@pluv/crdt-yjs 0.4.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
1
 
2
- > @pluv/crdt-yjs@0.4.1 build /home/runner/work/pluv/pluv/packages/crdt-yjs
2
+ > @pluv/crdt-yjs@0.10.0 build /home/runner/work/pluv/pluv/packages/crdt-yjs
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v7.1.0
7
+ CLI tsup v7.2.0
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 4.87 KB
12
- CJS ⚡️ Build success in 73ms
13
11
  ESM dist/index.mjs 3.68 KB
14
- ESM ⚡️ Build success in 73ms
12
+ ESM ⚡️ Build success in 99ms
13
+ CJS dist/index.js 4.87 KB
14
+ CJS ⚡️ Build success in 99ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 2186ms
17
- DTS dist/index.d.mts 3.17 KB
18
- DTS dist/index.d.ts 3.17 KB
16
+ DTS ⚡️ Build success in 1408ms
17
+ DTS dist/index.d.mts 3.11 KB
18
+ DTS dist/index.d.ts 3.11 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # @pluv/crdt-yjs
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f43f1cc: Change packages to all be versioned together for consistency.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [f43f1cc]
12
+ - @pluv/types@0.10.0
13
+
14
+ ## 0.4.2
15
+
16
+ ### Patch Changes
17
+
18
+ - f4317ba: \* Renamed type `unstable_YObjectValue` to `YObjectValue`;
19
+
20
+ - Renamed type `unstable_YObject` to `YObject`.
21
+ - Re-exported `xmlElement`, `xmlFragment` and `xmlText` from `@pluv/client`.
22
+
23
+ ```ts
24
+ import { y } from "@pluv/client";
25
+ // or
26
+ import { y } from "@pluv/react";
27
+
28
+ y.xmlElement("MyElement", {});
29
+ y.xmlFragment({});
30
+ y.xmlText("hello world");
31
+ ```
32
+
3
33
  ## 0.4.1
4
34
 
5
35
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,14 +1,14 @@
1
- import { Array, Map, AbstractType, Text, XmlElement, XmlFragment, XmlText, Doc, Transaction } from 'yjs';
1
+ import { Array, AbstractType, Map, Text, XmlElement, XmlFragment, XmlText, Doc, Transaction } from 'yjs';
2
2
  export { AbstractType, Array, Map, Text } from 'yjs';
3
3
  import { JsonPrimitive } from '@pluv/types';
4
4
 
5
5
  declare const array: <T extends unknown>(value?: readonly T[]) => Array<T>;
6
6
 
