@treenity/core 1.0.42 → 1.0.44
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 +18 -0
- package/dist/context.d.ts +1 -3
- package/dist/context.mjs.map +1 -1
- package/dist/contexts/react-context.mjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/meta-type.d.ts +12 -6
- package/dist/meta-type.mjs +30 -10
- package/dist/meta-type.mjs.map +1 -1
- package/dist/meta.d.ts +0 -2
- package/dist/meta.mjs +1 -4
- package/dist/meta.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @treenity/core
|
|
2
2
|
|
|
3
|
+
## 1.0.44
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update libs
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @treenity/call-chain@1.0.29
|
|
10
|
+
- @treenity/js-shared@1.0.33
|
|
11
|
+
|
|
12
|
+
## 1.0.43
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Update version
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @treenity/call-chain@1.0.28
|
|
19
|
+
- @treenity/js-shared@1.0.32
|
|
20
|
+
|
|
3
21
|
## 1.0.42
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ReactTypeContext } from './contexts/react-context';
|
|
3
|
-
import { MetaType } from './meta-type';
|
|
3
|
+
import { MetaName, MetaType } from './meta-type';
|
|
4
4
|
export interface TypeContextInfo<C, O> {
|
|
5
5
|
id: string;
|
|
6
6
|
context: string;
|
|
@@ -8,7 +8,6 @@ export interface TypeContextInfo<C, O> {
|
|
|
8
8
|
component: C;
|
|
9
9
|
options: O;
|
|
10
10
|
}
|
|
11
|
-
type MetaName<T> = string | MetaType<T>;
|
|
12
11
|
export declare const registerComp: <T>(type: MetaName<T>, component: any) => (ctx: ReactTypeContext) => TypeContextInfo<import("react").FC<{
|
|
13
12
|
value: any;
|
|
14
13
|
node: import("./node").Node;
|
|
@@ -39,4 +38,3 @@ export declare class ContextImpl<C, O> implements Context<C, O> {
|
|
|
39
38
|
get<T>(subContext: string, typeName?: MetaName<T>): Promise<[C, O]>;
|
|
40
39
|
search(subContext: string, query?: string): Promise<TypeContextInfo<C, O>[]>;
|
|
41
40
|
}
|
|
42
|
-
export {};
|
package/dist/context.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","sources":["../src/context.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"context.mjs","sources":["../src/context.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAcO,MAAM,YAAY,GACvB,CAAI,IAAiB,EAAE,SAAc,KACrC,CAAC,GAAqB,KACpB,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;MA+BjC,WAAW,CAAA;AAGH,IAAA,IAAA;AAFnB,IAAA,KAAK,GAAuC,IAAI,GAAG,EAAE;AAErD,IAAA,WAAA,CAAmB,IAAY,EAAA;QAAZ,IAAI,CAAA,IAAA,GAAJ,IAAI;AACrB,QAAA,YAAY,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI;;;;IAK7B,GAAG,CAAC,GAAG,IAAW,EAAA;AAChB,QAAA,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;AAAE,YAAA,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;AAC7C,QAAA,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,GAAG,EAAO,CAAC,GAAG,IAE1D;AACD,QAAA,QAAQ,GAAG,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;A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AI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;AAErC,QAAA,OAAO,IAAI;;IAGb,GAAG,CAAI,UAAkB,EAAE,QAAsB,EAAA;AAC/C,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK;YACzE,SAAS;YACT,OAAO;AACR,SAAA,CAAC;;AAGJ,IAAA,MAAM,MAAM,CAAC,UAAkB,EAAE,KAAc,EAAA;QAC7C,MAAM,MAAM,GAA4B,EAAE;QAE1C,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,UAAU;YAClB,UAAU,GAAG,SAAU;;AAGzB,QAAA,KAAK,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE;AAC7C,YAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU,KAAK,UAAU;YAC9E,IAAI,QAAQ,IAAI,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACpC,gBAAA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;;;AAGlB,QAAA,OAAO,MAAM;;AAEhB;AAED;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { capitalize } from '@treenity/js-shared/utils';
|
|
2
2
|
import { ContextImpl } from '../context.mjs';
|
|
3
|
-
import { getTypeName } from '../meta.mjs';
|
|
3
|
+
import { getTypeName } from '../meta-type.mjs';
|
|
4
4
|
|
|
5
5
|
class ReactTypeContextImpl extends ContextImpl {
|
|
6
6
|
add(...args) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { ContextImpl, registerComp } from './context.mjs';
|
|
2
2
|
export { default as Link } from './link/link.mjs';
|
|
3
3
|
export { types } from './types.mjs';
|
|
4
|
-
export { MetaSymbolType, getMeta, getMetaRaw,
|
|
4
|
+
export { MetaSymbolType, getMeta, getMetaRaw, serializeMeta } from './meta.mjs';
|
|
5
5
|
export { ServiceTypeContextImpl } from './contexts/service.mjs';
|
|
6
6
|
export { ProtoTypeContextImpl } from './contexts/proto.mjs';
|
|
7
7
|
export { NodeEngineTypeContextImpl } from './contexts/node-engine.mjs';
|
|
8
8
|
export { ReactTypeContextImpl } from './contexts/react-context.mjs';
|
|
9
|
-
export {
|
|
9
|
+
export { AnyType, AnyTypeImpl, MetaTypeImpl, getTypeFromClass, getTypeName, makeTypeId, metaType, pathToString, throwError } from './meta-type.mjs';
|
|
10
10
|
//# sourceMappingURL=index.mjs.map
|
package/dist/meta-type.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Class } from '@treenity/js-shared';
|
|
2
1
|
import Link from './link/link';
|
|
3
2
|
import { Typed } from './meta';
|
|
4
3
|
export declare function makeTypeId(type: string, context?: string): string;
|
|
@@ -9,8 +8,8 @@ export declare class MetaTypeImpl<T> implements MetaType<T>, Typed {
|
|
|
9
8
|
$loc: string;
|
|
10
9
|
constructor(type: string, context: string);
|
|
11
10
|
toJSON(): {
|
|
12
|
-
|
|
13
|
-
$context: string;
|
|
11
|
+
$$type: string;
|
|
12
|
+
$context: string | undefined;
|
|
14
13
|
};
|
|
15
14
|
get $id(): string;
|
|
16
15
|
get server(): MetaType<T>;
|
|
@@ -34,18 +33,25 @@ export type MetaType<T> = {
|
|
|
34
33
|
toString(): string;
|
|
35
34
|
isEqual(other: MetaName<any>, context?: string | boolean): boolean;
|
|
36
35
|
};
|
|
37
|
-
export type MetaName<T> = MetaType<T> |
|
|
36
|
+
export type MetaName<T> = string | MetaType<T> | Clas<T>;
|
|
38
37
|
export type MetaPath = Link | string;
|
|
39
38
|
export type FromMetaType<T> = T extends MetaType<infer U> ? U : never;
|
|
40
39
|
export declare function pathToString(path: MetaPath): string;
|
|
40
|
+
type Clas<T, A extends any[] = any[]> = {
|
|
41
|
+
new (...args: A): T;
|
|
42
|
+
};
|
|
43
|
+
export declare function getTypeFromClass(clas: Clas<any>): MetaType<any> | undefined;
|
|
44
|
+
export declare function getTypeName(metaName: MetaName<any>): string;
|
|
45
|
+
export declare function throwError(message: string): never;
|
|
41
46
|
export declare function metaType<T>(type: MetaName<T>, context?: string): MetaType<T>;
|
|
42
|
-
export declare function metaType<T>(type: MetaName<T extends
|
|
47
|
+
export declare function metaType<T>(type: MetaName<T extends Clas<any> ? InstanceType<T> : T>, cls?: T extends Clas<any> ? T : string): MetaType<T extends Clas<any> ? InstanceType<T> : T>;
|
|
43
48
|
/**
|
|
44
49
|
* Any type equals to any other type and has no context
|
|
45
50
|
*/
|
|
46
|
-
export declare class
|
|
51
|
+
export declare class AnyTypeImpl extends MetaTypeImpl<any> {
|
|
47
52
|
constructor();
|
|
48
53
|
isEqual(other: MetaName<any>, context?: string | boolean): boolean;
|
|
49
54
|
inContext<T1 = any>(context: string): MetaType<any>;
|
|
50
55
|
}
|
|
51
56
|
export declare const AnyType: MetaType<any>;
|
|
57
|
+
export {};
|
package/dist/meta-type.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getFileFromStack } from '@treenity/js-shared/utils';
|
|
2
|
-
import { getTypeName } from './meta.mjs';
|
|
3
2
|
|
|
4
3
|
function makeTypeId(type, context) {
|
|
5
4
|
return context ? `${context}:${type}` : type;
|
|
@@ -15,8 +14,8 @@ class MetaTypeImpl {
|
|
|
15
14
|
}
|
|
16
15
|
toJSON() {
|
|
17
16
|
return {
|
|
18
|
-
|
|
19
|
-
$context: this.$context,
|
|
17
|
+
$$type: this.$type, // to distinguish from other entity, which has $type field
|
|
18
|
+
$context: this.$context || undefined,
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
21
|
get $id() {
|
|
@@ -50,21 +49,42 @@ class MetaTypeImpl {
|
|
|
50
49
|
function pathToString(path) {
|
|
51
50
|
return typeof path === 'string' ? path : path.toString();
|
|
52
51
|
}
|
|
52
|
+
function getTypeFromClass(clas) {
|
|
53
|
+
return clas[Symbol.metadata]?.type;
|
|
54
|
+
}
|
|
55
|
+
function getTypeName(metaName) {
|
|
56
|
+
const metaNameAny = metaName;
|
|
57
|
+
return ((typeof metaName === 'string'
|
|
58
|
+
? metaName
|
|
59
|
+
: metaNameAny.$type || metaNameAny.$$type || getTypeFromClass(metaNameAny)?.$type) ||
|
|
60
|
+
throwError(`wrong type descriptor ${metaName}`));
|
|
61
|
+
}
|
|
62
|
+
function throwError(message) {
|
|
63
|
+
throw new Error(message);
|
|
64
|
+
}
|
|
53
65
|
function metaType(type, subContext) {
|
|
54
|
-
|
|
66
|
+
if (!type)
|
|
67
|
+
throw new Error('type is required');
|
|
68
|
+
const _subContext = subContext ??
|
|
69
|
+
(typeof type === 'string'
|
|
70
|
+
? ''
|
|
71
|
+
: '$context' in type
|
|
72
|
+
? type.$context
|
|
73
|
+
: getTypeFromClass(type)?.$context) ??
|
|
74
|
+
'';
|
|
55
75
|
type = getTypeName(type);
|
|
56
|
-
const metaType = _metaTypes[makeTypeId(type,
|
|
76
|
+
const metaType = _metaTypes[makeTypeId(type, _subContext)];
|
|
57
77
|
if (metaType)
|
|
58
78
|
return metaType;
|
|
59
|
-
const newType = new MetaTypeImpl(type,
|
|
60
|
-
newType.$loc = getFileFromStack(
|
|
79
|
+
const newType = new MetaTypeImpl(type, _subContext);
|
|
80
|
+
newType.$loc = getFileFromStack(4);
|
|
61
81
|
_metaTypes[makeTypeId(type, subContext)] = Object.freeze(newType);
|
|
62
82
|
return newType;
|
|
63
83
|
}
|
|
64
84
|
/**
|
|
65
85
|
* Any type equals to any other type and has no context
|
|
66
86
|
*/
|
|
67
|
-
class
|
|
87
|
+
class AnyTypeImpl extends MetaTypeImpl {
|
|
68
88
|
constructor() {
|
|
69
89
|
super('any', '');
|
|
70
90
|
}
|
|
@@ -76,9 +96,9 @@ class AntTypeImpl extends MetaTypeImpl {
|
|
|
76
96
|
}
|
|
77
97
|
}
|
|
78
98
|
const _metaTypes = {
|
|
79
|
-
any: new
|
|
99
|
+
any: new AnyTypeImpl(),
|
|
80
100
|
};
|
|
81
101
|
const AnyType = metaType('any');
|
|
82
102
|
|
|
83
|
-
export {
|
|
103
|
+
export { AnyType, AnyTypeImpl, MetaTypeImpl, getTypeFromClass, getTypeName, makeTypeId, metaType, pathToString, throwError };
|
|
84
104
|
//# sourceMappingURL=meta-type.mjs.map
|
package/dist/meta-type.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta-type.mjs","sources":["../src/meta-type.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta-type.mjs","sources":["../src/meta-type.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIgB,SAAA,UAAU,CAAC,IAAY,EAAE,OAAgB,EAAA;AACvD,IAAA,OAAO,OAAO,GAAG,CAAG,EAAA,OAAO,CAAI,CAAA,EAAA,IAAI,CAAE,CAAA,GAAG,IAAI;AAC9C;MAEa,YAAY,CAAA;AACvB,IAAA,KAAK;AACL,IAAA,QAAQ;AACR,IAAA,KAAK;IACL,IAAI,GAAW,SAAS;IAExB,WAAY,CAAA,IAAY,EAAE,OAAe,EAAA;AACvC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI;AACjB,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;;IAGzB,MAAM,GAAA;QACJ,OAAO;AACL,YAAA,MAAM,EAAE,IAAI,CAAC,KAAK;AAClB,YAAA,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;SACrC;;AAGH,IAAA,IAAI,GAAG,GAAA;QACL,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC;;AAG9C,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,QAAQ,KAAK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CAAC;;IAGlB,OAAO,CAAC,KAAoB,EAAE,OAA0B,EAAA;AACtD,QAAA,OAAO,IAAI;;AAGb,IAAA,SAAS,CAAW,OAAe,EAAA;AACjC,QAAA,OAAO,IAAqB;;AAE/B;AAED,MAAM,UAAU,GAA4C;IAC1D,GAAG,EAAE,IAAI,WAAW,EAAE;CACvB;MAEY,OAAO,GAAG,QAAQ,CAAM,KAAK;;;;"}
|
package/dist/meta.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Raw } from '@treenity/js-shared/utils';
|
|
2
|
-
import { MetaName } from './meta-type';
|
|
3
2
|
export interface WithId {
|
|
4
3
|
$id: string;
|
|
5
4
|
}
|
|
@@ -18,4 +17,3 @@ export declare const MetaSymbolType: unique symbol;
|
|
|
18
17
|
export declare function getMeta<T>(entity: T): Meta<T>;
|
|
19
18
|
export declare function getMetaRaw<T>(entity: T): Raw<T>;
|
|
20
19
|
export declare function serializeMeta(meta: any): Record<string, any>;
|
|
21
|
-
export declare function getTypeName(metaName: MetaName<any>): string;
|
package/dist/meta.mjs
CHANGED
|
@@ -11,9 +11,6 @@ function getMetaRaw(entity) {
|
|
|
11
11
|
function serializeMeta(meta) {
|
|
12
12
|
return typeof meta.toJSON === 'function' ? meta.toJSON() : JSON.parse(JSON.stringify(meta));
|
|
13
13
|
}
|
|
14
|
-
function getTypeName(metaName) {
|
|
15
|
-
return typeof metaName === 'string' ? metaName : metaName.$type;
|
|
16
|
-
}
|
|
17
14
|
|
|
18
|
-
export { MetaSymbolType, getMeta, getMetaRaw,
|
|
15
|
+
export { MetaSymbolType, getMeta, getMetaRaw, serializeMeta };
|
|
19
16
|
//# sourceMappingURL=meta.mjs.map
|
package/dist/meta.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.mjs","sources":["../src/meta.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA0BA;AAEa,MAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO;AAE1C,SAAU,OAAO,CAAI,MAAS,EAAA;AAClC,IAAA,OAAO,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC;AAC/C;AAEM,SAAU,UAAU,CAAI,MAAS,EAAA;IACrC,OAAQ,cAAc,CAAC,MAAM,EAAE,cAAc,CAAS,CAAC,IAAc;AACvE;AAEM,SAAU,aAAa,CAAC,IAAS,EAAA;IACrC,OAAO,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC7F
|
|
1
|
+
{"version":3,"file":"meta.mjs","sources":["../src/meta.ts"],"sourcesContent":[null],"names":[],"mappings":";;AA0BA;AAEa,MAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO;AAE1C,SAAU,OAAO,CAAI,MAAS,EAAA;AAClC,IAAA,OAAO,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC;AAC/C;AAEM,SAAU,UAAU,CAAI,MAAS,EAAA;IACrC,OAAQ,cAAc,CAAC,MAAM,EAAE,cAAc,CAAS,CAAC,IAAc;AACvE;AAEM,SAAU,aAAa,CAAC,IAAS,EAAA;IACrC,OAAO,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AAC7F;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treenity/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.44",
|
|
4
4
|
"description": "treenity core",
|
|
5
5
|
"author": "Treenity",
|
|
6
6
|
"license": "ISC",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@treenity/call-chain": "1.0.
|
|
18
|
-
"@treenity/js-shared": "1.0.
|
|
17
|
+
"@treenity/call-chain": "1.0.29",
|
|
18
|
+
"@treenity/js-shared": "1.0.33",
|
|
19
19
|
"json-schema": "^0.4.0",
|
|
20
20
|
"json-schema-to-ts": "^3.1.0",
|
|
21
21
|
"synchronous-promise": "2.0.17",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@testing-library/dom": "^8.17.1",
|
|
29
29
|
"@testing-library/jest-dom": "^6.4.8",
|
|
30
|
-
"@treenity/build-utils": "1.1.
|
|
31
|
-
"@treenity/tsconfig": "1.0.
|
|
30
|
+
"@treenity/build-utils": "1.1.30",
|
|
31
|
+
"@treenity/tsconfig": "1.0.13",
|
|
32
32
|
"@types/jest": "^29.5.12",
|
|
33
33
|
"@types/json-schema": "^7.0.15",
|
|
34
34
|
"@types/node": "^22.7.5",
|