Skip to content

Commit

Permalink
Update publish script to add publishing canonicals to manual publish …
Browse files Browse the repository at this point in the history
…as well.
  • Loading branch information
mayank1513 committed Jun 19, 2024
1 parent dbb05ba commit b39eb8f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
3 changes: 3 additions & 0 deletions scripts/manual-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
17 changes: 17 additions & 0 deletions scripts/publish-canonical.js
Original file line number Diff line number Diff line change
@@ -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."',
);
17 changes: 1 addition & 16 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

0 comments on commit b39eb8f

Please sign in to comment.