From 0608e9336ffca85fc1c404913c25d0c6b60c4a81 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Thu, 9 Nov 2023 12:09:21 +0100 Subject: [PATCH 1/2] chore: fix npm release preparation scripts, add .npmrc and release script --- .npmrc | 2 ++ package.json | 17 +++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000000..b15c08c1bdd --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +//registry.npmjs.org/:_authToken=${NPM_TOKEN} +lockfile-version=2 diff --git a/package.json b/package.json index bfc13ff392c..0b2a7d58ee6 100644 --- a/package.json +++ b/package.json @@ -37,18 +37,19 @@ "comment_prepare_1": "echo scripts in this section automatically prepare releases. Intended for use by maintainers only.", "comment_prepare_2": "echo experimental preparation scripts only prepare experimental packages", - "prepare_release:experimental:patch": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_patch && npm run _restore:lerna", - "prepare_release:experimental:minor": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_minor && npm run _restore:lerna", + "prepare_release:experimental:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_patch && npm run _restore:package-json", + "prepare_release:experimental:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_minor && npm run _restore:package-json", "comment_prepare_3": "echo sdk preparation scripts prepare all stable and experimental packages", - "prepare_release:sdk:patch": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:version_patch && npm run _restore:lerna", - "prepare_release:sdk:minor": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:version_minor && npm run _restore:lerna", + "prepare_release:sdk:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_patch && npm run _restore:package-json", + "prepare_release:sdk:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:version_minor && npm run _restore:package-json", + "release:publish": "lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access", "comment_internal": "echo scripts below this line are for internal use", "_check:no_changes": "if [ ! -z \"$(git status -uall --porcelain)\" ]; then echo Please ensure all changes are committed; exit 1; fi", - "_backup:lerna": "cp lerna.json lerna.json.backup", - "_restore:lerna": "mv lerna.json.backup lerna.json", - "_lerna:remove_api": "node -e 'var fs=require(\"fs\");var l=require(\"./lerna.json\");l.packages=l.packages.filter(p=>p!==\"api\");fs.writeFileSync(\"lerna.json\",JSON.stringify(l,null,2))'", - "_lerna:remove_stable": "node -e 'var fs=require(\"fs\");var l=require(\"./lerna.json\");l.packages=l.packages.filter(p=>p!==\"packages/*\");fs.writeFileSync(\"lerna.json\",JSON.stringify(l,null,2))'", + "_backup:package-json": "cp package.json package.json.backup", + "_restore:package-json": "mv package.json.backup package.json", + "_lerna:remove_api": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"api\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'", + "_lerna:remove_stable": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.packages=p.workspaces.filter(p=>p!==\"packages/*\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'", "_lerna:version_patch": "npx lerna version patch --exact --no-git-tag-version --no-push --yes", "_lerna:version_minor": "npx lerna version minor --exact --no-git-tag-version --no-push --yes" }, From 459addb5a2a8a8297eb6aa1bdc028e740da5d438 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Fri, 10 Nov 2023 09:29:58 +0100 Subject: [PATCH 2/2] apply review comments Co-authored-by: Trent Mick --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b2a7d58ee6..c3d7c59f301 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "_backup:package-json": "cp package.json package.json.backup", "_restore:package-json": "mv package.json.backup package.json", "_lerna:remove_api": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"api\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'", - "_lerna:remove_stable": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.packages=p.workspaces.filter(p=>p!==\"packages/*\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'", + "_lerna:remove_stable": "node -e 'var fs=require(\"fs\");var p=require(\"./package.json\");p.workspaces=p.workspaces.filter(p=>p!==\"packages/*\");fs.writeFileSync(\"package.json\",JSON.stringify(p,null,2))'", "_lerna:version_patch": "npx lerna version patch --exact --no-git-tag-version --no-push --yes", "_lerna:version_minor": "npx lerna version minor --exact --no-git-tag-version --no-push --yes" },