create-substrat 0.6.2 → 0.6.3

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/index.js CHANGED
@@ -21,16 +21,23 @@ import { DEV_SERVERS } from './dev-servers.js';
21
21
  const HERE = dirname(fileURLToPath(import.meta.url));
22
22
  const TEMPLATE = join(HERE, 'template');
23
23
 
24
- // Published today; Substrat is 0.x, so these are caret ranges on the current minor.
25
- // The runtime packages release together off one version line, so one constant is right
26
- // for all of them.
27
- const SUBSTRAT = '^0.71.0';
28
- // Engines do NOT share a line — each one versions on its own, so a single ENGINES
29
- // constant silently stops resolving the moment any engine crosses a minor. It did:
30
- // this file pinned `^0.3.37` while workorder had moved to 0.4.x and invoicing to 0.6.x,
31
- // so a freshly scaffolded project could not install. One pin per engine, deliberately.
32
- const ENGINE_WORKORDER = '^0.4.3';
33
- const ENGINE_INVOICING = '^0.6.2';
24
+ // Substrat is 0.x, so these are caret ranges on the current minor — a caret on 0.x
25
+ // locks the minor, which is what makes a stale pin here a scaffold four minors behind
26
+ // rather than a scaffold that quietly upgrades.
27
+ //
28
+ // EMITTED, NOT EDITED. `pnpm lint:pins` writes this block from each package's own
29
+ // version and `--check` fails CI on drift; `version-packages` runs the write, so a
30
+ // bump and its pins land in the same PR. Hand-maintained, they went stale twice: once
31
+ // resolving nothing (`^0.3.37` after workorder moved to 0.4.x), and once resolving
32
+ // fine but freezing the template against packages nobody ships, which is worse — the
33
+ // scaffold's own tests stayed green while the surface moved underneath them.
34
+ //
35
+ // The runtime packages release together off one version line (the changesets `fixed`
36
+ // group), so one constant is right for all of them. Engines do NOT share a line —
37
+ // each versions on its own, so one pin per engine, deliberately.
38
+ const SUBSTRAT = '^0.76.0';
39
+ const ENGINE_WORKORDER = '^0.6.3';
40
+ const ENGINE_INVOICING = '^0.7.3';
34
41
  const BOUNDARY_LINT = '^0.0.7';
35
42
 
36
43
  const DOCS = 'https://substrat.net';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-substrat",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Scaffold a Substrat vertical — `npm create substrat <dir>`.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -164,8 +164,15 @@ mountPlatformSurface<Env>(app, {
164
164
  hostFor,
165
165
  roles: ROLES,
166
166
  ownerRoleKey: OWNER_ROLE_KEY,
167
- onProvision: (env, b) => sweeper(env).noteScope(b.tenantId, b.scopeId),
168
- onDeleteScope: (env, s) => sweeper(env).forgetScope(s),
167
+ // Both hooks are `Promise<void>`: the roster's own count is its business, and
168
+ // returning it here would make the platform's response shape depend on what a
169
+ // vertical happens to hand back. Await, discard.
170
+ onProvision: async (env, b) => {
171
+ await sweeper(env).noteScope(b.tenantId, b.scopeId);
172
+ },
173
+ onDeleteScope: async (env, s) => {
174
+ await sweeper(env).forgetScope(s);
175
+ },
169
176
  });
170
177
 
171
178
  // Unmatched /api/* fails as JSON; everything else gets a pointer, not a UI —
@@ -160,14 +160,18 @@ describe('bike-shop scenario', () => {
160
160
  expect(underlag[0]!.status).toBe('open');
161
161
  expect(underlag[0]!.total).toBe('336.5');
162
162
 
163
- const detail = await greta.invoke<{ lines: { source_id: string; source_type: string }[] }>(
164
- 'invoicing/get',
165
- { underlagId: underlag[0]!.id },
166
- );
163
+ // Provenance is two-level: `document_*` is which delivery produced the line
164
+ // (this work order), `source_*` is what the line itself is (time vs material).
165
+ // Both come from the engine's own event payload — the vertical never joins
166
+ // into invoicing's tables to find out.
167
+ const detail = await greta.invoke<
168
+ { lines: { document_id: string; document_type: string; source_type: string | null }[] }
169
+ >('invoicing/get', { underlagId: underlag[0]!.id });
167
170
  expect(detail.lines).toHaveLength(2);
168
- expect(detail.lines.every((l) => l.source_type === 'workorder' && l.source_id === repairId)).toBe(
169
- true,
170
- );
171
+ expect(
172
+ detail.lines.every((l) => l.document_type === 'workorder' && l.document_id === repairId),
173
+ ).toBe(true);
174
+ expect(detail.lines.map((l) => l.source_type).sort()).toEqual(['material', 'time']);
171
175
  });
172
176
 
173
177
  it('7. portal isolation: Lisbeth sees her repair, Otto sees nothing', async () => {