Skip to content

fix(cli): allow choosing a supported TypeScript version - #2191

Merged
trueadm merged 4 commits into
octanejs:mainfrom
dannyward630:fix/cli-typescript-version
Oct 23, 2026
Merged

trueadm merged 4 commits into
octanejs:mainfrom
dannyward630:fix/cli-typescript-version

Conversation

@dannyward630

@dannyward630 dannyward630 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Validation

  • corepack pnpm --filter @octanejs/cli test — 196 tests passed.
  • corepack pnpm exec tsc --noEmit -p packages/cli/tsconfig.typecheck.json.
  • corepack pnpm format:files:check for the changed CLI source, tests, and README.
  • corepack pnpm changeset:check.
  • corepack pnpm sync; it refreshed the generated root-lockfile fingerprints in the React parity audit records and eval corpus manifest.
  • pnpm typecheck and the full repository pnpm test were not run; focused CLI checks cover this tooling-only change.
  • perf-review: not applicable; no runtime, compiler, or hot-path code changed.
  • concise-code: packages/cli/src +285 −36 (client runtime +0 −0); no new modules; new setRootProperty export is used by init to update JSONC safely. Smaller alternatives considered: pin only the stable default (omits the requested selector and TypeScript 7.1 setup) or always install the mapper (adds unused tooling to stable projects). The focused CLI path covers selection, compatibility checks, mapper setup, and doctor verification. Bundle bytes: not applicable.

Risk / follow-ups

  • Opened as a draft per the repository's AI contribution rules. Actions checks are skipped until a maintainer reviews and marks the PR ready.

Provenance

  • An agent produced this diff (agent-authored)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
Changes project scaffolding and TypeScript/tsconfig wiring for new and re-inited apps; mis-selection could leave typecheck broken until doctor/init is rerun, but scope is CLI-only with strong test coverage.

Overview
octane init and octane create now pick a supported TypeScript line instead of implicitly following the full @tsrx/typescript-plugin peer range (which can resolve to a 7.1 nightly). A new --typescript flag accepts a semver version/range or next for the 7.1 nightly; interactive runs offer stable 5.9/6 vs nightly, and CI/non-TTY defaults to stable without prompting.

When TypeScript 7.1 is chosen, init installs @tsrx/content-mapper, writes the top-level contentMappers entry for .tsrx in tsconfig.json (via new setRootProperty JSONC editing), and validates the choice against the plugin peer range before install. octane doctor adds ts.native-content-mapper to fail projects on 7.1 with .tsrx but missing mapper package/config.

Docs and CLI tests cover the flag, defaults, rejection of out-of-range versions, nightly scaffolding, and the doctor check. semver is added to @octanejs/cli; lockfile fingerprint updates in react-parity audit JSON are from pnpm sync, not functional parity changes.

Reviewed by Cursor Bugbot for commit 7091885. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Oct 21, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 34a672b. Configure here.

Comment thread packages/cli/src/commands/init/index.js Resolved
@trueadm
trueadm marked this pull request as ready for review October 21, 2026 10:35
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No byte growth, no added work, and no timing changes beyond ±3%.

Compares b7e49659b, the merge commit's first parent with d20fb4af9 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.608 3.567 −1.4% −7.2% … +5.6% ⚪ within noise
octane-tsrx replace 7.617 7.242 +1.5% −2.8% … +8.4% ⚪ within noise
octane-tsrx add 3.042 3.033 −5.4% −9.0% … −0.0% ⚪ within noise
octane-tsrx update 0.105 0.108 +6.6% +0.4% … +14.5% ⚪ within noise
octane-tsrx select 0.009 0.008 −4.0% −12.0% … +0.5% ⚪ within noise
octane-tsrx swap 0.024 0.024 +3.6% −1.4% … +9.7% ⚪ within noise
octane-tsrx remove 0.026 0.028 −0.9% −10.4% … +10.1% ⚪ within noise
octane-tsrx runlots 32.192 32.175 −1.9% −9.2% … +12.0% ⚪ within noise
octane-tsrx select_lots 0.009 0.008 +4.7% −4.5% … +12.6% ⚪ within noise
octane-tsrx clear 67.633 72.258 +6.4% +1.3% … +15.0% ⚪ within noise
octane-jsx run 5.250 5.308 +1.1% −12.5% … +14.2% ⚪ within noise
octane-jsx replace 12.475 10.008 −9.2% −24.8% … −2.0% ⚪ within noise
octane-jsx add 4.100 3.833 +1.1% −4.2% … +5.6% ⚪ within noise
octane-jsx update 0.212 0.214 +2.3% +0.7% … +8.7% ⚪ within noise
octane-jsx select 0.099 0.095 −2.6% −4.5% … +0.7% ⚪ within noise
octane-jsx swap 0.155 0.154 +2.9% +1.1% … +5.2% ⚪ within noise
octane-jsx remove 0.150 0.141 +0.5% −8.8% … +5.3% ⚪ within noise
octane-jsx runlots 31.442 29.742 +0.7% −8.6% … +7.5% ⚪ within noise
octane-jsx select_lots 1.133 1.143 +1.1% −10.2% … +10.3% ⚪ within noise
octane-jsx clear 57.892 62.017 +2.3% −4.8% … +10.2% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

No changes across 111 measured values.

Public-import reachability bundles (bytes)

No changes across 126 measured values.

