From 6321b7fe84369243b05425d79a6bfea5f1117590 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Thu, 7 Nov 2024 11:58:31 -0500 Subject: [PATCH 1/2] chore: remove some ci automation no longer needed Signed-off-by: Todd Baert --- .github/workflows/audit-pending-releases.yml | 15 --------------- CONTRIBUTING.md | 10 ++++++++++ package.json | 4 +--- packages/server/package.json | 7 +++---- packages/web/package.json | 4 ++-- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.github/workflows/audit-pending-releases.yml b/.github/workflows/audit-pending-releases.yml index 3616ad441..968b32dac 100644 --- a/.github/workflows/audit-pending-releases.yml +++ b/.github/workflows/audit-pending-releases.yml @@ -32,18 +32,3 @@ jobs: node-version: 18 registry-url: "https://registry.npmjs.org" cache: 'npm' - - # if this is an @openfeature/core release, but the SDKs to use this version as a peer, and commit back - - name: Update Peer Version in Dependants - if: ${{ endsWith(github.ref_name, env.CORE_PACKAGE) }} - run: | - npm run update-core-peers && \ - ! git diff-files --quiet && \ - ( echo 'Updated peer dependency in dependents, committing...' - git add --all && \ - git config user.name "openfeature-peer-update-bot" && \ - git config user.email "openfeature-peer-update-bot@openfeature.dev" && \ - git commit -m 'fix: bump @openfeature/${{ env.CORE_PACKAGE }} peer' -s && \ - git push ) || echo 'Peer dependency in dependents is already up to date.' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad3bae738..f71141cbd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -120,6 +120,16 @@ on each other), the owner should try to get people aligned by: - If none of the above worked and the PR has been stuck for more than 2 weeks, the owner should bring it to the OpenFeatures [meeting](README.md#contributing). +## Releasing + +As with most OpenFeature repos, release-please supports our release process. +For this SDK specifically, keep in mind this is a monorepo with dependencies with between components. +If there are multiple release PRs open, ensure that you release them in order consistent with their dependency graph, waiting for each to fully complete. +For example, if there are pending releases for: `@openfeature/core`, `@openfeature/web-sdk` and `@openfeature/react-sdk`, release them in that order. + +Also ensure that if there are changes in an artifact which depend on changes in a dependency, that you reflect that in the `peerDependencies` field. +For example, if a new release of `@openfeature/web-sdk` depends on features added in `@openfeature/core`, update the required minimum version of the `@openfeature/core` peer in the `@openfeature/web-sdk` package.json. + ## Design Choices As with other OpenFeature SDKs, js-sdk follows the diff --git a/package.json b/package.json index 1dc75a8b4..77983c522 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,7 @@ "clean": "shx rm -rf ./dist", "build": "npm run build --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/angular --workspace=packages/nest", "publish-all": "npm run publish-if-not-exists --workspace=packages/shared --workspace=packages/server --workspace=packages/web --workspace=packages/react --workspace=packages/angular --workspace=packages/nest", - "docs": "typedoc", - "core-version": "npm run version --workspace=packages/shared", - "update-core-peers": "export OPENFEATURE_CORE_VERSION=$(npm run --silent core-version) && npm run update-core-peer --workspace=packages/server --workspace=packages/web" + "docs": "typedoc" }, "repository": { "type": "git", diff --git a/packages/server/package.json b/packages/server/package.json index b10767112..596b9fff1 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -25,8 +25,7 @@ "postbuild": "shx cp ./../../package.esm.json ./dist/esm/package.json", "current-version": "echo $npm_package_version", "prepack": "shx cp ./../../LICENSE ./LICENSE", - "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi", - "update-core-peer": "npm install --save-peer --save-exact @openfeature/core@$OPENFEATURE_CORE_VERSION" + "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi" }, "repository": { "type": "git", @@ -49,9 +48,9 @@ "node": ">=18" }, "peerDependencies": { - "@openfeature/core": "1.5.0" + "@openfeature/core": "^1.5.0" }, "devDependencies": { - "@openfeature/core": "1.5.0" + "@openfeature/core": "^1.5.0" } } diff --git a/packages/web/package.json b/packages/web/package.json index 81c8871be..7d45559d3 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -47,9 +47,9 @@ }, "homepage": "https://github.com/open-feature/js-sdk#readme", "peerDependencies": { - "@openfeature/core": "1.5.0" + "@openfeature/core": "^1.5.0" }, "devDependencies": { - "@openfeature/core": "1.5.0" + "@openfeature/core": "^1.5.0" } } From 6276993d58c608dbdd2bd818f48f5a14a71cf498 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Thu, 7 Nov 2024 12:01:44 -0500 Subject: [PATCH 2/2] fixup: web too Signed-off-by: Todd Baert --- packages/web/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/web/package.json b/packages/web/package.json index 7d45559d3..05b8067fb 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -25,8 +25,7 @@ "postbuild": "shx cp ./../../package.esm.json ./dist/esm/package.json", "current-version": "echo $npm_package_version", "prepack": "shx cp ./../../LICENSE ./LICENSE", - "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi", - "update-core-peer": "npm install --save-peer --save-exact @openfeature/core@$OPENFEATURE_CORE_VERSION" + "publish-if-not-exists": "cp $NPM_CONFIG_USERCONFIG .npmrc && if [ \"$(npm show $npm_package_name@$npm_package_version version)\" = \"$(npm run current-version -s)\" ]; then echo 'already published, skipping'; else npm publish --access public; fi" }, "repository": { "type": "git",