Skip to content

fix(test): Node-20-compatible readdir instead of fs.globSync (unblocks CI + publish)#51

Merged
kurtstohrer merged 2 commits into
mainfrom
fix/ci-node20-globsync
Jun 22, 2026
Merged

fix(test): Node-20-compatible readdir instead of fs.globSync (unblocks CI + publish)#51
kurtstohrer merged 2 commits into
mainfrom
fix/ci-node20-globsync

Conversation

@kurtstohrer

Copy link
Copy Markdown
Owner

The merge of #50 left main CI red and is blocking the v0.4.0 npm publish.

Cause: transform-svelte.test.ts and transform-react.test.ts import fs.globSync, which is Node 22+ only. CI and publish.yml run Node 20, so pnpm test throws TypeError: globSync is not a function. (It passed locally on Node 22 — a latent, pre-existing incompatibility, not from #50's changes.)

Fix: replace fs.globSync('src/**/*.svelte', {cwd}) with a recursive readdirSync(.../src, {recursive:true}) filtered by extension — available on Node 18.17+/20, lists the same playground sources. Test-only; shipped code is unaffected.

Verified: the two transform suites (55 tests) pass, typecheck clean. Once merged, publish.yml can run green.

🤖 Generated with Claude Code

The transform smoke tests imported fs.globSync, which only exists in Node 22+.
CI (and publish.yml) run Node 20, so 'pnpm test' threw
'TypeError: globSync is not a function' — turning main CI red and blocking the
npm publish step. Replaced with a recursive readdirSync (Node 18.17+/20),
which lists the same playground sources. Test-only; shipped code is unaffected.
…flow

release.yml created the GitHub Release with GITHUB_TOKEN, whose events don't
trigger other workflows — so publish.yml's 'release: published' trigger never
fired and npm was never published. Make release.yml call publish.yml directly
(workflow_call + secrets: inherit) after cutting the tag/release, gated on a
version change. A direct reusable-workflow call isn't subject to the
GITHUB_TOKEN recursion guard, so a version bump on main now auto-publishes —
no manual dispatch, no PAT secret. publish.yml keeps its release/dispatch
triggers for manual runs.
@kurtstohrer kurtstohrer merged commit 53128d9 into main Jun 22, 2026
2 checks passed
@kurtstohrer kurtstohrer deleted the fix/ci-node20-globsync branch June 22, 2026 23:18
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