@sjcx/vorma 0.0.0-pre.1 → 0.0.0-pre.3

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.
Files changed (135) hide show
  1. package/dist/build/assemble-artifacts.d.ts +1 -1
  2. package/dist/build/bundle-client.d.ts +1 -1
  3. package/dist/build/cli.js +31 -38
  4. package/dist/build/compile-application.d.ts +2 -2
  5. package/dist/build/development-artifacts.d.ts +2 -1
  6. package/dist/build/development-build.d.ts +3 -6
  7. package/dist/build/development-work.d.ts +2 -3
  8. package/dist/build/generate-application.d.ts +2 -2
  9. package/dist/build/index.d.ts +2 -3
  10. package/dist/build/index.js +1 -1
  11. package/dist/build/inspect-projects.d.ts +3 -3
  12. package/dist/build/load-config.d.ts +0 -2
  13. package/dist/build/publish-artifacts.d.ts +1 -4
  14. package/dist/build/render-client-transport.d.ts +1 -1
  15. package/dist/build/render-server-generated.d.ts +1 -12
  16. package/dist/build/render-types.d.ts +1 -1
  17. package/dist/build/resolve-config.d.ts +2 -4
  18. package/dist/build/source-layout.d.ts +1 -1
  19. package/dist/{build-DcP5_DUV.js → build-sHSh5zaX.js} +67 -282
  20. package/package.json +5 -36
  21. package/dist/build/compile-server.d.ts +0 -42
  22. package/dist/client/assembly.d.ts +0 -40
  23. package/dist/client/browser-http-client.d.ts +0 -10
  24. package/dist/client/client-loaders.d.ts +0 -93
  25. package/dist/client/commit.d.ts +0 -41
  26. package/dist/client/contracts.d.ts +0 -192
  27. package/dist/client/core.d.ts +0 -45
  28. package/dist/client/development.d.ts +0 -16
  29. package/dist/client/document-recovery.d.ts +0 -4
  30. package/dist/client/endpoints.d.ts +0 -54
  31. package/dist/client/errors.d.ts +0 -87
  32. package/dist/client/freshness.d.ts +0 -51
  33. package/dist/client/head.d.ts +0 -14
  34. package/dist/client/history.d.ts +0 -25
  35. package/dist/client/index.d.ts +0 -80
  36. package/dist/client/index.js +0 -150
  37. package/dist/client/links.d.ts +0 -48
  38. package/dist/client/materialize.d.ts +0 -21
  39. package/dist/client/modules.d.ts +0 -2
  40. package/dist/client/navigation.d.ts +0 -47
  41. package/dist/client/payload.d.ts +0 -54
  42. package/dist/client/prefetch.d.ts +0 -28
  43. package/dist/client/prepare.d.ts +0 -47
  44. package/dist/client/projections.d.ts +0 -26
  45. package/dist/client/queries.d.ts +0 -33
  46. package/dist/client/react/application.d.ts +0 -87
  47. package/dist/client/react/hooks.d.ts +0 -36
  48. package/dist/client/react/index.d.ts +0 -5
  49. package/dist/client/react/index.js +0 -3237
  50. package/dist/client/react/link.d.ts +0 -27
  51. package/dist/client/react/view.d.ts +0 -86
  52. package/dist/client/request.d.ts +0 -16
  53. package/dist/client/route-context.d.ts +0 -31
  54. package/dist/client/route-matching.d.ts +0 -22
  55. package/dist/client/route-synchronization.d.ts +0 -30
  56. package/dist/client/route-url.d.ts +0 -5
  57. package/dist/client/runtime.d.ts +0 -82
  58. package/dist/client/scroll.d.ts +0 -16
  59. package/dist/client/services.d.ts +0 -34
  60. package/dist/client/state.d.ts +0 -102
  61. package/dist/client/static-assets.d.ts +0 -3
  62. package/dist/client/stylesheets.d.ts +0 -7
  63. package/dist/client/transport-type-entries.d.ts +0 -2
  64. package/dist/client/types.d.ts +0 -152
  65. package/dist/client/view-definition.d.ts +0 -24
  66. package/dist/client/work-indicator.d.ts +0 -18
  67. package/dist/compile-Me8EOyMK.js +0 -870
  68. package/dist/development-B_rxuwY7.js +0 -128
  69. package/dist/hash-set-BPx3iXec.js +0 -141
  70. package/dist/href-Cqyax8Y0.js +0 -357
  71. package/dist/materialize-DZ7VSLFk.js +0 -739
  72. package/dist/metadata-BoPKo-G2.js +0 -32
  73. package/dist/primitives/tasks/index.d.ts +0 -1
  74. package/dist/primitives/tasks/index.js +0 -1
  75. package/dist/route-context-CtY_9U_W.js +0 -559
  76. package/dist/route-matching-D_uSG2P9.js +0 -33
  77. package/dist/search-parse-0f7oqVsG.js +0 -375
  78. package/dist/server/config/index.d.ts +0 -36
  79. package/dist/server/config/index.js +0 -30
  80. package/dist/server/development/metadata.d.ts +0 -11
  81. package/dist/server/document.d.ts +0 -37
  82. package/dist/server/form-data.d.ts +0 -21
  83. package/dist/server/graph/compile.d.ts +0 -118
  84. package/dist/server/graph/declarations.d.ts +0 -117
  85. package/dist/server/graph/literal-error-tag.d.ts +0 -14
  86. package/dist/server/graph/pattern-conflicts.d.ts +0 -36
  87. package/dist/server/graph/search-schema.d.ts +0 -13
  88. package/dist/server/graph/transport-schema.d.ts +0 -11
  89. package/dist/server/index.d.ts +0 -310
  90. package/dist/server/index.js +0 -2311
  91. package/dist/server/public-assets.d.ts +0 -18
  92. package/dist/server/runtime/application.d.ts +0 -15
  93. package/dist/server/runtime/assets.d.ts +0 -15
  94. package/dist/server/runtime/context.d.ts +0 -96
  95. package/dist/server/runtime/domain-errors.d.ts +0 -11
  96. package/dist/server/runtime/effects.d.ts +0 -83
  97. package/dist/server/runtime/execute.d.ts +0 -13
  98. package/dist/server/runtime/finalize.d.ts +0 -44
  99. package/dist/server/runtime/handler.d.ts +0 -106
  100. package/dist/server/runtime/head.d.ts +0 -22
  101. package/dist/server/runtime/payload.d.ts +0 -50
  102. package/dist/server/runtime/pipeline.d.ts +0 -27
  103. package/dist/server/runtime/plan.d.ts +0 -98
  104. package/dist/server/runtime/render-document.d.ts +0 -16
  105. package/dist/server/runtime/startup-error.d.ts +0 -11
  106. package/dist/server/runtime/transport-type-entries.d.ts +0 -2
  107. package/dist/server/runtime/vercel-deployment.d.ts +0 -2
  108. package/dist/server/url-pathname.d.ts +0 -13
  109. package/dist/static-assets-BrH3O0M8.js +0 -199
  110. package/dist/universal/generated-types.d.ts +0 -9
  111. package/dist/universal/href.d.ts +0 -17
  112. package/dist/universal/http-method.d.ts +0 -4
  113. package/dist/universal/json-transport.d.ts +0 -14
  114. package/dist/universal/null-prototype-record.d.ts +0 -7
  115. package/dist/universal/path-wire.d.ts +0 -71
  116. package/dist/universal/pattern-language.d.ts +0 -4
  117. package/dist/universal/protocol-schemas.d.ts +0 -99
  118. package/dist/universal/protocol.d.ts +0 -162
  119. package/dist/universal/search-grammar.d.ts +0 -7
  120. package/dist/universal/search-parse.d.ts +0 -22
  121. package/dist/universal/search-serialize.d.ts +0 -16
  122. package/dist/universal/search-shape.d.ts +0 -32
  123. package/dist/universal/static-assets.d.ts +0 -2
  124. package/dist/universal/transport-types/big-decimal.d.ts +0 -13
  125. package/dist/universal/transport-types/chunk.d.ts +0 -8
  126. package/dist/universal/transport-types/date-time-utc.d.ts +0 -13
  127. package/dist/universal/transport-types/date-time-zoned.d.ts +0 -13
  128. package/dist/universal/transport-types/duration.d.ts +0 -13
  129. package/dist/universal/transport-types/hash-map.d.ts +0 -8
  130. package/dist/universal/transport-types/hash-set.d.ts +0 -8
  131. package/dist/universal/transport-types/option.d.ts +0 -10
  132. package/dist/universal/transport-types/redacted.d.ts +0 -9
  133. package/dist/universal/value-transport.d.ts +0 -117
  134. package/dist/value-transport-Bst4Hk-n.js +0 -864
  135. /package/dist/{universal → build}/content-digest.d.ts +0 -0
