Fix Bare dockerode failure: polyfill Node url.resolve
Release rolling / release (push) Has been cancelled

docker-modem calls url.resolve/parse/format, which bare-url does not
implement. Map bare url imports to build/shims/node-url.cjs so the
standalone peardock-server can talk to the Docker socket again.
This commit is contained in:
Raven Scott
2026-07-11 15:34:12 -04:00
parent ff8a96a48a
commit 2e51c49526
4 changed files with 314 additions and 2 deletions
+12
View File
@@ -82,6 +82,18 @@ function buildImportsMap() {
default: typeof map[spec] === 'object' && map[spec]?.default ? map[spec].default : spec,
}
}
// bare-pack resolves relative "bare" import targets poorly from nested
// node_modules — absolutize repo-local shims (e.g. ./build/shims/node-url.cjs).
for (const [spec, target] of Object.entries(map)) {
if (!target || typeof target !== 'object') continue
if (typeof target.bare === 'string' && target.bare.startsWith('./')) {
map[spec] = {
...target,
bare: fileURL(target.bare.replace(/^\.\//, '')),
}
}
}
return map
}