diff --git a/.changeset/defer-maintainer-validate-review.md b/.changeset/defer-maintainer-validate-review.md new file mode 100644 index 00000000..f7eeee63 --- /dev/null +++ b/.changeset/defer-maintainer-validate-review.md @@ -0,0 +1,5 @@ +--- +'@tanstack/intent': patch +--- + +Load `validate` and `review` command modules in `intent maintainer` only when the requested action uses them. `maintainer setup`, `add`, `remove`, and `sync` no longer evaluate the validation, example-checking, and review command bundles at startup; behavior does not change. diff --git a/packages/intent/src/commands/maintainer.ts b/packages/intent/src/commands/maintainer.ts index 8034c061..71370e5e 100644 --- a/packages/intent/src/commands/maintainer.ts +++ b/packages/intent/src/commands/maintainer.ts @@ -21,14 +21,11 @@ import { } from '../maintainer/distribution.js' import { planSetupGithubActions } from '../setup/index.js' import { detectIntentCommandPackageManager } from '../shared/command-runner.js' -import { describeSkillExamples } from '../validate/blocks.js' import { getMetaDir } from './support.js' import { buildMaintainerGuidanceBlock, planIntentSkillsBlock, } from './install/guidance.js' -import { runReviewCommand } from './review.js' -import { runValidateCommand } from './validate.js' import type { DistributionOptions } from '../maintainer/distribution.js' import type { ReviewPrompts } from '../review/interactive.js' @@ -326,6 +323,7 @@ export async function runMaintainerCommand( await runInteractiveReview(process.cwd(), options.base, prompts) return } + const { runReviewCommand } = await import('./review.js') runReviewCommand(undefined, options) return } @@ -474,6 +472,7 @@ export async function runMaintainerCommand( const validatedExamples = new Map() let validation: unknown if (action === 'check') { + const { runValidateCommand } = await import('./validate.js') // Include default workspace skills and any custom registered roots. Their errors land in // one report and one summary section, and the failure is rethrown after // the check summary below so the two sections keep their order. @@ -494,7 +493,9 @@ export async function runMaintainerCommand( ? validatedExamples : options.json ? new Map() - : await describeSkillExamples( + : await ( + await import('../validate/blocks.js') + ).describeSkillExamples( project.root, review.items .filter((item) => item.kind === 'skill' && !item.problems.length)