create-substrat 0.14.0 → 0.15.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/package.json +1 -1
- package/project-files.js +16 -7
- package/template/AGENTS.md +6 -3
- package/template/src/worker.ts +14 -4
package/package.json
CHANGED
package/project-files.js
CHANGED
|
@@ -30,12 +30,12 @@ import { DEV_SERVERS } from './dev-servers.js';
|
|
|
30
30
|
// The runtime packages release together off one version line (the changesets `fixed`
|
|
31
31
|
// group), so one constant is right for all of them. Engines do NOT share a line —
|
|
32
32
|
// each versions on its own, so one pin per engine, deliberately.
|
|
33
|
-
const SUBSTRAT = '^0.
|
|
34
|
-
const ENGINE_WORKORDER = '^0.13.
|
|
35
|
-
const ENGINE_INVOICING = '^0.11.
|
|
33
|
+
const SUBSTRAT = '^0.188.0';
|
|
34
|
+
const ENGINE_WORKORDER = '^0.13.13';
|
|
35
|
+
const ENGINE_INVOICING = '^0.11.72';
|
|
36
36
|
const BOUNDARY_LINT = '^0.8.2';
|
|
37
|
-
const DEV_ISSUER = '^0.4.
|
|
38
|
-
const ATTACHMENT_EXTRACTORS = '^0.2.
|
|
37
|
+
const DEV_ISSUER = '^0.4.1';
|
|
38
|
+
const ATTACHMENT_EXTRACTORS = '^0.2.49';
|
|
39
39
|
|
|
40
40
|
export const TSCONFIG = `${JSON.stringify(
|
|
41
41
|
{
|
|
@@ -82,6 +82,14 @@ export default defineConfig({
|
|
|
82
82
|
*/
|
|
83
83
|
export const TEST_RUNNER = { vitest: '^5.0.0', '@vitest/ui': '^5.0.0' };
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* The pnpm a scaffold installs with: the one the platform's build runs, which is this workspace's
|
|
87
|
+
* own (`tools/template-sync.mjs` holds the two together). With no pin a project took whatever pnpm
|
|
88
|
+
* was installed, and pnpm 11 refuses one: it stops on better-sqlite3's ignored build, and holds
|
|
89
|
+
* back any release younger than its minimum age, which every fresh `@substrat-run` release is.
|
|
90
|
+
*/
|
|
91
|
+
export const PACKAGE_MANAGER = 'pnpm@10.10.0';
|
|
92
|
+
|
|
85
93
|
/** The package.json of a new project. */
|
|
86
94
|
export function packageJson(name) {
|
|
87
95
|
return `${JSON.stringify(
|
|
@@ -90,6 +98,7 @@ export function packageJson(name) {
|
|
|
90
98
|
version: '0.0.0',
|
|
91
99
|
private: true,
|
|
92
100
|
type: 'module',
|
|
101
|
+
packageManager: PACKAGE_MANAGER,
|
|
93
102
|
// What `substrat push` reads: the permission surface (the registry the
|
|
94
103
|
// promotion checkpoint diffs) and the runtime needs the deploy config is
|
|
95
104
|
// derived from — you never author wrangler config (src/worker.ts is the
|
|
@@ -161,8 +170,8 @@ export function packageJson(name) {
|
|
|
161
170
|
...TEST_RUNNER,
|
|
162
171
|
},
|
|
163
172
|
// Do NOT add `zod` here — import `z` from `@substrat-run/contracts` (AGENTS.md, rule 10).
|
|
164
|
-
// better-sqlite3 >=13 ships prebuilt binaries for every supported platform
|
|
165
|
-
//
|
|
173
|
+
// better-sqlite3 >=13 ships prebuilt binaries for every supported platform, so its build
|
|
174
|
+
// stays ignored and needs no allowlist entry: pnpm 10 names it as ignored, and it loads.
|
|
166
175
|
},
|
|
167
176
|
null,
|
|
168
177
|
2,
|
package/template/AGENTS.md
CHANGED
|
@@ -81,9 +81,12 @@ and the `{ error }` envelope are authored there, not here, so they can't drift o
|
|
|
81
81
|
ship half-done). Sign-in is `workerDoor`, from `@substrat-run/vertical-host/worker-door`:
|
|
82
82
|
the issuer the dashboard delivers, the tenant's identity directory, and the owner seat
|
|
83
83
|
the first person takes. Every route gets its stub through `door.scope`, which hands an
|
|
84
|
-
operation the caller's verified address as `ctx.verifiedEmail`.
|
|
85
|
-
|
|
86
|
-
`
|
|
84
|
+
operation the caller's verified address as `ctx.verifiedEmail`. The first time a person
|
|
85
|
+
reaches the scope, the door runs your join if you name one (`workerDoor({ join })`), then
|
|
86
|
+
gives them every shape your `permissions` declare `bootstrap` with `holder: 'self'`, once.
|
|
87
|
+
That is what the seed does locally, so a vertical with a join operation names it there, or a
|
|
88
|
+
hosted person is never joined. There is no dev header to forget to turn off. `src/server.ts`
|
|
89
|
+
is the same shape, against the local OIDC issuer `pnpm dev` starts.
|
|
87
90
|
|
|
88
91
|
**A UI ships as declared assets.** If `app/` exists, `substrat.runtimeNeeds.assets` must
|
|
89
92
|
point at its build output and `runtimeNeeds.build` must produce it — otherwise the deployed
|
package/template/src/worker.ts
CHANGED
|
@@ -38,8 +38,9 @@ import {
|
|
|
38
38
|
invocationLog,
|
|
39
39
|
} from '@substrat-run/vertical-host';
|
|
40
40
|
import { IdentityDO, workerDoor } from '@substrat-run/vertical-host/worker-door';
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
// Only from provision.ts, the file `substrat push` reads: so this worker fits any vertical whose
|
|
42
|
+
// provision.ts exports these five, and needs no edit beyond a `join`.
|
|
43
|
+
import { MODULES, OWNER_ROLE_KEY, ROLES, envSpec, permissions } from './provision.js';
|
|
43
44
|
import { mountApi } from './routes.js';
|
|
44
45
|
|
|
45
46
|
/** The scope-DO class = the app binary: kernel + engines + this vertical, bundled. */
|
|
@@ -133,12 +134,21 @@ function hostFor(env: Env): CloudflareScopeHost {
|
|
|
133
134
|
return host;
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* Who is calling, for every route below. It hands an operation the caller's verified address, and
|
|
139
|
+
* the first time a person reaches a scope it gives them every shape `permissions` declares
|
|
140
|
+
* `bootstrap` with `holder: 'self'`, on their own record. A vertical with a join operation names it
|
|
141
|
+
* here, so a person is joined when they first sign in, before that grant:
|
|
142
|
+
*
|
|
143
|
+
* join: (scope, who) => scope.invoke('shop/join', { displayName: who.display }),
|
|
144
|
+
*
|
|
145
|
+
* This shop has neither: its people are added by staff, and its portal shape is a customer's.
|
|
146
|
+
*/
|
|
137
147
|
const door = workerDoor<Env>({
|
|
138
148
|
directory: (env, node) => env.AUTH.get(env.AUTH.idFromName(node.tenantId)),
|
|
139
149
|
nodeFor,
|
|
140
150
|
hostFor,
|
|
141
|
-
envSpec
|
|
151
|
+
envSpec,
|
|
142
152
|
});
|
|
143
153
|
|
|
144
154
|
/** The caller's scope stub. 401 if nobody. */
|