Skip to content

Commit

Permalink
Created introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Sep 16, 2023
1 parent 5db6910 commit e359f98
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ npx @codemod-utils/cli --name <your-codemod-name>
## Tutorials

- [Main tutorial: `ember-codemod-rename-test-modules`](./tutorials/ember-codemod-rename-test-modules/00-introduction.md)
- Tutorial for blueprints: `blueprint-for-v2-addon` (coming soon)
- [Tutorial for blueprints: `blueprint-for-v2-addon`](./tutorials/blueprint-for-v2-addon/00-introduction.md)


## Codemods written with @codemod-utils
Expand Down
31 changes: 31 additions & 0 deletions tutorials/blueprint-for-v2-addon/00-introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Introduction

[!IMPORTANT]
> 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.
>
> It's assumed that you have completed the [main tutorial](../ember-codemod-rename-test-modules/00-introduction.md).
We will partially implement `blueprint-for-v2-addon`, a codemod that helps [CLARK](https://www.clark.io/) create [v2 addons](https://rfcs.emberjs.com/id/0507-embroider-v2-package-format/). It creates files similarly to [`@embroider/addon-blueprint`](https://github.com/embroider-build/addon-blueprint), with some exceptions:

- We can easily standardize how we customize linter plugins and test apps.
- Upstream errors (from `ember-cli` and `@embroider/addon-blueprint`) affect little how we create v2 addons.
- Generating files is simpler and faster thanks to `@codemod-utils`.

```sh
# With @embroider/addon-blueprint
time EMBER_CLI_PNPM=true ember addon "@clark-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
```

```sh
# With blueprint-for-v2-addon
time pnpm generate-addon --addon-name "@clark-ui/button" --addon-location "ui/button"

1.86s user 0.23s system 133% cpu 1.565 total
```


## Table of contents

1. [Create a project](./01-create-a-project.md)

0 comments on commit e359f98

Please sign in to comment.