This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 95
/
package-scripts.yml
88 lines (73 loc) · 3.05 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
scripts:
test:
default:
description: Run jest unit tests
script: jest
watch:
description: Run jest unit tests in watch mode
script: nps "test --watch"
withCoverage:
description: Run jest with coverage collection.
script: nps "test --coverage"
up:
description: Wipe node_modules and install all dependencies
script: rimraf node_modules && yarn install
format:
default:
description: Run prettier on the src code
script: prettier --write "src/**/*.js" "decls/**/*.js" "tests/**/*.js" "menus/**/*.json" "keymaps/**/*.json" "styles/**/*.less"
listDifferent:
description: Run a check that all code has been formatted
script: prettier --list-different "src/**/*.js" "decls/**/*.js" "tests/**/*.js" "menus/**/*.json" "keymaps/**/*.json" "styles/**/*.less"
flow:
default:
description: Run Facebook flow
script: flow
up:
description: Update Facebook Flow flow-typed definitions (run this after changing a dependency)
script: flow-typed update
eslint:
description: Run ESlint
script: eslint .
lint:
description: Lint the entire project
script: nps eslint && nps flow && nps format.listDifferent
build:
default:
description: Delete the dist directory and run Babel to build the files
script: rimraf dist && babel src --copy-files --out-dir dist --ignore src/__snapshots__,**.test.js
watch:
description: Build sources with Babel as soon as they change
script: nps "build --watch"
validate:
default:
description: Run several scripts to make sure things look good before committing or on clean install
script: nps format && nps lint && nps test && nps build
extreme:
description: Run validate and also check node_modules for problems and generate contributors
script: nps test && nps format && nps lint && yarn check && nps build && nps generateContributors
ci:
description: Run all CI checks
script: nps lint && nps test.withCoverage && nps checkForDistChanges
reportCoverage:
description: Report coverage stats to codecov. This should be run after the `test` script
script: codecov
commit:
description: Uses commitizen to help us generate well formatted commit messages
script: git-cz
addContributor:
description: When new people contribute to the project, run this
script: all-contributors add
generateContributors:
description: Update the badge and contributors table
script: all-contributors generate
changelog:
description: Wipe and regenerate the changelog. Requires `conventional-changelog-cli`. Run after publishing using `apm publish <version>`.
script: conventional-changelog -p angular -i CHANGELOG.md -s -r 0
checkForDistChanges:
description: Exits nonzero if `dist` directory changes after running build.
script: |
dirty=`git status -s | grep -v '^??' | wc -l | awk '{print $1}'`
echo Found $dirty dirty files. These need to be committed to pass CI.
[ "$dirty" != "0" ] && git diff && exit 1
exit 0