atom.io 0.30.5 → 0.30.7
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/dist/{chunk-LSCRHXLI.js → chunk-UDHCFTYT.js} +31 -31
- package/internal/dist/index.d.ts +12 -12
- package/internal/dist/index.js +1 -1
- package/internal/src/store/index.ts +1 -0
- package/json/dist/index.js +1 -1
- package/package.json +17 -17
- package/realtime-server/dist/index.d.ts +4 -12
- package/realtime-server/dist/index.js +36 -24
- package/realtime-server/src/ipc-sockets/child-socket.ts +23 -10
|
@@ -70,6 +70,36 @@ function eldest(scion) {
|
|
|
70
70
|
}
|
|
71
71
|
return scion;
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
// internal/src/store/circular-buffer.ts
|
|
75
|
+
var CircularBuffer = class _CircularBuffer {
|
|
76
|
+
_buffer;
|
|
77
|
+
_index = 0;
|
|
78
|
+
constructor(lengthOrArray) {
|
|
79
|
+
let length;
|
|
80
|
+
if (typeof lengthOrArray === `number`) {
|
|
81
|
+
length = lengthOrArray;
|
|
82
|
+
} else {
|
|
83
|
+
length = lengthOrArray.length;
|
|
84
|
+
}
|
|
85
|
+
this._buffer = Array.from({ length });
|
|
86
|
+
}
|
|
87
|
+
get buffer() {
|
|
88
|
+
return this._buffer;
|
|
89
|
+
}
|
|
90
|
+
get index() {
|
|
91
|
+
return this._index;
|
|
92
|
+
}
|
|
93
|
+
add(item) {
|
|
94
|
+
this._buffer[this._index] = item;
|
|
95
|
+
this._index = (this._index + 1) % this._buffer.length;
|
|
96
|
+
}
|
|
97
|
+
copy() {
|
|
98
|
+
const copy = new _CircularBuffer([...this._buffer]);
|
|
99
|
+
copy._index = this._index;
|
|
100
|
+
return copy;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
73
103
|
var FAMILY_MEMBER_TOKEN_TYPES = {
|
|
74
104
|
atom_family: `atom`,
|
|
75
105
|
mutable_atom_family: `mutable_atom`,
|
|
@@ -2150,36 +2180,6 @@ function getEpochNumberOfAction(transactionKey, store) {
|
|
|
2150
2180
|
// internal/src/transaction/index.ts
|
|
2151
2181
|
var TRANSACTION_PHASES = [`idle`, `building`, `applying`];
|
|
2152
2182
|
|
|
2153
|
-
// internal/src/store/circular-buffer.ts
|
|
2154
|
-
var CircularBuffer = class _CircularBuffer {
|
|
2155
|
-
_buffer;
|
|
2156
|
-
_index = 0;
|
|
2157
|
-
constructor(lengthOrArray) {
|
|
2158
|
-
let length;
|
|
2159
|
-
if (typeof lengthOrArray === `number`) {
|
|
2160
|
-
length = lengthOrArray;
|
|
2161
|
-
} else {
|
|
2162
|
-
length = lengthOrArray.length;
|
|
2163
|
-
}
|
|
2164
|
-
this._buffer = Array.from({ length });
|
|
2165
|
-
}
|
|
2166
|
-
get buffer() {
|
|
2167
|
-
return this._buffer;
|
|
2168
|
-
}
|
|
2169
|
-
get index() {
|
|
2170
|
-
return this._index;
|
|
2171
|
-
}
|
|
2172
|
-
add(item) {
|
|
2173
|
-
this._buffer[this._index] = item;
|
|
2174
|
-
this._index = (this._index + 1) % this._buffer.length;
|
|
2175
|
-
}
|
|
2176
|
-
copy() {
|
|
2177
|
-
const copy = new _CircularBuffer([...this._buffer]);
|
|
2178
|
-
copy._index = this._index;
|
|
2179
|
-
return copy;
|
|
2180
|
-
}
|
|
2181
|
-
};
|
|
2182
|
-
|
|
2183
2183
|
// internal/src/store/store.ts
|
|
2184
2184
|
var Store = class {
|
|
2185
2185
|
parent = null;
|
|
@@ -3587,4 +3587,4 @@ var timeTravel = (store, action, token) => {
|
|
|
3587
3587
|
);
|
|
3588
3588
|
};
|
|
3589
3589
|
|
|
3590
|
-
export { FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Future, IMPLICIT, Junction, LazyMap, Molecule, NotFoundError, StatefulSubject, Store, Subject, TRANSACTION_PHASES, Tracker, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, counterfeit, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, createWritableSelectorFamily, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, prettyPrintTokenType, readCachedValue, readOrComputeValue, recallState, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootAtoms, subscribeToState2 as subscribeToState, subscribeToTimeline2 as subscribeToTimeline, subscribeToTransaction2 as subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw };
|
|
3590
|
+
export { CircularBuffer, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Future, IMPLICIT, Junction, LazyMap, Molecule, NotFoundError, StatefulSubject, Store, Subject, TRANSACTION_PHASES, Tracker, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, counterfeit, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, createWritableSelectorFamily, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, prettyPrintTokenType, readCachedValue, readOrComputeValue, recallState, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootAtoms, subscribeToState2 as subscribeToState, subscribeToTimeline2 as subscribeToTimeline, subscribeToTransaction2 as subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw };
|
package/internal/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,17 @@ import { Join } from 'atom.io/data';
|
|
|
5
5
|
import { Refinement } from 'atom.io/introspection';
|
|
6
6
|
import { Store as Store$1, Func as Func$1 } from 'atom.io/internal';
|
|
7
7
|
|
|
8
|
+
declare class CircularBuffer<T> {
|
|
9
|
+
protected _buffer: T[];
|
|
10
|
+
protected _index: number;
|
|
11
|
+
constructor(array: T[]);
|
|
12
|
+
constructor(length: number);
|
|
13
|
+
get buffer(): ReadonlyArray<T | undefined>;
|
|
14
|
+
get index(): number;
|
|
15
|
+
add(item: T): void;
|
|
16
|
+
copy(): CircularBuffer<T>;
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
declare const FAMILY_MEMBER_TOKEN_TYPES: {
|
|
9
20
|
readonly atom_family: "atom";
|
|
10
21
|
readonly mutable_atom_family: "mutable_atom";
|
|
@@ -315,17 +326,6 @@ declare function createTimeline<ManagedAtom extends TimelineManageable>(options:
|
|
|
315
326
|
|
|
316
327
|
declare const timeTravel: (store: Store, action: `redo` | `undo`, token: TimelineToken<any>) => void;
|
|
317
328
|
|
|
318
|
-
declare class CircularBuffer<T> {
|
|
319
|
-
protected _buffer: T[];
|
|
320
|
-
protected _index: number;
|
|
321
|
-
constructor(array: T[]);
|
|
322
|
-
constructor(length: number);
|
|
323
|
-
get buffer(): ReadonlyArray<T | undefined>;
|
|
324
|
-
get index(): number;
|
|
325
|
-
add(item: T): void;
|
|
326
|
-
copy(): CircularBuffer<T>;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
329
|
declare class Store implements Lineage {
|
|
330
330
|
parent: Store | null;
|
|
331
331
|
child: Store | null;
|
|
@@ -701,4 +701,4 @@ type SelectorFamily<T, K extends Canonical> = ReadonlySelectorFamily<T, K> | Wri
|
|
|
701
701
|
type WritableFamily<T, K extends Canonical> = AtomFamily<T, K> | WritableSelectorFamily<T, K>;
|
|
702
702
|
type ReadableFamily<T, K extends Canonical> = AtomFamily<T, K> | SelectorFamily<T, K>;
|
|
703
703
|
|
|
704
|
-
export { type Atom, type AtomFamily, type AtomIOState, type AtomIOToken, type AtomKey, type BaseExternalStoreConfiguration, type ChildStore, type Count, type Each, type Empty, type EnvironmentData, type ExternalStoreConfiguration, type ExternalStoreWithContentConfiguration, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, type Flat, type Func, Future, IMPLICIT, Junction, type JunctionAdvancedConfiguration, type JunctionEntries, type JunctionEntriesBase, type JunctionJSON, type JunctionSchema, type JunctionSchemaBase, LazyMap, type Lineage, type Modify, Molecule, type MutableAtom, type MutableAtomFamily, NotFoundError, type OperationProgress, type ReadableFamily, type ReadableState, type ReadonlySelector, type ReadonlySelectorFamily, type ReadonlySelectorKey, type RegularAtom, type RegularAtomFamily, type RootStore, type Selector, type SelectorFamily, type SelectorKey, type Signal, type StateKey, StatefulSubject, Store, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineMoleculeCreation, type TimelineMoleculeDisposal, type TimelineSelectorUpdate, type TimelineStateCreation, type TimelineStateDisposal, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionEpoch, type TransactionPhase, type TransactionProgress, type Transceiver, type TransceiverMode, type Withdrawable, type WritableFamily, type WritableSelector, type WritableSelectorFamily, type WritableState, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, counterfeit, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, prettyPrintTokenType, readCachedValue, readOrComputeValue, recallState, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw };
|
|
704
|
+
export { type Atom, type AtomFamily, type AtomIOState, type AtomIOToken, type AtomKey, type BaseExternalStoreConfiguration, type ChildStore, CircularBuffer, type Count, type Each, type Empty, type EnvironmentData, type ExternalStoreConfiguration, type ExternalStoreWithContentConfiguration, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, type Flat, type Func, Future, IMPLICIT, Junction, type JunctionAdvancedConfiguration, type JunctionEntries, type JunctionEntriesBase, type JunctionJSON, type JunctionSchema, type JunctionSchemaBase, LazyMap, type Lineage, type Modify, Molecule, type MutableAtom, type MutableAtomFamily, NotFoundError, type OperationProgress, type ReadableFamily, type ReadableState, type ReadonlySelector, type ReadonlySelectorFamily, type ReadonlySelectorKey, type RegularAtom, type RegularAtomFamily, type RootStore, type Selector, type SelectorFamily, type SelectorKey, type Signal, type StateKey, StatefulSubject, Store, Subject, TRANSACTION_PHASES, type Timeline, type TimelineAtomUpdate, type TimelineMoleculeCreation, type TimelineMoleculeDisposal, type TimelineSelectorUpdate, type TimelineStateCreation, type TimelineStateDisposal, type TimelineTransactionUpdate, Tracker, type Transaction, type TransactionEpoch, type TransactionPhase, type TransactionProgress, type Transceiver, type TransceiverMode, type Withdrawable, type WritableFamily, type WritableSelector, type WritableSelectorFamily, type WritableState, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, counterfeit, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, prettyPrintTokenType, readCachedValue, readOrComputeValue, recallState, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw };
|
package/internal/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Future, IMPLICIT, Junction, LazyMap, Molecule, NotFoundError, StatefulSubject, Store, Subject, TRANSACTION_PHASES, Tracker, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, counterfeit, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, prettyPrintTokenType, readCachedValue, readOrComputeValue, recallState, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw } from '../../dist/chunk-
|
|
1
|
+
export { CircularBuffer, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Future, IMPLICIT, Junction, LazyMap, Molecule, NotFoundError, StatefulSubject, Store, Subject, TRANSACTION_PHASES, Tracker, abortTransaction, actUponStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, cacheValue, clearStore, closeOperation, counterfeit, createAtomFamily, createMoleculeFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelector, createReadonlySelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneAtom, createStandaloneSelector, createTimeline, createTransaction, createWritableSelector, deposit, disposeAtom, disposeFromStore, disposeMolecule, disposeSelector, eldest, evictCachedValue, findInStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getUpdateFamily, getUpdateToken, growMoleculeInStore, ingestAtomUpdate, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestSelectorUpdate, ingestTransactionUpdate, initFamilyMemberInStore, isAtomDefault, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeMoleculeInStore, markAtomAsDefault, markAtomAsNotDefault, markDone, newest, openOperation, prettyPrintTokenType, readCachedValue, readOrComputeValue, recallState, registerSelector, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootAtoms, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceAllSelectorAtoms, traceSelectorAtoms, updateSelectorAtoms, withdraw } from '../../dist/chunk-UDHCFTYT.js';
|
|
2
2
|
import '../../dist/chunk-ADMEAXYU.js';
|
|
3
3
|
import '../../dist/chunk-XWL6SNVU.js';
|
package/json/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createWritableSelectorFamily } from '../../dist/chunk-
|
|
1
|
+
import { createWritableSelectorFamily } from '../../dist/chunk-UDHCFTYT.js';
|
|
2
2
|
import '../../dist/chunk-ADMEAXYU.js';
|
|
3
3
|
import '../../dist/chunk-XWL6SNVU.js';
|
|
4
4
|
import { createStandaloneSelector, IMPLICIT, growMoleculeInStore, initFamilyMemberInStore, withdraw, seekInStore } from 'atom.io/internal';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.7",
|
|
4
4
|
"description": "Composable and testable reactive data library.",
|
|
5
5
|
"homepage": "https://atom.io.fyi",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -57,35 +57,35 @@
|
|
|
57
57
|
"@types/estree": "1.0.6",
|
|
58
58
|
"@types/http-proxy": "1.17.15",
|
|
59
59
|
"@types/npmlog": "7.0.0",
|
|
60
|
-
"@types/react": "19.0.
|
|
60
|
+
"@types/react": "19.0.2",
|
|
61
61
|
"@types/tmp": "0.2.6",
|
|
62
|
-
"@typescript-eslint/parser": "8.
|
|
63
|
-
"@typescript-eslint/rule-tester": "8.
|
|
64
|
-
"@vitest/coverage-v8": "3.0.0-beta.
|
|
65
|
-
"@vitest/ui": "3.0.0-beta.
|
|
66
|
-
"concurrently": "9.1.
|
|
67
|
-
"drizzle-kit": "0.
|
|
68
|
-
"drizzle-orm": "0.
|
|
69
|
-
"eslint": "9.
|
|
70
|
-
"happy-dom": "
|
|
62
|
+
"@typescript-eslint/parser": "8.19.0",
|
|
63
|
+
"@typescript-eslint/rule-tester": "8.19.0",
|
|
64
|
+
"@vitest/coverage-v8": "3.0.0-beta.3",
|
|
65
|
+
"@vitest/ui": "3.0.0-beta.3",
|
|
66
|
+
"concurrently": "9.1.2",
|
|
67
|
+
"drizzle-kit": "0.30.1",
|
|
68
|
+
"drizzle-orm": "0.38.3",
|
|
69
|
+
"eslint": "9.17.0",
|
|
70
|
+
"happy-dom": "16.3.0",
|
|
71
71
|
"http-proxy": "1.18.1",
|
|
72
|
-
"motion": "11.
|
|
72
|
+
"motion": "11.15.0",
|
|
73
73
|
"npmlog": "7.0.1",
|
|
74
74
|
"postgres": "3.4.5",
|
|
75
|
-
"preact": "10.25.
|
|
75
|
+
"preact": "10.25.4",
|
|
76
76
|
"react": "19.0.0",
|
|
77
77
|
"react-dom": "19.0.0",
|
|
78
|
-
"react-router-dom": "7.
|
|
78
|
+
"react-router-dom": "7.1.1",
|
|
79
79
|
"socket.io": "4.8.1",
|
|
80
80
|
"socket.io-client": "4.8.1",
|
|
81
81
|
"tmp": "0.2.3",
|
|
82
82
|
"tsup": "8.3.5",
|
|
83
83
|
"tsx": "4.19.2",
|
|
84
84
|
"typescript": "5.7.2",
|
|
85
|
-
"vite": "6.0.
|
|
85
|
+
"vite": "6.0.7",
|
|
86
86
|
"vite-tsconfig-paths": "5.1.4",
|
|
87
|
-
"vitest": "3.0.0-beta.
|
|
88
|
-
"zod": "3.
|
|
87
|
+
"vitest": "3.0.0-beta.3",
|
|
88
|
+
"zod": "3.24.1"
|
|
89
89
|
},
|
|
90
90
|
"main": "dist/index.js",
|
|
91
91
|
"types": "dist/index.d.ts",
|
|
@@ -30,24 +30,16 @@ declare class CustomSocket<I extends Events, O extends Events> implements Socket
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
declare class ChildSocket<I extends Events, O extends Events> extends CustomSocket<I, O> {
|
|
33
|
-
process: ChildProcessWithoutNullStreams;
|
|
34
|
-
key: string;
|
|
35
|
-
logger: {
|
|
36
|
-
info: (prefix: string, message: string, ...args: unknown[]) => void;
|
|
37
|
-
warn: (prefix: string, message: string, ...args: unknown[]) => void;
|
|
38
|
-
error: (prefix: string, message: string, ...args: unknown[]) => void;
|
|
39
|
-
};
|
|
40
33
|
protected incompleteData: string;
|
|
41
34
|
protected unprocessedEvents: string[];
|
|
42
35
|
protected incompleteLog: string;
|
|
43
36
|
protected unprocessedLogs: string[];
|
|
44
37
|
id: string;
|
|
38
|
+
process: ChildProcessWithoutNullStreams;
|
|
39
|
+
key: string;
|
|
40
|
+
logger: Pick<Console, `error` | `info` | `warn`>;
|
|
45
41
|
protected handleLog(arg: Json.Serializable): void;
|
|
46
|
-
constructor(process: ChildProcessWithoutNullStreams, key: string, logger?:
|
|
47
|
-
info: (prefix: string, message: string, ...args: unknown[]) => void;
|
|
48
|
-
warn: (prefix: string, message: string, ...args: unknown[]) => void;
|
|
49
|
-
error: (prefix: string, message: string, ...args: unknown[]) => void;
|
|
50
|
-
});
|
|
42
|
+
constructor(process: ChildProcessWithoutNullStreams, key: string, logger?: Pick<Console, `error` | `info` | `warn`>);
|
|
51
43
|
}
|
|
52
44
|
|
|
53
45
|
declare class SubjectSocket<I extends Events, O extends Events> extends CustomSocket<I, O> {
|
|
@@ -61,7 +61,31 @@ var CustomSocket = class {
|
|
|
61
61
|
|
|
62
62
|
// realtime-server/src/ipc-sockets/child-socket.ts
|
|
63
63
|
var ChildSocket = class extends CustomSocket {
|
|
64
|
-
|
|
64
|
+
incompleteData = ``;
|
|
65
|
+
unprocessedEvents = [];
|
|
66
|
+
incompleteLog = ``;
|
|
67
|
+
unprocessedLogs = [];
|
|
68
|
+
id = `#####`;
|
|
69
|
+
process;
|
|
70
|
+
key;
|
|
71
|
+
logger;
|
|
72
|
+
handleLog(arg) {
|
|
73
|
+
if (Array.isArray(arg)) {
|
|
74
|
+
const [level, ...rest] = arg;
|
|
75
|
+
switch (level) {
|
|
76
|
+
case `i`:
|
|
77
|
+
this.logger.info(...rest);
|
|
78
|
+
break;
|
|
79
|
+
case `w`:
|
|
80
|
+
this.logger.warn(...rest);
|
|
81
|
+
break;
|
|
82
|
+
case `e`:
|
|
83
|
+
this.logger.error(...rest);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
constructor(process2, key, logger) {
|
|
65
89
|
super((event, ...args) => {
|
|
66
90
|
const stringifiedEvent = JSON.stringify([event, ...args]) + ``;
|
|
67
91
|
const errorHandler = (err) => {
|
|
@@ -76,8 +100,17 @@ var ChildSocket = class extends CustomSocket {
|
|
|
76
100
|
});
|
|
77
101
|
this.process = process2;
|
|
78
102
|
this.key = key;
|
|
79
|
-
this.logger = logger
|
|
80
|
-
|
|
103
|
+
this.logger = logger ?? {
|
|
104
|
+
info: (...args) => {
|
|
105
|
+
console.info(this.id, this.key, ...args);
|
|
106
|
+
},
|
|
107
|
+
warn: (...args) => {
|
|
108
|
+
console.warn(this.id, this.key, ...args);
|
|
109
|
+
},
|
|
110
|
+
error: (...args) => {
|
|
111
|
+
console.error(this.id, this.key, ...args);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
81
114
|
this.process.stdout.on(
|
|
82
115
|
`data`,
|
|
83
116
|
(buffer) => {
|
|
@@ -139,27 +172,6 @@ var ChildSocket = class extends CustomSocket {
|
|
|
139
172
|
this.id = process2.pid.toString();
|
|
140
173
|
}
|
|
141
174
|
}
|
|
142
|
-
incompleteData = ``;
|
|
143
|
-
unprocessedEvents = [];
|
|
144
|
-
incompleteLog = ``;
|
|
145
|
-
unprocessedLogs = [];
|
|
146
|
-
id = `#####`;
|
|
147
|
-
handleLog(arg) {
|
|
148
|
-
if (Array.isArray(arg)) {
|
|
149
|
-
const [level, ...rest] = arg;
|
|
150
|
-
switch (level) {
|
|
151
|
-
case `i`:
|
|
152
|
-
this.logger.info(this.id, this.key, ...rest);
|
|
153
|
-
break;
|
|
154
|
-
case `w`:
|
|
155
|
-
this.logger.warn(this.id, this.key, ...rest);
|
|
156
|
-
break;
|
|
157
|
-
case `e`:
|
|
158
|
-
this.logger.error(this.id, this.key, ...rest);
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
175
|
};
|
|
164
176
|
var SubjectSocket = class extends CustomSocket {
|
|
165
177
|
in;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChildProcessWithoutNullStreams } from "node:child_process"
|
|
2
|
+
import type { Console } from "node:console"
|
|
2
3
|
|
|
3
4
|
import type { Json } from "atom.io/json"
|
|
4
5
|
import { parseJson } from "atom.io/json"
|
|
@@ -19,31 +20,31 @@ export class ChildSocket<
|
|
|
19
20
|
|
|
20
21
|
public id = `#####`
|
|
21
22
|
|
|
23
|
+
public process: ChildProcessWithoutNullStreams
|
|
24
|
+
public key: string
|
|
25
|
+
public logger: Pick<Console, `error` | `info` | `warn`>
|
|
26
|
+
|
|
22
27
|
protected handleLog(arg: Json.Serializable): void {
|
|
23
28
|
if (Array.isArray(arg)) {
|
|
24
29
|
const [level, ...rest] = arg
|
|
25
30
|
switch (level) {
|
|
26
31
|
case `i`:
|
|
27
|
-
this.logger.info(
|
|
32
|
+
this.logger.info(...rest)
|
|
28
33
|
break
|
|
29
34
|
case `w`:
|
|
30
|
-
this.logger.warn(
|
|
35
|
+
this.logger.warn(...rest)
|
|
31
36
|
break
|
|
32
37
|
case `e`:
|
|
33
|
-
this.logger.error(
|
|
38
|
+
this.logger.error(...rest)
|
|
34
39
|
break
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
public constructor(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
info: (prefix: string, message: string, ...args: unknown[]) => void
|
|
44
|
-
warn: (prefix: string, message: string, ...args: unknown[]) => void
|
|
45
|
-
error: (prefix: string, message: string, ...args: unknown[]) => void
|
|
46
|
-
} = console,
|
|
45
|
+
process: ChildProcessWithoutNullStreams,
|
|
46
|
+
key: string,
|
|
47
|
+
logger?: Pick<Console, `error` | `info` | `warn`>,
|
|
47
48
|
) {
|
|
48
49
|
super((event, ...args) => {
|
|
49
50
|
const stringifiedEvent = JSON.stringify([event, ...args]) + `\x03`
|
|
@@ -60,6 +61,18 @@ export class ChildSocket<
|
|
|
60
61
|
return this
|
|
61
62
|
})
|
|
62
63
|
this.process = process
|
|
64
|
+
this.key = key
|
|
65
|
+
this.logger = logger ?? {
|
|
66
|
+
info: (...args: unknown[]) => {
|
|
67
|
+
console.info(this.id, this.key, ...args)
|
|
68
|
+
},
|
|
69
|
+
warn: (...args: unknown[]) => {
|
|
70
|
+
console.warn(this.id, this.key, ...args)
|
|
71
|
+
},
|
|
72
|
+
error: (...args: unknown[]) => {
|
|
73
|
+
console.error(this.id, this.key, ...args)
|
|
74
|
+
},
|
|
75
|
+
}
|
|
63
76
|
this.process.stdout.on(
|
|
64
77
|
`data`,
|
|
65
78
|
<Event extends keyof I>(buffer: EventBuffer<string, I[Event]>) => {
|