@askrjs/askr 0.0.28 → 0.0.30
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/README.md +44 -172
- package/dist/_virtual/_rolldown/runtime.js +7 -0
- package/dist/bench/components/benchmark-row.d.ts +20 -0
- package/dist/bench/components/benchmark-row.d.ts.map +1 -0
- package/dist/bench/components/benchmark-row.js +42 -0
- package/dist/bench/components/benchmark-row.js.map +1 -0
- package/dist/bench/components/benchmark-table.js +25 -0
- package/dist/bench/components/benchmark-table.js.map +1 -0
- package/dist/benchmark.d.ts +22 -0
- package/dist/benchmark.d.ts.map +1 -0
- package/dist/benchmark.js +64 -1
- package/dist/benchmark.js.map +1 -0
- package/dist/bin/askr-ssg.d.ts +22 -26
- package/dist/bin/askr-ssg.d.ts.map +1 -1
- package/dist/bin/askr-ssg.js +149 -2
- package/dist/bin/askr-ssg.js.map +1 -0
- package/dist/boot/index.d.ts +64 -42
- package/dist/boot/index.d.ts.map +1 -1
- package/dist/boot/index.js +416 -2
- package/dist/boot/index.js.map +1 -0
- package/dist/common/component.d.ts +14 -13
- package/dist/common/component.d.ts.map +1 -1
- package/dist/common/control.d.ts +13 -0
- package/dist/common/control.d.ts.map +1 -0
- package/dist/common/control.js +14 -0
- package/dist/common/control.js.map +1 -0
- package/dist/common/env.js +47 -0
- package/dist/common/env.js.map +1 -0
- package/dist/common/jsx.d.ts +17 -15
- package/dist/common/jsx.d.ts.map +1 -1
- package/dist/common/jsx.js +8 -1
- package/dist/common/jsx.js.map +1 -0
- package/dist/common/props.d.ts +14 -11
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/router.d.ts +190 -32
- package/dist/common/router.d.ts.map +1 -1
- package/dist/common/ssr-errors.d.ts +6 -3
- package/dist/common/ssr-errors.d.ts.map +1 -1
- package/dist/common/ssr-errors.js +16 -1
- package/dist/common/ssr-errors.js.map +1 -0
- package/dist/common/ssr.d.ts +12 -9
- package/dist/common/ssr.d.ts.map +1 -1
- package/dist/common/vnode.d.ts +17 -15
- package/dist/common/vnode.d.ts.map +1 -1
- package/dist/common/vnode.js +10 -1
- package/dist/common/vnode.js.map +1 -0
- package/dist/components/link.d.ts +37 -25
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +64 -1
- package/dist/components/link.js.map +1 -0
- package/dist/control/case.d.ts +17 -0
- package/dist/control/case.d.ts.map +1 -0
- package/dist/control/case.js +69 -0
- package/dist/control/case.js.map +1 -0
- package/dist/control/for.d.ts +23 -0
- package/dist/control/for.d.ts.map +1 -0
- package/dist/control/for.js +62 -0
- package/dist/control/for.js.map +1 -0
- package/dist/control/index.d.ts +4 -0
- package/dist/control/index.js +4 -0
- package/dist/control/shared.js +20 -0
- package/dist/control/shared.js.map +1 -0
- package/dist/control/show.d.ts +14 -0
- package/dist/control/show.d.ts.map +1 -0
- package/dist/control/show.js +33 -0
- package/dist/control/show.js.map +1 -0
- package/dist/dev/invariant.js +29 -2
- package/dist/dev/invariant.js.map +1 -0
- package/dist/dev/logger.js +37 -1
- package/dist/dev/logger.js.map +1 -0
- package/dist/foundations/core.d.ts +15 -23
- package/dist/foundations/core.js +13 -1
- package/dist/foundations/icon/icon.d.ts +53 -0
- package/dist/foundations/icon/icon.d.ts.map +1 -0
- package/dist/foundations/icon/icon.js +88 -0
- package/dist/foundations/icon/icon.js.map +1 -0
- package/dist/foundations/icon/icon.types.d.ts +21 -0
- package/dist/foundations/icon/icon.types.d.ts.map +1 -0
- package/dist/foundations/index.d.ts +23 -3
- package/dist/foundations/index.js +22 -1
- package/dist/foundations/interactions/dismissable.d.ts +25 -17
- package/dist/foundations/interactions/dismissable.d.ts.map +1 -1
- package/dist/foundations/interactions/dismissable.js +26 -1
- package/dist/foundations/interactions/dismissable.js.map +1 -0
- package/dist/foundations/interactions/focusable.d.ts +13 -7
- package/dist/foundations/interactions/focusable.d.ts.map +1 -1
- package/dist/foundations/interactions/focusable.js +18 -1
- package/dist/foundations/interactions/focusable.js.map +1 -0
- package/dist/foundations/interactions/hoverable.d.ts +17 -10
- package/dist/foundations/interactions/hoverable.d.ts.map +1 -1
- package/dist/foundations/interactions/hoverable.js +15 -1
- package/dist/foundations/interactions/hoverable.js.map +1 -0
- package/dist/foundations/interactions/interaction-policy.d.ts +32 -78
- package/dist/foundations/interactions/interaction-policy.d.ts.map +1 -1
- package/dist/foundations/interactions/interaction-policy.js +122 -1
- package/dist/foundations/interactions/interaction-policy.js.map +1 -0
- package/dist/foundations/interactions/pressable.d.ts +25 -18
- package/dist/foundations/interactions/pressable.d.ts.map +1 -1
- package/dist/foundations/interactions/pressable.js +51 -1
- package/dist/foundations/interactions/pressable.js.map +1 -0
- package/dist/foundations/interactions/roving-focus.d.ts +49 -114
- package/dist/foundations/interactions/roving-focus.d.ts.map +1 -1
- package/dist/foundations/interactions/roving-focus.js +71 -1
- package/dist/foundations/interactions/roving-focus.js.map +1 -0
- package/dist/foundations/state/controllable.d.ts +22 -41
- package/dist/foundations/state/controllable.d.ts.map +1 -1
- package/dist/foundations/state/controllable.js +81 -1
- package/dist/foundations/state/controllable.js.map +1 -0
- package/dist/foundations/structures/collection.d.ts +25 -40
- package/dist/foundations/structures/collection.d.ts.map +1 -1
- package/dist/foundations/structures/collection.js +51 -1
- package/dist/foundations/structures/collection.js.map +1 -0
- package/dist/foundations/structures/layer.d.ts +47 -68
- package/dist/foundations/structures/layer.d.ts.map +1 -1
- package/dist/foundations/structures/layer.js +81 -1
- package/dist/foundations/structures/layer.js.map +1 -0
- package/dist/foundations/structures/layout.d.ts +6 -3
- package/dist/foundations/structures/layout.d.ts.map +1 -1
- package/dist/foundations/structures/layout.js +13 -1
- package/dist/foundations/structures/layout.js.map +1 -0
- package/dist/foundations/structures/portal.d.ts +17 -10
- package/dist/foundations/structures/portal.d.ts.map +1 -1
- package/dist/foundations/structures/portal.js +105 -1
- package/dist/foundations/structures/portal.js.map +1 -0
- package/dist/foundations/structures/presence.d.ts +11 -5
- package/dist/foundations/structures/presence.d.ts.map +1 -1
- package/dist/foundations/structures/presence.js +39 -1
- package/dist/foundations/structures/presence.js.map +1 -0
- package/dist/foundations/structures/slot.d.ts +11 -8
- package/dist/foundations/structures/slot.d.ts.map +1 -1
- package/dist/foundations/structures/slot.js +41 -1
- package/dist/foundations/structures/slot.js.map +1 -0
- package/dist/foundations/structures.d.ts +7 -14
- package/dist/foundations/structures.js +6 -1
- package/dist/foundations/utilities/aria.d.ts +9 -6
- package/dist/foundations/utilities/aria.d.ts.map +1 -1
- package/dist/foundations/utilities/aria.js +17 -1
- package/dist/foundations/utilities/aria.js.map +1 -0
- package/dist/foundations/utilities/compose-handlers.d.ts +10 -7
- package/dist/foundations/utilities/compose-handlers.d.ts.map +1 -1
- package/dist/foundations/utilities/compose-handlers.js +20 -1
- package/dist/foundations/utilities/compose-handlers.js.map +1 -0
- package/dist/foundations/utilities/compose-ref.d.ts +7 -4
- package/dist/foundations/utilities/compose-ref.d.ts.map +1 -1
- package/dist/foundations/utilities/compose-ref.js +18 -1
- package/dist/foundations/utilities/compose-ref.js.map +1 -0
- package/dist/foundations/utilities/event-types.d.ts +14 -11
- package/dist/foundations/utilities/event-types.d.ts.map +1 -1
- package/dist/foundations/utilities/merge-props.d.ts +4 -1
- package/dist/foundations/utilities/merge-props.d.ts.map +1 -1
- package/dist/foundations/utilities/merge-props.js +49 -1
- package/dist/foundations/utilities/merge-props.js.map +1 -0
- package/dist/foundations/utilities/use-id.d.ts +9 -6
- package/dist/foundations/utilities/use-id.d.ts.map +1 -1
- package/dist/foundations/utilities/use-id.js +29 -1
- package/dist/foundations/utilities/use-id.js.map +1 -0
- package/dist/fx/fx.d.ts +24 -21
- package/dist/fx/fx.d.ts.map +1 -1
- package/dist/fx/fx.js +212 -1
- package/dist/fx/fx.js.map +1 -0
- package/dist/fx/index.d.ts +4 -7
- package/dist/fx/index.js +4 -1
- package/dist/fx/noop.js +9 -1
- package/dist/fx/noop.js.map +1 -0
- package/dist/fx/timing.d.ts +24 -21
- package/dist/fx/timing.d.ts.map +1 -1
- package/dist/fx/timing.js +236 -1
- package/dist/fx/timing.js.map +1 -0
- package/dist/index.d.ts +21 -23
- package/dist/index.js +34 -1
- package/dist/index.js.map +1 -0
- package/dist/jsx/index.d.ts +1 -4
- package/dist/jsx/index.js +3 -1
- package/dist/jsx/types.d.ts +18 -25
- package/dist/jsx/types.d.ts.map +1 -1
- package/dist/jsx/types.js +1 -1
- package/dist/jsx/utils.d.ts +4 -3
- package/dist/jsx/utils.d.ts.map +1 -1
- package/dist/jsx/utils.js +19 -1
- package/dist/jsx/utils.js.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +8 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +32 -1
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +12 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +45 -1
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-runtime2.d.ts +2 -0
- package/dist/jsx-runtime2.js +3 -0
- package/dist/renderer/children.js +293 -0
- package/dist/renderer/children.js.map +1 -0
- package/dist/renderer/cleanup.js +150 -1
- package/dist/renderer/cleanup.js.map +1 -0
- package/dist/renderer/dom.js +2439 -1
- package/dist/renderer/dom.js.map +1 -0
- package/dist/renderer/env.js +1 -0
- package/dist/renderer/evaluate.js +450 -1
- package/dist/renderer/evaluate.js.map +1 -0
- package/dist/renderer/fastpath.js +145 -1
- package/dist/renderer/fastpath.js.map +1 -0
- package/dist/renderer/index.js +24 -1
- package/dist/renderer/index.js.map +1 -0
- package/dist/renderer/keyed.js +119 -1
- package/dist/renderer/keyed.js.map +1 -0
- package/dist/renderer/reconcile.js +359 -1
- package/dist/renderer/reconcile.js.map +1 -0
- package/dist/renderer/types.js +1 -1
- package/dist/renderer/utils.js +220 -1
- package/dist/renderer/utils.js.map +1 -0
- package/dist/resources/index.d.ts +3 -9
- package/dist/resources/index.js +3 -1
- package/dist/router/index.d.ts +6 -10
- package/dist/router/index.js +5 -1
- package/dist/router/match.js +83 -1
- package/dist/router/match.js.map +1 -0
- package/dist/router/navigate.d.ts +20 -8
- package/dist/router/navigate.d.ts.map +1 -1
- package/dist/router/navigate.js +288 -1
- package/dist/router/navigate.js.map +1 -0
- package/dist/router/policy.d.ts +22 -0
- package/dist/router/policy.d.ts.map +1 -0
- package/dist/router/policy.js +116 -0
- package/dist/router/policy.js.map +1 -0
- package/dist/router/route-context.js +79 -0
- package/dist/router/route-context.js.map +1 -0
- package/dist/router/route.d.ts +101 -34
- package/dist/router/route.d.ts.map +1 -1
- package/dist/router/route.js +599 -1
- package/dist/router/route.js.map +1 -0
- package/dist/runtime/child-scope.d.ts +21 -0
- package/dist/runtime/child-scope.d.ts.map +1 -0
- package/dist/runtime/child-scope.js +77 -0
- package/dist/runtime/child-scope.js.map +1 -0
- package/dist/runtime/component.d.ts +67 -56
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/component.js +462 -1
- package/dist/runtime/component.js.map +1 -0
- package/dist/runtime/context.d.ts +28 -42
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js +205 -1
- package/dist/runtime/context.js.map +1 -0
- package/dist/runtime/control.d.ts +43 -0
- package/dist/runtime/control.d.ts.map +1 -0
- package/dist/runtime/control.js +125 -0
- package/dist/runtime/control.js.map +1 -0
- package/dist/runtime/derive.d.ts +12 -9
- package/dist/runtime/derive.d.ts.map +1 -1
- package/dist/runtime/derive.js +134 -1
- package/dist/runtime/derive.js.map +1 -0
- package/dist/runtime/dev-namespace.js +57 -1
- package/dist/runtime/dev-namespace.js.map +1 -0
- package/dist/runtime/effect.d.ts +32 -0
- package/dist/runtime/effect.d.ts.map +1 -0
- package/dist/runtime/effect.js +146 -0
- package/dist/runtime/effect.js.map +1 -0
- package/dist/runtime/events.js +162 -1
- package/dist/runtime/events.js.map +1 -0
- package/dist/runtime/execution-model.js +15 -1
- package/dist/runtime/execution-model.js.map +1 -0
- package/dist/runtime/fastlane.js +204 -1
- package/dist/runtime/fastlane.js.map +1 -0
- package/dist/runtime/for-bench.d.ts +41 -0
- package/dist/runtime/for-bench.d.ts.map +1 -0
- package/dist/runtime/for-bench.js +173 -0
- package/dist/runtime/for-bench.js.map +1 -0
- package/dist/runtime/for.d.ts +62 -49
- package/dist/runtime/for.d.ts.map +1 -1
- package/dist/runtime/for.js +668 -1
- package/dist/runtime/for.js.map +1 -0
- package/dist/runtime/operations.d.ts +18 -15
- package/dist/runtime/operations.d.ts.map +1 -1
- package/dist/runtime/operations.js +209 -1
- package/dist/runtime/operations.js.map +1 -0
- package/dist/runtime/perf-metrics.js +64 -1
- package/dist/runtime/perf-metrics.js.map +1 -0
- package/dist/runtime/readable.d.ts +24 -18
- package/dist/runtime/readable.d.ts.map +1 -1
- package/dist/runtime/readable.js +118 -1
- package/dist/runtime/readable.js.map +1 -0
- package/dist/runtime/resource-cell.js +102 -1
- package/dist/runtime/resource-cell.js.map +1 -0
- package/dist/runtime/scheduler.d.ts +51 -50
- package/dist/runtime/scheduler.d.ts.map +1 -1
- package/dist/runtime/scheduler.js +328 -1
- package/dist/runtime/scheduler.js.map +1 -0
- package/dist/runtime/selector.d.ts +7 -5
- package/dist/runtime/selector.d.ts.map +1 -1
- package/dist/runtime/selector.js +188 -1
- package/dist/runtime/selector.js.map +1 -0
- package/dist/runtime/ssr-bridge.js +24 -1
- package/dist/runtime/ssr-bridge.js.map +1 -0
- package/dist/runtime/state.d.ts +11 -19
- package/dist/runtime/state.d.ts.map +1 -1
- package/dist/runtime/state.js +99 -1
- package/dist/runtime/state.js.map +1 -0
- package/dist/ssg/batch-render.d.ts +10 -10
- package/dist/ssg/batch-render.d.ts.map +1 -1
- package/dist/ssg/batch-render.js +84 -1
- package/dist/ssg/batch-render.js.map +1 -0
- package/dist/ssg/create-static-gen.d.ts +28 -29
- package/dist/ssg/create-static-gen.d.ts.map +1 -1
- package/dist/ssg/create-static-gen.js +282 -1
- package/dist/ssg/create-static-gen.js.map +1 -0
- package/dist/ssg/generate-metadata.d.ts +12 -15
- package/dist/ssg/generate-metadata.d.ts.map +1 -1
- package/dist/ssg/generate-metadata.js +94 -1
- package/dist/ssg/generate-metadata.js.map +1 -0
- package/dist/ssg/incremental-manifest.js +56 -1
- package/dist/ssg/incremental-manifest.js.map +1 -0
- package/dist/ssg/index.d.ts +8 -28
- package/dist/ssg/index.js +7 -1
- package/dist/ssg/resolve-ssg-data.d.ts +10 -13
- package/dist/ssg/resolve-ssg-data.d.ts.map +1 -1
- package/dist/ssg/resolve-ssg-data.js +46 -1
- package/dist/ssg/resolve-ssg-data.js.map +1 -0
- package/dist/ssg/route-utils.d.ts +14 -10
- package/dist/ssg/route-utils.d.ts.map +1 -1
- package/dist/ssg/route-utils.js +24 -1
- package/dist/ssg/route-utils.js.map +1 -0
- package/dist/ssg/types.d.ts +157 -144
- package/dist/ssg/types.d.ts.map +1 -1
- package/dist/ssg/write-static-files.d.ts +8 -14
- package/dist/ssg/write-static-files.d.ts.map +1 -1
- package/dist/ssg/write-static-files.js +73 -1
- package/dist/ssg/write-static-files.js.map +1 -0
- package/dist/ssr/attrs.js +93 -1
- package/dist/ssr/attrs.js.map +1 -0
- package/dist/ssr/context.d.ts +31 -35
- package/dist/ssr/context.d.ts.map +1 -1
- package/dist/ssr/context.js +63 -1
- package/dist/ssr/context.js.map +1 -0
- package/dist/ssr/errors.d.ts +6 -4
- package/dist/ssr/errors.d.ts.map +1 -1
- package/dist/ssr/errors.js +4 -1
- package/dist/ssr/errors.js.map +1 -0
- package/dist/ssr/escape.js +153 -1
- package/dist/ssr/escape.js.map +1 -0
- package/dist/ssr/index.d.ts +74 -72
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +543 -1
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/render-keys.d.ts +27 -29
- package/dist/ssr/render-keys.d.ts.map +1 -1
- package/dist/ssr/render-keys.js +39 -1
- package/dist/ssr/render-keys.js.map +1 -0
- package/dist/ssr/sink.js +86 -1
- package/dist/ssr/sink.js.map +1 -0
- package/dist/ssr/stream-render.js +76 -1
- package/dist/ssr/stream-render.js.map +1 -0
- package/dist/ssr/types.d.ts +14 -13
- package/dist/ssr/types.d.ts.map +1 -1
- package/package.json +49 -69
- package/dist/_virtual/___vite-browser-external.js +0 -1
- package/dist/_virtual/__vite-browser-external.js +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -1
- package/dist/_virtual/_fs.js +0 -1
- package/dist/_virtual/_path.js +0 -1
- package/dist/_virtual/main.js +0 -1
- package/dist/_virtual/preload-helper.js +0 -1
- package/dist/bench/benchmark-entry.d.ts +0 -14
- package/dist/bench/benchmark-entry.d.ts.map +0 -1
- package/dist/common/errors.d.ts +0 -53
- package/dist/common/errors.d.ts.map +0 -1
- package/dist/common/index.d.ts +0 -14
- package/dist/common/index.d.ts.map +0 -1
- package/dist/dev/invariant.d.ts +0 -83
- package/dist/dev/invariant.d.ts.map +0 -1
- package/dist/dev/logger.d.ts +0 -13
- package/dist/dev/logger.d.ts.map +0 -1
- package/dist/dev/vite-plugin-askr.d.ts +0 -25
- package/dist/dev/vite-plugin-askr.d.ts.map +0 -1
- package/dist/dev/warnings.d.ts +0 -5
- package/dist/dev/warnings.d.ts.map +0 -1
- package/dist/for/for.d.ts +0 -16
- package/dist/for/for.d.ts.map +0 -1
- package/dist/for/for.js +0 -1
- package/dist/for/index.d.ts +0 -2
- package/dist/for/index.d.ts.map +0 -1
- package/dist/for/index.js +0 -1
- package/dist/foundations/core.d.ts.map +0 -1
- package/dist/foundations/index.d.ts.map +0 -1
- package/dist/foundations/interactions/index.d.ts +0 -5
- package/dist/foundations/interactions/index.d.ts.map +0 -1
- package/dist/foundations/state/index.d.ts +0 -2
- package/dist/foundations/state/index.d.ts.map +0 -1
- package/dist/foundations/structures/index.d.ts +0 -5
- package/dist/foundations/structures/index.d.ts.map +0 -1
- package/dist/foundations/structures.d.ts.map +0 -1
- package/dist/foundations/utilities/index.d.ts +0 -7
- package/dist/foundations/utilities/index.d.ts.map +0 -1
- package/dist/fx/index.d.ts.map +0 -1
- package/dist/fx/noop.d.ts +0 -12
- package/dist/fx/noop.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsx/index.d.ts.map +0 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -4
- package/dist/jsx/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx/jsx-runtime.d.ts +0 -10
- package/dist/jsx/jsx-runtime.d.ts.map +0 -1
- package/dist/node_modules/esbuild/lib/main.js +0 -65
- package/dist/renderer/cleanup.d.ts +0 -28
- package/dist/renderer/cleanup.d.ts.map +0 -1
- package/dist/renderer/dom.d.ts +0 -64
- package/dist/renderer/dom.d.ts.map +0 -1
- package/dist/renderer/evaluate.d.ts +0 -4
- package/dist/renderer/evaluate.d.ts.map +0 -1
- package/dist/renderer/fastpath.d.ts +0 -7
- package/dist/renderer/fastpath.d.ts.map +0 -1
- package/dist/renderer/index.d.ts +0 -6
- package/dist/renderer/index.d.ts.map +0 -1
- package/dist/renderer/keyed.d.ts +0 -23
- package/dist/renderer/keyed.d.ts.map +0 -1
- package/dist/renderer/reconcile.d.ts +0 -88
- package/dist/renderer/reconcile.d.ts.map +0 -1
- package/dist/renderer/types.d.ts +0 -3
- package/dist/renderer/types.d.ts.map +0 -1
- package/dist/renderer/utils.d.ts +0 -63
- package/dist/renderer/utils.d.ts.map +0 -1
- package/dist/resources/index.d.ts.map +0 -1
- package/dist/router/index.d.ts.map +0 -1
- package/dist/router/match.d.ts +0 -22
- package/dist/router/match.d.ts.map +0 -1
- package/dist/runtime/dev-namespace.d.ts +0 -31
- package/dist/runtime/dev-namespace.d.ts.map +0 -1
- package/dist/runtime/events.d.ts +0 -53
- package/dist/runtime/events.d.ts.map +0 -1
- package/dist/runtime/execution-model.d.ts +0 -4
- package/dist/runtime/execution-model.d.ts.map +0 -1
- package/dist/runtime/fastlane.d.ts +0 -27
- package/dist/runtime/fastlane.d.ts.map +0 -1
- package/dist/runtime/hydration.d.ts +0 -25
- package/dist/runtime/hydration.d.ts.map +0 -1
- package/dist/runtime/perf-metrics.d.ts +0 -25
- package/dist/runtime/perf-metrics.d.ts.map +0 -1
- package/dist/runtime/resource-cell.d.ts +0 -35
- package/dist/runtime/resource-cell.d.ts.map +0 -1
- package/dist/runtime/snapshot.d.ts +0 -25
- package/dist/runtime/snapshot.d.ts.map +0 -1
- package/dist/runtime/ssr-bridge.d.ts +0 -10
- package/dist/runtime/ssr-bridge.d.ts.map +0 -1
- package/dist/ssg/discover-resources.d.ts +0 -15
- package/dist/ssg/discover-resources.d.ts.map +0 -1
- package/dist/ssg/incremental-manifest.d.ts +0 -23
- package/dist/ssg/incremental-manifest.d.ts.map +0 -1
- package/dist/ssg/index.d.ts.map +0 -1
- package/dist/ssr/attrs.d.ts +0 -26
- package/dist/ssr/attrs.d.ts.map +0 -1
- package/dist/ssr/create-ssr.d.ts +0 -19
- package/dist/ssr/create-ssr.d.ts.map +0 -1
- package/dist/ssr/escape.d.ts +0 -38
- package/dist/ssr/escape.d.ts.map +0 -1
- package/dist/ssr/sink.d.ts +0 -23
- package/dist/ssr/sink.d.ts.map +0 -1
- package/dist/ssr/stream-render.d.ts +0 -7
- package/dist/ssr/stream-render.d.ts.map +0 -1
- package/dist/vite/index.js +0 -4
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* In phase 1, primarily handles user-supplied data.
|
|
6
|
-
*/
|
|
7
|
-
import type { SSRData } from '../common/ssr';
|
|
8
|
-
import type { RouteConfig } from './types';
|
|
1
|
+
import { RouteConfig } from "./types.js";
|
|
2
|
+
import { SSRData } from "../common/ssr.js";
|
|
3
|
+
|
|
4
|
+
//#region src/ssg/resolve-ssg-data.d.ts
|
|
9
5
|
interface DataResolutionOptions {
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
/** User-supplied data overrides per route path */
|
|
7
|
+
dataOverrides?: Record<string, unknown>;
|
|
12
8
|
}
|
|
13
9
|
/**
|
|
14
10
|
* Resolve and validate data for SSG routes
|
|
@@ -17,10 +13,11 @@ interface DataResolutionOptions {
|
|
|
17
13
|
* In phase 1: accepts user-supplied dataOverrides
|
|
18
14
|
* In phase 2: can be extended to auto-discover resources
|
|
19
15
|
*/
|
|
20
|
-
|
|
16
|
+
declare function resolveSsgData(routes: RouteConfig[], options?: DataResolutionOptions): Record<string, SSRData>;
|
|
21
17
|
/**
|
|
22
18
|
* Validate routes are properly configured
|
|
23
19
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
declare function validateRoutes(routes: RouteConfig[]): void;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { resolveSsgData, validateRoutes };
|
|
26
23
|
//# sourceMappingURL=resolve-ssg-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-ssg-data.d.ts","
|
|
1
|
+
{"version":3,"file":"resolve-ssg-data.d.ts","names":[],"sources":["../../src/ssg/resolve-ssg-data.ts"],"mappings":";;;;UAUU,qBAAA;EAYM;EAVd,aAAA,GAAgB,MAAA;AAAA;;;;;;;;iBAUF,cAAA,CACd,MAAA,EAAQ,WAAA,IACR,OAAA,GAAS,qBAAA,GACR,MAAA,SAAe,OAAA;;;;iBAyBF,cAAA,CAAe,MAAA,EAAQ,WAAA"}
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/ssg/resolve-ssg-data.ts
|
|
2
|
+
/**
|
|
3
|
+
* Resolve and validate data for SSG routes
|
|
4
|
+
* Returns a map of route path -> SSRData
|
|
5
|
+
*
|
|
6
|
+
* In phase 1: accepts user-supplied dataOverrides
|
|
7
|
+
* In phase 2: can be extended to auto-discover resources
|
|
8
|
+
*/
|
|
9
|
+
function resolveSsgData(routes, options = {}) {
|
|
10
|
+
const { dataOverrides = {} } = options;
|
|
11
|
+
const dataMap = {};
|
|
12
|
+
for (const route of routes) if (route.path in dataOverrides) {
|
|
13
|
+
const data = dataOverrides[route.path];
|
|
14
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) throw new Error(`data for route "${route.path}" must be an object, got ${typeof data}`);
|
|
15
|
+
dataMap[route.path] = data;
|
|
16
|
+
}
|
|
17
|
+
return dataMap;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Validate routes are properly configured
|
|
21
|
+
*/
|
|
22
|
+
function validateRoutes(routes) {
|
|
23
|
+
if (!Array.isArray(routes)) throw new Error("routes must be an array");
|
|
24
|
+
if (routes.length === 0) throw new Error("routes array cannot be empty");
|
|
25
|
+
const seen = /* @__PURE__ */ new Set();
|
|
26
|
+
for (const route of routes) {
|
|
27
|
+
if (typeof route.path !== "string" || !route.path.startsWith("/")) throw new Error(`route path must be a string starting with "/", got "${route.path}"`);
|
|
28
|
+
if (typeof (route.handler ?? route.component) !== "function") throw new Error(`route handler must be a function for path "${route.path}"`);
|
|
29
|
+
const key = `${route.path}::${JSON.stringify(route.params || {})}`;
|
|
30
|
+
if (seen.has(key)) throw new Error(`duplicate route entry detected for path "${route.path}"`);
|
|
31
|
+
seen.add(key);
|
|
32
|
+
if (route.path.includes("{")) {
|
|
33
|
+
const paramNames = Array.from(route.path.matchAll(/\{([^}]+)\}/g)).map((m) => m[1]);
|
|
34
|
+
if (!route.params) throw new Error(`route "${route.path}" uses path parameters and requires params`);
|
|
35
|
+
for (const name of paramNames) if (!(name in route.params)) throw new Error(`route "${route.path}" missing required param "${name}"`);
|
|
36
|
+
}
|
|
37
|
+
if (route.invalidationKeys !== void 0) {
|
|
38
|
+
if (!Array.isArray(route.invalidationKeys)) throw new Error(`route "${route.path}" invalidationKeys must be an array of strings`);
|
|
39
|
+
for (const key of route.invalidationKeys) if (typeof key !== "string" || key.length === 0) throw new Error(`route "${route.path}" invalidationKeys must contain only non-empty strings`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { resolveSsgData, validateRoutes };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=resolve-ssg-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-ssg-data.js","names":[],"sources":["../../src/ssg/resolve-ssg-data.ts"],"sourcesContent":["/**\n * Data resolution for SSG\n *\n * Merges user-supplied data overrides with any auto-discovered resources.\n * In phase 1, primarily handles user-supplied data.\n */\n\nimport type { SSRData } from '../common/ssr';\nimport type { RouteConfig } from './types';\n\ninterface DataResolutionOptions {\n /** User-supplied data overrides per route path */\n dataOverrides?: Record<string, unknown>;\n}\n\n/**\n * Resolve and validate data for SSG routes\n * Returns a map of route path -> SSRData\n *\n * In phase 1: accepts user-supplied dataOverrides\n * In phase 2: can be extended to auto-discover resources\n */\nexport function resolveSsgData(\n routes: RouteConfig[],\n options: DataResolutionOptions = {}\n): Record<string, SSRData> {\n const { dataOverrides = {} } = options;\n const dataMap: Record<string, SSRData> = {};\n\n for (const route of routes) {\n // Check if user provided data for this route\n if (route.path in dataOverrides) {\n const data = dataOverrides[route.path];\n if (typeof data !== 'object' || data === null || Array.isArray(data)) {\n throw new Error(\n `data for route \"${route.path}\" must be an object, got ${typeof data}`\n );\n }\n dataMap[route.path] = data as SSRData;\n }\n // In phase 1, routes without data are rendered with no SSR data\n // Phase 2 can add auto-discovery here\n }\n\n return dataMap;\n}\n\n/**\n * Validate routes are properly configured\n */\nexport function validateRoutes(routes: RouteConfig[]): void {\n if (!Array.isArray(routes)) {\n throw new Error('routes must be an array');\n }\n\n if (routes.length === 0) {\n throw new Error('routes array cannot be empty');\n }\n\n const seen = new Set<string>();\n\n for (const route of routes) {\n if (typeof route.path !== 'string' || !route.path.startsWith('/')) {\n throw new Error(\n `route path must be a string starting with \"/\", got \"${route.path}\"`\n );\n }\n\n const handler = route.handler ?? route.component;\n if (typeof handler !== 'function') {\n throw new Error(\n `route handler must be a function for path \"${route.path}\"`\n );\n }\n\n const key = `${route.path}::${JSON.stringify(route.params || {})}`;\n if (seen.has(key)) {\n throw new Error(\n `duplicate route entry detected for path \"${route.path}\"`\n );\n }\n seen.add(key);\n\n if (route.path.includes('{')) {\n const paramNames = Array.from(route.path.matchAll(/\\{([^}]+)\\}/g)).map(\n (m) => m[1]\n );\n if (!route.params) {\n throw new Error(\n `route \"${route.path}\" uses path parameters and requires params`\n );\n }\n for (const name of paramNames) {\n if (!(name in route.params)) {\n throw new Error(\n `route \"${route.path}\" missing required param \"${name}\"`\n );\n }\n }\n }\n\n if (route.invalidationKeys !== undefined) {\n if (!Array.isArray(route.invalidationKeys)) {\n throw new Error(\n `route \"${route.path}\" invalidationKeys must be an array of strings`\n );\n }\n for (const key of route.invalidationKeys) {\n if (typeof key !== 'string' || key.length === 0) {\n throw new Error(\n `route \"${route.path}\" invalidationKeys must contain only non-empty strings`\n );\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;AAsBA,SAAgB,eACd,QACA,UAAiC,EAAE,EACV;CACzB,MAAM,EAAE,gBAAgB,EAAE,KAAK;CAC/B,MAAM,UAAmC,EAAE;AAE3C,MAAK,MAAM,SAAS,OAElB,KAAI,MAAM,QAAQ,eAAe;EAC/B,MAAM,OAAO,cAAc,MAAM;AACjC,MAAI,OAAO,SAAS,YAAY,SAAS,QAAQ,MAAM,QAAQ,KAAK,CAClE,OAAM,IAAI,MACR,mBAAmB,MAAM,KAAK,2BAA2B,OAAO,OACjE;AAEH,UAAQ,MAAM,QAAQ;;AAM1B,QAAO;;;;;AAMT,SAAgB,eAAe,QAA6B;AAC1D,KAAI,CAAC,MAAM,QAAQ,OAAO,CACxB,OAAM,IAAI,MAAM,0BAA0B;AAG5C,KAAI,OAAO,WAAW,EACpB,OAAM,IAAI,MAAM,+BAA+B;CAGjD,MAAM,uBAAO,IAAI,KAAa;AAE9B,MAAK,MAAM,SAAS,QAAQ;AAC1B,MAAI,OAAO,MAAM,SAAS,YAAY,CAAC,MAAM,KAAK,WAAW,IAAI,CAC/D,OAAM,IAAI,MACR,uDAAuD,MAAM,KAAK,GACnE;AAIH,MAAI,QADY,MAAM,WAAW,MAAM,eAChB,WACrB,OAAM,IAAI,MACR,8CAA8C,MAAM,KAAK,GAC1D;EAGH,MAAM,MAAM,GAAG,MAAM,KAAK,IAAI,KAAK,UAAU,MAAM,UAAU,EAAE,CAAC;AAChE,MAAI,KAAK,IAAI,IAAI,CACf,OAAM,IAAI,MACR,4CAA4C,MAAM,KAAK,GACxD;AAEH,OAAK,IAAI,IAAI;AAEb,MAAI,MAAM,KAAK,SAAS,IAAI,EAAE;GAC5B,MAAM,aAAa,MAAM,KAAK,MAAM,KAAK,SAAS,eAAe,CAAC,CAAC,KAChE,MAAM,EAAE,GACV;AACD,OAAI,CAAC,MAAM,OACT,OAAM,IAAI,MACR,UAAU,MAAM,KAAK,4CACtB;AAEH,QAAK,MAAM,QAAQ,WACjB,KAAI,EAAE,QAAQ,MAAM,QAClB,OAAM,IAAI,MACR,UAAU,MAAM,KAAK,4BAA4B,KAAK,GACvD;;AAKP,MAAI,MAAM,qBAAqB,QAAW;AACxC,OAAI,CAAC,MAAM,QAAQ,MAAM,iBAAiB,CACxC,OAAM,IAAI,MACR,UAAU,MAAM,KAAK,gDACtB;AAEH,QAAK,MAAM,OAAO,MAAM,iBACtB,KAAI,OAAO,QAAQ,YAAY,IAAI,WAAW,EAC5C,OAAM,IAAI,MACR,UAAU,MAAM,KAAK,wDACtB"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { RouteConfig } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/ssg/route-utils.d.ts
|
|
4
|
+
interface ResolvedRouteDescriptor {
|
|
5
|
+
route: RouteConfig;
|
|
6
|
+
path: string;
|
|
7
|
+
filePath: string;
|
|
8
|
+
routeId: string;
|
|
9
|
+
invalidationKeys: string[];
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
declare function getOutputFilePath(pathStr: string): string;
|
|
12
|
+
declare function interpolateRoutePath(routePath: string, params?: Record<string, string>): string;
|
|
13
|
+
declare function resolveRouteDescriptor(route: RouteConfig): ResolvedRouteDescriptor;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { getOutputFilePath };
|
|
12
16
|
//# sourceMappingURL=route-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-utils.d.ts","
|
|
1
|
+
{"version":3,"file":"route-utils.d.ts","names":[],"sources":["../../src/ssg/route-utils.ts"],"mappings":";;;UAEiB,uBAAA;EACf,KAAA,EAAO,WAAA;EACP,IAAA;EACA,QAAA;EACA,OAAA;EACA,gBAAA;AAAA;AAAA,iBAGc,iBAAA,CAAkB,OAAA;AAAA,iBAQlB,oBAAA,CACd,SAAA,UACA,MAAA,GAAS,MAAA;AAAA,iBASK,sBAAA,CACd,KAAA,EAAO,WAAA,GACN,uBAAA"}
|
package/dist/ssg/route-utils.js
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/ssg/route-utils.ts
|
|
2
|
+
function getOutputFilePath(pathStr) {
|
|
3
|
+
if (pathStr === "/") return "index.html";
|
|
4
|
+
return `${pathStr.replace(/^\/|\/$/g, "")}/index.html`;
|
|
5
|
+
}
|
|
6
|
+
function interpolateRoutePath(routePath, params) {
|
|
7
|
+
if (!params) return routePath;
|
|
8
|
+
return routePath.replace(/\{([^}]+)\}/g, (_, key) => params[key] ?? "");
|
|
9
|
+
}
|
|
10
|
+
function resolveRouteDescriptor(route) {
|
|
11
|
+
const path = interpolateRoutePath(route.path, route.params);
|
|
12
|
+
const filePath = getOutputFilePath(path);
|
|
13
|
+
return {
|
|
14
|
+
route,
|
|
15
|
+
path,
|
|
16
|
+
filePath,
|
|
17
|
+
routeId: `${path}::${filePath}`,
|
|
18
|
+
invalidationKeys: route.invalidationKeys?.slice() ?? []
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { getOutputFilePath, interpolateRoutePath, resolveRouteDescriptor };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=route-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-utils.js","names":[],"sources":["../../src/ssg/route-utils.ts"],"sourcesContent":["import type { RouteConfig } from './types';\n\nexport interface ResolvedRouteDescriptor {\n route: RouteConfig;\n path: string;\n filePath: string;\n routeId: string;\n invalidationKeys: string[];\n}\n\nexport function getOutputFilePath(pathStr: string): string {\n if (pathStr === '/') {\n return 'index.html';\n }\n const normalized = pathStr.replace(/^\\/|\\/$/g, '');\n return `${normalized}/index.html`;\n}\n\nexport function interpolateRoutePath(\n routePath: string,\n params?: Record<string, string>\n): string {\n if (!params) return routePath;\n return routePath.replace(\n /\\{([^}]+)\\}/g,\n (_, key: string) => params[key] ?? ''\n );\n}\n\nexport function resolveRouteDescriptor(\n route: RouteConfig\n): ResolvedRouteDescriptor {\n const path = interpolateRoutePath(route.path, route.params);\n const filePath = getOutputFilePath(path);\n return {\n route,\n path,\n filePath,\n routeId: `${path}::${filePath}`,\n invalidationKeys: route.invalidationKeys?.slice() ?? [],\n };\n}\n"],"mappings":";AAUA,SAAgB,kBAAkB,SAAyB;AACzD,KAAI,YAAY,IACd,QAAO;AAGT,QAAO,GADY,QAAQ,QAAQ,YAAY,GACrC,CAAW;;AAGvB,SAAgB,qBACd,WACA,QACQ;AACR,KAAI,CAAC,OAAQ,QAAO;AACpB,QAAO,UAAU,QACf,iBACC,GAAG,QAAgB,OAAO,QAAQ,GACpC;;AAGH,SAAgB,uBACd,OACyB;CACzB,MAAM,OAAO,qBAAqB,MAAM,MAAM,MAAM,OAAO;CAC3D,MAAM,WAAW,kBAAkB,KAAK;AACxC,QAAO;EACL;EACA;EACA;EACA,SAAS,GAAG,KAAK,IAAI;EACrB,kBAAkB,MAAM,kBAAkB,OAAO,IAAI,EAAE;EACxD"}
|
package/dist/ssg/types.d.ts
CHANGED
|
@@ -1,164 +1,177 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type RouteRenderReason = 'full' | 'changed-key' | 'changed-route' | 'new-route' | 'no-keys' | 'unchanged' | 'deleted';
|
|
1
|
+
import { ComponentFunction } from "../common/component.js";
|
|
2
|
+
import { RouteAuthMode, RouteHandler, RoutePolicy } from "../common/router.js";
|
|
3
|
+
|
|
4
|
+
//#region src/ssg/types.d.ts
|
|
5
|
+
type SSGMode = 'full' | 'incremental';
|
|
6
|
+
type RouteRenderStatus = 'success' | 'error' | 'skipped' | 'removed';
|
|
7
|
+
type RouteRenderReason = 'full' | 'changed-key' | 'changed-route' | 'new-route' | 'no-keys' | 'unchanged' | 'deleted' | 'runtime-only';
|
|
9
8
|
/**
|
|
10
9
|
* Route config accepted by SSG.
|
|
11
10
|
*
|
|
12
11
|
* `handler` is preferred and matches router/SSR naming.
|
|
13
12
|
* `component` is kept for compatibility and is normalized to `handler`.
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
interface RouteConfig {
|
|
15
|
+
/** URL path to generate (e.g., "/blog/post-1", "/") */
|
|
16
|
+
path: string;
|
|
17
|
+
/** Route handler compatible with router/SSR */
|
|
18
|
+
handler?: RouteHandler;
|
|
19
|
+
/** Backward-compatible alias for handler */
|
|
20
|
+
component?: ComponentFunction;
|
|
21
|
+
/** Optional base props merged with route params during render */
|
|
22
|
+
props?: Record<string, unknown>;
|
|
23
|
+
/** Optional namespace for router compatibility */
|
|
24
|
+
namespace?: string;
|
|
25
|
+
/** Guest routes remain prerenderable; authenticated routes are runtime-only by default */
|
|
26
|
+
auth?: RouteAuthMode;
|
|
27
|
+
/** Role-gated routes are runtime-only by default */
|
|
28
|
+
role?: string;
|
|
29
|
+
/** Permission-gated routes are runtime-only by default */
|
|
30
|
+
permission?: string;
|
|
31
|
+
/** Advanced runtime access checks disable prerendering by default */
|
|
32
|
+
policies?: readonly RoutePolicy[];
|
|
33
|
+
/** Optional path parameter map for template paths like "/blog/{slug}" */
|
|
34
|
+
params?: Record<string, string>;
|
|
35
|
+
/** Optional explicit invalidation keys for incremental generation */
|
|
36
|
+
invalidationKeys?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* SSG entry generator for parameterized routes.
|
|
39
|
+
*
|
|
40
|
+
* Return one param map per page to be generated. The path template is
|
|
41
|
+
* expanded with each map to produce a concrete URL, e.g.:
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* route('/posts/{slug}', PostPage, {
|
|
45
|
+
* entries: async () => getPosts().map(p => ({ slug: p.slug })),
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
entries?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
30
50
|
}
|
|
31
51
|
/** Options for createStaticGen */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
interface SSGOptions {
|
|
53
|
+
/** Routes to generate */
|
|
54
|
+
routes: RouteConfig[];
|
|
55
|
+
/** Output directory for generated HTML files */
|
|
56
|
+
outputDir: string;
|
|
57
|
+
/** Optional seed for deterministic rendering */
|
|
58
|
+
seed?: number;
|
|
59
|
+
/** Optional override data for resources (route-keyed) */
|
|
60
|
+
dataOverrides?: Record<string, unknown>;
|
|
61
|
+
/** Optional concurrency limit for rendering (default: 10) */
|
|
62
|
+
concurrency?: number;
|
|
63
|
+
/** Preferred render parallelism. `'auto'` resolves from the host machine. */
|
|
64
|
+
parallelism?: number | 'auto';
|
|
45
65
|
}
|
|
46
66
|
/** Options for a single generation run */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
67
|
+
interface SSGGenerateOptions {
|
|
68
|
+
/** Generation mode */
|
|
69
|
+
mode?: SSGMode;
|
|
70
|
+
/** Changed invalidation keys for incremental runs */
|
|
71
|
+
changedKeys?: string[];
|
|
72
|
+
/** Changed concrete route paths for incremental runs */
|
|
73
|
+
changedRoutes?: string[];
|
|
74
|
+
/** Force a full rebuild even when incremental mode was requested */
|
|
75
|
+
forceFull?: boolean;
|
|
56
76
|
}
|
|
57
77
|
/** Result of rendering a single route */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
interface RouteRenderResult {
|
|
79
|
+
/** URL path */
|
|
80
|
+
path: string;
|
|
81
|
+
/** Output file path relative to outputDir */
|
|
82
|
+
filePath: string;
|
|
83
|
+
/** Generated HTML content */
|
|
84
|
+
html: string;
|
|
85
|
+
/** File size in bytes */
|
|
86
|
+
fileSize: number;
|
|
87
|
+
/** Render duration in milliseconds */
|
|
88
|
+
renderDuration: number;
|
|
89
|
+
/** Number of resources discovered and rendered */
|
|
90
|
+
resourceCount: number;
|
|
91
|
+
/** Render or generation status */
|
|
92
|
+
status: RouteRenderStatus;
|
|
93
|
+
/** Why this route was rendered, skipped, or removed */
|
|
94
|
+
reason: RouteRenderReason;
|
|
95
|
+
/** Whether the output file was written during this run */
|
|
96
|
+
written: boolean;
|
|
97
|
+
/** Error message if rendering failed */
|
|
98
|
+
error?: string;
|
|
79
99
|
}
|
|
80
100
|
/** Overall result from SSG generation */
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
interface SSGResult {
|
|
102
|
+
/** ISO timestamp of generation */
|
|
103
|
+
generatedAt: string;
|
|
104
|
+
/** Total number of routes processed */
|
|
105
|
+
totalRoutes: number;
|
|
106
|
+
/** Number of successfully generated routes */
|
|
107
|
+
successful: number;
|
|
108
|
+
/** Number of failed routes */
|
|
109
|
+
failed: number;
|
|
110
|
+
/** Total generation duration in milliseconds */
|
|
111
|
+
totalDuration: number;
|
|
112
|
+
/** Effective generation mode */
|
|
113
|
+
mode: SSGMode;
|
|
114
|
+
/** Number of routes rendered during this run */
|
|
115
|
+
rebuilt: number;
|
|
116
|
+
/** Number of current routes skipped as unchanged */
|
|
117
|
+
skipped: number;
|
|
118
|
+
/** Number of stale routes removed from output */
|
|
119
|
+
removed: number;
|
|
120
|
+
/** Number of rendered routes whose HTML bytes were unchanged */
|
|
121
|
+
cacheHits: number;
|
|
122
|
+
/** Invalidation keys applied to this run */
|
|
123
|
+
invalidatedKeys: string[];
|
|
124
|
+
/** Concrete route paths applied to this run */
|
|
125
|
+
invalidatedRoutes: string[];
|
|
126
|
+
/** Per-route results */
|
|
127
|
+
routes: RouteRenderResult[];
|
|
108
128
|
}
|
|
109
129
|
/** Metadata to write to metadata.json */
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
/** Render or generation status */
|
|
148
|
-
status: RouteRenderStatus;
|
|
149
|
-
/** Why this route was rendered, skipped, or removed */
|
|
150
|
-
reason: RouteRenderReason;
|
|
151
|
-
/** Whether the output file was written during this run */
|
|
152
|
-
written: boolean;
|
|
153
|
-
/** Error message if rendering failed */
|
|
154
|
-
error?: string;
|
|
155
|
-
}>;
|
|
130
|
+
interface SSGMetadata extends Record<string, unknown> {
|
|
131
|
+
/** ISO timestamp of generation */
|
|
132
|
+
generatedAt: string;
|
|
133
|
+
/** Total number of routes processed */
|
|
134
|
+
totalRoutes: number;
|
|
135
|
+
/** Number of successfully generated routes */
|
|
136
|
+
successful: number;
|
|
137
|
+
/** Number of failed routes */
|
|
138
|
+
failed: number;
|
|
139
|
+
/** Total generation duration in milliseconds */
|
|
140
|
+
totalDuration: number;
|
|
141
|
+
/** Effective generation mode */
|
|
142
|
+
mode: SSGMode;
|
|
143
|
+
/** Number of routes rendered during this run */
|
|
144
|
+
rebuilt: number;
|
|
145
|
+
/** Number of current routes skipped as unchanged */
|
|
146
|
+
skipped: number;
|
|
147
|
+
/** Number of stale routes removed from output */
|
|
148
|
+
removed: number;
|
|
149
|
+
/** Number of rendered routes whose HTML bytes were unchanged */
|
|
150
|
+
cacheHits: number;
|
|
151
|
+
/** Invalidation keys applied to this run */
|
|
152
|
+
invalidatedKeys: string[];
|
|
153
|
+
/** Concrete route paths applied to this run */
|
|
154
|
+
invalidatedRoutes: string[];
|
|
155
|
+
/** Per-route details */
|
|
156
|
+
routes: Array<{
|
|
157
|
+
/** URL path */path: string; /** Output file path relative to outputDir */
|
|
158
|
+
filePath: string; /** File size in bytes */
|
|
159
|
+
fileSize: number; /** Render duration in milliseconds */
|
|
160
|
+
renderDuration: number; /** Number of resources discovered and rendered */
|
|
161
|
+
resourceCount: number; /** Render or generation status */
|
|
162
|
+
status: RouteRenderStatus; /** Why this route was rendered, skipped, or removed */
|
|
163
|
+
reason: RouteRenderReason; /** Whether the output file was written during this run */
|
|
164
|
+
written: boolean; /** Error message if rendering failed */
|
|
165
|
+
error?: string;
|
|
166
|
+
}>;
|
|
156
167
|
}
|
|
157
168
|
/** Resource discovery result for a single route */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
169
|
+
interface DiscoveredResources {
|
|
170
|
+
[key: string]: {
|
|
171
|
+
count: number;
|
|
172
|
+
dependencies: string[];
|
|
173
|
+
};
|
|
163
174
|
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { DiscoveredResources, RouteConfig, RouteRenderReason, RouteRenderResult, RouteRenderStatus, SSGGenerateOptions, SSGMetadata, SSGMode, SSGOptions, SSGResult };
|
|
164
177
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/ssg/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/ssg/types.ts"],"mappings":";;;;KAWY,OAAA;AAAA,KAEA,iBAAA;AAAA,KAEA,iBAAA;;AAFZ;;;;;UAkBiB,WAAA;EAhBY;EAkB3B,IAAA;EAlB2B;EAoB3B,OAAA,GAAU,YAAA;EAJK;EAMf,SAAA,GAAY,iBAAA;;EAEZ,KAAA,GAAQ,MAAA;EAFI;EAIZ,SAAA;EAEO;EAAP,IAAA,GAAO,aAAA;EAQE;EANT,IAAA;EAsBI;EApBJ,UAAA;EAqBY;EAnBZ,QAAA,YAAoB,WAAA;EAmBT;EAjBX,MAAA,GAAS,MAAA;EAlBT;EAoBA,gBAAA;EAlBU;;;;;;;;;;;;EA+BV,OAAA,SACI,KAAA,CAAM,MAAA,oBACN,OAAA,CAAQ,KAAA,CAAM,MAAA;AAAA;;UAIH,UAAA;EALX;EAOJ,MAAA,EAAQ,WAAA;EANJ;EAQJ,SAAA;EARkB;EAUlB,IAAA;EAVwB;EAYxB,aAAA,GAAgB,MAAA;EARS;EAUzB,WAAA;EAFsB;EAItB,WAAA;AAAA;;UAIe,kBAAA;EARf;EAUA,IAAA,GAAO,OAAA;EARP;EAUA,WAAA;EARW;EAUX,aAAA;EANe;EAQf,SAAA;AAAA;;UAIe,iBAAA;EAVR;EAYP,IAAA;EARA;EAUA,QAAA;EARS;EAUT,IAAA;EANe;EAQf,QAAA;;EAEA,cAAA;EARA;EAUA,aAAA;EANA;EAQA,MAAA,EAAQ,iBAAA;EAJR;EAMA,MAAA,EAAQ,iBAAA;EAFR;EAIA,OAAA;EAFA;EAIA,KAAA;AAAA;;UAIe,SAAA;EAJV;EAML,WAAA;EAFwB;EAIxB,WAAA;EAsByB;EApBzB,UAAA;EAFA;EAIA,MAAA;EAAA;EAEA,aAAA;EAEA;EAAA,IAAA,EAAM,OAAA;EAEN;EAAA,OAAA;EAIA;EAFA,OAAA;EAMA;EAJA,OAAA;EAQA;EANA,SAAA;EAMyB;EAJzB,eAAA;EAQe;EANf,iBAAA;;EAEA,MAAA,EAAQ,iBAAA;AAAA;;UAIO,WAAA,SAAoB,MAAA;EAAA;EAEnC,WAAA;EAFyC;EAIzC,WAAA;EAFA;EAIA,UAAA;EAAA;EAEA,MAAA;EAEA;EAAA,aAAA;EAEM;EAAN,IAAA,EAAM,OAAA;EAIN;EAFA,OAAA;EAMA;EAJA,OAAA;EAQA;EANA,OAAA;EAQQ;EANR,SAAA;EAUE;EARF,eAAA;EAYE;EAVF,iBAAA;EAcE;EAZF,MAAA,EAAQ,KAAA;IAcN,eAZA,IAAA,UAcA;IAZA,QAAA,UAcK;IAZL,QAAA,UAiBa;IAfb,cAAA,UAegC;IAbhC,aAAA,UAcD;IAZC,MAAA,EAAQ,iBAAA,EAcR;IAZA,MAAA,EAAQ,iBAAA,EAYI;IAVZ,OAAA;IAEA,KAAA;EAAA;AAAA;;UAKa,mBAAA;EAAA,CACd,GAAA;IACC,KAAA;IACA,YAAA;EAAA;AAAA"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* This module is Node-only and not intended for browser builds.
|
|
6
|
-
*/
|
|
7
|
-
import type { RouteRenderResult } from './types';
|
|
1
|
+
import { RouteRenderResult } from "./types.js";
|
|
2
|
+
import { getOutputFilePath } from "./route-utils.js";
|
|
3
|
+
|
|
4
|
+
//#region src/ssg/write-static-files.d.ts
|
|
8
5
|
interface WriteStaticFilesOptions {
|
|
9
|
-
|
|
6
|
+
concurrency?: number;
|
|
10
7
|
}
|
|
11
8
|
/**
|
|
12
9
|
* Write rendered routes to disk
|
|
13
10
|
* Creates outputDir/{route-path}/index.html structure
|
|
14
11
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* E.g., "/blog/post" -> "blog/post" or "/" -> ""
|
|
19
|
-
*/
|
|
20
|
-
export { getOutputFilePath } from './route-utils';
|
|
12
|
+
declare function writeStaticFiles(results: RouteRenderResult[], outputDir: string, options?: WriteStaticFilesOptions): Promise<void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { writeStaticFiles };
|
|
21
15
|
//# sourceMappingURL=write-static-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-static-files.d.ts","
|
|
1
|
+
{"version":3,"file":"write-static-files.d.ts","names":[],"sources":["../../src/ssg/write-static-files.ts"],"mappings":";;;;UAYU,uBAAA;EACR,WAAA;AAAA;;;;;iBAOoB,gBAAA,CACpB,OAAA,EAAS,iBAAA,IACT,SAAA,UACA,OAAA,GAAS,uBAAA,GACR,OAAA"}
|