Updates
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user