@lage-run/hasher 0.1.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.
- package/.eslintignore +2 -0
- package/CHANGELOG.json +20 -0
- package/CHANGELOG.md +13 -0
- package/README.md +2 -0
- package/jest.config.js +1 -0
- package/lib/__fixtures__/config/backfill.config.d.ts +1 -0
- package/lib/__fixtures__/config/backfill.config.js +5 -0
- package/lib/__fixtures__/config/backfill.config.js.map +1 -0
- package/lib/__fixtures__/config/packages/package-1/backfill.config.d.ts +0 -0
- package/lib/__fixtures__/config/packages/package-1/backfill.config.js +2 -0
- package/lib/__fixtures__/config/packages/package-1/backfill.config.js.map +1 -0
- package/lib/__tests__/createPackageHashes.test.d.ts +1 -0
- package/lib/__tests__/createPackageHashes.test.js +43 -0
- package/lib/__tests__/createPackageHashes.test.js.map +1 -0
- package/lib/__tests__/getPackageDeps.test.d.ts +1 -0
- package/lib/__tests__/getPackageDeps.test.js +287 -0
- package/lib/__tests__/getPackageDeps.test.js.map +1 -0
- package/lib/__tests__/getRepoDeps.test.d.ts +1 -0
- package/lib/__tests__/getRepoDeps.test.js +238 -0
- package/lib/__tests__/getRepoDeps.test.js.map +1 -0
- package/lib/__tests__/getRepoState.test.d.ts +1 -0
- package/lib/__tests__/getRepoState.test.js +67 -0
- package/lib/__tests__/getRepoState.test.js.map +1 -0
- package/lib/__tests__/hashOfFiles.test.d.ts +1 -0
- package/lib/__tests__/hashOfFiles.test.js +100 -0
- package/lib/__tests__/hashOfFiles.test.js.map +1 -0
- package/lib/__tests__/helpers.test.d.ts +1 -0
- package/lib/__tests__/helpers.test.js +27 -0
- package/lib/__tests__/helpers.test.js.map +1 -0
- package/lib/__tests__/index.test.d.ts +1 -0
- package/lib/__tests__/index.test.js +87 -0
- package/lib/__tests__/index.test.js.map +1 -0
- package/lib/__tests__/resolveDependenciesHelper.d.ts +3 -0
- package/lib/__tests__/resolveDependenciesHelper.js +41 -0
- package/lib/__tests__/resolveDependenciesHelper.js.map +1 -0
- package/lib/__tests__/resolveExternalDependencies.test.d.ts +1 -0
- package/lib/__tests__/resolveExternalDependencies.test.js +108 -0
- package/lib/__tests__/resolveExternalDependencies.test.js.map +1 -0
- package/lib/__tests__/resolveInternalDependencies.test.d.ts +1 -0
- package/lib/__tests__/resolveInternalDependencies.test.js +100 -0
- package/lib/__tests__/resolveInternalDependencies.test.js.map +1 -0
- package/lib/createPackageHashes.d.ts +4 -0
- package/lib/createPackageHashes.js +41 -0
- package/lib/createPackageHashes.js.map +1 -0
- package/lib/getPackageDeps.d.ts +45 -0
- package/lib/getPackageDeps.js +254 -0
- package/lib/getPackageDeps.js.map +1 -0
- package/lib/getRepoState.d.ts +76 -0
- package/lib/getRepoState.js +271 -0
- package/lib/getRepoState.js.map +1 -0
- package/lib/hashOfFiles.d.ts +14 -0
- package/lib/hashOfFiles.js +65 -0
- package/lib/hashOfFiles.js.map +1 -0
- package/lib/hashOfPackage.d.ts +9 -0
- package/lib/hashOfPackage.js +52 -0
- package/lib/hashOfPackage.js.map +1 -0
- package/lib/helpers.d.ts +3 -0
- package/lib/helpers.js +31 -0
- package/lib/helpers.js.map +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +66 -0
- package/lib/index.js.map +1 -0
- package/lib/repoInfo.d.ts +26 -0
- package/lib/repoInfo.js +68 -0
- package/lib/repoInfo.js.map +1 -0
- package/lib/resolveExternalDependencies.d.ts +11 -0
- package/lib/resolveExternalDependencies.js +59 -0
- package/lib/resolveExternalDependencies.js.map +1 -0
- package/lib/resolveInternalDependencies.d.ts +6 -0
- package/lib/resolveInternalDependencies.js +15 -0
- package/lib/resolveInternalDependencies.js.map +1 -0
- package/package.json +30 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { WorkspaceInfo, ParsedLock } from "workspace-tools";
|
|
2
|
+
export interface RepoInfo {
|
|
3
|
+
root: string;
|
|
4
|
+
workspaceInfo: WorkspaceInfo;
|
|
5
|
+
parsedLock: ParsedLock;
|
|
6
|
+
repoHashes: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
packageHashes: Record<string, [string, string][]>;
|
|
10
|
+
}
|
|
11
|
+
export declare function getRepoInfoNoCache(cwd: string): Promise<{
|
|
12
|
+
root: string;
|
|
13
|
+
workspaceInfo: WorkspaceInfo;
|
|
14
|
+
parsedLock: ParsedLock;
|
|
15
|
+
repoHashes: Record<string, string>;
|
|
16
|
+
packageHashes: Record<string, [string, string][]>;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the repoInfo, one at a time
|
|
20
|
+
*
|
|
21
|
+
* No parallel of this function is allowed; this maximizes the cache hit even
|
|
22
|
+
* though the getWorkspaces and parseLockFile are async functions from workspace-tools
|
|
23
|
+
*
|
|
24
|
+
* @param cwd
|
|
25
|
+
*/
|
|
26
|
+
export declare function getRepoInfo(cwd: string): Promise<RepoInfo>;
|
package/lib/repoInfo.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRepoInfo = exports.getRepoInfoNoCache = void 0;
|
|
4
|
+
const workspace_tools_1 = require("workspace-tools");
|
|
5
|
+
const getPackageDeps_js_1 = require("./getPackageDeps.js");
|
|
6
|
+
const createPackageHashes_js_1 = require("./createPackageHashes.js");
|
|
7
|
+
const repoInfoCache = [];
|
|
8
|
+
/**
|
|
9
|
+
* repoInfo cache lookup - it is specialized to be using a substring match to make it run as fast as possible
|
|
10
|
+
* @param packageRoot
|
|
11
|
+
*/
|
|
12
|
+
function searchRepoInfoCache(packageRoot) {
|
|
13
|
+
for (const repoInfo of repoInfoCache) {
|
|
14
|
+
if (repoInfo.workspaceInfo && packageRoot.startsWith(repoInfo.root)) {
|
|
15
|
+
return repoInfo;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function getRepoInfoNoCache(cwd) {
|
|
20
|
+
const root = (0, workspace_tools_1.getWorkspaceRoot)(cwd);
|
|
21
|
+
if (!root) {
|
|
22
|
+
throw new Error("Cannot initialize Repo class without a workspace root");
|
|
23
|
+
}
|
|
24
|
+
// Assuming the package-deps-hash package returns a map of files to hashes that are unordered
|
|
25
|
+
const unorderedRepoHashes = Object.fromEntries((0, getPackageDeps_js_1.getPackageDeps)(root));
|
|
26
|
+
// Sorting repoHash by key because we want to consistent hashing based on the order of the files
|
|
27
|
+
const repoHashes = Object.keys(unorderedRepoHashes)
|
|
28
|
+
.sort((a, b) => a.localeCompare(b))
|
|
29
|
+
.reduce((obj, key) => {
|
|
30
|
+
obj[key] = unorderedRepoHashes[key];
|
|
31
|
+
return obj;
|
|
32
|
+
}, {});
|
|
33
|
+
const workspaceInfo = (0, workspace_tools_1.getWorkspaces)(root);
|
|
34
|
+
const parsedLock = await (0, workspace_tools_1.parseLockFile)(root);
|
|
35
|
+
const packageHashes = (0, createPackageHashes_js_1.createPackageHashes)(root, workspaceInfo, repoHashes);
|
|
36
|
+
const repoInfo = {
|
|
37
|
+
root,
|
|
38
|
+
workspaceInfo,
|
|
39
|
+
parsedLock,
|
|
40
|
+
repoHashes,
|
|
41
|
+
packageHashes,
|
|
42
|
+
};
|
|
43
|
+
repoInfoCache.push(repoInfo);
|
|
44
|
+
return repoInfo;
|
|
45
|
+
}
|
|
46
|
+
exports.getRepoInfoNoCache = getRepoInfoNoCache;
|
|
47
|
+
// A promise to guarantee the getRepoInfo is done one at a time
|
|
48
|
+
let oneAtATime = Promise.resolve();
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the repoInfo, one at a time
|
|
51
|
+
*
|
|
52
|
+
* No parallel of this function is allowed; this maximizes the cache hit even
|
|
53
|
+
* though the getWorkspaces and parseLockFile are async functions from workspace-tools
|
|
54
|
+
*
|
|
55
|
+
* @param cwd
|
|
56
|
+
*/
|
|
57
|
+
async function getRepoInfo(cwd) {
|
|
58
|
+
oneAtATime = oneAtATime.then(async () => {
|
|
59
|
+
const searchResult = searchRepoInfoCache(cwd);
|
|
60
|
+
if (searchResult) {
|
|
61
|
+
return searchResult;
|
|
62
|
+
}
|
|
63
|
+
return getRepoInfoNoCache(cwd);
|
|
64
|
+
});
|
|
65
|
+
return oneAtATime;
|
|
66
|
+
}
|
|
67
|
+
exports.getRepoInfo = getRepoInfo;
|
|
68
|
+
//# sourceMappingURL=repoInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repoInfo.js","sourceRoot":"","sources":["../src/repoInfo.ts"],"names":[],"mappings":";;;AACA,qDAAiF;AAEjF,2DAAqD;AACrD,qEAA+D;AAU/D,MAAM,aAAa,GAAe,EAAE,CAAC;AAErC;;;GAGG;AACH,SAAS,mBAAmB,CAAC,WAAmB;IAC9C,KAAK,MAAM,QAAQ,IAAI,aAAa,EAAE;QACpC,IAAI,QAAQ,CAAC,aAAa,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YACnE,OAAO,QAAQ,CAAC;SACjB;KACF;AACH,CAAC;AAEM,KAAK,UAAU,kBAAkB,CAAC,GAAW;IAClD,MAAM,IAAI,GAAG,IAAA,kCAAgB,EAAC,GAAG,CAAC,CAAC;IAEnC,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;KAC1E;IAED,6FAA6F;IAC7F,MAAM,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAAC,IAAA,kCAAc,EAAC,IAAI,CAAC,CAAC,CAAC;IAErE,gGAAgG;IAChG,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC;SAChD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;SAClC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACnB,GAAG,CAAC,GAAG,CAAC,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAA4B,CAAC,CAAC;IAEnC,MAAM,aAAa,GAAG,IAAA,+BAAa,EAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,MAAM,IAAA,+BAAa,EAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,aAAa,GAAG,IAAA,4CAAmB,EAAC,IAAI,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;IAE3E,MAAM,QAAQ,GAAG;QACf,IAAI;QACJ,aAAa;QACb,UAAU;QACV,UAAU;QACV,aAAa;KACd,CAAC;IAEF,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAE7B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAjCD,gDAiCC;AAED,+DAA+D;AAC/D,IAAI,UAAU,GAAiB,OAAO,CAAC,OAAO,EAAE,CAAC;AAEjD;;;;;;;GAOG;AACI,KAAK,UAAU,WAAW,CAAC,GAAW;IAC3C,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;QACtC,MAAM,YAAY,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,YAAY,EAAE;YAChB,OAAO,YAAY,CAAC;SACrB;QACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC;AAVD,kCAUC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ParsedLock, WorkspaceInfo } from "workspace-tools";
|
|
2
|
+
export declare type Dependencies = {
|
|
3
|
+
[key in string]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type ExternalDependenciesQueue = {
|
|
6
|
+
name: string;
|
|
7
|
+
versionRange: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare function filterExternalDependencies(dependencies: Dependencies, workspaces: WorkspaceInfo): Dependencies;
|
|
10
|
+
export declare function addToQueue(dependencies: Dependencies | undefined, done: string[], queue: [string, string][]): void;
|
|
11
|
+
export declare function resolveExternalDependencies(allDependencies: Dependencies, workspaces: WorkspaceInfo, lockInfo: ParsedLock): string[];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveExternalDependencies = exports.addToQueue = exports.filterExternalDependencies = void 0;
|
|
4
|
+
const workspace_tools_1 = require("workspace-tools");
|
|
5
|
+
const helpers_js_1 = require("./helpers.js");
|
|
6
|
+
function filterExternalDependencies(dependencies, workspaces) {
|
|
7
|
+
const workspacePackageNames = (0, workspace_tools_1.listOfWorkspacePackageNames)(workspaces);
|
|
8
|
+
const externalDependencies = {};
|
|
9
|
+
Object.entries(dependencies).forEach(([name, versionRange]) => {
|
|
10
|
+
if (workspacePackageNames.indexOf(name) < 0) {
|
|
11
|
+
externalDependencies[name] = versionRange;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return externalDependencies;
|
|
15
|
+
}
|
|
16
|
+
exports.filterExternalDependencies = filterExternalDependencies;
|
|
17
|
+
function isDone(done, key) {
|
|
18
|
+
return done.indexOf(key) >= 0;
|
|
19
|
+
}
|
|
20
|
+
function isInQueue(queue, key) {
|
|
21
|
+
return Boolean(queue.find(([name, versionRange]) => (0, helpers_js_1.nameAtVersion)(name, versionRange) === key));
|
|
22
|
+
}
|
|
23
|
+
function addToQueue(dependencies, done, queue) {
|
|
24
|
+
if (dependencies) {
|
|
25
|
+
Object.entries(dependencies).forEach(([name, versionRange]) => {
|
|
26
|
+
const versionRangeSignature = (0, helpers_js_1.nameAtVersion)(name, versionRange);
|
|
27
|
+
if (!isDone(done, versionRangeSignature) && !isInQueue(queue, versionRangeSignature)) {
|
|
28
|
+
queue.push([name, versionRange]);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.addToQueue = addToQueue;
|
|
34
|
+
function resolveExternalDependencies(allDependencies, workspaces, lockInfo) {
|
|
35
|
+
const externalDependencies = filterExternalDependencies(allDependencies, workspaces);
|
|
36
|
+
const done = [];
|
|
37
|
+
const doneRange = [];
|
|
38
|
+
const queue = Object.entries(externalDependencies);
|
|
39
|
+
while (queue.length > 0) {
|
|
40
|
+
const next = queue.shift();
|
|
41
|
+
if (!next) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const [name, versionRange] = next;
|
|
45
|
+
doneRange.push((0, helpers_js_1.nameAtVersion)(name, versionRange));
|
|
46
|
+
const lockFileResult = (0, workspace_tools_1.queryLockFile)(name, versionRange, lockInfo);
|
|
47
|
+
if (lockFileResult) {
|
|
48
|
+
const { version, dependencies } = lockFileResult;
|
|
49
|
+
addToQueue(dependencies, doneRange, queue);
|
|
50
|
+
done.push((0, helpers_js_1.nameAtVersion)(name, version));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
done.push((0, helpers_js_1.nameAtVersion)(name, versionRange));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return done;
|
|
57
|
+
}
|
|
58
|
+
exports.resolveExternalDependencies = resolveExternalDependencies;
|
|
59
|
+
//# sourceMappingURL=resolveExternalDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveExternalDependencies.js","sourceRoot":"","sources":["../src/resolveExternalDependencies.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WorkspaceInfo } from "workspace-tools";
|
|
2
|
+
export declare type Dependencies = {
|
|
3
|
+
[key in string]: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function filterInternalDependencies(dependencies: Dependencies, workspaces: WorkspaceInfo): string[];
|
|
6
|
+
export declare function resolveInternalDependencies(allDependencies: Dependencies, workspaces: WorkspaceInfo): string[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveInternalDependencies = exports.filterInternalDependencies = void 0;
|
|
4
|
+
const workspace_tools_1 = require("workspace-tools");
|
|
5
|
+
function filterInternalDependencies(dependencies, workspaces) {
|
|
6
|
+
const workspacePackageNames = (0, workspace_tools_1.listOfWorkspacePackageNames)(workspaces);
|
|
7
|
+
return Object.keys(dependencies).filter((dependency) => workspacePackageNames.indexOf(dependency) >= 0);
|
|
8
|
+
}
|
|
9
|
+
exports.filterInternalDependencies = filterInternalDependencies;
|
|
10
|
+
function resolveInternalDependencies(allDependencies, workspaces) {
|
|
11
|
+
const dependencyNames = filterInternalDependencies(allDependencies, workspaces);
|
|
12
|
+
return dependencyNames;
|
|
13
|
+
}
|
|
14
|
+
exports.resolveInternalDependencies = resolveInternalDependencies;
|
|
15
|
+
//# sourceMappingURL=resolveInternalDependencies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveInternalDependencies.js","sourceRoot":"","sources":["../src/resolveInternalDependencies.ts"],"names":[],"mappings":";;;AACA,qDAA8D;AAI9D,SAAgB,0BAA0B,CAAC,YAA0B,EAAE,UAAyB;IAC9F,MAAM,qBAAqB,GAAG,IAAA,6CAA2B,EAAC,UAAU,CAAC,CAAC;IACtE,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1G,CAAC;AAHD,gEAGC;AAED,SAAgB,2BAA2B,CAAC,eAA6B,EAAE,UAAyB;IAClG,MAAM,eAAe,GAAG,0BAA0B,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IAEhF,OAAO,eAAe,CAAC;AACzB,CAAC;AAJD,kEAIC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lage-run/hasher",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Hasher for Lage Targets",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/microsoft/lage"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "lib/index.js",
|
|
10
|
+
"types": "lib/index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "monorepo-scripts tsc",
|
|
13
|
+
"start": "monorepo-scripts tsc -w --preserveWatchOutput",
|
|
14
|
+
"test": "monorepo-scripts jest",
|
|
15
|
+
"lint": "monorepo-scripts lint"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"execa": "5.1.1",
|
|
19
|
+
"workspace-tools": "0.29.0",
|
|
20
|
+
"find-up": "^5.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@lage-run/monorepo-fixture": "^0.1.0",
|
|
24
|
+
"monorepo-scripts": "*",
|
|
25
|
+
"fs-extra": "10.1.0"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|