create-substrat 0.10.11 → 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/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
|
@@ -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
|
+
});
|