A tool for upgrading Carbon versions
To install @carbon/upgrade
in your project, you will need to run the following
command using npm:
npm install -S @carbon/upgrade
If you prefer Yarn, use the following command instead:
yarn add @carbon/upgrade
You can install @carbon/upgrade
in your project, or use a tool like
npx
by running the following command in your project:
npx @carbon/upgrade
Below is a full output of the options and commands available:
Usage: @carbon/upgrade [options]
Commands:
@carbon/upgrade upgrade upgrade your project [default]
@carbon/upgrade migrate <migration> run a Carbon migration on your
[paths...] source files
@carbon/upgrade migrate list list all available migrations
Options:
--help Show help [boolean]
--version Show version number [boolean]
--force force execution if the cli encounters an error while doing
safety checks [boolean] [default: false]
-w, --write update the files with changes found by running the migration
[boolean] [default: false]
-v, --verbose optionally include additional logs, useful for debugging
[boolean] [default: false]
Included within the CLI are a number of migrations available to you to be ran on your project's source files.
Migrations are automated scripts (codemods) ran using the jscodeshift runner, that will apply intelligent transformations to your code.
These migrations range from simple automations like a find and replace of import statements, to more sophisticated migrations that rewrite component prop usage, configuration, and set up. The source of these migrations can be viewed within the transforms folder. Each is tested against a series of test fixtures to ensure transforms are predictable and consistently provide the intended output.
The output of a codemod may not match your codebase's formatting style. It is recommended to always run the result of a codemod through an autoformatter like Prettier.
If you have ideas on how we could make your migration experience easier, please reach out by opening a new discussion.
We're always looking for contributors to help us fix bugs, build new features, or help us improve the project documentation. If you're interested, definitely check out our Contributing Guide! 👀
Licensed under the Apache 2.0 License.
This package uses IBM Telemetry to collect metrics data. By installing this package as a dependency you are agreeing to telemetry collection. To opt out, see Opting out of IBM Telemetry data collection. For more information on the data being collected, please see the IBM Telemetry documentation.