@miadi/relational-git-repository-mapper 0.4.0 → 0.5.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/README.md +54 -2
- package/dist/capabilities.d.ts +31 -0
- package/dist/capabilities.js +45 -5
- package/dist/cli.js +81 -7
- package/dist/hosts.d.ts +56 -0
- package/dist/hosts.js +60 -0
- package/dist/impact.d.ts +89 -0
- package/dist/impact.js +169 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +28 -1
- package/dist/join.d.ts +3 -2
- package/dist/join.js +33 -4
- package/dist/lineage.d.ts +4 -4
- package/dist/read.d.ts +50 -0
- package/dist/read.js +74 -3
- package/dist/scan.d.ts +3 -0
- package/dist/scan.js +17 -0
- package/dist/shipped-capabilities.d.ts +1 -0
- package/dist/shipped-capabilities.js +1736 -326
- package/dist/shipped-hosts.d.ts +2 -0
- package/dist/shipped-hosts.js +190 -0
- package/dist/types.d.ts +28 -1
- package/dist/where.d.ts +11 -0
- package/dist/where.js +85 -0
- package/package.json +5 -5
package/dist/scan.js
CHANGED
|
@@ -39,10 +39,20 @@ async function scanRepository(clone, options) {
|
|
|
39
39
|
const show = (path) => git(clone, ["show", `${commit}:${path}`]);
|
|
40
40
|
const globs = (0, capabilities_1.workspaceGlobs)(await show("package.json"), files.includes("pnpm-workspace.yaml") ? await show("pnpm-workspace.yaml") : undefined);
|
|
41
41
|
const artefacts = [];
|
|
42
|
+
const packages = [];
|
|
42
43
|
for (const manifest of (0, capabilities_1.packageManifests)(globs, files)) {
|
|
43
44
|
const pkg = (0, capabilities_1.parsePackageJson)((await show(manifest)) ?? "");
|
|
44
45
|
if (!pkg.name)
|
|
45
46
|
continue;
|
|
47
|
+
packages.push({
|
|
48
|
+
capability: (0, capabilities_1.capabilityId)("package", pkg.name),
|
|
49
|
+
name: pkg.name,
|
|
50
|
+
...(pkg.version ? { version: pkg.version } : {}),
|
|
51
|
+
repository,
|
|
52
|
+
path: manifest,
|
|
53
|
+
commit: commit.slice(0, 12),
|
|
54
|
+
dependsOn: pkg.dependsOn,
|
|
55
|
+
});
|
|
46
56
|
artefacts.push({ kind: "package", name: pkg.name, ...(pkg.description ? { description: pkg.description } : {}), path: manifest });
|
|
47
57
|
for (const bin of pkg.bins) {
|
|
48
58
|
artefacts.push({ kind: "cli", name: bin, description: `The ${bin} command, shipped by ${pkg.name}.`, path: manifest });
|
|
@@ -55,11 +65,18 @@ async function scanRepository(clone, options) {
|
|
|
55
65
|
continue;
|
|
56
66
|
artefacts.push({ kind: "skill", name, ...(front.description ? { description: front.description } : {}), path: file });
|
|
57
67
|
}
|
|
68
|
+
// Capabilities defined in code, each by the reader written for its repository's file.
|
|
69
|
+
for (const reader of capabilities_1.CODE_READERS) {
|
|
70
|
+
if (reader.repository.toLowerCase() !== repository.toLowerCase() || !files.includes(reader.path))
|
|
71
|
+
continue;
|
|
72
|
+
artefacts.push(...reader.read((await show(reader.path)) ?? ""));
|
|
73
|
+
}
|
|
58
74
|
const observedAt = (options.now ?? new Date()).toISOString();
|
|
59
75
|
return {
|
|
60
76
|
repository,
|
|
61
77
|
ref,
|
|
62
78
|
commit,
|
|
63
79
|
capabilities: (0, capabilities_1.capabilityRows)(artefacts, { repository, commit, observedBy: options.observedBy, observedAt }),
|
|
80
|
+
packages,
|
|
64
81
|
};
|
|
65
82
|
}
|