@adaas/a-frame 0.0.9 → 0.0.11

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/containers/CLI.container.ts","../../src/lib/components/Index.component.ts/Index.types.ts","../../src/lib/components/Index.component.ts/Index.error.ts","../../src/lib/components/Index.component.ts/Index.guard.ts","../../src/lib/components/Index.component.ts/decorators/IndexComponent.decorator.ts","../../src/lib/components/Index.component.ts/decorators/IndexNamespace.decorator.ts","../../src/lib/components/Index.component.ts/decorators/IndexDescribe.decorator.ts","../../src/lib/entities/Namespace/Namespace.entity.ts","../../src/lib/components/Index.component.ts/IndexConfigurations.meta.ts","../../src/lib/components/Index.component.ts/Index.meta.ts","../../src/lib/components/Index.component.ts/Index.component.ts"],"names":["A_Frame_IndexTargetType","A_Error","A_Context","A_CommonHelper","A_Meta"],"mappings":";;;;;;;;;;;;AAGO,IAAM,oBAAA,GAAN,cAAmC,WAAA,CAAY;AAAA,EAKlD,MAAM,UAAA,GAAa;AACf,IAAA,IAAI,SAAA,CAAU,gBAAgB,QAAA,EAAU;AACpC,MAAA,MAAM,IAAI,QAAQ,sDAAsD,CAAA;AAAA,IAC5E;AAAA,EACJ;AAAA,EAIA,MAAM,iBAAA,GAAoB;AACtB,IAAA,OAAA,CAAQ,IAAI,wCAAwC,CAAA;AAEpD,IAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA;AAEjC,IAAA,OAAA,CAAQ,GAAA,CAAI,2BAA2B,IAAI,CAAA;AAAA,EAG/C;AAEJ;AAlBU,eAAA,CAAA;AAAA,EADL,UAAU,IAAA;AAAK,CAAA,EAJP,oBAAA,CAKH,SAAA,EAAA,YAAA,EAAA,CAAA,CAAA;AAQA,eAAA,CAAA;AAAA,EADL,UAAU,KAAA;AAAM,CAAA,EAZR,oBAAA,CAaH,SAAA,EAAA,mBAAA,E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A,CAAI,qCAA4C,WAAW,CAAA;AAAA,EACpE;AACJ;;;ACjBO,IAAM,aAAA,GAAN,cAA4B,WAAA,CAAY;AAAA;AAAA;AAAA;AAAA,EAM3C,OAAO,UAAU,IAAA,EAAgD;AAC7D,IAAA,OAAO,gCAAgC,IAAI,CAAA;AAAA,EAC/C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,SAAS,WAAA,EAAuD;AACnE,IAAA,OAAO,+BAA+B,WAAW,CAAA;AAAA,EACrD;AAAA,EASA,OAAO,SAAA,CAAU,OAAA,GAAyC,EAAC,EAAmB;AAC1E,IAAA,OAAO,oDAA0D,OAAO,CAAA;AAAA,EAC5E;AAAA,EAOA,OAAO,SAAA,CAAU,OAAA,GAAyC,EAAC,EAAmB;AAC1E,IAAA,OAAO,oDAA0D,OAAO,CAAA;AAAA,EAC5E;AAAA,EAQA,OAAO,MAAA,CAAO,OAAA,GAAyC,EAAC,EAAmB;AACvE,IAAA,OAAO,8CAAuD,OAAO,CAAA;AAAA,EACzE;AAAA,EASA,OAAO,QAAA,CAAS,OAAA,GAAyC,EAAC,EAAmB;AACzE,IAAA,OAAO,kDAAyD,OAAO,CAAA;AAAA,EAC3E;AAAA,EAQA,OAAO,MAAA,CAAO,OAAA,GAAyC,EAAC,EAAoB;AACxE,IAAA,OAAO,8CAAuD,OAAO,CAAA;AAAA,EACzE;AAEJ;AApEa,aAAA,GAAN,eAAA,CAAA;AAAA,EADNA,MAAAA,CAAO,OAAO,iBAAiB;AAAA,CAAA,EACnB,aAAA,CAAA","file":"index.mjs","sourcesContent":["import { A_Concept, A_Container, A_Context, A_Error } from \"@adaas/a-concept\";\n\n\nexport class A_Frame_CLIContainer extends A_Container {\n\n\n\n @A_Concept.Load()\n async initialize() {\n if (A_Context.environment !== 'server') {\n throw new A_Error('A-Frame CLI can only be used in Node.js environment.');\n }\n }\n\n\n @A_Concept.Start()\n async readCommandParams() {\n console.log('Reading command parameters from CLI...');\n\n const args = process.argv.slice(2);\n\n console.log('Command Line Arguments:', args);\n\n // Here you can parse the args and set them to the container's state or properties as needed\n }\n\n}","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\"\nimport { A_Namespace } from \"src/lib/entities/Namespace/Namespace.entity\"\n\n\nexport type A_Frame_IndexOptions = {\n name?: string,\n namespace?: string | A_Namespace\n description?: string\n}\n\n\n\nexport type A_Frame_IndexMetaTarget = A_TYPES__Container_Constructor\n | A_TYPES__Entity_Constructor\n | A_TYPES__Component_Constructor\n | A_TYPES__Fragment_Constructor\n\n\n// ===========================================================================\n// --------------------------- Decorator Types -------------------------------\n// ===========================================================================\n// ---------------------------------------------------------------------------\n// -------------------- A-Frame Index Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_Frame_IndexDecoratorDescriptor =\n TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n\n\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_Frame_IndexDecoratorTarget = A_Frame_IndexMetaTarget\n | A_Component\n | A_Container\n | A_Entity\n | A_Fragment\n/**\n * Targets types that can be indexed\n */\nexport enum A_Frame_IndexTargetType {\n COMPONENT = 'component',\n ENTITY = 'entity',\n CONTAINER = 'container',\n FRAGMENT = 'fragment',\n METHOD = 'method'\n}\n\n/**\n * A type of Meta information stored by Index decorator\n * This information is used by A-Context to build a proper index structure\n */\nexport type A_Frame_IndexDecoratorMeta = {\n /**\n * Component name\n */\n name: string,\n /**\n * Component description\n */\n description?: string,\n /**\n * Type of the component\n */\n type: A_Frame_IndexTargetType,\n /**\n * Namespace for the component\n */\n namespace?: string | A_Namespace,\n /**\n * Constructor reference\n */\n constructor: A_Frame_IndexDecoratorTarget\n}\n\n\n// ---------------------------------------------------------------------------\n// -------------------- A-Frame Index Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_Frame_IndexNamespaceDecoratorDescriptor =\n TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n\n\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_Frame_IndexNamespaceDecoratorTarget = A_Container\n | A_Entity\n | A_Component\n | A_Fragment\n | A_TYPES__Fragment_Constructor\n | A_TYPES__Component_Constructor\n | A_TYPES__Container_Constructor\n | A_TYPES__Entity_Constructor\n\n\n\n\n// ---------------------------------------------------------------------------\n// ------------- A-Frame Index Configurations Meta Types----------------------\n// ---------------------------------------------------------------------------\n\n\nexport type A_Frame_IndexConfigurationsMetaType = {\n namespaces: string,\n descriptions: string,\n type: string,\n name: string,\n methods: Map<string, A_Frame_IndexConfigurationsMetaMethodMeta>\n}\n\n\nexport type A_Frame_IndexConfigurationsMetaMethodMeta = {\n name: string,\n description?: string,\n methodName: string\n}","import { A_Error } from \"@adaas/a-concept\";\n\n\nexport class A_Frame_IndexError extends A_Error {\n\n static readonly InvalidTarget = 'A-Frame Index Invalid Target Error';\n\n static readonly InvalidConfiguration = 'A-Frame Index Invalid Configuration Error';\n\n static readonly IndexDefinitionError = 'A-Frame Index Definition Error';\n static readonly IndexMetadataError = 'A-Frame Index Metadata Error';\n static readonly IndexRegistryError = 'A-Frame Index Registry Error';\n static readonly IndexComponentNotFoundError = 'A-Frame Index Component Not Found Error';\n}","import { A_CommonHelper, A_TypeGuards } from \"@adaas/a-concept\";\nimport { A_Frame_IndexDecoratorTarget, A_Frame_IndexMetaTarget } from \"./Index.types\";\n\n\n\nexport class A_Frame_IndexTypeGuard {\n /**\n * Determines if the target is an allowed type for indexing\n * \n * @param target \n * @returns \n */\n static isAllowedTarget(target: any): target is A_Frame_IndexDecoratorTarget {\n return A_TypeGuards.isEntityConstructor(target)\n || A_TypeGuards.isComponentConstructor(target)\n || A_TypeGuards.isContainerConstructor(target)\n || A_TypeGuards.isFragmentConstructor(target)\n || A_TypeGuards.isComponentInstance(target)\n || A_TypeGuards.isContainerInstance(target)\n || A_TypeGuards.isEntityInstance(target)\n || A_TypeGuards.isFragmentInstance(target);\n }\n\n\n\n static getTargetName(target: A_Frame_IndexDecoratorTarget): string {\n return A_CommonHelper.getComponentName(target);\n }\n\n\n static getTargetConstructor(target: A_Frame_IndexDecoratorTarget): A_Frame_IndexMetaTarget {\n return typeof target === 'function' ? target : target.constructor as A_Frame_IndexMetaTarget;\n }\n}","import { A_CommonHelper, A_Context, A_Meta } from \"@adaas/a-concept\";\nimport { A_Frame_IndexError } from \"../Index.error\";\nimport { A_Frame_IndexDecoratorTarget, A_Frame_IndexOptions, A_Frame_IndexTargetType, A_Frame_IndexDecoratorDescriptor, A_Frame_IndexMetaTarget } from \"../Index.types\";\nimport { A_Frame_Index } from \"../Index.component\";\nimport { A_Frame_IndexMeta } from \"../Index.meta\";\nimport { A_Frame_IndexTypeGuard } from \"../Index.guard\";\n\nexport function A_Frame_IndexDecorator(\n componentType: A_Frame_IndexTargetType,\n config: Partial<A_Frame_IndexOptions> = {}\n) {\n return function (\n target: A_Frame_IndexDecoratorTarget,\n propertyKey?: string | symbol,\n descriptor?: A_Frame_IndexDecoratorDescriptor\n ): any {\n\n // Handle method decorator case\n if (propertyKey && descriptor && componentType === A_Frame_IndexTargetType.METHOD) {\n // For methods, target is the class prototype\n const targetClass = target.constructor as A_Frame_IndexMetaTarget;\n const methodName = String(propertyKey);\n\n try {\n const indexMeta: A_Frame_IndexMeta = A_Context.meta(A_Frame_Index) as any;\n const targetMeta = indexMeta.getMetaFor(targetClass);\n\n\n if (!!config.namespace && !!targetMeta.namespace && config.namespace !== targetMeta.namespace) {\n throw new A_Frame_IndexError(\n A_Frame_IndexError.InvalidConfiguration,\n `Method namespace '${config.namespace}' does not match target class namespace '${targetMeta.namespace}'.`\n );\n }\n\n // Store method information\n const methodInfo = {\n name: config.name || methodName,\n description: config.description,\n namespace: config.namespace || targetMeta.namespace,\n methodName: methodName\n };\n\n // Add to methods array\n targetMeta.addMethod(methodInfo);\n\n indexMeta.seMetaFor(targetClass, targetMeta);\n\n return descriptor;\n\n } catch (error) {\n\n throw new A_Frame_IndexError(\n A_Frame_IndexError.IndexDefinitionError,\n `Unable to apply @A_Frame_Index.Method decorator on '${targetClass.name}.${methodName}': ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n\n }\n }\n\n // Handle class decorator case\n if (!A_Frame_IndexTypeGuard.isAllowedTarget(target)) {\n throw new A_Frame_IndexError(\n A_Frame_IndexError.InvalidTarget,\n `@A_Frame_Index.${componentType} decorator can only be applied to allowed targets.`\n );\n }\n\n // for error messages\n const componentName = A_CommonHelper.getComponentName(target);\n\n try {\n // Get the index meta for the global A_Frame_Index component\n const indexMeta: A_Frame_IndexMeta = A_Context.meta(A_Frame_Index) as any;\n\n const targetClass = A_Frame_IndexTypeGuard.getTargetConstructor(target);\n\n // Check for pending namespace and description from other decorators\n const targetMeta = indexMeta.getMetaFor(targetClass);\n\n targetMeta.name = config.name || componentName;\n targetMeta.description = config.description;\n targetMeta.namespace = config.namespace;\n targetMeta.type = componentType;\n\n indexMeta.seMetaFor(targetClass, targetMeta);\n\n return target;\n\n } catch (error) {\n throw new A_Frame_IndexError(\n A_Frame_IndexError.IndexDefinitionError,\n `Unable to apply @A_Frame_Index.${componentType} decorator on '${componentName}': ${error instanceof Error ? error.message : 'Unknown error'}`\n );\n }\n };\n}","import { A_CommonHelper, A_Context } from \"@adaas/a-concept\";\nimport { A_Frame_IndexDecoratorDescriptor, A_Frame_IndexDecoratorTarget, A_Frame_IndexNamespaceDecoratorTarget } from \"../Index.types\";\nimport { A_Frame_Index } from \"../Index.component\";\nimport { A_Frame_IndexTypeGuard } from \"../Index.guard\";\nimport { A_Frame_IndexMeta } from \"../Index.meta\";\nimport { A_Frame_IndexError } from \"../Index.error\";\n\nexport function A_Frame_IndexNamespaceDecorator(name?: string) {\n return function (\n target: A_Frame_IndexDecoratorTarget,\n propertyKey?: string | symbol,\n descriptor?: A_Frame_IndexDecoratorDescriptor\n\n ): A_Frame_IndexDecoratorTarget {\n const componentName = A_CommonHelper.getComponentName(target);\n\n if (!A_Frame_IndexTypeGuard.isAllowedTarget(target)) {\n throw new A_Frame_IndexError(\n A_Frame_IndexError.InvalidTarget,\n `Unable Apply Describe Index Decorator for '${componentName}': Target type is not allowed.`\n );\n }\n\n // for error messages\n\n try {\n // Get the index meta for the global A_Frame_Index component\n // TODO: Type casting hack to avoid circular dependency issues\n const indexMeta: A_Frame_IndexMeta = A_Context.meta(A_Frame_Index) as any;\n\n const targetClass = A_Frame_IndexTypeGuard.getTargetConstructor(target);\n\n // Check for pending namespace and description from other decorators\n const targetMeta = indexMeta.getMetaFor(targetClass)\n if (!!propertyKey || !!descriptor) {\n\n // const targetMethodName = propertyKey ? propertyKey.toString() : '';\n\n // const methodMeta = targetMeta.methods.get(targetMethodName);\n // if (!!methodMeta) {\n // methodMeta.namespace = name;\n // targetMeta.methods.set(targetMethodName, methodMeta);\n // }\n\n } else {\n targetMeta.namespace = name;\n\n indexMeta.seMetaFor(targetClass, targetMeta);\n }\n\n return target;\n\n } catch (error) {\n throw new A_Frame_IndexError(error);\n }\n };\n}","import { A_CommonHelper, A_Context } from \"@adaas/a-concept\";\nimport { A_Frame_IndexDecoratorDescriptor, A_Frame_IndexDecoratorTarget, A_Frame_IndexNamespaceDecoratorTarget } from \"../Index.types\";\nimport { A_Frame_Index } from \"../Index.component\";\nimport { A_Frame_IndexMeta } from \"../Index.meta\";\nimport { A_Frame_IndexTypeGuard } from \"../Index.guard\";\nimport { A_Frame_IndexError } from \"../Index.error\";\n\nexport function A_Frame_IndexDescribeDecorator(description: string) {\n return function (\n target: A_Frame_IndexDecoratorTarget,\n propertyKey?: string | symbol,\n descriptor?: A_Frame_IndexDecoratorDescriptor\n\n ): A_Frame_IndexDecoratorTarget {\n const componentName = A_CommonHelper.getComponentName(target);\n\n if (!A_Frame_IndexTypeGuard.isAllowedTarget(target)) {\n throw new A_Frame_IndexError(\n A_Frame_IndexError.InvalidTarget,\n `Unable Apply Describe Index Decorator for '${componentName}': Target type is not allowed.`\n );\n }\n\n // for error messages\n\n // for error messages\n\n try {\n // Get the index meta for the global A_Frame_Index component\n // TODO: Type casting hack to avoid circular dependency issues\n const indexMeta: A_Frame_IndexMeta = A_Context.meta(A_Frame_Index) as any;\n\n const targetClass = A_Frame_IndexTypeGuard.getTargetConstructor(target);\n\n // Check for pending namespace and description from other decorators\n const targetMeta = indexMeta.getMetaFor(targetClass)\n if (!!propertyKey || !!descriptor) {\n\n const targetMethodName = propertyKey ? propertyKey.toString() : '';\n\n const methodMeta = targetMeta.methods.get(targetMethodName);\n if (!!methodMeta) {\n methodMeta.description = description;\n targetMeta.methods.set(targetMethodName, methodMeta);\n }\n\n } else {\n targetMeta.description = description;\n\n indexMeta.seMetaFor(targetClass, targetMeta);\n }\n\n return target;\n\n } catch (error) {\n throw new A_Frame_IndexError(error);\n }\n };\n}","import { A_Entity } from \"@adaas/a-concept\";\n\n\nexport class A_Namespace extends A_Entity {\n\n\n \n}","import { A_Meta } from \"@adaas/a-concept\";\nimport { A_Namespace } from \"../../entities/Namespace/Namespace.entity\";\nimport { A_Frame_IndexConfigurationsMetaMethodMeta, A_Frame_IndexConfigurationsMetaType } from \"./Index.types\";\n\n\n\nexport class A_Frame_IndexConfigurationsMeta extends A_Meta<Partial<A_Frame_IndexConfigurationsMetaType>> {\n\n get name(): string | undefined {\n return this.get('name');\n }\n\n set name(value: string | undefined) {\n if (value)\n this.set('name', value);\n }\n\n\n get type(): string | undefined {\n return this.get('type');\n }\n\n set type(value: string | undefined) {\n if (value)\n this.set('type', value);\n }\n\n\n get namespace(): string | undefined {\n return this.get('namespaces');\n }\n\n set namespace(value: string | undefined | A_Namespace) {\n if (value) {\n const target = value instanceof A_Namespace ? value.aseid.toString() : value;\n this.set('namespaces', target);\n }\n }\n\n\n get description(): string | undefined {\n return this.get('descriptions');\n }\n\n set description(value: string | undefined) {\n if (value)\n this.set('descriptions', value);\n }\n\n\n\n get methods(): Map<string, A_Frame_IndexConfigurationsMetaMethodMeta> {\n if (!this.get('methods')) {\n this.set('methods', new Map());\n }\n\n return this.get('methods')!;\n }\n\n\n clear(): void {\n this.set('name', undefined);\n this.set('type', undefined);\n this.set('namespaces', undefined);\n this.set('descriptions', undefined);\n this.set('methods', new Map());\n }\n\n\n addMethod(methodMeta: A_Frame_IndexConfigurationsMetaMethodMeta): void {\n const methods = this.methods;\n\n if (!methods.has(methodMeta.name)) {\n methods.set(methodMeta.name, methodMeta);\n this.set('methods', methods);\n }\n }\n}","import { A_ComponentMeta, A_Context, A_Meta } from \"@adaas/a-concept\";\nimport { A_Frame_IndexDecoratorMeta, A_Frame_IndexTargetType, A_Frame_IndexMetaTarget } from \"./Index.types\";\nimport { A_Frame_Index } from \"./Index.component\";\nimport { A_Frame_IndexConfigurationsMeta } from \"./IndexConfigurations.meta\";\n\nexport class A_Frame_IndexMeta extends A_ComponentMeta {\n\n getMetaFor(target: A_Frame_IndexMetaTarget): A_Frame_IndexConfigurationsMeta {\n\n const targetSpace = this.get('A_FRAME_INDEX_CONFIGURATIONS_META' as any) || new Map<A_Frame_IndexMetaTarget, A_Frame_IndexConfigurationsMeta>();\n\n if (!targetSpace.has(target)) {\n targetSpace.set(target, new A_Frame_IndexConfigurationsMeta());\n this.set('A_FRAME_INDEX_CONFIGURATIONS_META' as any, targetSpace);\n }\n\n return targetSpace.get(target)!;\n }\n\n\n seMetaFor(target: A_Frame_IndexMetaTarget, meta: A_Frame_IndexConfigurationsMeta): void {\n const targetSpace = this.get('A_FRAME_INDEX_CONFIGURATIONS_META' as any) || new Map<A_Frame_IndexMetaTarget, A_Frame_IndexConfigurationsMeta>();\n\n targetSpace.set(target, meta);\n\n this.set('A_FRAME_INDEX_CONFIGURATIONS_META' as any, targetSpace);\n }\n}\n","import { A_Component, A_Meta } from \"@adaas/a-concept\";\nimport { A_Frame_IndexOptions, A_Frame_IndexTargetType } from \"./Index.types\";\nimport { A_Frame_IndexDecorator } from \"./decorators/IndexComponent.decorator\";\nimport { A_Frame_IndexNamespaceDecorator } from \"./decorators/IndexNamespace.decorator\";\nimport { A_Frame_IndexDescribeDecorator } from \"./decorators/IndexDescribe.decorator\";\nimport { A_Frame_IndexMeta } from \"./Index.meta\";\n\n\n\n@A_Meta.Define(A_Frame_IndexMeta)\nexport class A_Frame_Index extends A_Component {\n\n\n /**\n * Allows to mark namespace and add it to index structure,\n */\n static Namespace(name: string): ClassDecorator & MethodDecorator {\n return A_Frame_IndexNamespaceDecorator(name) as ClassDecorator & MethodDecorator;\n }\n\n /**\n * Allows to add description to a class and add it to index structure\n */\n static Describe(description: string): ClassDecorator & MethodDecorator {\n return A_Frame_IndexDescribeDecorator(description) as ClassDecorator & MethodDecorator;\n }\n\n\n\n /**\n * Allows to mark component and add it to index structure,\n */\n static Component(): ClassDecorator\n static Component(options: Partial<A_Frame_IndexOptions>): ClassDecorator\n static Component(options: Partial<A_Frame_IndexOptions> = {}): ClassDecorator {\n return A_Frame_IndexDecorator(A_Frame_IndexTargetType.COMPONENT, options) as ClassDecorator;\n }\n\n /**\n * Allows to mark container and add it to index structure,\n */\n static Container(): ClassDecorator\n static Container(options: Partial<A_Frame_IndexOptions>): ClassDecorator\n static Container(options: Partial<A_Frame_IndexOptions> = {}): ClassDecorator {\n return A_Frame_IndexDecorator(A_Frame_IndexTargetType.CONTAINER, options) as ClassDecorator;\n }\n\n /**\n * Allows to mark entity and add it to index structure, \n * so it can be reused in other components or structures\n */\n static Entity(): ClassDecorator\n static Entity(options: Partial<A_Frame_IndexOptions>): ClassDecorator\n static Entity(options: Partial<A_Frame_IndexOptions> = {}): ClassDecorator {\n return A_Frame_IndexDecorator(A_Frame_IndexTargetType.ENTITY, options) as ClassDecorator;\n }\n\n\n /**\n * Allows to mark fragment and add it to index structure, \n * so it can be reused in other components or structures\n */\n static Fragment(): ClassDecorator\n static Fragment(options: Partial<A_Frame_IndexOptions>): ClassDecorator\n static Fragment(options: Partial<A_Frame_IndexOptions> = {}): ClassDecorator {\n return A_Frame_IndexDecorator(A_Frame_IndexTargetType.FRAGMENT, options) as ClassDecorator;\n }\n\n /**\n * Allows to define a reusable AI method from components, \n * that can be reused in other components. to build new Features\n */\n static Method(): MethodDecorator\n static Method(options: Partial<A_Frame_IndexOptions>): MethodDecorator\n static Method(options: Partial<A_Frame_IndexOptions> = {}): MethodDecorator {\n return A_Frame_IndexDecorator(A_Frame_IndexTargetType.METHOD, options) as MethodDecorator;\n }\n\n}"]}
package/jest.config.ts CHANGED
@@ -9,13 +9,13 @@ const config: Config.InitialOptions = {
9
9
  '^.+\\.tsx?$': 'ts-jest'
10
10
  },
11
11
  moduleNameMapper: {
12
- "@adaas/a-concept/constants/(.*)": ["<rootDir>/src/constants/$1"],
13
- "@adaas/a-concept/global/(.*)": ["<rootDir>/src/global/$1"],
14
- "@adaas/a-concept/types/(.*)": ["<rootDir>/src/types/$1"],
15
- "@adaas/a-concept/helpers/(.*)": ["<rootDir>/src/helpers/$1"],
16
- "@adaas/a-concept/decorators/(.*)": ["<rootDir>/src/decorators/$1"],
17
- "@adaas/a-concept/base/(.*)": ["<rootDir>/src/base/$1"],
18
- "@adaas/a-concept/utils/(.*)": ["<rootDir>/src/utils/$1"]
12
+ "@adaas/a-frame/constants/(.*)": ["<rootDir>/src/constants/$1"],
13
+ "@adaas/a-frame/global/(.*)": ["<rootDir>/src/global/$1"],
14
+ "@adaas/a-frame/types/(.*)": ["<rootDir>/src/types/$1"],
15
+ "@adaas/a-frame/helpers/(.*)": ["<rootDir>/src/helpers/$1"],
16
+ "@adaas/a-frame/decorators/(.*)": ["<rootDir>/src/decorators/$1"],
17
+ "@adaas/a-frame/base/(.*)": ["<rootDir>/src/base/$1"],
18
+ "@adaas/a-frame/utils/(.*)": ["<rootDir>/src/utils/$1"]
19
19
  }
20
20
 
21
21
  };
package/package.json CHANGED
@@ -1,19 +1,41 @@
1
1
  {
2
2
  "name": "@adaas/a-frame",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "A-frame is index build engine for A-Concept ecosystem. It provides a way to build index structures for A-Concept basics",
5
5
  "license": "Apache-2.0",
6
- "main": "./dist/index.cjs",
7
- "module": "./dist/index.mjs",
8
- "types": "./dist/index.d.ts",
9
- "bin": {
10
- "a-frame": "./dist/index.js"
6
+ "author": {
7
+ "name": "ADAAS YAZILIM LİMİTED ŞİRKETİ",
8
+ "email": "contact-us@adaas.org"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/ADAAS-org/adaas-a-frame/issues"
11
12
  },
12
13
  "homepage": "https://github.com/ADAAS-org/adaas-a-frame#readme",
13
14
  "repository": {
14
15
  "type": "git",
15
16
  "url": "git+https://github.com/ADAAS-org/adaas-a-frame.git"
16
17
  },
18
+ "bin": {
19
+ "a-frame": "./dist/index.js"
20
+ },
21
+ "exports": {
22
+ ".": {
23
+ "browser": {
24
+ "types": "./dist/browser/index.d.mts",
25
+ "import": "./dist/browser/index.mjs"
26
+ },
27
+ "node": {
28
+ "types": "./dist/node/index.d.ts",
29
+ "import": "./dist/node/index.mjs",
30
+ "require": "./dist/node/index.cjs"
31
+ },
32
+ "default": {
33
+ "types": "./dist/node/index.d.ts",
34
+ "import": "./dist/node/index.mjs",
35
+ "require": "./dist/node/index.cjs"
36
+ }
37
+ }
38
+ },
17
39
  "keywords": [
18
40
  "adaas",
19
41
  "a-frame",
@@ -22,20 +44,7 @@
22
44
  "a-concept",
23
45
  "rag"
24
46
  ],
25
- "author": {
26
- "name": "ADAAS YAZILIM LİMİTED ŞİRKETİ",
27
- "email": "contact-us@adaas.org"
28
- },
29
- "bugs": {
30
- "url": "https://github.com/ADAAS-org/adaas-a-frame/issues"
31
- },
32
47
  "sideEffects": false,
33
- "exports": {
34
- ".": {
35
- "import": "./dist/index.mjs",
36
- "require": "./dist/index.cjs"
37
- }
38
- },
39
48
  "nodemonConfig": {
40
49
  "ignore": [
41
50
  "**/*.test.ts",
@@ -61,7 +70,7 @@
61
70
  "build": "tsup --config tsup.config.ts"
62
71
  },
63
72
  "dependencies": {
64
- "@adaas/a-concept": "^0.2.8"
73
+ "@adaas/a-concept": "^0.3.2"
65
74
  },
66
75
  "devDependencies": {
67
76
  "@types/chai": "^4.3.14",
package/tsconfig.json CHANGED
@@ -1,60 +1,41 @@
1
1
  {
2
- "compileOnSave": false,
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- "strict": true,
6
- "noImplicitAny": false,
7
- "noFallthroughCasesInSwitch": true,
8
- "downlevelIteration": true,
9
- "strictFunctionTypes": true,
10
- "strictNullChecks": true,
11
- "strictPropertyInitialization": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "resolveJsonModule": true,
14
- "noErrorTruncation": true,
15
- "jsx": "react",
16
- "target": "es2015",
17
- "module": "commonjs",
18
- "moduleResolution": "node",
19
- "allowSyntheticDefaultImports": true,
20
- "esModuleInterop": true,
21
- "noUnusedLocals": false,
22
- "noUnusedParameters": false,
23
- "removeComments": false,
24
- "preserveConstEnums": true,
25
- "sourceMap": true,
26
- "baseUrl": ".",
27
- "experimentalDecorators": true,
28
- "skipLibCheck": true,
29
- "typeRoots": [
30
- "node_modules/@types"
31
- ],
32
- "paths": {
33
- "@adaas/a-frame/constants/*": ["src/constants/*"],
34
- "@adaas/a-frame/lib/*": ["src/lib/*"],
35
- "@adaas/a-frame/types/*": ["src/types/*"],
36
- "@adaas/a-frame/helpers/*": ["src/helpers/*"],
37
- "@adaas/a-frame/decorators/*": ["src/decorators/*"],
38
- "@adaas/a-frame/utils/*": ["src/utils/*"]
39
- },
40
- "lib": [
41
- "dom",
42
- "esnext.asynciterable",
43
- "es2015",
44
- "es2016",
45
- "es2017.object"
46
- ]
47
- },
48
- "include": [
49
- "src/**/*",
50
- "tests/**/*",
51
- "examples/**/*",
52
- "src/index.ts",
53
- "./index.ts"
54
- ],
55
- "exclude": [
56
- "node_modules/**/*",
57
- "dist/**/*",
58
- "node_modules/@types/mocha/index.d.ts"
59
- ]
2
+ "extends": "./.conf/tsconfig.base.json",
3
+
4
+ "compilerOptions": {
5
+ "rootDir": "./",
6
+ "baseUrl": ".",
7
+ /* ===============================
8
+ Internal aliases (DEV ONLY)
9
+ =============================== */
10
+ "paths": {
11
+ "@adaas/a-frame/constants/*": ["src/constants/*"],
12
+ "@adaas/a-frame/utils/*": ["src/utils/*"],
13
+ "@adaas/a-frame/helpers/*": ["src/helpers/*"],
14
+ "@adaas/a-frame/types": ["src/types"],
15
+
16
+ },
17
+
18
+ /* ===============================
19
+ Types
20
+ =============================== */
21
+ "types": [
22
+ "node",
23
+ "jest",
24
+ "mocha",
25
+ ],
26
+ "typeRoots": ["node_modules/@types"]
27
+ },
28
+
29
+ "include": [
30
+ "src/**/*",
31
+ "tests/**/*",
32
+ "examples/**/*.ts",
33
+ "src/index.ts",
34
+ "src/env/global.browser.d.ts"
35
+ ],
36
+
37
+ "exclude": [
38
+ "node_modules",
39
+ "dist",
40
+ ]
60
41
  }
package/tsup.config.ts CHANGED
@@ -1,32 +1,111 @@
1
1
  import { defineConfig } from "tsup";
2
2
 
3
- export default defineConfig((options) => ({
4
- entry: ["src/index.ts"],
5
- format: ["esm", "cjs"],
6
- dts: true,
7
- clean: !options.watch,
8
- sourcemap: true,
9
- target: "es2020",
10
- minify: !options.watch,
11
- treeshake: "recommended",
12
- skipNodeModulesBundle: true,
13
- splitting: false,
14
- silent: false,
15
- platform: "neutral",
16
- // Add hash to filenames for cache busting in production builds
17
- outExtension({ format }) {
18
- return {
19
- js: format === "esm" ? `.mjs` : `.cjs`,
20
- };
21
- },
22
- // Extra optimization options (for 2025 esbuild)
23
- esbuildOptions(options) {
24
- options.keepNames = true; // Preserve class/function names for better debugging
25
- options.charset = "utf8";
3
+ export default defineConfig([
4
+ /**
5
+ * ============================
6
+ * Browser build
7
+ * ============================
8
+ *
9
+ * Produces:
10
+ * dist/browser/index.mjs
11
+ * dist/browser/env.mjs
12
+ *
13
+ * - No Node globals
14
+ * - No `process`
15
+ * - Used by bundlers (Vite, Webpack, Rollup)
16
+ */
17
+ {
18
+ entry: {
19
+ // Public library entry
20
+ index: "src/index.ts",
21
+ },
22
+
23
+ tsconfig: "./.conf/tsconfig.browser.json", // Separate tsconfig for browser build
24
+
25
+ // Output directory for browser bundle
26
+ outDir: "dist/browser",
27
+
28
+ bundle: true, // Bundle for browser consumption
29
+
30
+ // Browser consumers expect ESM
31
+ format: ["esm"],
32
+
33
+ // Tells esbuild this is browser-safe code
34
+ platform: "browser",
35
+
36
+ // Reasonable baseline for modern browsers
37
+ target: "es2020",
38
+
39
+ // Smaller bundles
40
+ treeshake: true,
41
+
42
+ // Useful for debugging in bundlers
43
+ sourcemap: true,
44
+
45
+ // Emit .d.ts files
46
+ dts: true,
47
+
48
+ minify: true, // Minify browser build for smaller size
49
+
50
+ // Ensure .mjs extension for ESM output
51
+ outExtension({ format }) {
52
+ return {
53
+ js: ".mjs"
54
+ };
55
+ }
26
56
  },
27
57
 
28
- // Enable minification for output size (production only)
29
- minifyWhitespace: !options.watch,
30
- minifyIdentifiers: !options.watch,
31
- minifySyntax: !options.watch,
32
- }));
58
+ /**
59
+ * ============================
60
+ * Node build
61
+ * ============================
62
+ *
63
+ * Produces:
64
+ * dist/node/index.mjs
65
+ * dist/node/index.cjs
66
+ * dist/node/env.mjs
67
+ * dist/node/env.cjs
68
+ *
69
+ * - Can use process.env
70
+ * - Used by Node (ESM + CJS)
71
+ */
72
+ {
73
+ entry: {
74
+ // Same public API as browser
75
+ index: "src/index.ts",
76
+ },
77
+
78
+ tsconfig: "./.conf/tsconfig.node.json", // Separate tsconfig for node build
79
+
80
+ splitting: true, // Disable code splitting for Node build
81
+
82
+ // Output directory for node bundle
83
+ outDir: "dist/node",
84
+
85
+ bundle: true, // Don't bundle node build, keep imports as-is
86
+
87
+ // Support both module systems
88
+ format: ["esm", "cjs"],
89
+
90
+ // Enables Node globals and resolution
91
+ platform: "node",
92
+
93
+ // Node 16+ safe baseline
94
+ target: "es2020",
95
+
96
+ treeshake: true,
97
+ sourcemap: true,
98
+
99
+ // Emit .d.ts files (shared shape)
100
+ dts: true,
101
+
102
+ minify: false, // Don't minify Node build for better readability
103
+
104
+ // Ensure .cjs extension for CommonJS output
105
+ outExtension({ format }) {
106
+ return {
107
+ js: format === "esm" ? ".mjs" : ".cjs"
108
+ };
109
+ }
110
+ },
111
+ ]);