@ms-cloudpack/package-utilities 5.10.4 → 5.11.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"createImportMap.d.ts","sourceRoot":"","sources":["../src/createImportMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAKlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,uBAAuB,CAAC;IAClC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE;IACP,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC,EACD,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,SAAS,CAAC,CAqCpB"}
1
+ {"version":3,"file":"createImportMap.d.ts","sourceRoot":"","sources":["../src/createImportMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIxD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,uBAAuB,CAAC;IAClC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE;IACP,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC,EACD,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,SAAS,CAAC,CAqCpB"}
@@ -1,9 +1,8 @@
1
1
  import {} from '@ms-cloudpack/config-types';
2
2
  import { merge } from 'merge';
3
- import { flattenExportsMap } from './flattenExportsMap.js';
4
3
  import { getExportsMap } from './getExportsMap.js';
5
- import { getResolvedFilePath } from './getResolvedFilePath.js';
6
4
  import { isExternalPackage } from './isExternalPackage.js';
5
+ import { getRuntimeEntryPaths } from './getRuntimeEntryPaths.js';
7
6
  /**
8
7
  * Given a resolve map and a bundleServerUrl, returns an import map to be used in the browser.
9
8
  */
@@ -51,12 +50,6 @@ async function getImportMapFromEntry(params) {
51
50
  name.startsWith('@types/')) {
52
51
  return importMap;
53
52
  }
54
- // Get both the unbundled entries from the exports map
55
- const unbundledExportsMap = flattenExportsMap(exportsMap, {
56
- conditions: ['browser-esm'],
57
- requiredConditions: ['browser-esm'],
58
- });
59
- const bundledExportsMap = flattenExportsMap(exportsMap);
60
53
  const packagePrefix = `${name}@${entry.version}/`;
61
54
  const baseUrl = `${bundleServerUrl}/${packagePrefix}`;
62
55
  const isExternal = isExternalPackage(entry.path);
@@ -64,20 +57,16 @@ async function getImportMapFromEntry(params) {
64
57
  const cacheBuster = `v${sessionVersion ?? 0}${targetVersion ? `.${targetVersion}` : ''}/`;
65
58
  const hash = isExternal ? `h-${await getPackageHash(entry.path)}/` : 'h-pending/';
66
59
  // Add the bundled entries to the import map, but prefer unbundled if the entry exists.
67
- for (const [importPath, bundledFilePath] of Object.entries(bundledExportsMap)) {
68
- const resolvedFilePath = getResolvedFilePath({
69
- entryPath: importPath,
70
- isExternal,
71
- unbundledExportsMap,
72
- bundledFilePath,
73
- bundledPrefix: `${hash}${cacheBuster}bundled/`,
74
- unbundledPrefix: `${hash}${cacheBuster}unbundled/`,
75
- });
76
- if (resolvedFilePath !== undefined) {
77
- const resolvedImportPath = importPath.replace('.', `${name}`);
78
- packageImportPaths?.add(entry.path, resolvedImportPath);
79
- importMap[resolvedImportPath] = new URL(resolvedFilePath, baseUrl).href;
80
- }
60
+ const entryPaths = getRuntimeEntryPaths({
61
+ isExternal,
62
+ exportsMap,
63
+ bundledPrefix: `${hash}${cacheBuster}bundled/`,
64
+ unbundledPrefix: `${hash}${cacheBuster}unbundled/`,
65
+ });
66
+ for (const [importPath, actualEntryPath] of Object.entries(entryPaths)) {
67
+ const resolvedImportPath = importPath.replace('.', `${name}`);
68
+ packageImportPaths?.add(entry.path, resolvedImportPath);
69
+ importMap[resolvedImportPath] = new URL(actualEntryPath, baseUrl).href;
81
70
  }
82
71
  // Finally add a fallback for all other unexpected bundle entries. (Note, this should point to a script
83
72
  // which logs this as an error to the user and offers a way to add the entry to exports overrides.)
@@ -1 +1 @@
1
- {"version":3,"file":"createImportMap.js","sourceRoot":"","sources":["../src/createImportMap.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAgB3D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAKC,EACD,OAA+B;IAE/B,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACpF,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,SAAS,GAAc;QAC3B,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,kBAAkB,EAAE,KAAK,EAAE,CAAC;IAE5B,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QACrD,KAAK,CACH,SAAS,CAAC,OAAO,EACjB,MAAM,qBAAqB,CAAC;YAC1B,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE;YACjF,OAAO;SACR,CAAC,CACH,CAAC;QAEF,IAAI,YAAY,CAAC,cAAc,EAAE,CAAC;YAChC,oBAAoB;YACpB,SAAS,CAAC,MAAM,KAAK,EAAE,CAAC;YAExB,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;gBACrE,MAAM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AU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;YAC9D,kBAAkB,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;YACxD,SAAS,CAAC,kBAAkB,CAAC,GAAG,IAAI,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,uGAAuG;IACvG,mGAAmG;IACnG,2DAA2D;IAE3D,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { type CloudpackConfig } from '@ms-cloudpack/config-types';\nimport { merge } from 'merge';\nimport type { PackageImportPaths } from './PackageImportPaths.js';\nimport { flattenExportsMap } from './flattenExportsMap.js';\nimport { getExportsMap } from './getExportsMap.js';\nimport { getResolvedFilePath } from './getResolvedFilePath.js';\nimport { isExternalPackage } from './isExternalPackage.js';\nimport type { ResolveMap } from './types/ResolveMap.js';\nimport type { ResolveMapEntry } from './types/ResolveMapEntry.js';\n\nexport interface ImportMap {\n imports: Record<string, string>;\n scopes?: Record<string, Record<string, string>>;\n}\n\nexport type CreateImportMapContext = {\n packages: PackageDefinitionsCache;\n packageImportPaths?: PackageImportPaths;\n getPackageHash: (packagePath: string) => Promise<string>;\n config: CloudpackConfig;\n};\n\n/**\n * Given a resolve map and a bundleServerUrl, returns an import map to be used in the browser.\n */\nexport async function createImportMap(\n options: {\n resolveMap: ResolveMap;\n bundleServerUrl: string;\n sessionVersion?: number;\n targetVersions?: Record<string, number>;\n },\n context: CreateImportMapContext,\n): Promise<ImportMap> {\n const { resolveMap, bundleServerUrl, sessionVersion = 0, targetVersions } = options;\n const { packageImportPaths } = context;\n const importMap: ImportMap = {\n imports: {},\n };\n\n packageImportPaths?.clear();\n\n for (const resolveEntry of Object.values(resolveMap)) {\n merge(\n importMap.imports,\n await getImportMapFromEntry({\n options: { entry: resolveEntry, bundleServerUrl, targetVersions, sessionVersion },\n context,\n }),\n );\n\n if (resolveEntry.scopedVersions) {\n // Initialize scopes\n importMap.scopes ??= {};\n\n for (const scopedEntry of Object.values(resolveEntry.scopedVersions)) {\n const importMapForEntry = await getImportMapFromEntry({\n options: { entry: scopedEntry, bundleServerUrl, sessionVersion, targetVersions },\n context,\n });\n\n for (const requiredById of Object.keys(scopedEntry.requiredBy)) {\n const scopes = (importMap.scopes[`${bundleServerUrl}/${requiredById}/`] ??= {});\n merge(scopes, importMapForEntry);\n }\n }\n }\n }\n\n return importMap;\n}\n\nasync function getImportMapFromEntry(params: {\n options: {\n entry: ResolveMapEntry;\n bundleServerUrl: string;\n sessionVersion: number;\n targetVersions?: Record<string, number>;\n };\n context: CreateImportMapContext;\n}): Promise<Record<string, string>> {\n const { options, context } = params;\n const { entry, bundleServerUrl, sessionVersion, targetVersions } = options;\n const { name } = entry;\n const { packages, packageImportPaths, getPackageHash, config } = context;\n const importMap: Record<string, string> = {};\n const definition = await packages.get(entry.path);\n const exportsMap = await getExportsMap({ packagePath: entry.path }, { packages, config });\n\n if (\n !definition ||\n !definition.version ||\n !exportsMap ||\n Object.keys(exportsMap).length === 0 ||\n name.startsWith('@types/')\n ) {\n return importMap;\n }\n\n // Get both the unbundled entries from the exports map\n const unbundledExportsMap = flattenExportsMap(exportsMap, {\n conditions: ['browser-esm'],\n requiredConditions: ['browser-esm'],\n });\n const bundledExportsMap = flattenExportsMap(exportsMap);\n const packagePrefix = `${name}@${entry.version}/`;\n const baseUrl = `${bundleServerUrl}/${packagePrefix}`;\n const isExternal = isExternalPackage(entry.path);\n const targetVersion = targetVersions?.[entry.path];\n const cacheBuster = `v${sessionVersion ?? 0}${targetVersion ? `.${targetVersion}` : ''}/`;\n const hash = isExternal ? `h-${await getPackageHash(entry.path)}/` : 'h-pending/';\n\n // Add the bundled entries to the import map, but prefer unbundled if the entry exists.\n for (const [importPath, bundledFilePath] of Object.entries(bundledExportsMap)) {\n const resolvedFilePath = getResolvedFilePath({\n entryPath: importPath,\n isExternal,\n unbundledExportsMap,\n bundledFilePath,\n bundledPrefix: `${hash}${cacheBuster}bundled/`,\n unbundledPrefix: `${hash}${cacheBuster}unbundled/`,\n });\n\n if (resolvedFilePath !== undefined) {\n const resolvedImportPath = importPath.replace('.', `${name}`);\n packageImportPaths?.add(entry.path, resolvedImportPath);\n importMap[resolvedImportPath] = new URL(resolvedFilePath, baseUrl).href;\n }\n }\n\n // Finally add a fallback for all other unexpected bundle entries. (Note, this should point to a script\n // which logs this as an error to the user and offers a way to add the entry to exports overrides.)\n // importMap[definition.name + '/'] = baseUrl + 'missing/';\n\n return importMap;\n}\n"]}
1
+ {"version":3,"file":"createImportMap.js","sourceRoot":"","sources":["../src/createImportMap.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAcjE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAKC,EACD,OAA+B;IAE/B,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACpF,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,SAAS,GAAc;QAC3B,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,kBAAkB,EAAE,KAAK,EAAE,CAAC;IAE5B,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QACrD,KAAK,CACH,SAAS,CAAC,OAAO,EACjB,MAAM,qBAAqB,CAAC;YAC1B,OAAO,EAAE,EAAE,KAAK,EAAE,YAA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AE,GAAG,IAAI,EAAE,CAAC,CAAC;QAC9D,kBAAkB,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACxD,SAAS,CAAC,kBAAkB,CAAC,GAAG,IAAI,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;IACzE,CAAC;IAED,uGAAuG;IACvG,mGAAmG;IACnG,2DAA2D;IAE3D,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { type CloudpackConfig } from '@ms-cloudpack/config-types';\nimport { merge } from 'merge';\nimport type { PackageImportPaths } from './PackageImportPaths.js';\nimport { getExportsMap } from './getExportsMap.js';\nimport { isExternalPackage } from './isExternalPackage.js';\nimport type { ResolveMap } from './types/ResolveMap.js';\nimport type { ResolveMapEntry } from './types/ResolveMapEntry.js';\nimport { getRuntimeEntryPaths } from './getRuntimeEntryPaths.js';\n\nexport interface ImportMap {\n imports: Record<string, string>;\n scopes?: Record<string, Record<string, string>>;\n}\n\nexport type CreateImportMapContext = {\n packages: PackageDefinitionsCache;\n packageImportPaths?: PackageImportPaths;\n getPackageHash: (packagePath: string) => Promise<string>;\n config: CloudpackConfig;\n};\n\n/**\n * Given a resolve map and a bundleServerUrl, returns an import map to be used in the browser.\n */\nexport async function createImportMap(\n options: {\n resolveMap: ResolveMap;\n bundleServerUrl: string;\n sessionVersion?: number;\n targetVersions?: Record<string, number>;\n },\n context: CreateImportMapContext,\n): Promise<ImportMap> {\n const { resolveMap, bundleServerUrl, sessionVersion = 0, targetVersions } = options;\n const { packageImportPaths } = context;\n const importMap: ImportMap = {\n imports: {},\n };\n\n packageImportPaths?.clear();\n\n for (const resolveEntry of Object.values(resolveMap)) {\n merge(\n importMap.imports,\n await getImportMapFromEntry({\n options: { entry: resolveEntry, bundleServerUrl, targetVersions, sessionVersion },\n context,\n }),\n );\n\n if (resolveEntry.scopedVersions) {\n // Initialize scopes\n importMap.scopes ??= {};\n\n for (const scopedEntry of Object.values(resolveEntry.scopedVersions)) {\n const importMapForEntry = await getImportMapFromEntry({\n options: { entry: scopedEntry, bundleServerUrl, sessionVersion, targetVersions },\n context,\n });\n\n for (const requiredById of Object.keys(scopedEntry.requiredBy)) {\n const scopes = (importMap.scopes[`${bundleServerUrl}/${requiredById}/`] ??= {});\n merge(scopes, importMapForEntry);\n }\n }\n }\n }\n\n return importMap;\n}\n\nasync function getImportMapFromEntry(params: {\n options: {\n entry: ResolveMapEntry;\n bundleServerUrl: string;\n sessionVersion: number;\n targetVersions?: Record<string, number>;\n };\n context: CreateImportMapContext;\n}): Promise<Record<string, string>> {\n const { options, context } = params;\n const { entry, bundleServerUrl, sessionVersion, targetVersions } = options;\n const { name } = entry;\n const { packages, packageImportPaths, getPackageHash, config } = context;\n const importMap: Record<string, string> = {};\n const definition = await packages.get(entry.path);\n const exportsMap = await getExportsMap({ packagePath: entry.path }, { packages, config });\n\n if (\n !definition ||\n !definition.version ||\n !exportsMap ||\n Object.keys(exportsMap).length === 0 ||\n name.startsWith('@types/')\n ) {\n return importMap;\n }\n\n const packagePrefix = `${name}@${entry.version}/`;\n const baseUrl = `${bundleServerUrl}/${packagePrefix}`;\n const isExternal = isExternalPackage(entry.path);\n const targetVersion = targetVersions?.[entry.path];\n const cacheBuster = `v${sessionVersion ?? 0}${targetVersion ? `.${targetVersion}` : ''}/`;\n const hash = isExternal ? `h-${await getPackageHash(entry.path)}/` : 'h-pending/';\n\n // Add the bundled entries to the import map, but prefer unbundled if the entry exists.\n const entryPaths = getRuntimeEntryPaths({\n isExternal,\n exportsMap,\n bundledPrefix: `${hash}${cacheBuster}bundled/`,\n unbundledPrefix: `${hash}${cacheBuster}unbundled/`,\n });\n\n for (const [importPath, actualEntryPath] of Object.entries(entryPaths)) {\n const resolvedImportPath = importPath.replace('.', `${name}`);\n packageImportPaths?.add(entry.path, resolvedImportPath);\n importMap[resolvedImportPath] = new URL(actualEntryPath, baseUrl).href;\n }\n\n // Finally add a fallback for all other unexpected bundle entries. (Note, this should point to a script\n // which logs this as an error to the user and offers a way to add the entry to exports overrides.)\n // importMap[definition.name + '/'] = baseUrl + 'missing/';\n\n return importMap;\n}\n"]}
@@ -23,7 +23,7 @@ export function getNonSemverTransform() {
23
23
  if (!depVersion || semver.validRange(depVersion)) {
24
24
  continue;
25
25
  }
26
- console.warn(`Non-semver dependency found: ${depName}@${depVersion} ` +
26
+ console.debug(`Non-semver dependency found: ${depName}@${depVersion} ` +
27
27
  `(in ${definition.name}@${definition.version} at ${packagePath}). ` +
28
28
  "Cloudpack will attempt to handle this, but it's recommended to use semantic versions only if possible.");
29
29
  // Update the version in the returned dependencies:
@@ -1 +1 @@
1
- {"version":3,"file":"getNonSemverTransform.js","sourceRoot":"","sources":["../src/getNonSemverTransform.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,MAAM,QAAQ,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAU,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB;IACnC;;;OAGG;IACH,MAAM,aAAa,GAGf,EAAE,CAAC;IAEP,OAAO,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,EAAE,EAAE;QACtD,MAAM,MAAM,GAAyB,EAAE,CAAC;QAExC,oCAAoC;QACpC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAEvC,KAAK,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzD,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;oBACjD,SAAS;gBACX,CAAC;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AAG,kBAAkB,CAAC;gBACpC,MAAM,CAAC,iBAAiB,GAAG;oBACzB,YAAY,EAAE,UAAU,CAAC,IAAI,IAAI,EAAE;oBACnC,eAAe,EAAE,UAAU,CAAC,OAAO,IAAI,EAAE;iBAC1C,CAAC;gBACF,MAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,MAAM,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageDefinitionTransform } from '@ms-cloudpack/bundler-types';\nimport type { PackageJson } from '@ms-cloudpack/config-types';\nimport semver from 'semver';\nimport { generateVersionFromNonSemver } from './generateVersionFromNonSemver.js';\n\nconst depTypes = ['dependencies', 'peerDependencies'] as const;\n\n/**\n * Get a transform which handles non-semver dependencies:\n * - In a parent package, if a dependency is specified with a non-semver version, change the dep\n * to a special `0.0.0-<original-version>` prerelease version.\n * - In a child package, if the package was pulled in as a non-semver dependency by a parent\n * (per the `importerContext`), change its version to the special prerelease version as above.\n */\nexport function getNonSemverTransform(): PackageDefinitionTransform {\n /**\n * Cached info about parent packages with non-semver dependencies:\n * Map from parent name/version => dep type => non-semver dependency names\n */\n const nonSemverDeps: Record<\n `${string}@${string}`,\n Partial<Record<'dependencies' | 'peerDependencies', string[]>>\n > = {};\n\n return ({ definition, packagePath, importerContext }) => {\n const result: Partial<PackageJson> = {};\n\n // Check for non-semver dependencies\n for (const depType of depTypes) {\n const deps = definition[depType] || {};\n\n for (const [depName, depVersion] of Object.entries(deps)) {\n if (!depVersion || semver.validRange(depVersion)) {\n continue;\n }\n\n console.warn(\n `Non-semver dependency found: ${depName}@${depVersion} ` +\n `(in ${definition.name}@${definition.version} at ${packagePath}). ` +\n \"Cloudpack will attempt to handle this, but it's recommended to use semantic versions only if possible.\",\n );\n\n // Update the version in the returned dependencies:\n // \"bar\": \"npm:@custom/bar@^1\" => \"0.0.0-npm--custom-bar--1\"\n const resultDeps = (result[depType] ??= { ...deps });\n resultDeps[depName] = generateVersionFromNonSemver(depVersion);\n\n // Save that this was a non-semver dep\n const record = (nonSemverDeps[`${definition.name}@${definition.version}`] ??= {});\n (record[depType] ??= []).push(depName);\n }\n }\n\n // If this package's parent pulled it in with a non-semver dependency, make some more updates\n // (see below)\n const nonSemverParentInfo =\n importerContext && nonSemverDeps[`${importerContext.parentName}@${importerContext.parentVersion}`];\n\n // TODO: maybe this could also be used for resolutions if we have problems there:\n // adding a check for !semver.satisfies(requiredAs, definition.version) and forcing the package version?\n\n if (nonSemverParentInfo) {\n // Example: the parent depended on this package as \"bar\": \"npm:@custom/bar@^1\"\n // importedName = bar\n // versionRequirement = 0.0.0-npm--custom-bar--1 (was modified when this transform ran on the parent definition)\n const { importedName, versionRequirement } = importerContext;\n\n for (const depType of depTypes) {\n if (!nonSemverParentInfo[depType]?.includes(importedName)) {\n continue;\n }\n\n // To ensure other code handles this package properly, change its name and version to\n // the ones used by the parent (after transforms). This ensures it works properly with\n // the resolve map and isn't accidentally used by other packages which depend on this\n // package under its real name.\n result.name = importedName;\n result.version = versionRequirement;\n result.cloudpackRemapped = {\n originalName: definition.name || '',\n originalVersion: definition.version || '',\n };\n break;\n }\n }\n\n if (Object.keys(result).length) {\n return { ...definition, ...result };\n }\n return undefined;\n };\n}\n"]}
1
+ {"version":3,"file":"getNonSemverTransform.js","sourceRoot":"","sources":["../src/getNonSemverTransform.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,MAAM,QAAQ,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAU,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB;IACnC;;;OAGG;IACH,MAAM,aAAa,GAGf,EAAE,CAAC;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wGAAwG;QAExG,IAAI,mBAAmB,EAAE,CAAC;YACxB,8EAA8E;YAC9E,uBAAuB;YACvB,kHAAkH;YAClH,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,eAAe,CAAC;YAE7D,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAC/B,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;oBAC1D,SAAS;gBACX,CAAC;gBAED,qFAAqF;gBACrF,sFAAsF;gBACtF,qFAAqF;gBACrF,+BAA+B;gBAC/B,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC;gBAC3B,MAAM,CAAC,OAAO,GAAG,kBAAkB,CAAC;gBACpC,MAAM,CAAC,iBAAiB,GAAG;oBACzB,YAAY,EAAE,UAAU,CAAC,IAAI,IAAI,EAAE;oBACnC,eAAe,EAAE,UAAU,CAAC,OAAO,IAAI,EAAE;iBAC1C,CAAC;gBACF,MAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,MAAM,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageDefinitionTransform } from '@ms-cloudpack/bundler-types';\nimport type { PackageJson } from '@ms-cloudpack/config-types';\nimport semver from 'semver';\nimport { generateVersionFromNonSemver } from './generateVersionFromNonSemver.js';\n\nconst depTypes = ['dependencies', 'peerDependencies'] as const;\n\n/**\n * Get a transform which handles non-semver dependencies:\n * - In a parent package, if a dependency is specified with a non-semver version, change the dep\n * to a special `0.0.0-<original-version>` prerelease version.\n * - In a child package, if the package was pulled in as a non-semver dependency by a parent\n * (per the `importerContext`), change its version to the special prerelease version as above.\n */\nexport function getNonSemverTransform(): PackageDefinitionTransform {\n /**\n * Cached info about parent packages with non-semver dependencies:\n * Map from parent name/version => dep type => non-semver dependency names\n */\n const nonSemverDeps: Record<\n `${string}@${string}`,\n Partial<Record<'dependencies' | 'peerDependencies', string[]>>\n > = {};\n\n return ({ definition, packagePath, importerContext }) => {\n const result: Partial<PackageJson> = {};\n\n // Check for non-semver dependencies\n for (const depType of depTypes) {\n const deps = definition[depType] || {};\n\n for (const [depName, depVersion] of Object.entries(deps)) {\n if (!depVersion || semver.validRange(depVersion)) {\n continue;\n }\n\n console.debug(\n `Non-semver dependency found: ${depName}@${depVersion} ` +\n `(in ${definition.name}@${definition.version} at ${packagePath}). ` +\n \"Cloudpack will attempt to handle this, but it's recommended to use semantic versions only if possible.\",\n );\n\n // Update the version in the returned dependencies:\n // \"bar\": \"npm:@custom/bar@^1\" => \"0.0.0-npm--custom-bar--1\"\n const resultDeps = (result[depType] ??= { ...deps });\n resultDeps[depName] = generateVersionFromNonSemver(depVersion);\n\n // Save that this was a non-semver dep\n const record = (nonSemverDeps[`${definition.name}@${definition.version}`] ??= {});\n (record[depType] ??= []).push(depName);\n }\n }\n\n // If this package's parent pulled it in with a non-semver dependency, make some more updates\n // (see below)\n const nonSemverParentInfo =\n importerContext && nonSemverDeps[`${importerContext.parentName}@${importerContext.parentVersion}`];\n\n // TODO: maybe this could also be used for resolutions if we have problems there:\n // adding a check for !semver.satisfies(requiredAs, definition.version) and forcing the package version?\n\n if (nonSemverParentInfo) {\n // Example: the parent depended on this package as \"bar\": \"npm:@custom/bar@^1\"\n // importedName = bar\n // versionRequirement = 0.0.0-npm--custom-bar--1 (was modified when this transform ran on the parent definition)\n const { importedName, versionRequirement } = importerContext;\n\n for (const depType of depTypes) {\n if (!nonSemverParentInfo[depType]?.includes(importedName)) {\n continue;\n }\n\n // To ensure other code handles this package properly, change its name and version to\n // the ones used by the parent (after transforms). This ensures it works properly with\n // the resolve map and isn't accidentally used by other packages which depend on this\n // package under its real name.\n result.name = importedName;\n result.version = versionRequirement;\n result.cloudpackRemapped = {\n originalName: definition.name || '',\n originalVersion: definition.version || '',\n };\n break;\n }\n }\n\n if (Object.keys(result).length) {\n return { ...definition, ...result };\n }\n return undefined;\n };\n}\n"]}
@@ -1,7 +1,5 @@
1
1
  /**
2
- * Get the resolved bundled or unbundled file path as appropriate, with the correct extension.
3
- * @returns The path, or undefined if a bundled path was requested and the entry is a .d.ts file
4
- * (which doesn't exist at runtime).
2
+ * @deprecated Use `getRuntimeEntryPaths`
5
3
  */
6
4
  export declare function getResolvedFilePath(params: {
7
5
  entryPath: string;
@@ -1 +1 @@
1
- {"version":3,"file":"getResolvedFilePath.d.ts","sourceRoot":"","sources":["../src/getResolvedFilePath.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,MAAM,GAAG,SAAS,CAmCrB"}
1
+ {"version":3,"file":"getResolvedFilePath.d.ts","sourceRoot":"","sources":["../src/getResolvedFilePath.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,MAAM,GAAG,SAAS,CAmCrB"}
@@ -1,8 +1,6 @@
1
1
  import path from 'path';
2
2
  /**
3
- * Get the resolved bundled or unbundled file path as appropriate, with the correct extension.
4
- * @returns The path, or undefined if a bundled path was requested and the entry is a .d.ts file
5
- * (which doesn't exist at runtime).
3
+ * @deprecated Use `getRuntimeEntryPaths`
6
4
  */
7
5
  export function getResolvedFilePath(params) {
8
6
  const { entryPath, isExternal, unbundledExportsMap, bundledFilePath, bundledPrefix = '', unbundledPrefix = '', } = params;
@@ -1 +1 @@
1
- {"version":3,"file":"getResolvedFilePath.js","sourceRoot":"","sources":["../src/getResolvedFilePath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAOnC;IACC,MAAM,EACJ,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,aAAa,GAAG,EAAE,EAClB,eAAe,GAAG,EAAE,GACrB,GAAG,MAAM,CAAC;IAEX,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,IAAI,gBAAgB,GAAG,iBAAiB,CAAC,CAAC,CAAC,eAAe,GAAG,iBAAiB,CAAC,CAAC,CAAC,aAAa,GAAG,eAAe,CAAC;IAEjH,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE3C,qBAAqB;IACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,uBAAuB;QACvB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACvC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,0EAA0E;QAC1E,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;YAClB,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAC1B,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC9B,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAC9E,CAAC;QACJ,CAAC;QAED,kDAAkD;QAClD,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["import path from 'path';\n\n/**\n * Get the resolved bundled or unbundled file path as appropriate, with the correct extension.\n * @returns The path, or undefined if a bundled path was requested and the entry is a .d.ts file\n * (which doesn't exist at runtime).\n */\nexport function getResolvedFilePath(params: {\n entryPath: string;\n isExternal: boolean;\n unbundledExportsMap: Record<string, string>;\n bundledFilePath: string;\n bundledPrefix?: string;\n unbundledPrefix?: string;\n}): string | undefined {\n const {\n entryPath,\n isExternal,\n unbundledExportsMap,\n bundledFilePath,\n bundledPrefix = '',\n unbundledPrefix = '',\n } = params;\n\n const unbundledFilePath = isExternal ? unbundledExportsMap[entryPath] : undefined;\n let resolvedFilePath = unbundledFilePath ? unbundledPrefix + unbundledFilePath : bundledPrefix + bundledFilePath;\n\n const ext = path.extname(resolvedFilePath);\n\n // For bundled files:\n if (!unbundledFilePath) {\n // Ignore .d.ts entries\n if (resolvedFilePath.endsWith('.d.ts')) {\n return undefined;\n }\n\n // We always expect responses to come back as javascript (.js extensions.)\n if (ext !== '.js') {\n resolvedFilePath = path.join(\n path.dirname(resolvedFilePath),\n path.basename(resolvedFilePath, ext) + (ext === '.mjs' ? '.js' : ext + '.js'),\n );\n }\n\n // Plus signs should be replaced with underscores.\n resolvedFilePath = resolvedFilePath.replace(/\\+/g, '_');\n }\n\n return resolvedFilePath;\n}\n"]}
1
+ {"version":3,"file":"getResolvedFilePath.js","sourceRoot":"","sources":["../src/getResolvedFilePath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAOnC;IACC,MAAM,EACJ,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,aAAa,GAAG,EAAE,EAClB,eAAe,GAAG,EAAE,GACrB,GAAG,MAAM,CAAC;IAEX,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClF,IAAI,gBAAgB,GAAG,iBAAiB,CAAC,CAAC,CAAC,eAAe,GAAG,iBAAiB,CAAC,CAAC,CAAC,aAAa,GAAG,eAAe,CAAC;IAEjH,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE3C,qBAAqB;IACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,uBAAuB;QACvB,IAAI,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACvC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,0EAA0E;QAC1E,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;YAClB,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAC1B,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC9B,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAC9E,CAAC;QACJ,CAAC;QAED,kDAAkD;QAClD,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["import path from 'path';\n\n/**\n * @deprecated Use `getRuntimeEntryPaths`\n */\nexport function getResolvedFilePath(params: {\n entryPath: string;\n isExternal: boolean;\n unbundledExportsMap: Record<string, string>;\n bundledFilePath: string;\n bundledPrefix?: string;\n unbundledPrefix?: string;\n}): string | undefined {\n const {\n entryPath,\n isExternal,\n unbundledExportsMap,\n bundledFilePath,\n bundledPrefix = '',\n unbundledPrefix = '',\n } = params;\n\n const unbundledFilePath = isExternal ? unbundledExportsMap[entryPath] : undefined;\n let resolvedFilePath = unbundledFilePath ? unbundledPrefix + unbundledFilePath : bundledPrefix + bundledFilePath;\n\n const ext = path.extname(resolvedFilePath);\n\n // For bundled files:\n if (!unbundledFilePath) {\n // Ignore .d.ts entries\n if (resolvedFilePath.endsWith('.d.ts')) {\n return undefined;\n }\n\n // We always expect responses to come back as javascript (.js extensions.)\n if (ext !== '.js') {\n resolvedFilePath = path.join(\n path.dirname(resolvedFilePath),\n path.basename(resolvedFilePath, ext) + (ext === '.mjs' ? '.js' : ext + '.js'),\n );\n }\n\n // Plus signs should be replaced with underscores.\n resolvedFilePath = resolvedFilePath.replace(/\\+/g, '_');\n }\n\n return resolvedFilePath;\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import type { PackageJsonExports } from '@ms-cloudpack/config-types';
2
+ /**
3
+ * For each path in the exports map, get the actual file path that will be used at runtime.
4
+ * - Prefers unbundled (browser-esm) paths for external packages if such paths exist.
5
+ * - Otherwise, uses bundled paths with the correct extension.
6
+ * - Omits any paths that won't exist at runtime, like .d.ts.
7
+ *
8
+ * @returns Mapping from import path (same as original exports map keys) to actual relative
9
+ * file path that will be used at runtime.
10
+ */
11
+ export declare function getRuntimeEntryPaths(params: {
12
+ /** Exports map for a package */
13
+ exportsMap: PackageJsonExports;
14
+ /** Whether the package is external to the repo */
15
+ isExternal: boolean;
16
+ /** Prefix for bundled file paths */
17
+ bundledPrefix?: string;
18
+ /** Prefix for unbundled file paths */
19
+ unbundledPrefix?: string;
20
+ }): Record<string, string>;
21
+ //# sourceMappingURL=getRuntimeEntryPaths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRuntimeEntryPaths.d.ts","sourceRoot":"","sources":["../src/getRuntimeEntryPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIrE;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,gCAAgC;IAChC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,kDAAkD;IAClD,UAAU,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0CzB"}
@@ -0,0 +1,44 @@
1
+ import path from 'path';
2
+ import { flattenExportsMap } from './flattenExportsMap.js';
3
+ /**
4
+ * For each path in the exports map, get the actual file path that will be used at runtime.
5
+ * - Prefers unbundled (browser-esm) paths for external packages if such paths exist.
6
+ * - Otherwise, uses bundled paths with the correct extension.
7
+ * - Omits any paths that won't exist at runtime, like .d.ts.
8
+ *
9
+ * @returns Mapping from import path (same as original exports map keys) to actual relative
10
+ * file path that will be used at runtime.
11
+ */
12
+ export function getRuntimeEntryPaths(params) {
13
+ const { exportsMap, isExternal, bundledPrefix = '', unbundledPrefix = '' } = params;
14
+ const result = {};
15
+ // Get both the unbundled and bundled entries from the exports map
16
+ const unbundledExportsMap = flattenExportsMap(exportsMap, {
17
+ conditions: ['browser-esm'],
18
+ requiredConditions: ['browser-esm'],
19
+ });
20
+ const bundledExportsMap = flattenExportsMap(exportsMap);
21
+ for (const [importPath, bundledFilePath] of Object.entries(bundledExportsMap)) {
22
+ const unbundledFilePath = isExternal ? unbundledExportsMap[importPath] : undefined;
23
+ let actualFilePath = unbundledFilePath ? unbundledPrefix + unbundledFilePath : bundledPrefix + bundledFilePath;
24
+ const ext = path.extname(actualFilePath);
25
+ // For bundled files:
26
+ if (!unbundledFilePath) {
27
+ // Ignore .d.ts entries
28
+ if (actualFilePath.endsWith('.d.ts')) {
29
+ continue;
30
+ }
31
+ // We always expect responses to come back as javascript (.js extensions.)
32
+ if (ext !== '.js') {
33
+ actualFilePath = path.join(path.dirname(actualFilePath), path.basename(actualFilePath, ext) + (ext === '.mjs' ? '.js' : ext + '.js'));
34
+ }
35
+ // Plus signs should be replaced with underscores.
36
+ actualFilePath = actualFilePath.replace(/\+/g, '_');
37
+ }
38
+ if (actualFilePath !== undefined) {
39
+ result[importPath] = actualFilePath;
40
+ }
41
+ }
42
+ return result;
43
+ }
44
+ //# sourceMappingURL=getRuntimeEntryPaths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRuntimeEntryPaths.js","sourceRoot":"","sources":["../src/getRuntimeEntryPaths.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,MASpC;IACC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,GAAG,EAAE,EAAE,eAAe,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACpF,MAAM,MAAM,GAA2B,EAAE,CAAC;IAE1C,kEAAkE;IAClE,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,UAAU,EAAE;QACxD,UAAU,EAAE,CAAC,aAAa,CAAC;QAC3B,kBAAkB,EAAE,CAAC,aAAa,CAAC;KACpC,CAAC,CAAC;IACH,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAExD,KAAK,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC9E,MAAM,iBAAiB,GAAG,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACnF,IAAI,cAAc,GAAG,iBAAiB,CAAC,CAAC,CAAC,eAAe,GAAG,iBAAiB,CAAC,CAAC,CAAC,aAAa,GAAG,eAAe,CAAC;QAE/G,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAEzC,qBAAqB;QACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,uBAAuB;YACvB,IAAI,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACrC,SAAS;YACX,CAAC;YAED,0EAA0E;YAC1E,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;gBAClB,cAAc,GAAG,IAAI,CAAC,IAAI,CACxB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAC5B,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAC5E,CAAC;YACJ,CAAC;YAED,kDAAkD;YAClD,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;QACtC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { PackageJsonExports } from '@ms-cloudpack/config-types';\nimport path from 'path';\nimport { flattenExportsMap } from './flattenExportsMap.js';\n\n/**\n * For each path in the exports map, get the actual file path that will be used at runtime.\n * - Prefers unbundled (browser-esm) paths for external packages if such paths exist.\n * - Otherwise, uses bundled paths with the correct extension.\n * - Omits any paths that won't exist at runtime, like .d.ts.\n *\n * @returns Mapping from import path (same as original exports map keys) to actual relative\n * file path that will be used at runtime.\n */\nexport function getRuntimeEntryPaths(params: {\n /** Exports map for a package */\n exportsMap: PackageJsonExports;\n /** Whether the package is external to the repo */\n isExternal: boolean;\n /** Prefix for bundled file paths */\n bundledPrefix?: string;\n /** Prefix for unbundled file paths */\n unbundledPrefix?: string;\n}): Record<string, string> {\n const { exportsMap, isExternal, bundledPrefix = '', unbundledPrefix = '' } = params;\n const result: Record<string, string> = {};\n\n // Get both the unbundled and bundled entries from the exports map\n const unbundledExportsMap = flattenExportsMap(exportsMap, {\n conditions: ['browser-esm'],\n requiredConditions: ['browser-esm'],\n });\n const bundledExportsMap = flattenExportsMap(exportsMap);\n\n for (const [importPath, bundledFilePath] of Object.entries(bundledExportsMap)) {\n const unbundledFilePath = isExternal ? unbundledExportsMap[importPath] : undefined;\n let actualFilePath = unbundledFilePath ? unbundledPrefix + unbundledFilePath : bundledPrefix + bundledFilePath;\n\n const ext = path.extname(actualFilePath);\n\n // For bundled files:\n if (!unbundledFilePath) {\n // Ignore .d.ts entries\n if (actualFilePath.endsWith('.d.ts')) {\n continue;\n }\n\n // We always expect responses to come back as javascript (.js extensions.)\n if (ext !== '.js') {\n actualFilePath = path.join(\n path.dirname(actualFilePath),\n path.basename(actualFilePath, ext) + (ext === '.mjs' ? '.js' : ext + '.js'),\n );\n }\n\n // Plus signs should be replaced with underscores.\n actualFilePath = actualFilePath.replace(/\\+/g, '_');\n }\n\n if (actualFilePath !== undefined) {\n result[importPath] = actualFilePath;\n }\n }\n\n return result;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -24,4 +24,5 @@ export { findProjectRoot } from './findProjectRoot.js';
24
24
  export { shouldExternalizePackage } from './shouldExternalizePackage.js';
25
25
  export { getResolvedFilePath } from './getResolvedFilePath.js';
26
26
  export { ensurePackageJsonDependencies } from './ensurePackageJsonDependencies.js';
27
+ export { getRuntimeEntryPaths } from './getRuntimeEntryPaths.js';
27
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,YAAY,EAAE,UAAU,E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AwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACxH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
package/lib/index.js CHANGED
@@ -28,4 +28,5 @@ export { findProjectRoot } from './findProjectRoot.js';
28
28
  export { shouldExternalizePackage } from './shouldExternalizePackage.js';
29
29
  export { getResolvedFilePath } from './getResolvedFilePath.js';
30
30
  export { ensurePackageJsonDependencies } from './ensurePackageJsonDependencies.js';
31
+ export { getRuntimeEntryPaths } from './getRuntimeEntryPaths.js';
31
32
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,sBAAsB;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAG1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,kCAAkC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAkC,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAqB;AACrB,OAAO,EAAE,eAAe,EAA+C,MAAM,sBAAsB,CAAC;AAEpG,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,uBAAuB;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,8BAA8B;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,0BAA0B;AAC1B,OAAO,EAAE,gBAAgB,EAAmB,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAA+D,MAAM,wBAAwB,CAAC;AACxH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC","sourcesContent":["// Package definition parsing\nexport { PackageDefinitions } from './PackageDefinitions.js';\n\n// ResolveMap creation\nexport { createResolveMap } from './createResolveMap/createResolveMap.js';\nexport type { ResolveMap } from './types/ResolveMap.js';\nexport type { ResolveMapEntry } from './types/ResolveMapEntry.js';\nexport { findResolveMapEntry } from './findResolveMapEntry.js';\nexport type { DiffResolveMapsChanges, DiffResolveMapsStats } from './createResolveMap/diffResolveMaps.js';\nexport { diffResolveMaps } from './createResolveMap/diffResolveMaps.js';\nexport type { LinkedPath } from './types/LinkedPath.js';\n\n// ExportsMap parsing and creation\nexport { flattenExportsMap } from './flattenExportsMap.js';\nexport { createExportsMap } from './createExportsMap.js';\nexport { addExportsMapEntry, type AddExportsMapEntryOptions } from './addExportsMapEntry.js';\nexport { getExportsMap } from './getExportsMap.js';\n\n// ImportMap creation\nexport { createImportMap, type ImportMap, type CreateImportMapContext } from './createImportMap.js';\n\n// ImportMap hashing\nexport { addImportMapHash } from './addImportMapHash.js';\n\n// Import paths caching\nexport { PackageImportPaths } from './PackageImportPaths.js';\n\n// Import resolution utilities\nexport { resolve } from './resolve.js';\n\n// Other package utilities\nexport { detectModuleType, type ModuleType } from './detectModuleType.js';\nexport { isExternalPackage } from './isExternalPackage.js';\nexport { findFileInPackage, type FindFileInPackageOptions, type FindFileInPackageResult } from './findFileInPackage.js';\nexport { getVersion } from './getVersion.js';\nexport { getDependencies } from './getDependencies.js';\nexport { getUnusedDependencies } from './getUnusedDependencies.js';\nexport { findProjectRoot } from './findProjectRoot.js';\nexport { shouldExternalizePackage } from './shouldExternalizePackage.js';\nexport { getResolvedFilePath } from './getResolvedFilePath.js';\nexport { ensurePackageJsonDependencies } from './ensurePackageJsonDependencies.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,sBAAsB;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAG1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,kCAAkC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAkC,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAqB;AACrB,OAAO,EAAE,eAAe,EAA+C,MAAM,sBAAsB,CAAC;AAEpG,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,uBAAuB;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,8BAA8B;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,0BAA0B;AAC1B,OAAO,EAAE,gBAAgB,EAAmB,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAA+D,MAAM,wBAAwB,CAAC;AACxH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["// Package definition parsing\nexport { PackageDefinitions } from './PackageDefinitions.js';\n\n// ResolveMap creation\nexport { createResolveMap } from './createResolveMap/createResolveMap.js';\nexport type { ResolveMap } from './types/ResolveMap.js';\nexport type { ResolveMapEntry } from './types/ResolveMapEntry.js';\nexport { findResolveMapEntry } from './findResolveMapEntry.js';\nexport type { DiffResolveMapsChanges, DiffResolveMapsStats } from './createResolveMap/diffResolveMaps.js';\nexport { diffResolveMaps } from './createResolveMap/diffResolveMaps.js';\nexport type { LinkedPath } from './types/LinkedPath.js';\n\n// ExportsMap parsing and creation\nexport { flattenExportsMap } from './flattenExportsMap.js';\nexport { createExportsMap } from './createExportsMap.js';\nexport { addExportsMapEntry, type AddExportsMapEntryOptions } from './addExportsMapEntry.js';\nexport { getExportsMap } from './getExportsMap.js';\n\n// ImportMap creation\nexport { createImportMap, type ImportMap, type CreateImportMapContext } from './createImportMap.js';\n\n// ImportMap hashing\nexport { addImportMapHash } from './addImportMapHash.js';\n\n// Import paths caching\nexport { PackageImportPaths } from './PackageImportPaths.js';\n\n// Import resolution utilities\nexport { resolve } from './resolve.js';\n\n// Other package utilities\nexport { detectModuleType, type ModuleType } from './detectModuleType.js';\nexport { isExternalPackage } from './isExternalPackage.js';\nexport { findFileInPackage, type FindFileInPackageOptions, type FindFileInPackageResult } from './findFileInPackage.js';\nexport { getVersion } from './getVersion.js';\nexport { getDependencies } from './getDependencies.js';\nexport { getUnusedDependencies } from './getUnusedDependencies.js';\nexport { findProjectRoot } from './findProjectRoot.js';\nexport { shouldExternalizePackage } from './shouldExternalizePackage.js';\nexport { getResolvedFilePath } from './getResolvedFilePath.js';\nexport { ensurePackageJsonDependencies } from './ensurePackageJsonDependencies.js';\nexport { getRuntimeEntryPaths } from './getRuntimeEntryPaths.js';\n"]}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Determines if a package should be externalized from the bundle.
3
- * Don't externalize inlined packages, or node builtins, or absolute paths, or relative paths.
3
+ * Don't externalize inlined packages, node builtins, absolute paths, or relative paths.
4
4
  */
5
- export declare function shouldExternalizePackage({ id, inlined, external, polyfills, shouldInlineNodeBuiltins, }: {
5
+ export declare function shouldExternalizePackage(params: {
6
6
  id: string;
7
7
  inlined?: string[];
8
8
  external?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"shouldExternalizePackage.d.ts","sourceRoot":"","sources":["../src/shouldExternalizePackage.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,EAAE,EACF,OAAO,EACP,QAAQ,EACR,SAAS,EACT,wBAAwB,GACzB,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,wBAAwB,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAOV"}
1
+ {"version":3,"file":"shouldExternalizePackage.d.ts","sourceRoot":"","sources":["../src/shouldExternalizePackage.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,wBAAwB,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAUV"}
@@ -1,14 +1,17 @@
1
1
  import path from 'path';
2
2
  import { isBuiltin } from 'module';
3
+ import { parseImportString } from '@ms-cloudpack/path-string-parsing';
3
4
  /**
4
5
  * Determines if a package should be externalized from the bundle.
5
- * Don't externalize inlined packages, or node builtins, or absolute paths, or relative paths.
6
+ * Don't externalize inlined packages, node builtins, absolute paths, or relative paths.
6
7
  */
7
- export function shouldExternalizePackage({ id, inlined, external, polyfills, shouldInlineNodeBuiltins, }) {
8
- return !(inlined?.includes(id) ||
9
- (shouldInlineNodeBuiltins && isInlinedNodeBuiltin(id, external, polyfills)) ||
8
+ export function shouldExternalizePackage(params) {
9
+ const { id, inlined, external, polyfills, shouldInlineNodeBuiltins } = params;
10
+ return !((shouldInlineNodeBuiltins && isInlinedNodeBuiltin(id, external, polyfills)) ||
10
11
  path.isAbsolute(id) ||
11
- isRelative(id));
12
+ isRelative(id) ||
13
+ // The length check ensures that parseImportString is only called when there are inlined deps
14
+ (inlined?.length && inlined.includes(parseImportString(id).packageName)));
12
15
  }
13
16
  // We should inline node builtins that are handled by the nodePolyfills plugin.
14
17
  // Except if the dependency is listed as external.
@@ -1 +1 @@
1
- {"version":3,"file":"shouldExternalizePackage.js","sourceRoot":"","sources":["../src/shouldExternalizePackage.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,EAAE,EACF,OAAO,EACP,QAAQ,EACR,SAAS,EACT,wBAAwB,GAOzB;IACC,OAAO,CAAC,CACN,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;QACrB,CAAC,wBAAwB,IAAI,oBAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC3E,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,CAAC,CACf,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,kDAAkD;AAClD,SAAS,oBAAoB,CAAC,EAAU,EAAE,QAAmB,EAAE,SAAuB;IACpF,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,UAAU,CAAC,EAAU;IAC5B,OAAO,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,CAAC;AACxG,CAAC","sourcesContent":["import path from 'path';\nimport { isBuiltin } from 'module';\n\n/**\n * Determines if a package should be externalized from the bundle.\n * Don't externalize inlined packages, or node builtins, or absolute paths, or relative paths.\n */\nexport function shouldExternalizePackage({\n id,\n inlined,\n external,\n polyfills,\n shouldInlineNodeBuiltins,\n}: {\n id: string;\n inlined?: string[];\n external?: string[];\n polyfills?: Set<string>;\n shouldInlineNodeBuiltins: boolean;\n}): boolean {\n return !(\n inlined?.includes(id) ||\n (shouldInlineNodeBuiltins && isInlinedNodeBuiltin(id, external, polyfills)) ||\n path.isAbsolute(id) ||\n isRelative(id)\n );\n}\n\n// We should inline node builtins that are handled by the nodePolyfills plugin.\n// Except if the dependency is listed as external.\nfunction isInlinedNodeBuiltin(id: string, external?: string[], polyfills?: Set<string>) {\n return (isBuiltin(id) || polyfills?.has(id)) && !external?.find((ex) => id.startsWith(ex));\n}\n\nfunction isRelative(id: string) {\n return id.startsWith('/') || id.startsWith('./') || id.startsWith('../') || id === '.' || id === '..';\n}\n"]}
1
+ {"version":3,"file":"shouldExternalizePackage.js","sourceRoot":"","sources":["../src/shouldExternalizePackage.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAMxC;IACC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,wBAAwB,EAAE,GAAG,MAAM,CAAC;IAE9E,OAAO,CAAC,CACN,CAAC,wBAAwB,IAAI,oBAAoB,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC3E,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,CAAC;QACd,6FAA6F;QAC7F,CAAC,OAAO,EAAE,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CACzE,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,kDAAkD;AAClD,SAAS,oBAAoB,CAAC,EAAU,EAAE,QAA8B,EAAE,SAAkC;IAC1G,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,UAAU,CAAC,EAAU;IAC5B,OAAO,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,CAAC;AACxG,CAAC","sourcesContent":["import path from 'path';\nimport { isBuiltin } from 'module';\nimport { parseImportString } from '@ms-cloudpack/path-string-parsing';\n\n/**\n * Determines if a package should be externalized from the bundle.\n * Don't externalize inlined packages, node builtins, absolute paths, or relative paths.\n */\nexport function shouldExternalizePackage(params: {\n id: string;\n inlined?: string[];\n external?: string[];\n polyfills?: Set<string>;\n shouldInlineNodeBuiltins: boolean;\n}): boolean {\n const { id, inlined, external, polyfills, shouldInlineNodeBuiltins } = params;\n\n return !(\n (shouldInlineNodeBuiltins && isInlinedNodeBuiltin(id, external, polyfills)) ||\n path.isAbsolute(id) ||\n isRelative(id) ||\n // The length check ensures that parseImportString is only called when there are inlined deps\n (inlined?.length && inlined.includes(parseImportString(id).packageName))\n );\n}\n\n// We should inline node builtins that are handled by the nodePolyfills plugin.\n// Except if the dependency is listed as external.\nfunction isInlinedNodeBuiltin(id: string, external: string[] | undefined, polyfills: Set<string> | undefined) {\n return (isBuiltin(id) || polyfills?.has(id)) && !external?.find((ex) => id.startsWith(ex));\n}\n\nfunction isRelative(id: string) {\n return id.startsWith('/') || id.startsWith('./') || id.startsWith('../') || id === '.' || id === '..';\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/package-utilities",
3
- "version": "5.10.4",
3
+ "version": "5.11.0",
4
4
  "description": "Utilities for resolving/parsing packages and their imports.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,10 +14,10 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@ms-cloudpack/bundler-types": "^0.24.4",
18
- "@ms-cloudpack/config-types": "^0.5.0",
17
+ "@ms-cloudpack/bundler-types": "^0.24.5",
18
+ "@ms-cloudpack/config-types": "^0.5.1",
19
19
  "@ms-cloudpack/json-utilities": "^0.1.4",
20
- "@ms-cloudpack/package-overrides": "^0.6.20",
20
+ "@ms-cloudpack/package-overrides": "^0.6.21",
21
21
  "@ms-cloudpack/path-utilities": "^2.5.0",
22
22
  "@ms-cloudpack/path-string-parsing": "^1.1.3",
23
23
  "acorn": "^8.11.2",