diff --git a/bootstrap/cms/clawdie-site/package.json b/bootstrap/cms/clawdie-site/package.json index c994cd1..b0bbbb5 100644 --- a/bootstrap/cms/clawdie-site/package.json +++ b/bootstrap/cms/clawdie-site/package.json @@ -21,8 +21,5 @@ "@astrojs/check": "^0.9.6", "typescript": "^5.9.3", "tsx": "^4.19.2" - }, - "overrides": { - "zod": "3.25.76" } } diff --git a/setup/cms.ts b/setup/cms.ts index 889878c..22077f4 100644 --- a/setup/cms.ts +++ b/setup/cms.ts @@ -161,14 +161,29 @@ function ensureCmsDocsBootstrapMounted( } } - ensureSymlinkOnlyWhenMissing( - path.join(astroRootOnHost, 'src'), - `${mountTarget}/src`, - ); - ensureSymlinkOnlyWhenMissing( - path.join(astroRootOnHost, 'scripts'), - `${mountTarget}/scripts`, - ); + for (const dir of ['src', 'scripts']) { + const destPath = path.join(astroRootOnHost, dir); + const srcPath = path.join(mountTargetOnHost, dir); + if (!fs.existsSync(srcPath)) continue; + // Remove stale symlink if present — symlinks break Vite path resolution + try { + if (fs.lstatSync(destPath).isSymbolicLink()) { + fs.rmSync(destPath, { force: true }); + } + } catch (err) { + const e = err as NodeJS.ErrnoException; + if (e.code !== 'ENOENT') throw e; + } + fs.mkdirSync(destPath, { recursive: true }); + const result = spawnSync( + 'rsync', + ['-a', '--delete', `${srcPath}/`, `${destPath}/`], + { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'] }, + ); + if ((result.status ?? 1) !== 0) { + logger.warn({ dir, error: result.stderr }, `Failed to sync ${dir} from bootstrap`); + } + } } // ── Starlight project template content ────────────────────────────────── @@ -196,9 +211,6 @@ function starlightPackageJson(): string { typescript: '^5.9.3', tsx: '^4.19.2', }, - overrides: { - zod: '3.25.76', - }, }, null, 2, @@ -424,7 +436,6 @@ function ensureStarlightPackage(astroRoot: string): boolean { const updated = JSON.parse(JSON.stringify(pkg)) as { dependencies?: Record; devDependencies?: Record; - overrides?: Record; }; updated.dependencies = updated.dependencies || {}; @@ -443,10 +454,6 @@ function ensureStarlightPackage(astroRoot: string): boolean { ensureDep(updated.devDependencies, '@astrojs/check', '^0.9.6'); ensureDep(updated.devDependencies, 'typescript', '^5.9.3'); ensureDep(updated.devDependencies, 'tsx', '^4.19.2'); - updated.overrides = updated.overrides || {}; - if (!updated.overrides.zod) { - updated.overrides.zod = '3.25.76'; - } const next = JSON.stringify(updated, null, 2); if (next !== currentNormalized) {