From bfff80c3e8b2c805f4cbeed063981f0b908b5c27 Mon Sep 17 00:00:00 2001 From: Jared Lunde Date: Tue, 23 Jun 2026 12:37:48 -0700 Subject: [PATCH] release(sdk): publish @beyond.dev/flags alongside @beyond.dev/kv at 0.2.0 The Release SDK workflow only published @beyond.dev/kv, so the flags adapter and OpenFeature providers added in #9 had no path to npm. Wire the workflow to publish both packages from the same sdk/v* tag (lockstep): - release-sdk.yml: set the tag version on both kv and flags (--allow-same-version), pin flags' @beyond.dev/kv dependency to ^, build all workspaces, then publish kv first and flags second so the pinned dependency is resolvable the moment flags lands. - Bump @beyond.dev/kv and @beyond.dev/flags to 0.2.0 and replace the flags "@beyond.dev/kv": "*" dependency with "^0.2.0"; sync package-lock. Verified: both packages' export maps fully resolve to built files, npm pack --dry-run includes every dist target (kv: index/next/cache; flags: index/adapter/4 middleware/2 openfeature), full flags suite 153/153 green, all workspaces typecheck. Note: publishing @beyond.dev/flags via OIDC requires it to be registered as a trusted publisher on npm (same as @beyond.dev/kv). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/release-sdk.yml | 19 ++++++++++++++----- sdk/ts/flags/package.json | 4 ++-- sdk/ts/kv/package.json | 2 +- sdk/ts/package-lock.json | 18 +++++++++++++++--- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-sdk.yml b/.github/workflows/release-sdk.yml index 7a25fb8..98e3068 100644 --- a/.github/workflows/release-sdk.yml +++ b/.github/workflows/release-sdk.yml @@ -16,17 +16,26 @@ jobs: - uses: jdx/mise-action@v4 - name: install:ts run: mise run install:ts - - name: set version + - name: set versions + # The tag drives the version for every published package (lockstep). + # @beyond.dev/flags depends on @beyond.dev/kv, so pin that dependency to + # the same release rather than letting consumers float to any version. run: | VERSION=${GITHUB_REF_NAME#sdk/v} - npm version "$VERSION" --no-git-tag-version - # @beyond.dev/kv lives in the workspace package, not the (private) sdk/ts root - working-directory: sdk/ts/kv + npm version "$VERSION" --no-git-tag-version --allow-same-version -w @beyond.dev/kv + npm version "$VERSION" --no-git-tag-version --allow-same-version -w @beyond.dev/flags + VERSION="$VERSION" node -e "const fs=require('fs');const f='flags/package.json';const p=JSON.parse(fs.readFileSync(f));p.dependencies['@beyond.dev/kv']='^'+process.env.VERSION;fs.writeFileSync(f,JSON.stringify(p,null,2)+'\n')" + working-directory: sdk/ts - name: build:ts run: mise run build:ts - name: upgrade npm # OIDC trusted publishing requires npm >= 11.5.1; node LTS ships npm 10. run: npm install -g npm@latest - - name: publish + # @beyond.dev/kv is published first so @beyond.dev/flags' pinned dependency + # on it is resolvable the moment flags lands on the registry. + - name: publish @beyond.dev/kv run: npm publish --access public working-directory: sdk/ts/kv + - name: publish @beyond.dev/flags + run: npm publish --access public + working-directory: sdk/ts/flags diff --git a/sdk/ts/flags/package.json b/sdk/ts/flags/package.json index 000ab6e..cfde3b1 100644 --- a/sdk/ts/flags/package.json +++ b/sdk/ts/flags/package.json @@ -1,6 +1,6 @@ { "name": "@beyond.dev/flags", - "version": "0.1.0", + "version": "0.2.0", "type": "module", "repository": { "type": "git", @@ -57,7 +57,7 @@ "test:watch": "vitest" }, "dependencies": { - "@beyond.dev/kv": "*", + "@beyond.dev/kv": "^0.2.0", "std-env": "^3.9.0", "tslib": "^2.8.1" }, diff --git a/sdk/ts/kv/package.json b/sdk/ts/kv/package.json index d77ab0b..0ec5bc0 100644 --- a/sdk/ts/kv/package.json +++ b/sdk/ts/kv/package.json @@ -1,6 +1,6 @@ { "name": "@beyond.dev/kv", - "version": "0.1.0", + "version": "0.2.0", "type": "module", "repository": { "type": "git", diff --git a/sdk/ts/package-lock.json b/sdk/ts/package-lock.json index 8815e1c..7d7bead 100644 --- a/sdk/ts/package-lock.json +++ b/sdk/ts/package-lock.json @@ -13,9 +13,9 @@ }, "flags": { "name": "@beyond.dev/flags", - "version": "0.1.0", + "version": "0.2.0", "dependencies": { - "@beyond.dev/kv": "*", + "@beyond.dev/kv": "^0.2.0", "std-env": "^3.9.0", "tslib": "^2.8.1" }, @@ -39,6 +39,9 @@ "node": ">=18" }, "peerDependencies": { + "@openfeature/core": ">=1.11", + "@openfeature/server-sdk": ">=1.22", + "@openfeature/web-sdk": ">=1.9", "express": ">=4", "fastify": ">=4", "fastify-plugin": ">=4", @@ -47,6 +50,15 @@ "next": ">=14" }, "peerDependenciesMeta": { + "@openfeature/core": { + "optional": true + }, + "@openfeature/server-sdk": { + "optional": true + }, + "@openfeature/web-sdk": { + "optional": true + }, "express": { "optional": true }, @@ -271,7 +283,7 @@ }, "kv": { "name": "@beyond.dev/kv", - "version": "0.1.0", + "version": "0.2.0", "dependencies": { "ioredis": "^5.10.1", "openapi-fetch": "^0.17.0",