Skip to content

Commit

Permalink
Helped consumers get the latest blueprints
Browse files Browse the repository at this point in the history
  • Loading branch information
ijlee2 committed Aug 30, 2024
0 parents commit bcdfd97
Show file tree
Hide file tree
Showing 221 changed files with 4,452 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# compiled output
/dist/
/dist-for-testing/
/tmp/

# dependencies
/node_modules/

# misc
!.*
.*/
/src/blueprints/
/tests/fixtures/
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

require('@shared-configs/eslint-config-node/patch');

module.exports = {
extends: ['@shared-configs/eslint-config-node/typescript'],
overrides: [
{
files: ['bin/**/*.{js,ts}', 'update-blueprints.js'],
rules: {
'n/hashbang': 'off',
},
},
],
};
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# compiled output
/dist/
/dist-for-testing/
/tmp/

# dependencies
/node_modules/

# misc
/.DS_Store
/.env*
/.eslintcache
/npm-debug.log*
/pnpm-debug.log*
/pnpm-error.log*
23 changes: 23 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# compiled output
/dist-for-testing/
/tmp/

# dependencies
/node_modules/

# misc
/.DS_Store
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.cjs
/.git/
/.github/
/.gitignore
/.pnpm-debug.log
/.prettierignore
/.prettierrc.cjs
/build.sh
/tests/
/update-blueprints.js
/update-test-fixtures.sh
3 changes: 3 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require('@shared-configs/prettier');
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# blueprints-v2-addon

## 0.1.0

### Minor Changes

- [#35](https://github.com/ijlee2/embroider-toolbox/pull/35) Helped consumers get the latest blueprints ([@ijlee2](https://github.com/ijlee2))
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2024 Isaac J. Lee

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
147 changes: 147 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# 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:

<details>

<summary>Workspace root</summary>

```json5
/* package.json */
{
"scripts": {
"addon": "blueprints-v2-addon"
},
"devDependencies": {
"blueprints-v2-addon": "workspace:*"
}
}
```

</details>

<details>

<summary>V2 addon in <code>packages</code></summary>

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:*"
}
}
```

</details>

> [!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 <name> [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 <component|helper|modifier|service|util> <name> [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 <template> 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 <component|helper|modifier|service|util> <name>

# 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 [`embroider-toolbox`](https://github.com/ijlee2/embroider-toolbox).

```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).
Loading

0 comments on commit bcdfd97

Please sign in to comment.