dsh-multi-chat 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,63 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Regenerate tsconfig.vitest.json from the vendored harness workspace's
4
- * tsconfig.base.json paths map.
5
- *
6
- * The vitest config resolves every `@deepseek-ai/*` import to harness
7
- * sources through vite-tsconfig-paths. The base map's targets are relative
8
- * to harness-src/, while tsconfig.vitest.json lives at the repo root, so
9
- * every target is rewritten with a `harness-src/` prefix (and the locale
10
- * source fixture import the tests use is added — the base wildcards do not
11
- * cover it).
12
- *
13
- * Run after updating harness-src/: `node scripts/sync-vitest-paths.mjs`
14
- */
15
- import { readFileSync, writeFileSync } from 'node:fs'
16
- import { fileURLToPath } from 'node:url'
17
- import { dirname, resolve } from 'node:path'
18
-
19
- const ROOT = dirname(dirname(fileURLToPath(import.meta.url)))
20
- const basePath = resolve(ROOT, 'harness-src/tsconfig.base.json')
21
- const outPath = resolve(ROOT, 'tsconfig.vitest.json')
22
-
23
- // Strip JSONC comments (line // and block /* */), preserving string contents.
24
- function stripJsonc(source) {
25
- let out = ''
26
- let inString = false
27
- for (let i = 0; i < source.length; i++) {
28
- const c = source[i]
29
- const n = source[i + 1]
30
- if (inString) {
31
- out += c
32
- if (c === '\\') { out += n ?? ''; i++ }
33
- else if (c === '"') inString = false
34
- continue
35
- }
36
- if (c === '"') { inString = true; out += c; continue }
37
- if (c === '/' && n === '/') { while (i < source.length && source[i] !== '\n') i++; continue }
38
- if (c === '/' && n === '*') {
39
- i += 2
40
- while (i < source.length && !(source[i] === '*' && source[i + 1] === '/')) i++
41
- i++
42
- continue
43
- }
44
- out += c
45
- }
46
- return out
47
- }
48
-
49
- const base = JSON.parse(stripJsonc(readFileSync(basePath, 'utf8')))
50
- const paths = {}
51
- for (const [key, targets] of Object.entries(base.compilerOptions.paths)) {
52
- paths[key] = targets.map(target => (target.startsWith('./') ? `harness-src/${target.slice(2)}` : target))
53
- }
54
- // Deep locale source import used by the test suite; not covered by the base
55
- // wildcards (the generic `@deepseek-ai/dsh-*` map mis-substitutes subpaths).
56
- paths['@deepseek-ai/dsh-client-locale/src/*'] = ['harness-src/packages/client/locale/src/*']
57
-
58
- const result = {
59
- extends: './harness-src/tsconfig.base.json',
60
- compilerOptions: { paths },
61
- }
62
- writeFileSync(outPath, `${JSON.stringify(result, null, 2)}\n`, 'utf8')
63
- console.log(`tsconfig.vitest.json: ${Object.keys(paths).length} path entries`)