@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,201 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// packages/front/fw/integrations/_shared/config-resolve.js
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Pure resolver for `fw.config.json` — **no `node:fs`, no
|
|
8
|
+
* source-tree scanning**. It takes an already-parsed config object plus the
|
|
9
|
+
* committed module catalog (`catalog.generated.json`) and produces a
|
|
10
|
+
* fully-resolved `BuildConfig`.
|
|
11
|
+
*
|
|
12
|
+
* Responsibilities (ported verbatim from the former build-side config loader,
|
|
13
|
+
* same semantics and `[config]` error messages):
|
|
14
|
+
* - Resolve `extends` cascading per preset (cycle-detected, deduplicated).
|
|
15
|
+
* - Apply default `variants` / `endpoint` per preset and side-bundle.
|
|
16
|
+
* - Synthesise the `full` preset from the catalog data.
|
|
17
|
+
*
|
|
18
|
+
* Byte-for-byte identical resolution semantics to the original loader — the
|
|
19
|
+
* only difference is the input shape (a parsed object + catalog data, instead
|
|
20
|
+
* of a file path + a live `scanAll`), so a single shipped code path serves
|
|
21
|
+
* both the default `fw.config.json` and an `options.configPath` override.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @typedef {('pure' | 'classic')} Variant
|
|
26
|
+
*
|
|
27
|
+
* @typedef {Object} PresetSpec
|
|
28
|
+
* @property {string} name
|
|
29
|
+
* @property {string} [description]
|
|
30
|
+
* @property {string[]} modules Fully resolved (`extends` cascade applied), deduped.
|
|
31
|
+
* @property {Variant[]} variants
|
|
32
|
+
* @property {string} endpoint Global property name used by the `classic` variant (`globalThis.<endpoint>`).
|
|
33
|
+
*
|
|
34
|
+
* @typedef {Object} SideBundleSpec
|
|
35
|
+
* @property {string} name
|
|
36
|
+
* @property {string} [description]
|
|
37
|
+
* @property {string[]} modules
|
|
38
|
+
* @property {Variant[]} variants
|
|
39
|
+
* @property {string} endpoint Global property name read by the `classic` variant.
|
|
40
|
+
*
|
|
41
|
+
* @typedef {Object} BuildDefaults
|
|
42
|
+
* @property {Variant[]} variants
|
|
43
|
+
* @property {string} endpoint
|
|
44
|
+
*
|
|
45
|
+
* @typedef {Object} BuildConfig
|
|
46
|
+
* @property {BuildDefaults} defaults Global defaults (variants, …).
|
|
47
|
+
* @property {Record<string, PresetSpec>} presets Resolved presets.
|
|
48
|
+
* @property {Record<string, SideBundleSpec>} sideBundles Resolved side-bundles.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Resolve a parsed `fw.config.json` object into a `BuildConfig`. Pure: never
|
|
53
|
+
* reads the filesystem, never scans the source tree. Resolves `extends`
|
|
54
|
+
* cascading, deduplicates, applies default variants/endpoint.
|
|
55
|
+
*
|
|
56
|
+
* @param {Object} raw Parsed `fw.config.json` object.
|
|
57
|
+
* @param {Object} [opts]
|
|
58
|
+
* @param {Variant[]} [opts.defaultVariantsFallback=['pure']] Fallback when `defaults.variants` is absent.
|
|
59
|
+
* @param {string} [opts.defaultEndpointFallback='fw'] Fallback when `defaults.endpoint` is absent.
|
|
60
|
+
* @returns {BuildConfig}
|
|
61
|
+
*/
|
|
62
|
+
export function resolveConfig(raw, { defaultVariantsFallback = ['pure'], defaultEndpointFallback = 'fw' } = {}) {
|
|
63
|
+
const defaultVariants = readVariants(raw.defaults?.variants, 'defaults', defaultVariantsFallback);
|
|
64
|
+
const defaultEndpoint = readEndpoint(raw.defaults?.endpoint, 'defaults', defaultEndpointFallback);
|
|
65
|
+
|
|
66
|
+
const rawPresets = raw.presets || {};
|
|
67
|
+
/** @type {Record<string, PresetSpec>} */
|
|
68
|
+
const presets = {};
|
|
69
|
+
for (const name of Object.keys(rawPresets)) {
|
|
70
|
+
presets[name] = {
|
|
71
|
+
name,
|
|
72
|
+
description: rawPresets[name].description,
|
|
73
|
+
modules: resolvePresetModules(name, rawPresets, new Set()),
|
|
74
|
+
variants: readVariants(rawPresets[name].variants, `presets.${name}`, defaultVariants),
|
|
75
|
+
endpoint: readEndpoint(rawPresets[name].endpoint, `presets.${name}`, defaultEndpoint),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const rawSide = raw.sideBundles || {};
|
|
80
|
+
/** @type {Record<string, SideBundleSpec>} */
|
|
81
|
+
const sideBundles = {};
|
|
82
|
+
for (const [name, spec] of Object.entries(rawSide)) {
|
|
83
|
+
sideBundles[name] = {
|
|
84
|
+
name,
|
|
85
|
+
description: spec.description,
|
|
86
|
+
modules: Array.isArray(spec.modules) ? [...new Set(spec.modules)] : [],
|
|
87
|
+
variants: readVariants(spec.variants, `sideBundles.${name}`, defaultVariants),
|
|
88
|
+
endpoint: readEndpoint(spec.endpoint, `sideBundles.${name}`, defaultEndpoint),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return { defaults: { variants: defaultVariants, endpoint: defaultEndpoint }, presets, sideBundles };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Recursively resolve a preset's full module list by applying `extends`.
|
|
97
|
+
* Detects cycles and rejects them with a clear `a -> b -> a` message.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} name
|
|
100
|
+
* @param {Record<string, { extends?: string, modules?: string[] }>} all
|
|
101
|
+
* @param {Set<string>} chain Current `extends` chain for cycle detection.
|
|
102
|
+
* @returns {string[]}
|
|
103
|
+
*/
|
|
104
|
+
function resolvePresetModules(name, all, chain) {
|
|
105
|
+
const spec = all[name];
|
|
106
|
+
if (!spec) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
`[config] preset "${name}" is referenced via extends but not defined`
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
if (chain.has(name)) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`[config] cycle in preset extends: ${[...chain, name].join(' -> ')}`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
chain.add(name);
|
|
117
|
+
const base = spec.extends ? resolvePresetModules(spec.extends, all, chain) : [];
|
|
118
|
+
chain.delete(name);
|
|
119
|
+
|
|
120
|
+
const own = Array.isArray(spec.modules) ? spec.modules : [];
|
|
121
|
+
// Deduplicate while preserving first-seen order (cascade then own).
|
|
122
|
+
const seen = new Set();
|
|
123
|
+
const out = [];
|
|
124
|
+
for (const m of [...base, ...own]) {
|
|
125
|
+
if (seen.has(m)) continue;
|
|
126
|
+
seen.add(m);
|
|
127
|
+
out.push(m);
|
|
128
|
+
}
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Normalise + validate a `variants` field. Empty / undefined falls back.
|
|
134
|
+
*
|
|
135
|
+
* @param {unknown} raw
|
|
136
|
+
* @param {string} where Path label used in error messages.
|
|
137
|
+
* @param {Variant[]} fallback
|
|
138
|
+
* @returns {Variant[]}
|
|
139
|
+
*/
|
|
140
|
+
function readVariants(raw, where, fallback) {
|
|
141
|
+
if (raw === undefined) return [...fallback];
|
|
142
|
+
if (!Array.isArray(raw)) {
|
|
143
|
+
throw new Error(`[config] ${where}.variants must be an array`);
|
|
144
|
+
}
|
|
145
|
+
const valid = new Set(['pure', 'classic']);
|
|
146
|
+
for (const v of raw) {
|
|
147
|
+
if (!valid.has(v)) {
|
|
148
|
+
throw new Error(
|
|
149
|
+
`[config] ${where}.variants contains invalid variant "${v}" (allowed: pure, classic)`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (raw.length === 0) {
|
|
154
|
+
throw new Error(`[config] ${where}.variants must not be empty (omit the field to inherit defaults)`);
|
|
155
|
+
}
|
|
156
|
+
return /** @type {Variant[]} */ ([...new Set(raw)]);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Validate an `endpoint` field — the global property name attached by the
|
|
161
|
+
* `classic` variant via `globalThis.<endpoint>`. Must be a valid JS identifier
|
|
162
|
+
* because the generated code uses dot access. Empty / undefined falls back.
|
|
163
|
+
*
|
|
164
|
+
* @param {unknown} raw
|
|
165
|
+
* @param {string} where
|
|
166
|
+
* @param {string} fallback
|
|
167
|
+
* @returns {string}
|
|
168
|
+
*/
|
|
169
|
+
function readEndpoint(raw, where, fallback) {
|
|
170
|
+
if (raw === undefined || raw === null) return fallback;
|
|
171
|
+
if (typeof raw !== 'string' || !/^[A-Za-z_$][\w$]*$/.test(raw)) {
|
|
172
|
+
throw new Error(
|
|
173
|
+
`[config] ${where}.endpoint must be a valid JS identifier (got ${JSON.stringify(raw)})`
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
return raw;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Inject a synthetic `full` preset whose `modules` is every name in the
|
|
181
|
+
* given catalog. Mutates and returns the same config for chaining. Variants
|
|
182
|
+
* come from `config.defaults`.
|
|
183
|
+
*
|
|
184
|
+
* Accepts either the artifact's `modules` object (`{ name: {...} }`) or an
|
|
185
|
+
* equivalent `Map` — both yield the module names in their own key order.
|
|
186
|
+
*
|
|
187
|
+
* @param {BuildConfig} config
|
|
188
|
+
* @param {Map<string, unknown> | Record<string, unknown>} modulesData
|
|
189
|
+
* @returns {BuildConfig}
|
|
190
|
+
*/
|
|
191
|
+
export function injectFullPreset(config, modulesData) {
|
|
192
|
+
const names = modulesData instanceof Map ? [...modulesData.keys()] : Object.keys(modulesData);
|
|
193
|
+
config.presets.full = {
|
|
194
|
+
name: 'full',
|
|
195
|
+
description: 'Every module discovered in src/ (synthesised at build time).',
|
|
196
|
+
modules: names,
|
|
197
|
+
variants: [...config.defaults.variants],
|
|
198
|
+
endpoint: config.defaults.endpoint,
|
|
199
|
+
};
|
|
200
|
+
return config;
|
|
201
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
// Copyright (c) 2026 AwaCloud SAS
|
|
2
|
+
// Author: Matthieu Bouilloux
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// packages/front/fw/integrations/_shared/core.js
|
|
6
|
+
/**
|
|
7
|
+
* @fileoverview Bundler-agnostic core shared by every `@awacloud/fw` bundler
|
|
8
|
+
* integration (Vite, esbuild, Rollup, Webpack, Bun).
|
|
9
|
+
*
|
|
10
|
+
* It owns the parts that do NOT depend on a specific bundler's plugin API :
|
|
11
|
+
* - loading + resolving `fw.config.json` (via the shipped `config-resolve.js`),
|
|
12
|
+
* - reading the committed module catalog (`catalog.generated.json`) to know
|
|
13
|
+
* each module's binding + file path,
|
|
14
|
+
* - matching the virtual specifiers,
|
|
15
|
+
* - emitting the virtual module source (`emit(rawId)`).
|
|
16
|
+
*
|
|
17
|
+
* Both the default config and an `options.configPath` override go through the
|
|
18
|
+
* SAME shipped resolver code path — there is no baked-in vs live divergence.
|
|
19
|
+
* The module catalog is a committed artifact (generated by
|
|
20
|
+
* `bun run integrations:catalog`), so `integrations/**` imports only `node:`
|
|
21
|
+
* builtins + fw files : no dependency on anything under `tools/**`, and fw
|
|
22
|
+
* stays zero-runtime-dep at consume/pack time.
|
|
23
|
+
*
|
|
24
|
+
* Each bundler adapter is then a thin shell that wires its own
|
|
25
|
+
* `resolve`/`load` hooks to `core.isVirtualId` / `core.emit`. The generated
|
|
26
|
+
* code is identical across bundlers : direct subpath imports
|
|
27
|
+
* (`@awacloud/fw/io/codec/hex.js`) + `registerAllDeep`, so tree-shaking and the
|
|
28
|
+
* transitive `deps` closure behave the same everywhere.
|
|
29
|
+
*
|
|
30
|
+
* @see ../vite/index.js first consumer (reference adapter)
|
|
31
|
+
* @see ../esbuild/index.js
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import { readFileSync } from 'node:fs';
|
|
35
|
+
import { resolve, relative } from 'node:path';
|
|
36
|
+
import { fileURLToPath } from 'node:url';
|
|
37
|
+
|
|
38
|
+
import { resolveConfig, injectFullPreset } from './config-resolve.js';
|
|
39
|
+
|
|
40
|
+
/** Virtual specifier for a pre-instantiated preset runtime. */
|
|
41
|
+
export const VIRTUAL_PRESET_PREFIX = 'virtual:@awacloud/fw/preset';
|
|
42
|
+
/** Virtual specifier for a side-bundle `install(runtime)` helper. */
|
|
43
|
+
export const VIRTUAL_SIDE_PREFIX = 'virtual:@awacloud/fw/side-bundle';
|
|
44
|
+
|
|
45
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
46
|
+
// core.js lives at integrations/_shared/ → package root is three levels up.
|
|
47
|
+
const PKG_ROOT = resolve(__filename, '..', '..', '..');
|
|
48
|
+
const SRC_DIR = resolve(PKG_ROOT, 'src');
|
|
49
|
+
/**
|
|
50
|
+
* Absolute path of the committed module catalog artifact. Exported so a dev
|
|
51
|
+
* host (e.g. the Vite adapter's `configureServer`) can watch it for
|
|
52
|
+
* mid-session regeneration — this constant is the ONLY location the artifact
|
|
53
|
+
* ever lives at, unlike `fw.config.json` which is per-instance overridable
|
|
54
|
+
* via `options.configPath`.
|
|
55
|
+
*/
|
|
56
|
+
export const CATALOG_PATH = resolve(__filename, '..', 'catalog.generated.json');
|
|
57
|
+
const DEFAULT_CONFIG_PATH = resolve(PKG_ROOT, 'fw.config.json');
|
|
58
|
+
|
|
59
|
+
const CATALOG_MISSING_MSG =
|
|
60
|
+
'[@awacloud/fw] integrations catalog missing/stale — run `bun run integrations:catalog` in packages/front/fw';
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @typedef {Object} CatalogEntry
|
|
64
|
+
* @property {string} bindingName The JS export binding (e.g. `hex`).
|
|
65
|
+
* @property {string} file Absolute path of the module's source file.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Read + validate the committed module catalog artifact. Missing file, invalid
|
|
70
|
+
* JSON, or a missing `modules` object all fail with the same actionable
|
|
71
|
+
* regeneration hint (the artifact is a build input, not a runtime asset).
|
|
72
|
+
*
|
|
73
|
+
* @returns {Record<string, { bindingName: string, subpath: string }>}
|
|
74
|
+
*/
|
|
75
|
+
function loadCatalogModules() {
|
|
76
|
+
let artifact;
|
|
77
|
+
try {
|
|
78
|
+
artifact = JSON.parse(readFileSync(CATALOG_PATH, 'utf8'));
|
|
79
|
+
} catch (err) {
|
|
80
|
+
throw new Error(CATALOG_MISSING_MSG, { cause: err });
|
|
81
|
+
}
|
|
82
|
+
if (!artifact || typeof artifact.modules !== 'object' || artifact.modules === null) {
|
|
83
|
+
throw new Error(CATALOG_MISSING_MSG);
|
|
84
|
+
}
|
|
85
|
+
return artifact.modules;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @typedef {Object} FwCoreOptions
|
|
90
|
+
* @property {string} [preset='site'] Default preset for the bare `virtual:@awacloud/fw/preset` specifier.
|
|
91
|
+
* @property {string[]} [sideBundles=[]] Side-bundles validated up-front (fail fast on misconfiguration).
|
|
92
|
+
* @property {string} [packageName='@awacloud/fw'] Package specifier used in the emitted imports.
|
|
93
|
+
* @property {string} [configPath] Override `fw.config.json` path.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @typedef {Object} FwCore
|
|
98
|
+
* @property {import('./config-resolve.js').BuildConfig} config Live snapshot — re-read `reload()` for the current value (a getter; not stale after `reload()`).
|
|
99
|
+
* @property {Map<string, CatalogEntry>} catalog Live snapshot — same freshness note as `config`.
|
|
100
|
+
* @property {string} pkg
|
|
101
|
+
* @property {string} srcDir
|
|
102
|
+
* @property {string} defaultPreset
|
|
103
|
+
* @property {string} configPath Resolved absolute path of the `fw.config.json` this core reads (default or `options.configPath`).
|
|
104
|
+
* @property {(id: string) => boolean} isVirtualId Whether `id` is one of our virtual specifiers.
|
|
105
|
+
* @property {(rawId: string) => (string | null)} emit Generate the virtual module source for `rawId`.
|
|
106
|
+
* @property {() => void} reload **Dev-only.** Re-reads `configPath` + the catalog artifact from disk and swaps the cached state, atomically (fully re-validated before anything is mutated, so a broken edit never corrupts a previously-working cache — it throws instead, leaving the prior state intact). Never called by the production/build path, so build output is unaffected by this method's mere existence.
|
|
107
|
+
* @property {(sanity: ('base'|'community'|'lockdown'|false)) => string} sanityImportLine Import/invoke snippet for the sanity layer (or ''). Every non-`false` tier emits an INVOKING snippet (`import {applyBase|applyCommunity|lockdown} …; <fn>()`), never a bare side-effect import — all three tiers are explicit-call ES modules.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The `apply*` export name each explicit-call sanity tier exposes (all tiers
|
|
112
|
+
* except `lockdown`, whose own export IS named `lockdown`).
|
|
113
|
+
*
|
|
114
|
+
* @type {Record<'base'|'community', string>}
|
|
115
|
+
*/
|
|
116
|
+
const SANITY_APPLY_FN = { base: 'applyBase', community: 'applyCommunity' };
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Build the shared core : load + resolve config, read the committed catalog,
|
|
120
|
+
* and expose the matcher + emitter. Throws up-front on a missing/invalid
|
|
121
|
+
* catalog artifact, an unknown default preset, or an unknown side-bundle so a
|
|
122
|
+
* misconfiguration fails at plugin construction, not mid-build.
|
|
123
|
+
*
|
|
124
|
+
* The load itself is factored into `loadState()` below so the exact same
|
|
125
|
+
* validated-load logic backs both this one-shot construction AND the
|
|
126
|
+
* dev-only `reload()` seam — there is no separate/diverging "live reload"
|
|
127
|
+
* code path, only the same loader invoked a second time.
|
|
128
|
+
*
|
|
129
|
+
* @param {FwCoreOptions} [options]
|
|
130
|
+
* @returns {FwCore}
|
|
131
|
+
*/
|
|
132
|
+
export function createFwCore(options = {}) {
|
|
133
|
+
const defaultPreset = options.preset || 'site';
|
|
134
|
+
const sideBundlesUsed = Array.isArray(options.sideBundles) ? options.sideBundles : [];
|
|
135
|
+
const pkg = options.packageName || '@awacloud/fw';
|
|
136
|
+
const configPath = resolve(options.configPath ?? DEFAULT_CONFIG_PATH);
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Read + validate config + catalog from disk. Pure w.r.t. this closure's
|
|
140
|
+
* mutable state — returns a fresh `{ config, catalog }` pair without
|
|
141
|
+
* touching anything, so a caller can validate before committing (atomic
|
|
142
|
+
* swap semantics for `reload()`).
|
|
143
|
+
*
|
|
144
|
+
* @returns {{ config: import('./config-resolve.js').BuildConfig, catalog: Map<string, CatalogEntry> }}
|
|
145
|
+
*/
|
|
146
|
+
function loadState() {
|
|
147
|
+
// Committed catalog artifact → the internal `name → { bindingName, file }`
|
|
148
|
+
// map the emitters consume (replaces a live `scanAll(SRC_DIR)`).
|
|
149
|
+
const modulesData = loadCatalogModules();
|
|
150
|
+
/** @type {Map<string, CatalogEntry>} */
|
|
151
|
+
const catalog = new Map();
|
|
152
|
+
for (const [name, { bindingName, subpath }] of Object.entries(modulesData)) {
|
|
153
|
+
catalog.set(name, { bindingName, file: resolve(SRC_DIR, subpath) });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Config: the SAME shipped resolver for both the default path and an
|
|
157
|
+
// `options.configPath` override — no baked-in vs live divergence.
|
|
158
|
+
const rawConfig = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
159
|
+
const config = resolveConfig(rawConfig);
|
|
160
|
+
// `full` is synthesised from the catalog (same approach as the build orchestrator).
|
|
161
|
+
injectFullPreset(config, modulesData);
|
|
162
|
+
|
|
163
|
+
// Up-front validation of the caller's selections.
|
|
164
|
+
if (!config.presets[defaultPreset]) {
|
|
165
|
+
throw new Error(
|
|
166
|
+
`[@awacloud/fw] Unknown preset "${defaultPreset}". Available: ${Object.keys(config.presets).join(', ')}`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
for (const name of sideBundlesUsed) {
|
|
170
|
+
if (!config.sideBundles[name]) {
|
|
171
|
+
throw new Error(
|
|
172
|
+
`[@awacloud/fw] Unknown side-bundle "${name}". Available: ${Object.keys(config.sideBundles).join(', ')}`
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return { config, catalog };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
let { config, catalog } = loadState();
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* **Dev-only invalidation seam.** Re-runs `loadState()` and, only if it
|
|
183
|
+
* succeeds, swaps `config`/`catalog` to the fresh values. A malformed
|
|
184
|
+
* edit (bad JSON, unknown preset, …) throws and leaves the previously-
|
|
185
|
+
* working cache untouched — the caller (a dev-server file watcher) is
|
|
186
|
+
* expected to catch and log, not crash the session. Never invoked by the
|
|
187
|
+
* production/build path: nothing here calls `reload()`, so build output
|
|
188
|
+
* is provably unaffected by its mere existence.
|
|
189
|
+
*/
|
|
190
|
+
function reload() {
|
|
191
|
+
const next = loadState();
|
|
192
|
+
config = next.config;
|
|
193
|
+
catalog = next.catalog;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** @param {string} id */
|
|
197
|
+
function isVirtualId(id) {
|
|
198
|
+
return (
|
|
199
|
+
id === VIRTUAL_PRESET_PREFIX ||
|
|
200
|
+
id.startsWith(VIRTUAL_PRESET_PREFIX + '/') ||
|
|
201
|
+
id.startsWith(VIRTUAL_SIDE_PREFIX + '/')
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** @param {string} rawId */
|
|
206
|
+
function emit(rawId) {
|
|
207
|
+
if (rawId === VIRTUAL_PRESET_PREFIX) {
|
|
208
|
+
return emitPreset(config.presets[defaultPreset], catalog, pkg);
|
|
209
|
+
}
|
|
210
|
+
if (rawId.startsWith(VIRTUAL_PRESET_PREFIX + '/')) {
|
|
211
|
+
const name = rawId.slice(VIRTUAL_PRESET_PREFIX.length + 1);
|
|
212
|
+
const preset = config.presets[name];
|
|
213
|
+
if (!preset) {
|
|
214
|
+
throw new Error(`[@awacloud/fw] Unknown preset "${name}" requested via virtual import`);
|
|
215
|
+
}
|
|
216
|
+
return emitPreset(preset, catalog, pkg);
|
|
217
|
+
}
|
|
218
|
+
if (rawId.startsWith(VIRTUAL_SIDE_PREFIX + '/')) {
|
|
219
|
+
const name = rawId.slice(VIRTUAL_SIDE_PREFIX.length + 1);
|
|
220
|
+
const sb = config.sideBundles[name];
|
|
221
|
+
if (!sb) {
|
|
222
|
+
throw new Error(`[@awacloud/fw] Unknown side-bundle "${name}" requested via virtual import`);
|
|
223
|
+
}
|
|
224
|
+
return emitSideBundle(sb, catalog, pkg);
|
|
225
|
+
}
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return {
|
|
230
|
+
get config() { return config; },
|
|
231
|
+
get catalog() { return catalog; },
|
|
232
|
+
pkg,
|
|
233
|
+
srcDir: SRC_DIR,
|
|
234
|
+
defaultPreset,
|
|
235
|
+
configPath,
|
|
236
|
+
isVirtualId,
|
|
237
|
+
emit,
|
|
238
|
+
reload,
|
|
239
|
+
sanityImportLine: (sanity) => sanityImportLine(sanity, pkg),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Produce the source snippet that activates the requested sanity tier.
|
|
245
|
+
*
|
|
246
|
+
* All three tiers (`base`, `community`, `lockdown`) are explicit-call ES
|
|
247
|
+
* modules: a bare side-effect import is INERT (proven — W0 FINDINGS §a/§c.1,
|
|
248
|
+
* `bare_import_of_esm_shape_is_INERT`). The snippet must therefore import the
|
|
249
|
+
* tier's named export and invoke it, mirroring the `lockdown` shape that was
|
|
250
|
+
* already correct before this conversion.
|
|
251
|
+
*
|
|
252
|
+
* Exported standalone (not only via `createFwCore(...).sanityImportLine`) so
|
|
253
|
+
* adapters that build their own injected script — e.g. Astro's
|
|
254
|
+
* `injectScript('page', …)`, which bypasses the Vite plugin's `sanity` option
|
|
255
|
+
* — can route through the same emission logic without instantiating a full
|
|
256
|
+
* core (config/catalog load) just for this snippet.
|
|
257
|
+
*
|
|
258
|
+
* @param {('base'|'community'|'lockdown'|false)} sanity
|
|
259
|
+
* @param {string} [pkg='@awacloud/fw'] Package specifier used in the emitted import.
|
|
260
|
+
* @returns {string}
|
|
261
|
+
*/
|
|
262
|
+
export function sanityImportLine(sanity, pkg = '@awacloud/fw') {
|
|
263
|
+
if (!sanity) return '';
|
|
264
|
+
if (sanity === 'lockdown') {
|
|
265
|
+
return `import { lockdown } from '${pkg}/sanity/lockdown'; lockdown();\n`;
|
|
266
|
+
}
|
|
267
|
+
const fn = SANITY_APPLY_FN[sanity];
|
|
268
|
+
return `import { ${fn} } from '${pkg}/sanity/${sanity}'; ${fn}();\n`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Compute the user-facing subpath import specifier for a module file.
|
|
273
|
+
* Maps an absolute path inside `src/` to a `@awacloud/fw/<rel-from-src>` specifier
|
|
274
|
+
* (POSIX-normalised, `.js` extension preserved).
|
|
275
|
+
*
|
|
276
|
+
* @param {string} pkg
|
|
277
|
+
* @param {string} absFile
|
|
278
|
+
* @returns {string}
|
|
279
|
+
*/
|
|
280
|
+
function subpathSpecifier(pkg, absFile) {
|
|
281
|
+
const rel = relative(SRC_DIR, absFile).replace(/\\/g, '/');
|
|
282
|
+
return `${pkg}/${rel}`;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Emit a virtual preset module : import each module from its direct subpath,
|
|
287
|
+
* instantiate a `ModuleRuntime`, register them via `registerAllDeep` (the
|
|
288
|
+
* bundler closes the transitive graph through each module file's static
|
|
289
|
+
* imports of its siblings).
|
|
290
|
+
*
|
|
291
|
+
* @param {import('./config-resolve.js').PresetSpec} preset
|
|
292
|
+
* @param {Map<string, CatalogEntry>} catalog
|
|
293
|
+
* @param {string} pkg
|
|
294
|
+
* @returns {string}
|
|
295
|
+
*/
|
|
296
|
+
export function emitPreset(preset, catalog, pkg) {
|
|
297
|
+
const lines = [
|
|
298
|
+
`// AUTO-GENERATED virtual module — preset "${preset.name}"`,
|
|
299
|
+
`import { ModuleRuntime } from '${pkg}/core/runtime';`,
|
|
300
|
+
];
|
|
301
|
+
|
|
302
|
+
const bindings = [];
|
|
303
|
+
for (const name of preset.modules) {
|
|
304
|
+
const info = catalog.get(name);
|
|
305
|
+
if (!info) {
|
|
306
|
+
throw new Error(`[@awacloud/fw] Module "${name}" listed by preset "${preset.name}" is not in the catalog.`);
|
|
307
|
+
}
|
|
308
|
+
lines.push(`import { ${info.bindingName} } from '${subpathSpecifier(pkg, info.file)}';`);
|
|
309
|
+
bindings.push(info.bindingName);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
lines.push(``);
|
|
313
|
+
lines.push(`export const runtime = new ModuleRuntime();`);
|
|
314
|
+
lines.push(bindings.length
|
|
315
|
+
? `runtime.registerAllDeep([${bindings.join(', ')}]);`
|
|
316
|
+
: `// empty preset`);
|
|
317
|
+
lines.push(``);
|
|
318
|
+
lines.push(`export const moduleNames = ${JSON.stringify(preset.modules)};`);
|
|
319
|
+
lines.push(``);
|
|
320
|
+
|
|
321
|
+
return lines.join('\n');
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Emit a virtual side-bundle module : exposes `install(runtime)` plus a
|
|
326
|
+
* `modules` array, ready to be code-split via dynamic `import()`.
|
|
327
|
+
*
|
|
328
|
+
* @param {import('./config-resolve.js').SideBundleSpec} sb
|
|
329
|
+
* @param {Map<string, CatalogEntry>} catalog
|
|
330
|
+
* @param {string} pkg
|
|
331
|
+
* @returns {string}
|
|
332
|
+
*/
|
|
333
|
+
export function emitSideBundle(sb, catalog, pkg) {
|
|
334
|
+
const lines = [
|
|
335
|
+
`// AUTO-GENERATED virtual module — side-bundle "${sb.name}"`,
|
|
336
|
+
];
|
|
337
|
+
|
|
338
|
+
const bindings = [];
|
|
339
|
+
for (const name of sb.modules) {
|
|
340
|
+
const info = catalog.get(name);
|
|
341
|
+
if (!info) {
|
|
342
|
+
throw new Error(`[@awacloud/fw] Module "${name}" listed by side-bundle "${sb.name}" is not in the catalog.`);
|
|
343
|
+
}
|
|
344
|
+
lines.push(`import { ${info.bindingName} } from '${subpathSpecifier(pkg, info.file)}';`);
|
|
345
|
+
bindings.push(info.bindingName);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
lines.push(``);
|
|
349
|
+
lines.push(`export const modules = [${bindings.join(', ')}];`);
|
|
350
|
+
lines.push(`export const moduleNames = ${JSON.stringify(sb.modules)};`);
|
|
351
|
+
lines.push(``);
|
|
352
|
+
lines.push(`/**`);
|
|
353
|
+
lines.push(` * Register every module of this side-bundle on the given runtime.`);
|
|
354
|
+
lines.push(` * @param {{ registerAllDeep: (mods: any[]) => any }} runtime`);
|
|
355
|
+
lines.push(` */`);
|
|
356
|
+
lines.push(`export function install(runtime) {`);
|
|
357
|
+
lines.push(` runtime.registerAllDeep(modules);`);
|
|
358
|
+
lines.push(`}`);
|
|
359
|
+
lines.push(``);
|
|
360
|
+
|
|
361
|
+
return lines.join('\n');
|
|
362
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# `@awacloud/fw/astro`
|
|
2
|
+
|
|
3
|
+
Official Astro integration. Since Astro runs on **Vite**, this integration **re-injects the `@awacloud/fw/vite` plugin** via the `astro:config:setup` hook — virtual modules are therefore available everywhere in an Astro app with no rewriting.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
// astro.config.mjs
|
|
9
|
+
import { defineConfig } from 'astro/config';
|
|
10
|
+
import fwAstro from '@awacloud/fw/astro';
|
|
11
|
+
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
integrations: [fwAstro({ preset: 'site-interactive', sanity: 'community' })],
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```astro
|
|
18
|
+
---
|
|
19
|
+
// src/pages/index.astro — frontmatter (SSR, pure data)
|
|
20
|
+
import { runtime } from 'virtual:@awacloud/fw/preset/site-interactive';
|
|
21
|
+
const html = runtime.resolve('render').toHTML(/* … */);
|
|
22
|
+
---
|
|
23
|
+
<div id="app" set:html={html}></div>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
// client island — rehydration
|
|
27
|
+
import { runtime } from 'virtual:@awacloud/fw/preset/site-interactive';
|
|
28
|
+
const ui = runtime.resolve('uiSession');
|
|
29
|
+
ui.hydrate(document.getElementById('app'));
|
|
30
|
+
</script>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Recipe — fw island (`FwIsland.astro`, option B)
|
|
34
|
+
|
|
35
|
+
Vanilla island: a container + an Astro `<script>` (bundled by Vite → virtual modules resolve). **Snippet** to adapt (the `uiSession` call depends on your widget); no component framework required.
|
|
36
|
+
|
|
37
|
+
```astro
|
|
38
|
+
---
|
|
39
|
+
// src/components/FwIsland.astro
|
|
40
|
+
---
|
|
41
|
+
<div data-fw-island></div>
|
|
42
|
+
<script>
|
|
43
|
+
import { runtime } from 'virtual:@awacloud/fw/preset/site-interactive';
|
|
44
|
+
const ui = runtime.resolve('uiSession');
|
|
45
|
+
for (const el of document.querySelectorAll('[data-fw-island]')) {
|
|
46
|
+
ui.mount(el /* , view, data */); // or ui.hydrate(el) on SSR markup
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For SSR data: produce the markup in the frontmatter via `render.toHTML` (see Usage) then `ui.hydrate(el)` in the script. **Assumed boundary**: imperative island, **no** JSX↔elm-array bridge (fw stays renderer-agnostic on the Astro side).
|
|
52
|
+
|
|
53
|
+
**Consequence — the Astro dev toolbar reports `No islands detected`.** That is
|
|
54
|
+
expected, not a breakage. This integration implements only
|
|
55
|
+
`astro:config:setup`; it registers no renderer (`addRenderer`), so fw islands
|
|
56
|
+
use no `client:*` directive and Astro emits no `<astro-island>` element. The
|
|
57
|
+
toolbar's island audit counts exactly those elements, so it correctly finds
|
|
58
|
+
none — while the fw islands themselves mount and hydrate normally. The same
|
|
59
|
+
applies to any Astro tooling keyed on `astro-island`: **fw islands are not
|
|
60
|
+
Astro islands**. Astro's own partial-hydration strategies (`client:visible`,
|
|
61
|
+
`client:idle`…) are therefore unavailable; schedule mounting from your own
|
|
62
|
+
script instead.
|
|
63
|
+
|
|
64
|
+
## Options
|
|
65
|
+
|
|
66
|
+
| Option | Type | Default | Role |
|
|
67
|
+
|---|---|---|---|
|
|
68
|
+
| `preset` | `string` | `'site'` | preset of the specifier without suffix |
|
|
69
|
+
| `sideBundles` | `string[]` | `[]` | side-bundles validated at startup |
|
|
70
|
+
| `sanity` | `'base' \| 'community' \| false` | `false` | sanity layer injected as a **client-only script** (`injectScript('page')`). `'community'` recommended: validates inputs without freezing prototypes or blocking APIs. `'base'` = strict lockdown. |
|
|
71
|
+
| `packageName` | `string` | `'@awacloud/fw'` | specifier used in emitted imports |
|
|
72
|
+
| `configPath` | `string` | bundled | override for `fw.config.json` |
|
|
73
|
+
|
|
74
|
+
## Design notes
|
|
75
|
+
|
|
76
|
+
- **Sanity = client-only.** The sanity layers (`community`, `base`) run in the browser → **never at SSR**. The integration forces `sanity: false` on the Vite plugin and places the chosen layer via `injectScript('page', …)` — it runs client-side, on every page, before islands. Do not inject it manually in the frontmatter. `'community'` is recommended: toolbar-compatible; `'base'` is the strict lockdown (frozen prototypes, blocked APIs, toolbar disabled).
|
|
77
|
+
- **SSR data.** `render.toHTML` (worker-safe) runs in the frontmatter / endpoint; the client island rehydrates via `uiSession.hydrate`. SSR round-trip flow already supported by the pipeline.
|
|
78
|
+
- **No component bridge.** The integration allows you to **use fw inside** Astro (islands + SSR data); it does not marry the elm-array with the Astro AST.
|
|
79
|
+
- **Depends on `@awacloud/fw/vite`** (re-injected) — it is a thin shell on top of it.
|
|
80
|
+
|
|
81
|
+
## Validation
|
|
82
|
+
|
|
83
|
+
Structurally validated by the [e2e harness](https://github.com/awacloud/awa/blob/main/packages/front/fw/integrations/_e2e/README.md): the `astro:config:setup` hook correctly registers a functional `@awacloud/fw` Vite plugin (resolution + emission verified) and the client-only sanity script. Since Astro runs on Vite — itself covered by real builds — a full Astro build adds no additional guarantee on fw logic.
|
|
84
|
+
|
|
85
|
+
## Dev toolbar
|
|
86
|
+
|
|
87
|
+
Only the strict `base` layer disables the dev toolbar (frozen prototypes /
|
|
88
|
+
blocked APIs crash the toolbar apps, e.g. `astro:settings`). The `community`
|
|
89
|
+
layer is toolbar-safe — when `sanity: 'community'` is set the toolbar remains
|
|
90
|
+
enabled with no action required.
|
|
91
|
+
|
|
92
|
+
If you use `sanity: 'base'` and need the toolbar back, opt in explicitly:
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
fwAstro({ preset: 'site-interactive', sanity: 'base', devToolbar: true })
|
|
96
|
+
```
|