@jxsuite/starters 1.1.0 → 1.2.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.
@@ -11,15 +11,488 @@
11
11
  "$ref": "https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"
12
12
  }
13
13
  ]
14
+ },
15
+ "https://jxsuite.com/schema/project/core/v2": {
16
+ "$defs": {
17
+ "ImageConfig": {
18
+ "description": "Image optimization configuration for the project.",
19
+ "properties": {
20
+ "formats": {
21
+ "items": {
22
+ "type": "string"
23
+ },
24
+ "type": "array"
25
+ },
26
+ "lazyLoad": {
27
+ "type": "boolean"
28
+ },
29
+ "optimize": {
30
+ "type": "boolean"
31
+ },
32
+ "quality": {
33
+ "properties": {
34
+ "avif": {
35
+ "type": "number"
36
+ },
37
+ "jpeg": {
38
+ "type": "number"
39
+ },
40
+ "png": {
41
+ "type": "number"
42
+ },
43
+ "webp": {
44
+ "type": "number"
45
+ }
46
+ },
47
+ "type": "object"
48
+ },
49
+ "remoteDomains": {
50
+ "description": "Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. [\"drive.usercontent.google.com\"]. Remote sources from other hosts are left untouched.",
51
+ "items": {
52
+ "type": "string"
53
+ },
54
+ "type": "array"
55
+ },
56
+ "service": {
57
+ "description": "How images are optimized: \"build\" runs Sharp at build time; \"cloudflare\" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).",
58
+ "enum": ["build", "cloudflare"],
59
+ "type": "string"
60
+ },
61
+ "sizes": {
62
+ "type": "string"
63
+ },
64
+ "widths": {
65
+ "items": {
66
+ "type": "number"
67
+ },
68
+ "type": "array"
69
+ }
70
+ },
71
+ "type": "object"
72
+ },
73
+ "JxFieldSchema": {
74
+ "description": "A single field definition inside a section entry schema — a small, recursive subset of JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",
75
+ "properties": {
76
+ "default": {},
77
+ "description": {
78
+ "type": "string"
79
+ },
80
+ "enum": {
81
+ "type": "array"
82
+ },
83
+ "format": {
84
+ "type": "string"
85
+ },
86
+ "items": {
87
+ "$ref": "https://jxsuite.com/schema/project/fields/v2"
88
+ },
89
+ "properties": {
90
+ "additionalProperties": {
91
+ "$ref": "https://jxsuite.com/schema/project/fields/v2"
92
+ },
93
+ "type": "object"
94
+ },
95
+ "required": {
96
+ "items": {
97
+ "type": "string"
98
+ },
99
+ "type": "array"
100
+ },
101
+ "type": {
102
+ "enum": ["string", "number", "integer", "boolean", "array", "object"],
103
+ "type": "string"
104
+ }
105
+ },
106
+ "required": ["type"],
107
+ "type": "object"
108
+ },
109
+ "RelationshipRef": {
110
+ "description": "Relationship reference field: points at a named entry of a referenceable section via \"#/<sectionKey>/<name>\" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.",
111
+ "properties": {
112
+ "$ref": {
113
+ "pattern": "^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",
114
+ "type": "string"
115
+ },
116
+ "description": {
117
+ "type": "string"
118
+ }
119
+ },
120
+ "required": ["$ref"],
121
+ "type": "object"
122
+ },
123
+ "StyleObject": {
124
+ "additionalProperties": {
125
+ "oneOf": [
126
+ {
127
+ "type": "string"
128
+ },
129
+ {
130
+ "type": "number"
131
+ },
132
+ {
133
+ "$ref": "#/$defs/StyleObject"
134
+ }
135
+ ]
136
+ },
137
+ "description": "CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth (e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission.",
138
+ "properties": {},
139
+ "type": "object"
140
+ }
141
+ },
142
+ "$id": "https://jxsuite.com/schema/project/core/v2",
143
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
144
+ "description": "Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document (project.schema.json) closes the composition. See specs/extensions.md §5.",
145
+ "properties": {
146
+ "$defs": {
147
+ "description": "Global type definitions available to all pages.",
148
+ "type": "object"
149
+ },
150
+ "$elements": {
151
+ "description": "Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",
152
+ "items": {
153
+ "oneOf": [
154
+ {
155
+ "additionalProperties": false,
156
+ "properties": {
157
+ "$ref": {
158
+ "type": "string"
159
+ }
160
+ },
161
+ "required": ["$ref"],
162
+ "type": "object"
163
+ },
164
+ {
165
+ "type": "string"
166
+ }
167
+ ]
168
+ },
169
+ "type": "array"
170
+ },
171
+ "$head": {
172
+ "description": "Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",
173
+ "examples": [
174
+ [
175
+ {
176
+ "attributes": {
177
+ "href": "/favicon.svg",
178
+ "rel": "icon"
179
+ },
180
+ "tagName": "link"
181
+ },
182
+ {
183
+ "attributes": {
184
+ "content": "Jx",
185
+ "name": "generator"
186
+ },
187
+ "tagName": "meta"
188
+ }
189
+ ]
190
+ ],
191
+ "items": {
192
+ "properties": {
193
+ "attributes": {
194
+ "additionalProperties": {
195
+ "type": "string"
196
+ },
197
+ "type": "object"
198
+ },
199
+ "tagName": {
200
+ "type": "string"
201
+ }
202
+ },
203
+ "type": "object"
204
+ },
205
+ "type": "array"
206
+ },
207
+ "$media": {
208
+ "additionalProperties": {
209
+ "type": "string"
210
+ },
211
+ "description": "Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. \"--dark\": \"(prefers-color-scheme: dark)\") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the visitor's persisted choice (spec §9.5).",
212
+ "examples": [
213
+ {
214
+ "--dark": "(prefers-color-scheme: dark)",
215
+ "--lg": "(min-width: 1024px)",
216
+ "--md": "(min-width: 768px)",
217
+ "--sm": "(min-width: 640px)"
218
+ }
219
+ ],
220
+ "type": "object"
221
+ },
222
+ "$schema": {
223
+ "description": "Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",
224
+ "type": "string"
225
+ },
226
+ "build": {
227
+ "description": "Build configuration.",
228
+ "properties": {
229
+ "adapter": {
230
+ "description": "Platform adapter for deployment-specific output.",
231
+ "enum": ["static", "cloudflare-pages", "cloudflare-workers", "node", "bun"],
232
+ "type": "string"
233
+ },
234
+ "deploy": {
235
+ "additionalProperties": false,
236
+ "description": "Deployment tracking: the hosting project this repo publishes to. Identifiers only (no secrets) — safe to commit; Studio uses it to tell whether the publish workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",
237
+ "properties": {
238
+ "accountId": {
239
+ "description": "Hosting account id (e.g. the Cloudflare account id).",
240
+ "type": "string"
241
+ },
242
+ "productionUrl": {
243
+ "description": "Production URL of the connected hosting project.",
244
+ "type": "string"
245
+ },
246
+ "projectName": {
247
+ "description": "Hosting project name (e.g. the Cloudflare Pages project).",
248
+ "pattern": "^[a-z0-9][a-z0-9-]*$",
249
+ "type": "string"
250
+ },
251
+ "provider": {
252
+ "description": "Hosting provider the project is connected to.",
253
+ "enum": ["cloudflare-pages"],
254
+ "type": "string"
255
+ }
256
+ },
257
+ "required": ["provider", "accountId", "projectName"],
258
+ "type": "object"
259
+ },
260
+ "format": {
261
+ "default": "directory",
262
+ "description": "Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",
263
+ "enum": ["directory", "single"],
264
+ "type": "string"
265
+ },
266
+ "outDir": {
267
+ "default": "./dist",
268
+ "description": "Output directory for compiled site.",
269
+ "type": "string"
270
+ },
271
+ "sitemap": {
272
+ "default": true,
273
+ "description": "Generate sitemap.xml from the route table (requires `url`). Set false to disable.",
274
+ "type": "boolean"
275
+ },
276
+ "trailingSlash": {
277
+ "default": "always",
278
+ "description": "Trailing slash behavior for generated URLs.",
279
+ "enum": ["always", "never", "ignore"],
280
+ "type": "string"
281
+ }
282
+ },
283
+ "type": "object"
284
+ },
285
+ "copy": {
286
+ "additionalProperties": {
287
+ "type": "string"
288
+ },
289
+ "description": "Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",
290
+ "type": "object"
291
+ },
292
+ "defaults": {
293
+ "description": "Default settings applied to all pages unless overridden.",
294
+ "properties": {
295
+ "charset": {
296
+ "default": "utf8",
297
+ "description": "Default charset for the page.",
298
+ "type": "string"
299
+ },
300
+ "lang": {
301
+ "default": "en",
302
+ "description": "Default lang attribute for the <html> element.",
303
+ "type": "string"
304
+ },
305
+ "layout": {
306
+ "default": null,
307
+ "description": "Default layout file path applied to all pages. Set to null to render pages without a layout.",
308
+ "examples": ["./layouts/base.json"],
309
+ "oneOf": [
310
+ {
311
+ "type": "string"
312
+ },
313
+ {
314
+ "type": "null"
315
+ }
316
+ ]
317
+ }
318
+ },
319
+ "type": "object"
320
+ },
321
+ "extensions": {
322
+ "description": "Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",
323
+ "examples": [["@jxsuite/parser"]],
324
+ "items": {
325
+ "type": "string"
326
+ },
327
+ "type": "array"
328
+ },
329
+ "i18n": {
330
+ "description": "Internationalization configuration.",
331
+ "properties": {
332
+ "defaultLocale": {
333
+ "description": "Default locale code.",
334
+ "examples": ["en"],
335
+ "type": "string"
336
+ },
337
+ "locales": {
338
+ "description": "Available locale codes.",
339
+ "examples": [["en", "fr", "de"]],
340
+ "items": {
341
+ "type": "string"
342
+ },
343
+ "type": "array"
344
+ },
345
+ "routing": {
346
+ "description": "Locale routing strategy.",
347
+ "enum": ["prefix-except-default", "prefix-always"],
348
+ "type": "string"
349
+ }
350
+ },
351
+ "type": "object"
352
+ },
353
+ "images": {
354
+ "$ref": "#/$defs/ImageConfig"
355
+ },
356
+ "imports": {
357
+ "additionalProperties": {
358
+ "type": "string"
359
+ },
360
+ "description": "Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",
361
+ "examples": [
362
+ {
363
+ "Markdown": "@jxsuite/parser/Markdown.class.json",
364
+ "MarkdownCollection": "@jxsuite/parser/MarkdownCollection.class.json"
365
+ }
366
+ ],
367
+ "type": "object"
368
+ },
369
+ "name": {
370
+ "default": "Jx Site",
371
+ "description": "Human-readable project name.",
372
+ "examples": ["My Portfolio", "Jx Example Site"],
373
+ "type": "string"
374
+ },
375
+ "redirects": {
376
+ "additionalProperties": {
377
+ "type": "string"
378
+ },
379
+ "description": "Static redirect rules. Maps source paths to destination paths.",
380
+ "examples": [
381
+ {
382
+ "/old-about": "/about"
383
+ }
384
+ ],
385
+ "type": "object"
386
+ },
387
+ "state": {
388
+ "description": "Site-wide reactive state available to all pages.",
389
+ "type": "object"
390
+ },
391
+ "style": {
392
+ "additionalProperties": {
393
+ "oneOf": [
394
+ {
395
+ "type": "string"
396
+ },
397
+ {
398
+ "type": "number"
399
+ },
400
+ {
401
+ "$ref": "#/$defs/StyleObject"
402
+ }
403
+ ]
404
+ },
405
+ "description": "Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",
406
+ "type": "object"
407
+ },
408
+ "url": {
409
+ "description": "Production URL of the deployed site.",
410
+ "examples": ["https://example.com", "https://jxsuite.com"],
411
+ "type": "string"
412
+ }
413
+ },
414
+ "title": "Jx Project Core",
415
+ "type": "object"
416
+ },
417
+ "https://jxsuite.com/schema/ext/parser/project/v1": {
418
+ "$id": "https://jxsuite.com/schema/ext/parser/project/v1",
419
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
420
+ "title": "Parser project fragment",
421
+ "description": "Project-schema fragment contributed by @jxsuite/parser: the `content` section declaring file-based content collections.",
422
+ "type": "object",
423
+ "properties": {
424
+ "content": {
425
+ "description": "File-based content collections. Each key names a content type; entries are loaded from the named source through the format registry.",
426
+ "type": "object",
427
+ "additionalProperties": {
428
+ "description": "Content type definition. Defines the source directory, frontmatter schema, and element dependencies.",
429
+ "type": "object",
430
+ "properties": {
431
+ "$elements": {
432
+ "description": "Custom elements available in markdown directives for this content type.",
433
+ "type": "array",
434
+ "items": {
435
+ "oneOf": [
436
+ {
437
+ "type": "object",
438
+ "properties": {
439
+ "$ref": {
440
+ "type": "string"
441
+ }
442
+ },
443
+ "required": ["$ref"]
444
+ },
445
+ {
446
+ "type": "string"
447
+ }
448
+ ]
449
+ }
450
+ },
451
+ "format": {
452
+ "description": "Name of a format class provided by an enabled extension (e.g. \"Markdown\", \"Csv\"). When omitted, the format is derived from the source file extension via the format registry. \"json\" is the only built-in.",
453
+ "type": "string"
454
+ },
455
+ "schema": {
456
+ "description": "JSON Schema for validating frontmatter of content type entries.",
457
+ "type": "object",
458
+ "properties": {
459
+ "type": {
460
+ "const": "object"
461
+ },
462
+ "properties": {
463
+ "description": "Field definitions; values are field schemas from the effective project field union.",
464
+ "type": "object",
465
+ "additionalProperties": {
466
+ "$ref": "https://jxsuite.com/schema/project/fields/v2"
467
+ }
468
+ },
469
+ "required": {
470
+ "description": "Frontmatter fields every entry must provide.",
471
+ "type": "array",
472
+ "items": {
473
+ "type": "string"
474
+ }
475
+ }
476
+ }
477
+ },
478
+ "source": {
479
+ "description": "Path to the content directory relative to the project root.",
480
+ "examples": ["./content/blog/", "./content/docs/"],
481
+ "type": "string"
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
14
487
  }
15
488
  },
16
489
  "$schema": "https://json-schema.org/draft/2020-12/schema",
17
490
  "allOf": [
18
491
  {
19
- "$ref": "./node_modules/@jxsuite/schema/schemas/project.core.schema.json"
492
+ "$ref": "https://jxsuite.com/schema/project/core/v2"
20
493
  },
21
494
  {
22
- "$ref": "./node_modules/@jxsuite/parser/schemas/project.fragment.schema.json"
495
+ "$ref": "https://jxsuite.com/schema/ext/parser/project/v1"
23
496
  }
24
497
  ],
25
498
  "type": "object",