@treenity/core 1.0.32 → 1.0.34

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @treenity/core
2
2
 
3
+ ## 1.0.34
4
+
5
+ ### Patch Changes
6
+
7
+ - update create feathers client in repositroy
8
+ - Updated dependencies
9
+ - @treenity/js-shared@1.0.27
10
+
11
+ ## 1.0.33
12
+
13
+ ### Patch Changes
14
+
15
+ - update version
16
+ - Updated dependencies
17
+ - @treenity/js-shared@1.0.26
18
+
3
19
  ## 1.0.32
4
20
 
5
21
  ### Patch Changes
@@ -8,6 +8,10 @@ export declare class MetaTypeImpl<T> implements MetaType<T>, Typed {
8
8
  $item?: T;
9
9
  $loc: string;
10
10
  constructor(type: string, context: string);
11
+ toJSON(): {
12
+ $type: string;
13
+ $context: string;
14
+ };
11
15
  get $id(): string;
12
16
  get server(): MetaType<T>;
13
17
  get client(): MetaType<T>;
@@ -16,8 +20,20 @@ export declare class MetaTypeImpl<T> implements MetaType<T>, Typed {
16
20
  toString(): string;
17
21
  isEqual(other: MetaName<any>, context?: string | boolean): boolean;
18
22
  }
19
- type MetaType_<T> = Readonly<InstanceType<typeof MetaTypeImpl<T>>>;
20
- export type MetaType<T> = MetaType_<T>;
23
+ export type MetaType<T> = {
24
+ $type: string;
25
+ $context: string;
26
+ $item?: T;
27
+ $loc: string;
28
+ toJSON(): any;
29
+ $id: string;
30
+ server: MetaType<T>;
31
+ client: MetaType<T>;
32
+ empty: MetaType<T>;
33
+ inContext<T1 = T>(this: MetaType<any>, context: string): MetaType<T1>;
34
+ toString(): string;
35
+ isEqual(other: MetaName<any>, context?: string | boolean): boolean;
36
+ };
21
37
  export type MetaName<T> = MetaType<T> | string;
22
38
  export type MetaPath = Link | string;
23
39
  export type FromMetaType<T> = T extends MetaType<infer U> ? U : never;
@@ -32,5 +48,4 @@ export declare class AntTypeImpl extends MetaTypeImpl<any> {
32
48
  isEqual(other: MetaName<any>, context?: string | boolean): boolean;
33
49
  inContext<T1 = any>(context: string): MetaType<any>;
34
50
  }
35
- export declare const AnyType: Readonly<MetaTypeImpl<any>>;
36
- export {};
51
+ export declare const AnyType: MetaType<any>;
@@ -1 +1 @@
1
- import{getFileFromStack as t}from"@treenity/js-shared/utils";import{getTypeName as e}from"./meta.mjs";function n(t,e){return e?`${e}:${t}`:t}class r{$type;$context;$item;$loc="unknown";constructor(t,e){this.$type=t,this.$context=e}get $id(){return n(this.$type,this.$context)}get server(){return"server"===this.$context?this:this.inContext("server")}get client(){return"client"===this.$context?this:this.inContext("client")}get empty(){return this.$context?this.inContext(""):this}inContext(t){return s(this,t)}toString(){return`[${this.$id}]`}isEqual(t,e){return"boolean"==typeof e?(t=s(t),this.$type===t.$type&&(!e||this.$context===t.$context)):(t=s(t,e),this.$type===t.$type&&this.$context===t.$context)}}function i(t){return"string"==typeof t?t:t.toString()}function s(i,s){s??="string"==typeof i?"":i.$context,i=e(i);const o=c[n(i,s)];if(o)return o;const $=new r(i,s);return $.$loc=t(3),c[n(i,s)]=Object.freeze($),$}class o extends r{constructor(){super("any","")}isEqual(t,e){return!0}inContext(t){return this}}const c={any:new o},$=s("any");export{o as AntTypeImpl,$ as AnyType,r as MetaTypeImpl,n as makeTypeId,s as metaType,i as pathToString};
1
+ import{getFileFromStack as t}from"@treenity/js-shared/utils";import{getTypeName as e}from"./meta.mjs";function n(t,e){return e?`${e}:${t}`:t}class r{$type;$context;$item;$loc="unknown";constructor(t,e){this.$type=t,this.$context=e}toJSON(){return{$type:this.$type,$context:this.$context}}get $id(){return n(this.$type,this.$context)}get server(){return"server"===this.$context?this:this.inContext("server")}get client(){return"client"===this.$context?this:this.inContext("client")}get empty(){return this.$context?this.inContext(""):this}inContext(t){return o(this,t)}toString(){return`[${this.$id}]`}isEqual(t,e){return"boolean"==typeof e?(t=o(t),this.$type===t.$type&&(!e||this.$context===t.$context)):(t=o(t,e),this.$type===t.$type&&this.$context===t.$context)}}function i(t){return"string"==typeof t?t:t.toString()}function o(i,o){o??="string"==typeof i?"":i.$context,i=e(i);const s=c[n(i,o)];if(s)return s;const $=new r(i,o);return $.$loc=t(3),c[n(i,o)]=Object.freeze($),$}class s extends r{constructor(){super("any","")}isEqual(t,e){return!0}inContext(t){return this}}const c={any:new s},$=o("any");export{s as AntTypeImpl,$ as AnyType,r as MetaTypeImpl,n as makeTypeId,o as metaType,i as pathToString};
@@ -1,4 +1,5 @@
1
- import { ProxyChain, Raw } from '@treenity/js-shared/utils';
1
+ import { Raw } from '@treenity/js-shared/utils';
2
+ import { CallChain } from '@treenity/call-chain';
2
3
  import { Meta, MetaRaw } from '../meta';
3
4
  import { MetaName, MetaPath } from '../meta-type';
4
5
  export interface NodeRef {
@@ -25,7 +26,11 @@ export interface Node extends NodeData {
25
26
  allRaw(): MetaRaw[];
26
27
  raw<T>(type: MetaName<T>, path?: MetaPath): T | undefined;
27
28
  get<T>(type: MetaName<T>, path?: MetaPath): Promise<T>;
28
- $$<T>(type: MetaName<T>, path?: MetaPath): ProxyChain<T>;
29
+ /**
30
+ * use `$get(metaName, name)` instead of `get()` to get promise with type definitions, for now it is
31
+ * the limitations of TS lang.
32
+ */
33
+ $$: CallChain<Node>;
29
34
  add<T>(type: MetaName<T>, meta: Raw<T>, name?: string): Promise<T>;
30
35
  remove(meta: string | any): Promise<boolean>;
31
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treenity/core",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "treenity core",
5
5
  "author": "Treenity",
6
6
  "license": "ISC",
@@ -14,28 +14,28 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@treenity/js-shared": "1.0.25",
17
+ "@treenity/js-shared": "1.0.27",
18
18
  "json-schema": "^0.4.0",
19
19
  "json-schema-to-ts": "3.1.0",
20
20
  "synchronous-promise": "2.0.17",
21
21
  "tslib": "2.8.0"
22
22
  },
23
23
  "peerDependencies": {
24
- "react": "^18.2.0"
24
+ "react": "^18.3.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@testing-library/dom": "^8.17.1",
28
28
  "@testing-library/jest-dom": "6.4.5",
29
- "@treenity/build-utils": "1.1.20",
29
+ "@treenity/build-utils": "1.1.22",
30
30
  "@treenity/tsconfig": "1.0.10",
31
31
  "@types/jest": "29.5.12",
32
32
  "@types/json-schema": "^7.0.15",
33
- "@types/node": "20.11.16",
33
+ "@types/node": "^22.7.5",
34
34
  "@types/prop-types": "^15.7.5",
35
35
  "@types/react": "18.2.51",
36
36
  "ajv": "^8.12.0",
37
37
  "jest": "29.7.0",
38
- "react": "18.2.0",
38
+ "react": "18.3.1",
39
39
  "rollup": "^4.24.0",
40
40
  "typescript": "5.4.5"
41
41
  },
@@ -1 +0,0 @@
1
- export {};