lalph 0.3.113 → 0.3.114
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/cli.mjs +39 -34
- package/package.json +1 -1
- package/src/IssueSource.ts +3 -1
package/dist/cli.mjs
CHANGED
|
@@ -8289,6 +8289,8 @@ const tap$2 = /* @__PURE__ */ dual(2, (self, f) => flatMap$7(self, (a) => as$2(i
|
|
|
8289
8289
|
/** @internal */
|
|
8290
8290
|
const asVoid$2 = (self) => flatMap$7(self, (_) => exitVoid);
|
|
8291
8291
|
/** @internal */
|
|
8292
|
+
const sandbox$1 = (self) => catchCause$4(self, fail$9);
|
|
8293
|
+
/** @internal */
|
|
8292
8294
|
const raceAllFirst$1 = (all, options) => withFiber$1((parent) => callback$2((resume) => {
|
|
8293
8295
|
let done = false;
|
|
8294
8296
|
const fibers = /* @__PURE__ */ new Set();
|
|
@@ -8562,18 +8564,6 @@ const ignore$2 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, opti
|
|
|
8562
8564
|
});
|
|
8563
8565
|
});
|
|
8564
8566
|
/** @internal */
|
|
8565
|
-
const ignoreCause$1 = /* @__PURE__ */ dual((args) => isEffect$1(args[0]), (self, options) => {
|
|
8566
|
-
if (!options?.log) return matchCauseEffect$1(self, {
|
|
8567
|
-
onFailure: (_) => void_$4,
|
|
8568
|
-
onSuccess: (_) => void_$4
|
|
8569
|
-
});
|
|
8570
|
-
const logEffect = logWithLevel$1(options.log === true ? void 0 : options.log);
|
|
8571
|
-
return matchCauseEffect$1(self, {
|
|
8572
|
-
onFailure: (cause) => options.message === void 0 ? logEffect(cause) : logEffect(options.message, cause),
|
|
8573
|
-
onSuccess: (_) => void_$4
|
|
8574
|
-
});
|
|
8575
|
-
});
|
|
8576
|
-
/** @internal */
|
|
8577
8567
|
const option$2 = (self) => match$6(self, {
|
|
8578
8568
|
onFailure: none$4,
|
|
8579
8569
|
onSuccess: some$2
|
|
@@ -15464,6 +15454,41 @@ const tapCause = tapCause$2;
|
|
|
15464
15454
|
*/
|
|
15465
15455
|
const retry$1 = retry$2;
|
|
15466
15456
|
/**
|
|
15457
|
+
* The `sandbox` function transforms an effect by exposing the full cause
|
|
15458
|
+
* of any error, defect, or fiber interruption that might occur during its
|
|
15459
|
+
* execution. It changes the error channel of the effect to include detailed
|
|
15460
|
+
* information about the cause, which is wrapped in a `Cause<E>` type.
|
|
15461
|
+
*
|
|
15462
|
+
* This function is useful when you need access to the complete underlying cause
|
|
15463
|
+
* of failures, defects, or interruptions, enabling more detailed error
|
|
15464
|
+
* handling. Once you apply `sandbox`, you can use operators like
|
|
15465
|
+
* {@link catchAll} and {@link catchTags} to handle specific error conditions.
|
|
15466
|
+
* If necessary, you can revert the sandboxing operation with {@link unsandbox}
|
|
15467
|
+
* to return to the original error handling behavior.
|
|
15468
|
+
*
|
|
15469
|
+
* @example
|
|
15470
|
+
* ```ts
|
|
15471
|
+
* import { Cause, Effect } from "effect"
|
|
15472
|
+
*
|
|
15473
|
+
* const task = Effect.fail("Something went wrong")
|
|
15474
|
+
*
|
|
15475
|
+
* // Sandbox exposes the full cause as the error type
|
|
15476
|
+
* const program = Effect.gen(function*() {
|
|
15477
|
+
* const result = yield* Effect.flip(Effect.sandbox(task))
|
|
15478
|
+
* return `Caught cause: ${Cause.squash(result)}`
|
|
15479
|
+
* })
|
|
15480
|
+
*
|
|
15481
|
+
* Effect.runPromise(program).then(console.log)
|
|
15482
|
+
* // Output: "Caught cause: Something went wrong"
|
|
15483
|
+
* ```
|
|
15484
|
+
*
|
|
15485
|
+
* @see {@link unsandbox} to restore the original error handling.
|
|
15486
|
+
*
|
|
15487
|
+
* @since 2.0.0
|
|
15488
|
+
* @category Error Handling
|
|
15489
|
+
*/
|
|
15490
|
+
const sandbox = sandbox$1;
|
|
15491
|
+
/**
|
|
15467
15492
|
* Discards both the success and failure values of an effect.
|
|
15468
15493
|
*
|
|
15469
15494
|
* **When to Use**
|
|
@@ -15511,26 +15536,6 @@ const retry$1 = retry$2;
|
|
|
15511
15536
|
*/
|
|
15512
15537
|
const ignore$1 = ignore$2;
|
|
15513
15538
|
/**
|
|
15514
|
-
* Ignores the effect's failure cause, including defects and interruptions.
|
|
15515
|
-
*
|
|
15516
|
-
* Use the `log` option to emit the full {@link Cause} when the effect fails,
|
|
15517
|
-
* and `message` to prepend a custom log message.
|
|
15518
|
-
*
|
|
15519
|
-
* @example
|
|
15520
|
-
* ```ts
|
|
15521
|
-
* import { Effect } from "effect"
|
|
15522
|
-
*
|
|
15523
|
-
* const task = Effect.fail("boom")
|
|
15524
|
-
*
|
|
15525
|
-
* const program = task.pipe(Effect.ignoreCause)
|
|
15526
|
-
* const programLog = task.pipe(Effect.ignoreCause({ log: true, message: "Ignoring failure cause" }))
|
|
15527
|
-
* ```
|
|
15528
|
-
*
|
|
15529
|
-
* @since 4.0.0
|
|
15530
|
-
* @category Error Handling
|
|
15531
|
-
*/
|
|
15532
|
-
const ignoreCause = ignoreCause$1;
|
|
15533
|
-
/**
|
|
15534
15539
|
* Replaces the original failure with a success value, ensuring the effect
|
|
15535
15540
|
* cannot fail.
|
|
15536
15541
|
*
|
|
@@ -179460,7 +179465,7 @@ var IssueSource = class IssueSource extends Service$1()("lalph/IssueSource") {
|
|
|
179460
179465
|
const refs = yield* make$48({
|
|
179461
179466
|
lookup: fnUntraced(function* (projectId) {
|
|
179462
179467
|
const ref = yield* make$47(IssuesChange.Internal({ issues: yield* pipe$1(impl.issues(projectId), orElseSucceed(empty$17)) }));
|
|
179463
|
-
yield* changes(ref).pipe(switchMap((_) => impl.issues(projectId).pipe(tap$1((issues) => set$3(ref, IssuesChange.External({ issues }))),
|
|
179468
|
+
yield* changes(ref).pipe(switchMap((_) => impl.issues(projectId).pipe(tap$1((issues) => set$3(ref, IssuesChange.External({ issues }))), delay(seconds(30)), sandbox, retry$1(forever$1), fromEffectDrain)), runDrain, forkScoped);
|
|
179464
179469
|
return ref;
|
|
179465
179470
|
}),
|
|
179466
179471
|
capacity: Number.MAX_SAFE_INTEGER
|
|
@@ -243794,7 +243799,7 @@ const commandEdit = make$60("edit").pipe(withDescription("Open the selected proj
|
|
|
243794
243799
|
const commandSource = make$60("source").pipe(withDescription("Select the issue source to use (e.g. GitHub Issues or Linear). This applies to all projects."), withHandler(() => selectIssueSource), provide(Settings.layer));
|
|
243795
243800
|
//#endregion
|
|
243796
243801
|
//#region package.json
|
|
243797
|
-
var version = "0.3.
|
|
243802
|
+
var version = "0.3.114";
|
|
243798
243803
|
//#endregion
|
|
243799
243804
|
//#region src/Tracing.ts
|
|
243800
243805
|
const TracingLayer = unwrap$3(gen(function* () {
|
package/package.json
CHANGED
package/src/IssueSource.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Effect,
|
|
6
6
|
FiberHandle,
|
|
7
7
|
Option,
|
|
8
|
+
Schedule,
|
|
8
9
|
Schema,
|
|
9
10
|
ScopedCache,
|
|
10
11
|
ServiceMap,
|
|
@@ -114,8 +115,9 @@ export class IssueSource extends ServiceMap.Service<
|
|
|
114
115
|
Effect.tap((issues) =>
|
|
115
116
|
SubscriptionRef.set(ref, IssuesChange.External({ issues })),
|
|
116
117
|
),
|
|
117
|
-
Effect.ignoreCause,
|
|
118
118
|
Effect.delay(Duration.seconds(30)),
|
|
119
|
+
Effect.sandbox,
|
|
120
|
+
Effect.retry(Schedule.forever),
|
|
119
121
|
Stream.fromEffectDrain,
|
|
120
122
|
),
|
|
121
123
|
),
|