Codemod to add component signatures
npm install ember-codemod-add-component-signatures
_Codemod to add component signatures_
To introduce Glint, you will need to write the signature and template registry for each component. This can be an error-prone, onerous task for large projects.
You can run this codemod to get started.
- Scaffolds signature for components
- Adds template registry for components
- Supports tag components
Step 1. Quickly migrate.
``sh`
cd
npx ember-codemod-add-component-signatures
Step 2. Review the package.
- [x] Fill in missing type information.
- [x] Confirm that you can run all scripts in package.json.
For more information, please check the FAQ.
Must:
- Migrate to the Octane layout (flat or nested). You can leverage the codemods for classic and pod layouts.
Nice to do:
- Refactor code (e.g. Glimmerize components, meet the linting rule no-implicit-this) to help the codemod parse code.
You must pass --type to indicate what type of project you have.
`sh`
npx ember-codemod-add-component-signatures --type app
npx ember-codemod-add-component-signatures --type v1-addon
npx ember-codemod-add-component-signatures --type v2-addon
By default, an Octane project has the flat component structure. Pass --component-structure to indicate otherwise.
`sh`
npx ember-codemod-add-component-signatures --component-structure nested
*.{js,gjs} files
By default, the codemod ignores component classes written in .{js,gjs}. Pass --convert-javascript to allow the codemod to change the file extension to .{ts,gts} and add the component signature.
`sh`
npx ember-codemod-add-component-signatures --convert-javascript
Pass --root to run the codemod on a project somewhere else (i.e. not in the current directory).
`sh`
npx ember-codemod-add-component-signatures --root
The codemod is designed to cover typical cases. It is not designed to cover one-off cases. (Classic components are not supported.)
To better meet your needs, consider cloning the repo and running the codemod locally.
`sh
cd
- Node.js v20 or above
See the Contributing guide for details.
This project is licensed under the MIT License.