diff --git a/scripts/manual-publish.js b/scripts/manual-publish.js index 1781464c..6ccf2a5e 100644 --- a/scripts/manual-publish.js +++ b/scripts/manual-publish.js @@ -75,3 +75,6 @@ execSync(`cd lib && pnpm build && npm publish --provenance --access public --tag execSync( `gh release create ${NEW_VERSION} --generate-notes${isLatestRelease ? " --latest" : ""} -n "$(sed '1,/^## /d;/^## /,$d' CHANGELOG.md)" --title "Release v${NEW_VERSION}"`, ); + +// Publish canonical packages +execSync("node scripts/publish-canonical.js"); diff --git a/scripts/publish-canonical.js b/scripts/publish-canonical.js new file mode 100644 index 00000000..0c47e744 --- /dev/null +++ b/scripts/publish-canonical.js @@ -0,0 +1,17 @@ +// Publish canonical packages +[ + "@mayank1513\\/r18gs", + "react18-global-store", + "react18-store", + "react19-global-store", + "react19-store", + "r19gs", +].forEach(pkg => { + execSync(`sed -i -e "s/name.*/name\\": \\"${pkg}\\",/" lib/package.json`); + execSync("cd lib && npm publish --provenance --access public"); +}); + +// Mark deprecated +execSync( + 'npm deprecate @mayank1513/r18gs "Please use https://www.npmjs.com/package/r18gs instead. We initially created scoped packages to have similarities with the GitHub Public Repository (which requires packages to be scoped). We are no longer using GPR and thus deprecating all scoped packages for which corresponding un-scoped packages exist."', +); diff --git a/scripts/publish.js b/scripts/publish.js index 5312cb68..9e040554 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -48,19 +48,4 @@ execSync( ); // Publish canonical packages -[ - "@mayank1513\\/r18gs", - "react18-global-store", - "react18-store", - "react19-global-store", - "react19-store", - "r19gs", -].forEach(pkg => { - execSync(`sed -i -e "s/name.*/name\\": \\"${pkg}\\",/" lib/package.json`); - execSync("cd lib && npm publish --provenance --access public"); -}); - -// Mark deprecated -execSync( - 'npm deprecate @mayank1513/r18gs "Please use https://www.npmjs.com/package/r18gs instead. We initially created scoped packages to have similarities with the GitHub Public Repository (which requires packages to be scoped). We are no longer using GPR and thus deprecating all scoped packages for which corresponding un-scoped packages exist."', -); +execSync("node scripts/publish-canonical.js");