@nelsonlongxiang/dsh-prompt-templates 0.2.10 → 0.4.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,38 +0,0 @@
1
- /**
2
- * Bootstrap the package-local Python backend venv with `uv sync`.
3
- *
4
- * Idempotent: an existing `python/.venv` is only synced, never rebuilt from
5
- * scratch, and no user data under `$DSH_HOME` is touched. Requires `uv` on
6
- * PATH; a missing `uv` fails with a clear diagnostic instead of a broken
7
- * install.
8
- */
9
-
10
- import { spawnSync } from 'node:child_process'
11
- import { existsSync } from 'node:fs'
12
- import { fileURLToPath } from 'node:url'
13
- import { dirname, join } from 'node:path'
14
-
15
- const pkgRoot = dirname(dirname(fileURLToPath(import.meta.url)))
16
- const pythonProject = join(pkgRoot, 'python')
17
-
18
- if (!existsSync(join(pythonProject, 'pyproject.toml'))) {
19
- console.error(`dsh-prompt-templates: python/pyproject.toml missing at ${pythonProject}`)
20
- process.exit(1)
21
- }
22
-
23
- const result = spawnSync('uv', ['sync', '--project', pythonProject], {
24
- stdio: 'inherit',
25
- env: { ...process.env, UV_PROJECT_ENVIRONMENT: join(pythonProject, '.venv'), PYTHONDONTWRITEBYTECODE: '1' },
26
- })
27
-
28
- if (result.error !== undefined) {
29
- console.error(
30
- 'dsh-prompt-templates: `uv` is required to bootstrap the Python backend '
31
- + '(https://docs.astral.sh/uv/). Install uv, then rerun '
32
- + '`node scripts/bootstrap.mjs`.',
33
- )
34
- process.exit(1)
35
- }
36
- if (result.status !== 0) {
37
- process.exit(result.status ?? 1)
38
- }