forked from tldraw/tldraw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lazy.config.ts
121 lines (118 loc) · 3.07 KB
/
lazy.config.ts
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
import { LazyConfig } from 'lazyrepo'
export function generateSharedScripts(bublic: '<rootDir>' | '<rootDir>/bublic') {
return {
build: {
baseCommand: 'exit 0',
runsAfter: { prebuild: {}, 'refresh-assets': {} },
workspaceOverrides: {
'{bublic/,}apps/vscode/*': { runsAfter: { 'refresh-assets': {} } },
'{bublic/,}packages/*': {
runsAfter: { 'build-api': { in: 'self-only' }, prebuild: { in: 'self-only' } },
cache: {
inputs: ['api/**/*', 'src/**/*'],
},
},
},
},
dev: {
execution: 'independent',
runsAfter: { 'refresh-assets': {} },
cache: 'none',
workspaceOverrides: {
'{bublic/,}apps/vscode/*': { runsAfter: { build: { in: 'self-only' } } },
},
},
test: {
baseCommand: 'yarn run -T jest',
runsAfter: { 'refresh-assets': {} },
cache: {
inputs: {
exclude: ['*.tsbuildinfo'],
},
},
},
'test-coverage': {
baseCommand: 'yarn run -T jest --coverage',
runsAfter: { 'refresh-assets': {} },
},
lint: {
execution: 'independent',
runsAfter: { 'build-types': {} },
cache: {
inputs: {
exclude: ['*.tsbuildinfo'],
},
},
},
'pack-tarball': {
parallel: false,
},
'refresh-assets': {
execution: 'top-level',
baseCommand: `tsx ${bublic}/scripts/refresh-assets.ts`,
cache: {
inputs: ['package.json', `${bublic}/scripts/refresh-assets.ts`, `${bublic}/assets/**/*`],
},
},
'build-types': {
execution: 'top-level',
baseCommand: `tsx ${bublic}/scripts/typecheck.ts`,
cache: {
inputs: {
include: ['<allWorkspaceDirs>/**/*.{ts,tsx}', '<allWorkspaceDirs>/tsconfig.json'],
exclude: ['<allWorkspaceDirs>/dist*/**/*', '<allWorkspaceDirs>/api/**/*'],
},
outputs: ['<allWorkspaceDirs>/*.tsbuildinfo', '<allWorkspaceDirs>/.tsbuild/**/*'],
},
runsAfter: {
'refresh-assets': {},
'maybe-clean-tsbuildinfo': {},
},
},
'build-api': {
execution: 'independent',
cache: {
inputs: ['.tsbuild/**/*.d.ts', 'tsconfig.json'],
outputs: ['api/**/*'],
},
runsAfter: {
'build-types': {
// Because build-types is top level, if usesOutput were set to true every
// build-api task would depend on all the .tsbuild files in the whole
// repo. So we set this to false and configure it to use only the
// local .tsbuild files
usesOutput: false,
},
},
},
'api-check': {
execution: 'top-level',
baseCommand: `tsx ${bublic}/scripts/api-check.ts`,
runsAfter: { 'build-api': {} },
cache: {
inputs: [`${bublic}/packages/*/api/public.d.ts`],
},
},
} satisfies LazyConfig['scripts']
}
const config = {
baseCacheConfig: {
include: [
'<rootDir>/{,bublic/}package.json',
'<rootDir>/{,bublic/}public-yarn.lock',
'<rootDir>/{,bublic/}lazy.config.ts',
'<rootDir>/{,bublic/}config/**/*',
'<rootDir>/{,bublic/}scripts/**/*',
],
exclude: [
'<allWorkspaceDirs>/coverage/**/*',
'<allWorkspaceDirs>/dist*/**/*',
'**/*.tsbuildinfo',
'<rootDir>/{,bublic/}docs/gen/**/*',
],
},
scripts: {
...generateSharedScripts('<rootDir>'),
},
} satisfies LazyConfig
export default config