Skip to content

Commit c29d370

Browse files
chore: version packages (#203)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## create-helix@0.9.3 ### Patch Changes - 5d76233: Wire `@helixui/tokens@3.x` into the Drupal scaffold (v0.9.3) v0.9.2 deliberately left every Drupal preset pinned to `@helixui/tokens@^0.2.0` with carve-outs in `doctor` + `upgrade` so they wouldn't push Drupal scaffolds onto an unverified 3.x contract. Investigating that work for v0.9.3 surfaced a deeper latent bug: the Drupal scaffold has **always** declared `@helixui/tokens` as a dependency but **never** loaded its CSS, so every `var(--hx-*, fallback)` reference in the generated theme silently resolved to its inline fallback instead of the upstream brand token. v0.9.3 closes that loop for **fresh** Drupal scaffolds: - The generated `{theme}.libraries.yml` declares a dedicated `helix-tokens` library that loads `css/vendor/helix-tokens.css` at `weight: -200`, and `global` depends on it — tokens are in place before any theme CSS that references them loads. - The generated `css/style.css` `@import`s `vendor/helix-tokens.css` FIRST, ahead of `helix-responsive.css` and `helix-overrides.css`. Cascade order is: upstream tokens → responsive defaults → consumer overrides. - **`css/vendor/helix-tokens.css` is vendored at SCAFFOLD time from a BUILD-TIME-BUNDLED copy.** `scripts/add-shebang.mjs` runs at every create-helix build and copies `@helixui/tokens/dist/tokens.css` into `dist/assets/helix-tokens.css`. The published tarball ships that fixed copy, and `scaffoldDrupalTheme` reads from it at scaffold time. This makes the scaffold output deterministic per create-helix release — the same create-helix version always emits the same bytes, independent of how the installer's npm/pnpm/yarn resolves transitive deps. (A fallback to runtime `require.resolve` of the package's exported CSS subpaths covers vitest tests against `src/`, where the dist artifact doesn't exist.) Scaffold-time vendoring also matters because Drupal theme users typically don't run `npm install` inside the theme directory — the documented setup is `cp -r theme/` + `drush theme:enable`, neither of which fires a Node install. - The scaffold also emits `scripts/copy-helix-tokens.mjs` and wires it to the `package.json` postinstall hook. This is the REFRESH path: when a developer does run `npm install` in the theme and gets a different `@helixui/tokens` version, the vendored copy is kept in sync. The script resolves `@helixui/tokens` via Node module resolution (`createRequire` + `require.resolve` of the exported CSS subpaths — NOT `package.json`, which `@helixui/tokens@3.x`'s exports map doesn't publish), so hoisted/workspace installs work the same as flat ones. - `src/presets/loader.ts` now imports `HELIX_TOKENS_VERSION` from `helix-versions.ts` — Drupal joins every framework template on the centralized pin (`^3.9.1`). `create-helix`'s own `@helixui/tokens` dependency is bumped to the same range (and both lockfiles refreshed) so the build-time bundling picks up the 3.9.1 bytes. **`doctor` and `upgrade` exempt `@helixui/tokens` for ALL Drupal scaffolds in this release.** The runtime token layer for any Drupal theme is `css/vendor/helix-tokens.css`, not the declared range in `package.json` or the contents of `node_modules/@helixui/tokens`. Bumping the pin alone would advance the declaration while the theme keeps serving stale token bytes (the documented `cp -r theme/` + `drush theme:enable` flow doesn't run `npm install`, so the theme's postinstall script never fires to refresh the vendored CSS). No honest `@helixui/tokens` upgrade exists for an existing Drupal theme yet, so both checks skip it. The v0.9.4 follow-up will make `runUpgrade` Drupal-theme-aware — refresh `css/vendor/helix-tokens.css` from create-helix's bundled copy and, for pre-v0.9.3 themes, also inject the wiring files (`scripts/copy-helix-tokens.mjs`, the `helix-tokens` library entry, the `style.css` `@import`). At that point the skips can be dropped entirely. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 5d76233 commit c29d370

3 files changed

Lines changed: 66 additions & 66 deletions

File tree

.changeset/drupal-tokens-3x-migration.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
11
# create-helix
22

3+
## 0.9.3
4+
5+
### Patch Changes
6+
7+
- 5d76233: Wire `@helixui/tokens@3.x` into the Drupal scaffold (v0.9.3)
8+
9+
v0.9.2 deliberately left every Drupal preset pinned to `@helixui/tokens@^0.2.0`
10+
with carve-outs in `doctor` + `upgrade` so they wouldn't push Drupal
11+
scaffolds onto an unverified 3.x contract. Investigating that work for
12+
v0.9.3 surfaced a deeper latent bug: the Drupal scaffold has **always**
13+
declared `@helixui/tokens` as a dependency but **never** loaded its CSS,
14+
so every `var(--hx-*, fallback)` reference in the generated theme silently
15+
resolved to its inline fallback instead of the upstream brand token.
16+
17+
v0.9.3 closes that loop for **fresh** Drupal scaffolds:
18+
- The generated `{theme}.libraries.yml` declares a dedicated `helix-tokens`
19+
library that loads `css/vendor/helix-tokens.css` at `weight: -200`, and
20+
`global` depends on it — tokens are in place before any theme CSS that
21+
references them loads.
22+
- The generated `css/style.css` `@import`s `vendor/helix-tokens.css` FIRST,
23+
ahead of `helix-responsive.css` and `helix-overrides.css`. Cascade order
24+
is: upstream tokens → responsive defaults → consumer overrides.
25+
- **`css/vendor/helix-tokens.css` is vendored at SCAFFOLD time from a
26+
BUILD-TIME-BUNDLED copy.** `scripts/add-shebang.mjs` runs at every
27+
create-helix build and copies `@helixui/tokens/dist/tokens.css` into
28+
`dist/assets/helix-tokens.css`. The published tarball ships that fixed
29+
copy, and `scaffoldDrupalTheme` reads from it at scaffold time. This
30+
makes the scaffold output deterministic per create-helix release — the
31+
same create-helix version always emits the same bytes, independent of
32+
how the installer's npm/pnpm/yarn resolves transitive deps. (A fallback
33+
to runtime `require.resolve` of the package's exported CSS subpaths
34+
covers vitest tests against `src/`, where the dist artifact doesn't
35+
exist.) Scaffold-time vendoring also matters because Drupal theme users
36+
typically don't run `npm install` inside the theme directory — the
37+
documented setup is `cp -r theme/` + `drush theme:enable`, neither of
38+
which fires a Node install.
39+
- The scaffold also emits `scripts/copy-helix-tokens.mjs` and wires it to
40+
the `package.json` postinstall hook. This is the REFRESH path: when a
41+
developer does run `npm install` in the theme and gets a different
42+
`@helixui/tokens` version, the vendored copy is kept in sync. The script
43+
resolves `@helixui/tokens` via Node module resolution (`createRequire` +
44+
`require.resolve` of the exported CSS subpaths — NOT `package.json`,
45+
which `@helixui/tokens@3.x`'s exports map doesn't publish), so
46+
hoisted/workspace installs work the same as flat ones.
47+
- `src/presets/loader.ts` now imports `HELIX_TOKENS_VERSION` from
48+
`helix-versions.ts` — Drupal joins every framework template on the
49+
centralized pin (`^3.9.1`). `create-helix`'s own `@helixui/tokens`
50+
dependency is bumped to the same range (and both lockfiles refreshed)
51+
so the build-time bundling picks up the 3.9.1 bytes.
52+
53+
**`doctor` and `upgrade` exempt `@helixui/tokens` for ALL Drupal scaffolds
54+
in this release.** The runtime token layer for any Drupal theme is
55+
`css/vendor/helix-tokens.css`, not the declared range in `package.json`
56+
or the contents of `node_modules/@helixui/tokens`. Bumping the pin alone
57+
would advance the declaration while the theme keeps serving stale token
58+
bytes (the documented `cp -r theme/` + `drush theme:enable` flow doesn't
59+
run `npm install`, so the theme's postinstall script never fires to
60+
refresh the vendored CSS). No honest `@helixui/tokens` upgrade exists for
61+
an existing Drupal theme yet, so both checks skip it. The v0.9.4 follow-up
62+
will make `runUpgrade` Drupal-theme-aware — refresh `css/vendor/helix-tokens.css`
63+
from create-helix's bundled copy and, for pre-v0.9.3 themes, also inject
64+
the wiring files (`scripts/copy-helix-tokens.mjs`, the `helix-tokens`
65+
library entry, the `style.css` `@import`). At that point the skips can be
66+
dropped entirely.
67+
368
## 0.9.2
469

570
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-helix",
3-
"version": "0.9.2",
3+
"version": "0.9.3",
44
"description": "Scaffold a new project with HELiX web components — TUI-powered CLI",
55
"type": "module",
66
"exports": {

0 commit comments

Comments
 (0)