Important
Please complete the main tutorial first.
Note
This tutorial covers blueprints, files that you can use like a "stamp" to create or update certain files in a project. You will also learn how to transform a user's CLI options in the create-options
step.
We will partially recreate blueprints-v2-addon
, a codemod that helps you write v2 addons. It creates an addon and a test app similarly to @embroider/addon-blueprint
, with some exceptions:
- We can customize files, lint configurations, and dependencies, and standardize these deviations.
- Upstream errors (from
ember-cli
and@embroider/addon-blueprint
) have a little effect. - Generating files is simpler and faster.
# Average for @embroider/addon-blueprint
❯ time EMBER_CLI_PNPM=true ember addon "@my-ui/button" --addon-location "ui/button" --blueprint "@embroider/addon-blueprint" --pnpm --skip-npm --typescript
1.87s user 1.18s system 126% cpu 2.409 total
# Average for blueprints-v2-addon
❯ time pnpm generate-addon --addon-name "@my-ui/button" --addon-location "ui/button"
1.86s user 0.23s system 133% cpu 1.565 total