refactor: introduce watch command (#28453)

Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

This is part of my work for hack day, but I wanted to tackle the
following problems:

1. There is no easy way to have angular, angular-server, vue,
vue-router, react, and react-router automatically recompile when you
make a change. Right now you have to manually run `npm run build` every
time you make a change.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Adds `npm run build.watch` to let developers easily watch for changes
in each project.
## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->
This commit is contained in:
Liam DeBeasi
2023-11-09 11:50:19 -05:00
committed by GitHub
parent 61b6bd0a0a
commit aeeb84b77d
6 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,7 @@
"test": "echo 'angular no tests yet'", "test": "echo 'angular no tests yet'",
"build": "ng-packagr -p ng-package.json -c tsconfig.json", "build": "ng-packagr -p ng-package.json -c tsconfig.json",
"build.prod": "npm run clean && npm run build", "build.prod": "npm run clean && npm run build",
"build.watch": "npm run build -- --watch",
"clean": "rm -rf ./dist", "clean": "rm -rf ./dist",
"lint": "eslint . --ext .ts && npm run prettier", "lint": "eslint . --ext .ts && npm run prettier",
"lint.fix": "eslint . --ext .ts --fix && npm run prettier.fix", "lint.fix": "eslint . --ext .ts --fix && npm run prettier.fix",

View File

@ -28,6 +28,7 @@
"build.core": "node scripts/build-core.js", "build.core": "node scripts/build-core.js",
"build.link": "npm run build && node scripts/link-copy.js", "build.link": "npm run build && node scripts/link-copy.js",
"build.ng": "ng-packagr -p ng-package.json -c tsconfig.json", "build.ng": "ng-packagr -p ng-package.json -c tsconfig.json",
"build.watch": "npm run build.ng -- --watch",
"clean": "node scripts/clean.js", "clean": "node scripts/clean.js",
"clean-generated": "node ./scripts/clean-generated.js", "clean-generated": "node ./scripts/clean-generated.js",
"lint": "npm run eslint && npm run prettier -- --write --cache", "lint": "npm run eslint && npm run prettier -- --write --cache",

View File

@ -21,6 +21,7 @@
}, },
"scripts": { "scripts": {
"build": "npm run clean && npm run compile", "build": "npm run clean && npm run compile",
"build.watch": "npm run compile -- --watch",
"clean": "rimraf dist", "clean": "rimraf dist",
"compile": "rollup -c", "compile": "rollup -c",
"eslint": "eslint src", "eslint": "eslint src",

View File

@ -21,6 +21,7 @@
}, },
"scripts": { "scripts": {
"build": "npm run clean && npm run copy && npm run compile", "build": "npm run clean && npm run copy && npm run compile",
"build.watch": "npm run compile -- --watch",
"clean": "rimraf dist && rimraf routing", "clean": "rimraf dist && rimraf routing",
"compile": "rollup -c", "compile": "rollup -c",
"eslint": "eslint src", "eslint": "eslint src",

View File

@ -10,6 +10,7 @@
"lint.fix": "npm run eslint -- --fix && npm run prettier -- --write --cache", "lint.fix": "npm run eslint -- --fix && npm run prettier -- --write --cache",
"bundle": "rollup --config rollup.config.mjs", "bundle": "rollup --config rollup.config.mjs",
"build": "npm run clean && npm run bundle", "build": "npm run clean && npm run bundle",
"build.watch": "npm run bundle -- --watch",
"clean": "rimraf dist", "clean": "rimraf dist",
"sync": "sh ./scripts/sync.sh" "sync": "sh ./scripts/sync.sh"
}, },

View File

@ -9,6 +9,7 @@
"lint.fix": "npm run eslint -- --fix && npm run prettier -- --write --cache", "lint.fix": "npm run eslint -- --fix && npm run prettier -- --write --cache",
"test": "jest", "test": "jest",
"build": "npm run clean && npm run copy && npm run copy.overlays && npm run bundle && npm run build.vetur && npm run build.web-types", "build": "npm run clean && npm run copy && npm run copy.overlays && npm run bundle && npm run build.vetur && npm run build.web-types",
"build.watch": "npm run bundle -- --watch",
"bundle": "rollup --config rollup.config.mjs", "bundle": "rollup --config rollup.config.mjs",
"clean": "rimraf dist", "clean": "rimraf dist",
"build.web-types": "node ./scripts/build-web-types.js", "build.web-types": "node ./scripts/build-web-types.js",