@awacloud/fw 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/LICENSE +176 -0
- package/NOTICE +12 -0
- package/README.md +355 -0
- package/dist/build/fw.core.pure.meta.json +29 -0
- package/dist/build/fw.core.pure.min.js +26 -0
- package/dist/build/fw.full.pure.meta.json +224 -0
- package/dist/build/fw.full.pure.min.js +60 -0
- package/dist/build/fw.minimal.pure.meta.json +21 -0
- package/dist/build/fw.minimal.pure.min.js +26 -0
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +29 -0
- package/dist/build/fw.pack.compress-heavy.pure.min.js +8 -0
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +38 -0
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-basic.pure.min.js +6 -0
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +29 -0
- package/dist/build/fw.pack.crypto-identity.pure.min.js +9 -0
- package/dist/build/fw.pack.realtime.pure.meta.json +21 -0
- package/dist/build/fw.pack.realtime.pure.min.js +6 -0
- package/dist/build/fw.pack.sensors.pure.meta.json +21 -0
- package/dist/build/fw.pack.sensors.pure.min.js +6 -0
- package/dist/build/fw.pack.structures-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.structures-advanced.pure.min.js +6 -0
- package/dist/build/fw.pack.text-advanced.pure.meta.json +20 -0
- package/dist/build/fw.pack.text-advanced.pure.min.js +6 -0
- package/dist/build/fw.pwa.pure.meta.json +127 -0
- package/dist/build/fw.pwa.pure.min.js +55 -0
- package/dist/build/fw.site-interactive.pure.meta.json +81 -0
- package/dist/build/fw.site-interactive.pure.min.js +52 -0
- package/dist/build/fw.site.pure.meta.json +51 -0
- package/dist/build/fw.site.pure.min.js +35 -0
- package/dist/build/fw.spa.pure.meta.json +108 -0
- package/dist/build/fw.spa.pure.min.js +55 -0
- package/dist/build/io/compress/brotli_dict.bin +432 -0
- package/dist/build/sanity-base-classic.min.js +6 -0
- package/dist/build/sanity-community-classic.min.js +6 -0
- package/dist/build/sanity.min.js +6 -0
- package/dist/types/core/logger.d.ts +71 -0
- package/dist/types/core/logger.d.ts.map +1 -0
- package/dist/types/core/modules.d.ts +3962 -0
- package/dist/types/core/modules.d.ts.map +1 -0
- package/dist/types/core/readyState.d.ts +14 -0
- package/dist/types/core/readyState.d.ts.map +1 -0
- package/dist/types/core/runtime.d.ts +625 -0
- package/dist/types/core/runtime.d.ts.map +1 -0
- package/dist/types/core/worker-helper.d.ts +153 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -0
- package/dist/types/crypto/cipher/aes.d.ts +55 -0
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -0
- package/dist/types/crypto/cipher/chacha20.d.ts +33 -0
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -0
- package/dist/types/crypto/hash/adf.d.ts +65 -0
- package/dist/types/crypto/hash/adf.d.ts.map +1 -0
- package/dist/types/crypto/hash/argon2.d.ts +79 -0
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -0
- package/dist/types/crypto/hash/blake2b.d.ts +40 -0
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/hash/hkdf.d.ts +88 -0
- package/dist/types/crypto/hash/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/hash/hmac.d.ts +85 -0
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts +80 -0
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/hash/poly1305.d.ts +31 -0
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha224.d.ts +80 -0
- package/dist/types/crypto/hash/sha224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha256.d.ts +82 -0
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha3.d.ts +111 -0
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha384.d.ts +84 -0
- package/dist/types/crypto/hash/sha384.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512.d.ts +87 -0
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_224.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_224.d.ts.map +1 -0
- package/dist/types/crypto/hash/sha512_256.d.ts +84 -0
- package/dist/types/crypto/hash/sha512_256.d.ts.map +1 -0
- package/dist/types/crypto/mode/cbc.d.ts +38 -0
- package/dist/types/crypto/mode/cbc.d.ts.map +1 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts +71 -0
- package/dist/types/crypto/mode/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/mode/cmac.d.ts +56 -0
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -0
- package/dist/types/crypto/mode/ctr.d.ts +52 -0
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -0
- package/dist/types/crypto/mode/gcm.d.ts +88 -0
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -0
- package/dist/types/crypto/mode/kw.d.ts +60 -0
- package/dist/types/crypto/mode/kw.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ecc.d.ts +284 -0
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ed25519.d.ts +107 -0
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts +154 -0
- package/dist/types/crypto/pkc/hybridKem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts +383 -0
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts +174 -0
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts +194 -0
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/pkc/rsa.d.ts +175 -0
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts +232 -0
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/pkc/x25519.d.ts +37 -0
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts +84 -0
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +1 -0
- package/dist/types/crypto/utils/aes_modes.d.ts +128 -0
- package/dist/types/crypto/utils/aes_modes.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts +45 -0
- package/dist/types/crypto/utils/asn1-oid.d.ts.map +1 -0
- package/dist/types/crypto/utils/asn1.d.ts +115 -0
- package/dist/types/crypto/utils/asn1.d.ts.map +1 -0
- package/dist/types/crypto/utils/bitArray.d.ts +75 -0
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -0
- package/dist/types/crypto/utils/bn.d.ts +214 -0
- package/dist/types/crypto/utils/bn.d.ts.map +1 -0
- package/dist/types/crypto/utils/jws.d.ts +159 -0
- package/dist/types/crypto/utils/jws.d.ts.map +1 -0
- package/dist/types/crypto/utils/keyformat.d.ts +100 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -0
- package/dist/types/crypto/utils/pad.d.ts +44 -0
- package/dist/types/crypto/utils/pad.d.ts.map +1 -0
- package/dist/types/crypto/utils/pem.d.ts +41 -0
- package/dist/types/crypto/utils/pem.d.ts.map +1 -0
- package/dist/types/crypto/utils/random.d.ts +203 -0
- package/dist/types/crypto/utils/random.d.ts.map +1 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts +162 -0
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -0
- package/dist/types/crypto/utils/totp.d.ts +183 -0
- package/dist/types/crypto/utils/totp.d.ts.map +1 -0
- package/dist/types/crypto/utils/uuid.d.ts +29 -0
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -0
- package/dist/types/crypto/wasm/aes.d.ts +59 -0
- package/dist/types/crypto/wasm/aes.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +70 -0
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/blake2b.d.ts +59 -0
- package/dist/types/crypto/wasm/blake2b.d.ts.map +1 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts +43 -0
- package/dist/types/crypto/wasm/chacha20poly1305.d.ts.map +1 -0
- package/dist/types/crypto/wasm/cmac.d.ts +42 -0
- package/dist/types/crypto/wasm/cmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ecc.d.ts +56 -0
- package/dist/types/crypto/wasm/ecc.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ed25519.d.ts +52 -0
- package/dist/types/crypto/wasm/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hkdf.d.ts +40 -0
- package/dist/types/crypto/wasm/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/wasm/hmac.d.ts +42 -0
- package/dist/types/crypto/wasm/hmac.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts +48 -0
- package/dist/types/crypto/wasm/ml_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts +58 -0
- package/dist/types/crypto/wasm/ml_kem.d.ts.map +1 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts +38 -0
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/rsa.d.ts +56 -0
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/runtime.d.ts +99 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha2.d.ts +45 -0
- package/dist/types/crypto/wasm/sha2.d.ts.map +1 -0
- package/dist/types/crypto/wasm/sha3.d.ts +57 -0
- package/dist/types/crypto/wasm/sha3.d.ts.map +1 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts +62 -0
- package/dist/types/crypto/wasm/slh_dsa.d.ts.map +1 -0
- package/dist/types/crypto/wasm/x25519.d.ts +53 -0
- package/dist/types/crypto/wasm/x25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aes.d.ts +59 -0
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts +40 -0
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/digest.d.ts +43 -0
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts +51 -0
- package/dist/types/crypto/webcrypto/ecc.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/ed25519.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts +18 -0
- package/dist/types/crypto/webcrypto/hkdf.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts +43 -0
- package/dist/types/crypto/webcrypto/hmac.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts +18 -0
- package/dist/types/crypto/webcrypto/pbkdf2.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts +51 -0
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts +43 -0
- package/dist/types/crypto/webcrypto/x25519.d.ts.map +1 -0
- package/dist/types/dom/display/animate.d.ts +35 -0
- package/dist/types/dom/display/animate.d.ts.map +1 -0
- package/dist/types/dom/display/fullscreen.d.ts +59 -0
- package/dist/types/dom/display/fullscreen.d.ts.map +1 -0
- package/dist/types/dom/fs/download.d.ts +36 -0
- package/dist/types/dom/fs/download.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts +107 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -0
- package/dist/types/dom/fs/indexedDB.d.ts +62 -0
- package/dist/types/dom/fs/indexedDB.d.ts.map +1 -0
- package/dist/types/dom/fs/remoteStore.d.ts +64 -0
- package/dist/types/dom/fs/remoteStore.d.ts.map +1 -0
- package/dist/types/dom/fs/storage.d.ts +56 -0
- package/dist/types/dom/fs/storage.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/idle.d.ts +91 -0
- package/dist/types/dom/lifecycle/idle.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/visibility.d.ts +49 -0
- package/dist/types/dom/lifecycle/visibility.d.ts.map +1 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts +69 -0
- package/dist/types/dom/lifecycle/wakeLock.d.ts.map +1 -0
- package/dist/types/dom/net/ajax.d.ts +27 -0
- package/dist/types/dom/net/ajax.d.ts.map +1 -0
- package/dist/types/dom/net/broadcastChannel.d.ts +51 -0
- package/dist/types/dom/net/broadcastChannel.d.ts.map +1 -0
- package/dist/types/dom/net/network.d.ts +80 -0
- package/dist/types/dom/net/network.d.ts.map +1 -0
- package/dist/types/dom/net/sse.d.ts +72 -0
- package/dist/types/dom/net/sse.d.ts.map +1 -0
- package/dist/types/dom/net/webrtc.d.ts +149 -0
- package/dist/types/dom/net/webrtc.d.ts.map +1 -0
- package/dist/types/dom/net/ws.d.ts +70 -0
- package/dist/types/dom/net/ws.d.ts.map +1 -0
- package/dist/types/dom/query/dnd.d.ts +86 -0
- package/dist/types/dom/query/dnd.d.ts.map +1 -0
- package/dist/types/dom/query/dom.d.ts +194 -0
- package/dist/types/dom/query/dom.d.ts.map +1 -0
- package/dist/types/dom/query/events.d.ts +135 -0
- package/dist/types/dom/query/events.d.ts.map +1 -0
- package/dist/types/dom/query/gesture.d.ts +59 -0
- package/dist/types/dom/query/gesture.d.ts.map +1 -0
- package/dist/types/dom/query/media.d.ts +156 -0
- package/dist/types/dom/query/media.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts +143 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -0
- package/dist/types/dom/rendering/component.d.ts +92 -0
- package/dist/types/dom/rendering/component.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts +83 -0
- package/dist/types/dom/rendering/devtools-ui.d.ts.map +1 -0
- package/dist/types/dom/rendering/devtools.d.ts +68 -0
- package/dist/types/dom/rendering/devtools.d.ts.map +1 -0
- package/dist/types/dom/rendering/parser.d.ts +216 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts +101 -0
- package/dist/types/dom/rendering/reactiveBind.d.ts.map +1 -0
- package/dist/types/dom/rendering/render.d.ts +121 -0
- package/dist/types/dom/rendering/render.d.ts.map +1 -0
- package/dist/types/dom/rendering/sanitize.d.ts +48 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -0
- package/dist/types/dom/rendering/secPolicy.d.ts +89 -0
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +251 -0
- package/dist/types/dom/rendering/template.d.ts.map +1 -0
- package/dist/types/dom/rendering/themeTokens.d.ts +61 -0
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts +192 -0
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts +63 -0
- package/dist/types/dom/rendering/uiSession-direct.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts +205 -0
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -0
- package/dist/types/dom/rendering/uiSession.d.ts +285 -0
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts +80 -0
- package/dist/types/dom/rendering/virtualScroll.d.ts.map +1 -0
- package/dist/types/dom/sensors/battery.d.ts +71 -0
- package/dist/types/dom/sensors/battery.d.ts.map +1 -0
- package/dist/types/dom/sensors/geolocation.d.ts +83 -0
- package/dist/types/dom/sensors/geolocation.d.ts.map +1 -0
- package/dist/types/dom/sensors/networkInfo.d.ts +82 -0
- package/dist/types/dom/sensors/networkInfo.d.ts.map +1 -0
- package/dist/types/dom/sensors/sensors.d.ts +191 -0
- package/dist/types/dom/sensors/sensors.d.ts.map +1 -0
- package/dist/types/dom/sw/backgroundSync.d.ts +48 -0
- package/dist/types/dom/sw/backgroundSync.d.ts.map +1 -0
- package/dist/types/dom/sw/cache.d.ts +71 -0
- package/dist/types/dom/sw/cache.d.ts.map +1 -0
- package/dist/types/dom/sw/push.d.ts +77 -0
- package/dist/types/dom/sw/push.d.ts.map +1 -0
- package/dist/types/dom/sw/serviceWorker.d.ts +57 -0
- package/dist/types/dom/sw/serviceWorker.d.ts.map +1 -0
- package/dist/types/dom/sw/sharedWorker.d.ts +81 -0
- package/dist/types/dom/sw/sharedWorker.d.ts.map +1 -0
- package/dist/types/dom/utils/a11y.d.ts +53 -0
- package/dist/types/dom/utils/a11y.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +44 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -0
- package/dist/types/dom/utils/entropyCollector.d.ts +58 -0
- package/dist/types/dom/utils/entropyCollector.d.ts.map +1 -0
- package/dist/types/dom/utils/focus.d.ts +123 -0
- package/dist/types/dom/utils/focus.d.ts.map +1 -0
- package/dist/types/dom/utils/form.d.ts +227 -0
- package/dist/types/dom/utils/form.d.ts.map +1 -0
- package/dist/types/dom/utils/formKit.d.ts +206 -0
- package/dist/types/dom/utils/formKit.d.ts.map +1 -0
- package/dist/types/dom/utils/keybindings.d.ts +53 -0
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -0
- package/dist/types/dom/utils/leaderElection.d.ts +70 -0
- package/dist/types/dom/utils/leaderElection.d.ts.map +1 -0
- package/dist/types/dom/utils/notifications.d.ts +164 -0
- package/dist/types/dom/utils/notifications.d.ts.map +1 -0
- package/dist/types/dom/utils/permissions.d.ts +35 -0
- package/dist/types/dom/utils/permissions.d.ts.map +1 -0
- package/dist/types/dom/utils/route.d.ts +117 -0
- package/dist/types/dom/utils/route.d.ts.map +1 -0
- package/dist/types/dom/utils/ua.d.ts +35 -0
- package/dist/types/dom/utils/ua.d.ts.map +1 -0
- package/dist/types/dom/utils/webauthn.d.ts +98 -0
- package/dist/types/dom/utils/webauthn.d.ts.map +1 -0
- package/dist/types/io/binary/reader.d.ts +59 -0
- package/dist/types/io/binary/reader.d.ts.map +1 -0
- package/dist/types/io/binary/writer.d.ts +56 -0
- package/dist/types/io/binary/writer.d.ts.map +1 -0
- package/dist/types/io/calc/adler32.d.ts +31 -0
- package/dist/types/io/calc/adler32.d.ts.map +1 -0
- package/dist/types/io/calc/bigint.d.ts +74 -0
- package/dist/types/io/calc/bigint.d.ts.map +1 -0
- package/dist/types/io/calc/crc32.d.ts +36 -0
- package/dist/types/io/calc/crc32.d.ts.map +1 -0
- package/dist/types/io/calc/easing.d.ts +60 -0
- package/dist/types/io/calc/easing.d.ts.map +1 -0
- package/dist/types/io/codec/b64.d.ts +28 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -0
- package/dist/types/io/codec/base32.d.ts +28 -0
- package/dist/types/io/codec/base32.d.ts.map +1 -0
- package/dist/types/io/codec/base58.d.ts +28 -0
- package/dist/types/io/codec/base58.d.ts.map +1 -0
- package/dist/types/io/codec/buffer.d.ts +66 -0
- package/dist/types/io/codec/buffer.d.ts.map +1 -0
- package/dist/types/io/codec/cbor.d.ts +43 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -0
- package/dist/types/io/codec/csv.d.ts +35 -0
- package/dist/types/io/codec/csv.d.ts.map +1 -0
- package/dist/types/io/codec/hex.d.ts +28 -0
- package/dist/types/io/codec/hex.d.ts.map +1 -0
- package/dist/types/io/codec/mime.d.ts +100 -0
- package/dist/types/io/codec/mime.d.ts.map +1 -0
- package/dist/types/io/codec/msgpack.d.ts +36 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -0
- package/dist/types/io/codec/url.d.ts +52 -0
- package/dist/types/io/codec/url.d.ts.map +1 -0
- package/dist/types/io/codec/utf8.d.ts +22 -0
- package/dist/types/io/codec/utf8.d.ts.map +1 -0
- package/dist/types/io/codec/xml.d.ts +91 -0
- package/dist/types/io/codec/xml.d.ts.map +1 -0
- package/dist/types/io/compress/bitstream.d.ts +51 -0
- package/dist/types/io/compress/bitstream.d.ts.map +1 -0
- package/dist/types/io/compress/brotli.d.ts +86 -0
- package/dist/types/io/compress/brotli.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict.d.ts +76 -0
- package/dist/types/io/compress/brotli_dict.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts +43 -0
- package/dist/types/io/compress/brotli_dict_words.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_frame.d.ts +166 -0
- package/dist/types/io/compress/brotli_frame.d.ts.map +1 -0
- package/dist/types/io/compress/brotli_shared.d.ts +165 -0
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -0
- package/dist/types/io/compress/deflate.d.ts +89 -0
- package/dist/types/io/compress/deflate.d.ts.map +1 -0
- package/dist/types/io/compress/gzip.d.ts +100 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -0
- package/dist/types/io/compress/huffman.d.ts +37 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -0
- package/dist/types/io/compress/lz4.d.ts +45 -0
- package/dist/types/io/compress/lz4.d.ts.map +1 -0
- package/dist/types/io/compress/lz77.d.ts +66 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -0
- package/dist/types/io/compress/lzw.d.ts +37 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -0
- package/dist/types/io/compress/zip.d.ts +112 -0
- package/dist/types/io/compress/zip.d.ts.map +1 -0
- package/dist/types/io/compress/zlib.d.ts +97 -0
- package/dist/types/io/compress/zlib.d.ts.map +1 -0
- package/dist/types/io/i18n/i18n.d.ts +64 -0
- package/dist/types/io/i18n/i18n.d.ts.map +1 -0
- package/dist/types/io/math/fixed-point.d.ts +30 -0
- package/dist/types/io/math/fixed-point.d.ts.map +1 -0
- package/dist/types/io/math/geom.d.ts +125 -0
- package/dist/types/io/math/geom.d.ts.map +1 -0
- package/dist/types/io/math/interp.d.ts +48 -0
- package/dist/types/io/math/interp.d.ts.map +1 -0
- package/dist/types/io/math/linalg.d.ts +117 -0
- package/dist/types/io/math/linalg.d.ts.map +1 -0
- package/dist/types/io/math/stats.d.ts +45 -0
- package/dist/types/io/math/stats.d.ts.map +1 -0
- package/dist/types/io/structures/btree.d.ts +84 -0
- package/dist/types/io/structures/btree.d.ts.map +1 -0
- package/dist/types/io/structures/heap.d.ts +75 -0
- package/dist/types/io/structures/heap.d.ts.map +1 -0
- package/dist/types/io/structures/lruCache.d.ts +88 -0
- package/dist/types/io/structures/lruCache.d.ts.map +1 -0
- package/dist/types/io/structures/ringBuffer.d.ts +82 -0
- package/dist/types/io/structures/ringBuffer.d.ts.map +1 -0
- package/dist/types/io/structures/tree-walker.d.ts +95 -0
- package/dist/types/io/structures/tree-walker.d.ts.map +1 -0
- package/dist/types/io/structures/trie.d.ts +71 -0
- package/dist/types/io/structures/trie.d.ts.map +1 -0
- package/dist/types/io/sync/abort.d.ts +59 -0
- package/dist/types/io/sync/abort.d.ts.map +1 -0
- package/dist/types/io/sync/atomics.d.ts +107 -0
- package/dist/types/io/sync/atomics.d.ts.map +1 -0
- package/dist/types/io/sync/cancellable.d.ts +69 -0
- package/dist/types/io/sync/cancellable.d.ts.map +1 -0
- package/dist/types/io/sync/channel.d.ts +70 -0
- package/dist/types/io/sync/channel.d.ts.map +1 -0
- package/dist/types/io/sync/mutex.d.ts +39 -0
- package/dist/types/io/sync/mutex.d.ts.map +1 -0
- package/dist/types/io/sync/semaphore.d.ts +40 -0
- package/dist/types/io/sync/semaphore.d.ts.map +1 -0
- package/dist/types/io/sync/tokenBucket.d.ts +53 -0
- package/dist/types/io/sync/tokenBucket.d.ts.map +1 -0
- package/dist/types/io/text/ansi.d.ts +125 -0
- package/dist/types/io/text/ansi.d.ts.map +1 -0
- package/dist/types/io/text/html-entities.d.ts +35 -0
- package/dist/types/io/text/html-entities.d.ts.map +1 -0
- package/dist/types/io/text/semver.d.ts +75 -0
- package/dist/types/io/text/semver.d.ts.map +1 -0
- package/dist/types/io/text/str.d.ts +88 -0
- package/dist/types/io/text/str.d.ts.map +1 -0
- package/dist/types/io/text/unicode.d.ts +70 -0
- package/dist/types/io/text/unicode.d.ts.map +1 -0
- package/dist/types/io/time/date.d.ts +73 -0
- package/dist/types/io/time/date.d.ts.map +1 -0
- package/dist/types/io/timing/clock.d.ts +39 -0
- package/dist/types/io/timing/clock.d.ts.map +1 -0
- package/dist/types/io/timing/rateLimit.d.ts +40 -0
- package/dist/types/io/timing/rateLimit.d.ts.map +1 -0
- package/dist/types/io/timing/scheduler.d.ts +122 -0
- package/dist/types/io/timing/scheduler.d.ts.map +1 -0
- package/dist/types/io/utils/bitmap.d.ts +34 -0
- package/dist/types/io/utils/bitmap.d.ts.map +1 -0
- package/dist/types/io/utils/errors.d.ts +94 -0
- package/dist/types/io/utils/errors.d.ts.map +1 -0
- package/dist/types/io/utils/eventBus.d.ts +68 -0
- package/dist/types/io/utils/eventBus.d.ts.map +1 -0
- package/dist/types/io/utils/queue.d.ts +69 -0
- package/dist/types/io/utils/queue.d.ts.map +1 -0
- package/dist/types/io/utils/signal.d.ts +362 -0
- package/dist/types/io/utils/signal.d.ts.map +1 -0
- package/dist/types/io/utils/ui8.d.ts +34 -0
- package/dist/types/io/utils/ui8.d.ts.map +1 -0
- package/dist/types/io/utils/valid.d.ts +130 -0
- package/dist/types/io/utils/valid.d.ts.map +1 -0
- package/dist/types/main.d.ts +25 -0
- package/dist/types/main.d.ts.map +1 -0
- package/dist/types/process/message.d.ts +64 -0
- package/dist/types/process/message.d.ts.map +1 -0
- package/dist/types/process/rpc.d.ts +35 -0
- package/dist/types/process/rpc.d.ts.map +1 -0
- package/dist/types/process/workerPool.d.ts +62 -0
- package/dist/types/process/workerPool.d.ts.map +1 -0
- package/dist/types/sanity/base.d.ts +28 -0
- package/dist/types/sanity/base.d.ts.map +1 -0
- package/dist/types/sanity/community.d.ts +20 -0
- package/dist/types/sanity/community.d.ts.map +1 -0
- package/dist/types/sanity/lockdown-apply.d.ts +7 -0
- package/dist/types/sanity/lockdown-apply.d.ts.map +1 -0
- package/dist/types/sanity/lockdown.d.ts +43 -0
- package/dist/types/sanity/lockdown.d.ts.map +1 -0
- package/dist/types/sanity/wasm-gate.d.ts +128 -0
- package/dist/types/sanity/wasm-gate.d.ts.map +1 -0
- package/docs/README.md +301 -0
- package/docs/api/README.md +33 -0
- package/docs/api/core/README.md +14 -0
- package/docs/api/core/logger.md +151 -0
- package/docs/api/core/main.md +105 -0
- package/docs/api/core/modules.md +123 -0
- package/docs/api/core/readyState.md +94 -0
- package/docs/api/core/runtime.md +499 -0
- package/docs/api/core/worker-helper.md +180 -0
- package/docs/api/crypto/README.md +39 -0
- package/docs/api/crypto/cipher/README.md +24 -0
- package/docs/api/crypto/cipher/aes.md +101 -0
- package/docs/api/crypto/cipher/chacha20.md +85 -0
- package/docs/api/crypto/hash/README.md +49 -0
- package/docs/api/crypto/hash/adf.md +61 -0
- package/docs/api/crypto/hash/argon2.md +92 -0
- package/docs/api/crypto/hash/blake2b.md +88 -0
- package/docs/api/crypto/hash/hkdf.md +82 -0
- package/docs/api/crypto/hash/hmac.md +90 -0
- package/docs/api/crypto/hash/pbkdf2.md +93 -0
- package/docs/api/crypto/hash/poly1305.md +71 -0
- package/docs/api/crypto/hash/sha224.md +61 -0
- package/docs/api/crypto/hash/sha256.md +84 -0
- package/docs/api/crypto/hash/sha3.md +89 -0
- package/docs/api/crypto/hash/sha384.md +58 -0
- package/docs/api/crypto/hash/sha512.md +73 -0
- package/docs/api/crypto/hash/sha512_224.md +59 -0
- package/docs/api/crypto/hash/sha512_256.md +58 -0
- package/docs/api/crypto/mode/README.md +33 -0
- package/docs/api/crypto/mode/cbc.md +69 -0
- package/docs/api/crypto/mode/chacha20poly1305.md +77 -0
- package/docs/api/crypto/mode/cmac.md +79 -0
- package/docs/api/crypto/mode/ctr.md +66 -0
- package/docs/api/crypto/mode/gcm.md +93 -0
- package/docs/api/crypto/mode/kw.md +84 -0
- package/docs/api/crypto/pkc/README.md +48 -0
- package/docs/api/crypto/pkc/ecc.md +91 -0
- package/docs/api/crypto/pkc/ed25519.md +99 -0
- package/docs/api/crypto/pkc/hybridKem.md +178 -0
- package/docs/api/crypto/pkc/hybridSign.md +192 -0
- package/docs/api/crypto/pkc/ml_dsa.md +99 -0
- package/docs/api/crypto/pkc/ml_kem.md +90 -0
- package/docs/api/crypto/pkc/rsa.md +87 -0
- package/docs/api/crypto/pkc/slh_dsa.md +86 -0
- package/docs/api/crypto/pkc/x25519.md +84 -0
- package/docs/api/crypto/utils/README.md +39 -0
- package/docs/api/crypto/utils/aes_ctr.md +71 -0
- package/docs/api/crypto/utils/aes_modes.md +81 -0
- package/docs/api/crypto/utils/asn1-oid.md +130 -0
- package/docs/api/crypto/utils/asn1.md +69 -0
- package/docs/api/crypto/utils/bitArray.md +77 -0
- package/docs/api/crypto/utils/bn.md +67 -0
- package/docs/api/crypto/utils/jws.md +94 -0
- package/docs/api/crypto/utils/keyformat.md +78 -0
- package/docs/api/crypto/utils/pad.md +66 -0
- package/docs/api/crypto/utils/pem.md +63 -0
- package/docs/api/crypto/utils/random.md +103 -0
- package/docs/api/crypto/utils/rsaKeygen.md +118 -0
- package/docs/api/crypto/utils/totp.md +159 -0
- package/docs/api/crypto/utils/uuid.md +98 -0
- package/docs/api/crypto/wasm/README.md +76 -0
- package/docs/api/crypto/wasm/aes.md +128 -0
- package/docs/api/crypto/wasm/argon2.md +110 -0
- package/docs/api/crypto/wasm/blake2b.md +103 -0
- package/docs/api/crypto/wasm/chacha20poly1305.md +120 -0
- package/docs/api/crypto/wasm/cmac.md +119 -0
- package/docs/api/crypto/wasm/ecc.md +114 -0
- package/docs/api/crypto/wasm/ed25519.md +117 -0
- package/docs/api/crypto/wasm/hkdf.md +163 -0
- package/docs/api/crypto/wasm/hmac.md +129 -0
- package/docs/api/crypto/wasm/ml_dsa.md +99 -0
- package/docs/api/crypto/wasm/ml_kem.md +91 -0
- package/docs/api/crypto/wasm/pbkdf2.md +111 -0
- package/docs/api/crypto/wasm/rsa.md +113 -0
- package/docs/api/crypto/wasm/runtime.md +172 -0
- package/docs/api/crypto/wasm/sha2.md +95 -0
- package/docs/api/crypto/wasm/sha3.md +127 -0
- package/docs/api/crypto/wasm/slh_dsa.md +89 -0
- package/docs/api/crypto/wasm/x25519.md +116 -0
- package/docs/api/crypto/webcrypto/README.md +56 -0
- package/docs/api/crypto/webcrypto/aes.md +140 -0
- package/docs/api/crypto/webcrypto/aeskw.md +120 -0
- package/docs/api/crypto/webcrypto/digest.md +103 -0
- package/docs/api/crypto/webcrypto/ecc.md +122 -0
- package/docs/api/crypto/webcrypto/ed25519.md +121 -0
- package/docs/api/crypto/webcrypto/hkdf.md +141 -0
- package/docs/api/crypto/webcrypto/hmac.md +112 -0
- package/docs/api/crypto/webcrypto/pbkdf2.md +140 -0
- package/docs/api/crypto/webcrypto/rsa.md +149 -0
- package/docs/api/crypto/webcrypto/x25519.md +96 -0
- package/docs/api/dom/README.md +117 -0
- package/docs/api/dom/display/README.md +27 -0
- package/docs/api/dom/display/animate.md +113 -0
- package/docs/api/dom/display/fullscreen.md +121 -0
- package/docs/api/dom/fs/README.md +36 -0
- package/docs/api/dom/fs/download.md +108 -0
- package/docs/api/dom/fs/fsAccess.md +200 -0
- package/docs/api/dom/fs/indexedDB.md +219 -0
- package/docs/api/dom/fs/remoteStore.md +158 -0
- package/docs/api/dom/fs/storage.md +197 -0
- package/docs/api/dom/lifecycle/README.md +11 -0
- package/docs/api/dom/lifecycle/idle.md +89 -0
- package/docs/api/dom/lifecycle/visibility.md +73 -0
- package/docs/api/dom/lifecycle/wakeLock.md +94 -0
- package/docs/api/dom/net/README.md +31 -0
- package/docs/api/dom/net/ajax.md +176 -0
- package/docs/api/dom/net/broadcastChannel.md +110 -0
- package/docs/api/dom/net/network.md +137 -0
- package/docs/api/dom/net/sse.md +141 -0
- package/docs/api/dom/net/webrtc.md +158 -0
- package/docs/api/dom/net/ws.md +168 -0
- package/docs/api/dom/query/README.md +30 -0
- package/docs/api/dom/query/dnd.md +137 -0
- package/docs/api/dom/query/dom.md +275 -0
- package/docs/api/dom/query/events.md +211 -0
- package/docs/api/dom/query/gesture.md +137 -0
- package/docs/api/dom/query/media.md +188 -0
- package/docs/api/dom/rendering/README.md +41 -0
- package/docs/api/dom/rendering/chart.md +149 -0
- package/docs/api/dom/rendering/component.md +287 -0
- package/docs/api/dom/rendering/devtools-ui.md +129 -0
- package/docs/api/dom/rendering/devtools.md +157 -0
- package/docs/api/dom/rendering/parser.md +200 -0
- package/docs/api/dom/rendering/reactiveBind.md +234 -0
- package/docs/api/dom/rendering/render.md +219 -0
- package/docs/api/dom/rendering/sanitize.md +97 -0
- package/docs/api/dom/rendering/secPolicy.md +155 -0
- package/docs/api/dom/rendering/template.md +301 -0
- package/docs/api/dom/rendering/themeTokens.md +175 -0
- package/docs/api/dom/rendering/uiSession.md +546 -0
- package/docs/api/dom/rendering/virtualScroll.md +126 -0
- package/docs/api/dom/sensors/README.md +12 -0
- package/docs/api/dom/sensors/battery.md +70 -0
- package/docs/api/dom/sensors/geolocation.md +115 -0
- package/docs/api/dom/sensors/networkInfo.md +73 -0
- package/docs/api/dom/sensors/sensors.md +123 -0
- package/docs/api/dom/sw/README.md +31 -0
- package/docs/api/dom/sw/backgroundSync.md +145 -0
- package/docs/api/dom/sw/cache.md +116 -0
- package/docs/api/dom/sw/push.md +114 -0
- package/docs/api/dom/sw/serviceWorker.md +90 -0
- package/docs/api/dom/sw/sharedWorker.md +131 -0
- package/docs/api/dom/utils/README.md +25 -0
- package/docs/api/dom/utils/a11y.md +143 -0
- package/docs/api/dom/utils/clipboard.md +146 -0
- package/docs/api/dom/utils/entropyCollector.md +175 -0
- package/docs/api/dom/utils/focus.md +140 -0
- package/docs/api/dom/utils/form.md +196 -0
- package/docs/api/dom/utils/formKit.md +181 -0
- package/docs/api/dom/utils/keybindings.md +138 -0
- package/docs/api/dom/utils/leaderElection.md +130 -0
- package/docs/api/dom/utils/notifications.md +106 -0
- package/docs/api/dom/utils/permissions.md +82 -0
- package/docs/api/dom/utils/route.md +112 -0
- package/docs/api/dom/utils/ua.md +119 -0
- package/docs/api/dom/utils/webauthn.md +190 -0
- package/docs/api/io/README.md +20 -0
- package/docs/api/io/binary/README.md +29 -0
- package/docs/api/io/binary/reader.md +126 -0
- package/docs/api/io/binary/writer.md +127 -0
- package/docs/api/io/calc/README.md +22 -0
- package/docs/api/io/calc/adler32.md +75 -0
- package/docs/api/io/calc/bigint.md +105 -0
- package/docs/api/io/calc/crc32.md +74 -0
- package/docs/api/io/calc/easing.md +118 -0
- package/docs/api/io/codec/README.md +35 -0
- package/docs/api/io/codec/b64.md +92 -0
- package/docs/api/io/codec/base32.md +98 -0
- package/docs/api/io/codec/base58.md +104 -0
- package/docs/api/io/codec/buffer.md +144 -0
- package/docs/api/io/codec/cbor.md +179 -0
- package/docs/api/io/codec/csv.md +178 -0
- package/docs/api/io/codec/hex.md +75 -0
- package/docs/api/io/codec/mime.md +156 -0
- package/docs/api/io/codec/msgpack.md +142 -0
- package/docs/api/io/codec/url.md +265 -0
- package/docs/api/io/codec/utf8.md +84 -0
- package/docs/api/io/codec/xml.md +87 -0
- package/docs/api/io/compress/README.md +62 -0
- package/docs/api/io/compress/bitstream.md +131 -0
- package/docs/api/io/compress/brotli.md +232 -0
- package/docs/api/io/compress/brotli_dict.md +119 -0
- package/docs/api/io/compress/brotli_dict_words.md +142 -0
- package/docs/api/io/compress/brotli_frame.md +214 -0
- package/docs/api/io/compress/brotli_shared.md +144 -0
- package/docs/api/io/compress/deflate.md +474 -0
- package/docs/api/io/compress/gzip.md +130 -0
- package/docs/api/io/compress/huffman.md +210 -0
- package/docs/api/io/compress/lz4.md +278 -0
- package/docs/api/io/compress/lz77.md +180 -0
- package/docs/api/io/compress/lzw.md +121 -0
- package/docs/api/io/compress/zip.md +209 -0
- package/docs/api/io/compress/zlib.md +125 -0
- package/docs/api/io/i18n/README.md +23 -0
- package/docs/api/io/i18n/i18n.md +128 -0
- package/docs/api/io/math/README.md +24 -0
- package/docs/api/io/math/fixed-point.md +115 -0
- package/docs/api/io/math/geom.md +144 -0
- package/docs/api/io/math/interp.md +115 -0
- package/docs/api/io/math/linalg.md +138 -0
- package/docs/api/io/math/stats.md +109 -0
- package/docs/api/io/structures/README.md +31 -0
- package/docs/api/io/structures/btree.md +155 -0
- package/docs/api/io/structures/heap.md +166 -0
- package/docs/api/io/structures/lruCache.md +156 -0
- package/docs/api/io/structures/ringBuffer.md +188 -0
- package/docs/api/io/structures/tree-walker.md +132 -0
- package/docs/api/io/structures/trie.md +138 -0
- package/docs/api/io/sync/README.md +29 -0
- package/docs/api/io/sync/abort.md +129 -0
- package/docs/api/io/sync/atomics.md +159 -0
- package/docs/api/io/sync/cancellable.md +176 -0
- package/docs/api/io/sync/channel.md +125 -0
- package/docs/api/io/sync/mutex.md +93 -0
- package/docs/api/io/sync/semaphore.md +106 -0
- package/docs/api/io/sync/tokenBucket.md +139 -0
- package/docs/api/io/text/README.md +23 -0
- package/docs/api/io/text/ansi.md +182 -0
- package/docs/api/io/text/html-entities.md +79 -0
- package/docs/api/io/text/semver.md +158 -0
- package/docs/api/io/text/str.md +129 -0
- package/docs/api/io/text/unicode.md +89 -0
- package/docs/api/io/time/README.md +22 -0
- package/docs/api/io/time/date.md +128 -0
- package/docs/api/io/timing/README.md +32 -0
- package/docs/api/io/timing/clock.md +102 -0
- package/docs/api/io/timing/rateLimit.md +137 -0
- package/docs/api/io/timing/scheduler.md +163 -0
- package/docs/api/io/utils/README.md +30 -0
- package/docs/api/io/utils/bitmap.md +96 -0
- package/docs/api/io/utils/errors.md +165 -0
- package/docs/api/io/utils/eventBus.md +162 -0
- package/docs/api/io/utils/queue.md +141 -0
- package/docs/api/io/utils/signal.md +388 -0
- package/docs/api/io/utils/ui8.md +111 -0
- package/docs/api/io/utils/valid.md +272 -0
- package/docs/api/process/README.md +18 -0
- package/docs/api/process/message.md +166 -0
- package/docs/api/process/rpc.md +161 -0
- package/docs/api/process/workerPool.md +130 -0
- package/docs/api/sanity/base.md +132 -0
- package/docs/api/sanity/community.md +96 -0
- package/docs/api/sanity/lockdown.md +128 -0
- package/docs/api/typed.md +85 -0
- package/docs/dev/README.md +25 -0
- package/docs/dev/provenance.md +80 -0
- package/docs/dev/publishing.md +31 -0
- package/docs/dev/runtime.md +64 -0
- package/docs/dev/testing.md +61 -0
- package/docs/dev/types.md +35 -0
- package/docs/evidence/pqc-hybrid-evidence.md +438 -0
- package/docs/guide/README.md +38 -0
- package/docs/guide/_QUICK_REF.md +341 -0
- package/docs/guide/by-use-case.md +160 -0
- package/docs/guide/doc-format.md +306 -0
- package/docs/guide/gesture-dnd-side-channel.md +119 -0
- package/docs/guide/getting-started.md +134 -0
- package/docs/guide/hmr.md +187 -0
- package/docs/guide/integration-bundlers.md +193 -0
- package/docs/guide/integrations-hmr.md +103 -0
- package/docs/guide/module-creation-workflow.md +342 -0
- package/docs/guide/module-pattern.md +244 -0
- package/docs/guide/rendering-pipeline.md +422 -0
- package/docs/guide/security.md +346 -0
- package/docs/guide/test-format.md +190 -0
- package/docs/guide/tutorial-todo.md +298 -0
- package/docs/guide/typescript.md +215 -0
- package/docs/guide/worker-confinement.md +301 -0
- package/docs/guide/workers.md +168 -0
- package/docs/notes/lz77-deflate-factorization.md +96 -0
- package/docs/notes/worker-confinement-spike.md +302 -0
- package/docs/tools/README.md +56 -0
- package/docs/tools/aot.md +108 -0
- package/docs/tools/audit.md +61 -0
- package/docs/tools/bundler.md +215 -0
- package/docs/tools/codegen.md +64 -0
- package/docs/tools/jsx.md +236 -0
- package/docs/tools/precompilation.md +88 -0
- package/docs/tools/standalone.md +107 -0
- package/fw.config.json +129 -0
- package/integrations/README.md +52 -0
- package/integrations/_shared/catalog.generated.json +207 -0
- package/integrations/_shared/config-resolve.js +201 -0
- package/integrations/_shared/core.js +362 -0
- package/integrations/astro/README.md +96 -0
- package/integrations/astro/index.d.ts +42 -0
- package/integrations/astro/index.js +94 -0
- package/integrations/bun/README.md +62 -0
- package/integrations/bun/index.d.ts +30 -0
- package/integrations/bun/index.js +134 -0
- package/integrations/deno/README.md +55 -0
- package/integrations/deno/deno.json +10 -0
- package/integrations/esbuild/README.md +75 -0
- package/integrations/esbuild/backend.js +147 -0
- package/integrations/esbuild/index.d.ts +32 -0
- package/integrations/esbuild/index.js +147 -0
- package/integrations/eslint/README.md +27 -0
- package/integrations/eslint/no-factory-capture.js +99 -0
- package/integrations/jest/README.md +45 -0
- package/integrations/jest/bun-test-shim.js +43 -0
- package/integrations/nestjs/README.md +68 -0
- package/integrations/nestjs/index.d.ts +38 -0
- package/integrations/nestjs/index.js +99 -0
- package/integrations/nextjs/README.md +149 -0
- package/integrations/nextjs/index.d.ts +30 -0
- package/integrations/nextjs/index.js +98 -0
- package/integrations/nodejs/README.md +46 -0
- package/integrations/nodejs/package.node.example.json +31 -0
- package/integrations/rollup/README.md +65 -0
- package/integrations/rollup/backend.js +132 -0
- package/integrations/rollup/index.d.ts +32 -0
- package/integrations/rollup/index.js +84 -0
- package/integrations/turbopack/README.md +56 -0
- package/integrations/turbopack/index.d.ts +47 -0
- package/integrations/turbopack/index.js +164 -0
- package/integrations/typedoc/README.md +57 -0
- package/integrations/typedoc/categorize.js +121 -0
- package/integrations/typedoc/tsconfig.typedoc.json +14 -0
- package/integrations/typedoc/typedoc.json +19 -0
- package/integrations/vite/README.md +115 -0
- package/integrations/vite/index.d.ts +29 -0
- package/integrations/vite/index.js +182 -0
- package/integrations/vite/package.json +8 -0
- package/integrations/vite/vite-env.d.ts +36 -0
- package/integrations/vitest/README.md +77 -0
- package/integrations/vitest/bun-test-shim.js +92 -0
- package/integrations/vitest/vitest.config.js +41 -0
- package/integrations/webpack/README.md +53 -0
- package/integrations/webpack/index.d.ts +29 -0
- package/integrations/webpack/index.js +182 -0
- package/package.json +303 -0
- package/src/core/logger.js +373 -0
- package/src/core/modules.js +289 -0
- package/src/core/readyState.js +119 -0
- package/src/core/runtime.js +929 -0
- package/src/core/worker-helper.js +261 -0
- package/src/crypto/NIST_CONFORMANCE.md +249 -0
- package/src/crypto/cipher/aes.acvp.md +74 -0
- package/src/crypto/cipher/aes.js +512 -0
- package/src/crypto/cipher/chacha20.acvp.md +117 -0
- package/src/crypto/cipher/chacha20.js +147 -0
- package/src/crypto/hash/adf.acvp.md +144 -0
- package/src/crypto/hash/adf.js +127 -0
- package/src/crypto/hash/argon2.acvp.md +144 -0
- package/src/crypto/hash/argon2.js +517 -0
- package/src/crypto/hash/blake2b.acvp.md +122 -0
- package/src/crypto/hash/blake2b.js +367 -0
- package/src/crypto/hash/hkdf.acvp.md +128 -0
- package/src/crypto/hash/hkdf.js +145 -0
- package/src/crypto/hash/hmac.acvp.md +110 -0
- package/src/crypto/hash/hmac.js +177 -0
- package/src/crypto/hash/pbkdf2.acvp.md +122 -0
- package/src/crypto/hash/pbkdf2.js +120 -0
- package/src/crypto/hash/poly1305.acvp.md +111 -0
- package/src/crypto/hash/poly1305.js +126 -0
- package/src/crypto/hash/sha224.acvp.md +81 -0
- package/src/crypto/hash/sha224.js +60 -0
- package/src/crypto/hash/sha256.acvp.md +75 -0
- package/src/crypto/hash/sha256.js +217 -0
- package/src/crypto/hash/sha3.acvp.md +133 -0
- package/src/crypto/hash/sha3.js +391 -0
- package/src/crypto/hash/sha384.acvp.md +82 -0
- package/src/crypto/hash/sha384.js +61 -0
- package/src/crypto/hash/sha512.acvp.md +84 -0
- package/src/crypto/hash/sha512.js +314 -0
- package/src/crypto/hash/sha512_224.acvp.md +90 -0
- package/src/crypto/hash/sha512_224.js +66 -0
- package/src/crypto/hash/sha512_256.acvp.md +96 -0
- package/src/crypto/hash/sha512_256.js +75 -0
- package/src/crypto/mode/cbc.acvp.md +105 -0
- package/src/crypto/mode/cbc.js +136 -0
- package/src/crypto/mode/chacha20poly1305.acvp.md +116 -0
- package/src/crypto/mode/chacha20poly1305.js +190 -0
- package/src/crypto/mode/cmac.acvp.md +106 -0
- package/src/crypto/mode/cmac.js +172 -0
- package/src/crypto/mode/ctr.acvp.md +110 -0
- package/src/crypto/mode/ctr.js +174 -0
- package/src/crypto/mode/gcm.acvp.md +129 -0
- package/src/crypto/mode/gcm.js +333 -0
- package/src/crypto/mode/kw.acvp.md +145 -0
- package/src/crypto/mode/kw.js +323 -0
- package/src/crypto/pkc/ecc.acvp.md +181 -0
- package/src/crypto/pkc/ecc.js +941 -0
- package/src/crypto/pkc/ed25519.acvp.md +172 -0
- package/src/crypto/pkc/ed25519.js +582 -0
- package/src/crypto/pkc/hybrid-kat.provenance.md +89 -0
- package/src/crypto/pkc/hybridKem.js +255 -0
- package/src/crypto/pkc/hybridSign.js +437 -0
- package/src/crypto/pkc/ml_dsa.acvp.md +146 -0
- package/src/crypto/pkc/ml_dsa.js +984 -0
- package/src/crypto/pkc/ml_kem.acvp.md +117 -0
- package/src/crypto/pkc/ml_kem.js +596 -0
- package/src/crypto/pkc/rsa.acvp.md +187 -0
- package/src/crypto/pkc/rsa.js +470 -0
- package/src/crypto/pkc/slh_dsa.acvp.md +155 -0
- package/src/crypto/pkc/slh_dsa.js +820 -0
- package/src/crypto/pkc/x25519.acvp.md +113 -0
- package/src/crypto/pkc/x25519.js +290 -0
- package/src/crypto/utils/aes_ctr.acvp.md +67 -0
- package/src/crypto/utils/aes_ctr.js +134 -0
- package/src/crypto/utils/aes_modes.acvp.md +66 -0
- package/src/crypto/utils/aes_modes.js +241 -0
- package/src/crypto/utils/asn1-oid.js +369 -0
- package/src/crypto/utils/asn1.js +343 -0
- package/src/crypto/utils/bitArray.js +312 -0
- package/src/crypto/utils/bn.js +825 -0
- package/src/crypto/utils/jws.js +222 -0
- package/src/crypto/utils/keyformat.js +303 -0
- package/src/crypto/utils/pad.js +198 -0
- package/src/crypto/utils/pem.js +90 -0
- package/src/crypto/utils/random.acvp.md +167 -0
- package/src/crypto/utils/random.js +846 -0
- package/src/crypto/utils/rsaKeygen.acvp.md +158 -0
- package/src/crypto/utils/rsaKeygen.js +448 -0
- package/src/crypto/utils/totp.js +409 -0
- package/src/crypto/utils/uuid.acvp.md +137 -0
- package/src/crypto/utils/uuid.js +176 -0
- package/src/crypto/wasm/aes.js +494 -0
- package/src/crypto/wasm/argon2.js +236 -0
- package/src/crypto/wasm/blake2b.js +213 -0
- package/src/crypto/wasm/chacha20poly1305.js +238 -0
- package/src/crypto/wasm/cmac.js +207 -0
- package/src/crypto/wasm/ecc.js +437 -0
- package/src/crypto/wasm/ed25519.js +307 -0
- package/src/crypto/wasm/hkdf.js +183 -0
- package/src/crypto/wasm/hmac.js +215 -0
- package/src/crypto/wasm/ml_dsa.js +375 -0
- package/src/crypto/wasm/ml_kem.js +313 -0
- package/src/crypto/wasm/pbkdf2.js +205 -0
- package/src/crypto/wasm/rsa.js +674 -0
- package/src/crypto/wasm/runtime.js +400 -0
- package/src/crypto/wasm/sha2.js +183 -0
- package/src/crypto/wasm/sha3.js +221 -0
- package/src/crypto/wasm/slh_dsa.js +397 -0
- package/src/crypto/wasm/x25519.js +241 -0
- package/src/crypto/webcrypto/aes.js +370 -0
- package/src/crypto/webcrypto/aeskw.js +185 -0
- package/src/crypto/webcrypto/digest.js +136 -0
- package/src/crypto/webcrypto/ecc.js +371 -0
- package/src/crypto/webcrypto/ed25519.js +248 -0
- package/src/crypto/webcrypto/hkdf.js +132 -0
- package/src/crypto/webcrypto/hmac.js +213 -0
- package/src/crypto/webcrypto/pbkdf2.js +146 -0
- package/src/crypto/webcrypto/rsa.js +415 -0
- package/src/crypto/webcrypto/x25519.js +250 -0
- package/src/dom/display/animate.js +154 -0
- package/src/dom/display/fullscreen.js +305 -0
- package/src/dom/fs/download.js +118 -0
- package/src/dom/fs/fsAccess.js +307 -0
- package/src/dom/fs/indexedDB.js +465 -0
- package/src/dom/fs/remoteStore.js +484 -0
- package/src/dom/fs/storage.js +440 -0
- package/src/dom/lifecycle/idle.js +133 -0
- package/src/dom/lifecycle/visibility.js +140 -0
- package/src/dom/lifecycle/wakeLock.js +187 -0
- package/src/dom/net/ajax.js +303 -0
- package/src/dom/net/broadcastChannel.js +89 -0
- package/src/dom/net/network.js +260 -0
- package/src/dom/net/sse.js +295 -0
- package/src/dom/net/webrtc.js +381 -0
- package/src/dom/net/ws.js +290 -0
- package/src/dom/query/dnd.js +409 -0
- package/src/dom/query/dom.js +831 -0
- package/src/dom/query/events.js +425 -0
- package/src/dom/query/gesture.js +396 -0
- package/src/dom/query/media.js +616 -0
- package/src/dom/rendering/chart.js +663 -0
- package/src/dom/rendering/component.js +469 -0
- package/src/dom/rendering/devtools-ui.js +399 -0
- package/src/dom/rendering/devtools.js +352 -0
- package/src/dom/rendering/parser.js +1055 -0
- package/src/dom/rendering/reactiveBind.js +341 -0
- package/src/dom/rendering/render.js +601 -0
- package/src/dom/rendering/sanitize.js +364 -0
- package/src/dom/rendering/secPolicy.js +281 -0
- package/src/dom/rendering/template.js +1031 -0
- package/src/dom/rendering/themeTokens.js +522 -0
- package/src/dom/rendering/uiSession-core.js +597 -0
- package/src/dom/rendering/uiSession-direct.js +251 -0
- package/src/dom/rendering/uiSession-list.js +751 -0
- package/src/dom/rendering/uiSession.js +145 -0
- package/src/dom/rendering/virtualScroll.js +341 -0
- package/src/dom/sensors/battery.js +153 -0
- package/src/dom/sensors/geolocation.js +156 -0
- package/src/dom/sensors/networkInfo.js +136 -0
- package/src/dom/sensors/sensors.js +340 -0
- package/src/dom/sw/backgroundSync.js +113 -0
- package/src/dom/sw/cache.js +139 -0
- package/src/dom/sw/push.js +181 -0
- package/src/dom/sw/serviceWorker.js +193 -0
- package/src/dom/sw/sharedWorker.js +192 -0
- package/src/dom/utils/a11y.js +244 -0
- package/src/dom/utils/clipboard.js +113 -0
- package/src/dom/utils/entropyCollector.js +344 -0
- package/src/dom/utils/focus.js +421 -0
- package/src/dom/utils/form.js +535 -0
- package/src/dom/utils/formKit.js +427 -0
- package/src/dom/utils/keybindings.js +574 -0
- package/src/dom/utils/leaderElection.js +280 -0
- package/src/dom/utils/notifications.js +218 -0
- package/src/dom/utils/permissions.js +107 -0
- package/src/dom/utils/route.js +482 -0
- package/src/dom/utils/ua.js +109 -0
- package/src/dom/utils/webauthn.js +369 -0
- package/src/external/README.md +15 -0
- package/src/io/binary/reader.js +374 -0
- package/src/io/binary/writer.js +351 -0
- package/src/io/calc/adler32.js +94 -0
- package/src/io/calc/bigint.js +276 -0
- package/src/io/calc/crc32.js +111 -0
- package/src/io/calc/easing.js +514 -0
- package/src/io/codec/b64.js +235 -0
- package/src/io/codec/base32.js +147 -0
- package/src/io/codec/base58.js +167 -0
- package/src/io/codec/buffer.js +630 -0
- package/src/io/codec/cbor.js +550 -0
- package/src/io/codec/csv.js +299 -0
- package/src/io/codec/hex.js +129 -0
- package/src/io/codec/mime.js +398 -0
- package/src/io/codec/msgpack.js +491 -0
- package/src/io/codec/url.js +530 -0
- package/src/io/codec/utf8.js +181 -0
- package/src/io/codec/xml.js +428 -0
- package/src/io/compress/bitstream.js +199 -0
- package/src/io/compress/brotli.js +3073 -0
- package/src/io/compress/brotli_dict.bin +432 -0
- package/src/io/compress/brotli_dict.js +356 -0
- package/src/io/compress/brotli_dict_words.js +157 -0
- package/src/io/compress/brotli_frame.js +420 -0
- package/src/io/compress/brotli_shared.js +715 -0
- package/src/io/compress/deflate.js +1432 -0
- package/src/io/compress/gzip.js +406 -0
- package/src/io/compress/huffman.js +322 -0
- package/src/io/compress/lz4.js +451 -0
- package/src/io/compress/lz77.js +408 -0
- package/src/io/compress/lzw.js +332 -0
- package/src/io/compress/zip.js +815 -0
- package/src/io/compress/zlib.js +340 -0
- package/src/io/i18n/i18n.js +236 -0
- package/src/io/math/fixed-point.js +269 -0
- package/src/io/math/geom.js +350 -0
- package/src/io/math/interp.js +263 -0
- package/src/io/math/linalg.js +472 -0
- package/src/io/math/stats.js +339 -0
- package/src/io/structures/btree.js +357 -0
- package/src/io/structures/heap.js +249 -0
- package/src/io/structures/lruCache.js +219 -0
- package/src/io/structures/ringBuffer.js +208 -0
- package/src/io/structures/tree-walker.js +413 -0
- package/src/io/structures/trie.js +219 -0
- package/src/io/sync/abort.js +196 -0
- package/src/io/sync/atomics.js +342 -0
- package/src/io/sync/cancellable.js +279 -0
- package/src/io/sync/channel.js +301 -0
- package/src/io/sync/mutex.js +148 -0
- package/src/io/sync/semaphore.js +156 -0
- package/src/io/sync/tokenBucket.js +208 -0
- package/src/io/text/ansi.js +536 -0
- package/src/io/text/html-entities.js +143 -0
- package/src/io/text/semver.js +375 -0
- package/src/io/text/str.js +243 -0
- package/src/io/text/unicode.js +188 -0
- package/src/io/time/date.js +355 -0
- package/src/io/timing/clock.js +79 -0
- package/src/io/timing/rateLimit.js +264 -0
- package/src/io/timing/scheduler.js +351 -0
- package/src/io/utils/bitmap.js +94 -0
- package/src/io/utils/errors.js +269 -0
- package/src/io/utils/eventBus.js +315 -0
- package/src/io/utils/queue.js +223 -0
- package/src/io/utils/signal.js +858 -0
- package/src/io/utils/ui8.js +99 -0
- package/src/io/utils/valid.js +556 -0
- package/src/main.js +41 -0
- package/src/polyfill/README.md +9 -0
- package/src/process/message.js +257 -0
- package/src/process/rpc.js +286 -0
- package/src/process/workerPool.js +392 -0
- package/src/sanity/base.js +374 -0
- package/src/sanity/community.js +254 -0
- package/src/sanity/lockdown-apply.js +58 -0
- package/src/sanity/lockdown.js +408 -0
- package/src/sanity/wasm-gate.js +316 -0
- package/src/typed.js +53 -0
- package/third-party/NOTICE-penner-easing +88 -0
- package/third-party/NOTICE-sjcl +50 -0
- package/tools/_lib/cli-help.js +55 -0
- package/tools/rendering/aot/index.js +148 -0
- package/tools/rendering/aot/lib/dom-codegen.js +295 -0
- package/tools/rendering/jsx/index.js +654 -0
- package/tools/rendering/precompilation/index.js +368 -0
- package/types/registry.generated.d.ts +217 -0
- package/types/typed.d.ts +106 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: note
|
|
3
|
+
status: complete
|
|
4
|
+
scope: core/worker-helper
|
|
5
|
+
date: 2026-06-15
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Worker Confinement Spike — Decision Note
|
|
9
|
+
|
|
10
|
+
> **status: historical (2026-06-15) — superseded for guidance by
|
|
11
|
+
> [`docs/guide/worker-confinement.md`](../guide/worker-confinement.md).**
|
|
12
|
+
> This page is a dated investigation record and is kept verbatim. For what to
|
|
13
|
+
> actually write in an application, read the guide; for what `lockdown()`
|
|
14
|
+
> integrates in a Worker *today*, read the final section of this page.
|
|
15
|
+
|
|
16
|
+
> Investigation: does fw's Worker boundary provide confinement (isolation)
|
|
17
|
+
> to complement the integrity tier (`sanity/lockdown.js`)? Answer: yes, with
|
|
18
|
+
> specific residuals to account for.
|
|
19
|
+
|
|
20
|
+
**File evidence base**: `src/core/worker-helper.js`, `src/core/runtime.js`,
|
|
21
|
+
`src/core/worker-confinement.poc.test.js`.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Q1 — Boundary reality: is a Worker a true separate realm?
|
|
26
|
+
|
|
27
|
+
**Verdict: Yes. A Worker is a genuine separate realm — distinct intrinsics,
|
|
28
|
+
no shared prototype chain, no shared variable scope with the spawning thread.**
|
|
29
|
+
|
|
30
|
+
A Web Worker (Bun or browser) spawns with its own JavaScript engine context:
|
|
31
|
+
separate `globalThis`, separate prototype chain for `Object`, `Array`, `Function`,
|
|
32
|
+
etc. The only crossing mechanism is `postMessage` / structured-clone
|
|
33
|
+
(spec: WHATWG Workers §2.6). No shared memory exists between parent and worker
|
|
34
|
+
unless an `ArrayBuffer` is explicitly transferred or a `SharedArrayBuffer` is
|
|
35
|
+
passed.
|
|
36
|
+
|
|
37
|
+
Evidence in fw: `worker-helper.js:198–210` builds the entire worker program as
|
|
38
|
+
a string (`code`), creates a `Blob` URL, and passes it to `new Worker(blobUrl)`.
|
|
39
|
+
The worker evaluates the string in its own fresh realm. `workerFn.toString()` is
|
|
40
|
+
called to embed the function source — any closure variable the function captured
|
|
41
|
+
is NOT transferred (the string contains only the syntactic body). A closure that
|
|
42
|
+
references a parent-scope binding would cause a `ReferenceError` inside the
|
|
43
|
+
worker (this is enforced at ESLint level by the `no-factory-capture` rule,
|
|
44
|
+
`fw-coding.md` §2).
|
|
45
|
+
|
|
46
|
+
PoC confirmation (`worker-confinement.poc.test.js`): a `globalThis[propName]`
|
|
47
|
+
set in the parent thread is NOT visible inside the spawned Worker (realm test,
|
|
48
|
+
live Worker), confirming the separate-`globalThis` boundary.
|
|
49
|
+
|
|
50
|
+
Structured-clone only: `postMessage` calls `structuredClone` semantics —
|
|
51
|
+
functions, prototypes, WeakMaps, Proxy objects, DOM nodes cannot cross the
|
|
52
|
+
boundary. Only plain JSON-like data, typed arrays, and transferable objects
|
|
53
|
+
(ArrayBuffer, MessagePort, etc.) can transit. fw serializes modules as
|
|
54
|
+
source-code strings (`runtime.js:520–556`, `serialize()`), not as live objects.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Q2 — Ambient authority audit
|
|
59
|
+
|
|
60
|
+
**Verdict: fetch and WebSocket are present by default in Bun Workers; `XMLHttpRequest`,
|
|
61
|
+
`importScripts`, `indexedDB`, and `caches` are absent. Dynamic `import()` is present
|
|
62
|
+
but restricted to local paths (no network). fetch and WebSocket are deletable
|
|
63
|
+
before running untrusted code; dynamic import is an irremovable language feature.**
|
|
64
|
+
|
|
65
|
+
Measured in the current Bun 1.3.13 Worker environment:
|
|
66
|
+
|
|
67
|
+
| Authority | Present by default | Withholdable? | Method |
|
|
68
|
+
|---|---|---|---|
|
|
69
|
+
| `fetch` | Yes | Yes | `delete globalThis.fetch` before user code runs |
|
|
70
|
+
| `WebSocket` | Yes | Yes | `delete globalThis.WebSocket` before user code |
|
|
71
|
+
| `XMLHttpRequest` | No | N/A (absent) | — |
|
|
72
|
+
| `importScripts` | No | N/A (absent) | — |
|
|
73
|
+
| `indexedDB` | No | N/A (absent) | — |
|
|
74
|
+
| `caches` | No | N/A (absent) | — |
|
|
75
|
+
| dynamic `import()` | Yes | No — syntax keyword | Residual (see below) |
|
|
76
|
+
| `Worker` (nested) | Yes | Yes | `delete globalThis.Worker` |
|
|
77
|
+
| `BroadcastChannel` | Yes | Yes | deletable |
|
|
78
|
+
|
|
79
|
+
**Residuals that cannot be fully removed:**
|
|
80
|
+
|
|
81
|
+
1. **Dynamic `import()`** is a language keyword, not a property, so it cannot be
|
|
82
|
+
`delete`d. However, in Bun's Worker with blob: URL origin, `import()` only
|
|
83
|
+
resolves local file-system paths (not `https://` URLs) — network import fails
|
|
84
|
+
with an ENOENT error. This means the network attack surface via `import()` is
|
|
85
|
+
already constrained, but a file-system read via `import()` to an absolute path
|
|
86
|
+
remains possible unless the OS has no world-readable sensitive JS files.
|
|
87
|
+
|
|
88
|
+
2. **`eval`** and **`new Function`** are language primitives. They can be overwritten
|
|
89
|
+
(`globalThis.eval = () => { throw ... }`) but not deleted (they'd re-resolve to
|
|
90
|
+
the language built-ins through the prototype chain). The sanity layer
|
|
91
|
+
(`sanity/base.js`) already blocks these with throwing wrappers; running
|
|
92
|
+
`lockdown()` inside the worker addresses them — see Q4.
|
|
93
|
+
|
|
94
|
+
**Mechanism for withholdable authorities** (demonstrated in PoC):
|
|
95
|
+
A custom `workerFw` function runs before `workerFn` (worker-helper.js:207).
|
|
96
|
+
Deleting properties from `globalThis` inside `workerFw` hides them from all
|
|
97
|
+
subsequently executing code (including `workerFn`). Since `workerFw` is
|
|
98
|
+
serialized and embedded before `workerFn`, the sequence is deterministic:
|
|
99
|
+
confinement setup → resolve modules → run user code.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Q3 — Capability model: fw DI modules as granted capabilities
|
|
104
|
+
|
|
105
|
+
**Verdict: The `dependencies` allowlist in `createWorker` options is the
|
|
106
|
+
capability grant mechanism. Only explicitly listed modules are serialized into
|
|
107
|
+
the worker; a module not in the list is absent from `libs` and from the
|
|
108
|
+
worker-side `ModuleRuntime` — it is unreachable, not just hidden.**
|
|
109
|
+
|
|
110
|
+
Mechanism (worker-helper.js:184–210):
|
|
111
|
+
|
|
112
|
+
1. `runtime.serialize(normalizedOptions.dependencies)` (runtime.js:520) builds
|
|
113
|
+
a topologically ordered graph of ONLY the listed modules and their transitive
|
|
114
|
+
dependencies. Modules not in the list are not serialized.
|
|
115
|
+
2. The serialized source string is embedded in the worker code as a literal
|
|
116
|
+
(`${serialized.content}`). The worker-side `ModuleRuntime` can only register
|
|
117
|
+
and resolve modules present in that string.
|
|
118
|
+
3. `DEFAULT_WORKER_FRAMEWORK` calls `runtime.resolveAll(exposedSpecs)` where
|
|
119
|
+
`exposedSpecs` is exactly the user's `dependencies` list (worker-helper.js:196).
|
|
120
|
+
Transitive dependencies are registered but NOT exposed in `libs` by default —
|
|
121
|
+
they can only be reached if listed explicitly.
|
|
122
|
+
|
|
123
|
+
PoC confirmation (`worker-confinement.poc.test.js`, sandbox + live tests):
|
|
124
|
+
- `mathModule` registered on main-thread runtime + granted → `libs.math` present,
|
|
125
|
+
computes `add(20, 22) = 42`.
|
|
126
|
+
- `secretModule` registered on main-thread runtime but NOT in `dependencies` →
|
|
127
|
+
absent from worker `libs` (both sandbox and live Worker confirm `libs.secret ===
|
|
128
|
+
undefined`). The worker's `ModuleRuntime` has no entry for `secret` at all; even
|
|
129
|
+
`runtime.resolve('secret')` inside the worker would throw `Module not found`.
|
|
130
|
+
|
|
131
|
+
The capability model is thus: the grant is the `dependencies` array passed to
|
|
132
|
+
`createWorker`. Anything not in the grant is unreachable from inside the worker.
|
|
133
|
+
The parent's full `runtime` registry is never transferred — only the serialized
|
|
134
|
+
subgraph.
|
|
135
|
+
|
|
136
|
+
**Non-granted module unreachability is structural, not policy**: a non-granted
|
|
137
|
+
module's `factory` source is absent from the worker code string entirely. There
|
|
138
|
+
is no way for worker code to conjure it unless the attacker can load an external
|
|
139
|
+
resource (see residuals in Q2).
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Q4 — Composition with Task 01 (lockdown)
|
|
144
|
+
|
|
145
|
+
**Verdict: Yes, `lockdown()` should run inside each Worker realm (in the
|
|
146
|
+
`workerFw` bootstrap, before user code). The pair provides layered defence:
|
|
147
|
+
confinement (worker boundary) plus integrity (prototype freeze + API blocks).
|
|
148
|
+
Neither is sufficient alone. The honest gap vs SES Compartments is: async-only
|
|
149
|
+
channel, per-worker startup cost, and Bun's dynamic-import residual.**
|
|
150
|
+
|
|
151
|
+
**What the Worker boundary provides alone (without lockdown):**
|
|
152
|
+
- Separate realm → no shared prototype chain with parent.
|
|
153
|
+
- Module capability grant → non-granted modules structurally absent.
|
|
154
|
+
- Parent-scope variables → unreachable (separate `globalThis`).
|
|
155
|
+
- postMessage only → the only sanctioned data channel.
|
|
156
|
+
|
|
157
|
+
**What lockdown adds inside the worker realm:**
|
|
158
|
+
- Freezes the worker's own built-in prototypes (`Object.prototype`, etc.),
|
|
159
|
+
preventing prototype-pollution attacks within the worker realm itself.
|
|
160
|
+
- Blocks `eval`/`new Function` (which are otherwise live inside the worker).
|
|
161
|
+
- Blocks timing channels (`performance.now`, `Date.now` rounding).
|
|
162
|
+
- Blocks dangerous DOM APIs (where they exist) and `Math.random`.
|
|
163
|
+
|
|
164
|
+
**What the pair guarantees that neither does alone:**
|
|
165
|
+
- Without lockdown, untrusted code in the worker could mutate `Array.prototype`
|
|
166
|
+
inside the worker realm and corrupt the fw module instances that run there.
|
|
167
|
+
- Without the Worker boundary, lockdown only provides integrity (no prototype
|
|
168
|
+
mutation) but not confinement — code still runs in the parent realm and has
|
|
169
|
+
access to all parent-scope bindings.
|
|
170
|
+
- Together: code runs in a realm where (a) it can only reach granted modules,
|
|
171
|
+
(b) built-ins are frozen, (c) dangerous APIs throw, (d) data crosses only via
|
|
172
|
+
structured-clone.
|
|
173
|
+
|
|
174
|
+
**Honest gap vs SES Compartments:**
|
|
175
|
+
|
|
176
|
+
| Aspect | Worker + lockdown | SES Compartment |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
| Realm isolation | True engine boundary (separate V8/JSC context) | Lexical illusion (same realm, virtualized `globalThis`) |
|
|
179
|
+
| Call protocol | Async only (`postMessage`, structured-clone) | Synchronous calls possible |
|
|
180
|
+
| Data crossing | Structured-clone — no live object sharing | Can pass live objects if caller allows |
|
|
181
|
+
| Startup cost | New thread/process per Worker (~1–10 ms overhead) | ~0 ms (same realm) |
|
|
182
|
+
| Code inspection | Attacker cannot observe parent intrinsics | Requires careful hardening of intrinsics |
|
|
183
|
+
| dynamic import residual | Present; file-system read possible | Fully virtualized by SES |
|
|
184
|
+
| Browser/Bun native | Yes — standard Web Worker API | Requires SES polyfill |
|
|
185
|
+
|
|
186
|
+
The Worker + lockdown pair gives **stronger** isolation where it applies (true
|
|
187
|
+
engine boundary vs lexical illusion) but is **async-only and per-worker costly**.
|
|
188
|
+
SES Compartments allow synchronous composition at near-zero cost but require
|
|
189
|
+
trusting the SES polyfill's hardening and do not protect against
|
|
190
|
+
prototype-graph sharing bugs in the polyfill itself.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Recommendation
|
|
195
|
+
|
|
196
|
+
**Adopt Workers as the confinement tier for fw.**
|
|
197
|
+
|
|
198
|
+
Rationale:
|
|
199
|
+
1. **Real engine isolation**: the Worker boundary is enforced by the JavaScript
|
|
200
|
+
engine, not userland code. An attacker inside the worker cannot escape to the
|
|
201
|
+
parent realm regardless of what they do to the worker's own prototype chain.
|
|
202
|
+
2. **fw-native**: the architecture was designed for this — factory serialization
|
|
203
|
+
(`runtime.serialize`), the `createWorkerRuntime` helper, and the `dependencies`
|
|
204
|
+
capability grant are already in production. The confinement model is not an
|
|
205
|
+
add-on; it is the natural expression of the DI architecture.
|
|
206
|
+
3. **Honest capability grant**: the grant mechanism (`dependencies` allowlist) is
|
|
207
|
+
structural, not advisory — a non-granted module's code is absent from the
|
|
208
|
+
worker binary.
|
|
209
|
+
|
|
210
|
+
**Recommended deployment pattern:**
|
|
211
|
+
|
|
212
|
+
```js
|
|
213
|
+
// Confinement-setup workerFw (embed alongside createWorker call-site)
|
|
214
|
+
const confinedWorkerFw = function(runtime, modules, args) {
|
|
215
|
+
// 1. Withhold ambient network authority
|
|
216
|
+
delete globalThis.fetch;
|
|
217
|
+
delete globalThis.WebSocket;
|
|
218
|
+
delete globalThis.Worker; // prevent nested worker spawn
|
|
219
|
+
delete globalThis.BroadcastChannel;
|
|
220
|
+
// 2. Run lockdown (integrity — freeze prototypes, block eval/Function/etc.)
|
|
221
|
+
// lockdown() would be injected via the dependencies list:
|
|
222
|
+
// e.g. dependencies: ['lockdown', 'math'] where lockdown is a side-effect module.
|
|
223
|
+
// Or: call it inline if the source is embedded via runtimeSource extension.
|
|
224
|
+
// 3. Resolve only the granted modules
|
|
225
|
+
const libs = runtime.resolveAll(modules);
|
|
226
|
+
return { libs, args };
|
|
227
|
+
};
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Trade-offs to document:**
|
|
231
|
+
- Async-only channel: any call from parent to worker (and vice versa) goes through
|
|
232
|
+
`postMessage` and structured-clone. Synchronous access to worker results is not
|
|
233
|
+
possible. This is a fundamental property of the Web Worker API.
|
|
234
|
+
- Per-worker cost: each Worker allocates a new thread (~1–10 ms on modern hardware).
|
|
235
|
+
Use a worker pool (existing `workerPool` module) for recurring tasks.
|
|
236
|
+
- Dynamic `import()` residual: in production browser environments this is network-
|
|
237
|
+
capable. For full coverage, the confinement-setup `workerFw` should also install
|
|
238
|
+
a throwing `import` override (not possible at the keyword level, but an `import`
|
|
239
|
+
meta-object shim can be installed). In Bun 1.3.13 the network attack vector is
|
|
240
|
+
absent but file-system import is possible — acceptable for server-side trust
|
|
241
|
+
boundaries where the filesystem is under operator control.
|
|
242
|
+
|
|
243
|
+
**Do NOT pursue an in-realm Compartment shim as an alternative** unless
|
|
244
|
+
synchronous composition is specifically required (e.g., plugins that must return
|
|
245
|
+
values synchronously). The Worker model provides stronger isolation at the cost of
|
|
246
|
+
asynchrony, which aligns with fw's event-driven architecture.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## What lockdown integrates today (2026-09-04)
|
|
251
|
+
|
|
252
|
+
> Appended after the fact. Everything above is the 2026-06-15 record, left
|
|
253
|
+
> verbatim; this section states what is measured true of the current tree and
|
|
254
|
+
> corrects the one place where the record above proposes an API shape that does
|
|
255
|
+
> not exist.
|
|
256
|
+
|
|
257
|
+
- **`lockdown()` is explicit-call.** The whole sanity layer is now
|
|
258
|
+
explicit-call ESM: `sanity/lockdown.js` exports `lockdown()` and `harden()`,
|
|
259
|
+
and a bare import hardens nothing.
|
|
260
|
+
- **Its intrinsic steps run in any realm, Workers included.** Steps 1–5 (tame
|
|
261
|
+
the function constructors, capture then remove the evaluators, poison the sync
|
|
262
|
+
WebAssembly constructors, harden the intrinsics) target pure-JS intrinsics —
|
|
263
|
+
`lockdown.js:339-347` states this as contract.
|
|
264
|
+
- **The DOM step is browser-gated.** Step 6 composes `applyBase()` only when
|
|
265
|
+
both `window` and `document` exist (`lockdown.js:383-397`), so a Worker or SSR
|
|
266
|
+
realm never loads the DOM layer at all.
|
|
267
|
+
- **fw does not wire it into the worker realm.** `lockdown` is not a DI module
|
|
268
|
+
(absent from `src/core/modules.js`) and is not part of `runtimeSource`, so it
|
|
269
|
+
is not reachable through the `dependencies` grant. The only pre-user-code hook,
|
|
270
|
+
`workerFw`, is called **synchronously** — its return value is assigned straight
|
|
271
|
+
to `runtime.context` (`worker-helper.js:207`) — so it cannot `await` the
|
|
272
|
+
dynamic `import()` that obtaining the module inside a `blob:` worker requires.
|
|
273
|
+
- **Correction to the pseudo-plan above.** The commented step 2 of the
|
|
274
|
+
"Recommended deployment pattern" (l215–218) suggests
|
|
275
|
+
`dependencies: ['lockdown', …]`, "where lockdown is a side-effect module".
|
|
276
|
+
**That shape does not exist**, and never did: the `dependencies` grant only
|
|
277
|
+
accepts registered DI modules, and lockdown is not one. The working route is
|
|
278
|
+
the opposite one — user code inside `workerFn` does
|
|
279
|
+
`import(<absolute module URL passed through args>)` and calls `mod.lockdown()`
|
|
280
|
+
itself. That leg is measured green in Chrome and under `bun test`
|
|
281
|
+
(ninth test of `src/core/worker-confinement.poc.test.js`); see
|
|
282
|
+
[`docs/guide/worker-confinement.md`](../guide/worker-confinement.md)
|
|
283
|
+
§ Applying lockdown inside the worker.
|
|
284
|
+
- **Correction to the Q2 authority table.** `delete globalThis.fetch` is a
|
|
285
|
+
Bun-only truth. In Chrome, `fetch` is an own property of
|
|
286
|
+
`WorkerGlobalScope.prototype`, not of the worker global, so that statement is
|
|
287
|
+
a no-op there and `fetch` survives; `WebSocket` *is* an own property and is
|
|
288
|
+
removed as the table says. The portable revocation walks the prototype chain —
|
|
289
|
+
see the guide, § Withholding ambient authority.
|
|
290
|
+
- **Productising this** (a first-class worker option that hardens the realm for
|
|
291
|
+
you) remains out of scope and stays tracked separately.
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## See also
|
|
296
|
+
|
|
297
|
+
- `src/core/worker-helper.js` — `createWorkerRuntime`, the grant mechanism
|
|
298
|
+
- `src/core/runtime.js:520` — `ModuleRuntime.serialize`, transitive graph builder
|
|
299
|
+
- `src/core/worker-confinement.poc.test.js` — runnable PoC (8 tests, all green)
|
|
300
|
+
- Task 01 deliverable: `src/sanity/lockdown.js` — integrity layer (composition partner)
|
|
301
|
+
- Task 03 deliverable: `docs/guide/security.md` — cross-links this note
|
|
302
|
+
- `docs/api/core/worker-helper.md` — API reference
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# `@awacloud/fw` — Tooling
|
|
2
|
+
|
|
3
|
+
Build-time tools for `@awacloud/fw`, **categorised by usage**. The bundler,
|
|
4
|
+
standalone-generator, catalog, registry, audit and deps tools are the
|
|
5
|
+
packages `@awacloud/tool-fw-bundler` and `@awacloud/tool-fw-codegen`
|
|
6
|
+
(devDependencies here). They are invoked through the `package.json` scripts
|
|
7
|
+
(`bun run prebuild`, `bun run types:registry`, …) or their bins directly
|
|
8
|
+
(`fw-bundler <command>`, `fw-codegen <command>`). `tools/rendering/**` (aot,
|
|
9
|
+
jsx, precompilation) and `tools/_lib/cli-help.js` are fw-private, unchanged,
|
|
10
|
+
still in this package's own tree.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
packages/front/fw/tools/
|
|
14
|
+
├── _lib/ # cli-help.js (still consumed by rendering/aot) — the shared
|
|
15
|
+
│ # scan-modules.js scanner moved to tools/fw-bundler/src/modlib/
|
|
16
|
+
└── rendering/ # template pre-compilation (fw-private)
|
|
17
|
+
├── aot/ → HTML → imperative JS factory
|
|
18
|
+
├── jsx/ → .jsx → ParseResult JSON
|
|
19
|
+
└── precompilation/ → HTML → ParseResult JSON
|
|
20
|
+
|
|
21
|
+
tools/fw-bundler/ # repo-level, mutualized — @awacloud/tool-fw-bundler
|
|
22
|
+
└── src/
|
|
23
|
+
├── bundle/ → presets + side-bundles → dist/build/
|
|
24
|
+
├── standalone/ → self-contained fw module (without runtime)
|
|
25
|
+
└── catalog/ → integrations catalog artifact (fw-bundler catalog)
|
|
26
|
+
|
|
27
|
+
tools/fw-codegen/ # repo-level, mutualized — @awacloud/tool-fw-codegen
|
|
28
|
+
└── src/
|
|
29
|
+
├── registry/ → generates the narrow type registry
|
|
30
|
+
├── audit/ → factory @returns audit
|
|
31
|
+
└── deps/ → deps: [...] companion-field injector
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Ecosystem integrations** (Vite, esbuild, Rollup, Bun, Webpack, Astro, Vitest, ESLint…) live outside `tools/`, in the dedicated [`integrations/`](../../integrations/) scope — they are bridges to community tools, not internal fw tooling.
|
|
35
|
+
|
|
36
|
+
| Sub-tool | Purpose | Entry | npm script |
|
|
37
|
+
| --------------------------------------- | -------------------------------------------------------------------- | ------------------------------ | -------------------- |
|
|
38
|
+
| [`bundler.md`](./bundler.md) | Prebuild orchestrator — emits framework bundles into `dist/build/`. | `tools/fw-bundler` (`bundle`) | `bun run prebuild` |
|
|
39
|
+
| [`standalone.md`](./standalone.md) | Self-contained ESM bundle for a fw module (without runtime). | `tools/fw-bundler` (`standalone`) | `bun run build:standalone` |
|
|
40
|
+
| [`precompilation.md`](./precompilation.md) | Pre-compiles HTML templates into `ParseResult` JSON. | `tools/rendering/precompilation/` | `bun run build:parseresult` |
|
|
41
|
+
| [`aot.md`](./aot.md) | AOT-compiles HTML templates into imperative JS factory functions. | `tools/rendering/aot/` | `bun run build:aot` |
|
|
42
|
+
| [`jsx.md`](./jsx.md) | Compiles `.jsx` templates to `ParseResult` JSON (blessed path, no runtime JSX). | `tools/rendering/jsx/` | — |
|
|
43
|
+
| [`audit.md`](./audit.md) | Audit of factory `@returns` annotations. | `tools/fw-codegen` (`audit`) | `bun run types:audit` |
|
|
44
|
+
| [`codegen.md`](./codegen.md) | Generates `types/registry.generated.d.ts` (narrow resolve). | `tools/fw-codegen` (`registry`) | `bun run types:registry` |
|
|
45
|
+
|
|
46
|
+
Each page follows the same structure: purpose, CLI usage + flags, example, runtime integration if applicable, limitations, cross-links.
|
|
47
|
+
|
|
48
|
+
## Runtime: bun (default) or Node
|
|
49
|
+
|
|
50
|
+
Scripts use **bun** by default, but **all tools also run under Node**:
|
|
51
|
+
|
|
52
|
+
- **bundler**: `dist/build/*` under Node via `--backend esbuild`/`rollup` (see [`bundler.md`](./bundler.md)).
|
|
53
|
+
- **standalone**: `--min` via `esbuild.transform` under Node (otherwise `Bun.build`).
|
|
54
|
+
- **aot / precompilation / codegen / audit**: `node:*` APIs only → Node-capable as-is.
|
|
55
|
+
|
|
56
|
+
Under Node, the fw-private `tools/rendering/**` scripts target `index.js` explicitly (`node tools/rendering/<sub>/index.js`); the mutualized `fw-bundler`/`fw-codegen` tools run via their exported `runCli` entry points — the shipped form is `bun run prebuild:node` — or, inside the awa monorepo, its own task router. Full task table + prerequisites: [`../dev/runtime.md`](../dev/runtime.md).
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# `tools/rendering/aot/` — AOT template compiler
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Walks one or more `.html` template files and emits a `.js` (or `.cjs`) module per template, exposing a factory function `tpl<Name>(data, slots?)` that returns the root `Element`. The generated function calls `document.createElement`/`createElementNS`/`createTextNode` directly — no fw runtime, no parser, no renderer.
|
|
6
|
+
|
|
7
|
+
## CLI usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bun tools/rendering/aot/ <input> [--out <dir>] [--prefix <name>] [--esm|--cjs]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| Flag | Default | Description |
|
|
14
|
+
| ----------- | ------------- | -------------------------------------------------- |
|
|
15
|
+
| `<input>` | (required) | `.html` file or directory (recursive walk). |
|
|
16
|
+
| `--out` | `dist/aot/` | Output directory. |
|
|
17
|
+
| `--prefix` | `tpl` | Factory name prefix. `nav.html` → `tplNav`. |
|
|
18
|
+
| `--esm` | (default) | Emits `export default tpl…`. |
|
|
19
|
+
| `--cjs` | — | Emits `module.exports = tpl…` (filename → `.cjs`). |
|
|
20
|
+
|
|
21
|
+
Convenience npm script: `bun run build:aot <input>`.
|
|
22
|
+
|
|
23
|
+
## Feature support
|
|
24
|
+
|
|
25
|
+
| Feature | AOT (`tools/rendering/aot/`) | ParseResult (`tools/rendering/precompilation/`) |
|
|
26
|
+
| ---------------------------------------- | :----------------: | :------------------------------------: |
|
|
27
|
+
| Static elements / attributes | ✓ | ✓ |
|
|
28
|
+
| `#{var}` text interpolation | ✓ | ✓ |
|
|
29
|
+
| `#{var}` attribute interpolation | ✓ | ✓ |
|
|
30
|
+
| `<!-- $name -->` iterate blocks | ✓ | ✓ |
|
|
31
|
+
| `${slot}` content slots | ✓ | ✓ |
|
|
32
|
+
| SVG child elements (`svg_*`) | ✓ | ✓ |
|
|
33
|
+
| Synthetic mixed-content text nodes | ✓ | ✓ |
|
|
34
|
+
| Runtime `default` value on `map` entries | (always empty fallback) | ✓ |
|
|
35
|
+
| Dynamic template registration | ✗ | ✓ (via `template.fromParseResult`) |
|
|
36
|
+
| Dynamic class composition beyond `#{v}` | ✗ | ✓ (via render data) |
|
|
37
|
+
| Conditional render of arbitrary subtrees | iterate blocks only | iterate blocks only |
|
|
38
|
+
|
|
39
|
+
### When to use which
|
|
40
|
+
|
|
41
|
+
- **AOT (`tools/rendering/aot/`)** — maximum runtime performance and minimal payload. No fw parser/renderer at runtime. Ideal for hot-path views and static dashboards. Locked to template features declared at build time.
|
|
42
|
+
- **ParseResult (`tools/rendering/precompilation/`)** — retains the flexibility of the fw renderer (full `MapEntry` semantics including `default`, runtime data binding, attach/detach) while avoiding the per-template parsing cost. Ideal when templates change frequently or when you rely on advanced renderer features.
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
Input — `nav.html`:
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<nav class="main #{theme}">
|
|
50
|
+
<h1>#{title}</h1>
|
|
51
|
+
<ul>
|
|
52
|
+
<!-- $items -->
|
|
53
|
+
<li><a href="#{href}">#{label}</a></li>
|
|
54
|
+
<!-- items$ -->
|
|
55
|
+
</ul>
|
|
56
|
+
</nav>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Output — `dist/aot/nav.js`:
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
function tplNav(data, slots) {
|
|
63
|
+
data = data || {};
|
|
64
|
+
const _frag = document.createDocumentFragment();
|
|
65
|
+
const el0 = document.createElement("nav");
|
|
66
|
+
el0.setAttribute("class", (data["theme"] !== undefined ? "main " + String(data["theme"]) : "main "));
|
|
67
|
+
const el1 = document.createElement("h1");
|
|
68
|
+
el1.textContent = (data["title"] !== undefined ? String(data["title"]) : "");
|
|
69
|
+
el0.appendChild(el1);
|
|
70
|
+
const el2 = document.createElement("ul");
|
|
71
|
+
{
|
|
72
|
+
const _arr = data["items"];
|
|
73
|
+
if (_arr) for (const item3 of _arr) {
|
|
74
|
+
const el4 = document.createElement("li");
|
|
75
|
+
const el5 = document.createElement("a");
|
|
76
|
+
el5.setAttribute("href", (item3["href"] !== undefined ? String(item3["href"]) : ""));
|
|
77
|
+
el5.textContent = (item3["label"] !== undefined ? String(item3["label"]) : "");
|
|
78
|
+
el4.appendChild(el5);
|
|
79
|
+
el2.appendChild(el4);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
el0.appendChild(el2);
|
|
83
|
+
_frag.appendChild(el0);
|
|
84
|
+
return _frag.firstChild;
|
|
85
|
+
}
|
|
86
|
+
export default tplNav;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Notes / limitations
|
|
90
|
+
|
|
91
|
+
- The generated code is **deterministic** (attributes sorted alphabetically; stable variable names `el<N>` / `item<N>`) for clean diffs.
|
|
92
|
+
- Runs anywhere `document` exists (browser, happy-dom, jsdom). Document this prerequisite for SSR consumers.
|
|
93
|
+
- Zero npm dependencies — only Bun built-ins and the fw parser itself.
|
|
94
|
+
|
|
95
|
+
## Tests
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
bun test tools/rendering/aot/index.test.js
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Covers static elements, text/attribute interpolation, iterate blocks, slots, nesting, deterministic output, and ESM/CJS shape.
|
|
102
|
+
|
|
103
|
+
## See also
|
|
104
|
+
|
|
105
|
+
- [`precompilation.md`](./precompilation.md) — alternative that retains the fw runtime renderer.
|
|
106
|
+
- [`standalone.md`](./standalone.md) — self-contained ESM bundle for a single fw module.
|
|
107
|
+
- [`bundler.md`](./bundler.md) — main prebuild orchestrator.
|
|
108
|
+
- [`../README.md`](../README.md) — general fw doc index.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# `tools/fw-codegen` (`audit`) — Factory return-type audit
|
|
2
|
+
|
|
3
|
+
> Mutualized: the implementation no longer lives
|
|
4
|
+
> under `packages/front/fw/tools/types/audit/` — it was ported
|
|
5
|
+
> logic-verbatim to the repo-level `tools/fw-codegen` package
|
|
6
|
+
> (`tools/fw-codegen/src/audit/`), consumed here as a devDependency
|
|
7
|
+
> (`@awacloud/tool-fw-codegen`) and invoked via its `fw-codegen audit` bin.
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Audits the `@returns` annotation of the `factory` of each module and classifies the result. Used to drive the quality of types emitted in `dist/types/`: a broad `@returns` (`{Object}`, `{Function}`, …) overwrites inference and produces a useless instance type (`resolve('x')` → `{}`). The audit lists precisely the modules to fix.
|
|
12
|
+
|
|
13
|
+
**Read-only** tool: it writes nothing, it only reports.
|
|
14
|
+
|
|
15
|
+
## CLI usage
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
fw-codegen audit # full report (3 buckets)
|
|
19
|
+
fw-codegen audit --lossy-only # only the fix list
|
|
20
|
+
# or via npm script
|
|
21
|
+
bun run types:audit
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| Flag | Description |
|
|
25
|
+
| ---------------- | ----------- |
|
|
26
|
+
| `--lossy-only` | Only displays the LOSSY bucket (correction targets). |
|
|
27
|
+
| `--help, -h` | Displays help. |
|
|
28
|
+
|
|
29
|
+
## Buckets
|
|
30
|
+
|
|
31
|
+
| Bucket | Criterion | Action |
|
|
32
|
+
| --------- | ------------------------------------------------------------------------ | ------ |
|
|
33
|
+
| **TYPED** | `@returns {SomeType}` precise (typedef / constructor / shape). | Nothing. |
|
|
34
|
+
| **INFER** | No `@returns` on the factory → tsc infers from the `return`. | Check (sometimes loose). |
|
|
35
|
+
| **LOSSY** | Broad `@returns`: `{Object}`, `{object}`, `{any}`, `{*}`, `{}`, `{Function}`, `{unknown}`. | **To fix.** |
|
|
36
|
+
|
|
37
|
+
LOSSY entries are sorted by **number of dependants** (usage proxy) — fixing the most-depended-upon modules first maximises impact.
|
|
38
|
+
|
|
39
|
+
## Example
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Factory return-type audit — 169 modules
|
|
43
|
+
TYPED (precise @returns) : 169
|
|
44
|
+
INFER (no @returns) : 0
|
|
45
|
+
LOSSY (wide @returns) : 0 ← fix targets
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
When a module is LOSSY, the fix is the "Variant B" pattern: declare a `@typedef` describing the returned public API + `@returns {<Typedef>}` on the factory (model: `src/io/calc/adler32.js`). See [TypeScript — improving the underlying type](../guide/typescript.md).
|
|
49
|
+
|
|
50
|
+
## How it works
|
|
51
|
+
|
|
52
|
+
1. `scanAll` (via `tools/fw-bundler/src/modlib/scan-modules.js`) enumerates the modules under `src/`.
|
|
53
|
+
2. For each module, the audit locates the `*/` immediately preceding the `factory` (to ignore `factory()` mentions inside `@example` blocks) and extracts the `@returns` type by brace balancing.
|
|
54
|
+
3. Classifies as TYPED / INFER / LOSSY based on the extracted type (set of "broad" types for LOSSY).
|
|
55
|
+
4. Computes the number of dependants for each module (sum of `dependencies` pointing to it) for sorting.
|
|
56
|
+
|
|
57
|
+
## See also
|
|
58
|
+
|
|
59
|
+
- [`codegen.md`](./codegen.md) — indirectly consumes the result: precise types ⇒ a useful narrow registry.
|
|
60
|
+
- [TypeScript](../guide/typescript.md) — the three `resolve` typing tiers and the correction pattern.
|
|
61
|
+
- [`../README.md`](../README.md) — general fw doc index.
|