-
-
Notifications
You must be signed in to change notification settings - Fork 631
/
package-scripts.yml
65 lines (61 loc) · 2.77 KB
/
package-scripts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
scripts:
lint:
description: Run all linters (eslint, tsc)
script: concurrently --prefix "[{name}]" --names "ESLINT" -c "blue,yellow,magenta,orange" "nps eslint"
eslint:
default:
description: Run eslint.
script: eslint . --ext ".js,.jsx,.ts"
fix:
description: Run eslint and auto-fix.
script: nps "eslint --fix"
debug:
description: Run eslint in debug mode.
script: DEBUG=eslint:cli-engine nps eslint
build:
prepack:
description: Build the project in the prepack script.
# This is necessary when used as a Git dependency since we don't have the dist directory in the repo.
# Depending on the package manager, `prepack`, `prepare`, or both may be run.
# They may also be run when publishing or in other cases, so we want to cover all of them.
# 1. If the project is already built, do nothing;
# 2. Build the project but ignore TypeScript errors from missing devDependencies;
# 3. Check if the project is built now;
# 4. If it failed, print an error message (still follow https://docs.npmjs.com/cli/v8/using-npm/scripts#best-practices).
script: >
[ -f node_package/lib/ReactOnRails.js ] ||
(npm run build >/dev/null 2>&1 || true) &&
[ -f node_package/lib/ReactOnRails.js ] ||
{ echo 'Building react-on-rails seems to have failed!'; }
format:
default:
description: Format files using prettier.
script: concurrently --prefix "[{name}]" --names "ts,js,json" -c "yellow,magenta,green" "nps format.js" "nps format.json"
listDifferent:
description: Check that all files were formatted using prettier.
script: |
concurrently \
--prefix "[{name}]" \
--names "ts,js,json" \
-c "yellow,magenta" \
"nps format.js.listDifferent" \
"nps format.json.listDifferent"
js:
default:
description: Run prettier-eslint on JS.
#script: prettier "packages/**/*.@(js|jsx)" "spec/dummy/client/app/**/*.@(js|jsx)" "webpack.config.babel.js" "webpack/**/*.js" --write
script: prettier "**/*.@(js|jsx)" --write
listDifferent:
description: Check if any JS files would change by running prettier-eslint.
# script: prettier "**/*.@(js|jsx)" "webpack.config.babel.js" "webpack/**/*.js" --list-different
script: prettier "**/*.@(js|jsx)" --list-different
json:
default:
description: Run prettier on JSON files.
script: rm -rf packages/vm-renderer/tests/tmp && prettier "**/*.json" --write
listDifferent:
description: Check if any JSON files would change by running prettier-eslint.
script: prettier "**/*.json" --list-different
renderer:
description: Starts the node renderer.
script: node renderer.js