This commit is contained in:
Raven Scott
2026-04-05 04:33:14 -04:00
parent 4af98ef97b
commit 904ad7e7fd
48 changed files with 1905 additions and 219 deletions
+7 -9
View File
@@ -19,18 +19,16 @@ ensure_root_deps() {
fi
}
# Pear bundles each package dir; hoisted deps live at repo root — symlink + real copy of workspace protocol.
# Pear mirrors from each package dir. npm workspaces often leave a *partial* `node_modules/`
# under the package (e.g. only workspace copies) while the rest hoists to the repo root — Pear
# then stages without `hyperswarm`, etc. Always rebuild flat symlinks from root (same as
# `npm run os:seeder` / ensure-pear-node-modules), then overlay the workspace protocol package.
prepare_pkg_for_pear() {
local pkg="$1"
local nm="$pkg/node_modules"
if [[ -L "$nm" ]]; then
:
elif [[ -d "$nm" ]]; then
log "WARN: $nm is a real directory (not symlink). Skipping node_modules symlink; ensure dependencies are available."
else
log "Linking $nm -> ../../node_modules"
ln -sf ../../node_modules "$nm"
fi
local rel="${pkg#"$ROOT"/}"
log "Mirroring root node_modules → $rel/node_modules (ensure-pear-node-modules)"
(cd "$ROOT" && node scripts/ensure-pear-node-modules.mjs "$rel")
rm -rf "$nm/bare-os-protocol"
log "Copying bare-os-protocol into $(basename "$pkg")/node_modules"
cp -R "$PROTO" "$nm/bare-os-protocol"