Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/defer-maintainer-validate-review.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 5 additions & 4 deletions packages/intent/src/commands/maintainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -474,6 +472,7 @@ export async function runMaintainerCommand(
const validatedExamples = new Map<string, string>()
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.
Expand All @@ -494,7 +493,9 @@ export async function runMaintainerCommand(
? validatedExamples
: options.json
? new Map<string, string>()
: await describeSkillExamples(
: await (
await import('../validate/blocks.js')
).describeSkillExamples(
project.root,
review.items
.filter((item) => item.kind === 'skill' && !item.problems.length)
Expand Down
Loading