build: offload package.json scripts to ts-node scripts
- Dominant language
- Vue
- Stars
- 126
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
I don't mind the `dep:` scripts, but the others are currently getting out of hand...
I just need these scripts:
- dev
- dev:docs
- publish
And all other things that happen should happen in a ts-node script inside `scripts/`, using the dependency `fs-extra` as much as possible.
Also:
Anything that happens in the `prepare` script should be automated with a watcher somehow:
- whenever anything in `/packages/form` changes, run something similar to the currently set up `prepare:form`
- whenever anything in `/packages/table` changes, run something similar to the currently set up `prepare:table`
- whenever anything in `/packages/utils` changes, execute `npm run build` in that folder
The scripts in package.json shown below should therefore be reduced to just the 3 I mention above.
```
"dev": "npm run prepare && npm run start:dev && cd packages/dev && npm run dev",
"dev:docs": "npm run prepare && npm run start:dev && cd packages/docs && npm run dev",
"dev:vuepress": "npm run prepare && npm run start:dev && cd packages/docs-vuepress && npm run dev",
"test": "lerna run test",
"build": "lerna run build",
"build:utils": "cd packages/utils && npm run build",
"build:form": "cd packages/form && npm run build",
"build:for-publish": "npm run prepare && npm run start:build && lerna run build && npm run build:vue-int && git add -A && git commit -m \"chore: build\" && git push",
"build:favicon": "copyfiles media/* packages/docs/public && cd packages/docs && npm run build:favicon",
"build:vue-int": "lerna run vue-int && ts-node scripts/vueInt.ts",
"build-and-publish": "npm run build:for-publish && npm run publish",
"publish": "lerna publish && npm run publish:post",
"publish:post": "npm run start:dev && git add -A && git commit -m \"chore: post-build\" && git push",
"deploy:docs": "npm run build:for-publish && firebase deploy --only hosting && git add -A && git commit -m \"chore: deploy\" && git push",
"prepare": "npm run prepare:form && npm run prepare:table",
"prepare:form": "npm run copy:form-to-docs && npm run copy:form-to-vuepress && npm run copy:form-to-dev",
"prepare:table": "npm run copy:table-to-docs && npm run copy:table-to-vuepress && npm run copy:table-to-dev",
"copy:form-to-docs": "rimraf packages/docs/src/components/atoms/form && copyfiles --up 3 'packages/form/src/**/*' packages/docs/src/components/atoms/form",
"copy:form-to-vuepress": "rimraf packages/docs-vuepress/src/.vuepress/components/atoms/form && copyfiles --up 3 'packages/form/src/**/*' packages/docs-vuepress/src/.vuepress/components/atoms/form",
"copy:form-to-dev": "rimraf packages/dev/src/components/atoms/form && copyfiles --up 3 'packages/form/src/**/*' packages/dev/src/components/atoms/form",
"copy:table-to-docs": "rimraf packages/docs/src/components/atoms/table && copyfiles --up 3 'packages/table/src/**/*' packages/docs/src/components/atoms/table",
"copy:table-to-vuepress": "rimraf packages/docs-vuepress/src/.vuepress/components/atoms/table && copyfiles --up 3 'packages/table/src/**/*' packages/docs-vuepress/src/.vuepress/components/atoms/table",
"copy:table-to-dev": "rimraf packages/dev/src/components/atoms/table && copyfiles --up 3 'packages/table/src/**/*' packages/dev/src/components/atoms/table",
"replace:dist-src": "replace-in-files --string='\"module\": \"dist/index.js\"' --replacement='\"module\": \"src/index.js\"' 'packages/*/package.json'",
"replace:src-dist": "replace-in-files --string='\"module\": \"src/index.js\"' --replacement='\"module\": \"dist/index.js\"' 'packages/*/package.json'",
"start:dev": "npm run replace:dist-src",
"start:build": "npm run replace:src-dist",
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.