fix(ci): write real newline in version.ts during publish version sync#156
Conversation
The version-sync Node script runs inside a single-quoted heredoc (<<'NODE'), so the shell passes its body to node verbatim. The \\n in the writeFileSync calls therefore reached node as \\n, producing a literal backslash-n at the end of the generated version.ts files instead of a trailing newline. tsc then failed with TS1127 "Invalid character" on the stray backslash, breaking the 'Build all packages' step of the Publish NPM Packages workflow. Use a single \n so the JS string emits a real newline.
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Warning Review limit reached
More reviews will be available in 9 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Reviewed PR #156. The workflow change is correct: the embedded Node script now writes real trailing newlines to Validated locally:
Initial parallel lint/test attempts hit local exit 137 resource kills, then passed when rerun serially. |
|
✅ pr-reviewer applied fixes — committed and pushed Reviewed PR #156. The workflow change is correct: the embedded Node script now writes real trailing newlines to Validated locally:
Initial parallel lint/test attempts hit local exit 137 resource kills, then passed when rerun serially. |
There was a problem hiding this comment.
✅ pr-reviewer applied fixes — committed and pushed f1160f2 to this PR. The notes below describe what changed.
Reviewed PR #156. The workflow change is correct: the embedded Node script now writes real trailing newlines to packages/sdk-typescript/src/version.ts and packages/cli/src/version.ts, instead of literal \n text. No additional code changes were needed.
Validated locally:
- Extracted embedded workflow Node script parses successfully.
- Isolated version-bump execution writes newline byte
0afor both SDK and CLI version files. - Workflow YAML parses.
npx turbo lint --concurrency=1 --forcepassed.npx turbo test --concurrency=1 --forcepassed.npx turbo build --concurrency=1 --forcepassed.
Initial parallel lint/test attempts hit local exit 137 resource kills, then passed when rerun serially. package-lock.json content is unchanged after install.
Problem
The Publish NPM Packages → Build & Version job fails at the "Build all packages" step with
@relaycast/sdk#builderroring on TS1127 "Invalid character" (exit code 2).Failing run
Root cause
The version-sync step runs a Node script inside a single-quoted heredoc (
<<'NODE'), so the shell passes the body tonodeverbatim — no escape processing. ThewriteFileSynccalls used\\n:Node received
\\n, and in a JS string literal'\\n'is an escaped backslash followed byn— so the generatedversion.tsended with a literal\n(backslash + letter n) instead of a newline:tscthen hit the stray\and threw "Invalid character", failing the build.Fix
Changed
\\n→\nfor both the SDK and CLI version files. Inside the quoted heredoc,\nreaches Node as\n, which the JS string evaluates to a real newline.Verification
\nbefore, clean trailing newline after the fix).npx turbo buildpasses all 9 packages.https://claude.ai/code/session_011oXzPZxMiyb1FHahGRG3LR
Generated by Claude Code