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
7 changes: 4 additions & 3 deletions packages/dsh-loopx-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ deferred atomicity limit are specified in the versioned

## Install

Requirements are Node.js 22.19+, `pnpm`, Python 3.11+ with `pip`, and network
access for the first DSH start when no compatible LoopX CLI is already
installed. LoopX itself is deliberately not a prerequisite. The initializer
Requirements are stable Node.js 22.22.3+ (excluding Node.js 23), `pnpm`,
Python 3.11+ with `pip`, and network access for the first DSH start when no
compatible LoopX CLI is already installed. LoopX itself is deliberately not a
prerequisite. The initializer
honors an explicit `PYTHON_BIN`; otherwise it tries `python3`, then discovers
`python3.<minor>` executables on the supplied `PATH` in descending numeric
order, then tries the bare name `python`. The last name is what a python.org
Expand Down
7 changes: 4 additions & 3 deletions packages/dsh-loopx-plugin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ need node
need pnpm

node -e '
const [major, minor] = process.versions.node.split(".").map(Number)
if (!((major === 22 && minor >= 19) || major >= 24)) process.exit(1)
if (!/^\d+\.\d+\.\d+$/.test(process.versions.node)) process.exit(1)
const [major, minor, patch] = process.versions.node.split(".").map(Number)
if (!((major === 22 && (minor > 22 || (minor === 22 && patch >= 3))) || major >= 24)) process.exit(1)
' || {
echo "install: Node.js 22.19+ (excluding Node.js 23) is required" >&2
echo "install: Node.js 22.22.3+ (excluding Node.js 23 and prereleases) is required" >&2
exit 2
}
pnpm_version="$(pnpm --version)"
Expand Down
2 changes: 1 addition & 1 deletion packages/dsh-loopx-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"NOTICE"
],
"engines": {
"node": "^22.19.0 || >=24.0.0"
"node": "^22.22.3 || >=24.0.0"
},
"scripts": {
"build": "node scripts/build.mjs",
Expand Down
29 changes: 28 additions & 1 deletion packages/dsh-loopx-plugin/smoke/dsh-peer-range-smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,37 @@ import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { satisfies, validRange } from 'semver'
import { runInNewContext } from 'node:vm'
import { minVersion, satisfies, validRange } from 'semver'

const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)))
const manifest = JSON.parse(await readFile(join(packageRoot, 'package.json'), 'utf8'))
const runtimeManifest = JSON.parse(await readFile(join(packageRoot, '../../package.json'), 'utf8'))
assert.equal(minVersion(manifest.engines.node).version, minVersion(runtimeManifest.engines.node).version,
'the plugin must not advertise a Node version below the LoopX runtime minimum')

const installer = await readFile(join(packageRoot, 'install.sh'), 'utf8')
const guard = installer.match(/node -e '([\s\S]*?)'\s*\|\|/)
assert(guard, 'the source installer must check Node before installing dependencies')
for (const [version, expected] of [
['22.19.0', false], ['22.22.2', false], ['22.22.3-rc.1', false],
['22.22.3', true], ['22.23.0', true], ['22.23.0-rc.1', false],
['23.0.0', false], ['24.0.0-rc.1', false], ['24.0.0', true], ['24.20.0', true],
]) {
assert.equal(satisfies(version, manifest.engines.node), expected, `package Node range: ${version}`)
const rejected = Symbol('unsupported Node')
let admitted = true
try {
runInNewContext(guard[1], { process: {
versions: { node: version },
exit(code) { assert.equal(code, 1); throw rejected },
} })
} catch (error) {
if (error !== rejected) throw error
admitted = false
}
assert.equal(admitted, expected, `source installer Node guard: ${version}`)
}

for (const [name, range] of Object.entries(manifest.peerDependencies ?? {})) {
if (!name.startsWith('@deepseek-ai/')) continue
Expand Down
Loading