diff --git a/packages/core/package.json b/packages/core/package.json index 90268a28..277c0d72 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -61,7 +61,6 @@ "vitest": "^1.2.2" }, "publishConfig": { - "access": "public", - "provenance": true + "access": "public" } } diff --git a/packages/widget/package.json b/packages/widget/package.json index 1745fe40..08151159 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -27,7 +27,9 @@ "dev": "rollup --config rollup.config.js -w", "build": "rollup --config rollup.config.js", "lint": "eslint src --ext .ts", - "chains:generate": "tsx ./src/scripts/codegen.ts" + "chains:generate": "tsx ./src/scripts/codegen.ts", + "postpublish": "git reset --hard", + "prepublishOnly": "node scripts/prepublish.js" }, "peerDependencies": { "react": "17.x || 18.x", diff --git a/packages/widget/scripts/prepublish.js b/packages/widget/scripts/prepublish.js new file mode 100644 index 00000000..bbd12d0c --- /dev/null +++ b/packages/widget/scripts/prepublish.js @@ -0,0 +1,16 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ + +const fs = require("fs/promises"); +const path = require("path"); +const packageJson = require("../package.json"); + +async function prepublish() { + delete packageJson.scripts; + delete packageJson.devDependencies; + const targetPath = path.resolve(process.cwd(), "package.json"); + await fs.writeFile(targetPath, JSON.stringify(packageJson, null, 2), { + encoding: "utf-8", + }); +} + +void prepublish();