@jxsuite/schema 0.28.0 → 0.28.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/class-schema.json +341 -341
- package/defs/cem.schema.ts +11 -11
- package/defs/children-value.schema.ts +6 -6
- package/defs/class-def.schema.ts +131 -131
- package/defs/content-type-def.schema.ts +18 -18
- package/defs/element-def.schema.ts +36 -36
- package/defs/expression-node.schema.ts +37 -37
- package/defs/external-class-def.schema.ts +41 -41
- package/defs/function-def.schema.ts +31 -31
- package/defs/head-entry.schema.ts +6 -6
- package/defs/image-config.schema.ts +19 -13
- package/defs/json-schema-type.schema.ts +1 -1
- package/defs/project-config.schema.ts +122 -122
- package/defs/pure-type-def.schema.ts +12 -12
- package/defs/ref-object.schema.ts +19 -19
- package/defs/state-entry.schema.ts +3 -3
- package/defs/style-object.schema.ts +7 -7
- package/defs/tag-name.schema.ts +1 -1
- package/defs/typed-state-def.schema.ts +14 -14
- package/package.json +3 -1
- package/project-schema.json +284 -286
- package/schema.json +982 -984
- package/src/format-registry.ts +28 -13
- package/src/guards.ts +195 -0
- package/src/parse.ts +57 -0
- package/src/schema.ts +229 -225
- package/types.ts +340 -52
|
@@ -1,199 +1,199 @@
|
|
|
1
1
|
export const projectConfigSchema = {
|
|
2
|
+
additionalProperties: false,
|
|
2
3
|
description:
|
|
3
4
|
"Schema for Jx project.json files. " +
|
|
4
5
|
"A project.json file is the root anchor file for a Jx project, " +
|
|
5
6
|
"declaring site metadata, default settings, global styles, content types, " +
|
|
6
7
|
"and build configuration.",
|
|
7
|
-
type: "object",
|
|
8
8
|
properties: {
|
|
9
|
-
|
|
10
|
-
description: "
|
|
11
|
-
type: "string",
|
|
12
|
-
default: "Jx Site",
|
|
13
|
-
examples: ["My Portfolio", "Jx Example Site"],
|
|
14
|
-
},
|
|
15
|
-
url: {
|
|
16
|
-
description: "Production URL of the deployed site.",
|
|
17
|
-
type: "string",
|
|
18
|
-
examples: ["https://example.com", "https://jxsuite.com"],
|
|
19
|
-
},
|
|
20
|
-
defaults: {
|
|
21
|
-
description: "Default settings applied to all pages unless overridden.",
|
|
9
|
+
$defs: {
|
|
10
|
+
description: "Global type definitions available to all pages.",
|
|
22
11
|
type: "object",
|
|
23
|
-
properties: {
|
|
24
|
-
layout: {
|
|
25
|
-
description:
|
|
26
|
-
"Default layout file path applied to all pages. " +
|
|
27
|
-
"Set to null to render pages without a layout.",
|
|
28
|
-
oneOf: [{ type: "string" }, { type: "null" }],
|
|
29
|
-
default: null,
|
|
30
|
-
examples: ["./layouts/base.json"],
|
|
31
|
-
},
|
|
32
|
-
lang: {
|
|
33
|
-
description: "Default lang attribute for the <html> element.",
|
|
34
|
-
type: "string",
|
|
35
|
-
default: "en",
|
|
36
|
-
},
|
|
37
|
-
charset: {
|
|
38
|
-
description: "Default charset for the page.",
|
|
39
|
-
type: "string",
|
|
40
|
-
default: "utf-8",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
$head: {
|
|
45
|
-
description:
|
|
46
|
-
"Global <head> entries applied to all pages. " +
|
|
47
|
-
"Array of element definitions for meta tags, link tags, script tags, etc.",
|
|
48
|
-
type: "array",
|
|
49
|
-
items: {
|
|
50
|
-
type: "object",
|
|
51
|
-
properties: {
|
|
52
|
-
tagName: { type: "string" },
|
|
53
|
-
attributes: {
|
|
54
|
-
type: "object",
|
|
55
|
-
additionalProperties: { type: "string" },
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
examples: [
|
|
60
|
-
[
|
|
61
|
-
{ tagName: "link", attributes: { rel: "icon", href: "/favicon.svg" } },
|
|
62
|
-
{ tagName: "meta", attributes: { name: "generator", content: "Jx" } },
|
|
63
|
-
],
|
|
64
|
-
],
|
|
65
12
|
},
|
|
66
13
|
$elements: {
|
|
67
14
|
description:
|
|
68
15
|
"Global custom element dependencies available to all pages. " +
|
|
69
16
|
"Items are $ref objects or npm package specifier strings.",
|
|
70
|
-
type: "array",
|
|
71
17
|
items: {
|
|
72
18
|
oneOf: [
|
|
73
19
|
{
|
|
74
|
-
type: "object",
|
|
75
|
-
required: ["$ref"],
|
|
76
|
-
properties: { $ref: { type: "string" } },
|
|
77
20
|
additionalProperties: false,
|
|
21
|
+
properties: { $ref: { type: "string" } },
|
|
22
|
+
required: ["$ref"],
|
|
23
|
+
type: "object",
|
|
78
24
|
},
|
|
79
25
|
{ type: "string" },
|
|
80
26
|
],
|
|
81
27
|
},
|
|
28
|
+
type: "array",
|
|
82
29
|
},
|
|
83
|
-
|
|
30
|
+
$head: {
|
|
84
31
|
description:
|
|
85
|
-
"Global
|
|
86
|
-
"
|
|
87
|
-
type: "object",
|
|
88
|
-
additionalProperties: { type: "string" },
|
|
32
|
+
"Global <head> entries applied to all pages. " +
|
|
33
|
+
"Array of element definitions for meta tags, link tags, script tags, etc.",
|
|
89
34
|
examples: [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
35
|
+
[
|
|
36
|
+
{ attributes: { href: "/favicon.svg", rel: "icon" }, tagName: "link" },
|
|
37
|
+
{ attributes: { content: "Jx", name: "generator" }, tagName: "meta" },
|
|
38
|
+
],
|
|
94
39
|
],
|
|
40
|
+
items: {
|
|
41
|
+
properties: {
|
|
42
|
+
attributes: {
|
|
43
|
+
additionalProperties: { type: "string" },
|
|
44
|
+
type: "object",
|
|
45
|
+
},
|
|
46
|
+
tagName: { type: "string" },
|
|
47
|
+
},
|
|
48
|
+
type: "object",
|
|
49
|
+
},
|
|
50
|
+
type: "array",
|
|
95
51
|
},
|
|
96
52
|
$media: {
|
|
53
|
+
additionalProperties: { type: "string" },
|
|
97
54
|
description:
|
|
98
55
|
"Named media breakpoints following CSS @custom-media convention. " +
|
|
99
56
|
"Available in all component style objects.",
|
|
100
|
-
type: "object",
|
|
101
|
-
additionalProperties: { type: "string" },
|
|
102
57
|
examples: [
|
|
103
58
|
{
|
|
104
|
-
"--sm": "(min-width: 640px)",
|
|
105
|
-
"--md": "(min-width: 768px)",
|
|
106
59
|
"--lg": "(min-width: 1024px)",
|
|
60
|
+
"--md": "(min-width: 768px)",
|
|
61
|
+
"--sm": "(min-width: 640px)",
|
|
107
62
|
},
|
|
108
63
|
],
|
|
109
|
-
},
|
|
110
|
-
style: {
|
|
111
|
-
description:
|
|
112
|
-
"Global CSS styles applied to the <body> element. " +
|
|
113
|
-
"Uses the same camelCase CSSOM convention as component styles.",
|
|
114
64
|
type: "object",
|
|
115
|
-
additionalProperties: {
|
|
116
|
-
oneOf: [{ type: "string" }, { type: "number" }, { type: "object" }],
|
|
117
|
-
},
|
|
118
65
|
},
|
|
119
|
-
|
|
120
|
-
description: "
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
66
|
+
build: {
|
|
67
|
+
description: "Build configuration.",
|
|
68
|
+
properties: {
|
|
69
|
+
adapter: {
|
|
70
|
+
description: "Platform adapter for deployment-specific output.",
|
|
71
|
+
enum: ["netlify", "vercel", "cloudflare"],
|
|
72
|
+
type: "string",
|
|
73
|
+
},
|
|
74
|
+
format: {
|
|
75
|
+
default: "directory",
|
|
76
|
+
description: "Output format.",
|
|
77
|
+
enum: ["directory", "single"],
|
|
78
|
+
type: "string",
|
|
79
|
+
},
|
|
80
|
+
outDir: {
|
|
81
|
+
default: "./dist",
|
|
82
|
+
description: "Output directory for compiled site.",
|
|
83
|
+
type: "string",
|
|
84
|
+
},
|
|
85
|
+
trailingSlash: {
|
|
86
|
+
default: "always",
|
|
87
|
+
description: "Trailing slash behavior for generated URLs.",
|
|
88
|
+
enum: ["always", "never", "ignore"],
|
|
89
|
+
type: "string",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
125
92
|
type: "object",
|
|
126
93
|
},
|
|
127
94
|
contentTypes: {
|
|
95
|
+
additionalProperties: { $ref: "#/$defs/ContentTypeDef" },
|
|
128
96
|
description:
|
|
129
97
|
"Content type definitions. Each key is a content type name; " +
|
|
130
98
|
"the value defines the source directory, frontmatter schema, and element dependencies.",
|
|
131
99
|
type: "object",
|
|
132
|
-
additionalProperties: { $ref: "#/$defs/ContentTypeDef" },
|
|
133
|
-
},
|
|
134
|
-
redirects: {
|
|
135
|
-
description: "Static redirect rules. Maps source paths to destination paths.",
|
|
136
|
-
type: "object",
|
|
137
|
-
additionalProperties: { type: "string" },
|
|
138
|
-
examples: [{ "/old-about": "/about" }],
|
|
139
100
|
},
|
|
140
101
|
copy: {
|
|
102
|
+
additionalProperties: { type: "string" },
|
|
141
103
|
description:
|
|
142
104
|
"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",
|
|
143
105
|
type: "object",
|
|
144
|
-
additionalProperties: { type: "string" },
|
|
145
106
|
},
|
|
146
|
-
|
|
147
|
-
description: "
|
|
148
|
-
type: "object",
|
|
107
|
+
defaults: {
|
|
108
|
+
description: "Default settings applied to all pages unless overridden.",
|
|
149
109
|
properties: {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
default: "./dist",
|
|
154
|
-
},
|
|
155
|
-
format: {
|
|
156
|
-
description: "Output format.",
|
|
110
|
+
charset: {
|
|
111
|
+
default: "utf8",
|
|
112
|
+
description: "Default charset for the page.",
|
|
157
113
|
type: "string",
|
|
158
|
-
enum: ["directory", "single"],
|
|
159
|
-
default: "directory",
|
|
160
114
|
},
|
|
161
|
-
|
|
162
|
-
|
|
115
|
+
lang: {
|
|
116
|
+
default: "en",
|
|
117
|
+
description: "Default lang attribute for the <html> element.",
|
|
163
118
|
type: "string",
|
|
164
|
-
enum: ["always", "never", "ignore"],
|
|
165
|
-
default: "always",
|
|
166
119
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
120
|
+
layout: {
|
|
121
|
+
default: null,
|
|
122
|
+
description:
|
|
123
|
+
"Default layout file path applied to all pages. " +
|
|
124
|
+
"Set to null to render pages without a layout.",
|
|
125
|
+
examples: ["./layouts/base.json"],
|
|
126
|
+
oneOf: [{ type: "string" }, { type: "null" }],
|
|
171
127
|
},
|
|
172
128
|
},
|
|
129
|
+
type: "object",
|
|
173
130
|
},
|
|
174
|
-
images: { $ref: "#/$defs/ImageConfig" },
|
|
175
131
|
i18n: {
|
|
176
132
|
description: "Internationalization configuration.",
|
|
177
|
-
type: "object",
|
|
178
133
|
properties: {
|
|
179
134
|
defaultLocale: {
|
|
180
135
|
description: "Default locale code.",
|
|
181
|
-
type: "string",
|
|
182
136
|
examples: ["en"],
|
|
137
|
+
type: "string",
|
|
183
138
|
},
|
|
184
139
|
locales: {
|
|
185
140
|
description: "Available locale codes.",
|
|
186
|
-
type: "array",
|
|
187
|
-
items: { type: "string" },
|
|
188
141
|
examples: [["en", "fr", "de"]],
|
|
142
|
+
items: { type: "string" },
|
|
143
|
+
type: "array",
|
|
189
144
|
},
|
|
190
145
|
routing: {
|
|
191
146
|
description: "Locale routing strategy.",
|
|
192
|
-
type: "string",
|
|
193
147
|
enum: ["prefix-except-default", "prefix-always"],
|
|
148
|
+
type: "string",
|
|
194
149
|
},
|
|
195
150
|
},
|
|
151
|
+
type: "object",
|
|
152
|
+
},
|
|
153
|
+
images: { $ref: "#/$defs/ImageConfig" },
|
|
154
|
+
imports: {
|
|
155
|
+
additionalProperties: { type: "string" },
|
|
156
|
+
description:
|
|
157
|
+
"Global import map: $prototype names to .class.json file paths. " +
|
|
158
|
+
"Makes external classes available by name in all pages.",
|
|
159
|
+
examples: [
|
|
160
|
+
{
|
|
161
|
+
Markdown: "@jxsuite/parser/Markdown.class.json",
|
|
162
|
+
MarkdownCollection: "@jxsuite/parser/MarkdownCollection.class.json",
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
type: "object",
|
|
166
|
+
},
|
|
167
|
+
name: {
|
|
168
|
+
default: "Jx Site",
|
|
169
|
+
description: "Human-readable project name.",
|
|
170
|
+
examples: ["My Portfolio", "Jx Example Site"],
|
|
171
|
+
type: "string",
|
|
172
|
+
},
|
|
173
|
+
redirects: {
|
|
174
|
+
additionalProperties: { type: "string" },
|
|
175
|
+
description: "Static redirect rules. Maps source paths to destination paths.",
|
|
176
|
+
examples: [{ "/old-about": "/about" }],
|
|
177
|
+
type: "object",
|
|
178
|
+
},
|
|
179
|
+
state: {
|
|
180
|
+
description: "Site-wide reactive state available to all pages.",
|
|
181
|
+
type: "object",
|
|
182
|
+
},
|
|
183
|
+
style: {
|
|
184
|
+
additionalProperties: {
|
|
185
|
+
oneOf: [{ type: "string" }, { type: "number" }, { type: "object" }],
|
|
186
|
+
},
|
|
187
|
+
description:
|
|
188
|
+
"Global CSS styles applied to the <body> element. " +
|
|
189
|
+
"Uses the same camelCase CSSOM convention as component styles.",
|
|
190
|
+
type: "object",
|
|
191
|
+
},
|
|
192
|
+
url: {
|
|
193
|
+
description: "Production URL of the deployed site.",
|
|
194
|
+
examples: ["https://example.com", "https://jxsuite.com"],
|
|
195
|
+
type: "string",
|
|
196
196
|
},
|
|
197
197
|
},
|
|
198
|
-
|
|
198
|
+
type: "object",
|
|
199
199
|
} as const;
|
|
@@ -4,23 +4,23 @@ export const pureTypeDefSchema = {
|
|
|
4
4
|
"No function, no runtime artifact. " +
|
|
5
5
|
"Referenced from state entries via $ref. " +
|
|
6
6
|
"Naming convention: PascalCase.",
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
not: {
|
|
8
|
+
anyOf: [{ required: ["default"] }, { required: ["$prototype"] }],
|
|
9
|
+
},
|
|
9
10
|
properties: {
|
|
10
|
-
type: { $ref: "#/$defs/JsonSchemaType" },
|
|
11
11
|
description: { type: "string" },
|
|
12
12
|
enum: { type: "array" },
|
|
13
|
-
|
|
13
|
+
examples: { type: "array" },
|
|
14
|
+
items: {},
|
|
15
|
+
maxLength: { minimum: 0, type: "integer" },
|
|
14
16
|
maximum: { type: "number" },
|
|
15
|
-
minLength: { type: "integer"
|
|
16
|
-
|
|
17
|
+
minLength: { minimum: 0, type: "integer" },
|
|
18
|
+
minimum: { type: "number" },
|
|
17
19
|
pattern: { type: "string" },
|
|
18
|
-
items: {},
|
|
19
20
|
properties: { type: "object" },
|
|
20
|
-
required: {
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
not: {
|
|
24
|
-
anyOf: [{ required: ["default"] }, { required: ["$prototype"] }],
|
|
21
|
+
required: { items: { type: "string" }, type: "array" },
|
|
22
|
+
type: { $ref: "#/$defs/JsonSchemaType" },
|
|
25
23
|
},
|
|
24
|
+
required: ["type"],
|
|
25
|
+
type: "object",
|
|
26
26
|
} as const;
|
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
export const internalRefSchema = {
|
|
2
2
|
description: "Reference to a $defs type definition in the current component.",
|
|
3
|
-
type: "string",
|
|
4
|
-
pattern: "^#/\\$defs/",
|
|
5
3
|
examples: ["#/$defs/Count", "#/$defs/TodoItem", "#/$defs/Status"],
|
|
4
|
+
pattern: "^#/\\$defs/",
|
|
5
|
+
type: "string",
|
|
6
6
|
} as const;
|
|
7
7
|
|
|
8
8
|
export const stateRefSchema = {
|
|
9
9
|
description: "Reference to a state entry (runtime variable) in the current component.",
|
|
10
|
-
type: "string",
|
|
11
|
-
pattern: "^#/state/",
|
|
12
10
|
examples: ["#/state/count", "#/state/addTask", "#/state/items"],
|
|
11
|
+
pattern: "^#/state/",
|
|
12
|
+
type: "string",
|
|
13
13
|
} as const;
|
|
14
14
|
|
|
15
15
|
export const externalRefSchema = {
|
|
16
16
|
description: "Reference to an external Jx component file.",
|
|
17
|
-
type: "string",
|
|
18
|
-
pattern: "^(\\./|\\.\\./).*\\.json$|^https?://",
|
|
19
17
|
examples: ["./card.json", "https://cdn.example.com/button.json"],
|
|
18
|
+
pattern: "^(\\./|\\.\\./).*\\.json$|^https?://",
|
|
19
|
+
type: "string",
|
|
20
20
|
} as const;
|
|
21
21
|
|
|
22
22
|
export const globalRefSchema = {
|
|
23
23
|
description: "Reference to a window or document global.",
|
|
24
|
-
type: "string",
|
|
25
|
-
pattern: "^(window|document)#/",
|
|
26
24
|
examples: ["window#/currentUser", "document#/appConfig"],
|
|
25
|
+
pattern: "^(window|document)#/",
|
|
26
|
+
type: "string",
|
|
27
27
|
} as const;
|
|
28
28
|
|
|
29
29
|
export const parentRefSchema = {
|
|
30
30
|
description: "Reference to a named state entry passed via $props from a parent component.",
|
|
31
|
-
type: "string",
|
|
32
|
-
pattern: "^parent#/",
|
|
33
31
|
examples: ["parent#/sharedState", "parent#/theme"],
|
|
32
|
+
pattern: "^parent#/",
|
|
33
|
+
type: "string",
|
|
34
34
|
} as const;
|
|
35
35
|
|
|
36
36
|
export const mapRefSchema = {
|
|
37
37
|
description: "Reference to the current Array map iteration context.",
|
|
38
|
-
type: "string",
|
|
39
|
-
pattern: "^\\$map/(item|index)(/.*)?$",
|
|
40
38
|
examples: ["$map/item", "$map/index", "$map/item/text", "$map/item/done"],
|
|
39
|
+
pattern: "^\\$map/(item|index)(/.*)?$",
|
|
40
|
+
type: "string",
|
|
41
41
|
} as const;
|
|
42
42
|
|
|
43
43
|
export const anyRefSchema = {
|
|
44
|
-
type: "string",
|
|
45
44
|
oneOf: [
|
|
46
45
|
{ $ref: "#/$defs/InternalRef" },
|
|
47
46
|
{ $ref: "#/$defs/StateRef" },
|
|
@@ -50,21 +49,22 @@ export const anyRefSchema = {
|
|
|
50
49
|
{ $ref: "#/$defs/ParentRef" },
|
|
51
50
|
{ $ref: "#/$defs/MapRef" },
|
|
52
51
|
],
|
|
52
|
+
type: "string",
|
|
53
53
|
} as const;
|
|
54
54
|
|
|
55
55
|
export const refObjectSchema = {
|
|
56
|
+
additionalProperties: false,
|
|
56
57
|
description: "A $ref binding. Resolves to a state entry (reactive) or plain value (static).",
|
|
57
|
-
type: "object",
|
|
58
|
-
required: ["$ref"],
|
|
59
58
|
properties: { $ref: { $ref: "#/$defs/AnyRef" } },
|
|
60
|
-
|
|
59
|
+
required: ["$ref"],
|
|
60
|
+
type: "object",
|
|
61
61
|
} as const;
|
|
62
62
|
|
|
63
63
|
export const externalComponentRefSchema = {
|
|
64
|
-
type: "object",
|
|
65
|
-
required: ["$ref"],
|
|
66
64
|
properties: {
|
|
67
|
-
$ref: { $ref: "#/$defs/ExternalRef" },
|
|
68
65
|
$props: { $ref: "#/$defs/PropsObject" },
|
|
66
|
+
$ref: { $ref: "#/$defs/ExternalRef" },
|
|
69
67
|
},
|
|
68
|
+
required: ["$ref"],
|
|
69
|
+
type: "object",
|
|
70
70
|
} as const;
|
|
@@ -17,7 +17,6 @@ export const stateEntrySchema = {
|
|
|
17
17
|
{ $ref: "#/$defs/ExternalClassDef" },
|
|
18
18
|
{ $ref: "#/$defs/ExpressionEntry" },
|
|
19
19
|
{
|
|
20
|
-
type: "object",
|
|
21
20
|
not: {
|
|
22
21
|
anyOf: [
|
|
23
22
|
{ required: ["$prototype"] },
|
|
@@ -26,24 +25,25 @@ export const stateEntrySchema = {
|
|
|
26
25
|
{ required: ["$expression"] },
|
|
27
26
|
],
|
|
28
27
|
},
|
|
28
|
+
type: "object",
|
|
29
29
|
},
|
|
30
30
|
],
|
|
31
31
|
} as const;
|
|
32
32
|
|
|
33
33
|
export const stateMapSchema = {
|
|
34
|
+
additionalProperties: { $ref: "#/$defs/StateEntry" },
|
|
34
35
|
description:
|
|
35
36
|
"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). " +
|
|
36
37
|
"All entries are reactive by default.",
|
|
37
38
|
type: "object",
|
|
38
|
-
additionalProperties: { $ref: "#/$defs/StateEntry" },
|
|
39
39
|
} as const;
|
|
40
40
|
|
|
41
41
|
export const defsMapSchema = {
|
|
42
|
+
additionalProperties: { $ref: "#/$defs/TypeDefEntry" },
|
|
42
43
|
description:
|
|
43
44
|
"Map of reusable JSON Schema type definitions. " +
|
|
44
45
|
"Keys are PascalCase type names. No runtime artifacts are produced.",
|
|
45
46
|
type: "object",
|
|
46
|
-
additionalProperties: { $ref: "#/$defs/TypeDefEntry" },
|
|
47
47
|
} as const;
|
|
48
48
|
|
|
49
49
|
export const typeDefEntrySchema = {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export const styleObjectSchema = {
|
|
2
|
-
description:
|
|
3
|
-
"CSS style definition. camelCase property names follow CSSOM convention. " +
|
|
4
|
-
"Keys starting with :, ., &, or [ are treated as nested CSS selectors. " +
|
|
5
|
-
"Keys matching $media breakpoint names are treated as responsive rules.",
|
|
6
|
-
type: "object",
|
|
7
|
-
properties: {},
|
|
8
2
|
additionalProperties: {
|
|
9
3
|
oneOf: [
|
|
10
4
|
{ type: "string" },
|
|
11
5
|
{ type: "number" },
|
|
12
6
|
{
|
|
7
|
+
additionalProperties: { oneOf: [{ type: "string" }, { type: "number" }] },
|
|
13
8
|
description: "Nested CSS selector or media breakpoint rules.",
|
|
14
9
|
type: "object",
|
|
15
|
-
additionalProperties: { oneOf: [{ type: "string" }, { type: "number" }] },
|
|
16
10
|
},
|
|
17
11
|
],
|
|
18
12
|
},
|
|
13
|
+
description:
|
|
14
|
+
"CSS style definition. camelCase property names follow CSSOM convention. " +
|
|
15
|
+
"Keys starting with :, ., &, or [ are treated as nested CSS selectors. " +
|
|
16
|
+
"Keys matching $media breakpoint names are treated as responsive rules.",
|
|
17
|
+
properties: {},
|
|
18
|
+
type: "object",
|
|
19
19
|
} as const;
|
package/defs/tag-name.schema.ts
CHANGED
|
@@ -3,29 +3,29 @@ export const typedStateDefSchema = {
|
|
|
3
3
|
"A typed reactive state variable with explicit type and default value. " +
|
|
4
4
|
"The type property is a JSON Schema or $ref to a $defs type definition. " +
|
|
5
5
|
"The default property is the initial runtime value.",
|
|
6
|
-
|
|
7
|
-
required: ["default"],
|
|
6
|
+
not: { required: ["$prototype"] },
|
|
8
7
|
properties: {
|
|
9
|
-
|
|
10
|
-
type: {
|
|
11
|
-
description: "JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",
|
|
12
|
-
oneOf: [{ type: "string" }, { type: "object" }],
|
|
13
|
-
},
|
|
14
|
-
description: { type: "string" },
|
|
8
|
+
$ref: { description: "Reference to a shared type definition.", type: "string" },
|
|
15
9
|
attribute: {
|
|
16
10
|
description: "Linked HTML attribute name for CEM extraction.",
|
|
17
11
|
type: "string",
|
|
18
12
|
},
|
|
19
|
-
|
|
20
|
-
description: "Whether property changes reflect back to the HTML attribute.",
|
|
21
|
-
type: "boolean",
|
|
22
|
-
},
|
|
13
|
+
default: { description: "Initial state value." },
|
|
23
14
|
deprecated: {
|
|
24
15
|
description: "Deprecation notice for CEM extraction.",
|
|
25
16
|
oneOf: [{ type: "boolean" }, { type: "string" }],
|
|
26
17
|
},
|
|
18
|
+
description: { type: "string" },
|
|
27
19
|
examples: { type: "array" },
|
|
28
|
-
|
|
20
|
+
reflects: {
|
|
21
|
+
description: "Whether property changes reflect back to the HTML attribute.",
|
|
22
|
+
type: "boolean",
|
|
23
|
+
},
|
|
24
|
+
type: {
|
|
25
|
+
description: "JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",
|
|
26
|
+
oneOf: [{ type: "string" }, { type: "object" }],
|
|
27
|
+
},
|
|
29
28
|
},
|
|
30
|
-
|
|
29
|
+
required: ["default"],
|
|
30
|
+
type: "object",
|
|
31
31
|
} as const;
|
package/package.json
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
".": "./src/schema.ts",
|
|
10
10
|
"./format-registry": "./src/format-registry.ts",
|
|
11
11
|
"./types": "./types.ts",
|
|
12
|
+
"./guards": "./src/guards.ts",
|
|
13
|
+
"./parse": "./src/parse.ts",
|
|
12
14
|
"./defs": "./defs/index.ts",
|
|
13
15
|
"./schema.json": "./schema.json",
|
|
14
16
|
"./project-schema.json": "./project-schema.json"
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
"upgrade": "bunx npm-check-updates -u && bun install"
|
|
38
40
|
},
|
|
39
41
|
"type": "module",
|
|
40
|
-
"version": "0.28.
|
|
42
|
+
"version": "0.28.3",
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"json-schema-to-ts": "^3.1.1"
|
|
43
45
|
}
|