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
2 changes: 1 addition & 1 deletion .vite-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
set -eu

# Regenerate skill reference + SKILL metadata (needs bailian-cli-core dist).
# Regenerate skill reference + SKILL metadata from source (no package build).
pnpm run sync:skill-assets

# Stage generator output so it is included in this commit.
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/lint-toolchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

- [ ] `.vite-hooks/pre-commit` 改动后,`pnpm install` 重新软链(走 `prepare: vp config`)
- [ ] 增加 hook 时,确认在干净 clone 后能自动激活
- [ ] pre-commit 会跑 `pnpm run sync:skill-assets`(先 build core,再 `generate:reference` + `sync:skill-version`)并 `git add` skill 资产,最后 `vp staged`
- [ ] pre-commit 会跑 `pnpm run sync:skill-assets`(`generate:reference` 含格式化 + `sync:skill-version`,直接读源码、无需先 build)并 `git add` skill 资产,最后 `vp staged`

### F. CI / 发版工具

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"ready": "vp check && vp run -r test && vp run -r build",
"prepare": "vp config",
"check": "vp check",
"sync:skill-assets": "pnpm --filter \"bailian-cli^...\" run build && pnpm --filter bailian-cli run generate:reference && pnpm --filter bailian-cli run sync:skill-version",
"sync:skill-assets": "pnpm --filter bailian-cli run generate:reference && pnpm --filter bailian-cli run sync:skill-version",
"dev": "pnpm -F bailian-cli-core dev",
"bl": "pnpm -F bailian-cli dev",
"kscli": "pnpm -F knowledge-studio-cli dev",
Expand Down
9 changes: 5 additions & 4 deletions tools/generate-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
*
* Run: pnpm --filter bailian-cli run generate:reference
* Also run via `pnpm run sync:skill-assets` or the repo pre-commit hook.
* Uses tsx because workspace packages resolve to source locally.
* Requires built `bailian-cli-core` for shared flag constants.
* Uses tsx and reads workspace packages from source
*/
import { mkdirSync, readdirSync, rmSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
Expand All @@ -19,8 +18,10 @@ import {
MODEL_AUTH_FLAGS,
OPENAPI_AUTH_FLAGS,
credentialFlagDefs,
} from "../packages/core/dist/index.mjs";
import type { AnyCommand, FlagDef, FlagsDef } from "../packages/core/src/index.ts";
type AnyCommand,
type FlagDef,
type FlagsDef,
} from "../packages/core/src/index.ts";
import { commands } from "../packages/cli/src/commands.ts";

const __dirname = dirname(fileURLToPath(import.meta.url));
Expand Down