Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/stable' into merge-stable
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/addon-dev/src/rollup-public-assets.ts
#	packages/shared-internals/src/index.ts
#	pnpm-lock.yaml
  • Loading branch information
mansona committed Apr 10, 2024
2 parents ea2a455 + e874289 commit f4ad24c
Show file tree
Hide file tree
Showing 25 changed files with 2,215 additions and 340 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
# github-changelog can discover what's changed since the last release
with:
fetch-depth: 0
ref: 'main'
- uses: ./.github/actions/setup
with:
use_pinned_node: true
Expand All @@ -57,17 +58,17 @@ jobs:
run: |
set +e
pnpm release-plan prepare 2> >(tee -a stderr.log >&2)
pnpm release-plan prepare 2> >(tee -a stderr.txt >&2)
if [ $? -ne 0 ]; then
echo 'text<<EOF' >> $GITHUB_OUTPUT
cat stderr.log >> $GITHUB_OUTPUT
cat stderr.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
else
echo 'text<<EOF' >> $GITHUB_OUTPUT
jq .description .release-plan.json -r >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
rm stderr.txt
fi
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- main

concurrency:
group: publish-stable-${{ github.head_ref || github.ref }}
group: publish-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: npm publish
run: pnpm release-plan publish --publish-branch=stable
run: pnpm release-plan publish

