Skip to content

fix(view): homepage version and CLI detection (closes #2255, #2259) - #2272

Merged
bpamiri merged 1 commit into
developfrom
peter/fix-homepage-version-and-cli-detection
Apr 23, 2026
Merged

bpamiri merged 1 commit into
developfrom
peter/fix-homepage-version-and-cli-detection

Conversation

@bpamiri

@bpamiri bpamiri commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Both issues turned out to be not regressions from the Theme A batch — the version helper was working as designed per its #2240 commit message, and the CLI path check has been hardcoded since the v4.0 congratulations redesign (#2098). Triage notes in the original brief.

Changes

  • `vendor/wheels/Global.cfc` — `$readFrameworkVersion()` gains an optional `rootBoxJsonPath` arg; when the framework box.json contains `@build.version@`, the helper consults the enclosing box.json and, if it identifies the wheels monorepo, returns `-dev`.
  • `vendor/wheels/public/views/congratulations.cfm` — CLI detection now falls through to `/.CommandBox/cfml/modules/wheels-cli/ModuleConfig.cfc`, `/.lucli/lucli`, and `~/.lucli/bin/lucli`. FileExists-only; no `cfexecute`.
  • `vendor/wheels/tests/specs/events/frameworkVersionSpec.cfc` — four new specs for the dev-fallback branch (monorepo match, vendored-install, both-placeholder, missing-root).

Test plan

  • Full core suite green locally: 3306 pass, 0 fail, 0 error, 16 skip (Lucee 7 + SQLite via LuCLI)
  • CI: PR fast-gate green across its matrix
  • Manual smoke: load `/` on the wheels-dev/wheels dev server — expect `4.0.0-dev` (instead of `0.0.0-dev`)
  • Manual smoke: install `wheels-cli` via CommandBox in a separate app, load `/` — expect "Wheels CLI detected"

Closes #2255
Closes #2259

🤖 Generated with Claude Code

… homepage

Resolves #2255. When $readFrameworkVersion() detects an unreplaced
@build.version@ placeholder, it now peeks at the enclosing repo's root
box.json. If that box.json identifies the wheels-dev/wheels monorepo
(slug "wheels" or name "Wheels.fw"), the helper returns
"<rootversion>-dev" so the homepage surfaces the upcoming version.
Vendored installs and any other hosting context still fall back to
"0.0.0-dev".

Resolves #2259. congratulations.cfm's CLI detection no longer relies
solely on the monorepo-only path /cli/lucli/Module.cfc. It additionally
probes ~/.CommandBox/cfml/modules/wheels-cli/ModuleConfig.cfc,
~/.lucli/lucli, and ~/.lucli/bin/lucli so CommandBox and LuCLI installs
are recognized too. FileExists-only; no cfexecute.

frameworkVersionSpec extended with four new cases covering the
monorepo-detection branch, the vendored-install fallback, the
both-placeholder fallback, and the missing-enclosing-box.json
fallback. Full core suite: 3306 pass, 0 fail, 0 error, 16 skip.
@bpamiri
bpamiri merged commit 22e05a1 into develop Apr 23, 2026
3 checks passed
@bpamiri
bpamiri deleted the peter/fix-homepage-version-and-cli-detection branch April 23, 2026 20:29
bpamiri added a commit that referenced this pull request Jun 26, 2026
…te (#3260)

* feat(cli): show onboarding content on the scaffolded home page

`wheels new` generated a bare two-line placeholder at `/`, while the
redesigned welcome page (Public.index -> congratulations.cfm) sat
orphaned at `/wheels` where nobody lands. Port the first-run essentials
into the generated app/views/main/index.cfm: a runtime status line
(Wheels version, engine, database, environment) and a Next-steps
command guide, as semantic HTML styled by the template's simple.css.
Leaves framework-internal chrome, the CLI install banner, and the
version-pinned "What's New" grid on the /wheels page.

Resync the scaffoldProject mirror in ProjectScaffoldTest.cfc (it mirrors
Module.cfc exactly) and strengthen the view assertion to lock in the new
content and the ## -> # escaping.

Signed-off-by: Peter Amiri <peter@alurium.com>

* fix(security): defense-in-depth gate the /wheels welcome page

Public.index (the congratulations/welcome page at the /wheels namespace
root) was the only Public.cfc handler without a $blockInProduction()
guard, a deliberate #2233 exception that relied on
enablePublicComponent=false to hide /wheels in production by default.
The redesigned page (#2098/#2272) surfaces version/engine/database/
environment, the same class of detail every other gated handler
protects. Add $blockInProduction() as the first statement so it no
longer renders outside development when enablePublicComponent is
manually enabled. Development still renders (the gate is an allowlist).

Flip PublicComponentProductionSpec.cfc: add "index" to the gated-handler
list and drop the now-contradictory "NOT gated" exception test.

Signed-off-by: Peter Amiri <peter@alurium.com>

* docs: flag starter home page as dev-facing, fix stale index() comment

Address wheels-bot review feedback on PR #3260:

- The generated starter home page now carries a comment warning that it
  is a development/first-run landing page which surfaces environment
  details (Wheels version, engine, database, environment) and should be
  replaced with a real homepage before production. Mirrored in the
  scaffoldProject test helper.
- InvokeMethodSpec.cfc described index() as "ungated"; fix the stale
  comment now that index() calls $blockInProduction().

Signed-off-by: Peter Amiri <peter@alurium.com>

---------

Signed-off-by: Peter Amiri <peter@alurium.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant