fix(cli): substitute @build.version@ when scaffolding from dev checkout (closes #2279) - #2289
Merged
Merged
Conversation
…ut (closes #2279) wheels new copied vendor/wheels/box.json verbatim from the resolved framework source. When that source was a dev checkout of the wheels-dev/wheels monorepo, the unreplaced @build.version@ placeholder propagated into the new app — the release pipeline substitutes it at build time, but raw checkouts do not. The framework's $readFrameworkVersion() fallback only identifies the monorepo when the enclosing box.json is the monorepo's own, never true inside a generated app, so the homepage reported "0.0.0-dev" forever. copyFrameworkToVendor now delegates to a new FrameworkInstaller service that post-processes the copied box.json: if it still contains @build.version@ AND the source's enclosing root box.json identifies the monorepo (slug=wheels or name=Wheels.fw) AND has a real version, rewrite the copy's placeholder to "<rootversion>-dev". Released bundles (real version already substituted) and third-party layouts (no monorepo markers) early-return, so no new failure modes. Isolated the rewrite into a service so specs can exercise it without instantiating Module.cfc (which requires a modules.BaseModule mapping only present at LuCLI runtime).
5 tasks
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.
Summary
wheels newcopiedvendor/wheels/box.jsonverbatim from the resolved framework source. When that source was a dev checkout of the wheels-dev/wheels monorepo, the unreplaced@build.version@placeholder rode along into the scaffolded app. The release pipeline substitutes the placeholder at build time, but raw checkouts do not.$readFrameworkVersion()'s dev-fallback only identifies the monorepo when the enclosingbox.jsonis the monorepo's own — a condition never met inside a generated app (its ownbox.jsonis the app's, and there's no monorepo root anywhere in its tree). The framework fell through to"0.0.0-dev"and the homepage reported that forever.copyFrameworkToVendornow delegates to a newFrameworkInstallerservice that post-processes the copiedbox.json. If the placeholder is still present AND the source's enclosing rootbox.jsonidentifies the monorepo (slug=wheelsorname=Wheels.fw) AND has a real version, the copy's placeholder becomes<rootversion>-dev(e.g.4.0.0-dev). Released bundles short-circuit — theirbox.jsonalready carries a real version.Why a service
Extracted into
cli/lucli/services/FrameworkInstaller.cfcso specs can exercise the behavior without instantiatingModule.cfc, which requires amodules.BaseModulemapping that only exists at LuCLI runtime. Keeps Module.cfc thin and keeps the test surface well-scoped.Test plan
FrameworkInstallerSpec— 6 specs covering slug match, name match, non-monorepo enclosingbox.json, released bundle (real version), both-placeholder pathological case, and missing enclosingbox.json. All green.442 pass, 0 fail, 0 error(was 436 pre-change; +6 new).wheels new issue-2279-testin a temp dir, inspectedvendor/wheels/box.json→"version":"4.0.0-dev"(was"@build.version@"before the fix).Out of scope / follow-ups
rootBoxJsonPathin$readFrameworkVersion()resolves tovendor/box.json(one level up fromvendor/wheels/Global.cfc), not<repo>/box.jsontwo levels up. If the running Wheels dev server also shows0.0.0-devat runtime ondevelop, that's a separate defect in PR fix(view): homepage version and CLI detection (closes #2255, #2259) #2272's default-path math and should be addressed in its own change with a smoke test on the server, not just on the synthetic-fixture unit tests.