{"id":15015803,"url":"https://github.com/embroider-build/addon-blueprint","last_synced_at":"2025-04-05T14:06:33.809Z","repository":{"id":39517815,"uuid":"449437354","full_name":"embroider-build/addon-blueprint","owner":"embroider-build","description":"Blueprint for v2-formatted Ember addons","archived":false,"fork":false,"pushed_at":"2025-03-14T21:44:06.000Z","size":1020,"stargazers_count":30,"open_issues_count":30,"forks_count":28,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-29T13:08:13.523Z","etag":null,"topics":["addon","blueprint","ember","emberjs","hacktoberfest","javascript","lib","library","npm","package","project","scaffold","testing","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/embroider-build.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-18T20:29:56.000Z","updated_at":"2025-03-14T21:43:32.000Z","dependencies_parsed_at":"2023-10-10T18:12:03.363Z","dependency_job_id":"8df82f8f-5165-4e40-9751-cb5a9b5af2e0","html_url":"https://github.com/embroider-build/addon-blueprint","commit_stats":{"total_commits":414,"total_committers":33,"mean_commits":"12.545454545454545","dds":0.5603864734299517,"last_synced_commit":"6598c3c93a3425623074777e2b651d5c93e3e317"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embroider-build%2Faddon-blueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embroider-build%2Faddon-blueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embroider-build%2Faddon-blueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/embroider-build%2Faddon-blueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/embroider-build","download_url":"https://codeload.github.com/embroider-build/addon-blueprint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345852,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["addon","blueprint","ember","emberjs","hacktoberfest","javascript","lib","library","npm","package","project","scaffold","testing","typescript"],"created_at":"2024-09-24T19:47:57.249Z","updated_at":"2025-04-05T14:06:33.785Z","avatar_url":"https://github.com/embroider-build.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @embroider/addon-blueprint\n\nBlueprint for scaffolding ember v2 addons\n\nFor migrating a v1 addon to a v2 addon, you may follow _[Porting Addons to V2](https://github.com/embroider-build/embroider/blob/main/PORTING-ADDONS-TO-V2.md)_ and\nthis blog post [Migrating an Ember addon to the next-gen v2 format\n](https://www.kaliber5.de/de/blog/v2-addon_en).\n\n## WIP\n\nThis is still work in progress.\n\nThe blueprint contains a number of assumptions, e.g. using a monorepo using (`yarn` or `npm`) workspaces, with separate workspaces for the addon and the test-app. But there is plenty of room for bikeshedding here, so if you have suggestions about better ways to set this up, then please file an issue to discuss!\n\n## Usage\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --pnpm\n```\n\n### Options\n\nFor all these options, you'll see a warning printed from `ember-cli` about unsupported options.\n`ember-cli` doesn't have a way to detect if flags are used by a blueprint.\n\n#### `--pnpm`\n\nSets up the new addon with [`pnpm`](https://pnpm.io/) as a default package manager.\n\nExample:\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --pnpm\ncd my-addon\n```\n\n#### `--npm`\n\nSets up the new addon with `npm` as a default.\n\nExample:\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --npm\ncd my-addon\n```\n\n#### `--yarn`\n\nSets up the new addon with `yarn` as a default.\n\nExample:\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --yarn\ncd my-addon\n```\n\n#### `--addon-location`\n\nThe location / folder name of the addon can be customized via `--addon-location`.\n\nExamples:\n\n```bash\nember addon my-addon -b @embroider/addon-blueprint --addon-location=packages/the-addon\n# generates\n#   my-addon/packages/the-addon\n```\n\n#### `--test-app-location`\n\nThe location / folder name of the addon can be customized via `--test-app-location`.\n\nExamples:\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --test-app-location=test-app\n# generates\n#   my-addon/test-app\n```\n\nBy default, `{test app name}` will be used.\n\n#### `--test-app-name`\n\nThe name of the test-app can be customized via `--test-app-name`.\n\nExamples:\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --test-app-name=test-app-for-my-addon\n# generates\n#   my-addon/test-app-for-my-addon\n```\n\nBy default, `test-app` will be used.\n\n#### `--addon-only`\n\nWill only create the addon, similar to the v1 addon behavior of `ember addon my-addon`.\nThis is useful for incremental migrations of v1 addons to v2 addons where the process from the\n[Porting Addons to V2](https://github.com/embroider-build/embroider/blob/main/PORTING-ADDONS-TO-V2.md)\nguide.\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --addon-only\n# generates non-monorepo:\n#   my-addon/\n#     .git\n#     package.json\n```\n\nFor incremental migration in monorepos, you'll want to also supply the `--skip-git` flag.\n\n#### `--typescript`\n\nSets up the new addon with [`typescript`](https://www.typescriptlang.org/) support.\n\nExample:\n\n```bash\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint --typescript\n```\n\n### Updating the addon\n\nThe blueprint supports `ember-cli-update` to update your addon with any changes that occurred in the blueprint since you created the addon. So to update your addons boilerplate, simply run `ember-cli-update` (or `npx ember-cli-update` if you haven't installed it globally).\n\nFor additional instructions, please consult its [documentation](https://github.com/ember-cli/ember-cli-update).\n\n### In existing monorepos\n\nTo generate a new v2 addon inside an existing monorepo, `cd` to that repo's directory and run the command as usual. The blueprint will auto-detect an existing `package.json` and adapt to it. Specifically it will not create or override any files at the root folder, like the `package.json` itself.\n\nMost likely though you would not want to use the default locations for the addon and the test app. Instead you should establish a convention how multiple addons and test-apps are located. With the aforementioned path options you can then make the blueprint emit the packages in the correct place.\n\nSome more things to pay attention to:\n\n- Pass the package manager option ( `--npm`, `--yarn`, `--pnpm`) that you already use!\n- Make sure that the chosen addon and test-app locations are all covered by the configured workspace layout of your package manager!\n- Each package should have a distinct name, so make provide unique names for your test apps instead of the default `test-app` by using the `--test-app-name` option.\n- There is no `start` script at the root `package.json` anymore to start both the addon's build and the test app in watch mode. So you would have to run that `start` script with your package manager in both locations in parallel (separate terminal windows/tabs).\n- Pass the `skip-git` option to not auto-commit the generated files. Most likely there will be things to adapt to you specific requirements before committing.\n- The blueprint will omit all files usually generated at the root folder, including `.prettierrc.js`, and instead use whatever you have already defined in your existing monorepo. So you should run the `lint:fix` script for both the addon and the test-app, and eventually address any non-fixable linting issues or other configuration conventions related to your specific setup.\n\nSome examples...\n\n#### Group by name\n\nWe group by the name of the addon, the addon's package and its test app are co-located sub-folders:\n\n```\nproject-monorepo\n└── addons\n    ├── my-addon\n    │   ├── package\n    │   └── test-app\n    └── ...\n```\n\n[//]: # 'to edit this: https://tree.nathanfriend.io/?s=(%27options!(%27fancy!true~fullPath3~trailingSlash3~rootDot3)~4(%274%27project-monorepo02addons05my-addon0*5package0*5test-app05...%27)~version!%271%27)*%20%200%5Cn5-%203!false4source!5*2%0154320*'\n\nTo generate this run:\n\n```bash\ncd project-monorepo\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint \\\n  --skip-git \\\n  --skip-npm \\\n  --addon-location=\"addons/my-addon/package\" \\\n  --test-app-name=\"test-app-for-my-addon\" \\\n  --test-app-location=\"addons/my-addon/test-app\"\n```\n\n#### Group by type\n\nAddons and test-apps are separated:\n\n```\nproject-monorepo\n├── addons\n│   ├── my-addon\n│   └── ...\n└── tests\n    ├── my-addon\n    └── ...\n```\n\n[//]: # 'to edit this: https://tree.nathanfriend.io/?s=(%27options!(%27fancy!true~fullPath2~trailingSlash2~rootDot2)~5(%275%27project-monorepo04738904test39%27)~version!%271%27)*0640862!false3s*my-74-%205source!6%20%207addon8%5Cn9*...%01987654320*'\n\nTo generate this run:\n\n```bash\ncd project-monorepo\nnpx ember-cli@latest addon my-addon -b @embroider/addon-blueprint \\\n  --skip-git \\\n  --skip-npm \\\n  --addon-location=\"addons/my-addon\" \\\n  --test-app-name=\"test-app-for-my-addon\" \\\n  --test-app-location=\"tests/my-addon\"\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembroider-build%2Faddon-blueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fembroider-build%2Faddon-blueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fembroider-build%2Faddon-blueprint/lists"}