@living-architecture/riviere-builder 0.2.2 → 0.2.4
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/dist/builder.d.ts +3 -3
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +5 -13
- package/dist/errors.d.ts +4 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +8 -0
- package/package.json +3 -3
package/dist/builder.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ interface BuilderGraph extends Omit<RiviereGraph, 'metadata' | 'externalLinks'>
|
|
|
21
21
|
* import { RiviereBuilder } from '@living-architecture/riviere-builder'
|
|
22
22
|
*
|
|
23
23
|
* const builder = RiviereBuilder.new({
|
|
24
|
-
* sources: [{ type: 'git', url: 'https://github.com/org/repo' }],
|
|
24
|
+
* sources: [{ type: 'git', url: 'https://github.com/your-org/your-repo' }],
|
|
25
25
|
* domains: { orders: { description: 'Order management' } }
|
|
26
26
|
* })
|
|
27
27
|
*
|
|
@@ -70,7 +70,7 @@ export declare class RiviereBuilder {
|
|
|
70
70
|
* ```typescript
|
|
71
71
|
* const builder = RiviereBuilder.new({
|
|
72
72
|
* name: 'My System',
|
|
73
|
-
* sources: [{ type: 'git', url: 'https://github.com/org/repo' }],
|
|
73
|
+
* sources: [{ type: 'git', url: 'https://github.com/your-org/your-repo' }],
|
|
74
74
|
* domains: {
|
|
75
75
|
* orders: { description: 'Order management' },
|
|
76
76
|
* users: { description: 'User accounts' }
|
|
@@ -88,7 +88,7 @@ export declare class RiviereBuilder {
|
|
|
88
88
|
* ```typescript
|
|
89
89
|
* builder.addSource({
|
|
90
90
|
* type: 'git',
|
|
91
|
-
* url: 'https://github.com/org/another-repo'
|
|
91
|
+
* url: 'https://github.com/your-org/another-repo'
|
|
92
92
|
* })
|
|
93
93
|
* ```
|
|
94
94
|
*/
|
package/dist/builder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EAEZ,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,EACjB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EAEZ,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,gBAAgB,EACjB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAWxF,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,eAAe,EACf,WAAW,EACX,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,OAAO,EACP,YAAY,EACb,MAAM,SAAS,CAAA;AAEhB,YAAY,EACV,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,cAAc,EACd,WAAW,EACX,eAAe,EACf,WAAW,EACX,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,OAAO,EACP,YAAY,GACb,CAAA;AAED,UAAU,eAAgB,SAAQ,IAAI,CAAC,aAAa,EAA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/dist/builder.js
CHANGED
|
@@ -5,7 +5,7 @@ import { calculateStats, findOrphans, findWarnings, toRiviereGraph, validateGrap
|
|
|
5
5
|
import { assertCustomTypeExists, assertDomainExists, assertRequiredPropertiesProvided } from './builder-assertions';
|
|
6
6
|
import { ComponentId } from '@living-architecture/riviere-schema';
|
|
7
7
|
import { createSourceNotFoundError, findNearMatches } from './component-suggestion';
|
|
8
|
-
import { DuplicateComponentError, DuplicateDomainError, InvalidEnrichmentTargetError } from './errors';
|
|
8
|
+
import { CustomTypeAlreadyDefinedError, DuplicateComponentError, DuplicateDomainError, InvalidEnrichmentTargetError, } from './errors';
|
|
9
9
|
/**
|
|
10
10
|
* Programmatically construct Rivière architecture graphs.
|
|
11
11
|
*
|
|
@@ -17,7 +17,7 @@ import { DuplicateComponentError, DuplicateDomainError, InvalidEnrichmentTargetE
|
|
|
17
17
|
* import { RiviereBuilder } from '@living-architecture/riviere-builder'
|
|
18
18
|
*
|
|
19
19
|
* const builder = RiviereBuilder.new({
|
|
20
|
-
* sources: [{ type: 'git', url: 'https://github.com/org/repo' }],
|
|
20
|
+
* sources: [{ type: 'git', url: 'https://github.com/your-org/your-repo' }],
|
|
21
21
|
* domains: { orders: { description: 'Order management' } }
|
|
22
22
|
* })
|
|
23
23
|
*
|
|
@@ -84,7 +84,7 @@ export class RiviereBuilder {
|
|
|
84
84
|
* ```typescript
|
|
85
85
|
* const builder = RiviereBuilder.new({
|
|
86
86
|
* name: 'My System',
|
|
87
|
-
* sources: [{ type: 'git', url: 'https://github.com/org/repo' }],
|
|
87
|
+
* sources: [{ type: 'git', url: 'https://github.com/your-org/your-repo' }],
|
|
88
88
|
* domains: {
|
|
89
89
|
* orders: { description: 'Order management' },
|
|
90
90
|
* users: { description: 'User accounts' }
|
|
@@ -123,7 +123,7 @@ export class RiviereBuilder {
|
|
|
123
123
|
* ```typescript
|
|
124
124
|
* builder.addSource({
|
|
125
125
|
* type: 'git',
|
|
126
|
-
* url: 'https://github.com/org/another-repo'
|
|
126
|
+
* url: 'https://github.com/your-org/another-repo'
|
|
127
127
|
* })
|
|
128
128
|
* ```
|
|
129
129
|
*/
|
|
@@ -183,7 +183,6 @@ export class RiviereBuilder {
|
|
|
183
183
|
route: input.route,
|
|
184
184
|
sourceLocation: input.sourceLocation,
|
|
185
185
|
...(input.description !== undefined && { description: input.description }),
|
|
186
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
187
186
|
};
|
|
188
187
|
return this.registerComponent(component);
|
|
189
188
|
}
|
|
@@ -222,7 +221,6 @@ export class RiviereBuilder {
|
|
|
222
221
|
...(input.path !== undefined && { path: input.path }),
|
|
223
222
|
...(input.operationName !== undefined && { operationName: input.operationName }),
|
|
224
223
|
...(input.description !== undefined && { description: input.description }),
|
|
225
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
226
224
|
};
|
|
227
225
|
return this.registerComponent(component);
|
|
228
226
|
}
|
|
@@ -254,7 +252,6 @@ export class RiviereBuilder {
|
|
|
254
252
|
module: input.module,
|
|
255
253
|
sourceLocation: input.sourceLocation,
|
|
256
254
|
...(input.description !== undefined && { description: input.description }),
|
|
257
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
258
255
|
};
|
|
259
256
|
return this.registerComponent(component);
|
|
260
257
|
}
|
|
@@ -297,7 +294,6 @@ export class RiviereBuilder {
|
|
|
297
294
|
...(input.stateChanges !== undefined && { stateChanges: input.stateChanges }),
|
|
298
295
|
...(input.businessRules !== undefined && { businessRules: input.businessRules }),
|
|
299
296
|
...(input.description !== undefined && { description: input.description }),
|
|
300
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
301
297
|
};
|
|
302
298
|
return this.registerComponent(component);
|
|
303
299
|
}
|
|
@@ -332,7 +328,6 @@ export class RiviereBuilder {
|
|
|
332
328
|
sourceLocation: input.sourceLocation,
|
|
333
329
|
...(input.eventSchema !== undefined && { eventSchema: input.eventSchema }),
|
|
334
330
|
...(input.description !== undefined && { description: input.description }),
|
|
335
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
336
331
|
};
|
|
337
332
|
return this.registerComponent(component);
|
|
338
333
|
}
|
|
@@ -366,7 +361,6 @@ export class RiviereBuilder {
|
|
|
366
361
|
subscribedEvents: input.subscribedEvents,
|
|
367
362
|
sourceLocation: input.sourceLocation,
|
|
368
363
|
...(input.description !== undefined && { description: input.description }),
|
|
369
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
370
364
|
};
|
|
371
365
|
return this.registerComponent(component);
|
|
372
366
|
}
|
|
@@ -393,7 +387,7 @@ export class RiviereBuilder {
|
|
|
393
387
|
defineCustomType(input) {
|
|
394
388
|
const customTypes = this.graph.metadata.customTypes;
|
|
395
389
|
if (customTypes[input.name]) {
|
|
396
|
-
throw new
|
|
390
|
+
throw new CustomTypeAlreadyDefinedError(input.name);
|
|
397
391
|
}
|
|
398
392
|
customTypes[input.name] = {
|
|
399
393
|
...(input.requiredProperties !== undefined && { requiredProperties: input.requiredProperties }),
|
|
@@ -439,7 +433,6 @@ export class RiviereBuilder {
|
|
|
439
433
|
module: input.module,
|
|
440
434
|
sourceLocation: input.sourceLocation,
|
|
441
435
|
...(input.description !== undefined && { description: input.description }),
|
|
442
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
443
436
|
};
|
|
444
437
|
return this.registerComponent(component);
|
|
445
438
|
}
|
|
@@ -585,7 +578,6 @@ export class RiviereBuilder {
|
|
|
585
578
|
...(input.type !== undefined && { type: input.type }),
|
|
586
579
|
...(input.description !== undefined && { description: input.description }),
|
|
587
580
|
...(input.sourceLocation !== undefined && { sourceLocation: input.sourceLocation }),
|
|
588
|
-
...(input.metadata !== undefined && { metadata: input.metadata }),
|
|
589
581
|
};
|
|
590
582
|
this.graph.externalLinks.push(externalLink);
|
|
591
583
|
return externalLink;
|
package/dist/errors.d.ts
CHANGED
|
@@ -25,4 +25,8 @@ export declare class InvalidEnrichmentTargetError extends Error {
|
|
|
25
25
|
readonly componentType: string;
|
|
26
26
|
constructor(componentId: string, componentType: string);
|
|
27
27
|
}
|
|
28
|
+
export declare class CustomTypeAlreadyDefinedError extends Error {
|
|
29
|
+
readonly typeName: string;
|
|
30
|
+
constructor(typeName: string);
|
|
31
|
+
}
|
|
28
32
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,UAAU,EAAE,MAAM;CAK/B;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,UAAU,EAAE,MAAM;CAK/B;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAA;gBAEnB,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE;CAU3D;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;gBAEhB,WAAW,EAAE,MAAM;CAKhC;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAA;gBAElB,WAAW,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,EAAO;CAS5D;AAED,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;gBAElB,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAMvD"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,UAAU,EAAE,MAAM;CAK/B;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;gBAEf,UAAU,EAAE,MAAM;CAK/B;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAA;gBAEnB,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE;CAU3D;AAED,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;gBAEhB,WAAW,EAAE,MAAM;CAKhC;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAA;gBAElB,WAAW,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,EAAO;CAS5D;AAED,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;gBAElB,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAMvD;AAED,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;gBAEb,QAAQ,EAAE,MAAM;CAK7B"}
|
package/dist/errors.js
CHANGED
|
@@ -57,3 +57,11 @@ export class InvalidEnrichmentTargetError extends Error {
|
|
|
57
57
|
this.componentType = componentType;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
export class CustomTypeAlreadyDefinedError extends Error {
|
|
61
|
+
typeName;
|
|
62
|
+
constructor(typeName) {
|
|
63
|
+
super(`Custom type '${typeName}' already defined`);
|
|
64
|
+
this.name = 'CustomTypeAlreadyDefinedError';
|
|
65
|
+
this.typeName = typeName;
|
|
66
|
+
}
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@living-architecture/riviere-builder",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"tslib": "^2.3.0",
|
|
26
|
-
"@living-architecture/riviere-query": "0.2.
|
|
27
|
-
"@living-architecture/riviere-schema": "0.2.
|
|
26
|
+
"@living-architecture/riviere-query": "0.2.4",
|
|
27
|
+
"@living-architecture/riviere-schema": "0.2.2"
|
|
28
28
|
}
|
|
29
29
|
}
|