env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
Expand Down
63 changes: 49 additions & 14 deletions .release-plan.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"solution": {
"@embroider/addon-dev": {
"oldVersion": "4.2.1"
"impact": "minor",
"oldVersion": "4.2.1",
"newVersion": "4.3.0",
"constraints": [
{
"impact": "minor",
"reason": "Appears in changelog section :rocket: Enhancement"
}
],
"pkgJSONPath": "./packages/addon-dev/package.json"
},
"@embroider/addon-shim": {
"oldVersion": "1.8.7"
Expand All @@ -11,21 +20,29 @@
},
"@embroider/compat": {
"impact": "patch",
"oldVersion": "3.4.4",
"newVersion": "3.4.5",
"oldVersion": "3.4.6",
"newVersion": "3.4.7",
"constraints": [
{
"impact": "patch",
"reason": "Has dependency `workspace:*` on @embroider/macros"
},
{
"impact": "patch",
"reason": "Appears in changelog section :house: Internal"
}
],
"pkgJSONPath": "./packages/compat/package.json"
},
"@embroider/core": {
"impact": "patch",
"oldVersion": "3.4.4",
"newVersion": "3.4.5",
"oldVersion": "3.4.6",
"newVersion": "3.4.7",
"constraints": [
{
"impact": "patch",
"reason": "Has dependency `workspace:*` on @embroider/shared-internals"
},
{
"impact": "patch",
"reason": "Has dependency `workspace:*` on @embroider/macros"
Expand All @@ -37,13 +54,13 @@
"oldVersion": "3.0.3"
},
"@embroider/macros": {
"impact": "minor",
"oldVersion": "1.13.5",
"newVersion": "1.14.0",
"impact": "patch",
"oldVersion": "1.15.0",
"newVersion": "1.15.1",
"constraints": [
{
"impact": "minor",
"reason": "Appears in changelog section :rocket: Enhancement"
"impact": "patch",
"reason": "Has dependency `workspace:*` on @embroider/shared-internals"
}
],
"pkgJSONPath": "./packages/macros/package.json"
Expand All @@ -55,20 +72,38 @@
"oldVersion": "2.1.6"
},
"@embroider/shared-internals": {
"oldVersion": "2.5.2"
"impact": "minor",
"oldVersion": "2.5.2",
"newVersion": "2.6.0",
"constraints": [
{
"impact": "minor",
"reason": "Appears in changelog section :rocket: Enhancement"
}
],
"pkgJSONPath": "./packages/shared-internals/package.json"
},
"@embroider/test-setup": {
"oldVersion": "3.0.3"
},
"@embroider/util": {
"oldVersion": "1.12.1"
"oldVersion": "1.13.0"
},
"@embroider/vite": {
"oldVersion": "0.2.0"
},
"@embroider/webpack": {
"oldVersion": "3.2.2"
"impact": "patch",
"oldVersion": "3.2.2",
"newVersion": "3.2.3",
"constraints": [
{
"impact": "patch",
"reason": "Has dependency `workspace:*` on @embroider/shared-internals"
}
],
"pkgJSONPath": "./packages/webpack/package.json"
}
},
"description": "## Release (2024-02-28)\n\n@embroider/compat 3.4.5 (patch)\n@embroider/core 3.4.5 (patch)\n@embroider/macros 1.14.0 (minor)\n\n#### :rocket: Enhancement\n* `@embroider/macros`\n * [#1815](https://github.com/embroider-build/embroider/pull/1815) Make macro configs static ([@simonihmig](https://github.com/simonihmig))\n\n#### :house: Internal\n* Other\n * [#1824](https://github.com/embroider-build/embroider/pull/1824) update release-plan ([@mansona](https://github.com/mansona))\n* `@embroider/test-scenarios`\n * [#1820](https://github.com/embroider-build/embroider/pull/1820) [stable] Pin ember-data to fix issue in CI ([@simonihmig](https://github.com/simonihmig))\n\n#### Committers: 2\n- Chris Manson ([@mansona](https://github.com/mansona))\n- Simon Ihmig ([@simonihmig](https://github.com/simonihmig))\n"
"description": "## Release (2024-04-10)\n\n@embroider/addon-dev 4.3.0 (minor)\n@embroider/compat 3.4.7 (patch)\n@embroider/core 3.4.7 (patch)\n@embroider/macros 1.15.1 (patch)\n@embroider/shared-internals 2.6.0 (minor)\n@embroider/webpack 3.2.3 (patch)\n\n#### :rocket: Enhancement\n* `@embroider/addon-dev`, `@embroider/shared-internals`, `@embroider/test-scenarios`\n * [#1856](https://github.com/embroider-build/embroider/pull/1856) Compile Hbs route templates correctly ([@BlueCutOfficial](https://github.com/BlueCutOfficial))\n* `@embroider/addon-dev`, `@embroider/test-scenarios`\n * [#1867](https://github.com/embroider-build/embroider/pull/1867) add a namespace option for public-assets plugin ([@mansona](https://github.com/mansona))\n\n#### :house: Internal\n* Other\n * [#1871](https://github.com/embroider-build/embroider/pull/1871) fix release-plan unlabelled changes PR ([@mansona](https://github.com/mansona))\n * [#1869](https://github.com/embroider-build/embroider/pull/1869) update release plan ([@mansona](https://github.com/mansona))\n* `@embroider/compat`, `@embroider/test-scenarios`\n * [#1806](https://github.com/embroider-build/embroider/pull/1806) resolver transform to emit imports for helper and modifiers that need… ([@void-mAlex](https://github.com/void-mAlex))\n\n#### Committers: 3\n- Alex ([@void-mAlex](https://github.com/void-mAlex))\n- Chris Manson ([@mansona](https://github.com/mansona))\n- Marine Dunstetter ([@BlueCutOfficial](https://github.com/BlueCutOfficial))\n"
}
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Embroider Changelog

## Release (2024-04-10)

@embroider/addon-dev 4.3.0 (minor)
@embroider/compat 3.4.7 (patch)
@embroider/core 3.4.7 (patch)
@embroider/macros 1.15.1 (patch)
@embroider/shared-internals 2.6.0 (minor)
@embroider/webpack 3.2.3 (patch)

#### :rocket: Enhancement
* `@embroider/addon-dev`, `@embroider/shared-internals`, `@embroider/test-scenarios`
* [#1856](https://github.com/embroider-build/embroider/pull/1856) Compile Hbs route templates correctly ([@BlueCutOfficial](https://github.com/BlueCutOfficial))
* `@embroider/addon-dev`, `@embroider/test-scenarios`
* [#1867](https://github.com/embroider-build/embroider/pull/1867) add a namespace option for public-assets plugin ([@mansona](https://github.com/mansona))

#### :house: Internal
* Other
* [#1871](https://github.com/embroider-build/embroider/pull/1871) fix release-plan unlabelled changes PR ([@mansona](https://github.com/mansona))
* [#1869](https://github.com/embroider-build/embroider/pull/1869) update release plan ([@mansona](https://github.com/mansona))
* `@embroider/compat`, `@embroider/test-scenarios`
* [#1806](https://github.com/embroider-build/embroider/pull/1806) resolver transform to emit imports for helper and modifiers that need… ([@void-mAlex](https://github.com/void-mAlex))

#### Committers: 3
- Alex ([@void-mAlex](https://github.com/void-mAlex))
- Chris Manson ([@mansona](https://github.com/mansona))
- Marine Dunstetter ([@BlueCutOfficial](https://github.com/BlueCutOfficial))

## Release (2024-03-07)

@embroider/compat 3.4.6 (patch)
@embroider/core 3.4.6 (patch)
@embroider/macros 1.15.0 (minor)
@embroider/util 1.13.0 (minor)

#### :rocket: Enhancement
* `@embroider/macros`, `@embroider/util`
* [#1832](https://github.com/embroider-build/embroider/pull/1832) Update to `ember-cli-babel` v8 ([@bertdeblock](https://github.com/bertdeblock))

#### :bug: Bug Fix
* `@embroider/macros`
* [#1838](https://github.com/embroider-build/embroider/pull/1838) make sure @embroider/macros doesn't try to load a babel config ([@mansona](https://github.com/mansona))

#### Committers: 2
- Bert De Block ([@bertdeblock](https://github.com/bertdeblock))
- Chris Manson ([@mansona](https://github.com/mansona))

## Release (2024-02-28)

@embroider/compat 3.4.5 (patch)
Expand Down
30 changes: 29 additions & 1 deletion docs/v2-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* [Why do v2 addons need a build step?](#why-do-v2-addons-need-a-build-step)
* [How can I integrate with the app's build?](#how-can-i-integrate-with-the-apps-build)
* [How can I define the public exports of my addon?](#how-can-i-define-the-public-exports-of-my-addon)
* [How can I provide route templates with my v2 addon?](#how-can-i-provide-route-templates-with-my-v2-addon)

<!-- tocstop -->

Expand Down Expand Up @@ -141,7 +142,8 @@ This is done by adding some meta data to the addon's `package.json`, specifying
}
```

If you have many files you want to expose this way, you can instead add the `addon.publicAssets()` plugin from `@embroider/addon-dev` to your Rollup config to automate the generation of this mapping data.
If you have many files you want to expose this way, you can instead add the `addon.publicAssets()` plugin from `@embroider/addon-dev` to your Rollup config to automate the generation of this mapping data. This rollup plugin will automatically prefix your public assets with a folder name that matches your addon packages name, this is to prevent any name clashes between addons. You can read more about it in the docs for the addon-dev rollup plugin utilities https://github.com/embroider-build/embroider/tree/main/packages/addon-dev#rollup-utilities


## Build setup

Expand Down Expand Up @@ -195,3 +197,29 @@ Additionally, there is a feature supported in node.js and modern bundlers to def
When using `package.json#exports` make sure that:
- the `addon.publicEntrypoints(...)` plugin in `rollup.config.mjs` includes _at least_ whatever is defined in `package.json#exports`
- the modules that `addon.appReexports(...)` exposes must have overlap with the `package.json#exports` so that the app-tree merging may import from the addon

### How can I provide route templates with my v2 addon?

During a v2 addon build step, standalone `.hbs` are considered template-only components by default.

If you want your v2 addon to provide a route template, the best way to proceed is to make it a `.gjs` file using [ember-route-template](https://github.com/discourse/ember-route-template). Similarly, if you want to migrate to v2 a classic addon that used to provide `.hbs` route templates, you should refactor the `.hbs` to `.gjs` files to complete the migration.

If for whatever reason the `.gjs` approach cannot be used, it's still possible to have your v2 addon providing the route templates as `.hbs`, but it requires extra configuration. During the build step, Rollup and Babel work together to transform all standalone `.hbs` into template-only components. Therefore, you need to tell both Rollup and Babel to _not_ compile a given list of `.hbs` files this way.

Let's assume your addon has a `templates/` folder that contains all your route templates. The files in `templates/` should be compiled as simple templates (not template-only components).

In the `rollup.config.mjs`, pass a list of glob patterns in the `excludeColocation` option of the function `addon.hbs`:

```js
addon.hbs({ excludeColocation: ['templates/**/*'] }),
```

In the `babel.config.json`, pass the same list of glob patterns in the `exclude` option of the `template-colocation-plugin`:

```
"plugins": [
["@embroider/addon-dev/template-colocation-plugin", {
exclude: ['templates/**/*']
}],
],
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.2.1",
"prettier": "^2.3.1",
"release-plan": "^0.8.0",
"release-plan": "^0.9.0",
"typescript": "^5.1.6"
},
"publishConfig": {
Expand Down
4 changes: 4 additions & 0 deletions packages/addon-dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ For a guide on porting a V1 addon to V2, see https://github.com/embroider-build/
2. Copy the `./sample-rollup.config.js` in this repo to your own `rollup.config.js`.
3. Copy the `./sample-babel.config.json` in this repo to your own `babel.config.json`.

### addon.publicAssets(path <required>, options)

A rollup plugin to expose a folder of assets. `path` is a required to define which folder to expose. `options.include` is a glob pattern passed to `walkSync.include` to pick files. `options.exlude` is a glob pattern passed to `walkSync.ignore` to exclude files. `options.namespace` is the namespace to expose files, defaults to the package name

## addon-dev command

The `addon-dev` command helps with common tasks in v2 addons.
Expand Down
2 changes: 1 addition & 1 deletion packages/addon-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@embroider/addon-dev",
"version": "4.2.1",
"version": "4.3.0",
"description": "Utilities for addon authors",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit f4ad24c

Please sign in to comment.