@ms-cloudpack/bundle-server 0.8.9 → 0.8.10

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.
@@ -19,7 +19,7 @@ export function getLinkedPackageRedirectUrl(options) {
19
19
  // We want the request path to start with the package name and version to ignore any prefix.
20
20
  const linkedRequestPath = `./${packageName}@${realVersion}${originalUrl.substring(nameIndexEnd)}`;
21
21
  // Redirect URL using the remote host.
22
- return makeUrl(linkedRequestPath, remote.hostUrl).href;
22
+ return makeUrl(linkedRequestPath, `${remote.hostUrl}/`).href;
23
23
  }
24
24
  }
25
25
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"getLinkedPackageRedirectUrl.js","sourceRoot":"","sources":["../src/getLinkedPackageRedirectUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,wEAAwE;AACxE,MAAM,UAAU,2BAA2B,CAAC,OAM3C;IACC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEjF,0FAA0F;IAC1F,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC;QACrC,oCAAoC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,SAAS;QACX,CAAC;QACD,0GAA0G;QAC1G,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACtF,MAAM,KAAK,GAAG,mBAAmB,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACxG,2GAA2G;QAC3G,IAAI,KAAK,EAAE,IAAI,KAAK,YAAY,CAAC,IAAI,EAAE,CAAC;YACtC,sEAAsE;YACtE,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;YAChG,4FAA4F;YAC5F,MAAM,iBAAiB,GAAG,KAAK,WAAW,IAAI,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YAClG,sCAAsC;YACtC,OAAO,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;QACzD,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport type { LinkedPath, ResolveMapEntry } from '@ms-cloudpack/common-types';\nimport { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\n\n// Helper function to determine if we need to redirect to a remote host.\nexport function getLinkedPackageRedirectUrl(options: {\n linkedPaths: LinkedPath[];\n packageName: string;\n version: string;\n packageEntry: ResolveMapEntry;\n originalUrl: string;\n}): string | undefined {\n const { linkedPaths, packageName, version, packageEntry, originalUrl } = options;\n\n // If there is any linked path with a remote we need to check if we should redirect to it.\n for (const { remote } of linkedPaths) {\n // Early exit if there is no remote.\n if (!remote) {\n continue;\n }\n // Remove the -linked suffix if it is linked to compare the version with the linked package map correctly.\n const realVersion = packageEntry.isLinked ? version.replace(/-linked$/, '') : version;\n const entry = findResolveMapEntry({ packageName, version: realVersion, resolveMap: remote.resolveMap });\n // Compare by path to see if we should redirect, since we could have multiple versions of the same package.\n if (entry?.path === packageEntry.path) {\n // Use the original URL to construct the new URL to keep query params.\n const nameIndexEnd = originalUrl.indexOf(packageName) + packageName.length + version.length + 1;\n // We want the request path to start with the package name and version to ignore any prefix.\n const linkedRequestPath = `./${packageName}@${realVersion}${originalUrl.substring(nameIndexEnd)}`;\n // Redirect URL using the remote host.\n return makeUrl(linkedRequestPath, remote.hostUrl).href;\n }\n }\n\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"getLinkedPackageRedirectUrl.js","sourceRoot":"","sources":["../src/getLinkedPackageRedirectUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,wEAAwE;AACxE,MAAM,UAAU,2BAA2B,CAAC,OAM3C;IACC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAEjF,0FAA0F;IAC1F,KAAK,MAAM,EAAE,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC;QACrC,oCAAoC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,SAAS;QACX,CAAC;QACD,0GAA0G;QAC1G,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACtF,MAAM,KAAK,GAAG,mBAAmB,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACxG,2GAA2G;QAC3G,IAAI,KAAK,EAAE,IAAI,KAAK,YAAY,CAAC,IAAI,EAAE,CAAC;YACtC,sEAAsE;YACtE,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;YAChG,4FAA4F;YAC5F,MAAM,iBAAiB,GAAG,KAAK,WAAW,IAAI,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YAClG,sCAAsC;YACtC,OAAO,OAAO,CAAC,iBAAiB,EAAE,GAAG,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport type { LinkedPath, ResolveMapEntry } from '@ms-cloudpack/common-types';\nimport { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\n\n// Helper function to determine if we need to redirect to a remote host.\nexport function getLinkedPackageRedirectUrl(options: {\n linkedPaths: LinkedPath[];\n packageName: string;\n version: string;\n packageEntry: ResolveMapEntry;\n originalUrl: string;\n}): string | undefined {\n const { linkedPaths, packageName, version, packageEntry, originalUrl } = options;\n\n // If there is any linked path with a remote we need to check if we should redirect to it.\n for (const { remote } of linkedPaths) {\n // Early exit if there is no remote.\n if (!remote) {\n continue;\n }\n // Remove the -linked suffix if it is linked to compare the version with the linked package map correctly.\n const realVersion = packageEntry.isLinked ? version.replace(/-linked$/, '') : version;\n const entry = findResolveMapEntry({ packageName, version: realVersion, resolveMap: remote.resolveMap });\n // Compare by path to see if we should redirect, since we could have multiple versions of the same package.\n if (entry?.path === packageEntry.path) {\n // Use the original URL to construct the new URL to keep query params.\n const nameIndexEnd = originalUrl.indexOf(packageName) + packageName.length + version.length + 1;\n // We want the request path to start with the package name and version to ignore any prefix.\n const linkedRequestPath = `./${packageName}@${realVersion}${originalUrl.substring(nameIndexEnd)}`;\n // Redirect URL using the remote host.\n return makeUrl(linkedRequestPath, `${remote.hostUrl}/`).href;\n }\n }\n\n return undefined;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/bundle-server",
3
- "version": "0.8.9",
3
+ "version": "0.8.10",
4
4
  "description": "An implementation of the Bundle server for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,14 +14,14 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@ms-cloudpack/api-server": "^0.64.17",
18
- "@ms-cloudpack/common-types": "^0.27.4",
19
- "@ms-cloudpack/create-express-app": "^1.10.48",
20
- "@ms-cloudpack/import-map": "^0.10.42",
21
- "@ms-cloudpack/inline-scripts": "^0.2.31",
22
- "@ms-cloudpack/package-utilities": "^12.3.25",
17
+ "@ms-cloudpack/api-server": "^0.64.18",
18
+ "@ms-cloudpack/common-types": "^0.27.5",
19
+ "@ms-cloudpack/create-express-app": "^1.10.49",
20
+ "@ms-cloudpack/import-map": "^0.10.43",
21
+ "@ms-cloudpack/inline-scripts": "^0.2.32",
22
+ "@ms-cloudpack/package-utilities": "^12.4.0",
23
23
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
24
- "@ms-cloudpack/path-utilities": "^3.1.19",
24
+ "@ms-cloudpack/path-utilities": "^3.1.20",
25
25
  "es-module-shims": "^2.6.1",
26
26
  "ts-dedent": "^2.2.0"
27
27
  },