From b8174e296a26b9699b8e21681a46f464b60c4396 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 30 Sep 2026 19:49:16 +0000 Subject: [PATCH] Runner: Erkennung pnpm/yarn-Details Co-Authored-By: Claude Sonnet 5.5 --- runner/src/detect.js | 5 +++-- runner/test/detect.test.js | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/runner/src/detect.js b/runner/src/detect.js index 52952c4..5886985 100644 --- a/runner/src/detect.js +++ b/runner/src/detect.js @@ -33,13 +33,14 @@ function installCmd(pm, files) { ? ['npm', 'ci', '--include=dev'] : ['npm', 'install', '--include=dev', '--no-audit', '--no-fund']; } + if (pm === 'yarn' && files.has('.yarnrc.yml')) return ['yarn', 'install', '--immutable']; // Yarn Berry return [pm, 'install', '--frozen-lockfile']; } -// npm/pnpm brauchen `--` vor den Skript-Argumenten, yarn/bun reichen sie direkt durch. +// Nur npm braucht `--` vor den Skript-Argumenten, pnpm/yarn/bun reichen sie direkt durch. function devCmdFor(pm, port) { const args = ['--host', '0.0.0.0', '--port', String(port)]; - return pm === 'npm' || pm === 'pnpm' ? [pm, 'run', 'dev', '--', ...args] : [pm, 'run', 'dev', ...args]; + return pm === 'npm' ? [pm, 'run', 'dev', '--', ...args] : [pm, 'run', 'dev', ...args]; } export function detectProject(files, { mode, index, previewJson } = {}) { diff --git a/runner/test/detect.test.js b/runner/test/detect.test.js index 01ae6e7..d51b063 100644 --- a/runner/test/detect.test.js +++ b/runner/test/detect.test.js @@ -38,7 +38,12 @@ test('pnpm-lock ⇒ pnpm', () => { assert.equal(r.pm, 'pnpm'); assert.deepEqual(r.install, ['pnpm', 'install', '--frozen-lockfile']); assert.deepEqual(r.buildCmd, ['pnpm', 'run', 'build']); - assert.deepEqual(r.devCmd, ['pnpm', 'run', 'dev', '--', '--host', '0.0.0.0', '--port', '5173']); + assert.deepEqual(r.devCmd, ['pnpm', 'run', 'dev', '--host', '0.0.0.0', '--port', '5173']); +}); + +test('yarn Berry (.yarnrc.yml) ⇒ --immutable', () => { + const r = detectProject(fake({ 'package.json': pkg({ build: 'x' }), 'yarn.lock': '', '.yarnrc.yml': '' }), {}); + assert.deepEqual(r.install, ['yarn', 'install', '--immutable']); }); test('yarn.lock und bun.lockb/bun.lock', () => {