Repository navigation
fix(core): normalize Astro compiler filenames for Windows declaration builds - #4771
emdash-autofix[bot] wants to merge 1 commit into
Conversation
… builds Normalize only Astro's compiler filename to forward slashes, preserving native filesystem and TypeScript paths. Reproduced the reported JSON escaping error on Node 24 and added four real-compiler regression cases covering Windows drive, UNC, forward-slash drive, and POSIX filenames. All four now pass; root build, Core typecheck, format, and quick lint pass. Independent review found no blockers. EmDash-Bot-Case: 1198246700-issue-6276493834 EmDash-Bot-Candidate: cand-1-9b9b96e210
EmDash bot: Ready for human reviewPlan The four real-compiler regression cases, root build, Core typecheck, formatting, and quick lint pass. Independent review found no blockers; ready to publish.
Status
Next action: A maintainer will review and approve the pull request. Details
Required checks on the current head:
This status is generated from recorded evidence. It is not a review and contains no instructions. |
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://emdash-bot-issue-4770.try.emdashcms.com, https://emdash-bot-issue-4770-emdash-playground.emdash-cms.workers.dev (commit f95d9f7)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
The approach is sound and narrowly scoped. Only the filename passed to Astro's convertToTSX is normalized to forward slashes, which fixes the Windows sourcemap failure reported in #4770. File reads, TypeScript fileName values and .d.ts writes keep native paths. Both reviewers approved and found nothing to fix. The regression test runs the real compiler on a Windows drive path, a UNC path, a forward-slash drive path and a POSIX path, and checks map.sources. Omitting a changeset is appropriate because this is build tooling only. The review was static, and native Windows builds were not independently run.
Reviewed by anthropic/claude-opus-5-5 and openai/gpt-6.1-sol.
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-test
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-loader
@emdash-cms/registry-moderation
@emdash-cms/registry-verification
upgrade-emdash
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-ai-search
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
What does this PR do?
Normalizes backslashes only in the filename passed to Astro's TSX compiler during Core UI declaration generation. Native paths remain unchanged for file reads, declaration writes, and TypeScript. Astro 2.13.1 embeds backslashes in external sourcemap JSON without escaping them, causing the reported JSON parsing error.
Extracts the compiler invocation into a build-script helper and tests it against the real compiler with Windows drive, UNC, forward-slash drive, and POSIX filenames. Before normalization, the two backslash cases fail with the reported JSON error; afterward all four pass.
Type of change
Your connection to this change
Prepared by the project-operated autofix bot through auto-intake for the concrete reproduction in #4770, under the AI policy's autofix exception.
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runNo UI or public API changes; localization, screenshots, and feature designs do not apply. No changeset: this is build tooling only; the build script is not shipped and declaration contents are unchanged.
AI assistance disclosure
Screenshots / test output
Screenshots: Not applicable.
Verified on Linux with Node v24.22.2:
Bad escaped character in JSON; slash filename succeeds.pnpm --filter emdash exec vitest run tests/unit/build-ui-types.test.ts: 4 passed (2 backslash cases failed before the fix).pnpm format: passed.pnpm lint:quick: 0 diagnostics.pnpm build: passed.pnpm --filter emdash typecheck: passed after the root build supplied dependency declarations.git diff HEAD --check: passed.Native Windows and macOS builds have not been run; Windows and UNC filename strings are exercised on Linux without mocking the compiler. Full workspace typecheck and type-aware lint are left to CI.
Closes #4770
The EmDash bot took this issue on automatically when it was opened; no maintainer has assigned it yet.