arktype 3.0.0-rc.3 → 3.0.0-rc.5
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/out/_internal/schema/runtime.d.ts +1 -0
- package/out/_internal/schema/shared/errorReaders.d.ts +28 -0
- package/out/_internal/schema/shared/errors.d.ts +1 -17
- package/out/_internal/util/registry.d.ts +1 -1
- package/out/{chunk-GTTUSCSN.js → chunk-223NAMM2.js} +6 -6
- package/out/{chunk-6BXI2HGB.js → chunk-32J3BJIT.js} +2 -2
- package/out/{chunk-JDNRVFDJ.js → chunk-3HYMQFAC.js} +3 -3
- package/out/{chunk-3DJ7WMQY.js → chunk-7H7M4BW2.js} +5 -5
- package/out/{chunk-JY2RW3YZ.js → chunk-7NX6KDC7.js} +3 -3
- package/out/{chunk-RFG7WANT.js → chunk-ADCJNPZW.js} +15 -15
- package/out/{chunk-R4OZUFE4.js → chunk-C6A65WF4.js} +3 -3
- package/out/{chunk-5I22KZGW.js → chunk-CE2YGI4T.js} +1 -1
- package/out/{chunk-FMW3G2HM.js → chunk-CM74IBWA.js} +3 -3
- package/out/{chunk-NA6AKIHO.js → chunk-EYXKZRJM.js} +1 -1
- package/out/{chunk-WJYZSFTR.js → chunk-FEXLREE4.js} +5 -5
- package/out/{chunk-3KBOPH3J.js → chunk-GU3X7OIZ.js} +55 -1
- package/out/{chunk-SUKTVBEL.js → chunk-IVOJVPSS.js} +2 -53
- package/out/{chunk-DDX6RRRC.js → chunk-J6NFH2BS.js} +2 -2
- package/out/{chunk-D4OFGPEY.js → chunk-JX4N7RSQ.js} +3 -3
- package/out/{chunk-HAUTPBFA.js → chunk-LZXHV74B.js} +2 -2
- package/out/{chunk-OORKLVIJ.js → chunk-N4DO6WIB.js} +3 -3
- package/out/{chunk-3DCESM55.js → chunk-NQL4QPUE.js} +8 -3
- package/out/{chunk-372QLHPR.js → chunk-PAP4AM6W.js} +1 -1
- package/out/{chunk-7COZLHTN.js → chunk-SIV4PRW5.js} +3 -3
- package/out/{chunk-LMCZ3U5T.js → chunk-SLIFVOQJ.js} +1 -1
- package/out/{chunk-LD4ERH7O.js → chunk-UHXVY3HO.js} +1 -1
- package/out/{chunk-4RDZ5SOT.js → chunk-UVB5BUJ4.js} +26 -16
- package/out/{chunk-FARGFIEU.js → chunk-UXYJKKHC.js} +2 -2
- package/out/{chunk-IPDD4PDL.js → chunk-VNCC4KXJ.js} +2 -2
- package/out/codecs.js +12 -12
- package/out/config.js +6 -6
- package/out/declare.d.ts +24 -5
- package/out/errors.js +7 -7
- package/out/i18n.js +4 -4
- package/out/index.js +12 -12
- package/out/internal.js +25 -25
- package/out/island.js +13 -13
- package/out/islandDependency.js +26 -26
- package/out/keywords/ts.js +8 -8
- package/out/locales/de.js +5 -5
- package/out/locales/en.js +10 -10
- package/out/mutatesInput.js +9 -9
- package/out/parser/tupleExpressions.d.ts +3 -3
- package/out/precompiled.js +7 -7
- package/out/runtime.d.ts +4 -2
- package/out/runtime.js +1 -1
- package/out/schema.js +7 -7
- package/out/schemaInternal.js +17 -17
- package/out/schemaRuntime.js +2 -2
- package/out/schemaRuntimeLean.js +87 -0
- package/out/schemaRuntimeNone.js +87 -0
- package/out/schemaRuntimeNoneLean.js +87 -0
- package/out/util.js +1 -1
- package/package.json +4 -4
- package/skills/arktype/references/precompile.md +25 -25
- /package/out/{chunk-46PLKNON.js → chunk-BMIVLSDP.js} +0 -0
package/out/schemaRuntimeNone.js
CHANGED
|
@@ -343,6 +343,41 @@ var baseNameOf = (value) => {
|
|
|
343
343
|
};
|
|
344
344
|
var baseNameOfSymbol = (symbol) => symbol.description && isDotAccessible(symbol.description) ? symbol.description : "symbol";
|
|
345
345
|
|
|
346
|
+
// ../util/out/path.js
|
|
347
|
+
var keySuffixes = /* @__PURE__ */ new Map();
|
|
348
|
+
var keySuffixOf = (key) => {
|
|
349
|
+
let suffix = keySuffixes.get(key);
|
|
350
|
+
if (suffix === void 0) {
|
|
351
|
+
suffix = isDotAccessible(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
352
|
+
if (key.length <= 64) {
|
|
353
|
+
if (keySuffixes.size === 1024)
|
|
354
|
+
keySuffixes.clear();
|
|
355
|
+
keySuffixes.set(key, suffix);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return suffix;
|
|
359
|
+
};
|
|
360
|
+
var indexSuffixes = [];
|
|
361
|
+
var appendStringifiedKey = ((path, prop, opts) => {
|
|
362
|
+
switch (typeof prop) {
|
|
363
|
+
case "string": {
|
|
364
|
+
const suffix = keySuffixOf(prop);
|
|
365
|
+
return path === "" && suffix[0] === "." ? prop : path + suffix;
|
|
366
|
+
}
|
|
367
|
+
case "number":
|
|
368
|
+
return path + (prop >>> 0 === prop && prop < 256 ? indexSuffixes[prop] ??= `[${prop}]` : `[${prop}]`);
|
|
369
|
+
case "symbol":
|
|
370
|
+
return `${path}[${(opts?.stringifySymbol ?? String)(prop)}]`;
|
|
371
|
+
}
|
|
372
|
+
return opts?.stringifyNonKey ? `${path}[${opts.stringifyNonKey(prop)}]` : throwParseError(`${typeof prop} must be a PropertyKey or stringifyNonKey must be passed to options`);
|
|
373
|
+
});
|
|
374
|
+
var stringifyPath = ((path, opts) => {
|
|
375
|
+
let s = "";
|
|
376
|
+
for (const k of path)
|
|
377
|
+
s = appendStringifiedKey(s, k, opts);
|
|
378
|
+
return s;
|
|
379
|
+
});
|
|
380
|
+
|
|
346
381
|
// ../schema/out/shared/configured.js
|
|
347
382
|
var isPlain = (value) => {
|
|
348
383
|
const proto = Object.getPrototypeOf(value);
|
|
@@ -422,6 +457,54 @@ var enInfo = /* @__PURE__ */ Object.freeze({
|
|
|
422
457
|
verbatim: (text) => text
|
|
423
458
|
});
|
|
424
459
|
|
|
460
|
+
// ../schema/out/shared/errorReaders.js
|
|
461
|
+
var byPath = (errors) => {
|
|
462
|
+
const result = {};
|
|
463
|
+
for (const error of errors.issues) {
|
|
464
|
+
const k = propStringOf(error);
|
|
465
|
+
if (!hasOwn(result, k))
|
|
466
|
+
defineEntry(result, k, error);
|
|
467
|
+
}
|
|
468
|
+
return result;
|
|
469
|
+
};
|
|
470
|
+
var flatByPath = (errors) => {
|
|
471
|
+
const result = {};
|
|
472
|
+
for (const error of errors.issues)
|
|
473
|
+
addEntry(result, propStringOf(error), error);
|
|
474
|
+
return result;
|
|
475
|
+
};
|
|
476
|
+
var flatMessagesByPath = (errors) => {
|
|
477
|
+
const result = {};
|
|
478
|
+
for (const error of errors.issues)
|
|
479
|
+
addEntry(result, propStringOf(error), error.message);
|
|
480
|
+
return result;
|
|
481
|
+
};
|
|
482
|
+
var byAncestorPath = (errors) => {
|
|
483
|
+
const result = {};
|
|
484
|
+
for (const error of errors.issues) {
|
|
485
|
+
let propString = "";
|
|
486
|
+
addEntry(result, propString, error);
|
|
487
|
+
for (const k of error.path) {
|
|
488
|
+
propString = appendStringifiedKey(propString, k);
|
|
489
|
+
addEntry(result, propString, error);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return result;
|
|
493
|
+
};
|
|
494
|
+
var propStringOf = (error) => error.propString ?? stringifyPath(error.path);
|
|
495
|
+
var addEntry = (result, k, value) => {
|
|
496
|
+
if (hasOwn(result, k))
|
|
497
|
+
result[k].push(value);
|
|
498
|
+
else
|
|
499
|
+
defineEntry(result, k, [value]);
|
|
500
|
+
};
|
|
501
|
+
var defineEntry = (result, k, value) => Object.defineProperty(result, k, {
|
|
502
|
+
value,
|
|
503
|
+
enumerable: true,
|
|
504
|
+
writable: true,
|
|
505
|
+
configurable: true
|
|
506
|
+
});
|
|
507
|
+
|
|
425
508
|
// ../schema/out/runtime.js
|
|
426
509
|
export { appliesValues, discriminatesBooleans, failsInBranches, findsOnRead, holdsExpression, listsUnions, transformsBranches, traversesUnions } from "./shared/issueFeatures.js";
|
|
427
510
|
|
|
@@ -1679,6 +1762,8 @@ export {
|
|
|
1679
1762
|
applyResolution,
|
|
1680
1763
|
applyValue,
|
|
1681
1764
|
arrayIndexMatcher,
|
|
1765
|
+
byAncestorPath,
|
|
1766
|
+
byPath,
|
|
1682
1767
|
callMorph,
|
|
1683
1768
|
codedIssue,
|
|
1684
1769
|
computeDefaultValueMorph,
|
|
@@ -1707,6 +1792,8 @@ export {
|
|
|
1707
1792
|
fingerprintOf,
|
|
1708
1793
|
fixConfig,
|
|
1709
1794
|
fixConfigured,
|
|
1795
|
+
flatByPath,
|
|
1796
|
+
flatMessagesByPath,
|
|
1710
1797
|
foundErrors,
|
|
1711
1798
|
holdsOnlyIndices,
|
|
1712
1799
|
inContext,
|
|
@@ -342,6 +342,41 @@ var baseNameOf = (value) => {
|
|
|
342
342
|
};
|
|
343
343
|
var baseNameOfSymbol = (symbol) => symbol.description && isDotAccessible(symbol.description) ? symbol.description : "symbol";
|
|
344
344
|
|
|
345
|
+
// ../util/out/path.js
|
|
346
|
+
var keySuffixes = /* @__PURE__ */ new Map();
|
|
347
|
+
var keySuffixOf = (key) => {
|
|
348
|
+
let suffix = keySuffixes.get(key);
|
|
349
|
+
if (suffix === void 0) {
|
|
350
|
+
suffix = isDotAccessible(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
|
|
351
|
+
if (key.length <= 64) {
|
|
352
|
+
if (keySuffixes.size === 1024)
|
|
353
|
+
keySuffixes.clear();
|
|
354
|
+
keySuffixes.set(key, suffix);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return suffix;
|
|
358
|
+
};
|
|
359
|
+
var indexSuffixes = [];
|
|
360
|
+
var appendStringifiedKey = ((path, prop, opts) => {
|
|
361
|
+
switch (typeof prop) {
|
|
362
|
+
case "string": {
|
|
363
|
+
const suffix = keySuffixOf(prop);
|
|
364
|
+
return path === "" && suffix[0] === "." ? prop : path + suffix;
|
|
365
|
+
}
|
|
366
|
+
case "number":
|
|
367
|
+
return path + (prop >>> 0 === prop && prop < 256 ? indexSuffixes[prop] ??= `[${prop}]` : `[${prop}]`);
|
|
368
|
+
case "symbol":
|
|
369
|
+
return `${path}[${(opts?.stringifySymbol ?? String)(prop)}]`;
|
|
370
|
+
}
|
|
371
|
+
return opts?.stringifyNonKey ? `${path}[${opts.stringifyNonKey(prop)}]` : throwParseError(`${typeof prop} must be a PropertyKey or stringifyNonKey must be passed to options`);
|
|
372
|
+
});
|
|
373
|
+
var stringifyPath = ((path, opts) => {
|
|
374
|
+
let s = "";
|
|
375
|
+
for (const k of path)
|
|
376
|
+
s = appendStringifiedKey(s, k, opts);
|
|
377
|
+
return s;
|
|
378
|
+
});
|
|
379
|
+
|
|
345
380
|
// ../schema/out/shared/configured.js
|
|
346
381
|
var isPlain = (value) => {
|
|
347
382
|
const proto = Object.getPrototypeOf(value);
|
|
@@ -421,6 +456,54 @@ var enInfo = /* @__PURE__ */ Object.freeze({
|
|
|
421
456
|
verbatim: (text) => text
|
|
422
457
|
});
|
|
423
458
|
|
|
459
|
+
// ../schema/out/shared/errorReaders.js
|
|
460
|
+
var byPath = (errors) => {
|
|
461
|
+
const result = {};
|
|
462
|
+
for (const error of errors.issues) {
|
|
463
|
+
const k = propStringOf(error);
|
|
464
|
+
if (!hasOwn(result, k))
|
|
465
|
+
defineEntry(result, k, error);
|
|
466
|
+
}
|
|
467
|
+
return result;
|
|
468
|
+
};
|
|
469
|
+
var flatByPath = (errors) => {
|
|
470
|
+
const result = {};
|
|
471
|
+
for (const error of errors.issues)
|
|
472
|
+
addEntry(result, propStringOf(error), error);
|
|
473
|
+
return result;
|
|
474
|
+
};
|
|
475
|
+
var flatMessagesByPath = (errors) => {
|
|
476
|
+
const result = {};
|
|
477
|
+
for (const error of errors.issues)
|
|
478
|
+
addEntry(result, propStringOf(error), error.message);
|
|
479
|
+
return result;
|
|
480
|
+
};
|
|
481
|
+
var byAncestorPath = (errors) => {
|
|
482
|
+
const result = {};
|
|
483
|
+
for (const error of errors.issues) {
|
|
484
|
+
let propString = "";
|
|
485
|
+
addEntry(result, propString, error);
|
|
486
|
+
for (const k of error.path) {
|
|
487
|
+
propString = appendStringifiedKey(propString, k);
|
|
488
|
+
addEntry(result, propString, error);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
return result;
|
|
492
|
+
};
|
|
493
|
+
var propStringOf = (error) => error.propString ?? stringifyPath(error.path);
|
|
494
|
+
var addEntry = (result, k, value) => {
|
|
495
|
+
if (hasOwn(result, k))
|
|
496
|
+
result[k].push(value);
|
|
497
|
+
else
|
|
498
|
+
defineEntry(result, k, [value]);
|
|
499
|
+
};
|
|
500
|
+
var defineEntry = (result, k, value) => Object.defineProperty(result, k, {
|
|
501
|
+
value,
|
|
502
|
+
enumerable: true,
|
|
503
|
+
writable: true,
|
|
504
|
+
configurable: true
|
|
505
|
+
});
|
|
506
|
+
|
|
424
507
|
// ../schema/out/runtime.js
|
|
425
508
|
export { appliesValues, discriminatesBooleans, failsInBranches, findsOnRead, holdsExpression, listsUnions, transformsBranches, traversesUnions } from "./shared/issueFeatures.js";
|
|
426
509
|
|
|
@@ -1672,6 +1755,8 @@ export {
|
|
|
1672
1755
|
applyResolution,
|
|
1673
1756
|
applyValue,
|
|
1674
1757
|
arrayIndexMatcher,
|
|
1758
|
+
byAncestorPath,
|
|
1759
|
+
byPath,
|
|
1675
1760
|
callMorph,
|
|
1676
1761
|
codedIssue,
|
|
1677
1762
|
computeDefaultValueMorph,
|
|
@@ -1700,6 +1785,8 @@ export {
|
|
|
1700
1785
|
fingerprintOf,
|
|
1701
1786
|
fixConfig,
|
|
1702
1787
|
fixConfigured,
|
|
1788
|
+
flatByPath,
|
|
1789
|
+
flatMessagesByPath,
|
|
1703
1790
|
foundErrors,
|
|
1704
1791
|
holdsOnlyIndices,
|
|
1705
1792
|
inContext,
|
package/out/util.js
CHANGED
|
@@ -3,7 +3,7 @@ export { Hkt, Scanner, writeUnclosedGroupMessage, writeUnmatchedGroupCloseMessag
|
|
|
3
3
|
export { WeakCache, defineLazily, holdsWeakly, lazily } from "./chunk-UJJGG4VQ.js";
|
|
4
4
|
export { ipv4Matcher, ipv6Matcher, isIpv4, isIpv6, isIso8601, isUuid, iso8601Matcher, uuidMatcher } from "./chunk-US6BWOGJ.js";
|
|
5
5
|
export { Backslash, alphabet, anchoredSource, capitalize, deanchoredRegex, deanchoredSource, editsBetween, emojiToUnicode, hashOf, uncapitalize, whitespaceChars } from "./chunk-TACLEIDM.js";
|
|
6
|
-
export { arkUtilVersion, initialRegistryContents, nameOf, register, registeredNameOf, registry } from "./chunk-
|
|
6
|
+
export { arkUtilVersion, initialRegistryContents, nameOf, register, registeredNameOf, registry } from "./chunk-SLIFVOQJ.js";
|
|
7
7
|
export { isolate, listPattern } from "./chunk-3SH2BQ4T.js";
|
|
8
8
|
import { NoopBase, ancestorsOf, defineProperties, getBuiltinNameOfConstructor, hasDomain, includes, isArray, noSuggest, timeOf } from "./chunk-3HZC67MT.js";
|
|
9
9
|
export { Callable, CastableBase, DynamicBase, DynamicFunction, FileConstructor, InnerDynamicBase, InternalArktypeError, ParseError, ZeroWidthSpace, append, appendStringifiedKey, appendUnique, arityOf, arkKind, arkKindOf, arrayEquals, baseNameOf, builtinConstructors, cached, conflatenate, conflatenateAll, constructorExtends, constructorNameOf, dateGetTime, defineValue, describeCollapsibleDate, domainDescriptions, domainOf, ecmascriptConstructors, ecmascriptDescriptions, entriesOf, enumValues, envHasCsp, expressionOf, flatMorph, fromEntries, functionNameOf, getDuplicatesOf, getPath, groupBy, hasDefinedKey, hasKey, hasObjectKind, hasOwn, integerLikeMatcher, intersectUniqueLists, invert, isDate, isDateObject, isDigitCode, isDotAccessible, isEmptyObject, isInstanceOf, isKeyOf, isNumericString, isPlainObjectOrArray, isRegExpObject, isStandardSchema, isThunk, isValidDate, isWellFormedInteger, isWellFormedNumber, join, jsTypeOfDescriptions, keysOf, liftArray, nearestFloat, nonFiniteNumbers, numberLikeMatcher, numericStringMatcher, objectKindDescriptions, objectKindOf, objectKindOrDomainOf, omit, ownEntriesOf, pathAt, pick, platformConstructors, platformDescriptions, print, printDecimal, printKind, printSymbol, printable, prototypeOf, range, readsOnlyData, returnsReports, serializePrimitive, snapshot, splitByKeys, spliterate, stringAndSymbolicEntriesOf, stringifyPath, testsOrRejects, throwError, throwInternalError, throwParseError, toJsonMethodOf, tryCatch, tryParseDate, tryParseInteger, tryParseNumber, tryParseWellFormedBigint, tryParseWellFormedNumber, typedArrayConstructors, typedArrayDescriptions, unset, wellFormedIntegerMatcher, wellFormedNumberMatcher, withAlphabetizedKeys, writeInvalidDateMessage, writeMalformedNumericLiteralMessage } from "./chunk-3HZC67MT.js";
|
package/package.json
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"json-schema",
|
|
16
16
|
"precompile"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.0.0-rc.
|
|
19
|
-
"arkAotVersion": "3.0.0-rc.
|
|
18
|
+
"version": "3.0.0-rc.5",
|
|
19
|
+
"arkAotVersion": "3.0.0-rc.5",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://arktype.io",
|
|
22
22
|
"repository": {
|
|
@@ -361,9 +361,9 @@
|
|
|
361
361
|
],
|
|
362
362
|
"devDependencies": {
|
|
363
363
|
"zod": "4.6.7",
|
|
364
|
-
"@ark/util": "3.0.0-rc.
|
|
364
|
+
"@ark/util": "3.0.0-rc.5",
|
|
365
365
|
"@ark/schema": "0.57.0-beta.1",
|
|
366
|
-
"arkregex": "0.0.16-rc.
|
|
366
|
+
"arkregex": "0.0.16-rc.5",
|
|
367
367
|
"arksets": "0.0.1-beta.1"
|
|
368
368
|
},
|
|
369
369
|
"publishConfig": {
|
|
@@ -144,7 +144,7 @@ Composing inside a definition is fine anywhere, even in a function body: `const
|
|
|
144
144
|
## What changes at runtime
|
|
145
145
|
|
|
146
146
|
- A validator validates, `.assert()`s and is a Standard Schema, but has no `.and`, `.or`, `.pick` or other composing method. The build fails where it sees one called outside a definition.
|
|
147
|
-
- Each error in `out.issues` has only `code`, `path`, `data`, `expected` and `message
|
|
147
|
+
- Each error in `out.issues` has only `code`, `path`, `data`, `expected` and `message`. `byPath`, `flatByPath`, `flatMessagesByPath` and `byAncestorPath` from `arktype` read them as they read arktype's, but `arktype/runtime` doesn't export `messageIn`: read `issue.message`, which is English.
|
|
148
148
|
- Error messages are arktype's: an issue's `message` says what failed, without its path or what the value was, like `must be an email address`, and `out.summary` writes the path before it, like `email must be an email address`. A missing key reads `name must be a string (was missing)`. Text configured with `.configure({ message })` or `.describe()` is kept, as is a `required` message configured in the config module, whose function receives `propString` and `valueMeta` as in arktype.
|
|
149
149
|
- The build works out which introspection members, like `toJsonSchema()`, `json` and `~standard.jsonSchema`, each validator needs, baking each where it sees code read it, following it into its dependencies and, in a build reading one module at a time, into each module importing it. So the MCP SDK, the AI SDK, Elysia's OpenAPI plugin, hono-openapi and oRPC's `@orpc/arktype` converter need nothing set, and setting one under `members` only overrides what the build works out. Where the build loses track of a validator, like one passed to a function it can't resolve, it bakes each into it and a production build warns `precompile: baking each introspection member into ...`; the build is correct, only larger. Code the build can't see, like code outside the bundle reading an entry's export, reads a member it didn't bake and throws, naming the member to set true under `members`. A production build decides `assert`, `meta`, `~standard` and `methods` the same way, keeping in each validator what the code it reaches reads, like `~standard` for Hono's `sValidator`, with nothing to set. tRPC, Hono's validators, React Hook Form, TanStack Form and Router and t3-env need nothing.
|
|
150
150
|
- `drizzle-arktype` creates Types from your tables as the program runs, so it runs on arktype, as the next item sets, which ships the parser. To precompile those Types instead, write each one out with a line that fails to compile if it drifts from the table, like `const matches: Equals<typeof selectTask.infer, typeof tasks.$inferSelect> = true`, with `Equals` from migrating.md's How to convert.
|
|
@@ -157,30 +157,30 @@ Composing inside a definition is fine anywhere, even in a function body: `const
|
|
|
157
157
|
|
|
158
158
|
Each build error names the file, line and column, then why, then the fix on its last line. Apply that fix. A bundler stops at the first error, so run `npx @ark/aot --check src` to see them all. Don't set `allowUnsafe` to get past one, and don't switch to `runtime: "arktype"` unless the program really composes or introspects Types at runtime, as that ships arktype's parser again.
|
|
159
159
|
|
|
160
|
-
| The build says
|
|
161
|
-
|
|
|
162
|
-
| `` `limit` is a parameter of makeField ...; its value is known only at runtime ``
|
|
163
|
-
| `` `shape` is a parameter of createFinalSchema ..., which nothing calls by name; ... ``
|
|
164
|
-
| `T.or reads or, which a standalone validator lacks`
|
|
165
|
-
| `` `text` (...) is not a static helper: it runs `if (...)` ... ``
|
|
166
|
-
| `` `text` is read outside a call the build precompiles ``
|
|
167
|
-
| `... exports text, a helper the build precompiles at each call, but ... imports it`
|
|
168
|
-
| `` `shape` is written at ..., so its value at the site is not known ``
|
|
169
|
-
| `User.description reads description, which a standalone validator lacks`
|
|
170
|
-
| `T.default(x) can't be precompiled yet`, `.default() gives the definition of an object's key`
|
|
171
|
-
| `
|
|
172
|
-
| `configure() is called, but the build has no config module`
|
|
173
|
-
| `... loads src/schemas.ts, which creates a Type, before the config module ... runs`
|
|
174
|
-
| `` `User` comes from `~/schemas`, which the build can't resolve ``
|
|
175
|
-
| `arktype resolves to more than one copy`, or a version mismatch
|
|
176
|
-
| `my-lib imports arktype, which a standalone build resolves to arktype/runtime`
|
|
177
|
-
| `src/Form.svelte imports arktype, which a standalone build resolves to arktype/runtime`
|
|
178
|
-
| `precompile.esbuild() needs bundle: true`
|
|
179
|
-
| `Next.js leaves the pages router's dependencies external on the server ...`
|
|
180
|
-
| `The bundle leaves my-lib, which imports arktype ...`
|
|
181
|
-
| `The build's serverExternalPackages option leaves my-lib ...` (Turbopack)
|
|
182
|
-
| `arktype resolves to ... rather than arktype/runtime` (Turbopack)
|
|
183
|
-
| `type is not a function` at runtime
|
|
160
|
+
| The build says | Fix |
|
|
161
|
+
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
162
|
+
| `` `limit` is a parameter of makeField ...; its value is known only at runtime `` | call the helper where that value is known, with it; see the table above |
|
|
163
|
+
| `` `shape` is a parameter of createFinalSchema ..., which nothing calls by name; ... `` | mark the definition `// @ark-runtime`: only arktype sees what the caller, like a library, passes it |
|
|
164
|
+
| `T.or reads or, which a standalone validator lacks` | compose inside a definition, make the helper one expression, or consts and one `return`, or make it a Generic |
|
|
165
|
+
| `` `text` (...) is not a static helper: it runs `if (...)` ... `` | rewrite the helper's body as one expression, or consts and one `return` |
|
|
166
|
+
| `` `text` is read outside a call the build precompiles `` | call the helper directly, with arguments the build can read |
|
|
167
|
+
| `... exports text, a helper the build precompiles at each call, but ... imports it` | call the helper in a `.ts` or `.js` module and import what it returns |
|
|
168
|
+
| `` `shape` is written at ..., so its value at the site is not known `` | write the object whole in its literal, or define each variant as its own Type |
|
|
169
|
+
| `User.description reads description, which a standalone validator lacks` | read it inside a definition, or set that member under `members` |
|
|
170
|
+
| `T.default(x) can't be precompiled yet`, `.default() gives the definition of an object's key` | write `.default(x)` at the object key it's for, not in a `const`, as the message shows |
|
|
171
|
+
| `messageIn(issue, locale) calls messageIn, which arktype/runtime doesn't export` | read `issue.message`, which a standalone validator writes in English |
|
|
172
|
+
| `configure() is called, but the build has no config module` | add `"config"` to `ark.json`, as above |
|
|
173
|
+
| `... loads src/schemas.ts, which creates a Type, before the config module ... runs` | import the config module first in that file, before any module that creates a Type |
|
|
174
|
+
| `` `User` comes from `~/schemas`, which the build can't resolve `` | add the alias to `tsconfig.json`'s `paths` |
|
|
175
|
+
| `arktype resolves to more than one copy`, or a version mismatch | install one version of `arktype`, then clear the bundler's cache |
|
|
176
|
+
| `my-lib imports arktype, which a standalone build resolves to arktype/runtime` | set `"precompile": { "dependencies": { "my-lib": "aot" } }`, or `"arktype"` in place of `"aot"` if it creates Types from runtime values |
|
|
177
|
+
| `src/Form.svelte imports arktype, which a standalone build resolves to arktype/runtime` | move the Types, and any code reading `type`, into a `.ts` module the component imports; don't set `allowUnsafe` |
|
|
178
|
+
| `precompile.esbuild() needs bundle: true` | set `bundle: true` |
|
|
179
|
+
| `Next.js leaves the pages router's dependencies external on the server ...` | add `bundlePagesRouterDependencies: true` to the Next config |
|
|
180
|
+
| `The bundle leaves my-lib, which imports arktype ...` | add the package to `ssr.noExternal` (Vite on a server), or bundle it |
|
|
181
|
+
| `The build's serverExternalPackages option leaves my-lib ...` (Turbopack) | remove the package from `serverExternalPackages` |
|
|
182
|
+
| `arktype resolves to ... rather than arktype/runtime` (Turbopack) | add the `resolveAlias` entries it lists |
|
|
183
|
+
| `type is not a function` at runtime | a module defining Types wasn't precompiled, e.g. no Turbopack rule matches its extension; add one |
|
|
184
184
|
|
|
185
185
|
Three messages concern `members`:
|
|
186
186
|
|
|
File without changes
|