@uniflowed/config 0.0.0-alpha.1 → 0.0.0-alpha.11

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 CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  export type {
6
6
  CapabilityJsHost,
7
+ CoverageThresholds,
7
8
  RuleLevel,
8
9
  TaskDefinition,
9
10
  UniflowedConfig,
@@ -8,197 +8,239 @@ export type RuleLevel = "off" | "warn" | "error" | 0 | 1 | 2 | boolean;
8
8
  export type TaskDefinition =
9
9
  | string
10
10
  | {
11
- +command: string,
12
- +cwd?: string,
13
- +dependsOn?: $ReadOnlyArray<string>,
14
- +env?: { +[string]: string },
11
+ readonly command: string,
12
+ readonly cwd?: string,
13
+ readonly dependsOn?: $ReadOnlyArray<string>,
14
+ readonly env?: { readonly [string]: string },
15
15
  };
16
16
 
17
17
  export type CapabilityJsHost = "node" | "deno" | "bun";
18
18
 
19
+ /**
20
+ * Percentages a coverage gate requires, as whole numbers between 0 and 100.
21
+ *
22
+ * A metric nobody names is not checked, which is not the same as requiring
23
+ * zero: `{ lines: 0 }` says "every line, and I mean it" in a way that reads
24
+ * wrong, so the absent case is the one that means nothing is required.
25
+ */
26
+ export type CoverageThresholds = {
27
+ readonly lines?: number,
28
+ readonly functions?: number,
29
+ readonly branches?: number,
30
+ };
31
+
19
32
  export type UniflowedConfig = {
20
- +app?: {
21
- +orm?: {
22
- +enabled?: boolean,
23
- +module?: "@uniflowed/orm",
24
- +native?: true,
25
- +generatedFlowTypes?: true,
26
- +preparedByDefault?: true,
33
+ readonly app?: {
34
+ readonly orm?: {
35
+ readonly enabled?: boolean,
36
+ readonly module?: "@uniflowed/orm",
37
+ readonly native?: true,
38
+ readonly generatedFlowTypes?: true,
39
+ readonly preparedByDefault?: true,
27
40
  },
28
- +builtins?: {
29
- +fetch?: {
30
- +module?: "@uniflowed/fetch",
31
- +overrideGlobalFetch?: false,
41
+ readonly builtins?: {
42
+ readonly fetch?: {
43
+ readonly module?: "@uniflowed/fetch",
44
+ readonly overrideGlobalFetch?: false,
32
45
  },
33
- +cell?: boolean,
34
- +reactCompiler?: {
35
- +enabled?: boolean,
36
- +implementation?: "official-rust",
37
- +mode?: "syntax",
46
+ readonly cell?: boolean,
47
+ readonly reactCompiler?: {
48
+ readonly enabled?: boolean,
49
+ readonly implementation?: "official-rust",
50
+ readonly mode?: "syntax",
38
51
  },
39
- +graphql?: {
40
- +module?: "@uniflowed/graphql",
41
- +relayBase?: true,
52
+ readonly graphql?: {
53
+ readonly module?: "@uniflowed/graphql",
54
+ readonly relayBase?: true,
42
55
  },
43
- +loader?: {
44
- +module?: "@uniflowed/loader",
45
- +stateModule?: "@uniflowed/state",
46
- +cache?: "opt-in",
56
+ readonly loader?: {
57
+ readonly module?: "@uniflowed/loader",
58
+ readonly stateModule?: "@uniflowed/state",
59
+ readonly cache?: "opt-in",
47
60
  },
48
- +markdown?: {
49
- +module?: "@uniflowed/markdown",
50
- +engine?: "ox-content-wasm",
51
- +mdx?: {
52
- +enabled?: boolean,
53
- +extensions?: $ReadOnlyArray<".mdx">,
54
- +jsxImportSource?: "@uniflowed/jsx-runtime",
55
- +pipelinePlugin?: "built-in",
61
+ readonly markdown?: {
62
+ readonly module?: "@uniflowed/markdown",
63
+ readonly engine?: "ox-content-wasm",
64
+ readonly mdx?: {
65
+ readonly enabled?: boolean,
66
+ readonly extensions?: $ReadOnlyArray<".mdx">,
67
+ readonly jsxImportSource?: "@uniflowed/jsx-runtime",
68
+ readonly pipelinePlugin?: "built-in",
56
69
  },
57
- +cache?: "opt-in",
70
+ readonly cache?: "opt-in",
58
71
  },
59
- +motion?: {
60
- +module?: "@uniflowed/motion",
61
- +engine?: "uf-native",
62
- +compilerSafe?: true,
63
- +serverComponentSafe?: true,
64
- +reducedMotionDefault?: true,
72
+ readonly images?: {
73
+ readonly enabled?: boolean,
74
+ // The widths a layout asks for. uf emits one variant per width that is
75
+ // not wider than the source, plus one at the source's own width.
76
+ readonly widths?: $ReadOnlyArray<number>,
77
+ readonly quality?: number,
78
+ readonly placeholder?: boolean,
65
79
  },
66
- +tui?: {
67
- +module?: "@uniflowed/tui",
68
- +stdModule?: "@uniflowed/std/tui",
69
- +standard?: "open-tui",
70
- +nativeRenderer?: true,
71
- +beatReactInk?: true,
72
- +richMedia?: true,
73
- +inMemoryTests?: true,
80
+ readonly fonts?: {
81
+ readonly enabled?: boolean,
82
+ readonly display?: string,
83
+ // The local face uf scales into a metric-matched fallback. One of the
84
+ // faces `uf_assets::font::LOCAL_FACES` knows the metrics of, because
85
+ // the scaling is a ratio against real numbers rather than a guess.
86
+ readonly fallback?: string,
74
87
  },
75
- +pwa?: {
76
- +module?: "@uniflowed/pwa",
77
- +enabledByDefault?: false,
78
- +cache?: "opt-in",
88
+ readonly motion?: {
89
+ readonly module?: "@uniflowed/motion",
90
+ readonly engine?: "uf-native",
91
+ readonly compilerSafe?: true,
92
+ readonly serverComponentSafe?: true,
93
+ readonly reducedMotionDefault?: true,
79
94
  },
80
- +temporal?: {
81
- +module?: "@uniflowed/temporal",
82
- +lite?: true,
95
+ readonly tui?: {
96
+ readonly module?: "@uniflowed/tui",
97
+ readonly stdModule?: "@uniflowed/std/tui",
98
+ readonly standard?: "open-tui",
99
+ readonly nativeRenderer?: true,
100
+ readonly beatReactInk?: true,
101
+ readonly richMedia?: true,
102
+ readonly inMemoryTests?: true,
83
103
  },
84
- +web?: {
85
- +module?: "@uniflowed/web",
86
- +typedRoutes?: true,
87
- +linkPrefetch?: "off" | "intent" | "render",
88
- +cache?: "opt-in",
104
+ readonly pwa?: {
105
+ readonly module?: "@uniflowed/pwa",
106
+ readonly enabledByDefault?: false,
107
+ readonly cache?: "opt-in",
108
+ },
109
+ readonly temporal?: {
110
+ readonly module?: "@uniflowed/temporal",
111
+ readonly lite?: true,
112
+ },
113
+ readonly web?: {
114
+ readonly module?: "@uniflowed/web",
115
+ readonly typedRoutes?: true,
116
+ readonly linkPrefetch?: "off" | "intent" | "render",
117
+ readonly cache?: "opt-in",
89
118
  },
90
119
  },
91
- +runtime?: {
92
- +default?: "node" | "deno" | "bun" | "uf",
93
- +compatibility?: $ReadOnlyArray<
120
+ readonly runtime?: {
121
+ readonly default?: "node" | "deno" | "bun" | "uf",
122
+ readonly compatibility?: $ReadOnlyArray<
94
123
  "node" | "bun" | "deno" | "edge" | "serverless" | "container",
95
124
  >,
96
- +capabilityJsHost?: {
97
- +default?: CapabilityJsHost,
98
- +hosts?: $ReadOnlyArray<CapabilityJsHost>,
99
- +autoDetect?: boolean,
125
+ readonly capabilityJsHost?: {
126
+ readonly default?: CapabilityJsHost,
127
+ readonly hosts?: $ReadOnlyArray<CapabilityJsHost>,
128
+ readonly autoDetect?: boolean,
100
129
  },
101
- +deploy?: {
102
- +enabled?: boolean,
103
- +adapters?: $ReadOnlyArray<
130
+ readonly deploy?: {
131
+ readonly enabled?: boolean,
132
+ readonly adapters?: $ReadOnlyArray<
104
133
  "node" | "bun" | "deno" | "edge" | "serverless" | "static" | "container",
105
134
  >,
106
135
  },
107
136
  },
108
- +router?: {
109
- +entry?: string,
110
- +root?: string,
111
- +manifest?: string,
137
+ readonly router?: {
138
+ readonly entry?: string,
139
+ readonly root?: string,
140
+ readonly manifest?: string,
112
141
  },
113
- +rendering?: {
114
- +modes?: $ReadOnlyArray<"ppr" | "ssr" | "ssg" | "isr">,
115
- +cache?: {
116
- +actions?: boolean,
117
- +data?: boolean,
118
- +fetch?: boolean,
119
- +route?: boolean,
142
+ readonly rendering?: {
143
+ readonly modes?: $ReadOnlyArray<"ppr" | "ssr" | "ssg" | "isr">,
144
+ readonly cache?: {
145
+ readonly actions?: boolean,
146
+ readonly data?: boolean,
147
+ readonly fetch?: boolean,
148
+ readonly route?: boolean,
120
149
  },
121
150
  },
122
151
  },
123
- +build?: {
124
- +entries?: $ReadOnlyArray<string>,
125
- +outDir?: string,
126
- +staticBuild?: boolean,
127
- +sourcemap?: boolean,
152
+ readonly build?: {
153
+ readonly entries?: $ReadOnlyArray<string>,
154
+ readonly outDir?: string,
155
+ readonly staticBuild?: boolean,
156
+ readonly sourcemap?: boolean,
128
157
  },
129
- +dev?: {
130
- +host?: string,
131
- +port?: number,
132
- +strictPort?: boolean,
158
+ readonly dev?: {
159
+ readonly host?: string,
160
+ readonly port?: number,
161
+ readonly strictPort?: boolean,
133
162
  },
134
- +docs?: {
135
- +enabled?: boolean,
136
- +app?: string,
137
- +source?: string,
138
- +outDir?: string,
139
- +staticBuild?: boolean,
140
- +deploy?: "void",
163
+ readonly docs?: {
164
+ readonly enabled?: boolean,
165
+ readonly app?: string,
166
+ readonly source?: string,
167
+ readonly outDir?: string,
168
+ readonly staticBuild?: boolean,
169
+ readonly deploy?: "void",
141
170
  },
142
- +lint?: {
143
- +engine?: "rust",
144
- +flow?: {
145
- +builtins?: "mixed",
146
- +parser?: "official-flow-rust",
171
+ readonly lint?: {
172
+ readonly engine?: "rust",
173
+ readonly flow?: {
174
+ readonly builtins?: "mixed",
175
+ readonly parser?: "official-flow-rust",
147
176
  },
148
- +rules?: { +[string]: RuleLevel },
177
+ readonly rules?: { readonly [string]: RuleLevel },
149
178
  },
150
- +fmt?: {
151
- +indentWidth?: number,
152
- +lineWidth?: number,
153
- +maxBlankLines?: number,
154
- +flow?: {
155
- +parser?: "official-flow-rust",
156
- +printer?: "uf-rust",
179
+ readonly fmt?: {
180
+ readonly indentWidth?: number,
181
+ readonly lineWidth?: number,
182
+ readonly maxBlankLines?: number,
183
+ readonly flow?: {
184
+ readonly parser?: "official-flow-rust",
185
+ readonly printer?: "uf-rust",
157
186
  },
158
- +nonFlow?: {
159
- +formatter?: "biome",
187
+ readonly nonFlow?: {
188
+ readonly formatter?: "biome" | "prettier" | "none",
160
189
  },
161
- +quotes?: "single" | "double",
162
- +semicolons?: boolean,
190
+ readonly quotes?: "single" | "double",
191
+ readonly semicolons?: boolean,
163
192
  },
164
- +package?: {
165
- +generator?: "napi-rs",
166
- +targets?: $ReadOnlyArray<
193
+ readonly package?: {
194
+ readonly generator?: "napi-rs",
195
+ readonly targets?: $ReadOnlyArray<
167
196
  "node-napi" | "bun-napi" | "deno-napi" | "edge-wasm" | "serverless-napi",
168
197
  >,
169
- +typescriptDeclarationsToFlow?: true,
198
+ readonly typescriptDeclarationsToFlow?: true,
170
199
  },
171
- +pm?: {
172
- +module?: "@uniflowed/pm",
173
- +resolver?: "uf-native",
174
- +lockfile?: "uf.lock",
175
- +storeDir?: string,
176
- +allowLifecycleScripts?: false,
200
+ readonly pm?: {
201
+ readonly module?: "@uniflowed/pm",
202
+ readonly resolver?: "uf-native",
203
+ readonly lockfile?: "uf.lock",
204
+ readonly storeDir?: string,
205
+ readonly allowLifecycleScripts?: false,
177
206
  },
178
- +rm?: {
179
- +module?: "@uniflowed/rm",
180
- +inferFromConfig?: true,
181
- +version?: "node@system" | string,
182
- +autoSwitch?: boolean,
183
- +acquisition?: "auto",
184
- +apply?: "config-and-host",
185
- +doctor?: boolean,
207
+ readonly rm?: {
208
+ readonly module?: "@uniflowed/rm",
209
+ readonly inferFromConfig?: true,
210
+ readonly version?: "node@system" | string,
211
+ readonly autoSwitch?: boolean,
212
+ readonly acquisition?: "auto",
213
+ readonly apply?: "config-and-host",
214
+ readonly doctor?: boolean,
186
215
  },
187
- +server?: {
188
- +engine?: "native-rust",
189
- +native?: {
190
- +streaming?: boolean,
191
- +zeroCopyHttp?: boolean,
192
- +adapters?: $ReadOnlyArray<
216
+ readonly server?: {
217
+ readonly engine?: "native-rust",
218
+ readonly native?: {
219
+ readonly streaming?: boolean,
220
+ readonly zeroCopyHttp?: boolean,
221
+ readonly adapters?: $ReadOnlyArray<
193
222
  "uf" | "node" | "bun" | "deno" | "edge" | "serverless" | "container",
194
223
  >,
195
224
  },
196
225
  },
197
- +std?: {
198
- +module?: "@uniflowed/std",
199
- +wintertcAligned?: true,
200
- +nativeBindings?: boolean,
201
- +modules?: $ReadOnlyArray<
226
+ // Where the built site is served from, and what `uf build` may therefore
227
+ // write for a crawler. `url` is the switch: without it no `sitemap.xml` and
228
+ // no `robots.txt` are written at all, because a build cannot guess the host
229
+ // it will be deployed to and a wrong `<loc>` is worse than a missing one.
230
+ readonly site?: {
231
+ readonly url?: string,
232
+ readonly sitemap?: boolean,
233
+ readonly robots?: {
234
+ readonly enabled?: boolean,
235
+ readonly allow?: $ReadOnlyArray<string>,
236
+ readonly disallow?: $ReadOnlyArray<string>,
237
+ },
238
+ },
239
+ readonly std?: {
240
+ readonly module?: "@uniflowed/std",
241
+ readonly wintertcAligned?: true,
242
+ readonly nativeBindings?: boolean,
243
+ readonly modules?: $ReadOnlyArray<
202
244
  | "vfs"
203
245
  | "fs"
204
246
  | "types"
@@ -245,58 +287,75 @@ export type UniflowedConfig = {
245
287
  | "defer",
246
288
  >,
247
289
  },
248
- +publish?: {
249
- +registry?: string,
250
- +dryRun?: boolean,
251
- +firstPublish?: {
252
- +mode?: "local",
253
- +localBootstrap?: true,
290
+ readonly publish?: {
291
+ readonly registry?: string,
292
+ readonly dryRun?: boolean,
293
+ readonly firstPublish?: {
294
+ readonly mode?: "local",
295
+ readonly localBootstrap?: true,
254
296
  },
255
- +trustedPublish?: {
256
- +enabled?: true,
257
- +provider?: "github-actions-oidc",
258
- +tokenless?: true,
259
- +trigger?: "tag-push",
297
+ readonly trustedPublish?: {
298
+ readonly enabled?: true,
299
+ readonly provider?: "github-actions-oidc",
300
+ readonly tokenless?: true,
301
+ readonly trigger?: "tag-push",
260
302
  },
261
303
  },
262
- +release?: {
263
- +tagPrefix?: "uf@",
264
- +command?: "uf release alpha" | string,
265
- +publish?: true,
304
+ readonly release?: {
305
+ readonly tagPrefix?: "uf@",
306
+ readonly command?: "uf release alpha" | string,
307
+ readonly publish?: true,
266
308
  },
267
- +story?: {
268
- +enabled?: boolean,
269
- +module?: "@uniflowed/story",
270
- +mocks?: {
271
- +module?: "@uniflowed/mock",
272
- +mswCompatible?: boolean,
309
+ readonly story?: {
310
+ readonly enabled?: boolean,
311
+ readonly module?: "@uniflowed/story",
312
+ readonly mocks?: {
313
+ readonly module?: "@uniflowed/mock",
314
+ readonly mswCompatible?: boolean,
273
315
  },
274
- +browser?: {
275
- +module?: "@uniflowed/browser",
276
- +playwrightCompatible?: boolean,
316
+ readonly browser?: {
317
+ readonly module?: "@uniflowed/browser",
318
+ readonly playwrightCompatible?: boolean,
277
319
  },
278
320
  },
279
- +taskRunner?: {
280
- +engine?: "vite-task",
281
- +allowPackageScripts?: false,
321
+ readonly taskRunner?: {
322
+ readonly engine?: "vite-task",
323
+ readonly allowPackageScripts?: false,
282
324
  },
283
- +test?: {
284
- +module?: "@uniflowed/test",
285
- +runner?: {
286
- +runtime?: "capability-js-host" | "uf-self-hosted",
287
- +jsHosts?: $ReadOnlyArray<CapabilityJsHost>,
288
- +scheduler?: "native-work-stealing",
289
- +performanceTarget?: "faster-than-bun",
290
- +officialFlowParser?: true,
325
+ readonly test?: {
326
+ readonly module?: "@uniflowed/test",
327
+ readonly runner?: {
328
+ readonly runtime?: "capability-js-host" | "uf-self-hosted",
329
+ readonly jsHosts?: $ReadOnlyArray<CapabilityJsHost>,
330
+ readonly scheduler?: "native-work-stealing",
331
+ readonly performanceTarget?: "faster-than-bun",
332
+ readonly officialFlowParser?: true,
333
+ },
334
+ readonly reactTestingLibraryNative?: true,
335
+ /**
336
+ * What `uf test --coverage` measures, writes and fails on.
337
+ *
338
+ * The thresholds live here rather than on the command line because a
339
+ * coverage gate is a property of the project: the number CI fails on has to
340
+ * be the number a laptop fails on. They are checked whenever coverage was
341
+ * collected, so `enabled: false` plus `--coverage` still gates.
342
+ */
343
+ readonly coverage?: {
344
+ readonly enabled?: boolean,
345
+ readonly directory?: string,
346
+ readonly reporters?: $ReadOnlyArray<"text" | "lcov" | "cobertura">,
347
+ readonly include?: $ReadOnlyArray<string>,
348
+ readonly exclude?: $ReadOnlyArray<string>,
349
+ readonly thresholds?: CoverageThresholds,
350
+ readonly perFileThresholds?: CoverageThresholds,
291
351
  },
292
- +reactTestingLibraryNative?: true,
293
352
  },
294
- +tasks?: { +[string]: TaskDefinition },
295
- +vrt?: {
296
- +enabled?: boolean,
297
- +module?: "@uniflowed/vrt",
298
- +baselines?: string,
299
- +threshold?: number,
353
+ readonly tasks?: { readonly [string]: TaskDefinition },
354
+ readonly vrt?: {
355
+ readonly enabled?: boolean,
356
+ readonly module?: "@uniflowed/vrt",
357
+ readonly baselines?: string,
358
+ readonly threshold?: number,
300
359
  },
301
360
  };
302
361
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniflowed/config",
3
- "version": "0.0.0-alpha.1",
3
+ "version": "0.0.0-alpha.11",
4
4
  "description": "Flow declarations for @uniflowed/config, part of the Unified Toolchain for Flow.",
5
5
  "type": "module",
6
6
  "license": "MIT",