@dannyward630
dannyward630 force-pushed the fix/cli-typescript-version branch from 34a672b to cf26766 Compare October 21, 2026 21:43
@dannyward630

Copy link
Copy Markdown
Contributor Author

The latest run's only source-test failure is Node 24 shard 2/4: packages/octane/tests/compiler/volar.test.ts → “type-checks dynamic tags against the element or component named by the tag” hit its 5-second timeout after the shard ran for 864 seconds. This file is unchanged by the PR, and the same test passes locally on the rebased head (2.89 seconds for the test; command: corepack pnpm exec vitest run --project octane packages/octane/tests/compiler/volar.test.ts -t 'type-checks dynamic tags against the element or component named by the tag'). The test (24) and CI provenance failures are downstream of that shard failure. GitHub rejected a rerun request because this account lacks repository admin rights.

# Conflicts:
#	packages/alien-signals/audit/react-parity.json
#	packages/apollo-client/audit/react-parity.json
#	packages/aria/audit/react-parity.json
#	packages/base-ui-utils/audit/react-parity.json
#	packages/base-ui/audit/react-parity.json
#	packages/better-auth/audit/react-parity.json
#	packages/cmdk/audit/react-parity.json
#	packages/colorful/audit/react-parity.json
#	packages/day-picker/audit/react-parity.json
#	packages/dexie/audit/react-parity.json
#	packages/dnd-kit/audit/react-parity.json
#	packages/draggable/audit/react-parity.json
#	packages/drei/audit/react-parity.json
#	packages/dropzone/audit/react-parity.json
#	packages/email/audit/react-parity.json
#	packages/embla-carousel/audit/react-parity.json
#	packages/floating-ui/audit/react-parity.json
#	packages/formisch/audit/react-parity.json
#	packages/gsap/audit/react-parity.json
#	packages/hook-form/audit/react-parity.json
#	packages/i18next/audit/react-parity.json
#	packages/inertia/audit/react-parity.json
#	packages/ink/audit/react-parity.json
#	packages/input-otp/audit/react-parity.json
#	packages/intersection-observer/audit/react-parity.json
#	packages/jotai/audit/react-parity.json
#	packages/lexical/audit/react-parity.json
#	packages/livestore/audit/react-parity.json
#	packages/lucide/audit/react-parity.json
#	packages/mantine-hooks/audit/react-parity.json
#	packages/markdown/audit/react-parity.json
#	packages/mobx/audit/react-parity.json
#	packages/monaco-editor/audit/react-parity.json
#	packages/motion/audit/react-parity.json
#	packages/nuqs/audit/react-parity.json
#	packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
#	packages/octane-is/audit/react-parity.json
#	packages/opentui/audit/react-parity.json
#	packages/pdf/audit/react-parity.json
#	packages/phosphor-icons/audit/react-parity.json
#	packages/popper/audit/react-parity.json
#	packages/radix/audit/react-parity.json
#	packages/rainbowkit/audit/react-parity.json
#	packages/react-error-boundary/audit/react-parity.json
#	packages/react-map-gl/audit/react-parity.json
#	packages/recharts/audit/react-parity.json
#	packages/redux-toolkit/audit/react-parity.json
#	packages/redux/audit/react-parity.json
#	packages/remix-router/audit/react-parity.json
#	packages/resizable-panels/audit/react-parity.json
#	packages/rxjs/audit/react-parity.json
#	packages/select/audit/react-parity.json
#	packages/shadcn/audit/react-parity.json
#	packages/solana-kit/audit/react-parity.json
#	packages/sonner/audit/react-parity.json
#	packages/spring/audit/react-parity.json
#	packages/streamdown/audit/react-parity.json
#	packages/styled-components/audit/react-parity.json
#	packages/swr/audit/react-parity.json
#	packages/syntax-highlighter/audit/react-parity.json
#	packages/tanstack-ai/audit/react-parity.json
#	packages/tanstack-devtools/audit/react-parity.json
#	packages/tanstack-form/audit/react-parity.json
#	packages/tanstack-query-devtools/audit/react-parity.json
#	packages/tanstack-query/audit/react-parity.json
#	packages/tanstack-router-ssr-query/audit/react-parity.json
#	packages/tanstack-router/audit/react-parity.json
#	packages/tanstack-store/audit/react-parity.json
#	packages/tanstack-virtual/audit/react-parity.json
#	packages/testing-library/audit/react-parity.json
#	packages/textarea-autosize/audit/react-parity.json
#	packages/three/audit/react-parity.json
#	packages/tiptap/audit/react-parity.json
#	packages/transition-group/audit/react-parity.json
#	packages/usehooks-ts/audit/react-parity.json
#	packages/valtio/audit/react-parity.json
#	packages/vaul/audit/react-parity.json
#	packages/visx/audit/react-parity.json
#	packages/wagmi/audit/react-parity.json
#	packages/waypoint/audit/react-parity.json
#	packages/window/audit/react-parity.json
#	packages/xstate-store/audit/react-parity.json
#	packages/xstate/audit/react-parity.json
#	packages/xyflow/audit/react-parity.json
#	packages/zag/audit/react-parity.json
#	packages/zustand/audit/react-parity.json
@trueadm
trueadm merged commit eadfb51 into octanejs:main Oct 23, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

octane init: let the user choose the TypeScript version (it installs a 7.1 nightly today)

2 participants