@ms-cloudpack/package-hashes 0.7.36 → 0.7.37
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.
package/lib/PackageHashes.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export declare class PackageHashes implements PackageHashesCache {
|
|
|
38
38
|
* Creates a serializable representation of the cache.
|
|
39
39
|
*/
|
|
40
40
|
toSerializable(): SerializablePackageHashesCache;
|
|
41
|
+
set(input: Omit<PackageHashOptions, 'shouldRecalculate'>, hash: string): void;
|
|
42
|
+
extend(input: SerializablePackageHashesCache): void;
|
|
41
43
|
}
|
|
42
44
|
export {};
|
|
43
45
|
//# sourceMappingURL=PackageHashes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageHashes.d.ts","sourceRoot":"","sources":["../src/PackageHashes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,8BAA8B,EAC/B,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D;;;;GAIG;AACH,KAAK,oBAAoB,GACrB;IACE,iFAAiF;IACjF,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,OAAO,EAAE;QACP,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,uBAAuB,GAAG,6BAA6B,CAAC,CAAC;QACvF,QAAQ,EAAE,uBAAuB,CAAC;QAClC,UAAU,EAAE,UAAU,CAAC;KACxB,CAAC;CACH,GACD;IACE;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEN;;GAEG;AACH,qBAAa,aAAc,YAAW,kBAAkB;IAa1C,QAAQ,CAAC,OAAO,EAAE,oBAAoB;IAZlD,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAGhC;IACF,uEAAuE;IAC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C,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAM7E,MAAM,CAAC,KAAK,EAAE,8BAA8B,GAAG,IAAI;CAcpD"}
|
package/lib/PackageHashes.js
CHANGED
|
@@ -63,5 +63,23 @@ export class PackageHashes {
|
|
|
63
63
|
},
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
+
set(input, hash) {
|
|
67
|
+
const { packagePath, isSourceHashingEnabled, targetEnvironment } = input;
|
|
68
|
+
const map = (isSourceHashingEnabled ? this._hashesWithSource : this._hashesWithNoSource)[targetEnvironment];
|
|
69
|
+
map.set(packagePath, hash);
|
|
70
|
+
}
|
|
71
|
+
extend(input) {
|
|
72
|
+
// Helper function to merge an object's entries into a Map
|
|
73
|
+
const extendMap = (map, obj = {}) => {
|
|
74
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
75
|
+
map.set(key, value);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
// Apply to all map collections
|
|
79
|
+
extendMap(this._hashesWithSource.browser, input.hashesWithSource?.browser);
|
|
80
|
+
extendMap(this._hashesWithSource.node, input.hashesWithSource?.node);
|
|
81
|
+
extendMap(this._hashesWithNoSource.browser, input.hashesWithNoSource?.browser);
|
|
82
|
+
extendMap(this._hashesWithNoSource.node, input.hashesWithNoSource?.node);
|
|
83
|
+
}
|
|
66
84
|
}
|
|
67
85
|
//# sourceMappingURL=PackageHashes.js.map
|
package/lib/PackageHashes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageHashes.js","sourceRoot":"","sources":["../src/PackageHashes.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AA2BzE;;GAEG;AACH,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I,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/C,OAAO,GAAG,CAAC,GAAG,CAAC,WAAW,CAAW,CAAC;QACxC,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAErC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAE3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,OAAO;YACL,gBAAgB,EAAE;gBAChB,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;gBAC3D,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC;aACtD;YACD,kBAAkB,EAAE;gBAClB,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC;gBAC7D,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;aACxD;SACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type {\n CloudpackConfig,\n PackageDefinitionsCache,\n PackageHashOptions,\n PackageHashesCache,\n ResolveMap,\n SerializablePackageHashesCache,\n} from '@ms-cloudpack/common-types';\nimport { hashPackage } from './hashPackage.js';\nimport type { HashFunction } from './types/HashFunction.js';\nimport { PackagePatchesCache } from './PackagePatchesCache.js';\nimport { BundlerCapabilitiesCache } from './BundlerCapabilitiesCache.js';\n\n/**\n * Constructor options for the PackageHashes class.\n *\n * (For `PackageHashes.get` options, see `PackageHashOptions`.)\n */\ntype PackageHashesOptions =\n | {\n /** Working directory used to find the project root (usually repository root). */\n cwd: string;\n /**\n * Context for the hash calculations.\n */\n context: {\n config: Pick<CloudpackConfig, 'patchFilesGlobPattern' | 'bundlerCapabilitiesRegistry'>;\n packages: PackageDefinitionsCache;\n resolveMap: ResolveMap;\n };\n }\n | {\n /**\n * A function that returns the hash for a given package path. This is intended for testing purposes.\n */\n hash: HashFunction;\n };\n\n/**\n * Utility class for hashing packages and caching the results.\n */\nexport class PackageHashes implements PackageHashesCache {\n /** Mapping from package path to hash (considering source files) */\n private readonly _hashesWithSource = {\n browser: new Map<string, string>(),\n node: new Map<string, string>(),\n };\n /** Mapping from package path to hash (not considering source files) */\n private readonly _hashesWithNoSource = {\n browser: new Map<string, string>(),\n node: new Map<string, string>(),\n };\n private readonly _hash: HashFunction;\n\n constructor(readonly options: PackageHashesOptions) {\n if ('hash' in options) {\n this._hash = options.hash;\n return;\n }\n\n const { config } = options.context;\n const patches = new PackagePatchesCache({\n cwd: options.cwd,\n globPattern: config.patchFilesGlobPattern,\n });\n const bundlerCapabilitiesCache = new BundlerCapabilitiesCache(config.bundlerCapabilitiesRegistry);\n\n this._hash = (input) =>\n hashPackage({\n input,\n context: {\n ...options.context,\n patches,\n bundlerCapabilitiesCache,\n },\n });\n }\n\n async get(input: PackageHashOptions): Promise<string> {\n const { packagePath, isSourceHashingEnabled, shouldRecalculate, targetEnvironment } = input;\n\n const map = (isSourceHashingEnabled ? this._hashesWithSource : this._hashesWithNoSource)[targetEnvironment];\n\n if (!shouldRecalculate && map.has(packagePath)) {\n return map.get(packagePath) as string;\n }\n\n const hash = await this._hash(input);\n\n map.set(packagePath, hash);\n\n return hash;\n }\n\n /**\n * Creates a serializable representation of the cache.\n */\n toSerializable(): SerializablePackageHashesCache {\n return {\n hashesWithSource: {\n browser: Object.fromEntries(this._hashesWithSource.browser),\n node: Object.fromEntries(this._hashesWithSource.node),\n },\n hashesWithNoSource: {\n browser: Object.fromEntries(this._hashesWithNoSource.browser),\n node: Object.fromEntries(this._hashesWithNoSource.node),\n },\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PackageHashes.js","sourceRoot":"","sources":["../src/PackageHashes.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,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,0DAA0D;QAC1D,MAAM,SAAS,GAAG,CAAC,GAAwB,EAAE,MAA8B,EAAE,EAAQ,EAAE;YACrF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/C,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACtB,CAAC;QACH,CAAC,CAAC;QAEF,+BAA+B;QAC/B,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QAC3E,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QACrE,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAC/E,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;CACF","sourcesContent":["import type {\n CloudpackConfig,\n PackageDefinitionsCache,\n PackageHashOptions,\n PackageHashesCache,\n ResolveMap,\n SerializablePackageHashesCache,\n} from '@ms-cloudpack/common-types';\nimport { hashPackage } from './hashPackage.js';\nimport type { HashFunction } from './types/HashFunction.js';\nimport { PackagePatchesCache } from './PackagePatchesCache.js';\nimport { BundlerCapabilitiesCache } from './BundlerCapabilitiesCache.js';\n\n/**\n * Constructor options for the PackageHashes class.\n *\n * (For `PackageHashes.get` options, see `PackageHashOptions`.)\n */\ntype PackageHashesOptions =\n | {\n /** Working directory used to find the project root (usually repository root). */\n cwd: string;\n /**\n * Context for the hash calculations.\n */\n context: {\n config: Pick<CloudpackConfig, 'patchFilesGlobPattern' | 'bundlerCapabilitiesRegistry'>;\n packages: PackageDefinitionsCache;\n resolveMap: ResolveMap;\n };\n }\n | {\n /**\n * A function that returns the hash for a given package path. This is intended for testing purposes.\n */\n hash: HashFunction;\n };\n\n/**\n * Utility class for hashing packages and caching the results.\n */\nexport class PackageHashes implements PackageHashesCache {\n /** Mapping from package path to hash (considering source files) */\n private readonly _hashesWithSource = {\n browser: new Map<string, string>(),\n node: new Map<string, string>(),\n };\n /** Mapping from package path to hash (not considering source files) */\n private readonly _hashesWithNoSource = {\n browser: new Map<string, string>(),\n node: new Map<string, string>(),\n };\n private readonly _hash: HashFunction;\n\n constructor(readonly options: PackageHashesOptions) {\n if ('hash' in options) {\n this._hash = options.hash;\n return;\n }\n\n const { config } = options.context;\n const patches = new PackagePatchesCache({\n cwd: options.cwd,\n globPattern: config.patchFilesGlobPattern,\n });\n const bundlerCapabilitiesCache = new BundlerCapabilitiesCache(config.bundlerCapabilitiesRegistry);\n\n this._hash = (input) =>\n hashPackage({\n input,\n context: {\n ...options.context,\n patches,\n bundlerCapabilitiesCache,\n },\n });\n }\n\n async get(input: PackageHashOptions): Promise<string> {\n const { packagePath, isSourceHashingEnabled, shouldRecalculate, targetEnvironment } = input;\n\n const map = (isSourceHashingEnabled ? this._hashesWithSource : this._hashesWithNoSource)[targetEnvironment];\n\n if (!shouldRecalculate && map.has(packagePath)) {\n return map.get(packagePath) as string;\n }\n\n const hash = await this._hash(input);\n\n map.set(packagePath, hash);\n\n return hash;\n }\n\n /**\n * Creates a serializable representation of the cache.\n */\n toSerializable(): SerializablePackageHashesCache {\n return {\n hashesWithSource: {\n browser: Object.fromEntries(this._hashesWithSource.browser),\n node: Object.fromEntries(this._hashesWithSource.node),\n },\n hashesWithNoSource: {\n browser: Object.fromEntries(this._hashesWithNoSource.browser),\n node: Object.fromEntries(this._hashesWithNoSource.node),\n },\n };\n }\n\n set(input: Omit<PackageHashOptions, 'shouldRecalculate'>, hash: string): void {\n const { packagePath, isSourceHashingEnabled, targetEnvironment } = input;\n const map = (isSourceHashingEnabled ? this._hashesWithSource : this._hashesWithNoSource)[targetEnvironment];\n map.set(packagePath, hash);\n }\n\n extend(input: SerializablePackageHashesCache): void {\n // Helper function to merge an object's entries into a Map\n const extendMap = (map: Map<string, string>, obj: Record<string, string> = {}): void => {\n for (const [key, value] of Object.entries(obj)) {\n map.set(key, value);\n }\n };\n\n // Apply to all map collections\n extendMap(this._hashesWithSource.browser, input.hashesWithSource?.browser);\n extendMap(this._hashesWithSource.node, input.hashesWithSource?.node);\n extendMap(this._hashesWithNoSource.browser, input.hashesWithNoSource?.browser);\n extendMap(this._hashesWithNoSource.node, input.hashesWithNoSource?.node);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/package-hashes",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.37",
|
|
4
4
|
"description": "Utilities for hashing packages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@ms-cloudpack/common-types": "^0.24.
|
|
18
|
-
"@ms-cloudpack/config": "^0.33.
|
|
19
|
-
"@ms-cloudpack/package-utilities": "^12.0
|
|
20
|
-
"@ms-cloudpack/path-string-parsing": "^1.2.
|
|
21
|
-
"@ms-cloudpack/path-utilities": "^3.0.
|
|
17
|
+
"@ms-cloudpack/common-types": "^0.24.13",
|
|
18
|
+
"@ms-cloudpack/config": "^0.33.25",
|
|
19
|
+
"@ms-cloudpack/package-utilities": "^12.1.0",
|
|
20
|
+
"@ms-cloudpack/path-string-parsing": "^1.2.7",
|
|
21
|
+
"@ms-cloudpack/path-utilities": "^3.0.10",
|
|
22
22
|
"fast-glob": "^3.2.12",
|
|
23
23
|
"glob-hasher": "^1.4.2",
|
|
24
24
|
"object-hash": "^3.0.0"
|