-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(upgrade): add package.json update flow to cli #10388
feat(upgrade): add package.json update flow to cli #10388
Conversation
✔️ Deploy Preview for carbon-react-next ready! 🔨 Explore the source changes: b937687 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/61e1e4637300ab000749526e 😎 Browse the preview: https://deploy-preview-10388--carbon-react-next.netlify.app/ |
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: b937687 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/61e1e4639d39fc0007d7250d 😎 Browse the preview: https://deploy-preview-10388--carbon-elements.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: b937687 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/61e1e46343170b0009487237 😎 Browse the preview: https://deploy-preview-10388--carbon-components-react.netlify.app |
@@ -5,96 +5,112 @@ | |||
* LICENSE file in the root directory of this source tree. | |||
*/ | |||
|
|||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the use strict
be removed because this file is going through the esbuild
process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! Definitely
…190-add-upgrade-path-to-cli
…carbon into 10190-add-upgrade-path-to-cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 🎉
Closes #10190
This PR adds in an MVP for the Upgrade CLI to support various upgrade strategies. Currently, it supports previewing and writing changes made to a workspace's
package.json
file. In the future, it will also support running migrations for the updates in an upgrade path.Changelog
New
esbuild
to bundlepackages/upgrade
into a single executablecli.js
commands/upgrade.js
) contain all functionality for a command and have integration tests (and can have unit tests)Changed
cli.js
file inpackages/upgrade
.cjs
and.mjs
filesRemoved
Testing / Reviewing
cd packages/upgrade
yarn build
to build the CLIcd fixtures/sample-project
to use our sample project fixture../../bin/carbon-upgrade.js --help
to verify the CLI is up-and-running../../bin/carbon-upgrade.js
and choose an upgrade path. Verify the CLI does not change the file and shows a preview of the changes../../bin/carbon-upgrade.js -w
and choose an upgrade path. Verify the CLI edits the file locally (and discard the changes)