@livestore/solid 0.4.0-dev.14 → 0.4.0-dev.16
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/.tsbuildinfo +1 -1
- package/dist/store.d.ts +2 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +7 -5
- package/dist/store.js.map +1 -1
- package/package.json +4 -4
- package/src/store.ts +18 -6
package/dist/store.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { LogConfig } from '@livestore/common';
|
|
1
2
|
import type { CreateStoreOptions, LiveStoreSchema, Store } from '@livestore/livestore';
|
|
2
3
|
import * as Solid from 'solid-js';
|
|
3
4
|
export declare const storeToExport: Solid.Accessor<Store<any, {}> | undefined>, setStoreToExport: Solid.Setter<Store<any, {}> | undefined>;
|
|
4
|
-
export declare const getStore: <Schema extends LiveStoreSchema>({ adapter, schema, storeId, }: Pick<CreateStoreOptions<Schema>, "schema" | "adapter" | "storeId">) => Promise<Solid.Accessor<Store<Schema> | undefined>>;
|
|
5
|
+
export declare const getStore: <Schema extends LiveStoreSchema>({ adapter, schema, storeId, logger, logLevel, }: Pick<CreateStoreOptions<Schema>, "schema" | "adapter" | "storeId"> & LogConfig.WithLoggerOptions) => Promise<Solid.Accessor<Store<Schema> | undefined>>;
|
|
5
6
|
//# sourceMappingURL=store.d.ts.map
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAIV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAEV,kBAAkB,EAClB,eAAe,EAEf,KAAK,EAEN,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AA4CjC,eAAO,MAAO,aAAa,8CAAE,gBAAgB,0CAGe,CAAA;AA2G5D,eAAO,MAAM,QAAQ,GAAU,MAAM,SAAS,eAAe,EAAE,iDAM5D,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC,iBAAiB,KAAG,OAAO,CAC3G,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAgB1C,CAAA"}
|
package/dist/store.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { provideOtel, StoreInterrupted } from '@livestore/common';
|
|
1
|
+
import { LogConfig, provideOtel, StoreInterrupted, } from '@livestore/common';
|
|
2
2
|
import { createStore, makeShutdownDeferred } from '@livestore/livestore';
|
|
3
3
|
import { LS_DEV, omitUndefineds } from '@livestore/utils';
|
|
4
|
-
import { Cause, Deferred, Effect, Exit, identity,
|
|
4
|
+
import { Cause, Deferred, Effect, Exit, identity, Scope, TaskTracing } from '@livestore/utils/effect';
|
|
5
5
|
import * as Solid from 'solid-js';
|
|
6
6
|
const interrupt = (componentScope, shutdownDeferred, error) => Effect.gen(function* () {
|
|
7
7
|
// console.log('[@livestore/livestore/solid] interupting', error)
|
|
@@ -27,7 +27,7 @@ const [, setInternalStore] = Solid.createSignal(storeValue);
|
|
|
27
27
|
// TODO remove `any` store type
|
|
28
28
|
// this will require fixing: error TS2742: The inferred type of 'storeToExport' cannot be named without a reference to '../node_modules/@livestore/common/src/schema/state/sqlite/db-schema/dsl/mod.ts'. This is likely not portable. A type annotation is necessary.
|
|
29
29
|
export const [storeToExport, setStoreToExport] = Solid.createSignal();
|
|
30
|
-
const setupStore = async ({ schema, storeId, boot, adapter, batchUpdates, disableDevtools, signal, setupDone, }) => {
|
|
30
|
+
const setupStore = async ({ schema, storeId, boot, adapter, batchUpdates, disableDevtools, signal, setupDone, logger, logLevel, }) => {
|
|
31
31
|
Solid.createEffect(() => {
|
|
32
32
|
const counter = storeValue.counter;
|
|
33
33
|
const setContextValue = (value) => {
|
|
@@ -73,7 +73,7 @@ const setupStore = async ({ schema, storeId, boot, adapter, batchUpdates, disabl
|
|
|
73
73
|
}).pipe(Scope.extend(componentScope), Effect.forkIn(componentScope));
|
|
74
74
|
const shutdownContext = (cause) => Effect.sync(() => setContextValue({ stage: 'shutdown', cause }));
|
|
75
75
|
yield* Deferred.await(shutdownDeferred).pipe(Effect.tapErrorCause((cause) => Effect.logDebug('[@livestore/livestore/solid] shutdown', Cause.pretty(cause))), Effect.tap((intentionalShutdown) => shutdownContext(intentionalShutdown)), Effect.catchTag('InvalidPullError', (cause) => shutdownContext(cause)), Effect.catchTag('InvalidPushError', (cause) => shutdownContext(cause)), Effect.catchTag('LiveStore.StoreInterrupted', (cause) => shutdownContext(cause)), Effect.tapError((error) => Effect.sync(() => setContextValue({ stage: 'error', error }))), Effect.tapDefect((defect) => Effect.sync(() => setContextValue({ stage: 'error', error: defect }))), Effect.exit);
|
|
76
|
-
}).pipe(Effect.scoped, withSemaphore(storeId), Effect.withSpan('@livestore/solid:setupStore'), LS_DEV ? TaskTracing.withAsyncTaggingTracing((name) => console.createTask(name)) : identity, provideOtel({}), Effect.tapCauseLogPretty, Effect.annotateLogs({ thread: 'window' }),
|
|
76
|
+
}).pipe(Effect.scoped, withSemaphore(storeId), Effect.withSpan('@livestore/solid:setupStore'), LS_DEV ? TaskTracing.withAsyncTaggingTracing((name) => console.createTask(name)) : identity, provideOtel({}), Effect.tapCauseLogPretty, Effect.annotateLogs({ thread: 'window' }), LogConfig.withLoggerConfig({ logger, logLevel }, { threadName: 'window' }), Effect.runFork);
|
|
77
77
|
Solid.onCleanup(() => {
|
|
78
78
|
if (storeValue.componentScope !== undefined && storeValue.shutdownDeferred !== undefined) {
|
|
79
79
|
interrupt(storeValue.componentScope, storeValue.shutdownDeferred, new StoreInterrupted({ reason: 'unmounting component' }));
|
|
@@ -83,12 +83,14 @@ const setupStore = async ({ schema, storeId, boot, adapter, batchUpdates, disabl
|
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
export const getStore = async ({ adapter, schema, storeId, }) => {
|
|
86
|
+
export const getStore = async ({ adapter, schema, storeId, logger, logLevel, }) => {
|
|
87
87
|
const setupDone = Promise.withResolvers();
|
|
88
88
|
await setupStore({
|
|
89
89
|
adapter,
|
|
90
90
|
schema,
|
|
91
91
|
storeId,
|
|
92
|
+
logger,
|
|
93
|
+
logLevel,
|
|
92
94
|
setupDone: setupDone.resolve,
|
|
93
95
|
});
|
|
94
96
|
await setupDone.promise;
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,WAAW,EACX,gBAAgB,GAEjB,MAAM,mBAAmB,CAAA;AAS1B,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrG,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AAEjC,MAAM,SAAS,GAAG,CAAC,cAAoC,EAAE,gBAAkC,EAAE,KAAuB,EAAE,EAAE,CACtH,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,iEAAiE;IACjE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IACpD,KAAK,CAAC,CAAC,QAAQ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UAAU,EAAE,QAAQ,EAAE,CAAC,EAC1E,MAAM,CAAC,OAAO,CACf,CAAA;QAED,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;YACnB,IAAI,UAAU,CAAC,cAAc,KAAK,SAAS,IAAI,UAAU,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACzF,SAAS,CACP,UAAU,CAAC,cAAc,EACzB,UAAU,CAAC,gBAAgB,EAC3B,IAAI,gBAAgB,CAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,CACzD,CAAA;gBACD,UAAU,CAAC,cAAc,GAAG,SAAS,CAAA;gBACrC,UAAU,CAAC,gBAAgB,GAAG,SAAS,CAAA;YACzC,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAkC,EAC7D,OAAO,EACP,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,GACyF,EAEjG,EAAE;IACF,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,EAAQ,CAAA;IAE/C,MAAM,UAAU,CAAC;QACf,OAAO;QACP,MAAM;QACN,OAAO;QACP,MAAM;QACN,QAAQ;QACR,SAAS,EAAE,SAAS,CAAC,OAAO;KAC7B,CAAC,CAAA;IAEF,MAAM,SAAS,CAAC,OAAO,CAAA;IAEvB,OAAO,aAAyD,CAAA;AAClE,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/solid",
|
|
3
|
-
"version": "0.4.0-dev.
|
|
3
|
+
"version": "0.4.0-dev.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/mod.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@opentelemetry/api": "1.9.0",
|
|
10
|
-
"@livestore/
|
|
11
|
-
"@livestore/
|
|
12
|
-
"@livestore/utils": "0.4.0-dev.
|
|
10
|
+
"@livestore/livestore": "0.4.0-dev.16",
|
|
11
|
+
"@livestore/common": "0.4.0-dev.16",
|
|
12
|
+
"@livestore/utils": "0.4.0-dev.16"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@opentelemetry/sdk-trace-base": "^2.0.1",
|
package/src/store.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type IntentionalShutdownCause,
|
|
3
|
+
LogConfig,
|
|
4
|
+
provideOtel,
|
|
5
|
+
StoreInterrupted,
|
|
6
|
+
type SyncError,
|
|
7
|
+
} from '@livestore/common'
|
|
2
8
|
import type {
|
|
3
9
|
BootStatus,
|
|
4
10
|
CreateStoreOptions,
|
|
@@ -9,7 +15,7 @@ import type {
|
|
|
9
15
|
} from '@livestore/livestore'
|
|
10
16
|
import { createStore, makeShutdownDeferred } from '@livestore/livestore'
|
|
11
17
|
import { LS_DEV, omitUndefineds } from '@livestore/utils'
|
|
12
|
-
import { Cause, Deferred, Effect, Exit, identity,
|
|
18
|
+
import { Cause, Deferred, Effect, Exit, identity, Scope, TaskTracing } from '@livestore/utils/effect'
|
|
13
19
|
import * as Solid from 'solid-js'
|
|
14
20
|
|
|
15
21
|
const interrupt = (componentScope: Scope.CloseableScope, shutdownDeferred: ShutdownDeferred, error: StoreInterrupted) =>
|
|
@@ -68,7 +74,10 @@ const setupStore = async ({
|
|
|
68
74
|
disableDevtools,
|
|
69
75
|
signal,
|
|
70
76
|
setupDone,
|
|
71
|
-
|
|
77
|
+
logger,
|
|
78
|
+
logLevel,
|
|
79
|
+
}: CreateStoreOptions<LiveStoreSchema> &
|
|
80
|
+
LogConfig.WithLoggerOptions & { signal?: AbortSignal; setupDone: () => void }) => {
|
|
72
81
|
Solid.createEffect(() => {
|
|
73
82
|
const counter = storeValue.counter
|
|
74
83
|
|
|
@@ -143,8 +152,7 @@ const setupStore = async ({
|
|
|
143
152
|
provideOtel({}),
|
|
144
153
|
Effect.tapCauseLogPretty,
|
|
145
154
|
Effect.annotateLogs({ thread: 'window' }),
|
|
146
|
-
|
|
147
|
-
Logger.withMinimumLogLevel(LogLevel.Debug),
|
|
155
|
+
LogConfig.withLoggerConfig({ logger, logLevel }, { threadName: 'window' }),
|
|
148
156
|
Effect.runFork,
|
|
149
157
|
)
|
|
150
158
|
|
|
@@ -166,7 +174,9 @@ export const getStore = async <Schema extends LiveStoreSchema>({
|
|
|
166
174
|
adapter,
|
|
167
175
|
schema,
|
|
168
176
|
storeId,
|
|
169
|
-
|
|
177
|
+
logger,
|
|
178
|
+
logLevel,
|
|
179
|
+
}: Pick<CreateStoreOptions<Schema>, 'schema' | 'adapter' | 'storeId'> & LogConfig.WithLoggerOptions): Promise<
|
|
170
180
|
Solid.Accessor<Store<Schema> | undefined>
|
|
171
181
|
> => {
|
|
172
182
|
const setupDone = Promise.withResolvers<void>()
|
|
@@ -175,6 +185,8 @@ export const getStore = async <Schema extends LiveStoreSchema>({
|
|
|
175
185
|
adapter,
|
|
176
186
|
schema,
|
|
177
187
|
storeId,
|
|
188
|
+
logger,
|
|
189
|
+
logLevel,
|
|
178
190
|
setupDone: setupDone.resolve,
|
|
179
191
|
})
|
|
180
192
|
|