alinea 1.4.8 → 1.4.9

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
- "_id": "30rpBhkAFN1Jx77Ugh6OVnLrQa4",
2
+ "_id": "30ulr5UTckoCL1Upuj7QIxl3v7l",
3
3
  "_type": "Page",
4
4
  "_index": "a0",
5
5
  "_seeded": "welcome.json",
package/dist/LICENSES.md CHANGED
@@ -26,6 +26,33 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
26
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
27
  SOFTWARE.
28
28
 
29
+ ===
30
+
31
+ # lib0@0.2.88 (MIT)
32
+
33
+ The MIT License (MIT)
34
+
35
+ Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining a copy
38
+ of this software and associated documentation files (the "Software"), to deal
39
+ in the Software without restriction, including without limitation the rights
40
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41
+ copies of the Software, and to permit persons to whom the Software is
42
+ furnished to do so, subject to the following conditions:
43
+
44
+ The above copyright notice and this permission notice shall be included in all
45
+ copies or substantial portions of the Software.
46
+
47
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53
+ SOFTWARE.
54
+
55
+
29
56
  ===
30
57
 
31
58
  # htmlparser2@9.1.0 (MIT)
@@ -76,23 +103,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
76
103
  SOFTWARE.
77
104
 
78
105
 
79
- ===
80
-
81
- # domhandler@5.0.3 (BSD-2-Clause)
82
-
83
- Copyright (c) Felix Böhm
84
- All rights reserved.
85
-
86
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
87
-
88
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
89
-
90
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
91
-
92
- THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
93
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
94
-
95
-
96
106
  ===
97
107
 
98
108
  # domutils@3.1.0 (BSD-2-Clause)
@@ -110,23 +120,6 @@ THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRE
110
120
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
111
121
 
112
122
 
113
- ===
114
-
115
- # entities@4.5.0 (BSD-2-Clause)
116
-
117
- Copyright (c) Felix Böhm
118
- All rights reserved.
119
-
120
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
121
-
122
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
123
-
124
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
125
-
126
- THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
127
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
128
-
129
-
130
123
  ===
131
124
 
132
125
  # @headlessui/react@2.2.0 (MIT)
@@ -155,46 +148,36 @@ SOFTWARE.
155
148
 
156
149
  ===
157
150
 
158
- # lib0@0.2.88 (MIT)
151
+ # domhandler@5.0.3 (BSD-2-Clause)
159
152
 
160
- The MIT License (MIT)
153
+ Copyright (c) Felix Böhm
154
+ All rights reserved.
161
155
 
162
- Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
156
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
163
157
 
164
- Permission is hereby granted, free of charge, to any person obtaining a copy
165
- of this software and associated documentation files (the "Software"), to deal
166
- in the Software without restriction, including without limitation the rights
167
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
168
- copies of the Software, and to permit persons to whom the Software is
169
- furnished to do so, subject to the following conditions:
158
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
170
159
 
171
- The above copyright notice and this permission notice shall be included in all
172
- copies or substantial portions of the Software.
160
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
173
161
 
174
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
176
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
177
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
178
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
179
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
180
- SOFTWARE.
162
+ THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
163
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
181
164
 
182
165
 
183
166
  ===
184
167
 
185
- # dom-serializer@2.0.0 (MIT)
186
-
187
- License
168
+ # entities@4.5.0 (BSD-2-Clause)
188
169
 
189
- (The MIT License)
170
+ Copyright (c) Felix Böhm
171
+ All rights reserved.
190
172
 
191
- Copyright (c) 2014 The cheeriojs contributors
173
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
192
174
 
193
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
175
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
194
176
 
195
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
177
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
196
178
 
197
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
179
+ THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
180
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
198
181
 
199
182
 
200
183
  ===
@@ -457,6 +440,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
457
440
  SOFTWARE.
458
441
 
459
442
 
443
+ ===
444
+
445
+ # dom-serializer@2.0.0 (MIT)
446
+
447
+ License
448
+
449
+ (The MIT License)
450
+
451
+ Copyright (c) 2014 The cheeriojs contributors
452
+
453
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
454
+
455
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
456
+
457
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
458
+
459
+
460
460
  ===
461
461
 
462
462
  # react-is@16.13.1 (MIT)
