Skip to content

fix(ci): write real newline in version.ts during publish version sync#156

Merged
willwashburn merged 1 commit into
mainfrom
claude/tender-hopper-ihtys
Jun 1, 2026
Merged

fix(ci): write real newline in version.ts during publish version sync#156
willwashburn merged 1 commit into
mainfrom
claude/tender-hopper-ihtys

Conversation

@willwashburn
Copy link
Copy Markdown
Member

Problem

The Publish NPM Packages → Build & Version job fails at the "Build all packages" step with @relaycast/sdk#build erroring 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 to node verbatim — no escape processing. The writeFileSync calls used \\n:

fs.writeFileSync(sdkVersionPath, '...as const;\\n');

Node received \\n, and in a JS string literal '\\n' is an escaped backslash followed by n — so the generated version.ts ended with a literal \n (backslash + letter n) instead of a newline:

export const SDK_VERSION = "2.0.1" as const;\n   ← literal backslash-n

tsc then hit the stray \ and threw "Invalid character", failing the build.

Fix

Changed \\n\n for both the SDK and CLI version files. Inside the quoted heredoc, \n reaches Node as \n, which the JS string evaluates to a real newline.

Verification

  • Reproduced the bug by simulating the exact heredoc write (literal \n before, clean trailing newline after the fix).
  • npx turbo build passes all 9 packages.

https://claude.ai/code/session_011oXzPZxMiyb1FHahGRG3LR


Generated by Claude Code

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.
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@willwashburn, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 259fe2ef-d23c-44e3-97fa-739e76bc6fdd

📥 Commits

Reviewing files that changed from the base of the PR and between 8e167e5 and 85f1e21.

📒 Files selected for processing (1)
  • .github/workflows/publish-npm.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/tender-hopper-ihtys

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

@willwashburn willwashburn merged commit 066c218 into main Jun 1, 2026
5 checks passed
@willwashburn willwashburn deleted the claude/tender-hopper-ihtys branch June 1, 2026 18:00
@agent-relay-bot
Copy link
Copy Markdown
Contributor

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 0a for both SDK and CLI version files.
  • Workflow YAML parses.
  • npx turbo lint --concurrency=1 --force passed.
  • npx turbo test --concurrency=1 --force passed.
  • npx turbo build --concurrency=1 --force passed.

Initial parallel lint/test attempts hit local exit 137 resource kills, then passed when rerun serially. package-lock.json content is unchanged after install.

@agent-relay-bot
Copy link
Copy Markdown
Contributor

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 0a for both SDK and CLI version files.
  • Workflow YAML parses.
  • npx turbo lint --concurrency=1 --force passed.
  • npx turbo test --concurrency=1 --force passed.
  • npx turbo build --concurrency=1 --force passed.

Initial parallel lint/test attempts hit local exit 137 resource kills, then passed when rerun serially. package-lock.json content is unchanged after install.

Copy link
Copy Markdown
Contributor

@agent-relay-bot agent-relay-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 0a for both SDK and CLI version files.
  • Workflow YAML parses.
  • npx turbo lint --concurrency=1 --force passed.
  • npx turbo test --concurrency=1 --force passed.
  • npx turbo build --concurrency=1 --force passed.

Initial parallel lint/test attempts hit local exit 137 resource kills, then passed when rerun serially. package-lock.json content is unchanged after install.

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.

2 participants