https://github.com/ijlee2/blueprints-v2-addon-output
Reference repo for updating blueprints-v2-addon (created by create-v2-addon-repo)
https://github.com/ijlee2/blueprints-v2-addon-output
codemod ember-codemod ember-polaris emberjs embroider
Last synced: 3 months ago
JSON representation
Reference repo for updating blueprints-v2-addon (created by create-v2-addon-repo)
- Host: GitHub
- URL: https://github.com/ijlee2/blueprints-v2-addon-output
- Owner: ijlee2
- License: mit
- Created: 2024-08-30T06:45:09.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-07T09:39:30.000Z (3 months ago)
- Last Synced: 2025-03-10T18:58:56.233Z (3 months ago)
- Topics: codemod, ember-codemod, ember-polaris, emberjs, embroider
- Language: TypeScript
- Homepage: https://github.com/ijlee2/embroider-toolbox
- Size: 91.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# blueprints-v2-addon
_Blueprints for v2 addons_
1. [Features](#features)
1. [Usage](#usage)
- [Install blueprints](#install-blueprints)
- [Create addon](#create-addon)
- [Create entity](#create-entity)
- [Remove entity](#remove-entity)
- [Update blueprints](#update-blueprints)
1. [Compatibility](#compatibility)
1. [License](#license)## Features
Standardize how you write v2 addons:
- Run `new` to create a v2 addon
- Run `generate` to create source and test files
- Run `destroy` to remove source and test files
- Blueprints available for components, helpers, modifiers, services, and utilities
- Tailor addon blueprints to your needs## Usage
### Install blueprints
Install `blueprints-v2-addon` as a development dependency in these locations:
Workspace root
```json5
/* package.json */
{
"scripts": {
"addon": "blueprints-v2-addon"
},
"devDependencies": {
"blueprints-v2-addon": "workspace:*"
}
}
```V2 addon in
packages
Note, the `new` command will automatically update `package.json`.
```json5
/* Example: packages/ui/form/package.json */
{
"scripts": {
"addon": "blueprints-v2-addon --test-app-location '../../../test-app'"
},
"devDependencies": {
"blueprints-v2-addon": "workspace:*"
}
}
```> [!NOTE]
>
> From the workspace root, please run `pnpm build; pnpm install` so that the blueprints are available.### Create addon
From the workspace root, run the `new` command to create a package in `packages`. The package will be added to `docs-app` and `test-app`.
```sh
pnpm addon new [options]# Example: Create the addon `ui-form`
pnpm addon new ui-form# Example: Specify the location for a scoped package
pnpm addon new @my-org-ui/form --location ui/form
```### Create entity
From the addon root, run the `generate` command to create the source code and its test file.
```sh
pnpm addon generate [options]# Example: Create a component
pnpm addon generate component ui/form/input# Example: Use alias
pnpm addon g component ui/form/textarea
```There may be more than 1 blueprint available. You can pass `--blueprint` to select the right one.
```sh
# Example: Create a tag component
pnpm addon g component ui/form/select --blueprint glimmer-strict
```For more information, pass `--help`.
### Remove entity
From the addon root, run the `destroy` command to remove the source code and its test file.
```sh
pnpm addon destroy# Example: Remove a component
pnpm addon destroy component ui/form/input# Example: Use alias
pnpm addon d component ui/form/textarea
```### Update blueprints
Get the latest blueprints from [`create-v2-addon-repo`](https://github.com/ijlee2/embroider-toolbox). The versions available for `--to` can be found at [`blueprints-v2-addon-output`](https://github.com/ijlee2/blueprints-v2-addon-output/releases).
```sh
# From this package root
pnpm update-blueprints --to 0.5.0
```## Compatibility
- Node.js v18 or above
## License
This project is licensed under the [MIT License](LICENSE.md).