{"id":47703,"library":"forest-codemod","title":"Forest Codemod","description":"Forest Codemod is a tool for automated migration of ForestAdmin agent configurations, currently at version 1.0.0-beta.1. It is designed to assist in transitioning between major ForestAdmin agent versions by applying codemod transformations. The package is in beta, meaning APIs may change. It differentiates itself by focusing specifically on ForestAdmin agent migrations, providing a streamlined CLI experience for developers upgrading their ForestAdmin backend setups.","status":"active","version":"1.0.0-beta.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install forest-codemod","lang":"bash","label":"npm"},{"cmd":"yarn add forest-codemod","lang":"bash","label":"yarn"},{"cmd":"pnpm add forest-codemod","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core transformation engine","package":"jscodeshift","optional":false}],"imports":[{"note":"ESM-only package since v1.0.0-beta.1","wrong":"const forestCodemod = require('forest-codemod')","symbol":"default","correct":"import forestCodemod from 'forest-codemod'"},{"note":"Named export for class-based usage","wrong":"import ForestCodemod from 'forest-codemod'","symbol":"ForestCodemod","correct":"import { ForestCodemod } from 'forest-codemod'"},{"note":"Utility function for programmatic migration","wrong":null,"symbol":"runMigration","correct":"import { runMigration } from 'forest-codemod'"}],"quickstart":{"code":"import { runMigration } from 'forest-codemod';\nimport path from 'path';\n\nconst config = {\n  source: path.resolve('./agent-config.js'),\n  dest: path.resolve('./agent-config-v2.js'),\n  transform: 'v1-to-v2',\n};\n\nrunMigration(config)\n  .then(() => {\n    console.log('Migration completed successfully');\n  })\n  .catch((err) => {\n    console.error('Migration failed:', err);\n  });","lang":"typescript","description":"Demonstrates programmatic migration of a ForestAdmin agent configuration file from v1 to v2 using the runMigration function."},"warnings":[{"fix":"Replace 'v1-to-v2' with 'upgrade-v1' in the transform option.","message":"The 'transform' option 'v1-to-v2' is deprecated and will be removed in version 2.0.0. Use 'upgrade-v1' instead.","severity":"deprecated","affected_versions":">=1.0.0-beta.1 <1.3.0"},{"fix":"Ensure both 'source' and 'dest' are provided when calling runMigration.","message":"The 'source' and 'dest' options are now required. In older beta versions, they were optional and defaulted to current directory.","severity":"breaking","affected_versions":">=1.0.0-beta.1"},{"fix":"Always set the 'dest' option to a different file path.","message":"The codemod modifies files in-place if 'dest' is not specified. Always provide a 'dest' to prevent data loss.","severity":"gotcha","affected_versions":">=1.0.0-beta.1"}],"env_vars":null,"search_vec":"'1.0.0':18 'agent':13,30,53 'api':42 'appli':33 'assist':24 'autom':9 'backend':65 'beta':40 'beta.1':19 'chang':44 'cli':58 'codemod':2,4,34 'configur':14 'current':15 'design':22 'develop':61 'differenti':46 'experi':59 'focus':49 'forest':1,3 'forestadmin':12,29,52,64 'javascript':67 'major':28 'may':43 'mean':41 'migrat':10,54 'packag':37 'provid':55 'setup':66 'specif':50 'streamlin':57 'tool':7 'transform':35 'transit':26 'upgrad':62 'version':17,31","created_at":"2026-06-07T16:52:52.685481+00:00","updated_at":"2026-06-07T16:52:52.685481+00:00","problems":[{"fix":"npm install jscodeshift --save-dev","cause":"jscodeshift is a peer dependency not installed","error":"Error: Cannot find module 'jscodeshift'"},{"fix":"Use 'import { runMigration } from 'forest-codemod''","cause":"Importing incorrectly, using default import instead of named import","error":"TypeError: runMigration is not a function"},{"fix":"Use 'upgrade-v1' instead","cause":"Using deprecated transform name that has been removed","error":"Error: Unknown transform 'v1-to-v2'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"forest-codemod","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}