mirror of
https://github.com/CryptKeeperZK/semaphore.git
synced 2026-01-08 23:17:58 -05:00
chore(cli): create a script to remove unnecessary files in monorepo templates
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
"build:libraries": "yarn workspaces foreach -t --no-private run build",
|
||||
"compile:contracts": "yarn workspace contracts compile",
|
||||
"download:snark-artifacts": "rimraf snark-artifacts && ts-node scripts/download-snark-artifacts.ts",
|
||||
"remove:template-files": "ts-node scripts/remove-template-files.ts",
|
||||
"test": "yarn test:libraries && yarn test:contracts",
|
||||
"test:libraries": "jest --coverage",
|
||||
"test:contracts": "yarn workspace contracts test:coverage",
|
||||
@@ -18,7 +19,7 @@
|
||||
"prettier:write": "prettier -w .",
|
||||
"docs": "yarn workspaces foreach --no-private run docs",
|
||||
"version:bump": "yarn workspaces foreach --no-private version -d ${0} && yarn version apply --all && git commit -am \"chore: v${0}\" && git tag v${0}",
|
||||
"version:publish": "yarn build:libraries && yarn workspaces foreach --no-private npm publish --tolerate-republish --access public",
|
||||
"version:publish": "yarn build:libraries && yarn remove:template-files && yarn workspaces foreach --no-private npm publish --tolerate-republish --access public",
|
||||
"version:release": "changelogithub",
|
||||
"commit": "cz",
|
||||
"precommit": "lint-staged",
|
||||
|
||||
24
scripts/remove-template-files.ts
Normal file
24
scripts/remove-template-files.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { rmSync } from "fs"
|
||||
|
||||
async function main() {
|
||||
const templates = ["cli-template-monorepo-ethers", "cli-template-monorepo-subgraph"]
|
||||
const files: string[] = [
|
||||
"contracts/build",
|
||||
"contracts/cache",
|
||||
"contracts/node_modules",
|
||||
"web-app/node_modules",
|
||||
"web-app/.next",
|
||||
"web-app/next-env.d.ts"
|
||||
]
|
||||
|
||||
templates.map((template) =>
|
||||
files.map((file) => rmSync(`packages/${template}/apps/${file}`, { recursive: true, force: true }))
|
||||
)
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
Reference in New Issue
Block a user