@pluv/crdt-yjs 0.38.14 → 0.39.1

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,5 +1,5 @@
1
1
 
2
- > @pluv/crdt-yjs@0.38.14 build /home/runner/work/pluv/pluv/packages/crdt-yjs
2
+ > @pluv/crdt-yjs@0.39.1 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
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 10.96 KB
12
- ESM ⚡️ Build success in 102ms
13
- CJS dist/index.js 11.75 KB
14
- CJS ⚡️ Build success in 103ms
11
+ ESM dist/index.mjs 10.97 KB
12
+ ESM ⚡️ Build success in 139ms
13
+ CJS dist/index.js 11.76 KB
14
+ CJS ⚡️ Build success in 142ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 2124ms
16
+ DTS ⚡️ Build success in 2091ms
17
17
  DTS dist/index.d.mts 3.95 KB
18
18
  DTS dist/index.d.ts 3.95 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @pluv/crdt-yjs
2
2
 
3
+ ## 0.39.1
4
+
5
+ ### Patch Changes
6
+
7
+ - @pluv/crdt@0.39.1
8
+ - @pluv/types@0.39.1
9
+
10
+ ## 0.39.0
11
+
12
+ ### Patch Changes
13
+
14
+ - @pluv/crdt@0.39.0
15
+ - @pluv/types@0.39.0
16
+
3
17
  ## 0.38.14
4
18
 
5
19
  ### Patch Changes
