arktype 3.0.0-beta.1 → 3.0.0-rc.0
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/README.md +48 -144
- package/out/_internal/regex/charset.d.ts +24 -0
- package/out/_internal/regex/escape.d.ts +29 -0
- package/out/_internal/regex/execArray.d.ts +24 -0
- package/out/_internal/regex/group.d.ts +34 -0
- package/out/_internal/regex/index.d.ts +2 -0
- package/out/_internal/regex/internal.d.ts +9 -0
- package/out/_internal/regex/parse.d.ts +10 -0
- package/out/_internal/regex/quantify.d.ts +59 -0
- package/out/_internal/regex/regex.d.ts +38 -0
- package/out/_internal/regex/state.d.ts +383 -0
- package/out/_internal/schema/codecs.d.ts +2 -0
- package/out/_internal/schema/config.d.ts +103 -0
- package/out/_internal/schema/constraint.d.ts +78 -0
- package/out/_internal/schema/errors.d.ts +1 -0
- package/out/_internal/schema/generic.d.ts +85 -0
- package/out/_internal/schema/i18n.d.ts +3 -0
- package/out/_internal/schema/index.d.ts +54 -0
- package/out/_internal/schema/internal.d.ts +15 -0
- package/out/_internal/schema/intrinsic.d.ts +28 -0
- package/out/_internal/schema/kinds.d.ts +76 -0
- package/out/_internal/schema/module.d.ts +23 -0
- package/out/_internal/schema/mutatesInput.d.ts +2 -0
- package/out/_internal/schema/node.d.ts +349 -0
- package/out/_internal/schema/parse.d.ts +77 -0
- package/out/_internal/schema/parseSchema.d.ts +116 -0
- package/out/_internal/schema/predicate.d.ts +46 -0
- package/out/_internal/schema/refinements/after.d.ts +32 -0
- package/out/_internal/schema/refinements/before.d.ts +32 -0
- package/out/_internal/schema/refinements/divisor.d.ts +41 -0
- package/out/_internal/schema/refinements/exactLength.d.ts +43 -0
- package/out/_internal/schema/refinements/kinds.d.ts +40 -0
- package/out/_internal/schema/refinements/max.d.ts +33 -0
- package/out/_internal/schema/refinements/maxLength.d.ts +32 -0
- package/out/_internal/schema/refinements/min.d.ts +33 -0
- package/out/_internal/schema/refinements/minLength.d.ts +32 -0
- package/out/_internal/schema/refinements/notEqual.d.ts +38 -0
- package/out/_internal/schema/refinements/notEqualLength.d.ts +38 -0
- package/out/_internal/schema/refinements/pattern.d.ts +43 -0
- package/out/_internal/schema/refinements/range.d.ts +101 -0
- package/out/_internal/schema/roots/alias.d.ts +49 -0
- package/out/_internal/schema/roots/basis.d.ts +12 -0
- package/out/_internal/schema/roots/domain.d.ts +45 -0
- package/out/_internal/schema/roots/intersection.d.ts +72 -0
- package/out/_internal/schema/roots/morph.d.ts +59 -0
- package/out/_internal/schema/roots/proto.d.ts +42 -0
- package/out/_internal/schema/roots/root.d.ts +163 -0
- package/out/_internal/schema/roots/union.d.ts +146 -0
- package/out/_internal/schema/roots/unit.d.ts +36 -0
- package/out/_internal/schema/runtime.d.ts +29 -0
- package/out/_internal/schema/runtimeLean.d.ts +2 -0
- package/out/_internal/schema/runtimeNone.d.ts +2 -0
- package/out/_internal/schema/runtimeNoneLean.d.ts +2 -0
- package/out/_internal/schema/scope.d.ts +203 -0
- package/out/_internal/schema/shared/codecs.d.ts +5 -0
- package/out/_internal/schema/shared/compile.d.ts +144 -0
- package/out/_internal/schema/shared/configured.d.ts +14 -0
- package/out/_internal/schema/shared/declare.d.ts +100 -0
- package/out/_internal/schema/shared/disjoint.d.ts +45 -0
- package/out/_internal/schema/shared/enWriters.d.ts +30 -0
- package/out/_internal/schema/shared/errorModes.d.ts +25 -0
- package/out/_internal/schema/shared/errorWriters.d.ts +34 -0
- package/out/_internal/schema/shared/errors.d.ts +264 -0
- package/out/_internal/schema/shared/implement.d.ts +154 -0
- package/out/_internal/schema/shared/inPlace.d.ts +8 -0
- package/out/_internal/schema/shared/issueFeatures.d.ts +38 -0
- package/out/_internal/schema/shared/issues.d.ts +261 -0
- package/out/_internal/schema/shared/issuesLean.d.ts +80 -0
- package/out/_internal/schema/shared/issuesNone.d.ts +22 -0
- package/out/_internal/schema/shared/issuesNoneLean.d.ts +20 -0
- package/out/_internal/schema/shared/issuesUndetailed.d.ts +25 -0
- package/out/_internal/schema/shared/jsonSchema.d.ts +153 -0
- package/out/_internal/schema/shared/listed.d.ts +15 -0
- package/out/_internal/schema/shared/locale.d.ts +149 -0
- package/out/_internal/schema/shared/registry.d.ts +16 -0
- package/out/_internal/schema/shared/render.d.ts +3 -0
- package/out/_internal/schema/shared/rootApply.d.ts +19 -0
- package/out/_internal/schema/shared/sets.d.ts +26 -0
- package/out/_internal/schema/shared/standardFailure.d.ts +22 -0
- package/out/_internal/schema/shared/standardSchema.d.ts +124 -0
- package/out/_internal/schema/shared/toJsonSchema.d.ts +229 -0
- package/out/_internal/schema/shared/transform.d.ts +35 -0
- package/out/_internal/schema/shared/traversal.d.ts +288 -0
- package/out/_internal/schema/shared/utils.d.ts +59 -0
- package/out/_internal/schema/structure/index.d.ts +43 -0
- package/out/_internal/schema/structure/optional.d.ts +61 -0
- package/out/_internal/schema/structure/prop.d.ts +45 -0
- package/out/_internal/schema/structure/required.d.ts +49 -0
- package/out/_internal/schema/structure/sequence.d.ts +127 -0
- package/out/_internal/schema/structure/shared.d.ts +3 -0
- package/out/_internal/schema/structure/structure.d.ts +178 -0
- package/out/_internal/schema/units.d.ts +123 -0
- package/out/_internal/sets/algebra.d.ts +26 -0
- package/out/_internal/sets/constraint.d.ts +19 -0
- package/out/_internal/sets/engine.d.ts +2 -0
- package/out/_internal/sets/formats.d.ts +23 -0
- package/out/_internal/sets/fromJsonSchema.d.ts +15 -0
- package/out/_internal/sets/implement.d.ts +16 -0
- package/out/_internal/sets/index.d.ts +2 -0
- package/out/_internal/sets/internal.d.ts +20 -0
- package/out/_internal/sets/intersections.d.ts +5 -0
- package/out/_internal/sets/kinds.d.ts +3 -0
- package/out/_internal/sets/refinements.d.ts +14 -0
- package/out/_internal/sets/roots/alias.d.ts +3 -0
- package/out/_internal/sets/roots/domain.d.ts +3 -0
- package/out/_internal/sets/roots/intersection.d.ts +4 -0
- package/out/_internal/sets/roots/morph.d.ts +4 -0
- package/out/_internal/sets/roots/proto.d.ts +3 -0
- package/out/_internal/sets/roots/union.d.ts +16 -0
- package/out/_internal/sets/roots/unit.d.ts +3 -0
- package/out/_internal/sets/structure/index.d.ts +3 -0
- package/out/_internal/sets/structure/prop.d.ts +8 -0
- package/out/_internal/sets/structure/sequence.d.ts +3 -0
- package/out/_internal/sets/structure/structure.d.ts +3 -0
- package/out/_internal/sets/toJsonSchema.d.ts +25 -0
- package/out/_internal/util/arrays.d.ts +130 -0
- package/out/_internal/util/clone.d.ts +4 -0
- package/out/_internal/util/describe.d.ts +25 -0
- package/out/_internal/util/domain.d.ts +49 -0
- package/out/_internal/util/errors.d.ts +29 -0
- package/out/_internal/util/facts.d.ts +22 -0
- package/out/_internal/util/flatMorph.d.ts +41 -0
- package/out/_internal/util/formats.d.ts +8 -0
- package/out/_internal/util/functions.d.ts +33 -0
- package/out/_internal/util/generics.d.ts +65 -0
- package/out/_internal/util/get.d.ts +9 -0
- package/out/_internal/util/hkt.d.ts +27 -0
- package/out/_internal/util/i18n.d.ts +12 -0
- package/out/_internal/util/index.d.ts +28 -0
- package/out/_internal/util/internal.d.ts +2 -0
- package/out/_internal/util/intersections.d.ts +50 -0
- package/out/_internal/util/isomorphic.d.ts +8 -0
- package/out/_internal/util/keys.d.ts +18 -0
- package/out/_internal/util/lazily.d.ts +7 -0
- package/out/_internal/util/numbers.d.ts +82 -0
- package/out/_internal/util/objectKinds.d.ts +157 -0
- package/out/_internal/util/path.d.ts +16 -0
- package/out/_internal/util/primitive.d.ts +16 -0
- package/out/_internal/util/records.d.ts +173 -0
- package/out/_internal/util/registry.d.ts +13 -0
- package/out/_internal/util/scanner.d.ts +110 -0
- package/out/_internal/util/serialize.d.ts +40 -0
- package/out/_internal/util/strings.d.ts +35 -0
- package/out/_internal/util/traits.d.ts +89 -0
- package/out/_internal/util/unionToTuple.d.ts +14 -0
- package/out/_internal/util/weak.d.ts +8 -0
- package/out/attributes.d.ts +15 -11
- package/out/checkers.d.ts +1 -1
- package/out/chunk-22RQSVV3.js +0 -0
- package/out/chunk-3HZC67MT.js +965 -0
- package/out/chunk-3KBOPH3J.js +1564 -0
- package/out/chunk-3SH2BQ4T.js +15 -0
- package/out/chunk-46PLKNON.js +126 -0
- package/out/{chunk-G45P2CLE.js → chunk-4FTHWK63.js} +6 -1
- package/out/{chunk-UK5UGFOX.js → chunk-4HREHNIV.js} +23 -11
- package/out/chunk-4NZCLVBD.js +14 -0
- package/out/chunk-6FMBO47M.js +7 -0
- package/out/chunk-7TALAWYX.js +10 -0
- package/out/{chunk-DLWCO4RV.js → chunk-BCYKO54Z.js} +11 -2
- package/out/chunk-BDJVONP7.js +168 -0
- package/out/{chunk-E3DZXEZK.js → chunk-C2JOL5M2.js} +4 -2
- package/out/{chunk-2U2AWCI3.js → chunk-C2V6QPE3.js} +126 -97
- package/out/chunk-C3B4IFQL.js +6408 -0
- package/out/chunk-CWSF57VM.js +10 -0
- package/out/chunk-F5BACUJS.js +7 -0
- package/out/{chunk-EVCML554.js → chunk-FWRSDUJ2.js} +14 -5
- package/out/chunk-GID3FSQA.js +161 -0
- package/out/chunk-I2KLQ2HA.js +22 -0
- package/out/chunk-K7SLP5D2.js +84 -0
- package/out/chunk-KQPSKGUI.js +9 -0
- package/out/chunk-KXOC3JEX.js +8234 -0
- package/out/chunk-KXOSUYRA.js +405 -0
- package/out/chunk-LHNEY6QW.js +0 -0
- package/out/chunk-MTWKGAGO.js +323 -0
- package/out/chunk-NU73GNCX.js +170 -0
- package/out/{chunk-RAZ3TXOE.js → chunk-P5W67FQH.js} +34 -19
- package/out/chunk-PDLTEX6Z.js +1118 -0
- package/out/{chunk-VV6YDN2D.js → chunk-QUS4IAXJ.js} +304 -263
- package/out/chunk-R7WXIH5P.js +94 -0
- package/out/chunk-TACLEIDM.js +95 -0
- package/out/chunk-UJJGG4VQ.js +71 -0
- package/out/chunk-US6BWOGJ.js +109 -0
- package/out/chunk-VMMMOO4R.js +945 -0
- package/out/chunk-VYMXHSFR.js +439 -0
- package/out/chunk-W2XOI5DY.js +141 -0
- package/out/chunk-WC5L5YRP.js +25 -0
- package/out/{chunk-NRIGTMPM.js → chunk-WKOSL2G6.js} +4 -1
- package/out/chunk-XLG66ZDF.js +0 -0
- package/out/{chunk-5U2ZMDNI.js → chunk-XNUAQSJ4.js} +52 -30
- package/out/chunk-ZRYEHGSG.js +79 -0
- package/out/cli.d.ts +28 -0
- package/out/cli.js +636 -0
- package/out/codecs.d.ts +6 -5
- package/out/codecs.js +23 -7
- package/out/config.d.ts +5 -17
- package/out/config.js +11 -2
- package/out/declare.d.ts +40 -12
- package/out/deferred.d.ts +2 -2
- package/out/errors.d.ts +1 -1
- package/out/errors.js +10 -2
- package/out/fn.d.ts +20 -13
- package/out/fromJsonSchema.d.ts +18 -0
- package/out/generic.d.ts +9 -6
- package/out/i18n.d.ts +2 -2
- package/out/i18n.js +9 -2
- package/out/index.d.ts +16 -7
- package/out/index.js +25 -8
- package/out/internal.d.ts +4 -0
- package/out/internal.js +41 -17
- package/out/island.js +22 -6
- package/out/islandDependency.js +42 -18
- package/out/jsonSchema/infer.d.ts +805 -0
- package/out/jsonSchema/validate.d.ts +416 -0
- package/out/keywords/Array.d.ts +2 -2
- package/out/keywords/builtins.d.ts +3 -3
- package/out/keywords/constructors.d.ts +1 -1
- package/out/keywords/functions.d.ts +5 -192
- package/out/keywords/keywords.d.ts +3 -3
- package/out/keywords/number.d.ts +2 -2
- package/out/keywords/phrases.d.ts +4 -191
- package/out/keywords/string.d.ts +3 -3
- package/out/keywords/ts.d.ts +18 -18
- package/out/keywords/ts.js +19 -4
- package/out/locale.d.ts +6 -2
- package/out/locales/de.js +9 -2
- package/out/locales/en.js +21 -5
- package/out/match.d.ts +13 -10
- package/out/module.d.ts +2 -2
- package/out/mutatesInput.js +18 -3
- package/out/nary.d.ts +220 -194
- package/out/parser/ast/bounds.d.ts +2 -2
- package/out/parser/ast/default.d.ts +2 -2
- package/out/parser/ast/divisor.d.ts +2 -2
- package/out/parser/ast/generic.d.ts +2 -2
- package/out/parser/ast/infer.d.ts +1 -1
- package/out/parser/ast/keyof.d.ts +2 -2
- package/out/parser/ast/utils.d.ts +1 -1
- package/out/parser/ast/validate.d.ts +2 -2
- package/out/parser/definition.d.ts +4 -4
- package/out/parser/objectLiteral.d.ts +2 -2
- package/out/parser/property.d.ts +2 -2
- package/out/parser/reduce/dynamic.d.ts +2 -2
- package/out/parser/reduce/shared.d.ts +1 -1
- package/out/parser/reduce/static.d.ts +1 -1
- package/out/parser/shift/operand/enclosed.d.ts +2 -2
- package/out/parser/shift/operand/genericArgs.d.ts +2 -2
- package/out/parser/shift/operand/operand.d.ts +1 -1
- package/out/parser/shift/operand/unenclosed.d.ts +2 -2
- package/out/parser/shift/operand/unresolvable.d.ts +2 -2
- package/out/parser/shift/operator/bounds.d.ts +2 -2
- package/out/parser/shift/operator/brand.d.ts +2 -2
- package/out/parser/shift/operator/default.d.ts +4 -4
- package/out/parser/shift/operator/divisor.d.ts +1 -1
- package/out/parser/shift/operator/operator.d.ts +1 -1
- package/out/parser/shift/tokens.d.ts +1 -1
- package/out/parser/string.d.ts +2 -2
- package/out/parser/tupleExpressions.d.ts +6 -8
- package/out/parser/tupleLiteral.d.ts +2 -2
- package/out/precompiled.d.ts +1 -1
- package/out/precompiled.js +16 -2
- package/out/regex.d.ts +1 -0
- package/out/regex.js +2 -0
- package/out/runtime.d.ts +10 -8
- package/out/runtime.js +6 -4
- package/out/runtimeDevelopment.js +70 -52
- package/out/schema.d.ts +1 -0
- package/out/schema.js +15 -0
- package/out/schemaInternal.d.ts +1 -0
- package/out/schemaInternal.js +1401 -0
- package/out/schemaIssueFeatures.d.ts +1 -0
- package/out/schemaRuntime.d.ts +1 -0
- package/out/schemaRuntime.js +7 -0
- package/out/schemaRuntimeLean.d.ts +1 -0
- package/out/schemaRuntimeLean.js +1870 -0
- package/out/schemaRuntimeNone.d.ts +1 -0
- package/out/schemaRuntimeNone.js +1774 -0
- package/out/schemaRuntimeNoneLean.d.ts +1 -0
- package/out/schemaRuntimeNoneLean.js +1767 -0
- package/out/scope.d.ts +3 -4
- package/out/shared/issueFeatures.d.ts +38 -0
- package/out/shared/issueFeatures.js +40 -0
- package/out/standalone/artifact.d.ts +6 -6
- package/out/standalone/baking.d.ts +2 -2
- package/out/standalone/combinators.d.ts +1 -1
- package/out/standalone/compilers.d.ts +1 -1
- package/out/standalone/fallbacks.d.ts +1 -1
- package/out/standalone/keys.d.ts +1 -1
- package/out/standalone/sites.d.ts +3 -3
- package/out/standalone/units.d.ts +1 -1
- package/out/standalone/values.d.ts +1 -1
- package/out/type.d.ts +6 -6
- package/out/util.d.ts +1 -0
- package/out/util.js +137 -0
- package/out/variants/array.d.ts +6 -6
- package/out/variants/base.d.ts +61 -10
- package/out/variants/date.d.ts +5 -5
- package/out/variants/instantiate.d.ts +1 -1
- package/out/variants/number.d.ts +6 -6
- package/out/variants/object.d.ts +25 -12
- package/out/variants/string.d.ts +8 -8
- package/package.json +183 -8
- package/skills/arktype/SKILL.md +93 -93
- package/skills/arktype/references/migrating.md +144 -158
- package/skills/arktype/references/precompile.md +7 -7
- package/out/chunk-4CUA5XIP.js +0 -7
- package/out/chunk-GPNK5353.js +0 -2529
- package/out/chunk-MLKGABMK.js +0 -9
- package/out/chunk-PRTMQCHS.js +0 -3
- package/out/chunk-R5G57XC7.js +0 -7
- package/out/chunk-SWOOCAHN.js +0 -4
- package/out/chunk-TAHPKDNM.js +0 -3
- package/out/chunk-UETB6YE2.js +0 -14
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InternalTypedFn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4FTHWK63.js";
|
|
4
|
+
import {
|
|
5
|
+
dateGetTime,
|
|
6
|
+
getBuiltinNameOfConstructor,
|
|
7
|
+
hasDomain,
|
|
8
|
+
hasOwn,
|
|
9
|
+
printable,
|
|
10
|
+
prototypeOf,
|
|
11
|
+
stringifyPath,
|
|
12
|
+
throwError,
|
|
13
|
+
throwParseError
|
|
14
|
+
} from "./chunk-3HZC67MT.js";
|
|
4
15
|
|
|
5
16
|
// out/runtime.js
|
|
6
|
-
import { ArkErrors as ArkErrors2, codedIssue, describeActual, enInfo, errorsOf, failsKey, failsKeySite, failsSite, findsOnRead, FirstIssues, holdsExpression, isCustomIssue, issueAt, issuesOf, mergeIssues, runtimeConfig as runtimeConfig2, sharedMessageOf, supportedJsonSchemaTargets, throwOnDefault, traversesUnions, validateStandardJsonSchemaTarget, writeFromPath, writeListed } from "
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export { aliasVisits, allowsAcyclic, allowsInBranch, applyCyclic, applyIssues, applyRejected, arrayIndexMatcher, callMorph, codedIssue, computeDefaultValueMorph, configure, configuredFallbackOf, configuredWriterOf, copyDeclared, alikeIssue, describeCollapsibleDate, disallowed, enInfo, enterResolution, execMorph, exitResolution, failsKey, failsKeySite, failsSite, FirstIssues, FirstIssueTraversal, fixConfig, foundErrors, fixConfigured, holdsOnlyIndices, keepOwn, InternalTraversal, listedIssue, matchesRepeated, mergeTransformed, missingTextOf, pipe, printKind, rejected, rejects, throwIssues, throwOnDefault, Traversal, TraversalError, tryMorph, writeDomainActual, writeLengthActual, writeMessage, writeNotEqualActual, writeProtoActual, writeNullableJsonSchema, writeUnionJsonSchema, writeUnitActual, writeUnitMessage } from "@ark/schema/runtime";
|
|
10
|
-
export { baseNameOf, functionNameOf, isIpv4, isIpv6, isIso8601, isNumericString, isPlainObjectOrArray, isUuid, isValidDate, isWellFormedInteger, jsTypeOfDescriptions, liftArray, ParseError, printable, throwParseError, timeOf } from "@ark/util";
|
|
17
|
+
import { ArkErrors as ArkErrors2, codedIssue, describeActual, enInfo, errorsOf, failsKey, failsKeySite, failsSite, findsOnRead, FirstIssues, holdsExpression, inContext, isCustomIssue, issueAt, issuesOf, mergeIssues, runtimeConfig as runtimeConfig2, sharedMessageOf, supportedJsonSchemaTargets, throwOnDefault, ToJsonSchemaError, traversesUnions, validateStandardJsonSchemaTarget, writeFromPath, writeListed, withContextOf } from "arktype/schema/runtime";
|
|
18
|
+
import { addErrors, addMorphErrs, allowsInBranchBy, allowsInContext, allowsUntracked, appliesValues, ArkErrors, copyOf, describePredicate, discriminatesBooleans, enterApplied, exitApplied, failsInBranches, pipeApplied, pipeChecked, pipeTransformed, runtimeConfig, runtimeScope, silentCtx, TransformErrors, transformed, transformedInApply, transformIfAllowed, transformResolution, transformsBranches, transformsValid } from "arktype/schema/runtime";
|
|
19
|
+
export { aliasVisits, allowsAcyclic, allowsInBranch, applyCyclic, applyIssues, applyRejected, arrayIndexMatcher, callMorph, codedIssue, computeDefaultValueMorph, configure, configuredFallbackOf, configuredWriterOf, copyDeclared, alikeIssue, describeCollapsibleDate, disallowed, enInfo, enterResolution, execMorph, exitResolution, failsKey, failsKeySite, failsSite, FirstIssues, FirstIssueTraversal, fixConfig, foundErrors, fixConfigured, holdsOnlyIndices, keepOwn, InternalTraversal, listedIssue, matchesRepeated, mergeTransformed, missingTextOf, pipe, printKind, rejected, rejects, throwIssues, throwOnDefault, Traversal, TraversalError, tryMorph, withContextOf, writeDomainActual, writeLengthActual, writeMessage, writeNotEqualActual, writeProtoActual, writeNullableJsonSchema, writeUnionJsonSchema, writeUnitActual, writeUnitMessage } from "arktype/schema/runtime";
|
|
11
20
|
|
|
12
21
|
// out/checkers.js
|
|
13
|
-
import { listedIssue } from "
|
|
14
|
-
import { hasOwn } from "@ark/util";
|
|
22
|
+
import { listedIssue } from "arktype/schema/runtime";
|
|
15
23
|
var transformedBy = ({ t }, data, ctx) => !t ? data : t.c ? t(data, ctx) : t(data);
|
|
16
24
|
var holdingMorphs = (t, held) => {
|
|
17
25
|
for (const checker of held) {
|
|
@@ -802,7 +810,7 @@ var union = ((branches, description, issueOf, fails) => {
|
|
|
802
810
|
});
|
|
803
811
|
|
|
804
812
|
// out/runtime.js
|
|
805
|
-
var
|
|
813
|
+
var precompiledForArktype_3_0_0_rc_0 = true;
|
|
806
814
|
var assign = /* @__PURE__ */ (() => Object.assign)();
|
|
807
815
|
var is = /* @__PURE__ */ (() => Object.is)();
|
|
808
816
|
var freeze = /* @__PURE__ */ (() => Object.freeze)();
|
|
@@ -851,10 +859,29 @@ var failureMessage = {
|
|
|
851
859
|
},
|
|
852
860
|
enumerable: true
|
|
853
861
|
};
|
|
854
|
-
var
|
|
855
|
-
value
|
|
856
|
-
|
|
857
|
-
|
|
862
|
+
var failureToJson = {
|
|
863
|
+
value() {
|
|
864
|
+
return {
|
|
865
|
+
issues: this._s(true),
|
|
866
|
+
message: this._s()
|
|
867
|
+
};
|
|
868
|
+
},
|
|
869
|
+
writable: true,
|
|
870
|
+
configurable: true
|
|
871
|
+
};
|
|
872
|
+
var standardResultOf = (out) => {
|
|
873
|
+
if (!(out instanceof ArkErrors2))
|
|
874
|
+
return { value: out };
|
|
875
|
+
const issues = out.issues;
|
|
876
|
+
return Object.defineProperty(Object.defineProperty(Object.defineProperty({ issues }, "_s", {
|
|
877
|
+
value: (json) => json ? typeof out.toJSON === "function" ? out.toJSON() : issues.toJSON() : out.summary,
|
|
878
|
+
writable: true
|
|
879
|
+
}), "message", failureMessage), "toJSON", failureToJson);
|
|
880
|
+
};
|
|
881
|
+
var standardValidated = (validator, input, options) => {
|
|
882
|
+
const context = options?.libraryOptions?.context;
|
|
883
|
+
return standardResultOf(context === void 0 ? validator(input, void 0, null) : inContext(context, () => validator(input, void 0, null)));
|
|
884
|
+
};
|
|
858
885
|
var siteOf = ((code, description, message) => ({ code, description, x: message }));
|
|
859
886
|
var requiredSiteOf = ((description) => ({
|
|
860
887
|
m: { code: "required", description }
|
|
@@ -866,7 +893,7 @@ var keySiteOf = ((code, description, missing = description) => ({
|
|
|
866
893
|
var standardOf = (validator, attributes) => freeze({
|
|
867
894
|
vendor: "arktype",
|
|
868
895
|
version: 1,
|
|
869
|
-
validate: freeze((input) =>
|
|
896
|
+
validate: freeze((input, options) => standardValidated(validator, input, options)),
|
|
870
897
|
...attributes["~standard"]
|
|
871
898
|
});
|
|
872
899
|
var createValidator = ((rootApply, allows, attributes, id, holes) => createValidatorWith((_, configuredOnFail) => ((data, pipedFromCtx, onFail = configuredOnFail) => pipedFromCtx ? rootApply(data, pipedInto(pipedFromCtx)) : rootApply(data, onFail)), [allows], id, attributes, holes));
|
|
@@ -880,6 +907,7 @@ var createValidatorWith = ((make, parts, id, attributes = { meta: emptyMeta }, h
|
|
|
880
907
|
own(validator, attributes);
|
|
881
908
|
validator.allows = freeze(parts[0]);
|
|
882
909
|
validator["~standard"] = standardOf(validator, attributes);
|
|
910
|
+
validator.withContext = freeze((context) => withContextOf(validator, context));
|
|
883
911
|
return holdHoles(freeze(validator), id, holes);
|
|
884
912
|
});
|
|
885
913
|
var pipedInto = (ctx) => (errors) => ctx.piped(errors);
|
|
@@ -962,21 +990,8 @@ var writeStandardJsonSchema = (writers, opts) => {
|
|
|
962
990
|
throwError(bakedJsonSchemaOptionsMessage);
|
|
963
991
|
return writers[i]();
|
|
964
992
|
};
|
|
965
|
-
var ToJsonSchemaError = class extends Error {
|
|
966
|
-
name = "ToJsonSchemaError";
|
|
967
|
-
code;
|
|
968
|
-
context;
|
|
969
|
-
constructor(code, message, context) {
|
|
970
|
-
super(message);
|
|
971
|
-
this.code = code;
|
|
972
|
-
this.context = context;
|
|
973
|
-
}
|
|
974
|
-
hasCode(code) {
|
|
975
|
-
return this.code === code;
|
|
976
|
-
}
|
|
977
|
-
};
|
|
978
993
|
var throwJsonSchemaError = (code, message, context) => {
|
|
979
|
-
throw new ToJsonSchemaError(code,
|
|
994
|
+
throw new ToJsonSchemaError(code, context, "", message);
|
|
980
995
|
};
|
|
981
996
|
var fallbackThrower = (code, header) => (ctx) => throwJsonSchemaError(code, header + printable(ctx, { quoteKeys: false, indent: 4 }), ctx);
|
|
982
997
|
var throwUnbaked = (reason) => throwError(writeUnbakedMessage(reason));
|
|
@@ -1186,7 +1201,13 @@ var InvalidErrors = /* @__PURE__ */ (() => {
|
|
|
1186
1201
|
}
|
|
1187
1202
|
get _() {
|
|
1188
1203
|
return this._f ??= [
|
|
1189
|
-
{
|
|
1204
|
+
{
|
|
1205
|
+
code: "predicate",
|
|
1206
|
+
path: [],
|
|
1207
|
+
data: this._d,
|
|
1208
|
+
expected: "valid",
|
|
1209
|
+
message: "is invalid"
|
|
1210
|
+
}
|
|
1190
1211
|
];
|
|
1191
1212
|
}
|
|
1192
1213
|
}
|
|
@@ -1459,7 +1480,7 @@ export {
|
|
|
1459
1480
|
discriminate,
|
|
1460
1481
|
discriminateOr,
|
|
1461
1482
|
union,
|
|
1462
|
-
|
|
1483
|
+
precompiledForArktype_3_0_0_rc_0,
|
|
1463
1484
|
assign,
|
|
1464
1485
|
is,
|
|
1465
1486
|
freeze,
|
|
@@ -1468,6 +1489,7 @@ export {
|
|
|
1468
1489
|
own,
|
|
1469
1490
|
bakeInto,
|
|
1470
1491
|
standardResultOf,
|
|
1492
|
+
standardValidated,
|
|
1471
1493
|
siteOf,
|
|
1472
1494
|
requiredSiteOf,
|
|
1473
1495
|
keySiteOf,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileConstructor,
|
|
3
|
+
baseNameOf
|
|
4
|
+
} from "./chunk-3HZC67MT.js";
|
|
5
|
+
|
|
6
|
+
// ../util/out/registry.js
|
|
7
|
+
var arkUtilVersion = "3.0.0-rc.0";
|
|
8
|
+
var reservedRegistryKeys = {
|
|
9
|
+
inPlace: void 0,
|
|
10
|
+
errorModes: void 0,
|
|
11
|
+
encode: void 0,
|
|
12
|
+
sets: void 0,
|
|
13
|
+
kw: void 0,
|
|
14
|
+
config: void 0,
|
|
15
|
+
cfg: void 0,
|
|
16
|
+
defaultConfig: void 0,
|
|
17
|
+
ambient: void 0,
|
|
18
|
+
nodesById: void 0,
|
|
19
|
+
reached: void 0,
|
|
20
|
+
deferDefaultCheck: void 0,
|
|
21
|
+
eagerTypes: void 0,
|
|
22
|
+
typeAttachments: void 0
|
|
23
|
+
};
|
|
24
|
+
var initialRegistryContents = {
|
|
25
|
+
version: arkUtilVersion,
|
|
26
|
+
FileConstructor,
|
|
27
|
+
...reservedRegistryKeys
|
|
28
|
+
};
|
|
29
|
+
var registry = initialRegistryContents;
|
|
30
|
+
var namesByResolution = /* @__PURE__ */ new Map();
|
|
31
|
+
var namesByUnregisteredObject = /* @__PURE__ */ new WeakMap();
|
|
32
|
+
var namesByUnregisteredSymbol = /* @__PURE__ */ new Map();
|
|
33
|
+
var nameCounts = /* @__PURE__ */ Object.create(null);
|
|
34
|
+
var register = (value) => {
|
|
35
|
+
const existingName = namesByResolution.get(value);
|
|
36
|
+
if (existingName)
|
|
37
|
+
return existingName;
|
|
38
|
+
const name = unregisteredNameOf(value) ?? nextName(value);
|
|
39
|
+
registry[name] = value;
|
|
40
|
+
namesByResolution.set(value, name);
|
|
41
|
+
return name;
|
|
42
|
+
};
|
|
43
|
+
var registeredNameOf = (value) => namesByResolution.get(value);
|
|
44
|
+
var nameOf = (value) => {
|
|
45
|
+
const existingName = namesByResolution.get(value) ?? unregisteredNameOf(value);
|
|
46
|
+
if (existingName)
|
|
47
|
+
return existingName;
|
|
48
|
+
const name = nextName(value);
|
|
49
|
+
if (typeof value === "symbol")
|
|
50
|
+
namesByUnregisteredSymbol.set(value, name);
|
|
51
|
+
else
|
|
52
|
+
namesByUnregisteredObject.set(value, name);
|
|
53
|
+
return name;
|
|
54
|
+
};
|
|
55
|
+
var unregisteredNameOf = (value) => typeof value === "symbol" ? namesByUnregisteredSymbol.get(value) : namesByUnregisteredObject.get(value);
|
|
56
|
+
var nextName = (value) => {
|
|
57
|
+
const baseName = baseNameOf(value);
|
|
58
|
+
let name = baseName;
|
|
59
|
+
let count = nameCounts[baseName] ?? 0;
|
|
60
|
+
while (isNameTaken(name) || name in registry)
|
|
61
|
+
name = `${baseName}$${++count}`;
|
|
62
|
+
nameCounts[baseName] = count;
|
|
63
|
+
return name;
|
|
64
|
+
};
|
|
65
|
+
var isNameTaken = (name) => {
|
|
66
|
+
if (name in nameCounts)
|
|
67
|
+
return true;
|
|
68
|
+
const counted = /^(.+)\$([1-9]\d*)$/.exec(name);
|
|
69
|
+
return !!counted && Number(counted[2]) <= (nameCounts[counted[1]] ?? 0);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
arkUtilVersion,
|
|
74
|
+
initialRegistryContents,
|
|
75
|
+
registry,
|
|
76
|
+
register,
|
|
77
|
+
registeredNameOf,
|
|
78
|
+
nameOf
|
|
79
|
+
};
|
package/out/cli.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export type PackageManager = "pnpm" | "bun" | "yarn" | "npm";
|
|
3
|
+
export type MigrationSource = "zod" | "valibot" | "yup" | "joi" | "typebox" | "v2";
|
|
4
|
+
export type CliContext = {
|
|
5
|
+
cwd?: string;
|
|
6
|
+
stdout?: (text: string) => void;
|
|
7
|
+
stderr?: (text: string) => void;
|
|
8
|
+
};
|
|
9
|
+
type PackageManifest = {
|
|
10
|
+
name?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
arkAotVersion?: string;
|
|
13
|
+
ark?: unknown;
|
|
14
|
+
bin?: string | Record<string, string>;
|
|
15
|
+
dependencies?: Record<string, string>;
|
|
16
|
+
devDependencies?: Record<string, string>;
|
|
17
|
+
};
|
|
18
|
+
export declare const bundledSkillPath: () => string;
|
|
19
|
+
export declare const detectPackageManager: (startDir: string) => PackageManager;
|
|
20
|
+
export declare const installDevCommand: (pm: PackageManager, pkg: string) => string;
|
|
21
|
+
export declare const detectMigrationSource: (manifest: PackageManifest | undefined) => MigrationSource | undefined;
|
|
22
|
+
export type InstallSkillOptions = {
|
|
23
|
+
allowOutside?: boolean;
|
|
24
|
+
cwd?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const installBundledSkill: (projectRoot: string, targetDir?: string, opts?: InstallSkillOptions) => string;
|
|
27
|
+
export declare const runCli: (argv: string[], ctx?: CliContext) => number;
|
|
28
|
+
export {};
|