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

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,226 @@ 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",
71
+ },
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,
58
79
  },
59
- +motion?: {
60
- +module?: "@uniflowed/motion",
61
- +engine?: "uf-native",
62
- +compilerSafe?: true,
63
- +serverComponentSafe?: true,
64
- +reducedMotionDefault?: 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,
65
87
  },
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,
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,
74
94
  },
75
- +pwa?: {
76
- +module?: "@uniflowed/pwa",
77
- +enabledByDefault?: false,
78
- +cache?: "opt-in",
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,
79
103
  },
80
- +temporal?: {
81
- +module?: "@uniflowed/temporal",
82
- +lite?: true,
104
+ readonly pwa?: {
105
+ readonly module?: "@uniflowed/pwa",
106
+ readonly enabledByDefault?: false,
107
+ readonly cache?: "opt-in",
83
108
  },
84
- +web?: {
85
- +module?: "@uniflowed/web",
86
- +typedRoutes?: true,
87
- +linkPrefetch?: "off" | "intent" | "render",
88
- +cache?: "opt-in",
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
+ readonly std?: {
227
+ readonly module?: "@uniflowed/std",
228
+ readonly wintertcAligned?: true,
229
+ readonly nativeBindings?: boolean,
230
+ readonly modules?: $ReadOnlyArray<
202
231
  | "vfs"
203
232
  | "fs"
204
233
  | "types"
@@ -245,58 +274,75 @@ export type UniflowedConfig = {
245
274
  | "defer",
246
275
  >,
247
276
  },
248
- +publish?: {
249
- +registry?: string,
250
- +dryRun?: boolean,
251
- +firstPublish?: {
252
- +mode?: "local",
253
- +localBootstrap?: true,
277
+ readonly publish?: {
278
+ readonly registry?: string,
279
+ readonly dryRun?: boolean,
280
+ readonly firstPublish?: {
281
+ readonly mode?: "local",
282
+ readonly localBootstrap?: true,
254
283
  },
255
- +trustedPublish?: {
256
- +enabled?: true,
257
- +provider?: "github-actions-oidc",
258
- +tokenless?: true,
259
- +trigger?: "tag-push",
284
+ readonly trustedPublish?: {
285
+ readonly enabled?: true,
286
+ readonly provider?: "github-actions-oidc",
287
+ readonly tokenless?: true,
288
+ readonly trigger?: "tag-push",
260
289
  },
261
290
  },
262
- +release?: {
263
- +tagPrefix?: "uf@",
264
- +command?: "uf release alpha" | string,
265
- +publish?: true,
291
+ readonly release?: {
292
+ readonly tagPrefix?: "uf@",
293
+ readonly command?: "uf release alpha" | string,
294
+ readonly publish?: true,
266
295
  },
267
- +story?: {
268
- +enabled?: boolean,
269
- +module?: "@uniflowed/story",
270
- +mocks?: {
271
- +module?: "@uniflowed/mock",
272
- +mswCompatible?: boolean,
296
+ readonly story?: {
297
+ readonly enabled?: boolean,
298
+ readonly module?: "@uniflowed/story",
299
+ readonly mocks?: {
300
+ readonly module?: "@uniflowed/mock",
301
+ readonly mswCompatible?: boolean,
273
302
  },
274
- +browser?: {
275
- +module?: "@uniflowed/browser",
276
- +playwrightCompatible?: boolean,
303
+ readonly browser?: {
304
+ readonly module?: "@uniflowed/browser",
305
+ readonly playwrightCompatible?: boolean,
277
306
  },
278
307
  },
279
- +taskRunner?: {
280
- +engine?: "vite-task",
281
- +allowPackageScripts?: false,
308
+ readonly taskRunner?: {
309
+ readonly engine?: "vite-task",
310
+ readonly allowPackageScripts?: false,
282
311
  },
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,
312
+ readonly test?: {
313
+ readonly module?: "@uniflowed/test",
314
+ readonly runner?: {
315
+ readonly runtime?: "capability-js-host" | "uf-self-hosted",
316
+ readonly jsHosts?: $ReadOnlyArray<CapabilityJsHost>,
317
+ readonly scheduler?: "native-work-stealing",
318
+ readonly performanceTarget?: "faster-than-bun",
319
+ readonly officialFlowParser?: true,
320
+ },
321
+ readonly reactTestingLibraryNative?: true,
322
+ /**
323
+ * What `uf test --coverage` measures, writes and fails on.
324
+ *
325
+ * The thresholds live here rather than on the command line because a
326
+ * coverage gate is a property of the project: the number CI fails on has to
327
+ * be the number a laptop fails on. They are checked whenever coverage was
328
+ * collected, so `enabled: false` plus `--coverage` still gates.
329
+ */
330
+ readonly coverage?: {
331
+ readonly enabled?: boolean,
332
+ readonly directory?: string,
333
+ readonly reporters?: $ReadOnlyArray<"text" | "lcov" | "cobertura">,
334
+ readonly include?: $ReadOnlyArray<string>,
335
+ readonly exclude?: $ReadOnlyArray<string>,
336
+ readonly thresholds?: CoverageThresholds,
337
+ readonly perFileThresholds?: CoverageThresholds,
291
338
  },
292
- +reactTestingLibraryNative?: true,
293
339
  },
294
- +tasks?: { +[string]: TaskDefinition },
295
- +vrt?: {
296
- +enabled?: boolean,
297
- +module?: "@uniflowed/vrt",
298
- +baselines?: string,
299
- +threshold?: number,
340
+ readonly tasks?: { readonly [string]: TaskDefinition },
341
+ readonly vrt?: {
342
+ readonly enabled?: boolean,
343
+ readonly module?: "@uniflowed/vrt",
344
+ readonly baselines?: string,
345
+ readonly threshold?: number,
300
346
  },
301
347
  };
302
348
 
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.10",
4
4
  "description": "Flow declarations for @uniflowed/config, part of the Unified Toolchain for Flow.",
5
5
  "type": "module",
6
6
  "license": "MIT",