Skip to content

fix(cli): make docs-agent template TypeScript clean - #3074

Merged
kwakayama merged 4 commits into
mainfrom
codex/fix-docs-agent-template-typescript
Jul 24, 2026
Merged

kwakayama merged 4 commits into
mainfrom
codex/fix-docs-agent-template-typescript

Conversation

@kwakayama

@kwakayama kwakayama commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make the generated docs-agent template pass strict consumer TypeScript checks
  • preserve explicit .ts route imports required by the native Deno app-router loader
  • add CSS import typing and a local Tabs callback annotation
  • add regressions for both consumer compiler configuration and native Deno route imports
  • reserve the next unused framework version, 0.1.1128

Why the tsconfig change is required

The app router imports API route modules directly through native Deno before bundling. Those route modules therefore need explicit .ts specifiers for their shared store import. TypeScript accepts those specifiers only when allowImportingTsExtensions is enabled, and that option requires a no-emit type-checking contract. The template now declares both allowImportingTsExtensions and noEmit instead of breaking Deno route loading.

The generated globals.d.ts is independently required so strict TypeScript accepts the layout side-effect import of globals.css.

Reproduction

The published docs-agent template produced three TS5097 errors for route-local .ts imports, TS2882 for globals.css, and TS7006 for the Tabs callback when running tsc --noEmit. The framework build could still pass because it did not exercise the standalone consumer TypeScript contract.

Verification

  • fresh scaffold from the updated branch using the current published 0.1.1127 runtime: tsc --noEmit passed
  • fresh scaffold production build passed
  • docs-agent template suite: 14 steps passed, including native Deno route imports
  • synchronized version suite: 21 steps passed
  • template manifest, format, lint, typecheck, and diff checks passed
  • repository pre-push suite: 2,646 tests / 21,500 steps passed

Release

0.1.1127 is already published. This PR synchronizes deno.json and src/utils/version-constant.ts at the next unused version, 0.1.1128.

@kwakayama
kwakayama requested a review from kojiwakayama as a code owner July 24, 2026 17:01

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 26c240b414

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cli/templates/files/docs-agent/app/api/ag-ui/route.ts Outdated
The docs-agent app router routes are imported directly by the Deno runtime before any bundler can rewrite relative specifiers, so their shared store import must include the .ts extension. The template TypeScript config now declares the no-emit extension-import contract that keeps consumer type checking compatible with that Deno-first runtime requirement.

Constraint: App-router route modules are loaded through native Deno import(file://...) at request time

Rejected: Keep extensionless route imports | breaks Deno-native route loading before bundling

Rejected: Remove the route import regression | would leave the runtime boundary untested

Confidence: high

Scope-risk: narrow

Directive: Do not remove .ts from docs-agent route-local imports without testing native Deno route imports

Tested: deno test --no-check --allow-all cli/templates/index.test.ts

Tested: deno run -A scripts/build/generate-templates-manifest.ts --check

Tested: deno fmt --check cli/templates/index.test.ts cli/templates/files/docs-agent/app/api/ag-ui/route.ts cli/templates/files/docs-agent/app/api/ingest/route.ts cli/templates/files/docs-agent/app/api/uploads/route.ts cli/templates/files/docs-agent/tsconfig.json cli/templates/manifest.json

Tested: deno lint cli/templates/index.test.ts cli/templates/files/docs-agent/app/api/ag-ui/route.ts cli/templates/files/docs-agent/app/api/ingest/route.ts cli/templates/files/docs-agent/app/api/uploads/route.ts

Tested: deno check cli/templates/index.test.ts

Not-tested: Full repository test suite
@kwakayama
kwakayama enabled auto-merge July 24, 2026 18:29
kojiwakayama
kojiwakayama previously approved these changes Jul 24, 2026
The current main branch already published v0.1.1127, so the docs-agent scaffold fix needs the next unused package version for the release workflow to publish consumable artifacts.\n\nConstraint: Framework releases require deno.json and the shared version constant to stay synchronized.\n\nTested: deno test --allow-read src/utils/version.test.ts\nTested: deno test --no-check --allow-all cli/templates/index.test.ts\nTested: template manifest, format, check, and diff validation
@kwakayama
kwakayama added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 100a47c Jul 24, 2026
30 checks passed
@kwakayama
kwakayama deleted the codex/fix-docs-agent-template-typescript branch July 24, 2026 19:35
kojiwakayama added a commit that referenced this pull request Aug 11, 2026
An untouched scaffold failed its own type check on a framework-authored
line. `app/layout.tsx` opens with `import "../globals.css";`, and the
scaffold shipped no ambient declaration for `*.css`, so the first
`tsc --noEmit` a developer runs on a brand-new project is red:

    app/layout.tsx(1,8): error TS2882: Cannot find module or type
    declarations for side-effect import of '../globals.css'.

`docs-agent` already carried `globals.d.ts` from #3074; the other five
styled starters (ai-agent, agentic-workflow, coding-agent,
multi-agent-system, saas-starter) never got it. Ship the same one-line
declaration with each of them and regenerate the template manifest.

The regression lives in cli/templates/index.test.ts because that is where
the scaffolded file set is asserted, and it reads through `getTemplate`
rather than off disk: a declaration that exists in `files/` but never
reaches manifest.json leaves the developer with the same red compiler.
It discovers the starters that import a stylesheet instead of listing
them, so a starter that adopts one later is covered too.

Found on a DX dogfood walk of the create-project quickstart.
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.

2 participants