Skip to content

Implement npm release flow based on SDK reference#1

Merged
towanTG merged 6 commits intomainfrom
chore/npm-release-flow
Feb 26, 2026
Merged

Implement npm release flow based on SDK reference#1
towanTG merged 6 commits intomainfrom
chore/npm-release-flow

Conversation

@towanTG
Copy link
Contributor

@towanTG towanTG commented Feb 26, 2026

Implement npm release flow based on SDK reference

Using the findings from the prior investigation task (task-api-sdk-1772109916543), implement a complete npm release flow for the api-sdk-typescript repo. Reference the SDK principal's workspace (swapkit/sdk) for the existing GitHub Actions workflows, package.json publish config, versioning strategy, and changesets setup. Adapt and implement an equivalent pipeline for this repo. Key areas: GitHub Actions release workflow, npm publish config, version management (changesets or similar), CI checks before publish. Query the sdk principal's workspace if you need to inspect specific files from their setup.


Created by Dominion principal-api-sdk

- Create .gitignore with node_modules, dist, .tgz, .env, .DS_Store
- Create .npmrc with npm registry
- Add clean, type-check, and prepublishOnly scripts to package.json
Adds CI workflow that runs type-check and build on PRs to main.
Uses Node.js 22 on ubuntu-latest with actions/checkout@v4 and
actions/setup-node@v4.
Publishes to npm on push to main with OIDC provenance.
Uses concurrency group to prevent parallel publishes.
Requires NPM_TOKEN secret in repo settings.
- Add version-change detection to release workflow (compare against npm
  registry, skip publish if version unchanged)
- Add path filtering to release trigger (only src/, package.json, tsconfig.json)
- Add type-check step to release workflow before publish
- Add push trigger to CI so main branch pushes also run checks
- Add npm dependency caching to both CI and release workflows
- Add type-check to prepublishOnly script for defense-in-depth
- Remove src/ from package files array (dist/ has .d.ts for type support)
- Fix index.ts imports to match auto-generated SDK function names
  (getSwapTo, postV3Quote, postV3Swap, postTrack, postScreen, getGas,
  postPriceCachedPrice, postChainflipBrokerChannel)
setup-node@v4 with cache: 'npm' requires a lock file in the repo.
The lock file was generated but not committed, causing both CI and
Release workflows to fail.
@towanTG
Copy link
Contributor Author

towanTG commented Feb 26, 2026

Dominion CI fix (check build failure):

Fixed CI build failure by committing the missing package-lock.json file. The setup-node@v4 action with cache: 'npm' requires a lock file in the repository. The file was generated locally but never committed. Verified type-check and build pass locally before committing.

@@ -0,0 +1,20 @@
name: CI
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should use bun for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in general this is a bun repo - so no package lock

// SwapKitService — single unified service class with all SDK methods
// ---------------------------------------------------------------------------

import {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

do not change the code it is generated by another repo and just pushed here - if ci is an issue - disable it for now

- Convert CI and release workflows from npm to bun (oven-sh/setup-bun)
- Revert src/index.ts to original generated state (not our code to modify)
- Remove package-lock.json, add bun.lock (this is a bun repo)
- Disable both workflows (workflow_dispatch only) until codegen syncs
  src/index.ts exports with src/sdk.ts
- Update prepublishOnly to use bun

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@towanTG
Copy link
Contributor Author

towanTG commented Feb 26, 2026

Dominion fix (comment feedback from @towanTG):

Fixed all 3 review comments: (1) Converted CI and release workflows from npm/node to bun (oven-sh/setup-bun), (2) Reverted src/index.ts to its original generated state — the file is auto-generated by another repo and should not be modified here, (3) Removed package-lock.json and added bun.lock since this is a bun repo. Both CI and release workflows are disabled (workflow_dispatch only) until the codegen repo pushes synced index.ts/sdk.ts exports.

@towanTG towanTG merged commit cc2dd95 into main Feb 26, 2026
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