Skip to content

fix(vue-app-layout): declare the @fastkit/vanilla-extract-utils dependency - #177

Merged
dadajam4 merged 2 commits into
mainfrom
fix/vue-app-layout-vanilla-extract-utils-dep
Jul 28, 2026
Merged

dadajam4 merged 2 commits into
mainfrom
fix/vue-app-layout-vanilla-extract-utils-dep

Conversation

@dadajam4

@dadajam4 dadajam4 commented Jul 28, 2026 •

Copy link
Copy Markdown
Owner

📝 Description

Fixes the Build docs failure in the release run for #175: https://github.com/dadajam4/fastkit/actions/runs/30361575091/job/90282365281

✘ [ERROR] Could not resolve "@fastkit/vanilla-extract-utils"
    src/styles/layers.css.ts:3:39:
      3 │ import { defineLayerStyle } from '@fastkit/vanilla-extract-utils';
  The module "./dist/vanilla-extract-utils.mjs" was not found on the file system:
    ../../node_modules/@fastkit/vanilla-extract-utils/package.json:27:19

⛳️ Current behavior

packages/vue-app-layout/src/styles/layers.css.ts imports @fastkit/vanilla-extract-utils, but the package never declared it in any dependency field. It resolved only through the root node_modules, where the module is hoisted as a workspace-level devDependency — note the ../../node_modules/... path in the error.

That hid the import from turbo. build is ordered by dependsOn: ["^build"], which walks declared workspace dependencies, so turbo had no reason to build @fastkit/vanilla-extract-utils before @fastkit/vue-app-layout and the two could run concurrently. Whenever the former's dist did not happen to exist yet, the latter failed.

Nothing surfaced it until now because a warm dist masks it. #175 changed the lockfile, which invalidated the turbo cache (Cached: 1 cached, 47 total in that run), so the release did a fully cold build and lost the race. The import dates back to #31, so the latent bug is long-standing — #175 only removed the thing that was hiding it.

🚀 New behavior

@fastkit/vanilla-extract-utils is declared as a devDependency of @fastkit/vue-app-layout, which gives turbo the edge it needs to order the two builds.

devDependency rather than dependency: .css.ts is evaluated at build time and compiles away. The built dist contains no reference to the module — its only external imports are @fastkit/helpers, @fastkit/tiny-logger, @fastkit/vue-body-scroll-lock, @fastkit/vue-resize, @fastkit/vue-scroller, @fastkit/vue-utils, vue and vue-router — so consumers never need it.

Why declare it, rather than order the build another way

docs/dependency-management.md listed @fastkit/vanilla-extract-utils among the root-aggregated dev toolchain, with "do not declare it per package" — so this PR also amends that policy rather than quietly making an exception to it.

The alternative was to build it in an earlier phase, the way build:plugboy already handles plugboy. That does not hold up: the phase only applies to pnpm build / pnpm build:docs, so turbo run build --filter=@fastkit/vue-app-layout — an everyday single-package build, and how this bug was reproduced — would still race. Declaring the dependency puts the edge in turbo's graph, so ordering holds under any invocation.

Root-aggregation is there to keep a dependency that every package uses out of 60-odd package.json files, and it cannot express build order. @fastkit/vanilla-extract-utils is imported by exactly one package, so one declaration is precision rather than noise. plugboy is the genuine exception: every package builds with it, so the pre-phase handles ordering once instead of 60 declarations.

The doc now says that, drops @fastkit/vanilla-extract-utils from the list, and gains a Workspace build-time helpers section covering the general case — *.css.ts helpers, ./plugboy-dts-preserve subpaths, codegen helpers.

💣 Is this a breaking change (Yes/No):

No. One devDependency entry plus a policy doc edit; the published dist is unchanged.

📝 Additional Information

Reproduced, then confirmed fixed. Removing packages/vanilla-extract-utils/dist and building only @fastkit/vue-app-layout fails on main with the exact CI error, and after the fix builds 14 tasks in dependency order.

Also verified under CI's conditions — every dist plus the turbo cache removed, then pnpm build:docs: 52/52. Full suite green (build:force, typecheck 72, test 71, lint 72).

Why pnpm audit:deps did not catch it. By design: scripts/audit-dist-phantoms.mjs audits import specifiers that survive into dist, because that is what breaks a consumer without shamefully-hoist. This import disappears at build time, so it is invisible to that audit and only breaks the build itself. Extending the guard to cover build-time-only imports would need a source-level scan; happy to look at that separately if it seems worth it.

No changeset. @fastkit/vue-app-layout is already scheduled for a patch in the pending Version Packages PR (#176) via toolchain-rebuild.md, and a devDependency is inert for consumers.

🤖 Generated with Claude Code

…dency

`src/styles/layers.css.ts` imports `@fastkit/vanilla-extract-utils`, but the
package never declared it — it resolved only through the root `node_modules`,
where the module is hoisted as a workspace-level devDependency.

That hid the import from turbo. `build` is ordered by `dependsOn: ["^build"]`,
which walks declared workspace dependencies, so turbo had no reason to build
@fastkit/vanilla-extract-utils first and the two could run concurrently. Whenever
its `dist` did not happen to exist yet, vue-app-layout failed to build with
`Could not resolve "@fastkit/vanilla-extract-utils"`.

Nothing surfaced it until now because a warm `dist` masks it. #175 changed the
lockfile, which invalidated the turbo cache, so the release run did a fully cold
build and hit the race — the "Build docs" step failed there. The import itself
dates back to #31, so this is long-standing.

Declared as a devDependency: `.css.ts` is evaluated at build time and compiles
away, and the built `dist` contains no reference to the module, so consumers
never need it.

Reproduced by removing `packages/vanilla-extract-utils/dist` and building only
@fastkit/vue-app-layout — it failed before and now builds 14 tasks in dependency
order. Also verified against CI's conditions: every `dist` plus the turbo cache
removed, then `pnpm build:docs` (52/52).

`pnpm audit:deps` did not catch this by design — it audits imports that survive
into `dist`, which is what breaks consumers. This one disappears at build time
and only breaks the build itself.

No changeset: @fastkit/vue-app-layout is already scheduled for a patch in the
pending release, and a devDependency is inert for consumers.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@changeset-bot

changeset-bot Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8313c1f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

The policy listed @fastkit/vanilla-extract-utils among the root-aggregated dev
toolchain with "do not declare it per package", which the preceding commit
contradicts. Resolve it in favour of declaring, and record why.

Root-aggregation exists to keep a dependency that every package uses out of
60-odd package.json files. It cannot express build order, and for a workspace
package that matters: turbo orders `build` by walking declared workspace
dependencies, so an undeclared one has no edge and its dist may not exist yet
when the dependent builds. @fastkit/plugboy gets away with it only because every
package builds with it, so the `build:plugboy` phase handles ordering once.

Drop @fastkit/vanilla-extract-utils from that list, note the limit of
root-aggregation in the decision guide, and add a "Workspace build-time helpers"
section covering the general case — *.css.ts helpers, ./plugboy-dts-preserve
subpaths, codegen helpers.

The file is not prettier-clean on main and `lint` does not cover docs markdown,
so it is left as-is apart from these edits rather than reformatted, to keep the
diff readable.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@dadajam4
dadajam4 merged commit c813d01 into main Jul 28, 2026
1 check passed
@dadajam4
dadajam4 deleted the fix/vue-app-layout-vanilla-extract-utils-dep branch July 28, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant