@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,42 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// packages/front/fw/integrations/astro/index.d.ts
|
|
6
|
+
// Types for the `@awacloud/fw` Astro integration. Does NOT depend on the `astro`
|
|
7
|
+
// package — typed against a minimal structural integration shape (same
|
|
8
|
+
// dependency-free convention as the bundler adapters).
|
|
9
|
+
|
|
10
|
+
export interface FwAstroOptions {
|
|
11
|
+
/** Default preset for the bare `virtual:@awacloud/fw/preset` specifier. Default: `'site'`. */
|
|
12
|
+
preset?: string;
|
|
13
|
+
/** Side-bundles validated up-front (fail fast on misconfiguration). */
|
|
14
|
+
sideBundles?: string[];
|
|
15
|
+
/**
|
|
16
|
+
* Inject the sanity layer as a client-only page script. Default: `false`.
|
|
17
|
+
* `'community'` is recommended: validates inputs without freezing prototypes
|
|
18
|
+
* or blocking APIs (the dev toolbar stays enabled). `'base'` is the strict
|
|
19
|
+
* lockdown — freezes prototypes / blocks APIs (disables the dev toolbar).
|
|
20
|
+
*/
|
|
21
|
+
sanity?: 'base' | 'community' | false;
|
|
22
|
+
/**
|
|
23
|
+
* Override for Astro's dev toolbar. Default: disabled only when
|
|
24
|
+
* `sanity: 'base'` is active (frozen prototypes / blocked APIs break the
|
|
25
|
+
* toolbar); `sanity: 'community'` keeps the toolbar enabled; without
|
|
26
|
+
* `sanity` the toolbar is untouched.
|
|
27
|
+
*/
|
|
28
|
+
devToolbar?: boolean;
|
|
29
|
+
/** Package specifier used in the emitted imports. Default: `'@awacloud/fw'`. */
|
|
30
|
+
packageName?: string;
|
|
31
|
+
/** Override `fw.config.json` path. */
|
|
32
|
+
configPath?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Minimal structural shape of an Astro integration (no dependency on `astro`). */
|
|
36
|
+
export interface FwAstroIntegration {
|
|
37
|
+
name: string;
|
|
38
|
+
hooks: Record<string, (...args: unknown[]) => void>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Create the `@awacloud/fw` Astro integration (re-injects the Vite plugin). */
|
|
42
|
+
export default function fwAstro(options?: FwAstroOptions): FwAstroIntegration;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// packages/front/fw/integrations/astro/index.js
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Official Astro integration for `@awacloud/fw`.
|
|
8
|
+
*
|
|
9
|
+
* Astro builds on **Vite**, so this integration does NOT reimplement the
|
|
10
|
+
* virtual-module logic : it re-injects the existing `@awacloud/fw/vite` plugin via
|
|
11
|
+
* the `astro:config:setup` hook. The virtual presets
|
|
12
|
+
* (`virtual:@awacloud/fw/preset/*`, `…/side-bundle/*`) are then available in any
|
|
13
|
+
* Astro app — `.astro` frontmatter, islands, endpoints — for free.
|
|
14
|
+
*
|
|
15
|
+
* Sanity layer : injected as a **client-only** page script via Astro's
|
|
16
|
+
* `injectScript('page', …)`, NOT through the Vite plugin's `sanity` option.
|
|
17
|
+
* Reason : `sanity/base.js` freezes `window`/`document` and must never run on
|
|
18
|
+
* the SSR server. The Vite plugin injects sanity via `transformIndexHtml`, but
|
|
19
|
+
* Astro generates its own page HTML (Vite's HTML transform does not run for
|
|
20
|
+
* Astro pages) — so we force `sanity: false` on the Vite plugin and let Astro
|
|
21
|
+
* place the script on the client only.
|
|
22
|
+
*
|
|
23
|
+
* SSR : `render.toHTML` (worker-safe, pure data) can run in `.astro`
|
|
24
|
+
* frontmatter / endpoints to produce markup ; the client island rehydrates
|
|
25
|
+
* via `uiSession.hydrate`. This integration does NOT bridge JSX/elm-array —
|
|
26
|
+
* it lets you USE fw inside an Astro app (islands + SSR data).
|
|
27
|
+
*
|
|
28
|
+
* Usage :
|
|
29
|
+
*
|
|
30
|
+
* // astro.config.mjs
|
|
31
|
+
* import { defineConfig } from 'astro/config';
|
|
32
|
+
* import fwAstro from '@awacloud/fw/astro';
|
|
33
|
+
*
|
|
34
|
+
* export default defineConfig({
|
|
35
|
+
* integrations: [fwAstro({ preset: 'site-interactive', sanity: 'community' })],
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* // any .astro / island script
|
|
39
|
+
* import { runtime } from 'virtual:@awacloud/fw/preset/site-interactive';
|
|
40
|
+
*
|
|
41
|
+
* @see ../vite/index.js the plugin this integration re-injects
|
|
42
|
+
* @see ./README.md
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
import fwVite from '../vite/index.js';
|
|
46
|
+
import { sanityImportLine } from '../_shared/core.js';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @typedef {Object} FwAstroOptions
|
|
50
|
+
* @property {string} [preset='site'] Default preset for the bare `virtual:@awacloud/fw/preset` specifier.
|
|
51
|
+
* @property {string[]} [sideBundles=[]] Side-bundles validated up-front.
|
|
52
|
+
* @property {('base'|'community'|false)} [sanity=false] Inject the sanity layer as a client-only page script. `'community'` is recommended: it validates inputs without freezing prototypes or blocking APIs. `'base'` is the strict lockdown (frozen prototypes / blocked APIs) — use only when you need the full enforcement.
|
|
53
|
+
* @property {boolean} [devToolbar] Override for Astro's dev toolbar. Default: disabled only when `sanity: 'base'` is active (frozen prototypes / blocked APIs break the toolbar); `community` keeps the toolbar enabled; without sanity it is untouched.
|
|
54
|
+
* @property {string} [packageName='@awacloud/fw'] Package specifier used in the emitted imports.
|
|
55
|
+
* @property {string} [configPath] Override `fw.config.json` path.
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {FwAstroOptions} [options]
|
|
60
|
+
* @returns {{ name: string, hooks: Record<string, Function> }} Astro integration
|
|
61
|
+
*/
|
|
62
|
+
export default function fwAstro(options = {}) {
|
|
63
|
+
const sanity = options.sanity || false;
|
|
64
|
+
const pkg = options.packageName || '@awacloud/fw';
|
|
65
|
+
// The Vite plugin handles virtual modules ; sanity is forced off here and
|
|
66
|
+
// placed client-only by Astro (see file header).
|
|
67
|
+
const viteOptions = { ...options, sanity: false };
|
|
68
|
+
delete viteOptions.devToolbar;
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
name: '@awacloud/fw',
|
|
72
|
+
hooks: {
|
|
73
|
+
'astro:config:setup': ({ updateConfig, injectScript }) => {
|
|
74
|
+
updateConfig({ vite: { plugins: [fwVite(viteOptions)] } });
|
|
75
|
+
if (sanity) {
|
|
76
|
+
// 'page' → runs on the client for every page, before islands.
|
|
77
|
+
// Routed through the shared `sanityImportLine` (rather than
|
|
78
|
+
// building its own bare-import literal) so the injected
|
|
79
|
+
// script is the INVOKING form (`import {applyBase} …;
|
|
80
|
+
// applyBase();`) — a bare side-effect import of the
|
|
81
|
+
// explicit-call ESM tiers is inert (FINDINGS §c.1).
|
|
82
|
+
// `injectScript`'s body accepts arbitrary statements, so
|
|
83
|
+
// the multi-statement snippet is not a problem here.
|
|
84
|
+
injectScript('page', sanityImportLine(sanity, pkg).trim());
|
|
85
|
+
// Only the strict `base` lockdown breaks the dev toolbar (frozen
|
|
86
|
+
// prototypes / blocked APIs). `community` is toolbar-safe.
|
|
87
|
+
if (sanity === 'base' && options.devToolbar !== true) {
|
|
88
|
+
updateConfig({ devToolbar: { enabled: false } });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# `@awacloud/fw/bun`
|
|
2
|
+
|
|
3
|
+
Official Bun plugin — **consumer role**. For a third-party app built or run with Bun that wants the `@awacloud/fw` virtual modules.
|
|
4
|
+
|
|
5
|
+
> **Distinct from the internal builder.** `tools/fw-bundler` (`bundle`) already uses `Bun.build` to produce `dist/build/*`. This plugin is the *consumer* bridge — same engine, different scope.
|
|
6
|
+
|
|
7
|
+
`Bun.plugin` mirrors the esbuild `onResolve`/`onLoad` API: it is the shortest adapter. Emitted code is identical to Vite/esbuild/Rollup.
|
|
8
|
+
|
|
9
|
+
## Usage — build
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import fwBun from '@awacloud/fw/bun';
|
|
13
|
+
|
|
14
|
+
await Bun.build({
|
|
15
|
+
entrypoints: ['./src/app.js'],
|
|
16
|
+
outdir: './dist',
|
|
17
|
+
plugins: [fwBun({ preset: 'site-interactive', sanity: 'base' })],
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage — runtime (`bunfig.toml`)
|
|
22
|
+
|
|
23
|
+
```toml
|
|
24
|
+
# bunfig.toml
|
|
25
|
+
preload = ["./fw-register.js"]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
// fw-register.js
|
|
30
|
+
import { plugin } from 'bun';
|
|
31
|
+
import fwBun from '@awacloud/fw/bun';
|
|
32
|
+
|
|
33
|
+
plugin(fwBun({ preset: 'site' }));
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
// app.js — resolved at runtime via the preloaded plugin
|
|
38
|
+
import { runtime } from 'virtual:@awacloud/fw/preset/site';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Virtual modules
|
|
42
|
+
|
|
43
|
+
| Specifier | Content |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `virtual:@awacloud/fw/preset` | pre-instantiated runtime for the default preset |
|
|
46
|
+
| `virtual:@awacloud/fw/preset/<name>` | same for preset `<name>` |
|
|
47
|
+
| `virtual:@awacloud/fw/side-bundle/<name>` | `install(runtime)` + `modules` |
|
|
48
|
+
|
|
49
|
+
## Options
|
|
50
|
+
|
|
51
|
+
| Option | Type | Default | Role |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| `preset` | `string` | `'site'` | preset of the specifier without suffix |
|
|
54
|
+
| `sideBundles` | `string[]` | `[]` | side-bundles validated at startup |
|
|
55
|
+
| `sanity` | `'base' \| 'community' \| 'lockdown' \| false` | `false` | sanity layer on each entry (**build-time only**) |
|
|
56
|
+
| `packageName` | `string` | `'@awacloud/fw'` | specifier used in emitted imports |
|
|
57
|
+
| `configPath` | `string` | bundled | override for `fw.config.json` |
|
|
58
|
+
|
|
59
|
+
## Notes
|
|
60
|
+
|
|
61
|
+
- **Sanity**: injected on `entrypoints` at build time (`build.config.entrypoints`). `'lockdown'` emits `import { lockdown } from '…'; lockdown();` (explicit-call module, not an IIFE). In runtime mode (`plugin()`), `build.config` is absent → import manually (`import { applyBase } from '@awacloud/fw/sanity/base'; applyBase();` or `import { lockdown } from '@awacloud/fw/sanity/lockdown'; lockdown();`). Browser-only.
|
|
62
|
+
- **Dual use**: the same plugin object works for both `Bun.build({ plugins })` and the runtime `plugin()`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// packages/front/fw/integrations/bun/index.d.ts
|
|
6
|
+
// Types for the `@awacloud/fw` Bun plugin. Does NOT depend on `bun-types` — typed
|
|
7
|
+
// against a minimal structural plugin shape (same convention as the other
|
|
8
|
+
// bundler adapters).
|
|
9
|
+
|
|
10
|
+
export interface FwBunOptions {
|
|
11
|
+
/** Default preset for the bare `virtual:@awacloud/fw/preset` specifier. Default: `'site'`. */
|
|
12
|
+
preset?: string;
|
|
13
|
+
/** Side-bundles validated up-front (fail fast on misconfiguration). */
|
|
14
|
+
sideBundles?: string[];
|
|
15
|
+
/** Prepend the sanity layer to every entry point (build-time only). Default: `false`. */
|
|
16
|
+
sanity?: 'base' | 'community' | 'lockdown' | false;
|
|
17
|
+
/** Package specifier used in the emitted imports. Default: `'@awacloud/fw'`. */
|
|
18
|
+
packageName?: string;
|
|
19
|
+
/** Override `fw.config.json` path. */
|
|
20
|
+
configPath?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Minimal structural shape of a Bun plugin (no dependency on `bun-types`). */
|
|
24
|
+
export interface FwBunPlugin {
|
|
25
|
+
name: string;
|
|
26
|
+
setup(build: unknown): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Create the `@awacloud/fw` Bun consumer plugin (works with `Bun.build` and runtime `plugin()`). */
|
|
30
|
+
export default function fwBun(options?: FwBunOptions): FwBunPlugin;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// packages/front/fw/integrations/bun/index.js
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Official Bun plugin for `@awacloud/fw` (consumer).
|
|
8
|
+
*
|
|
9
|
+
* IMPORTANT — this is the *consumer* plugin, for a third-party app built or
|
|
10
|
+
* run with Bun that wants the virtual presets. It is DISTINCT from the
|
|
11
|
+
* internal builder (`tools/fw-bundler` (`bundle`)) which uses `Bun.build` to produce
|
|
12
|
+
* `dist/build/*`. Same engine, different perimeters — do not conflate them.
|
|
13
|
+
*
|
|
14
|
+
* Exposes the same virtual modules as every other adapter :
|
|
15
|
+
* - `virtual:@awacloud/fw/preset/<name>` — pre-instantiated runtime for a preset.
|
|
16
|
+
* - `virtual:@awacloud/fw/side-bundle/<name>` — `install(runtime)` helper for a side-bundle.
|
|
17
|
+
*
|
|
18
|
+
* `Bun.plugin` mirrors esbuild's `onResolve`/`onLoad`, so this adapter is the
|
|
19
|
+
* shortest port. The emitted code (shared `_shared/core.js`) is identical to
|
|
20
|
+
* the Vite / esbuild / Rollup output.
|
|
21
|
+
*
|
|
22
|
+
* Usage — at build time :
|
|
23
|
+
*
|
|
24
|
+
* import fwBun from '@awacloud/fw/bun';
|
|
25
|
+
* await Bun.build({
|
|
26
|
+
* entrypoints: ['./src/app.js'],
|
|
27
|
+
* outdir: './dist',
|
|
28
|
+
* plugins: [fwBun({ preset: 'site-interactive', sanity: 'base' })],
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* Usage — at runtime (bunfig.toml `preload`) :
|
|
32
|
+
*
|
|
33
|
+
* // bunfig.toml : preload = ["./fw-register.js"]
|
|
34
|
+
* // fw-register.js :
|
|
35
|
+
* import { plugin } from 'bun';
|
|
36
|
+
* import fwBun from '@awacloud/fw/bun';
|
|
37
|
+
* plugin(fwBun({ preset: 'site' }));
|
|
38
|
+
*
|
|
39
|
+
* @see ../_shared/core.js
|
|
40
|
+
* @see ../esbuild/index.js near-identical adapter
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
import { readFileSync } from 'node:fs';
|
|
44
|
+
import { resolve, extname } from 'node:path';
|
|
45
|
+
|
|
46
|
+
import {
|
|
47
|
+
createFwCore,
|
|
48
|
+
VIRTUAL_PRESET_PREFIX,
|
|
49
|
+
VIRTUAL_SIDE_PREFIX,
|
|
50
|
+
} from '../_shared/core.js';
|
|
51
|
+
|
|
52
|
+
const NAMESPACE = 'awa-fw';
|
|
53
|
+
const FILTER = /^virtual:@awacloud\/fw\/(preset|side-bundle)(\/.*)?$/;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @param {string} file
|
|
57
|
+
* @returns {('js'|'jsx'|'ts'|'tsx')}
|
|
58
|
+
*/
|
|
59
|
+
function loaderFor(file) {
|
|
60
|
+
switch (extname(file)) {
|
|
61
|
+
case '.ts': return 'ts';
|
|
62
|
+
case '.tsx': return 'tsx';
|
|
63
|
+
case '.jsx': return 'jsx';
|
|
64
|
+
default: return 'js';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @typedef {Object} FwBunOptions
|
|
70
|
+
* @property {string} [preset='site'] Default preset for the bare `virtual:@awacloud/fw/preset` specifier.
|
|
71
|
+
* @property {string[]} [sideBundles=[]] Side-bundles validated up-front.
|
|
72
|
+
* @property {('base'|'community'|'lockdown'|false)} [sanity=false] Prepend the sanity layer to every entry point (build-time only).
|
|
73
|
+
* @property {string} [packageName='@awacloud/fw'] Package specifier used in the emitted imports.
|
|
74
|
+
* @property {string} [configPath] Override `fw.config.json` path.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @param {FwBunOptions} [options]
|
|
79
|
+
* @returns {{ name: string, setup: (build: any) => void }} Bun plugin
|
|
80
|
+
*/
|
|
81
|
+
export default function fwBun(options = {}) {
|
|
82
|
+
const sanity = options.sanity || false;
|
|
83
|
+
// Shared core : config load + source-tree scan + virtual matcher/emitter.
|
|
84
|
+
const core = createFwCore(options);
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
name: '@awacloud/fw',
|
|
88
|
+
setup(build) {
|
|
89
|
+
// 0. RUNTIME mode (`plugin()` via bunfig `preload`) : static imports
|
|
90
|
+
// of virtual specifiers are not routed through `onResolve` — the
|
|
91
|
+
// runtime API for non-file modules is `build.module(exactId, cb)`.
|
|
92
|
+
// The specifier set is enumerable from the config, so register
|
|
93
|
+
// every preset / side-bundle up-front. Runtime is detected by the
|
|
94
|
+
// ABSENCE of `build.config` (present in `Bun.build`, where
|
|
95
|
+
// `build.module` exists but throws, and the onResolve/onLoad pair
|
|
96
|
+
// below applies instead).
|
|
97
|
+
if (!build.config && typeof build.module === 'function') {
|
|
98
|
+
const ids = [
|
|
99
|
+
VIRTUAL_PRESET_PREFIX,
|
|
100
|
+
...Object.keys(core.config.presets || {}).map((n) => `${VIRTUAL_PRESET_PREFIX}/${n}`),
|
|
101
|
+
...Object.keys(core.config.sideBundles || {}).map((n) => `${VIRTUAL_SIDE_PREFIX}/${n}`),
|
|
102
|
+
];
|
|
103
|
+
for (const id of ids) {
|
|
104
|
+
const contents = core.emit(id);
|
|
105
|
+
if (contents == null) continue;
|
|
106
|
+
build.module(id, () => ({ contents, loader: 'js' }));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 1. Virtual modules (Bun.build).
|
|
111
|
+
build.onResolve({ filter: FILTER }, (args) => ({ path: args.path, namespace: NAMESPACE }));
|
|
112
|
+
|
|
113
|
+
build.onLoad({ filter: /.*/, namespace: NAMESPACE }, (args) => {
|
|
114
|
+
const contents = core.emit(args.path);
|
|
115
|
+
if (contents == null) return undefined;
|
|
116
|
+
return { contents, loader: 'js' };
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// 2. Sanity layer on entry points (build-time only ; `build.config`
|
|
120
|
+
// is present for `Bun.build`, absent for a runtime `plugin()`).
|
|
121
|
+
const entrypoints = build.config && Array.isArray(build.config.entrypoints)
|
|
122
|
+
? build.config.entrypoints
|
|
123
|
+
: [];
|
|
124
|
+
if (sanity && entrypoints.length) {
|
|
125
|
+
const entries = new Set(entrypoints.map((p) => resolve(process.cwd(), p)));
|
|
126
|
+
build.onLoad({ filter: /\.[cm]?[jt]sx?$/ }, (args) => {
|
|
127
|
+
if (!entries.has(args.path)) return undefined;
|
|
128
|
+
const original = readFileSync(args.path, 'utf8');
|
|
129
|
+
return { contents: core.sanityImportLine(sanity) + original, loader: loaderFor(args.path) };
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# `@awacloud/fw` — Deno
|
|
2
|
+
|
|
3
|
+
**Runtime target** (compat), not a plugin. `@awacloud/fw` being **zero-dependency ESM** built on **standard Web APIs**, it runs under Deno almost as-is. This page documents the compat and friction points. See also [`../nodejs/`](../nodejs/README.md) (same browser/server boundary).
|
|
4
|
+
|
|
5
|
+
## Why it aligns
|
|
6
|
+
|
|
7
|
+
- **Zero dependency** → nothing to resolve via npm for the core.
|
|
8
|
+
- **Web APIs** (`crypto.subtle`, `getRandomValues`, `TextEncoder`, `structuredClone`, `fetch`…) natively present under Deno.
|
|
9
|
+
- The **sanity layer** is standard Web JS (prototype freezing, API blocking) → works in a browser/Deno Worker context.
|
|
10
|
+
|
|
11
|
+
## Consumption
|
|
12
|
+
|
|
13
|
+
### Via `npm:` (post-publication)
|
|
14
|
+
```ts
|
|
15
|
+
import { hex } from 'npm:@awacloud/fw/io/codec/hex.js';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Via import map (`deno.json`)
|
|
19
|
+
```jsonc
|
|
20
|
+
// deno.json — see the provided example
|
|
21
|
+
{ "imports": { "@awacloud/fw": "npm:@awacloud/fw", "@awacloud/fw/": "npm:/@awacloud/fw/" } }
|
|
22
|
+
```
|
|
23
|
+
```ts
|
|
24
|
+
import { ModuleRuntime } from '@awacloud/fw/core/runtime';
|
|
25
|
+
import { hex } from '@awacloud/fw/io/codec/hex.js';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Smoke test
|
|
29
|
+
|
|
30
|
+
[`check-deno.ts`](https://github.com/awacloud/awa/blob/main/packages/front/fw/integrations/deno/check-deno.ts) runs a few worker-safe modules (hex, utf8, sha256) under Deno:
|
|
31
|
+
```sh
|
|
32
|
+
deno run --allow-read integrations/deno/check-deno.ts
|
|
33
|
+
```
|
|
34
|
+
In-repo it imports `../../src` directly (no need to publish). Logic validated under Node/bun; **requires Deno** for the actual run.
|
|
35
|
+
|
|
36
|
+
## Boundary & friction
|
|
37
|
+
|
|
38
|
+
| Topic | Status under Deno |
|
|
39
|
+
|---|---|
|
|
40
|
+
| Worker-safe modules (crypto, io/codec, io/compress, io/math, process, valid…) | ✅ run as-is |
|
|
41
|
+
| `dom/*` + `sanity` modules | ⛔ **browser-only** — do not resolve server-side under Deno (same boundary as Node) |
|
|
42
|
+
| **Serialized Worker** (`runtime.serialize()` → `new Worker(url, { type: 'module' })`) | ⚠️ **to validate as a priority** — Web-standard so likely fine, but the Deno Worker context ≠ browser. This is the core of the fw model. |
|
|
43
|
+
| **Build** (`dist/build/*`) | Consume pre-built bundles. Building *under* Deno = via `esbuild` npm + `esbuild_deno_loader` (not targeted by default) — `Bun.build` unavailable. |
|
|
44
|
+
| **Tests** | `deno test` has its own API **without `expect()`** → the `bun:test` shim does not map. Use **[Vitest](../vitest/README.md)** (Deno can run Vitest via npm compat) rather than a `Deno.test` port. |
|
|
45
|
+
| **Permissions** | crypto/io access neither the FS nor the network → few `--allow-*` flags needed. Document per use case. |
|
|
46
|
+
|
|
47
|
+
## Open questions
|
|
48
|
+
|
|
49
|
+
- **Serialized Worker under Deno**: the only real technical risk — to test once Deno is in the loop.
|
|
50
|
+
- **JSR**: publish on the Deno registry (JSR) too? Out of scope until npm publication is done.
|
|
51
|
+
- Depends on **publishing** `npm:@awacloud/fw` for the simplest path (otherwise import map → source/CDN).
|
|
52
|
+
|
|
53
|
+
## Status
|
|
54
|
+
|
|
55
|
+
Compat **documented + smoke test provided**. Real runtime validation (and especially Worker serialization) **pending a Deno environment**.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Example Deno config for consuming @awacloud/fw. Maps the package to npm: specifiers (post-publication). In-repo, check-deno.ts imports ../../src directly and needs no map.",
|
|
3
|
+
"imports": {
|
|
4
|
+
"@awacloud/fw": "npm:@awacloud/fw",
|
|
5
|
+
"@awacloud/fw/": "npm:/@awacloud/fw/"
|
|
6
|
+
},
|
|
7
|
+
"tasks": {
|
|
8
|
+
"fw:check": "deno run --allow-read integrations/deno/check-deno.ts"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# `@awacloud/fw/esbuild`
|
|
2
|
+
|
|
3
|
+
Official esbuild plugin — **consumer role** (role 1). Exposes the same virtual modules as the Vite plugin, via esbuild's native `onResolve`/`onLoad`.
|
|
4
|
+
|
|
5
|
+
> **Role 2** (esbuild as a *Node build backend* replacing `Bun.build`) is delivered in [`backend.js`](./backend.js) — see the section below.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
`esbuild` is a **peer dependency** (provided by the app). The plugin does not depend on it at the type level (minimal structural shape).
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import * as esbuild from 'esbuild';
|
|
15
|
+
import fwEsbuild from '@awacloud/fw/esbuild';
|
|
16
|
+
|
|
17
|
+
await esbuild.build({
|
|
18
|
+
entryPoints: ['src/app.js'],
|
|
19
|
+
bundle: true,
|
|
20
|
+
format: 'esm',
|
|
21
|
+
outfile: 'dist/app.js',
|
|
22
|
+
plugins: [fwEsbuild({ preset: 'site-interactive', sanity: 'base' })],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
// src/app.js
|
|
28
|
+
import { runtime } from 'virtual:@awacloud/fw/preset/site-interactive';
|
|
29
|
+
|
|
30
|
+
// code-split side-bundle loaded on demand
|
|
31
|
+
const cryptoBasic = await import('virtual:@awacloud/fw/side-bundle/crypto-basic');
|
|
32
|
+
cryptoBasic.install(runtime);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Virtual modules
|
|
36
|
+
|
|
37
|
+
| Specifier | Content |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `virtual:@awacloud/fw/preset` | pre-instantiated runtime for the default preset (`options.preset`) |
|
|
40
|
+
| `virtual:@awacloud/fw/preset/<name>` | same for preset `<name>` |
|
|
41
|
+
| `virtual:@awacloud/fw/side-bundle/<name>` | `export function install(runtime)` + `modules` |
|
|
42
|
+
|
|
43
|
+
The emitted code is **identical** to that of the other bundlers (shared core `../_shared/core.js`): direct subpath imports + `registerAllDeep`. esbuild follows these imports and tree-shakes what the app does not use.
|
|
44
|
+
|
|
45
|
+
## Options
|
|
46
|
+
|
|
47
|
+
| Option | Type | Default | Role |
|
|
48
|
+
|---|---|---|---|
|
|
49
|
+
| `preset` | `string` | `'site'` | preset of the `virtual:@awacloud/fw/preset` specifier (without suffix) |
|
|
50
|
+
| `sideBundles` | `string[]` | `[]` | side-bundles validated at startup (immediate failure if unknown) |
|
|
51
|
+
| `sanity` | `'base' \| 'community' \| 'lockdown' \| false` | `false` | prefixes the sanity layer on each **entry point** |
|
|
52
|
+
| `packageName` | `string` | `'@awacloud/fw'` | specifier used in emitted imports |
|
|
53
|
+
| `configPath` | `string` | bundled | override for `fw.config.json` |
|
|
54
|
+
| `resolveDir` | `string` | build cwd | resolution directory for the emitted `@awacloud/fw/*` imports |
|
|
55
|
+
|
|
56
|
+
## Node build backend (role 2) — [`backend.js`](./backend.js)
|
|
57
|
+
|
|
58
|
+
**Node** replacement for the bun-specific builder (`tools/fw-bundler/src/bundle/lib/bundler.js` → `Bun.build` + `Bun.gzipSync`), to produce the standalone bundles `dist/build/*` **without bun**. Same contract (`buildOne`/`buildClassical` → `{ outputs, outFile, bytes, hashSha256, gzBytes }`), hash via `node:crypto`, gzip via `node:zlib`. `sanity.min.js` is emitted in `format: 'iife'`.
|
|
59
|
+
|
|
60
|
+
The selector (`tools/fw-bundler/src/bundle/lib/bundler.js`) picks the backend: **bun by default**, esbuild if forced (`--backend esbuild` / `FW_BUILD_BACKEND=esbuild`) or when bun is absent (auto). The esbuild backend is lazily imported (a bun build never needs esbuild).
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
bun run setup:e2e # installs esbuild (+ bundlers) on demand
|
|
64
|
+
bun run prebuild:node # node ../../../tools/fw-bundler/src/bundle/index.js --backend esbuild → dist/build/* under pure Node
|
|
65
|
+
bun run prebuild:esbuild # bun, but esbuild backend (test)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Validated: full build under pure Node (8 presets + 8 side-bundles + sanity, `pure` and `classic` variants). Sizes comparable to the bun backend (core.min ≈ 25.6 KB vs 26.2 KB).
|
|
69
|
+
|
|
70
|
+
> **Node invocation**: target `index.js` explicitly (`node ../../../tools/fw-bundler/src/bundle/index.js`), not the directory — `node <dir>` does not set `argv[1]` to the resolved file, so the `isMainModule` guard would not execute `main()`.
|
|
71
|
+
|
|
72
|
+
## Notes (consumer plugin)
|
|
73
|
+
|
|
74
|
+
- **Sanity & entry points**: esbuild has no "transform on entry" hook like Vite. The plugin re-emits each declared entry (`entryPoints`) with the `@awacloud/fw/sanity/<base|community>` import prefixed, or with `import { lockdown } from '@awacloud/fw/sanity/lockdown'; lockdown();` for `'lockdown'` (explicit-call module, not an IIFE). The sanity layer is **browser-only** — do not enable it for a pure Node/Worker target.
|
|
75
|
+
- **`resolveDir`**: the emitted `@awacloud/fw/*` imports are resolved from the build cwd (the app's `node_modules`). For non-standard layouts, override via `resolveDir`.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// packages/front/fw/integrations/esbuild/backend.js
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview esbuild **build backend** for `@awacloud/fw` (esbuild role 2).
|
|
8
|
+
*
|
|
9
|
+
* Drop-in replacement for the bun-specific builder
|
|
10
|
+
* (`tools/fw-bundler/src/bundle/lib/bundler.js` → `Bun.build` + `Bun.gzipSync`) so the
|
|
11
|
+
* autonomous bundles (`dist/build/*`) can be produced under **pure Node**.
|
|
12
|
+
*
|
|
13
|
+
* Same contract as the bun backend :
|
|
14
|
+
* buildOne(opts) → { outputs, outFile, bytes, hashSha256, gzBytes }
|
|
15
|
+
* buildClassical(opts) → idem (IIFE, for sanity.min.js)
|
|
16
|
+
*
|
|
17
|
+
* Writes the output to `outdir` ; the orchestrator renames it afterwards
|
|
18
|
+
* (`renameOutput`). Hash via `node:crypto`, gzip size via `node:zlib` — no bun
|
|
19
|
+
* primitive. esbuild is a peer installed on demand (`bun run setup:e2e`).
|
|
20
|
+
*
|
|
21
|
+
* Selected by `tools/fw-bundler/src/bundle/lib/bundler.js` when the backend is
|
|
22
|
+
* `esbuild` (forced via `--backend esbuild` / `FW_BUILD_BACKEND`, or auto when
|
|
23
|
+
* not running under bun).
|
|
24
|
+
*
|
|
25
|
+
* @see ./README.md
|
|
26
|
+
* @see ../nodejs/README.md
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
30
|
+
import { createHash } from 'node:crypto';
|
|
31
|
+
import { gzipSync } from 'node:zlib';
|
|
32
|
+
import { resolve, dirname, basename } from 'node:path';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* esbuild plugin marking the listed specifiers as external — mirrors the bun
|
|
36
|
+
* backend's `mark-external` plugin (the `onResolve` API is identical). esbuild's
|
|
37
|
+
* native `external` already handles bare specifiers ; this also catches the
|
|
38
|
+
* exact relative/literal ones so they survive verbatim.
|
|
39
|
+
* @param {string[]} external
|
|
40
|
+
*/
|
|
41
|
+
function markExternal(external) {
|
|
42
|
+
return {
|
|
43
|
+
name: 'mark-external',
|
|
44
|
+
setup(b) {
|
|
45
|
+
for (const spec of external) {
|
|
46
|
+
const escaped = spec.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
47
|
+
b.onResolve({ filter: new RegExp(`^${escaped}$`) }, (args) => ({ path: args.path, external: true }));
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @param {unknown} e @returns {string} */
|
|
54
|
+
function formatEsbuildErrors(e) {
|
|
55
|
+
const errs = e && typeof e === 'object' && Array.isArray(e.errors) ? e.errors : null;
|
|
56
|
+
if (!errs) return (e && e.message) || String(e);
|
|
57
|
+
return errs.map((er) => {
|
|
58
|
+
const loc = er.location ? ` at ${er.location.file}:${er.location.line}:${er.location.column}` : '';
|
|
59
|
+
return `[error] ${er.text}${loc}`;
|
|
60
|
+
}).join('\n');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** @param {('none'|'browser'|'node'|'neutral'|string)} target */
|
|
64
|
+
function platformFor(target) {
|
|
65
|
+
if (target === 'node') return 'node';
|
|
66
|
+
if (target === 'neutral') return 'neutral';
|
|
67
|
+
return 'browser';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Build a single entry with esbuild. Same signature/return as the bun backend.
|
|
72
|
+
* @returns {Promise<{ outputs: string[], outFile: string, bytes: number, hashSha256: string, gzBytes: number }>}
|
|
73
|
+
*/
|
|
74
|
+
export async function buildOne({
|
|
75
|
+
entry,
|
|
76
|
+
outdir,
|
|
77
|
+
outFileName,
|
|
78
|
+
minify = true,
|
|
79
|
+
sourcemap = 'external',
|
|
80
|
+
format = 'esm',
|
|
81
|
+
target = 'browser',
|
|
82
|
+
external,
|
|
83
|
+
}) {
|
|
84
|
+
const { build } = await import('esbuild');
|
|
85
|
+
|
|
86
|
+
// Deterministic, collision-free intermediate name in `outdir` (the
|
|
87
|
+
// orchestrator renames to the final `fw.<…>.js` afterwards). Distinct
|
|
88
|
+
// per target dir + minify flag so concurrent calls never clash.
|
|
89
|
+
const base = outFileName
|
|
90
|
+
? outFileName.replace(/\.js$/, '')
|
|
91
|
+
: `${basename(dirname(entry))}${minify ? '.min' : ''}`;
|
|
92
|
+
const outFile = resolve(outdir, `${base}.js`);
|
|
93
|
+
|
|
94
|
+
/** @type {Record<string, unknown>} */
|
|
95
|
+
const opts = {
|
|
96
|
+
entryPoints: [entry],
|
|
97
|
+
outfile: outFile,
|
|
98
|
+
bundle: true,
|
|
99
|
+
format,
|
|
100
|
+
platform: platformFor(target),
|
|
101
|
+
minify,
|
|
102
|
+
sourcemap: sourcemap === 'none' ? false : true,
|
|
103
|
+
legalComments: 'none',
|
|
104
|
+
logLevel: 'silent',
|
|
105
|
+
write: true,
|
|
106
|
+
};
|
|
107
|
+
if (external && external.length) {
|
|
108
|
+
opts.external = [...external];
|
|
109
|
+
opts.plugins = [markExternal(external)];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
await build(opts);
|
|
114
|
+
} catch (e) {
|
|
115
|
+
throw new Error(`esbuild.build failed for ${entry}:\n${formatEsbuildErrors(e)}`, { cause: e });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const buf = readFileSync(outFile);
|
|
119
|
+
const outputs = [outFile];
|
|
120
|
+
const mapFile = `${outFile}.map`;
|
|
121
|
+
if (existsSync(mapFile)) outputs.push(mapFile);
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
outputs,
|
|
125
|
+
outFile,
|
|
126
|
+
bytes: buf.byteLength,
|
|
127
|
+
hashSha256: createHash('sha256').update(buf).digest('hex'),
|
|
128
|
+
gzBytes: gzipSync(buf).byteLength,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Build a classical (IIFE) script — used for `sanity.min.js`. esbuild's `iife`
|
|
134
|
+
* format wraps the (already self-invoking) source ; valid as a `<script>` blob.
|
|
135
|
+
* @returns {Promise<{ outputs: string[], outFile: string, bytes: number, hashSha256: string, gzBytes: number }>}
|
|
136
|
+
*/
|
|
137
|
+
export async function buildClassical({ entry, outdir, outFileName, minify = true }) {
|
|
138
|
+
return buildOne({
|
|
139
|
+
entry,
|
|
140
|
+
outdir,
|
|
141
|
+
outFileName,
|
|
142
|
+
minify,
|
|
143
|
+
sourcemap: 'none',
|
|
144
|
+
format: 'iife',
|
|
145
|
+
target: 'browser',
|
|
146
|
+
});
|
|
147
|
+
}
|