Compare commits
8 Commits
jazz-react
...
jazz-nodej
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07ea59fdcb | ||
|
|
932a84a47f | ||
|
|
34dda7bdbd | ||
|
|
49fa153581 | ||
|
|
c80b827775 | ||
|
|
a2bf9f988a | ||
|
|
ac27b2d5c2 | ||
|
|
0ddceac4c0 |
@@ -1,5 +1,31 @@
|
||||
# jazz-example-chat
|
||||
|
||||
## 0.0.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
- jazz-react@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
|
||||
## 0.0.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
- jazz-react@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
|
||||
## 0.0.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
- jazz-react@0.7.16
|
||||
|
||||
## 0.0.62
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-chat",
|
||||
"private": true,
|
||||
"version": "0.0.62",
|
||||
"version": "0.0.65",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# jazz-example-chat
|
||||
|
||||
## 0.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
- cojson-transport-ws@0.7.18
|
||||
|
||||
## 0.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
- cojson-transport-ws@0.7.17
|
||||
|
||||
## 0.0.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-inspector",
|
||||
"private": true,
|
||||
"version": "0.0.47",
|
||||
"version": "0.0.49",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -19,7 +19,7 @@
|
||||
"hash-slash": "workspace:*",
|
||||
"cojson": "workspace:*",
|
||||
"cojson-transport-ws": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"lucide-react": "^0.274.0",
|
||||
"qrcode": "^1.5.3",
|
||||
"react": "^18.2.0",
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
# jazz-example-pets
|
||||
|
||||
## 0.0.83
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
- jazz-browser-media-images@0.7.18
|
||||
|
||||
## 0.0.82
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
- jazz-browser-media-images@0.7.17
|
||||
|
||||
## 0.0.81
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
- jazz-browser-media-images@0.7.16
|
||||
- jazz-react@0.7.16
|
||||
|
||||
## 0.0.80
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-pets",
|
||||
"private": true,
|
||||
"version": "0.0.80",
|
||||
"version": "0.0.83",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
# jazz-example-todo
|
||||
|
||||
## 0.0.82
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
|
||||
## 0.0.81
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
|
||||
## 0.0.80
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
- jazz-react@0.7.16
|
||||
|
||||
## 0.0.79
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-todo",
|
||||
"private": true,
|
||||
"version": "0.0.79",
|
||||
"version": "0.0.82",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# cojson-storage-indexeddb
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "cojson-storage-indexeddb",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cojson": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# cojson-storage-sqlite
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "cojson-storage-sqlite",
|
||||
"type": "module",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^8.5.2",
|
||||
"cojson": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# cojson-transport-nodejs-ws
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "cojson-transport-ws",
|
||||
"type": "module",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cojson": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# cojson
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Update to Effect 3.5.2
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix bugs in new storage interface
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"types": "src/index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
||||
@@ -22,7 +22,7 @@
|
||||
"@noble/ciphers": "^0.1.3",
|
||||
"@noble/hashes": "^1.4.0",
|
||||
"@scure/base": "^1.1.1",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"hash-wasm": "^4.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -118,20 +118,21 @@ export function writeBlock<WH, RH, FS extends FileSystem<WH, RH>>(
|
||||
const headerBytes = textEncoder.encode(JSON.stringify(blockHeader));
|
||||
yield* $(fs.append(file, headerBytes));
|
||||
|
||||
console.log(
|
||||
"full file",
|
||||
yield* $(
|
||||
fs.read(file as unknown as RH, 0, offset + headerBytes.length),
|
||||
),
|
||||
);
|
||||
// console.log(
|
||||
// "full file",
|
||||
// yield* $(
|
||||
// fs.read(file as unknown as RH, 0, offset + headerBytes.length),
|
||||
// ),
|
||||
// );
|
||||
|
||||
const filename: BlockFilename = `${hash.digest()}-L${level}-H${
|
||||
headerBytes.length
|
||||
}.jsonl`;
|
||||
console.log("renaming to" + filename);
|
||||
// console.log("renaming to" + filename);
|
||||
yield* $(fs.closeAndRename(file, filename));
|
||||
|
||||
console.log("Wrote block", filename, blockHeader);
|
||||
// console.log("Wrote block", filename, blockHeader);
|
||||
// console.log("IDs in block", blockHeader.map(e => e.id));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -126,10 +126,12 @@ export function mergeChunks(
|
||||
} else {
|
||||
const lastNewEntry = newEntries[newEntries.length - 1]!;
|
||||
lastNewEntry.transactions.push(...entry.transactions);
|
||||
lastNewEntry.lastSignature = entry.lastSignature;
|
||||
|
||||
bytesSinceLastSignature += entry.transactions.length;
|
||||
}
|
||||
}
|
||||
newSessions[sessionID] = newEntries;
|
||||
} else {
|
||||
return Either.right("nonContigous" as const);
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
|
||||
if (!coValue) {
|
||||
if (newContent.header) {
|
||||
console.log("Creating in WAL", newContent.id);
|
||||
// console.log("Creating in WAL", newContent.id);
|
||||
yield* this.withWAL((wal) =>
|
||||
writeToWal(
|
||||
wal,
|
||||
@@ -258,7 +258,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
// })
|
||||
// )
|
||||
// );
|
||||
console.warn(
|
||||
yield* Effect.logWarning(
|
||||
"Incontiguous incoming update for " + newContent.id,
|
||||
);
|
||||
return coValues;
|
||||
@@ -268,6 +268,23 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
if (Either.isRight(merged)) {
|
||||
yield* Effect.logWarning(
|
||||
"Non-contigous new content for " + newContent.id,
|
||||
Object.entries(coValue.sessionEntries).map(
|
||||
([session, entries]) =>
|
||||
entries.map((entry) => ({
|
||||
session: session,
|
||||
after: entry.after,
|
||||
length: entry.transactions.length,
|
||||
})),
|
||||
),
|
||||
Object.entries(
|
||||
newContentAsChunk.sessionEntries,
|
||||
).map(([session, entries]) =>
|
||||
entries.map((entry) => ({
|
||||
session: session,
|
||||
after: entry.after,
|
||||
length: entry.transactions.length,
|
||||
})),
|
||||
),
|
||||
);
|
||||
|
||||
// yield* Effect.promise(() =>
|
||||
@@ -280,7 +297,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
|
||||
return coValues;
|
||||
} else {
|
||||
console.log("Appending to WAL", newContent.id);
|
||||
// console.log("Appending to WAL", newContent.id);
|
||||
yield* this.withWAL((wal) =>
|
||||
writeToWal(
|
||||
wal,
|
||||
@@ -316,6 +333,8 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
|
||||
const { handle, size } = yield* fs.openToRead(blockFile);
|
||||
|
||||
// console.log("Attempting to load", id, blockFile);
|
||||
|
||||
if (!cachedHeader) {
|
||||
cachedHeader = {};
|
||||
const header = yield* readHeader(
|
||||
@@ -335,6 +354,8 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
}
|
||||
const headerEntry = cachedHeader[id];
|
||||
|
||||
// console.log("Header entry", id, headerEntry);
|
||||
|
||||
let result;
|
||||
if (headerEntry) {
|
||||
result = yield* readChunk(handle, headerEntry, fs);
|
||||
@@ -361,7 +382,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
|
||||
const coValues = new Map<RawCoID, CoValueChunk>();
|
||||
|
||||
console.log("Compacting WAL files", walFiles);
|
||||
yield* Effect.log("Compacting WAL files", walFiles);
|
||||
if (walFiles.length === 0) return;
|
||||
|
||||
yield* SynchronizedRef.updateEffect(this.currentWal, (wal) =>
|
||||
@@ -374,7 +395,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
);
|
||||
|
||||
for (const fileName of walFiles) {
|
||||
const { handle, size } =
|
||||
const { handle, size }: { handle: RH; size: number } =
|
||||
yield* this.fs.openToRead(fileName);
|
||||
if (size === 0) {
|
||||
yield* this.fs.close(handle);
|
||||
@@ -394,7 +415,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
if (existingChunk) {
|
||||
const merged = mergeChunks(existingChunk, chunk);
|
||||
if (Either.isRight(merged)) {
|
||||
console.warn(
|
||||
yield* Effect.logWarning(
|
||||
"Non-contigous chunks in " +
|
||||
chunk.id +
|
||||
", " +
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
# jazz-browser-media-images
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
|
||||
## 0.7.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
- jazz-browser@0.7.16
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jazz-browser-media-images",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
# jazz-browser
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
- cojson-storage-indexeddb@0.7.18
|
||||
- cojson-transport-ws@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
- cojson-storage-indexeddb@0.7.17
|
||||
- cojson-transport-ws@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
|
||||
## 0.7.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jazz-browser",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
@@ -10,7 +10,7 @@
|
||||
"cojson": "workspace:*",
|
||||
"cojson-storage-indexeddb": "workspace:*",
|
||||
"cojson-transport-ws": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"jazz-tools": "workspace:*",
|
||||
"typescript": "^5.1.6"
|
||||
},
|
||||
|
||||
@@ -309,7 +309,7 @@ const opfsWorkerJSSrc = `
|
||||
postMessage({requestId: event.data.requestId, data: buffer, result: "done"});
|
||||
} else if (event.data.type === "close") {
|
||||
const handle = handlesByRequest.get(event.data.handle);
|
||||
console.log("Closing handle", filenamesForHandles.get(handle), event.data.handle, handle);
|
||||
// console.log("Closing handle", filenamesForHandles.get(handle), event.data.handle, handle);
|
||||
handle.flush();
|
||||
handle.close();
|
||||
handlesByRequest.delete(handle);
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
# jazz-autosub
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
- cojson-transport-ws@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
- cojson-transport-ws@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
|
||||
## 0.7.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
"types": "src/index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"dependencies": {
|
||||
"cojson": "workspace:*",
|
||||
"cojson-transport-ws": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"jazz-tools": "workspace:*",
|
||||
"ws": "^8.14.2"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
# jazz-react
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
- jazz-browser@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
- jazz-browser@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
|
||||
## 0.7.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
- jazz-browser@0.7.16
|
||||
|
||||
## 0.7.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jazz-react",
|
||||
"version": "0.7.15",
|
||||
"version": "0.7.18",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
# jazz-autosub
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
- cojson-transport-ws@0.7.18
|
||||
- jazz-tools@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
- cojson-transport-ws@0.7.17
|
||||
- jazz-tools@0.7.17
|
||||
|
||||
## 0.7.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- jazz-tools@0.7.16
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"bin": "./dist/index.js",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext ts,tsx",
|
||||
"format": "prettier --write './src/**/*.{ts,tsx}'",
|
||||
@@ -16,7 +16,7 @@
|
||||
"@effect/schema": "^0.66.16",
|
||||
"cojson": "workspace:*",
|
||||
"cojson-transport-ws": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"fast-check": "^3.17.2",
|
||||
"jazz-tools": "workspace:*",
|
||||
"ws": "^8.14.2"
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
# jazz-autosub
|
||||
|
||||
## 0.7.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.18
|
||||
|
||||
## 0.7.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- cojson@0.7.17
|
||||
|
||||
## 0.7.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix: allow null in encoded fields
|
||||
|
||||
## 0.7.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
"types": "./src/index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.7.14",
|
||||
"version": "0.7.18",
|
||||
"dependencies": {
|
||||
"@effect/schema": "^0.66.16",
|
||||
"cojson": "workspace:*",
|
||||
"effect": "^3.1.5",
|
||||
"effect": "^3.5.2",
|
||||
"fast-check": "^3.17.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -539,6 +539,7 @@ const CoMapProxyHandler: ProxyHandler<CoMap> = {
|
||||
if (
|
||||
(typeof key === "string" || ItemsSym) &&
|
||||
typeof value === "object" &&
|
||||
value !== null &&
|
||||
SchemaInit in value
|
||||
) {
|
||||
(target.constructor as typeof CoMap)._schema ||= {};
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
WasmCrypto,
|
||||
isControlledAccount,
|
||||
} from "../index.js";
|
||||
import { Schema } from "@effect/schema";
|
||||
|
||||
const Crypto = await WasmCrypto.create();
|
||||
|
||||
@@ -24,6 +25,7 @@ describe("Simple CoMap operations", async () => {
|
||||
_height = co.number;
|
||||
birthday = co.encoded(Encoders.Date);
|
||||
name? = co.string;
|
||||
nullable = co.encoded(Schema.NullOr(Schema.String));
|
||||
|
||||
get roughColor() {
|
||||
return this.color + "ish";
|
||||
@@ -39,6 +41,7 @@ describe("Simple CoMap operations", async () => {
|
||||
color: "red",
|
||||
_height: 10,
|
||||
birthday: birthday,
|
||||
nullable: null,
|
||||
},
|
||||
{ owner: me },
|
||||
);
|
||||
@@ -49,7 +52,12 @@ describe("Simple CoMap operations", async () => {
|
||||
expect(map._height).toEqual(10);
|
||||
expect(map.birthday).toEqual(birthday);
|
||||
expect(map._raw.get("birthday")).toEqual(birthday.toISOString());
|
||||
expect(Object.keys(map)).toEqual(["color", "_height", "birthday"]);
|
||||
expect(Object.keys(map)).toEqual([
|
||||
"color",
|
||||
"_height",
|
||||
"birthday",
|
||||
"nullable",
|
||||
]);
|
||||
});
|
||||
|
||||
test("Construction with too many things provided", () => {
|
||||
@@ -84,6 +92,9 @@ describe("Simple CoMap operations", async () => {
|
||||
expect(map._height).toEqual(20);
|
||||
expect(map._raw.get("_height")).toEqual(20);
|
||||
|
||||
map.nullable = "not null";
|
||||
map.nullable = null;
|
||||
|
||||
map.name = "Secret name";
|
||||
expect(map.name).toEqual("Secret name");
|
||||
map.name = undefined;
|
||||
@@ -253,11 +264,12 @@ describe("CoMap resolution", async () => {
|
||||
|
||||
test("Loading and availability", async () => {
|
||||
const { me, map } = await initNodeAndMap();
|
||||
const [initialAsPeer, secondPeer] = await Effect.runPromise(connectedPeers(
|
||||
"initial",
|
||||
"second",
|
||||
{ peer1role: "server", peer2role: "client" },
|
||||
));
|
||||
const [initialAsPeer, secondPeer] = await Effect.runPromise(
|
||||
connectedPeers("initial", "second", {
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
}),
|
||||
);
|
||||
if (!isControlledAccount(me)) {
|
||||
throw "me is not a controlled account";
|
||||
}
|
||||
@@ -323,11 +335,12 @@ describe("CoMap resolution", async () => {
|
||||
test("Subscription & auto-resolution", async () => {
|
||||
const { me, map } = await initNodeAndMap();
|
||||
|
||||
const [initialAsPeer, secondAsPeer] = await Effect.runPromise(connectedPeers(
|
||||
"initial",
|
||||
"second",
|
||||
{ peer1role: "server", peer2role: "client" },
|
||||
));
|
||||
const [initialAsPeer, secondAsPeer] = await Effect.runPromise(
|
||||
connectedPeers("initial", "second", {
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
}),
|
||||
);
|
||||
if (!isControlledAccount(me)) {
|
||||
throw "me is not a controlled account";
|
||||
}
|
||||
|
||||
104
pnpm-lock.yaml
generated
104
pnpm-lock.yaml
generated
@@ -163,8 +163,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/cojson-transport-ws
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
hash-slash:
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/hash-slash
|
||||
@@ -451,8 +451,8 @@ importers:
|
||||
specifier: ^1.1.1
|
||||
version: 1.1.5
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
hash-wasm:
|
||||
specifier: ^4.9.0
|
||||
version: 4.11.0
|
||||
@@ -488,8 +488,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
typescript:
|
||||
specifier: ^5.1.6
|
||||
version: 5.3.3
|
||||
@@ -513,8 +513,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
typescript:
|
||||
specifier: ^5.1.6
|
||||
version: 5.3.3
|
||||
@@ -529,8 +529,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
typescript:
|
||||
specifier: ^5.1.6
|
||||
version: 5.3.3
|
||||
@@ -566,8 +566,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson-transport-ws
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
jazz-tools:
|
||||
specifier: workspace:*
|
||||
version: link:../jazz-tools
|
||||
@@ -609,8 +609,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson-transport-ws
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
jazz-tools:
|
||||
specifier: workspace:*
|
||||
version: link:../jazz-tools
|
||||
@@ -657,13 +657,13 @@ importers:
|
||||
dependencies:
|
||||
'@effect/cli':
|
||||
specifier: ^0.36.21
|
||||
version: 0.36.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1))(@effect/printer-ansi@0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1))(@effect/printer@0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1))(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1)
|
||||
version: 0.36.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2))(@effect/printer-ansi@0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2))(@effect/printer@0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2))(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2)
|
||||
'@effect/platform-node':
|
||||
specifier: ^0.49.2
|
||||
version: 0.49.2(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1))(effect@3.2.1)
|
||||
version: 0.49.2(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2))(effect@3.5.2)
|
||||
'@effect/schema':
|
||||
specifier: ^0.66.16
|
||||
version: 0.66.16(effect@3.2.1)(fast-check@3.17.2)
|
||||
version: 0.66.16(effect@3.5.2)(fast-check@3.17.2)
|
||||
cojson:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson
|
||||
@@ -671,8 +671,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson-transport-ws
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
fast-check:
|
||||
specifier: ^3.17.2
|
||||
version: 3.17.2
|
||||
@@ -697,13 +697,13 @@ importers:
|
||||
dependencies:
|
||||
'@effect/schema':
|
||||
specifier: ^0.66.16
|
||||
version: 0.66.16(effect@3.2.1)(fast-check@3.17.2)
|
||||
version: 0.66.16(effect@3.5.2)(fast-check@3.17.2)
|
||||
cojson:
|
||||
specifier: workspace:*
|
||||
version: link:../cojson
|
||||
effect:
|
||||
specifier: ^3.1.5
|
||||
version: 3.2.1
|
||||
specifier: ^3.5.2
|
||||
version: 3.5.2
|
||||
fast-check:
|
||||
specifier: ^3.17.2
|
||||
version: 3.17.2
|
||||
@@ -2461,8 +2461,8 @@ packages:
|
||||
resolution: {integrity: sha512-G0wNgFMFRDnFfKaXG2R6HiyVHqhKwdQ3EgoxW3wPlns2wKqem7F+HgkWBcevN7Vz0nN4AXtskID7/6jsYDXcKw==}
|
||||
hasBin: true
|
||||
|
||||
effect@3.2.1:
|
||||
resolution: {integrity: sha512-WnM7QyHekA+oWkJyD1g99BDqD3atAXKjarcDnUX9alIKLd8EFXdY333wpgcNJkSqtvXDsx8qYWOMbuivdwoN2w==}
|
||||
effect@3.5.2:
|
||||
resolution: {integrity: sha512-jZAZAgHHrnkqrRaaLBU/a6zEFm3+uOimr+ZJqvCqiHtw5k2AE6F0jiEPuM/MNJOe4r16JDo4SYa3IULIQuXvAw==}
|
||||
|
||||
electron-to-chromium@1.4.615:
|
||||
resolution: {integrity: sha512-/bKPPcgZVUziECqDc+0HkT87+0zhaWSZHNXqF8FLd2lQcptpmUFwoCSWjCdOng9Gdq+afKArPdEg/0ZW461Eng==}
|
||||
@@ -5015,29 +5015,29 @@ snapshots:
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.9
|
||||
|
||||
'@effect/cli@0.36.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1))(@effect/printer-ansi@0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1))(@effect/printer@0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1))(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1)':
|
||||
'@effect/cli@0.36.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2))(@effect/printer-ansi@0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2))(@effect/printer@0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2))(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2)':
|
||||
dependencies:
|
||||
'@effect/platform': 0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1)
|
||||
'@effect/printer': 0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1)
|
||||
'@effect/printer-ansi': 0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1)
|
||||
'@effect/schema': 0.66.16(effect@3.2.1)(fast-check@3.17.2)
|
||||
effect: 3.2.1
|
||||
'@effect/platform': 0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2)
|
||||
'@effect/printer': 0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2)
|
||||
'@effect/printer-ansi': 0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2)
|
||||
'@effect/schema': 0.66.16(effect@3.5.2)(fast-check@3.17.2)
|
||||
effect: 3.5.2
|
||||
ini: 4.1.2
|
||||
toml: 3.0.0
|
||||
yaml: 2.4.2
|
||||
|
||||
'@effect/platform-node-shared@0.4.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1))(effect@3.2.1)':
|
||||
'@effect/platform-node-shared@0.4.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2))(effect@3.5.2)':
|
||||
dependencies:
|
||||
'@effect/platform': 0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1)
|
||||
'@effect/platform': 0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2)
|
||||
'@parcel/watcher': 2.4.1
|
||||
effect: 3.2.1
|
||||
effect: 3.5.2
|
||||
multipasta: 0.2.1
|
||||
|
||||
'@effect/platform-node@0.49.2(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1))(effect@3.2.1)':
|
||||
'@effect/platform-node@0.49.2(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2))(effect@3.5.2)':
|
||||
dependencies:
|
||||
'@effect/platform': 0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1)
|
||||
'@effect/platform-node-shared': 0.4.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1))(effect@3.2.1)
|
||||
effect: 3.2.1
|
||||
'@effect/platform': 0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2)
|
||||
'@effect/platform-node-shared': 0.4.21(@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2))(effect@3.5.2)
|
||||
effect: 3.5.2
|
||||
mime: 3.0.0
|
||||
undici: 6.16.1
|
||||
ws: 8.17.0
|
||||
@@ -5045,33 +5045,33 @@ snapshots:
|
||||
- bufferutil
|
||||
- utf-8-validate
|
||||
|
||||
'@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2))(effect@3.2.1)':
|
||||
'@effect/platform@0.53.2(@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2))(effect@3.5.2)':
|
||||
dependencies:
|
||||
'@effect/schema': 0.66.16(effect@3.2.1)(fast-check@3.17.2)
|
||||
effect: 3.2.1
|
||||
'@effect/schema': 0.66.16(effect@3.5.2)(fast-check@3.17.2)
|
||||
effect: 3.5.2
|
||||
find-my-way-ts: 0.1.2
|
||||
multipasta: 0.2.1
|
||||
path-browserify: 1.0.1
|
||||
|
||||
'@effect/printer-ansi@0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1)':
|
||||
'@effect/printer-ansi@0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2)':
|
||||
dependencies:
|
||||
'@effect/printer': 0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1)
|
||||
'@effect/typeclass': 0.24.12(effect@3.2.1)
|
||||
effect: 3.2.1
|
||||
'@effect/printer': 0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2)
|
||||
'@effect/typeclass': 0.24.12(effect@3.5.2)
|
||||
effect: 3.5.2
|
||||
|
||||
'@effect/printer@0.33.12(@effect/typeclass@0.24.12(effect@3.2.1))(effect@3.2.1)':
|
||||
'@effect/printer@0.33.12(@effect/typeclass@0.24.12(effect@3.5.2))(effect@3.5.2)':
|
||||
dependencies:
|
||||
'@effect/typeclass': 0.24.12(effect@3.2.1)
|
||||
effect: 3.2.1
|
||||
'@effect/typeclass': 0.24.12(effect@3.5.2)
|
||||
effect: 3.5.2
|
||||
|
||||
'@effect/schema@0.66.16(effect@3.2.1)(fast-check@3.17.2)':
|
||||
'@effect/schema@0.66.16(effect@3.5.2)(fast-check@3.17.2)':
|
||||
dependencies:
|
||||
effect: 3.2.1
|
||||
effect: 3.5.2
|
||||
fast-check: 3.17.2
|
||||
|
||||
'@effect/typeclass@0.24.12(effect@3.2.1)':
|
||||
'@effect/typeclass@0.24.12(effect@3.5.2)':
|
||||
dependencies:
|
||||
effect: 3.2.1
|
||||
effect: 3.5.2
|
||||
|
||||
'@esbuild/aix-ppc64@0.19.10':
|
||||
optional: true
|
||||
@@ -6684,7 +6684,7 @@ snapshots:
|
||||
unzipper: 0.10.14
|
||||
which: 4.0.0
|
||||
|
||||
effect@3.2.1: {}
|
||||
effect@3.5.2: {}
|
||||
|
||||
electron-to-chromium@1.4.615: {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user