@ms-cloudpack/package-utilities
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -5,3 +5,24 @@ { | ||
{ | ||
"date": "Sat, 21 May 2022 00:31:20 GMT", | ||
"date": "Wed, 25 May 2022 21:40:21 GMT", | ||
"tag": "@ms-cloudpack/package-utilities_v0.4.0", | ||
"version": "0.4.0", | ||
"comments": { | ||
"minor": [ | ||
{ | ||
"author": "dzearing@microsoft.com", | ||
"package": "@ms-cloudpack/package-utilities", | ||
"commit": "c81fea1af8bedcd81366fbddb199dd2c0e6cbaa7", | ||
"comment": "Updating the entry evaluation to prefer source files for intra-repo packages." | ||
}, | ||
{ | ||
"author": "beachball", | ||
"package": "@ms-cloudpack/package-utilities", | ||
"comment": "Bump @ms-cloudpack/path-utilities to v0.3.0", | ||
"commit": "c81fea1af8bedcd81366fbddb199dd2c0e6cbaa7" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Sat, 21 May 2022 00:31:32 GMT", | ||
"tag": "@ms-cloudpack/package-utilities_v0.3.0", | ||
@@ -8,0 +29,0 @@ "version": "0.3.0", |
# Change Log - @ms-cloudpack/package-utilities | ||
This log was last generated on Sat, 21 May 2022 00:31:20 GMT and should not be manually modified. | ||
This log was last generated on Wed, 25 May 2022 21:40:21 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 0.4.0 | ||
Wed, 25 May 2022 21:40:21 GMT | ||
### Minor changes | ||
- Updating the entry evaluation to prefer source files for intra-repo packages. (dzearing@microsoft.com) | ||
- Bump @ms-cloudpack/path-utilities to v0.3.0 | ||
## 0.3.0 | ||
Sat, 21 May 2022 00:31:20 GMT | ||
Sat, 21 May 2022 00:31:32 GMT | ||
@@ -11,0 +20,0 @@ ### Minor changes |
@@ -14,3 +14,3 @@ import path from 'path'; | ||
// Initialize scopes | ||
importMap.scopes = importMap.scopes || {}; | ||
importMap.scopes ?? (importMap.scopes = {}); | ||
for (const scopedEntry of Object.values(resolveEntry.scopedVersions)) { | ||
@@ -30,3 +30,3 @@ for (const requiredById of scopedEntry.requiredBy) { | ||
if (definition) { | ||
const baseUrl = `${bundleServerUrl}/${definition.name}@${definition.version}`; | ||
const baseUrl = `${bundleServerUrl}/${definition.name}@${definition.version}/`; | ||
if (definition.exports) { | ||
@@ -38,3 +38,3 @@ for (const [exportKey, exportEntry] of Object.entries(definition.exports)) { | ||
if (exportPath) { | ||
importMap[importAlias] = slash(path.join(baseUrl, exportPath)); | ||
importMap[importAlias] = new URL(exportPath, baseUrl).href; | ||
} | ||
@@ -45,3 +45,3 @@ } | ||
else { | ||
importMap[definition.name] = slash(path.join(baseUrl, definition.module || definition.main || 'index.js')); | ||
importMap[definition.name] = new URL(definition.module || definition.main || 'index.js', baseUrl).href; | ||
} | ||
@@ -48,0 +48,0 @@ } |
@@ -18,3 +18,3 @@ import { createImportMap } from './createImportMap.js'; | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/index.js", | ||
"a": "http://localhost:12345/a@1.0.0/index.js", | ||
}, | ||
@@ -38,3 +38,3 @@ } | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/foo/main.js", | ||
"a": "http://localhost:12345/a@1.0.0/foo/main.js", | ||
}, | ||
@@ -58,3 +58,3 @@ } | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/foo/module.js", | ||
"a": "http://localhost:12345/a@1.0.0/foo/module.js", | ||
}, | ||
@@ -79,3 +79,3 @@ } | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/foo/module.js", | ||
"a": "http://localhost:12345/a@1.0.0/foo/module.js", | ||
}, | ||
@@ -101,3 +101,3 @@ } | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/foo/string.js", | ||
"a": "http://localhost:12345/a@1.0.0/foo/string.js", | ||
}, | ||
@@ -123,3 +123,3 @@ } | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/foo/default.js", | ||
"a": "http://localhost:12345/a@1.0.0/foo/default.js", | ||
}, | ||
@@ -148,3 +148,3 @@ } | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/foo/import.js", | ||
"a": "http://localhost:12345/a@1.0.0/foo/import.js", | ||
}, | ||
@@ -176,4 +176,4 @@ } | ||
"imports": Object { | ||
"a": "http:/localhost:12345/a@1.0.0/foo/import.js", | ||
"a/lib/Button": "http:/localhost:12345/a@1.0.0/lib/Button.js", | ||
"a": "http://localhost:12345/a@1.0.0/foo/import.js", | ||
"a/lib/Button": "http://localhost:12345/a@1.0.0/lib/Button.js", | ||
}, | ||
@@ -180,0 +180,0 @@ } |
import { getPackageDefinition } from './getPackageDefinition.js'; | ||
import { findPackagePath } from './findPackagePath.js'; | ||
export async function createResolveMap(options) { | ||
var _a, _b, _c, _d; | ||
const { appPath, additionalPaths = [] } = options; | ||
@@ -14,2 +15,4 @@ const visitedPaths = new Set([appPath, ...additionalPaths]); | ||
const packageId = `${definition.name}@${definition.version}`; | ||
const namedEntries = (allEntries[_a = definition.name] ?? (allEntries[_a] = {})); | ||
namedEntries[_b = definition.version] ?? (namedEntries[_b] = createMapEntry(definition, packagePath)); | ||
for (const depName of Object.keys(definition?.dependencies || {})) { | ||
@@ -19,4 +22,4 @@ const dependencyPath = findPackagePath(depName, packagePath); | ||
if (dependencyDefinition) { | ||
const dependencyNamedEntries = (allEntries[dependencyDefinition.name] ??= {}); | ||
const dependencyEntry = (dependencyNamedEntries[dependencyDefinition.version] ??= createMapEntry(dependencyDefinition, dependencyPath)); | ||
const dependencyNamedEntries = (allEntries[_c = dependencyDefinition.name] ?? (allEntries[_c] = {})); | ||
const dependencyEntry = (dependencyNamedEntries[_d = dependencyDefinition.version] ?? (dependencyNamedEntries[_d] = createMapEntry(dependencyDefinition, dependencyPath))); | ||
dependencyEntry.requiredBy.add(packageId); | ||
@@ -23,0 +26,0 @@ if (!visitedPaths.has(dependencyPath)) { |
@@ -27,2 +27,8 @@ import { slash } from '@ms-cloudpack/path-utilities'; | ||
}, | ||
"test-project-1": Object { | ||
"name": "test-project-1", | ||
"path": "", | ||
"requiredBy": Array [], | ||
"version": "0.0.1", | ||
}, | ||
} | ||
@@ -29,0 +35,0 @@ `); |
{ | ||
"name": "@ms-cloudpack/package-utilities", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Utilities for resolving/parsing packages and their imports.", | ||
@@ -18,3 +18,3 @@ "license": "MIT", | ||
"@babel/traverse": "^7.16.10", | ||
"@ms-cloudpack/path-utilities": "^0.2.0", | ||
"@ms-cloudpack/path-utilities": "^0.3.0", | ||
"resolve": "^1.22.0" | ||
@@ -21,0 +21,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112060
1739
+ Added@ms-cloudpack/path-utilities@0.3.2(transitive)
- Removed@ms-cloudpack/path-utilities@0.2.0(transitive)