-
Notifications
You must be signed in to change notification settings - Fork 170
Expand file tree
/
Copy pathlage.config.mjs
More file actions
94 lines (90 loc) · 3.04 KB
/
lage.config.mjs
File metadata and controls
94 lines (90 loc) · 3.04 KB
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
/** @type {import('lage').ConfigOptions} */
const config = {
npmClient: 'yarn',
pipeline: {
// ── Per-package tasks ──────────────────────────────────────────────────
'build-cjs': {
// cjs builds need to wait for the esm builds to produce the type definitions
dependsOn: ['^build-core', '^build-cjs'],
inputs: ['*', 'src/**/*', 'assets/**/*'],
outputs: ['lib-commonjs/**/*'],
},
'build-core': {
// the core build does esm builds (which produce type definitions used by both cjs and esm builds)
// this also handles noEmit packages which should be run in sequence with other packages
dependsOn: ['^build-core'],
inputs: ['*', 'src/**/*', 'assets/**/*'],
outputs: ['lib/**/*'],
},
'build-all': {
dependsOn: ['build-core', 'build-cjs'],
inputs: ['*', 'src/**/*', 'assets/**/*'],
outputs: ['lib/**/*', 'lib-commonjs/**/*'],
},
bundle: {
inputs: ['**/*', '!node_modules/**/*', '!dist/**/*', '!lib/**/*', '!lib-commonjs/**/*'],
outputs: ['dist/**/*'],
},
clean: {
cache: false,
},
lint: {
inputs: ['*', 'src/**/*'],
outputs: [],
},
'lint-package': {
inputs: ['**/*', '!node_modules/**/*', '!dist/**/*', '!lib/**/*', '!lib-commonjs/**/*'],
outputs: [],
},
test: {
dependsOn: ['build-all'],
inputs: [],
outputs: [],
},
// ── Root-only tasks (scripts exist only in the root package.json) ──────
// These run once for the whole repo. Sub-packages do not have these scripts,
// so lage naturally scopes them to the root workspace.
'check-publishing': {
cache: false,
},
'format:check': {
cache: false,
},
'lint-lockfile': {
cache: false,
},
// ── Pipeline aliases ───────────────────────────────────────────────────
'repo-checks': ['lint-lockfile', 'format:check', 'check-publishing'],
buildci: ['build-all', 'test', 'lint', 'lint-package', 'repo-checks'],
// ── Worker tasks ───────────────────────────────────────────────────────
pack: {
dependsOn: ['build-all', '^pack'],
type: 'worker',
options: {
worker: 'scripts/src/worker/pack.mts',
outputDir: '_packed',
},
cache: false,
},
publish: {
dependsOn: ['^publish'],
type: 'worker',
options: {
worker: 'scripts/src/worker/publish.mts',
outputDir: '_packed',
},
cache: false,
},
'publish:dry-run': {
dependsOn: ['^publish:dry-run'],
type: 'worker',
options: {
worker: 'scripts/src/worker/publish.mts',
outputDir: '_packed',
dryRun: true,
},
cache: false,
},
},
};
export default config;