@formicoidea/labre-framework-ddd-core-domain 0.35.0 → 0.37.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/dist/commands.js CHANGED
@@ -18,6 +18,7 @@ const SPECS = [
18
18
  label: 'Core Domain Chart',
19
19
  iconKey: 'ddd-core-domain.chart',
20
20
  element: 'background',
21
+ board: true,
21
22
  icon: chartSwatch,
22
23
  run: std => placeDddElement(std, (surface, cx, cy) => createCoreDomainChart(surface, cx, cy)),
23
24
  },
@@ -77,6 +78,10 @@ export const coreDomainCommands = SPECS.map((spec, order) => ({
77
78
  defaultKeys: { mac: [], other: [] },
78
79
  availability: 'always',
79
80
  run: spec.run,
80
- telemetry: { framework: 'ddd-core-domain', element: spec.element },
81
+ telemetry: {
82
+ framework: 'ddd-core-domain',
83
+ element: spec.element,
84
+ board: spec.board,
85
+ },
81
86
  }));
82
87
  export const coreDomainCommandIcons = Object.fromEntries(SPECS.map(spec => [spec.iconKey, spec.icon]));
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export { coreDomainTemplateCategory } from './templates.js';
12
12
  export { coreDomainSeniorTool } from './toolbar/senior-tool.js';
13
13
  export { EdgelessDddCoreDomainSeniorButton } from './toolbar/senior-button.js';
14
14
  export { DddCoreDomainRenderViewExtension, DddCoreDomainViewExtension, } from './view.js';
15
+ export { CORE_DOMAIN_MARKER_READING, CORE_DOMAIN_READING, CORE_DOMAIN_READINGS, } from './reading.js';
package/dist/index.js CHANGED
@@ -15,3 +15,4 @@ export { coreDomainTemplateCategory } from './templates.js';
15
15
  export { coreDomainSeniorTool } from './toolbar/senior-tool.js';
16
16
  export { EdgelessDddCoreDomainSeniorButton } from './toolbar/senior-button.js';
17
17
  export { DddCoreDomainRenderViewExtension, DddCoreDomainViewExtension, } from './view.js';
