fix(sdk): fixed ts sdk publishing job to use later node version#1619
Merged
waleedlatif1 merged 1 commit intostagingfrom Oct 13, 2025
Merged
fix(sdk): fixed ts sdk publishing job to use later node version#1619waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1 merged 1 commit intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
Updated the TypeScript SDK publishing workflow to use Node.js 22 instead of Node.js 18. This change is necessary because the SDK uses the native File API (line 133 in packages/ts-sdk/src/index.ts) for file upload functionality, which was introduced in Node.js 20.
Key Points:
- The SDK's
convertFilesToBase64method relies oninstanceof Filechecks andFile.arrayBuffer()method - Node.js 18 does not have native
Filesupport, which would cause the publishing process to fail - Node.js 20+ includes the native
FileAPI as part of the Fetch API implementation
Confidence Score: 4/5
- This PR is safe to merge with minimal risk
- The change is minimal and well-justified - upgrading from Node 18 to Node 22 to support the native
FileAPI used in the SDK. However, there's a minor concern: thepackage.jsonspecifiesengines.node: ">=16", which could mislead users into thinking Node 16-19 is supported when the SDK actually requires Node 20+ for theFileAPI to work properly in Node environments - Consider updating
packages/ts-sdk/package.jsonto reflect the actual Node.js version requirement (>=20)
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| .github/workflows/publish-ts-sdk.yml | 4/5 | Updated Node.js version from 18 to 22 to support the File API used in the TypeScript SDK for file upload functionality |
Sequence Diagram
sequenceDiagram
participant GHA as GitHub Actions
participant Node as Node.js 22
participant Bun as Bun Runtime
participant NPM as NPM Registry
participant SDK as TypeScript SDK
GHA->>GHA: Checkout repository
GHA->>Bun: Setup Bun 1.2.22
GHA->>Node: Setup Node.js 22
Note over Node: Required for File API support
GHA->>Bun: Install dependencies
GHA->>SDK: Run tests
SDK-->>GHA: Tests pass
GHA->>SDK: Build package
SDK->>SDK: Compile TypeScript (uses File API)
SDK-->>GHA: Build artifacts
GHA->>Node: Get package version
Node-->>GHA: Return version
GHA->>NPM: Check if version exists
NPM-->>GHA: Version status
alt Version does not exist
GHA->>NPM: Publish package
NPM-->>GHA: Published successfully
GHA->>GHA: Create GitHub Release
else Version exists
GHA->>GHA: Skip publishing
end
Additional Comments (1)
-
packages/ts-sdk/package.json, line 46-48 (link)syntax: The
engines.nodefield specifies>=16, but the SDK uses the nativeFileAPI (insrc/index.ts:133) which is only available in Node 20+. Update to reflect the actual requirement:
1 file reviewed, 1 comment
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.
Summary
fixed ts sdk publishing job to use later node version bc earlier versions of Node do not support
FiletypeType of Change
Testing
Tested manually
Checklist