@uniflowed/config 0.0.0-alpha.12 → 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 +95 -0
- package/package.json +1 -1
package/index.js
CHANGED
package/internal/schema.js
CHANGED
|
@@ -12,10 +12,50 @@ export type TaskDefinition =
|
|
|
12
12
|
readonly cwd?: string,
|
|
13
13
|
readonly dependsOn?: $ReadOnlyArray<string>,
|
|
14
14
|
readonly env?: { readonly [string]: string },
|
|
15
|
+
// Everything the task reads, as paths or globs from the project root; a
|
|
16
|
+
// pattern beginning `!` excludes. This is the whole of the cache key, so
|
|
17
|
+
// a task that lists nothing is never cached and always runs.
|
|
18
|
+
readonly inputs?: $ReadOnlyArray<string>,
|
|
19
|
+
// Everything it writes. Checked rather than restored: a replayed result
|
|
20
|
+
// has to still have its files on disk, unchanged.
|
|
21
|
+
readonly outputs?: $ReadOnlyArray<string>,
|
|
22
|
+
// `false` keeps a task with declared inputs out of the cache.
|
|
23
|
+
readonly cache?: boolean,
|
|
15
24
|
};
|
|
16
25
|
|
|
17
26
|
export type CapabilityJsHost = "node" | "deno" | "bun";
|
|
18
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
|
+
|
|
19
59
|
/**
|
|
20
60
|
* Percentages a coverage gate requires, as whole numbers between 0 and 100.
|
|
21
61
|
*
|
|
@@ -152,9 +192,16 @@ export type UniflowedConfig = {
|
|
|
152
192
|
readonly build?: {
|
|
153
193
|
readonly entries?: $ReadOnlyArray<string>,
|
|
154
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.
|
|
155
197
|
readonly staticBuild?: boolean,
|
|
156
198
|
readonly sourcemap?: boolean,
|
|
157
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
|
+
},
|
|
158
205
|
readonly dev?: {
|
|
159
206
|
readonly host?: string,
|
|
160
207
|
readonly port?: number,
|
|
@@ -186,6 +233,16 @@ export type UniflowedConfig = {
|
|
|
186
233
|
},
|
|
187
234
|
readonly nonFlow?: {
|
|
188
235
|
readonly formatter?: "biome" | "prettier" | "none",
|
|
236
|
+
/**
|
|
237
|
+
* Extra arguments, passed to that formatter verbatim.
|
|
238
|
+
*
|
|
239
|
+
* Strings rather than a shape, so that reaching one of biome's or
|
|
240
|
+
* prettier's own options never waits for a uf release — a Tailwind 4
|
|
241
|
+
* project writes `["--css-parse-tailwind-directives=true"]` and needs no
|
|
242
|
+
* second configuration file. An argument that would turn `uf fmt
|
|
243
|
+
* --check` into a write is refused where the config is read.
|
|
244
|
+
*/
|
|
245
|
+
readonly arguments?: $ReadOnlyArray<string>,
|
|
189
246
|
},
|
|
190
247
|
readonly quotes?: "single" | "double",
|
|
191
248
|
readonly semicolons?: boolean,
|
|
@@ -197,12 +254,50 @@ export type UniflowedConfig = {
|
|
|
197
254
|
>,
|
|
198
255
|
readonly typescriptDeclarationsToFlow?: true,
|
|
199
256
|
},
|
|
257
|
+
readonly permissions?: Permissions,
|
|
200
258
|
readonly pm?: {
|
|
201
259
|
readonly module?: "@uniflowed/pm",
|
|
202
260
|
readonly resolver?: "uf-native",
|
|
203
261
|
readonly lockfile?: "uf.lock",
|
|
204
262
|
readonly storeDir?: string,
|
|
205
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",
|
|
206
301
|
},
|
|
207
302
|
readonly rm?: {
|
|
208
303
|
readonly module?: "@uniflowed/rm",
|