@uniflowed/config 0.0.0-alpha.13 → 0.0.0-alpha.14
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 +1 -0
- package/internal/schema.js +76 -0
- package/package.json +1 -1
package/index.js
CHANGED
package/internal/schema.js
CHANGED
|
@@ -25,6 +25,37 @@ export type TaskDefinition =
|
|
|
25
25
|
|
|
26
26
|
export type CapabilityJsHost = "node" | "deno" | "bun";
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* What the project's own code may reach.
|
|
30
|
+
*
|
|
31
|
+
* Absent from `uf.config.js` means no permission model: the toolchain starts
|
|
32
|
+
* its host the way it always has. Present means **deny by default** — the
|
|
33
|
+
* project's code gets what is listed and nothing else — and `permissions: {}`
|
|
34
|
+
* is a legitimate thing to write, meaning "nothing beyond what uf itself needs
|
|
35
|
+
* to load and transform the project". There is deliberately no way to spell
|
|
36
|
+
* "everything"; a project that wants everything does not declare a set.
|
|
37
|
+
*
|
|
38
|
+
* Every field is a list of literal strings, because `uf.config.js` is read as
|
|
39
|
+
* text and parsed as JSON5 rather than executed: a computed path or a
|
|
40
|
+
* `process.env` read here would not parse.
|
|
41
|
+
*
|
|
42
|
+
* The set is uf's, not a runtime's. Node.js enforces `read` and `write`, Deno
|
|
43
|
+
* enforces all five, and Bun has no permission model at all — a host that
|
|
44
|
+
* cannot enforce what is declared **refuses the run** rather than applying part
|
|
45
|
+
* of it. `docs/hosts.md` is the table.
|
|
46
|
+
*
|
|
47
|
+
* The declared paths are *added to* the ones uf needs to run the project, so
|
|
48
|
+
* what a set denies is the rest of the machine — `~/.ssh`, the network, the
|
|
49
|
+
* environment — and not the project's own files.
|
|
50
|
+
*/
|
|
51
|
+
export type Permissions = {
|
|
52
|
+
readonly read?: $ReadOnlyArray<string>,
|
|
53
|
+
readonly write?: $ReadOnlyArray<string>,
|
|
54
|
+
readonly net?: $ReadOnlyArray<string>,
|
|
55
|
+
readonly env?: $ReadOnlyArray<string>,
|
|
56
|
+
readonly run?: $ReadOnlyArray<string>,
|
|
57
|
+
};
|
|
58
|
+
|
|
28
59
|
/**
|
|
29
60
|
* Percentages a coverage gate requires, as whole numbers between 0 and 100.
|
|
30
61
|
*
|
|
@@ -161,9 +192,16 @@ export type UniflowedConfig = {
|
|
|
161
192
|
readonly build?: {
|
|
162
193
|
readonly entries?: $ReadOnlyArray<string>,
|
|
163
194
|
readonly outDir?: string,
|
|
195
|
+
// Prerender every route and leave no server bundle behind. Read together
|
|
196
|
+
// with `app.rendering.modes`; see docs/app/reference/config.
|
|
164
197
|
readonly staticBuild?: boolean,
|
|
165
198
|
readonly sourcemap?: boolean,
|
|
166
199
|
},
|
|
200
|
+
// Which builder uf drives. Vite is the default, not a dependency: any module
|
|
201
|
+
// satisfying the contract in docs/architecture.md can be named here.
|
|
202
|
+
readonly builder?: {
|
|
203
|
+
readonly module?: string,
|
|
204
|
+
},
|
|
167
205
|
readonly dev?: {
|
|
168
206
|
readonly host?: string,
|
|
169
207
|
readonly port?: number,
|
|
@@ -216,12 +254,50 @@ export type UniflowedConfig = {
|
|
|
216
254
|
>,
|
|
217
255
|
readonly typescriptDeclarationsToFlow?: true,
|
|
218
256
|
},
|
|
257
|
+
readonly permissions?: Permissions,
|
|
219
258
|
readonly pm?: {
|
|
220
259
|
readonly module?: "@uniflowed/pm",
|
|
221
260
|
readonly resolver?: "uf-native",
|
|
222
261
|
readonly lockfile?: "uf.lock",
|
|
223
262
|
readonly storeDir?: string,
|
|
224
263
|
readonly allowLifecycleScripts?: false,
|
|
264
|
+
/**
|
|
265
|
+
* The registry uf *reads* from: packuments, provenance attestations, and
|
|
266
|
+
* the versions `uf update` reports against.
|
|
267
|
+
*
|
|
268
|
+
* Unset means `publish.registry`, which is where this lived until it
|
|
269
|
+
* turned out to be answering two questions with one value. A project that
|
|
270
|
+
* publishes to a company registry and installs through a read-through
|
|
271
|
+
* mirror sets both; one that has only ever set `publish.registry` keeps
|
|
272
|
+
* working and is told, once, which key to move to.
|
|
273
|
+
*/
|
|
274
|
+
readonly registry?: string,
|
|
275
|
+
/**
|
|
276
|
+
* Which registry answers for which scope: `{ "@company": "https://…" }`.
|
|
277
|
+
*
|
|
278
|
+
* A scope named here resolves from that registry **and nowhere else**.
|
|
279
|
+
* There is no fallback to the public registry, deliberately: publishing
|
|
280
|
+
* `@company/internal-thing` to npmjs and waiting for a resolver to fall
|
|
281
|
+
* back to it is the dependency-confusion attack, so the fallback is the
|
|
282
|
+
* vulnerability rather than a recovery from it. A name the bound registry
|
|
283
|
+
* does not have is an error that names the scope and the registry.
|
|
284
|
+
*
|
|
285
|
+
* uf refuses an install whose lockfile resolves a bound scope from
|
|
286
|
+
* somewhere else. It does not rewrite the project's `.npmrc`: the manager
|
|
287
|
+
* that resolves is the manager that has to be told, in its own
|
|
288
|
+
* configuration.
|
|
289
|
+
*/
|
|
290
|
+
readonly scopes?: { readonly [scope: string]: string },
|
|
291
|
+
/**
|
|
292
|
+
* How hard `uf install` looks at npm provenance attestations.
|
|
293
|
+
*
|
|
294
|
+
* `"report"`, the default, reads the attestation of every package the
|
|
295
|
+
* install brought in or moved: an attestation that is not about the
|
|
296
|
+
* tarball being installed stops the install, and a package with none is a
|
|
297
|
+
* line in the summary. `"off"` reads none, for a machine with no route to
|
|
298
|
+
* a registry.
|
|
299
|
+
*/
|
|
300
|
+
readonly provenance?: "report" | "off",
|
|
225
301
|
},
|
|
226
302
|
readonly rm?: {
|
|
227
303
|
readonly module?: "@uniflowed/rm",
|