tldraw/lazy.config.ts

116 lines
2.8 KiB
TypeScript
Raw Normal View History

2023-04-25 11:01:25 +00:00
import { LazyConfig } from 'lazyrepo'
const config = {
baseCacheConfig: {
include: [
'<rootDir>/package.json',
'<rootDir>/yarn.lock',
'<rootDir>/lazy.config.ts',
'<rootDir>/config/**/*',
'<rootDir>/scripts/**/*',
],
exclude: [
'<allWorkspaceDirs>/coverage/**/*',
'<allWorkspaceDirs>/dist*/**/*',
'**/*.tsbuildinfo',
'<rootDir>/docs/gen/**/*',
],
},
scripts: {
2023-04-25 11:01:25 +00:00
build: {
baseCommand: 'exit 0',
runsAfter: { prebuild: {}, 'refresh-assets': {} },
workspaceOverrides: {
'apps/vscode/*': { runsAfter: { 'refresh-assets': {} } },
'packages/*': {
runsAfter: { 'build-api': { in: 'self-only' }, prebuild: { in: 'self-only' } },
cache: {
inputs: ['api/**/*', 'src/**/*'],
},
},
},
2023-04-25 11:01:25 +00:00
},
dev: {
execution: 'independent',
runsAfter: { predev: {}, 'refresh-assets': {} },
2023-04-25 11:01:25 +00:00
cache: 'none',
workspaceOverrides: {
'apps/vscode/*': { runsAfter: { build: { in: 'self-only' } } },
},
},
2023-04-25 11:01:25 +00:00
test: {
baseCommand: 'yarn run -T jest',
runsAfter: { 'refresh-assets': {} },
cache: {
inputs: {
exclude: ['*.tsbuildinfo'],
},
},
2023-04-25 11:01:25 +00:00
},
2023-05-02 12:25:26 +00:00
'test-coverage': {
2023-04-25 11:01:25 +00:00
baseCommand: 'yarn run -T jest --coverage',
runsAfter: { 'refresh-assets': {} },
2023-04-25 11:01:25 +00:00
},
lint: {
execution: 'independent',
2023-05-02 12:25:26 +00:00
runsAfter: { 'build-types': {} },
cache: {
inputs: {
exclude: ['*.tsbuildinfo'],
},
},
2023-04-25 11:01:25 +00:00
},
'pack-tarball': {
parallel: false,
},
'refresh-assets': {
execution: 'top-level',
baseCommand: `tsx <rootDir>/scripts/refresh-assets.ts`,
2023-04-25 11:01:25 +00:00
cache: {
inputs: ['package.json', `<rootDir>/scripts/refresh-assets.ts`, `<rootDir>/assets/**/*`],
2023-04-25 11:01:25 +00:00
},
},
2023-05-02 12:25:26 +00:00
'build-types': {
2023-04-25 11:01:25 +00:00
execution: 'top-level',
baseCommand: `tsx <rootDir>/scripts/typecheck.ts`,
2023-04-25 11:01:25 +00:00
cache: {
inputs: {
2023-05-02 12:25:26 +00:00
include: ['<allWorkspaceDirs>/**/*.{ts,tsx}', '<allWorkspaceDirs>/tsconfig.json'],
exclude: ['<allWorkspaceDirs>/dist*/**/*', '<allWorkspaceDirs>/api/**/*'],
2023-04-25 11:01:25 +00:00
},
2023-05-02 12:25:26 +00:00
outputs: ['<allWorkspaceDirs>/*.tsbuildinfo', '<allWorkspaceDirs>/.tsbuild/**/*'],
2023-04-25 11:01:25 +00:00
},
runsAfter: {
'refresh-assets': {},
'maybe-clean-tsbuildinfo': {},
},
},
2023-05-02 12:25:26 +00:00
'build-api': {
2023-04-25 11:01:25 +00:00
execution: 'independent',
cache: {
inputs: ['.tsbuild/**/*.d.ts', 'tsconfig.json'],
2023-05-02 12:25:26 +00:00
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,
},
2023-04-25 11:01:25 +00:00
},
},
2023-05-02 12:25:26 +00:00
'api-check': {
2023-04-25 11:01:25 +00:00
execution: 'top-level',
baseCommand: `tsx <rootDir>/scripts/api-check.ts`,
2023-05-02 12:25:26 +00:00
runsAfter: { 'build-api': {} },
2023-04-25 11:01:25 +00:00
cache: {
inputs: [`<rootDir>/packages/*/api/public.d.ts`],
2023-04-25 11:01:25 +00:00
},
},
},
} satisfies LazyConfig
export default config