Implement npm release flow based on SDK reference#1
Conversation
- 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.
|
Dominion CI fix (check 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 | |||
There was a problem hiding this comment.
we should use bun for this
There was a problem hiding this comment.
in general this is a bun repo - so no package lock
| // SwapKitService — single unified service class with all SDK methods | ||
| // --------------------------------------------------------------------------- | ||
|
|
||
| import { |
There was a problem hiding this comment.
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>
|
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. |
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