@decocms/blocks 8.9.1 โ 8.11.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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol/channel.d.ts +98 -0
- package/dist/protocol/channel.d.ts.map +1 -0
- package/dist/protocol/channel.js +58 -0
- package/dist/protocol/channel.js.map +1 -0
- package/dist/protocol/client.js +2 -2
- package/dist/protocol/client.js.map +1 -1
- package/dist/protocol/conformance/blockMetaVectors.json +214 -0
- package/dist/protocol/conformance/contentHashFixtures.d.ts +22 -0
- package/dist/protocol/conformance/contentHashFixtures.d.ts.map +1 -1
- package/dist/protocol/conformance/contentHashFixtures.js +55 -0
- package/dist/protocol/conformance/contentHashFixtures.js.map +1 -1
- package/dist/protocol/conformance/index.d.ts +2 -1
- package/dist/protocol/conformance/index.d.ts.map +1 -1
- package/dist/protocol/conformance/index.js +2 -1
- package/dist/protocol/conformance/index.js.map +1 -1
- package/dist/protocol/conformance/vectors.d.ts +33 -0
- package/dist/protocol/conformance/vectors.d.ts.map +1 -0
- package/dist/protocol/conformance/vectors.js +3 -0
- package/dist/protocol/conformance/vectors.js.map +1 -0
- package/dist/protocol/index.d.ts +11 -1
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js +11 -1
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/keys.d.ts +1 -1
- package/dist/protocol/keys.js +1 -1
- package/dist/v8/background.d.ts +13 -0
- package/dist/v8/background.d.ts.map +1 -1
- package/dist/v8/background.js +41 -0
- package/dist/v8/background.js.map +1 -1
- package/dist/v8/blockMeta.d.ts +27 -0
- package/dist/v8/blockMeta.d.ts.map +1 -0
- package/dist/v8/blockMeta.js +75 -0
- package/dist/v8/blockMeta.js.map +1 -0
- package/dist/v8/blockStore.d.ts +43 -0
- package/dist/v8/blockStore.d.ts.map +1 -0
- package/dist/v8/blockStore.js +95 -0
- package/dist/v8/blockStore.js.map +1 -0
- package/dist/v8/boundedJson.d.ts +5 -0
- package/dist/v8/boundedJson.d.ts.map +1 -1
- package/dist/v8/boundedJson.js +10 -2
- package/dist/v8/boundedJson.js.map +1 -1
- package/dist/v8/boundedMap.d.ts +19 -0
- package/dist/v8/boundedMap.d.ts.map +1 -0
- package/dist/v8/boundedMap.js +52 -0
- package/dist/v8/boundedMap.js.map +1 -0
- package/dist/v8/builtins/data.d.ts +18 -2
- package/dist/v8/builtins/data.d.ts.map +1 -1
- package/dist/v8/builtins/data.js +17 -1
- package/dist/v8/builtins/data.js.map +1 -1
- package/dist/v8/builtins/index.d.ts.map +1 -1
- package/dist/v8/builtins/index.js +2 -1
- package/dist/v8/builtins/index.js.map +1 -1
- package/dist/v8/builtins/legacy.d.ts +6 -3
- package/dist/v8/builtins/legacy.d.ts.map +1 -1
- package/dist/v8/builtins/legacy.js +6 -3
- package/dist/v8/builtins/legacy.js.map +1 -1
- package/dist/v8/canonical.d.ts +8 -0
- package/dist/v8/canonical.d.ts.map +1 -1
- package/dist/v8/canonical.js +15 -0
- package/dist/v8/canonical.js.map +1 -1
- package/dist/v8/cli/builtins.d.ts.map +1 -1
- package/dist/v8/cli/builtins.js +1 -0
- package/dist/v8/cli/builtins.js.map +1 -1
- package/dist/v8/cli/check/index.d.ts +10 -0
- package/dist/v8/cli/check/index.d.ts.map +1 -1
- package/dist/v8/cli/check/index.js +91 -7
- package/dist/v8/cli/check/index.js.map +1 -1
- package/dist/v8/cli/content.d.ts +12 -25
- package/dist/v8/cli/content.d.ts.map +1 -1
- package/dist/v8/cli/content.js +46 -75
- package/dist/v8/cli/content.js.map +1 -1
- package/dist/v8/cli/index.d.ts +2 -2
- package/dist/v8/cli/index.d.ts.map +1 -1
- package/dist/v8/cli/index.js +2 -2
- package/dist/v8/cli/index.js.map +1 -1
- package/dist/v8/cli/remote/commands.d.ts +71 -0
- package/dist/v8/cli/remote/commands.d.ts.map +1 -0
- package/dist/v8/cli/remote/commands.js +644 -0
- package/dist/v8/cli/remote/commands.js.map +1 -0
- package/dist/v8/cli/remote/diff.d.ts +15 -0
- package/dist/v8/cli/remote/diff.d.ts.map +1 -0
- package/dist/v8/cli/remote/diff.js +102 -0
- package/dist/v8/cli/remote/diff.js.map +1 -0
- package/dist/v8/cli/remote/env.d.ts +35 -0
- package/dist/v8/cli/remote/env.d.ts.map +1 -0
- package/dist/v8/cli/remote/env.js +84 -0
- package/dist/v8/cli/remote/env.js.map +1 -0
- package/dist/v8/cli/remote/http.d.ts +149 -0
- package/dist/v8/cli/remote/http.d.ts.map +1 -0
- package/dist/v8/cli/remote/http.js +381 -0
- package/dist/v8/cli/remote/http.js.map +1 -0
- package/dist/v8/cli/remote/local.d.ts +90 -0
- package/dist/v8/cli/remote/local.d.ts.map +1 -0
- package/dist/v8/cli/remote/local.js +309 -0
- package/dist/v8/cli/remote/local.js.map +1 -0
- package/dist/v8/cli/root.d.ts +29 -0
- package/dist/v8/cli/root.d.ts.map +1 -1
- package/dist/v8/cli/root.js +28 -0
- package/dist/v8/cli/root.js.map +1 -1
- package/dist/v8/cli/run.d.ts +13 -1
- package/dist/v8/cli/run.d.ts.map +1 -1
- package/dist/v8/cli/run.js +310 -124
- package/dist/v8/cli/run.js.map +1 -1
- package/dist/v8/cli/schema/builtinSchemas.d.ts.map +1 -1
- package/dist/v8/cli/schema/builtinSchemas.js +28 -10
- package/dist/v8/cli/schema/builtinSchemas.js.map +1 -1
- package/dist/v8/cli/schema/generate.js +1 -1
- package/dist/v8/cli/schema/generate.js.map +1 -1
- package/dist/v8/cli/skills.d.ts +25 -0
- package/dist/v8/cli/skills.d.ts.map +1 -0
- package/dist/v8/cli/skills.js +70 -0
- package/dist/v8/cli/skills.js.map +1 -0
- package/dist/v8/client.d.ts +9 -9
- package/dist/v8/client.d.ts.map +1 -1
- package/dist/v8/client.js +138 -50
- package/dist/v8/client.js.map +1 -1
- package/dist/v8/cms.d.ts +2 -1
- package/dist/v8/cms.d.ts.map +1 -1
- package/dist/v8/cms.js +55 -46
- package/dist/v8/cms.js.map +1 -1
- package/dist/v8/content.d.ts +39 -78
- package/dist/v8/content.d.ts.map +1 -1
- package/dist/v8/content.js +155 -195
- package/dist/v8/content.js.map +1 -1
- package/dist/v8/contentIndex.d.ts +71 -0
- package/dist/v8/contentIndex.d.ts.map +1 -0
- package/dist/v8/contentIndex.js +137 -0
- package/dist/v8/contentIndex.js.map +1 -0
- package/dist/v8/draft.d.ts +7 -7
- package/dist/v8/draft.d.ts.map +1 -1
- package/dist/v8/draft.js +10 -9
- package/dist/v8/draft.js.map +1 -1
- package/dist/v8/draftChanges.d.ts +59 -32
- package/dist/v8/draftChanges.d.ts.map +1 -1
- package/dist/v8/draftChanges.js +139 -75
- package/dist/v8/draftChanges.js.map +1 -1
- package/dist/v8/errors.d.ts +21 -0
- package/dist/v8/errors.d.ts.map +1 -1
- package/dist/v8/errors.js +22 -0
- package/dist/v8/errors.js.map +1 -1
- package/dist/v8/hostedSource.d.ts +57 -0
- package/dist/v8/hostedSource.d.ts.map +1 -0
- package/dist/v8/hostedSource.js +18 -0
- package/dist/v8/hostedSource.js.map +1 -0
- package/dist/v8/identity.d.ts +1 -1
- package/dist/v8/identity.js +1 -1
- package/dist/v8/index.d.ts +1 -0
- package/dist/v8/index.d.ts.map +1 -1
- package/dist/v8/index.js +1 -0
- package/dist/v8/index.js.map +1 -1
- package/dist/v8/matchRoute.js +7 -4
- package/dist/v8/matchRoute.js.map +1 -1
- package/dist/v8/pin.d.ts +34 -0
- package/dist/v8/pin.d.ts.map +1 -0
- package/dist/v8/pin.js +156 -0
- package/dist/v8/pin.js.map +1 -0
- package/dist/v8/preview/StudioBridge.d.ts +8 -8
- package/dist/v8/preview/StudioBridge.d.ts.map +1 -1
- package/dist/v8/preview/StudioBridge.js +8 -10
- package/dist/v8/preview/StudioBridge.js.map +1 -1
- package/dist/v8/preview/StudioChannel.d.ts +51 -0
- package/dist/v8/preview/StudioChannel.d.ts.map +1 -0
- package/dist/v8/preview/StudioChannel.js +104 -0
- package/dist/v8/preview/StudioChannel.js.map +1 -0
- package/dist/v8/preview/index.d.ts +3 -0
- package/dist/v8/preview/index.d.ts.map +1 -1
- package/dist/v8/preview/index.js +3 -0
- package/dist/v8/preview/index.js.map +1 -1
- package/dist/v8/remoteLoader.d.ts +42 -5
- package/dist/v8/remoteLoader.d.ts.map +1 -1
- package/dist/v8/remoteLoader.js +317 -259
- package/dist/v8/remoteLoader.js.map +1 -1
- package/dist/v8/resolver.d.ts +22 -8
- package/dist/v8/resolver.d.ts.map +1 -1
- package/dist/v8/resolver.js +37 -32
- package/dist/v8/resolver.js.map +1 -1
- package/dist/v8/revisionId.d.ts +11 -0
- package/dist/v8/revisionId.d.ts.map +1 -0
- package/dist/v8/revisionId.js +13 -0
- package/dist/v8/revisionId.js.map +1 -0
- package/dist/v8/settings.d.ts +6 -6
- package/dist/v8/settings.d.ts.map +1 -1
- package/dist/v8/settings.js +8 -7
- package/dist/v8/settings.js.map +1 -1
- package/dist/v8/telemetry.d.ts +4 -2
- package/dist/v8/telemetry.d.ts.map +1 -1
- package/dist/v8/telemetry.js +2 -2
- package/dist/v8/telemetry.js.map +1 -1
- package/dist/v8/types.d.ts +52 -40
- package/dist/v8/types.d.ts.map +1 -1
- package/dist/v8/variants.d.ts +7 -2
- package/dist/v8/variants.d.ts.map +1 -1
- package/dist/v8/variants.js +21 -24
- package/dist/v8/variants.js.map +1 -1
- package/dist/v8/vite/index.d.ts +2 -2
- package/dist/v8/vite/index.js +1 -1
- package/dist/v8/vite/index.js.map +1 -1
- package/package.json +3 -2
- package/skills/deco-apps/SKILL.md +82 -0
- package/skills/deco-apps/references/algolia.md +51 -0
- package/skills/deco-apps/references/commerce-types.md +132 -0
- package/skills/deco-apps/references/instrumented-fetch.md +144 -0
- package/skills/deco-apps/references/magento.md +55 -0
- package/skills/deco-apps/references/messaging.md +76 -0
- package/skills/deco-apps/references/shopify.md +69 -0
- package/skills/deco-apps/references/vendored-loaders.md +135 -0
- package/skills/deco-apps/references/vtex-cookies-auth.md +146 -0
- package/skills/deco-apps/references/vtex.md +150 -0
- package/skills/deco-apps/references/wake.md +75 -0
- package/skills/deco-cms-schema/SKILL.md +80 -0
- package/skills/deco-cms-schema/references/annotations.md +147 -0
- package/skills/deco-cms-schema/references/content-hygiene.md +91 -0
- package/skills/deco-cms-schema/references/formats-and-widgets.md +112 -0
- package/skills/deco-cms-schema/references/shapes-that-break-the-form.md +165 -0
- package/skills/deco-cms-schema/references/types-to-fields.md +112 -0
- package/skills/deco-go-live/SKILL.md +127 -0
- package/skills/deco-go-live/references/content-releases.md +90 -0
- package/skills/deco-go-live/references/process.md +106 -0
- package/skills/deco-go-live/references/proxy-headers-checkout.md +139 -0
- package/skills/deco-go-live/references/qa-checklist-template.md +150 -0
- package/skills/deco-go-live/references/qa-inventory.md +120 -0
- package/skills/deco-go-live/references/react-spa.md +183 -0
- package/skills/deco-go-live/references/seo-analytics.md +114 -0
- package/skills/deco-go-live/references/traffic-ramp.md +87 -0
- package/skills/deco-go-live/references/worker-runtime.md +93 -0
- package/skills/deco-go-live/scripts/preflight.sh +221 -0
- package/skills/deco-images-media/SKILL.md +64 -0
- package/skills/deco-images-media/references/asset-upload.md +191 -0
- package/skills/deco-images-media/references/components-per-binding.md +167 -0
- package/skills/deco-images-media/references/providers-and-cdn.md +145 -0
- package/skills/deco-images-media/references/quality-and-lcp.md +93 -0
- package/skills/deco-images-media/references/troubleshooting.md +147 -0
- package/skills/deco-images-media/references/video.md +122 -0
- package/skills/deco-make-editable/SKILL.md +94 -0
- package/skills/deco-make-editable/references/a11y-and-e2e.md +104 -0
- package/skills/deco-make-editable/references/content-shapes.md +198 -0
- package/skills/deco-make-editable/references/from-figma.md +110 -0
- package/skills/deco-make-editable/references/i18n-fields.md +112 -0
- package/skills/deco-make-editable/references/inventory.md +79 -0
- package/skills/deco-make-editable/references/pixel-parity.md +175 -0
- package/skills/deco-make-editable/references/seeding-content.md +119 -0
- package/skills/deco-nextjs-site/SKILL.md +74 -0
- package/skills/deco-nextjs-site/references/caching.md +116 -0
- package/skills/deco-nextjs-site/references/metadata-seo.md +100 -0
- package/skills/deco-nextjs-site/references/proxy-and-drafts.md +177 -0
- package/skills/deco-nextjs-site/references/rendering.md +171 -0
- package/skills/deco-nextjs-site/references/setup.md +190 -0
- package/skills/deco-nextjs-site/references/studio-bridge.md +130 -0
- package/skills/deco-site-authoring/SKILL.md +75 -0
- package/skills/deco-site-authoring/references/lazy-blocks.md +155 -0
- package/skills/deco-site-authoring/references/loaders.md +192 -0
- package/skills/deco-site-authoring/references/pages.md +156 -0
- package/skills/deco-site-authoring/references/review-before-publish.md +95 -0
- package/skills/deco-site-authoring/references/sections.md +158 -0
- package/skills/deco-site-authoring/references/seo.md +116 -0
- package/skills/deco-site-workflow/SKILL.md +92 -0
- package/skills/deco-site-workflow/references/check.md +116 -0
- package/skills/deco-site-workflow/references/cli-reference.md +104 -0
- package/skills/deco-site-workflow/references/content-layout.md +93 -0
- package/skills/deco-site-workflow/references/content-sync.md +146 -0
- package/skills/deco-site-workflow/references/delivery.md +51 -0
- package/skills/deco-site-workflow/references/deploy.md +87 -0
- package/skills/deco-site-workflow/references/schema.md +173 -0
- package/skills/deco-site-workflow/references/serve-and-studio.md +138 -0
- package/skills/deco-storefront-caching/SKILL.md +67 -0
- package/skills/deco-storefront-caching/references/cache-keys.md +129 -0
- package/skills/deco-storefront-caching/references/case-study.md +82 -0
- package/skills/deco-storefront-caching/references/egress-traps.md +153 -0
- package/skills/deco-storefront-caching/references/nextjs.md +60 -0
- package/skills/deco-storefront-caching/references/perf-guardrails-e2e.md +123 -0
- package/skills/deco-storefront-caching/references/verification.md +136 -0
- package/skills/deco-storefront-caching/references/worker-page-cache.md +160 -0
- package/skills/deco-storefront-caching/scripts/html-anatomy.mjs +97 -0
- package/skills/deco-storefront-performance/SKILL.md +81 -0
- package/skills/deco-storefront-performance/references/cls-third-party.md +90 -0
- package/skills/deco-storefront-performance/references/hydration.md +116 -0
- package/skills/deco-storefront-performance/references/loaders-n-plus-1.md +107 -0
- package/skills/deco-storefront-performance/references/navigation-ux.md +130 -0
- package/skills/deco-storefront-performance/references/payload-trim.md +163 -0
- package/skills/deco-storefront-performance/references/render-location.md +152 -0
- package/skills/deco-storefront-performance/references/request-dedupe.md +147 -0
- package/skills/deco-storefront-performance/references/trace-reading.md +79 -0
- package/skills/deco-storefront-performance/references/worker-memory.md +176 -0
- package/skills/deco-tanstack-site/SKILL.md +68 -0
- package/skills/deco-tanstack-site/references/document-and-security.md +155 -0
- package/skills/deco-tanstack-site/references/router-and-navigation.md +137 -0
- package/skills/deco-tanstack-site/references/routes-and-pages.md +183 -0
- package/skills/deco-tanstack-site/references/server-functions.md +123 -0
- package/skills/deco-tanstack-site/references/setup.md +153 -0
- package/skills/deco-tanstack-site/references/worker-entry.md +152 -0
- package/skills/deco-v7-to-v8-migration/SKILL.md +122 -0
- package/skills/deco-v7-to-v8-migration/references/caching-and-privacy.md +10 -0
- package/skills/deco-v7-to-v8-migration/references/content.md +25 -0
- package/skills/deco-v7-to-v8-migration/references/editor-forms.md +27 -0
- package/skills/deco-v7-to-v8-migration/references/faststore.md +40 -0
- package/skills/deco-v7-to-v8-migration/references/framework-code.md +53 -0
- package/skills/deco-v7-to-v8-migration/references/hosted-releases.md +16 -0
- package/skills/deco-v7-to-v8-migration/references/import-map.md +81 -0
- package/skills/deco-v7-to-v8-migration/references/legacy-names.md +33 -0
- package/skills/deco-v7-to-v8-migration/references/manual-steps.md +10 -0
- package/skills/deco-v7-to-v8-migration/references/native-apps.md +43 -0
- package/skills/deco-v7-to-v8-migration/references/nextjs.md +19 -0
- package/skills/deco-v7-to-v8-migration/references/parity.md +66 -0
- package/skills/deco-v7-to-v8-migration/references/rendering.md +13 -0
- package/skills/deco-v7-to-v8-migration/references/running-the-script.md +29 -0
- package/skills/deco-v7-to-v8-migration/references/script-steps.md +13 -0
- package/skills/deco-v7-to-v8-migration/references/server-functions.md +15 -0
- package/skills/deco-v7-to-v8-migration/references/sibling-port.md +11 -0
- package/skills/deco-v7-to-v8-migration/references/site-code.md +15 -0
- package/skills/deco-v7-to-v8-migration/references/telemetry.md +10 -0
- package/skills/deco-v7-to-v8-migration/references/verify.md +20 -0
- package/skills/deco-v7-to-v8-migration/scripts/apps.ts +297 -0
- package/skills/deco-v7-to-v8-migration/scripts/asyncRendering.ts +73 -0
- package/skills/deco-v7-to-v8-migration/scripts/blockMap.ts +584 -0
- package/skills/deco-v7-to-v8-migration/scripts/ciSchemaCheck.ts +145 -0
- package/skills/deco-v7-to-v8-migration/scripts/compat.ts +357 -0
- package/skills/deco-v7-to-v8-migration/scripts/content.ts +121 -0
- package/skills/deco-v7-to-v8-migration/scripts/experiments.ts +81 -0
- package/skills/deco-v7-to-v8-migration/scripts/framework.ts +61 -0
- package/skills/deco-v7-to-v8-migration/scripts/imageCopy.ts +276 -0
- package/skills/deco-v7-to-v8-migration/scripts/imageModule.ts +285 -0
- package/skills/deco-v7-to-v8-migration/scripts/imports.ts +942 -0
- package/skills/deco-v7-to-v8-migration/scripts/invoke.ts +624 -0
- package/skills/deco-v7-to-v8-migration/scripts/legacyNames.ts +45 -0
- package/skills/deco-v7-to-v8-migration/scripts/main.ts +59 -0
- package/skills/deco-v7-to-v8-migration/scripts/matchers.ts +41 -0
- package/skills/deco-v7-to-v8-migration/scripts/migrate.ts +176 -0
- package/skills/deco-v7-to-v8-migration/scripts/redirects.ts +455 -0
- package/skills/deco-v7-to-v8-migration/scripts/report.ts +50 -0
- package/skills/deco-v7-to-v8-migration/scripts/scaffold.ts +1119 -0
- package/skills/deco-v7-to-v8-migration/scripts/secrets.ts +35 -0
- package/skills/deco-v7-to-v8-migration/scripts/sectionLoaders.ts +216 -0
- package/skills/deco-v7-to-v8-migration/scripts/siteSettings.ts +261 -0
- package/skills/deco-v7-to-v8-migration/scripts/stubs.ts +388 -0
- package/skills/deco-v7-to-v8-migration/scripts/tsconfig.json +7 -0
- package/skills/deco-v7-to-v8-migration/scripts/vendor.ts +249 -0
- package/skills/deco-v7-to-v8-migration/scripts/vtexInvoke.ts +240 -0
- package/skills/deco-v7-to-v8-migration/scripts/walk.ts +30 -0
- package/skills/deco-variants/SKILL.md +57 -0
- package/skills/deco-variants/references/caching-variants.md +63 -0
- package/skills/deco-variants/references/custom-matchers.md +83 -0
- package/skills/deco-variants/references/draft-preview.md +59 -0
- package/skills/deco-variants/references/experiments-and-campaigns.md +104 -0
- package/skills/deco-variants/references/multivariate.md +85 -0
- package/skills/deco-variants/references/v7-matchers.md +71 -0
- package/src/index.ts +2 -0
- package/src/protocol/channel.ts +127 -0
- package/src/protocol/client.ts +2 -2
- package/src/protocol/conformance/blockMetaVectors.json +214 -0
- package/src/protocol/conformance/contentHashFixtures.ts +74 -0
- package/src/protocol/conformance/index.ts +9 -1
- package/src/protocol/conformance/vectors.ts +36 -0
- package/src/protocol/index.ts +32 -0
- package/src/protocol/keys.ts +1 -1
- package/src/v8/background.ts +42 -0
- package/src/v8/blockMeta.ts +100 -0
- package/src/v8/blockStore.ts +124 -0
- package/src/v8/boundedJson.ts +20 -2
- package/src/v8/boundedMap.ts +53 -0
- package/src/v8/builtins/data.ts +26 -2
- package/src/v8/builtins/index.ts +2 -1
- package/src/v8/builtins/legacy.ts +6 -3
- package/src/v8/canonical.ts +15 -0
- package/src/v8/cli/builtins.ts +1 -0
- package/src/v8/cli/check/index.ts +97 -7
- package/src/v8/cli/content.ts +49 -91
- package/src/v8/cli/index.ts +2 -2
- package/src/v8/cli/remote/commands.ts +834 -0
- package/src/v8/cli/remote/diff.ts +100 -0
- package/src/v8/cli/remote/env.ts +107 -0
- package/src/v8/cli/remote/http.ts +484 -0
- package/src/v8/cli/remote/local.ts +343 -0
- package/src/v8/cli/root.ts +40 -0
- package/src/v8/cli/run.ts +366 -135
- package/src/v8/cli/schema/builtinSchemas.ts +29 -10
- package/src/v8/cli/schema/generate.ts +1 -1
- package/src/v8/cli/skills.ts +91 -0
- package/src/v8/client.ts +162 -60
- package/src/v8/cms.ts +62 -53
- package/src/v8/content.ts +179 -229
- package/src/v8/contentIndex.ts +183 -0
- package/src/v8/draft.ts +15 -14
- package/src/v8/draftChanges.ts +151 -85
- package/src/v8/errors.ts +37 -0
- package/src/v8/hostedSource.ts +67 -0
- package/src/v8/identity.ts +1 -1
- package/src/v8/index.ts +1 -0
- package/src/v8/matchRoute.ts +7 -4
- package/src/v8/pin.ts +176 -0
- package/src/v8/preview/StudioBridge.ts +8 -10
- package/src/v8/preview/StudioChannel.ts +116 -0
- package/src/v8/preview/index.ts +3 -0
- package/src/v8/remoteLoader.ts +350 -286
- package/src/v8/resolver.ts +56 -33
- package/src/v8/revisionId.ts +14 -0
- package/src/v8/settings.ts +10 -9
- package/src/v8/telemetry.ts +3 -3
- package/src/v8/types.ts +52 -40
- package/src/v8/variants.ts +30 -26
- package/src/v8/vite/index.ts +3 -3
- package/dist/v8/cli/serve/server.d.ts +0 -29
- package/dist/v8/cli/serve/server.d.ts.map +0 -1
- package/dist/v8/cli/serve/server.js +0 -296
- package/dist/v8/cli/serve/server.js.map +0 -1
- package/src/v8/cli/serve/server.ts +0 -348
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Content hygiene: fields that should not exist
|
|
2
|
+
|
|
3
|
+
A form is easier to use with fewer, better fields. This file covers what to
|
|
4
|
+
render when fields are empty, which fields to remove, and how to remove one
|
|
5
|
+
without breaking saved content.
|
|
6
|
+
|
|
7
|
+
## Render something sensible with empty props
|
|
8
|
+
|
|
9
|
+
A new block starts with nothing filled in, and an optional prop arrives as
|
|
10
|
+
`undefined`. The section must not throw and should not render blank: a
|
|
11
|
+
realistic default is how an editor learns what a field is for.
|
|
12
|
+
|
|
13
|
+
Declare `DEFAULT_*` constants for what optional fields fall back to, and use
|
|
14
|
+
them once, where props enter the component, instead of scattering
|
|
15
|
+
`?? something` through the JSX.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
const DEFAULT_TITLE = "New arrivals";
|
|
19
|
+
|
|
20
|
+
export function Shelf({ title = DEFAULT_TITLE, products = [] }: Props) {
|
|
21
|
+
// โฆ
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`@default` only writes `default` into the schema. It does not change what
|
|
26
|
+
your component receives for content saved without the field, so keep the code
|
|
27
|
+
default too.
|
|
28
|
+
|
|
29
|
+
## Dead fields: the editor sets them, nothing happens
|
|
30
|
+
|
|
31
|
+
A field that reaches no DOM attribute is worse than a missing one. The editor
|
|
32
|
+
changes it, sees no effect, and decides the CMS is broken.
|
|
33
|
+
|
|
34
|
+
They pile up when a shared type is reused for a narrower purpose: a `Cta` type
|
|
35
|
+
with `buttonStyle`, `backgroundColor`, `hoverColor` and `showArrowIcon`,
|
|
36
|
+
attached to a section that only reads `url` and `text`. Give that section its
|
|
37
|
+
own narrower type.
|
|
38
|
+
|
|
39
|
+
Check the result in `.deco/schema.gen.json`, not in the `.tsx` diff: every
|
|
40
|
+
removed field gone from the block's definition, every kept field still there.
|
|
41
|
+
|
|
42
|
+
## Layout controls posing as content
|
|
43
|
+
|
|
44
|
+
A field should carry an editorial decision: which image, which text, which
|
|
45
|
+
color, how many items. Not a layout one: card width in pixels, a desktop gap
|
|
46
|
+
and a separate mobile gap as raw numbers.
|
|
47
|
+
|
|
48
|
+
The test: remove the field and fix one value in the component. Does the
|
|
49
|
+
editor lose a decision they really need to make? If not, it is not a prop.
|
|
50
|
+
One content review removed a set of these because every editor used the same
|
|
51
|
+
value anyway. The fields only added a way to break the layout by accident.
|
|
52
|
+
|
|
53
|
+
When a developer escape hatch has to stay visible, end its `@title` with
|
|
54
|
+
"(advanced)" so editors can tell it from fields meant for daily use.
|
|
55
|
+
|
|
56
|
+
## Removing or renaming a field with saved content
|
|
57
|
+
|
|
58
|
+
`deco check` rejects a key that the code does not declare. Keys starting with
|
|
59
|
+
`_`, `$` or `@` are exempt. So deleting or renaming a prop makes every saved
|
|
60
|
+
block that still has the old key fail `deco check`.
|
|
61
|
+
|
|
62
|
+
Two safe paths:
|
|
63
|
+
|
|
64
|
+
- **Migrate the content in the same change.** Update the saved blocks so no
|
|
65
|
+
value uses the old key, run `deco check`, and ship both together. How to
|
|
66
|
+
edit content and send it as a draft is in the `deco-site-workflow` skill.
|
|
67
|
+
- **Retire the field first.** Keep it in the type with `@hide` and
|
|
68
|
+
`@deprecated`, with a `//` comment saying what replaced it. Content keeps
|
|
69
|
+
validating; editors no longer see it. Delete it once no content uses it.
|
|
70
|
+
|
|
71
|
+
`@ignore` is not a way to retire a field: it removes the field from the
|
|
72
|
+
schema, so saved values fail `deco check` just as if it were deleted.
|
|
73
|
+
|
|
74
|
+
## Placeholder content
|
|
75
|
+
|
|
76
|
+
Blocks left with lorem ipsum, placeholder image URLs, or hidden on the page
|
|
77
|
+
render nothing useful and clutter the form with entries an editor cannot tell
|
|
78
|
+
from real ones. Delete them before handing the site over.
|
|
79
|
+
|
|
80
|
+
## Structure
|
|
81
|
+
|
|
82
|
+
- Past about 30โ40 lines of `Props`, or once there are two or more nested
|
|
83
|
+
types (an array item, a variant union), move the types to a sibling
|
|
84
|
+
`types.ts`. Types only, no logic.
|
|
85
|
+
- More than about eight top-level fields with no grouping reads as a wall of
|
|
86
|
+
inputs. Group them into named nested objects (`/** @title Colors */ colors:
|
|
87
|
+
{โฆ}`).
|
|
88
|
+
- When two or more sections need the same piece of form (same field, same
|
|
89
|
+
label, same `@description`), extract a shared type and compose it. Image
|
|
90
|
+
pairs (desktop and mobile) and autoplay settings are the usual candidates.
|
|
91
|
+
Sections that should behave the same drift apart otherwise.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Formats and widgets
|
|
2
|
+
|
|
3
|
+
A field's `format` picks its widget in Studio. There are three ways to set it:
|
|
4
|
+
|
|
5
|
+
1. `@format` on the **field** itself. This always wins.
|
|
6
|
+
2. A **widget alias** as the field's type (`image: ImageWidget`).
|
|
7
|
+
3. `@format` on a **type alias** the field uses. It applies only when no
|
|
8
|
+
widget alias already set a format.
|
|
9
|
+
|
|
10
|
+
All three end up as the same `format` string in `.deco/schema.gen.json`.
|
|
11
|
+
|
|
12
|
+
## Widget aliases
|
|
13
|
+
|
|
14
|
+
`deco schema` matches these by **name, as written on the prop**
|
|
15
|
+
(`WIDGET_TYPE_FORMATS` in `typeToSchema.ts`). Each is a `string`.
|
|
16
|
+
|
|
17
|
+
| Alias | `format` |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `ImageWidget` | `image-uri` |
|
|
20
|
+
| `VideoWidget` | `video-uri` |
|
|
21
|
+
| `HTMLWidget` | `html` |
|
|
22
|
+
| `RichText` | `rich-text` |
|
|
23
|
+
| `Color` | `color` |
|
|
24
|
+
| `TextArea` | `textarea` |
|
|
25
|
+
| `Code` | `code` |
|
|
26
|
+
| `DateTimeWidget` | `date-time` |
|
|
27
|
+
| `Secret` | `password` |
|
|
28
|
+
|
|
29
|
+
Where to get them:
|
|
30
|
+
|
|
31
|
+
- `@decocms/compat-v7/types/widgets` (also re-exported from
|
|
32
|
+
`@decocms/compat-v7/types` and `@decocms/compat-v7`) exports `ImageWidget`,
|
|
33
|
+
`VideoWidget`, `HTMLWidget`, `RichText`, `TextArea`, `Color`, `Secret`, plus
|
|
34
|
+
`TextWidget` and `ButtonWidget`.
|
|
35
|
+
- `Code` and `DateTimeWidget` are not exported there. Because the match is by
|
|
36
|
+
name, a site can declare `type Code = string` itself and get the widget.
|
|
37
|
+
- `TextWidget` and `ButtonWidget` have no format. They are plain text fields.
|
|
38
|
+
|
|
39
|
+
The alias also works inside the annotation: `ImageWidget[]` sets the format on
|
|
40
|
+
the items, and `ImageWidget | null` or an optional field works too. The match is a whole
|
|
41
|
+
word, so `BrandColor` does not count as `Color`.
|
|
42
|
+
|
|
43
|
+
Other names are not guessed from. For a `BrandColor` alias, put
|
|
44
|
+
`@format color` on the alias or on the field.
|
|
45
|
+
|
|
46
|
+
`Secret` is a masked text box, nothing more. The value is a plain string saved
|
|
47
|
+
in content. Real credentials belong in the deploy platform's secrets, read by
|
|
48
|
+
the site's code.
|
|
49
|
+
|
|
50
|
+
## `@format` on a type alias
|
|
51
|
+
|
|
52
|
+
`@format` on a type alias reaches every field typed with it, including a
|
|
53
|
+
literal select and arrays of it. A field's own `@format` still wins.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
/** @format color */
|
|
57
|
+
type TextTone = "black" | "white";
|
|
58
|
+
|
|
59
|
+
interface Props {
|
|
60
|
+
/** @title Text color */
|
|
61
|
+
tone: TextTone; // select with format "color"
|
|
62
|
+
/** @title Palette */
|
|
63
|
+
palette: TextTone[]; // items get format "color"
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## `@format` values
|
|
68
|
+
|
|
69
|
+
The generator passes any `@format` value through unchanged, except `datetime`,
|
|
70
|
+
which it rewrites to `date-time` (`FORMAT_ALIASES`).
|
|
71
|
+
|
|
72
|
+
`deco check` validates only three formats on saved content:
|
|
73
|
+
|
|
74
|
+
| `@format` | `deco check` accepts |
|
|
75
|
+
|---|---|
|
|
76
|
+
| `date` | A real calendar date, `YYYY-MM-DD` |
|
|
77
|
+
| `date-time` | A date, `T` or a space, and a time; seconds and zone optional |
|
|
78
|
+
| `uri` | A parseable URL with a scheme |
|
|
79
|
+
|
|
80
|
+
Every other format (`image-uri`, `color`, `rich-text`, `textarea`, `html`โฆ)
|
|
81
|
+
names a widget, not a rule. `deco check` accepts any string there.
|
|
82
|
+
|
|
83
|
+
Whether Studio draws a special widget for a format outside the alias table is
|
|
84
|
+
Studio's decision, not the generator's. Open the form and look before you rely
|
|
85
|
+
on one.
|
|
86
|
+
|
|
87
|
+
`@format dynamic-options` is kept in the schema, but in v8 it gives a text
|
|
88
|
+
field: the site editor never runs site code, so there are no suggestions. See
|
|
89
|
+
the `@options` section of [annotations.md](./annotations.md).
|
|
90
|
+
|
|
91
|
+
## Picking a text widget
|
|
92
|
+
|
|
93
|
+
- **`RichText`** when the editor needs bold or an inline link. One rich-text
|
|
94
|
+
field beats a text field plus a separate URL field.
|
|
95
|
+
- **`TextArea`** for plain running text.
|
|
96
|
+
- A bare `string` for one line.
|
|
97
|
+
- **`HTMLWidget`** only for markup pasted from elsewhere. It gives the least
|
|
98
|
+
protection against an editor breaking the page.
|
|
99
|
+
|
|
100
|
+
## Never a bare string where a widget exists
|
|
101
|
+
|
|
102
|
+
A `videoSrc: string` renders as a text box that asks an editor for a URL. Use
|
|
103
|
+
`VideoWidget`. The same goes for images (`ImageWidget`) and colors (`Color`):
|
|
104
|
+
no free-text field holding an image URL, no raw hex string without a color
|
|
105
|
+
picker.
|
|
106
|
+
|
|
107
|
+
Name the field for what it holds. Once a field is titled "Video (MP4 URL)",
|
|
108
|
+
editors keep pasting URLs even after a picker arrives. Title it "Video
|
|
109
|
+
(desktop)" and say in `@description` what an empty value does.
|
|
110
|
+
|
|
111
|
+
For what an image field's `@description` should say about sizes, see the
|
|
112
|
+
`deco-images-media` skill.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Shapes that break the form
|
|
2
|
+
|
|
3
|
+
These shapes compile, pass review and generate a schema. They fail in front
|
|
4
|
+
of an editor, or in production on content an editor saved.
|
|
5
|
+
|
|
6
|
+
## Nest a one-to-many relation. Never link it by a typed key.
|
|
7
|
+
|
|
8
|
+
If an item belongs to exactly one group, the items live inside the group.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
// Good: a column owns its links
|
|
12
|
+
/** @titleBy heading */
|
|
13
|
+
export interface FooterColumn {
|
|
14
|
+
/** @title Heading */
|
|
15
|
+
heading: string;
|
|
16
|
+
/** @title Links */
|
|
17
|
+
links: FooterLink[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Bad: two sibling arrays joined by a key the editor types from memory
|
|
21
|
+
tabs: { label: string; key: string }[];
|
|
22
|
+
cards: { caption: string; tabKey?: string }[];
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The bad shape fails three ways. The typed key has no autocomplete. A
|
|
26
|
+
mismatched key makes a card vanish from its tab with no visible error. And the
|
|
27
|
+
two arrays have to be kept in sync by hand. Use sibling arrays plus a key only
|
|
28
|
+
when the relation is really many-to-many, which is rare in editorial content.
|
|
29
|
+
|
|
30
|
+
## Two sibling fields with the same anonymous inline type
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// Bad
|
|
34
|
+
collection?: { collectionId: string } | { skuId: string };
|
|
35
|
+
collection2?: { collectionId: string } | { skuId: string };
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Both fields produce identical inline schemas (the generator gives a shared
|
|
39
|
+
`$ref` only to named types). On the v7 Studio this shape made both fields
|
|
40
|
+
share one form state: typing into the first mirrored into the second, and it
|
|
41
|
+
shipped on live content. That bug has not been checked on the v8 Studio.
|
|
42
|
+
|
|
43
|
+
Either way, numbered sibling slots are the wrong shape. Use a list, so each
|
|
44
|
+
entry is its own node:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
/** @titleBy label */
|
|
48
|
+
export interface Companion {
|
|
49
|
+
/** @title Label */
|
|
50
|
+
label: string;
|
|
51
|
+
/** @title Collection ID */
|
|
52
|
+
collectionId?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface Props {
|
|
56
|
+
/** @title Companion products */
|
|
57
|
+
products?: Companion[];
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If saved content still uses the old fields, keep them with `@hide @deprecated`
|
|
62
|
+
until the content is migrated. See [content-hygiene.md](./content-hygiene.md).
|
|
63
|
+
|
|
64
|
+
## Arrays from content can hold holes
|
|
65
|
+
|
|
66
|
+
The type says `T[]`. At runtime an entry can still be:
|
|
67
|
+
|
|
68
|
+
- `null`, saved in content, or returned by a block in that slot;
|
|
69
|
+
- an object with fields missing: an empty row an editor saved, or content
|
|
70
|
+
written before a field was added.
|
|
71
|
+
|
|
72
|
+
In v8, when a block inside an array resolves to `undefined` (for
|
|
73
|
+
example a `multivariate` with no matching rule), the resolver drops that entry
|
|
74
|
+
and the array gets shorter. `null` values are still kept.
|
|
75
|
+
|
|
76
|
+
`deco check` reports a `null` where the item type is not nullable, and missing
|
|
77
|
+
required fields. Run it, but do not count on it: content changes after deploy.
|
|
78
|
+
|
|
79
|
+
Compact once, where the data enters the component, before any `.map`,
|
|
80
|
+
`.filter` or `.find`:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
const isPresent = <T>(value: T | null | undefined): value is T => value != null;
|
|
84
|
+
const links = (props.links ?? []).filter(isPresent);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Prefer a type guard like this over `.filter(Boolean)`. `Boolean` works at
|
|
88
|
+
runtime but does not narrow the type, so you cast afterwards. On a list of
|
|
89
|
+
primitives it also drops legitimate `0`, `""` and `false`.
|
|
90
|
+
|
|
91
|
+
This matters most in a section on every page (header, footer). One unhandled
|
|
92
|
+
hole there breaks every page, not one section.
|
|
93
|
+
|
|
94
|
+
How multivariate blocks are written and previewed is in the `deco-variants`
|
|
95
|
+
skill.
|
|
96
|
+
|
|
97
|
+
## Variants: a union of types, not an enum plus dead fields
|
|
98
|
+
|
|
99
|
+
When a field can take really different structures, model it as a union of
|
|
100
|
+
named types, each with a `@title`. The editor picks a member and sees only
|
|
101
|
+
its fields, instead of an `aspectRatio` box that does nothing under every
|
|
102
|
+
other choice. See [types-to-fields.md](./types-to-fields.md) for how members
|
|
103
|
+
get their labels.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
/** @title Wide */
|
|
107
|
+
export interface WideLayout {
|
|
108
|
+
/** @hide */
|
|
109
|
+
kind: "wide";
|
|
110
|
+
/** @title Aspect ratio */
|
|
111
|
+
aspectRatio: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @title Contained */
|
|
115
|
+
export interface ContainedLayout {
|
|
116
|
+
// Nothing to set: this is the default crop. The literal keeps the type
|
|
117
|
+
// from being empty (see below).
|
|
118
|
+
/** @hide */
|
|
119
|
+
kind: "contained";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface Props {
|
|
123
|
+
/** @title Layout */
|
|
124
|
+
layout?: WideLayout | ContainedLayout;
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Details that keep this safe on a section that already has content:
|
|
129
|
+
|
|
130
|
+
- **Do not leave a member empty.** In v8 an object field also offers every
|
|
131
|
+
block whose return type fits it (TypeScript assignability, see
|
|
132
|
+
[types-to-fields.md](./types-to-fields.md)). An empty interface accepts any
|
|
133
|
+
object, so every block that returns an object would show up as a choice.
|
|
134
|
+
A single string literal field fixes it. The generator gives a literal an
|
|
135
|
+
equal `default`, so the editor writes it into new entries, and a hidden
|
|
136
|
+
field with a default stays required.
|
|
137
|
+
- **Switch on the literal** at runtime (`layout?.kind === "wide"`), and treat
|
|
138
|
+
any other value as the default member.
|
|
139
|
+
- **Adding `kind` to a union that already has content** makes old entries
|
|
140
|
+
fail `deco check` (a required field is missing) until each saved value gets
|
|
141
|
+
its `kind`. Run `deco check` and fix the content in the same change.
|
|
142
|
+
- **Keep the prop optional.** Content saved before the union existed has no
|
|
143
|
+
value, and `deco check` would report a missing required field.
|
|
144
|
+
- **Title every member** in the editor's language.
|
|
145
|
+
|
|
146
|
+
When each member of a string union needs a matching value, pair it with a
|
|
147
|
+
`Record<Union, โฆ>`. The compiler then refuses a new option without its
|
|
148
|
+
counterpart.
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
type Tone = "light" | "dark";
|
|
152
|
+
const TONE_CLASS: Record<Tone, string> = { light: "bg-white", dark: "bg-black" };
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Free text is untrusted input
|
|
156
|
+
|
|
157
|
+
A text field is the one place TypeScript cannot help: the editor can type
|
|
158
|
+
anything. If the code parses it (a number, a JSON value, a facet key, a URL),
|
|
159
|
+
guard the parse at the consumer and fall back to a default. On a section
|
|
160
|
+
that renders on every page or on the home page, a bad value breaks the whole
|
|
161
|
+
page. One incident came from an editor typing a platform-specific facet key
|
|
162
|
+
into a free-text field.
|
|
163
|
+
|
|
164
|
+
If the value has a closed set of choices, make it a select instead
|
|
165
|
+
(a literal union or `@options`).
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# What each TypeScript shape becomes
|
|
2
|
+
|
|
3
|
+
`typeToJsonSchema` in `packages/blocks/src/v8/cli/schema/typeToSchema.ts`
|
|
4
|
+
turns the props type into JSON Schema; Studio draws the form from that. When a
|
|
5
|
+
field comes out as the wrong kind, find its shape here, then read the block's
|
|
6
|
+
entry in `.deco/schema.gen.json` to confirm.
|
|
7
|
+
|
|
8
|
+
## Primitives and selects
|
|
9
|
+
|
|
10
|
+
| Type | Field |
|
|
11
|
+
|---|---|
|
|
12
|
+
| `string` | Text (or a widget, see [formats-and-widgets.md](./formats-and-widgets.md)) |
|
|
13
|
+
| `number` | Number |
|
|
14
|
+
| `boolean`, `true \| false` | Boolean |
|
|
15
|
+
| `"a" \| "b"`, a string `enum` | Select: `type: "string"` with `enum`, in the order the type spells them |
|
|
16
|
+
| `1 \| 2 \| 3` | Number select |
|
|
17
|
+
| A single string literal, `kind: "image"` | `const` with an equal `default`, so new entries get the value |
|
|
18
|
+
| `T \| null`, `T \| undefined` | `T` with `nullable: true` |
|
|
19
|
+
| `prop?: T` | `T`, left out of `required` |
|
|
20
|
+
| `string & { brand }` | The primitive (`string`) |
|
|
21
|
+
| `any`, `unknown` | An empty schema: no usable field |
|
|
22
|
+
|
|
23
|
+
A literal union, written inline or through a type alias, lists its choices
|
|
24
|
+
in the order you wrote them, even when the checker met the literals in
|
|
25
|
+
another order.
|
|
26
|
+
|
|
27
|
+
## Objects, lists and maps
|
|
28
|
+
|
|
29
|
+
| Type | Field |
|
|
30
|
+
|---|---|
|
|
31
|
+
| An interface or object type | A group of fields, in declaration order |
|
|
32
|
+
| `T[]` | A list of `T` |
|
|
33
|
+
| `A & B` (objects) | One group with the fields of both |
|
|
34
|
+
| `Record<string, T>` | A map: `additionalProperties` of `T` |
|
|
35
|
+
| `Record<string, any>` | A free-form map. It does not offer blocks |
|
|
36
|
+
| A type that contains itself (`Link { submenu?: Link[] }`) | A `$ref` to its shared definition |
|
|
37
|
+
|
|
38
|
+
## Unions of objects: the variant picker
|
|
39
|
+
|
|
40
|
+
`A | B` where the members are objects becomes `anyOf`: the editor picks one
|
|
41
|
+
member and fills in that member's fields. Each member's label comes from, in
|
|
42
|
+
order:
|
|
43
|
+
|
|
44
|
+
1. `@title` on the member's interface or type alias;
|
|
45
|
+
2. the type's name (`WideLayout`);
|
|
46
|
+
3. the value of the first literal property (`kind: "wide"` โ "wide").
|
|
47
|
+
|
|
48
|
+
An anonymous member with none of these has no label. Give every member a
|
|
49
|
+
`@title` in the editor's language: the picker shows those strings.
|
|
50
|
+
|
|
51
|
+
A union that mixes primitives and objects (`string | Banner`) is also an
|
|
52
|
+
`anyOf`, of a text field and a group.
|
|
53
|
+
|
|
54
|
+
## Sections, lazy values and blocks
|
|
55
|
+
|
|
56
|
+
| Type | Field |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `ReactNode`, `ReactElement`, `JSX.Element` | A section picker |
|
|
59
|
+
| `ReactNode[]` | A list of sections |
|
|
60
|
+
| A render descriptor (`{ component; props }`) | A section picker |
|
|
61
|
+
| v7's opaque `Section` / `Section[]` (`type Section = any`) | A section picker / list |
|
|
62
|
+
| `Lazy<T>` | A `lazy` block whose `value` has the form of `T` |
|
|
63
|
+
|
|
64
|
+
An object or list field that a block can fill gets three kinds of choice:
|
|
65
|
+
a saved block ("Select from saved"), "Inline data" (the plain form), and every
|
|
66
|
+
block whose function's awaited return type fits the field. Sections and
|
|
67
|
+
matchers are never offered here. "Fits" is TypeScript assignability, not the
|
|
68
|
+
type's name. So a `products: Product[]` field offers every loader that returns
|
|
69
|
+
`Product[]`. Two exceptions:
|
|
70
|
+
|
|
71
|
+
- A type whose fields are all optional (`{ size?: number }`) would accept
|
|
72
|
+
almost any object. For such a type a block must return the same named type.
|
|
73
|
+
- A `Record<string, any>` field offers no blocks, because every block would
|
|
74
|
+
fit.
|
|
75
|
+
|
|
76
|
+
How to write lazy blocks and sections is in the `deco-site-authoring` skill.
|
|
77
|
+
|
|
78
|
+
## Props that never reach the form
|
|
79
|
+
|
|
80
|
+
These are skipped:
|
|
81
|
+
|
|
82
|
+
- methods and other function-typed props (but `Lazy<T>` is a field);
|
|
83
|
+
- `__resolveType`, any name starting with `$`, and `@type`;
|
|
84
|
+
- React internals: `ref`, `then`, `catch`, `finally`, `$$typeof`, `_owner`,
|
|
85
|
+
`_store`;
|
|
86
|
+
- symbol keys;
|
|
87
|
+
- anything tagged `@ignore`.
|
|
88
|
+
|
|
89
|
+
Names starting with `_` are kept: `__title` labels a list entry, `_id` is
|
|
90
|
+
site data.
|
|
91
|
+
|
|
92
|
+
Platform types from the TypeScript lib (`URL`, `URLSearchParams`, `Request`,
|
|
93
|
+
`Response`, `Headers`, `AbortSignal`, `ReadableStream`, `WritableStream`,
|
|
94
|
+
`Blob`, `File`, `FormData`) become a hidden object. Nobody edits them in a
|
|
95
|
+
form.
|
|
96
|
+
|
|
97
|
+
## `required`
|
|
98
|
+
|
|
99
|
+
A prop that is not optional is in `required`, unless it is hidden with no
|
|
100
|
+
default. `deco check` reports saved content missing a required field, and a
|
|
101
|
+
`null` where the type is not nullable. If old content may lack the field, make
|
|
102
|
+
it optional or give it a `@default`.
|
|
103
|
+
|
|
104
|
+
## Whole-block warnings
|
|
105
|
+
|
|
106
|
+
`deco schema` warns, and the form is empty, when:
|
|
107
|
+
|
|
108
|
+
- the block's props are typed `any`;
|
|
109
|
+
- its first parameter is not an object (for example a string).
|
|
110
|
+
|
|
111
|
+
It also warns when a block returns `any`: that block is then not offered for
|
|
112
|
+
any field.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deco-go-live
|
|
3
|
+
description: "Go-live and the first 72 hours for a site on @decocms/blocks 8 (mainly TanStack Start behind createDecoWorker from @decocms/tanstack/worker). Covers code and content freeze, the last content import as a draft (deco push --draft, deco check, deco publish), how releases reach the site from the CDN and how to roll back traffic, code and content (deco releases, Studio's make-current), the traffic ramp with abTestingRoutes from @decocms/compat-v7/tanstack/worker, Worker runtime limits (128 MB, shared state, deadlines, telemetry), go-live cache checks, proxied checkout headers (COOP, 304 and bfcache), React/SPA leftovers from Fresh ports, SEO, redirects and analytics parity, a read-only preflight script, and a QA checklist built from an inventory of the site's blocks and routes. Load it before a cutover, after a migration or a framework upgrade, to build a QA pass, or to chase a regression right after launch. Assumes the site already builds and renders."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Go-live check for a v8 site
|
|
7
|
+
|
|
8
|
+
Most items below come from a real incident on a store that already went live. Walk
|
|
9
|
+
it on the candidate (and on the real host) before the first byte of
|
|
10
|
+
production traffic, again on cutover day, and once more 24 to 72 hours later.
|
|
11
|
+
It is a double check, not a setup guide: wiring is in **deco-tanstack-site**
|
|
12
|
+
and **deco-nextjs-site**, the CLI flow in **deco-site-workflow**.
|
|
13
|
+
|
|
14
|
+
- ๐ด **Blocks go-live**: data leak, site down, checkout or revenue loss.
|
|
15
|
+
- ๐ก **Fix before ramping above 0%**: cache, SEO, analytics, performance.
|
|
16
|
+
- ๐ข **Watch after go-live**: monitor, compare with the old site.
|
|
17
|
+
- ๐งช needs a browser and a person looking at the result.
|
|
18
|
+
|
|
19
|
+
Record PASS / FAIL / N/A for every line in the go-live ticket. "Didn't check"
|
|
20
|
+
is not N/A.
|
|
21
|
+
|
|
22
|
+
## When to load what
|
|
23
|
+
|
|
24
|
+
| Reference | Load it when |
|
|
25
|
+
|---|---|
|
|
26
|
+
| [`references/process.md`](./references/process.md) | Planning the freeze, the last content import, the CMS pass, cutover day or the first 72 hours |
|
|
27
|
+
| [`references/content-releases.md`](./references/content-releases.md) | Checking how a publish reaches the site, what it doesn't reach, or writing the rollback plan |
|
|
28
|
+
| [`references/traffic-ramp.md`](./references/traffic-ramp.md) | Splitting the production host between the new site and the old origin |
|
|
29
|
+
| [`references/worker-runtime.md`](./references/worker-runtime.md) | Memory errors, 524s, data shown to the wrong user, missing telemetry |
|
|
30
|
+
| [`references/proxy-headers-checkout.md`](./references/proxy-headers-checkout.md) | A proxied checkout, header differences with the old site, real-host-only bugs, redirect loops |
|
|
31
|
+
| [`references/react-spa.md`](./references/react-spa.md) | Something works after F5 but not after a click, hydration errors, stale chunks |
|
|
32
|
+
| [`references/seo-analytics.md`](./references/seo-analytics.md) | Tag-manager timing, indexing, soft 404s, the redirect sweep, sitemaps, search behavior |
|
|
33
|
+
| [`references/qa-inventory.md`](./references/qa-inventory.md) | Building a QA pass: list the blocks, routes, interactions and integrations first |
|
|
34
|
+
| [`references/qa-checklist-template.md`](./references/qa-checklist-template.md) | Filling the QA checklist from that inventory |
|
|
35
|
+
|
|
36
|
+
Cache keys, profiles and hit-rate work are in **deco-storefront-caching**;
|
|
37
|
+
render and upstream performance in **deco-storefront-performance**; parity with
|
|
38
|
+
a v7 site in **deco-v7-to-v8-migration**.
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bash <path-to-this-skill>/scripts/preflight.sh \
|
|
44
|
+
<site-repo> https://<candidate-host> https://<old-site-host>
|
|
45
|
+
deco schema --check && deco check
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The script is read-only (greps and curls). It only catches what is greppable
|
|
49
|
+
or curl-able.
|
|
50
|
+
|
|
51
|
+
## 1. Process (โ [process.md](./references/process.md))
|
|
52
|
+
|
|
53
|
+
- [ ] ๐ด **Code freeze on the old repo** with a date and a recorded `FREEZE_SHA`; every commit since the migration cut reconciled.
|
|
54
|
+
- [ ] ๐ด **Content freeze on the old CMS**; last import after the last edit, pushed as a draft, `deco check --draft=<name>` clean, then `deco publish`.
|
|
55
|
+
- [ ] ๐ด **Schemas match production**: same props and defaults; five-criteria parity.
|
|
56
|
+
- [ ] ๐ก **CMS pass** with the editors before go-live; draft preview works on their hosts.
|
|
57
|
+
- [ ] ๐ก **Inventory** of integrations not ported and of A/B tests whose variant code was never ported.
|
|
58
|
+
|
|
59
|
+
## 2. Content and rollback (โ [content-releases.md](./references/content-releases.md))
|
|
60
|
+
|
|
61
|
+
- [ ] ๐ด `createCMS({ site })` on production; a cold start renders; no direct imports of `.deco/blocks/*.json` that a publish can't reach.
|
|
62
|
+
- [ ] ๐ด `"blocksMajor": 8` in `.deco/schema.gen.json`; `deco schema push` runs on production deploys.
|
|
63
|
+
- [ ] ๐ด **Rollback written and rehearsed** for traffic, code and content.
|
|
64
|
+
- [ ] ๐ก The content team knows a publish takes about a minute to show.
|
|
65
|
+
|
|
66
|
+
## 3. Traffic ramp (โ [traffic-ramp.md](./references/traffic-ramp.md))
|
|
67
|
+
|
|
68
|
+
- [ ] ๐ด At 0%, the **fallback bucket** works through the worker: the worker 404s `/live/*` and `/deco/*` before the split, so old pages that call them break.
|
|
69
|
+
- [ ] ๐ด `shouldBypassAB` returns `true` for routes only the new site has.
|
|
70
|
+
- [ ] ๐ก Both buckets smoke-tested with `?_deco_bucket=worker|fallback`, including existing proxies.
|
|
71
|
+
|
|
72
|
+
## 4. Worker runtime (โ [worker-runtime.md](./references/worker-runtime.md))
|
|
73
|
+
|
|
74
|
+
- [ ] ๐ด **No per-user state at module scope** (`new QueryClient()` outside `getRouter`, module `Map`s with user data).
|
|
75
|
+
- [ ] ๐ด **Memory under ~80% of 128 MB** in a load test; big responses streamed; no content in the bundle.
|
|
76
|
+
- [ ] ๐ก **Every upstream await has a deadline**; shared promises have one too.
|
|
77
|
+
- [ ] ๐ก Observability and CMS telemetry on; `service.version` set to the commit.
|
|
78
|
+
- [ ] ๐ข Memory compared after every `@decocms/*` bump.
|
|
79
|
+
|
|
80
|
+
## 5. Cache (โ **deco-storefront-caching**)
|
|
81
|
+
|
|
82
|
+
- [ ] ๐ด **A signed-in shopper never gets a stored anonymous page**; nothing per-user is stored.
|
|
83
|
+
- [ ] ๐ก Anonymous pages set no cookie except the first-visit `deco_segment`, and the second request is `X-Cache: HIT`.
|
|
84
|
+
- [ ] ๐ก The cache key drops the paid-media parameters your traffic carries.
|
|
85
|
+
- [ ] ๐ก A failed loader marks the page degraded (`x-deco-degraded`) instead of caching "not found".
|
|
86
|
+
|
|
87
|
+
## 6. Proxy, headers, checkout (โ [proxy-headers-checkout.md](./references/proxy-headers-checkout.md))
|
|
88
|
+
|
|
89
|
+
- [ ] ๐ด **Header diff old ร new** on store pages and the proxied checkout; the worker's default COOP overridden where the old site sent none.
|
|
90
|
+
- [ ] ๐ด **The proxied checkout never answers 304** from a stored copy; ๐งช bfcache tested on a deployed preview.
|
|
91
|
+
- [ ] ๐ด Third-party checkout scripts **byte-compared** with the old site.
|
|
92
|
+
- [ ] ๐ด **Real-host-only bugs** checked with the production `Host`.
|
|
93
|
+
- [ ] ๐ก No self-redirect loops on encoded paths.
|
|
94
|
+
|
|
95
|
+
## 7. React / SPA (โ [react-spa.md](./references/react-spa.md))
|
|
96
|
+
|
|
97
|
+
- [ ] ๐ด ๐งช **Cart write then immediate navigation** to checkout keeps the change.
|
|
98
|
+
- [ ] ๐ด Fresh leftovers grep is clean (`window.STOREFRONT`, `hx-*`, `value=` without `onChange`).
|
|
99
|
+
- [ ] ๐ก ๐งช Every inline-script component works when reached by **SPA click**.
|
|
100
|
+
- [ ] ๐ก ๐งช Product โ product by SPA: gallery keyed, no React #310; hook-order lint on.
|
|
101
|
+
- [ ] ๐ก ๐งช Zero React #418 on mobile with the tag manager on.
|
|
102
|
+
- [ ] ๐ก Stale-chunk reload guard; intent-preload payload measured.
|
|
103
|
+
- [ ] ๐ข Old service worker unregistered by a self-unregistering `sw.js`.
|
|
104
|
+
|
|
105
|
+
## 8. SEO, analytics, search (โ [seo-analytics.md](./references/seo-analytics.md))
|
|
106
|
+
|
|
107
|
+
- [ ] ๐ด **Tag manager loads from `<head>` without a gesture gate**; checkout cookies match the old site.
|
|
108
|
+
- [ ] ๐ด On the real host at 0%: **no `noindex`, no `Disallow: /`**; real 404 status codes.
|
|
109
|
+
- [ ] ๐ก Every analytics vendor mounted and receiving events the next day.
|
|
110
|
+
- [ ] ๐ก No duplicate `from` in the redirects block (`deco check` does not catch them), and a **sweep of every rule** against the old site.
|
|
111
|
+
- [ ] ๐ก Sitemap served by a real route and streamed.
|
|
112
|
+
- [ ] ๐ก Facet change resets `page`; autocomplete uses the typed term.
|
|
113
|
+
|
|
114
|
+
## 9. Cutover day and after (โ [process.md](./references/process.md#cutover-day))
|
|
115
|
+
|
|
116
|
+
- [ ] ๐ด Deploy freeze during the window.
|
|
117
|
+
- [ ] ๐ด Split config before the route; smoke with each bucket forced.
|
|
118
|
+
- [ ] ๐ก Cache warmed by fetching **pages** with mobile and desktop user agents.
|
|
119
|
+
- [ ] ๐ก Traffic ladder with written gates.
|
|
120
|
+
- [ ] ๐ข Compare with the **same hour the day before**; keep removed endpoints alive for the HTML cache TTL; keep porting old-repo drift.
|
|
121
|
+
|
|
122
|
+
## Related
|
|
123
|
+
|
|
124
|
+
- **deco-site-workflow**: `deco pull`, `push`, `drafts`, `publish`, `releases`, `schema push`.
|
|
125
|
+
- **deco-variants**: tests and campaigns, preview links with `__test` / `__campaign`.
|
|
126
|
+
- **ecommerce-qa** (decocms/storefront-skills): end-to-end purchase tests with `@decocms/qa`.
|
|
127
|
+
- **tools-reconcile-snapshot** (decocms/migrations; planned to move to the blocks 7.x branch as **deco-reconcile-snapshot**): old-repo drift since the cut.
|