Runner: json-Typ vor eigener Erkennung (R21), Erstdeploy-Rueckfall, json-index beim Veroeffentlichen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8a028ce75a
commit
c256b78dae
5 files changed
+92
-14
No files matched your search
@@ -56,14 +56,18 @@ export function detectProject(files, { mode, index, previewJson } = {}) {
|
||||
const hasDev = hasScript(scripts, 'dev');
|
||||
const m = mode === 'build' || mode === 'dev' ? mode : 'auto';
|
||||
|
||||
const base = { pm, install: installCmd(pm, files), buildCmd: hasBuild ? [pm, 'run', 'build'] : null, devCmd: hasDev ? devCmdFor(pm, devPort) : null, outputDirs, devPort };
|
||||
const base = { index: indexFile, pm, install: installCmd(pm, files), buildCmd: hasBuild ? [pm, 'run', 'build'] : null, devCmd: hasDev ? devCmdFor(pm, devPort) : null, outputDirs, devPort };
|
||||
const asBuild = () => ({ kind: 'build', ...base });
|
||||
const asDev = () => ({ kind: 'dev', ...base });
|
||||
const asStatic = (hint) => ({ kind: 'static', ...base, install: [], buildCmd: null, devCmd: null, outputDirs: [], index: indexFile, ...(hint ? { hint } : {}) });
|
||||
const asStatic = (hint) => ({ kind: 'static', ...base, install: [], buildCmd: null, devCmd: null, outputDirs: [], ...(hint ? { hint } : {}) });
|
||||
|
||||
if (m === 'build') return hasBuild ? asBuild() : { ...asBuild(), error: 'Kein build-Skript in package.json' };
|
||||
if (m === 'dev') return hasDev ? asDev() : { ...asDev(), error: 'Kein dev-Skript in package.json' };
|
||||
|
||||
// R21: .webklar-preview.json-Typ zuerst. 'static' mit index.html bleibt statisch (auch mit build-Skript),
|
||||
// 'node_build' baut ausdrücklich (kein Dev-Rückfall). Ohne Typ: eigene Erkennung.
|
||||
if (pj.type === 'static' && hasIndex) return asStatic();
|
||||
if (pj.type === 'node_build' && hasBuild) return { ...asBuild(), explicitType: true };
|
||||
if (hasIndex && !hasBuild) return asStatic();
|
||||
if (hasBuild) return asBuild();
|
||||
if (hasDev) return asDev();
|
||||
|
||||
Reference in new issue
Block a user