18
+ export { CORE_DOMAIN_MARKER_READING, CORE_DOMAIN_READING, CORE_DOMAIN_READINGS, } from './reading.js';
@@ -0,0 +1,51 @@
1
+ import type { ReadingProfile } from '@formicoidea/labre-core/blocks/surface';
2
+ /**
3
+ * What a Core Domain Chart lets the tool read (MF3, the reversed reading).
4
+ *
5
+ * DATA, like the rules and the profiles beside it: the engine
6
+ * (`@labre/affine-block-surface`) knows how to read a role and a typed edge — it
7
+ * knows nothing about this framework. Everything below is already stated in
8
+ * `roles.ts` and is merely POINTED AT here.
9
+ *
10
+ * Registered from the FLAG-GATED view extension: reading a chart is tooling, so
11
+ * a chart whose flag is off keeps every element it has and simply stops being
12
+ * read (ADR 0009).
13
+ *
14
+ * ## TWO profiles, because the vocabulary has two disjoint node families
15
+ *
16
+ * `roles.ts` makes the split deliberately: a sub-domain is a thing PLOTTED at a
17
+ * (differentiation, complexity) position, a Team Topologies marker is an
18
+ * annotation about how work flows between teams. Neither specialises the other,
19
+ * so neither `appliesTo` can cover both — and giving them a common parent would
20
+ * mean minting a role the notation does not have, which ADR 0007 forbids.
21
+ *
22
+ * The chart itself is the FRAME and is not read.
23
+ *
24
+ * ## No nature, no phase
25
+ *
26
+ * The framework ships no type-3 tag pack: the five dot presets ARE roles, and
27
+ * the panel says them on the type line with the chain above them ("Platform
28
+ * sub-domain › Sub-domain"). And the chart's two axes are a plane, not a set of
29
+ * declared zones with ids — reading a phase off it would be an invented fact, so
30
+ * the section is absent rather than empty. A follow-up ticket covers the
31
+ * variant-scoped 2D zones the engine would need.
32
+ */
33
+ /**
34
+ * The dots: the five presets, and the two bounded-context positions.
35
+ *
36
+ * The MOVEMENT is the only typed edge on this board. ADR 0010 tier 2 on that
37
+ * role: the verb is "is moving to", so the SOURCE is where the context stands
38
+ * today and the TARGET where it is headed — an edge leaving the subject names
39
+ * where it goes, one arriving names where it came from.
40
+ */
41
+ export declare const CORE_DOMAIN_READING: ReadingProfile;
42
+ /**
43
+ * The Team Topologies markers.
44
+ *
45
+ * No relation: a movement runs between two positions of a bounded context, and
46
+ * `core-domain.malformed-movement` is written on exactly that. A marker is what
47
+ * the chart SAYS about an interaction, not a thing that moves.
48
+ */
49
+ export declare const CORE_DOMAIN_MARKER_READING: ReadingProfile;
50
+ /** Both profiles, in the order the view extension registers them. */
51
+ export declare const CORE_DOMAIN_READINGS: readonly ReadingProfile[];
@@ -0,0 +1,77 @@
1
+ import { CORE_DOMAIN_ROLE, CORE_DOMAIN_ROLES } from './roles.js';
2
+ /**
3
+ * What a Core Domain Chart lets the tool read (MF3, the reversed reading).
4
+ *
5
+ * DATA, like the rules and the profiles beside it: the engine
6
+ * (`@labre/affine-block-surface`) knows how to read a role and a typed edge — it
7
+ * knows nothing about this framework. Everything below is already stated in
8
+ * `roles.ts` and is merely POINTED AT here.
9
+ *
10
+ * Registered from the FLAG-GATED view extension: reading a chart is tooling, so
11
+ * a chart whose flag is off keeps every element it has and simply stops being
12
+ * read (ADR 0009).
13
+ *
14
+ * ## TWO profiles, because the vocabulary has two disjoint node families
15
+ *
16
+ * `roles.ts` makes the split deliberately: a sub-domain is a thing PLOTTED at a
17
+ * (differentiation, complexity) position, a Team Topologies marker is an
18
+ * annotation about how work flows between teams. Neither specialises the other,
19
+ * so neither `appliesTo` can cover both — and giving them a common parent would
20
+ * mean minting a role the notation does not have, which ADR 0007 forbids.
21
+ *
22
+ * The chart itself is the FRAME and is not read.
23
+ *
24
+ * ## No nature, no phase
25
+ *
26
+ * The framework ships no type-3 tag pack: the five dot presets ARE roles, and
27
+ * the panel says them on the type line with the chain above them ("Platform
28
+ * sub-domain › Sub-domain"). And the chart's two axes are a plane, not a set of
29
+ * declared zones with ids — reading a phase off it would be an invented fact, so
30
+ * the section is absent rather than empty. A follow-up ticket covers the
31
+ * variant-scoped 2D zones the engine would need.
32
+ */
33
+ /**
34
+ * The dots: the five presets, and the two bounded-context positions.
35
+ *
36
+ * The MOVEMENT is the only typed edge on this board. ADR 0010 tier 2 on that
37
+ * role: the verb is "is moving to", so the SOURCE is where the context stands
38
+ * today and the TARGET where it is headed — an edge leaving the subject names
39
+ * where it goes, one arriving names where it came from.
40
+ */
41
+ export const CORE_DOMAIN_READING = {
42
+ id: 'core-domain',
43
+ framework: 'ddd-core-domain',
44
+ roles: CORE_DOMAIN_ROLES,
45
+ appliesTo: CORE_DOMAIN_ROLE.subdomain,
46
+ relation: {
47
+ edgeRole: CORE_DOMAIN_ROLE.movement,
48
+ sides: {
49
+ consumer: {
50
+ labelKey: 'com.labre.core-domain.reading.relations.consumer',
51
+ labelFallback: 'Moved from',
52
+ },
53
+ supplier: {
54
+ labelKey: 'com.labre.core-domain.reading.relations.supplier',
55
+ labelFallback: 'Moves to',
56
+ },
57
+ },
58
+ },
59
+ };
60
+ /**
61
+ * The Team Topologies markers.
62
+ *
63
+ * No relation: a movement runs between two positions of a bounded context, and
64
+ * `core-domain.malformed-movement` is written on exactly that. A marker is what
65
+ * the chart SAYS about an interaction, not a thing that moves.
66
+ */
67
+ export const CORE_DOMAIN_MARKER_READING = {
68
+ id: 'core-domain-marker',
69
+ framework: 'ddd-core-domain',
70
+ roles: CORE_DOMAIN_ROLES,
71
+ appliesTo: CORE_DOMAIN_ROLE.marker,
72
+ };
73
+ /** Both profiles, in the order the view extension registers them. */
74
+ export const CORE_DOMAIN_READINGS = [
75
+ CORE_DOMAIN_READING,
76
+ CORE_DOMAIN_MARKER_READING,
77
+ ];
@@ -3,6 +3,7 @@ import { coreDomainCommands } from './commands.js';
3
3
  import { CORE_DOMAIN_BACKGROUND } from './core-domain/background.js';
4
4
  import { CORE_DOMAIN_NUDGES } from './nudges.js';
5
5
  import { CORE_DOMAIN_PROFILES } from './profiles.js';
6
+ import { CORE_DOMAIN_READINGS } from './reading.js';
6
7
  import { CORE_DOMAIN_ROLES } from './roles.js';
