Repository navigation
fix(cli): ignore text imports and follow renamed exports in Strong reports - #2060
Conversation
…ports
`octane analyze` scanned raw source for `import`/`export` lines, so a
code sample in a template literal or a comment counted as a real
statement. The website's playground samples became a ReactCompat
boundary, and a module that mentioned `octane` only in a sample counted
toward Strong coverage. Both scanners now read the source with comment
and template literal text blanked, keeping quoted strings so specifiers
survive.
`--strong-dependencies` stopped at a dependency module that imports a
binding and exports it under another name, so the component's own
module never appeared. `@octanejs/tanstack-devtools`, whose entry does
`export const TanStackDevtools = Devtools.TanStackDevtools`, was missing
from the website's report. An export that only renames an imported
binding (`= binding`, `= ns.member`, `export { binding as X }`,
`export default binding`) now passes the import's names on, as a
re-export does. An export that builds a new value from an import still
stops there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Blanking a template literal's backticks made `export const X = tag`…`` and `export default tag`…`` read as a rename of `tag`, so the module that builds the value dropped out of the Strong dependency walk and the tag's module was followed instead. The backticks now stay, so a tagged template never reads as a bare name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Comment backticks survive source blanking
- The blanking regex now checks whether the matched text starts with a backtick (template literal) or slash (comment), preserving backticks only for template literals so comment backticks are correctly blanked to spaces.
Or push these changes by commenting:
@cursor push b83276be26
Preview (b83276be26)
diff --git a/packages/cli/src/commands/analyze/strong-coverage.js b/packages/cli/src/commands/analyze/strong-coverage.js
--- a/packages/cli/src/commands/analyze/strong-coverage.js
+++ b/packages/cli/src/commands/analyze/strong-coverage.js
@@ -156,15 +156,17 @@
/**
* `source` with comment and template literal text blanked, so a statement
* scanner never reads code that is only text, such as a code sample in a
- * template string. Line breaks stay, and so do backticks, so a tagged template
- * never reads as a bare name. Quoted strings stay: a specifier is one, and one
- * ends at its line, so it cannot hold a statement.
+ * template string. Line breaks stay; backticks stay only in template literals
+ * so a tagged template never reads as a bare name. Quoted strings stay: a
+ * specifier is one, and one ends at its line, so it cannot hold a statement.
*
* @param {string} source
*/
export function codeOnly(source) {
return source.replace(TEXT, (text) =>
- text[0] === "'" || text[0] === '"' ? text : text.replace(/[^\n`]/g, ' '),
+ text[0] === "'" || text[0] === '"'
+ ? text
+ : text.replace(text[0] === '`' ? /[^\n`]/g : /[^\n]/g, ' '),
);
}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 8ae6ecd. Configure here.
Keeping every backtick left a comment's backticks inside an import or export clause, which corrupted the specifier beside it, so a rename through that import was not followed. Only a template literal keeps its backticks, which is all a tagged template needs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
View logs |
octane-website-mcp | c7ee9f4 | Oct 14 2026, 06:31 PM |
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 93 measured values. Public-import reachability bundles (bytes)No changes across 120 measured values. |
Brings in #2047-#2051 (Strong literal stabilisation), #2054 (checked compiled boundaries and a compiled router entry), #2055/#2057 (Strong rejects descriptor APIs and .tsx/.jsx), #2056/#2060/#2061 (CLI Strong reports), #2062 (Strong in the website and devtools), #2065 (no browser-translation DOM accommodations) and Version Packages. Conflicts, resolved so main's behaviour lands on the redesign's commit model: - runtime.ts, #2065: setText keeps main's legacy host-only convention and the redesign's hydration writeText. The translator recovery is gone from renderText/commitText, setRenderText/commitSetText, commitHole, childTextHoleUpdate, recordHole and bindSignalChild; removeOnlyChildText still removes a committed Text at commit. resetOnlyChildHost and PENDING_HOST_TEXTS (which served only the host-only text writes) are deleted. - compile.js, #2065: text updates call setRenderText(_txt, v), commit functions setText(_txt, v), and commitHole takes no host. - runtime.server.ts, #2054: a compiled-only frame checks its output; ordinary frames keep the redesign's returned-value normalization. - codes.json: main's 344-346 (CompiledContext, CompiledOutlet) keep their numbers; the redesign's codes move to 347 (server boundary error), 348 (hydration protocol skew) and 349 (frontier rehome). Generated tables and CLI data are regenerated; docs/ssr.md names #348. Adaptations: - compiled-boundaries.test.ts: the server runs no error boundary (React's model), so an invalid CompiledOutlet under a catch-only @Try fails renderToString with the CompiledOutlet error; the client still shows the catch arm. - scripts/render-writers.mjs drops resetOnlyChildHost. Co-Authored-By: Claude Opus 5.5 <[email protected]>


Summary
This fixes two bugs in
octane analyzethat #2059 found while measuring the website under--strong-dependencies.import/exportlines anywhere in the raw source, including inside template literals and comments.website/src/lib/playground-examples.tswas reported as a ReactCompat boundary, because two of its template strings begin withimport … from 'octane/react'..tsmodule that mentionedoctaneonly inside a sample counted toward Strong coverage.export … from. A dependency module that imports a binding and exports it under another name ended the walk, so the module that defines the component never appeared.@octanejs/tanstack-devtoolswas missing from the website's report entirely. Its entry doesexport const TanStackDevtools = Devtools.TanStackDevtools.export const X = binding,= ns.member,export { binding as X }andexport default binding.memo(Internal), is still declared by its own module. The walk doesn't follow that import, because it's the module's implementation.On the website, with every module temporarily marked Strong, the report now lists
@octanejs/tanstack-devtools(src/devtools.tsrx) and no longer reports a ReactCompat boundary.Validation
pnpm format:check(not run repo-wide;pnpm format:files:checkon the changed files passes)pnpm typecheck(not run repo-wide;pnpm typecheck:fileson both changed source files passes)pnpm test(not run locally; CI runs it)vitest run packages/cli/tests/analyze.test.js --project cli, 28 passedpnpm sync: no generated changes.perf-review: not applicable. The diff is limited topackages/cli: no runtime, compiler output or binding hot path.concise-code:codeOnlyinstrong-coverage.js, used byruntimeRequestsand by the export scanner instrong-dependencies.js.@tsrx/coreores-module-lexer. The CLI has no parser dependency, and it has to keep working against older installedoctanebuilds, so it would need a new compiler API plus a regex fallback anyway.Internal.tsrxfixture asserts that it stays excluded.Risk / follow-ups
/*can still be misread, as before. That is acceptable for a report-only tool.octane analyzecan't read a Strong setting passed through the Vite plugin, such as the website'stanstackStart({ octane }). It only readsoctane.config.ts.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Report-only CLI heuristics change; no runtime, compiler, or auth paths. Remaining regex edge cases are unchanged in spirit.
Overview
octane analyzenow strips comment and template-literal text before regex-based import/export scanning, so playground-style samples no longer fake Strong coverage hits oroctane/reactReactCompat boundaries.--strong-dependencieswalks through rename-only exports (export const X = binding, namespace members,export { a as X },export default binding) to the defining module, while still treating wrapped values likememo(Internal)as local declarations and not following their implementation imports.CLI tests cover template-string samples and the
@kit/panelrename/re-export scenarios.Reviewed by Cursor Bugbot for commit 2d06e2b. Bugbot is set up for automated code reviews on this repo. Configure here.