7
- type unstable__YObjectValue = Record<string, NonNullable<JsonPrimitive> | AbstractType<any>>;
8
- type unstable__YObject<T extends unstable__YObjectValue> = Map<T[keyof T]> & {
7
+ type YObjectValue = Record<string, NonNullable<JsonPrimitive> | AbstractType<any>>;
8
+ type YObject<T extends YObjectValue> = Map<T[keyof T]> & {
9
9
  __$type: T;
10
10
  };
11
- declare const object: <T extends unstable__YObjectValue = {}>(value: T) => unstable__YObject<T>;
11
+ declare const object: <T extends YObjectValue = {}>(value: T) => YObject<T>;
12
12
 
13
13
  type InferYjsDocJson<TDoc extends YjsDoc<any>> = TDoc extends YjsDoc<infer ITypes> ? {
14
14
  [P in keyof ITypes]: InferYjsSharedTypeJson<ITypes[P]>;
@@ -16,7 +16,7 @@ type InferYjsDocJson<TDoc extends YjsDoc<any>> = TDoc extends YjsDoc<infer IType
16
16
  type InferYjsDocSharedType<TDoc extends YjsDoc<any>, TKey extends keyof InferYjsDocSharedTypes<TDoc> = keyof InferYjsDocSharedTypes<TDoc>> = InferYjsDocSharedTypes<TDoc>[TKey];
17
17
  type InferYjsDocSharedTypeJson<TDoc extends YjsDoc<any>, TKey extends keyof InferYjsDocSharedTypes<TDoc> = keyof InferYjsDocSharedTypes<TDoc>> = InferYjsSharedTypeJson<InferYjsDocSharedTypes<TDoc>[TKey]>;
18
18
  type InferYjsDocSharedTypes<TDoc extends YjsDoc<any>> = TDoc extends YjsDoc<infer ITypes> ? ITypes : never;
19
- type InferYjsSharedTypeJson<TShared extends unknown> = TShared extends AbstractType<any> ? TShared extends Array<infer IItem> ? readonly InferYjsSharedTypeJson<IItem>[] : TShared extends unstable__YObject<infer IObject> ? {
19
+ type InferYjsSharedTypeJson<TShared extends unknown> = TShared extends AbstractType<any> ? TShared extends Array<infer IItem> ? readonly InferYjsSharedTypeJson<IItem>[] : TShared extends YObject<infer IObject> ? {
20
20
  [P in keyof IObject]: InferYjsSharedTypeJson<IObject[P]>;
21
21
  } : TShared extends Map<infer IItem> ? Record<string, InferYjsSharedTypeJson<IItem>> : TShared extends Text | XmlElement | XmlFragment | XmlText ? string : never : TShared;
22
22
 
@@ -53,4 +53,4 @@ declare const xmlFragment: (params?: XmlFragmentParams) => XmlFragment;
53
53
 
54
54
  declare const xmlText: (value?: string) => XmlText;
55
55
 
56
- export { InferYjsDocJson, InferYjsDocSharedType, InferYjsDocSharedTypeJson, InferYjsDocSharedTypes, InferYjsSharedTypeJson, XmlElementParams, XmlFragmentParams, YjsDoc, array, doc, map, object, text, unstable__YObject, xmlElement, xmlFragment, xmlText };
56
+ export { InferYjsDocJson, InferYjsDocSharedType, InferYjsDocSharedTypeJson, InferYjsDocSharedTypes, InferYjsSharedTypeJson, XmlElementParams, XmlFragmentParams, YObject, YObjectValue, YjsDoc, array, doc, map, object, text, xmlElement, xmlFragment, xmlText };
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { Array, Map, AbstractType, Text, XmlElement, XmlFragment, XmlText, Doc, Transaction } from 'yjs';
1
+ import { Array, AbstractType, Map, Text, XmlElement, XmlFragment, XmlText, Doc, Transaction } from 'yjs';
2
2
  export { AbstractType, Array, Map, Text } from 'yjs';
3
3
  import { JsonPrimitive } from '@pluv/types';
4
4
 
5
5
  declare const array: <T extends unknown>(value?: readonly T[]) => Array<T>;
6
6
 
7
- type unstable__YObjectValue = Record<string, NonNullable<JsonPrimitive> | AbstractType<any>>;
8
- type unstable__YObject<T extends unstable__YObjectValue> = Map<T[keyof T]> & {
7
+ type YObjectValue = Record<string, NonNullable<JsonPrimitive> | AbstractType<any>>;
8
+ type YObject<T extends YObjectValue> = Map<T[keyof T]> & {
9
9
  __$type: T;
10
10
  };
11
- declare const object: <T extends unstable__YObjectValue = {}>(value: T) => unstable__YObject<T>;
11
+ declare const object: <T extends YObjectValue = {}>(value: T) => YObject<T>;
12
12
 
13
13
  type InferYjsDocJson<TDoc extends YjsDoc<any>> = TDoc extends YjsDoc<infer ITypes> ? {
14
14
  [P in keyof ITypes]: InferYjsSharedTypeJson<ITypes[P]>;
@@ -16,7 +16,7 @@ type InferYjsDocJson<TDoc extends YjsDoc<any>> = TDoc extends YjsDoc<infer IType
16
16
  type InferYjsDocSharedType<TDoc extends YjsDoc<any>, TKey extends keyof InferYjsDocSharedTypes<TDoc> = keyof InferYjsDocSharedTypes<TDoc>> = InferYjsDocSharedTypes<TDoc>[TKey];
17
17
  type InferYjsDocSharedTypeJson<TDoc extends YjsDoc<any>, TKey extends keyof InferYjsDocSharedTypes<TDoc> = keyof InferYjsDocSharedTypes<TDoc>> = InferYjsSharedTypeJson<InferYjsDocSharedTypes<TDoc>[TKey]>;
18
18
  type InferYjsDocSharedTypes<TDoc extends YjsDoc<any>> = TDoc extends YjsDoc<infer ITypes> ? ITypes : never;
19
- type InferYjsSharedTypeJson<TShared extends unknown> = TShared extends AbstractType<any> ? TShared extends Array<infer IItem> ? readonly InferYjsSharedTypeJson<IItem>[] : TShared extends unstable__YObject<infer IObject> ? {
19
+ type InferYjsSharedTypeJson<TShared extends unknown> = TShared extends AbstractType<any> ? TShared extends Array<infer IItem> ? readonly InferYjsSharedTypeJson<IItem>[] : TShared extends YObject<infer IObject> ? {
20
20
  [P in keyof IObject]: InferYjsSharedTypeJson<IObject[P]>;
21
21
  } : TShared extends Map<infer IItem> ? Record<string, InferYjsSharedTypeJson<IItem>> : TShared extends Text | XmlElement | XmlFragment | XmlText ? string : never : TShared;
22
22
 
@@ -53,4 +53,4 @@ declare const xmlFragment: (params?: XmlFragmentParams) => XmlFragment;
53
53
 
54
54
  declare const xmlText: (value?: string) => XmlText;
55
55
 
56
- export { InferYjsDocJson, InferYjsDocSharedType, InferYjsDocSharedTypeJson, InferYjsDocSharedTypes, InferYjsSharedTypeJson, XmlElementParams, XmlFragmentParams, YjsDoc, array, doc, map, object, text, unstable__YObject, xmlElement, xmlFragment, xmlText };
56
+ export { InferYjsDocJson, InferYjsDocSharedType, InferYjsDocSharedTypeJson, InferYjsDocSharedTypes, InferYjsSharedTypeJson, XmlElementParams, XmlFragmentParams, YObject, YObjectValue, YjsDoc, array, doc, map, object, text, xmlElement, xmlFragment, xmlText };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt-yjs",
3
- "version": "0.4.1",
3
+ "version": "0.10.0",
4
4
  "description": "yjs for @pluv/io",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -17,19 +17,19 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@types/react": "^18.2.15",
20
+ "@types/react": "^18.2.20",
21
21
  "js-base64": "^3.7.5",
22
- "@pluv/types": "^0.2.2"
22
+ "@pluv/types": "^0.10.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "yjs": "^13.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "tsup": "^7.1.0",
28
+ "tsup": "^7.2.0",
29
29
  "typescript": "^5.1.6",
30
- "yjs": "^13.6.6",
31
- "@pluv/tsconfig": "^0.1.8",
32
- "eslint-config-pluv": "^0.1.14"
30
+ "yjs": "^13.6.7",
31
+ "@pluv/tsconfig": "^0.10.0",
32
+ "eslint-config-pluv": "^0.2.0"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/index.ts CHANGED
@@ -1,15 +1,10 @@
1
1
  export type { AbstractType, Array, Map, Text } from "yjs";
2
2
  export { array } from "./array";
3
- export { doc, YjsDoc } from "./doc";
3
+ export { YjsDoc, doc } from "./doc";
4
4
  export { map } from "./map";
5
- export type { unstable__YObject } from "./object";
6
5
  export { object } from "./object";
6
+ export type { YObject, YObjectValue } from "./object";
7
7
  export { text } from "./text";
8
- export type { XmlElementParams } from "./xmlElement";
9
- export { xmlElement } from "./xmlElement";
10
- export type { XmlFragmentParams } from "./xmlFragment";
11
- export { xmlFragment } from "./xmlFragment";
12
- export { xmlText } from "./xmlText";
13
8
  export type {
14
9
  InferYjsDocJson,
15
10
  InferYjsDocSharedType,
@@ -17,3 +12,8 @@ export type {
17
12
  InferYjsDocSharedTypes,
18
13
  InferYjsSharedTypeJson,
19
14
  } from "./types";
15
+ export { xmlElement } from "./xmlElement";
16
+ export type { XmlElementParams } from "./xmlElement";
17
+ export { xmlFragment } from "./xmlFragment";
18
+ export type { XmlFragmentParams } from "./xmlFragment";
19
+ export { xmlText } from "./xmlText";
package/src/object.ts CHANGED
@@ -2,17 +2,15 @@ import type { JsonPrimitive } from "@pluv/types";
2
2
  import type { AbstractType } from "yjs";
3
3
  import { Map as YMap } from "yjs";
4
4
 
5
- export type unstable__YObjectValue = Record<
5
+ export type YObjectValue = Record<
6
6
  string,
7
7
  NonNullable<JsonPrimitive> | AbstractType<any>
8
8
  >;
9
9
 
10
- export type unstable__YObject<T extends unstable__YObjectValue> = YMap<
11
- T[keyof T]
12
- > & { __$type: T };
10
+ export type YObject<T extends YObjectValue> = YMap<T[keyof T]> & {
11
+ __$type: T;
12
+ };
13
13
 
14
- export const object = <T extends unstable__YObjectValue = {}>(
15
- value: T,
16
- ): unstable__YObject<T> => {
17
- return new YMap(Object.entries(value)) as unstable__YObject<T>;
14
+ export const object = <T extends YObjectValue = {}>(value: T): YObject<T> => {
15
+ return new YMap(Object.entries(value)) as YObject<T>;
18
16
  };
package/src/types.ts CHANGED
@@ -8,7 +8,7 @@ import type {
8
8
  XmlText as YXmlText,
9
9
  } from "yjs";
10
10
  import type { YjsDoc } from "./doc";
11
- import type { unstable__YObject } from "./object";
11
+ import type { YObject } from "./object";
12
12
 
13
13
  export type InferYjsDocJson<TDoc extends YjsDoc<any>> = TDoc extends YjsDoc<
14
14
  infer ITypes
@@ -35,7 +35,7 @@ export type InferYjsSharedTypeJson<TShared extends unknown> =
35
35
  TShared extends AbstractType<any>
36
36
  ? TShared extends YArray<infer IItem>
37
37
  ? readonly InferYjsSharedTypeJson<IItem>[]
38
- : TShared extends unstable__YObject<infer IObject>
38
+ : TShared extends YObject<infer IObject>
39
39
  ? { [P in keyof IObject]: InferYjsSharedTypeJson<IObject[P]> }
40
40
  : TShared extends YMap<infer IItem>
41
41
  ? Record<string, InferYjsSharedTypeJson<IItem>>