Skip to content

Commit

Permalink
update package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
codingki committed Jul 1, 2024
1 parent 8c4de49 commit 34371c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"vitest": "^1.2.2"
},
"publishConfig": {
"access": "public",
"provenance": true
"access": "public"
}
}
4 changes: 3 additions & 1 deletion packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions packages/widget/scripts/prepublish.js
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 34371c8

Please sign in to comment.