@stacksjs/stx 0.2.852 → 0.2.853
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 +1 -1
- package/dist/analytics.d.ts +1 -1
- package/dist/animation.d.ts +1 -44
- package/dist/api-client.d.ts +1 -0
- package/dist/app-shell.d.ts +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/application-layers.d.ts +1 -1
- package/dist/assets.d.ts +1 -1
- package/dist/ast.d.ts +23 -1
- package/dist/broadcasting.d.ts +1 -1
- package/dist/browser-composables.d.ts +1 -0
- package/dist/build-externalize-repeated.d.ts +1 -1
- package/dist/build-id.d.ts +1 -0
- package/dist/build-views.d.ts +1 -1
- package/dist/build.d.ts +3 -3
- package/dist/builtins/attrs.d.ts +1 -1
- package/dist/builtins/drawer.d.ts +2 -2
- package/dist/builtins/icon.d.ts +2 -13
- package/dist/builtins/image-delivery.d.ts +1 -1
- package/dist/builtins/image-worker.d.ts +2 -2
- package/dist/builtins/index.d.ts +22 -22
- package/dist/builtins/modal.d.ts +2 -2
- package/dist/builtins/safe-image.d.ts +2 -2
- package/dist/builtins/stx-image.d.ts +2 -43
- package/dist/builtins/stx-link.d.ts +1 -10
- package/dist/builtins/stx-loading-indicator.d.ts +1 -13
- package/dist/builtins/suspense.d.ts +1 -8
- package/dist/builtins/toast.d.ts +2 -3
- package/dist/builtins/transition-group.d.ts +1 -2
- package/dist/bundle-analyzer/index.d.ts +6 -6
- package/dist/bundle-analyzer/report.d.ts +1 -1
- package/dist/bundle-analyzer/treemap.d.ts +1 -1
- package/dist/caching.d.ts +4 -4
- package/dist/chunk-05f4tjsq.js +2 -0
- package/dist/{chunk-422r7zkx.js → chunk-0hegjagg.js} +2 -2
- package/dist/{chunk-6tns3zet.js → chunk-0wxmmvj0.js} +3 -3
- package/dist/chunk-0xwmweqm.js +2 -0
- package/dist/chunk-0yc4p3y2.js +2 -0
- package/dist/chunk-161p0zcy.js +2 -0
- package/dist/chunk-28r4jyvj.js +2 -0
- package/dist/{chunk-gwdffrz6.js → chunk-2rxr5cj6.js} +3 -3
- package/dist/{chunk-s0pnyd2f.js → chunk-33ph9zb2.js} +4 -4
- package/dist/chunk-3b9950gz.js +2 -0
- package/dist/chunk-46mw2r3k.js +2 -0
- package/dist/chunk-48z6w533.js +3 -0
- package/dist/{chunk-88392kaj.js → chunk-4nhbbcr9.js} +5 -5
- package/dist/{chunk-f5n871gp.js → chunk-4wx7refk.js} +4 -4
- package/dist/chunk-4zkk63v3.js +2 -0
- package/dist/{chunk-kp2g6sj6.js → chunk-52szcd15.js} +1 -1
- package/dist/chunk-5758n8sm.js +2 -0
- package/dist/{chunk-fffjjgnt.js → chunk-5erremft.js} +2 -2
- package/dist/{chunk-r0k5jbvk.js → chunk-5fdpg861.js} +1 -1
- package/dist/{chunk-k47addf7.js → chunk-5g1jwxny.js} +9 -9
- package/dist/{chunk-fkrf2099.js → chunk-5pft38qa.js} +2 -2
- package/dist/chunk-5t8xpkwc.js +2 -0
- package/dist/{chunk-aas25pac.js → chunk-63rvsnt2.js} +3 -3
- package/dist/chunk-6bm19d4k.js +2 -0
- package/dist/chunk-6c45vx1e.js +2 -0
- package/dist/chunk-6vc1dwqt.js +2 -0
- package/dist/chunk-76b6m6n0.js +2 -0
- package/dist/{chunk-qev14f76.js → chunk-7kc9xwht.js} +3 -3
- package/dist/{chunk-42hj9jnj.js → chunk-7rtvravz.js} +7 -7
- package/dist/{chunk-hh9hnx1a.js → chunk-7wwq1btb.js} +1 -1
- package/dist/{chunk-pbq1gn94.js → chunk-83d468me.js} +4 -4
- package/dist/{chunk-r53tqxmq.js → chunk-8cg88x7m.js} +39 -39
- package/dist/chunk-8fprfzcn.js +2 -0
- package/dist/{chunk-tn9h4prj.js → chunk-8g0243g1.js} +3 -3
- package/dist/chunk-9h1w4py6.js +2 -0
- package/dist/{chunk-tt3jxdy5.js → chunk-9mzskb69.js} +3 -3
- package/dist/{chunk-8cvgm13s.js → chunk-9r999ees.js} +2 -2
- package/dist/{chunk-2d7e5g92.js → chunk-9z7fnv33.js} +1 -1
- package/dist/{chunk-818kkhb8.js → chunk-a0ahcd1g.js} +2 -2
- package/dist/chunk-aajezypd.js +2 -0
- package/dist/{chunk-714p8awg.js → chunk-agvm20mz.js} +3 -3
- package/dist/{chunk-3bp76dx5.js → chunk-baxrx1rz.js} +9 -9
- package/dist/{chunk-xndr2dx9.js → chunk-bkefg64w.js} +5 -5
- package/dist/{chunk-n2z4kyba.js → chunk-bqxrfagh.js} +1 -1
- package/dist/chunk-bz4bskx3.js +2 -0
- package/dist/chunk-bze3ksvb.js +2 -0
- package/dist/chunk-c2et7w0g.js +2 -0
- package/dist/{chunk-c1dkvqr5.js → chunk-c54bhqrg.js} +39 -39
- package/dist/{chunk-keeetray.js → chunk-c9k0yhyq.js} +2 -2
- package/dist/{chunk-g34tj6ny.js → chunk-cabdpgxg.js} +3 -3
- package/dist/{chunk-e0dgx3ev.js → chunk-cf7dk9ev.js} +10 -10
- package/dist/chunk-cfmjtyzm.js +2 -0
- package/dist/{chunk-h9gjt73q.js → chunk-csgfws3j.js} +2 -2
- package/dist/{chunk-scaawv2r.js → chunk-csksn1kg.js} +2 -2
- package/dist/{chunk-t23jn83r.js → chunk-ctb1bj28.js} +2 -2
- package/dist/chunk-cxf0rzv6.js +2 -0
- package/dist/{chunk-axga9ebe.js → chunk-d4gy4yz0.js} +2 -2
- package/dist/chunk-dee5mtdv.js +2 -0
- package/dist/chunk-dm10y06z.js +2 -0
- package/dist/chunk-dw9vnhc4.js +2 -0
- package/dist/chunk-e5vbwsty.js +2 -0
- package/dist/chunk-e64m5ayt.js +2 -0
- package/dist/{chunk-z33esms3.js → chunk-ehp792dy.js} +2 -2
- package/dist/{chunk-tm1ec751.js → chunk-f9thwm8c.js} +4 -4
- package/dist/chunk-faf3gh3j.js +2 -0
- package/dist/chunk-fbakngjt.js +2 -0
- package/dist/{chunk-amerebya.js → chunk-fhrvxfq9.js} +2 -2
- package/dist/{chunk-pkq96sqk.js → chunk-fj5jw2jd.js} +6 -6
- package/dist/chunk-fn2cjkp0.js +2 -0
- package/dist/{chunk-m05pqmcj.js → chunk-fphnst8a.js} +5 -5
- package/dist/chunk-fsg958xx.js +2 -0
- package/dist/{chunk-1pavg6q5.js → chunk-fxt9vwdw.js} +38 -38
- package/dist/chunk-g976n4r1.js +2 -0
- package/dist/chunk-gn1dmfdv.js +2 -0
- package/dist/chunk-gsn5vvw4.js +2 -0
- package/dist/chunk-hmys6w75.js +2 -0
- package/dist/chunk-hqtj4ngq.js +2 -0
- package/dist/chunk-hwq24mwt.js +2 -0
- package/dist/{chunk-0rszcb0m.js → chunk-j1yjbykm.js} +6 -6
- package/dist/{chunk-frhdk0p9.js → chunk-j2wcawmf.js} +2 -2
- package/dist/{chunk-k7dvn2r8.js → chunk-jr346anv.js} +2 -2
- package/dist/{chunk-d5m6xy9p.js → chunk-jtpqqxzb.js} +6 -6
- package/dist/chunk-jy5fezyr.js +2 -0
- package/dist/chunk-kfq4mwem.js +2 -0
- package/dist/chunk-kgrvvtcy.js +3 -0
- package/dist/chunk-kkk1dtq6.js +2 -0
- package/dist/chunk-knd3m4t4.js +2 -0
- package/dist/{chunk-jtccqpwa.js → chunk-kvafq9gy.js} +2 -2
- package/dist/chunk-m3kc2a3v.js +2 -0
- package/dist/{chunk-7x6aqvfe.js → chunk-m9n3ahsy.js} +2 -2
- package/dist/{chunk-1sedjgmj.js → chunk-mdsc3rz1.js} +2 -2
- package/dist/chunk-mjp2sp74.js +2 -0
- package/dist/{chunk-g046t3hb.js → chunk-mmdqdkbd.js} +1 -1
- package/dist/{chunk-caehra7e.js → chunk-mpmnbvy4.js} +5 -5
- package/dist/chunk-mx79sfyr.js +2 -0
- package/dist/chunk-n6w82yf2.js +2 -0
- package/dist/{chunk-qjc3qjyf.js → chunk-n77xrpv9.js} +2 -2
- package/dist/{chunk-2stgv8kd.js → chunk-n8qd1n8w.js} +3 -3
- package/dist/{chunk-agbkv9ab.js → chunk-ngnvyqk3.js} +2 -2
- package/dist/{chunk-9gzgfj19.js → chunk-nyqvtca1.js} +4 -4
- package/dist/{chunk-te090fxv.js → chunk-nz202f97.js} +4 -4
- package/dist/chunk-pd3wzh2x.js +2 -0
- package/dist/chunk-pj3xwwtg.js +2 -0
- package/dist/{chunk-gsrdjmw9.js → chunk-pm241ehv.js} +2 -2
- package/dist/{chunk-8vjr3atq.js → chunk-prfrqfae.js} +2 -2
- package/dist/chunk-q1z8edtn.js +2 -0
- package/dist/{chunk-3wkgd883.js → chunk-qkcn0exq.js} +6 -6
- package/dist/{chunk-m710wkr4.js → chunk-qnyh0m22.js} +1 -1
- package/dist/{chunk-e85wsz8y.js → chunk-r69en2jg.js} +1 -1
- package/dist/{chunk-833y1ndd.js → chunk-rbxbgvkf.js} +1 -1
- package/dist/{chunk-tgk6bst6.js → chunk-rmeey2xa.js} +4 -4
- package/dist/{chunk-0kaph5qq.js → chunk-rrppkyv0.js} +42 -42
- package/dist/{chunk-whdy7r35.js → chunk-rw7q2a3c.js} +9 -9
- package/dist/chunk-s4c1mq0r.js +2 -0
- package/dist/chunk-sx1prttb.js +2 -0
- package/dist/chunk-syww37qd.js +2 -0
- package/dist/{chunk-6p62jjzm.js → chunk-t3a3wbjk.js} +2 -2
- package/dist/{chunk-0dnetjh8.js → chunk-te82sjhy.js} +48 -48
- package/dist/{chunk-2rg9pqmh.js → chunk-tm8a2b69.js} +4 -4
- package/dist/{chunk-w7dks1ev.js → chunk-trxha300.js} +5 -5
- package/dist/{chunk-tbms7m44.js → chunk-txdxfjbj.js} +3 -3
- package/dist/{chunk-m150nmez.js → chunk-vpqgg04q.js} +1 -1
- package/dist/{chunk-02w7kaas.js → chunk-vtzkqsq1.js} +17 -17
- package/dist/chunk-vw9h1x2m.js +2 -0
- package/dist/{chunk-e105xsee.js → chunk-w7p34cr3.js} +1 -1
- package/dist/{chunk-sb8vn22f.js → chunk-x1w19y3w.js} +4 -4
- package/dist/chunk-x2vybq9n.js +2 -0
- package/dist/chunk-x8jsmwhg.js +2 -0
- package/dist/chunk-xa9mkdn7.js +2 -0
- package/dist/{chunk-gn6yqcz2.js → chunk-xzdjhjz4.js} +4 -4
- package/dist/{chunk-kd06c90f.js → chunk-ya6f7mt5.js} +4 -4
- package/dist/{chunk-0b7knfwk.js → chunk-zjfp64v7.js} +1 -1
- package/dist/{chunk-cm5kpn54.js → chunk-zqpjqcm8.js} +5 -5
- package/dist/chunk-zzzqnf9k.js +2 -0
- package/dist/cli.js +41 -41
- package/dist/client/directive.d.ts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client-script-bundler.d.ts +1 -1
- package/dist/client-script.d.ts +5 -5
- package/dist/client.d.ts +1 -0
- package/dist/component-client-factories.d.ts +1 -0
- package/dist/component-contract-checks.d.ts +1 -1
- package/dist/component-hmr.d.ts +17 -0
- package/dist/component-library.d.ts +1 -1
- package/dist/component-model.d.ts +1 -1
- package/dist/component-processing.d.ts +4 -4
- package/dist/component-registry.d.ts +2 -2
- package/dist/component-renderer.d.ts +3 -3
- package/dist/components.d.ts +1 -1
- package/dist/composables/index.d.ts +47 -47
- package/dist/composables/use-ambient-sound.d.ts +38 -1
- package/dist/composables/use-broadcast-channel.d.ts +1 -0
- package/dist/composables/use-cached-query.d.ts +3 -3
- package/dist/composables/use-completion.d.ts +1 -1
- package/dist/composables/use-cookie.d.ts +1 -1
- package/dist/composables/use-eye-dropper.d.ts +1 -0
- package/dist/composables/use-fetch.d.ts +2 -2
- package/dist/composables/use-form.d.ts +2 -2
- package/dist/composables/use-intersection-observer.d.ts +1 -0
- package/dist/composables/use-keyboard.d.ts +21 -20
- package/dist/composables/use-media-query.d.ts +5 -5
- package/dist/composables/use-notification.d.ts +0 -9
- package/dist/composables/use-permissions.d.ts +0 -10
- package/dist/composables/use-scroll-lock.d.ts +2 -1
- package/dist/composables/use-share.d.ts +0 -4
- package/dist/composables/use-speech.d.ts +1 -0
- package/dist/composables/use-storage.d.ts +1 -1
- package/dist/composables/use-timer.d.ts +4 -4
- package/dist/composables/use-virtual-list.d.ts +1 -1
- package/dist/composables/use-websocket.d.ts +1 -0
- package/dist/composables.d.ts +3 -3
- package/dist/config.d.ts +18 -1
- package/dist/config.js +9 -2
- package/dist/craft-compiler.d.ts +1 -5
- package/dist/craft-components.d.ts +2 -6
- package/dist/craft-entry.d.ts +5 -5
- package/dist/craft-entry.js +2 -2
- package/dist/craft-ssr.d.ts +1 -1
- package/dist/craft.js +2 -2
- package/dist/csp.d.ts +1 -1
- package/dist/custom-directives.d.ts +1 -1
- package/dist/database.d.ts +21 -1
- package/dist/deploy/index.d.ts +6 -6
- package/dist/dev-server/index.d.ts +7 -7
- package/dist/dev-server/serve-app.d.ts +1 -1
- package/dist/dev-server/serve-file.d.ts +1 -1
- package/dist/dev-server/serve-markdown.d.ts +1 -1
- package/dist/dev-server/serve-multi.d.ts +1 -1
- package/dist/dev-server/terminal-colors.d.ts +25 -25
- package/dist/dev-server/ts-css.d.ts +1 -1
- package/dist/dev-server/types.d.ts +1 -1
- package/dist/dev-server.d.ts +5 -5
- package/dist/directive-api.d.ts +1 -1
- package/dist/directive-arguments.d.ts +1 -1
- package/dist/docs.d.ts +2 -2
- package/dist/document-shell.d.ts +2 -2
- package/dist/dynamic-components.d.ts +1 -1
- package/dist/edge-runtime.d.ts +1 -1
- package/dist/engine-bindings.d.ts +1 -1
- package/dist/error-handling.d.ts +1 -1
- package/dist/errors/codes.d.ts +28 -28
- package/dist/errors/formatter.d.ts +2 -2
- package/dist/errors/index.d.ts +5 -5
- package/dist/errors/logger.d.ts +14 -1
- package/dist/errors/sanitizer.d.ts +13 -2
- package/dist/errors/types.d.ts +1 -1
- package/dist/expressions.d.ts +3 -36
- package/dist/forms-validation.d.ts +5 -1
- package/dist/forms.d.ts +21 -21
- package/dist/fragment-container.d.ts +1 -0
- package/dist/heatmap.d.ts +2 -5
- package/dist/hot-reload.d.ts +3 -0
- package/dist/hydration.d.ts +28 -0
- package/dist/i18n.d.ts +2 -1
- package/dist/image-optimization/build-plugin.d.ts +2 -2
- package/dist/image-optimization/component.d.ts +1 -1
- package/dist/image-optimization/directive.d.ts +3 -3
- package/dist/image-optimization/index.d.ts +6 -6
- package/dist/image-optimization/processor.d.ts +1 -0
- package/dist/image-optimization/serve.d.ts +2 -1
- package/dist/includes.d.ts +2 -2
- package/dist/index.d.ts +171 -171
- package/dist/init.d.ts +1 -0
- package/dist/installed-entry.d.ts +1 -1
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/lazy-loader.d.ts +5 -0
- package/dist/loading-indicator.d.ts +0 -2
- package/dist/loops.d.ts +3 -3
- package/dist/manifest.d.ts +2 -2
- package/dist/media/client/index.d.ts +6 -6
- package/dist/media/image/component.d.ts +1 -1
- package/dist/media/image/directive.d.ts +2 -2
- package/dist/media/image/editing.d.ts +35 -35
- package/dist/media/image/index.d.ts +6 -6
- package/dist/media/image/placeholder.d.ts +1 -1
- package/dist/media/image/processor/cache.d.ts +3 -2
- package/dist/media/image/processor/index.d.ts +4 -4
- package/dist/media/image/processor/optimizer.d.ts +1 -1
- package/dist/media/image/processor/responsive.d.ts +1 -1
- package/dist/media/image/srcset.d.ts +6 -6
- package/dist/media/index.d.ts +13 -13
- package/dist/media/manager/embed.d.ts +1 -1
- package/dist/media/protected/component.d.ts +1 -1
- package/dist/media/protected/index.d.ts +2 -2
- package/dist/media/protected/signature.d.ts +1 -1
- package/dist/media/shared/index.d.ts +2 -2
- package/dist/media/upload/component.d.ts +1 -1
- package/dist/media/upload/index.d.ts +1 -1
- package/dist/media/video/directive.d.ts +2 -2
- package/dist/media/video/index.d.ts +2 -2
- package/dist/media/video/processor/cache.d.ts +3 -2
- package/dist/media/video/processor/index.d.ts +5 -5
- package/dist/media/video/processor/streaming.d.ts +1 -1
- package/dist/media/video/processor/thumbnail.d.ts +1 -1
- package/dist/media/video/processor/transcoder.d.ts +1 -1
- package/dist/meta-arguments.d.ts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/native/bridge/protocol.d.ts +15 -14
- package/dist/native/cli.d.ts +1 -1
- package/dist/native/compiler/browser.d.ts +1 -1
- package/dist/native/compiler/bundle.d.ts +3 -3
- package/dist/native/compiler/class-table.d.ts +4 -4
- package/dist/native/compiler/client-script.d.ts +1 -1
- package/dist/native/compiler/component-mapping.d.ts +1 -1
- package/dist/native/compiler/design-tokens.d.ts +1 -1
- package/dist/native/compiler/headwind-to-style.d.ts +3 -3
- package/dist/native/compiler/html-to-ir.d.ts +1 -1
- package/dist/native/compiler/inline-style.d.ts +2 -2
- package/dist/native/compiler/ir.d.ts +3 -3
- package/dist/native/compiler/layout-chrome.d.ts +1 -1
- package/dist/native/compiler/render-screen.d.ts +5 -5
- package/dist/native/compiler/shared-scripts.d.ts +1 -1
- package/dist/native/compiler/svg.d.ts +1 -1
- package/dist/native/components/primitives.d.ts +32 -32
- package/dist/native/floating-actions.d.ts +1 -1
- package/dist/native/hot-reload/client.d.ts +26 -1
- package/dist/native/index.d.ts +19 -19
- package/dist/native/runtime/binding-tree.d.ts +8 -3
- package/dist/native/runtime/browser-renderer.d.ts +33 -3
- package/dist/native/runtime/browser-screen.d.ts +2 -2
- package/dist/native/runtime/compact-document.d.ts +3 -5
- package/dist/native/runtime/craft-bridge.d.ts +4 -3
- package/dist/native/runtime/craft.d.ts +1 -1
- package/dist/native/runtime/event-stream.d.ts +1 -0
- package/dist/native/runtime/initial-media-mutations.d.ts +1 -1
- package/dist/native/runtime/jsc-globals.d.ts +18 -32
- package/dist/native/runtime/native-host.d.ts +8 -8
- package/dist/native/runtime/navigation-chrome.d.ts +1 -1
- package/dist/native/runtime/overlay-presenter.d.ts +3 -2
- package/dist/native/runtime/shared-screen.d.ts +7 -6
- package/dist/native/runtime/view-operations.d.ts +1 -1
- package/dist/native/runtime/web-navigation.d.ts +1 -0
- package/dist/native/runtime/web-storage.d.ts +4 -2
- package/dist/native/testing-mutations.d.ts +1 -1
- package/dist/native/testing.d.ts +4 -3
- package/dist/native/testing.js +21 -2
- package/dist/native/ui.d.ts +37 -36
- package/dist/native-build.d.ts +3 -3
- package/dist/offline/app-service-worker.d.ts +1 -0
- package/dist/offline/query-cache.d.ts +2 -2
- package/dist/page-action.d.ts +1 -1
- package/dist/parser/expression-parser.d.ts +1 -1
- package/dist/parser/index.d.ts +4 -4
- package/dist/parser/tokenizer.d.ts +16 -0
- package/dist/performance-utils.d.ts +136 -256
- package/dist/plugin-system.d.ts +7 -1
- package/dist/precompiler.d.ts +32 -1
- package/dist/process.d.ts +6 -6
- package/dist/production-build.d.ts +36 -0
- package/dist/production-builder.d.ts +3 -3
- package/dist/production-server.d.ts +1 -1
- package/dist/pwa/audit.d.ts +1 -1
- package/dist/pwa/directives.d.ts +1 -18
- package/dist/pwa/icons.d.ts +1 -1
- package/dist/pwa/index.d.ts +10 -10
- package/dist/pwa/inject.d.ts +1 -1
- package/dist/pwa/manifest.d.ts +1 -1
- package/dist/pwa/offline.d.ts +1 -1
- package/dist/pwa/precache.d.ts +1 -1
- package/dist/pwa/service-worker.d.ts +1 -1
- package/dist/pwa/workbox-strategies.d.ts +1 -1
- package/dist/pwa/workbox.d.ts +1 -1
- package/dist/pwa.d.ts +9 -9
- package/dist/pwa.js +3 -3
- package/dist/reactive-bindings.d.ts +1 -0
- package/dist/render-memo.d.ts +1 -1
- package/dist/render.d.ts +1 -1
- package/dist/route-response-cache.d.ts +5 -1
- package/dist/route-types.d.ts +1 -0
- package/dist/runtime-config-loader.d.ts +1 -1
- package/dist/runtime-config-server.d.ts +1 -4
- package/dist/runtime-config-types.d.ts +2 -2
- package/dist/runtime-injection.d.ts +1 -1
- package/dist/safe-evaluator.d.ts +38 -55
- package/dist/script-validation.d.ts +1 -1
- package/dist/seo.d.ts +1 -9
- package/dist/serve.d.ts +1 -1
- package/dist/server-api.d.ts +3 -2
- package/dist/server-components.d.ts +2 -1
- package/dist/server-data.d.ts +1 -0
- package/dist/signal-processing.d.ts +3 -3
- package/dist/signals.d.ts +2 -2
- package/dist/site-builder/build.d.ts +1 -1
- package/dist/site-builder/i18n.d.ts +1 -1
- package/dist/site-builder/index.d.ts +9 -9
- package/dist/site-builder/robots.d.ts +1 -1
- package/dist/site-builder/router.d.ts +1 -1
- package/dist/site-builder/seo.d.ts +1 -1
- package/dist/site-builder/sitemap.d.ts +1 -1
- package/dist/site-builder/theme.d.ts +1 -1
- package/dist/source-maps.d.ts +14 -0
- package/dist/ssg-static-paths.d.ts +1 -1
- package/dist/ssg.d.ts +3 -22
- package/dist/ssg.js +3 -3
- package/dist/ssr.d.ts +2 -1
- package/dist/state-management.d.ts +1 -0
- package/dist/story/addons.d.ts +1 -1
- package/dist/story/analytics.d.ts +7 -0
- package/dist/story/auto-stories.d.ts +1 -1
- package/dist/story/bookmarks.d.ts +4 -0
- package/dist/story/collect/analyzer.d.ts +1 -1
- package/dist/story/collect/index.d.ts +4 -4
- package/dist/story/collect/parser.d.ts +1 -1
- package/dist/story/collect/scanner.d.ts +1 -1
- package/dist/story/collect/tree.d.ts +1 -1
- package/dist/story/commands/index.d.ts +6 -6
- package/dist/story/compiled-output.d.ts +1 -1
- package/dist/story/composition.d.ts +1 -1
- package/dist/story/config-watcher.d.ts +1 -1
- package/dist/story/config.d.ts +1 -1
- package/dist/story/context.d.ts +1 -1
- package/dist/story/controls/index.d.ts +2 -1
- package/dist/story/desktop-preview.d.ts +1 -1
- package/dist/story/docs-generator.d.ts +1 -1
- package/dist/story/figma-export.d.ts +1 -1
- package/dist/story/generator.d.ts +1 -1
- package/dist/story/index.d.ts +41 -41
- package/dist/story/interactions.d.ts +1 -1
- package/dist/story/output.d.ts +1 -0
- package/dist/story/performance.d.ts +9 -0
- package/dist/story/presets.d.ts +5 -0
- package/dist/story/props-validation.d.ts +1 -1
- package/dist/story/renderer.d.ts +1 -1
- package/dist/story/search-index.d.ts +1 -1
- package/dist/story/search.d.ts +1 -1
- package/dist/story/server.d.ts +1 -1
- package/dist/story/setup.d.ts +1 -1
- package/dist/story/snapshots.d.ts +1 -1
- package/dist/story/testing.d.ts +1 -1
- package/dist/story/theme.d.ts +1 -1
- package/dist/story/ts-css.d.ts +1 -1
- package/dist/story/ui/code-panel.d.ts +1 -1
- package/dist/story/ui/controls-panel.d.ts +1 -1
- package/dist/story/ui/index.d.ts +4 -4
- package/dist/story/ui/preview.d.ts +1 -1
- package/dist/story/visual-testing.d.ts +1 -1
- package/dist/streaming.d.ts +1 -1
- package/dist/stx-module-imports.d.ts +2 -1
- package/dist/stx-virtual-ts.d.ts +3 -2
- package/dist/temp-dir.d.ts +1 -0
- package/dist/template-compiler.d.ts +1 -1
- package/dist/template-hydrator.d.ts +1 -1
- package/dist/testing.d.ts +35 -66
- package/dist/theme-tokens.d.ts +5 -1
- package/dist/ts-css-config.d.ts +1 -0
- package/dist/type-checker.d.ts +24 -0
- package/dist/typecheck.d.ts +4 -4
- package/dist/types/config-types.d.ts +17 -17
- package/dist/types/context-types.d.ts +1 -1
- package/dist/types/directive-types.d.ts +2 -1
- package/dist/types/index.d.ts +7 -7
- package/dist/types.d.ts +1 -1
- package/dist/utils.d.ts +5 -5
- package/dist/variable-extractor.d.ts +1 -1
- package/dist/visual-editor.d.ts +0 -4
- package/dist/web-components/index.d.ts +4 -4
- package/dist/web-components/reactive-generator.d.ts +1 -1
- package/dist/web-components.d.ts +1 -1
- package/package.json +11 -7
- package/stx.d.ts +6 -5
- package/dist/chunk-0dve54ne.js +0 -3
- package/dist/chunk-0g05v7m1.js +0 -2
- package/dist/chunk-14vv64pw.js +0 -2
- package/dist/chunk-1mqyt33c.js +0 -2
- package/dist/chunk-1qdhwjs4.js +0 -2
- package/dist/chunk-332qk8tm.js +0 -3
- package/dist/chunk-3gyq9rjx.js +0 -2
- package/dist/chunk-3w9xhs7k.js +0 -2
- package/dist/chunk-47z5w330.js +0 -2
- package/dist/chunk-4e5wynb4.js +0 -2
- package/dist/chunk-4e6wkjtx.js +0 -2
- package/dist/chunk-4hfh5ety.js +0 -2
- package/dist/chunk-67bn31a3.js +0 -2
- package/dist/chunk-6amqskpv.js +0 -2
- package/dist/chunk-6ra9dqs2.js +0 -2
- package/dist/chunk-7hnt9a2e.js +0 -2
- package/dist/chunk-80bb89fh.js +0 -2
- package/dist/chunk-8f5dy08a.js +0 -2
- package/dist/chunk-8k6cd1e0.js +0 -2
- package/dist/chunk-a69v31q8.js +0 -2
- package/dist/chunk-a7v1j7td.js +0 -2
- package/dist/chunk-acbx3jn5.js +0 -2
- package/dist/chunk-apq33h4w.js +0 -2
- package/dist/chunk-c90qz5w0.js +0 -2
- package/dist/chunk-dqrkteav.js +0 -2
- package/dist/chunk-dx31vsyf.js +0 -2
- package/dist/chunk-epqp6mmn.js +0 -2
- package/dist/chunk-et9fyzf6.js +0 -2
- package/dist/chunk-f4x21pqx.js +0 -2
- package/dist/chunk-fhd8e4mq.js +0 -2
- package/dist/chunk-frhh6jd3.js +0 -2
- package/dist/chunk-ft43rx62.js +0 -2
- package/dist/chunk-g1gqysb4.js +0 -2
- package/dist/chunk-h7rcb74n.js +0 -2
- package/dist/chunk-j3x3e353.js +0 -2
- package/dist/chunk-j415w6dm.js +0 -2
- package/dist/chunk-ja5ghh0f.js +0 -2
- package/dist/chunk-jmjz23rf.js +0 -2
- package/dist/chunk-k1pyzf9e.js +0 -2
- package/dist/chunk-m276y4f3.js +0 -2
- package/dist/chunk-p9sbpbhg.js +0 -2
- package/dist/chunk-pd0wdjqd.js +0 -2
- package/dist/chunk-ptppavv8.js +0 -2
- package/dist/chunk-q2d8x7p1.js +0 -2
- package/dist/chunk-s922rk4n.js +0 -2
- package/dist/chunk-tdtwqydq.js +0 -2
- package/dist/chunk-v4kqxe8a.js +0 -2
- package/dist/chunk-vffwkmt4.js +0 -2
- package/dist/chunk-vqr3hn16.js +0 -2
- package/dist/chunk-x1c1aggq.js +0 -2
- package/dist/chunk-xkvzg640.js +0 -2
- package/dist/chunk-xt7qsgk4.js +0 -2
- package/dist/chunk-ydjy26ch.js +0 -2
- package/dist/chunk-yq12dhnt.js +0 -2
- package/dist/chunk-yx37mvy7.js +0 -2
- package/dist/chunk-z278w3cb.js +0 -2
- package/dist/chunk-z5z6442j.js +0 -2
- package/dist/chunk-znfzh6fm.js +0 -2
package/dist/plugin-system.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomDirective, StxOptions } from './types';
|
|
1
|
+
import type { CustomDirective, StxOptions } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Define an stx plugin with type safety.
|
|
4
4
|
*
|
|
@@ -135,6 +135,9 @@ export type DirectivePhase = | 'comments'
|
|
|
135
135
|
* Plugin manager that handles registration, lifecycle, and execution
|
|
136
136
|
*/
|
|
137
137
|
export declare class PluginManager {
|
|
138
|
+
private plugins;
|
|
139
|
+
private sortedPlugins;
|
|
140
|
+
private initialized;
|
|
138
141
|
register(plugin: StxPlugin, options: StxOptions): Promise<void>;
|
|
139
142
|
unregister(name: string): Promise<boolean>;
|
|
140
143
|
get(name: string): StxPlugin | undefined;
|
|
@@ -149,4 +152,7 @@ export declare class PluginManager {
|
|
|
149
152
|
runBeforeRender(ctx: PluginContext): Promise<PluginContext>;
|
|
150
153
|
runAfterRender(ctx: PluginContext): Promise<PluginContext>;
|
|
151
154
|
runOnError(ctx: PluginErrorContext): Promise<PluginContext | null>;
|
|
155
|
+
private sortPlugins;
|
|
156
|
+
private runHooks;
|
|
157
|
+
private runDirectiveHooks;
|
|
152
158
|
}
|
package/dist/precompiler.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SourceMapV3 } from './source-maps';
|
|
1
|
+
import type { SourceMapV3 } from './source-maps.js';
|
|
2
2
|
// Export singleton instance
|
|
3
3
|
export declare const compiler: TemplateCompiler;
|
|
4
4
|
/**
|
|
@@ -37,7 +37,38 @@ export type CompileMode = 'ssr' | 'client' | 'universal';
|
|
|
37
37
|
* Template pre-compiler
|
|
38
38
|
*/
|
|
39
39
|
export declare class TemplateCompiler {
|
|
40
|
+
private parser;
|
|
40
41
|
constructor();
|
|
41
42
|
compile(template: string, options?: CompileOptions): CompileResult;
|
|
42
43
|
compileFile(filePath: string, options?: CompileOptions): Promise<CompileResult>;
|
|
44
|
+
private createContext;
|
|
45
|
+
private generateRenderFunction;
|
|
46
|
+
private analyzeAST;
|
|
47
|
+
private generateNode;
|
|
48
|
+
private generateText;
|
|
49
|
+
private generateExpression;
|
|
50
|
+
private generateDirective;
|
|
51
|
+
private generateIf;
|
|
52
|
+
private generateUnless;
|
|
53
|
+
private generateForeach;
|
|
54
|
+
private generateFor;
|
|
55
|
+
private generateWhile;
|
|
56
|
+
private generateIsset;
|
|
57
|
+
private generateEmpty;
|
|
58
|
+
private generateAuth;
|
|
59
|
+
private generateGuest;
|
|
60
|
+
private generateEnv;
|
|
61
|
+
private generateSwitch;
|
|
62
|
+
private generateSlot;
|
|
63
|
+
private generateSection;
|
|
64
|
+
private generatePush;
|
|
65
|
+
private generateOnce;
|
|
66
|
+
private generateScript;
|
|
67
|
+
private generateStyle;
|
|
68
|
+
private generateElement;
|
|
69
|
+
private generateAttribute;
|
|
70
|
+
private parseAttributeValue;
|
|
71
|
+
private generateComponent;
|
|
72
|
+
private splitConditionalBody;
|
|
73
|
+
private wrapModule;
|
|
43
74
|
}
|
package/dist/process.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { processJsonDirective, processOnceDirective } from './misc-directives';
|
|
2
|
-
import { validateClientScript } from './script-validation';
|
|
3
|
-
import type { StxOptions } from './types';
|
|
1
|
+
import { processJsonDirective, processOnceDirective } from './misc-directives.js';
|
|
2
|
+
import { validateClientScript } from './script-validation.js';
|
|
3
|
+
import type { StxOptions } from './types.js';
|
|
4
4
|
export declare function buildModulesTag(sources: Array<string | null>, options: StxOptions, dependencies?: Set<string>, built?: { code?: string, inputs?: string[] }): Promise<string | null>;
|
|
5
5
|
export declare function processDirectives(template: string, context: Record<string, any>, filePath: string, options: StxOptions, dependencies: Set<string>): Promise<string>;
|
|
6
6
|
// Re-export public API from extracted modules (preserves backwards compatibility)
|
|
7
|
-
export { injectRouterScript } from './runtime-injection';
|
|
8
|
-
export { processJsonDirective, processOnceDirective } from './misc-directives';
|
|
9
|
-
export { validateClientScript } from './script-validation';
|
|
7
|
+
export { injectRouterScript } from './runtime-injection.js';
|
|
8
|
+
export { processJsonDirective, processOnceDirective } from './misc-directives.js';
|
|
9
|
+
export { validateClientScript } from './script-validation.js';
|
|
@@ -158,6 +158,42 @@ export declare interface AssetInfo {
|
|
|
158
158
|
* Production Build orchestrator
|
|
159
159
|
*/
|
|
160
160
|
export declare class ProductionBuild {
|
|
161
|
+
private config;
|
|
162
|
+
private startTime;
|
|
163
|
+
private outputs;
|
|
164
|
+
private chunks;
|
|
165
|
+
private assets;
|
|
166
|
+
private warnings;
|
|
167
|
+
private errors;
|
|
168
|
+
private moduleGraph;
|
|
169
|
+
private assetHashes;
|
|
161
170
|
constructor(config: ProductionBuildConfig);
|
|
162
171
|
build(): Promise<BuildResult>;
|
|
172
|
+
private collectEntries;
|
|
173
|
+
private buildEntry;
|
|
174
|
+
private resolveRelativePath;
|
|
175
|
+
private processTemplate;
|
|
176
|
+
private processCss;
|
|
177
|
+
private processScript;
|
|
178
|
+
private extractCss;
|
|
179
|
+
private processAssets;
|
|
180
|
+
private performCodeSplitting;
|
|
181
|
+
private minifyOutputs;
|
|
182
|
+
private minifyJs;
|
|
183
|
+
private minifyCss;
|
|
184
|
+
private minifyHtml;
|
|
185
|
+
private generateSourceMaps;
|
|
186
|
+
private fingerprintAssets;
|
|
187
|
+
private compressOutputs;
|
|
188
|
+
private analyzeBundle;
|
|
189
|
+
private generateAnalysisHtml;
|
|
190
|
+
private generateAnalysisText;
|
|
191
|
+
private runPluginHook;
|
|
192
|
+
private runPluginTransform;
|
|
193
|
+
private generateHash;
|
|
194
|
+
private getOutputName;
|
|
195
|
+
private formatSize;
|
|
196
|
+
private ensureDir;
|
|
197
|
+
private walkDir;
|
|
198
|
+
private getResult;
|
|
163
199
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ManifestAssets } from './manifest';
|
|
2
|
-
import { type RouteRules } from './route-rules';
|
|
3
|
-
import { type ServerApiOptions } from './server-api';
|
|
1
|
+
import { type ManifestAssets } from './manifest.js';
|
|
2
|
+
import { type RouteRules } from './route-rules.js';
|
|
3
|
+
import { type ServerApiOptions } from './server-api.js';
|
|
4
4
|
/**
|
|
5
5
|
* Build the stx application for production.
|
|
6
6
|
*
|
package/dist/pwa/audit.d.ts
CHANGED
package/dist/pwa/directives.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import type { CustomDirective } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Generate install button HTML and JavaScript
|
|
4
|
-
*/
|
|
5
|
-
declare function generateInstallButton(content: string, options: StxOptions): string;
|
|
6
|
-
/**
|
|
7
|
-
* Generate update prompt HTML and JavaScript
|
|
8
|
-
*/
|
|
9
|
-
declare function generateUpdatePrompt(content: string, options: StxOptions): string;
|
|
10
|
-
/**
|
|
11
|
-
* Generate offline indicator HTML and JavaScript
|
|
12
|
-
*/
|
|
13
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
14
|
-
declare function generateOfflineIndicator(content: string, options: StxOptions): string;
|
|
15
|
-
/**
|
|
16
|
-
* Generate push subscribe button HTML and JavaScript
|
|
17
|
-
*/
|
|
18
|
-
declare function generatePushSubscribe(content: string, options: StxOptions): string;
|
|
1
|
+
import type { CustomDirective } from '../types.js';
|
|
19
2
|
/**
|
|
20
3
|
* Register all PWA directives with the config
|
|
21
4
|
*/
|
package/dist/pwa/icons.d.ts
CHANGED
package/dist/pwa/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export {
|
|
|
24
24
|
generateServiceWorkerAuto,
|
|
25
25
|
getServiceWorkerFileName,
|
|
26
26
|
isWorkboxEnabled,
|
|
27
|
-
} from './service-worker';
|
|
27
|
+
} from './service-worker.js';
|
|
28
28
|
// ============================================================================
|
|
29
29
|
// Workbox Integration
|
|
30
30
|
// ============================================================================
|
|
@@ -36,7 +36,7 @@ export {
|
|
|
36
36
|
type WorkboxConfig,
|
|
37
37
|
type WorkboxModule,
|
|
38
38
|
type RuntimeCacheRule,
|
|
39
|
-
} from './workbox';
|
|
39
|
+
} from './workbox.js';
|
|
40
40
|
export {
|
|
41
41
|
mapStrategyToWorkbox,
|
|
42
42
|
getWorkboxStrategyName,
|
|
@@ -52,20 +52,20 @@ export {
|
|
|
52
52
|
type WorkboxPlugin,
|
|
53
53
|
type WorkboxRoute,
|
|
54
54
|
type RuntimeCachingConfig,
|
|
55
|
-
} from './workbox-strategies';
|
|
55
|
+
} from './workbox-strategies.js';
|
|
56
56
|
// ============================================================================
|
|
57
57
|
// Manifest
|
|
58
58
|
// ============================================================================
|
|
59
59
|
export {
|
|
60
60
|
generateManifest,
|
|
61
|
-
} from './manifest';
|
|
61
|
+
} from './manifest.js';
|
|
62
62
|
// ============================================================================
|
|
63
63
|
// Icons
|
|
64
64
|
// ============================================================================
|
|
65
65
|
export {
|
|
66
66
|
generatePwaIcons,
|
|
67
67
|
type IconGenerationResult,
|
|
68
|
-
} from './icons';
|
|
68
|
+
} from './icons.js';
|
|
69
69
|
// ============================================================================
|
|
70
70
|
// Precache
|
|
71
71
|
// ============================================================================
|
|
@@ -74,20 +74,20 @@ export {
|
|
|
74
74
|
generatePrecacheManifestJs,
|
|
75
75
|
formatSize,
|
|
76
76
|
type PrecacheEntry,
|
|
77
|
-
} from './precache';
|
|
77
|
+
} from './precache.js';
|
|
78
78
|
// ============================================================================
|
|
79
79
|
// Offline
|
|
80
80
|
// ============================================================================
|
|
81
81
|
export {
|
|
82
82
|
generateOfflinePage,
|
|
83
|
-
} from './offline';
|
|
83
|
+
} from './offline.js';
|
|
84
84
|
// ============================================================================
|
|
85
85
|
// Injection
|
|
86
86
|
// ============================================================================
|
|
87
87
|
export {
|
|
88
88
|
injectPwaTags,
|
|
89
89
|
generateSwRegistrationScript,
|
|
90
|
-
} from './inject';
|
|
90
|
+
} from './inject.js';
|
|
91
91
|
// ============================================================================
|
|
92
92
|
// Audit
|
|
93
93
|
// ============================================================================
|
|
@@ -95,10 +95,10 @@ export {
|
|
|
95
95
|
runPwaAudit,
|
|
96
96
|
type AuditResult,
|
|
97
97
|
type AuditCheck,
|
|
98
|
-
} from './audit';
|
|
98
|
+
} from './audit.js';
|
|
99
99
|
// ============================================================================
|
|
100
100
|
// Directives
|
|
101
101
|
// ============================================================================
|
|
102
102
|
export {
|
|
103
103
|
pwaDirectives,
|
|
104
|
-
} from './directives';
|
|
104
|
+
} from './directives.js';
|
package/dist/pwa/inject.d.ts
CHANGED
package/dist/pwa/manifest.d.ts
CHANGED
package/dist/pwa/offline.d.ts
CHANGED
package/dist/pwa/precache.d.ts
CHANGED
package/dist/pwa/workbox.d.ts
CHANGED
package/dist/pwa.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference path="./stx.d.ts" />
|
|
2
|
-
import type { StxOptions } from './types';
|
|
2
|
+
import type { StxOptions } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Build all PWA assets
|
|
5
5
|
*
|
|
@@ -42,11 +42,11 @@ export declare interface PwaBuildResult {
|
|
|
42
42
|
totalSize: number
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
export * from './pwa/audit';
|
|
46
|
-
export * from './pwa/directives';
|
|
47
|
-
export * from './pwa/icons';
|
|
48
|
-
export * from './pwa/inject';
|
|
49
|
-
export * from './pwa/manifest';
|
|
50
|
-
export * from './pwa/offline';
|
|
51
|
-
export * from './pwa/precache';
|
|
52
|
-
export * from './pwa/service-worker';
|
|
45
|
+
export * from './pwa/audit.js';
|
|
46
|
+
export * from './pwa/directives.js';
|
|
47
|
+
export * from './pwa/icons.js';
|
|
48
|
+
export * from './pwa/inject.js';
|
|
49
|
+
export * from './pwa/manifest.js';
|
|
50
|
+
export * from './pwa/offline.js';
|
|
51
|
+
export * from './pwa/precache.js';
|
|
52
|
+
export * from './pwa/service-worker.js';
|
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{so,Ut,
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{so,Ut,Al,Mg}from"./chunk-ctb1bj28.js";import{ro,ji,Ig,Og,Ng}from"./chunk-33ph9zb2.js";import{Tl,$l,Rl,Ag,Pg}from"./chunk-j2wcawmf.js";import{We,Pn,Bi}from"./chunk-krtkxnz6.js";import{Dg,Lg,jg,Bg,oo,ky}from"./chunk-fhrvxfq9.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-28r4jyvj.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=so(n,t);if(a){let s=Ut(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return ji(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=so(n,t);if(a){let s=Ut(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return ji(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,$l as auditBuildOutput,Tl as auditConfig,re as buildPwaAssets,Rl as calculateAuditResult,Pg as formatAuditResult,Bi as formatSize,j as generateManifest,_ as generateManifestJson,Og as generateManifestLink,F as generateOfflinePage,We as generatePrecacheManifest,Pn as generatePrecacheManifestJs,M as generatePwaIcons,ro as generatePwaTags,so as generateServiceWorker,Mg as generateServiceWorkerAuto,Ig as generateSwRegistrationScript,Ng as generateThemeColorMeta,N as getExpectedIconPaths,Ut as getServiceWorkerFileName,ji as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Al as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,oo as pwaDirectives,Dg as pwaInstallDirective,jg as pwaOfflineDirective,Bg as pwaPushDirective,Lg as pwaUpdateDirective,ky as registerPwaDirectives,Ag as runPwaAudit,D as validateManifest};
|
package/dist/render-memo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LRUCache } from './performance-utils';
|
|
1
|
+
import { LRUCache } from './performance-utils.js';
|
|
2
2
|
/** A bounded memo that `clearRenderMemos` knows about. */
|
|
3
3
|
export declare function renderMemo<V>(maxSize: number): LRUCache<string, V>;
|
|
4
4
|
/** Forget everything. Wired into `clearDevCaches`. */
|
package/dist/render.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type { RouteCacheRule } from './route-rules';
|
|
1
|
+
import type { RouteCacheRule } from './route-rules.js';
|
|
2
2
|
/** Process-local, bounded origin cache; never caches actions or personalized responses. */
|
|
3
3
|
export declare class RouteResponseCache {
|
|
4
|
+
private entries;
|
|
5
|
+
private pending;
|
|
6
|
+
private generation;
|
|
7
|
+
private now;
|
|
4
8
|
constructor(now?: () => number);
|
|
5
9
|
invalidate(pathname?: string): void;
|
|
6
10
|
respond(request: Request, policy: RouteCacheRule | false | undefined, render: () => Promise<Response>): Promise<Response>;
|
package/dist/route-types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RuntimeConfigDefaults } from './runtime-config-server';
|
|
1
|
+
import { type RuntimeConfigDefaults } from './runtime-config-server.js';
|
|
2
2
|
/** Also supports hosts that extract server scripts before processDirectives. */
|
|
3
3
|
export declare function prepareRuntimeConfig(context: Record<string, any>, filePath: string, defaults?: RuntimeConfigDefaults): Promise<void>;
|
|
4
4
|
/** Emit literal types only; client declarations never reference private keys. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PublicRuntimeConfig } from './runtime-config';
|
|
1
|
+
import type { PublicRuntimeConfig } from './runtime-config.js';
|
|
2
2
|
export declare function withRuntimeConfig<T>(config: ResolvedRuntimeConfig, run: () => T): T;
|
|
3
3
|
export declare function currentRuntimeConfig(): ResolvedRuntimeConfig | undefined;
|
|
4
4
|
export declare function useServerRuntimeConfig(): Readonly<{ public: PublicRuntimeConfig, private: PrivateRuntimeConfig }>;
|
|
@@ -8,9 +8,6 @@ export declare function useRuntimeConfig(): Readonly<PublicRuntimeConfig>;
|
|
|
8
8
|
export declare function resolveRuntimeConfig(defaults?: RuntimeConfigDefaults, env?: Record<string, string | undefined>): ResolvedRuntimeConfig;
|
|
9
9
|
export declare function runtimeConfigTag(config: ResolvedRuntimeConfig): string;
|
|
10
10
|
export declare function injectRuntimeConfig(html: string, config: ResolvedRuntimeConfig): string;
|
|
11
|
-
// Endpoint bundles and the host must share the SAME async context, not copies
|
|
12
|
-
// of an AsyncLocalStorage instance produced by separate bundler invocations.
|
|
13
|
-
declare const key: symbol;
|
|
14
11
|
export declare interface RuntimeConfigDefaults {
|
|
15
12
|
public?: Record<string, RuntimeConfigValue>
|
|
16
13
|
private?: Record<string, RuntimeConfigValue>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { RuntimeConfigDefaults } from './runtime-config-server';
|
|
2
|
-
export type { PublicRuntimeConfig } from './runtime-config';
|
|
1
|
+
export type { RuntimeConfigDefaults } from './runtime-config-server.js';
|
|
2
|
+
export type { PublicRuntimeConfig } from './runtime-config.js';
|
package/dist/safe-evaluator.d.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe expression evaluator that reduces security risks from using new Function()
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Safe evaluator configuration options
|
|
6
|
-
*/
|
|
7
|
-
export interface SafeEvaluatorConfig {
|
|
8
|
-
/** Maximum depth for object sanitization (default: 10) */
|
|
9
|
-
maxSanitizeDepth: number;
|
|
10
|
-
/**
|
|
11
|
-
* Allow bracket notation with string literals like `obj["key"]` (default: false).
|
|
12
|
-
*
|
|
13
|
-
* SECURITY WARNING: Enabling bracket notation broadens the attack surface.
|
|
14
|
-
* Bracket notation can access properties that dot-notation filters block
|
|
15
|
-
* (e.g. `obj["__proto__"]`, `obj["constructor"]`), and a dynamic key path
|
|
16
|
-
* assembled at runtime (`obj[userInput]`) cannot be statically proven safe.
|
|
17
|
-
* Only enable when all bracket keys are known string literals authored by
|
|
18
|
-
* the template writer — never based on untrusted input.
|
|
19
|
-
*/
|
|
20
|
-
allowBracketNotation: boolean;
|
|
21
|
-
}
|
|
22
1
|
/**
|
|
23
2
|
* Configure the safe evaluator
|
|
24
3
|
*
|
|
@@ -39,17 +18,6 @@ export declare function resetSafeEvaluatorConfig(): void;
|
|
|
39
18
|
* Get current configuration
|
|
40
19
|
*/
|
|
41
20
|
export declare function getSafeEvaluatorConfig(): SafeEvaluatorConfig;
|
|
42
|
-
/**
|
|
43
|
-
* Thrown when an expression breaks the evaluator's security policy.
|
|
44
|
-
*
|
|
45
|
-
* `rule` names what rejected it, on its own, so a caller reporting the failure
|
|
46
|
-
* can say why without re-parsing the message.
|
|
47
|
-
*/
|
|
48
|
-
export declare class UnsafeExpressionError extends Error {
|
|
49
|
-
readonly rule: string;
|
|
50
|
-
readonly expression: string;
|
|
51
|
-
constructor(rule: string, expression: string, message?: string);
|
|
52
|
-
}
|
|
53
21
|
/**
|
|
54
22
|
* The rule an expression breaks, or `null` when it is safe to evaluate.
|
|
55
23
|
*
|
|
@@ -61,25 +29,6 @@ export declare function getExpressionSafetyRule(expression: string): string | nu
|
|
|
61
29
|
* Sanitize an expression by checking for dangerous patterns
|
|
62
30
|
*/
|
|
63
31
|
export declare function sanitizeExpression(expression: string): string;
|
|
64
|
-
/**
|
|
65
|
-
* Create a safer context object that only exposes safe properties
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* Where a loop keeps the sanitized copies of the objects its iterations share.
|
|
69
|
-
*
|
|
70
|
-
* Every condition and expression builds a safe context, and building one deep-
|
|
71
|
-
* copies each object in scope. Inside `@foreach` that scope is the page's: an
|
|
72
|
-
* `@if` per row of a 2,287-file commit copied the commit - all 2,287 files of
|
|
73
|
-
* it - once per row, five million objects for one page and eight seconds of a
|
|
74
|
-
* server that does nothing else meanwhile (ReviewOS, 2026-10-20). The rows
|
|
75
|
-
* share those objects, so a loop keeps one copy of each for its duration.
|
|
76
|
-
*
|
|
77
|
-
* A symbol, so it rides along in `{ ...context }` to nested loops and stays out
|
|
78
|
-
* of `Object.entries`, which is what reaches templates. Scoped to the loop
|
|
79
|
-
* rather than the process, so an object changed between requests is never
|
|
80
|
-
* served from an old copy.
|
|
81
|
-
*/
|
|
82
|
-
export declare const SANITIZE_CACHE: unique symbol;
|
|
83
32
|
export declare function createSafeContext(context: Record<string, unknown>): Record<string, unknown>;
|
|
84
33
|
/**
|
|
85
34
|
* Safely evaluate an expression with the given context
|
|
@@ -144,10 +93,7 @@ export declare function safeEvaluateObject(expression: string, context: Record<s
|
|
|
144
93
|
* code and had to be retried. Zero mismatches on a correct runtime; a non-zero
|
|
145
94
|
* count is the runtime bug above happening, and being caught.
|
|
146
95
|
*/
|
|
147
|
-
export declare function compileVerificationStats(): {
|
|
148
|
-
compiles: number;
|
|
149
|
-
mismatches: number;
|
|
150
|
-
};
|
|
96
|
+
export declare function compileVerificationStats(): { compiles: number, mismatches: number };
|
|
151
97
|
export declare function compileVerified(params: readonly string[], body: string): (...args: unknown[]) => unknown;
|
|
152
98
|
/**
|
|
153
99
|
* The variables an expression actually reads from its surrounding scope.
|
|
@@ -207,3 +153,40 @@ export declare function isForExpressionSafe(expression: string): boolean;
|
|
|
207
153
|
* @returns A function that executes the loop safely
|
|
208
154
|
*/
|
|
209
155
|
export declare function createSafeLoopFunction(loopType: 'for' | 'while', expression: string, body: string, contextKeys: string[], maxIterations?: number): (...args: unknown[]) => string;
|
|
156
|
+
/**
|
|
157
|
+
* Create a safer context object that only exposes safe properties
|
|
158
|
+
*/
|
|
159
|
+
/**
|
|
160
|
+
* Where a loop keeps the sanitized copies of the objects its iterations share.
|
|
161
|
+
*
|
|
162
|
+
* Every condition and expression builds a safe context, and building one deep-
|
|
163
|
+
* copies each object in scope. Inside `@foreach` that scope is the page's: an
|
|
164
|
+
* `@if` per row of a 2,287-file commit copied the commit - all 2,287 files of
|
|
165
|
+
* it - once per row, five million objects for one page and eight seconds of a
|
|
166
|
+
* server that does nothing else meanwhile (ReviewOS, 2026-10-20). The rows
|
|
167
|
+
* share those objects, so a loop keeps one copy of each for its duration.
|
|
168
|
+
*
|
|
169
|
+
* A symbol, so it rides along in `{ ...context }` to nested loops and stays out
|
|
170
|
+
* of `Object.entries`, which is what reaches templates. Scoped to the loop
|
|
171
|
+
* rather than the process, so an object changed between requests is never
|
|
172
|
+
* served from an old copy.
|
|
173
|
+
*/
|
|
174
|
+
export declare const SANITIZE_CACHE: unique symbol;
|
|
175
|
+
/**
|
|
176
|
+
* Safe evaluator configuration options
|
|
177
|
+
*/
|
|
178
|
+
export declare interface SafeEvaluatorConfig {
|
|
179
|
+
maxSanitizeDepth: number
|
|
180
|
+
allowBracketNotation: boolean
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Thrown when an expression breaks the evaluator's security policy.
|
|
184
|
+
*
|
|
185
|
+
* `rule` names what rejected it, on its own, so a caller reporting the failure
|
|
186
|
+
* can say why without re-parsing the message.
|
|
187
|
+
*/
|
|
188
|
+
export declare class UnsafeExpressionError extends Error {
|
|
189
|
+
readonly rule: string;
|
|
190
|
+
readonly expression: string;
|
|
191
|
+
constructor(rule: string, expression: string, message?: string);
|
|
192
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StrictModeConfig } from './types';
|
|
1
|
+
import type { StrictModeConfig } from './types.js';
|
|
2
2
|
/** Rules suppressed per 1-based line. An empty set means "every rule". */
|
|
3
3
|
export declare function parseStrictIgnores(content: string): Map<number, Set<string>>;
|
|
4
4
|
export declare function validateClientScript(content: string, filePath: string, strict?: boolean | StrictModeConfig, originFilePath?: string): void;
|
package/dist/seo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomDirective, StxOptions } from './types';
|
|
1
|
+
import type { CustomDirective, StxOptions } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Process `@meta(...)` and `@metaTag({...})` in place, emitting the tags where
|
|
4
4
|
* the directives sit.
|
|
@@ -10,14 +10,6 @@ import type { CustomDirective, StxOptions } from './types';
|
|
|
10
10
|
* `@meta('og:title', post.title)`, and the one-argument `@meta('og:title')`.
|
|
11
11
|
*/
|
|
12
12
|
export declare function processMetaDirectives(template: string, context: Record<string, any>, filePath: string, _options: StxOptions): string;
|
|
13
|
-
/**
|
|
14
|
-
* The JSON-LD `<script>` for `data`.
|
|
15
|
-
*
|
|
16
|
-
* `</` is escaped so a value containing `</script>` cannot close the block and
|
|
17
|
-
* open markup of its own; `</` would do too, but `<\/` is what every
|
|
18
|
-
* existing page already ships.
|
|
19
|
-
*/
|
|
20
|
-
declare function jsonLdScript(data: unknown): string;
|
|
21
13
|
/**
|
|
22
14
|
* Process `@structuredData(...)` for JSON-LD.
|
|
23
15
|
*
|
package/dist/serve.d.ts
CHANGED