@@ -486,16 +486,43 @@ SOFTWARE.
486
486
 
487
487
  ===
488
488
 
489
- # @headless-tree/core@0.0.15 (MIT)
489
+ # @headless-tree/react@0.0.15 (MIT)
490
490
 
491
491
  MIT
492
492
 
493
493
  ===
494
494
 
495
- # @headless-tree/react@0.0.15 (MIT)
495
+ # @headless-tree/core@0.0.15 (MIT)
496
496
 
497
497
  MIT
498
498
 
499
+ ===
500
+
501
+ # y-prosemirror@1.2.15 (MIT)
502
+
503
+ The MIT License (MIT)
504
+
505
+ Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
506
+
507
+ Permission is hereby granted, free of charge, to any person obtaining a copy
508
+ of this software and associated documentation files (the "Software"), to deal
509
+ in the Software without restriction, including without limitation the rights
510
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
511
+ copies of the Software, and to permit persons to whom the Software is
512
+ furnished to do so, subject to the following conditions:
513
+
514
+ The above copyright notice and this permission notice shall be included in all
515
+ copies or substantial portions of the Software.
516
+
517
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
518
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
519
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
520
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
521
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
522
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
523
+ SOFTWARE.
524
+
525
+
499
526
  ===
500
527
 
501
528
  # @babel/runtime@7.25.4 (MIT)
@@ -524,33 +551,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
524
551
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
525
552
 
526
553
 
527
- ===
528
-
529
- # y-prosemirror@1.2.15 (MIT)
530
-
531
- The MIT License (MIT)
532
-
533
- Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
534
-
535
- Permission is hereby granted, free of charge, to any person obtaining a copy
536
- of this software and associated documentation files (the "Software"), to deal
537
- in the Software without restriction, including without limitation the rights
538
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
539
- copies of the Software, and to permit persons to whom the Software is
540
- furnished to do so, subject to the following conditions:
541
-
542
- The above copyright notice and this permission notice shall be included in all
543
- copies or substantial portions of the Software.
544
-
545
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
546
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
547
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
548
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
549
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
550
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
551
- SOFTWARE.
552
-
553
-
554
554
  ===
555
555
 
556
556
  # @react-aria/focus@3.19.1 (Apache-2.0)
@@ -1585,6 +1585,33 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1585
1585
  See the License for the specific language governing permissions and
1586
1586
  limitations under the License.
1587
1587
 
1588
+ ===
1589
+
1590
+ # @tanstack/virtual-core@3.10.6 (MIT)
1591
+
1592
+ MIT License
1593
+
1594
+ Copyright (c) 2021-present Tanner Linsley
1595
+
1596
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1597
+ of this software and associated documentation files (the "Software"), to deal
1598
+ in the Software without restriction, including without limitation the rights
1599
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1600
+ copies of the Software, and to permit persons to whom the Software is
1601
+ furnished to do so, subject to the following conditions:
1602
+
1603
+ The above copyright notice and this permission notice shall be included in all
1604
+ copies or substantial portions of the Software.
1605
+
1606
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1607
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1608
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1609
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1610
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1611
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1612
+ SOFTWARE.
1613
+
1614
+
1588
1615
  ===
1589
1616
 
1590
1617
  # @react-stately/utils@3.10.5 (Apache-2.0)
@@ -1790,30 +1817,3 @@ limitations under the License.
1790
1817
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1791
1818
  See the License for the specific language governing permissions and
1792
1819
  limitations under the License.
1793
-
1794
-
1795
- ===
1796
-
1797
- # @tanstack/virtual-core@3.10.6 (MIT)
1798
-
1799
- MIT License
1800
-
1801
- Copyright (c) 2021-present Tanner Linsley
1802
-
1803
- Permission is hereby granted, free of charge, to any person obtaining a copy
1804
- of this software and associated documentation files (the "Software"), to deal
1805
- in the Software without restriction, including without limitation the rights
1806
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1807
- copies of the Software, and to permit persons to whom the Software is
1808
- furnished to do so, subject to the following conditions:
1809
-
1810
- The above copyright notice and this permission notice shall be included in all
1811
- copies or substantial portions of the Software.
1812
-
1813
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1814
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1815
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1816
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1817
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1819
- SOFTWARE.
package/dist/bundled.d.ts CHANGED
@@ -3545,7 +3545,7 @@ declare module 'alinea/core/source/ShaMismatchError' {
3545
3545
  export class ShaMismatchError extends HttpError {
3546
3546
  actual: string;
3547
3547
  expected: string;
3548
- constructor(actual: string, expected: string);
3548
+ constructor(actual: string, expected: string, message?: string);
3549
3549
  }
3550
3550
 
3551
3551
  }
