@lorion-org/composition-graph 1.0.0-beta.2 → 1.0.0-beta.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.
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ import { createDescriptorCatalog } from '@lorion-org/composition-graph';
|
|
|
210
210
|
import { discoverDescriptors } from '@lorion-org/descriptor-discovery';
|
|
211
211
|
|
|
212
212
|
const discovered = discoverDescriptors({
|
|
213
|
-
cwd: '
|
|
213
|
+
cwd: '.',
|
|
214
214
|
descriptorPaths: ['layer-extensions/*/extension.json'],
|
|
215
215
|
nestedField: 'bundles',
|
|
216
216
|
});
|
|
@@ -246,8 +246,8 @@ const catalog = createDescriptorCatalog({
|
|
|
246
246
|
});
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
-
That turns `{ id: '
|
|
250
|
-
`auth ->
|
|
249
|
+
That turns `{ id: 'auth-oidc', defaultFor: 'auth' }` into a graph edge
|
|
250
|
+
`auth -> auth-oidc`, as long as both descriptors exist.
|
|
251
251
|
|
|
252
252
|
Dependency-specific projections are also intentionally outside the core. If a
|
|
253
253
|
consumer needs a "what pulled this in?" view, derive that from
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lorion-org/composition-graph",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"description": "Framework-free descriptor catalogs, relation graphs, and composition selection logic.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"dist",
|
|
41
|
-
"examples",
|
|
42
41
|
"LICENSE",
|
|
43
42
|
"src/**/*.ts",
|
|
44
43
|
"!src/**/*.spec.ts"
|
|
@@ -55,7 +54,7 @@
|
|
|
55
54
|
"scripts": {
|
|
56
55
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
57
56
|
"clean": "rimraf coverage dist tsconfig.tsbuildinfo",
|
|
58
|
-
"example:composition": "node ./
|
|
57
|
+
"example:composition": "node ./snippets/deployment-composition.js",
|
|
59
58
|
"lint": "eslint src --ext .ts",
|
|
60
59
|
"test": "vitest run --root ../.. --config vitest.config.mts packages/composition-graph/src/index.spec.ts",
|
|
61
60
|
"coverage": "node -e \"require('node:fs').mkdirSync('../../coverage/.tmp', { recursive: true })\" && vitest run --coverage --coverage.include=packages/composition-graph/src/**/*.ts --root ../.. --config vitest.config.mts packages/composition-graph/src/index.spec.ts",
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/* eslint-env node */
|
|
2
|
-
import { createDescriptorCatalog } from '../dist/index.js';
|
|
3
|
-
|
|
4
|
-
const catalog = createDescriptorCatalog({
|
|
5
|
-
descriptors: [
|
|
6
|
-
{
|
|
7
|
-
id: 'web',
|
|
8
|
-
version: '1.0.0',
|
|
9
|
-
dependencies: {
|
|
10
|
-
checkout: '^1.0.0',
|
|
11
|
-
payments: '^1.0.0',
|
|
12
|
-
'payment-provider-invoice': '^1.0.0',
|
|
13
|
-
'payment-provider-stripe': '^1.0.0',
|
|
14
|
-
shops: '^1.0.0',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
id: 'checkout',
|
|
19
|
-
version: '1.0.0',
|
|
20
|
-
dependencies: { payments: '^1.0.0' },
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: 'payments',
|
|
24
|
-
version: '1.0.0',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
id: 'shops',
|
|
28
|
-
version: '1.0.0',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
id: 'payment-provider-invoice',
|
|
32
|
-
version: '1.0.0',
|
|
33
|
-
providesFor: 'payment-checkout',
|
|
34
|
-
dependencies: { payments: '^1.0.0' },
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: 'payment-provider-stripe',
|
|
38
|
-
version: '1.0.0',
|
|
39
|
-
defaultFor: 'payment-checkout',
|
|
40
|
-
providesFor: 'payment-checkout',
|
|
41
|
-
dependencies: { payments: '^1.0.0' },
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const selection = catalog.resolveSelection({
|
|
47
|
-
selected: ['web'],
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
process.stdout.write(`${selection.getResolved().join(', ')}\n`);
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { createDescriptorCatalog } from '@lorion-org/composition-graph';
|
|
2
|
-
|
|
3
|
-
const catalog = createDescriptorCatalog({
|
|
4
|
-
descriptors: [
|
|
5
|
-
{
|
|
6
|
-
id: 'web',
|
|
7
|
-
version: '1.0.0',
|
|
8
|
-
dependencies: {
|
|
9
|
-
checkout: '^1.0.0',
|
|
10
|
-
payments: '^1.0.0',
|
|
11
|
-
'payment-provider-invoice': '^1.0.0',
|
|
12
|
-
'payment-provider-stripe': '^1.0.0',
|
|
13
|
-
shops: '^1.0.0',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
id: 'checkout',
|
|
18
|
-
version: '1.0.0',
|
|
19
|
-
dependencies: { payments: '^1.0.0' },
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 'payments',
|
|
23
|
-
version: '1.0.0',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: 'shops',
|
|
27
|
-
version: '1.0.0',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'payment-provider-invoice',
|
|
31
|
-
version: '1.0.0',
|
|
32
|
-
providesFor: 'payment-checkout',
|
|
33
|
-
dependencies: { payments: '^1.0.0' },
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'payment-provider-stripe',
|
|
37
|
-
version: '1.0.0',
|
|
38
|
-
defaultFor: 'payment-checkout',
|
|
39
|
-
providesFor: 'payment-checkout',
|
|
40
|
-
dependencies: { payments: '^1.0.0' },
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const selection = catalog.resolveSelection({
|
|
46
|
-
selected: ['web'],
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
console.log(selection.getResolved());
|
|
50
|
-
// ['checkout', 'payment-provider-invoice', 'payment-provider-stripe', 'payments', 'shops', 'web']
|
|
51
|
-
|
|
52
|
-
console.log(selection.getProvenance());
|
|
53
|
-
// [
|
|
54
|
-
// { descriptorId: 'checkout', origins: ['resolved'] },
|
|
55
|
-
// { descriptorId: 'payment-provider-invoice', origins: ['resolved'] },
|
|
56
|
-
// { descriptorId: 'payment-provider-stripe', origins: ['resolved'] },
|
|
57
|
-
// { descriptorId: 'payments', origins: ['resolved'] },
|
|
58
|
-
// { descriptorId: 'shops', origins: ['resolved'] },
|
|
59
|
-
// { descriptorId: 'web', origins: ['selected'] }
|
|
60
|
-
// ]
|