Fix Bare dockerode failure: polyfill Node url.resolve
Release rolling / release (push) Has been cancelled
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user