Skip to content

fix(astro-markflow): fix import scan regressions with block comments and CRLF#175

Open
jp-knj wants to merge 7 commits intomainfrom
fix/import-scan-regressions
Open

fix(astro-markflow): fix import scan regressions with block comments and CRLF#175
jp-knj wants to merge 7 commits intomainfrom
fix/import-scan-regressions

Conversation

@jp-knj
Copy link
Copy Markdown
Member

@jp-knj jp-knj commented Feb 2, 2026

Summary

  • Remove seenImport early-termination in collectImportedNames that missed imports after interleaved const declarations; add inBlockComment tracking for multi-line /* ... */ comments
  • Update RE_SCAN_NOISE regex to handle CRLF line endings so getHeadings stripping works on Windows-style files

Test plan

  • Verify pnpm --dir packages/astro-markflow test passes (297/297)

🤖 Generated with Claude Code

jp-knj and others added 7 commits February 1, 2026 11:46
…n vite plugin

Cache resolveId's readFile + preprocess results for reuse in load(), cache
detectProblematicMdxPatterns results from buildStart, and use processedSourceCache
in catch blocks instead of re-reading files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…peline to plugin init

Moved normalizeStarlightComponents (3→1 call) and createPipeline (3→1 call)
out of per-file transform/load hooks into the configResolved hook, since
their results are invariant across files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ng scans in transforms

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…tml highlighting, and update bench script

- collectImportedNames: add skipCodeFences option and early termination at first non-import line
- stripScanNoise: consolidate 3 chained .replace() into single regex pass
- rewriteAstroSetHtml: collect all set:html blocks then highlight in parallel via Promise.all
- bench-pipeline.mjs: use compileBatch production path instead of parseBlocks+blocksToJsx
- orchestrator: add pipeline profiling support (MARKFLOW_PIPELINE_PROFILE=1)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…regex

The getHeadings branch in RE_SCAN_NOISE expected multi-line format with
`\n}` on its own line. For single-line output from blocksToJsx/wrapHtmlInJsxModule,
`[\s\S]*?\n}` would scan past the closing `}` and match the next `\n}` in the file,
stripping the entire JSX body and silently dropping component imports.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…plugin-reduce-redundant-work

# Conflicts:
#	packages/astro-markflow/src/transforms/inject-components.ts
…and CRLF

Remove seenImport early-termination in collectImportedNames that missed
imports after interleaved const declarations. Add inBlockComment tracking
so multi-line /* ... */ comments don't break the scan.

Update RE_SCAN_NOISE regex to handle CRLF line endings so getHeadings
stripping works on Windows-style files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant