@adaas/a-frame 0.0.22 → 0.1.1
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/.conf/tsconfig.browser.json +13 -0
- package/.conf/tsconfig.node.json +14 -0
- package/.env.example +12 -0
- package/dist/browser/A-FrameBrowserStorageBlobs.context-OEQr85oq.d.mts +40 -0
- package/dist/browser/A-FrameBundle.types-DaaUvViw.d.mts +33 -0
- package/dist/browser/A-FrameChannel.types-DWOEUs28.d.mts +142 -0
- package/dist/browser/A-FrameDefinition.entity-DWGN_Ujr.d.mts +329 -0
- package/dist/browser/A-FrameDynamicStructure.entity-DaBgSRCR.d.mts +188 -0
- package/dist/browser/A-FrameLogger.component.env-browser-BIPAP4oQ.d.mts +112 -0
- package/dist/browser/A-FrameNamespace.entity-rCm1AavP.d.mts +125 -0
- package/dist/browser/bundle.d.mts +8 -0
- package/dist/browser/bundle.mjs +2 -0
- package/dist/browser/bundle.mjs.map +1 -0
- package/dist/browser/channel.d.mts +165 -0
- package/dist/browser/channel.mjs +3 -0
- package/dist/browser/channel.mjs.map +1 -0
- package/dist/browser/chunk-5TTVFB3G.mjs +2 -0
- package/dist/browser/chunk-5TTVFB3G.mjs.map +1 -0
- package/dist/browser/chunk-AYN7KUQT.mjs +3 -0
- package/dist/browser/chunk-AYN7KUQT.mjs.map +1 -0
- package/dist/browser/chunk-DMGQW3AO.mjs +2 -0
- package/dist/browser/chunk-DMGQW3AO.mjs.map +1 -0
- package/dist/browser/chunk-G66IL2DR.mjs +2 -0
- package/dist/browser/chunk-G66IL2DR.mjs.map +1 -0
- package/dist/browser/chunk-GOADBDTE.mjs +2 -0
- package/dist/browser/chunk-GOADBDTE.mjs.map +1 -0
- package/dist/browser/chunk-H6OZP4ZV.mjs +2 -0
- package/dist/browser/chunk-H6OZP4ZV.mjs.map +1 -0
- package/dist/browser/chunk-INS7RO3B.mjs +2 -0
- package/dist/browser/chunk-INS7RO3B.mjs.map +1 -0
- package/dist/browser/chunk-K4MZY4ME.mjs +2 -0
- package/dist/browser/chunk-K4MZY4ME.mjs.map +1 -0
- package/dist/browser/chunk-OFKV5GNB.mjs +3 -0
- package/dist/browser/chunk-OFKV5GNB.mjs.map +1 -0
- package/dist/browser/chunk-QATIN7CO.mjs +3 -0
- package/dist/browser/chunk-QATIN7CO.mjs.map +1 -0
- package/dist/browser/chunk-QBBQ37P3.mjs +2 -0
- package/dist/browser/chunk-QBBQ37P3.mjs.map +1 -0
- package/dist/browser/chunk-VDVJWU5T.mjs +2 -0
- package/dist/browser/chunk-VDVJWU5T.mjs.map +1 -0
- package/dist/browser/chunk-X3C4I6YJ.mjs +2 -0
- package/dist/browser/chunk-X3C4I6YJ.mjs.map +1 -0
- package/dist/browser/chunk-YQJFTBGV.mjs +3 -0
- package/dist/browser/chunk-YQJFTBGV.mjs.map +1 -0
- package/dist/browser/chunk-ZVCTU2DN.mjs +3 -0
- package/dist/browser/chunk-ZVCTU2DN.mjs.map +1 -0
- package/dist/browser/core.d.mts +97 -0
- package/dist/browser/core.mjs +2 -0
- package/dist/browser/core.mjs.map +1 -0
- package/dist/browser/crypto.d.mts +35 -0
- package/dist/browser/crypto.mjs +2 -0
- package/dist/browser/crypto.mjs.map +1 -0
- package/dist/browser/definition.d.mts +13 -0
- package/dist/browser/definition.mjs +2 -0
- package/dist/browser/definition.mjs.map +1 -0
- package/dist/browser/dynamic-feature.d.mts +10 -0
- package/dist/browser/dynamic-feature.mjs +2 -0
- package/dist/browser/dynamic-feature.mjs.map +1 -0
- package/dist/browser/dynamic-structure.d.mts +12 -0
- package/dist/browser/dynamic-structure.mjs +2 -0
- package/dist/browser/dynamic-structure.mjs.map +1 -0
- package/dist/browser/env.d.mts +2 -0
- package/dist/browser/env.mjs +2 -0
- package/dist/browser/env.mjs.map +1 -0
- package/dist/browser/frame-index.d.mts +95 -0
- package/dist/browser/frame-index.mjs +2 -0
- package/dist/browser/frame-index.mjs.map +1 -0
- package/dist/browser/index.browser-CZlhzfSP.d.mts +22 -0
- package/dist/browser/index.d.mts +1 -144
- package/dist/browser/index.mjs +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/logger.d.mts +41 -0
- package/dist/browser/logger.mjs +2 -0
- package/dist/browser/logger.mjs.map +1 -0
- package/dist/browser/namespace.d.mts +13 -0
- package/dist/browser/namespace.mjs +2 -0
- package/dist/browser/namespace.mjs.map +1 -0
- package/dist/browser/storage.d.mts +194 -0
- package/dist/browser/storage.mjs +2 -0
- package/dist/browser/storage.mjs.map +1 -0
- package/dist/browser/vector.d.mts +15 -0
- package/dist/browser/vector.mjs +2 -0
- package/dist/browser/vector.mjs.map +1 -0
- package/dist/index.cjs +0 -0
- package/dist/node/A-FrameChannel.component-BfBcs734.d.ts +62 -0
- package/dist/node/A-FrameChannel.component-NNKcFViw.d.mts +62 -0
- package/dist/node/A-FrameChannel.types-DQF-IiRq.d.mts +146 -0
- package/dist/node/A-FrameChannel.types-DQF-IiRq.d.ts +146 -0
- package/dist/node/A-FrameDefinition.entity-CAUOdEvU.d.ts +329 -0
- package/dist/node/A-FrameDefinition.entity-DWGN_Ujr.d.mts +329 -0
- package/dist/node/A-FrameDynamicStructure.entity-DaBgSRCR.d.mts +188 -0
- package/dist/node/A-FrameDynamicStructure.entity-DaBgSRCR.d.ts +188 -0
- package/dist/node/A-FrameNamespace.entity-D3fZBGDx.d.ts +125 -0
- package/dist/node/A-FrameNamespace.entity-rCm1AavP.d.mts +125 -0
- package/dist/node/A-FrameStorage.component-BYjHfHJJ.d.mts +107 -0
- package/dist/node/A-FrameStorage.component-CT01fs-t.d.ts +107 -0
- package/dist/node/bundle.cjs +101 -0
- package/dist/node/bundle.cjs.map +1 -0
- package/dist/node/bundle.d.mts +69 -0
- package/dist/node/bundle.d.ts +69 -0
- package/dist/node/bundle.mjs +76 -0
- package/dist/node/bundle.mjs.map +1 -0
- package/dist/node/channel.cjs +60 -0
- package/dist/node/channel.cjs.map +1 -0
- package/dist/node/channel.d.mts +61 -0
- package/dist/node/channel.d.ts +61 -0
- package/dist/node/channel.mjs +11 -0
- package/dist/node/channel.mjs.map +1 -0
- package/dist/node/chunk-3LOMGNWA.cjs +8 -0
- package/dist/node/chunk-3LOMGNWA.cjs.map +1 -0
- package/dist/node/chunk-3ONWH75E.mjs +257 -0
- package/dist/node/chunk-3ONWH75E.mjs.map +1 -0
- package/dist/node/chunk-3TD2PEDZ.mjs +53 -0
- package/dist/node/chunk-3TD2PEDZ.mjs.map +1 -0
- package/dist/node/chunk-442DXGOD.mjs +16 -0
- package/dist/node/chunk-442DXGOD.mjs.map +1 -0
- package/dist/node/chunk-5BKCX2RO.mjs +33 -0
- package/dist/node/chunk-5BKCX2RO.mjs.map +1 -0
- package/dist/node/chunk-6EFXNUL4.mjs +6 -0
- package/dist/node/chunk-6EFXNUL4.mjs.map +1 -0
- package/dist/node/chunk-6KAGWGTE.mjs +529 -0
- package/dist/node/chunk-6KAGWGTE.mjs.map +1 -0
- package/dist/node/chunk-7A6XGT5J.cjs +541 -0
- package/dist/node/chunk-7A6XGT5J.cjs.map +1 -0
- package/dist/node/chunk-AOQRXZPC.mjs +207 -0
- package/dist/node/chunk-AOQRXZPC.mjs.map +1 -0
- package/dist/node/chunk-APRYHBEF.mjs +171 -0
- package/dist/node/chunk-APRYHBEF.mjs.map +1 -0
- package/dist/node/chunk-B7BXP7K4.mjs +253 -0
- package/dist/node/chunk-B7BXP7K4.mjs.map +1 -0
- package/dist/node/chunk-B7ZDJXD3.cjs +35 -0
- package/dist/node/chunk-B7ZDJXD3.cjs.map +1 -0
- package/dist/node/chunk-CP6JHUU6.cjs +541 -0
- package/dist/node/chunk-CP6JHUU6.cjs.map +1 -0
- package/dist/node/chunk-DDCEMKBP.mjs +655 -0
- package/dist/node/chunk-DDCEMKBP.mjs.map +1 -0
- package/dist/node/chunk-DMY44VUG.mjs +655 -0
- package/dist/node/chunk-DMY44VUG.mjs.map +1 -0
- package/dist/node/chunk-F46TSY2K.cjs +541 -0
- package/dist/node/chunk-F46TSY2K.cjs.map +1 -0
- package/dist/node/chunk-F4UCOZW5.mjs +33 -0
- package/dist/node/chunk-F4UCOZW5.mjs.map +1 -0
- package/dist/node/chunk-GBTFMT3K.cjs +256 -0
- package/dist/node/chunk-GBTFMT3K.cjs.map +1 -0
- package/dist/node/chunk-GNVXVK2B.cjs +8 -0
- package/dist/node/chunk-GNVXVK2B.cjs.map +1 -0
- package/dist/node/chunk-GRR6NNWY.cjs +688 -0
- package/dist/node/chunk-GRR6NNWY.cjs.map +1 -0
- package/dist/node/chunk-IIVYTS5M.mjs +239 -0
- package/dist/node/chunk-IIVYTS5M.mjs.map +1 -0
- package/dist/node/chunk-JQBYDEMW.mjs +33 -0
- package/dist/node/chunk-JQBYDEMW.mjs.map +1 -0
- package/dist/node/chunk-K4MZY4ME.mjs +3 -0
- package/dist/node/chunk-K4MZY4ME.mjs.map +1 -0
- package/dist/node/chunk-KK64VLZN.cjs +4 -0
- package/dist/node/chunk-KK64VLZN.cjs.map +1 -0
- package/dist/node/chunk-KLG6HKFU.cjs +175 -0
- package/dist/node/chunk-KLG6HKFU.cjs.map +1 -0
- package/dist/node/chunk-LJIZ47HO.cjs +688 -0
- package/dist/node/chunk-LJIZ47HO.cjs.map +1 -0
- package/dist/node/chunk-NIXKAQVP.cjs +35 -0
- package/dist/node/chunk-NIXKAQVP.cjs.map +1 -0
- package/dist/node/chunk-OI76LHVT.mjs +21 -0
- package/dist/node/chunk-OI76LHVT.mjs.map +1 -0
- package/dist/node/chunk-OJGCQNAH.mjs +529 -0
- package/dist/node/chunk-OJGCQNAH.mjs.map +1 -0
- package/dist/node/chunk-OYC6L5NX.mjs +6 -0
- package/dist/node/chunk-OYC6L5NX.mjs.map +1 -0
- package/dist/node/chunk-QFHZIG7Y.cjs +25 -0
- package/dist/node/chunk-QFHZIG7Y.cjs.map +1 -0
- package/dist/node/chunk-QFUZVN4Y.cjs +259 -0
- package/dist/node/chunk-QFUZVN4Y.cjs.map +1 -0
- package/dist/node/chunk-R2H234YO.cjs +8 -0
- package/dist/node/chunk-R2H234YO.cjs.map +1 -0
- package/dist/node/chunk-RRLTGGM7.cjs +209 -0
- package/dist/node/chunk-RRLTGGM7.cjs.map +1 -0
- package/dist/node/chunk-SDKIJDMH.mjs +655 -0
- package/dist/node/chunk-SDKIJDMH.mjs.map +1 -0
- package/dist/node/chunk-TO4BPKCY.mjs +6 -0
- package/dist/node/chunk-TO4BPKCY.mjs.map +1 -0
- package/dist/node/chunk-UKKCN7CQ.cjs +688 -0
- package/dist/node/chunk-UKKCN7CQ.cjs.map +1 -0
- package/dist/node/chunk-UPA7VN4R.mjs +153 -0
- package/dist/node/chunk-UPA7VN4R.mjs.map +1 -0
- package/dist/node/chunk-UTJ7CVVB.cjs +248 -0
- package/dist/node/chunk-UTJ7CVVB.cjs.map +1 -0
- package/dist/node/chunk-XFUF7SDO.cjs +35 -0
- package/dist/node/chunk-XFUF7SDO.cjs.map +1 -0
- package/dist/node/chunk-YVX4W6SI.cjs +155 -0
- package/dist/node/chunk-YVX4W6SI.cjs.map +1 -0
- package/dist/node/chunk-YWWGJ6EJ.cjs +55 -0
- package/dist/node/chunk-YWWGJ6EJ.cjs.map +1 -0
- package/dist/node/chunk-Z4HUCRK2.mjs +529 -0
- package/dist/node/chunk-Z4HUCRK2.mjs.map +1 -0
- package/dist/node/chunk-ZM2RLVVH.cjs +18 -0
- package/dist/node/chunk-ZM2RLVVH.cjs.map +1 -0
- package/dist/node/core.cjs +259 -0
- package/dist/node/core.cjs.map +1 -0
- package/dist/node/core.d.mts +76 -0
- package/dist/node/core.d.ts +76 -0
- package/dist/node/core.mjs +248 -0
- package/dist/node/core.mjs.map +1 -0
- package/dist/node/crypto.cjs +13 -0
- package/dist/node/crypto.cjs.map +1 -0
- package/dist/node/crypto.d.mts +44 -0
- package/dist/node/crypto.d.ts +44 -0
- package/dist/node/crypto.mjs +4 -0
- package/dist/node/crypto.mjs.map +1 -0
- package/dist/node/definition.cjs +19 -0
- package/dist/node/definition.cjs.map +1 -0
- package/dist/node/definition.d.mts +13 -0
- package/dist/node/definition.d.ts +13 -0
- package/dist/node/definition.mjs +6 -0
- package/dist/node/definition.mjs.map +1 -0
- package/dist/node/dynamic-feature.cjs +14 -0
- package/dist/node/dynamic-feature.cjs.map +1 -0
- package/dist/node/dynamic-feature.d.mts +10 -0
- package/dist/node/dynamic-feature.d.ts +10 -0
- package/dist/node/dynamic-feature.mjs +12 -0
- package/dist/node/dynamic-feature.mjs.map +1 -0
- package/dist/node/dynamic-structure.cjs +143 -0
- package/dist/node/dynamic-structure.cjs.map +1 -0
- package/dist/node/dynamic-structure.d.mts +12 -0
- package/dist/node/dynamic-structure.d.ts +12 -0
- package/dist/node/dynamic-structure.mjs +138 -0
- package/dist/node/dynamic-structure.mjs.map +1 -0
- package/dist/node/env.cjs +14 -0
- package/dist/node/env.cjs.map +1 -0
- package/dist/node/env.d.mts +22 -0
- package/dist/node/env.d.ts +22 -0
- package/dist/node/env.mjs +5 -0
- package/dist/node/env.mjs.map +1 -0
- package/dist/node/frame-index.cjs +16 -0
- package/dist/node/frame-index.cjs.map +1 -0
- package/dist/node/frame-index.d.mts +95 -0
- package/dist/node/frame-index.d.ts +95 -0
- package/dist/node/frame-index.mjs +7 -0
- package/dist/node/frame-index.mjs.map +1 -0
- package/dist/node/index.cjs +0 -288
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.mts +1 -144
- package/dist/node/index.d.ts +1 -144
- package/dist/node/index.mjs +0 -284
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/logger.cjs +41 -0
- package/dist/node/logger.cjs.map +1 -0
- package/dist/node/logger.d.mts +150 -0
- package/dist/node/logger.d.ts +150 -0
- package/dist/node/logger.mjs +4 -0
- package/dist/node/logger.mjs.map +1 -0
- package/dist/node/namespace.cjs +24 -0
- package/dist/node/namespace.cjs.map +1 -0
- package/dist/node/namespace.d.mts +13 -0
- package/dist/node/namespace.d.ts +13 -0
- package/dist/node/namespace.mjs +7 -0
- package/dist/node/namespace.mjs.map +1 -0
- package/dist/node/storage.cjs +42 -0
- package/dist/node/storage.cjs.map +1 -0
- package/dist/node/storage.d.mts +110 -0
- package/dist/node/storage.d.ts +110 -0
- package/dist/node/storage.mjs +13 -0
- package/dist/node/storage.mjs.map +1 -0
- package/dist/node/vector.cjs +13 -0
- package/dist/node/vector.cjs.map +1 -0
- package/dist/node/vector.d.mts +15 -0
- package/dist/node/vector.d.ts +15 -0
- package/dist/node/vector.mjs +4 -0
- package/dist/node/vector.mjs.map +1 -0
- package/jest.config.browser.ts +41 -0
- package/jest.config.ts +18 -8
- package/package.json +125 -13
- package/{index.ts → src/concept.ts} +5 -2
- package/src/helpers/Hash.helper.ts +14 -0
- package/src/index.ts +0 -24
- package/src/lib/A-Frame/A-Frame.component.env-browser.ts +126 -0
- package/src/lib/A-Frame/A-Frame.component.env-node.ts +105 -0
- package/src/lib/A-Frame/A-Frame.component.ts +62 -0
- package/src/lib/A-Frame/A-Frame.context.ts +40 -0
- package/src/lib/{components/Index.component.ts/Index.error.ts → A-Frame/A-Frame.error.ts} +1 -1
- package/src/lib/{components/Index.component.ts/Index.guard.ts → A-Frame/A-Frame.guard.ts} +9 -6
- package/src/lib/A-Frame/A-Frame.meta.ts +27 -0
- package/src/lib/{components/Index.component.ts/Index.types.ts → A-Frame/A-Frame.types.ts} +52 -17
- package/src/lib/A-Frame/decorators/A-FrameDefine.decorator.ts +104 -0
- package/src/lib/A-Frame/decorators/A-FrameNamespace.decorator.ts +33 -0
- package/src/lib/A-Frame/index.browser.ts +10 -0
- package/src/lib/A-Frame/index.ts +10 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.builder.env-node.ts +95 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.constants.ts +5 -0
- package/src/lib/A-FrameBundle/A-FrameBundle.types.ts +31 -0
- package/src/lib/A-FrameBundle/index.browser.ts +6 -0
- package/src/lib/A-FrameBundle/index.ts +7 -0
- package/src/lib/A-FrameCLI/A-FrameCLI.container.ts +333 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-browser.ts +63 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.env-node.ts +586 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.component.ts +273 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.constants.ts +39 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.error.ts +10 -0
- package/src/lib/A-FrameChannel/A-FrameChannel.types.ts +143 -0
- package/src/lib/A-FrameChannel/A-FrameChannelEvent.context.ts +28 -0
- package/src/lib/A-FrameChannel/A-FrameChannelRequest.context.ts +36 -0
- package/src/lib/A-FrameChannel/A-FrameChannelSocket.entity.ts +189 -0
- package/src/lib/A-FrameChannel/A-FrameChannelStream.entity.ts +144 -0
- package/src/lib/A-FrameChannel/index.browser.ts +3 -0
- package/src/lib/A-FrameChannel/index.ts +10 -0
- package/src/lib/A-FrameCrypto/A-FrameCrypto.component.env-browser.ts +123 -0
- package/src/lib/A-FrameCrypto/A-FrameCrypto.component.env-node.ts +204 -0
- package/src/lib/A-FrameCrypto/index.browser.ts +1 -0
- package/src/lib/A-FrameCrypto/index.ts +1 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.constants.ts +8 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.entity.ts +290 -0
- package/src/lib/A-FrameDefinition/A-FrameDefinition.types.ts +109 -0
- package/src/lib/A-FrameDefinition/index.ts +3 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.entity.ts +13 -0
- package/src/lib/A-FrameDynamicFeature/A-FrameDynamicFeature.types.ts +10 -0
- package/src/lib/A-FrameDynamicFeature/index.ts +2 -0
- package/src/lib/A-FrameDynamicPatch/A-FrameDynamicPatch.entity.ts +38 -0
- package/src/lib/A-FrameDynamicPatch/A-FrameDynamicPatch.types.ts +20 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.constants.ts +9 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.entity.ts +91 -0
- package/src/lib/A-FrameDynamicSession/A-FrameDynamicSession.types.ts +18 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.constants.ts +13 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.entity.ts +187 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.error.ts +13 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructure.types.ts +128 -0
- package/src/lib/A-FrameDynamicStructure/A-FrameDynamicStructureOperation.context.ts +32 -0
- package/src/lib/A-FrameDynamicStructure/index.ts +5 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-browser.ts +31 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.fragment.env-node.ts +39 -0
- package/src/lib/A-FrameEnv/A-FrameEnv.types.ts +7 -0
- package/src/lib/A-FrameEnv/index.browser.ts +1 -0
- package/src/lib/A-FrameEnv/index.ts +1 -0
- package/src/lib/A-FrameIndex/A-FrameIndex.context.ts +321 -0
- package/src/lib/A-FrameIndex/A-FrameIndex.types.ts +63 -0
- package/src/lib/A-FrameIndex/index.browser.ts +3 -0
- package/src/lib/A-FrameIndex/index.ts +3 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.env-browser.ts +99 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.env-node.ts +129 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.component.ts +123 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.constants.ts +66 -0
- package/src/lib/A-FrameLogger/A-FrameLogger.types.ts +67 -0
- package/src/lib/A-FrameLogger/index.browser.ts +4 -0
- package/src/lib/A-FrameLogger/index.ts +4 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.constants.ts +12 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.entity.ts +211 -0
- package/src/lib/A-FrameNamespace/A-FrameNamespace.types.ts +72 -0
- package/src/lib/A-FrameNamespace/index.ts +3 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.codec.ts +338 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.component.ts +191 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.constants.ts +11 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.error.ts +13 -0
- package/src/lib/A-FrameStorage/A-FrameStorage.types.ts +98 -0
- package/src/lib/A-FrameStorage/A-FrameStorageOperation.context.ts +59 -0
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorage.component.ts +312 -0
- package/src/lib/A-FrameStorage/browser/A-FrameBrowserStorageBlobs.context.ts +77 -0
- package/src/lib/A-FrameStorage/index.browser.ts +11 -0
- package/src/lib/A-FrameStorage/index.ts +10 -0
- package/src/lib/A-FrameStorage/node/A-FrameNodeStorage.component.ts +464 -0
- package/src/lib/A-FrameStorage/server/A-FrameServerStorage.component.ts +177 -0
- package/src/lib/{entities/A_FrameVector/A_FrameVector.entity.ts → A-FrameVector/A-FrameVector.entity.ts} +10 -0
- package/src/lib/A-FrameVector/index.ts +3 -0
- package/tests/A-Frame.browser.test.ts +94 -0
- package/tests/A-Frame.test.ts +74 -67
- package/tests/jest.browser-environment.js +30 -0
- package/tests/jest.polyfills.browser.ts +13 -0
- package/tests/jest.setup.browser.ts +33 -0
- package/tsconfig.browser.json +54 -0
- package/tsconfig.json +16 -0
- package/tsup.config.ts +32 -2
- package/src/lib/components/Builder.component.ts/Builder.component.ts +0 -0
- package/src/lib/components/Index.component.ts/Index.component.ts +0 -79
- package/src/lib/components/Index.component.ts/Index.constants.ts +0 -0
- package/src/lib/components/Index.component.ts/Index.meta.ts +0 -28
- package/src/lib/components/Index.component.ts/IndexConfigurations.meta.ts +0 -78
- package/src/lib/components/Index.component.ts/decorators/IndexComponent.decorator.ts +0 -97
- package/src/lib/components/Index.component.ts/decorators/IndexDescribe.decorator.ts +0 -59
- package/src/lib/components/Index.component.ts/decorators/IndexNamespace.decorator.ts +0 -57
- package/src/lib/components/Search/A_FrameSearch.component.ts +0 -66
- package/src/lib/containers/CLI.container.ts +0 -27
- package/src/lib/entities/Namespace/Namespace.entity.ts +0 -8
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { A_ComponentMeta, A_Context, A_Meta } from "@adaas/a-concept";
|
|
2
|
+
import { A_FrameMetaTarget } from "./A-Frame.types";
|
|
3
|
+
import { A_FrameIndexMeta } from "./A-FrameIndex.meta";
|
|
4
|
+
|
|
5
|
+
export class A_FrameMeta extends A_ComponentMeta {
|
|
6
|
+
|
|
7
|
+
getMetaFor(target: A_FrameMetaTarget): A_FrameIndexMeta {
|
|
8
|
+
|
|
9
|
+
const targetSpace = this.get('A_Frame_CONFIGURATIONS_META' as any) || new Map<A_FrameMetaTarget, A_FrameIndexMeta>();
|
|
10
|
+
|
|
11
|
+
if (!targetSpace.has(target)) {
|
|
12
|
+
targetSpace.set(target, new A_FrameIndexMeta());
|
|
13
|
+
this.set('A_Frame_CONFIGURATIONS_META' as any, targetSpace);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return targetSpace.get(target)!;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
seMetaFor(target: A_FrameMetaTarget, meta: A_FrameIndexMeta): void {
|
|
21
|
+
const targetSpace = this.get('A_Frame_CONFIGURATIONS_META' as any) || new Map<A_FrameMetaTarget, A_FrameIndexMeta>();
|
|
22
|
+
|
|
23
|
+
targetSpace.set(target, meta);
|
|
24
|
+
|
|
25
|
+
this.set('A_Frame_CONFIGURATIONS_META' as any, targetSpace);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
import { A_Component, A_Container, A_Entity, A_Fragment, A_TYPES__Component_Constructor, A_TYPES__Container_Constructor, A_TYPES__Entity_Constructor, A_TYPES__Fragment_Constructor, A_TYPES__Required } from "@adaas/a-concept"
|
|
2
|
-
import {
|
|
2
|
+
import { A_FrameNamespace } from "../A-FrameNamespace"
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
namespace?: string | A_Namespace
|
|
5
|
+
export type A_FrameOptions = {
|
|
6
|
+
namespace?: string
|
|
8
7
|
description?: string
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
|
|
11
|
+
export type A_FrameDefineOptions<T extends Record<string, any> = Record<string, any>> = {
|
|
12
|
+
/**
|
|
13
|
+
* The description of the Method or Class to be indexed. Uses for the better explanation and retrieval strategy
|
|
14
|
+
*/
|
|
15
|
+
description?: string,
|
|
16
|
+
/**
|
|
17
|
+
* Define Namespace to separate and group together related components, entities and containers.
|
|
18
|
+
*
|
|
19
|
+
* [!] Namespace is a hard separation between groups.
|
|
20
|
+
*/
|
|
21
|
+
namespace?: string | A_FrameNamespace
|
|
22
|
+
/***
|
|
23
|
+
* Optional parameters that can be used to store any additional information about the component, entity or container.
|
|
24
|
+
* This information can be used for the better retrieval strategy or for the better explanation of the component, entity or container.
|
|
25
|
+
*/
|
|
26
|
+
metadata?: T,
|
|
27
|
+
/**
|
|
28
|
+
* Can add a custom way of explaining the component, entity or container, so it can be used in the better retrieval strategy.
|
|
29
|
+
*/
|
|
30
|
+
examples?: string[]
|
|
31
|
+
}
|
|
12
32
|
|
|
13
|
-
|
|
33
|
+
|
|
34
|
+
export type A_FrameMetaTarget = A_TYPES__Container_Constructor
|
|
14
35
|
| A_TYPES__Entity_Constructor
|
|
15
36
|
| A_TYPES__Component_Constructor
|
|
16
37
|
| A_TYPES__Fragment_Constructor
|
|
@@ -25,7 +46,7 @@ export type A_Frame_IndexMetaTarget = A_TYPES__Container_Constructor
|
|
|
25
46
|
/**
|
|
26
47
|
* Indicates a type of Feature Define decorator
|
|
27
48
|
*/
|
|
28
|
-
export type
|
|
49
|
+
export type A_FrameDecoratorDescriptor =
|
|
29
50
|
TypedPropertyDescriptor<(...args: any[]) => any>
|
|
30
51
|
| TypedPropertyDescriptor<(...args: any[]) => any>
|
|
31
52
|
| TypedPropertyDescriptor<(...args: any[]) => Promise<any>>
|
|
@@ -37,7 +58,7 @@ export type A_Frame_IndexDecoratorDescriptor =
|
|
|
37
58
|
*
|
|
38
59
|
* [!] The feature can be defined on Container, Entity, Component or Command
|
|
39
60
|
*/
|
|
40
|
-
export type
|
|
61
|
+
export type A_FrameDecoratorTarget = A_FrameMetaTarget
|
|
41
62
|
| A_Component
|
|
42
63
|
| A_Container
|
|
43
64
|
| A_Entity
|
|
@@ -45,7 +66,7 @@ export type A_Frame_IndexDecoratorTarget = A_Frame_IndexMetaTarget
|
|
|
45
66
|
/**
|
|
46
67
|
* Targets types that can be indexed
|
|
47
68
|
*/
|
|
48
|
-
export enum
|
|
69
|
+
export enum A_FrameTargetType {
|
|
49
70
|
COMPONENT = 'component',
|
|
50
71
|
ENTITY = 'entity',
|
|
51
72
|
CONTAINER = 'container',
|
|
@@ -57,7 +78,7 @@ export enum A_Frame_IndexTargetType {
|
|
|
57
78
|
* A type of Meta information stored by Index decorator
|
|
58
79
|
* This information is used by A-Context to build a proper index structure
|
|
59
80
|
*/
|
|
60
|
-
export type
|
|
81
|
+
export type A_FrameDecoratorMeta = {
|
|
61
82
|
/**
|
|
62
83
|
* Component name
|
|
63
84
|
*/
|
|
@@ -69,15 +90,15 @@ export type A_Frame_IndexDecoratorMeta = {
|
|
|
69
90
|
/**
|
|
70
91
|
* Type of the component
|
|
71
92
|
*/
|
|
72
|
-
type:
|
|
93
|
+
type: A_FrameTargetType,
|
|
73
94
|
/**
|
|
74
95
|
* Namespace for the component
|
|
75
96
|
*/
|
|
76
|
-
namespace?: string |
|
|
97
|
+
namespace?: string | A_FrameNamespace
|
|
77
98
|
/**
|
|
78
99
|
* Constructor reference
|
|
79
100
|
*/
|
|
80
|
-
constructor:
|
|
101
|
+
constructor: A_FrameDecoratorTarget
|
|
81
102
|
}
|
|
82
103
|
|
|
83
104
|
|
|
@@ -87,7 +108,7 @@ export type A_Frame_IndexDecoratorMeta = {
|
|
|
87
108
|
/**
|
|
88
109
|
* Indicates a type of Feature Define decorator
|
|
89
110
|
*/
|
|
90
|
-
export type
|
|
111
|
+
export type A_FrameNamespaceDecoratorDescriptor =
|
|
91
112
|
TypedPropertyDescriptor<(...args: any[]) => any>
|
|
92
113
|
| TypedPropertyDescriptor<(...args: any[]) => any>
|
|
93
114
|
| TypedPropertyDescriptor<(...args: any[]) => Promise<any>>
|
|
@@ -99,7 +120,7 @@ export type A_Frame_IndexNamespaceDecoratorDescriptor =
|
|
|
99
120
|
*
|
|
100
121
|
* [!] The feature can be defined on Container, Entity, Component or Command
|
|
101
122
|
*/
|
|
102
|
-
export type
|
|
123
|
+
export type A_FrameNamespaceDecoratorTarget = A_Container
|
|
103
124
|
| A_Entity
|
|
104
125
|
| A_Component
|
|
105
126
|
| A_Fragment
|
|
@@ -116,17 +137,31 @@ export type A_Frame_IndexNamespaceDecoratorTarget = A_Container
|
|
|
116
137
|
// ---------------------------------------------------------------------------
|
|
117
138
|
|
|
118
139
|
|
|
119
|
-
export type
|
|
140
|
+
export type A_FrameIndexMetaType = {
|
|
120
141
|
namespaces: string,
|
|
121
142
|
descriptions: string,
|
|
122
143
|
type: string,
|
|
123
144
|
name: string,
|
|
124
|
-
methods: Map<string,
|
|
145
|
+
methods: Map<string, A_FrameIndexMetaMethodMeta>
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
|
|
128
|
-
export type
|
|
149
|
+
export type A_FrameIndexMetaMethodMeta = {
|
|
129
150
|
name: string,
|
|
130
151
|
description?: string,
|
|
131
152
|
methodName: string
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
export type A_FrameNamespaceOptions = {
|
|
159
|
+
/**
|
|
160
|
+
* Must have UNIQUE name of the Namespace. This is used for the indexing and retrieval strategy. It should be descriptive and concise.
|
|
161
|
+
*/
|
|
162
|
+
name: string,
|
|
163
|
+
/**
|
|
164
|
+
* The description of the Namespace to be indexed. Uses for the better explanation and retrieval strategy
|
|
165
|
+
*/
|
|
166
|
+
description?: string,
|
|
132
167
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { A_CommonHelper, A_Context, A_Meta, A_TypeGuards } from "@adaas/a-concept";
|
|
2
|
+
import { A_FrameDecoratorTarget, A_FrameTargetType, A_FrameDecoratorDescriptor, A_FrameMetaTarget, A_FrameDefineOptions } from "../A-Frame.types";
|
|
3
|
+
import { A_FrameTypeGuard } from "../A-Frame.guard";
|
|
4
|
+
import { A_FrameError } from "../A-Frame.error";
|
|
5
|
+
import { A_FrameIndex } from "@adaas/a-frame/index";
|
|
6
|
+
import { A_FrameDefinition } from "@adaas/a-frame/definition";
|
|
7
|
+
import { A_FrameNamespace } from "@adaas/a-frame/namespace";
|
|
8
|
+
|
|
9
|
+
export function A_FrameDefineDecorator(
|
|
10
|
+
config: A_FrameDefineOptions
|
|
11
|
+
) {
|
|
12
|
+
return function (
|
|
13
|
+
target: A_FrameDecoratorTarget,
|
|
14
|
+
propertyKey?: string | symbol,
|
|
15
|
+
descriptor?: A_FrameDecoratorDescriptor
|
|
16
|
+
): any {
|
|
17
|
+
let componentType: A_FrameTargetType;
|
|
18
|
+
|
|
19
|
+
switch (true) {
|
|
20
|
+
case !!propertyKey && !!descriptor:
|
|
21
|
+
componentType = A_FrameTargetType.METHOD;
|
|
22
|
+
break;
|
|
23
|
+
case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):
|
|
24
|
+
componentType = A_FrameTargetType.COMPONENT;
|
|
25
|
+
break;
|
|
26
|
+
case A_TypeGuards.isContainerConstructor(target) || A_TypeGuards.isContainerInstance(target):
|
|
27
|
+
componentType = A_FrameTargetType.CONTAINER;
|
|
28
|
+
break;
|
|
29
|
+
case A_TypeGuards.isEntityConstructor(target) || A_TypeGuards.isEntityInstance(target):
|
|
30
|
+
componentType = A_FrameTargetType.ENTITY;
|
|
31
|
+
break;
|
|
32
|
+
case A_TypeGuards.isFragmentConstructor(target) || A_TypeGuards.isFragmentInstance(target):
|
|
33
|
+
componentType = A_FrameTargetType.FRAGMENT;
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
throw new A_FrameError(
|
|
37
|
+
A_FrameError.InvalidTarget,
|
|
38
|
+
`@A_Frame.Define decorator cannot be applied to the target.`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const namespace = config.namespace
|
|
42
|
+
? config.namespace instanceof A_FrameNamespace
|
|
43
|
+
? config.namespace
|
|
44
|
+
: A_FrameIndex.getNamespace(config.namespace) || new A_FrameNamespace({
|
|
45
|
+
name: config.namespace,
|
|
46
|
+
})
|
|
47
|
+
: A_FrameIndex.getDefaultNamespace();
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
// Handle method decorator case
|
|
51
|
+
if (!!propertyKey && !!descriptor) {
|
|
52
|
+
// For methods, target is the class prototype
|
|
53
|
+
const targetClass = target.constructor as A_FrameMetaTarget;
|
|
54
|
+
const methodName = String(propertyKey);
|
|
55
|
+
|
|
56
|
+
const source = (descriptor.value as Function).toString();
|
|
57
|
+
|
|
58
|
+
// Add to methods array
|
|
59
|
+
A_FrameIndex.addDefinition(new A_FrameDefinition({
|
|
60
|
+
name: methodName,
|
|
61
|
+
dependency: targetClass.name,
|
|
62
|
+
description: config.description,
|
|
63
|
+
source: source,
|
|
64
|
+
metadata: config.metadata,
|
|
65
|
+
type: A_FrameTargetType.METHOD,
|
|
66
|
+
namespace: namespace
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
return descriptor;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Handle class decorator case
|
|
73
|
+
if (!A_FrameTypeGuard.isAllowedTarget(target)) {
|
|
74
|
+
throw new A_FrameError(
|
|
75
|
+
A_FrameError.InvalidTarget,
|
|
76
|
+
`@A_Frame.${componentType} decorator can only be applied to allowed targets.`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// for error messages
|
|
81
|
+
const componentName = A_CommonHelper.getComponentName(target);
|
|
82
|
+
|
|
83
|
+
const targetClass = A_FrameTypeGuard.getTargetConstructor(target);
|
|
84
|
+
|
|
85
|
+
// Check for pending namespace and description from other decorators
|
|
86
|
+
const source = target.toString();
|
|
87
|
+
|
|
88
|
+
A_FrameIndex.addDefinition(new A_FrameDefinition({
|
|
89
|
+
name: componentName,
|
|
90
|
+
description: config.description,
|
|
91
|
+
dependency: targetClass.name,
|
|
92
|
+
source: source,
|
|
93
|
+
metadata: config.metadata,
|
|
94
|
+
type: componentType,
|
|
95
|
+
namespace: namespace
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
return target;
|
|
99
|
+
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { A_CommonHelper, A_Context, A_Meta, A_TypeGuards } from "@adaas/a-concept";
|
|
2
|
+
import { A_FrameDecoratorTarget, A_FrameTargetType, A_FrameDecoratorDescriptor, A_FrameMetaTarget, A_FrameNamespaceOptions } from "../A-Frame.types";
|
|
3
|
+
import { A_FrameError } from "../A-Frame.error";
|
|
4
|
+
import { A_FrameIndex } from "@adaas/a-frame/index";
|
|
5
|
+
import { A_FrameNamespace } from "@adaas/a-frame/namespace";
|
|
6
|
+
|
|
7
|
+
export function A_FrameNamespaceDecorator(
|
|
8
|
+
config: Partial<A_FrameNamespaceOptions> = {}
|
|
9
|
+
) {
|
|
10
|
+
return function (
|
|
11
|
+
target: A_FrameDecoratorTarget,
|
|
12
|
+
propertyKey?: string | symbol,
|
|
13
|
+
descriptor?: A_FrameDecoratorDescriptor
|
|
14
|
+
): any {
|
|
15
|
+
|
|
16
|
+
if (!config.name)
|
|
17
|
+
throw new A_FrameError(
|
|
18
|
+
A_FrameError.InvalidConfiguration,
|
|
19
|
+
`@A_Frame.Namespace decorator requires a name in the configuration.`
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const namespace = new A_FrameNamespace({
|
|
23
|
+
name: config.name,
|
|
24
|
+
description: config.description,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
A_FrameIndex.addNamespace(namespace);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './A-Frame.component';
|
|
2
|
+
export * from './A-Frame.context';
|
|
3
|
+
export * from './A-Frame.types';
|
|
4
|
+
export * from './A-Frame.error';
|
|
5
|
+
// export * from './A-Frame.meta';
|
|
6
|
+
export * from './A-Frame.guard';
|
|
7
|
+
export * from './decorators/A-FrameDefine.decorator';
|
|
8
|
+
export * from './decorators/A-FrameNamespace.decorator';
|
|
9
|
+
|
|
10
|
+
export * from './A-Frame.component.env-browser';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './A-Frame.component';
|
|
2
|
+
export * from './A-Frame.context';
|
|
3
|
+
export * from './A-Frame.types';
|
|
4
|
+
export * from './A-Frame.error';
|
|
5
|
+
// export * from './A-Frame.meta';
|
|
6
|
+
export * from './A-Frame.guard';
|
|
7
|
+
export * from './decorators/A-FrameDefine.decorator';
|
|
8
|
+
export * from './decorators/A-FrameNamespace.decorator';
|
|
9
|
+
|
|
10
|
+
export * from './A-Frame.component.env-node';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as fs from 'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { A_Component } from '@adaas/a-concept';
|
|
4
|
+
import { A_FrameBundle } from './A-FrameBundle.types';
|
|
5
|
+
import { A_FRAME_BUNDLE_VERSION } from './A-FrameBundle.constants';
|
|
6
|
+
import { A_FrameStorageCodec } from '../A-FrameStorage/A-FrameStorage.codec';
|
|
7
|
+
import * as pkg from '../../../package.json';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export interface A_FrameBundleBuilderOptions {
|
|
11
|
+
/** Source directory containing the encrypted `*.aframe` files (Node storage). */
|
|
12
|
+
storageDir: string;
|
|
13
|
+
/** Server version to embed in the bundle metadata. */
|
|
14
|
+
serverVersion: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A_FrameBundleBuilder — Node-only build-time helper.
|
|
20
|
+
*
|
|
21
|
+
* Reads the encrypted `*.aframe` files produced by Node storage and packages
|
|
22
|
+
* them into a single JSON (or generated TypeScript module) artifact that ships
|
|
23
|
+
* with the browser bundle. The browser bootstrap then seeds these blobs into
|
|
24
|
+
* `A_FrameBrowserStorageBlobs` so that read-only `definition.load()` /
|
|
25
|
+
* `namespace.load()` calls work without a filesystem.
|
|
26
|
+
*/
|
|
27
|
+
export class A_FrameBundleBuilder extends A_Component {
|
|
28
|
+
|
|
29
|
+
/** Read all `.aframe` files from a storage directory and serialise them. */
|
|
30
|
+
async build(opts: A_FrameBundleBuilderOptions): Promise<A_FrameBundle> {
|
|
31
|
+
const ext = A_FrameStorageCodec.fileExtension; // ".aframe"
|
|
32
|
+
const namespacesFile = `__namespaces${ext}`;
|
|
33
|
+
|
|
34
|
+
let entries: string[];
|
|
35
|
+
try {
|
|
36
|
+
entries = await fs.readdir(opts.storageDir);
|
|
37
|
+
} catch (err: any) {
|
|
38
|
+
if (err?.code === 'ENOENT') {
|
|
39
|
+
throw new Error(`A-Frame storage directory not found: ${opts.storageDir}`);
|
|
40
|
+
}
|
|
41
|
+
throw err;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const aframeFiles = entries.filter(f => f.endsWith(ext));
|
|
45
|
+
|
|
46
|
+
let namespaces: string | null = null;
|
|
47
|
+
const definitions: Record<string, string> = {};
|
|
48
|
+
|
|
49
|
+
for (const file of aframeFiles) {
|
|
50
|
+
const buf = await fs.readFile(path.join(opts.storageDir, file));
|
|
51
|
+
const b64 = buf.toString('base64');
|
|
52
|
+
|
|
53
|
+
if (file === namespacesFile) {
|
|
54
|
+
namespaces = b64;
|
|
55
|
+
} else {
|
|
56
|
+
const id = file.slice(0, -ext.length);
|
|
57
|
+
definitions[id] = b64;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
bundleVersion: A_FRAME_BUNDLE_VERSION,
|
|
63
|
+
aFrameVersion: (pkg as any).version || '0.0.0',
|
|
64
|
+
serverVersion: opts.serverVersion,
|
|
65
|
+
builtAt: new Date().toISOString(),
|
|
66
|
+
namespaces,
|
|
67
|
+
definitions,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Write the bundle to disk as a JSON file. */
|
|
72
|
+
async writeJSON(bundle: A_FrameBundle, outFile: string): Promise<void> {
|
|
73
|
+
await fs.mkdir(path.dirname(path.resolve(outFile)), { recursive: true });
|
|
74
|
+
await fs.writeFile(outFile, JSON.stringify(bundle, null, 2));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Emit a TypeScript module that exports the bundle as a typed constant.
|
|
79
|
+
* Useful for bundlers that prefer TS imports over JSON imports.
|
|
80
|
+
*/
|
|
81
|
+
async writeTS(bundle: A_FrameBundle, outFile: string): Promise<void> {
|
|
82
|
+
const banner = '// AUTO-GENERATED by @adaas/a-frame — do not edit.\n';
|
|
83
|
+
const body =
|
|
84
|
+
`import type { A_FrameBundle } from '@adaas/a-frame';\n\n` +
|
|
85
|
+
`export const A_FRAME_BUNDLE: A_FrameBundle = ${JSON.stringify(bundle, null, 2)} as A_FrameBundle;\n`;
|
|
86
|
+
await fs.mkdir(path.dirname(path.resolve(outFile)), { recursive: true });
|
|
87
|
+
await fs.writeFile(outFile, banner + body);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Convenience: detect output format by extension and write. */
|
|
91
|
+
async writeAuto(bundle: A_FrameBundle, outFile: string): Promise<void> {
|
|
92
|
+
if (/\.tsx?$/.test(outFile)) return this.writeTS(bundle, outFile);
|
|
93
|
+
return this.writeJSON(bundle, outFile);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialized A-Frame bundle artifact.
|
|
3
|
+
*
|
|
4
|
+
* Built by `A_FrameBundleBuilder` from a Node storage directory at build time
|
|
5
|
+
* (see CLI `--bundle <out>`). Loaded by `A_FrameBrowserStorageBlobs.seedFromBundle()`
|
|
6
|
+
* at app startup in the browser.
|
|
7
|
+
*
|
|
8
|
+
* Storage blobs are kept in their AES-256-GCM encrypted form — the consuming
|
|
9
|
+
* browser app must obtain the encryption key out-of-band (typically by
|
|
10
|
+
* authenticating against the A-Frame server with the user's token).
|
|
11
|
+
*/
|
|
12
|
+
export interface A_FrameBundle {
|
|
13
|
+
/** Bundle format version. Currently 1. */
|
|
14
|
+
bundleVersion: number;
|
|
15
|
+
/** A-Frame client library version that produced the bundle. */
|
|
16
|
+
aFrameVersion: string;
|
|
17
|
+
/** A-Frame server version this bundle was embedded against. */
|
|
18
|
+
serverVersion: string;
|
|
19
|
+
/** Build timestamp (ISO 8601). */
|
|
20
|
+
builtAt: string;
|
|
21
|
+
/**
|
|
22
|
+
* Base64-encoded contents of the `__namespaces.aframe` index file.
|
|
23
|
+
* `null` when no namespaces have been persisted yet.
|
|
24
|
+
*/
|
|
25
|
+
namespaces: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Map of namespace id (file basename without extension) → base64-encoded
|
|
28
|
+
* contents of the corresponding `<namespace>.aframe` file.
|
|
29
|
+
*/
|
|
30
|
+
definitions: Record<string, string>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { A_FrameBundleBuilder } from './A-FrameBundle.builder.env-node';
|
|
2
|
+
export type { A_FrameBundleBuilderOptions } from './A-FrameBundle.builder.env-node';
|
|
3
|
+
export type { A_FrameBundle } from './A-FrameBundle.types';
|
|
4
|
+
export {
|
|
5
|
+
A_FRAME_BUNDLE_VERSION,
|
|
6
|
+
A_FRAME_BUNDLE_DEFAULT_FILENAME,
|
|
7
|
+
} from './A-FrameBundle.constants';
|