Repository navigation
fix(vue-app-layout): declare the @fastkit/vanilla-extract-utils dependency - #177
Merged
Merged
Conversation
…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]>
|
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Fixes the
Build docsfailure in the release run for #175: https://github.com/dadajam4/fastkit/actions/runs/30361575091/job/90282365281⛳️ Current behavior
packages/vue-app-layout/src/styles/layers.css.tsimports@fastkit/vanilla-extract-utils, but the package never declared it in any dependency field. It resolved only through the rootnode_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.
buildis ordered bydependsOn: ["^build"], which walks declared workspace dependencies, so turbo had no reason to build@fastkit/vanilla-extract-utilsbefore@fastkit/vue-app-layoutand the two could run concurrently. Whenever the former'sdistdid not happen to exist yet, the latter failed.Nothing surfaced it until now because a warm
distmasks it. #175 changed the lockfile, which invalidated the turbo cache (Cached: 1 cached, 47 totalin 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-utilsis 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.tsis evaluated at build time and compiles away. The builtdistcontains 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,vueandvue-router— so consumers never need it.Why declare it, rather than order the build another way
docs/dependency-management.mdlisted@fastkit/vanilla-extract-utilsamong 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:plugboyalready handles plugboy. That does not hold up: the phase only applies topnpm build/pnpm build:docs, soturbo 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.jsonfiles, and it cannot express build order.@fastkit/vanilla-extract-utilsis 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-utilsfrom the list, and gains a Workspace build-time helpers section covering the general case —*.css.tshelpers,./plugboy-dts-preservesubpaths, codegen helpers.💣 Is this a breaking change (Yes/No):
No. One devDependency entry plus a policy doc edit; the published
distis unchanged.📝 Additional Information
Reproduced, then confirmed fixed. Removing
packages/vanilla-extract-utils/distand building only@fastkit/vue-app-layoutfails onmainwith the exact CI error, and after the fix builds 14 tasks in dependency order.Also verified under CI's conditions — every
distplus the turbo cache removed, thenpnpm build:docs: 52/52. Full suite green (build:force,typecheck72,test71,lint72).Why
pnpm audit:depsdid not catch it. By design:scripts/audit-dist-phantoms.mjsaudits import specifiers that survive intodist, because that is what breaks a consumer withoutshamefully-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-layoutis already scheduled for a patch in the pending Version Packages PR (#176) viatoolchain-rebuild.md, and a devDependency is inert for consumers.🤖 Generated with Claude Code