Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paul-soporan/clipanion-v3-codemod
Clipanion v2 to v3 codemod
https://github.com/paul-soporan/clipanion-v3-codemod
clipanion codemod
Last synced: 19 days ago
JSON representation
Clipanion v2 to v3 codemod
- Host: GitHub
- URL: https://github.com/paul-soporan/clipanion-v3-codemod
- Owner: paul-soporan
- License: mit
- Created: 2021-01-28T15:02:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-13T17:36:22.000Z (over 3 years ago)
- Last Synced: 2024-12-08T09:34:11.629Z (27 days ago)
- Topics: clipanion, codemod
- Language: TypeScript
- Homepage:
- Size: 47.1 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - clipanion-v3-codemod - soporan | 2 | (TypeScript)
README
clipanion-v3-codemod
Clipanion v2 to v3 codemod---
`clipanion-v3-codemod` is a [Clipanion](https://github.com/arcanis/clipanion) v2 to v3 codemod written with [`jscodeshift`](https://github.com/facebook/jscodeshift). It can migrate most Clipanion v2 code, with a few exceptions (warnings will be emitted):
- `static schema` (and `Command.Schema`) - has to be manually migrated to [Typanion](https://github.com/arcanis/typanion/)
- multiple option decorators on the same class property - this isn't supported by Clipanion v3## Features
- Transforms `Command.*` class property decorators into `Option.*` class property initializers
- Transforms `Command.Path` decorators into `static paths`
- Transforms `Command.Entries.*` to `Builtins.*Command`
- Transforms `Command.addPath` fallback usage into push calls to the `Command.paths` static property
- Transforms `Command.addOption` fallback usage into `Option.*` 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')") `
Using with npx:
`npx jscodeshift -t $(node -p "require.resolve('clipanion-v3-codemod')") `