Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/sync-plugin-bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ async function bundleEntry(entry: string): Promise<string> {
`[sync-plugin-bootstrap] expected exactly one output for ${entry}, got ${result.outputs.length}`,
)
}
return await result.outputs[0].text()
const text = await result.outputs[0].text()
// Normalize line endings so the emitted artifact (and the in-memory
// comparison in the freshness gate) is identical on LF and CRLF checkouts.
return text.replace(/\r\n/g, '\n')
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/architecture/plugin-bootstrap-fresh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ describe('generated plugin bootstrap artifacts', () => {
for (const { outFile, content } of built) {
const path = join(GENERATED_DIR, outFile)
expect(existsSync(path), `missing generated/${outFile}`).toBe(true)
const current = readFileSync(path, 'utf8')
// Tolerate CRLF working-tree line endings on Windows checkouts.
const current = readFileSync(path, 'utf8').replace(/\r\n/g, '\n')
expect(
current === content,
`generated/${outFile} is stale — run \`bun run bootstrap:sync\``,
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/site-explorer/siteExplorerPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ describe('SiteExplorerPanel', () => {
expect(treeDropCss).toContain('.dropInside')
expect(css).toContain('.dragOverlayRow')

const beforeAfterBlock = treeDropCss.match(/\.dropBefore::before,\n\.dropAfter::after,\n\.dropRoot::after,\n\.rootDropGapActive::after\s*\{[^}]*\}/s)?.[0] ?? ''
const beforeAfterBlock = treeDropCss.match(/\.dropBefore::before,\r?\n\.dropAfter::after,\r?\n\.dropRoot::after,\r?\n\.rootDropGapActive::after\s*\{[^}]*\}/s)?.[0] ?? ''
expect(beforeAfterBlock).toContain('position: absolute')
expect(beforeAfterBlock).not.toMatch(/(?:^|\n)\s*(margin|padding)\b/)

Expand Down