fix: harden skill discovery

This commit is contained in:
Yichen Jiang
2026-07-05 18:33:27 +08:00
parent f626e569a4
commit dca2cc257d
29 changed files with 555 additions and 61 deletions

View File

@@ -1,4 +1,5 @@
import tsconfigPaths from 'vite-tsconfig-paths'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
export default defineConfig({
@@ -18,6 +19,16 @@ export default defineConfig({
// upstream copies (vendor/README.md). The plugin's `projects` option
// instead applies the one root map to every importer.
plugins: [tsconfigPaths({ projects: ['./tsconfig.json'] })],
resolve: {
// The root tsconfig maps `schemastery` to its vendored TS source, whose
// upstream module shape is `export = Schema`. Vite/Vitest does not synthesize
// a default export for that source file consistently, while the package's
// built ESM artifact does. Tests exercise harness source but can use the
// vendored dependency's built artifact for this CJS-interop boundary.
alias: {
schemastery: fileURLToPath(new URL('./vendor/schemastery/lib/index.mjs', import.meta.url)),
},
},
test: {
include: ['packages/*/*/tests/**/*.spec.ts', 'examples/*/tests/**/*.spec.ts'],
coverage: {