@softarc/native-federation-orchestrator 4.6.0 → 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ var baseURL = (() => {
10
10
  })();
11
11
  var activeMap = EMPTY_MAP;
12
12
  var hostInstanceKeys = /* @__PURE__ */ Object.create(null);
13
+ var lastRemoteBaseURL;
13
14
  function initialize(data = {}) {
14
15
  if (data.initialImportMap) {
15
16
  activeMap = normalize(data.initialImportMap);
@@ -31,7 +32,22 @@ async function resolve(specifier, context, nextResolve) {
31
32
  if (Object.prototype.hasOwnProperty.call(hostInstanceKeys, specifier)) {
32
33
  return { url: HOST_PREFIX + encodeURIComponent(specifier), shortCircuit: true };
33
34
  }
34
- const mapped = resolveSpecifier(activeMap, specifier, context.parentURL);
35
+ const effectiveParent = context.parentURL || lastRemoteBaseURL;
36
+ let mapped = resolveSpecifier(activeMap, specifier, effectiveParent);
37
+ if (!mapped) {
38
+ const isRelative = specifier.startsWith("/") || specifier.startsWith("./") || specifier.startsWith("../");
39
+ try {
40
+ if (isRelative && effectiveParent) {
41
+ mapped = new URL(specifier, effectiveParent).href;
42
+ } else if (/^https?:\/\//.test(specifier)) {
43
+ mapped = specifier;
44
+ }
45
+ } catch {
46
+ }
47
+ }
48
+ if (mapped && (mapped.startsWith("http://") || mapped.startsWith("https://"))) {
49
+ return { url: mapped, format: "module", shortCircuit: true };
50
+ }
35
51
  return nextResolve(mapped ?? specifier, context);
36
52
  }
37
53
  async function load(url, context, nextLoad) {
@@ -44,12 +60,13 @@ async function load(url, context, nextLoad) {
44
60
  };
45
61
  }
46
62
  if (url.startsWith("http://") || url.startsWith("https://")) {
63
+ lastRemoteBaseURL = url;
47
64
  const res = await fetch(url);
48
65
  if (!res.ok) {
49
66
  throw new Error(`Failed to fetch module from ${url}: ${res.status} ${res.statusText}`);
50
67
  }
51
68
  const source = await res.text();
52
- return { shortCircuit: true, format: "module", source };
69
+ return { shortCircuit: true, format: "module", source, responseURL: url };
53
70
  }
54
71
  if (!url.startsWith("node:")) {
55
72
  context.format = "module";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/scripts/node-loader.ts"],
4
- "sourcesContent": ["/**\n * Node.js module customization hooks for native-federation.\n *\n * Registered via `module.register(<this file>, import.meta.url, { data: { port }, transferList: [port] })`\n * from the orchestrator. The main thread posts the resolved import map over the\n * MessagePort whenever it changes; this loader rewrites `import` specifiers\n * accordingly and fetches http(s) modules into the loader as source text.\n */\n\nimport type { MessagePort } from 'node:worker_threads';\n\ntype Imports = Record<string, string>;\ntype Scopes = Record<string, Imports>;\ntype ImportMap = { imports: Imports; scopes?: Scopes };\n\n/** Per-specifier list of export names to re-export from the host's published instances. */\ntype HostInstanceKeys = Record<string, string[]>;\n\ntype InitData = {\n port?: MessagePort;\n initialImportMap?: ImportMap;\n};\n\ntype IncomingMessage =\n | { type: 'set-import-map'; map: ImportMap }\n | { type: 'set-host-instances'; keys?: HostInstanceKeys };\n\nconst EMPTY_MAP: ImportMap = Object.freeze({ imports: {}, scopes: {} });\n\n/** Synthetic URL scheme for specifiers bridged to the host's instances. */\nconst HOST_PREFIX = 'nf-host:';\n/** Global key on the main thread holding `{ [specifier]: namespaceObject }`. */\nconst HOST_INSTANCES_GLOBAL = '__NF_HOST_INSTANCES__';\n\nconst baseURL = (() => {\n const cwd = process.cwd();\n const url = new URL('file://');\n url.pathname = cwd.endsWith('/') ? cwd : cwd + '/';\n return url.href.endsWith('/') ? url.href : url.href + '/';\n})();\n\nlet activeMap: ImportMap = EMPTY_MAP;\nlet hostInstanceKeys: HostInstanceKeys = Object.create(null);\n\nexport function initialize(data: InitData = {}): void {\n if (data.initialImportMap) {\n activeMap = normalize(data.initialImportMap);\n }\n if (data.port) {\n data.port.on('message', (msg: IncomingMessage) => {\n if (msg && msg.type === 'set-import-map') {\n activeMap = normalize(msg.map);\n data.port!.postMessage({ type: 'import-map-applied' });\n } else if (msg && msg.type === 'set-host-instances') {\n hostInstanceKeys = msg.keys ?? Object.create(null);\n data.port!.postMessage({ type: 'host-instances-applied' });\n }\n });\n data.port.unref?.();\n }\n}\n\ntype ResolveContext = { parentURL?: string };\ntype ResolveResult = { url: string; format?: string | null; shortCircuit?: boolean };\ntype NextResolve = (specifier: string, context?: ResolveContext) => Promise<ResolveResult>;\n\nexport async function resolve(\n specifier: string,\n context: ResolveContext,\n nextResolve: NextResolve\n): Promise<ResolveResult> {\n // Bridged specifiers win over the import map: route them to a synthetic\n // module that re-exports from the host's published instances.\n if (Object.prototype.hasOwnProperty.call(hostInstanceKeys, specifier)) {\n return { url: HOST_PREFIX + encodeURIComponent(specifier), shortCircuit: true };\n }\n const mapped = resolveSpecifier(activeMap, specifier, context.parentURL);\n return nextResolve(mapped ?? specifier, context);\n}\n\ntype LoadContext = { format?: string | null };\ntype LoadResult = {\n format: string;\n source?: string | ArrayBuffer | Uint8Array;\n shortCircuit?: boolean;\n};\ntype NextLoad = (url: string, context?: LoadContext) => Promise<LoadResult>;\n\nexport async function load(\n url: string,\n context: LoadContext,\n nextLoad: NextLoad\n): Promise<LoadResult> {\n if (url.startsWith(HOST_PREFIX)) {\n const specifier = decodeURIComponent(url.slice(HOST_PREFIX.length));\n return {\n shortCircuit: true,\n format: 'module',\n source: synthHostModule(specifier, hostInstanceKeys[specifier]),\n };\n }\n if (url.startsWith('http://') || url.startsWith('https://')) {\n const res = await fetch(url);\n if (!res.ok) {\n throw new Error(`Failed to fetch module from ${url}: ${res.status} ${res.statusText}`);\n }\n const source = await res.text();\n return { shortCircuit: true, format: 'module', source };\n }\n if (!url.startsWith('node:')) {\n context.format = 'module';\n }\n return nextLoad(url, context);\n}\n\n// --- host-instance bridge --------------------------------------------------\n// Synthesizes an in-memory ESM module whose exports forward to the namespace\n// the host published on `globalThis[HOST_INSTANCES_GLOBAL]`. The export-key\n// list is computed on the main thread (where the namespace lives) and shipped\n// over the port, so the loader realm never has to enumerate a namespace it\n// can't see. The `globalThis[...]` reads below run at module-eval time on the\n// main thread, where the instances actually exist.\n\nfunction synthHostModule(specifier: string, keys: string[] | undefined): string {\n const ID = /^[\\p{ID_Start}$_][\\p{ID_Continue}$]*$/u;\n const ref = `globalThis[${JSON.stringify(HOST_INSTANCES_GLOBAL)}][${JSON.stringify(specifier)}]`;\n const lines = [\n `const __ns = ${ref};`,\n `if (!__ns) throw new Error(${JSON.stringify(\n `[native-federation] host instance '${specifier}' not published`\n )});`,\n ];\n let hasDefault = false;\n for (const k of keys ?? []) {\n if (k === 'default') {\n hasDefault = true;\n continue;\n }\n // Defensive: only emit syntactically valid export identifiers. Angular's\n // \u0275\u2026 names pass \\p{ID_Start}; anything else is skipped.\n if (ID.test(k)) lines.push(`export const ${k} = __ns[${JSON.stringify(k)}];`);\n }\n if (hasDefault) lines.push(`export default __ns[\"default\"];`);\n return lines.join('\\n') + '\\n';\n}\n\n// --- WICG import-map resolve algorithm ------------------------------------\n// https://wicg.github.io/import-maps/#new-resolve-algorithm\n\nfunction resolveSpecifier(map: ImportMap, specifier: string, parentURL?: string): string | null {\n const currentBaseURL = parentURL ? parentURL.slice(0, parentURL.lastIndexOf('/') + 1) : baseURL;\n const normalizedSpecifier = parseURLLikeSpecifier(specifier, currentBaseURL) ?? specifier;\n\n if (map.scopes) {\n for (const scopePrefix in map.scopes) {\n if (\n scopePrefix === currentBaseURL ||\n (scopePrefix.endsWith('/') && currentBaseURL.startsWith(scopePrefix))\n ) {\n const match = resolveImportsMatch(normalizedSpecifier, map.scopes[scopePrefix]!);\n if (match) return match;\n }\n }\n }\n\n return resolveImportsMatch(normalizedSpecifier, map.imports);\n}\n\nfunction resolveImportsMatch(normalizedSpecifier: string, specifierMap: Imports): string | null {\n for (const specifierKey in specifierMap) {\n const resolutionResult = specifierMap[specifierKey];\n if (resolutionResult === undefined) continue;\n\n if (specifierKey === normalizedSpecifier) return resolutionResult;\n\n if (specifierKey.endsWith('/') && normalizedSpecifier.startsWith(specifierKey)) {\n const afterPrefix = normalizedSpecifier.slice(specifierKey.length);\n try {\n return new URL(afterPrefix, resolutionResult).href;\n } catch {\n throw new TypeError(\n `import-map resolution of '${specifierKey}' failed due to URL parse failure`\n );\n }\n }\n }\n return null;\n}\n\nfunction parseURLLikeSpecifier(specifier: string, base: string): string | null {\n const useBase =\n specifier.startsWith('/') || specifier.startsWith('./') || specifier.startsWith('../');\n try {\n return new URL(specifier, useBase ? base : undefined).href;\n } catch {\n return null;\n }\n}\n\nfunction normalize(parsed: ImportMap): ImportMap {\n return {\n imports: parsed.imports ?? {},\n scopes: parsed.scopes ?? {},\n };\n}\n"],
5
- "mappings": ";AA2BA,IAAM,YAAuB,OAAO,OAAO,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;AAGtE,IAAM,cAAc;AAEpB,IAAM,wBAAwB;AAE9B,IAAM,WAAW,MAAM;AACrB,QAAM,MAAM,QAAQ,IAAI;AACxB,QAAM,MAAM,IAAI,IAAI,SAAS;AAC7B,MAAI,WAAW,IAAI,SAAS,GAAG,IAAI,MAAM,MAAM;AAC/C,SAAO,IAAI,KAAK,SAAS,GAAG,IAAI,IAAI,OAAO,IAAI,OAAO;AACxD,GAAG;AAEH,IAAI,YAAuB;AAC3B,IAAI,mBAAqC,uBAAO,OAAO,IAAI;AAEpD,SAAS,WAAW,OAAiB,CAAC,GAAS;AACpD,MAAI,KAAK,kBAAkB;AACzB,gBAAY,UAAU,KAAK,gBAAgB;AAAA,EAC7C;AACA,MAAI,KAAK,MAAM;AACb,SAAK,KAAK,GAAG,WAAW,CAAC,QAAyB;AAChD,UAAI,OAAO,IAAI,SAAS,kBAAkB;AACxC,oBAAY,UAAU,IAAI,GAAG;AAC7B,aAAK,KAAM,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACvD,WAAW,OAAO,IAAI,SAAS,sBAAsB;AACnD,2BAAmB,IAAI,QAAQ,uBAAO,OAAO,IAAI;AACjD,aAAK,KAAM,YAAY,EAAE,MAA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;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,sBAAsB,WAAmB,MAA6B;AAC7E,QAAM,UACJ,UAAU,WAAW,GAAG,KAAK,UAAU,WAAW,IAAI,KAAK,UAAU,WAAW,KAAK;AACvF,MAAI;AACF,WAAO,IAAI,IAAI,WAAW,UAAU,OAAO,MAAS,EAAE;AAAA,EACxD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,UAAU,QAA8B;AAC/C,SAAO;AAAA,IACL,SAAS,OAAO,WAAW,CAAC;AAAA,IAC5B,QAAQ,OAAO,UAAU,CAAC;AAAA,EAC5B;AACF;",
4
+ "sourcesContent": ["/**\n * Node.js module customization hooks for native-federation.\n *\n * Registered via `module.register(<this file>, import.meta.url, { data: { port }, transferList: [port] })`\n * from the orchestrator. The main thread posts the resolved import map over the\n * MessagePort whenever it changes; this loader rewrites `import` specifiers\n * accordingly and fetches http(s) modules into the loader as source text.\n */\n\nimport type { MessagePort } from 'node:worker_threads';\n\ntype Imports = Record<string, string>;\ntype Scopes = Record<string, Imports>;\ntype ImportMap = { imports: Imports; scopes?: Scopes };\n\n/** Per-specifier list of export names to re-export from the host's published instances. */\ntype HostInstanceKeys = Record<string, string[]>;\n\ntype InitData = {\n port?: MessagePort;\n initialImportMap?: ImportMap;\n};\n\ntype IncomingMessage =\n | { type: 'set-import-map'; map: ImportMap }\n | { type: 'set-host-instances'; keys?: HostInstanceKeys };\n\nconst EMPTY_MAP: ImportMap = Object.freeze({ imports: {}, scopes: {} });\n\n/** Synthetic URL scheme for specifiers bridged to the host's instances. */\nconst HOST_PREFIX = 'nf-host:';\n/** Global key on the main thread holding `{ [specifier]: namespaceObject }`. */\nconst HOST_INSTANCES_GLOBAL = '__NF_HOST_INSTANCES__';\n\nconst baseURL = (() => {\n const cwd = process.cwd();\n const url = new URL('file://');\n url.pathname = cwd.endsWith('/') ? cwd : cwd + '/';\n return url.href.endsWith('/') ? url.href : url.href + '/';\n})();\n\nlet activeMap: ImportMap = EMPTY_MAP;\nlet hostInstanceKeys: HostInstanceKeys = Object.create(null);\n// Fallback parent when context.parentURL arrives empty (seen under module.register()'s worker-thread hook).\nlet lastRemoteBaseURL: string | undefined;\n\nexport function initialize(data: InitData = {}): void {\n if (data.initialImportMap) {\n activeMap = normalize(data.initialImportMap);\n }\n if (data.port) {\n data.port.on('message', (msg: IncomingMessage) => {\n if (msg && msg.type === 'set-import-map') {\n activeMap = normalize(msg.map);\n data.port!.postMessage({ type: 'import-map-applied' });\n } else if (msg && msg.type === 'set-host-instances') {\n hostInstanceKeys = msg.keys ?? Object.create(null);\n data.port!.postMessage({ type: 'host-instances-applied' });\n }\n });\n data.port.unref?.();\n }\n}\n\ntype ResolveContext = { parentURL?: string };\ntype ResolveResult = { url: string; format?: string | null; shortCircuit?: boolean };\ntype NextResolve = (specifier: string, context?: ResolveContext) => Promise<ResolveResult>;\n\nexport async function resolve(\n specifier: string,\n context: ResolveContext,\n nextResolve: NextResolve\n): Promise<ResolveResult> {\n // Bridged specifiers win over the import map: route them to a synthetic\n // module that re-exports from the host's published instances.\n if (Object.prototype.hasOwnProperty.call(hostInstanceKeys, specifier)) {\n return { url: HOST_PREFIX + encodeURIComponent(specifier), shortCircuit: true };\n }\n // context.parentURL can be an empty string (not just missing) here; treat it as absent.\n const effectiveParent = context.parentURL || lastRemoteBaseURL;\n let mapped = resolveSpecifier(activeMap, specifier, effectiveParent);\n\n // Not every relative/absolute specifier has an import-map entry (e.g. a sibling chunk); resolve those directly.\n if (!mapped) {\n const isRelative =\n specifier.startsWith('/') || specifier.startsWith('./') || specifier.startsWith('../');\n try {\n if (isRelative && effectiveParent) {\n mapped = new URL(specifier, effectiveParent).href;\n } else if (/^https?:\\/\\//.test(specifier)) {\n mapped = specifier;\n }\n } catch {\n // fall through to nextResolve, which will surface the original error\n }\n }\n\n // nextResolve() can't handle absolute http(s) URLs (throws ERR_INVALID_URL); short-circuit like load() does.\n if (mapped && (mapped.startsWith('http://') || mapped.startsWith('https://'))) {\n return { url: mapped, format: 'module', shortCircuit: true };\n }\n\n return nextResolve(mapped ?? specifier, context);\n}\n\ntype LoadContext = { format?: string | null };\ntype LoadResult = {\n format: string;\n source?: string | ArrayBuffer | Uint8Array;\n shortCircuit?: boolean;\n responseURL?: string;\n};\ntype NextLoad = (url: string, context?: LoadContext) => Promise<LoadResult>;\n\nexport async function load(\n url: string,\n context: LoadContext,\n nextLoad: NextLoad\n): Promise<LoadResult> {\n if (url.startsWith(HOST_PREFIX)) {\n const specifier = decodeURIComponent(url.slice(HOST_PREFIX.length));\n return {\n shortCircuit: true,\n format: 'module',\n source: synthHostModule(specifier, hostInstanceKeys[specifier]),\n };\n }\n if (url.startsWith('http://') || url.startsWith('https://')) {\n lastRemoteBaseURL = url;\n const res = await fetch(url);\n if (!res.ok) {\n throw new Error(`Failed to fetch module from ${url}: ${res.status} ${res.statusText}`);\n }\n const source = await res.text();\n return { shortCircuit: true, format: 'module', source, responseURL: url };\n }\n if (!url.startsWith('node:')) {\n context.format = 'module';\n }\n return nextLoad(url, context);\n}\n\n// --- host-instance bridge --------------------------------------------------\n// Synthesizes an in-memory ESM module whose exports forward to the namespace\n// the host published on `globalThis[HOST_INSTANCES_GLOBAL]`. The export-key\n// list is computed on the main thread (where the namespace lives) and shipped\n// over the port, so the loader realm never has to enumerate a namespace it\n// can't see. The `globalThis[...]` reads below run at module-eval time on the\n// main thread, where the instances actually exist.\n\nfunction synthHostModule(specifier: string, keys: string[] | undefined): string {\n const ID = /^[\\p{ID_Start}$_][\\p{ID_Continue}$]*$/u;\n const ref = `globalThis[${JSON.stringify(HOST_INSTANCES_GLOBAL)}][${JSON.stringify(specifier)}]`;\n const lines = [\n `const __ns = ${ref};`,\n `if (!__ns) throw new Error(${JSON.stringify(\n `[native-federation] host instance '${specifier}' not published`\n )});`,\n ];\n let hasDefault = false;\n for (const k of keys ?? []) {\n if (k === 'default') {\n hasDefault = true;\n continue;\n }\n // Defensive: only emit syntactically valid export identifiers. Angular's\n // \u0275\u2026 names pass \\p{ID_Start}; anything else is skipped.\n if (ID.test(k)) lines.push(`export const ${k} = __ns[${JSON.stringify(k)}];`);\n }\n if (hasDefault) lines.push(`export default __ns[\"default\"];`);\n return lines.join('\\n') + '\\n';\n}\n\n// --- WICG import-map resolve algorithm ------------------------------------\n// https://wicg.github.io/import-maps/#new-resolve-algorithm\n\nfunction resolveSpecifier(map: ImportMap, specifier: string, parentURL?: string): string | null {\n const currentBaseURL = parentURL ? parentURL.slice(0, parentURL.lastIndexOf('/') + 1) : baseURL;\n const normalizedSpecifier = parseURLLikeSpecifier(specifier, currentBaseURL) ?? specifier;\n\n if (map.scopes) {\n for (const scopePrefix in map.scopes) {\n if (\n scopePrefix === currentBaseURL ||\n (scopePrefix.endsWith('/') && currentBaseURL.startsWith(scopePrefix))\n ) {\n const match = resolveImportsMatch(normalizedSpecifier, map.scopes[scopePrefix]!);\n if (match) return match;\n }\n }\n }\n\n return resolveImportsMatch(normalizedSpecifier, map.imports);\n}\n\nfunction resolveImportsMatch(normalizedSpecifier: string, specifierMap: Imports): string | null {\n for (const specifierKey in specifierMap) {\n const resolutionResult = specifierMap[specifierKey];\n if (resolutionResult === undefined) continue;\n\n if (specifierKey === normalizedSpecifier) return resolutionResult;\n\n if (specifierKey.endsWith('/') && normalizedSpecifier.startsWith(specifierKey)) {\n const afterPrefix = normalizedSpecifier.slice(specifierKey.length);\n try {\n return new URL(afterPrefix, resolutionResult).href;\n } catch {\n throw new TypeError(\n `import-map resolution of '${specifierKey}' failed due to URL parse failure`\n );\n }\n }\n }\n return null;\n}\n\nfunction parseURLLikeSpecifier(specifier: string, base: string): string | null {\n const useBase =\n specifier.startsWith('/') || specifier.startsWith('./') || specifier.startsWith('../');\n try {\n return new URL(specifier, useBase ? base : undefined).href;\n } catch {\n return null;\n }\n}\n\nfunction normalize(parsed: ImportMap): ImportMap {\n return {\n imports: parsed.imports ?? {},\n scopes: parsed.scopes ?? {},\n };\n}\n"],
5
+ "mappings":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AI,aAAa,gBAAgB,EAAE;AAAA,MAChD,QAAQ;AACN,cAAM,IAAI;AAAA,UACR,6BAA6B,YAAY;AAAA,QAC3C;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,sBAAsB,WAAmB,MAA6B;AAC7E,QAAM,UACJ,UAAU,WAAW,GAAG,KAAK,UAAU,WAAW,IAAI,KAAK,UAAU,WAAW,KAAK;AACvF,MAAI;AACF,WAAO,IAAI,IAAI,WAAW,UAAU,OAAO,MAAS,EAAE;AAAA,EACxD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,UAAU,QAA8B;AAC/C,SAAO;AAAA,IACL,SAAS,OAAO,WAAW,CAAC;AAAA,IAC5B,QAAQ,OAAO,UAAU,CAAC;AAAA,EAC5B;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.6.0",
2
+ "version": "4.6.1",
3
3
  "name": "@softarc/native-federation-orchestrator",
4
4
  "author": "Aukevanoost",
5
5
  "keywords": [