This repository has been archived by the owner on May 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 114
/
package-scripts.js
176 lines (175 loc) · 4.99 KB
/
package-scripts.js
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
const {
series: { nps: series },
concurrent: { nps: parallel }
} = require("nps-utils");
module.exports = {
scripts: {
default: "nps help",
production: {
build: {
script: series(
"packages.build",
"deploy.catchup",
"production.directory",
"icons.build",
"metadata.build",
"docs.build",
"production.copy.docs",
"sandbox.build"
),
description: "Build for production"
},
directory: {
script: "mkdir -p build",
description: "Create build directory"
},
copy: {
docs: {
script: "cp -r internal/docs/public/* build/",
description: "Copy generated docs site to main production build"
}
},
start: {
script: "serve -s build",
description: "Start production server"
}
},
test: {
ciunit: {
script: series("test.unit")
},
ciintegration: {
script: series("test.integration")
},
civisual: {
script: series("sandbox.build", "test.visual")
},
default: {
script: series("production.build"),
description: "Check if applications build + Run visual tests + Run unit and integration tests"
},
visual: {
script: "node tooling/chromatic.js",
description: "Run chromatic visual tests"
},
unit: {
default: {
script: "cd internal/test && yarn test-unit",
description: "Run unit tests"
},
watch: {
script: "cd internal/test && yarn test-unit-watch",
description: "Run unit tests in watch mode"
}
},
watch: {
script: "cd internal/test && yarn test-watch",
description: "Run all tests in watch mode"
},
coverage: {
script: "cd internal/test && yarn coverage",
description: "Run a coverage report"
},
integration: {
default: {
script: "cd internal/test && yarn test-integration",
description: "Run integration tests"
},
watch: {
script: "cd internal/test && yarn test-integration-watch",
description: "Run integration tests in watch mode"
}
}
},
metadata: {
debug: {
script: "ts-node --project ./tooling/tsconfig.tooling.json tooling/component-metadata --debug",
description: "Generate metadata from components with debug mode"
},
dev: {
script: "ts-node --project ./tooling/tsconfig.tooling.json tooling/component-metadata -w",
description: "Generate metadata from components with watch mode"
},
build: {
script: "ts-node --project ./tooling/tsconfig.tooling.json tooling/component-metadata",
description: "Generate metadata from components"
}
},
docs: {
dev: {
script: parallel("metadata.dev", "icons.dev", "docs.dev_site"),
description: "Start metadata + documentation site in dev mode"
},
static_build: {
script: series(
"packages.build",
"metadata.build",
"icons.build",
"production.directory",
"sandbox.build",
"docs.build",
"production.copy.docs"
),
description: "Start metadata + documentation site in dev mode"
},
dev_site: {
script: "cd internal/docs && yarn dev",
description: "Start documentation site in dev mode"
},
build: {
script: "cd internal/docs && yarn build",
description: "Build documentation site"
}
},
icons: {
dev: {
script: "node tooling/update-icons -w",
description: "Build icons with watch mode"
},
build: {
script: "node tooling/update-icons",
description: "Build icons"
}
},
sandbox: {
dev: {
script: "start-storybook -p 9001 -s build",
description: "Start sandbox in dev mode"
},
build: {
script: "build-storybook -c .storybook -o build/sandbox",
description: "Build sandbox for production"
}
},
packages: {
build: {
default: {
script: "node tooling/build.js",
description: "Build packages for production"
},
dev: {
script: "node tooling/build.js -w",
description: "Build packages in watching mode"
}
}
},
deploy: {
default: {
script: series("deploy.build", "deploy.publish"),
description: "Build and publish new versions of core packages"
},
publish: {
script: "node tooling/publish.js",
description: "Publish new versions of core packages"
},
build: {
script: series("icons.build", "packages.build"),
description: "Build packages for production (packages.build)"
},
catchup: {
script: "node tooling/catchup.js && yarn install",
description: "Catch up with deployed version"
}
}
}
};