clipanion-v3-codemod
Clipanion v2 to v3 codemod
clipanion-v3-codemod
is a Clipanion v2 to v3 codemod written with jscodeshift
. It can migrate most Clipanion v2 code, with a few exceptions (warnings will be emitted):
-
static schema
(andCommand.Schema
) - has to be manually migrated to Typanion - multiple option decorators on the same class property - this isn't supported by Clipanion v3
Features
- Transforms
Command.*
class property decorators intoOption.*
class property initializers - Transforms
Command.Path
decorators intostatic paths
- Transforms
Command.Entries.*
toBuiltins.*Command
- Transforms
Command.addPath
fallback usage into push calls to theCommand.paths
static property - Transforms
Command.addOption
fallback usage intoOption.*
initializers
Installation
Using Yarn:
yarn add clipanion-v3-codemod jscodeshift -D
Using npm:
npm install clipanion-v3-codemod jscodeshift -D
TypeScript type definitions are included out-of-the-box.
Usage
Using with Yarn:
yarn jscodeshift -t $(yarn node -p "require.resolve('clipanion-v3-codemod')") <path>
Using with npx:
npx jscodeshift -t $(node -p "require.resolve('clipanion-v3-codemod')") <path>