package/dist/index.js CHANGED
@@ -119,7 +119,7 @@ var import_yjs5 = require("yjs");
119
119
  var YjsXmlElement = class extends import_yjs5.XmlElement {
120
120
  constructor(name, value) {
121
121
  super(name);
122
- !!value.length && this.insert(0, value);
122
+ if (!!value.length) this.insert(0, value);
123
123
  this.initialValue = value;
124
124
  }
125
125
  __pluvType() {
@@ -150,7 +150,7 @@ var CrdtYjsDoc = class extends import_crdt.AbstractCrdtDoc {
150
150
  var _a, _b, _c, _d, _e, _f, _g, _h;
151
151
  if (node instanceof YjsArray) {
152
152
  const yArray = this.value.getArray(key);
153
- !!((_a = node.initialValue) == null ? void 0 : _a.length) && yArray.insert(0, (_b = node.initialValue) == null ? void 0 : _b.slice(0));
153
+ if (!!((_a = node.initialValue) == null ? void 0 : _a.length)) yArray.insert(0, (_b = node.initialValue) == null ? void 0 : _b.slice(0));
154
154
  return __spreadProps(__spreadValues({}, acc), { [key]: yArray });
155
155
  }
156
156
  if (node instanceof YjsMap) {
@@ -169,17 +169,17 @@ var CrdtYjsDoc = class extends import_crdt.AbstractCrdtDoc {
169
169
  }
170
170
  if (node instanceof YjsText) {
171
171
  const yText = this.value.getText(key);
172
- typeof node.initialValue === "string" && yText.insert(0, node.initialValue);
172
+ if (typeof node.initialValue === "string") yText.insert(0, node.initialValue);
173
173
  return __spreadProps(__spreadValues({}, acc), { [key]: yText });
174
174
  }
175
175
  if (node instanceof YjsXmlElement) {
176
176
  const yXmlElement = this.value.getXmlElement(key);
177
- !!((_e = node.initialValue) == null ? void 0 : _e.length) && yXmlElement.insert(0, (_f = node.initialValue) == null ? void 0 : _f.slice(0));
177
+ if (!!((_e = node.initialValue) == null ? void 0 : _e.length)) yXmlElement.insert(0, (_f = node.initialValue) == null ? void 0 : _f.slice(0));
178
178
  return __spreadProps(__spreadValues({}, acc), { [key]: yXmlElement });
179
179
  }
180
180
  if (node instanceof import_yjs7.XmlFragment) {
181
181
  const yXmlFragment = this.value.getXmlFragment(key);
182
- !!((_g = node.initialValue) == null ? void 0 : _g.length) && yXmlFragment.insert(0, (_h = node.initialValue) == null ? void 0 : _h.slice(0));
182
+ if (!!((_g = node.initialValue) == null ? void 0 : _g.length)) yXmlFragment.insert(0, (_h = node.initialValue) == null ? void 0 : _h.slice(0));
183
183
  return __spreadProps(__spreadValues({}, acc), { [key]: yXmlFragment });
184
184
  }
185
185
  if (node instanceof YjsXmlText) {
@@ -317,7 +317,7 @@ var import_yjs8 = require("yjs");
317
317
  var YjsXmlFragment = class extends import_yjs8.XmlFragment {
318
318
  constructor(value) {
319
319
  super();
320
- !!value.length && this.insert(0, value);
320
+ if (!!value.length) this.insert(0, value);
321
321
  this.initialValue = value;
322
322
  }
323
323
  __pluvType() {
package/dist/index.mjs CHANGED
@@ -111,7 +111,7 @@ import { XmlElement as YXmlElement } from "yjs";
111
111
  var YjsXmlElement = class extends YXmlElement {
112
112
  constructor(name, value) {
113
113
  super(name);
114
- !!value.length && this.insert(0, value);
114
+ if (!!value.length) this.insert(0, value);
115
115
  this.initialValue = value;
116
116
  }
117
117
  __pluvType() {
@@ -142,7 +142,7 @@ var CrdtYjsDoc = class extends AbstractCrdtDoc {
142
142
  var _a, _b, _c, _d, _e, _f, _g, _h;
143
143
  if (node instanceof YjsArray) {
144
144
  const yArray = this.value.getArray(key);
145
- !!((_a = node.initialValue) == null ? void 0 : _a.length) && yArray.insert(0, (_b = node.initialValue) == null ? void 0 : _b.slice(0));
145
+ if (!!((_a = node.initialValue) == null ? void 0 : _a.length)) yArray.insert(0, (_b = node.initialValue) == null ? void 0 : _b.slice(0));
146
146
  return __spreadProps(__spreadValues({}, acc), { [key]: yArray });
147
147
  }
148
148
  if (node instanceof YjsMap) {
@@ -161,17 +161,17 @@ var CrdtYjsDoc = class extends AbstractCrdtDoc {
161
161
  }
162
162
  if (node instanceof YjsText) {
163
163
  const yText = this.value.getText(key);
164
- typeof node.initialValue === "string" && yText.insert(0, node.initialValue);
164
+ if (typeof node.initialValue === "string") yText.insert(0, node.initialValue);
165
165
  return __spreadProps(__spreadValues({}, acc), { [key]: yText });
166
166
  }
167
167
  if (node instanceof YjsXmlElement) {
168
168
  const yXmlElement = this.value.getXmlElement(key);
169
- !!((_e = node.initialValue) == null ? void 0 : _e.length) && yXmlElement.insert(0, (_f = node.initialValue) == null ? void 0 : _f.slice(0));
169
+ if (!!((_e = node.initialValue) == null ? void 0 : _e.length)) yXmlElement.insert(0, (_f = node.initialValue) == null ? void 0 : _f.slice(0));
170
170
  return __spreadProps(__spreadValues({}, acc), { [key]: yXmlElement });
171
171
  }
172
172
  if (node instanceof YXmlFragment) {
173
173
  const yXmlFragment = this.value.getXmlFragment(key);
174
- !!((_g = node.initialValue) == null ? void 0 : _g.length) && yXmlFragment.insert(0, (_h = node.initialValue) == null ? void 0 : _h.slice(0));
174
+ if (!!((_g = node.initialValue) == null ? void 0 : _g.length)) yXmlFragment.insert(0, (_h = node.initialValue) == null ? void 0 : _h.slice(0));
175
175
  return __spreadProps(__spreadValues({}, acc), { [key]: yXmlFragment });
176
176
  }
177
177
  if (node instanceof YjsXmlText) {
@@ -309,7 +309,7 @@ import { XmlFragment as YXmlFragment2 } from "yjs";
309
309
  var YjsXmlFragment = class extends YXmlFragment2 {
310
310
  constructor(value) {
311
311
  super();
312
- !!value.length && this.insert(0, value);
312
+ if (!!value.length) this.insert(0, value);
313
313
  this.initialValue = value;
314
314
  }
315
315
  __pluvType() {
@@ -0,0 +1,4 @@
1
+ import { config } from "eslint-config-pluv/base";
2
+
3
+ /** @type {import("eslint").Linter.Config} */
4
+ export default config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/crdt-yjs",
3
- "version": "0.38.14",
3
+ "version": "0.39.1",
4
4
  "description": "yjs 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.38.14",
22
- "@pluv/types": "^0.38.14"
21
+ "@pluv/crdt": "^0.39.1",
22
+ "@pluv/types": "^0.39.1"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "yjs": "^13.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "eslint": "^8.57.1",
28
+ "eslint": "^9.24.0",
29
29
  "tsup": "^8.4.0",
30
30
  "typescript": "^5.8.3",
31
31
  "yjs": "^13.6.24",
32
- "@pluv/tsconfig": "^0.38.14",
33
- "eslint-config-pluv": "^0.38.14"
32
+ "@pluv/tsconfig": "^0.39.1",
33
+ "eslint-config-pluv": "^0.39.1"
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
  }
@@ -37,7 +37,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
37
37
  if (node instanceof YjsArray) {
38
38
  const yArray = this.value.getArray(key);
39
39
 
40
- !!node.initialValue?.length && yArray.insert(0, node.initialValue?.slice(0));
40
+ if (!!node.initialValue?.length) yArray.insert(0, node.initialValue?.slice(0));
41
41
 
42
42
  return { ...acc, [key]: yArray };
43
43
  }
@@ -65,7 +65,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
65
65
  if (node instanceof YjsText) {
66
66
  const yText = this.value.getText(key);
67
67
 
68
- typeof node.initialValue === "string" && yText.insert(0, node.initialValue);
68
+ if (typeof node.initialValue === "string") yText.insert(0, node.initialValue);
69
69
 
70
70
  return { ...acc, [key]: yText };
71
71
  }
@@ -73,7 +73,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
73
73
  if (node instanceof YjsXmlElement) {
74
74
  const yXmlElement = this.value.getXmlElement(key);
75
75
 
76
- !!node.initialValue?.length && yXmlElement.insert(0, node.initialValue?.slice(0));
76
+ if (!!node.initialValue?.length) yXmlElement.insert(0, node.initialValue?.slice(0));
77
77
 
78
78
  return { ...acc, [key]: yXmlElement };
79
79
  }
@@ -81,7 +81,7 @@ export class CrdtYjsDoc<TStorage extends Record<string, YjsType<any, any>>> exte
81
81
  if (node instanceof YXmlFragment) {
82
82
  const yXmlFragment = this.value.getXmlFragment(key);
83
83
 
84
- !!node.initialValue?.length && yXmlFragment.insert(0, node.initialValue?.slice(0));
84
+ if (!!node.initialValue?.length) yXmlFragment.insert(0, node.initialValue?.slice(0));
85
85
 
86
86
  return { ...acc, [key]: yXmlFragment };
87
87
  }
@@ -11,7 +11,7 @@ export class YjsXmlElement<T extends Record<string, any> = Record<string, any>>
11
11
  constructor(name: string, value: (YXmlElement | YXmlText)[] | readonly (YXmlElement | YXmlText)[]) {
12
12
  super(name);
13
13
 
14
- !!value.length && this.insert(0, value as (YXmlElement | YXmlText)[]);
14
+ if (!!value.length) this.insert(0, value as (YXmlElement | YXmlText)[]);
15
15
 
16
16
  this.initialValue = value;
17
17
  }
@@ -8,7 +8,7 @@ export class YjsXmlFragment extends YXmlFragment implements YjsType<YXmlFragment
8
8
  constructor(value: (YXmlElement | YXmlText)[] | readonly (YXmlElement | YXmlText)[]) {
9
9
  super();
10
10
 
11
- !!value.length && this.insert(0, value as (YXmlElement | YXmlText)[]);
11
+ if (!!value.length) this.insert(0, value as (YXmlElement | YXmlText)[]);
12
12
 
13
13
  this.initialValue = value;
14
14
  }
package/.eslintrc.js DELETED
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ["pluv"],
4
- };