fix(test): Node-20-compatible readdir instead of fs.globSync (unblocks CI + publish)#51
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The merge of #50 left main CI red and is blocking the v0.4.0 npm publish.
Cause:
transform-svelte.test.tsandtransform-react.test.tsimportfs.globSync, which is Node 22+ only. CI andpublish.ymlrun Node 20, sopnpm testthrowsTypeError: 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 recursivereaddirSync(.../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.ymlcan run green.🤖 Generated with Claude Code