-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,90 @@ | |
|
||
# @codemod-utils/cli | ||
|
||
_CLI for @codemod-utils_ | ||
_CLI to create a codemod project_ | ||
|
||
|
||
## Usage | ||
|
||
Use `npx` to run `@codemod-utils/cli`. (Alternatively, you can install `@codemod-utils/cli` globally.) | ||
|
||
```sh | ||
npx @codemod-utils/cli --name <your-codemod-name> <additional arguments> | ||
``` | ||
|
||
This will create a folder named `<your-codemod-name>`, inside of which you can find the package named `<your-codemod-name>`. | ||
|
||
Change the directory, then run these scripts: | ||
|
||
```sh | ||
# Set up the project | ||
pnpm install | ||
|
||
# Create a GitHub repository | ||
git init | ||
git add . | ||
git commit -m "Initial commit" | ||
git branch -M main | ||
git remote add origin [email protected]:<your-GitHub-handle>/<your-repo-name>.git | ||
git push -u origin main | ||
``` | ||
|
||
|
||
### Arguments | ||
|
||
You must pass `--name` to name your codemod. | ||
|
||
```sh | ||
npx @codemod-utils/cli --name ember-codemod-v1-to-v2 | ||
``` | ||
|
||
|
||
<details> | ||
<summary>Optional: Add <code>@codemod-utils</code> packages</summary> | ||
|
||
By default, `@codemod-utils/cli` installs only [`@codemod-utils/files`](../files/README.md) and [`@codemod-utils/tests`](../tests/README.md). | ||
|
||
To add more `@codemod-utils` packages and scaffold files, pass `--addon` and a list of package names. | ||
|
||
```sh | ||
npx @codemod-utils/cli --addon blueprints | ||
``` | ||
|
||
The available package names are: | ||
|
||
- [`ast-javascript`](../ast/javascript/README.md) | ||
- [`ast-template`](../ast/template/README.md) | ||
- [`blueprints`](../blueprints/README.md) | ||
- [`ember-cli-string`](../ember-cli-string/README.md) | ||
- [`json`](../json/README.md) | ||
|
||
</details> | ||
|
||
|
||
<details> | ||
<summary>Optional: Specify the project root</summary> | ||
|
||
Pass `--root` to run the codemod somewhere else (i.e. not in the current directory). | ||
|
||
```sh | ||
npx @codemod-utils/cli --root=<path/to/your/project> | ||
``` | ||
|
||
</details> | ||
|
||
|
||
<details> | ||
<summary>Optional: Create a JavaScript project</summary> | ||
|
||
By default, `@codemod-utils/cli` creates a TypeScript project to help you (and contributors) maintain and extend the codemod. | ||
|
||
Pass `--typescript` to opt out. | ||
|
||
```sh | ||
npx @codemod-utils/cli --typescript false | ||
``` | ||
|
||
</details> | ||
|
||
|
||
## Compatibility | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters