import { LazyConfig } from 'lazyrepo' const config = { baseCacheConfig: { include: [ '/package.json', '/yarn.lock', '/lazy.config.ts', '/config/**/*', '/scripts/**/*', ], exclude: [ '/coverage/**/*', '/dist*/**/*', '**/*.tsbuildinfo', '/docs/gen/**/*', ], }, scripts: { 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/**/*'], }, }, }, }, dev: { execution: 'independent', runsAfter: { 'refresh-assets': {} }, cache: 'none', workspaceOverrides: { '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 /scripts/refresh-assets.ts`, cache: { inputs: ['package.json', `/scripts/refresh-assets.ts`, `/assets/**/*`], }, }, 'build-types': { execution: 'top-level', baseCommand: `tsx /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, }, }, }, 'api-check': { execution: 'top-level', baseCommand: `tsx /scripts/api-check.ts`, runsAfter: { 'build-api': {} }, cache: { inputs: [`/packages/*/api/public.d.ts`], }, }, }, } satisfies LazyConfig export default config