create-substrat 0.10.10 → 0.10.12
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/dev-servers.js +5 -2
- package/index.js +8 -4
- package/package.json +1 -1
- package/template/.claude/launch.json +10 -0
- package/template/.substrat/playbook.md +4 -2
- package/template/vitest.ui.config.ts +37 -0
package/dev-servers.js
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* web app to scaffold yet.
|
|
27
|
+
* Three processes: the local OIDC issuer, the Hono API that relies on it, and the test
|
|
28
|
+
* dashboard. There is no web app to scaffold yet.
|
|
29
29
|
*
|
|
30
30
|
* The issuer is a separate PROCESS rather than a branch inside the API on purpose — that
|
|
31
31
|
* is what keeps the vertical free of any dev-only auth path, and lets it be swapped for a
|
|
@@ -34,4 +34,7 @@
|
|
|
34
34
|
export const DEV_SERVERS = [
|
|
35
35
|
{ name: 'issuer', run: 'issuer', portEnv: 'ISSUER_PORT', portFrom: 'src/server.ts' },
|
|
36
36
|
{ name: 'api', run: 'server', portEnv: 'PORT', portFrom: 'src/server.ts' },
|
|
37
|
+
// The test dashboard (#756). 5290 — clear of the demo blocks (527x/528x/529x), which a
|
|
38
|
+
// scaffold has no claim on (#983).
|
|
39
|
+
{ name: 'tests', run: 'test:ui', portEnv: 'VITEST_UI_PORT', portFrom: 'vitest.ui.config.ts' },
|
|
37
40
|
];
|
package/index.js
CHANGED
|
@@ -36,11 +36,11 @@ const TEMPLATE = join(HERE, 'template');
|
|
|
36
36
|
// The runtime packages release together off one version line (the changesets `fixed`
|
|
37
37
|
// group), so one constant is right for all of them. Engines do NOT share a line —
|
|
38
38
|
// each versions on its own, so one pin per engine, deliberately.
|
|
39
|
-
const SUBSTRAT = '^0.
|
|
40
|
-
const ENGINE_WORKORDER = '^0.12.
|
|
41
|
-
const ENGINE_INVOICING = '^0.11.
|
|
39
|
+
const SUBSTRAT = '^0.135.0';
|
|
40
|
+
const ENGINE_WORKORDER = '^0.12.19';
|
|
41
|
+
const ENGINE_INVOICING = '^0.11.19';
|
|
42
42
|
const BOUNDARY_LINT = '^0.6.1';
|
|
43
|
-
const DEV_ISSUER = '^0.2.
|
|
43
|
+
const DEV_ISSUER = '^0.2.17';
|
|
44
44
|
|
|
45
45
|
const DOCS = 'https://substrat.net';
|
|
46
46
|
|
|
@@ -113,6 +113,9 @@ function packageJson(name) {
|
|
|
113
113
|
issuer: 'substrat-dev-issuer --personas src/personas.ts',
|
|
114
114
|
server: 'tsx src/server.ts',
|
|
115
115
|
test: 'vitest run',
|
|
116
|
+
// The live test dashboard in the Browser pane: the `tests` entry of
|
|
117
|
+
// .claude/launch.json. `--watch` is explicit, since vitest runs once and exits without a TTY.
|
|
118
|
+
'test:ui': 'vitest --watch --ui --open=false -c vitest.ui.config.ts',
|
|
116
119
|
typecheck: 'tsc --noEmit && tsc -p tsconfig.worker.json --noEmit',
|
|
117
120
|
'lint:boundaries': 'substrat-boundary-lint',
|
|
118
121
|
},
|
|
@@ -140,6 +143,7 @@ function packageJson(name) {
|
|
|
140
143
|
tsx: '^4.19.0',
|
|
141
144
|
typescript: '^5.6.0',
|
|
142
145
|
vitest: '^3.0.0',
|
|
146
|
+
'@vitest/ui': '^3.0.0',
|
|
143
147
|
},
|
|
144
148
|
// Do NOT add `zod` here — import `z` from `@substrat-run/contracts` (AGENTS.md, rule 10).
|
|
145
149
|
// better-sqlite3 >=13 ships prebuilt binaries for every supported platform and
|
package/package.json
CHANGED
|
@@ -289,8 +289,10 @@ export const model = emitModel(entities);
|
|
|
289
289
|
|
|
290
290
|
These are compile errors, not lints: a `parents` naming no entity, a `permission` that is
|
|
291
291
|
not declared, an `entityIdFrom` naming no field of that operation's `output`, a `payload`
|
|
292
|
-
carrying a field the entity marks `erasable`, a `{var}` in an HTTP path that
|
|
293
|
-
field. All before a handler exists.
|
|
292
|
+
carrying a field the entity marks `erasable` or `outsideText`, a `{var}` in an HTTP path that
|
|
293
|
+
names no input field. All before a handler exists. Mark `outsideText` on any column whose value
|
|
294
|
+
a customer, a remote system or an inbound header writes and that is not personal data (an error
|
|
295
|
+
a provider returned, a subject line, a fetched document): it may sit on its row, never on an event.
|
|
294
296
|
|
|
295
297
|
Field names mirror the SQL columns, snake_case included — a prettier naming here is a second
|
|
296
298
|
description of the same rows. Not every table is an entity: an entity is something the
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The config behind `pnpm test:ui` — your own `vitest.config.ts`, plus the live test
|
|
3
|
+
* dashboard served on a port Claude Desktop's Browser pane can open (`.claude/launch.json`,
|
|
4
|
+
* the `tests` entry).
|
|
5
|
+
*
|
|
6
|
+
* The UI lives at `/__vitest__/` and the bare origin is a 404, but a launch entry carries
|
|
7
|
+
* a port and never a path, so `/` is redirected to the UI here. `VITEST_UI_PORT` moves
|
|
8
|
+
* the port; it binds 127.0.0.1 only, since the dashboard can re-run your tests. The port
|
|
9
|
+
* is strict: a busy one fails the start rather than moving the dashboard somewhere the
|
|
10
|
+
* launch entry does not point.
|
|
11
|
+
*/
|
|
12
|
+
import { mergeConfig, type Plugin } from 'vitest/config';
|
|
13
|
+
|
|
14
|
+
import base from './vitest.config.ts';
|
|
15
|
+
|
|
16
|
+
const redirectRootToUi: Plugin = {
|
|
17
|
+
name: 'substrat:vitest-ui-root',
|
|
18
|
+
configureServer(server) {
|
|
19
|
+
server.middlewares.use((req, res, next) => {
|
|
20
|
+
if (req.url !== '/') return next();
|
|
21
|
+
res.statusCode = 302;
|
|
22
|
+
res.setHeader('Location', '/__vitest__/');
|
|
23
|
+
res.end();
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default mergeConfig(base, {
|
|
29
|
+
plugins: [redirectRootToUi],
|
|
30
|
+
test: {
|
|
31
|
+
api: {
|
|
32
|
+
host: '127.0.0.1',
|
|
33
|
+
port: Number(process.env.VITEST_UI_PORT ?? 5290),
|
|
34
|
+
strictPort: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|