Upgrade scripts for Comet DXP
npx @comet/upgrade <target-version>
For example:
npx @comet/upgrade v4
-
Start the development process:
npm start
-
Add a new script for the version you want to upgrade to, for instance,
src/v4/change-something.ts
. The script must have a function as default export that performs the changes. See src/v4/remove-clear-types-script.ts for an example. -
Test the upgrade script
Navigate to the project you want to upgrade:
cd project-you-want-to-upgrade/
Create a new branch to test the script:
git checkout -b upgrade-comet-to-4
Execute the local @comet/upgrade binary:
../comet-upgrade/bin/index.js 4 # comet-upgrade directory
Verify the changes in your project. If something is not as expected, adapt the upgrade script accordingly and then run it again on a clean state:
git reset --hard HEAD ../comet-upgrade/bin/index.js 4