7
8
  import { CORE_DOMAIN_RULES } from './rules.js';
8
9
  /**
@@ -23,4 +24,9 @@ export const coreDomainTranslationEntries = mergeTranslationEntries(commandTrans
23
24
  // registry names no framework category in the bundled distribution, so a
24
25
  // host that composed core's manifest alone drew translated entries under
25
26
  // English headers (#183).
26
- commandCategoryTranslationEntries(coreDomainCommands), collectTranslationKeys('role', CORE_DOMAIN_ROLES), collectTranslationKeys('background', CORE_DOMAIN_BACKGROUND), collectTranslationKeys('rule', CORE_DOMAIN_RULES), collectTranslationKeys('nudge', CORE_DOMAIN_NUDGES), collectTranslationKeys('profile', CORE_DOMAIN_PROFILES));
27
+ commandCategoryTranslationEntries(coreDomainCommands), collectTranslationKeys('role', CORE_DOMAIN_ROLES), collectTranslationKeys('background', CORE_DOMAIN_BACKGROUND), collectTranslationKeys('rule', CORE_DOMAIN_RULES), collectTranslationKeys('nudge', CORE_DOMAIN_NUDGES), collectTranslationKeys('profile', CORE_DOMAIN_PROFILES),
28
+ // LAST, and the order is load-bearing: a reading profile carries the
29
+ // framework's own `roles`, so walking it reaches every role key the `role`
30
+ // line above already named. `mergeTranslationEntries` keeps the FIRST
31
+ // occurrence, which is what makes each key report the source it comes from.
32
+ collectTranslationKeys('reading', CORE_DOMAIN_READINGS));
package/dist/view.js CHANGED
@@ -1,4 +1,4 @@
1
- import { morphToolbarConfig, QualityNudgeExtension, validationToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
1
+ import { morphToolbarConfig, QualityNudgeExtension, ReadingProfileExtension, validationToolbarConfig, ValidationProfileExtension, ValidationRuleExtension, } from '@formicoidea/labre-core/blocks/surface';
2
2
  import { ViewExtensionProvider, } from '@formicoidea/labre-core/ext-loader';
3
3
  import { ToolbarModuleExtension, toolbarModuleKey, } from '@formicoidea/labre-core/shared/services';
4
4
  import { BlockFlavourIdentifier, CommandExtension } from '@formicoidea/labre-core/std';
@@ -11,6 +11,7 @@ import { coreDomainEffects } from './effects.js';
11
11
  import { CORE_DOMAIN_MORPH_SPEC } from './morph.js';
12
12
  import { CORE_DOMAIN_NUDGES } from './nudges.js';
13
13
  import { CORE_DOMAIN_PROFILES } from './profiles.js';
14
+ import { CORE_DOMAIN_READINGS } from './reading.js';
14
15
  import { CORE_DOMAIN_ROLES } from './roles.js';
15
16
  import { CORE_DOMAIN_RULES } from './rules.js';
16
17
  import { coreDomainSeniorTool } from './toolbar/senior-tool.js';
@@ -78,6 +79,14 @@ export class DddCoreDomainViewExtension extends ViewExtensionProvider {
78
79
  id: BlockFlavourIdentifier('custom:affine:surface:coreDomain'),
79
80
  config: validationToolbarConfig,
80
81
  }));
82
+ // The reversed reading (MF3): what the chart says about an artefact, on
83
+ // demand. Two profiles, because the vocabulary has two disjoint node
84
+ // families and neither may inherit the other's rules (`reading.ts`). The
85
+ // CLICK that triggers it is registered once by the surface and gated by
86
+ // the presence of a profile.
87
+ for (const reading of CORE_DOMAIN_READINGS) {
88
+ context.register(ReadingProfileExtension(reading));
89
+ }
81
90
  context.register(coreDomainSeniorTool);
82
91
  context.register(CommandExtension(coreDomainCommands, coreDomainCommandIcons));
83
92
  // The "Change type" dropdown on a selected dot's or marker's contextual
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formicoidea/labre-framework-ddd-core-domain",
3
3
  "description": "Labre ddd-core-domain framework for @formicoidea/labre-core.",
4
- "version": "0.35.0",
4
+ "version": "0.37.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "author": "lajola",
@@ -31,8 +31,8 @@
31
31
  "dist"
32
32
  ],
33
33
  "dependencies": {
34
- "@formicoidea/labre-core": "0.35.0",
35
- "@formicoidea/labre-ddd-shared": "0.35.0",
34
+ "@formicoidea/labre-core": "0.37.0",
35
+ "@formicoidea/labre-ddd-shared": "0.37.0",
36
36
  "lit": "^3.2.0"
37
37
  }
38
38
  }