@vltpkg/graph 1.0.0-rc.4 → 1.0.0-rc.5
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.
|
@@ -32,10 +32,11 @@ export type JSONOutputItem = {
|
|
|
32
32
|
};
|
|
33
33
|
export type JSONOutputGraph = {
|
|
34
34
|
edges: EdgeLike[];
|
|
35
|
+
nodes: NodeLike[];
|
|
35
36
|
importers: Set<NodeLike>;
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
38
39
|
* Returns a JSON string representation of the graph.
|
|
39
40
|
*/
|
|
40
|
-
export declare function jsonOutput({ edges, importers }: JSONOutputGraph): JSONOutputItem[];
|
|
41
|
+
export declare function jsonOutput({ edges, nodes, importers, }: JSONOutputGraph): JSONOutputItem[];
|
|
41
42
|
//# sourceMappingURL=json-output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-output.d.ts","sourceRoot":"","sources":["../../../src/visualization/json-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEvD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAA;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"json-output.d.ts","sourceRoot":"","sources":["../../../src/visualization/json-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEvD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAA;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACvB;;OAEG;IACH,EAAE,CAAC,EAAE,QAAQ,CAAA;IACb;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,SAAS,GACV,EAAE,eAAe,oBA2CjB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns a JSON string representation of the graph.
|
|
3
3
|
*/
|
|
4
|
-
export function jsonOutput({ edges, importers }) {
|
|
4
|
+
export function jsonOutput({ edges, nodes, importers, }) {
|
|
5
5
|
const res = [];
|
|
6
6
|
const seenIds = new Set();
|
|
7
7
|
// Collects edge & it's linked nodes as json output items
|
|
@@ -37,7 +37,7 @@ export function jsonOutput({ edges, importers }) {
|
|
|
37
37
|
return a.name.localeCompare(b.name);
|
|
38
38
|
});
|
|
39
39
|
for (const node of orderedImporters) {
|
|
40
|
-
if (seenIds.has(node.id))
|
|
40
|
+
if (!nodes.includes(node) || seenIds.has(node.id))
|
|
41
41
|
continue;
|
|
42
42
|
res.unshift({
|
|
43
43
|
/* c8 ignore next - name can't be missing but ts won't know */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-output.js","sourceRoot":"","sources":["../../../src/visualization/json-output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-output.js","sourceRoot":"","sources":["../../../src/visualization/json-output.ts"],"names":[],"mappings":"AAwCA;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,SAAS,GACO;IAChB,MAAM,GAAG,GAAqB,EAAE,CAAA;IAChC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAS,CAAA;IAEhC,yDAAyD;IACzD,MAAM,YAAY,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC5C,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAA;QAChD,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAA;QAChD,IAAI,YAAY,IAAI,CAAC,YAAY;YAAE,OAAO,CAAC,CAAC,CAAA;QAC5C,oBAAoB;QACpB,IAAI,CAAC,YAAY,IAAI,YAAY;YAAE,OAAO,CAAC,CAAA;QAC3C,OAAO,CAAC,CAAA,CAAC,oCAAoC;IAC/C,CAAC,CAAC,CAAA;IACF,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,IAAI,IAAI,CAAC,EAAE;YAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;QACpC,GAAG,CAAC,IAAI,CAAC;YACP,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;YACpB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;SACjC,CAAC,CAAA;IACJ,CAAC;IAED,qDAAqD;IACrD,sBAAsB;IACtB,MAAM,gBAAgB,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACpD,IAAI,CAAC,CAAC,CAAC,IAAI;YAAE,OAAO,CAAC,CAAA;QACrB,IAAI,CAAC,CAAC,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC,CAAA;QACtB,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IACF,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,SAAQ;QAC3D,GAAG,CAAC,OAAO,CAAC;YACV,8DAA8D;YAC9D,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE;YAC1B,EAAE,EAAE,IAAI;YACR,UAAU,EAAE,KAAK;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import type { DepID } from '@vltpkg/dep-id'\nimport type { EdgeLike, NodeLike } from '@vltpkg/types'\n\n/**\n * A JSON output item describes a package that is present in the install\n * graph. It represents an edge plus it's linking Node.\n */\nexport type JSONOutputItem = {\n /**\n * The name of the package.\n */\n name: string\n /**\n * A reference to the id of the Node that this package is linked from.\n */\n fromID?: DepID\n /**\n * The dependency spec definition for this package.\n */\n spec?: string\n /**\n * The package type.\n */\n type?: EdgeLike['type']\n /**\n * A representation of the package object that fulfills this dependency.\n */\n to?: NodeLike\n /**\n * Whether this edge was overridden by a graph modifier.\n */\n overridden: boolean\n}\n\nexport type JSONOutputGraph = {\n edges: EdgeLike[]\n nodes: NodeLike[]\n importers: Set<NodeLike>\n}\n\n/**\n * Returns a JSON string representation of the graph.\n */\nexport function jsonOutput({\n edges,\n nodes,\n importers,\n}: JSONOutputGraph) {\n const res: JSONOutputItem[] = []\n const seenIds = new Set<DepID>()\n\n // Collects edge & it's linked nodes as json output items\n const orderedEdges = [...edges].sort((a, b) => {\n const aIsWorkspace = a.spec.type === 'workspace'\n const bIsWorkspace = b.spec.type === 'workspace'\n if (aIsWorkspace && !bIsWorkspace) return -1\n /* c8 ignore next */\n if (!aIsWorkspace && bIsWorkspace) return 1\n return 0 // preserve original order otherwise\n })\n for (const edge of orderedEdges) {\n if (edge.to) seenIds.add(edge.to.id)\n res.push({\n name: edge.name,\n fromID: edge.from.id,\n spec: String(edge.spec),\n type: edge.type,\n to: edge.to,\n overridden: edge.spec.overridden,\n })\n }\n\n // Collects included importer nodes json output items\n /* c8 ignore next 3 */\n const orderedImporters = [...importers].sort((a, b) => {\n if (!a.name) return 1\n if (!b.name) return -1\n return a.name.localeCompare(b.name)\n })\n for (const node of orderedImporters) {\n if (!nodes.includes(node) || seenIds.has(node.id)) continue\n res.unshift({\n /* c8 ignore next - name can't be missing but ts won't know */\n name: node.name || node.id,\n to: node,\n overridden: false,\n })\n }\n\n return res\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/graph",
|
|
3
3
|
"description": "A library that helps understanding & expressing what happens on an install",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
"graph-run": "^1.1.0",
|
|
25
25
|
"path-scurry": "^2.0.0",
|
|
26
26
|
"promise-call-limit": "^3.0.2",
|
|
27
|
-
"@vltpkg/
|
|
28
|
-
"@vltpkg/
|
|
29
|
-
"@vltpkg/
|
|
30
|
-
"@vltpkg/
|
|
31
|
-
"@vltpkg/
|
|
32
|
-
"@vltpkg/
|
|
33
|
-
"@vltpkg/
|
|
34
|
-
"@vltpkg/
|
|
35
|
-
"@vltpkg/pick-manifest": "1.0.0-rc.
|
|
36
|
-
"@vltpkg/package-json": "1.0.0-rc.
|
|
37
|
-
"@vltpkg/query": "1.0.0-rc.
|
|
38
|
-
"@vltpkg/rollback-remove": "1.0.0-rc.
|
|
39
|
-
"@vltpkg/run": "1.0.0-rc.
|
|
40
|
-
"@vltpkg/
|
|
41
|
-
"@vltpkg/
|
|
42
|
-
"@vltpkg/
|
|
43
|
-
"@vltpkg/vlt-json": "1.0.0-rc.
|
|
44
|
-
"@vltpkg/
|
|
45
|
-
"@vltpkg/
|
|
27
|
+
"@vltpkg/cmd-shim": "1.0.0-rc.5",
|
|
28
|
+
"@vltpkg/dep-id": "1.0.0-rc.5",
|
|
29
|
+
"@vltpkg/error-cause": "1.0.0-rc.5",
|
|
30
|
+
"@vltpkg/dss-breadcrumb": "1.0.0-rc.5",
|
|
31
|
+
"@vltpkg/fast-split": "1.0.0-rc.5",
|
|
32
|
+
"@vltpkg/init": "1.0.0-rc.5",
|
|
33
|
+
"@vltpkg/output": "1.0.0-rc.5",
|
|
34
|
+
"@vltpkg/package-info": "1.0.0-rc.5",
|
|
35
|
+
"@vltpkg/pick-manifest": "1.0.0-rc.5",
|
|
36
|
+
"@vltpkg/package-json": "1.0.0-rc.5",
|
|
37
|
+
"@vltpkg/query": "1.0.0-rc.5",
|
|
38
|
+
"@vltpkg/rollback-remove": "1.0.0-rc.5",
|
|
39
|
+
"@vltpkg/run": "1.0.0-rc.5",
|
|
40
|
+
"@vltpkg/satisfies": "1.0.0-rc.5",
|
|
41
|
+
"@vltpkg/types": "1.0.0-rc.5",
|
|
42
|
+
"@vltpkg/security-archive": "1.0.0-rc.5",
|
|
43
|
+
"@vltpkg/vlt-json": "1.0.0-rc.5",
|
|
44
|
+
"@vltpkg/workspaces": "1.0.0-rc.5",
|
|
45
|
+
"@vltpkg/spec": "1.0.0-rc.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@eslint/js": "^9.34.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"typedoc": "~0.27.9",
|
|
56
56
|
"typescript": "5.7.3",
|
|
57
57
|
"typescript-eslint": "^8.40.0",
|
|
58
|
-
"@vltpkg/vlt-json": "1.0.0-rc.
|
|
58
|
+
"@vltpkg/vlt-json": "1.0.0-rc.5"
|
|
59
59
|
},
|
|
60
60
|
"license": "BSD-2-Clause-Patent",
|
|
61
61
|
"engines": {
|