@thresho/site-sdk 2.0.0 → 2.1.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/CHANGELOG.md +5 -0
- package/README.md +11 -1
- package/diagnostics.json +1 -0
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
Add the generated diagnostic catalog with canonical documentation URLs for all 40 authoring codes.
|
|
6
|
+
Keep package format 2 and compiler 10.
|
|
7
|
+
|
|
3
8
|
## 2.0.0
|
|
4
9
|
|
|
5
10
|
Initial public format 2 SDK. Generate declaration-only element types, manifest types, JSON schemas and vocabulary from Forger.
|
package/README.md
CHANGED
|
@@ -35,7 +35,17 @@ Content.Text collects and discards its authored children; put visible text in th
|
|
|
35
35
|
Empty fragments do not satisfy the compiler's Catalog.Products child requirement.
|
|
36
36
|
|
|
37
37
|
The vocabulary.json file records the shared compiler vocabulary and enforcement boundaries.
|
|
38
|
-
The
|
|
38
|
+
The diagnostics.json file contains the generated authoring diagnostic catalog:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
import catalog from "@thresho/site-sdk/diagnostics.json" with { type: "json" };
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The catalog has formatVersion 2 and a diagnostics array. Each record contains code, family, severity, message, cause, fix, docsAnchor and docsUrl.
|
|
45
|
+
The authoring pack contains the same catalog bytes. Occurrence messages retain source-specific context; each code has one canonical documentation URL.
|
|
46
|
+
The future thresho CLI (#57) consumes this JSON export and the source-check code, message and docsUrl fields.
|
|
47
|
+
Source checks remain authenticated. The catalog contains no compiler runtime or tenant data.
|
|
48
|
+
Documentation URLs reserve the future diagnostic reference route; this package does not deploy the documentation pages.
|
|
39
49
|
|
|
40
50
|
Version 2.x targets package format 2. Additions require a minor release; type corrections require a patch release.
|
|
41
51
|
Removal or narrowing requires a major format release.
|
package/diagnostics.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"diagnostics":[{"cause":"Authored markup or CSS changes the platform consent banner.","code":"CONSENT_OVERRIDDEN","docsAnchor":"consent-overridden","docsUrl":"https://docs.thresho.com/reference/diagnostics#consent-overridden","family":"source","fix":"Remove selectors and attributes that target the platform consent banner.","message":"The cookie consent banner is restyled or hidden.","severity":"error"},{"cause":"A transaction route repeats a required disclosure control.","code":"DISCLOSURE_DUPLICATED","docsAnchor":"disclosure-duplicated","docsUrl":"https://docs.thresho.com/reference/diagnostics#disclosure-duplicated","family":"source","fix":"Keep one instance of the named disclosure in its required placement.","message":"A required disclosure appears more than once.","severity":"error"},{"cause":"An attribute or style hides a required disclosure or its ancestor.","code":"DISCLOSURE_HIDDEN","docsAnchor":"disclosure-hidden","docsUrl":"https://docs.thresho.com/reference/diagnostics#disclosure-hidden","family":"source","fix":"Remove hidden state and visibility treatments from the disclosure and its ancestors.","message":"A required disclosure is hidden.","severity":"error"},{"cause":"Authored children, properties or CSS replace a required disclosure.","code":"DISCLOSURE_OVERRIDDEN","docsAnchor":"disclosure-overridden","docsUrl":"https://docs.thresho.com/reference/diagnostics#disclosure-overridden","family":"source","fix":"Use the platform disclosure control without replacement children or unregistered treatments.","message":"A required disclosure is restyled or replaced.","severity":"error"},{"cause":"A transaction route omits a required disclosure control.","code":"DISCLOSURE_REQUIRED","docsAnchor":"disclosure-required","docsUrl":"https://docs.thresho.com/reference/diagnostics#disclosure-required","family":"source","fix":"Add the named disclosure exactly where the route contract requires it.","message":"A required disclosure is missing.","severity":"error"},{"cause":"An anchor names a route the manifest does not declare, a nodeId that is not authored on that route, or a property the compiler does not register.","code":"EXTENSION_ANCHOR_UNKNOWN","docsAnchor":"extension-anchor-unknown","docsUrl":"https://docs.thresho.com/reference/diagnostics#extension-anchor-unknown","family":"source","fix":"An anchor names a route the manifest does not declare, a nodeId that is not authored on that route, or a property the compiler does not register. Add the route, pin the nodeId in the source, and use a registered data-design property.","message":"An anchor names a route the manifest does not declare, a nodeId that is not authored on that route, or a property the compiler does not register.","severity":"error"},{"cause":"An anchor names a registered property with no patchable literal at that node.","code":"EXTENSION_ANCHOR_UNPATCHABLE","docsAnchor":"extension-anchor-unpatchable","docsUrl":"https://docs.thresho.com/reference/diagnostics#extension-anchor-unpatchable","family":"source","fix":"An anchor names a registered property with no patchable literal at that node. A generated or instance-scoped identity, a non-literal value, a shared source location or a duplicate declaration cannot be patched; move the value to a single literal at the anchored node.","message":"An anchor names a registered property with no patchable literal at that node.","severity":"error"},{"cause":"The extension surface names something the package does not declare, repeats an entry, uses an unknown key, or breaks a bound.","code":"EXTENSION_INVALID","docsAnchor":"extension-invalid","docsUrl":"https://docs.thresho.com/reference/diagnostics#extension-invalid","family":"source","fix":"The extension surface names something the package does not declare, repeats an entry, uses an unknown key, or breaks a bound. Name only declared content keys, declared image slots, registered tokens, explicit nodeIds, registered block names and free route patterns.","message":"The extension surface names something the package does not declare, repeats an entry, uses an unknown key, or breaks a bound.","severity":"error"},{"cause":"The extension surface reaches a protected surface.","code":"EXTENSION_PROTECTED_SURFACE","docsAnchor":"extension-protected-surface","docsUrl":"https://docs.thresho.com/reference/diagnostics#extension-protected-surface","family":"source","fix":"The extension surface reaches a protected surface. A region cannot sit on a cart, checkout, confirmation or account route, cannot name a Checkout control or a required-disclosure control, and cannot target a protected control or a node inside one. An anchor cannot target a protected control.","message":"The extension surface reaches a protected surface.","severity":"error"},{"cause":"Every form needs a consent label and a privacyPath that names a declared page on the same site.","code":"FORM_CONSENT_REQUIRED","docsAnchor":"form-consent-required","docsUrl":"https://docs.thresho.com/reference/diagnostics#form-consent-required","family":"source","fix":"Every form needs a consent label and a privacyPath that names a declared page on the same site.","message":"Every form needs a consent label and a privacyPath that names a declared page on the same site.","severity":"error"},{"cause":"A form or field value is outside its bound.","code":"FORM_FIELD_BOUND","docsAnchor":"form-field-bound","docsUrl":"https://docs.thresho.com/reference/diagnostics#form-field-bound","family":"source","fix":"A form or field value is outside its bound. Check the field count, option count, route count, text length, date, time and numeric range.","message":"A form or field value is outside its bound.","severity":"error"},{"cause":"A form field kind is not supported.","code":"FORM_FIELD_KIND_UNSUPPORTED","docsAnchor":"form-field-kind-unsupported","docsUrl":"https://docs.thresho.com/reference/diagnostics#form-field-kind-unsupported","family":"source","fix":"A form field kind is not supported. Use text, email, tel, url, number, textarea, select, checkbox, radio-group, date or time.","message":"A form field kind is not supported.","severity":"error"},{"cause":"A form field name is reserved for thresho or for the renderer.","code":"FORM_FIELD_NAME_RESERVED","docsAnchor":"form-field-name-reserved","docsUrl":"https://docs.thresho.com/reference/diagnostics#form-field-name-reserved","family":"source","fix":"A form field name is reserved for thresho or for the renderer. Rename it.","message":"A form field name is reserved for thresho or for the renderer.","severity":"error"},{"cause":"A form declaration or placement is not accepted.","code":"FORM_INVALID","docsAnchor":"form-invalid","docsUrl":"https://docs.thresho.com/reference/diagnostics#form-invalid","family":"source","fix":"A form declaration or placement is not accepted. Check the form kind, its required email, date or rating field, the form id, and that every placing Form tag names a declared form of the same kind.","message":"A form declaration or placement is not accepted.","severity":"error"},{"cause":"A form field collects health, identity or payment data.","code":"FORM_PHI_FIELD_REFUSED","docsAnchor":"form-phi-field-refused","docsUrl":"https://docs.thresho.com/reference/diagnostics#form-phi-field-refused","family":"source","fix":"A form field collects health, identity or payment data. Remove it; a thresho form cannot collect special-category data.","message":"A form field collects health, identity or payment data.","severity":"error"},{"cause":"An SDK component is used where its data is not available, with an unknown prop, or outside its allowed parent.","code":"INVALID_BINDING","docsAnchor":"invalid-binding","docsUrl":"https://docs.thresho.com/reference/diagnostics#invalid-binding","family":"source","fix":"An SDK component is used where its data is not available, with an unknown prop, or outside its allowed parent. Move it inside the right route or parent, or remove the prop.","message":"An SDK component is used where its data is not available, with an unknown prop, or outside its allowed parent.","severity":"error"},{"cause":"A font slot declaration or a font binding is not accepted.","code":"INVALID_FONT","docsAnchor":"invalid-font","docsUrl":"https://docs.thresho.com/reference/diagnostics#invalid-font","family":"source","fix":"A font slot declaration or a font binding is not accepted. Declare 1 to 8 unique slots with an approved family, a weight in steps of 100, a style, a display value and a preload flag.","message":"A font slot declaration or a font binding is not accepted.","severity":"error"},{"cause":"A locale tag, the supported locale list, a locale prefix on an authored route, or a per-locale content map is not accepted.","code":"INVALID_LOCALE","docsAnchor":"invalid-locale","docsUrl":"https://docs.thresho.com/reference/diagnostics#invalid-locale","family":"source","fix":"A locale tag, the supported locale list, a locale prefix on an authored route, or a per-locale content map is not accepted. Use a lowercase language tag with an optional uppercase region, list 1 to 8 unique tags, include the default tag, and let thresho own the first path segment for every declared tag.","message":"A locale tag, the supported locale list, a locale prefix on an authored route, or a per-locale content map is not accepted.","severity":"error"},{"cause":"A media slot declaration, a Presentation.Image or Presentation.Video slot, or a media binding is not accepted.","code":"INVALID_MEDIA","docsAnchor":"invalid-media","docsUrl":"https://docs.thresho.com/reference/diagnostics#invalid-media","family":"source","fix":"A media slot declaration, a Presentation.Image or Presentation.Video slot, or a media binding is not accepted. Declare 1 to 32 unique slots with a kind and a backend, name a declared image slot as the poster, and keep every binding URL on the platform media origin.","message":"A media slot declaration, a Presentation.Image or Presentation.Video slot, or a media binding is not accepted.","severity":"error"},{"cause":"The manifest or file map is malformed.","code":"INVALID_PACKAGE","docsAnchor":"invalid-package","docsUrl":"https://docs.thresho.com/reference/diagnostics#invalid-package","family":"source","fix":"The manifest or file map is malformed. Check kind, formatVersion, id, name, journeys, routes, content and every file path against schema/source.schema.json.","message":"The manifest or file map is malformed.","severity":"error"},{"cause":"A route path, entry, capability or role is not accepted, a protected path is used without the role that owns it, a route path ends with a slash, or the journey rules below are not met.","code":"INVALID_ROUTE","docsAnchor":"invalid-route","docsUrl":"https://docs.thresho.com/reference/diagnostics#invalid-route","family":"source","fix":"A route path, entry, capability or role is not accepted, a protected path is used without the role that owns it, a route path ends with a slash, or the journey rules below are not met. The message names the rule.","message":"A route path, entry, capability or role is not accepted, a protected path is used without the role that owns it, a route path ends with a slash, or the journey rules below are not met.","severity":"error"},{"cause":"A file, stylesheet, content field or total size limit was exceeded.","code":"LIMIT_EXCEEDED","docsAnchor":"limit-exceeded","docsUrl":"https://docs.thresho.com/reference/diagnostics#limit-exceeded","family":"source","fix":"A file, stylesheet, content field or total size limit was exceeded. Split or shorten the source.","message":"A file, stylesheet, content field or total size limit was exceeded.","severity":"error"},{"cause":"An overlay operation produces source that the compiler refuses.","code":"OVERLAY_COMPILE_FAILED","docsAnchor":"overlay-compile-failed","docsUrl":"https://docs.thresho.com/reference/diagnostics#overlay-compile-failed","family":"overlay","fix":"Correct the named source rule or reset the overlay operation, then check again.","message":"The effective source does not compile.","severity":"error"},{"cause":"The authored source no longer supports the requested edit.","code":"OVERLAY_CONFLICT","docsAnchor":"overlay-conflict","docsUrl":"https://docs.thresho.com/reference/diagnostics#overlay-conflict","family":"overlay","fix":"Reload the current source and correct the named conflicting operation.","message":"The overlay operation conflicts with the source.","severity":"error"},{"cause":"An overlay operation has an unsupported shape or value.","code":"OVERLAY_INVALID","docsAnchor":"overlay-invalid","docsUrl":"https://docs.thresho.com/reference/diagnostics#overlay-invalid","family":"overlay","fix":"Correct the named operation using the declared extension surface.","message":"The overlay operation is invalid.","severity":"error"},{"cause":"An overlay operation changes a protected control or its required context.","code":"OVERLAY_PROTECTED_SURFACE","docsAnchor":"overlay-protected-surface","docsUrl":"https://docs.thresho.com/reference/diagnostics#overlay-protected-surface","family":"overlay","fix":"Remove the edit or choose an editable target outside the protected surface.","message":"The overlay targets a protected surface.","severity":"error"},{"cause":"An overlay operation names a target absent from the current source.","code":"OVERLAY_TARGET_UNKNOWN","docsAnchor":"overlay-target-unknown","docsUrl":"https://docs.thresho.com/reference/diagnostics#overlay-target-unknown","family":"overlay","fix":"Choose a declared target from the current template and retry the edit.","message":"The overlay target is unknown.","severity":"error"},{"cause":"The package artifact is larger than 3 MiB after JSON escaping.","code":"PACKAGE_BYTES_EXCEEDED","docsAnchor":"package-bytes-exceeded","docsUrl":"https://docs.thresho.com/reference/diagnostics#package-bytes-exceeded","family":"source","fix":"The package artifact is larger than 3 MiB after JSON escaping. Shorten long text or remove repeated content.","message":"The package artifact is larger than 3 MiB after JSON escaping.","severity":"error"},{"cause":"The package compiled view has more than 16384 nodes.","code":"PACKAGE_NODES_EXCEEDED","docsAnchor":"package-nodes-exceeded","docsUrl":"https://docs.thresho.com/reference/diagnostics#package-nodes-exceeded","family":"source","fix":"The package compiled view has more than 16384 nodes. Remove sections or share components.","message":"The package compiled view has more than 16384 nodes.","severity":"error"},{"cause":"An element id starts with the reserved prefix site-source-.","code":"RESERVED_ELEMENT_ID","docsAnchor":"reserved-element-id","docsUrl":"https://docs.thresho.com/reference/diagnostics#reserved-element-id","family":"source","fix":"An element id starts with the reserved prefix site-source-. Rename it; thresho keeps that prefix for its hydration payload and root.","message":"An element id starts with the reserved prefix site-source-.","severity":"error"},{"cause":"One route nests more than 32 elements deep.","code":"ROUTE_DEPTH_EXCEEDED","docsAnchor":"route-depth-exceeded","docsUrl":"https://docs.thresho.com/reference/diagnostics#route-depth-exceeded","family":"source","fix":"One route nests more than 32 elements deep. Flatten the markup.","message":"One route nests more than 32 elements deep.","severity":"error"},{"cause":"One route has more than 2048 compiled nodes.","code":"ROUTE_NODES_EXCEEDED","docsAnchor":"route-nodes-exceeded","docsUrl":"https://docs.thresho.com/reference/diagnostics#route-nodes-exceeded","family":"source","fix":"One route has more than 2048 compiled nodes. Split the page or remove sections.","message":"One route has more than 2048 compiled nodes.","severity":"error"},{"cause":"A search description contains fewer than 50 or more than 160 characters.","code":"SEO_DESCRIPTION_LENGTH","docsAnchor":"seo-description-length","docsUrl":"https://docs.thresho.com/reference/diagnostics#seo-description-length","family":"source","fix":"Use 50 to 160 Unicode code points in the search description.","message":"A search description is outside the suggested length.","severity":"warning"},{"cause":"A public route does not name a nonempty search description content field.","code":"SEO_DESCRIPTION_REQUIRED","docsAnchor":"seo-description-required","docsUrl":"https://docs.thresho.com/reference/diagnostics#seo-description-required","family":"source","fix":"Set seo.description to a declared content field with text for every supported locale.","message":"A route has no search description.","severity":"error"},{"cause":"A search title contains fewer than 10 or more than 60 characters.","code":"SEO_TITLE_LENGTH","docsAnchor":"seo-title-length","docsUrl":"https://docs.thresho.com/reference/diagnostics#seo-title-length","family":"source","fix":"Use 10 to 60 Unicode code points in the search title.","message":"A search title is outside the suggested length.","severity":"warning"},{"cause":"A public route does not name a nonempty search title content field.","code":"SEO_TITLE_REQUIRED","docsAnchor":"seo-title-required","docsUrl":"https://docs.thresho.com/reference/diagnostics#seo-title-required","family":"source","fix":"Set seo.title to a declared content field with text for every supported locale.","message":"A route has no search title.","severity":"error"},{"cause":"The package source is larger than 512 KiB in total.","code":"SOURCE_BYTES_EXCEEDED","docsAnchor":"source-bytes-exceeded","docsUrl":"https://docs.thresho.com/reference/diagnostics#source-bytes-exceeded","family":"source","fix":"The package source is larger than 512 KiB in total. Remove or shorten source files.","message":"The package source is larger than 512 KiB in total.","severity":"error"},{"cause":"One source file is larger than 64 KiB.","code":"SOURCE_FILE_BYTES_EXCEEDED","docsAnchor":"source-file-bytes-exceeded","docsUrl":"https://docs.thresho.com/reference/diagnostics#source-file-bytes-exceeded","family":"source","fix":"One source file is larger than 64 KiB. Split it into smaller files.","message":"One source file is larger than 64 KiB.","severity":"error"},{"cause":"A registered presentation token reaches a CSS property its kind does not allow, directly or through a custom-property alias.","code":"TOKEN_SINK_REFUSED","docsAnchor":"token-sink-refused","docsUrl":"https://docs.thresho.com/reference/diagnostics#token-sink-refused","family":"source","fix":"A registered presentation token reaches a CSS property its kind does not allow, directly or through a custom-property alias. Use a colour token only in a colour property, a spacing token only in gap, margin or padding, a radius token only in border-radius, the type token only in font-size, and the layout token only in a column property.","message":"A registered presentation token reaches a CSS property its kind does not allow, directly or through a custom-property alias.","severity":"error"},{"cause":"A construct outside the bounded source language was used: imports other than @thresho/site-sdk and local components, hooks, handlers, function calls, spreads, dynamic names, network access.","code":"UNSUPPORTED_SOURCE","docsAnchor":"unsupported-source","docsUrl":"https://docs.thresho.com/reference/diagnostics#unsupported-source","family":"source","fix":"A construct outside the bounded source language was used: imports other than @thresho/site-sdk and local components, hooks, handlers, function calls, spreads, dynamic names, network access. Replace it with an SDK component or plain markup.","message":"A construct outside the bounded source language was used: imports other than @thresho/site-sdk and local components, hooks, handlers, function calls, spreads, dynamic names, network access.","severity":"error"}],"formatVersion":2}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thresho/site-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,12 +21,14 @@
|
|
|
21
21
|
"./tsconfig.json": "./tsconfig.json",
|
|
22
22
|
"./schema/manifest.schema.json": "./schema/manifest.schema.json",
|
|
23
23
|
"./schema/source.schema.json": "./schema/source.schema.json",
|
|
24
|
-
"./vocabulary.json": "./vocabulary.json"
|
|
24
|
+
"./vocabulary.json": "./vocabulary.json",
|
|
25
|
+
"./diagnostics.json": "./diagnostics.json"
|
|
25
26
|
},
|
|
26
27
|
"files": [
|
|
27
28
|
"CHANGELOG.md",
|
|
28
29
|
"LICENSE",
|
|
29
30
|
"README.md",
|
|
31
|
+
"diagnostics.json",
|
|
30
32
|
"index.d.ts",
|
|
31
33
|
"jsx-dev-runtime.d.ts",
|
|
32
34
|
"jsx-runtime.d.ts",
|
|
@@ -38,6 +40,6 @@
|
|
|
38
40
|
"thresho": {
|
|
39
41
|
"formatVersion": 2,
|
|
40
42
|
"compilerVersion": "site-source-compiler/10",
|
|
41
|
-
"vocabularyDigest": "
|
|
43
|
+
"vocabularyDigest": "c39d5c38e77cd041167eb953514c6de5c6b3acf8d6450a226db5d7494e76e638"
|
|
42
44
|
}
|
|
43
45
|
}
|