analyze-ember-project-dependencies
Analyze dependencies of an Ember project
- Why use it?
- Usage
- Compatibility
- Contributing
- License
Why use it?
Both Embroider and pnpm
ask that packages declare their dependencies correctly. The codemod (really, a linter) performs a static code analysis, so that you can easily find missing and unused dependencies.
For more information, see Fixing Package Dependencies.
Usage
Step 1. Run the codemod.
cd <path/to/your/project>
npx analyze-ember-project-dependencies
Step 2. Check the output for true positives.
Arguments
Optional: Specify the project root
Pass --root
to run the codemod somewhere else (i.e. not in the current directory).
npx ember-codemod-remove-inject-as-service --root <path/to/your/project>
Limitations
The codemod is designed to cover typical cases. It is not designed to cover one-off cases.
To better meet your needs, consider cloning the repo and running the codemod locally.
cd <path/to/cloned/repo>
pnpm build
./dist/bin/analyze-ember-project-dependencies.js --root <path/to/your/project>
[!IMPORTANT]
The codemod uses a list of entities called KNOWN_ENTITIES
to analyze implicit code. The list isn't meant to be exhaustive.
Please modify KNOWN_ENTITIES
to account for packages specific to your project.
src/utils/find-entities/known-entities.ts
const KNOWN_ENTITIES = new Map<PackageName, Partial<ProjectDataEntities>>([
[
'@ember/render-modifiers',
{
modifiers: ['did-insert', 'did-update', 'will-destroy'],
},
],
]);
export { KNOWN_ENTITIES };
Compatibility
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.