@@ -1,375 +0,0 @@
1
- import { a as restoreEffectTransportType, p as makeNullPrototypeRecord } from "./value-transport-Bst4Hk-n.js";
2
- import { a as EMPTY_ARRAY_MARKER, c as ESCAPED_KEY_SEPARATOR, d as ESCAPE_PREFIX, f as KEY_SEPARATOR, h as encodeScalar, l as ESCAPED_SCALAR_PREFIX, m as appendKey, o as EMPTY_KEY_SEGMENT, p as NULL_MARKER, s as EMPTY_OBJECT_MARKER, u as ESCAPED_TILDE } from "./href-Cqyax8Y0.js";
3
- import { Result } from "effect";
4
- //#region src/universal/search-parse.ts
5
- const ABSENT = Symbol("absent");
6
- function parseSearchParams(input) {
7
- return Result.map(parseNode({
8
- ...input,
9
- params: indexSearchFields(input.params),
10
- node: input.document,
11
- path: ""
12
- }), (value) => value === ABSENT ? void 0 : value);
13
- }
14
- /** Indexes exact values and immediate encoded child keys once per parse. */
15
- function indexSearchFields(params) {
16
- const values = /* @__PURE__ */ new Map();
17
- const children = /* @__PURE__ */ new Map();
18
- for (const [key, value] of params) {
19
- const existing = values.get(key);
20
- if (existing !== void 0) {
21
- existing.push(value);
22
- continue;
23
- }
24
- values.set(key, [value]);
25
- if (key === "") continue;
26
- let parent = "";
27
- let start = 0;
28
- while (true) {
29
- const separator = key.indexOf(KEY_SEPARATOR, start);
30
- const child = key.slice(start, separator === -1 ? void 0 : separator);
31
- if (parent !== "" || start === 0) {
32
- let names = children.get(parent);
33
- if (names === void 0) {
34
- names = /* @__PURE__ */ new Set();
35
- children.set(parent, names);
36
- }
37
- names.add(child);
38
- }
39
- if (separator === -1) break;
40
- parent = key.slice(0, separator);
41
- start = separator + KEY_SEPARATOR.length;
42
- }
43
- }
44
- return {
45
- values,
46
- children
47
- };
48
- }
49
- function parseNode(input) {
50
- const { node, path, params } = input;
51
- const present = containsKey(path, params);
52
- if (node.optional && !present) return Result.succeed(ABSENT);
53
- if (node.nullable) {
54
- if (!present) return Result.succeed(null);
55
- const exact = params.values.get(path) ?? [];
56
- if (exact.includes(NULL_MARKER)) return exact.length === 1 && !containsChildKey(path, params) ? Result.succeed(null) : failInvalidValue({
57
- path,
58
- expected: "an unambiguous null marker"
59
- });
60
- }
61
- switch (node.kind) {
62
- case "scalar": {
63
- const raw = getOneValue(path, params);
64
- return Result.isFailure(raw) ? raw : parseScalar({
65
- ...input,
66
- node,
67
- raw: raw.success
68
- });
69
- }
70
- case "option":
71
- if (!present) return restoreSearchEffectType({
72
- ...input,
73
- kind: "option",
74
- value: []
75
- });
76
- return Result.flatMap(parseNode({
77
- ...input,
78
- node: node.value
79
- }), (value) => {
80
- return restoreSearchEffectType({
81
- ...input,
82
- kind: "option",
83
- value: [value]
84
- });
85
- });
86
- case "redacted": return Result.flatMap(parseNode({
87
- ...input,
88
- node: node.value
89
- }), (value) => {
90
- return restoreSearchEffectType({
91
- ...input,
92
- kind: "redacted",
93
- value: {
94
- value,
95
- ...node.label === void 0 ? {} : { label: node.label }
96
- }
97
- });
98
- });
99
- case "array": return Result.flatMap(parseArray({
100
- ...input,
101
- node: node.item
102
- }), (values) => {
103
- switch (node.collection) {
104
- case "array": return Result.succeed(values);
105
- case "set": return Result.succeed(new Set(values));
106
- default: return restoreSearchEffectType({
107
- ...input,
108
- kind: node.collection,
109
- value: values
110
- });
111
- }
112
- });
113
- case "record": return Result.flatMap(parseRecord({
114
- ...input,
115
- node
116
- }), (value) => {
117
- switch (node.collection) {
118
- case "record": return Result.succeed(value);
119
- case "map": return Result.succeed(new Map(Object.entries(value)));
120
- case "hash-map": return restoreSearchEffectType({
121
- ...input,
122
- kind: "hash-map",
123
- value: Object.entries(value)
124
- });
125
- }
126
- });
127
- case "object": {
128
- const exact = params.values.get(path) ?? [];
129
- if (exact.length > 0 && (exact.length !== 1 || exact[0] !== EMPTY_OBJECT_MARKER || containsChildKey(path, params))) return failInvalidValue({
130
- path,
131
- expected: "an unambiguous empty-object marker or child fields"
132
- });
133
- const result = makeSearchObject();
134
- for (const [name, child] of Object.entries(node.fields)) {
135
- const value = parseNode({
136
- ...input,
137
- node: child,
138
- path: appendKey({
139
- parent: path,
140
- child: name
141
- })
142
- });
143
- if (Result.isFailure(value)) return value;
144
- if (value.success !== ABSENT) result[name] = value.success;
145
- }
146
- return Result.succeed(result);
147
- }
148
- }
149
- }
150
- function parseArray(input) {
151
- const values = input.params.values.get(input.path) ?? [];
152
- if (values.length === 0 || values.length === 1 && values[0] === EMPTY_ARRAY_MARKER) return Result.succeed([]);
153
- if (values.includes(EMPTY_ARRAY_MARKER)) return failInvalidValue({
154
- path: input.path,
155
- expected: "an array without a mixed empty-array marker"
156
- });
157
- const result = [];
158
- for (const raw of values) {
159
- const value = parseScalar({
160
- ...input,
161
- raw
162
- });
163
- if (Result.isFailure(value)) return Result.fail(value.failure);
164
- result.push(value.success);
165
- }
166
- return Result.succeed(result);
167
- }
168
- function parseRecord(input) {
169
- const { params, path, node } = input;
170
- const exact = params.values.get(path) ?? [];
171
- if (exact.length === 1 && exact[0] === EMPTY_OBJECT_MARKER && !containsChildKey(path, params)) return Result.succeed(makeSearchObject());
172
- if (exact.length > 0) return failInvalidValue({
173
- path,
174
- expected: "an empty-object marker or dotted map entries"
175
- });
176
- const result = makeSearchObject();
177
- for (const encodedKey of params.children.get(path) ?? []) {
178
- if (encodedKey === "") continue;
179
- const decoded = decodeKeySegment({
180
- value: encodedKey,
181
- path
182
- });
183
- if (Result.isFailure(decoded)) return Result.fail(decoded.failure);
184
- const key = parseScalar({
185
- ...input,
186
- node: node.key,
187
- raw: encodeScalar(decoded.success)
188
- });
189
- if (Result.isFailure(key)) return Result.fail(key.failure);
190
- if (typeof key.success !== "string") return failMalformedSchema(path);
191
- const value = parseNode({
192
- ...input,
193
- node: node.value,
194
- path: path === "" ? encodedKey : `${path}${KEY_SEPARATOR}${encodedKey}`
195
- });
196
- if (Result.isFailure(value)) return Result.fail(value.failure);
197
- if (value.success !== ABSENT) result[key.success] = value.success;
198
- }
199
- return Result.succeed(result);
200
- }
201
- function parseScalar(input) {
202
- if (input.raw === NULL_MARKER && input.node.nullable) return Result.succeed(null);
203
- const decoded = decodeScalar({
204
- value: input.raw,
205
- path: input.path
206
- });
207
- if (Result.isFailure(decoded)) return decoded;
208
- const value = decoded.success;
209
- switch (input.node.type) {
210
- case "string": return input.node.values === void 0 || input.node.values.includes(value) ? Result.succeed(value) : failInvalidValue({
211
- path: input.path,
212
- expected: "a declared enum variant"
213
- });
214
- case "boolean": return value === "true" ? Result.succeed(true) : value === "false" ? Result.succeed(false) : failInvalidValue({
215
- path: input.path,
216
- expected: "true or false"
217
- });
218
- case "number": return parseNumber(value, input.path);
219
- case "bigint": return parseBigInt(value, input.path);
220
- default: return parsePlatformScalar({
221
- ...input,
222
- type: input.node.type,
223
- value
224
- });
225
- }
226
- }
227
- function restoreSearchEffectType(input) {
228
- return Result.mapError(restoreEffectTransportType(input), (cause) => {
229
- return {
230
- _tag: "InvalidSearchParam",
231
- path: input.path,
232
- expected: cause.reason
233
- };
234
- });
235
- }
236
- function parsePlatformScalar(input) {
237
- switch (input.type) {
238
- case "date": {
239
- const date = new Date(input.value);
240
- return Number.isNaN(date.getTime()) ? failInvalidValue({
241
- path: input.path,
242
- expected: "an ISO 8601 date"
243
- }) : Result.succeed(date);
244
- }
245
- case "url": return Result.try({
246
- try: () => new URL(input.value),
247
- catch: () => {
248
- return {
249
- _tag: "InvalidSearchParam",
250
- path: input.path,
251
- expected: "an absolute URL"
252
- };
253
- }
254
- });
255
- case "url-search-params": return Result.succeed(new URLSearchParams(input.value));
256
- case "regexp": {
257
- const match = /^\/([^]*)\/([a-z]*)$/.exec(input.value);
258
- if (match === null || match[1] === void 0 || match[2] === void 0) return failInvalidValue({
259
- path: input.path,
260
- expected: "a regular expression as /source/flags"
261
- });
262
- const source = match[1];
263
- const flags = match[2];
264
- return Result.try({
265
- try: () => new RegExp(source, flags),
266
- catch: () => {
267
- return {
268
- _tag: "InvalidSearchParam",
269
- path: input.path,
270
- expected: "a valid regular expression"
271
- };
272
- }
273
- });
274
- }
275
- default: {
276
- const kind = input.type;
277
- return kind === "duration" || kind === "big-decimal" || kind === "date-time-utc" || kind === "date-time-zoned" ? restoreSearchEffectType({
278
- kind,
279
- value: input.value,
280
- path: input.path,
281
- typeEntries: input.typeEntries
282
- }) : failMalformedSchema(input.path);
283
- }
284
- }
285
- }
286
- function parseNumber(value, path) {
287
- if (!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(value)) return failInvalidValue({
288
- path,
289
- expected: "a finite decimal number"
290
- });
291
- const parsed = Number(value);
292
- return Number.isFinite(parsed) ? Result.succeed(parsed === 0 ? 0 : parsed) : failInvalidValue({
293
- path,
294
- expected: "a finite decimal number"
295
- });
296
- }
297
- function parseBigInt(value, path) {
298
- return /^[+-]?\d+$/.test(value) ? Result.succeed(BigInt(value)) : failInvalidValue({
299
- path,
300
- expected: "a base-10 integer"
301
- });
302
- }
303
- function decodeKeySegment(input) {
304
- if (input.value === EMPTY_KEY_SEGMENT) return Result.succeed("");
305
- let out = "";
306
- for (let index = 0; index < input.value.length; index++) {
307
- const character = input.value[index];
308
- if (character !== ESCAPE_PREFIX) {
309
- out += character;
310
- continue;
311
- }
312
- const code = input.value[++index];
313
- if (code === void 0) return failInvalidValue({
314
- path: input.path,
315
- expected: "a well-formed key escape"
316
- });
317
- const escape = `${ESCAPE_PREFIX}${code}`;
318
- if (escape === ESCAPED_TILDE) out += ESCAPE_PREFIX;
319
- else if (escape === ESCAPED_KEY_SEPARATOR) out += KEY_SEPARATOR;
320
- else return failInvalidValue({
321
- path: input.path,
322
- expected: "a well-formed key escape"
323
- });
324
- }
325
- return Result.succeed(out);
326
- }
327
- function decodeScalar(input) {
328
- if (input.value.startsWith(ESCAPED_SCALAR_PREFIX)) {
329
- const escaped = input.value.slice(ESCAPED_SCALAR_PREFIX.length);
330
- return escaped.startsWith(ESCAPE_PREFIX) ? Result.succeed(escaped) : failInvalidValue({
331
- path: input.path,
332
- expected: "a well-formed escaped scalar"
333
- });
334
- }
335
- return input.value.startsWith(ESCAPE_PREFIX) ? failInvalidValue({
336
- path: input.path,
337
- expected: "a scalar, not a reserved marker"
338
- }) : Result.succeed(input.value);
339
- }
340
- function makeSearchObject() {
341
- return makeNullPrototypeRecord();
342
- }
343
- function getOneValue(path, params) {
344
- const values = params.values.get(path);
345
- const only = values?.[0];
346
- if (values === void 0 || only === void 0) return Result.fail({
347
- _tag: "MissingSearchParam",
348
- path
349
- });
350
- return values.length === 1 ? Result.succeed(only) : failInvalidValue({
351
- path,
352
- expected: "exactly one value"
353
- });
354
- }
355
- function containsKey(path, params) {
356
- return params.values.has(path) || containsChildKey(path, params);
357
- }
358
- function containsChildKey(path, params) {
359
- return params.children.has(path);
360
- }
361
- function failMalformedSchema(path) {
362
- return Result.fail({
363
- _tag: "MalformedSearchSchema",
364
- path
365
- });
366
- }
367
- function failInvalidValue(input) {
368
- return Result.fail({
369
- _tag: "InvalidSearchParam",
370
- path: input.path,
371
- expected: input.expected
372
- });
373
- }
374
- //#endregion
375
- export { parseSearchParams as t };
@@ -1,36 +0,0 @@
1
- import { Schema } from "effect";
2
- export declare const VormaConfigSchema: Schema.Struct<{
3
- readonly importMeta: Schema.Struct<{
4
- readonly url: Schema.NonEmptyString;
5
- }>;
6
- readonly serverEntry: Schema.NonEmptyString;
7
- readonly serverTsconfigFile: Schema.NonEmptyString;
8
- readonly clientEntry: Schema.NonEmptyString;
9
- readonly clientTsconfigFile: Schema.NonEmptyString;
10
- readonly publicAssetsDir: Schema.NonEmptyString;
11
- readonly viteConfigFile: Schema.NonEmptyString;
12
- readonly criticalCssEntry: Schema.optionalKey<Schema.NonEmptyString>;
13
- readonly serverExternalPackages: Schema.optionalKey<Schema.$Array<Schema.String>>;
14
- readonly publicAssetsBasePath: Schema.String;
15
- readonly bodySsr: Schema.optionalKey<Schema.Boolean>;
16
- readonly dev: Schema.optionalKey<Schema.Struct<{
17
- readonly revalidateClientOnChange: Schema.optionalKey<Schema.$Array<Schema.String>>;
18
- }>>;
19
- }>;
20
- /**
21
- * Every path is relative to the configuration file's directory.
22
- * `serverTsconfigFile` and `clientTsconfigFile` name the two TypeScript
23
- * projects: the build reads each project's own source files through the
24
- * TypeScript checker, and every export with a registerable declaration value
25
- * is registered. Server compilation leaves `effect` and all its subpaths as
26
- * runtime imports so generated code shares the application's Effect instance.
27
- * Other server dependencies retain ordinary resolution. The build never sets
28
- * Vite's `root`, so the author's `root` applies when set and Vite's own default applies
29
- * otherwise. Vorma owns `_vorma` beside each entry; the
30
- * client output also holds public assets and locks. Body SSR and critical CSS
31
- * are enabled explicitly; omission means off. serverExternalPackages names
32
- * additional packages left as runtime imports. Effect is always external;
33
- * omission means the server build bundles other package dependencies.
34
- */
35
- export type VormaConfig = typeof VormaConfigSchema.Type;
36
- export declare function defineConfig(config: VormaConfig): VormaConfig;
@@ -1,30 +0,0 @@
1
- import { Schema } from "effect";
2
- //#region src/server/config/index.ts
3
- const PACKAGE_NAME = /^(?:@[a-z0-9\-~][a-z0-9\-._~]*\/)?[a-z0-9\-~][a-z0-9\-._~]*$/;
4
- /**
5
- * A bare npm package name, optionally scoped. A subpath, a trailing slash, a
6
- * relative or absolute path and a `node:` specifier all name something other
7
- * than an installed package, so they are not external packages.
8
- */
9
- const ExternalPackageNameSchema = Schema.String.check(Schema.makeFilter((name) => {
10
- return PACKAGE_NAME.test(name) ? void 0 : `externalPackages entries must be bare package names such as "sharp" or "@scope/sharp", got ${JSON.stringify(name)}`;
11
- }));
12
- const VormaConfigSchema = Schema.Struct({
13
- importMeta: Schema.Struct({ url: Schema.NonEmptyString }),
14
- serverEntry: Schema.NonEmptyString,
15
- serverTsconfigFile: Schema.NonEmptyString,
16
- clientEntry: Schema.NonEmptyString,
17
- clientTsconfigFile: Schema.NonEmptyString,
18
- publicAssetsDir: Schema.NonEmptyString,
19
- viteConfigFile: Schema.NonEmptyString,
20
- criticalCssEntry: Schema.optionalKey(Schema.NonEmptyString),
21
- serverExternalPackages: Schema.optionalKey(Schema.Array(ExternalPackageNameSchema)),
22
- publicAssetsBasePath: Schema.String,
23
- bodySsr: Schema.optionalKey(Schema.Boolean),
24
- dev: Schema.optionalKey(Schema.Struct({ revalidateClientOnChange: Schema.optionalKey(Schema.Array(Schema.String)) }))
25
- });
26
- function defineConfig(config) {
27
- return config;
28
- }
29
- //#endregion
30
- export { VormaConfigSchema, defineConfig };
@@ -1,11 +0,0 @@
1
- import { Effect } from "effect";
2
- import type { ProductionMetadata } from "../../universal/protocol.ts";
3
- export type DevelopmentMetadataIssue = {
4
- readonly _tag: "DevelopmentMetadataIssue";
5
- readonly cause: unknown;
6
- };
7
- /** Reads each atomic development publication; unchanged bytes retain the same snapshot. */
8
- export declare function createDevelopmentMetadataReader(input: {
9
- readonly url: URL;
10
- readonly initial: ProductionMetadata;
11
- }): Effect.Effect<ProductionMetadata, DevelopmentMetadataIssue, never>;
@@ -1,37 +0,0 @@
1
- import { Result } from "effect";
2
- export type Attributes = Readonly<Record<string, string | true>>;
3
- /** Head content is escaped text or explicitly trusted HTML, without recursive element children. */
4
- export type Element = {
5
- readonly tag: string;
6
- readonly attributes?: Attributes;
7
- } & ({
8
- readonly textContent?: string;
9
- readonly dangerousInnerHtml?: never;
10
- } | {
11
- readonly textContent?: never;
12
- readonly dangerousInnerHtml: string;
13
- });
14
- export type RenderError = {
15
- readonly _tag: "InvalidTagName";
16
- readonly tag: string;
17
- } | {
18
- readonly _tag: "InvalidAttributeName";
19
- readonly attribute: string;
20
- readonly tag: string;
21
- } | {
22
- readonly _tag: "VoidElementWithContent";
23
- readonly tag: string;
24
- } | {
25
- readonly _tag: "MixedTextAndRawContent";
26
- readonly tag: string;
27
- };
28
- /** Escapes ordinary text once, when producing HTML. */
29
- export declare function escapeText(value: string): string;
30
- /** Escapes a value for a double-quoted HTML attribute. */
31
- export declare function escapeAttributeValue(value: string): string;
32
- /** Escapes serialized JSON for insertion through a script element's dangerousInnerHtml. */
33
- export declare function escapeJsonForScript(serializedJson: string): string;
34
- export declare function renderElementContent(element: Element): Result.Result<string, RenderError>;
35
- /** Serializes one element without interpreting raw code or markup. */
36
- export declare function renderElement(element: Element): Result.Result<string, RenderError>;
37
- export declare function renderElements(elements: ReadonlyArray<Element>): Result.Result<string, RenderError>;
@@ -1,21 +0,0 @@
1
- import { Schema } from "effect";
2
- import { Multipart } from "effect/unstable/http";
3
- /** Native Effect form fields and request-scoped persisted uploads. */
4
- export type FormData = Multipart.Persisted;
5
- declare const FORM_DATA_TRANSPORT: unique symbol;
6
- /** Identifies form transport to the checker without changing native runtime values. */
7
- export interface FormDataEncoded extends Multipart.Persisted {
8
- readonly [FORM_DATA_TRANSPORT]?: true;
9
- }
10
- /** Form inputs decode their encoded record; other transported values use the schema's service-free type side. */
11
- export type FormInputServices<S extends Schema.Top> = typeof FORM_DATA_TRANSPORT extends keyof S["Encoded"] ? S["DecodingServices"] : never;
12
- /** Marks an endpoint's form transport; handlers receive Effect's parsed form record. */
13
- export declare const FormData: Schema.Codec<Multipart.Persisted, FormDataEncoded>;
14
- /**
15
- * Whether an input schema reads the request's form data. `FormData` and
16
- * every schema derived from it, such as `FormData.pipe(Schema.decodeTo(...))`,
17
- * encode to the native form record at the end of their chain, which
18
- * carries this module's identifier.
19
- */
20
- export declare function matchesFormInput(schema: Schema.Top): boolean;
21
- export {};
@@ -1,118 +0,0 @@
1
- import type { CompiledFlatPattern, CompiledNestedPattern, PatternCompileError } from "@vorma/primitives/matcher";
2
- import { type PathWireError } from "../../universal/path-wire.ts";
3
- import type { SearchContractDocument } from "../../universal/protocol-schemas.ts";
4
- import { type DeclaredSchema, type EndpointDeclaration, type HttpMethod, type TaskMiddlewareDeclaration, type UiLoaderDeclaration } from "./declarations.ts";
5
- import { type ConflictingDynamicParameterNameError } from "./pattern-conflicts.ts";
6
- import { type DerivedSearchContract } from "./search-schema.ts";
7
- /** A UI loader's search-parameter contract: the authored codec, the check-free document the URL parser reads, and its top-level fields. */
8
- export type UiSearchContract = DerivedSearchContract & {
9
- readonly schema: DeclaredSchema;
10
- };
11
- export type UiLoaderNode = {
12
- readonly declaration: UiLoaderDeclaration;
13
- readonly registered: CompiledNestedPattern;
14
- /** Null when the loader takes no search parameters. */
15
- readonly search: UiSearchContract | null;
16
- };
17
- export type UiSearchOwner = UiLoaderNode & {
18
- readonly search: UiSearchContract;
19
- };
20
- /** A GET endpoint's search-parameter contract: the authored codec and the check-free document the URL parser reads. */
21
- export type EndpointSearchContract = {
22
- readonly schema: DeclaredSchema;
23
- readonly document: SearchContractDocument;
24
- };
25
- export type EndpointNode = {
26
- readonly declaration: EndpointDeclaration;
27
- readonly registered: CompiledFlatPattern;
28
- /** Null unless the endpoint is a GET with an input schema. */
29
- readonly search: EndpointSearchContract | null;
30
- };
31
- export type MiddlewareNode = {
32
- readonly declaration: TaskMiddlewareDeclaration;
33
- readonly registered: ReadonlyArray<CompiledFlatPattern>;
34
- };
35
- export type DeclarationRole = "uiLoader" | "endpoint" | "middleware";
36
- export type GraphError = {
37
- readonly _tag: "InvalidEndpointMethod";
38
- readonly pattern: string;
39
- readonly method: string;
40
- readonly kind: string;
41
- } | {
42
- readonly _tag: "InvalidPattern";
43
- readonly role: DeclarationRole;
44
- readonly pattern: string;
45
- readonly cause: PatternCompileError | PathWireError;
46
- } | {
47
- readonly _tag: "DuplicateUiLoader";
48
- readonly pattern: string;
49
- } | {
50
- readonly _tag: "DuplicateEndpoint";
51
- readonly method: HttpMethod;
52
- readonly pattern: string;
53
- } | {
54
- readonly _tag: "ConflictingEndpointParameters";
55
- readonly method: HttpMethod;
56
- readonly patterns: ReadonlyArray<string>;
57
- readonly cause: ConflictingDynamicParameterNameError;
58
- } | {
59
- readonly _tag: "ConflictingMiddlewareParameters";
60
- readonly index: number;
61
- readonly patterns: ReadonlyArray<string>;
62
- readonly cause: ConflictingDynamicParameterNameError;
63
- } | {
64
- readonly _tag: "EmptyMiddlewareSelector";
65
- readonly index: number;
66
- readonly field: "patterns" | "methods";
67
- } | {
68
- readonly _tag: "UnsupportedSearchSchema";
69
- readonly role: "uiLoader" | "endpoint";
70
- readonly pattern: string;
71
- readonly path: string;
72
- readonly reason: string;
73
- } | {
74
- readonly _tag: "UntransportableSchema";
75
- readonly role: DeclarationRole;
76
- readonly pattern: string;
77
- readonly field: "input" | "output" | "event" | "errors";
78
- readonly path: string;
79
- readonly reason: string;
80
- } | {
81
- readonly _tag: "InvalidErrorStatus";
82
- readonly role: "endpoint";
83
- readonly pattern: string;
84
- readonly status: number;
85
- } | {
86
- readonly _tag: "ErrorSchemaWithoutLiteralTag";
87
- readonly role: "endpoint";
88
- readonly pattern: string;
89
- readonly index: number;
90
- } | {
91
- readonly _tag: "DuplicateErrorTag";
92
- readonly role: "endpoint";
93
- readonly pattern: string;
94
- readonly tag: string;
95
- } | {
96
- readonly _tag: "FrameworkErrorTagCollision";
97
- readonly role: "endpoint";
98
- readonly pattern: string;
99
- readonly tag: string;
100
- };
101
- export declare function compileUiLoader(declaration: UiLoaderDeclaration, errors: Array<GraphError>): UiLoaderNode | null;
102
- export declare function compileEndpoint(declaration: EndpointDeclaration, errors: Array<GraphError>): EndpointNode | null;
103
- export declare function compileMiddleware(declaration: TaskMiddlewareDeclaration, index: number, errors: Array<GraphError>): MiddlewareNode | null;
104
- /** Groups endpoint nodes by method, preserving declaration order within each method. */
105
- export declare function groupEndpointsByMethod(endpoints: ReadonlyArray<EndpointNode>): ReadonlyMap<HttpMethod, ReadonlyArray<EndpointNode>>;
106
- export declare function checkEndpointPatternRegistrations(endpoints: ReadonlyArray<EndpointNode>, errors: Array<GraphError>): void;
107
- type NestedRouteNode = {
108
- readonly registered: CompiledNestedPattern;
109
- };
110
- /** Materializes each target's registered outer-to-inner route chain in time proportional to route depth. */
111
- export declare function createNestedRouteChains<Node extends NestedRouteNode>(input: {
112
- readonly nodes: ReadonlyArray<Node>;
113
- }): ReadonlyArray<{
114
- readonly target: Node;
115
- readonly chain: ReadonlyArray<Node>;
116
- }>;
117
- export declare function checkDuplicates(uiLoaders: ReadonlyArray<UiLoaderNode>, endpoints: ReadonlyArray<EndpointNode>, errors: Array<GraphError>): void;
118
- export {};