@pluv/crdt-loro 0.38.14 → 0.39.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.
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +7 -0
- package/dist/index.js +5 -3
- package/dist/index.mjs +5 -3
- package/eslint.config.mjs +4 -0
- package/package.json +8 -8
- package/src/doc/CrdtLoroDoc.ts +5 -3
- package/.eslintrc.js +0 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/crdt-loro@0.
|
|
2
|
+
> @pluv/crdt-loro@0.39.0 build /home/runner/work/pluv/pluv/packages/crdt-loro
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m8.
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m8.91 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 88ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m10.02 KB[39m
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 88ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1810ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m3.48 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.48 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -70,14 +70,16 @@ var CrdtLoroDoc = class extends import_crdt.AbstractCrdtDoc {
|
|
|
70
70
|
if (node instanceof import_loro_crdt.LoroList) {
|
|
71
71
|
const container = this.value.getList(key);
|
|
72
72
|
node.toArray().forEach((item, i) => {
|
|
73
|
-
(0, import_loro_crdt.isContainer)(item)
|
|
73
|
+
if ((0, import_loro_crdt.isContainer)(item)) container.insertContainer(i, item);
|
|
74
|
+
else container.insert(i, item);
|
|
74
75
|
});
|
|
75
76
|
return __spreadProps(__spreadValues({}, acc), { [key]: container });
|
|
76
77
|
}
|
|
77
78
|
if (node instanceof import_loro_crdt.LoroMap) {
|
|
78
79
|
const container = this.value.getMap(key);
|
|
79
80
|
container.entries().forEach(([key2, item]) => {
|
|
80
|
-
(0, import_loro_crdt.isContainer)(item)
|
|
81
|
+
if ((0, import_loro_crdt.isContainer)(item)) container.setContainer(key2, item);
|
|
82
|
+
else container.set(key2, item);
|
|
81
83
|
});
|
|
82
84
|
return __spreadProps(__spreadValues({}, acc), { [key]: container });
|
|
83
85
|
}
|
|
@@ -114,7 +116,7 @@ var CrdtLoroDoc = class extends import_crdt.AbstractCrdtDoc {
|
|
|
114
116
|
if (!_updates.length) return this;
|
|
115
117
|
if (_updates.length === 1) {
|
|
116
118
|
const update = (_a = _updates[0]) != null ? _a : null;
|
|
117
|
-
update
|
|
119
|
+
if (!!update) this.value.import(update);
|
|
118
120
|
return this;
|
|
119
121
|
}
|
|
120
122
|
this.value.importBatch(_updates);
|
package/dist/index.mjs
CHANGED
|
@@ -51,14 +51,16 @@ var CrdtLoroDoc = class extends AbstractCrdtDoc {
|
|
|
51
51
|
if (node instanceof LoroList) {
|
|
52
52
|
const container = this.value.getList(key);
|
|
53
53
|
node.toArray().forEach((item, i) => {
|
|
54
|
-
isContainer(item)
|
|
54
|
+
if (isContainer(item)) container.insertContainer(i, item);
|
|
55
|
+
else container.insert(i, item);
|
|
55
56
|
});
|
|
56
57
|
return __spreadProps(__spreadValues({}, acc), { [key]: container });
|
|
57
58
|
}
|
|
58
59
|
if (node instanceof LoroMap) {
|
|
59
60
|
const container = this.value.getMap(key);
|
|
60
61
|
container.entries().forEach(([key2, item]) => {
|
|
61
|
-
isContainer(item)
|
|
62
|
+
if (isContainer(item)) container.setContainer(key2, item);
|
|
63
|
+
else container.set(key2, item);
|
|
62
64
|
});
|
|
63
65
|
return __spreadProps(__spreadValues({}, acc), { [key]: container });
|
|
64
66
|
}
|
|
@@ -95,7 +97,7 @@ var CrdtLoroDoc = class extends AbstractCrdtDoc {
|
|
|
95
97
|
if (!_updates.length) return this;
|
|
96
98
|
if (_updates.length === 1) {
|
|
97
99
|
const update = (_a = _updates[0]) != null ? _a : null;
|
|
98
|
-
update
|
|
100
|
+
if (!!update) this.value.import(update);
|
|
99
101
|
return this;
|
|
100
102
|
}
|
|
101
103
|
this.value.importBatch(_updates);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/crdt-loro",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "loro for @pluv/io",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"js-base64": "^3.7.7",
|
|
21
|
-
"@pluv/crdt": "^0.
|
|
22
|
-
"@pluv/types": "^0.
|
|
21
|
+
"@pluv/crdt": "^0.39.0",
|
|
22
|
+
"@pluv/types": "^0.39.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"loro-crdt": "^1.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"eslint": "^
|
|
29
|
-
"loro-crdt": "^1.5.
|
|
28
|
+
"eslint": "^9.24.0",
|
|
29
|
+
"loro-crdt": "^1.5.3",
|
|
30
30
|
"tsup": "^8.4.0",
|
|
31
31
|
"typescript": "^5.8.3",
|
|
32
|
-
"@pluv/tsconfig": "^0.
|
|
33
|
-
"eslint-config-pluv": "^0.
|
|
32
|
+
"@pluv/tsconfig": "^0.39.0",
|
|
33
|
+
"eslint-config-pluv": "^0.39.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
37
37
|
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
|
|
38
|
-
"lint": "eslint src/**/*.ts* --fix",
|
|
38
|
+
"lint": "eslint src/**/*.ts* --fix --max-warnings 0",
|
|
39
39
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/src/doc/CrdtLoroDoc.ts
CHANGED
|
@@ -22,7 +22,8 @@ export class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> ex
|
|
|
22
22
|
const container = this.value.getList(key);
|
|
23
23
|
|
|
24
24
|
node.toArray().forEach((item, i) => {
|
|
25
|
-
isContainer(item)
|
|
25
|
+
if (isContainer(item)) container.insertContainer(i, item);
|
|
26
|
+
else container.insert(i, item);
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
return { ...acc, [key]: container };
|
|
@@ -32,7 +33,8 @@ export class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> ex
|
|
|
32
33
|
const container = this.value.getMap(key);
|
|
33
34
|
|
|
34
35
|
container.entries().forEach(([key, item]) => {
|
|
35
|
-
isContainer(item)
|
|
36
|
+
if (isContainer(item)) container.setContainer(key, item);
|
|
37
|
+
else container.set(key, item);
|
|
36
38
|
});
|
|
37
39
|
|
|
38
40
|
return { ...acc, [key]: container };
|
|
@@ -88,7 +90,7 @@ export class CrdtLoroDoc<TStorage extends Record<string, LoroType<any, any>>> ex
|
|
|
88
90
|
if (_updates.length === 1) {
|
|
89
91
|
const update = _updates[0] ?? null;
|
|
90
92
|
|
|
91
|
-
update
|
|
93
|
+
if (!!update) this.value.import(update);
|
|
92
94
|
|
|
93
95
|
return this;
|
|
94
96
|
}
|
package/.eslintrc.js
DELETED