@ankhorage/dependency-graph 1.1.1 → 1.2.0
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/CHANGELOG.md +7 -0
- package/dist/dependencyGraphApi.d.ts +3 -0
- package/dist/dependencyGraphApi.d.ts.map +1 -0
- package/dist/dependencyGraphApi.js +2 -0
- package/dist/dependencyGraphApi.js.map +1 -0
- package/dist/features/dependency-analysis/adapters/inbound/api/dependencyGraphApi.d.ts +3 -0
- package/dist/features/dependency-analysis/adapters/inbound/api/dependencyGraphApi.d.ts.map +1 -0
- package/dist/features/dependency-analysis/adapters/inbound/api/dependencyGraphApi.js +69 -0
- package/dist/features/dependency-analysis/adapters/inbound/api/dependencyGraphApi.js.map +1 -0
- package/dist/types/dependencyGraphApi.d.ts +5 -0
- package/dist/types/dependencyGraphApi.d.ts.map +1 -0
- package/dist/types/dependencyGraphApi.js +2 -0
- package/dist/types/dependencyGraphApi.js.map +1 -0
- package/package.json +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @ankhorage/dependency-graph
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9960384: Expose dependency graph creation as the canonical `dependency-graph` API action through a new public
|
|
8
|
+
`@ankhorage/dependency-graph/api` entrypoint.
|
|
9
|
+
|
|
3
10
|
## 1.1.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyGraphApi.d.ts","sourceRoot":"","sources":["../src/dependencyGraphApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAC;AAC/G,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyGraphApi.js","sourceRoot":"","sources":["../src/dependencyGraphApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAC","sourcesContent":["export { dependencyGraphApi } from './features/dependency-analysis/adapters/inbound/api/dependencyGraphApi.js';\nexport type { DependencyGraphApiInput } from './types/dependencyGraphApi.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyGraphApi.d.ts","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/inbound/api/dependencyGraphApi.ts"],"names":[],"mappings":"AAKA,sGAAsG;AACtG,eAAO,MAAM,kBAAkB,qCA2C7B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createApiRuntime } from '@ankhorage/api';
|
|
2
|
+
import { createDependencyGraphAsync } from '../../../composition/createDependencyGraphAsync.js';
|
|
3
|
+
/*** Expose dependency graph creation through the canonical framework-neutral Ankhorage API action. */
|
|
4
|
+
export const dependencyGraphApi = createApiRuntime({
|
|
5
|
+
definition: {
|
|
6
|
+
id: 'dependency-graph',
|
|
7
|
+
origin: 'internal',
|
|
8
|
+
protocol: 'rest',
|
|
9
|
+
basePath: '/api',
|
|
10
|
+
endpoints: {
|
|
11
|
+
actions: {
|
|
12
|
+
id: 'actions',
|
|
13
|
+
kind: 'http',
|
|
14
|
+
operations: {
|
|
15
|
+
'dependency-graph': {
|
|
16
|
+
id: 'dependency-graph',
|
|
17
|
+
endpointId: 'actions',
|
|
18
|
+
protocol: 'http',
|
|
19
|
+
intent: 'action',
|
|
20
|
+
method: 'POST',
|
|
21
|
+
path: '/dependency-graph',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
handlers: {
|
|
28
|
+
'dependency-graph': async (request) => {
|
|
29
|
+
const input = readDependencyGraphApiInput(request.body);
|
|
30
|
+
if (input === undefined) {
|
|
31
|
+
return {
|
|
32
|
+
status: 400,
|
|
33
|
+
body: {
|
|
34
|
+
error: {
|
|
35
|
+
code: 'invalid_dependency_graph_input',
|
|
36
|
+
operationId: 'dependency-graph',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
body: await createDependencyGraphAsync({ projects: input.projects }),
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
/*** Validate the transport-neutral input before invoking filesystem-backed dependency analysis. */
|
|
48
|
+
function readDependencyGraphApiInput(input) {
|
|
49
|
+
if (typeof input !== 'object' ||
|
|
50
|
+
input === null ||
|
|
51
|
+
!('projects' in input) ||
|
|
52
|
+
!Array.isArray(input.projects) ||
|
|
53
|
+
!input.projects.every(isDependencyGraphProjectInput)) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
return { projects: input.projects };
|
|
57
|
+
}
|
|
58
|
+
/*** Validate one project identity/root pair accepted by dependency graph analysis. */
|
|
59
|
+
function isDependencyGraphProjectInput(value) {
|
|
60
|
+
return (typeof value === 'object' &&
|
|
61
|
+
value !== null &&
|
|
62
|
+
'id' in value &&
|
|
63
|
+
typeof value.id === 'string' &&
|
|
64
|
+
value.id.length > 0 &&
|
|
65
|
+
'rootPath' in value &&
|
|
66
|
+
typeof value.rootPath === 'string' &&
|
|
67
|
+
value.rootPath.length > 0);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=dependencyGraphApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyGraphApi.js","sourceRoot":"","sources":["../../../../../../src/features/dependency-analysis/adapters/inbound/api/dependencyGraphApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAEhG,sGAAsG;AACtG,MAAM,CAAC,MAAM,kBAAkB,GAA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AAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;AACtC,CAAC;AAED,sFAAsF;AACtF,SAAS,6BAA6B,CACpC,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,IAAI,IAAI,KAAK;QACb,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ;QAC5B,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC;QACnB,UAAU,IAAI,KAAK;QACnB,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QAClC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAC1B,CAAC;AACJ,CAAC","sourcesContent":["import { createApiRuntime } from '@ankhorage/api';\n\nimport type { DependencyGraphApiInput } from '../../../../../types/dependencyGraphApi.js';\nimport { createDependencyGraphAsync } from '../../../composition/createDependencyGraphAsync.js';\n\n/*** Expose dependency graph creation through the canonical framework-neutral Ankhorage API action. */\nexport const dependencyGraphApi = createApiRuntime({\n definition: {\n id: 'dependency-graph',\n origin: 'internal',\n protocol: 'rest',\n basePath: '/api',\n endpoints: {\n actions: {\n id: 'actions',\n kind: 'http',\n operations: {\n 'dependency-graph': {\n id: 'dependency-graph',\n endpointId: 'actions',\n protocol: 'http',\n intent: 'action',\n method: 'POST',\n path: '/dependency-graph',\n },\n },\n },\n },\n },\n handlers: {\n 'dependency-graph': async (request) => {\n const input = readDependencyGraphApiInput(request.body);\n if (input === undefined) {\n return {\n status: 400,\n body: {\n error: {\n code: 'invalid_dependency_graph_input',\n operationId: 'dependency-graph',\n },\n },\n };\n }\n\n return {\n body: await createDependencyGraphAsync({ projects: input.projects }),\n };\n },\n },\n});\n\n/*** Validate the transport-neutral input before invoking filesystem-backed dependency analysis. */\nfunction readDependencyGraphApiInput(input: unknown): DependencyGraphApiInput | undefined {\n if (\n typeof input !== 'object' ||\n input === null ||\n !('projects' in input) ||\n !Array.isArray(input.projects) ||\n !input.projects.every(isDependencyGraphProjectInput)\n ) {\n return undefined;\n }\n\n return { projects: input.projects };\n}\n\n/*** Validate one project identity/root pair accepted by dependency graph analysis. */\nfunction isDependencyGraphProjectInput(\n value: unknown,\n): value is DependencyGraphApiInput['projects'][number] {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'id' in value &&\n typeof value.id === 'string' &&\n value.id.length > 0 &&\n 'rootPath' in value &&\n typeof value.rootPath === 'string' &&\n value.rootPath.length > 0\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyGraphApi.d.ts","sourceRoot":"","sources":["../../src/types/dependencyGraphApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,2BAA2B,EAAE,CAAC;CAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencyGraphApi.js","sourceRoot":"","sources":["../../src/types/dependencyGraphApi.ts"],"names":[],"mappings":"","sourcesContent":["import type { DependencyGraphProjectInput } from './dependencyGraph.js';\n\nexport interface DependencyGraphApiInput {\n readonly projects: readonly DependencyGraphProjectInput[];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/dependency-graph",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Project-aware dependency analysis that produces canonical Ankhorage graphs.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"types": "./dist/dependencyGraph.d.ts",
|
|
33
33
|
"import": "./dist/dependencyGraph.js"
|
|
34
34
|
},
|
|
35
|
+
"./api": {
|
|
36
|
+
"types": "./dist/dependencyGraphApi.d.ts",
|
|
37
|
+
"import": "./dist/dependencyGraphApi.js"
|
|
38
|
+
},
|
|
35
39
|
"./package.json": "./package.json"
|
|
36
40
|
},
|
|
37
41
|
"publishConfig": {
|
|
@@ -57,20 +61,18 @@
|
|
|
57
61
|
"knip:check": "ankhorage-knip"
|
|
58
62
|
},
|
|
59
63
|
"dependencies": {
|
|
64
|
+
"@ankhorage/api": "^0.2.0",
|
|
60
65
|
"@ankhorage/graph": "^0.3.0",
|
|
61
66
|
"@ankhorage/project-detector": "^0.3.0",
|
|
62
67
|
"@ankhorage/utility": "^0.8.0",
|
|
63
|
-
"java-parser": "^3.0.1"
|
|
64
|
-
},
|
|
65
|
-
"peerDependencies": {
|
|
68
|
+
"java-parser": "^3.0.1",
|
|
66
69
|
"typescript": "~6.0.3"
|
|
67
70
|
},
|
|
68
71
|
"devDependencies": {
|
|
69
72
|
"@ankhorage/devtools": "^1.14.7",
|
|
70
73
|
"@ankhorage/paradox": "^0.1.26",
|
|
71
74
|
"@types/bun": "^1.4.2",
|
|
72
|
-
"@types/node": "^26.5.1"
|
|
73
|
-
"typescript": "~6.0.3"
|
|
75
|
+
"@types/node": "^26.5.1"
|
|
74
76
|
},
|
|
75
77
|
"packageManager": "bun@1.4.2"
|
|
76
78
|
}
|