@awacloud/fw 0.1.0 → 1.0.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 +125 -0
- package/NOTICE +8 -0
- package/README.md +163 -31
- package/dist/build/fw.core.pure.meta.json +6 -6
- package/dist/build/fw.core.pure.min.js +15 -12
- package/dist/build/fw.full.pure.meta.json +13 -7
- package/dist/build/fw.full.pure.min.js +45 -42
- package/dist/build/fw.minimal.pure.meta.json +6 -6
- package/dist/build/fw.minimal.pure.min.js +16 -13
- package/dist/build/fw.pack.compress-heavy.pure.meta.json +6 -6
- package/dist/build/fw.pack.compress-heavy.pure.min.js +3 -3
- package/dist/build/fw.pack.crypto-advanced.pure.meta.json +6 -6
- package/dist/build/fw.pack.crypto-advanced.pure.min.js +1 -1
- package/dist/build/fw.pack.crypto-basic.pure.meta.json +6 -6
- package/dist/build/fw.pack.crypto-basic.pure.min.js +1 -1
- package/dist/build/fw.pack.crypto-identity.pure.meta.json +7 -6
- package/dist/build/fw.pack.crypto-identity.pure.min.js +4 -4
- package/dist/build/fw.pwa.pure.meta.json +7 -6
- package/dist/build/fw.pwa.pure.min.js +38 -35
- package/dist/build/fw.site-interactive.pure.meta.json +6 -6
- package/dist/build/fw.site-interactive.pure.min.js +37 -34
- package/dist/build/fw.site.pure.meta.json +6 -6
- package/dist/build/fw.site.pure.min.js +24 -21
- package/dist/build/fw.spa.pure.meta.json +8 -7
- package/dist/build/fw.spa.pure.min.js +41 -38
- package/dist/build/sanity-base-classic.min.js +1 -1
- package/dist/build/sanity.min.js +1 -1
- package/dist/types/core/internal.d.ts +29 -0
- package/dist/types/core/internal.d.ts.map +1 -0
- package/dist/types/core/logger.d.ts +23 -4
- package/dist/types/core/logger.d.ts.map +1 -1
- package/dist/types/core/modules.d.ts +374 -61
- package/dist/types/core/modules.d.ts.map +1 -1
- package/dist/types/core/runtime.d.ts +10 -6
- package/dist/types/core/runtime.d.ts.map +1 -1
- package/dist/types/core/worker-helper.d.ts +35 -0
- package/dist/types/core/worker-helper.d.ts.map +1 -1
- package/dist/types/crypto/cipher/aes.d.ts +1 -7
- package/dist/types/crypto/cipher/aes.d.ts.map +1 -1
- package/dist/types/crypto/cipher/chacha20.d.ts +0 -10
- package/dist/types/crypto/cipher/chacha20.d.ts.map +1 -1
- package/dist/types/crypto/hash/argon2.d.ts +0 -15
- package/dist/types/crypto/hash/argon2.d.ts.map +1 -1
- package/dist/types/crypto/hash/blake2b.d.ts.map +1 -1
- package/dist/types/crypto/hash/hmac.d.ts.map +1 -1
- package/dist/types/crypto/hash/pbkdf2.d.ts.map +1 -1
- package/dist/types/crypto/hash/poly1305.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha224.d.ts +1 -1
- package/dist/types/crypto/hash/sha256.d.ts +4 -13
- package/dist/types/crypto/hash/sha256.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha3.d.ts.map +1 -1
- package/dist/types/crypto/hash/sha384.d.ts +1 -1
- package/dist/types/crypto/hash/sha512.d.ts +4 -13
- package/dist/types/crypto/hash/sha512.d.ts.map +1 -1
- package/dist/types/crypto/mode/cmac.d.ts +0 -6
- package/dist/types/crypto/mode/cmac.d.ts.map +1 -1
- package/dist/types/crypto/mode/ctr.d.ts +0 -6
- package/dist/types/crypto/mode/ctr.d.ts.map +1 -1
- package/dist/types/crypto/mode/gcm.d.ts +0 -9
- package/dist/types/crypto/mode/gcm.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ecc.d.ts +0 -1
- package/dist/types/crypto/pkc/ecc.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ed25519.d.ts +4 -25
- package/dist/types/crypto/pkc/ed25519.d.ts.map +1 -1
- package/dist/types/crypto/pkc/hybridSign.d.ts +25 -5
- package/dist/types/crypto/pkc/hybridSign.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ml_dsa.d.ts +6 -26
- package/dist/types/crypto/pkc/ml_dsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/ml_kem.d.ts +0 -43
- package/dist/types/crypto/pkc/ml_kem.d.ts.map +1 -1
- package/dist/types/crypto/pkc/rsa.d.ts +0 -24
- package/dist/types/crypto/pkc/rsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/slh_dsa.d.ts +6 -16
- package/dist/types/crypto/pkc/slh_dsa.d.ts.map +1 -1
- package/dist/types/crypto/pkc/x25519.d.ts +0 -6
- package/dist/types/crypto/pkc/x25519.d.ts.map +1 -1
- package/dist/types/crypto/utils/bitArray.d.ts +0 -8
- package/dist/types/crypto/utils/bitArray.d.ts.map +1 -1
- package/dist/types/crypto/utils/jws.d.ts +6 -14
- package/dist/types/crypto/utils/jws.d.ts.map +1 -1
- package/dist/types/crypto/utils/keyformat.d.ts +52 -0
- package/dist/types/crypto/utils/keyformat.d.ts.map +1 -1
- package/dist/types/crypto/utils/random.d.ts +1 -10
- package/dist/types/crypto/utils/random.d.ts.map +1 -1
- package/dist/types/crypto/utils/rsaKeygen.d.ts +0 -10
- package/dist/types/crypto/utils/rsaKeygen.d.ts.map +1 -1
- package/dist/types/crypto/utils/uuid.d.ts.map +1 -1
- package/dist/types/crypto/utils/x509.d.ts +397 -0
- package/dist/types/crypto/utils/x509.d.ts.map +1 -0
- package/dist/types/crypto/wasm/argon2.d.ts +2 -1
- package/dist/types/crypto/wasm/argon2.d.ts.map +1 -1
- package/dist/types/crypto/wasm/pbkdf2.d.ts +2 -2
- package/dist/types/crypto/wasm/pbkdf2.d.ts.map +1 -1
- package/dist/types/crypto/wasm/rsa.d.ts.map +1 -1
- package/dist/types/crypto/wasm/runtime.d.ts +13 -0
- package/dist/types/crypto/wasm/runtime.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/aes.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/aeskw.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/digest.d.ts +0 -4
- package/dist/types/crypto/webcrypto/digest.d.ts.map +1 -1
- package/dist/types/crypto/webcrypto/rsa.d.ts.map +1 -1
- package/dist/types/dom/fs/fileIntake.d.ts +59 -0
- package/dist/types/dom/fs/fileIntake.d.ts.map +1 -0
- package/dist/types/dom/fs/fsAccess.d.ts.map +1 -1
- package/dist/types/dom/query/dnd.d.ts.map +1 -1
- package/dist/types/dom/query/sound.d.ts +89 -0
- package/dist/types/dom/query/sound.d.ts.map +1 -0
- package/dist/types/dom/rendering/chart.d.ts.map +1 -1
- package/dist/types/dom/rendering/component.d.ts +9 -3
- package/dist/types/dom/rendering/component.d.ts.map +1 -1
- package/dist/types/dom/rendering/parser.d.ts +39 -0
- package/dist/types/dom/rendering/parser.d.ts.map +1 -1
- package/dist/types/dom/rendering/render.d.ts.map +1 -1
- package/dist/types/dom/rendering/sanitize.d.ts +4 -0
- package/dist/types/dom/rendering/sanitize.d.ts.map +1 -1
- package/dist/types/dom/rendering/secPolicy.d.ts.map +1 -1
- package/dist/types/dom/rendering/styleSheet.d.ts +74 -0
- package/dist/types/dom/rendering/styleSheet.d.ts.map +1 -0
- package/dist/types/dom/rendering/template.d.ts +9 -3
- package/dist/types/dom/rendering/template.d.ts.map +1 -1
- package/dist/types/dom/rendering/themeTokens.d.ts +9 -3
- package/dist/types/dom/rendering/themeTokens.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession-core.d.ts +9 -3
- package/dist/types/dom/rendering/uiSession-core.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession-list.d.ts +9 -3
- package/dist/types/dom/rendering/uiSession-list.d.ts.map +1 -1
- package/dist/types/dom/rendering/uiSession.d.ts +18 -6
- package/dist/types/dom/rendering/uiSession.d.ts.map +1 -1
- package/dist/types/dom/sw/installPrompt.d.ts +89 -0
- package/dist/types/dom/sw/installPrompt.d.ts.map +1 -0
- package/dist/types/dom/sw/precache.d.ts +149 -0
- package/dist/types/dom/sw/precache.d.ts.map +1 -0
- package/dist/types/dom/sw/swUpdate.d.ts +129 -0
- package/dist/types/dom/sw/swUpdate.d.ts.map +1 -0
- package/dist/types/dom/utils/clipboard.d.ts +8 -0
- package/dist/types/dom/utils/clipboard.d.ts.map +1 -1
- package/dist/types/dom/utils/keybindings.d.ts.map +1 -1
- package/dist/types/dom/utils/route.d.ts.map +1 -1
- package/dist/types/dom/utils/ua.d.ts +2 -2
- package/dist/types/dom/utils/ua.d.ts.map +1 -1
- package/dist/types/io/calc/crc32.d.ts.map +1 -1
- package/dist/types/io/codec/b64.d.ts +24 -0
- package/dist/types/io/codec/b64.d.ts.map +1 -1
- package/dist/types/io/codec/cbor.d.ts +1 -0
- package/dist/types/io/codec/cbor.d.ts.map +1 -1
- package/dist/types/io/codec/hex.d.ts.map +1 -1
- package/dist/types/io/codec/msgpack.d.ts +1 -0
- package/dist/types/io/codec/msgpack.d.ts.map +1 -1
- package/dist/types/io/codec/url.d.ts +3 -1
- package/dist/types/io/codec/url.d.ts.map +1 -1
- package/dist/types/io/codec/utf8.d.ts.map +1 -1
- package/dist/types/io/compress/bitstream.d.ts +1 -1
- package/dist/types/io/compress/brotli.d.ts +0 -1
- package/dist/types/io/compress/brotli.d.ts.map +1 -1
- package/dist/types/io/compress/brotli_shared.d.ts +0 -4
- package/dist/types/io/compress/brotli_shared.d.ts.map +1 -1
- package/dist/types/io/compress/deflate.d.ts +14 -1
- package/dist/types/io/compress/deflate.d.ts.map +1 -1
- package/dist/types/io/compress/gzip.d.ts +4 -0
- package/dist/types/io/compress/gzip.d.ts.map +1 -1
- package/dist/types/io/compress/huffman.d.ts +7 -0
- package/dist/types/io/compress/huffman.d.ts.map +1 -1
- package/dist/types/io/compress/lz4.d.ts +4 -2
- package/dist/types/io/compress/lz4.d.ts.map +1 -1
- package/dist/types/io/compress/lz77.d.ts +17 -0
- package/dist/types/io/compress/lz77.d.ts.map +1 -1
- package/dist/types/io/compress/lzw.d.ts +2 -0
- package/dist/types/io/compress/lzw.d.ts.map +1 -1
- package/dist/types/io/compress/zip.d.ts.map +1 -1
- package/dist/types/io/compress/zlib.d.ts +9 -2
- package/dist/types/io/compress/zlib.d.ts.map +1 -1
- package/dist/types/io/math/linalg.d.ts.map +1 -1
- package/dist/types/process/rpc.d.ts.map +1 -1
- package/dist/types/process/workerPool.d.ts.map +1 -1
- package/dist/types/sanity/base.d.ts +12 -2
- package/dist/types/sanity/base.d.ts.map +1 -1
- package/dist/types/sanity/lockdown.d.ts +6 -5
- package/dist/types/sanity/lockdown.d.ts.map +1 -1
- package/dist/types/sanity/wasm-gate.d.ts +1 -1
- package/docs/README.md +17 -10
- package/docs/api/README.md +5 -5
- package/docs/api/core/logger.md +2 -1
- package/docs/api/core/modules.md +3 -3
- package/docs/api/core/runtime.md +9 -9
- package/docs/api/core/worker-helper.md +12 -2
- package/docs/api/crypto/README.md +1 -1
- package/docs/api/crypto/cipher/README.md +2 -2
- package/docs/api/crypto/cipher/aes.md +5 -10
- package/docs/api/crypto/cipher/chacha20.md +3 -8
- package/docs/api/crypto/hash/README.md +5 -5
- package/docs/api/crypto/hash/adf.md +21 -11
- package/docs/api/crypto/hash/argon2.md +3 -12
- package/docs/api/crypto/hash/blake2b.md +12 -14
- package/docs/api/crypto/hash/pbkdf2.md +1 -1
- package/docs/api/crypto/hash/sha224.md +2 -2
- package/docs/api/crypto/hash/sha256.md +4 -4
- package/docs/api/crypto/hash/sha3.md +2 -2
- package/docs/api/crypto/hash/sha384.md +1 -1
- package/docs/api/crypto/hash/sha512.md +5 -5
- package/docs/api/crypto/hash/sha512_224.md +1 -1
- package/docs/api/crypto/hash/sha512_256.md +1 -1
- package/docs/api/crypto/mode/README.md +3 -3
- package/docs/api/crypto/mode/cbc.md +2 -2
- package/docs/api/crypto/mode/chacha20poly1305.md +1 -1
- package/docs/api/crypto/mode/cmac.md +4 -4
- package/docs/api/crypto/mode/ctr.md +2 -3
- package/docs/api/crypto/mode/gcm.md +5 -5
- package/docs/api/crypto/mode/kw.md +4 -4
- package/docs/api/crypto/pkc/README.md +8 -8
- package/docs/api/crypto/pkc/ecc.md +19 -17
- package/docs/api/crypto/pkc/ed25519.md +10 -15
- package/docs/api/crypto/pkc/hybridKem.md +8 -2
- package/docs/api/crypto/pkc/hybridSign.md +34 -7
- package/docs/api/crypto/pkc/ml_dsa.md +20 -19
- package/docs/api/crypto/pkc/ml_kem.md +3 -3
- package/docs/api/crypto/pkc/rsa.md +7 -9
- package/docs/api/crypto/pkc/slh_dsa.md +12 -12
- package/docs/api/crypto/pkc/x25519.md +5 -4
- package/docs/api/crypto/utils/README.md +7 -7
- package/docs/api/crypto/utils/aes_modes.md +2 -5
- package/docs/api/crypto/utils/asn1.md +25 -16
- package/docs/api/crypto/utils/jws.md +6 -4
- package/docs/api/crypto/utils/keyformat.md +24 -15
- package/docs/api/crypto/utils/pad.md +1 -1
- package/docs/api/crypto/utils/pem.md +3 -3
- package/docs/api/crypto/utils/random.md +3 -4
- package/docs/api/crypto/utils/rsaKeygen.md +2 -2
- package/docs/api/crypto/utils/totp.md +2 -2
- package/docs/api/crypto/utils/uuid.md +5 -5
- package/docs/api/crypto/utils/x509.md +124 -0
- package/docs/api/crypto/wasm/aes.md +1 -1
- package/docs/api/crypto/wasm/argon2.md +6 -4
- package/docs/api/crypto/wasm/ml_kem.md +1 -0
- package/docs/api/crypto/wasm/pbkdf2.md +8 -8
- package/docs/api/crypto/wasm/rsa.md +1 -1
- package/docs/api/crypto/wasm/runtime.md +27 -10
- package/docs/api/crypto/webcrypto/aes.md +1 -1
- package/docs/api/crypto/webcrypto/aeskw.md +2 -2
- package/docs/api/crypto/webcrypto/digest.md +3 -5
- package/docs/api/crypto/webcrypto/ecc.md +1 -1
- package/docs/api/crypto/webcrypto/ed25519.md +1 -1
- package/docs/api/crypto/webcrypto/rsa.md +3 -2
- package/docs/api/crypto/webcrypto/x25519.md +1 -1
- package/docs/api/dom/README.md +6 -1
- package/docs/api/dom/fs/README.md +1 -0
- package/docs/api/dom/fs/fileIntake.md +120 -0
- package/docs/api/dom/fs/fsAccess.md +1 -0
- package/docs/api/dom/fs/indexedDB.md +1 -1
- package/docs/api/dom/fs/storage.md +1 -1
- package/docs/api/dom/query/README.md +2 -1
- package/docs/api/dom/query/dnd.md +4 -1
- package/docs/api/dom/query/dom.md +5 -0
- package/docs/api/dom/query/sound.md +103 -0
- package/docs/api/dom/rendering/README.md +4 -3
- package/docs/api/dom/rendering/chart.md +5 -4
- package/docs/api/dom/rendering/component.md +25 -3
- package/docs/api/dom/rendering/parser.md +5 -2
- package/docs/api/dom/rendering/reactiveBind.md +1 -1
- package/docs/api/dom/rendering/render.md +2 -2
- package/docs/api/dom/rendering/sanitize.md +10 -2
- package/docs/api/dom/rendering/secPolicy.md +4 -4
- package/docs/api/dom/rendering/styleSheet.md +85 -0
- package/docs/api/dom/rendering/template.md +20 -5
- package/docs/api/dom/rendering/themeTokens.md +6 -3
- package/docs/api/dom/rendering/uiSession.md +18 -5
- package/docs/api/dom/rendering/virtualScroll.md +2 -2
- package/docs/api/dom/sensors/geolocation.md +1 -1
- package/docs/api/dom/sw/README.md +7 -1
- package/docs/api/dom/sw/cache.md +2 -1
- package/docs/api/dom/sw/installPrompt.md +111 -0
- package/docs/api/dom/sw/precache.md +124 -0
- package/docs/api/dom/sw/serviceWorker.md +4 -2
- package/docs/api/dom/sw/swUpdate.md +112 -0
- package/docs/api/dom/utils/clipboard.md +56 -5
- package/docs/api/dom/utils/entropyCollector.md +1 -1
- package/docs/api/dom/utils/keybindings.md +17 -2
- package/docs/api/dom/utils/leaderElection.md +2 -2
- package/docs/api/dom/utils/route.md +1 -0
- package/docs/api/dom/utils/ua.md +15 -10
- package/docs/api/io/calc/crc32.md +4 -1
- package/docs/api/io/codec/README.md +2 -2
- package/docs/api/io/codec/b64.md +31 -2
- package/docs/api/io/codec/buffer.md +1 -1
- package/docs/api/io/codec/cbor.md +6 -4
- package/docs/api/io/codec/csv.md +178 -178
- package/docs/api/io/codec/hex.md +10 -2
- package/docs/api/io/codec/msgpack.md +4 -3
- package/docs/api/io/codec/url.md +4 -3
- package/docs/api/io/codec/utf8.md +3 -3
- package/docs/api/io/compress/bitstream.md +6 -3
- package/docs/api/io/compress/brotli.md +36 -4
- package/docs/api/io/compress/brotli_shared.md +1 -1
- package/docs/api/io/compress/deflate.md +42 -34
- package/docs/api/io/compress/gzip.md +26 -6
- package/docs/api/io/compress/huffman.md +2 -1
- package/docs/api/io/compress/lz4.md +5 -3
- package/docs/api/io/compress/lz77.md +26 -3
- package/docs/api/io/compress/lzw.md +13 -8
- package/docs/api/io/compress/zip.md +36 -10
- package/docs/api/io/compress/zlib.md +21 -5
- package/docs/api/io/math/linalg.md +1 -1
- package/docs/api/io/utils/valid.md +1 -1
- package/docs/api/process/rpc.md +3 -2
- package/docs/api/process/workerPool.md +1 -1
- package/docs/api/sanity/base.md +9 -5
- package/docs/api/sanity/lockdown.md +7 -6
- package/docs/api/surface.json +12311 -0
- package/docs/api/typed.md +5 -3
- package/docs/dev/README.md +2 -0
- package/docs/dev/bench.md +76 -0
- package/docs/dev/crypto-references.md +54 -0
- package/docs/dev/provenance.md +30 -7
- package/docs/dev/publishing.md +7 -7
- package/docs/dev/runtime.md +1 -1
- package/docs/dev/testing.md +13 -0
- package/docs/evidence/l4-evidence.md +86 -0
- package/docs/evidence/pqc-hybrid-evidence.md +7 -6
- package/docs/guide/README.md +1 -0
- package/docs/guide/_QUICK_REF.md +5 -5
- package/docs/guide/doc-format.md +4 -3
- package/docs/guide/integrations-hmr.md +1 -1
- package/docs/guide/module-creation-workflow.md +8 -8
- package/docs/guide/rendering-pipeline.md +11 -4
- package/docs/guide/security.md +7 -5
- package/docs/guide/stability.md +123 -0
- package/docs/guide/tutorial-todo.md +20 -8
- package/docs/guide/typescript.md +9 -0
- package/docs/guide/worker-confinement.md +30 -17
- package/docs/notes/lz77-deflate-factorization.md +3 -3
- package/docs/tools/README.md +1 -1
- package/docs/tools/bundler.md +3 -3
- package/docs/tools/codegen.md +1 -1
- package/docs/tools/standalone.md +0 -1
- package/fw.config.json +2 -2
- package/integrations/_shared/catalog.generated.json +7 -1
- package/integrations/_shared/core.js +1 -1
- package/integrations/astro/index.js +1 -1
- package/integrations/eslint/README.md +7 -1
- package/integrations/nextjs/index.js +1 -1
- package/integrations/nodejs/README.md +3 -3
- package/integrations/turbopack/index.js +2 -2
- package/integrations/typedoc/categorize.js +1 -1
- package/integrations/typedoc/typedoc.json +2 -1
- package/integrations/vite/index.js +2 -2
- package/integrations/vite/vite-env.d.ts +7 -4
- package/integrations/webpack/index.js +3 -3
- package/package.json +76 -10
- package/src/core/internal.js +31 -0
- package/src/core/logger.js +95 -23
- package/src/core/modules.js +17 -8
- package/src/core/readyState.js +1 -1
- package/src/core/runtime.js +74 -27
- package/src/core/worker-helper.js +83 -4
- package/src/crypto/NIST_CONFORMANCE.md +47 -34
- package/src/crypto/cipher/aes.acvp.md +7 -8
- package/src/crypto/cipher/aes.js +280 -229
- package/src/crypto/cipher/chacha20.acvp.md +6 -7
- package/src/crypto/cipher/chacha20.js +91 -61
- package/src/crypto/hash/adf.js +1 -1
- package/src/crypto/hash/argon2.acvp.md +11 -15
- package/src/crypto/hash/argon2.js +9 -24
- package/src/crypto/hash/blake2b.js +157 -125
- package/src/crypto/hash/hkdf.acvp.md +15 -15
- package/src/crypto/hash/hkdf.js +1 -1
- package/src/crypto/hash/hmac.acvp.md +10 -12
- package/src/crypto/hash/hmac.js +5 -1
- package/src/crypto/hash/pbkdf2.acvp.md +13 -13
- package/src/crypto/hash/pbkdf2.js +36 -8
- package/src/crypto/hash/poly1305.acvp.md +10 -6
- package/src/crypto/hash/poly1305.js +171 -50
- package/src/crypto/hash/sha224.acvp.md +3 -3
- package/src/crypto/hash/sha224.js +4 -4
- package/src/crypto/hash/sha256.acvp.md +2 -2
- package/src/crypto/hash/sha256.js +514 -50
- package/src/crypto/hash/sha3.acvp.md +9 -9
- package/src/crypto/hash/sha3.js +127 -71
- package/src/crypto/hash/sha384.acvp.md +3 -3
- package/src/crypto/hash/sha384.js +4 -4
- package/src/crypto/hash/sha512.acvp.md +7 -8
- package/src/crypto/hash/sha512.js +107 -108
- package/src/crypto/hash/sha512_224.acvp.md +6 -6
- package/src/crypto/hash/sha512_224.js +2 -2
- package/src/crypto/hash/sha512_256.acvp.md +6 -6
- package/src/crypto/hash/sha512_256.js +2 -2
- package/src/crypto/mode/cbc.acvp.md +2 -2
- package/src/crypto/mode/cbc.js +1 -1
- package/src/crypto/mode/chacha20poly1305.acvp.md +6 -6
- package/src/crypto/mode/chacha20poly1305.js +3 -3
- package/src/crypto/mode/cmac.acvp.md +5 -5
- package/src/crypto/mode/cmac.js +8 -8
- package/src/crypto/mode/ctr.acvp.md +2 -2
- package/src/crypto/mode/ctr.js +1 -3
- package/src/crypto/mode/gcm.acvp.md +6 -6
- package/src/crypto/mode/gcm.js +7 -7
- package/src/crypto/mode/kw.acvp.md +4 -4
- package/src/crypto/mode/kw.js +5 -5
- package/src/crypto/pkc/ecc.acvp.md +13 -13
- package/src/crypto/pkc/ecc.js +9 -11
- package/src/crypto/pkc/ed25519.acvp.md +30 -34
- package/src/crypto/pkc/ed25519.js +453 -94
- package/src/crypto/pkc/hybrid-kat.provenance.md +4 -4
- package/src/crypto/pkc/hybridSign.js +103 -24
- package/src/crypto/pkc/ml_dsa.acvp.md +18 -18
- package/src/crypto/pkc/ml_dsa.js +29 -32
- package/src/crypto/pkc/ml_kem.acvp.md +7 -7
- package/src/crypto/pkc/ml_kem.js +15 -21
- package/src/crypto/pkc/rsa.acvp.md +11 -15
- package/src/crypto/pkc/rsa.js +7 -44
- package/src/crypto/pkc/slh_dsa.acvp.md +16 -16
- package/src/crypto/pkc/slh_dsa.js +16 -18
- package/src/crypto/pkc/x25519.acvp.md +13 -10
- package/src/crypto/pkc/x25519.js +273 -29
- package/src/crypto/utils/aes_modes.acvp.md +1 -2
- package/src/crypto/utils/aes_modes.js +2 -2
- package/src/crypto/utils/asn1-oid.js +1 -1
- package/src/crypto/utils/asn1.js +1 -1
- package/src/crypto/utils/bitArray.js +33 -48
- package/src/crypto/utils/bn.js +1 -1
- package/src/crypto/utils/jws.js +37 -41
- package/src/crypto/utils/keyformat.js +181 -2
- package/src/crypto/utils/pem.js +1 -1
- package/src/crypto/utils/random.acvp.md +5 -5
- package/src/crypto/utils/random.js +845 -846
- package/src/crypto/utils/rsaKeygen.acvp.md +3 -2
- package/src/crypto/utils/rsaKeygen.js +6 -6
- package/src/crypto/utils/totp.js +1 -1
- package/src/crypto/utils/uuid.acvp.md +5 -5
- package/src/crypto/utils/uuid.js +11 -10
- package/src/crypto/utils/x509.js +591 -0
- package/src/crypto/wasm/aes.js +1 -1
- package/src/crypto/wasm/aes.scalar.wasm +0 -0
- package/src/crypto/wasm/argon2.js +17 -1
- package/src/crypto/wasm/argon2.scalar.wasm +0 -0
- package/src/crypto/wasm/blake2b.scalar.wasm +0 -0
- package/src/crypto/wasm/blake2b.simd.wasm +0 -0
- package/src/crypto/wasm/chacha20poly1305.scalar.wasm +0 -0
- package/src/crypto/wasm/chacha20poly1305.simd.wasm +0 -0
- package/src/crypto/wasm/cmac.scalar.wasm +0 -0
- package/src/crypto/wasm/ecc.js +3 -3
- package/src/crypto/wasm/ecc.scalar.wasm +0 -0
- package/src/crypto/wasm/ed25519.js +1 -1
- package/src/crypto/wasm/ed25519.scalar.wasm +0 -0
- package/src/crypto/wasm/hkdf.scalar.wasm +0 -0
- package/src/crypto/wasm/hmac.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_dsa.js +2 -2
- package/src/crypto/wasm/ml_dsa.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_dsa.simd.wasm +0 -0
- package/src/crypto/wasm/ml_kem.js +2 -2
- package/src/crypto/wasm/ml_kem.scalar.wasm +0 -0
- package/src/crypto/wasm/ml_kem.simd.wasm +0 -0
- package/src/crypto/wasm/pbkdf2.js +8 -6
- package/src/crypto/wasm/pbkdf2.scalar.wasm +0 -0
- package/src/crypto/wasm/rsa.js +6 -5
- package/src/crypto/wasm/rsa.scalar.wasm +0 -0
- package/src/crypto/wasm/runtime.js +84 -17
- package/src/crypto/wasm/sha2.scalar.wasm +0 -0
- package/src/crypto/wasm/sha3.scalar.wasm +0 -0
- package/src/crypto/wasm/sha3.simd.wasm +0 -0
- package/src/crypto/wasm/slh_dsa.js +1 -1
- package/src/crypto/wasm/slh_dsa.scalar.wasm +0 -0
- package/src/crypto/wasm/x25519.js +1 -1
- package/src/crypto/wasm/x25519.scalar.wasm +0 -0
- package/src/crypto/webcrypto/aes.js +8 -2
- package/src/crypto/webcrypto/aeskw.js +7 -2
- package/src/crypto/webcrypto/digest.js +1 -15
- package/src/crypto/webcrypto/ecc.js +2 -2
- package/src/crypto/webcrypto/ed25519.js +2 -2
- package/src/crypto/webcrypto/hmac.js +2 -2
- package/src/crypto/webcrypto/rsa.js +7 -2
- package/src/crypto/webcrypto/x25519.js +2 -2
- package/src/dom/display/animate.js +1 -1
- package/src/dom/display/fullscreen.js +1 -1
- package/src/dom/fs/download.js +1 -1
- package/src/dom/fs/fileIntake.js +192 -0
- package/src/dom/fs/fsAccess.js +2 -3
- package/src/dom/fs/indexedDB.js +1 -1
- package/src/dom/fs/remoteStore.js +1 -1
- package/src/dom/fs/storage.js +1 -1
- package/src/dom/lifecycle/idle.js +1 -1
- package/src/dom/lifecycle/visibility.js +1 -1
- package/src/dom/lifecycle/wakeLock.js +1 -1
- package/src/dom/net/ajax.js +1 -1
- package/src/dom/net/network.js +1 -1
- package/src/dom/net/sse.js +1 -1
- package/src/dom/net/webrtc.js +1 -1
- package/src/dom/net/ws.js +1 -1
- package/src/dom/query/dnd.js +56 -4
- package/src/dom/query/dom.js +1 -1
- package/src/dom/query/events.js +1 -1
- package/src/dom/query/gesture.js +1 -1
- package/src/dom/query/media.js +1 -1
- package/src/dom/query/sound.js +333 -0
- package/src/dom/rendering/chart.js +736 -663
- package/src/dom/rendering/component.js +25 -14
- package/src/dom/rendering/devtools.js +2 -2
- package/src/dom/rendering/parser.js +155 -12
- package/src/dom/rendering/render.js +14 -4
- package/src/dom/rendering/sanitize.js +11 -4
- package/src/dom/rendering/secPolicy.js +6 -4
- package/src/dom/rendering/styleSheet.js +217 -0
- package/src/dom/rendering/template.js +72 -13
- package/src/dom/rendering/themeTokens.js +542 -522
- package/src/dom/rendering/uiSession-core.js +51 -6
- package/src/dom/rendering/uiSession-direct.js +1 -1
- package/src/dom/rendering/uiSession-list.js +4 -4
- package/src/dom/rendering/uiSession.js +1 -1
- package/src/dom/rendering/virtualScroll.js +341 -341
- package/src/dom/sensors/battery.js +1 -1
- package/src/dom/sensors/geolocation.js +1 -1
- package/src/dom/sensors/networkInfo.js +1 -1
- package/src/dom/sensors/sensors.js +1 -1
- package/src/dom/sw/backgroundSync.js +1 -1
- package/src/dom/sw/cache.js +1 -1
- package/src/dom/sw/installPrompt.js +151 -0
- package/src/dom/sw/precache.js +257 -0
- package/src/dom/sw/push.js +1 -1
- package/src/dom/sw/sharedWorker.js +1 -1
- package/src/dom/sw/swUpdate.js +239 -0
- package/src/dom/utils/a11y.js +1 -1
- package/src/dom/utils/clipboard.js +56 -6
- package/src/dom/utils/entropyCollector.js +1 -1
- package/src/dom/utils/focus.js +1 -1
- package/src/dom/utils/form.js +1 -1
- package/src/dom/utils/keybindings.js +600 -574
- package/src/dom/utils/leaderElection.js +1 -1
- package/src/dom/utils/notifications.js +1 -1
- package/src/dom/utils/permissions.js +107 -107
- package/src/dom/utils/route.js +14 -2
- package/src/dom/utils/ua.js +42 -28
- package/src/dom/utils/webauthn.js +1 -1
- package/src/io/binary/reader.js +1 -1
- package/src/io/binary/writer.js +1 -1
- package/src/io/calc/bigint.js +1 -1
- package/src/io/calc/crc32.js +28 -2
- package/src/io/calc/easing.js +514 -514
- package/src/io/codec/b64.js +189 -52
- package/src/io/codec/base32.js +1 -1
- package/src/io/codec/base58.js +1 -1
- package/src/io/codec/buffer.js +1 -1
- package/src/io/codec/cbor.js +111 -18
- package/src/io/codec/csv.js +1 -1
- package/src/io/codec/hex.js +51 -6
- package/src/io/codec/mime.js +1 -1
- package/src/io/codec/msgpack.js +47 -6
- package/src/io/codec/url.js +24 -7
- package/src/io/codec/utf8.js +5 -3
- package/src/io/codec/xml.js +1 -1
- package/src/io/compress/bitstream.js +2 -2
- package/src/io/compress/brotli.js +663 -163
- package/src/io/compress/brotli_dict.js +1 -1
- package/src/io/compress/brotli_dict_words.js +1 -1
- package/src/io/compress/brotli_frame.js +1 -1
- package/src/io/compress/brotli_shared.js +7 -7
- package/src/io/compress/deflate.js +87 -53
- package/src/io/compress/gzip.js +187 -74
- package/src/io/compress/huffman.js +24 -1
- package/src/io/compress/lz4.js +45 -7
- package/src/io/compress/lz77.js +148 -63
- package/src/io/compress/lzw.js +35 -19
- package/src/io/compress/zip.js +862 -815
- package/src/io/compress/zlib.js +87 -7
- package/src/io/i18n/i18n.js +1 -1
- package/src/io/math/fixed-point.js +1 -1
- package/src/io/math/geom.js +1 -1
- package/src/io/math/interp.js +1 -1
- package/src/io/math/linalg.js +10 -4
- package/src/io/math/stats.js +1 -1
- package/src/io/structures/btree.js +1 -1
- package/src/io/structures/heap.js +1 -1
- package/src/io/structures/lruCache.js +1 -1
- package/src/io/structures/ringBuffer.js +1 -1
- package/src/io/structures/tree-walker.js +1 -1
- package/src/io/structures/trie.js +1 -1
- package/src/io/sync/abort.js +1 -1
- package/src/io/sync/atomics.js +1 -1
- package/src/io/sync/cancellable.js +1 -1
- package/src/io/sync/channel.js +1 -1
- package/src/io/sync/mutex.js +1 -1
- package/src/io/sync/semaphore.js +1 -1
- package/src/io/sync/tokenBucket.js +1 -1
- package/src/io/text/ansi.js +1 -1
- package/src/io/text/html-entities.js +1 -1
- package/src/io/time/date.js +1 -1
- package/src/io/timing/clock.js +1 -1
- package/src/io/timing/rateLimit.js +1 -1
- package/src/io/timing/scheduler.js +1 -1
- package/src/io/utils/errors.js +1 -1
- package/src/io/utils/eventBus.js +1 -1
- package/src/io/utils/signal.js +1 -1
- package/src/io/utils/valid.js +1 -1
- package/src/main.js +1 -1
- package/src/process/message.js +1 -1
- package/src/process/rpc.js +7 -3
- package/src/process/workerPool.js +11 -4
- package/src/sanity/base.js +85 -39
- package/src/sanity/lockdown-apply.js +3 -3
- package/src/sanity/lockdown.js +58 -32
- package/src/sanity/wasm-gate.js +2 -2
- package/src/typed.js +7 -3
- package/third-party/NOTICE-brotli-dictionary.txt +69 -0
- package/third-party/NOTICE-fw-wasm-crypto.txt +576 -0
- package/third-party/NOTICE-whatwg-entities.txt +44 -0
- package/types/registry.generated.d.ts +7 -1
- package/types/typed.d.ts +7 -3
- package/dist/types/crypto/utils/aes_ctr.d.ts +0 -84
- package/dist/types/crypto/utils/aes_ctr.d.ts.map +0 -1
- package/docs/api/crypto/utils/aes_ctr.md +0 -71
- package/src/crypto/utils/aes_ctr.acvp.md +0 -67
- package/src/crypto/utils/aes_ctr.js +0 -134
|
@@ -124,7 +124,7 @@ Encapsulates all 4 stages. The simplest API to use.
|
|
|
124
124
|
const uiSession = runtime.resolve('uiSession');
|
|
125
125
|
|
|
126
126
|
// Initialise on an existing template context
|
|
127
|
-
const ui = uiSession('
|
|
127
|
+
const ui = uiSession('content'); // template context name
|
|
128
128
|
|
|
129
129
|
// Parse HTML
|
|
130
130
|
const b1 = ui.parse('<div><h1>#{title}</h1>${content}</div>');
|
|
@@ -284,6 +284,13 @@ render.toHTML(tpl, data, { hydrate: false }); // markers OFF (clean output)
|
|
|
284
284
|
render.toHTML(tpl, data, { idPrefix: 'app' }); // → data-fw-id="app:title"
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
+
The rows of an iterate block are rendered from one sub-template, so they
|
|
288
|
+
**share** their `data-fw-id` values (`UIList.adopt` finds each node inside
|
|
289
|
+
its own row). Each row root also carries `data-fw-row="<i>"`, its 0-based
|
|
290
|
+
index (every root of a multi-root row gets it; no `idPrefix`), so one row is
|
|
291
|
+
addressable on its own: `[data-fw-id="app:item"][data-fw-row="2"]`. With
|
|
292
|
+
`hydrate: false`, neither marker is emitted.
|
|
293
|
+
|
|
287
294
|
### Slots and iterations
|
|
288
295
|
|
|
289
296
|
```js
|
|
@@ -330,7 +337,7 @@ After receiving the SSR HTML, the client creates a `uiSession` on the container
|
|
|
330
337
|
// Container: <div id="app">…</div>
|
|
331
338
|
|
|
332
339
|
// 2. Client: create the session on the SSR container.
|
|
333
|
-
tpl.init('app', { to: '#app' });
|
|
340
|
+
tpl.init('app', { to: '#app', main: true }); // the first context builds the shared catalogue
|
|
334
341
|
const ui = uiSession('app');
|
|
335
342
|
|
|
336
343
|
// 3. Hydrate with the SAME items (template + data + opts) as SSR.
|
|
@@ -384,8 +391,8 @@ domReady.loaded(() => {
|
|
|
384
391
|
tpl.elm('page', { id: 'app', tag: 'div', attrs: ['style'],
|
|
385
392
|
data: { style: 'padding:20px' } });
|
|
386
393
|
|
|
387
|
-
tpl.init('
|
|
388
|
-
const ui = uiSession('
|
|
394
|
+
tpl.init('content', { to: '#app' });
|
|
395
|
+
const ui = uiSession('content');
|
|
389
396
|
|
|
390
397
|
// Main layout
|
|
391
398
|
const layout = ui.parse(`
|
package/docs/guide/security.md
CHANGED
|
@@ -13,12 +13,14 @@ category: guide
|
|
|
13
13
|
| `community` | `sanity/community` | ESM, explicit call | Yes | XSS denylist, reduced API surface — tolerates Next/Astro SSR and dev toolbars |
|
|
14
14
|
| `base` | `sanity/base` | ESM, explicit call | Partial | Strict XSS denylist + prototype freeze — breaks frameworks that patch prototypes; Astro disables dev toolbar |
|
|
15
15
|
| `lockdown` | `sanity/lockdown` | ESM, explicit call | No | **Integrity**: tame Function constructors, remove evaluators, transitively freeze all intrinsics (SES-grade) |
|
|
16
|
+
| none | — | — | Yes | Nothing applied. fw works without any tier: no module needs one, and the fw modules that replace a blocked API (`random`, `uuid`, `route`, `clock`) work the same with or without it. The tiers harden the realm against other code |
|
|
16
17
|
|
|
17
18
|
### Recommended default
|
|
18
19
|
|
|
19
20
|
New applications call `lockdown()` once at startup. In a browser realm it also
|
|
20
|
-
applies the `base` DOM/XSS denylist (step
|
|
21
|
-
|
|
21
|
+
applies the `base` DOM/XSS denylist (step 5, `sanity/lockdown.js:403-417`),
|
|
22
|
+
synchronously and before the intrinsic freeze, so `lockdown()` is a
|
|
23
|
+
**superset** of `applyBase()` — there is no reason to call
|
|
22
24
|
both. Choose `community` or `base` alone only when a host framework patches
|
|
23
25
|
prototypes (Next / Astro dev toolbars), which the frozen intrinsics break.
|
|
24
26
|
|
|
@@ -124,7 +126,7 @@ Workers run in a **separate realm** (their own JavaScript global) and communicat
|
|
|
124
126
|
`@awacloud/fw`'s serializable-modules-run-in-workers design is the framework's confinement story:
|
|
125
127
|
|
|
126
128
|
- [Worker confinement](./worker-confinement.md) — **the guide**: capability grant via `dependencies`, withholding ambient authority in `workerFw`, applying `lockdown()` inside the worker realm, runnable examples and honest limits.
|
|
127
|
-
- [`docs/notes/worker-confinement-spike.md`](../notes/worker-confinement-spike.md) — the historical
|
|
129
|
+
- [`docs/notes/worker-confinement-spike.md`](../notes/worker-confinement-spike.md) — the historical investigation note (2026-06-15): realm separation, structured-clone boundary, module serialisability constraints, and integration with `workerPool`.
|
|
128
130
|
|
|
129
131
|
A typical deployment combining integrity and isolation:
|
|
130
132
|
|
|
@@ -199,7 +201,7 @@ These properties are replaced with no-op functions or neutral values:
|
|
|
199
201
|
|-----|--------------|
|
|
200
202
|
| `document.write` | throw |
|
|
201
203
|
| `document.writeln` | throw |
|
|
202
|
-
| `document.execCommand`, `evaluate`, `implementation`, `createContextualFragment` | throw |
|
|
204
|
+
| `document.execCommand`, `evaluate`, `implementation`, `createContextualFragment` | throw (`Range.prototype.createContextualFragment` is not reached) |
|
|
203
205
|
| `document.open`, `close` | throw |
|
|
204
206
|
| `document.domain` (set) | throw |
|
|
205
207
|
|
|
@@ -338,7 +340,7 @@ Sanity freezes prototypes and blocks `eval`/`Function`. Most modern libraries (l
|
|
|
338
340
|
- [sanity/community — API reference](../api/sanity/community.md)
|
|
339
341
|
- [sanity/lockdown — API reference](../api/sanity/lockdown.md)
|
|
340
342
|
- [Worker confinement](./worker-confinement.md) — the confinement guide: capability grant, ambient-authority withholding, lockdown inside the worker
|
|
341
|
-
- [docs/notes/worker-confinement-spike.md](../notes/worker-confinement-spike.md) — historical
|
|
343
|
+
- [docs/notes/worker-confinement-spike.md](../notes/worker-confinement-spike.md) — historical investigation note on Worker isolation (confinement)
|
|
342
344
|
- [secPolicy](../api/dom/rendering/secPolicy.md) — shared security policy (URL/CSS/clobber/`on*`/tags)
|
|
343
345
|
- [uuid](../api/crypto/utils/uuid.md) — secure identifier generator
|
|
344
346
|
- [parser](../api/dom/rendering/parser.md) — safe alternative to `innerHTML`
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# API stability
|
|
2
|
+
|
|
3
|
+
This page defines what `@awacloud/fw` promises to keep from one release to
|
|
4
|
+
the next: the public surface frozen at 1.0.0, the SemVer rules that apply to
|
|
5
|
+
it, and the deprecation cycle that a breaking change goes through. The
|
|
6
|
+
snapshot in [`docs/api/surface.json`](../api/surface.json) is the
|
|
7
|
+
machine-readable form of the surface, and a test keeps the package equal to
|
|
8
|
+
it.
|
|
9
|
+
|
|
10
|
+
## The public surface
|
|
11
|
+
|
|
12
|
+
The surface covered by SemVer is everything a consumer reaches through the
|
|
13
|
+
package's `exports` map:
|
|
14
|
+
|
|
15
|
+
| Part | What is frozen |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Entry points | Every key of the `exports` map (`.`, `./core/*`, `./typed`, `./sanity/*`, `./config`, the bundler integrations, `./dist/build/*`) and, for a JavaScript entry, the names it exports. |
|
|
18
|
+
| Registry modules | The 208 modules of `core/modules.js`, reached as `./io/…`, `./dom/…`, `./crypto/…`, `./process/…`: each module's registry `name`, its module file path, the names that file exports, and the API its factory returns — every public key, its kind (function, class, object, constant) and its signature as published in the declaration files. |
|
|
19
|
+
| Types | The published declarations: the `dist/types/` tree generated from the JSDoc, `types/*.d.ts` and the integrations' `.d.ts`. |
|
|
20
|
+
| Documented behaviour | What a module's page under [`docs/api/`](../api/README.md) states: return values, defaults, the `false`-on-invalid-input convention, the error `code` strings, the option names. |
|
|
21
|
+
|
|
22
|
+
The surface does **not** cover:
|
|
23
|
+
|
|
24
|
+
- the **internal slot**: the primitives some modules keep for their vector
|
|
25
|
+
tests and for one another (`makeSha` of sha256 / sha512, the NTT of
|
|
26
|
+
ml_kem, `encodeTlv` of hybridSign…) sit under a non-enumerable property
|
|
27
|
+
keyed by `Symbol.for('@awacloud/fw/internal')` — not an API key, not in
|
|
28
|
+
the types or the pages' key lists, and free to change in any release
|
|
29
|
+
(the API pages name them as `internalOf(module).name`, the helper of
|
|
30
|
+
`src/core/internal.js`, which the `exports` map does not expose). No API
|
|
31
|
+
object carries a `_` key;
|
|
32
|
+
- the `_`-prefixed **methods of classes** (`sha256.fn.prototype._block`,
|
|
33
|
+
the stream classes' `_take` / `_emit`, the rendering session's helpers):
|
|
34
|
+
implementation methods, outside the contract;
|
|
35
|
+
- error **message** text (the `code` strings are frozen, the messages are
|
|
36
|
+
not), log output, and timing or performance;
|
|
37
|
+
- the contents of a built bundle under `dist/build/` (its file name is
|
|
38
|
+
frozen, its code is generated);
|
|
39
|
+
- everything outside the `exports` map: `playground/`, `tools/` (except
|
|
40
|
+
what the integrations import), the tests and their fixtures;
|
|
41
|
+
- behaviour that contradicts the documented contract: fixing it is a patch,
|
|
42
|
+
even when a caller relied on the defect.
|
|
43
|
+
|
|
44
|
+
### Surfaces other awa products build on
|
|
45
|
+
|
|
46
|
+
These are part of the surface above; they are named here because the AWA
|
|
47
|
+
Viewer and the embeddable viewer core depend on them, and a change to one is
|
|
48
|
+
measured against those consumers' suites before it lands:
|
|
49
|
+
`dom/fs/fileIntake`, `dom/sw/installPrompt`, `dom/sw/swUpdate`, `dom/sw/precache`,
|
|
50
|
+
`dom/utils/clipboard` (`setRich` included), `dom/utils/keybindings` (the
|
|
51
|
+
punctuation key names), and the types build that the package export reads.
|
|
52
|
+
|
|
53
|
+
### The crypto tier
|
|
54
|
+
|
|
55
|
+
The crypto modules' API is frozen like every other module's: names,
|
|
56
|
+
signatures, argument order (`sign(key, message, …)`,
|
|
57
|
+
`verify(key, signature, message, …)` on every scheme and tier) and return
|
|
58
|
+
conventions. What stays an early release is the **assurance**, not the API:
|
|
59
|
+
the crypto tier carries no constant-time attestation for its pure-JS
|
|
60
|
+
implementations and no third-party audit (see the README's
|
|
61
|
+
*Crypto tier — early release*). Reworking an implementation against a
|
|
62
|
+
validation harness changes the code behind the API, not the API.
|
|
63
|
+
|
|
64
|
+
## SemVer rules
|
|
65
|
+
|
|
66
|
+
From 1.0.0:
|
|
67
|
+
|
|
68
|
+
- **Major** — a change that can break a correct caller: a removed or renamed
|
|
69
|
+
export, module or key; a changed kind or signature; a changed default; a
|
|
70
|
+
new throw (or a new `false`) on input that was accepted; a changed error
|
|
71
|
+
`code`; a moved module path or registry name.
|
|
72
|
+
- **Minor** — an additive change: a new module, export, key, option or
|
|
73
|
+
error code on a path that used to fail; a deprecation.
|
|
74
|
+
- **Patch** — a fix that brings the code back to its documented behaviour,
|
|
75
|
+
with no change to the surface.
|
|
76
|
+
|
|
77
|
+
A security fix that cannot be made compatibly may ship in a minor or a patch.
|
|
78
|
+
It is listed under **Security** in [`CHANGELOG.md`](../../CHANGELOG.md) with
|
|
79
|
+
what changes and the migration.
|
|
80
|
+
|
|
81
|
+
## Deprecation cycle
|
|
82
|
+
|
|
83
|
+
A breaking change after 1.0.0 goes through a deprecation first:
|
|
84
|
+
|
|
85
|
+
1. **Deprecate** in a minor release. The old name keeps working, delegating
|
|
86
|
+
to its replacement. Its JSDoc carries `@deprecated` with the replacement
|
|
87
|
+
(editors then show it struck through), its page under `docs/api/` says
|
|
88
|
+
so, and `CHANGELOG.md` lists it under **Deprecated**. fw prints nothing
|
|
89
|
+
at run time: a deprecation never writes to the console.
|
|
90
|
+
2. **Keep** it for at least one further minor release and six months,
|
|
91
|
+
whichever is longer.
|
|
92
|
+
3. **Remove** it in the next major release, listed under **Breaking** with
|
|
93
|
+
the replacement.
|
|
94
|
+
|
|
95
|
+
When no compatible bridge exists (a changed default, a changed argument
|
|
96
|
+
order), the change waits for the next major release and is announced under
|
|
97
|
+
**Deprecated** in the minor before it.
|
|
98
|
+
|
|
99
|
+
## The snapshot gate
|
|
100
|
+
|
|
101
|
+
`tools/api-surface.js` measures the surface from the package itself — it
|
|
102
|
+
imports each entry, resolves every registry module in a plain process and
|
|
103
|
+
walks the API it returns (keys and kinds, values left out), and hashes each
|
|
104
|
+
published declaration file with its comments removed, so a documentation
|
|
105
|
+
edit does not move the hash and a changed signature does. The result is
|
|
106
|
+
compared with `docs/api/surface.json`:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
bun run api:surface:check # from packages/front/fw: the classified diff, exit 1 on drift
|
|
110
|
+
bun run api:surface # write the snapshot after a deliberate change
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The test `tests/api-surface.integration.test.js` runs the same comparison in
|
|
114
|
+
the suite, and `prepack` runs the check before a package is built. Each
|
|
115
|
+
difference is classed: `breaking` (a removed entry, export, key or
|
|
116
|
+
declaration file, a changed kind), `additive`, `internal` (the `_` keys),
|
|
117
|
+
`dependencies` (a module's registry dependencies) and `types` (a changed
|
|
118
|
+
declaration). A changed declaration is read by hand: it is breaking when a
|
|
119
|
+
signature narrows or reorders, additive when it gains an optional part.
|
|
120
|
+
|
|
121
|
+
The gate sees the shape of the API, not its behaviour: a changed default or
|
|
122
|
+
a new throw leaves the shape as it was. Those are caught by the module's own
|
|
123
|
+
tests, which pin the documented behaviour, and recorded in `CHANGELOG.md`.
|
|
@@ -32,10 +32,19 @@ Runtime demo: the HTML input fits in 25 lines, the JS in fewer than 60.
|
|
|
32
32
|
<meta charset="utf-8">
|
|
33
33
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
34
34
|
<title>Todo</title>
|
|
35
|
-
<script
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
<script type="importmap">
|
|
36
|
+
{
|
|
37
|
+
"imports": {
|
|
38
|
+
"@awacloud/fw": "./node_modules/@awacloud/fw/src/main.js",
|
|
39
|
+
"@awacloud/fw/": "./node_modules/@awacloud/fw/src/"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
<!-- fw security lock, first: module scripts run in document order -->
|
|
44
|
+
<script type="module">
|
|
45
|
+
import { lockdown } from '@awacloud/fw/sanity/lockdown.js';
|
|
46
|
+
lockdown();
|
|
47
|
+
</script>
|
|
39
48
|
<script type="module" src="./app.js"></script>
|
|
40
49
|
</head>
|
|
41
50
|
<body>
|
|
@@ -44,8 +53,11 @@ Runtime demo: the HTML input fits in 25 lines, the JS in fewer than 60.
|
|
|
44
53
|
</html>
|
|
45
54
|
```
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
The import map loads `@awacloud/fw` from `node_modules` as native ES
|
|
57
|
+
modules (a subpath keeps its `.js` extension: an import map does no
|
|
58
|
+
extension lookup). `lockdown()`, the default sanity tier, runs first — it
|
|
59
|
+
neutralises `eval`, `Function`, `innerHTML`, `history.pushState`,
|
|
60
|
+
`Math.random`, `crypto.randomUUID`, etc. The rest of
|
|
49
61
|
the app works with fw's secure APIs only (hence the `uuid` module
|
|
50
62
|
below, instead of `crypto.randomUUID`).
|
|
51
63
|
|
|
@@ -103,7 +115,7 @@ Notation reminder:
|
|
|
103
115
|
|
|
104
116
|
```js
|
|
105
117
|
import { runtime } from '@awacloud/fw';
|
|
106
|
-
import modules from '@awacloud/fw/core/modules';
|
|
118
|
+
import modules from '@awacloud/fw/core/modules.js';
|
|
107
119
|
|
|
108
120
|
// After the refactor: no module is pre-registered by main.js.
|
|
109
121
|
// The user must register the full set (or a subset) before the
|
|
@@ -228,7 +240,7 @@ via `sess.on(blockId, slotName, ...)` is more economical for long lists
|
|
|
228
240
|
|
|
229
241
|
```js
|
|
230
242
|
import { runtime } from '@awacloud/fw';
|
|
231
|
-
import modules from '@awacloud/fw/core/modules';
|
|
243
|
+
import modules from '@awacloud/fw/core/modules.js';
|
|
232
244
|
|
|
233
245
|
runtime.registerAll(modules);
|
|
234
246
|
|
package/docs/guide/typescript.md
CHANGED
|
@@ -165,6 +165,15 @@ bun run types:registry # → types/registry.generated.d.ts
|
|
|
165
165
|
|
|
166
166
|
`bun run types:registry:check` fails if the registry is stale (use in CI).
|
|
167
167
|
|
|
168
|
+
### ⚠️ Self-referencing type queries in a `.d.ts`
|
|
169
|
+
|
|
170
|
+
A type query that names the package's own public specifier from inside its
|
|
171
|
+
own declarations fails silently:
|
|
172
|
+
`import('<self-package>/typed').X` inside the package's own `.d.ts` collapses
|
|
173
|
+
to `any` under `moduleResolution: bundler` and no tsc error is raised
|
|
174
|
+
(`skipLibCheck` swallows it): verify such queries from inside AND outside the
|
|
175
|
+
package, and prove them with a should-be-rejected value.
|
|
176
|
+
|
|
168
177
|
## Writing a module in TypeScript
|
|
169
178
|
|
|
170
179
|
You can author modules in TypeScript provided the compiled JavaScript output preserves the factory shape for worker serialisation:
|
|
@@ -93,6 +93,18 @@ worker global, so `delete globalThis.fetch` works there. The portable form walks
|
|
|
93
93
|
the prototype chain and deletes the property from whichever object actually owns
|
|
94
94
|
it:
|
|
95
95
|
|
|
96
|
+
Since `createWorker` gained the `revoke` option, this is built in — it walks the
|
|
97
|
+
chain, then fails closed if a name is still reachable:
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
const worker = fw.createWorker(workerFn, {
|
|
101
|
+
dependencies: ['hex'],
|
|
102
|
+
revoke: ['fetch', 'WebSocket', 'Worker', 'BroadcastChannel', 'XMLHttpRequest'],
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The same, by hand in a `workerFw` (what the option does, minus the check):
|
|
107
|
+
|
|
96
108
|
```js
|
|
97
109
|
const confinedWorkerFw = function (runtime, moduleNames, args) {
|
|
98
110
|
// Self-contained by contract: no closure over main-thread bindings.
|
|
@@ -124,22 +136,23 @@ Two authorities survive any property-level revocation, because they are
|
|
|
124
136
|
|
|
125
137
|
## Applying lockdown inside the worker — status
|
|
126
138
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
`
|
|
131
|
-
|
|
132
|
-
|
|
139
|
+
**`createWorker(fn, { lockdown: true })` runs `lockdown()` inside the worker
|
|
140
|
+
realm** before the user function, after `workerFw` and after `revoke`. The
|
|
141
|
+
worker becomes a **module** worker whose program starts with a static `import`
|
|
142
|
+
of `sanity/lockdown.js` (resolved next to `core/worker-helper.js`; pass
|
|
143
|
+
`lockdown: { url }` with an absolute URL when fw is bundled or served from
|
|
144
|
+
elsewhere). A static import is evaluated before the body, so no top-level
|
|
145
|
+
`await` stands between `new Worker` and the message handler: a message posted
|
|
146
|
+
right after `createWorker` returns is still received.
|
|
133
147
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
`
|
|
138
|
-
|
|
148
|
+
Measured in headless Chromium 148 and in Bun 1.3.13 (`src/core/worker-confine.test.js`),
|
|
149
|
+
the user function then meets `eval` and `Function` blocked and
|
|
150
|
+
`Object.prototype` frozen, with the granted `libs` working; combined with
|
|
151
|
+
`revoke`, `fetch`, `XMLHttpRequest` and `WebSocket` are gone as well. A module
|
|
152
|
+
worker has no `importScripts`.
|
|
139
153
|
|
|
140
|
-
|
|
141
|
-
below
|
|
142
|
-
part of this guide's contract; it is tracked separately.
|
|
154
|
+
Without the option the worker is unchanged. [Example 2](#example-2--freezing-the-workers-own-intrinsics)
|
|
155
|
+
below shows the same freeze done by hand in `workerFn`, which still works.
|
|
143
156
|
|
|
144
157
|
## Runnable example
|
|
145
158
|
|
|
@@ -287,8 +300,8 @@ before it runs unhardened.
|
|
|
287
300
|
after the freeze. Chrome is unaffected (its `Worker` constructor is native).
|
|
288
301
|
Under Bun, spawn the workers you need before locking down the parent realm, or
|
|
289
302
|
keep the parent lockdown to browser deployments.
|
|
290
|
-
- **The DOM step never runs in a worker.** `lockdown()`'s step
|
|
291
|
-
`window` + `document` (`sanity/lockdown.js:
|
|
303
|
+
- **The DOM step never runs in a worker.** `lockdown()`'s step 5 is gated on
|
|
304
|
+
`window` + `document` (`sanity/lockdown.js:411`), so a worker realm gets the
|
|
292
305
|
intrinsic tier only — which is all a worker realm has to harden anyway.
|
|
293
306
|
|
|
294
307
|
## See also
|
|
@@ -297,5 +310,5 @@ before it runs unhardened.
|
|
|
297
310
|
- [Security guide](./security.md) — the tier spectrum, the recommended default, integrity vs confinement
|
|
298
311
|
- [Web Workers guide](./workers.md) — `createWorker`, serialisation, the RPC pattern
|
|
299
312
|
- [`core/worker-helper` — API reference](../api/core/worker-helper.md) — `WorkerOptions`, `workerFw`, the patched `terminate`
|
|
300
|
-
- [Worker confinement
|
|
313
|
+
- [Worker confinement investigation (2026-06-15)](../notes/worker-confinement-spike.md) — the historical investigation this guide supersedes for guidance
|
|
301
314
|
- `src/core/worker-confinement.poc.test.js` — the regression suite backing every claim above
|
|
@@ -65,19 +65,19 @@ Until then, keep the duplication as an accepted trade-off.
|
|
|
65
65
|
## Outcome
|
|
66
66
|
|
|
67
67
|
- **Prerequisite 1 fulfilled.** `lz77.encode`/`encodeTokens` gained
|
|
68
|
-
additive `hashFn`, `start` and `niceLength` options (
|
|
68
|
+
additive `hashFn`, `start` and `niceLength` options (the first step,
|
|
69
69
|
`01-lz77-scanner-extensions`), making an injectable hash function — and
|
|
70
70
|
therefore a bit-exact cutover path — available without touching the
|
|
71
71
|
module's existing default behaviour or its 6 pre-existing `DEFAULT`
|
|
72
72
|
values.
|
|
73
73
|
- **The factorisation landed, but as a full in-house rewrite rather than a
|
|
74
74
|
cutover onto the pre-existing `lz77.encode` callback interface.**
|
|
75
|
-
`deflate.js`'s DEFLATE encoder was rewritten from RFC 1951 (
|
|
75
|
+
`deflate.js`'s DEFLATE encoder was rewritten from RFC 1951 (a later step,
|
|
76
76
|
`03-deflate-encoder-rfc1951`) to scan through the shared `lz77` module —
|
|
77
77
|
first via `lz77.encode`'s `literal`/`match` callbacks, then via
|
|
78
78
|
`lz77.encodeTokens`'s packed `(len, dist)` buffer — replacing the
|
|
79
79
|
duplicated inline hash-chain scanner this note flagged.
|
|
80
|
-
- **Prerequisite 2's callback-vs-packed-token measurement
|
|
80
|
+
- **Prerequisite 2's callback-vs-packed-token measurement settled
|
|
81
81
|
as a wash, not a win**, and a separate perf landing then closed the
|
|
82
82
|
larger regression the note did not anticipate. Quoted from
|
|
83
83
|
`03-report.md`: "Δbytes is IDENTICAL to the callback run at every level,
|
package/docs/tools/README.md
CHANGED
|
@@ -53,4 +53,4 @@ Scripts use **bun** by default, but **all tools also run under Node**:
|
|
|
53
53
|
- **standalone**: `--min` via `esbuild.transform` under Node (otherwise `Bun.build`).
|
|
54
54
|
- **aot / precompilation / codegen / audit**: `node:*` APIs only → Node-capable as-is.
|
|
55
55
|
|
|
56
|
-
Under Node, the fw-private `tools/rendering/**` scripts target `index.js` explicitly (`node tools/rendering/<sub>/index.js`); the mutualized `fw-bundler`/`fw-codegen` tools run via their exported `runCli` entry points — the shipped form is `bun run prebuild:node` — or, inside the
|
|
56
|
+
Under Node, the fw-private `tools/rendering/**` scripts target `index.js` explicitly (`node tools/rendering/<sub>/index.js`); the mutualized `fw-bundler`/`fw-codegen` tools run via their exported `runCli` entry points — the shipped form is `bun run prebuild:node` — or, inside the AWA monorepo, its own task router. Full task table + prerequisites: [`../dev/runtime.md`](../dev/runtime.md).
|
package/docs/tools/bundler.md
CHANGED
|
@@ -43,7 +43,7 @@ fw-bundler bundle [target] [flags] # from the package root
|
|
|
43
43
|
| Flag | Effect |
|
|
44
44
|
| ------------------- | ------ |
|
|
45
45
|
| `--dev` | `ENV.DEV = true` and preserves `/* dev_only */` blocks. |
|
|
46
|
-
| `--no-log` | `ENV.LOG = false` — no main logger. |
|
|
46
|
+
| `--no-log` | `ENV.LOG = false` — no main logger, and `console` is not taken over (see the README's *Logging and `console`*). |
|
|
47
47
|
| `--no-sanity-log` | Patches `sanity/base.js` with `LOG_ATTEMPTS = false` (silent in production). |
|
|
48
48
|
| `--sanity-only` | Builds only `dist/build/sanity.min.js`. |
|
|
49
49
|
| `--no-sanity` | Does not emit `sanity.min.js`. |
|
|
@@ -147,7 +147,7 @@ Everything is written to `dist/build/`. Naming convention:
|
|
|
147
147
|
| `pure` | `fw.<preset>.pure.min.js` (+ `.pure.js`) | `fw.pack.<name>.pure.min.js` (+ `.pure.js`) |
|
|
148
148
|
| `classic` | `fw.<preset>.min.js` (+ `.js`) | `fw.pack.<name>.min.js` (+ `.js`) |
|
|
149
149
|
|
|
150
|
-
Each bundle has a paired `.meta.json` with: description, modules listed, env, bytes (min/gz), sha256
|
|
150
|
+
Each bundle has a paired `.meta.json` with: description, modules listed, env, bytes (min/gz), sha256. No build timestamp: the output is reproducible.
|
|
151
151
|
|
|
152
152
|
## Architecture
|
|
153
153
|
|
|
@@ -203,7 +203,7 @@ With the `deps` field (cf. [`docs/guide/module-pattern.md`](../guide/module-patt
|
|
|
203
203
|
|
|
204
204
|
- Zero npm dependencies — only `Bun.build`, `Bun.gzipSync`, `node:fs`, `node:path`, `node:crypto`.
|
|
205
205
|
- Browser target (`target: 'browser'`, `format: 'esm'`).
|
|
206
|
-
-
|
|
206
|
+
- No source maps are emitted.
|
|
207
207
|
- `sanity.min.js` is a classic script (no module syntax).
|
|
208
208
|
|
|
209
209
|
## See also
|
package/docs/tools/codegen.md
CHANGED
|
@@ -31,7 +31,7 @@ bun run types:registry:check
|
|
|
31
31
|
## Example
|
|
32
32
|
|
|
33
33
|
```
|
|
34
|
-
[codegen-types] wrote types\registry.generated.d.ts (
|
|
34
|
+
[codegen-types] wrote types\registry.generated.d.ts (208 modules).
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Consumption (cf. [TypeScript — Tier 2](../guide/typescript.md)):
|
package/docs/tools/standalone.md
CHANGED
|
@@ -48,7 +48,6 @@ const ct = aesModes.cbc.encrypt(key, iv, plaintext);
|
|
|
48
48
|
// Generated by @awacloud/fw standalone-factory generator
|
|
49
49
|
// Module: aes_modes v1.0.0
|
|
50
50
|
// Dependencies (transitive, 7): bitArray, aes, cbc, ctr, gcm, kw, pad
|
|
51
|
-
// Built: 2026-05-25T…
|
|
52
51
|
|
|
53
52
|
const __bitArray = (function() { … })();
|
|
54
53
|
const __aes = (function() { … })();
|
package/fw.config.json
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"linalg", "geom", "stats", "fixedPoint",
|
|
56
56
|
"binaryReader", "binaryWriter",
|
|
57
57
|
"processMessage", "processRPC",
|
|
58
|
-
"dnd", "media"
|
|
58
|
+
"dnd", "media", "sound"
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
"pwa": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"crypto-identity": {
|
|
88
88
|
"description": "Passkeys, signatures, key formats.",
|
|
89
89
|
"modules": [
|
|
90
|
-
"webauthn", "jws", "keyformat",
|
|
90
|
+
"webauthn", "jws", "keyformat", "x509",
|
|
91
91
|
"ed25519", "x25519", "ecc",
|
|
92
92
|
"pem", "asn1", "asn1Oid", "bitArray", "bn"
|
|
93
93
|
]
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
"adf": { "bindingName": "adf", "subpath": "crypto/hash/adf.js" },
|
|
7
7
|
"adler32": { "bindingName": "adler32", "subpath": "io/calc/adler32.js" },
|
|
8
8
|
"aes": { "bindingName": "aes", "subpath": "crypto/cipher/aes.js" },
|
|
9
|
-
"aes_ctr": { "bindingName": "aes_ctr", "subpath": "crypto/utils/aes_ctr.js" },
|
|
10
9
|
"aes_modes": { "bindingName": "aes_modes", "subpath": "crypto/utils/aes_modes.js" },
|
|
11
10
|
"ajax": { "bindingName": "ajax", "subpath": "dom/net/ajax.js" },
|
|
12
11
|
"animate": { "bindingName": "animate", "subpath": "dom/display/animate.js" },
|
|
@@ -65,6 +64,7 @@
|
|
|
65
64
|
"errors": { "bindingName": "errors", "subpath": "io/utils/errors.js" },
|
|
66
65
|
"eventBus": { "bindingName": "eventBus", "subpath": "io/utils/eventBus.js" },
|
|
67
66
|
"events": { "bindingName": "events", "subpath": "dom/query/events.js" },
|
|
67
|
+
"fileIntake": { "bindingName": "fileIntake", "subpath": "dom/fs/fileIntake.js" },
|
|
68
68
|
"fixedPoint": { "bindingName": "fixedPoint", "subpath": "io/math/fixed-point.js" },
|
|
69
69
|
"focus": { "bindingName": "focus", "subpath": "dom/utils/focus.js" },
|
|
70
70
|
"form": { "bindingName": "form", "subpath": "dom/utils/form.js" },
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"i18n": { "bindingName": "i18n", "subpath": "io/i18n/i18n.js" },
|
|
88
88
|
"idle": { "bindingName": "idle", "subpath": "dom/lifecycle/idle.js" },
|
|
89
89
|
"indexedDB": { "bindingName": "indexedDB", "subpath": "dom/fs/indexedDB.js" },
|
|
90
|
+
"installPrompt": { "bindingName": "installPrompt", "subpath": "dom/sw/installPrompt.js" },
|
|
90
91
|
"interp": { "bindingName": "interp", "subpath": "io/math/interp.js" },
|
|
91
92
|
"jws": { "bindingName": "jws", "subpath": "crypto/utils/jws.js" },
|
|
92
93
|
"keybindings": { "bindingName": "keybindings", "subpath": "dom/utils/keybindings.js" },
|
|
@@ -113,6 +114,7 @@
|
|
|
113
114
|
"pem": { "bindingName": "pem", "subpath": "crypto/utils/pem.js" },
|
|
114
115
|
"permissions": { "bindingName": "permissions", "subpath": "dom/utils/permissions.js" },
|
|
115
116
|
"poly1305": { "bindingName": "poly1305", "subpath": "crypto/hash/poly1305.js" },
|
|
117
|
+
"precache": { "bindingName": "precache", "subpath": "dom/sw/precache.js" },
|
|
116
118
|
"processMessage": { "bindingName": "processMessage", "subpath": "process/message.js" },
|
|
117
119
|
"processRPC": { "bindingName": "processRPC", "subpath": "process/rpc.js" },
|
|
118
120
|
"push": { "bindingName": "push", "subpath": "dom/sw/push.js" },
|
|
@@ -143,10 +145,13 @@
|
|
|
143
145
|
"sharedWorker": { "bindingName": "sharedWorker", "subpath": "dom/sw/sharedWorker.js" },
|
|
144
146
|
"signal": { "bindingName": "signal", "subpath": "io/utils/signal.js" },
|
|
145
147
|
"slh_dsa": { "bindingName": "slh_dsa", "subpath": "crypto/pkc/slh_dsa.js" },
|
|
148
|
+
"sound": { "bindingName": "sound", "subpath": "dom/query/sound.js" },
|
|
146
149
|
"sse": { "bindingName": "sse", "subpath": "dom/net/sse.js" },
|
|
147
150
|
"stats": { "bindingName": "stats", "subpath": "io/math/stats.js" },
|
|
148
151
|
"storage": { "bindingName": "storage", "subpath": "dom/fs/storage.js" },
|
|
149
152
|
"str": { "bindingName": "str", "subpath": "io/text/str.js" },
|
|
153
|
+
"styleSheet": { "bindingName": "styleSheet", "subpath": "dom/rendering/styleSheet.js" },
|
|
154
|
+
"swUpdate": { "bindingName": "swUpdate", "subpath": "dom/sw/swUpdate.js" },
|
|
150
155
|
"template": { "bindingName": "template", "subpath": "dom/rendering/template.js" },
|
|
151
156
|
"themeTokens": { "bindingName": "themeTokens", "subpath": "dom/rendering/themeTokens.js" },
|
|
152
157
|
"tokenBucket": { "bindingName": "tokenBucket", "subpath": "io/sync/tokenBucket.js" },
|
|
@@ -200,6 +205,7 @@
|
|
|
200
205
|
"workerPool": { "bindingName": "workerPool", "subpath": "process/workerPool.js" },
|
|
201
206
|
"ws": { "bindingName": "ws", "subpath": "dom/net/ws.js" },
|
|
202
207
|
"x25519": { "bindingName": "x25519", "subpath": "crypto/pkc/x25519.js" },
|
|
208
|
+
"x509": { "bindingName": "x509", "subpath": "crypto/utils/x509.js" },
|
|
203
209
|
"xml": { "bindingName": "xml", "subpath": "io/codec/xml.js" },
|
|
204
210
|
"zip": { "bindingName": "zip", "subpath": "io/compress/zip.js" },
|
|
205
211
|
"zlib": { "bindingName": "zlib", "subpath": "io/compress/zlib.js" }
|
|
@@ -244,7 +244,7 @@ export function createFwCore(options = {}) {
|
|
|
244
244
|
* Produce the source snippet that activates the requested sanity tier.
|
|
245
245
|
*
|
|
246
246
|
* All three tiers (`base`, `community`, `lockdown`) are explicit-call ES
|
|
247
|
-
* modules: a bare side-effect import is INERT (proven
|
|
247
|
+
* modules: a bare side-effect import is INERT (proven by
|
|
248
248
|
* `bare_import_of_esm_shape_is_INERT`). The snippet must therefore import the
|
|
249
249
|
* tier's named export and invoke it, mirroring the `lockdown` shape that was
|
|
250
250
|
* already correct before this conversion.
|
|
@@ -78,7 +78,7 @@ export default function fwAstro(options = {}) {
|
|
|
78
78
|
// building its own bare-import literal) so the injected
|
|
79
79
|
// script is the INVOKING form (`import {applyBase} …;
|
|
80
80
|
// applyBase();`) — a bare side-effect import of the
|
|
81
|
-
// explicit-call ESM tiers is inert
|
|
81
|
+
// explicit-call ESM tiers is inert.
|
|
82
82
|
// `injectScript`'s body accepts arbitrary statements, so
|
|
83
83
|
// the multi-statement snippet is not a problem here.
|
|
84
84
|
injectScript('page', sanityImportLine(sanity, pkg).trim());
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# `@awacloud/fw` — ESLint
|
|
2
2
|
|
|
3
|
-
ESLint guards that **encode framework invariants**. Consumed by the `eslint.config.js` at the root of the package
|
|
3
|
+
ESLint guards that **encode framework invariants**. Consumed by the `eslint.config.js` at the root of the package, and exported as `@awacloud/fw/eslint` for a project that wants the same rule:
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
// eslint.config.js of a consumer
|
|
7
|
+
import fw from '@awacloud/fw/eslint';
|
|
8
|
+
export default [{ plugins: { fw }, rules: { 'fw/no-factory-capture': 'error' } }];
|
|
9
|
+
```
|
|
4
10
|
|
|
5
11
|
## Contents
|
|
6
12
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* layer client-side — a root `'use client'` component that does
|
|
25
25
|
* `import { applyCommunity } from '@awacloud/fw/sanity/community';
|
|
26
26
|
* applyCommunity();` (a bare side-effect import is inert — `community` is
|
|
27
|
-
* an explicit-call ES module
|
|
27
|
+
* an explicit-call ES module). Under `community`, `<Link>`
|
|
28
28
|
* / `history` client navigation works normally. See README for the
|
|
29
29
|
* recommended pattern.
|
|
30
30
|
* - **Not a React bridge.** This lets you USE fw inside a Next app (a widget
|
|
@@ -21,10 +21,10 @@ The builder drove `Bun.build`/`Bun.gzipSync`. It is now behind a **backend selec
|
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
bun run setup:e2e # installs esbuild (on demand)
|
|
24
|
-
node
|
|
24
|
+
node --input-type=module -e "import('@awacloud/tool-fw-bundler/bundle').then(m => m.runCli(process.argv.slice(1))).then(c => process.exit(c))" -- --backend esbuild
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
> **Node invocation**:
|
|
27
|
+
> **Node invocation**: the bundler and codegen tools are reached through their package `exports` (`@awacloud/tool-fw-bundler/<entry>`, `@awacloud/tool-fw-codegen/<entry>`) and their `runCli(argv)`, the form [`docs/dev/runtime.md`](../../docs/dev/runtime.md) and `package.node.example.json` use — no relative path into `tools/`.
|
|
28
28
|
|
|
29
29
|
## Developing 100% under Node — intentional substitution
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ The default `package.json` is **bun**-oriented (and intentionally *lean*: heavy
|
|
|
34
34
|
# use it as inspiration, or merge its scripts/devDependencies into package.json, then:
|
|
35
35
|
npm install
|
|
36
36
|
npm test # vitest
|
|
37
|
-
npm run prebuild #
|
|
37
|
+
npm run prebuild # @awacloud/tool-fw-bundler/bundle runCli, --backend esbuild
|
|
38
38
|
npm run types # tsc
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* Notes :
|
|
29
29
|
* - The generated directory (default `.fw-virtual/`) is build output —
|
|
30
|
-
* gitignore it. It is fully rewritten, but LAZILY
|
|
30
|
+
* gitignore it. It is fully rewritten, but LAZILY: merely
|
|
31
31
|
* calling `fwTurbopack(...)` only reads `fw.config.json` + the catalog
|
|
32
32
|
* and computes the alias map in memory — it never touches disk. The
|
|
33
33
|
* rm+mkdir+write only happens the FIRST time the returned `resolveAlias`
|
|
@@ -74,7 +74,7 @@ const HEADER =
|
|
|
74
74
|
/**
|
|
75
75
|
* Build the Turbopack alias map for the configured virtual modules. Reads
|
|
76
76
|
* `fw.config.json` + the catalog and computes the map ENTIRELY IN MEMORY —
|
|
77
|
-
* this alone never touches disk
|
|
77
|
+
* this alone never touches disk. The directory rm+mkdir+write is
|
|
78
78
|
* deferred to `materialize()`, run lazily on first read of `resolveAlias`
|
|
79
79
|
* (see the `FwTurbopackResult` typedef) so merely constructing the config
|
|
80
80
|
* for inspection can never destroy a pre-existing `outDir`.
|
|
@@ -42,7 +42,7 @@ function listDts(dir) {
|
|
|
42
42
|
for (const ent of readdirSync(dir)) {
|
|
43
43
|
const p = join(dir, ent);
|
|
44
44
|
if (statSync(p).isDirectory()) out.push(...listDts(p));
|
|
45
|
-
else if (ent.endsWith('.d.ts') && !ent.endsWith('.test.d.ts') && !ent.endsWith('.kat.d.ts')) out.push(p);
|
|
45
|
+
else if (ent.endsWith('.d.ts') && !ent.endsWith('.test.d.ts') && !ent.endsWith('.kat.d.ts') && !ent.endsWith('.reference.d.ts')) out.push(p);
|
|
46
46
|
}
|
|
47
47
|
return out;
|
|
48
48
|
}
|