constructa-schema 0.0.1 → 0.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Constructa contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -3,3 +3,21 @@
3
3
  Portable generator definitions, validation schemas, and related types shared by every Constructa interface.
4
4
 
5
5
  Planned areas include definition versioning, primitive and composite definitions, validation results, and safe serialization. This package must remain independent of execution, UI, network, and persistence concerns.
6
+
7
+ ## Portable data constraint
8
+
9
+ Portable generator definitions are JSON-only data. Supported values are strings, booleans, `null`, finite numbers other than negative zero, arrays, and plain object records whose properties are all JSON values.
10
+
11
+ Omit optional data by leaving the property out. `undefined` is not a portable value, including in object properties or array items. Values that JSON would coerce, execute, or silently omit are rejected, including functions, symbols, bigints, `NaN`, infinities, cyclic objects, sparse arrays, custom `toJSON` behavior, class instances, maps, sets, dates, accessors, symbol keys, and non-enumerable properties.
12
+
13
+ Use `isJsonValue`, `assertJsonValue`, or `findJsonValueError` to enforce this constraint before later schema-specific validation.
14
+
15
+ ## Schema version
16
+
17
+ Complete portable definitions must include `schemaVersion: 1`. `CURRENT_SCHEMA_VERSION` identifies the version emitted by current Constructa tooling, and `SUPPORTED_SCHEMA_VERSIONS` lists the versions accepted by this package.
18
+
19
+ Use `isSchemaVersion`, `assertSchemaVersion`, `isVersionedDefinition`, `assertVersionedDefinition`, `findSchemaVersionValueFailure`, or `findSchemaVersionFailure` to reject missing or unsupported version markers with structured failures.
20
+
21
+ ## Dependency boundary
22
+
23
+ This is the bottom of the domain dependency graph and has no Constructa runtime dependencies. In particular, it must not import core, generators, exporters, the SDK, applications, UI, environment, persistence, or transport code.
package/dist/index.d.ts CHANGED
@@ -1 +1,43 @@
1
- export {}
1
+ //#region src/index.d.ts
2
+ type JsonPrimitive = boolean | null | number | string;
3
+ type JsonValue = JsonArray | JsonObject | JsonPrimitive;
4
+ type JsonArray = readonly JsonValue[];
5
+ type JsonObject = {
6
+ readonly [key: string]: JsonValue;
7
+ };
8
+ declare const CURRENT_SCHEMA_VERSION = 1;
9
+ declare const SUPPORTED_SCHEMA_VERSIONS: readonly [1];
10
+ type SchemaVersion = (typeof SUPPORTED_SCHEMA_VERSIONS)[number];
11
+ type VersionedDefinition = JsonObject & {
12
+ readonly schemaVersion: SchemaVersion;
13
+ };
14
+ type SchemaVersionFailureCode = "schema_version_missing" | "schema_version_unsupported";
15
+ type SchemaVersionFailure = {
16
+ readonly code: SchemaVersionFailureCode;
17
+ readonly message: string;
18
+ readonly path: string;
19
+ readonly severity: "error";
20
+ readonly supportedVersions: readonly SchemaVersion[];
21
+ };
22
+ declare class JsonValueError extends TypeError {
23
+ constructor(path: string, reason: string);
24
+ }
25
+ declare class SchemaVersionError extends TypeError {
26
+ readonly failure: SchemaVersionFailure;
27
+ constructor(failure: SchemaVersionFailure);
28
+ }
29
+ declare function isJsonValue(value: unknown): value is JsonValue;
30
+ declare function isSchemaVersion(value: unknown): value is SchemaVersion;
31
+ declare function isVersionedDefinition(value: unknown): value is VersionedDefinition;
32
+ declare function assertJsonValue(value: unknown, path?: string): asserts value is JsonValue;
33
+ declare function assertSchemaVersion(value: unknown, path?: string): asserts value is SchemaVersion;
34
+ declare function assertVersionedDefinition(value: unknown, path?: string): asserts value is VersionedDefinition;
35
+ declare function findJsonValueError(value: unknown, path?: string): {
36
+ path: string;
37
+ reason: string;
38
+ } | undefined;
39
+ declare function findSchemaVersionFailure(value: unknown, path?: string): SchemaVersionFailure | undefined;
40
+ declare function findSchemaVersionValueFailure(value: unknown, path?: string): SchemaVersionFailure | undefined;
41
+ //#endregion
42
+ export { CURRENT_SCHEMA_VERSION, JsonArray, JsonObject, JsonPrimitive, JsonValue, JsonValueError, SUPPORTED_SCHEMA_VERSIONS, SchemaVersion, SchemaVersionError, SchemaVersionFailure, SchemaVersionFailureCode, VersionedDefinition, assertJsonValue, assertSchemaVersion, assertVersionedDefinition, findJsonValueError, findSchemaVersionFailure, findSchemaVersionValueFailure, isJsonValue, isSchemaVersion, isVersionedDefinition };
43
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";KAAY;KAEA,YAAY,YAAY,aAAa;KAErC,qBAAqB;KAErB;YACA,cAAc;;cAGb;cAEA;KAED,wBAAwB;KAExB,sBAAsB;WACvB,eAAe;;KAGd;KAIA;WACD,MAAM;WACN;WACA;WACA;WACA,4BAA4B;;cAG1B,uBAAuB;EACtB,YAAA,cAAc;;cAMf,2BAA2B;WAC7B,SAAS;EAEN,YAAA,SAAS;;iBAOP,YAAY,iBAAiB,SAAS;iBAItC,gBAAgB,iBAAiB,SAAS;iBAI1C,sBACd,iBACC,SAAS;iBAQI,gBACd,gBACA,wBACS,SAAS;iBAQJ,oBACd,gBACA,wBACS,SAAS;iBAQJ,0BACd,gBACA,wBACS,SAAS;iBAUJ,mBACd,gBACA;EACG;EAAc;;iBAIH,yBACd,gBACA,gBACC;iBAaa,8BACd,gBACA,gBACC"}
package/dist/index.js CHANGED
@@ -0,0 +1,165 @@
1
+ //#region src/index.ts
2
+ const CURRENT_SCHEMA_VERSION = 1;
3
+ const SUPPORTED_SCHEMA_VERSIONS = [1];
4
+ var JsonValueError = class extends TypeError {
5
+ constructor(path, reason) {
6
+ super(`${path}: ${reason}`);
7
+ this.name = "JsonValueError";
8
+ }
9
+ };
10
+ var SchemaVersionError = class extends TypeError {
11
+ failure;
12
+ constructor(failure) {
13
+ super(`${failure.path}: ${failure.message}`);
14
+ this.name = "SchemaVersionError";
15
+ this.failure = failure;
16
+ }
17
+ };
18
+ function isJsonValue(value) {
19
+ return findJsonValueError(value) === void 0;
20
+ }
21
+ function isSchemaVersion(value) {
22
+ return value === 1;
23
+ }
24
+ function isVersionedDefinition(value) {
25
+ return findSchemaVersionFailure(value) === void 0 && isJsonRecord(value) && isJsonValue(value);
26
+ }
27
+ function assertJsonValue(value, path = "$") {
28
+ const error = findJsonValueError(value, path);
29
+ if (error !== void 0) throw new JsonValueError(error.path, error.reason);
30
+ }
31
+ function assertSchemaVersion(value, path = "$.schemaVersion") {
32
+ const failure = findSchemaVersionValueFailure(value, path);
33
+ if (failure !== void 0) throw new SchemaVersionError(failure);
34
+ }
35
+ function assertVersionedDefinition(value, path = "$") {
36
+ const failure = findSchemaVersionFailure(value, path);
37
+ if (failure !== void 0) throw new SchemaVersionError(failure);
38
+ assertJsonValue(value, path);
39
+ }
40
+ function findJsonValueError(value, path = "$") {
41
+ return findJsonValueErrorInternal(value, path, /* @__PURE__ */ new Set());
42
+ }
43
+ function findSchemaVersionFailure(value, path = "$") {
44
+ if (!isJsonRecord(value) || !Object.hasOwn(value, "schemaVersion")) return createSchemaVersionFailure("schema_version_missing", { path: appendPathSegment(path, "schemaVersion") });
45
+ return findSchemaVersionValueFailure(value.schemaVersion, appendPathSegment(path, "schemaVersion"));
46
+ }
47
+ function findSchemaVersionValueFailure(value, path = "$.schemaVersion") {
48
+ if (isSchemaVersion(value)) return;
49
+ return createSchemaVersionFailure("schema_version_unsupported", { path });
50
+ }
51
+ function findJsonValueErrorInternal(value, path, ancestors) {
52
+ switch (typeof value) {
53
+ case "boolean":
54
+ case "string": return;
55
+ case "number":
56
+ if (!Number.isFinite(value)) return {
57
+ path,
58
+ reason: "number must be finite"
59
+ };
60
+ if (Object.is(value, -0)) return {
61
+ path,
62
+ reason: "number must not be negative zero"
63
+ };
64
+ return;
65
+ case "object":
66
+ if (value === null) return;
67
+ return findJsonObjectError(value, path, ancestors);
68
+ case "bigint":
69
+ case "function":
70
+ case "symbol":
71
+ case "undefined": return {
72
+ path,
73
+ reason: `${typeof value} is not JSON-compatible`
74
+ };
75
+ }
76
+ }
77
+ function createSchemaVersionFailure(code, options) {
78
+ return {
79
+ code,
80
+ message: code === "schema_version_missing" ? `schemaVersion is required and must be 1` : `schemaVersion must be 1`,
81
+ path: options.path,
82
+ severity: "error",
83
+ supportedVersions: SUPPORTED_SCHEMA_VERSIONS
84
+ };
85
+ }
86
+ function appendPathSegment(path, segment) {
87
+ return path === "$" ? `$.${segment}` : `${path}.${segment}`;
88
+ }
89
+ function isJsonRecord(value) {
90
+ const prototype = typeof value === "object" && value !== null ? Object.getPrototypeOf(value) : void 0;
91
+ return typeof value === "object" && value !== null && !Array.isArray(value) && (prototype === null || prototype === Object.prototype);
92
+ }
93
+ function findJsonObjectError(value, path, ancestors) {
94
+ if (ancestors.has(value)) return {
95
+ path,
96
+ reason: "cyclic objects are not JSON-compatible"
97
+ };
98
+ if (hasCallableToJson(value)) return {
99
+ path,
100
+ reason: "objects with toJSON behavior are not portable"
101
+ };
102
+ ancestors.add(value);
103
+ const error = Array.isArray(value) ? findJsonArrayError(value, path, ancestors) : findJsonRecordError(value, path, ancestors);
104
+ ancestors.delete(value);
105
+ return error;
106
+ }
107
+ function hasCallableToJson(value) {
108
+ return "toJSON" in value && typeof value.toJSON === "function";
109
+ }
110
+ function findJsonArrayError(value, path, ancestors) {
111
+ const extraProperty = Object.keys(value).find((key) => !isArrayIndexKey(key));
112
+ if (extraProperty !== void 0) return {
113
+ path: `${path}.${extraProperty}`,
114
+ reason: "array object properties would be omitted from JSON"
115
+ };
116
+ const ownPropertyError = findUnsupportedOwnProperty(value, path, ["length"]);
117
+ if (ownPropertyError !== void 0) return ownPropertyError;
118
+ for (let index = 0; index < value.length; index += 1) {
119
+ if (!(index in value)) return {
120
+ path: `${path}[${index}]`,
121
+ reason: "sparse array slots are not JSON-compatible"
122
+ };
123
+ const itemError = findJsonValueErrorInternal(value[index], `${path}[${index}]`, ancestors);
124
+ if (itemError !== void 0) return itemError;
125
+ }
126
+ }
127
+ function isArrayIndexKey(key) {
128
+ const index = Number(key);
129
+ return Number.isInteger(index) && index >= 0 && index < 2 ** 32 - 1 && String(index) === key;
130
+ }
131
+ function findJsonRecordError(value, path, ancestors) {
132
+ const prototype = Object.getPrototypeOf(value);
133
+ if (prototype !== null && prototype !== Object.prototype) return {
134
+ path,
135
+ reason: "object must be a plain JSON record"
136
+ };
137
+ const ownPropertyError = findUnsupportedOwnProperty(value, path);
138
+ if (ownPropertyError !== void 0) return ownPropertyError;
139
+ for (const key of Object.keys(value)) {
140
+ const itemError = findJsonValueErrorInternal(value[key], `${path}.${key}`, ancestors);
141
+ if (itemError !== void 0) return itemError;
142
+ }
143
+ }
144
+ function findUnsupportedOwnProperty(value, path, allowedNonEnumerableProperties = []) {
145
+ if (Object.getOwnPropertySymbols(value).length > 0) return {
146
+ path,
147
+ reason: "symbol keys are not JSON-compatible"
148
+ };
149
+ const allowedNonEnumerable = new Set(allowedNonEnumerableProperties);
150
+ const descriptors = Object.getOwnPropertyDescriptors(value);
151
+ for (const [key, descriptor] of Object.entries(descriptors)) {
152
+ if ("get" in descriptor || "set" in descriptor) return {
153
+ path: `${path}.${key}`,
154
+ reason: "accessor properties are not portable JSON data"
155
+ };
156
+ if (!descriptor.enumerable && !allowedNonEnumerable.has(key)) return {
157
+ path: `${path}.${key}`,
158
+ reason: "non-enumerable properties would be omitted from JSON"
159
+ };
160
+ }
161
+ }
162
+ //#endregion
163
+ export { CURRENT_SCHEMA_VERSION, JsonValueError, SUPPORTED_SCHEMA_VERSIONS, SchemaVersionError, assertJsonValue, assertSchemaVersion, assertVersionedDefinition, findJsonValueError, findSchemaVersionFailure, findSchemaVersionValueFailure, isJsonValue, isSchemaVersion, isVersionedDefinition };
164
+
165
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export type JsonPrimitive = boolean | null | number | string;\n\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport type JsonArray = readonly JsonValue[];\n\nexport type JsonObject = {\n readonly [key: string]: JsonValue;\n};\n\nexport const CURRENT_SCHEMA_VERSION = 1;\n\nexport const SUPPORTED_SCHEMA_VERSIONS = [CURRENT_SCHEMA_VERSION] as const;\n\nexport type SchemaVersion = (typeof SUPPORTED_SCHEMA_VERSIONS)[number];\n\nexport type VersionedDefinition = JsonObject & {\n readonly schemaVersion: SchemaVersion;\n};\n\nexport type SchemaVersionFailureCode =\n | \"schema_version_missing\"\n | \"schema_version_unsupported\";\n\nexport type SchemaVersionFailure = {\n readonly code: SchemaVersionFailureCode;\n readonly message: string;\n readonly path: string;\n readonly severity: \"error\";\n readonly supportedVersions: readonly SchemaVersion[];\n};\n\nexport class JsonValueError extends TypeError {\n constructor(path: string, reason: string) {\n super(`${path}: ${reason}`);\n this.name = \"JsonValueError\";\n }\n}\n\nexport class SchemaVersionError extends TypeError {\n readonly failure: SchemaVersionFailure;\n\n constructor(failure: SchemaVersionFailure) {\n super(`${failure.path}: ${failure.message}`);\n this.name = \"SchemaVersionError\";\n this.failure = failure;\n }\n}\n\nexport function isJsonValue(value: unknown): value is JsonValue {\n return findJsonValueError(value) === undefined;\n}\n\nexport function isSchemaVersion(value: unknown): value is SchemaVersion {\n return value === CURRENT_SCHEMA_VERSION;\n}\n\nexport function isVersionedDefinition(\n value: unknown,\n): value is VersionedDefinition {\n return (\n findSchemaVersionFailure(value) === undefined &&\n isJsonRecord(value) &&\n isJsonValue(value)\n );\n}\n\nexport function assertJsonValue(\n value: unknown,\n path = \"$\",\n): asserts value is JsonValue {\n const error = findJsonValueError(value, path);\n\n if (error !== undefined) {\n throw new JsonValueError(error.path, error.reason);\n }\n}\n\nexport function assertSchemaVersion(\n value: unknown,\n path = \"$.schemaVersion\",\n): asserts value is SchemaVersion {\n const failure = findSchemaVersionValueFailure(value, path);\n\n if (failure !== undefined) {\n throw new SchemaVersionError(failure);\n }\n}\n\nexport function assertVersionedDefinition(\n value: unknown,\n path = \"$\",\n): asserts value is VersionedDefinition {\n const failure = findSchemaVersionFailure(value, path);\n\n if (failure !== undefined) {\n throw new SchemaVersionError(failure);\n }\n\n assertJsonValue(value, path);\n}\n\nexport function findJsonValueError(\n value: unknown,\n path = \"$\",\n): { path: string; reason: string } | undefined {\n return findJsonValueErrorInternal(value, path, new Set());\n}\n\nexport function findSchemaVersionFailure(\n value: unknown,\n path = \"$\",\n): SchemaVersionFailure | undefined {\n if (!isJsonRecord(value) || !Object.hasOwn(value, \"schemaVersion\")) {\n return createSchemaVersionFailure(\"schema_version_missing\", {\n path: appendPathSegment(path, \"schemaVersion\"),\n });\n }\n\n return findSchemaVersionValueFailure(\n value.schemaVersion,\n appendPathSegment(path, \"schemaVersion\"),\n );\n}\n\nexport function findSchemaVersionValueFailure(\n value: unknown,\n path = \"$.schemaVersion\",\n): SchemaVersionFailure | undefined {\n if (isSchemaVersion(value)) {\n return undefined;\n }\n\n return createSchemaVersionFailure(\"schema_version_unsupported\", { path });\n}\n\nfunction findJsonValueErrorInternal(\n value: unknown,\n path: string,\n ancestors: Set<object>,\n): { path: string; reason: string } | undefined {\n switch (typeof value) {\n case \"boolean\":\n case \"string\":\n return undefined;\n case \"number\":\n if (!Number.isFinite(value)) {\n return { path, reason: \"number must be finite\" };\n }\n if (Object.is(value, -0)) {\n return { path, reason: \"number must not be negative zero\" };\n }\n return undefined;\n case \"object\":\n if (value === null) {\n return undefined;\n }\n return findJsonObjectError(value, path, ancestors);\n case \"bigint\":\n case \"function\":\n case \"symbol\":\n case \"undefined\":\n return { path, reason: `${typeof value} is not JSON-compatible` };\n }\n}\n\nfunction createSchemaVersionFailure(\n code: SchemaVersionFailureCode,\n options: { readonly path: string },\n): SchemaVersionFailure {\n return {\n code,\n message:\n code === \"schema_version_missing\"\n ? `schemaVersion is required and must be ${CURRENT_SCHEMA_VERSION}`\n : `schemaVersion must be ${CURRENT_SCHEMA_VERSION}`,\n path: options.path,\n severity: \"error\",\n supportedVersions: SUPPORTED_SCHEMA_VERSIONS,\n };\n}\n\nfunction appendPathSegment(path: string, segment: string) {\n return path === \"$\" ? `$.${segment}` : `${path}.${segment}`;\n}\n\nfunction isJsonRecord(value: unknown): value is Record<string, unknown> {\n const prototype =\n typeof value === \"object\" && value !== null\n ? Object.getPrototypeOf(value)\n : undefined;\n\n return (\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n (prototype === null || prototype === Object.prototype)\n );\n}\n\nfunction findJsonObjectError(\n value: object,\n path: string,\n ancestors: Set<object>,\n): { path: string; reason: string } | undefined {\n if (ancestors.has(value)) {\n return { path, reason: \"cyclic objects are not JSON-compatible\" };\n }\n\n if (hasCallableToJson(value)) {\n return { path, reason: \"objects with toJSON behavior are not portable\" };\n }\n\n ancestors.add(value);\n const error = Array.isArray(value)\n ? findJsonArrayError(value, path, ancestors)\n : findJsonRecordError(value, path, ancestors);\n ancestors.delete(value);\n\n return error;\n}\n\nfunction hasCallableToJson(value: object) {\n return (\n \"toJSON\" in value &&\n typeof (value as { readonly toJSON?: unknown }).toJSON === \"function\"\n );\n}\n\nfunction findJsonArrayError(\n value: readonly unknown[],\n path: string,\n ancestors: Set<object>,\n): { path: string; reason: string } | undefined {\n const extraProperty = Object.keys(value).find((key) => !isArrayIndexKey(key));\n\n if (extraProperty !== undefined) {\n return {\n path: `${path}.${extraProperty}`,\n reason: \"array object properties would be omitted from JSON\",\n };\n }\n\n const ownPropertyError = findUnsupportedOwnProperty(value, path, [\"length\"]);\n\n if (ownPropertyError !== undefined) {\n return ownPropertyError;\n }\n\n for (let index = 0; index < value.length; index += 1) {\n if (!(index in value)) {\n return {\n path: `${path}[${index}]`,\n reason: \"sparse array slots are not JSON-compatible\",\n };\n }\n\n const itemError = findJsonValueErrorInternal(\n value[index],\n `${path}[${index}]`,\n ancestors,\n );\n\n if (itemError !== undefined) {\n return itemError;\n }\n }\n\n return undefined;\n}\n\nfunction isArrayIndexKey(key: string) {\n const index = Number(key);\n\n return (\n Number.isInteger(index) &&\n index >= 0 &&\n index < 2 ** 32 - 1 &&\n String(index) === key\n );\n}\n\nfunction findJsonRecordError(\n value: object,\n path: string,\n ancestors: Set<object>,\n): { path: string; reason: string } | undefined {\n const prototype = Object.getPrototypeOf(value);\n\n if (prototype !== null && prototype !== Object.prototype) {\n return { path, reason: \"object must be a plain JSON record\" };\n }\n\n const ownPropertyError = findUnsupportedOwnProperty(value, path);\n\n if (ownPropertyError !== undefined) {\n return ownPropertyError;\n }\n\n for (const key of Object.keys(value)) {\n const itemError = findJsonValueErrorInternal(\n (value as Record<string, unknown>)[key],\n `${path}.${key}`,\n ancestors,\n );\n\n if (itemError !== undefined) {\n return itemError;\n }\n }\n\n return undefined;\n}\n\nfunction findUnsupportedOwnProperty(\n value: object,\n path: string,\n allowedNonEnumerableProperties: readonly string[] = [],\n): { path: string; reason: string } | undefined {\n if (Object.getOwnPropertySymbols(value).length > 0) {\n return { path, reason: \"symbol keys are not JSON-compatible\" };\n }\n\n const allowedNonEnumerable = new Set(allowedNonEnumerableProperties);\n const descriptors = Object.getOwnPropertyDescriptors(value);\n\n for (const [key, descriptor] of Object.entries(descriptors)) {\n if (\"get\" in descriptor || \"set\" in descriptor) {\n return {\n path: `${path}.${key}`,\n reason: \"accessor properties are not portable JSON data\",\n };\n }\n\n if (!descriptor.enumerable && !allowedNonEnumerable.has(key)) {\n return {\n path: `${path}.${key}`,\n reason: \"non-enumerable properties would be omitted from JSON\",\n };\n }\n }\n\n return undefined;\n}\n"],"mappings":";AAUA,MAAa,yBAAyB;AAEtC,MAAa,4BAA4B,CAAA,CAAuB;AAoBhE,IAAa,iBAAb,cAAoC,UAAU;CAC5C,YAAY,MAAc,QAAgB;EACxC,MAAM,GAAG,KAAK,IAAI,QAAQ;EAC1B,KAAK,OAAO;CACd;AACF;AAEA,IAAa,qBAAb,cAAwC,UAAU;CAChD;CAEA,YAAY,SAA+B;EACzC,MAAM,GAAG,QAAQ,KAAK,IAAI,QAAQ,SAAS;EAC3C,KAAK,OAAO;EACZ,KAAK,UAAU;CACjB;AACF;AAEA,SAAgB,YAAY,OAAoC;CAC9D,OAAO,mBAAmB,KAAK,MAAM,KAAA;AACvC;AAEA,SAAgB,gBAAgB,OAAwC;CACtE,OAAO,UAAA;AACT;AAEA,SAAgB,sBACd,OAC8B;CAC9B,OACE,yBAAyB,KAAK,MAAM,KAAA,KACpC,aAAa,KAAK,KAClB,YAAY,KAAK;AAErB;AAEA,SAAgB,gBACd,OACA,OAAO,KACqB;CAC5B,MAAM,QAAQ,mBAAmB,OAAO,IAAI;CAE5C,IAAI,UAAU,KAAA,GACZ,MAAM,IAAI,eAAe,MAAM,MAAM,MAAM,MAAM;AAErD;AAEA,SAAgB,oBACd,OACA,OAAO,mBACyB;CAChC,MAAM,UAAU,8BAA8B,OAAO,IAAI;CAEzD,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,mBAAmB,OAAO;AAExC;AAEA,SAAgB,0BACd,OACA,OAAO,KAC+B;CACtC,MAAM,UAAU,yBAAyB,OAAO,IAAI;CAEpD,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,mBAAmB,OAAO;CAGtC,gBAAgB,OAAO,IAAI;AAC7B;AAEA,SAAg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AAM;AAEtB;AAEA,SAAS,oBACP,OACA,MACA,WAC8C;CAC9C,MAAM,YAAY,OAAO,eAAe,KAAK;CAE7C,IAAI,cAAc,QAAQ,cAAc,OAAO,WAC7C,OAAO;EAAE;EAAM,QAAQ;CAAqC;CAG9D,MAAM,mBAAmB,2BAA2B,OAAO,IAAI;CAE/D,IAAI,qBAAqB,KAAA,GACvB,OAAO;CAGT,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EACpC,MAAM,YAAY,2BACf,MAAkC,MACnC,GAAG,KAAK,GAAG,OACX,SACF;EAEA,IAAI,cAAc,KAAA,GAChB,OAAO;CAEX;AAGF;AAEA,SAAS,2BACP,OACA,MACA,iCAAoD,CAAC,GACP;CAC9C,IAAI,OAAO,sBAAsB,KAAK,CAAC,CAAC,SAAS,GAC/C,OAAO;EAAE;EAAM,QAAQ;CAAsC;CAG/D,MAAM,uBAAuB,IAAI,IAAI,8BAA8B;CACnE,MAAM,cAAc,OAAO,0BAA0B,KAAK;CAE1D,KAAK,MAAM,CAAC,KAAK,eAAe,OAAO,QAAQ,WAAW,GAAG;EAC3D,IAAI,SAAS,cAAc,SAAS,YAClC,OAAO;GACL,MAAM,GAAG,KAAK,GAAG;GACjB,QAAQ;EACV;EAGF,IAAI,CAAC,WAAW,cAAc,CAAC,qBAAqB,IAAI,GAAG,GACzD,OAAO;GACL,MAAM,GAAG,KAAK,GAAG;GACjB,QAAQ;EACV;CAEJ;AAGF"}
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "constructa-schema",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Portable schemas and types for Constructa generator definitions.",
5
5
  "private": false,
6
6
  "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Jack-WebDev/constructa.git",
10
+ "directory": "packages/schema"
11
+ },
7
12
  "type": "module",
8
13
  "files": [
9
14
  "dist"
@@ -17,15 +22,15 @@
17
22
  "default": "./dist/index.js"
18
23
  }
19
24
  },
20
- "scripts": {
21
- "build": "tsdown",
22
- "check-types": "tsc --noEmit"
23
- },
24
25
  "publishConfig": {
25
26
  "access": "public"
26
27
  },
27
28
  "devDependencies": {
28
- "@constructa/config": "workspace:*",
29
- "typescript": "catalog:"
29
+ "typescript": "^6.0.3",
30
+ "@constructa/config": "0.0.0"
31
+ },
32
+ "scripts": {
33
+ "build": "tsdown",
34
+ "check-types": "tsc --noEmit"
30
35
  }
31
- }
36
+ }