@homepages/concrete 11.0.0 → 13.0.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 +203 -0
- package/README.md +8 -10
- package/codemods/fixtures-are-data.mjs +7 -0
- package/codemods/fixtures-list-properties.mjs +6 -0
- package/codemods/manifest.json +17 -0
- package/codemods/steps/fixtures-list-properties.mjs +16 -0
- package/codemods/steps/fixtures-to-data.mjs +41 -0
- package/dist/artifact/playground/client/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
- package/dist/artifact/playground/client/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
- package/dist/artifact/playground/client/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
- package/dist/artifact/playground/client/assets/index-Bmvcss4B.js +1338 -0
- package/dist/artifact/playground/client/assets/index-C01UCAWD.css +1 -0
- package/dist/artifact/playground/client/index.html +2 -2
- package/dist/artifact/playground/client/island-canvas-host.mjs +1 -1
- package/dist/artifact/playground/host.mjs +110 -60
- package/dist/base.css +19 -59
- package/dist/cli/build/icons.js +1 -1
- package/dist/cli/build/index.js +11 -10
- package/dist/cli/build/manifest.js +44 -0
- package/dist/cli/build/record.js +123 -0
- package/dist/cli/build/sections.js +28 -18
- package/dist/cli/build/source.js +1 -1
- package/dist/cli/build/static.js +8 -5
- package/dist/cli/build/template-build.js +614 -0
- package/dist/cli/check/analyze.js +18 -1
- package/dist/cli/check/load-workspace.js +2 -2
- package/dist/cli/check/portable-names.js +1 -1
- package/dist/cli/check/render/corpus.js +119 -0
- package/dist/cli/check/render/invariants.js +1 -0
- package/dist/cli/check/stages/bundles.js +15 -18
- package/dist/cli/check/stages/composition.js +8 -25
- package/dist/cli/check/stages/fixtures.js +14 -10
- package/dist/cli/check/stages/logic.js +7 -23
- package/dist/cli/check/stages/render.js +12 -14
- package/dist/cli/check/stages/sections.js +22 -66
- package/dist/cli/check/stages/stylesheet.js +4 -26
- package/dist/cli/check/stages/workspace.js +27 -22
- package/dist/cli/commands.js +51 -23
- package/dist/cli/currency/preamble.js +1 -1
- package/dist/cli/currency/resolve-latest.js +3 -2
- package/dist/cli/dev/capture-browser.js +26 -0
- package/dist/cli/dev/fixture-schema.js +441 -0
- package/dist/cli/dev/folder-files.js +244 -0
- package/dist/cli/dev/index.js +7 -3
- package/dist/cli/dev/playground-server.js +34 -0
- package/dist/cli/dev/section-ladders.js +76 -0
- package/dist/cli/dev/server.js +120 -304
- package/dist/cli/install/background.js +16 -0
- package/dist/cli/install/index.js +45 -0
- package/dist/cli/install/tools.js +27 -0
- package/dist/cli/media/derive.js +19 -13
- package/dist/cli/media/deriver-plugin.js +14 -3
- package/dist/cli/property/fixture-list.js +46 -0
- package/dist/cli/property/index.js +12 -9
- package/dist/cli/property/library.js +12 -10
- package/dist/cli/publish/artifact.js +90 -0
- package/dist/cli/publish/captures.js +61 -0
- package/dist/cli/publish/fixtures.js +17 -0
- package/dist/cli/publish/index.js +10 -18
- package/dist/cli/{build → publish}/playground.js +3 -3
- package/dist/cli/publish/report.js +15 -33
- package/dist/cli/upgrade/codemod.d.ts +14 -0
- package/dist/cli/upgrade/fixture-conversion.d.ts +11 -0
- package/dist/cli/upgrade/fixture-conversion.js +54 -0
- package/dist/cli/upgrade/fixture-modules.js +125 -0
- package/dist/cli/upgrade/fixtures-to-data.d.ts +40 -0
- package/dist/cli/upgrade/fixtures-to-data.js +498 -0
- package/dist/cli/upgrade/index.js +18 -2
- package/dist/cli/upgrade/legacy-fixtures.d.ts +34 -0
- package/dist/cli/upgrade/legacy-fixtures.js +22 -0
- package/dist/cli/upgrade/stage.js +1 -1
- package/dist/cli/workspace-fixtures.js +80 -0
- package/dist/cli.js +1 -0
- package/dist/css/compile.js +9 -3
- package/dist/fixtures/bundle-rule.js +16 -16
- package/dist/fixtures/media-plugin.js +12 -33
- package/dist/fixtures/synthesize-empties.js +3 -2
- package/dist/index.d.ts +7 -7
- package/dist/{playground-island-runtime.d.ts → island-runtime.d.ts} +1 -2
- package/dist/{playground-island-runtime.js → island-runtime.js} +1 -2
- package/dist/islands/client-module.js +1 -1
- package/dist/{cli/dev → islands}/tsconfig-paths.js +2 -14
- package/dist/islands/wrap.js +40 -0
- package/dist/node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.js +5119 -0
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/bundle-evaluation/dist/cache.js +36 -0
- package/dist/packages/internal/bundle-evaluation/dist/evaluate.js +174 -0
- package/dist/packages/internal/bundle-evaluation/dist/index.js +5 -0
- package/dist/packages/internal/bundle-evaluation/dist/section-code.js +10 -0
- package/dist/packages/internal/capture-settle/dist/index.js +2 -2
- package/dist/packages/internal/capture-settle/dist/settle.js +88 -13
- package/dist/packages/internal/code-fingerprint/dist/index.js +57 -0
- package/dist/packages/internal/content-doc-ops/dist/index.js +176 -0
- package/dist/packages/internal/content-doc-ops/dist/made-rows.js +15 -0
- package/dist/packages/internal/deliverable-reads/dist/bootstrap.js +81 -0
- package/dist/packages/internal/deliverable-reads/dist/display.js +21 -0
- package/dist/packages/internal/deliverable-reads/dist/format.js +15 -0
- package/dist/packages/internal/deliverable-reads/dist/index.js +7 -0
- package/dist/packages/internal/deliverable-reads/dist/pages.js +29 -0
- package/dist/packages/internal/deliverable-reads/dist/requirements.js +72 -0
- package/dist/{cli/capture → packages/internal/download-files/dist}/bundle.js +8 -4
- package/dist/packages/internal/download-files/dist/capture-origin.js +126 -0
- package/dist/packages/internal/download-files/dist/capture-routes.js +139 -0
- package/dist/packages/internal/download-files/dist/capture-shell.js +38 -0
- package/dist/packages/internal/download-files/dist/capture.js +74 -0
- package/dist/packages/internal/download-files/dist/egress-watch.js +38 -0
- package/dist/packages/internal/download-files/dist/files.js +7 -0
- package/dist/packages/internal/download-files/dist/finish.js +35 -0
- package/dist/packages/internal/download-files/dist/fleet.js +94 -0
- package/dist/packages/internal/download-files/dist/format.js +40 -0
- package/dist/packages/internal/download-files/dist/make.js +105 -0
- package/dist/packages/internal/download-files/dist/master-tally.js +32 -0
- package/dist/packages/internal/download-files/dist/names.js +24 -0
- package/dist/packages/internal/download-files/dist/pdf-boxes.js +33 -0
- package/dist/packages/internal/download-files/dist/pdf-image-placements.js +194 -0
- package/dist/packages/internal/download-files/dist/pdf-images.js +289 -0
- package/dist/packages/internal/file-store/dist/files.js +8 -0
- package/dist/packages/internal/file-store/dist/lru.js +40 -0
- package/dist/packages/internal/file-store/dist/refusal.js +12 -0
- package/dist/packages/internal/file-store/dist/trees.js +151 -0
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +1 -1
- package/dist/packages/internal/fill-bake/dist/compute-reads.js +48 -22
- package/dist/packages/internal/fill-bake/dist/held-rows.js +2 -0
- package/dist/packages/internal/fill-bake/dist/index.js +6 -1
- package/dist/packages/internal/fill-bake/dist/item-merge.js +4 -3
- package/dist/packages/internal/fill-bake/dist/resolve-instance.js +9 -0
- package/dist/packages/internal/fill-bake/dist/resolve.js +3 -0
- package/dist/packages/internal/fill-bake/dist/round-trip.js +2 -0
- package/dist/packages/internal/fill-bake/dist/strip.js +6 -0
- package/dist/packages/internal/fill-vocabulary/dist/holder.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +1 -1
- package/dist/packages/internal/fill-vocabulary/dist/verbs.js +1 -1
- package/dist/packages/internal/format-geometry/dist/capture.js +3 -11
- package/dist/packages/internal/format-geometry/dist/format.d.ts +2 -8
- package/dist/packages/internal/format-geometry/dist/geometry.js +2 -13
- package/dist/packages/internal/island-runtime/dist/index.js +1 -10
- package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +5 -0
- package/dist/packages/internal/lead-fields/dist/ingest.js +72 -0
- package/dist/packages/internal/media-resolution/dist/video.js +6 -2
- package/dist/packages/internal/page-render/dist/addresses.js +57 -0
- package/dist/packages/internal/page-render/dist/index.js +6 -0
- package/dist/packages/internal/page-render/dist/kept.js +30 -0
- package/dist/packages/internal/page-render/dist/nav.js +42 -0
- package/dist/packages/internal/page-render/dist/render.js +152 -0
- package/dist/packages/internal/page-shell/dist/assemble.js +161 -0
- package/dist/packages/internal/page-shell/dist/escape.js +10 -0
- package/dist/packages/internal/page-shell/dist/frame.js +23 -0
- package/dist/packages/internal/page-shell/dist/index.js +26 -0
- package/dist/packages/internal/playground/dist/build-fingerprint.js +18 -0
- package/dist/packages/internal/playground/dist/fixture-conversions/list-names-properties.js +76 -0
- package/dist/packages/internal/playground/dist/fixture-formats.d.ts +37 -0
- package/dist/packages/internal/playground/dist/fixture-formats.js +20 -0
- package/dist/packages/internal/playground/dist/host/bootstrap.js +108 -0
- package/dist/packages/internal/playground/dist/host/built.js +202 -0
- package/dist/packages/internal/playground/dist/host/catalog-fixture.js +53 -0
- package/dist/packages/internal/playground/dist/host/download.js +34 -0
- package/dist/packages/internal/playground/dist/host/env.js +11 -0
- package/dist/packages/internal/playground/dist/host/everywhere-saves.js +353 -0
- package/dist/packages/internal/playground/dist/host/fixture-addresses.js +52 -0
- package/dist/packages/internal/playground/dist/host/fixture-documents.js +494 -0
- package/dist/packages/internal/playground/dist/host/fixture-operations.js +364 -0
- package/dist/packages/internal/playground/dist/host/fixture-units.js +93 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/image-dimensions.js +1 -1
- package/dist/packages/internal/playground/dist/host/leads.js +41 -0
- package/dist/packages/internal/playground/dist/host/media-saves.js +309 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/media-store.js +79 -26
- package/dist/packages/internal/playground/dist/host/overridable.js +9 -0
- package/dist/packages/internal/playground/dist/host/owned-saves.js +203 -0
- package/dist/{playground → packages/internal/playground/dist}/host/page-state.js +1 -1
- package/dist/packages/internal/playground/dist/host/program.js +54 -0
- package/dist/packages/internal/playground/dist/host/property-derive.js +216 -0
- package/dist/packages/internal/playground/dist/host/property-saves.js +74 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/property.js +88 -229
- package/dist/packages/internal/playground/dist/host/provenance.js +49 -0
- package/dist/packages/internal/playground/dist/host/resolve.js +553 -0
- package/dist/packages/internal/playground/dist/host/row-images.js +41 -0
- package/dist/{fixtures → packages/internal/playground/dist/host}/rows.js +1 -1
- package/dist/packages/internal/playground/dist/host/save.js +429 -0
- package/dist/packages/internal/playground/dist/host/serve.js +952 -0
- package/dist/packages/internal/playground/dist/host/site.js +79 -0
- package/dist/packages/internal/playground/dist/host/slots.js +202 -0
- package/dist/packages/internal/playground/dist/host/stated-content.js +93 -0
- package/dist/packages/internal/playground/dist/host/stored-fixtures.js +135 -0
- package/dist/packages/internal/playground/dist/host/violations.js +7 -0
- package/dist/packages/internal/playground/dist/jobs/lanes.js +24 -0
- package/dist/packages/internal/playground/dist/jobs/memory-queue.js +112 -0
- package/dist/packages/internal/playground/dist/jobs/probe.js +37 -0
- package/dist/packages/internal/playground/dist/jobs/queue.js +28 -0
- package/dist/packages/internal/playground/dist/jobs/runner.js +207 -0
- package/dist/packages/internal/playground/dist/layout.js +14 -0
- package/dist/packages/internal/playground/dist/platform.js +33 -0
- package/dist/packages/internal/playground/dist/server/changes.js +57 -0
- package/dist/packages/internal/playground/dist/server/crop.js +47 -0
- package/dist/packages/internal/playground/dist/server/derived-files.js +88 -0
- package/dist/packages/internal/playground/dist/server/download.js +158 -0
- package/dist/{cli/dev → packages/internal/playground/dist/server}/http.js +4 -12
- package/dist/packages/internal/playground/dist/server/jobs.js +29 -0
- package/dist/{cli/dev → packages/internal/playground/dist/server}/listen.js +4 -11
- package/dist/packages/internal/playground/dist/server/playground-server.js +424 -0
- package/dist/{cli/dev → packages/internal/playground/dist/server}/request-error.js +1 -1
- package/dist/packages/internal/playground/dist/server/size-ladders.js +170 -0
- package/dist/packages/internal/playground/dist/server/verification.js +75 -0
- package/dist/packages/internal/playground/dist/server/verify-build.js +139 -0
- package/dist/packages/internal/playground/dist/wire.js +78 -0
- package/dist/packages/internal/property-facts/dist/registry-facts.js +1 -1
- package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +1 -1
- package/dist/packages/internal/section-contracts/dist/reads-acyclic-contract.js +1 -1
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +1 -1
- package/dist/packages/internal/site-files/dist/head.js +59 -0
- package/dist/packages/internal/site-files/dist/index.js +4 -0
- package/dist/packages/internal/site-files/dist/site.js +211 -0
- package/dist/packages/internal/static-assets-binding/dist/index.js +32 -0
- package/dist/packages/internal/static-assets-binding/dist/section-asset-url.js +38 -5
- package/dist/packages/internal/template-artifact/dist/asset-mime.js +8 -1
- package/dist/packages/internal/template-artifact/dist/build.js +148 -0
- package/dist/packages/internal/template-artifact/dist/composition.js +62 -0
- package/dist/packages/internal/template-artifact/dist/index.js +2 -2
- package/dist/packages/internal/template-artifact/dist/layout.js +48 -12
- package/dist/packages/internal/template-artifact/dist/manifest.js +3 -10
- package/dist/packages/internal/template-artifact/dist/verify.js +51 -31
- package/dist/packages/internal/template-contracts/dist/address-value.js +6 -1
- package/dist/packages/internal/template-contracts/dist/content-categories.js +10 -1
- package/dist/packages/internal/template-contracts/dist/fact-compute.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/fact-registry.js +59 -32
- package/dist/packages/internal/template-contracts/dist/fill-spec.js +14 -1
- package/dist/packages/internal/template-contracts/dist/list.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/media-candidates.js +67 -2
- package/dist/packages/internal/template-contracts/dist/media-offer.js +180 -0
- package/dist/packages/internal/template-contracts/dist/object.d.ts +2 -2
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +9 -2
- package/dist/packages/internal/template-contracts/dist/read-graph.js +36 -2
- package/dist/packages/internal/template-contracts/dist/ref-locate.js +16 -1
- package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +9 -10
- package/dist/packages/internal/template-contracts/dist/registry-facts.js +12 -1
- package/dist/packages/internal/template-contracts/dist/registry-graph.js +112 -0
- package/dist/packages/internal/template-contracts/dist/registry-shape.js +15 -2
- package/dist/packages/internal/template-contracts/dist/require-graph.js +300 -0
- package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/row.d.ts +3 -3
- package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +1 -1
- package/dist/{schema → packages/internal/template-contracts/dist}/section-nav.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +4 -4
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +3 -1
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +24 -1
- package/dist/packages/internal/template-contracts/dist/slot-overrides.js +26 -1
- package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -1
- package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/table-members.js +7 -2
- package/dist/packages/internal/template-contracts/dist/video-value.d.ts +1 -1
- package/dist/packages/internal/upload-formats/dist/heic.js +35 -0
- package/dist/packages/internal/upload-formats/dist/index.js +80 -0
- package/dist/packages/internal/upload-formats/dist/magic-bytes.js +293 -0
- package/dist/platform/paths.js +1 -0
- package/dist/platform/process.js +49 -1
- package/dist/primitives/FrameShell.d.ts +5 -2
- package/dist/primitives/FrameShell.js +2 -1
- package/dist/rules/registry.js +28 -4
- package/dist/schema/fact.d.ts +2 -2
- package/dist/schema/facts-view.d.ts +1 -1
- package/dist/schema/format.d.ts +0 -1
- package/dist/schema/format.js +1 -2
- package/dist/schema/manifest.js +18 -24
- package/dist/schema/section-props.d.ts +1 -1
- package/dist/schema/section-schema.d.ts +1 -1
- package/dist/schema/section-schema.js +1 -0
- package/dist/section/declare.d.ts +1 -1
- package/dist/section/discovery.js +6 -2
- package/dist/section/publish-shape.js +38 -0
- package/dist/section/section.d.ts +1 -1
- package/dist/site-analytics.js +6 -1
- package/dist/site-runtime/window-height.js +19 -0
- package/dist/template/define-template.d.ts +25 -4
- package/dist/template/define-template.js +3 -0
- package/dist/template/logic-shim.d.ts +1 -1
- package/dist/template/materialize.js +3 -1
- package/dist/template/running-copy.js +0 -1
- package/dist/template/section-reads.js +1 -1
- package/guide/reference/cli/INDEX.md +6 -5
- package/guide/reference/cli/build.md +10 -8
- package/guide/reference/cli/check.md +4 -2
- package/guide/reference/cli/dev.md +6 -2
- package/guide/reference/cli/install.md +41 -0
- package/guide/reference/cli/property-add.md +5 -4
- package/guide/reference/cli/property-list.md +2 -2
- package/guide/reference/cli/publish.md +5 -5
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +9 -5
- package/package.json +14 -30
- package/dist/artifact/playground/client/assets/index-ByeGGedv.js +0 -1259
- package/dist/artifact/playground/client/assets/index-CxWPYOH2.css +0 -1
- package/dist/cli/build/artifact.js +0 -220
- package/dist/cli/build/captures.js +0 -48
- package/dist/cli/build/fixtures.js +0 -92
- package/dist/cli/capture/capture-browser.js +0 -37
- package/dist/cli/capture/capture.js +0 -113
- package/dist/cli/check/render/inputs.js +0 -60
- package/dist/cli/check/render/nav.js +0 -31
- package/dist/cli/dev/crop.js +0 -20
- package/dist/cli/dev/fixture-ladders.js +0 -96
- package/dist/cli/dev/hmr.js +0 -26
- package/dist/cli/dev/islands.js +0 -234
- package/dist/cli/dev/load-template.js +0 -52
- package/dist/cli/dev/vite.js +0 -114
- package/dist/cli/dev/workspace-reader.js +0 -248
- package/dist/cli/publish/freshness.js +0 -64
- package/dist/fixtures/brand.d.ts +0 -4
- package/dist/fixtures/brand.js +0 -8
- package/dist/fixtures/load.js +0 -159
- package/dist/fixtures/resolve.js +0 -392
- package/dist/fixtures.d.ts +0 -429
- package/dist/fixtures.js +0 -23
- package/dist/packages/internal/canvas-core/dist/island-host.js +0 -62
- package/dist/packages/internal/canvas-core/dist/island-shields.js +0 -30
- package/dist/playground/canvas-island-host.d.ts +0 -11
- package/dist/playground/canvas-island-host.js +0 -29
- package/dist/playground/canvas-markers.js +0 -14
- package/dist/playground/host/paths.js +0 -8
- package/dist/playground/layout.js +0 -17
- package/dist/playground/wire.js +0 -28
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { runNodeScript } from "../../platform/process.js";
|
|
1
2
|
import { booleanFlag, findCommand, flagName, parseSpec, stringFlag } from "../commands.js";
|
|
2
3
|
import { CONCRETE_PACKAGE, findWorkspaceRoot, isRegistryRange, readDeclaredRange, resolveInstalledPackageDir, resolveInstalledVersion } from "../workspace.js";
|
|
3
4
|
import { compareVersions, parseVersion } from "../currency/version-order.js";
|
|
4
5
|
import { NO_AUTO_UPDATE_ENV, optedOut } from "../currency/opt-out.js";
|
|
5
6
|
import { runNpm } from "../currency/refresh.js";
|
|
6
7
|
import { resolveLatest, versionExists } from "../currency/resolve-latest.js";
|
|
8
|
+
import { TOOLS_INSTALL_COMMAND } from "../install/tools.js";
|
|
7
9
|
import { CODEMODS_DIR, MANIFEST_FILE, parseCodemodManifest, stepsBetween } from "./manifest.js";
|
|
8
10
|
import { runCodemod } from "./codemod.js";
|
|
9
11
|
import { planRewrite } from "./plan.js";
|
|
@@ -14,6 +16,14 @@ import { parseArgs } from "node:util";
|
|
|
14
16
|
|
|
15
17
|
//#region src/cli/upgrade/index.ts
|
|
16
18
|
const PREFIX = "concrete upgrade";
|
|
19
|
+
async function runInstalledToolsInstall(packageDir, { root, env, sink }) {
|
|
20
|
+
const failure = await runNodeScript([join(packageDir, "dist", "cli.js"), "install"], {
|
|
21
|
+
cwd: root,
|
|
22
|
+
env,
|
|
23
|
+
sink
|
|
24
|
+
});
|
|
25
|
+
return failure === null ? null : `concrete install ${failure}`;
|
|
26
|
+
}
|
|
17
27
|
const CONFIG_READ_TIMEOUT_MS = 15e3;
|
|
18
28
|
const defaultUpgradeEnvironment = {
|
|
19
29
|
latest: ({ root, env }) => resolveLatest({
|
|
@@ -27,7 +37,8 @@ const defaultUpgradeEnvironment = {
|
|
|
27
37
|
configTimeoutMs: CONFIG_READ_TIMEOUT_MS
|
|
28
38
|
}),
|
|
29
39
|
install: (request) => runNpm(["install"], request),
|
|
30
|
-
stageTarget: stageWithNpmPack
|
|
40
|
+
stageTarget: stageWithNpmPack,
|
|
41
|
+
installTools: runInstalledToolsInstall
|
|
31
42
|
};
|
|
32
43
|
function say(stream, text) {
|
|
33
44
|
stream.write(text.endsWith("\n") ? text : `${text}\n`);
|
|
@@ -214,6 +225,11 @@ function upgradeWith(environment) {
|
|
|
214
225
|
say(io.stderr, `${PREFIX}: the install finished but ${CONCRETE_PACKAGE} does not resolve from the workspace root, so no codemod ran.`);
|
|
215
226
|
return 1;
|
|
216
227
|
}
|
|
228
|
+
const toolsFailure = await environment.installTools(packageDir, {
|
|
229
|
+
...request,
|
|
230
|
+
sink: io.stderr
|
|
231
|
+
});
|
|
232
|
+
if (toolsFailure !== null) say(io.stderr, `${PREFIX}: installing the playground's tools failed (${toolsFailure}). Install them with \`${TOOLS_INSTALL_COMMAND}\`.`);
|
|
217
233
|
const done = `${PREFIX}: done — this workspace is on ${landed}. Commit package.json, package-lock.json and every rewritten file together.`;
|
|
218
234
|
if (!isAfter(landed, installed)) {
|
|
219
235
|
say(io.stdout, done);
|
|
@@ -236,4 +252,4 @@ function upgradeWith(environment) {
|
|
|
236
252
|
const runUpgrade = upgradeWith(defaultUpgradeEnvironment);
|
|
237
253
|
|
|
238
254
|
//#endregion
|
|
239
|
-
export { defaultUpgradeEnvironment, runUpgrade, upgradeWith };
|
|
255
|
+
export { defaultUpgradeEnvironment, runInstalledToolsInstall, runUpgrade, upgradeWith };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/cli/upgrade/legacy-fixtures.d.ts
|
|
2
|
+
/** The brand: a real symbol, so a fixture is recognised only by the module that stamped it. */
|
|
3
|
+
declare const FIXTURE: unique symbol;
|
|
4
|
+
/** One `content(...)` entry as a fixture module stated it. */
|
|
5
|
+
interface ContentEntry {
|
|
6
|
+
readonly section: {
|
|
7
|
+
readonly key: string;
|
|
8
|
+
};
|
|
9
|
+
readonly values: {
|
|
10
|
+
readonly enabled?: boolean;
|
|
11
|
+
readonly variant?: string;
|
|
12
|
+
readonly [slot: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
readonly overrides?: {
|
|
15
|
+
readonly [slot: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
readonly instance?: string;
|
|
18
|
+
}
|
|
19
|
+
/** A `defineFixture` value: a property, a content list and a label. */
|
|
20
|
+
interface Fixture {
|
|
21
|
+
readonly label?: string;
|
|
22
|
+
readonly property: Readonly<Record<string, unknown>>;
|
|
23
|
+
readonly content?: readonly ContentEntry[];
|
|
24
|
+
readonly [FIXTURE]: true;
|
|
25
|
+
}
|
|
26
|
+
/** Is this export a fixture value? */
|
|
27
|
+
declare function isFixture(value: unknown): value is Fixture;
|
|
28
|
+
declare function defineFixture(spec: Omit<Fixture, typeof FIXTURE>): Fixture;
|
|
29
|
+
declare function content(section: ContentEntry["section"], values: ContentEntry["values"], options?: {
|
|
30
|
+
readonly instance?: string;
|
|
31
|
+
readonly overrides?: ContentEntry["overrides"];
|
|
32
|
+
}): ContentEntry;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { ContentEntry, FIXTURE, Fixture, content, defineFixture, isFixture };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/cli/upgrade/legacy-fixtures.ts
|
|
2
|
+
const FIXTURE = Symbol("@homepages/concrete/fixture");
|
|
3
|
+
function isFixture(value) {
|
|
4
|
+
return typeof value === "object" && value !== null && value[FIXTURE] === true;
|
|
5
|
+
}
|
|
6
|
+
function defineFixture(spec) {
|
|
7
|
+
return {
|
|
8
|
+
...spec,
|
|
9
|
+
[FIXTURE]: true
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function content(section, values, options = {}) {
|
|
13
|
+
return {
|
|
14
|
+
section,
|
|
15
|
+
values,
|
|
16
|
+
...options.overrides === void 0 ? {} : { overrides: options.overrides },
|
|
17
|
+
...options.instance === void 0 ? {} : { instance: options.instance }
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { FIXTURE, content, defineFixture, isFixture };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawnNpm } from "../../platform/process.js";
|
|
2
|
-
import { CONCRETE_PACKAGE } from "../workspace.js";
|
|
3
2
|
import { removeTree } from "../../platform/fs.js";
|
|
3
|
+
import { CONCRETE_PACKAGE } from "../workspace.js";
|
|
4
4
|
import { readTarball } from "../tar.js";
|
|
5
5
|
import { CODEMODS_DIR } from "./manifest.js";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { fixtureMediaModule } from "../fixtures/media-plugin.js";
|
|
2
|
+
import { loadDataFixtures } from "../packages/internal/playground/dist/host/fixture-documents.js";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readFile } from "node:fs/promises";
|
|
5
|
+
|
|
6
|
+
//#region src/cli/workspace-fixtures.ts
|
|
7
|
+
const TEMPLATE_FILE = "template.ts";
|
|
8
|
+
function isMissing(cause) {
|
|
9
|
+
const code = cause.code;
|
|
10
|
+
return code === "ENOENT" || code === "ENOTDIR" || code === "EISDIR";
|
|
11
|
+
}
|
|
12
|
+
function workspaceFixtureStore(root) {
|
|
13
|
+
const assets = /* @__PURE__ */ new Map();
|
|
14
|
+
const reached = /* @__PURE__ */ new Set();
|
|
15
|
+
const read = async (path) => {
|
|
16
|
+
try {
|
|
17
|
+
const bytes = await readFile(join(root, ...path.split("/")));
|
|
18
|
+
reached.add(path);
|
|
19
|
+
return bytes;
|
|
20
|
+
} catch (cause) {
|
|
21
|
+
if (isMissing(cause)) return null;
|
|
22
|
+
throw cause;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
assets,
|
|
27
|
+
read: reached,
|
|
28
|
+
store: {
|
|
29
|
+
async readText(path) {
|
|
30
|
+
const bytes = await read(path);
|
|
31
|
+
return bytes === null ? null : bytes.toString("utf8");
|
|
32
|
+
},
|
|
33
|
+
async mediaFile(path) {
|
|
34
|
+
const bytes = await read(path);
|
|
35
|
+
if (bytes === null) return null;
|
|
36
|
+
const { asset, value } = await fixtureMediaModule(join(root, ...path.split("/")), new Uint8Array(bytes));
|
|
37
|
+
assets.set(asset.url, asset);
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async function loadWorkspaceFixtures(input) {
|
|
44
|
+
const { root, template, placements } = input;
|
|
45
|
+
if (template.fixtures === void 0) return {
|
|
46
|
+
resolved: [],
|
|
47
|
+
assets: /* @__PURE__ */ new Map(),
|
|
48
|
+
files: /* @__PURE__ */ new Set(),
|
|
49
|
+
list: null,
|
|
50
|
+
violations: [{
|
|
51
|
+
rule: "fixtures/none",
|
|
52
|
+
file: TEMPLATE_FILE,
|
|
53
|
+
message: `${TEMPLATE_FILE} names no fixture list; add \`fixtures: "./fixtures/index.json"\` and list a content fixture in it`
|
|
54
|
+
}]
|
|
55
|
+
};
|
|
56
|
+
const disk = workspaceFixtureStore(root);
|
|
57
|
+
const loaded = await loadDataFixtures({
|
|
58
|
+
store: disk.store,
|
|
59
|
+
list: template.fixtures,
|
|
60
|
+
listedIn: TEMPLATE_FILE,
|
|
61
|
+
placements,
|
|
62
|
+
...input.log === void 0 ? {} : { log: input.log }
|
|
63
|
+
});
|
|
64
|
+
const violations = [...loaded.violations];
|
|
65
|
+
if (loaded.fixtures.length === 0 && violations.length === 0) violations.push({
|
|
66
|
+
rule: "fixtures/none",
|
|
67
|
+
file: TEMPLATE_FILE,
|
|
68
|
+
message: `the fixture list ${template.fixtures} names no content fixture`
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
resolved: loaded.fixtures,
|
|
72
|
+
assets: disk.assets,
|
|
73
|
+
files: disk.read,
|
|
74
|
+
list: loaded.list,
|
|
75
|
+
violations
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
export { loadWorkspaceFixtures, workspaceFixtureStore };
|
package/dist/cli.js
CHANGED
|
@@ -60,6 +60,7 @@ async function main(argv, io) {
|
|
|
60
60
|
if (cmd === "check") return dispatch(cmd, async () => (await import("./cli/check/index.js")).runCheck, args, io);
|
|
61
61
|
if (cmd === "build") return dispatch(cmd, async () => (await import("./cli/build/index.js")).runBuild, args, io);
|
|
62
62
|
if (cmd === "upgrade") return dispatch(cmd, async () => (await import("./cli/upgrade/index.js")).runUpgrade, args, io);
|
|
63
|
+
if (cmd === "install") return dispatch(cmd, async () => (await import("./cli/install/index.js")).runInstall, args, io);
|
|
63
64
|
if (cmd === "publish") return dispatch(cmd, async () => (await import("./cli/publish/index.js")).runPublish, args, io);
|
|
64
65
|
if (cmd === "property") return dispatch(command.name, async () => (await import("./cli/property/index.js")).runProperty, args, io);
|
|
65
66
|
io.stderr.write(`concrete: '${cmd}' is declared but has no dispatch branch.\n`);
|
package/dist/css/compile.js
CHANGED
|
@@ -53,12 +53,18 @@ async function compileTailwind(root, entry, exclude) {
|
|
|
53
53
|
] });
|
|
54
54
|
return optimize(compiler.build(scanner.scan()), { minify: true }).code;
|
|
55
55
|
}
|
|
56
|
-
async function
|
|
56
|
+
async function collectTemplateCss(input) {
|
|
57
57
|
const graph = await collectCssGraph({
|
|
58
58
|
root: input.root,
|
|
59
59
|
templateFile: input.templateFile
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
return {
|
|
62
|
+
graph,
|
|
63
|
+
inlined: await inlineCssGraph(input.root, graph)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
async function compileTemplateCss(input, collected) {
|
|
67
|
+
const { graph, inlined } = collected ?? await collectTemplateCss(input);
|
|
62
68
|
const importViolations = tailwindImportViolations({
|
|
63
69
|
root: input.root,
|
|
64
70
|
templateFile: input.templateFile,
|
|
@@ -90,4 +96,4 @@ async function compileTemplateCss(input) {
|
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
//#endregion
|
|
93
|
-
export { buildTailwindEntry, compileTemplateCss };
|
|
99
|
+
export { buildTailwindEntry, collectTemplateCss, compileTemplateCss };
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { toPosix } from "../platform/paths.js";
|
|
2
2
|
import { MEDIA_LOADERS, createFixtureMediaPlugin, externalOutsideWorkspace } from "./media-plugin.js";
|
|
3
|
-
import {
|
|
4
|
-
import { join } from "node:path";
|
|
3
|
+
import { isAbsolute, join, relative } from "node:path";
|
|
5
4
|
import { build } from "esbuild";
|
|
6
5
|
|
|
7
6
|
//#region src/fixtures/bundle-rule.ts
|
|
8
|
-
const FIXTURES_SUBPATH = "@homepages/concrete/fixtures";
|
|
9
7
|
const SAMPLE_LIBRARY = "@homepages/sample-properties";
|
|
10
8
|
const RULE = "fixtures/reachable-from-bundle";
|
|
9
|
+
function targetPath(root, path) {
|
|
10
|
+
const colon = path.indexOf(":");
|
|
11
|
+
const file = colon > 1 ? path.slice(colon + 1) : path;
|
|
12
|
+
return toPosix(isAbsolute(file) ? relative(root, file) : file);
|
|
13
|
+
}
|
|
11
14
|
async function findFixturesReachableFromBundle(options) {
|
|
12
|
-
const { root } = options;
|
|
15
|
+
const { root, fixtureFiles } = options;
|
|
13
16
|
const media = createFixtureMediaPlugin(root);
|
|
14
17
|
const result = await build({
|
|
15
18
|
entryPoints: [...options.entries],
|
|
@@ -31,27 +34,24 @@ async function findFixturesReachableFromBundle(options) {
|
|
|
31
34
|
logLevel: "silent"
|
|
32
35
|
});
|
|
33
36
|
const violations = [];
|
|
34
|
-
const fixturesPrefix = `${FIXTURES_DIR}/`;
|
|
35
37
|
for (const [input, meta] of Object.entries(result.metafile.inputs)) {
|
|
36
38
|
const file = toPosix(input);
|
|
37
|
-
if (file.
|
|
39
|
+
if (file.includes(":")) continue;
|
|
38
40
|
for (const imp of meta.imports) {
|
|
39
|
-
const target = toPosix(imp.path);
|
|
40
41
|
if (imp.external === true) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
file,
|
|
44
|
-
message: `${file} imports ${FIXTURES_SUBPATH} as a value; only a type import may reach the fixtures subpath from shipped code`
|
|
45
|
-
});
|
|
46
|
-
else if (target === "@homepages/sample-properties" || target.startsWith(`${"@homepages/sample-properties"}/`)) violations.push({
|
|
42
|
+
const target = toPosix(imp.path);
|
|
43
|
+
if (target === "@homepages/sample-properties" || target.startsWith(`${"@homepages/sample-properties"}/`)) violations.push({
|
|
47
44
|
rule: RULE,
|
|
48
45
|
file,
|
|
49
46
|
message: `${file} imports ${target}; the sample library is copied into a workspace with \`concrete property add\`, never depended on`
|
|
50
47
|
});
|
|
51
|
-
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const target = targetPath(root, imp.path);
|
|
51
|
+
if (fixtureFiles.has(target)) violations.push({
|
|
52
52
|
rule: RULE,
|
|
53
53
|
file,
|
|
54
|
-
message: `${file} imports ${target};
|
|
54
|
+
message: `${file} imports ${target}, which the fixture list reaches; dev data never reaches a published bundle`
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -59,4 +59,4 @@ async function findFixturesReachableFromBundle(options) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
//#endregion
|
|
62
|
-
export {
|
|
62
|
+
export { SAMPLE_LIBRARY, findFixturesReachableFromBundle };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { externalFile, isInsideRoot } from "../platform/paths.js";
|
|
2
|
-
import {
|
|
3
|
-
import { basename
|
|
2
|
+
import { fixtureMediaUrl as fixtureMediaUrl$1, importedFileValue } from "../packages/internal/playground/dist/host/property-derive.js";
|
|
3
|
+
import { basename } from "node:path";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
|
|
@@ -9,13 +9,6 @@ const NAMESPACE = "concrete-fixture-media";
|
|
|
9
9
|
const RESOLVING = Symbol("concrete-fixture-media:resolving");
|
|
10
10
|
const FIXTURE_MEDIA_PATH = "/fixture-media";
|
|
11
11
|
const MEDIA_FILTER = /\.(?:[pP][nN][gG]|[jJ][pP][eE]?[gG]|[wW][eE][bB][pP]|[aA][vV][iI][fF]|[sS][vV][gG]|[gG][iI][fF]|[iI][cC][oO]|[wW][oO][fF][fF]2?|[tT][tT][fF]|[oO][tT][fF]|[eE][oO][tT]|[mM][pP]4|[wW][eE][bB][mM]|[mM][oO][vV]|[mM][pP]3|[wW][aA][vV]|[pP][dD][fF]|[zZ][iI][pP])$/;
|
|
12
|
-
const DERIVED_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
13
|
-
".png",
|
|
14
|
-
".jpg",
|
|
15
|
-
".jpeg",
|
|
16
|
-
".webp",
|
|
17
|
-
".avif"
|
|
18
|
-
]);
|
|
19
12
|
const MEDIA_LOADERS = Object.fromEntries([
|
|
20
13
|
".png",
|
|
21
14
|
".jpg",
|
|
@@ -58,37 +51,23 @@ function externalOutsideWorkspace(root) {
|
|
|
58
51
|
};
|
|
59
52
|
}
|
|
60
53
|
function fixtureMediaUrl(path, bytes) {
|
|
61
|
-
|
|
62
|
-
const hash = createHash("sha256").update(bytes).digest("hex").slice(0, 8);
|
|
63
|
-
return `${FIXTURE_MEDIA_PATH}/${basename(path, ext)}-${hash}${ext.toLowerCase()}`;
|
|
54
|
+
return fixtureMediaUrl$1(FIXTURE_MEDIA_PATH, basename(path), createHash("sha256").update(bytes).digest("hex"));
|
|
64
55
|
}
|
|
65
56
|
const MEDIA_EXTENSIONS = new Set(Object.keys(MEDIA_LOADERS));
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
const derived = DERIVED_EXTENSIONS.has(extname(path).toLowerCase());
|
|
57
|
+
function fixtureMediaModule(path, bytes, url = fixtureMediaUrl(path, bytes)) {
|
|
58
|
+
const value = importedFileValue(url, bytes, null);
|
|
69
59
|
const asset = {
|
|
70
60
|
url,
|
|
71
61
|
path,
|
|
72
62
|
bytes: bytes.byteLength,
|
|
73
|
-
derived
|
|
74
|
-
};
|
|
75
|
-
if (!derived) return {
|
|
76
|
-
asset,
|
|
77
|
-
value: url
|
|
63
|
+
derived: value !== url
|
|
78
64
|
};
|
|
79
|
-
return {
|
|
65
|
+
return Promise.resolve({
|
|
80
66
|
asset,
|
|
81
|
-
value
|
|
82
|
-
|
|
83
|
-
responsive: ladders === void 0 ? null : await ladders.responsiveFor(path, bytes),
|
|
84
|
-
...imageDimensions(bytes) ?? {
|
|
85
|
-
width: 0,
|
|
86
|
-
height: 0
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
67
|
+
value
|
|
68
|
+
});
|
|
90
69
|
}
|
|
91
|
-
function createFixtureMediaPlugin(root,
|
|
70
|
+
function createFixtureMediaPlugin(root, urlOf) {
|
|
92
71
|
const assets = /* @__PURE__ */ new Map();
|
|
93
72
|
return {
|
|
94
73
|
plugin: {
|
|
@@ -116,7 +95,7 @@ function createFixtureMediaPlugin(root, ladders) {
|
|
|
116
95
|
namespace: NAMESPACE
|
|
117
96
|
}, async (args) => {
|
|
118
97
|
const bytes = await readFile(args.path);
|
|
119
|
-
const { asset, value } = await fixtureMediaModule(args.path, bytes,
|
|
98
|
+
const { asset, value } = await fixtureMediaModule(args.path, bytes, urlOf?.(args.path, bytes));
|
|
120
99
|
assets.set(asset.url, asset);
|
|
121
100
|
return {
|
|
122
101
|
contents: `export default ${JSON.stringify(value)};`,
|
|
@@ -131,4 +110,4 @@ function createFixtureMediaPlugin(root, ladders) {
|
|
|
131
110
|
}
|
|
132
111
|
|
|
133
112
|
//#endregion
|
|
134
|
-
export { FIXTURE_MEDIA_PATH,
|
|
113
|
+
export { FIXTURE_MEDIA_PATH, MEDIA_LOADERS, createFixtureMediaPlugin, externalOutsideWorkspace, fixtureMediaModule, fixtureMediaUrl };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isEmptyValue } from "../packages/internal/playground/dist/host/provenance.js";
|
|
2
|
+
import { emptyValueFor, uniquePlacements } from "../packages/internal/playground/dist/host/resolve.js";
|
|
2
3
|
|
|
3
4
|
//#region src/fixtures/synthesize-empties.ts
|
|
4
5
|
function synthesizeEmptyFixtures(resolved, placements) {
|
|
@@ -8,7 +9,7 @@ function synthesizeEmptyFixtures(resolved, placements) {
|
|
|
8
9
|
for (const placement of uniquePlacements(placements)) {
|
|
9
10
|
const instance = resolved.contentDoc.instances.find((i) => i.instance_id === placement.instance);
|
|
10
11
|
if (instance === void 0) continue;
|
|
11
|
-
for (const [slot, def] of Object.entries(placement.section.
|
|
12
|
+
for (const [slot, def] of Object.entries(placement.section.slots)) {
|
|
12
13
|
if (!(slot in instance.slots) || isEmptyValue(instance.slots[slot], def.type)) continue;
|
|
13
14
|
const empty = emptyValueFor(def.type);
|
|
14
15
|
out.push({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ATTR_ISLAND_KEY, ISLAND_CAPTURE_HOLDS_GLOBAL } from "./packages/internal/capture-settle/dist/island-markers.js";
|
|
2
2
|
import { ATTR_ISLAND_FRAMELESS, ATTR_ISLAND_ID, ATTR_ISLAND_PROPS, EDITOR_BRIDGE_PROP, EDITOR_BRIDGE_PROTOCOL, EditorBridge, EditorBridgeSelection, EditorSelection, ISLAND_ELEMENT, IslandComponent, IslandEditor, IslandEditorOptions, IslandModule, IslandProps, IslandPropsError, IslandServerFrame, deserializeIslandProps, islandId, serializeIslandProps } from "./packages/internal/island-runtime/dist/contract.js";
|
|
3
3
|
import "./asset-modules.js";
|
|
4
|
+
import { UseEditorResult, useEditor } from "./packages/internal/island-runtime/dist/use-editor.js";
|
|
5
|
+
import { useCaptureReady } from "./packages/internal/island-runtime/dist/use-capture-ready.js";
|
|
6
|
+
import { useIslandId } from "./packages/internal/island-runtime/dist/use-island-id.js";
|
|
7
|
+
import { IslandMarker, IslandMarkerProps } from "./islands/marker.js";
|
|
4
8
|
import { AddressValue } from "./packages/internal/template-contracts/dist/address-value.js";
|
|
5
9
|
import { ResponsiveImage, ResponsiveSource } from "./packages/internal/template-contracts/dist/responsive-image.js";
|
|
6
10
|
import { DocumentValue } from "./packages/internal/template-contracts/dist/document-value.js";
|
|
@@ -8,12 +12,10 @@ import { TourValue } from "./packages/internal/template-contracts/dist/tour-valu
|
|
|
8
12
|
import { VideoValue } from "./packages/internal/template-contracts/dist/video-value.js";
|
|
9
13
|
import { PoiPhoto, PoiRow } from "./packages/internal/template-contracts/dist/poi-row.js";
|
|
10
14
|
import { AuthorImage, ImageValue, MediaValue, PlaybackConfig } from "./packages/internal/template-contracts/dist/runtime-values.js";
|
|
11
|
-
import { ComputeBinding, compute } from "./packages/internal/template-contracts/dist/compute.js";
|
|
12
|
-
import { AddressMembers, ElementOf, RowId, TableRow } from "./packages/internal/template-contracts/dist/row-ref.js";
|
|
13
|
-
import { ItemIdentity, ObjectValue, SlotValue } from "./packages/internal/template-contracts/dist/slot-value.js";
|
|
14
15
|
import { AddressSlot, DateSlot, DocumentSlot, EmailSlot, ImageSlot, ListItemSlot, ListSlot, MediaSlot, NumberSlot, ObjectFieldSlot, ObjectSlot, PhoneSlot, PoiSlot, RowSlot, SelectSlot, TextSlot, TourSlot, UrlSlot, ValueSlot, VideoSlot } from "./packages/internal/template-contracts/dist/slot-types.js";
|
|
15
16
|
import { ElementRef, RowRef, SlotRef } from "./packages/internal/template-contracts/dist/slot-ref.js";
|
|
16
17
|
import { FillBinding, FillVerb, FindFill, FindInput, PickFill, PickInput, WriteFill, WriteInput, fill } from "./packages/internal/template-contracts/dist/fill-builders.js";
|
|
18
|
+
import { ComputeBinding, compute } from "./packages/internal/template-contracts/dist/compute.js";
|
|
17
19
|
import { IconName } from "./packages/internal/template-contracts/dist/icon-names.js";
|
|
18
20
|
import { AutocropInput, AutocropProcess, CutoutProcess, HolderProcess, holderProcess } from "./packages/internal/template-contracts/dist/process-builders.js";
|
|
19
21
|
import { AddressSlotDef, CropConfig, DateSlotDef, DisplayEntryInput, DisplayFill, DocumentSlotDef, EmailSlotDef, ImageSlotDef, MediaSlotDef, NumberSlotDef, PhoneSlotDef, PoiSlotDef, SelectOptionInput, SelectOptionObject, SelectSlotDef, SlotSource, TextSlotDef, TourSlotDef, UrlSlotDef, VideoSlotDef, address, date, document, email, image, media, number, phone, poi, select, text, tour, url, video } from "./packages/internal/template-contracts/dist/slot-builders.js";
|
|
@@ -21,12 +23,10 @@ import { ObjectLabelField, ObjectLabelSource, ObjectSlotDef, object } from "./pa
|
|
|
21
23
|
import { RowFill, RowSlotDef, RowSourceInput, TableSource, row } from "./packages/internal/template-contracts/dist/row.js";
|
|
22
24
|
import { ListFill, ListSlotDef, ListSourceInput, list } from "./packages/internal/template-contracts/dist/list.js";
|
|
23
25
|
import { DocumentMedia, ImageMedia, Media, TourMedia, VideoMedia } from "./packages/internal/template-contracts/dist/registry-facts.js";
|
|
26
|
+
import { AddressMembers, ElementOf, RowId, TableRow } from "./packages/internal/template-contracts/dist/row-ref.js";
|
|
27
|
+
import { ItemIdentity, ObjectValue, SlotValue } from "./packages/internal/template-contracts/dist/slot-value.js";
|
|
24
28
|
import { Coordinates } from "./schema/property-facts.js";
|
|
25
29
|
import "./schema/section-schema.js";
|
|
26
|
-
import { UseEditorResult, useEditor } from "./packages/internal/island-runtime/dist/use-editor.js";
|
|
27
|
-
import { useCaptureReady } from "./packages/internal/island-runtime/dist/use-capture-ready.js";
|
|
28
|
-
import { useIslandId } from "./packages/internal/island-runtime/dist/use-island-id.js";
|
|
29
|
-
import { IslandMarker, IslandMarkerProps } from "./islands/marker.js";
|
|
30
30
|
import { BoundSlotValue, FieldBinding, FieldBindings, ItemBinding, ObjectBinding, SlotBinding, SlotBindingMap, bindItems } from "./primitives/slot-bindings.js";
|
|
31
31
|
import { SectionOptions } from "./section/declare.js";
|
|
32
32
|
import { SectionContractProps, SectionPlacementProps, SectionRenderBindings, SectionValue, section } from "./section/section.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { islandsCaptureReady } from "./packages/internal/island-runtime/dist/capture-holds.js";
|
|
2
2
|
import { hydrateIslands } from "./packages/internal/island-runtime/dist/index.js";
|
|
3
|
-
|
|
4
|
-
export { hydrateIslands, installCanvasIslandHost, islandsCaptureReady };
|
|
3
|
+
export { hydrateIslands, islandsCaptureReady };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { islandsCaptureReady } from "./packages/internal/island-runtime/dist/capture-holds.js";
|
|
2
2
|
import { hydrateIslands } from "./packages/internal/island-runtime/dist/index.js";
|
|
3
|
-
import { installCanvasIslandHost } from "./playground/canvas-island-host.js";
|
|
4
3
|
|
|
5
|
-
export { hydrateIslands,
|
|
4
|
+
export { hydrateIslands, islandsCaptureReady };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, statSync } from "node:fs";
|
|
2
2
|
import { isAbsolute, join, resolve } from "node:path";
|
|
3
3
|
|
|
4
|
-
//#region src/
|
|
4
|
+
//#region src/islands/tsconfig-paths.ts
|
|
5
5
|
const RESOLVE_EXTENSIONS = [
|
|
6
6
|
"",
|
|
7
7
|
".ts",
|
|
@@ -65,18 +65,6 @@ function createPathsResolver(ts, root) {
|
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
async function createTsconfigPathsPlugin(root) {
|
|
69
|
-
const ts = (await import("typescript")).default;
|
|
70
|
-
const resolvePath = createPathsResolver(ts, root);
|
|
71
|
-
if (resolvePath === null) return null;
|
|
72
|
-
return {
|
|
73
|
-
name: "concrete-dev:tsconfig-paths",
|
|
74
|
-
enforce: "pre",
|
|
75
|
-
resolveId(source) {
|
|
76
|
-
return resolvePath(source) ?? null;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
68
|
|
|
81
69
|
//#endregion
|
|
82
|
-
export { createPathsResolver
|
|
70
|
+
export { createPathsResolver };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { hasClientDirective } from "./client-module.js";
|
|
2
|
+
|
|
3
|
+
//#region src/islands/wrap.ts
|
|
4
|
+
const SERVER_FRAME = /^[ \t]*export[ \t]+const[ \t]+serverFrame[ \t]*(?::[^=]*)?=[ \t]*(.*)$/m;
|
|
5
|
+
function declaresNoServerFrame(text) {
|
|
6
|
+
const declaration = SERVER_FRAME.exec(text);
|
|
7
|
+
if (!declaration) return false;
|
|
8
|
+
const source = (declaration[1] ?? "").replace(/;.*$/, "").trim();
|
|
9
|
+
const literal = /^(true|false)\b/.exec(source);
|
|
10
|
+
if (!literal) return false;
|
|
11
|
+
const rest = source.slice(literal[0].length).trim();
|
|
12
|
+
if (rest !== "" && !/^(?:satisfies|as)\b/.test(rest)) return false;
|
|
13
|
+
return literal[1] === "false";
|
|
14
|
+
}
|
|
15
|
+
function markerModule(islandKey, markerSpecifier, children) {
|
|
16
|
+
return `
|
|
17
|
+
;
|
|
18
|
+
import { createElement as __trCreateElement, useId as __trUseId } from "react";
|
|
19
|
+
import { IslandMarker as __TrIslandMarker } from ${JSON.stringify(markerSpecifier)};
|
|
20
|
+
export default function __trIslandWrapper(__trProps) {
|
|
21
|
+
const __trIslandId = __trUseId();
|
|
22
|
+
return __trCreateElement(
|
|
23
|
+
__TrIslandMarker,
|
|
24
|
+
{ islandKey: ${JSON.stringify(islandKey)}, islandId: __trIslandId, props: __trProps },${children}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
const DEFAULT_EXPORT = /export\s+default\s+/;
|
|
30
|
+
function wrapClientModule(code, islandKey, markerSpecifier) {
|
|
31
|
+
if (!hasClientDirective(code) || !DEFAULT_EXPORT.test(code)) return null;
|
|
32
|
+
return code.replace(DEFAULT_EXPORT, "const __trIslandReal = ") + markerModule(islandKey, markerSpecifier, "\n __trCreateElement(__trIslandReal, __trProps),") + "export { __trIslandReal };\n";
|
|
33
|
+
}
|
|
34
|
+
function stubClientModule(code, islandKey, markerSpecifier) {
|
|
35
|
+
if (!hasClientDirective(code) || !DEFAULT_EXPORT.test(code) || !declaresNoServerFrame(code)) return null;
|
|
36
|
+
return markerModule(islandKey, markerSpecifier, "");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { declaresNoServerFrame, stubClientModule, wrapClientModule };
|