From ec1b66e48c826f82087a3c86f60e6b2beb33b6ae Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 9 Feb 2024 22:14:43 +1300 Subject: [PATCH] update effect --- .changeset/rare-teachers-swim.md | 7 + .changeset/red-apples-trade.md | 7 + package.json | 6 +- packages/rx-react/package.json | 6 +- packages/rx-react/src/index.ts | 24 +-- packages/rx-vue/package.json | 6 +- packages/rx/package.json | 4 +- packages/rx/src/Result.ts | 88 ++++----- packages/rx/src/Rx.ts | 256 ++++++++++++------------ packages/rx/src/internal/registry.ts | 4 +- packages/rx/src/internal/runtime.ts | 4 +- packages/rx/test/Rx.test.ts | 16 +- pnpm-lock.yaml | 285 ++++++++++++++------------- 13 files changed, 370 insertions(+), 343 deletions(-) create mode 100644 .changeset/rare-teachers-swim.md create mode 100644 .changeset/red-apples-trade.md diff --git a/.changeset/rare-teachers-swim.md b/.changeset/rare-teachers-swim.md new file mode 100644 index 0000000..9713343 --- /dev/null +++ b/.changeset/rare-teachers-swim.md @@ -0,0 +1,7 @@ +--- +"@effect-rx/rx-react": minor +"@effect-rx/rx-vue": minor +"@effect-rx/rx": minor +--- + +swap type params for Result diff --git a/.changeset/red-apples-trade.md b/.changeset/red-apples-trade.md new file mode 100644 index 0000000..fdb7e4d --- /dev/null +++ b/.changeset/red-apples-trade.md @@ -0,0 +1,7 @@ +--- +"@effect-rx/rx-react": minor +"@effect-rx/rx-vue": minor +"@effect-rx/rx": minor +--- + +update effect diff --git a/package.json b/package.json index 84c6722..d39cb79 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "@effect/docgen": "^0.3.8", "@effect/eslint-plugin": "^0.1.2", "@effect/language-service": "^0.1.0", - "@typescript-eslint/eslint-plugin": "^6.20.0", - "@typescript-eslint/parser": "^6.20.0", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", "@vitest/coverage-v8": "^1.2.2", "babel-plugin-annotate-pure-calls": "^0.4.0", "eslint": "^8.56.0", @@ -37,7 +37,7 @@ "eslint-plugin-codegen": "^0.23.0", "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-simple-import-sort": "^10.0.0", + "eslint-plugin-simple-import-sort": "^11.0.0", "eslint-plugin-sort-destructure-keys": "^1.5.0", "fast-check": "^3.15.1", "glob": "^10.3.10", diff --git a/packages/rx-react/package.json b/packages/rx-react/package.json index b99cecb..63e6c2f 100644 --- a/packages/rx-react/package.json +++ b/packages/rx-react/package.json @@ -23,12 +23,12 @@ "license": "MIT", "sideEffects": false, "devDependencies": { - "@types/react": "^18.2.52", - "effect": "^2.2.3", + "@types/react": "^18.2.55", + "effect": "^2.3.0", "react": "^18.2.0" }, "peerDependencies": { - "effect": "^2.2.0", + "effect": "^2.3.0", "react": "^18" }, "dependencies": { diff --git a/packages/rx-react/src/index.ts b/packages/rx-react/src/index.ts index 56f2ace..e1c1f4f 100644 --- a/packages/rx-react/src/index.ts +++ b/packages/rx-react/src/index.ts @@ -103,8 +103,8 @@ function setRx(registry: Registry.Registry, rx: Rx.Writable): (_: W function setRxPromise( registry: Registry.Registry, - rx: Rx.Writable, W> -): (_: W) => Promise> { + rx: Rx.Writable, W> +): (_: W) => Promise> { const cancelRef = React.useRef void>>(undefined as any) if (!cancelRef.current) { cancelRef.current = new Set() @@ -159,8 +159,8 @@ export const useRxSet = (rx: Rx.Writable): (_: W | ((_: R) => W)) => * @category hooks */ export const useRxSetPromise = ( - rx: Rx.Writable, W> -): (_: W) => Promise> => { + rx: Rx.Writable, W> +): (_: W) => Promise> => { const registry = React.useContext(RegistryContext) return setRxPromise(registry, rx) } @@ -191,14 +191,14 @@ export const useRx = ( ] as const } -type SuspenseResult = +type SuspenseResult = | { readonly _tag: "Suspended" readonly promise: Promise } | { readonly _tag: "Value" - readonly value: Result.Success | Result.Failure + readonly value: Result.Success | Result.Failure } const suspenseRx = Rx.family((rx: Rx.Rx>) => @@ -233,10 +233,10 @@ const suspenseMounts = globalValue("@effect-rx/rx-react/suspenseMounts", () => n * @since 1.0.0 * @category hooks */ -export const useRxSuspense = ( - rx: Rx.Rx>, +export const useRxSuspense = ( + rx: Rx.Rx>, options?: { readonly suspendOnWaiting?: boolean } -): Result.Success | Result.Failure => { +): Result.Success | Result.Failure => { const registry = React.useContext(RegistryContext) const resultRx = React.useMemo( () => (options?.suspendOnWaiting ? suspenseRxWaiting(rx) : suspenseRx(rx)), @@ -264,10 +264,10 @@ export const useRxSuspense = ( * @since 1.0.0 * @category hooks */ -export const useRxSuspenseSuccess = ( - rx: Rx.Rx>, +export const useRxSuspenseSuccess = ( + rx: Rx.Rx>, options?: { readonly suspendOnWaiting?: boolean } -): Result.Success => { +): Result.Success => { const result = useRxSuspense(rx, options) if (result._tag === "Failure") { throw Cause.squash(result.cause) diff --git a/packages/rx-vue/package.json b/packages/rx-vue/package.json index fb0bd4c..b06a7d3 100644 --- a/packages/rx-vue/package.json +++ b/packages/rx-vue/package.json @@ -23,11 +23,11 @@ "license": "MIT", "sideEffects": false, "devDependencies": { - "effect": "^2.2.3", - "vue": "^3.4.15" + "effect": "^2.3.0", + "vue": "^3.4.18" }, "peerDependencies": { - "effect": "^2.2.0", + "effect": "^2.3.0", "vue": "^3.4" }, "dependencies": { diff --git a/packages/rx/package.json b/packages/rx/package.json index c074baf..d78e985 100644 --- a/packages/rx/package.json +++ b/packages/rx/package.json @@ -24,9 +24,9 @@ "license": "MIT", "sideEffects": false, "devDependencies": { - "effect": "^2.2.3" + "effect": "^2.3.0" }, "peerDependencies": { - "effect": "^2.2.0" + "effect": "^2.3.0" } } diff --git a/packages/rx/src/Result.ts b/packages/rx/src/Result.ts index 79fcebb..c5fd535 100644 --- a/packages/rx/src/Result.ts +++ b/packages/rx/src/Result.ts @@ -24,7 +24,7 @@ export type TypeId = typeof TypeId * @since 1.0.0 * @category models */ -export type Result = Initial | Success | Failure +export type Result = Initial | Success | Failure /** * @since 1.0.0 @@ -35,7 +35,7 @@ export declare namespace Result { * @since 1.0.0 * @category models */ - export interface Proto extends Pipeable, Data.Case { + export interface Proto extends Pipeable { readonly [TypeId]: { readonly E: (_: never) => E readonly A: (_: never) => A @@ -46,19 +46,19 @@ export declare namespace Result { /** * @since 1.0.0 */ - export type InferA> = R extends Result ? A : never + export type InferA> = R extends Result ? A : never /** * @since 1.0.0 */ - export type InferE> = R extends Result ? E : never + export type InferE> = R extends Result ? E : never /** * @since 1.0.0 */ - export type With, E, A> = R extends Initial ? Initial - : R extends Success ? Success - : R extends Failure ? Failure + export type With, A, E> = R extends Initial ? Initial + : R extends Success ? Success + : R extends Failure ? Failure : never } @@ -76,7 +76,7 @@ const ResultProto = Data.struct({ * @since 1.0.0 * @category models */ -export interface Initial extends Result.Proto { +export interface Initial extends Result.Proto { readonly _tag: "Initial" } @@ -84,24 +84,24 @@ export interface Initial extends Result.Proto { * @since 1.0.0 * @category constructors */ -export const fromExit = (exit: Exit.Exit): Success | Failure => +export const fromExit = (exit: Exit.Exit): Success | Failure => exit._tag === "Success" ? success(exit.value) : failure(exit.cause) /** * @since 1.0.0 * @category constructors */ -export const fromExitWithPrevious = ( - exit: Exit.Exit, - previous: Option.Option> -): Success | Failure => +export const fromExitWithPrevious = ( + exit: Exit.Exit, + previous: Option.Option> +): Success | Failure => exit._tag === "Success" ? success(exit.value) : failureWithPrevious(exit.cause, previous) /** * @since 1.0.0 * @category constructors */ -export const waitingFrom = (previous: Option.Option>): Result => { +export const waitingFrom = (previous: Option.Option>): Result => { if (previous._tag === "None") { return initial(true) } @@ -112,20 +112,20 @@ export const waitingFrom = (previous: Option.Option>): Result * @since 1.0.0 * @category refinements */ -export const isInitial = (result: Result): result is Initial => result._tag === "Initial" +export const isInitial = (result: Result): result is Initial => result._tag === "Initial" /** * @since 1.0.0 * @category refinements */ -export const isNotInitial = (result: Result): result is Success | Failure => +export const isNotInitial = (result: Result): result is Success | Failure => result._tag !== "Initial" /** * @since 1.0.0 * @category constructors */ -export const initial = (waiting = false): Initial => { +export const initial = (waiting = false): Initial => { const result = Object.create(ResultProto) result._tag = "Initial" result.waiting = waiting @@ -136,7 +136,7 @@ export const initial = (waiting = false): Initial => { * @since 1.0.0 * @category models */ -export interface Success extends Result.Proto { +export interface Success extends Result.Proto { readonly _tag: "Success" readonly value: A } @@ -145,13 +145,13 @@ export interface Success extends Result.Proto { * @since 1.0.0 * @category refinements */ -export const isSuccess = (result: Result): result is Success => result._tag === "Success" +export const isSuccess = (result: Result): result is Success => result._tag === "Success" /** * @since 1.0.0 * @category constructors */ -export const success = (value: A, waiting = false): Success => { +export const success = (value: A, waiting = false): Success => { const result = Object.create(ResultProto) result._tag = "Success" result.value = value @@ -163,7 +163,7 @@ export const success = (value: A, waiting = false): Success => { * @since 1.0.0 * @category models */ -export interface Failure extends Result.Proto { +export interface Failure extends Result.Proto { readonly _tag: "Failure" readonly cause: Cause.Cause readonly previousValue: Option.Option @@ -173,24 +173,24 @@ export interface Failure extends Result.Proto { * @since 1.0.0 * @category refinements */ -export const isFailure = (result: Result): result is Failure => result._tag === "Failure" +export const isFailure = (result: Result): result is Failure => result._tag === "Failure" /** * @since 1.0.0 * @category refinements */ -export const isInterrupted = (result: Result): result is Failure => +export const isInterrupted = (result: Result): result is Failure => result._tag === "Failure" && Cause.isInterruptedOnly(result.cause) /** * @since 1.0.0 * @category constructors */ -export const failure = ( +export const failure = ( cause: Cause.Cause, previousValue: Option.Option = Option.none(), waiting = false -): Failure => { +): Failure => { const result = Object.create(ResultProto) result._tag = "Failure" result.cause = cause @@ -203,28 +203,28 @@ export const failure = ( * @since 1.0.0 * @category constructors */ -export const failureWithPrevious = ( +export const failureWithPrevious = ( cause: Cause.Cause, - previous: Option.Option>, + previous: Option.Option>, waiting = false -): Failure => failure(cause, Option.flatMap(previous, value), waiting) +): Failure => failure(cause, Option.flatMap(previous, value), waiting) /** * @since 1.0.0 * @category constructors */ -export const fail = (error: E, previousData?: Option.Option, waiting?: boolean): Failure => +export const fail = (error: E, previousData?: Option.Option, waiting?: boolean): Failure => failure(Cause.fail(error), previousData, waiting) /** * @since 1.0.0 * @category constructors */ -export const failWithPrevious = ( +export const failWithPrevious = ( error: E, - previous: Option.Option>, + previous: Option.Option>, waiting?: boolean -): Failure => fail(error, Option.flatMap(previous, value), waiting) +): Failure => fail(error, Option.flatMap(previous, value), waiting) /** * @since 1.0.0 @@ -245,8 +245,8 @@ export const waiting = >(self: R): R => { */ export const replacePrevious = , XE, A>( self: R, - previous: Option.Option> -): Result.With, A> => { + previous: Option.Option> +): Result.With> => { if (self._tag === "Failure") { return failureWithPrevious(self.cause, previous, self.waiting) as any } @@ -257,7 +257,7 @@ export const replacePrevious = , XE, A>( * @since 1.0.0 * @category accessors */ -export const value = (self: Result): Option.Option => { +export const value = (self: Result): Option.Option => { if (self._tag === "Success") { return Option.some(self.value) } else if (self._tag === "Failure") { @@ -270,7 +270,7 @@ export const value = (self: Result): Option.Option => { * @since 1.0.0 * @category accessors */ -export const cause = (self: Result): Option.Option> => { +export const cause = (self: Result): Option.Option> => { if (self._tag === "Failure") { return Option.some(self.cause) } @@ -281,9 +281,9 @@ export const cause = (self: Result): Option.Option> = * @since 1.0.0 * @category combinators */ -export const toExit = ( - self: Result -): Exit.Exit => { +export const toExit = ( + self: Result +): Exit.Exit => { switch (self._tag) { case "Success": { return Exit.succeed(self.value) @@ -301,13 +301,13 @@ export const toExit = ( * @since 1.0.0 * @category combinators */ -export const map = dual< - (f: (a: A) => B) => (self: Result) => Result, - (self: Result, f: (a: A) => B) => Result ->(2, (self: Result, f: (a: A) => B): Result => { +export const map: { + (f: (a: A) => B): (self: Result) => Result + (self: Result, f: (a: A) => B): Result +} = dual(2, (self: Result, f: (a: A) => B): Result => { switch (self._tag) { case "Initial": - return self as any as Result + return self as any as Result case "Failure": return failure(self.cause, Option.map(self.previousValue, f), self.waiting) case "Success": diff --git a/packages/rx/src/Rx.ts b/packages/rx/src/Rx.ts index 6343c40..a756dc1 100644 --- a/packages/rx/src/Rx.ts +++ b/packages/rx/src/Rx.ts @@ -87,7 +87,7 @@ export declare namespace Rx { * @since 1.0.0 * @category models */ - export type GetResult = (rx: Rx>) => Exit.Exit + export type GetResult = (rx: Rx>) => Exit.Exit /** * @since 1.0.0 @@ -99,7 +99,7 @@ export declare namespace Rx { * @since 1.0.0 * @category models */ - export type SetEffect = (rx: Writable, value: W) => Effect.Effect + export type SetEffect = (rx: Writable, value: W) => Effect.Effect /** * @since 1.0.0 @@ -111,7 +111,7 @@ export declare namespace Rx { * @since 1.0.0 * @category models */ - export type RefreshRx = (rx: Rx & Refreshable) => Effect.Effect + export type RefreshRx = (rx: Rx & Refreshable) => Effect.Effect /** * @since 1.0.0 @@ -181,27 +181,27 @@ export interface Writable extends Rx { export interface Context { (rx: Rx): A readonly get: (rx: Rx) => A - readonly result: (rx: Rx>) => Exit.Exit + readonly result: (rx: Rx>) => Exit.Exit readonly once: (rx: Rx) => A readonly addFinalizer: (f: () => void) => void readonly mount: (rx: Rx) => void readonly refreshSync: (rx: Rx & Refreshable) => void - readonly refresh: (rx: Rx & Refreshable) => Effect.Effect + readonly refresh: (rx: Rx & Refreshable) => Effect.Effect readonly refreshSelfSync: () => void - readonly refreshSelf: Effect.Effect + readonly refreshSelf: Effect.Effect readonly self: () => Option.Option readonly setSelfSync: (a: A) => void - readonly setSelf: (a: A) => Effect.Effect + readonly setSelf: (a: A) => Effect.Effect readonly setSync: (rx: Writable, value: W) => void - readonly set: (rx: Writable, value: W) => Effect.Effect + readonly set: (rx: Writable, value: W) => Effect.Effect readonly stream: (rx: Rx, options?: { readonly withoutInitialValue?: boolean readonly bufferSize?: number - }) => Stream.Stream - readonly streamResult: (rx: Rx>, options?: { + }) => Stream.Stream + readonly streamResult: (rx: Rx>, options?: { readonly withoutInitialValue?: boolean readonly bufferSize?: number - }) => Stream.Stream + }) => Stream.Stream readonly subscribe: (rx: Rx, f: (_: A) => void, options?: { readonly immediate?: boolean }) => void @@ -341,18 +341,18 @@ function constSetSelf(ctx: WriteContext, value: A) { * @category constructors */ export const make: { - (effect: Effect.Effect, options?: { + (effect: Effect.Effect, options?: { readonly initialValue?: A - }): Rx> - (create: Rx.Read>, options?: { + }): Rx> + (create: Rx.Read>, options?: { readonly initialValue?: A - }): Rx> - (stream: Stream.Stream, options?: { + }): Rx> + (stream: Stream.Stream, options?: { readonly initialValue?: A - }): Rx> - (create: Rx.Read>, options?: { + }): Rx> + (create: Rx.Read>, options?: { readonly initialValue?: A - }): Rx> + }): Rx> (create: Rx.Read): Rx (initialValue: A): Writable } = (arg: any, options?: { readonly initialValue?: unknown }) => { @@ -372,26 +372,26 @@ const isDataType = (u: object): u is Option.Option | Either.Either(effect: Effect.Effect, options?: { + (effect: Effect.Effect, options?: { readonly initialValue?: A - }): (get: Context, runtime?: Runtime.Runtime) => Result.Result - (create: Rx.Read>, options?: { + }): (get: Context, runtime?: Runtime.Runtime) => Result.Result + (create: Rx.Read>, options?: { readonly initialValue?: A - }): (get: Context, runtime?: Runtime.Runtime) => Result.Result - (stream: Stream.Stream, options?: { + }): (get: Context, runtime?: Runtime.Runtime) => Result.Result + (stream: Stream.Stream, options?: { readonly initialValue?: A - }): (get: Context, runtime?: Runtime.Runtime) => Result.Result - (create: Rx.Read>, options?: { + }): (get: Context, runtime?: Runtime.Runtime) => Result.Result + (create: Rx.Read>, options?: { readonly initialValue?: A - }): (get: Context, runtime?: Runtime.Runtime) => Result.Result + }): (get: Context, runtime?: Runtime.Runtime) => Result.Result (create: Rx.Read): (get: Context, runtime?: Runtime.Runtime) => A (initialValue: A): Writable -} = ( +} = ( arg: - | Effect.Effect - | Rx.Read> - | Stream.Stream - | Rx.Read> + | Effect.Effect + | Rx.Read> + | Stream.Stream + | Rx.Read> | Rx.Read | A, options?: { readonly initialValue?: unknown } @@ -435,25 +435,25 @@ const state = ( return initialValue }, constSetSelf) -const effect = ( +const effect = ( get: Context, - effect: Effect.Effect, + effect: Effect.Effect, options?: { readonly initialValue?: A }, runtime?: Runtime.Runtime -): Result.Result => { +): Result.Result => { const initialValue = options?.initialValue !== undefined - ? Result.success(options.initialValue) - : Result.initial() + ? Result.success(options.initialValue) + : Result.initial() return makeEffect(get, effect, initialValue, runtime) } -function makeEffect( +function makeEffect( ctx: Context, - effect: Effect.Effect, - initialValue: Result.Result, + effect: Effect.Effect, + initialValue: Result.Result, runtime = Runtime.defaultRuntime -): Result.Result { - const previous = ctx.self>() +): Result.Result { + const previous = ctx.self>() const scope = Effect.runSync(Scope.make()) ctx.addFinalizer(() => { @@ -484,34 +484,34 @@ function makeEffect( * @since 1.0.0 * @category models */ -export interface RxRuntime extends Rx>> { - readonly layer: Rx> +export interface RxRuntime extends Rx, ER>> { + readonly layer: Rx> readonly rx: { - (effect: Effect.Effect, options?: { + (effect: Effect.Effect, options?: { readonly initialValue?: A - }): Rx> - (create: Rx.Read>, options?: { + }): Rx> + (create: Rx.Read>, options?: { readonly initialValue?: A - }): Rx> - (stream: Stream.Stream, options?: { + }): Rx> + (stream: Stream.Stream, options?: { readonly initialValue?: A - }): Rx> - (create: Rx.Read>, options?: { + }): Rx> + (create: Rx.Read>, options?: { readonly initialValue?: A - }): Rx> + }): Rx> } readonly fn: { - (fn: Rx.ReadFn>, options?: { + (fn: Rx.ReadFn>, options?: { readonly initialValue?: A }): RxResultFn extends true ? void : Arg> - (fn: Rx.ReadFn>, options?: { + (fn: Rx.ReadFn>, options?: { readonly initialValue?: A }): RxResultFn extends true ? void : Arg> } - readonly pull: (create: Rx.Read> | Stream.Stream, options?: { + readonly pull: (create: Rx.Read> | Stream.Stream, options?: { readonly disableAccumulation?: boolean readonly initialValue?: ReadonlyArray }) => Writable, void> @@ -521,11 +521,11 @@ export interface RxRuntime extends Rx ( - create: Layer.Layer | Rx.Read> -) => RxRuntime = () => { +export const context: () => ( + create: Layer.Layer | Rx.Read> +) => RxRuntime = () => { const memoMapRx = make(Layer.makeMemoMap) - return (create: Layer.Layer | Rx.Read>): RxRuntime => { + return (create: Layer.Layer | Rx.Read>): RxRuntime => { const rx = Object.create(RxRuntimeProto) rx.keepAlive = false rx.refresh = undefined @@ -555,33 +555,34 @@ export const context: () => ( * @since 1.0.0 * @category context */ -export const runtime: ( - create: Layer.Layer | Rx.Read> -) => RxRuntime = globalValue("@effect-rx/rx/Rx/defaultContext", () => context()) +export const runtime: (create: Layer.Layer | Rx.Read>) => RxRuntime = globalValue( + "@effect-rx/rx/Rx/defaultContext", + () => context() +) // ----------------------------------------------------------------------------- // constructors - stream // ----------------------------------------------------------------------------- -const stream = ( +const stream = ( get: Context, - stream: Stream.Stream, + stream: Stream.Stream, options?: { readonly initialValue?: A }, runtime?: Runtime.Runtime -): Result.Result => { +): Result.Result => { const initialValue = options?.initialValue !== undefined - ? Result.success(options.initialValue) - : Result.initial() + ? Result.success(options.initialValue) + : Result.initial() return makeStream(get, stream, initialValue, runtime) } -function makeStream( +function makeStream( ctx: Context, - stream: Stream.Stream, - initialValue: Result.Result, + stream: Stream.Stream, + initialValue: Result.Result, runtime = Runtime.defaultRuntime -): Result.Result { - const previous = ctx.self>() +): Result.Result { + const previous = ctx.self>() const cancel = runCallbackSync(runtime)( Stream.runForEach( @@ -593,7 +594,7 @@ function makeStream( ctx.setSelfSync(Result.failureWithPrevious(exit.cause, previous)) } else { pipe( - ctx.self>(), + ctx.self>(), Option.flatMap(Result.value), Option.match({ onNone: () => ctx.setSelfSync(Result.failWithPrevious(new NoSuchElementException(), previous)), @@ -621,7 +622,7 @@ function makeStream( * @since 1.0.0 * @category models */ -export interface RxResultFn extends Writable, Arg> {} +export interface RxResultFn extends Writable, Arg> {} /** * @since 1.0.0 @@ -656,29 +657,29 @@ export const fnSync: { * @category constructors */ export const fn: { - (fn: Rx.ReadFn>, options?: { + (fn: Rx.ReadFn>, options?: { readonly initialValue?: A - }): RxResultFn extends true ? void : Arg> - (fn: Rx.ReadFn>, options?: { + }): RxResultFn extends true ? void : Arg, A, E> + (fn: Rx.ReadFn>, options?: { readonly initialValue?: A - }): RxResultFn extends true ? void : Arg> -} = (f: Rx.ReadFn | Effect.Effect>, options?: { + }): RxResultFn extends true ? void : Arg, A, E | NoSuchElementException> +} = (f: Rx.ReadFn | Effect.Effect>, options?: { readonly initialValue?: A -}): RxResultFn extends true ? void : Arg> => { +}): RxResultFn extends true ? void : Arg, A, E | NoSuchElementException> => { const [read, write] = makeResultFn(f, options) return writable(read, write) as any } function makeResultFn( - f: Rx.ReadFn | Stream.Stream>, + f: Rx.ReadFn | Stream.Stream>, options?: { readonly initialValue?: A } ) { const argRx = state<[number, Arg]>([0, undefined as any]) const initialValue = options?.initialValue !== undefined - ? Result.success(options.initialValue) - : Result.initial() + ? Result.success(options.initialValue) + : Result.initial() - function read(get: Context, runtime?: Runtime.Runtime): Result.Result { + function read(get: Context, runtime?: Runtime.Runtime): Result.Result { const [counter, arg] = get(argRx) if (counter === 0) { return initialValue @@ -689,7 +690,7 @@ function makeResultFn( } return makeStream(get, value, initialValue, runtime) } - function write(ctx: WriteContext>, arg: Arg) { + function write(ctx: WriteContext>, arg: Arg) { ctx.set(argRx, [ctx.get(argRx)[0] + 1, arg]) } return [read, write] as const @@ -699,19 +700,19 @@ function makeResultFn( * @since 1.0.0 * @category models */ -export type PullResult = Result.Result = Result.Result<{ readonly done: boolean readonly items: Array -}> +}, E | NoSuchElementException> /** * @since 1.0.0 * @category constructors */ -export const pull = (create: Rx.Read> | Stream.Stream, options?: { +export const pull = (create: Rx.Read> | Stream.Stream, options?: { readonly disableAccumulation?: boolean readonly initialValue?: ReadonlyArray -}): Writable, void> => { +}): Writable, void> => { const pullRx = readable( makeRead(function(get) { return makeStreamPullEffect(get, create, options) @@ -720,9 +721,9 @@ export const pull = (create: Rx.Read> | Stream. return makeStreamPull(pullRx, options) } -const makeStreamPullEffect = ( +const makeStreamPullEffect = ( get: Context, - create: Rx.Read> | Stream.Stream, + create: Rx.Read> | Stream.Stream, options?: { readonly disableAccumulation?: boolean }, runtime?: Runtime.Runtime ) => { @@ -735,24 +736,23 @@ const makeStreamPullEffect = ( ) } -const makeStreamPull = ( +const makeStreamPull = ( pullRx: Rx< Result.Result< - never, - readonly [Effect.Effect, Chunk.Chunk>, Runtime.Runtime | undefined] + readonly [Effect.Effect, Option.Option>, Runtime.Runtime | undefined] > >, options?: { readonly initialValue?: ReadonlyArray } ) => { - const initialValue: Result.Result - }> = options?.initialValue !== undefined + }, E | NoSuchElementException> = options?.initialValue !== undefined ? Result.success({ done: false, items: options.initialValue as Array }) : Result.initial() - return writable(function(get: Context): PullResult { - const previous = get.self>() + return writable(function(get: Context): PullResult { + const previous = get.self>() const pullResult = get(pullRx) if (pullResult._tag !== "Success") { return Result.replacePrevious(pullResult, previous) @@ -764,14 +764,14 @@ const makeStreamPull = ( done: false, items: Chunk.toReadonlyArray(_) as Array })), - Effect.catchAll((error): Effect.Effect - }> => + }, E | NoSuchElementException> => Option.match(error, { onNone: () => pipe( - get.self>(), + get.self>(), Option.flatMap(Result.value), Option.match({ onNone: () => Effect.fail(new NoSuchElementException()), @@ -840,33 +840,25 @@ export const family = typeof WeakRef === "undefined" || typeof FinalizationRegis */ export const withFallback: { ( - fallback: Rx> + fallback: Rx> ): >>( self: R ) => [R] extends [Writable] - ? Writable> | E2, Result.Result.InferA> | A2>, RW> - : Rx> | E2, Result.Result.InferA> | A2>> - >, E2, A2>( + ? Writable> | A2, Result.Result.InferE> | E2>, RW> + : Rx> | A2, Result.Result.InferE> | E2>> + >, A2, E2>( self: R, - fallback: Rx> + fallback: Rx> ): [R] extends [Writable] - ? Writable> | E2, Result.Result.InferA> | A2>, RW> - : Rx> | E2, Result.Result.InferA> | A2>> -} = dual< - ( - fallback: Rx> - ) => >>( - self: R - ) => [R] extends [Writable] - ? Writable> | E2, Result.Result.InferA> | A2>, RW> - : Rx> | E2, Result.Result.InferA> | A2>>, - >, E2, A2>( - self: R, - fallback: Rx> - ) => [R] extends [Writable] - ? Writable> | E2, Result.Result.InferA> | A2>, RW> - : Rx> | E2, Result.Result.InferA> | A2>> ->(2, (self, fallback) => { + ? Writable> | A2, Result.Result.InferE> | E2>, RW> + : Rx> | A2, Result.Result.InferE> | E2>> +} = dual(2, >, A2, E2>( + self: R, + fallback: Rx> +): [R] extends [Writable] + ? Writable> | A2, Result.Result.InferE> | E2>, RW> + : Rx> | A2, Result.Result.InferE> | E2>> => +{ function withFallback(get: Context) { const result = get(self) if (result._tag === "Initial") { @@ -991,19 +983,23 @@ export const map = dual< * @since 1.0.0 * @category combinators */ -export const mapResult = dual< +export const mapResult: { >, B>( f: (_: Result.Result.InferA>) => B - ) => ( + ): ( self: R - ) => [R] extends [Writable] ? Writable>, B>, RW> - : Rx>, B>>, + ) => [R] extends [Writable] ? Writable>>, RW> + : Rx>>> >, B>( self: R, f: (_: Result.Result.InferA>) => B - ) => [R] extends [Writable] ? Writable>, B>, RW> - : Rx>, B>> ->(2, (self, f) => map(self, Result.map(f)) as any) + ): [R] extends [Writable] ? Writable>>, RW> + : Rx>>> +} = dual(2, >, B>( + self: R, + f: (_: Result.Result.InferA>) => B +): [R] extends [Writable] ? Writable>>, RW> + : Rx>>> => map(self, Result.map(f))) /** * @since 1.0.0 diff --git a/packages/rx/src/internal/registry.ts b/packages/rx/src/internal/registry.ts index 2deef0e..6eb7d7a 100644 --- a/packages/rx/src/internal/registry.ts +++ b/packages/rx/src/internal/registry.ts @@ -418,7 +418,7 @@ const LifetimeProto: Omit, "node" | "finalizers" | "disposed"> = { return parent.value() }, - result(this: Lifetime, rx: Rx.Rx>): Exit { + result(this: Lifetime, rx: Rx.Rx>): Exit { if (this.disposed) { throw disposedError(this.node.rx) } @@ -551,7 +551,7 @@ const LifetimeProto: Omit, "node" | "finalizers" | "disposed"> = { ) }, - streamResult(this: Lifetime, rx: Rx.Rx>, options?: { + streamResult(this: Lifetime, rx: Rx.Rx>, options?: { readonly withoutInitialValue?: boolean readonly bufferSize?: number }) { diff --git a/packages/rx/src/internal/runtime.ts b/packages/rx/src/internal/runtime.ts index d685edd..88c4433 100644 --- a/packages/rx/src/internal/runtime.ts +++ b/packages/rx/src/internal/runtime.ts @@ -7,7 +7,7 @@ import * as Exit from "effect/Exit" import * as Runtime from "effect/Runtime" import { SyncScheduler } from "effect/Scheduler" -const fastPath = (effect: Effect.Effect): Exit.Exit | undefined => { +const fastPath = (effect: Effect.Effect): Exit.Exit | undefined => { const op = effect as any switch (op._tag) { case "Failure": @@ -33,7 +33,7 @@ const fastPath = (effect: Effect.Effect): Exit.Exit | un /** @internal */ export const runCallbackSync = (runtime: Runtime.Runtime) => - (effect: Effect.Effect, onExit: (exit: Exit.Exit) => void): (() => void) | undefined => { + (effect: Effect.Effect, onExit: (exit: Exit.Exit) => void): (() => void) | undefined => { const op = fastPath(effect) if (op) { onExit(op) diff --git a/packages/rx/test/Rx.test.ts b/packages/rx/test/Rx.test.ts index 9219ff8..333198e 100644 --- a/packages/rx/test/Rx.test.ts +++ b/packages/rx/test/Rx.test.ts @@ -777,10 +777,10 @@ describe("Rx", () => { }) interface BuildCounter { - readonly get: Effect.Effect - readonly inc: Effect.Effect + readonly get: Effect.Effect + readonly inc: Effect.Effect } -const BuildCounter = Context.Tag("BuildCounter") +const BuildCounter = Context.GenericTag("BuildCounter") const BuildCounterLive = Layer.sync(BuildCounter, () => { let count = 0 return BuildCounter.of({ @@ -792,10 +792,10 @@ const BuildCounterLive = Layer.sync(BuildCounter, () => { }) interface Counter { - readonly get: Effect.Effect - readonly inc: Effect.Effect + readonly get: Effect.Effect + readonly inc: Effect.Effect } -const Counter = Context.Tag("Counter") +const Counter = Context.GenericTag("Counter") const CounterLive = Layer.effect( Counter, Effect.gen(function*(_) { @@ -831,9 +831,9 @@ const CounterTest = Layer.effect( ) interface Multiplier { - readonly times: (n: number) => Effect.Effect + readonly times: (n: number) => Effect.Effect } -const Multiplier = Context.Tag("Multiplier") +const Multiplier = Context.GenericTag("Multiplier") const MultiplierLive = Layer.effect( Multiplier, Effect.gen(function*(_) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a12f9ec..db05d9d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,11 +39,11 @@ importers: specifier: ^0.1.0 version: 0.1.0 '@typescript-eslint/eslint-plugin': - specifier: ^6.20.0 - version: 6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.21.0 + version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: ^6.20.0 - version: 6.20.0(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.21.0 + version: 6.21.0(eslint@8.56.0)(typescript@5.3.3) '@vitest/coverage-v8': specifier: ^1.2.2 version: 1.2.2(vitest@1.2.2) @@ -55,7 +55,7 @@ importers: version: 8.56.0 eslint-import-resolver-typescript: specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@6.20.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 3.6.1(@typescript-eslint/parser@6.21.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) eslint-plugin-codegen: specifier: ^0.23.0 version: 0.23.0(eslint@8.56.0) @@ -64,10 +64,10 @@ importers: version: 2.0.0(eslint@8.56.0)(typescript@5.3.3) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + version: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) eslint-plugin-simple-import-sort: - specifier: ^10.0.0 - version: 10.0.0(eslint@8.56.0) + specifier: ^11.0.0 + version: 11.0.0(eslint@8.56.0) eslint-plugin-sort-destructure-keys: specifier: ^1.5.0 version: 1.5.0(eslint@8.56.0) @@ -96,8 +96,8 @@ importers: packages/rx: devDependencies: effect: - specifier: ^2.2.3 - version: 2.2.3 + specifier: ^2.3.0 + version: 2.3.0 publishDirectory: dist packages/rx-react: @@ -107,11 +107,11 @@ importers: version: link:../rx/dist devDependencies: '@types/react': - specifier: ^18.2.52 - version: 18.2.52 + specifier: ^18.2.55 + version: 18.2.55 effect: - specifier: ^2.2.3 - version: 2.2.3 + specifier: ^2.3.0 + version: 2.3.0 react: specifier: ^18.2.0 version: 18.2.0 @@ -124,11 +124,11 @@ importers: version: link:../rx/dist devDependencies: effect: - specifier: ^2.2.3 - version: 2.2.3 + specifier: ^2.3.0 + version: 2.3.0 vue: - specifier: ^3.4.15 - version: 3.4.15(typescript@5.3.3) + specifier: ^3.4.18 + version: 3.4.18(typescript@5.3.3) publishDirectory: dist packages: @@ -163,7 +163,7 @@ packages: slash: 2.0.0 optionalDependencies: '@nicolo-ribaudo/chokidar-2': 2.1.8-no-fsevents.3 - chokidar: 3.5.3 + chokidar: 3.6.0 dev: true /@babel/code-frame@7.23.5: @@ -1506,8 +1506,8 @@ packages: resolution: {integrity: sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==} dev: true - /@types/react@18.2.52: - resolution: {integrity: sha512-E/YjWh3tH+qsLKaUzgpZb5AY0ChVa+ZJzF7ogehVILrFpdQk6nC/WXOv0bfFEABbXbgNxLBGU7IIZByPKb6eBw==} + /@types/react@18.2.55: + resolution: {integrity: sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==} dependencies: '@types/prop-types': 15.7.11 '@types/scheduler': 0.16.8 @@ -1540,8 +1540,8 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin@6.20.0(@typescript-eslint/parser@6.20.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-fTwGQUnjhoYHeSF6m5pWNkzmDDdsKELYrOBxhjMrofPqCkoC2k3B2wvGHFxa1CTIqkEn88nlW1HVMztjo2K8Hg==} + /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1552,25 +1552,25 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.20.0 - '@typescript-eslint/type-utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.20.0 + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/type-utils': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) + semver: 7.6.0 + ts-api-utils: 1.2.1(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.20.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-bYerPDF/H5v6V76MdMYhjwmwgMA+jlPVqjSDq2cRqMi8bP5sR3Z+RLOiOMad3nsnmDVmn2gAFCyNgh/dIrfP/w==} + /@typescript-eslint/parser@6.21.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1579,10 +1579,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.20.0 - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.20.0 + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -1598,16 +1598,16 @@ packages: '@typescript-eslint/visitor-keys': 6.19.0 dev: true - /@typescript-eslint/scope-manager@6.20.0: - resolution: {integrity: sha512-p4rvHQRDTI1tGGMDFQm+GtxP1ZHyAh64WANVoyEcNMpaTFn3ox/3CcgtIlELnRfKzSs/DwYlDccJEtr3O6qBvA==} + /@typescript-eslint/scope-manager@6.21.0: + resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/visitor-keys': 6.20.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 dev: true - /@typescript-eslint/type-utils@6.20.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-qnSobiJQb1F5JjN0YDRPHruQTrX7ICsmltXhkV536mp4idGAYrIyr47zF/JmkJtEcAVnIz4gUYJ7gOZa6SmN4g==} + /@typescript-eslint/type-utils@6.21.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1616,11 +1616,11 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.20.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 - ts-api-utils: 1.0.3(typescript@5.3.3) + ts-api-utils: 1.2.1(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - supports-color @@ -1641,8 +1641,8 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/types@6.20.0: - resolution: {integrity: sha512-MM9mfZMAhiN4cOEcUOEx+0HmuaW3WBfukBZPCfwSqFnQy0grXYtngKCqpQN339X3RrwtzspWJrpbrupKYUSBXQ==} + /@typescript-eslint/types@6.21.0: + resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -1660,7 +1660,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.4 + semver: 7.6.0 tsutils: 3.21.0(typescript@3.9.10) typescript: 3.9.10 transitivePeerDependencies: @@ -1681,7 +1681,7 @@ packages: debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.4 + semver: 7.6.0 tsutils: 3.21.0(typescript@4.9.5) typescript: 4.9.5 transitivePeerDependencies: @@ -1704,14 +1704,14 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) + ts-api-utils: 1.2.1(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.20.0(typescript@5.3.3): - resolution: {integrity: sha512-RnRya9q5m6YYSpBN7IzKu9FmLcYtErkDkc8/dKv81I9QiLLtVBHrjz+Ev/crAqgMNW2FCsoZF4g2QUylMnJz+g==} + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.3.3): + resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1719,14 +1719,14 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/visitor-keys': 6.20.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 - semver: 7.5.4 - ts-api-utils: 1.0.3(typescript@5.3.3) + semver: 7.6.0 + ts-api-utils: 1.2.1(typescript@5.3.3) typescript: 5.3.3 transitivePeerDependencies: - supports-color @@ -1751,8 +1751,8 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.20.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-/EKuw+kRu2vAqCoDwDCBtDRU6CTKbUmwwI7SH7AashZ+W+7o8eiyy6V2cdOqN49KsTcASWsC5QeghYuRDTyOOg==} + /@typescript-eslint/utils@6.21.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1760,11 +1760,11 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.20.0 - '@typescript-eslint/types': 6.20.0 - '@typescript-eslint/typescript-estree': 6.20.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.21.0 + '@typescript-eslint/types': 6.21.0 + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) eslint: 8.56.0 - semver: 7.5.4 + semver: 7.6.0 transitivePeerDependencies: - supports-color - typescript @@ -1794,11 +1794,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.20.0: - resolution: {integrity: sha512-E8Cp98kRe4gKHjJD4NExXKz/zOJ1A2hhZc+IMVD6i7w4yjIvh6VyuRI0gRtxAsXtoC35uGMaQ9rjI2zJaXDEAw==} + /@typescript-eslint/visitor-keys@6.21.0: + resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.20.0 + '@typescript-eslint/types': 6.21.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1868,77 +1868,77 @@ packages: pretty-format: 29.7.0 dev: true - /@vue/compiler-core@3.4.15: - resolution: {integrity: sha512-XcJQVOaxTKCnth1vCxEChteGuwG6wqnUHxAm1DO3gCz0+uXKaJNx8/digSz4dLALCy8n2lKq24jSUs8segoqIw==} + /@vue/compiler-core@3.4.18: + resolution: {integrity: sha512-F7YK8lMK0iv6b9/Gdk15A67wM0KKZvxDxed0RR60C1z9tIJTKta+urs4j0RTN5XqHISzI3etN3mX0uHhjmoqjQ==} dependencies: - '@babel/parser': 7.23.6 - '@vue/shared': 3.4.15 + '@babel/parser': 7.23.9 + '@vue/shared': 3.4.18 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.0.2 dev: true - /@vue/compiler-dom@3.4.15: - resolution: {integrity: sha512-wox0aasVV74zoXyblarOM3AZQz/Z+OunYcIHe1OsGclCHt8RsRm04DObjefaI82u6XDzv+qGWZ24tIsRAIi5MQ==} + /@vue/compiler-dom@3.4.18: + resolution: {integrity: sha512-24Eb8lcMfInefvQ6YlEVS18w5Q66f4+uXWVA+yb7praKbyjHRNuKVWGuinfSSjM0ZIiPi++QWukhkgznBaqpEA==} dependencies: - '@vue/compiler-core': 3.4.15 - '@vue/shared': 3.4.15 + '@vue/compiler-core': 3.4.18 + '@vue/shared': 3.4.18 dev: true - /@vue/compiler-sfc@3.4.15: - resolution: {integrity: sha512-LCn5M6QpkpFsh3GQvs2mJUOAlBQcCco8D60Bcqmf3O3w5a+KWS5GvYbrrJBkgvL1BDnTp+e8q0lXCLgHhKguBA==} + /@vue/compiler-sfc@3.4.18: + resolution: {integrity: sha512-rG5tqtnzwrVpMqAQ7FHtvHaV70G6LLfJIWLYZB/jZ9m/hrnZmIQh+H3ewnC5onwe/ibljm9+ZupxeElzqCkTAw==} dependencies: - '@babel/parser': 7.23.6 - '@vue/compiler-core': 3.4.15 - '@vue/compiler-dom': 3.4.15 - '@vue/compiler-ssr': 3.4.15 - '@vue/shared': 3.4.15 + '@babel/parser': 7.23.9 + '@vue/compiler-core': 3.4.18 + '@vue/compiler-dom': 3.4.18 + '@vue/compiler-ssr': 3.4.18 + '@vue/shared': 3.4.18 estree-walker: 2.0.2 - magic-string: 0.30.5 - postcss: 8.4.33 + magic-string: 0.30.7 + postcss: 8.4.35 source-map-js: 1.0.2 dev: true - /@vue/compiler-ssr@3.4.15: - resolution: {integrity: sha512-1jdeQyiGznr8gjFDadVmOJqZiLNSsMa5ZgqavkPZ8O2wjHv0tVuAEsw5hTdUoUW4232vpBbL/wJhzVW/JwY1Uw==} + /@vue/compiler-ssr@3.4.18: + resolution: {integrity: sha512-hSlv20oUhPxo2UYUacHgGaxtqP0tvFo6ixxxD6JlXIkwzwoZ9eKK6PFQN4hNK/R13JlNyldwWt/fqGBKgWJ6nQ==} dependencies: - '@vue/compiler-dom': 3.4.15 - '@vue/shared': 3.4.15 + '@vue/compiler-dom': 3.4.18 + '@vue/shared': 3.4.18 dev: true - /@vue/reactivity@3.4.15: - resolution: {integrity: sha512-55yJh2bsff20K5O84MxSvXKPHHt17I2EomHznvFiJCAZpJTNW8IuLj1xZWMLELRhBK3kkFV/1ErZGHJfah7i7w==} + /@vue/reactivity@3.4.18: + resolution: {integrity: sha512-7uda2/I0jpLiRygprDo5Jxs2HJkOVXcOMlyVlY54yRLxoycBpwGJRwJT9EdGB4adnoqJDXVT2BilUAYwI7qvmg==} dependencies: - '@vue/shared': 3.4.15 + '@vue/shared': 3.4.18 dev: true - /@vue/runtime-core@3.4.15: - resolution: {integrity: sha512-6E3by5m6v1AkW0McCeAyhHTw+3y17YCOKG0U0HDKDscV4Hs0kgNT5G+GCHak16jKgcCDHpI9xe5NKb8sdLCLdw==} + /@vue/runtime-core@3.4.18: + resolution: {integrity: sha512-7mU9diCa+4e+8/wZ7Udw5pwTH10A11sZ1nldmHOUKJnzCwvZxfJqAtw31mIf4T5H2FsLCSBQT3xgioA9vIjyDQ==} dependencies: - '@vue/reactivity': 3.4.15 - '@vue/shared': 3.4.15 + '@vue/reactivity': 3.4.18 + '@vue/shared': 3.4.18 dev: true - /@vue/runtime-dom@3.4.15: - resolution: {integrity: sha512-EVW8D6vfFVq3V/yDKNPBFkZKGMFSvZrUQmx196o/v2tHKdwWdiZjYUBS+0Ez3+ohRyF8Njwy/6FH5gYJ75liUw==} + /@vue/runtime-dom@3.4.18: + resolution: {integrity: sha512-2y1Mkzcw1niSfG7z3Qx+2ir9Gb4hdTkZe5p/I8x1aTIKQE0vY0tPAEUPhZm5tx6183gG3D/KwHG728UR0sIufA==} dependencies: - '@vue/runtime-core': 3.4.15 - '@vue/shared': 3.4.15 + '@vue/runtime-core': 3.4.18 + '@vue/shared': 3.4.18 csstype: 3.1.3 dev: true - /@vue/server-renderer@3.4.15(vue@3.4.15): - resolution: {integrity: sha512-3HYzaidu9cHjrT+qGUuDhFYvF/j643bHC6uUN9BgM11DVy+pM6ATsG6uPBLnkwOgs7BpJABReLmpL3ZPAsUaqw==} + /@vue/server-renderer@3.4.18(vue@3.4.18): + resolution: {integrity: sha512-YJd1wa7mzUN3NRqLEsrwEYWyO+PUBSROIGlCc3J/cvn7Zu6CxhNLgXa8Z4zZ5ja5/nviYO79J1InoPeXgwBTZA==} peerDependencies: - vue: 3.4.15 + vue: 3.4.18 dependencies: - '@vue/compiler-ssr': 3.4.15 - '@vue/shared': 3.4.15 - vue: 3.4.15(typescript@5.3.3) + '@vue/compiler-ssr': 3.4.18 + '@vue/shared': 3.4.18 + vue: 3.4.18(typescript@5.3.3) dev: true - /@vue/shared@3.4.15: - resolution: {integrity: sha512-KzfPTxVaWfB+eGcGdbSf4CWdaXcGDqckoeXUh7SB3fZdEtzPCK2Vq9B/lRRL3yutax/LWITz+SwvgyOxz5V75g==} + /@vue/shared@3.4.18: + resolution: {integrity: sha512-CxouGFxxaW5r1WbrSmWwck3No58rApXgRSBxrqgnY1K+jk20F6DrXJkHdH9n4HVT+/B6G2CAn213Uq3npWiy8Q==} dev: true /acorn-jsx@5.3.2(acorn@8.11.2): @@ -2317,8 +2317,8 @@ packages: get-func-name: 2.0.2 dev: true - /chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + /chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} engines: {node: '>= 8.10.0'} requiresBuild: true dependencies: @@ -2795,8 +2795,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /effect@2.2.3: - resolution: {integrity: sha512-9h1YbGAjmT0A6HLseMmp1OI7VIg8Ee1go+FVjilDvNAWoxvlzudu/eYSo3lqJz1/TjUxj115AytTmI3CeuaUCA==} + /effect@2.3.0: + resolution: {integrity: sha512-Clz1L1N/Q0pSWVVkbvijvP5IEH2rE9aBlbLXCB0XYiRRrEI/POWYxQcQ3ECcpyQuFaNU2uQoVwsqwFI1MCL1Fg==} dev: true /electron-to-chromium@1.4.646: @@ -3016,7 +3016,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.20.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3026,8 +3026,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.56.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -3039,7 +3039,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -3060,11 +3060,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.20.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.20.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.21.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) transitivePeerDependencies: - supports-color dev: true @@ -3116,7 +3116,7 @@ packages: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -3126,7 +3126,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.20.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.56.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -3135,7 +3135,7 @@ packages: doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.20.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.21.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -3163,8 +3163,8 @@ packages: - supports-color dev: true - /eslint-plugin-simple-import-sort@10.0.0(eslint@8.56.0): - resolution: {integrity: sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==} + /eslint-plugin-simple-import-sort@11.0.0(eslint@8.56.0): + resolution: {integrity: sha512-3zxeF/0piwHA7/JlbpOmMJ1/1tc1dSRiir4DwpEnP747alKwZbj5xX+ZxroShMBU6LNDkpquo7FsXHCBc0HgCA==} peerDependencies: eslint: '>=5.0.0' dependencies: @@ -4506,15 +4506,15 @@ packages: - supports-color dev: true - /magic-string@0.30.5: - resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} + /magic-string@0.30.6: + resolution: {integrity: sha512-n62qCLbPjNjyo+owKtveQxZFZTBm+Ms6YoGD23Wew6Vw337PElFNifQpknPruVRQV57kVShPnLGo9vWxVhpPvA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /magic-string@0.30.6: - resolution: {integrity: sha512-n62qCLbPjNjyo+owKtveQxZFZTBm+Ms6YoGD23Wew6Vw337PElFNifQpknPruVRQV57kVShPnLGo9vWxVhpPvA==} + /magic-string@0.30.7: + resolution: {integrity: sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -5108,6 +5108,15 @@ packages: source-map-js: 1.0.2 dev: true + /postcss@8.4.35: + resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: true + /precinct@8.3.1: resolution: {integrity: sha512-pVppfMWLp2wF68rwHqBIpPBYY8Kd12lDhk8LVQzOwqllifVR15qNFyod43YLyFpurKRZQKnE7E4pofAagDOm2Q==} engines: {node: ^10.13 || ^12 || >=14} @@ -5509,6 +5518,14 @@ packages: lru-cache: 6.0.0 dev: true + /semver@7.6.0: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true @@ -5926,9 +5943,9 @@ packages: engines: {node: '>=8'} dev: true - /ts-api-utils@1.0.3(typescript@5.3.3): - resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} - engines: {node: '>=16.13.0'} + /ts-api-utils@1.2.1(typescript@5.3.3): + resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} + engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: @@ -6285,19 +6302,19 @@ packages: - terser dev: true - /vue@3.4.15(typescript@5.3.3): - resolution: {integrity: sha512-jC0GH4KkWLWJOEQjOpkqU1bQsBwf4R1rsFtw5GQJbjHVKWDzO6P0nWWBTmjp1xSemAioDFj1jdaK1qa3DnMQoQ==} + /vue@3.4.18(typescript@5.3.3): + resolution: {integrity: sha512-0zLRYamFRe0wF4q2L3O24KQzLyLpL64ye1RUToOgOxuWZsb/FhaNRdGmeozdtVYLz6tl94OXLaK7/WQIrVCw1A==} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@vue/compiler-dom': 3.4.15 - '@vue/compiler-sfc': 3.4.15 - '@vue/runtime-dom': 3.4.15 - '@vue/server-renderer': 3.4.15(vue@3.4.15) - '@vue/shared': 3.4.15 + '@vue/compiler-dom': 3.4.18 + '@vue/compiler-sfc': 3.4.18 + '@vue/runtime-dom': 3.4.18 + '@vue/server-renderer': 3.4.18(vue@3.4.18) + '@vue/shared': 3.4.18 typescript: 5.3.3 dev: true