@@ -3660,6 +3660,7 @@ declare module 'alinea/core/source/Tree' {
3660
3660
  constructor({ sha, entries }: Tree);
3661
3661
  get isEmpty(): boolean;
3662
3662
  get entries(): Array<Entry>;
3663
+ get shas(): ReadonlySet<string>;
3663
3664
  hasSha(sha: string): boolean;
3664
3665
  clone(): WriteableTree;
3665
3666
  toJSON(): {
@@ -2,7 +2,7 @@
2
2
  var package_default = {
3
3
  bin: "./dist/cli.js",
4
4
  name: "alinea",
5
- version: "1.4.8",
5
+ version: "1.4.9",
6
6
  description: "Headless git-based CMS",
7
7
  repository: {
8
8
  type: "git",
package/dist/cli/Serve.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-QWP7LPX7.js";
3
+ } from "../chunks/chunk-NEFR4CFI.js";
4
4
  import "../chunks/chunk-NZLE2WMY.js";
5
5
 
6
6
  // src/cli/Serve.ts
package/dist/cli/bin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-QWP7LPX7.js";
3
+ } from "../chunks/chunk-NEFR4CFI.js";
4
4
  import "../chunks/chunk-NZLE2WMY.js";
5
5
 
6
6
  // node_modules/mri/lib/index.mjs
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-QWP7LPX7.js";
3
+ } from "../chunks/chunk-NEFR4CFI.js";
4
4
  import {
5
5
  PLazy
6
6
  } from "../chunks/chunk-IKINPSS5.js";
@@ -1,6 +1,7 @@
1
1
  import "../../chunks/chunk-NZLE2WMY.js";
2
2
 
3
3
  // src/core/source/IndexedDBSource.ts
4
+ import { ShaMismatchError } from "./ShaMismatchError.js";
4
5
  import { ReadonlyTree } from "./Tree.js";
5
6
  var IndexedDBSource = class {
6
7
  #factory;
@@ -45,16 +46,31 @@ var IndexedDBSource = class {
45
46
  getTree() {
46
47
  const handle = async () => {
47
48
  const db = await this.#connect();
48
- return new Promise((resolve, reject) => {
49
- const transaction = db.transaction(["tree"], "readonly");
50
- const store = transaction.objectStore("tree");
51
- const request = store.get("tree");
52
- request.onsuccess = (event) => {
53
- const entry = event.target.result;
54
- resolve(entry ? new ReadonlyTree(entry) : ReadonlyTree.EMPTY);
55
- };
56
- request.onerror = (event) => reject(event.target.error);
57
- });
49
+ const transaction = db.transaction(["tree", "blobs"], "readonly");
50
+ const treeStore = transaction.objectStore("tree");
51
+ const blobsStore = transaction.objectStore("blobs");
52
+ const [tree, blobKeys] = await Promise.all([
53
+ new Promise((resolve, reject) => {
54
+ const request = treeStore.get("tree");
55
+ request.onsuccess = (event) => {
56
+ const entry = event.target.result;
57
+ resolve(entry ? new ReadonlyTree(entry) : ReadonlyTree.EMPTY);
58
+ };
59
+ request.onerror = (event) => reject(event.target.error);
60
+ }),
61
+ new Promise((resolve, reject) => {
62
+ const request = blobsStore.getAllKeys();
63
+ request.onsuccess = () => resolve(request.result);
64
+ request.onerror = (event) => reject(event.target.error);
65
+ })
66
+ ]);
67
+ for (const sha of tree.shas) {
68
+ if (!blobKeys.includes(sha)) {
69
+ console.warn(`Blob ${sha} in tree, but not found`);
70
+ return ReadonlyTree.EMPTY;
71
+ }
72
+ }
73
+ return tree;
58
74
  };
59
75
  return handle().catch(this.#retryIfClosing(handle));
60
76
  }
@@ -81,6 +97,12 @@ var IndexedDBSource = class {
81
97
  async applyChanges(batch) {
82
98
  const db = await this.#connect();
83
99
  const current = await this.getTree();
100
+ if (batch.fromSha !== current.sha)
101
+ throw new ShaMismatchError(
102
+ current.sha,
103
+ batch.fromSha,
104
+ "Cannot apply changes locally due to SHA mismatch"
105
+ );
84
106
  const updatedTree = current.clone();
85
107
  updatedTree.applyChanges(batch);
86
108
  const compiled = await updatedTree.compile();
@@ -93,10 +115,15 @@ var IndexedDBSource = class {
93
115
  case "add":
94
116
  blobs.put(change.contents, change.sha);
95
117
  break;
96
- case "delete":
97
- blobs.delete(change.sha);
98
- break;
99
118
  }
119
+ const blobKeys = await new Promise((resolve, reject) => {
120
+ const request = blobs.getAllKeys();
121
+ request.onsuccess = () => resolve(request.result);
122
+ request.onerror = (event) => reject(event.target.error);
123
+ });
124
+ for (const sha of blobKeys) {
125
+ if (!compiled.hasSha(sha)) blobs.delete(sha);
126
+ }
100
127
  return new Promise((resolve, reject) => {
101
128
  transaction.oncomplete = () => resolve();
102
129
  transaction.onerror = (event) => reject(event.target.error);
@@ -41,13 +41,13 @@ var MemorySource = class {
41
41
  this.#blobs.set(change.sha, change.contents);
42
42
  continue;
43
43
  }
44
- case "delete": {
45
- this.#blobs.delete(change.sha);
46
- continue;
47
- }
48
44
  }
49
45
  }
50
- this.#tree = await this.#tree.withChanges(batch);
46
+ const compiled = await this.#tree.withChanges(batch);
47
+ for (const sha of this.#blobs.keys()) {
48
+ if (!compiled.hasSha(sha)) this.#blobs.delete(sha);
49
+ }
50
+ this.#tree = compiled;
51
51
  }
52
52
  };
53
53
  export {
@@ -2,5 +2,5 @@ import { HttpError } from '../HttpError.js';
2
2
  export declare class ShaMismatchError extends HttpError {
3
3
  actual: string;
4
4
  expected: string;
5
- constructor(actual: string, expected: string);
5
+ constructor(actual: string, expected: string, message?: string);
6
6
  }
@@ -3,8 +3,8 @@ import "../../chunks/chunk-NZLE2WMY.js";
3
3
  // src/core/source/ShaMismatchError.ts
4
4
  import { HttpError } from "../HttpError.js";
5
5
  var ShaMismatchError = class extends HttpError {
6
- constructor(actual, expected) {
7
- super(409, `SHA mismatch: ${actual} != ${expected}`);
6
+ constructor(actual, expected, message = "SHA mismatch") {
7
+ super(409, `${message}: ${actual} <> ${expected}`);
8
8
  this.actual = actual;
9
9
  this.expected = expected;
10
10
  }
@@ -50,6 +50,7 @@ export declare class ReadonlyTree extends TreeBase<ReadonlyTree> {
50
50
  constructor({ sha, entries }: Tree);
51
51
  get isEmpty(): boolean;
52
52
  get entries(): Array<Entry>;
53
+ get shas(): ReadonlySet<string>;
53
54
  hasSha(sha: string): boolean;
54
55
  clone(): WriteableTree;
55
56
  toJSON(): {
@@ -125,6 +125,9 @@ var ReadonlyTree = class _ReadonlyTree extends TreeBase {
125
125
  ...entry.toJSON()
126
126
  }));
127
127
  }
128
+ get shas() {
129
+ return this.#shas;
130
+ }
128
131
  hasSha(sha) {
129
132
  return this.#shas.has(sha);
130
133
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bin": "./dist/cli.js",
3
3
  "name": "alinea",
4
- "version": "1.4.8",
4
+ "version": "1.4.9",
5
5
  "description": "Headless git-based CMS",
6
6
  "repository": {
7
7
  "type": "git",