Skip to content

Commit

Permalink
Fix publish script and format
Browse files Browse the repository at this point in the history
mayank1513 committed Jun 5, 2024
1 parent 738dd96 commit 6f02e19
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"repository": "github:react18-tools/nextjs-themes-ultra",
"repository": "github:react18-tools/nextjs-themes-ultra.git",
"bugs": "https://github.com/react18-tools/nextjs-themes-ultra/issues",
"homepage": "https://github.com/react18-tools/nextjs-themes-ultra/#readme",
"sideEffects": false,
10 changes: 7 additions & 3 deletions scripts/publish.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** It is assumed that this is called only from the default branch. */
const { execSync, exec } = require("child_process");
const { execSync } = require("child_process");
const fs = require("fs");
const path = require("path");

@@ -55,7 +55,11 @@ const pkgPath = path.join(__dirname, "../lib/package.json");
const publishCanonical = canonical => {
pkgJSON.name = canonical;
fs.writeFileSync(pkgPath, JSON.stringify(pkgJSON, null, 2));
exec("cd lib && pnpm build && npm publish --provenance --access public");
try {
execSync("cd lib && pnpm build && npm publish --provenance --access public");
} catch (e) {
console.error(e);
}
};

canonicals.forEach(publishCanonical);
@@ -70,7 +74,7 @@ liteCanonicals.forEach(publishCanonical);
const toDeprecate = ["@mayank1513/nthul", "@mayank1513/nthul-lite"];

toDeprecate.forEach(pkg =>
exec(
execSync(
`npm deprecate ${pkg} "Please use <https://www.npmjs.com/package/${pkg.slice("/")[1]}> 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.`,
),
);

0 comments on commit 6f02e19

Please sign in to comment.