import { LazyConfig } from 'lazyrepo' const config = { baseCacheConfig: { include: [ '/package.json', '/yarn.lock', '/lazy.config.ts', '/internal/config/**/*', '/internal/scripts/**/*', 'package.json', ], exclude: [ '/coverage/**/*', '/dist*/**/*', '/.next*/**/*', '**/*.tsbuildinfo', '/docs/gen/**/*', ], }, scripts: { build: { baseCommand: 'exit 0', runsAfter: { prebuild: {}, 'refresh-assets': {}, 'build-i18n': {}, }, workspaceOverrides: { 'apps/vscode/*': { runsAfter: { 'refresh-assets': {} } }, 'packages/*': { runsAfter: { 'build-api': { in: 'self-only' }, prebuild: { in: 'self-only' } }, cache: { inputs: ['api/**/*', 'src/**/*'], }, }, 'apps/docs': { runsAfter: { 'build-api': { in: 'all-packages' } }, cache: { inputs: [ 'app/**/*', 'api/**/*', 'components/**/*', 'public/**/*', 'scripts/**/*', 'styles/**/*', 'types/**/*', 'utils/**/*', ], }, }, }, }, dev: { execution: 'independent', runsAfter: { predev: {}, 'refresh-assets': {}, 'build-i18n': {} }, cache: 'none', workspaceOverrides: { 'apps/vscode/*': { runsAfter: { build: { in: 'self-only' } } }, }, }, // predev/prebuild are the css-copy scripts. They write generated, gitignored files // (tldraw.css, commenting.css, ...) that lazy doesn't track as outputs, so a cache hit // would skip regenerating a file that's missing on disk and vite would fail to resolve it. // They're a few file copies, so just always run them. predev: { cache: 'none', }, prebuild: { cache: 'none', }, e2e: { cache: 'none', }, 'e2e-x10': { cache: 'none', }, context: { execution: 'independent', cache: 'none', }, 'pack-tarball': { parallel: false, }, 'refresh-assets': { execution: 'top-level', baseCommand: `tsx /internal/scripts/refresh-assets.ts`, cache: { inputs: [ 'package.json', `/internal/scripts/refresh-assets.ts`, `/assets/**/*`, `/apps/dotcom/client/assets/**/*`, `/packages/*/package.json`, ], }, }, 'build-types': { execution: 'top-level', baseCommand: `tsx /internal/scripts/typecheck.ts`, cache: { inputs: { include: ['/**/*.{ts,tsx}', '/tsconfig.json'], exclude: ['/dist*/**/*', '/api/**/*'], }, outputs: ['/*.tsbuildinfo', '/.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, }, }, }, 'build-i18n': { execution: 'independent', cache: { inputs: ['/apps/dotcom/client/public/tla/locales/*.json'], outputs: ['/apps/dotcom/client/public/tla/locales-compiled/*.json'], }, }, 'api-check': { execution: 'top-level', baseCommand: `tsx /internal/scripts/api-check.ts`, runsAfter: { 'build-api': {} }, cache: { inputs: [`/packages/*/api/public.d.ts`], }, }, }, } satisfies LazyConfig export default config