@stacksjs/stx 0.2.572 → 0.2.574
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a11y.d.ts +51 -111
- package/dist/animation.d.ts +131 -74
- package/dist/api-client.d.ts +11 -21
- package/dist/api-handler.d.ts +4 -4
- package/dist/appearance-bootstrap.d.ts +16 -77
- package/dist/application-layers.d.ts +11 -20
- package/dist/asset-roots.d.ts +7 -27
- package/dist/assets.d.ts +7 -9
- package/dist/async-components.d.ts +56 -78
- package/dist/auth.d.ts +0 -3
- package/dist/browser-core-imports.d.ts +2 -2
- package/dist/build-externalize-repeated.d.ts +0 -25
- package/dist/build-externalize.d.ts +18 -53
- package/dist/build-id.d.ts +40 -28
- package/dist/build-message.d.ts +20 -44
- package/dist/builtins/attrs.d.ts +0 -14
- package/dist/builtins/drawer.d.ts +3 -22
- package/dist/builtins/icon.d.ts +17 -19
- package/dist/builtins/image-alpha.d.ts +8 -8
- package/dist/builtins/image-delivery.d.ts +38 -40
- package/dist/builtins/image-placeholder.d.ts +12 -50
- package/dist/builtins/image-warmup-worker.d.ts +1 -1
- package/dist/builtins/image-worker.d.ts +6 -32
- package/dist/builtins/index.d.ts +16 -6
- package/dist/builtins/modal.d.ts +13 -23
- package/dist/builtins/safe-image.d.ts +2 -42
- package/dist/builtins/stx-image.d.ts +44 -24
- package/dist/builtins/stx-link.d.ts +5 -8
- package/dist/builtins/stx-loading-indicator.d.ts +11 -10
- package/dist/builtins/suspense.d.ts +6 -27
- package/dist/builtins/toast.d.ts +15 -16
- package/dist/builtins/transition-group.d.ts +1 -25
- package/dist/caching.d.ts +24 -21
- package/dist/{chunk-a6jq7hex.js → chunk-06hx32h4.js} +3 -3
- package/dist/{chunk-cyg9w31a.js → chunk-0gt7e1ns.js} +1 -1
- package/dist/{chunk-15g5sc0p.js → chunk-0ppzstqj.js} +2 -2
- package/dist/{chunk-qcymqscj.js → chunk-0px2ab3m.js} +9 -9
- package/dist/chunk-0q5s55km.js +2 -0
- package/dist/{chunk-7t3ykgsm.js → chunk-1c8sdf9a.js} +3 -3
- package/dist/chunk-1m5pagp3.js +2 -0
- package/dist/{chunk-mzqyv7s5.js → chunk-1n9bxdnh.js} +3 -3
- package/dist/{chunk-58tz7tmf.js → chunk-1swmxkdt.js} +2 -2
- package/dist/{chunk-4easd8da.js → chunk-1x2x3xgc.js} +4 -4
- package/dist/chunk-27ja2rpd.js +2 -0
- package/dist/chunk-2b0p7am3.js +2 -0
- package/dist/{chunk-qj4j547f.js → chunk-30acme5g.js} +2 -2
- package/dist/{chunk-1n64749x.js → chunk-32pxa1r0.js} +1 -1
- package/dist/{chunk-g66m3g2r.js → chunk-37d52q0d.js} +1 -1
- package/dist/{chunk-sfwprq8q.js → chunk-3dr757vb.js} +9 -9
- package/dist/chunk-3k6q1481.js +2 -0
- package/dist/{chunk-2z0trbbm.js → chunk-3kc7af8c.js} +2 -2
- package/dist/chunk-3pr388w5.js +2 -0
- package/dist/chunk-42h0kvng.js +2 -0
- package/dist/chunk-4eff1v2p.js +2 -0
- package/dist/{chunk-gzgc8zk5.js → chunk-4k6cb5fg.js} +5 -5
- package/dist/{chunk-s12b57m9.js → chunk-4xvbc0mb.js} +2 -2
- package/dist/{chunk-83fdt4yj.js → chunk-501h1mer.js} +4 -4
- package/dist/{chunk-tv784gv0.js → chunk-550q827h.js} +2 -2
- package/dist/chunk-5n2v9g2c.js +2 -0
- package/dist/{chunk-q79kmad5.js → chunk-5xwmkxkk.js} +1 -1
- package/dist/chunk-68ygpbta.js +2 -0
- package/dist/{chunk-0bt0fbs1.js → chunk-69k5t6pj.js} +52 -52
- package/dist/{chunk-232jswfm.js → chunk-6c2y9h5h.js} +1 -1
- package/dist/chunk-6gjfres0.js +2 -0
- package/dist/chunk-6z57saf5.js +2 -0
- package/dist/chunk-71zwgxws.js +2 -0
- package/dist/{chunk-b9r88ysg.js → chunk-76437eb4.js} +2 -2
- package/dist/{chunk-beqkrwt1.js → chunk-7a0ewpz0.js} +2 -2
- package/dist/chunk-7debnvz9.js +2 -0
- package/dist/{chunk-jwvzvapp.js → chunk-7gxn7mvd.js} +2 -2
- package/dist/{chunk-vp31ff54.js → chunk-7hr63cp5.js} +2 -2
- package/dist/{chunk-5t1whxxt.js → chunk-825m59jr.js} +5 -5
- package/dist/{chunk-74xwzxwz.js → chunk-8efe5vpm.js} +2 -2
- package/dist/{chunk-jqefcghh.js → chunk-8hp6722y.js} +5 -5
- package/dist/{chunk-kgj852hx.js → chunk-9yht5n7g.js} +2 -2
- package/dist/{chunk-kzjrgh0b.js → chunk-a3w3jc0t.js} +6 -6
- package/dist/chunk-a77gbp9x.js +2 -0
- package/dist/chunk-ampr3fpv.js +2 -0
- package/dist/{chunk-2ads8rw5.js → chunk-b10n7cpe.js} +2 -2
- package/dist/{chunk-0q6n3by0.js → chunk-bb5a8adb.js} +3 -3
- package/dist/chunk-bgbz0wzq.js +2 -0
- package/dist/chunk-bgr7fqhs.js +2 -0
- package/dist/chunk-bjfrwcfh.js +2 -0
- package/dist/{chunk-9k7bq97t.js → chunk-byhsfnkc.js} +1 -1
- package/dist/{chunk-zyk12484.js → chunk-c0ewddb3.js} +2 -2
- package/dist/{chunk-b2q8bk8p.js → chunk-c6jyp7ss.js} +2 -2
- package/dist/chunk-cdt5pg28.js +2 -0
- package/dist/chunk-cfh798k7.js +2 -0
- package/dist/{chunk-pnag11c4.js → chunk-cp5903cg.js} +2 -2
- package/dist/{chunk-4bgfpkwx.js → chunk-crj0yqc6.js} +1 -1
- package/dist/chunk-dax3zkmm.js +2 -0
- package/dist/chunk-dn676tdp.js +2 -0
- package/dist/chunk-dtbj816p.js +2 -0
- package/dist/chunk-e23cg45k.js +2 -0
- package/dist/{chunk-qzbzn1yf.js → chunk-e27njk86.js} +12 -12
- package/dist/{chunk-vr36s2en.js → chunk-e40qpeg5.js} +2 -2
- package/dist/{chunk-q83w8edy.js → chunk-e7pjsrfc.js} +2 -2
- package/dist/chunk-ecwpsjpd.js +2 -0
- package/dist/{chunk-pqcvh9pp.js → chunk-f0mbj8w9.js} +1 -1
- package/dist/chunk-f1zyc84x.js +2 -0
- package/dist/{chunk-f4jh9vrj.js → chunk-g8dx2jew.js} +246 -243
- package/dist/{chunk-phzs239m.js → chunk-gdxhe7ae.js} +4 -4
- package/dist/{chunk-5dmkkvs7.js → chunk-gh0q6jrm.js} +2 -2
- package/dist/chunk-h8vk3q9n.js +2 -0
- package/dist/{chunk-k7ht6tqe.js → chunk-hq8vxds5.js} +2 -2
- package/dist/{chunk-zd01r00t.js → chunk-hqda3vcw.js} +1 -1
- package/dist/chunk-j8pamkbh.js +2 -0
- package/dist/{chunk-2jjff8kv.js → chunk-jwe7yq8m.js} +5 -5
- package/dist/chunk-k5rrp1bt.js +2 -0
- package/dist/{chunk-yk3wh2xv.js → chunk-kcq2ed1d.js} +2 -2
- package/dist/{chunk-9yar9rfq.js → chunk-ktc1ecsm.js} +1 -1
- package/dist/chunk-mfm7ezh6.js +2 -0
- package/dist/chunk-mp16jxcg.js +2 -0
- package/dist/chunk-myhh1zsm.js +2 -0
- package/dist/chunk-n1c9j5qv.js +2 -0
- package/dist/{chunk-dcpf6kas.js → chunk-n8hnrgen.js} +6 -6
- package/dist/{chunk-36agnyhe.js → chunk-nc0ba89b.js} +6 -6
- package/dist/chunk-nf63pk4s.js +2 -0
- package/dist/{chunk-1edvsndv.js → chunk-nxw03sy9.js} +2 -2
- package/dist/{chunk-jze68d0z.js → chunk-p3xkj7pm.js} +2 -2
- package/dist/chunk-p5cry5s7.js +2 -0
- package/dist/{chunk-0dz1b6a1.js → chunk-pxk0tpw2.js} +3 -3
- package/dist/chunk-qd4snptd.js +2 -0
- package/dist/{chunk-h4k3hyny.js → chunk-r5ce7mkg.js} +2 -2
- package/dist/chunk-r8qhex33.js +2 -0
- package/dist/chunk-rqvn1s52.js +2 -0
- package/dist/{chunk-79vdkvhf.js → chunk-sej3ng5k.js} +5 -5
- package/dist/chunk-sjsant53.js +2 -0
- package/dist/chunk-snzh9z3g.js +3 -0
- package/dist/{chunk-ymawe0y5.js → chunk-ss4h5ch3.js} +1 -1
- package/dist/{chunk-2crxkm7j.js → chunk-svvavwp2.js} +4 -4
- package/dist/{chunk-qt3x1sh3.js → chunk-t79xnvzr.js} +3 -3
- package/dist/{chunk-rrj5m9xv.js → chunk-ta50ym5j.js} +2 -2
- package/dist/chunk-ty8g61y9.js +2 -0
- package/dist/chunk-v1k6w4z5.js +2 -0
- package/dist/{chunk-rfnr4xz6.js → chunk-vde4mtfr.js} +2 -2
- package/dist/chunk-vm7zv0gc.js +2 -0
- package/dist/{chunk-xckzvbvn.js → chunk-vnh550b5.js} +1 -1
- package/dist/chunk-vnxc48en.js +2 -0
- package/dist/chunk-y7vbwhh7.js +2 -0
- package/dist/{chunk-ydx3mfpp.js → chunk-yf90vn5t.js} +6 -6
- package/dist/{chunk-6wc2t6cd.js → chunk-yhqhv8mp.js} +13 -13
- package/dist/{chunk-s34g3awk.js → chunk-ytf3qkaw.js} +3 -3
- package/dist/chunk-yvyypd92.js +2 -0
- package/dist/{chunk-c4zpzxex.js → chunk-z33z3rr4.js} +4 -4
- package/dist/chunk-zfw39q56.js +2 -0
- package/dist/chunk-zpm02e15.js +2 -0
- package/dist/chunk-zzr0p4bb.js +2 -0
- package/dist/cli.js +18 -18
- package/dist/client/directive.d.ts +0 -7
- package/dist/client/index.d.ts +1 -0
- package/dist/client/signals-appearance-runtime.d.ts +1 -1
- package/dist/client/signals-binding-utils-runtime.d.ts +1 -1
- package/dist/client/signals-bootstrap-runtime.d.ts +2 -2
- package/dist/client/signals-class-runtime.d.ts +1 -1
- package/dist/client/signals-component-api-runtime.d.ts +1 -1
- package/dist/client/signals-component-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-component-props-runtime.d.ts +1 -1
- package/dist/client/signals-conditional-chain-runtime.d.ts +1 -1
- package/dist/client/signals-conditional-component-runtime.d.ts +1 -1
- package/dist/client/signals-container-cleanup-runtime.d.ts +1 -1
- package/dist/client/signals-context-runtime.d.ts +1 -1
- package/dist/client/signals-cookie-runtime.d.ts +1 -1
- package/dist/client/signals-devtools-runtime.d.ts +1 -1
- package/dist/client/signals-dialog-runtime.d.ts +1 -1
- package/dist/client/signals-dom-ready-runtime.d.ts +1 -1
- package/dist/client/signals-drawer-runtime.d.ts +1 -1
- package/dist/client/signals-effect-runtime.d.ts +1 -1
- package/dist/client/signals-event-shorthand-runtime.d.ts +1 -1
- package/dist/client/signals-expression-compiler-runtime.d.ts +1 -1
- package/dist/client/signals-expression-runtime.d.ts +1 -1
- package/dist/client/signals-fetch-transport-runtime.d.ts +1 -1
- package/dist/client/signals-for-runtime.d.ts +1 -1
- package/dist/client/signals-globals-runtime.d.ts +1 -1
- package/dist/client/signals-handler-runtime.d.ts +1 -1
- package/dist/client/signals-head-runtime.d.ts +1 -1
- package/dist/client/signals-helpers-runtime.d.ts +1 -1
- package/dist/client/signals-host-runtime.d.ts +1 -1
- package/dist/client/signals-hydration-audit-runtime.d.ts +1 -1
- package/dist/client/signals-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-if-chain-runtime.d.ts +1 -1
- package/dist/client/signals-if-runtime.d.ts +1 -1
- package/dist/client/signals-lazy-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-lifecycle-runtime.d.ts +1 -1
- package/dist/client/signals-loop-component-remap-runtime.d.ts +1 -1
- package/dist/client/signals-loop-conditional-runtime.d.ts +1 -1
- package/dist/client/signals-loop-row-runtime.d.ts +1 -1
- package/dist/client/signals-manifest-hydration-runtime.d.ts +1 -1
- package/dist/client/signals-model-runtime.d.ts +1 -1
- package/dist/client/signals-mount-runtime.d.ts +1 -1
- package/dist/client/signals-navigation-runtime.d.ts +1 -1
- package/dist/client/signals-notify-runtime.d.ts +1 -1
- package/dist/client/signals-optimistic-runtime.d.ts +1 -1
- package/dist/client/signals-overlay-runtime.d.ts +1 -1
- package/dist/client/signals-pipe-runtime.d.ts +1 -1
- package/dist/client/signals-proxy-runtime.d.ts +1 -1
- package/dist/client/signals-query-runtime.d.ts +1 -1
- package/dist/client/signals-reactive-runtime.d.ts +1 -1
- package/dist/client/signals-ref-runtime.d.ts +1 -1
- package/dist/client/signals-scope-disposal-runtime.d.ts +1 -1
- package/dist/client/signals-scope-traversal-runtime.d.ts +1 -1
- package/dist/client/signals-show-runtime.d.ts +1 -1
- package/dist/client/signals-spa-load-control-runtime.d.ts +1 -1
- package/dist/client/signals-spa-load-runtime.d.ts +1 -1
- package/dist/client/signals-state-runtime.d.ts +1 -1
- package/dist/client/signals-storage-runtime.d.ts +1 -1
- package/dist/client/signals-store-registry-runtime.d.ts +1 -1
- package/dist/client/signals-style-runtime.d.ts +1 -1
- package/dist/client/signals-suspense-runtime.d.ts +1 -1
- package/dist/client/signals-timer-runtime.d.ts +1 -1
- package/dist/client/signals-toast-runtime.d.ts +1 -1
- package/dist/client/signals-tooltip-runtime.d.ts +1 -1
- package/dist/client/signals-transition-group-runtime.d.ts +1 -1
- package/dist/client/signals-websocket-runtime.d.ts +1 -1
- package/dist/client-helpers.d.ts +1 -312
- package/dist/client-module-registry.d.ts +4 -27
- package/dist/client-parameter-bindings.d.ts +4 -9
- package/dist/client-parameter-bindings.js +30 -10
- package/dist/client-script-bundler.d.ts +55 -103
- package/dist/client-script.d.ts +69 -127
- package/dist/client-script.js +4 -7
- package/dist/color-mode-boot.d.ts +21 -58
- package/dist/component-client-factories.d.ts +8 -9
- package/dist/component-contract-checks.d.ts +15 -18
- package/dist/component-contract.d.ts +6 -6
- package/dist/component-hmr.d.ts +8 -7
- package/dist/component-model.d.ts +14 -20
- package/dist/component-processing.d.ts +51 -59
- package/dist/component-registry.d.ts +28 -99
- package/dist/component-renderer.d.ts +19 -16
- package/dist/component-resolution.d.ts +8 -8
- package/dist/component-tags.d.ts +1 -1
- package/dist/composable-loader.d.ts +6 -41
- package/dist/composables/use-fetch.d.ts +45 -114
- package/dist/composables/use-form.d.ts +2 -56
- package/dist/composables/use-intersection-observer.d.ts +1 -1
- package/dist/composables.d.ts +75 -74
- package/dist/composition-api.d.ts +19 -43
- package/dist/computed.d.ts +93 -86
- package/dist/conditionals.d.ts +0 -24
- package/dist/config.d.ts +30 -24
- package/dist/config.js +3 -0
- package/dist/craft-bridge.d.ts +1 -467
- package/dist/craft-components.d.ts +234 -680
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/csp.d.ts +41 -107
- package/dist/database.d.ts +1 -1
- package/dist/defer.d.ts +0 -24
- package/dist/dev-server/terminal-colors.d.ts +32 -32
- package/dist/dev-server/ts-css.d.ts +26 -35
- package/dist/dev-server/types.d.ts +33 -29
- package/dist/directive-api.d.ts +42 -85
- package/dist/directive-arguments.d.ts +14 -39
- package/dist/document-shell.d.ts +49 -81
- package/dist/dynamic-components.d.ts +0 -9
- package/dist/engine-bindings.d.ts +1 -1
- package/dist/env.d.ts +26 -0
- package/dist/error-boundaries.d.ts +36 -43
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +43 -51
- package/dist/errors/formatter.d.ts +38 -58
- package/dist/errors/index.d.ts +61 -5
- package/dist/errors/logger.d.ts +40 -114
- package/dist/errors/sanitizer.d.ts +28 -53
- package/dist/errors/types.d.ts +31 -44
- package/dist/events.d.ts +32 -94
- package/dist/expressions.d.ts +57 -62
- package/dist/find-body-tag.d.ts +5 -34
- package/dist/first-script-tag.d.ts +0 -23
- package/dist/forms-validation.d.ts +117 -149
- package/dist/forms.d.ts +161 -120
- package/dist/framework-composables.d.ts +0 -32
- package/dist/head-injection.d.ts +30 -32
- package/dist/head-keys.d.ts +12 -15
- package/dist/head.d.ts +110 -139
- package/dist/heatmap.d.ts +76 -152
- package/dist/html-masking.d.ts +38 -62
- package/dist/hydration-runtime.d.ts +24 -20
- package/dist/hydration.d.ts +11 -10
- package/dist/i18n.d.ts +34 -95
- package/dist/image-optimization/auto-sibling.d.ts +4 -32
- package/dist/imported-signals.d.ts +0 -36
- package/dist/includes.d.ts +6 -69
- package/dist/index.d.ts +2 -1
- package/dist/init.d.ts +12 -20
- package/dist/internal-markdown.d.ts +8 -12
- package/dist/interpolation-context.d.ts +15 -15
- package/dist/island-chunking.d.ts +13 -30
- package/dist/keep-alive.d.ts +52 -72
- package/dist/layout-types.d.ts +2 -27
- package/dist/lazy-module.d.ts +0 -10
- package/dist/loading-indicator.d.ts +8 -5
- package/dist/loop-binding.d.ts +4 -7
- package/dist/loops.d.ts +25 -67
- package/dist/markdown.d.ts +1 -0
- package/dist/media/image/component.d.ts +9 -25
- package/dist/media/image/directive.d.ts +1 -15
- package/dist/media/image/placeholder.d.ts +9 -20
- package/dist/media/image/processor/cache.d.ts +18 -40
- package/dist/media/image/processor/index.d.ts +10 -1
- package/dist/media/image/processor/optimizer.d.ts +1 -12
- package/dist/media/image/processor/responsive.d.ts +6 -16
- package/dist/media/image/srcset.d.ts +49 -47
- package/dist/media/shared/cache.d.ts +31 -51
- package/dist/media/shared/hash.d.ts +0 -7
- package/dist/media/types.d.ts +754 -1235
- package/dist/media/video/directive.d.ts +1 -15
- package/dist/media/video/index.d.ts +17 -39
- package/dist/media/video/processor/cache.d.ts +19 -42
- package/dist/media/video/processor/index.d.ts +18 -1
- package/dist/media/video/processor/streaming.d.ts +10 -17
- package/dist/media/video/processor/thumbnail.d.ts +15 -21
- package/dist/media/video/processor/transcoder.d.ts +1 -11
- package/dist/meta-arguments.d.ts +14 -39
- package/dist/method-spoofing.d.ts +0 -7
- package/dist/middleware.d.ts +0 -60
- package/dist/native/bridge/protocol.d.ts +2 -1
- package/dist/native/compiler/headwind-to-style.d.ts +383 -359
- package/dist/native/compiler/icons.d.ts +249 -243
- package/dist/native/compiler/svg.d.ts +35 -24
- package/dist/native/runtime/jsc-globals.d.ts +1 -1
- package/dist/native/runtime/native-host.d.ts +1 -1
- package/dist/native/runtime/native-host.js +3 -0
- package/dist/offline/app-service-worker.d.ts +50 -114
- package/dist/offline/kept-store.d.ts +23 -37
- package/dist/offline/query-cache.d.ts +55 -126
- package/dist/owned-routes.d.ts +0 -31
- package/dist/page-response.d.ts +8 -39
- package/dist/parser/directive-parser.d.ts +45 -57
- package/dist/parser/expression-parser.d.ts +35 -33
- package/dist/parser/index.d.ts +39 -4
- package/dist/parser/tokenizer.d.ts +49 -61
- package/dist/partial-hydration.d.ts +51 -82
- package/dist/performance-utils.d.ts +115 -255
- package/dist/placeholder.d.ts +9 -18
- package/dist/plugin-system.d.ts +115 -264
- package/dist/process.d.ts +4 -9
- package/dist/process.js +6 -4
- package/dist/prop-sentinels.d.ts +11 -11
- package/dist/public-env.d.ts +0 -14
- package/dist/pwa/directives.d.ts +20 -12
- package/dist/pwa/inject.d.ts +0 -10
- package/dist/pwa/precache.d.ts +16 -22
- package/dist/pwa/service-worker.d.ts +0 -12
- package/dist/pwa.js +3 -3
- package/dist/reactive-bindings.d.ts +11 -34
- package/dist/reactive-tracking.d.ts +0 -36
- package/dist/reactive.d.ts +41 -58
- package/dist/render-memo.d.ts +5 -23
- package/dist/resolve-stx-targets.d.ts +6 -44
- package/dist/route-middleware.d.ts +35 -2
- package/dist/route-rules.d.ts +10 -13
- package/dist/router.d.ts +9 -8
- package/dist/routes.d.ts +3 -1
- package/dist/runtime-config-server.d.ts +14 -17
- package/dist/runtime-config.d.ts +2 -3
- package/dist/runtime-globals.d.ts +90 -122
- package/dist/runtime-injection.d.ts +0 -8
- package/dist/scaffolding.d.ts +30 -26
- package/dist/script-emit.d.ts +0 -30
- package/dist/script-validation.d.ts +6 -12
- package/dist/seo.d.ts +75 -153
- package/dist/server-api.d.ts +9 -12
- package/dist/server-bindings.d.ts +1 -26
- package/dist/server-data.d.ts +4 -5
- package/dist/sfc-template.d.ts +8 -8
- package/dist/signal-processing.d.ts +37 -53
- package/dist/signals-api.d.ts +58 -135
- package/dist/signals.d.ts +18 -24
- package/dist/site-url.d.ts +31 -28
- package/dist/slots.d.ts +20 -86
- package/dist/source-signature.d.ts +5 -28
- package/dist/ssg.d.ts +158 -337
- package/dist/ssg.js +4 -4
- package/dist/state-dir.d.ts +4 -4
- package/dist/store-loader.d.ts +0 -10
- package/dist/story/analytics.d.ts +60 -138
- package/dist/story/bookmarks.d.ts +34 -87
- package/dist/story/cli.d.ts +69 -123
- package/dist/story/collect/scanner.d.ts +0 -4
- package/dist/story/collect/tree.d.ts +1 -8
- package/dist/story/commands/build.d.ts +6 -11
- package/dist/story/commands/dev.d.ts +8 -15
- package/dist/story/commands/preview.d.ts +7 -13
- package/dist/story/config-watcher.d.ts +13 -20
- package/dist/story/config.d.ts +8 -11
- package/dist/story/context.d.ts +8 -14
- package/dist/story/hmr.d.ts +26 -24
- package/dist/story/hot-swap.d.ts +23 -34
- package/dist/story/keyboard-shortcuts.d.ts +18 -23
- package/dist/story/output.d.ts +44 -46
- package/dist/story/performance.d.ts +45 -107
- package/dist/story/presets.d.ts +41 -107
- package/dist/story/renderer.d.ts +27 -41
- package/dist/story/search.d.ts +12 -23
- package/dist/story/server.d.ts +11 -21
- package/dist/story/setup.d.ts +15 -23
- package/dist/story/testing.d.ts +40 -65
- package/dist/story/types.d.ts +160 -262
- package/dist/streaming.d.ts +57 -119
- package/dist/strip-literals.d.ts +1 -25
- package/dist/stx-module-imports.d.ts +7 -0
- package/dist/stx-virtual-ts.d.ts +102 -253
- package/dist/stx-virtual-ts.js +5 -4
- package/dist/style-scoping.d.ts +8 -21
- package/dist/suspense.d.ts +52 -67
- package/dist/teleport.d.ts +0 -22
- package/dist/template-syntax-escape.d.ts +8 -8
- package/dist/template-tag-balance.d.ts +6 -22
- package/dist/testing.d.ts +26 -11
- package/dist/theme-tokens.d.ts +388 -134
- package/dist/transitions.d.ts +55 -66
- package/dist/ts-css-config.d.ts +12 -70
- package/dist/types/component-types.d.ts +122 -187
- package/dist/types/config-types.d.ts +341 -956
- package/dist/types/context-types.d.ts +24 -46
- package/dist/types/csp-types.d.ts +66 -70
- package/dist/types/directive-types.d.ts +156 -223
- package/dist/types/index.d.ts +110 -6
- package/dist/types/pwa-types.d.ts +148 -273
- package/dist/types.d.ts +1 -0
- package/dist/unresolved-identifiers.d.ts +22 -24
- package/dist/url-safety.d.ts +32 -32
- package/dist/utils.d.ts +21 -36
- package/dist/utils.js +6 -2
- package/dist/validator.d.ts +26 -28
- package/dist/variable-extractor.d.ts +19 -49
- package/dist/view-composers.d.ts +81 -80
- package/dist/virtual-scrolling.d.ts +82 -101
- package/dist/visual-testing.d.ts +10 -9
- package/dist/vue-template.d.ts +0 -23
- package/dist/web-components/css-scoping.d.ts +11 -21
- package/dist/web-components.d.ts +58 -81
- package/dist/x-element.d.ts +1 -0
- package/package.json +6 -6
- package/stx.d.ts +2 -2
- package/dist/app-service-worker.d.ts +0 -165
- package/dist/chunk-01mxer9s.js +0 -2
- package/dist/chunk-09gtbb1w.js +0 -2
- package/dist/chunk-0g2ybnht.js +0 -3
- package/dist/chunk-15erabm6.js +0 -2
- package/dist/chunk-1z6c6dyk.js +0 -2
- package/dist/chunk-1zfg1kd5.js +0 -2
- package/dist/chunk-279jv0yf.js +0 -2
- package/dist/chunk-2a1q5y6r.js +0 -2
- package/dist/chunk-2cqbyb8w.js +0 -2
- package/dist/chunk-2jsnrfc8.js +0 -2
- package/dist/chunk-3gft8zng.js +0 -2
- package/dist/chunk-49gwmcrn.js +0 -2
- package/dist/chunk-4wfr074d.js +0 -2
- package/dist/chunk-5afw7z6v.js +0 -2
- package/dist/chunk-5fv4g4et.js +0 -2
- package/dist/chunk-604rs9sq.js +0 -2
- package/dist/chunk-636sfxyj.js +0 -2
- package/dist/chunk-6f4qrd0s.js +0 -2
- package/dist/chunk-6va5pe2m.js +0 -2
- package/dist/chunk-8k61b4ae.js +0 -2
- package/dist/chunk-asbq9cgs.js +0 -2
- package/dist/chunk-b7t8jejd.js +0 -2
- package/dist/chunk-b894fxfc.js +0 -2
- package/dist/chunk-bm2q1srp.js +0 -2
- package/dist/chunk-cgwyd9aq.js +0 -2
- package/dist/chunk-cvswrbzw.js +0 -2
- package/dist/chunk-d8206zbp.js +0 -2
- package/dist/chunk-f10299sf.js +0 -2
- package/dist/chunk-f1apaqfk.js +0 -2
- package/dist/chunk-g6zeqvvb.js +0 -2
- package/dist/chunk-ghy82tsc.js +0 -2
- package/dist/chunk-jw33eys8.js +0 -2
- package/dist/chunk-k6wgh598.js +0 -2
- package/dist/chunk-m2a1fxpb.js +0 -2
- package/dist/chunk-m6mxqepz.js +0 -2
- package/dist/chunk-n6qp05t9.js +0 -2
- package/dist/chunk-nn174xjh.js +0 -2
- package/dist/chunk-ntgy4e1q.js +0 -2
- package/dist/chunk-nw4axkpx.js +0 -2
- package/dist/chunk-p5chk3s9.js +0 -2
- package/dist/chunk-pw9verqx.js +0 -2
- package/dist/chunk-ta8bhz27.js +0 -2
- package/dist/chunk-tc5r2vmw.js +0 -2
- package/dist/chunk-ts80ktq7.js +0 -2
- package/dist/chunk-vyg8bvkt.js +0 -2
- package/dist/chunk-xq2ck69k.js +0 -2
- package/dist/chunk-y4ajd836.js +0 -2
- package/dist/chunk-zddzjd60.js +0 -2
- package/dist/chunk-zgxj1q7w.js +0 -2
- package/dist/chunk-zs7qhh40.js +0 -2
- package/dist/signals-context-runtime.d.ts +0 -2
- package/dist/signals-drawer-runtime.d.ts +0 -2
- package/dist/signals-host-runtime.d.ts +0 -9
- package/dist/signals-loop-conditional-runtime.d.ts +0 -2
- package/dist/signals-manifest-hydration-runtime.d.ts +0 -2
- package/dist/signals-notify-runtime.d.ts +0 -2
- package/dist/signals-optimistic-runtime.d.ts +0 -2
- package/dist/signals-overlay-runtime.d.ts +0 -2
- package/dist/signals-scope-disposal-runtime.d.ts +0 -2
- package/dist/signals-spa-load-control-runtime.d.ts +0 -2
- package/dist/signals-storage-runtime.d.ts +0 -2
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A cheap fingerprint of a set of source files, so a memoised bundle cannot
|
|
3
|
-
* outlive its sources.
|
|
4
|
-
*
|
|
5
|
-
* The store and composable loaders memoised their built bundle per directory
|
|
6
|
-
* and nothing ever invalidated it. `clearStoreCache()` and
|
|
7
|
-
* `clearComposableCache()` existed and were exported, but the only callers in
|
|
8
|
-
* the entire workspace were tests — so in dev, no edit to a store reached the
|
|
9
|
-
* browser without restarting the server, including creating the first one
|
|
10
|
-
* (stacksjs/stx#1877).
|
|
11
|
-
*
|
|
12
|
-
* A watcher alone is not enough: it fixes the common case but a missed event
|
|
13
|
-
* still leaves a stale bundle serving indefinitely, with no symptom other than
|
|
14
|
-
* an edit that seems not to have happened. Keying the memo on the sources means
|
|
15
|
-
* the worst a missed event costs is one stale request, not the rest of the
|
|
16
|
-
* session.
|
|
17
|
-
*
|
|
18
|
-
* Statting a handful of files is nothing next to the `Bun.build` it guards,
|
|
19
|
-
* but on every render of a page it is not nothing, so in production a
|
|
20
|
-
* signature is reused for a second (see `sourceSignature`).
|
|
21
|
-
*
|
|
22
|
-
* @module source-signature
|
|
23
|
-
*/
|
|
24
1
|
/**
|
|
25
2
|
* Fingerprint `files` by path, size and mtime.
|
|
26
3
|
*
|
|
@@ -34,11 +11,6 @@
|
|
|
34
11
|
export declare function sourceSignature(files: readonly string[]): string;
|
|
35
12
|
/** Forget recent signatures, so the next call stats again. */
|
|
36
13
|
export declare function clearSourceSignatures(): void;
|
|
37
|
-
/** A memo entry that knows which sources it was built from. */
|
|
38
|
-
export interface SignedCacheEntry<T> {
|
|
39
|
-
signature: string;
|
|
40
|
-
value: T;
|
|
41
|
-
}
|
|
42
14
|
/**
|
|
43
15
|
* Read a memo entry, returning `undefined` when the sources have changed since
|
|
44
16
|
* it was written.
|
|
@@ -46,3 +18,8 @@ export interface SignedCacheEntry<T> {
|
|
|
46
18
|
export declare function readSigned<T>(cache: Map<string, SignedCacheEntry<T>>, key: string, signature: string): T | undefined;
|
|
47
19
|
/** Write a memo entry stamped with the signature of its sources. */
|
|
48
20
|
export declare function writeSigned<T>(cache: Map<string, SignedCacheEntry<T>>, key: string, signature: string, value: T): T;
|
|
21
|
+
/** A memo entry that knows which sources it was built from. */
|
|
22
|
+
export declare interface SignedCacheEntry<T> {
|
|
23
|
+
signature: string
|
|
24
|
+
value: T
|
|
25
|
+
}
|
package/dist/ssg.d.ts
CHANGED
|
@@ -1,329 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* Static Site Generation (SSG) with Incremental Static Regeneration (ISR)
|
|
3
|
-
*
|
|
4
|
-
* Pre-renders pages at build time for optimal performance and SEO.
|
|
5
|
-
* Supports on-demand revalidation for dynamic content.
|
|
6
|
-
*
|
|
7
|
-
* ## Features
|
|
8
|
-
*
|
|
9
|
-
* - Build-time page generation from file-based routes
|
|
10
|
-
* - Dynamic route handling with getStaticPaths()
|
|
11
|
-
* - Incremental Static Regeneration (ISR)
|
|
12
|
-
* - Automatic sitemap generation
|
|
13
|
-
* - RSS feed generation
|
|
14
|
-
* - Content source integrations (Markdown, CMS, API)
|
|
15
|
-
* - Parallel page generation
|
|
16
|
-
* - Build caching for faster rebuilds
|
|
17
|
-
*
|
|
18
|
-
* ## Usage
|
|
19
|
-
*
|
|
20
|
-
* ```typescript
|
|
21
|
-
* import { generateStaticSite, defineStaticPaths } from 'stx/ssg'
|
|
22
|
-
*
|
|
23
|
-
* // Generate entire site
|
|
24
|
-
* await generateStaticSite({
|
|
25
|
-
* pagesDir: 'pages',
|
|
26
|
-
* outputDir: 'dist',
|
|
27
|
-
* revalidate: 3600, // ISR: revalidate every hour
|
|
28
|
-
* })
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* For dynamic routes, export getStaticPaths in your template:
|
|
32
|
-
* ```html
|
|
33
|
-
* <script server>
|
|
34
|
-
* export async function getStaticPaths() {
|
|
35
|
-
* const posts = await fetchPosts()
|
|
36
|
-
* return posts.map(post => ({
|
|
37
|
-
* params: { slug: post.slug },
|
|
38
|
-
* props: { post }
|
|
39
|
-
* }))
|
|
40
|
-
* }
|
|
41
|
-
* </script>
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* @module ssg
|
|
45
|
-
*/
|
|
1
|
+
/// <reference path="./stx.d.ts" />
|
|
46
2
|
import type { StxOptions } from './types';
|
|
47
|
-
export interface SSGConfig {
|
|
48
|
-
/**
|
|
49
|
-
* Client-side router options, forwarded verbatim to the injected router.
|
|
50
|
-
*
|
|
51
|
-
* Read here as `options.router` when the page is generated. Previously typed
|
|
52
|
-
* only as an `any` cast at the call site, which let `buildApp` omit it
|
|
53
|
-
* without the compiler noticing — so a project that configured `container`
|
|
54
|
-
* or `prefetch` got the client's built-in defaults instead.
|
|
55
|
-
*/
|
|
56
|
-
router?: StxOptions['router'];
|
|
57
|
-
/** Directory containing pages (default: 'pages') */
|
|
58
|
-
pagesDir?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Directory `@include` resolves against. Defaults to the config's
|
|
61
|
-
* `partialsDir`.
|
|
62
|
-
*
|
|
63
|
-
* `pagesDir`, `publicDir` and `outputDir` were all overridable here and these
|
|
64
|
-
* two were not, so a caller could point the build at one directory layout and
|
|
65
|
-
* silently get another for its partials (stacksjs/stx#1921).
|
|
66
|
-
*/
|
|
67
|
-
partialsDir?: string;
|
|
68
|
-
/** Directory components resolve against. Defaults to the config's `componentsDir`. */
|
|
69
|
-
componentsDir?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Fail the build when an `@include` cannot be resolved (default: true).
|
|
72
|
-
*
|
|
73
|
-
* A failed include renders the error into the page and, before this, left the
|
|
74
|
-
* build reporting `Failed: 0` with exit 0 — so the only way to find it was to
|
|
75
|
-
* read the emitted HTML, which is exactly what nobody does when the build says
|
|
76
|
-
* success. An unresolvable include is not a recoverable condition in a build:
|
|
77
|
-
* it produces a file you would never knowingly deploy.
|
|
78
|
-
*
|
|
79
|
-
* Set `false` for the old behaviour.
|
|
80
|
-
*/
|
|
81
|
-
failOnIncludeError?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Fail the build when a `<script server>` fails (default: true).
|
|
84
|
-
*
|
|
85
|
-
* The same condition as `failOnIncludeError`, for the other half of the page.
|
|
86
|
-
* A failed server script leaves every variable it declared undefined, so the
|
|
87
|
-
* page is written with its content missing -- empty headings, `{{ name }}` as
|
|
88
|
-
* literal text, or an error banner where a component should be -- while the
|
|
89
|
-
* build reports `Failed: 0` and exits 0.
|
|
90
|
-
*
|
|
91
|
-
* That is not a theoretical ordering: an app shipped 13 of 46 pages as
|
|
92
|
-
* nothing but a banner printing an absolute build-machine path to visitors,
|
|
93
|
-
* and what caught it was an unrelated responsive check noticing the banner
|
|
94
|
-
* overflowed a 390px viewport (stacksjs/stx#2035).
|
|
95
|
-
*
|
|
96
|
-
* Only the failures that are certainly bugs count -- a module that does not
|
|
97
|
-
* resolve, a script that does not parse, a binding that does not exist. A
|
|
98
|
-
* script reaching for `window` is not one of them.
|
|
99
|
-
*
|
|
100
|
-
* Set `false` for the old behaviour.
|
|
101
|
-
*/
|
|
102
|
-
failOnServerScriptError?: boolean;
|
|
103
|
-
/** Output directory for generated files (default: 'dist') */
|
|
104
|
-
outputDir?: string;
|
|
105
|
-
/** Base URL for the site (default: '/') */
|
|
106
|
-
baseUrl?: string;
|
|
107
|
-
/** Site domain for absolute URLs */
|
|
108
|
-
domain?: string;
|
|
109
|
-
/** Enable ISR with revalidation time in seconds */
|
|
110
|
-
revalidate?: number | false;
|
|
111
|
-
/** Generate sitemap.xml */
|
|
112
|
-
sitemap?: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Routes to keep out of sitemap.xml (#1866).
|
|
115
|
-
*
|
|
116
|
-
* Strings match a URL exactly or as a `/prefix/` when they end in `/`;
|
|
117
|
-
* RegExps are tested against the URL. A page can also exclude itself with
|
|
118
|
-
* `definePageMeta({ sitemap: false })` or by declaring a `noindex` robots
|
|
119
|
-
* meta, which is checked without needing this list.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* ```ts
|
|
123
|
-
* sitemapExclude: ['/login', '/account/', /^\/admin/]
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
sitemapExclude?: (string | RegExp)[];
|
|
127
|
-
/**
|
|
128
|
-
* Generate robots.txt (default: true).
|
|
129
|
-
*
|
|
130
|
-
* Written from the same resolved site URL as the sitemap, with a `Sitemap:`
|
|
131
|
-
* line pointing at it, and a `Disallow` for every `sitemapExclude` entry —
|
|
132
|
-
* so the two files cannot disagree about what is public.
|
|
133
|
-
*/
|
|
134
|
-
robots?: boolean | RobotsConfig;
|
|
135
|
-
/** Generate RSS feed */
|
|
136
|
-
rss?: boolean | RSSConfig;
|
|
137
|
-
/** Parallel page generation limit (default: 10) */
|
|
138
|
-
concurrency?: number;
|
|
139
|
-
/** Enable build caching (default: true) */
|
|
140
|
-
cache?: boolean;
|
|
141
|
-
/** Cache directory (default: `ssg-cache` inside the state directory) */
|
|
142
|
-
cacheDir?: string;
|
|
143
|
-
/** Custom content loaders */
|
|
144
|
-
contentLoaders?: ContentLoader[];
|
|
145
|
-
/** Pre-render hooks */
|
|
146
|
-
hooks?: SSGHooks;
|
|
147
|
-
/** Minify HTML output (default: true) */
|
|
148
|
-
minify?: boolean;
|
|
149
|
-
/** Generate 404 page */
|
|
150
|
-
generate404?: boolean;
|
|
151
|
-
/** Additional files to copy to output */
|
|
152
|
-
publicDir?: string;
|
|
153
|
-
/** Trailing slash behavior */
|
|
154
|
-
trailingSlash?: boolean;
|
|
155
|
-
/** Clean output directory before build */
|
|
156
|
-
cleanOutput?: boolean;
|
|
157
|
-
/**
|
|
158
|
-
* Extra input folded into every page's cache key.
|
|
159
|
-
*
|
|
160
|
-
* A page's key is its own file plus the dependencies collected while
|
|
161
|
-
* rendering it, which covers templates, components and layouts and nothing
|
|
162
|
-
* else. Anything build-wide — the Css config, an env var the pages read
|
|
163
|
-
* — is invisible to it, and a build that reports every route `Cached` and
|
|
164
|
-
* exits 0 gives no signal that it used the old value (#1940).
|
|
165
|
-
*
|
|
166
|
-
* Defaults to a digest of the resolved Css config. Set it to add your
|
|
167
|
-
* own build inputs; set it to a constant to opt out of that default.
|
|
168
|
-
*/
|
|
169
|
-
cacheSalt?: string;
|
|
170
|
-
/**
|
|
171
|
-
* Per-island chunking (#1746): lift each `client="<trigger>"` island's inline
|
|
172
|
-
* setup script into a content-hashed chunk under `_stx/islands/` that the
|
|
173
|
-
* runtime fetches only on the hydration trigger. Default `false` (opt-in) —
|
|
174
|
-
* when off, builds are byte-identical and islands stay inline.
|
|
175
|
-
*/
|
|
176
|
-
chunkIslands?: boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Emit `<link rel="prefetch" as="script">` hints for `visible`/`idle` island
|
|
179
|
-
* chunks so they warm in cache before the trigger fires (instant hydration,
|
|
180
|
-
* still no inline JS). `interaction`/`media:` islands are skipped. Requires
|
|
181
|
-
* `chunkIslands`. Default `false` — trades some idle bandwidth for latency.
|
|
182
|
-
*/
|
|
183
|
-
prefetchIslands?: boolean;
|
|
184
|
-
/**
|
|
185
|
-
* Stamp Subresource Integrity (`sha384`) on island chunks so the runtime pins
|
|
186
|
-
* them against tampering and a strict CSP can require SRI. Requires
|
|
187
|
-
* `chunkIslands`. Default `false` — only enable when chunks are served
|
|
188
|
-
* byte-for-byte unchanged (no CDN/proxy transform).
|
|
189
|
-
*/
|
|
190
|
-
integrityIslands?: boolean;
|
|
191
|
-
}
|
|
192
|
-
/** robots.txt options for the static build (#1866). */
|
|
193
|
-
export interface RobotsConfig {
|
|
194
|
-
/** Extra paths to disallow, on top of `sitemapExclude`. */
|
|
195
|
-
disallow?: string[];
|
|
196
|
-
/** Paths to explicitly allow. Defaults to `['/']`. */
|
|
197
|
-
allow?: string[];
|
|
198
|
-
/** User agent the rules apply to. Defaults to `*`. */
|
|
199
|
-
userAgent?: string;
|
|
200
|
-
/** Emit the `Sitemap:` line (default: true when a sitemap is generated). */
|
|
201
|
-
sitemap?: boolean;
|
|
202
|
-
}
|
|
203
|
-
export interface RSSConfig {
|
|
204
|
-
title: string;
|
|
205
|
-
description: string;
|
|
206
|
-
link: string;
|
|
207
|
-
language?: string;
|
|
208
|
-
copyright?: string;
|
|
209
|
-
/** Function to get items for RSS feed */
|
|
210
|
-
getItems?: () => Promise<RSSItem[]>;
|
|
211
|
-
}
|
|
212
|
-
export interface RSSItem {
|
|
213
|
-
title: string;
|
|
214
|
-
link: string;
|
|
215
|
-
description?: string;
|
|
216
|
-
pubDate?: Date;
|
|
217
|
-
author?: string;
|
|
218
|
-
categories?: string[];
|
|
219
|
-
guid?: string;
|
|
220
|
-
}
|
|
221
|
-
export interface StaticPath {
|
|
222
|
-
/** Route parameters */
|
|
223
|
-
params: Record<string, string>;
|
|
224
|
-
/** Props to pass to the page */
|
|
225
|
-
props?: Record<string, unknown>;
|
|
226
|
-
/** Page-specific revalidation time (overrides global) */
|
|
227
|
-
revalidate?: number | false;
|
|
228
|
-
}
|
|
229
|
-
export interface StaticPathsResult {
|
|
230
|
-
paths: StaticPath[];
|
|
231
|
-
/** Fallback behavior for paths not returned */
|
|
232
|
-
fallback?: 'blocking' | 'static' | false;
|
|
233
|
-
}
|
|
234
|
-
export interface ContentLoader {
|
|
235
|
-
/** Name of the loader */
|
|
236
|
-
name: string;
|
|
237
|
-
/** File extensions this loader handles */
|
|
238
|
-
extensions: string[];
|
|
239
|
-
/** Load content from file */
|
|
240
|
-
load: (filePath: string) => Promise<ContentResult>;
|
|
241
|
-
}
|
|
242
|
-
export interface ContentResult {
|
|
243
|
-
/** Rendered HTML content */
|
|
244
|
-
content: string;
|
|
245
|
-
/** Frontmatter/metadata */
|
|
246
|
-
data: Record<string, unknown>;
|
|
247
|
-
/** Table of contents (for markdown) */
|
|
248
|
-
toc?: TocItem[];
|
|
249
|
-
}
|
|
250
|
-
export interface TocItem {
|
|
251
|
-
id: string;
|
|
252
|
-
text: string;
|
|
253
|
-
level: number;
|
|
254
|
-
children?: TocItem[];
|
|
255
|
-
}
|
|
256
|
-
export interface SSGHooks {
|
|
257
|
-
/** Called before build starts */
|
|
258
|
-
onBuildStart?: () => void | Promise<void>;
|
|
259
|
-
/** Called after build completes */
|
|
260
|
-
onBuildEnd?: (result: SSGResult) => void | Promise<void>;
|
|
261
|
-
/** Called before each page is rendered */
|
|
262
|
-
onPageStart?: (route: string) => void | Promise<void>;
|
|
263
|
-
/** Called after each page is rendered */
|
|
264
|
-
onPageEnd?: (route: string, html: string) => void | Promise<void>;
|
|
265
|
-
/** Called on build error */
|
|
266
|
-
onError?: (error: Error, route?: string) => void | Promise<void>;
|
|
267
|
-
}
|
|
268
|
-
export interface SSGResult {
|
|
269
|
-
/** Total pages generated */
|
|
270
|
-
totalPages: number;
|
|
271
|
-
/** Successfully generated pages */
|
|
272
|
-
successCount: number;
|
|
273
|
-
/** Failed pages */
|
|
274
|
-
failedCount: number;
|
|
275
|
-
/** Pages that were cached */
|
|
276
|
-
cachedCount: number;
|
|
277
|
-
/** Build time in milliseconds */
|
|
278
|
-
buildTime: number;
|
|
279
|
-
/** Generated sitemap path */
|
|
280
|
-
sitemapPath?: string;
|
|
281
|
-
/** Generated RSS path */
|
|
282
|
-
rssPath?: string;
|
|
283
|
-
/** Individual page results */
|
|
284
|
-
pages: PageResult[];
|
|
285
|
-
/** Errors encountered */
|
|
286
|
-
errors: PageError[];
|
|
287
|
-
/**
|
|
288
|
-
* Per-island chunking stats (#1746), present only when `chunkIslands` emitted
|
|
289
|
-
* any chunks: `count` unique (content-addressed) chunk files and `totalBytes`
|
|
290
|
-
* of island JS moved out of inline HTML into lazily-fetched chunks.
|
|
291
|
-
*/
|
|
292
|
-
islandChunks?: {
|
|
293
|
-
count: number;
|
|
294
|
-
totalBytes: number;
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
export interface PageResult {
|
|
298
|
-
route: string;
|
|
299
|
-
outputPath: string;
|
|
300
|
-
size: number;
|
|
301
|
-
cached: boolean;
|
|
302
|
-
revalidateAt?: number;
|
|
303
|
-
}
|
|
304
|
-
export interface PageError {
|
|
305
|
-
route: string;
|
|
306
|
-
error: Error;
|
|
307
|
-
}
|
|
308
|
-
export interface ISRCache {
|
|
309
|
-
/** Get cached page */
|
|
310
|
-
get: (route: string) => Promise<CachedPage | null>;
|
|
311
|
-
/** Set cached page */
|
|
312
|
-
set: (route: string, page: CachedPage) => Promise<void>;
|
|
313
|
-
/** Invalidate cached page */
|
|
314
|
-
invalidate: (route: string) => Promise<void>;
|
|
315
|
-
/** Invalidate all pages matching pattern */
|
|
316
|
-
invalidatePattern: (pattern: RegExp) => Promise<void>;
|
|
317
|
-
/** Check if page needs revalidation */
|
|
318
|
-
needsRevalidation: (route: string) => Promise<boolean>;
|
|
319
|
-
}
|
|
320
|
-
export interface CachedPage {
|
|
321
|
-
html: string;
|
|
322
|
-
generatedAt: number;
|
|
323
|
-
revalidateAfter: number;
|
|
324
|
-
etag: string;
|
|
325
|
-
headers?: Record<string, string>;
|
|
326
|
-
}
|
|
327
3
|
/**
|
|
328
4
|
* Whether a page declares an `action` — the export that receives its own POST.
|
|
329
5
|
*
|
|
@@ -354,12 +30,9 @@ export declare function generateStaticSite(options?: SSGConfig): Promise<SSGResu
|
|
|
354
30
|
* Create ISR handler for runtime revalidation
|
|
355
31
|
*/
|
|
356
32
|
export declare function createISRHandler(options?: SSGConfig): {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
} | null>;
|
|
361
|
-
revalidate: (route: string) => Promise<void>;
|
|
362
|
-
invalidate: (route: string | RegExp) => Promise<void>;
|
|
33
|
+
get: (route: string) => Promise<{ html: string; headers: Record<string, string> } | null>
|
|
34
|
+
revalidate: (route: string) => Promise<void>
|
|
35
|
+
invalidate: (route: string | RegExp) => Promise<void>
|
|
363
36
|
};
|
|
364
37
|
/**
|
|
365
38
|
* Define static paths for dynamic routes (used in templates)
|
|
@@ -369,10 +42,158 @@ export declare function defineStaticPaths(pathsFn: () => Promise<StaticPath[]> |
|
|
|
369
42
|
* Create a markdown content loader
|
|
370
43
|
*/
|
|
371
44
|
export declare function createMarkdownLoader(): ContentLoader;
|
|
372
|
-
declare const
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
45
|
+
declare const __dtsx_default_export__: {
|
|
46
|
+
generateStaticSite: typeof generateStaticSite;
|
|
47
|
+
createISRHandler: typeof createISRHandler;
|
|
48
|
+
defineStaticPaths: typeof defineStaticPaths;
|
|
49
|
+
createMarkdownLoader: typeof createMarkdownLoader
|
|
377
50
|
};
|
|
378
|
-
|
|
51
|
+
// =============================================================================
|
|
52
|
+
// Types
|
|
53
|
+
// =============================================================================
|
|
54
|
+
export declare interface SSGConfig {
|
|
55
|
+
router?: StxOptions['router']
|
|
56
|
+
pagesDir?: string
|
|
57
|
+
partialsDir?: string
|
|
58
|
+
componentsDir?: string
|
|
59
|
+
failOnIncludeError?: boolean
|
|
60
|
+
failOnServerScriptError?: boolean
|
|
61
|
+
outputDir?: string
|
|
62
|
+
baseUrl?: string
|
|
63
|
+
domain?: string
|
|
64
|
+
revalidate?: number | false
|
|
65
|
+
sitemap?: boolean
|
|
66
|
+
sitemapExclude?: (string | RegExp)[]
|
|
67
|
+
robots?: boolean | RobotsConfig
|
|
68
|
+
rss?: boolean | RSSConfig
|
|
69
|
+
concurrency?: number
|
|
70
|
+
cache?: boolean
|
|
71
|
+
cacheDir?: string
|
|
72
|
+
contentLoaders?: ContentLoader[]
|
|
73
|
+
hooks?: SSGHooks
|
|
74
|
+
minify?: boolean
|
|
75
|
+
generate404?: boolean
|
|
76
|
+
publicDir?: string
|
|
77
|
+
trailingSlash?: boolean
|
|
78
|
+
cleanOutput?: boolean
|
|
79
|
+
cacheSalt?: string
|
|
80
|
+
chunkIslands?: boolean
|
|
81
|
+
prefetchIslands?: boolean
|
|
82
|
+
integrityIslands?: boolean
|
|
83
|
+
}
|
|
84
|
+
/** robots.txt options for the static build (#1866). */
|
|
85
|
+
export declare interface RobotsConfig {
|
|
86
|
+
disallow?: string[]
|
|
87
|
+
allow?: string[]
|
|
88
|
+
userAgent?: string
|
|
89
|
+
sitemap?: boolean
|
|
90
|
+
}
|
|
91
|
+
export declare interface RSSConfig {
|
|
92
|
+
title: string
|
|
93
|
+
description: string
|
|
94
|
+
link: string
|
|
95
|
+
language?: string
|
|
96
|
+
copyright?: string
|
|
97
|
+
getItems?: () => Promise<RSSItem[]>
|
|
98
|
+
}
|
|
99
|
+
export declare interface RSSItem {
|
|
100
|
+
title: string
|
|
101
|
+
link: string
|
|
102
|
+
description?: string
|
|
103
|
+
pubDate?: Date
|
|
104
|
+
author?: string
|
|
105
|
+
categories?: string[]
|
|
106
|
+
guid?: string
|
|
107
|
+
}
|
|
108
|
+
export declare interface StaticPath {
|
|
109
|
+
params: Record<string, string>
|
|
110
|
+
props?: Record<string, unknown>
|
|
111
|
+
revalidate?: number | false
|
|
112
|
+
}
|
|
113
|
+
export declare interface StaticPathsResult {
|
|
114
|
+
paths: StaticPath[]
|
|
115
|
+
fallback?: 'blocking' | 'static' | false
|
|
116
|
+
}
|
|
117
|
+
export declare interface ContentLoader {
|
|
118
|
+
name: string
|
|
119
|
+
extensions: string[]
|
|
120
|
+
load: (filePath: string) => Promise<ContentResult>
|
|
121
|
+
}
|
|
122
|
+
export declare interface ContentResult {
|
|
123
|
+
content: string
|
|
124
|
+
data: Record<string, unknown>
|
|
125
|
+
toc?: TocItem[]
|
|
126
|
+
}
|
|
127
|
+
export declare interface TocItem {
|
|
128
|
+
id: string
|
|
129
|
+
text: string
|
|
130
|
+
level: number
|
|
131
|
+
children?: TocItem[]
|
|
132
|
+
}
|
|
133
|
+
export declare interface SSGHooks {
|
|
134
|
+
onBuildStart?: () => void | Promise<void>
|
|
135
|
+
onBuildEnd?: (result: SSGResult) => void | Promise<void>
|
|
136
|
+
onPageStart?: (route: string) => void | Promise<void>
|
|
137
|
+
onPageEnd?: (route: string, html: string) => void | Promise<void>
|
|
138
|
+
onError?: (error: Error, route?: string) => void | Promise<void>
|
|
139
|
+
}
|
|
140
|
+
export declare interface SSGResult {
|
|
141
|
+
totalPages: number
|
|
142
|
+
successCount: number
|
|
143
|
+
failedCount: number
|
|
144
|
+
cachedCount: number
|
|
145
|
+
buildTime: number
|
|
146
|
+
sitemapPath?: string
|
|
147
|
+
rssPath?: string
|
|
148
|
+
pages: PageResult[]
|
|
149
|
+
errors: PageError[]
|
|
150
|
+
islandChunks?: { count: number, totalBytes: number }
|
|
151
|
+
}
|
|
152
|
+
export declare interface PageResult {
|
|
153
|
+
route: string
|
|
154
|
+
outputPath: string
|
|
155
|
+
size: number
|
|
156
|
+
cached: boolean
|
|
157
|
+
revalidateAt?: number
|
|
158
|
+
}
|
|
159
|
+
export declare interface PageError {
|
|
160
|
+
route: string
|
|
161
|
+
error: Error
|
|
162
|
+
}
|
|
163
|
+
export declare interface ISRCache {
|
|
164
|
+
get: (route: string) => Promise<CachedPage | null>
|
|
165
|
+
set: (route: string, page: CachedPage) => Promise<void>
|
|
166
|
+
invalidate: (route: string) => Promise<void>
|
|
167
|
+
invalidatePattern: (pattern: RegExp) => Promise<void>
|
|
168
|
+
needsRevalidation: (route: string) => Promise<boolean>
|
|
169
|
+
}
|
|
170
|
+
export declare interface CachedPage {
|
|
171
|
+
html: string
|
|
172
|
+
generatedAt: number
|
|
173
|
+
revalidateAfter: number
|
|
174
|
+
etag: string
|
|
175
|
+
headers?: Record<string, string>
|
|
176
|
+
}
|
|
177
|
+
declare class BuildCache {
|
|
178
|
+
constructor(cacheDir: string, salt?: string);
|
|
179
|
+
load(): Promise<void>;
|
|
180
|
+
save(): Promise<void>;
|
|
181
|
+
getHash(filePath: string, dependencies: string[]): string;
|
|
182
|
+
get(route: string, filePath: string): string | null;
|
|
183
|
+
set(route: string, filePath: string, dependencies: string[], html: string): void;
|
|
184
|
+
}
|
|
185
|
+
// =============================================================================
|
|
186
|
+
// ISR Cache Implementation
|
|
187
|
+
// =============================================================================
|
|
188
|
+
declare class FileISRCache implements ISRCache {
|
|
189
|
+
constructor(cacheDir: string);
|
|
190
|
+
get(route: string): Promise<CachedPage | null>;
|
|
191
|
+
set(route: string, page: CachedPage): Promise<void>;
|
|
192
|
+
invalidate(route: string): Promise<void>;
|
|
193
|
+
invalidatePattern(pattern: RegExp): Promise<void>;
|
|
194
|
+
needsRevalidation(route: string): Promise<boolean>;
|
|
195
|
+
}
|
|
196
|
+
// =============================================================================
|
|
197
|
+
// Exports
|
|
198
|
+
// =============================================================================
|
|
199
|
+
export default __dtsx_default_export__;
|
package/dist/ssg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-3kc7af8c.js";import"./chunk-yf90vn5t.js";import"./chunk-7hr63cp5.js";import{rt,st,ot,it,at,ct}from"./chunk-gdxhe7ae.js";import"./chunk-hq8vxds5.js";import"./chunk-4xvbc0mb.js";import{f,He,L,J,n,o}from"./chunk-g8dx2jew.js";import"./chunk-3dr757vb.js";import{cr}from"./chunk-nc0ba89b.js";import"./chunk-vde4mtfr.js";import"./chunk-ta50ym5j.js";import"./chunk-nxw03sy9.js";import"./chunk-550q827h.js";import"./chunk-sej3ng5k.js";import{ce,bt,wt}from"./chunk-n8hnrgen.js";import{zo,Ho,Uo}from"./chunk-pxk0tpw2.js";import{ht,tn,nn}from"./chunk-0ppzstqj.js";import"./chunk-cp5903cg.js";import{a}from"./chunk-snzh9z3g.js";import x from"fs";import g from"path";import{createHash as Dt}from"crypto";function Rt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ut(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace(kt,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Rt(h);let S=Ct(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${Dt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Et=new Set(["visible","idle"]);function dt(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Et.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var It=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Bt(t){for(let i of It){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function gt(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function jt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=gt(e.default??e);if(l)return l}catch{}}return null}async function pt(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=gt(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await jt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=Bt(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ft(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
3
|
`)}class mt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,i=""){this.cacheDir=t,this.salt=i}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let i=JSON.parse(await Bun.file(t).text());for(let[s,r]of Object.entries(i))this.cache.set(s,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),i={};for(let[s,r]of this.cache)i[s]=r;await Bun.write(t,JSON.stringify(i))}getHash(t,i){let s=x.statSync(t),r=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of i)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,i){let s=this.cache.get(t);if(!s)return null;let r=this.getHash(i,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(t),null;return s.html}set(t,i,s,r){let c=this.getHash(i,s);this.cache.set(t,{hash:c,html:r,generatedAt:Date.now(),dependencies:s})}}class yt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let i=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",i)}async get(t){let i=this.getFilePath(t);if(!await Bun.file(i).exists())return null;try{return JSON.parse(await Bun.file(i).text())}catch{return null}}async set(t,i){let s=this.getFilePath(t);await x.promises.mkdir(g.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(i))}async invalidate(t){let i=this.getFilePath(t);if(await Bun.file(i).exists())await x.promises.unlink(i)}async invalidatePattern(t){let i=g.join(this.cacheDir,"isr");if(!x.existsSync(i))return;let s=await x.promises.readdir(i);for(let r of s){let c=r.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(i,r))}}async needsRevalidation(t){let i=await this.get(t);if(!i)return!0;return Date.now()>i.revalidateAfter}}async function Ft(t){try{let s=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let r=s[1];if(!r.includes("getStaticPaths"))return null;let c=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
|
|
4
4
|
return (async function getStaticPaths() {
|
|
5
5
|
${c[1]}
|
|
@@ -9,7 +9,7 @@ import"./chunk-2z0trbbm.js";import"./chunk-ydx3mfpp.js";import"./chunk-vp31ff54.
|
|
|
9
9
|
${e[1]}
|
|
10
10
|
})()
|
|
11
11
|
`)(i)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Lt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function St(t,i,s={},r,c){let e=await Bun.file(t.filePath).text(),l=await Tt(t.filePath),w=await At(e,i,t.filePath),y={...l||{},...w||{},...s,params:i,$route:{path:t.pattern,params:i}},h=new Set,S=[],P=[],D={...c,...r.partialsDir?{partialsDir:r.partialsDir}:{},...r.componentsDir?{componentsDir:r.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(b)=>{S.push(`${g.relative(process.cwd(),b.templatePath)}: ${b.message}
|
|
12
|
-
resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Lt(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let p=await n(e,y,t.filePath,D,h);for(let b of[t.filePath,...h])for(let B of
|
|
12
|
+
resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Lt(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let p=await n(e,y,t.filePath,D,h);for(let b of[t.filePath,...h])for(let B of ce(b))h.add(B);if(Object.keys(i).length>0){let b=`<script>if(window.stx)window.stx._rp=${JSON.stringify(i)};else window.__stx_rp=${JSON.stringify(i)};</script>`;if(p.includes("</head>"))p=p.replace("</head>",`${b}
|
|
13
13
|
</head>`);else p=`${b}
|
|
14
14
|
${p}`}if(p=await J(p,{router:r.router}),p=await f(p),r.minify!==!1)return{html:Mt(p),dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P};return{html:p,dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P}}function Mt(t){let i=[],s=0,r=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=r.exec(t))!==null){let l=t.slice(s,c.index);i.push(l.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let w=c[1],y=c[2],h=c[3];y=y.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),i.push(w+y+h),s=c.index+c[0].length}let e=t.slice(s);return i.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),i.join("").trim()}function Ut(t){let i=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);i=(i<<5)-i+r,i=i&i}return`"${Math.abs(i).toString(36)}"`}function _t(t,i,s,r){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(i))return!0;return r.some((c)=>{if(c instanceof RegExp)return c.test(t);return c.endsWith("/")?t===c.slice(0,-1)||t.startsWith(c):t===c})}function Gt(t,i){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
15
15
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
@@ -41,7 +41,7 @@ ${t.map((r)=>{let c=new URL(r.loc,i).href,e=` <url>
|
|
|
41
41
|
${s.join(`
|
|
42
42
|
`)}
|
|
43
43
|
</channel>
|
|
44
|
-
</rss>`}async function zt(t={}){let i=Date.now();wt();let s=await o(process.cwd()),r=s.build||{},c=await pt({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ft());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-
|
|
44
|
+
</rss>`}async function zt(t={}){let i=Date.now();wt();let s=await o(process.cwd()),r=s.build||{},c=await pt({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ft());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-4eff1v2p.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-mp16jxcg.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new mt(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-4eff1v2p.js");await u('<div class="bg-black"></div>')}catch{}rt();let xt=s?.routeMiddleware?.dir||"middleware";await ot(process.cwd(),xt);let H=st();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let vt=s?.routeMiddleware?.global||[];Uo(s?.layoutsDir,a(process.cwd()));let K=L(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${K.length} routes`);let G=[];for(let u of K){let m=await Ot(u);for(let v of m)G.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=G.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<G.length;u+=e.concurrency)X.push(G.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:M,props:Pt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Jt(j),$t=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],tt=[...vt,...$t];if(tt.length>0){let C=it(d,M,F||{}),O=at(C,null,void 0,{isServer:!0}),E=await ct(tt,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,_=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,_),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(_),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let et=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(et)try{if(!await Function("route",`
|
|
45
45
|
const validate = ${et[1]};
|
|
46
46
|
return validate(route);
|
|
47
47
|
`)({params:M})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,nt=!1;if(e.cache){if(k=B.get(d,v.filePath),k)nt=!0,l.cachedCount++}if(!k){let C=await St(v,M,Pt,e,s);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
@@ -73,7 +73,7 @@ ${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.
|
|
|
73
73
|
<a href="/">Go home</a>
|
|
74
74
|
</div>
|
|
75
75
|
</body>
|
|
76
|
-
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...s,debug:!1,cache:!1},M=await n(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),M)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...s,debug:!1,cache:!1},v=await n(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Gt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=
|
|
76
|
+
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...s,debug:!1,cache:!1},M=await n(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),M)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...s,debug:!1,cache:!1},v=await n(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Gt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=cr({rules:[{userAgent:u.userAgent||"*",allow:u.allow||["/"],...m.length>0?{disallow:m}:{}}],...u.sitemap!==!1&&l.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(g.join(e.outputDir,"robots.txt"),v),console.log("Generated robots.txt")}if(e.rss){let u=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(u.getItems)m=await u.getItems();let v=Nt(u,m),d=g.join(e.outputDir,"rss.xml");await Bun.write(d,v),l.rssPath=d,console.log(`Generated rss.xml with ${m.length} items`)}let N=zo(e.outputDir);if(N.assets>0)console.log(`Externalized ${N.assets} asset(s) from ${N.pages} page(s) (${(N.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let z=Ho(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} repeated asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&x.existsSync(e.publicDir))await V(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let Z=nn();if(Z)await V(Z,g.join(e.outputDir,tn)),console.log(`Copied assets from ${ht}`)}catch(D){throw await e.hooks.onError?.(D),D}if(l.buildTime=Date.now()-i,w.size>0){l.islandChunks={count:w.size,totalBytes:y};let D={generatedChunks:w.size,totalBytes:y,chunks:h,pages:S};await Bun.write(g.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(D,null,2))}await e.hooks.onBuildEnd?.(l);let P=l.islandChunks?`
|
|
77
77
|
Island chunks: ${l.islandChunks.count} (${(l.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
78
78
|
Build complete!
|
|
79
79
|
Total: ${l.totalPages} pages
|
package/dist/state-dir.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/** The directory used when nothing configures one. */
|
|
2
|
-
export declare const DEFAULT_STATE_DIR = ".stx";
|
|
3
|
-
/** Environment variable that overrides both the config and the default. */
|
|
4
|
-
export declare const STATE_DIR_ENV_VAR = "STX_DIR";
|
|
5
1
|
/**
|
|
6
2
|
* Records the `stateDir` coming from `stx.config.ts`.
|
|
7
3
|
*
|
|
@@ -34,3 +30,7 @@ export declare function stateDir(root?: string, ...segments: string[]): string;
|
|
|
34
30
|
*/
|
|
35
31
|
export declare function rebaseOntoStateDir(value: string): string;
|
|
36
32
|
export declare function rebaseOntoStateDir(value: string | undefined): string | undefined;
|
|
33
|
+
/** The directory used when nothing configures one. */
|
|
34
|
+
export declare const DEFAULT_STATE_DIR: '.stx';
|
|
35
|
+
/** Environment variable that overrides both the config and the default. */
|
|
36
|
+
export declare const STATE_DIR_ENV_VAR: 'STX_DIR';
|
package/dist/store-loader.d.ts
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Store Auto-Loader
|
|
3
|
-
*
|
|
4
|
-
* Discovers .ts files in storesDir, bundles them with Bun.build,
|
|
5
|
-
* and returns a <script> tag to inject into the page. Stores are
|
|
6
|
-
* registered before any <script client> blocks run, so useStore()
|
|
7
|
-
* always finds them.
|
|
8
|
-
*
|
|
9
|
-
* @module store-loader
|
|
10
|
-
*/
|
|
11
1
|
export declare function getStoreScript(storesDir?: string): Promise<string | null>;
|
|
12
2
|
/**
|
|
13
3
|
* Clear the cached store script (for dev mode hot reload).
|