-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.json
360 lines (360 loc) · 9.83 KB
/
tasks.json
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"tasks": {
"build": {
"name": "build",
"description": "Full release build",
"steps": [
{
"spawn": "default"
},
{
"spawn": "pre-compile"
},
{
"spawn": "compile"
},
{
"spawn": "post-compile"
},
{
"spawn": "test"
},
{
"spawn": "package"
}
]
},
"bump": {
"name": "bump",
"description": "Bumps version based on latest git tag and generates a changelog entry",
"env": {
"OUTFILE": "package.json",
"CHANGELOG": "dist/changelog.md",
"BUMPFILE": "dist/version.txt",
"RELEASETAG": "dist/releasetag.txt",
"RELEASE_TAG_PREFIX": "",
"BUMP_PACKAGE": "commit-and-tag-version@^12"
},
"steps": [
{
"builtin": "release/bump-version"
},
{
"exec": "lerna run bump --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
],
"condition": "git log --oneline -1 | grep -qv \"chore(release):\""
},
"clobber": {
"name": "clobber",
"description": "hard resets to HEAD of origin and cleans the local repo",
"env": {
"BRANCH": "$(git branch --show-current)"
},
"steps": [
{
"exec": "git checkout -b scratch",
"name": "save current HEAD in \"scratch\" branch"
},
{
"exec": "git checkout $BRANCH"
},
{
"exec": "git fetch origin",
"name": "fetch latest changes from origin"
},
{
"exec": "git reset --hard origin/$BRANCH",
"name": "hard reset to origin commit"
},
{
"exec": "git clean -fdx",
"name": "clean all untracked files"
},
{
"say": "ready to rock! (unpushed commits are under the \"scratch\" branch)"
}
],
"condition": "git diff --exit-code > /dev/null"
},
"compile": {
"name": "compile",
"description": "Only compile",
"steps": [
{
"exec": "lerna run compile --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"default": {
"name": "default",
"description": "Synthesize project files",
"steps": [
{
"exec": "ts-node --project tsconfig.dev.json .projenrc.ts"
},
{
"exec": "lerna run default --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"docgen": {
"name": "docgen",
"description": "Generate TypeScript API reference docs/",
"steps": [
{
"exec": "lerna run docgen --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"eject": {
"name": "eject",
"description": "Remove projen from the project",
"env": {
"PROJEN_EJECTING": "true"
},
"steps": [
{
"spawn": "default"
},
{
"exec": "lerna run eject --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"eslint": {
"name": "eslint",
"description": "Runs eslint against the codebase",
"env": {
"ESLINT_USE_FLAT_CONFIG": "false"
},
"steps": [
{
"exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern $@ src test build-tools projenrc .projenrc.ts",
"receiveArgs": true
}
]
},
"install": {
"name": "install",
"description": "Install project dependencies and update lockfile (non-frozen)",
"steps": [
{
"exec": "pnpm i --no-frozen-lockfile"
},
{
"exec": "lerna run install --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"install:ci": {
"name": "install:ci",
"description": "Install project dependencies using frozen lockfile",
"steps": [
{
"exec": "pnpm i --frozen-lockfile"
},
{
"exec": "lerna run install:ci --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"package": {
"name": "package",
"description": "Creates the distribution package",
"steps": [
{
"exec": "mkdir -p dist/js"
},
{
"exec": "lerna run package --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
},
{
"exec": "lerna-projen copy-dist packages/mondo-result-types/dist dist"
},
{
"exec": "lerna-projen copy-dist packages/mondo-fetch/dist dist"
}
]
},
"post-compile": {
"name": "post-compile",
"description": "Runs after successful compilation",
"steps": [
{
"spawn": "docgen"
},
{
"exec": "lerna run post-compile --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
},
{
"exec": "lerna-projen move-docs docs/ packages/mondo-result-types docs"
},
{
"exec": "lerna-projen move-docs docs/ packages/mondo-fetch docs"
}
]
},
"post-upgrade": {
"name": "post-upgrade",
"description": "Runs after upgrading dependencies",
"steps": [
{
"exec": "lerna run upgrade --stream"
},
{
"exec": "npx projen"
}
]
},
"pre-compile": {
"name": "pre-compile",
"description": "Prepare the project for compilation",
"steps": [
{
"exec": "lerna-projen clean-dist dist"
},
{
"exec": "lerna run pre-compile --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"publish:github": {
"name": "publish:github",
"description": "Publish this package to GitHub Releases",
"requiredEnv": [
"GITHUB_TOKEN",
"GITHUB_REPOSITORY",
"GITHUB_REF"
],
"steps": [
{
"exec": "test \"$(git branch --show-current)\" = \"main\""
},
{
"exec": "errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q \"Release.tag_name already exists\" $errout; then cat $errout; exit $exitcode; fi"
}
]
},
"publish:npm": {
"name": "publish:npm",
"description": "Publish this package to npm",
"env": {
"NPM_DIST_TAG": "latest",
"NPM_REGISTRY": "registry.npmjs.org",
"NPM_CONFIG_PROVENANCE": "true"
},
"requiredEnv": [
"NPM_TOKEN"
],
"steps": [
{
"exec": "test \"$(git branch --show-current)\" = \"main\""
},
{
"exec": "npx -p publib@latest publib-npm"
}
]
},
"release": {
"name": "release",
"description": "Prepare a release from \"main\" branch",
"env": {
"RELEASE": "true",
"MAJOR": "1"
},
"steps": [
{
"exec": "rm -fr dist"
},
{
"spawn": "bump"
},
{
"spawn": "build"
},
{
"spawn": "unbump"
},
{
"exec": "git diff --ignore-space-at-eol --exit-code"
},
{
"exec": "lerna run release --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"test": {
"name": "test",
"description": "Run tests",
"steps": [
{
"spawn": "eslint"
},
{
"exec": "lerna run test --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"unbump": {
"name": "unbump",
"description": "Restores version to 0.0.0",
"env": {
"OUTFILE": "package.json",
"CHANGELOG": "dist/changelog.md",
"BUMPFILE": "dist/version.txt",
"RELEASETAG": "dist/releasetag.txt",
"RELEASE_TAG_PREFIX": "",
"BUMP_PACKAGE": "commit-and-tag-version@^12"
},
"steps": [
{
"builtin": "release/reset-version"
},
{
"exec": "lerna run unbump --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
},
"upgrade": {
"name": "upgrade",
"description": "upgrade dependencies",
"env": {
"CI": "0"
},
"steps": [
{
"exec": "pnpm dlx npm-check-updates@16 --upgrade --target=minor --peer --no-deprecated --dep=dev,peer,prod,optional --filter=@types/node,eslint-import-resolver-typescript,eslint-plugin-import,lerna,lerna-projen,projen,ts-node,typedoc,typescript"
},
{
"exec": "pnpm i --no-frozen-lockfile"
},
{
"exec": "pnpm update @stylistic/eslint-plugin @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser commit-and-tag-version constructs eslint-import-resolver-typescript eslint-plugin-import eslint lerna lerna-projen projen ts-node typedoc typescript"
},
{
"exec": "npx projen"
},
{
"spawn": "post-upgrade"
}
]
},
"watch": {
"name": "watch",
"description": "Watch & compile in the background",
"steps": [
{
"exec": "tsc --build -w"
},
{
"exec": "lerna run watch --stream --since $(git describe --abbrev=0 --tags --match \"v*\" HEAD^)"
}
]
}
},
"env": {
"PATH": "$(pnpm -c exec \"node --print process.env.PATH\")"
},
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
}