@effect/language-service 0.84.2 → 0.85.0
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/README.md +11 -0
- package/cli.js +945 -270
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +529 -103
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +539 -113
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/schema.json +132 -0
- package/transform.js +529 -103
- package/transform.js.map +1 -1
package/cli.js
CHANGED
|
@@ -12333,7 +12333,7 @@ var require_dist3 = __commonJS({
|
|
|
12333
12333
|
}
|
|
12334
12334
|
});
|
|
12335
12335
|
|
|
12336
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12336
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Pipeable.js
|
|
12337
12337
|
var pipeArguments = (self, args3) => {
|
|
12338
12338
|
switch (args3.length) {
|
|
12339
12339
|
case 0:
|
|
@@ -12377,7 +12377,7 @@ var Class = /* @__PURE__ */ (function() {
|
|
|
12377
12377
|
return PipeableBase;
|
|
12378
12378
|
})();
|
|
12379
12379
|
|
|
12380
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12380
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Function.js
|
|
12381
12381
|
var dual = function(arity, body) {
|
|
12382
12382
|
if (typeof arity === "function") {
|
|
12383
12383
|
return function() {
|
|
@@ -12439,7 +12439,7 @@ function memoize(f) {
|
|
|
12439
12439
|
};
|
|
12440
12440
|
}
|
|
12441
12441
|
|
|
12442
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12442
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/equal.js
|
|
12443
12443
|
var getAllObjectKeys = (obj) => {
|
|
12444
12444
|
const keys2 = new Set(Reflect.ownKeys(obj));
|
|
12445
12445
|
if (obj.constructor === Object) return keys2;
|
|
@@ -12462,7 +12462,7 @@ var getAllObjectKeys = (obj) => {
|
|
|
12462
12462
|
};
|
|
12463
12463
|
var byReferenceInstances = /* @__PURE__ */ new WeakSet();
|
|
12464
12464
|
|
|
12465
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12465
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Predicate.js
|
|
12466
12466
|
function isString(input) {
|
|
12467
12467
|
return typeof input === "string";
|
|
12468
12468
|
}
|
|
@@ -12511,7 +12511,7 @@ function isIterable(input) {
|
|
|
12511
12511
|
return hasProperty(input, Symbol.iterator) || isString(input);
|
|
12512
12512
|
}
|
|
12513
12513
|
|
|
12514
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12514
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Hash.js
|
|
12515
12515
|
var symbol = "~effect/interfaces/Hash";
|
|
12516
12516
|
var hash = (self) => {
|
|
12517
12517
|
switch (typeof self) {
|
|
@@ -12630,7 +12630,7 @@ function withVisitedTracking(obj, fn4) {
|
|
|
12630
12630
|
return result3;
|
|
12631
12631
|
}
|
|
12632
12632
|
|
|
12633
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12633
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Equal.js
|
|
12634
12634
|
var symbol2 = "~effect/interfaces/Equal";
|
|
12635
12635
|
function equals() {
|
|
12636
12636
|
if (arguments.length === 1) {
|
|
@@ -12792,7 +12792,7 @@ var compareSets = /* @__PURE__ */ makeCompareSet(compareBoth);
|
|
|
12792
12792
|
var isEqual = (u) => hasProperty(u, symbol2);
|
|
12793
12793
|
var asEquivalence = () => equals;
|
|
12794
12794
|
|
|
12795
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12795
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Redactable.js
|
|
12796
12796
|
var symbolRedactable = /* @__PURE__ */ Symbol.for("~effect/Inspectable/redactable");
|
|
12797
12797
|
var isRedactable = (u) => hasProperty(u, symbolRedactable);
|
|
12798
12798
|
function redact(u) {
|
|
@@ -12811,7 +12811,7 @@ var emptyServiceMap = {
|
|
|
12811
12811
|
}
|
|
12812
12812
|
};
|
|
12813
12813
|
|
|
12814
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12814
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Formatter.js
|
|
12815
12815
|
function format(input, options) {
|
|
12816
12816
|
const space = options?.space ?? 0;
|
|
12817
12817
|
const seen = /* @__PURE__ */ new WeakSet();
|
|
@@ -12899,7 +12899,7 @@ function formatJson(input, options) {
|
|
|
12899
12899
|
return out;
|
|
12900
12900
|
}
|
|
12901
12901
|
|
|
12902
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12902
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Inspectable.js
|
|
12903
12903
|
var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
|
|
12904
12904
|
var toJson = (input) => {
|
|
12905
12905
|
try {
|
|
@@ -12959,7 +12959,7 @@ var Class2 = class {
|
|
|
12959
12959
|
}
|
|
12960
12960
|
};
|
|
12961
12961
|
|
|
12962
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
12962
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Utils.js
|
|
12963
12963
|
var SingleShotGen = class _SingleShotGen {
|
|
12964
12964
|
called = false;
|
|
12965
12965
|
self;
|
|
@@ -13002,7 +13002,7 @@ var forced = {
|
|
|
13002
13002
|
var isNotOptimizedAway = /* @__PURE__ */ standard[InternalTypeId](() => new Error().stack)?.includes(InternalTypeId) === true;
|
|
13003
13003
|
var internalCall = isNotOptimizedAway ? standard[InternalTypeId] : forced[InternalTypeId];
|
|
13004
13004
|
|
|
13005
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13005
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/core.js
|
|
13006
13006
|
var EffectTypeId = `~effect/Effect`;
|
|
13007
13007
|
var ExitTypeId = `~effect/Exit`;
|
|
13008
13008
|
var effectVariance = {
|
|
@@ -13371,10 +13371,10 @@ var done = (value2) => {
|
|
|
13371
13371
|
return exitFail(Done(value2));
|
|
13372
13372
|
};
|
|
13373
13373
|
|
|
13374
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13374
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/array.js
|
|
13375
13375
|
var isArrayNonEmpty = (self) => self.length > 0;
|
|
13376
13376
|
|
|
13377
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13377
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/option.js
|
|
13378
13378
|
var TypeId = "~effect/data/Option";
|
|
13379
13379
|
var CommonProto = {
|
|
13380
13380
|
[TypeId]: {
|
|
@@ -13445,7 +13445,7 @@ var some = (value2) => {
|
|
|
13445
13445
|
return a;
|
|
13446
13446
|
};
|
|
13447
13447
|
|
|
13448
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13448
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/result.js
|
|
13449
13449
|
var TypeId2 = "~effect/data/Result";
|
|
13450
13450
|
var CommonProto2 = {
|
|
13451
13451
|
[TypeId2]: {
|
|
@@ -13516,7 +13516,7 @@ var succeed = (success) => {
|
|
|
13516
13516
|
return a;
|
|
13517
13517
|
};
|
|
13518
13518
|
|
|
13519
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13519
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Order.js
|
|
13520
13520
|
function make(compare) {
|
|
13521
13521
|
return (self, that) => self === that ? 0 : compare(self, that);
|
|
13522
13522
|
}
|
|
@@ -13540,7 +13540,7 @@ var combine2 = /* @__PURE__ */ dual(2, (self, that) => make((a1, a2) => {
|
|
|
13540
13540
|
var mapInput = /* @__PURE__ */ dual(2, (self, f) => make((b1, b2) => self(f(b1), f(b2))));
|
|
13541
13541
|
var isGreaterThan = (O) => dual(2, (self, that) => O(self, that) === 1);
|
|
13542
13542
|
|
|
13543
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13543
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Option.js
|
|
13544
13544
|
var none2 = () => none;
|
|
13545
13545
|
var some2 = some;
|
|
13546
13546
|
var isNone2 = isNone;
|
|
@@ -13559,7 +13559,7 @@ var flatMap = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : f(s
|
|
|
13559
13559
|
var filter = /* @__PURE__ */ dual(2, (self, predicate) => isNone2(self) ? none2() : predicate(self.value) ? some2(self.value) : none2());
|
|
13560
13560
|
var liftPredicate = /* @__PURE__ */ dual(2, (b, predicate) => predicate(b) ? some2(b) : none2());
|
|
13561
13561
|
|
|
13562
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13562
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Result.js
|
|
13563
13563
|
var succeed2 = succeed;
|
|
13564
13564
|
var fail2 = fail;
|
|
13565
13565
|
var isFailure2 = isFailure;
|
|
@@ -13572,7 +13572,7 @@ var match2 = /* @__PURE__ */ dual(2, (self, {
|
|
|
13572
13572
|
}) => isFailure2(self) ? onFailure(self.failure) : onSuccess(self.success));
|
|
13573
13573
|
var getOrElse2 = /* @__PURE__ */ dual(2, (self, onFailure) => isFailure2(self) ? onFailure(self.failure) : self.success);
|
|
13574
13574
|
|
|
13575
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13575
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Iterable.js
|
|
13576
13576
|
var findFirst = /* @__PURE__ */ dual(2, (self, f) => {
|
|
13577
13577
|
let i = 0;
|
|
13578
13578
|
for (const a of self) {
|
|
@@ -13591,7 +13591,7 @@ var findFirst = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
13591
13591
|
return none2();
|
|
13592
13592
|
});
|
|
13593
13593
|
|
|
13594
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13594
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Record.js
|
|
13595
13595
|
var map3 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
13596
13596
|
const out = {
|
|
13597
13597
|
...self
|
|
@@ -13603,7 +13603,7 @@ var map3 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
|
13603
13603
|
});
|
|
13604
13604
|
var keys = (self) => Object.keys(self);
|
|
13605
13605
|
|
|
13606
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13606
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Array.js
|
|
13607
13607
|
var Array2 = globalThis.Array;
|
|
13608
13608
|
var fromIterable = (collection) => Array2.isArray(collection) ? collection : Array2.from(collection);
|
|
13609
13609
|
var match3 = /* @__PURE__ */ dual(2, (self, {
|
|
@@ -13742,7 +13742,7 @@ var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
|
|
|
13742
13742
|
var dedupe = (self) => dedupeWith(self, asEquivalence());
|
|
13743
13743
|
var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable(self).join(sep));
|
|
13744
13744
|
|
|
13745
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13745
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Duration.js
|
|
13746
13746
|
var TypeId3 = "~effect/time/Duration";
|
|
13747
13747
|
var bigint0 = /* @__PURE__ */ BigInt(0);
|
|
13748
13748
|
var bigint1e3 = /* @__PURE__ */ BigInt(1e3);
|
|
@@ -13973,7 +13973,7 @@ var Equivalence = (self, that) => matchPair(self, that, {
|
|
|
13973
13973
|
});
|
|
13974
13974
|
var equals2 = /* @__PURE__ */ dual(2, (self, that) => Equivalence(self, that));
|
|
13975
13975
|
|
|
13976
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13976
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Filter.js
|
|
13977
13977
|
var composePassthrough = /* @__PURE__ */ dual(2, (left, right) => (input) => {
|
|
13978
13978
|
const leftOut = left(input);
|
|
13979
13979
|
if (isFailure2(leftOut)) return fail2(input);
|
|
@@ -13986,7 +13986,7 @@ var toOption = (self) => (input) => {
|
|
|
13986
13986
|
return isFailure2(result3) ? none2() : some2(result3.success);
|
|
13987
13987
|
};
|
|
13988
13988
|
|
|
13989
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
13989
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/ServiceMap.js
|
|
13990
13990
|
var ServiceTypeId = "~effect/ServiceMap/Service";
|
|
13991
13991
|
var Service = function() {
|
|
13992
13992
|
const prevLimit = Error.stackTraceLimit;
|
|
@@ -14020,10 +14020,7 @@ var Service = function() {
|
|
|
14020
14020
|
};
|
|
14021
14021
|
};
|
|
14022
14022
|
var ServiceProto = {
|
|
14023
|
-
[ServiceTypeId]:
|
|
14024
|
-
_Service: (_) => _,
|
|
14025
|
-
_Identifier: (_) => _
|
|
14026
|
-
},
|
|
14023
|
+
[ServiceTypeId]: ServiceTypeId,
|
|
14027
14024
|
...PipeInspectableProto,
|
|
14028
14025
|
...YieldableProto,
|
|
14029
14026
|
toJSON() {
|
|
@@ -14171,7 +14168,7 @@ var withMapUnsafe = (self, f) => {
|
|
|
14171
14168
|
};
|
|
14172
14169
|
var Reference = Service;
|
|
14173
14170
|
|
|
14174
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
14171
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Scheduler.js
|
|
14175
14172
|
var Scheduler = /* @__PURE__ */ Reference("effect/Scheduler", {
|
|
14176
14173
|
defaultValue: () => new MixedScheduler()
|
|
14177
14174
|
});
|
|
@@ -14282,7 +14279,7 @@ var PreventSchedulerYield = /* @__PURE__ */ Reference("effect/Scheduler/PreventS
|
|
|
14282
14279
|
defaultValue: () => false
|
|
14283
14280
|
});
|
|
14284
14281
|
|
|
14285
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
14282
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Tracer.js
|
|
14286
14283
|
var ParentSpanKey = "effect/Tracer/ParentSpan";
|
|
14287
14284
|
var ParentSpan = class extends (/* @__PURE__ */ Service()(ParentSpanKey)) {
|
|
14288
14285
|
};
|
|
@@ -14362,7 +14359,10 @@ var randomHexString = /* @__PURE__ */ (function() {
|
|
|
14362
14359
|
};
|
|
14363
14360
|
})();
|
|
14364
14361
|
|
|
14365
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
14362
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/metric.js
|
|
14363
|
+
var FiberRuntimeMetricsKey = "effect/observability/Metric/FiberRuntimeMetricsKey";
|
|
14364
|
+
|
|
14365
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/references.js
|
|
14366
14366
|
var CurrentConcurrency = /* @__PURE__ */ Reference("effect/References/CurrentConcurrency", {
|
|
14367
14367
|
defaultValue: () => "unbounded"
|
|
14368
14368
|
});
|
|
@@ -14394,10 +14394,7 @@ var CurrentLogSpans = /* @__PURE__ */ Reference("effect/References/CurrentLogSpa
|
|
|
14394
14394
|
defaultValue: () => []
|
|
14395
14395
|
});
|
|
14396
14396
|
|
|
14397
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
14398
|
-
var FiberRuntimeMetricsKey = "effect/observability/Metric/FiberRuntimeMetricsKey";
|
|
14399
|
-
|
|
14400
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.38/node_modules/effect/dist/internal/tracer.js
|
|
14397
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/tracer.js
|
|
14401
14398
|
var makeStackCleaner = (line) => (stack) => {
|
|
14402
14399
|
let cache;
|
|
14403
14400
|
return () => {
|
|
@@ -14412,10 +14409,10 @@ var makeStackCleaner = (line) => (stack) => {
|
|
|
14412
14409
|
};
|
|
14413
14410
|
};
|
|
14414
14411
|
|
|
14415
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
14412
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/version.js
|
|
14416
14413
|
var version = "dev";
|
|
14417
14414
|
|
|
14418
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
14415
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/effect.js
|
|
14419
14416
|
var Interrupt = class extends ReasonBase {
|
|
14420
14417
|
fiberId;
|
|
14421
14418
|
constructor(fiberId2, annotations = constEmptyAnnotations) {
|
|
@@ -15343,7 +15340,7 @@ var exitPrimitive = /* @__PURE__ */ makePrimitive({
|
|
|
15343
15340
|
return succeed3(exit3 ?? exitFailCause(cause));
|
|
15344
15341
|
}
|
|
15345
15342
|
});
|
|
15346
|
-
var timeoutOrElse = /* @__PURE__ */ dual(2, (self, options) => raceFirst(self, flatMap3(sleep(options.duration), options.
|
|
15343
|
+
var timeoutOrElse = /* @__PURE__ */ dual(2, (self, options) => raceFirst(self, flatMap3(sleep(options.duration), options.orElse)));
|
|
15347
15344
|
var ScopeTypeId = "~effect/Scope";
|
|
15348
15345
|
var ScopeCloseableTypeId = "~effect/Scope/Closeable";
|
|
15349
15346
|
var scopeTag = /* @__PURE__ */ Service("effect/Scope");
|
|
@@ -15699,6 +15696,9 @@ var runForkWith = (services3) => (effect2, options) => {
|
|
|
15699
15696
|
fiber2.addObserver(() => options.signal.removeEventListener("abort", abort));
|
|
15700
15697
|
}
|
|
15701
15698
|
}
|
|
15699
|
+
if (options?.onFiberStart) {
|
|
15700
|
+
options.onFiberStart(fiber2);
|
|
15701
|
+
}
|
|
15702
15702
|
return fiber2;
|
|
15703
15703
|
};
|
|
15704
15704
|
var fiberRunIn = /* @__PURE__ */ dual(2, (self, scope3) => {
|
|
@@ -16129,7 +16129,7 @@ var tracerLogger = /* @__PURE__ */ loggerMake(({
|
|
|
16129
16129
|
span.event(toStringUnknown(Array.isArray(message) && message.length === 1 ? message[0] : message), clock.currentTimeNanosUnsafe(), attributes);
|
|
16130
16130
|
});
|
|
16131
16131
|
|
|
16132
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16132
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Cause.js
|
|
16133
16133
|
var fail4 = causeFail;
|
|
16134
16134
|
var hasInterruptsOnly2 = hasInterruptsOnly;
|
|
16135
16135
|
var squash = causeSquash;
|
|
@@ -16142,7 +16142,7 @@ var Done2 = Done;
|
|
|
16142
16142
|
var done2 = done;
|
|
16143
16143
|
var UnknownError2 = UnknownError;
|
|
16144
16144
|
|
|
16145
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16145
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Exit.js
|
|
16146
16146
|
var succeed4 = exitSucceed;
|
|
16147
16147
|
var failCause2 = exitFailCause;
|
|
16148
16148
|
var fail5 = exitFail;
|
|
@@ -16151,7 +16151,7 @@ var isSuccess3 = exitIsSuccess;
|
|
|
16151
16151
|
var match6 = exitMatch;
|
|
16152
16152
|
var getSuccess2 = exitGetSuccess;
|
|
16153
16153
|
|
|
16154
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16154
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Deferred.js
|
|
16155
16155
|
var TypeId5 = "~effect/Deferred";
|
|
16156
16156
|
var DeferredProto = {
|
|
16157
16157
|
[TypeId5]: {
|
|
@@ -16193,7 +16193,10 @@ var doneUnsafe = (self, effect2) => {
|
|
|
16193
16193
|
return true;
|
|
16194
16194
|
};
|
|
16195
16195
|
|
|
16196
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16196
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/References.js
|
|
16197
|
+
var MinimumLogLevel2 = MinimumLogLevel;
|
|
16198
|
+
|
|
16199
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Scope.js
|
|
16197
16200
|
var Scope = scopeTag;
|
|
16198
16201
|
var makeUnsafe3 = scopeMakeUnsafe;
|
|
16199
16202
|
var provide = provideScope;
|
|
@@ -16202,7 +16205,7 @@ var addFinalizer2 = scopeAddFinalizer;
|
|
|
16202
16205
|
var forkUnsafe2 = scopeForkUnsafe;
|
|
16203
16206
|
var close = scopeClose;
|
|
16204
16207
|
|
|
16205
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16208
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Layer.js
|
|
16206
16209
|
var TypeId6 = "~effect/Layer";
|
|
16207
16210
|
var MemoMapTypeId = "~effect/Layer/MemoMap";
|
|
16208
16211
|
var LayerProto = {
|
|
@@ -16292,7 +16295,7 @@ var merge2 = /* @__PURE__ */ dual(2, (self, that) => mergeAll2(self, ...Array.is
|
|
|
16292
16295
|
var provideWith = (self, that, f) => fromBuild((memoMap, scope3) => flatMap3(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope3) : that.build(memoMap, scope3), (context) => self.build(memoMap, scope3).pipe(provideServices(context), map5((merged) => f(merged, context)))));
|
|
16293
16296
|
var provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self2, that2) => merge(that2, self2)));
|
|
16294
16297
|
|
|
16295
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16298
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Data.js
|
|
16296
16299
|
var Class3 = class extends Class {
|
|
16297
16300
|
constructor(props) {
|
|
16298
16301
|
super();
|
|
@@ -16328,15 +16331,15 @@ function taggedMatch() {
|
|
|
16328
16331
|
var Error3 = Error2;
|
|
16329
16332
|
var TaggedError2 = TaggedError;
|
|
16330
16333
|
|
|
16331
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16334
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Number.js
|
|
16332
16335
|
var Number3 = globalThis.Number;
|
|
16333
16336
|
var Order = Number2;
|
|
16334
16337
|
|
|
16335
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16338
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/String.js
|
|
16336
16339
|
var String3 = globalThis.String;
|
|
16337
16340
|
var Order2 = String2;
|
|
16338
16341
|
|
|
16339
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16342
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Pull.js
|
|
16340
16343
|
var catchDone = /* @__PURE__ */ dual(2, (effect2, f) => catchCauseFilter(effect2, filterDoneLeftover, (l) => f(l)));
|
|
16341
16344
|
var isDoneCause = (cause) => cause.reasons.some(isDoneFailure);
|
|
16342
16345
|
var isDoneFailure = (failure) => failure._tag === "Fail" && isDone2(failure.error);
|
|
@@ -16347,11 +16350,11 @@ var doneExitFromCause = (cause) => {
|
|
|
16347
16350
|
return !isFailure2(halt) ? succeed4(halt.success.value) : failCause2(halt.failure);
|
|
16348
16351
|
};
|
|
16349
16352
|
|
|
16350
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16353
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/layer.js
|
|
16351
16354
|
var provideLayer = (self, layer11, options) => scopedWith((scope3) => flatMap3(options?.local ? buildWithMemoMap(layer11, makeMemoMapUnsafe(), scope3) : buildWithScope(layer11, scope3), (context) => provideServices(self, context)));
|
|
16352
16355
|
var provide2 = /* @__PURE__ */ dual((args3) => isEffect(args3[0]), (self, source, options) => isServiceMap(source) ? provideServices(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll2(...source) : source, options));
|
|
16353
16356
|
|
|
16354
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16357
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Effect.js
|
|
16355
16358
|
var isEffect2 = isEffect;
|
|
16356
16359
|
var forEach2 = forEach;
|
|
16357
16360
|
var whileLoop2 = whileLoop;
|
|
@@ -16442,7 +16445,7 @@ var flatMapEager2 = flatMapEager;
|
|
|
16442
16445
|
var catchEager2 = catchEager;
|
|
16443
16446
|
var fnUntracedEager2 = fnUntracedEager;
|
|
16444
16447
|
|
|
16445
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16448
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Runtime.js
|
|
16446
16449
|
var defaultTeardown = (exit3, onExit4) => {
|
|
16447
16450
|
if (isSuccess3(exit3)) return onExit4(0);
|
|
16448
16451
|
if (hasInterruptsOnly2(exit3.cause)) return onExit4(130);
|
|
@@ -16488,7 +16491,7 @@ var getErrorReported = (u) => {
|
|
|
16488
16491
|
return true;
|
|
16489
16492
|
};
|
|
16490
16493
|
|
|
16491
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
16494
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeRuntime.js
|
|
16492
16495
|
var runMain = /* @__PURE__ */ makeRunMain(({
|
|
16493
16496
|
fiber: fiber2,
|
|
16494
16497
|
teardown
|
|
@@ -16515,10 +16518,10 @@ var runMain = /* @__PURE__ */ makeRunMain(({
|
|
|
16515
16518
|
process.on("SIGTERM", onSigint);
|
|
16516
16519
|
});
|
|
16517
16520
|
|
|
16518
|
-
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
16521
|
+
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.43_effect@4.0.0-beta.43_ioredis@5.10.0/node_modules/@effect/platform-node/dist/NodeRuntime.js
|
|
16519
16522
|
var runMain2 = runMain;
|
|
16520
16523
|
|
|
16521
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16524
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/record.js
|
|
16522
16525
|
function set(self, key, value2) {
|
|
16523
16526
|
if (key === "__proto__") {
|
|
16524
16527
|
Object.defineProperty(self, key, {
|
|
@@ -16533,7 +16536,7 @@ function set(self, key, value2) {
|
|
|
16533
16536
|
return self;
|
|
16534
16537
|
}
|
|
16535
16538
|
|
|
16536
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16539
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/schema/annotations.js
|
|
16537
16540
|
function resolve(ast) {
|
|
16538
16541
|
return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
|
|
16539
16542
|
}
|
|
@@ -16547,11 +16550,11 @@ var getExpected = /* @__PURE__ */ memoize((ast) => {
|
|
|
16547
16550
|
return ast.getExpected(getExpected);
|
|
16548
16551
|
});
|
|
16549
16552
|
|
|
16550
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16553
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/RegExp.js
|
|
16551
16554
|
var RegExp2 = globalThis.RegExp;
|
|
16552
16555
|
var escape = (string6) => string6.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
16553
16556
|
|
|
16554
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16557
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Encoding.js
|
|
16555
16558
|
var EncodingErrorTypeId = "~effect/encoding/EncodingError";
|
|
16556
16559
|
var EncodingError = class extends (/* @__PURE__ */ TaggedError2("EncodingError")) {
|
|
16557
16560
|
/**
|
|
@@ -16637,10 +16640,10 @@ function getBase64Code(charCode) {
|
|
|
16637
16640
|
var base64abc = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/"];
|
|
16638
16641
|
var base64codes = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
|
|
16639
16642
|
|
|
16640
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16643
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/redacted.js
|
|
16641
16644
|
var redactedRegistry = /* @__PURE__ */ new WeakMap();
|
|
16642
16645
|
|
|
16643
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16646
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Redacted.js
|
|
16644
16647
|
var TypeId7 = "~effect/data/Redacted";
|
|
16645
16648
|
var isRedacted = (u) => hasProperty(u, TypeId7);
|
|
16646
16649
|
var make5 = (value2, options) => {
|
|
@@ -16671,7 +16674,7 @@ var Proto2 = {
|
|
|
16671
16674
|
}
|
|
16672
16675
|
};
|
|
16673
16676
|
|
|
16674
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
16677
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/SchemaIssue.js
|
|
16675
16678
|
var TypeId8 = "~effect/SchemaIssue/Issue";
|
|
16676
16679
|
function isIssue(u) {
|
|
16677
16680
|
return hasProperty(u, TypeId8);
|
|
@@ -17005,7 +17008,7 @@ function formatOption(actual) {
|
|
|
17005
17008
|
return format(actual.value);
|
|
17006
17009
|
}
|
|
17007
17010
|
|
|
17008
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
17011
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/SchemaGetter.js
|
|
17009
17012
|
var Getter = class _Getter extends Class {
|
|
17010
17013
|
run;
|
|
17011
17014
|
constructor(run6) {
|
|
@@ -17079,7 +17082,7 @@ function decodeBase642() {
|
|
|
17079
17082
|
})).asEffect());
|
|
17080
17083
|
}
|
|
17081
17084
|
|
|
17082
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
17085
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/SchemaTransformation.js
|
|
17083
17086
|
var TypeId9 = "~effect/SchemaTransformation/Transformation";
|
|
17084
17087
|
var Transformation = class _Transformation {
|
|
17085
17088
|
[TypeId9] = TypeId9;
|
|
@@ -17147,7 +17150,7 @@ var urlFromString = /* @__PURE__ */ transformOrFail2({
|
|
|
17147
17150
|
var uint8ArrayFromBase64String = /* @__PURE__ */ new Transformation(/* @__PURE__ */ decodeBase642(), /* @__PURE__ */ encodeBase642());
|
|
17148
17151
|
var fromJsonString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ parseJson(), /* @__PURE__ */ stringifyJson());
|
|
17149
17152
|
|
|
17150
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
17153
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/SchemaAST.js
|
|
17151
17154
|
function makeGuard(tag2) {
|
|
17152
17155
|
return (ast) => ast._tag === tag2;
|
|
17153
17156
|
}
|
|
@@ -18408,7 +18411,7 @@ var StringTree = /* @__PURE__ */ new Declaration([], () => (input, ast) => isStr
|
|
|
18408
18411
|
});
|
|
18409
18412
|
var unknownToStringTree = /* @__PURE__ */ new Link(StringTree, /* @__PURE__ */ passthrough2());
|
|
18410
18413
|
|
|
18411
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18414
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Brand.js
|
|
18412
18415
|
function nominal() {
|
|
18413
18416
|
return Object.assign((input) => input, {
|
|
18414
18417
|
option: (input) => some2(input),
|
|
@@ -18417,7 +18420,7 @@ function nominal() {
|
|
|
18417
18420
|
});
|
|
18418
18421
|
}
|
|
18419
18422
|
|
|
18420
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18423
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/PlatformError.js
|
|
18421
18424
|
var TypeId11 = "~effect/platform/PlatformError";
|
|
18422
18425
|
var BadArgument = class extends (/* @__PURE__ */ TaggedError2("BadArgument")) {
|
|
18423
18426
|
/**
|
|
@@ -18459,15 +18462,15 @@ var PlatformError = class extends (/* @__PURE__ */ TaggedError2("PlatformError")
|
|
|
18459
18462
|
var systemError = (options) => new PlatformError(new SystemError(options));
|
|
18460
18463
|
var badArgument = (options) => new PlatformError(new BadArgument(options));
|
|
18461
18464
|
|
|
18462
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18465
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Fiber.js
|
|
18463
18466
|
var TypeId12 = `~effect/Fiber/${version}`;
|
|
18464
18467
|
var interrupt3 = fiberInterrupt;
|
|
18465
18468
|
var runIn = fiberRunIn;
|
|
18466
18469
|
|
|
18467
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18470
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Latch.js
|
|
18468
18471
|
var makeUnsafe4 = makeLatchUnsafe;
|
|
18469
18472
|
|
|
18470
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18473
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/MutableList.js
|
|
18471
18474
|
var Empty = /* @__PURE__ */ Symbol.for("effect/MutableList/Empty");
|
|
18472
18475
|
var make8 = () => ({
|
|
18473
18476
|
head: void 0,
|
|
@@ -18538,7 +18541,7 @@ var take = (self) => {
|
|
|
18538
18541
|
return message;
|
|
18539
18542
|
};
|
|
18540
18543
|
|
|
18541
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18544
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/MutableRef.js
|
|
18542
18545
|
var TypeId13 = "~effect/MutableRef";
|
|
18543
18546
|
var MutableRefProto = {
|
|
18544
18547
|
[TypeId13]: TypeId13,
|
|
@@ -18556,7 +18559,7 @@ var make9 = (value2) => {
|
|
|
18556
18559
|
return ref;
|
|
18557
18560
|
};
|
|
18558
18561
|
|
|
18559
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18562
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Queue.js
|
|
18560
18563
|
var TypeId14 = "~effect/Queue";
|
|
18561
18564
|
var EnqueueTypeId = "~effect/Queue/Enqueue";
|
|
18562
18565
|
var DequeueTypeId = "~effect/Queue/Dequeue";
|
|
@@ -18820,7 +18823,7 @@ var finalize = (self, exit3) => {
|
|
|
18820
18823
|
openState.awaiters.clear();
|
|
18821
18824
|
};
|
|
18822
18825
|
|
|
18823
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18826
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Semaphore.js
|
|
18824
18827
|
var makeUnsafe5 = (permits) => new SemaphoreImpl(permits);
|
|
18825
18828
|
var SemaphoreImpl = class {
|
|
18826
18829
|
waiters = /* @__PURE__ */ new Set();
|
|
@@ -18905,7 +18908,7 @@ var SemaphoreImpl = class {
|
|
|
18905
18908
|
}
|
|
18906
18909
|
};
|
|
18907
18910
|
|
|
18908
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
18911
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Channel.js
|
|
18909
18912
|
var TypeId15 = "~effect/Channel";
|
|
18910
18913
|
var isChannel = (u) => hasProperty(u, TypeId15);
|
|
18911
18914
|
var ChannelProto = {
|
|
@@ -19068,7 +19071,7 @@ var runFold = /* @__PURE__ */ dual(3, (self, initial, f) => suspend2(() => {
|
|
|
19068
19071
|
}));
|
|
19069
19072
|
var toPullScoped = (self, scope3) => toTransform(self)(done2(), scope3);
|
|
19070
19073
|
|
|
19071
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19074
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/stream.js
|
|
19072
19075
|
var TypeId16 = "~effect/Stream";
|
|
19073
19076
|
var streamVariance = {
|
|
19074
19077
|
_R: identity,
|
|
@@ -19087,7 +19090,7 @@ var fromChannel = (channel) => {
|
|
|
19087
19090
|
return self;
|
|
19088
19091
|
};
|
|
19089
19092
|
|
|
19090
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19093
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Sink.js
|
|
19091
19094
|
var TypeId17 = "~effect/Sink";
|
|
19092
19095
|
var endVoid = /* @__PURE__ */ succeed6([void 0]);
|
|
19093
19096
|
var sinkVariance = {
|
|
@@ -19124,7 +19127,7 @@ var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap4(f)
|
|
|
19124
19127
|
}), catchDone(() => endVoid)));
|
|
19125
19128
|
var unwrap2 = (effect2) => fromChannel2(unwrap(map6(effect2, toChannel)));
|
|
19126
19129
|
|
|
19127
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19130
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/rcRef.js
|
|
19128
19131
|
var TypeId18 = "~effect/RcRef";
|
|
19129
19132
|
var stateEmpty = {
|
|
19130
19133
|
_tag: "Empty"
|
|
@@ -19222,11 +19225,11 @@ var get3 = /* @__PURE__ */ fnUntraced2(function* (self_) {
|
|
|
19222
19225
|
return state.value;
|
|
19223
19226
|
});
|
|
19224
19227
|
|
|
19225
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19228
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/RcRef.js
|
|
19226
19229
|
var make12 = make11;
|
|
19227
19230
|
var get4 = get3;
|
|
19228
19231
|
|
|
19229
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19232
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Stream.js
|
|
19230
19233
|
var TypeId19 = "~effect/Stream";
|
|
19231
19234
|
var isStream = (u) => hasProperty(u, TypeId19);
|
|
19232
19235
|
var fromChannel3 = fromChannel;
|
|
@@ -19278,7 +19281,7 @@ var runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
|
|
|
19278
19281
|
});
|
|
19279
19282
|
var mkString = (self) => runFold(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
|
|
19280
19283
|
|
|
19281
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19284
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/FileSystem.js
|
|
19282
19285
|
var TypeId20 = "~effect/platform/FileSystem";
|
|
19283
19286
|
var Size = (bytes) => typeof bytes === "bigint" ? bytes : BigInt(bytes);
|
|
19284
19287
|
var bigint1024 = /* @__PURE__ */ BigInt(1024);
|
|
@@ -19340,7 +19343,7 @@ var FileDescriptor = /* @__PURE__ */ nominal();
|
|
|
19340
19343
|
var WatchBackend = class extends (/* @__PURE__ */ Service()("effect/platform/FileSystem/WatchBackend")) {
|
|
19341
19344
|
};
|
|
19342
19345
|
|
|
19343
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19346
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Path.js
|
|
19344
19347
|
var TypeId21 = "~effect/platform/Path";
|
|
19345
19348
|
var Path = /* @__PURE__ */ Service("effect/Path");
|
|
19346
19349
|
function normalizeStringPosix(path4, allowAboveRoot) {
|
|
@@ -19808,7 +19811,7 @@ var posixImpl = /* @__PURE__ */ Path.of({
|
|
|
19808
19811
|
toNamespacedPath: identity
|
|
19809
19812
|
});
|
|
19810
19813
|
|
|
19811
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19814
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/process/ChildProcessSpawner.js
|
|
19812
19815
|
var ExitCode = /* @__PURE__ */ nominal();
|
|
19813
19816
|
var ProcessId = /* @__PURE__ */ nominal();
|
|
19814
19817
|
var HandleTypeId = "~effect/ChildProcessSpawner/ChildProcessHandle";
|
|
@@ -19838,7 +19841,7 @@ var make14 = (spawn2) => {
|
|
|
19838
19841
|
var ChildProcessSpawner = class extends (/* @__PURE__ */ Service()("effect/process/ChildProcessSpawner")) {
|
|
19839
19842
|
};
|
|
19840
19843
|
|
|
19841
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
19844
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/process/ChildProcess.js
|
|
19842
19845
|
var TypeId22 = "~effect/unstable/process/ChildProcess";
|
|
19843
19846
|
var Proto3 = {
|
|
19844
19847
|
...PipeInspectableProto,
|
|
@@ -19961,10 +19964,10 @@ var splitByWhitespaces = (template, rawTemplate) => {
|
|
|
19961
19964
|
};
|
|
19962
19965
|
var concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || prevTokens.length === 0 || nextTokens.length === 0 ? [...prevTokens, ...nextTokens] : [...prevTokens.slice(0, -1), `${prevTokens.at(-1)}${nextTokens.at(0)}`, ...nextTokens.slice(1)];
|
|
19963
19966
|
|
|
19964
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
19967
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
|
|
19965
19968
|
var NodeChildProcess = __toESM(require("child_process"), 1);
|
|
19966
19969
|
|
|
19967
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
19970
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/internal/utils.js
|
|
19968
19971
|
var handleErrnoException = (module2, method) => (err, [path4]) => {
|
|
19969
19972
|
let reason = "Unknown";
|
|
19970
19973
|
switch (err.code) {
|
|
@@ -20000,7 +20003,7 @@ var handleErrnoException = (module2, method) => (err, [path4]) => {
|
|
|
20000
20003
|
});
|
|
20001
20004
|
};
|
|
20002
20005
|
|
|
20003
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
20006
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeSink.js
|
|
20004
20007
|
var fromWritable = (options) => fromChannel2(mapDone(fromWritableChannel(options), (_) => [_]));
|
|
20005
20008
|
var fromWritableChannel = (options) => fromTransform((pull) => {
|
|
20006
20009
|
const writable = options.evaluate();
|
|
@@ -20040,7 +20043,7 @@ var pullIntoWritable = (options) => options.pull.pipe(flatMap4((chunk) => {
|
|
|
20040
20043
|
});
|
|
20041
20044
|
}) : identity);
|
|
20042
20045
|
|
|
20043
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
20046
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeStream.js
|
|
20044
20047
|
var import_node_stream = require("stream");
|
|
20045
20048
|
var fromReadable = (options) => fromChannel3(fromReadableChannel(options));
|
|
20046
20049
|
var fromReadableChannel = (options) => fromTransform((_, scope3) => readableToPullUnsafe({
|
|
@@ -20098,7 +20101,7 @@ var readableToPullUnsafe = (options) => {
|
|
|
20098
20101
|
};
|
|
20099
20102
|
var defaultOnError = (error2) => new UnknownError2(error2);
|
|
20100
20103
|
|
|
20101
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
20104
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
|
|
20102
20105
|
var toError = (error2) => error2 instanceof globalThis.Error ? error2 : new globalThis.Error(String(error2));
|
|
20103
20106
|
var toPlatformError = (method, error2, command) => {
|
|
20104
20107
|
const {
|
|
@@ -20342,7 +20345,7 @@ var make17 = /* @__PURE__ */ gen2(function* () {
|
|
|
20342
20345
|
const killSignal = options?.killSignal ?? "SIGTERM";
|
|
20343
20346
|
return isUndefined(options?.forceKillAfter) ? kill(command, childProcess, killSignal) : timeoutOrElse2(kill(command, childProcess, killSignal), {
|
|
20344
20347
|
duration: options.forceKillAfter,
|
|
20345
|
-
|
|
20348
|
+
orElse: () => kill(command, childProcess, "SIGKILL")
|
|
20346
20349
|
});
|
|
20347
20350
|
};
|
|
20348
20351
|
const getSourceStream = (handle, from) => {
|
|
@@ -20510,7 +20513,7 @@ var flattenCommand = (command) => {
|
|
|
20510
20513
|
};
|
|
20511
20514
|
};
|
|
20512
20515
|
|
|
20513
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
20516
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
|
|
20514
20517
|
var Crypto = __toESM(require("crypto"), 1);
|
|
20515
20518
|
var NFS = __toESM(require("fs"), 1);
|
|
20516
20519
|
var OS = __toESM(require("os"), 1);
|
|
@@ -20885,10 +20888,10 @@ var makeFileSystem = /* @__PURE__ */ map6(/* @__PURE__ */ serviceOption2(WatchBa
|
|
|
20885
20888
|
}));
|
|
20886
20889
|
var layer2 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
|
|
20887
20890
|
|
|
20888
|
-
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
20891
|
+
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.43_effect@4.0.0-beta.43_ioredis@5.10.0/node_modules/@effect/platform-node/dist/NodeFileSystem.js
|
|
20889
20892
|
var layer3 = layer2;
|
|
20890
20893
|
|
|
20891
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
20894
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodePath.js
|
|
20892
20895
|
var NodePath = __toESM(require("path"), 1);
|
|
20893
20896
|
var NodeUrl = __toESM(require("url"), 1);
|
|
20894
20897
|
var fromFileUrl2 = (url) => try_2({
|
|
@@ -20926,10 +20929,10 @@ var layer4 = /* @__PURE__ */ succeed5(Path)({
|
|
|
20926
20929
|
toFileUrl: toFileUrl2
|
|
20927
20930
|
});
|
|
20928
20931
|
|
|
20929
|
-
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
20932
|
+
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.43_effect@4.0.0-beta.43_ioredis@5.10.0/node_modules/@effect/platform-node/dist/NodePath.js
|
|
20930
20933
|
var layer5 = layer4;
|
|
20931
20934
|
|
|
20932
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
20935
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Stdio.js
|
|
20933
20936
|
var TypeId23 = "~effect/Stdio";
|
|
20934
20937
|
var Stdio = /* @__PURE__ */ Service(TypeId23);
|
|
20935
20938
|
var make18 = (options) => ({
|
|
@@ -20937,7 +20940,7 @@ var make18 = (options) => ({
|
|
|
20937
20940
|
...options
|
|
20938
20941
|
});
|
|
20939
20942
|
|
|
20940
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
20943
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
|
|
20941
20944
|
var layer6 = /* @__PURE__ */ succeed5(Stdio, /* @__PURE__ */ make18({
|
|
20942
20945
|
args: /* @__PURE__ */ sync2(() => process.argv.slice(2)),
|
|
20943
20946
|
stdout: (options) => fromWritable({
|
|
@@ -20972,13 +20975,13 @@ var layer6 = /* @__PURE__ */ succeed5(Stdio, /* @__PURE__ */ make18({
|
|
|
20972
20975
|
})
|
|
20973
20976
|
}));
|
|
20974
20977
|
|
|
20975
|
-
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
20978
|
+
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.43_effect@4.0.0-beta.43_ioredis@5.10.0/node_modules/@effect/platform-node/dist/NodeStdio.js
|
|
20976
20979
|
var layer7 = layer6;
|
|
20977
20980
|
|
|
20978
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
20981
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Struct.js
|
|
20979
20982
|
var lambda = (f) => f;
|
|
20980
20983
|
|
|
20981
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
20984
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/SchemaParser.js
|
|
20982
20985
|
var recurDefaults = /* @__PURE__ */ memoize((ast) => {
|
|
20983
20986
|
switch (ast._tag) {
|
|
20984
20987
|
case "Declaration": {
|
|
@@ -21116,7 +21119,7 @@ var recur = /* @__PURE__ */ memoize((ast) => {
|
|
|
21116
21119
|
};
|
|
21117
21120
|
});
|
|
21118
21121
|
|
|
21119
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
21122
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/schema/schema.js
|
|
21120
21123
|
var TypeId24 = "~effect/Schema/Schema";
|
|
21121
21124
|
var SchemaProto = {
|
|
21122
21125
|
[TypeId24]: TypeId24,
|
|
@@ -21145,7 +21148,7 @@ function make19(ast, options) {
|
|
|
21145
21148
|
return self;
|
|
21146
21149
|
}
|
|
21147
21150
|
|
|
21148
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
21151
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/internal/schema/to-codec.js
|
|
21149
21152
|
function makeReorder(getPriority) {
|
|
21150
21153
|
return (types) => {
|
|
21151
21154
|
const indexMap = /* @__PURE__ */ new Map();
|
|
@@ -21166,7 +21169,7 @@ function makeReorder(getPriority) {
|
|
|
21166
21169
|
};
|
|
21167
21170
|
}
|
|
21168
21171
|
|
|
21169
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
21172
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Schema.js
|
|
21170
21173
|
var TypeId25 = TypeId24;
|
|
21171
21174
|
function declareConstructor() {
|
|
21172
21175
|
return (typeParameters, run6, annotations) => {
|
|
@@ -21267,7 +21270,7 @@ function makeTuple(ast, elements) {
|
|
|
21267
21270
|
function Tuple(elements) {
|
|
21268
21271
|
return makeTuple(tuple(elements), elements);
|
|
21269
21272
|
}
|
|
21270
|
-
var
|
|
21273
|
+
var ArraySchema = /* @__PURE__ */ lambda((schema) => make20(new Arrays(false, [], [schema.ast]), {
|
|
21271
21274
|
schema
|
|
21272
21275
|
}));
|
|
21273
21276
|
function makeUnion(ast, members) {
|
|
@@ -21556,7 +21559,7 @@ var FormData2 = /* @__PURE__ */ instanceOf(globalThis.FormData, {
|
|
|
21556
21559
|
Type: `globalThis.FormData`
|
|
21557
21560
|
},
|
|
21558
21561
|
expected: "FormData",
|
|
21559
|
-
toCodecJson: () => link3()(
|
|
21562
|
+
toCodecJson: () => link3()(ArraySchema(Tuple([String6, Union2([Struct({
|
|
21560
21563
|
_tag: tag("String"),
|
|
21561
21564
|
value: String6
|
|
21562
21565
|
}), Struct({
|
|
@@ -21838,7 +21841,7 @@ function onSerializerEnsureArray(ast) {
|
|
|
21838
21841
|
}
|
|
21839
21842
|
}
|
|
21840
21843
|
|
|
21841
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
21844
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Terminal.js
|
|
21842
21845
|
var TypeId26 = "~effect/platform/Terminal";
|
|
21843
21846
|
var QuitErrorTypeId = "effect/platform/Terminal/QuitError";
|
|
21844
21847
|
var QuitError = class extends (/* @__PURE__ */ ErrorClass("QuitError")({
|
|
@@ -21856,7 +21859,7 @@ var make21 = (impl) => Terminal.of({
|
|
|
21856
21859
|
[TypeId26]: TypeId26
|
|
21857
21860
|
});
|
|
21858
21861
|
|
|
21859
|
-
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
21862
|
+
// ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.43_effect@4.0.0-beta.43/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
|
|
21860
21863
|
var readline = __toESM(require("readline"), 1);
|
|
21861
21864
|
var make22 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
|
|
21862
21865
|
const stdin = process.stdin;
|
|
@@ -21927,13 +21930,13 @@ function defaultShouldQuit(input) {
|
|
|
21927
21930
|
return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
|
|
21928
21931
|
}
|
|
21929
21932
|
|
|
21930
|
-
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
21933
|
+
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.43_effect@4.0.0-beta.43_ioredis@5.10.0/node_modules/@effect/platform-node/dist/NodeTerminal.js
|
|
21931
21934
|
var layer9 = layer8;
|
|
21932
21935
|
|
|
21933
|
-
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
21936
|
+
// ../../node_modules/.pnpm/@effect+platform-node@4.0.0-beta.43_effect@4.0.0-beta.43_ioredis@5.10.0/node_modules/@effect/platform-node/dist/NodeServices.js
|
|
21934
21937
|
var layer10 = /* @__PURE__ */ provideMerge(layer, /* @__PURE__ */ mergeAll2(layer3, layer5, layer7, layer9));
|
|
21935
21938
|
|
|
21936
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
21939
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Console.js
|
|
21937
21940
|
var Console = ConsoleRef;
|
|
21938
21941
|
var consoleWith = (f) => withFiber((fiber2) => f(fiber2.getRef(Console)));
|
|
21939
21942
|
var error = (...args3) => consoleWith((console2) => sync(() => {
|
|
@@ -21943,7 +21946,7 @@ var log = (...args3) => consoleWith((console2) => sync(() => {
|
|
|
21943
21946
|
console2.log(...args3);
|
|
21944
21947
|
}));
|
|
21945
21948
|
|
|
21946
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
21949
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/ConfigProvider.js
|
|
21947
21950
|
var import_meta = {};
|
|
21948
21951
|
function makeValue(value2) {
|
|
21949
21952
|
return {
|
|
@@ -22036,7 +22039,7 @@ function trieNodeAt(root, path4) {
|
|
|
22036
22039
|
return node;
|
|
22037
22040
|
}
|
|
22038
22041
|
|
|
22039
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
22042
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Config.js
|
|
22040
22043
|
var TypeId27 = "~effect/Config";
|
|
22041
22044
|
var ConfigError = class {
|
|
22042
22045
|
_tag = "ConfigError";
|
|
@@ -22124,7 +22127,7 @@ function succeed8(value2) {
|
|
|
22124
22127
|
return make24(() => succeed6(value2));
|
|
22125
22128
|
}
|
|
22126
22129
|
|
|
22127
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
22130
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/CliError.js
|
|
22128
22131
|
var CliError_exports = {};
|
|
22129
22132
|
__export(CliError_exports, {
|
|
22130
22133
|
DuplicateOption: () => DuplicateOption,
|
|
@@ -22142,8 +22145,8 @@ var isCliError = (u) => hasProperty(u, TypeId28);
|
|
|
22142
22145
|
var UnrecognizedOption = class extends (/* @__PURE__ */ ErrorClass(`${TypeId28}/UnrecognizedOption`)({
|
|
22143
22146
|
_tag: /* @__PURE__ */ tag("UnrecognizedOption"),
|
|
22144
22147
|
option: String6,
|
|
22145
|
-
command: /* @__PURE__ */ optional(/* @__PURE__ */
|
|
22146
|
-
suggestions: /* @__PURE__ */
|
|
22148
|
+
command: /* @__PURE__ */ optional(/* @__PURE__ */ ArraySchema(String6)),
|
|
22149
|
+
suggestions: /* @__PURE__ */ ArraySchema(String6)
|
|
22147
22150
|
})) {
|
|
22148
22151
|
/**
|
|
22149
22152
|
* @since 4.0.0
|
|
@@ -22232,8 +22235,8 @@ var InvalidValue2 = class extends (/* @__PURE__ */ ErrorClass(`${TypeId28}/Inval
|
|
|
22232
22235
|
var UnknownSubcommand = class extends (/* @__PURE__ */ ErrorClass(`${TypeId28}/UnknownSubcommand`)({
|
|
22233
22236
|
_tag: /* @__PURE__ */ tag("UnknownSubcommand"),
|
|
22234
22237
|
subcommand: String6,
|
|
22235
|
-
parent: /* @__PURE__ */ optional(/* @__PURE__ */
|
|
22236
|
-
suggestions: /* @__PURE__ */
|
|
22238
|
+
parent: /* @__PURE__ */ optional(/* @__PURE__ */ ArraySchema(String6)),
|
|
22239
|
+
suggestions: /* @__PURE__ */ ArraySchema(String6)
|
|
22237
22240
|
})) {
|
|
22238
22241
|
/**
|
|
22239
22242
|
* @since 4.0.0
|
|
@@ -22262,8 +22265,8 @@ var UserError = class extends (/* @__PURE__ */ ErrorClass(`${TypeId28}/UserError
|
|
|
22262
22265
|
var NonShowHelpErrors = /* @__PURE__ */ Union2([UnrecognizedOption, DuplicateOption, MissingOption, MissingArgument, InvalidValue2, UnknownSubcommand, UserError]);
|
|
22263
22266
|
var ShowHelp = class extends (/* @__PURE__ */ ErrorClass(`${TypeId28}/ShowHelp`)({
|
|
22264
22267
|
_tag: /* @__PURE__ */ tag("ShowHelp"),
|
|
22265
|
-
commandPath: /* @__PURE__ */
|
|
22266
|
-
errors: /* @__PURE__ */
|
|
22268
|
+
commandPath: /* @__PURE__ */ ArraySchema(String6),
|
|
22269
|
+
errors: /* @__PURE__ */ ArraySchema(NonShowHelpErrors)
|
|
22267
22270
|
})) {
|
|
22268
22271
|
[TypeId28] = TypeId28;
|
|
22269
22272
|
[errorExitCode] = this.errors.length ? 1 : 0;
|
|
@@ -22273,7 +22276,7 @@ var ShowHelp = class extends (/* @__PURE__ */ ErrorClass(`${TypeId28}/ShowHelp`)
|
|
|
22273
22276
|
}
|
|
22274
22277
|
};
|
|
22275
22278
|
|
|
22276
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
22279
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/Primitive.js
|
|
22277
22280
|
var Ini = __toESM(require_ini(), 1);
|
|
22278
22281
|
var Toml = __toESM(require_toml(), 1);
|
|
22279
22282
|
var Yaml = __toESM(require_dist(), 1);
|
|
@@ -22424,7 +22427,7 @@ var getTypeName = (primitive) => {
|
|
|
22424
22427
|
};
|
|
22425
22428
|
var getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.choiceKeys : void 0;
|
|
22426
22429
|
|
|
22427
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
22430
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/ansi.js
|
|
22428
22431
|
var ESC = "\x1B[";
|
|
22429
22432
|
var BEL = "\x07";
|
|
22430
22433
|
var SEP = ";";
|
|
@@ -22481,7 +22484,7 @@ var eraseLines = (rows) => {
|
|
|
22481
22484
|
return command;
|
|
22482
22485
|
};
|
|
22483
22486
|
|
|
22484
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
22487
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/Prompt.js
|
|
22485
22488
|
var TypeId30 = "~effect/cli/Prompt";
|
|
22486
22489
|
var defaultFigures = {
|
|
22487
22490
|
arrowUp: "\u2191",
|
|
@@ -23178,7 +23181,7 @@ var renderMultiSelectChoices = (state, options, figures2, renderOptions) => {
|
|
|
23178
23181
|
const isSelected = state.selectedIndices.has(choiceIndex);
|
|
23179
23182
|
const checkbox = isSelected ? figures2.checkboxOn : figures2.checkboxOff;
|
|
23180
23183
|
const annotatedCheckbox = isHighlighted && renderOptions?.plain !== true ? annotate2(checkbox, cyanBright) : checkbox;
|
|
23181
|
-
const title = choice4.title;
|
|
23184
|
+
const title = isHighlighted && renderOptions?.plain !== true ? annotate2(choice4.title, cyanBright) : choice4.title;
|
|
23182
23185
|
const description = renderChoiceDescription(choice4, isHighlighted, renderOptions);
|
|
23183
23186
|
documents.push(prefix + " " + annotatedCheckbox + " " + title + " " + description);
|
|
23184
23187
|
}
|
|
@@ -23486,7 +23489,7 @@ var entriesToDisplay = (cursor, total, maxVisible) => {
|
|
|
23486
23489
|
};
|
|
23487
23490
|
};
|
|
23488
23491
|
|
|
23489
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
23492
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/Param.js
|
|
23490
23493
|
var TypeId31 = "~effect/cli/Param";
|
|
23491
23494
|
var argumentKind = "argument";
|
|
23492
23495
|
var flagKind = "flag";
|
|
@@ -23914,7 +23917,7 @@ var getParamMetadata = (param) => {
|
|
|
23914
23917
|
});
|
|
23915
23918
|
};
|
|
23916
23919
|
|
|
23917
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
23920
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/CliOutput.js
|
|
23918
23921
|
var Formatter = /* @__PURE__ */ Reference("effect/cli/CliOutput", {
|
|
23919
23922
|
defaultValue: () => defaultFormatter2()
|
|
23920
23923
|
});
|
|
@@ -24106,7 +24109,7 @@ var formatHelpDocImpl = (doc, colors2) => {
|
|
|
24106
24109
|
return sections.join("\n");
|
|
24107
24110
|
};
|
|
24108
24111
|
|
|
24109
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24112
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/Command.js
|
|
24110
24113
|
var Command_exports = {};
|
|
24111
24114
|
__export(Command_exports, {
|
|
24112
24115
|
annotate: () => annotate3,
|
|
@@ -24129,7 +24132,7 @@ __export(Command_exports, {
|
|
|
24129
24132
|
withSubcommands: () => withSubcommands
|
|
24130
24133
|
});
|
|
24131
24134
|
|
|
24132
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24135
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/completions/bash.js
|
|
24133
24136
|
var escapeForBash = (s) => s.replace(/'/g, "'\\''");
|
|
24134
24137
|
var sanitizeFunctionName = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
24135
24138
|
var flagNamesForWordlist = (flag) => {
|
|
@@ -24291,7 +24294,7 @@ var generate = (executableName, descriptor) => {
|
|
|
24291
24294
|
return lines2.join("\n");
|
|
24292
24295
|
};
|
|
24293
24296
|
|
|
24294
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24297
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/completions/fish.js
|
|
24295
24298
|
var escapeFishString = (s) => s.replace(/'/g, "\\'");
|
|
24296
24299
|
var subcommandCondition = (parentPath, childSubcommandNames) => {
|
|
24297
24300
|
if (parentPath.length === 0) {
|
|
@@ -24459,7 +24462,7 @@ var generate2 = (executableName, descriptor) => {
|
|
|
24459
24462
|
return lines2.join("\n");
|
|
24460
24463
|
};
|
|
24461
24464
|
|
|
24462
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24465
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/completions/zsh.js
|
|
24463
24466
|
var escapeZsh = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:");
|
|
24464
24467
|
var sanitize = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
24465
24468
|
var allForms = (flag) => {
|
|
@@ -24617,7 +24620,7 @@ var generate3 = (executableName, descriptor) => {
|
|
|
24617
24620
|
return lines2.join("\n");
|
|
24618
24621
|
};
|
|
24619
24622
|
|
|
24620
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24623
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/Completions.js
|
|
24621
24624
|
var generate4 = (executableName, shell, descriptor) => {
|
|
24622
24625
|
switch (shell) {
|
|
24623
24626
|
case "bash":
|
|
@@ -24629,7 +24632,7 @@ var generate4 = (executableName, shell, descriptor) => {
|
|
|
24629
24632
|
}
|
|
24630
24633
|
};
|
|
24631
24634
|
|
|
24632
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24635
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/Flag.js
|
|
24633
24636
|
var Flag_exports = {};
|
|
24634
24637
|
__export(Flag_exports, {
|
|
24635
24638
|
atLeast: () => atLeast2,
|
|
@@ -24702,7 +24705,7 @@ var orElse4 = /* @__PURE__ */ dual(2, (self, that) => orElse3(self, that));
|
|
|
24702
24705
|
var orElseResult2 = /* @__PURE__ */ dual(2, (self, that) => orElseResult(self, that));
|
|
24703
24706
|
var withSchema2 = /* @__PURE__ */ dual(2, (self, schema) => withSchema(self, schema));
|
|
24704
24707
|
|
|
24705
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24708
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/config.js
|
|
24706
24709
|
var ConfigInternalTypeId = "~effect/cli/Command/Config/Internal";
|
|
24707
24710
|
var parseConfig = (config2) => {
|
|
24708
24711
|
const orderedParams = [];
|
|
@@ -24806,7 +24809,7 @@ var reconstructTree = (tree, results) => {
|
|
|
24806
24809
|
}
|
|
24807
24810
|
};
|
|
24808
24811
|
|
|
24809
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24812
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/command.js
|
|
24810
24813
|
var TypeId32 = "~effect/cli/Command";
|
|
24811
24814
|
var toImpl = (self) => self;
|
|
24812
24815
|
var Proto8 = {
|
|
@@ -24922,10 +24925,20 @@ var toFlagDoc = (single) => {
|
|
|
24922
24925
|
name: single.name,
|
|
24923
24926
|
aliases: formattedAliases,
|
|
24924
24927
|
type: single.typeName ?? getTypeName(single.primitiveType),
|
|
24925
|
-
description: single.description,
|
|
24928
|
+
description: appendChoiceKeys(single.description, getChoiceKeys(single.primitiveType)),
|
|
24926
24929
|
required: single.primitiveType._tag !== "Boolean"
|
|
24927
24930
|
};
|
|
24928
24931
|
};
|
|
24932
|
+
var appendChoiceKeys = (description, choiceKeys) => {
|
|
24933
|
+
if (choiceKeys === void 0 || choiceKeys.length === 0) {
|
|
24934
|
+
return description;
|
|
24935
|
+
}
|
|
24936
|
+
const choiceSuffix = `(choices: ${choiceKeys.join(", ")})`;
|
|
24937
|
+
return match(description, {
|
|
24938
|
+
onNone: () => some2(choiceSuffix),
|
|
24939
|
+
onSome: (value2) => some2(`${value2} ${choiceSuffix}`)
|
|
24940
|
+
});
|
|
24941
|
+
};
|
|
24929
24942
|
var makeParser = (cfg) => fnUntraced2(function* (input) {
|
|
24930
24943
|
const parsedArgs = {
|
|
24931
24944
|
flags: input.flags,
|
|
@@ -24976,7 +24989,7 @@ var checkForDuplicateFlags = (parent, subcommands, options) => {
|
|
|
24976
24989
|
}
|
|
24977
24990
|
};
|
|
24978
24991
|
|
|
24979
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
24992
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/completions/CommandDescriptor.js
|
|
24980
24993
|
var toFlagType = (single) => {
|
|
24981
24994
|
const tag2 = single.primitiveType._tag;
|
|
24982
24995
|
switch (tag2) {
|
|
@@ -25099,7 +25112,7 @@ var fromCommand = (cmd) => {
|
|
|
25099
25112
|
};
|
|
25100
25113
|
};
|
|
25101
25114
|
|
|
25102
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
25115
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/help.js
|
|
25103
25116
|
var dedupeGlobalFlags = (flags) => {
|
|
25104
25117
|
const seen = /* @__PURE__ */ new Set();
|
|
25105
25118
|
const deduped = [];
|
|
@@ -25198,7 +25211,7 @@ var getHelpForCommandPath = (command, commandPath, builtIns) => gen2(function* (
|
|
|
25198
25211
|
};
|
|
25199
25212
|
});
|
|
25200
25213
|
|
|
25201
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
25214
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/GlobalFlag.js
|
|
25202
25215
|
var action = (options) => ({
|
|
25203
25216
|
_tag: "Action",
|
|
25204
25217
|
flag: options.flag,
|
|
@@ -25250,7 +25263,7 @@ var LogLevel = /* @__PURE__ */ setting("log-level")({
|
|
|
25250
25263
|
});
|
|
25251
25264
|
var BuiltIns = [Help, Version, Completions, LogLevel];
|
|
25252
25265
|
|
|
25253
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
25266
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/lexer.js
|
|
25254
25267
|
function lex(argv) {
|
|
25255
25268
|
const endIndex = argv.indexOf("--");
|
|
25256
25269
|
if (endIndex === -1) {
|
|
@@ -25311,7 +25324,7 @@ var lexTokens = (args3) => {
|
|
|
25311
25324
|
return tokens;
|
|
25312
25325
|
};
|
|
25313
25326
|
|
|
25314
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
25327
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/auto-suggest.js
|
|
25315
25328
|
var levenshtein = (a, b) => {
|
|
25316
25329
|
const m = a.length;
|
|
25317
25330
|
const n = b.length;
|
|
@@ -25335,7 +25348,7 @@ var suggest = (input, candidates) => {
|
|
|
25335
25348
|
return distances.filter(([d]) => d === minDistance).map(([, c]) => c);
|
|
25336
25349
|
};
|
|
25337
25350
|
|
|
25338
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
25351
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/internal/parser.js
|
|
25339
25352
|
var getCommandPath = (parsedInput) => match(parsedInput.subcommand, {
|
|
25340
25353
|
onNone: () => [],
|
|
25341
25354
|
onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
|
|
@@ -25619,7 +25632,7 @@ var scanCommandLevel = (tokens, context) => {
|
|
|
25619
25632
|
return toLeafResult(state);
|
|
25620
25633
|
};
|
|
25621
25634
|
|
|
25622
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
25635
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/unstable/cli/Command.js
|
|
25623
25636
|
var isCommand = (u) => hasProperty(u, TypeId32);
|
|
25624
25637
|
var make25 = (name, config2, handler) => {
|
|
25625
25638
|
const parsedConfig = parseConfig(config2 ?? {});
|
|
@@ -25933,7 +25946,7 @@ var runWith2 = (command, config2) => {
|
|
|
25933
25946
|
program = provideService2(program, LogLevel, logLevel);
|
|
25934
25947
|
const services3 = match(logLevel, {
|
|
25935
25948
|
onNone: () => empty2(),
|
|
25936
|
-
onSome: (level) => make3(
|
|
25949
|
+
onSome: (level) => make3(MinimumLogLevel2, level)
|
|
25937
25950
|
});
|
|
25938
25951
|
yield* provideServices2(program, services3);
|
|
25939
25952
|
}, catchFilter2((error2) => isCliError(error2) && error2._tag === "ShowHelp" ? succeed2(error2) : fail2(error2), (error2) => andThen2(showHelp(command, error2), fail6(error2))), catchFilter2((e) => isQuitError(e) ? succeed2(e) : fail2(e), (_) => interrupt2));
|
|
@@ -25942,7 +25955,7 @@ var runWith2 = (command, config2) => {
|
|
|
25942
25955
|
// package.json
|
|
25943
25956
|
var package_default = {
|
|
25944
25957
|
name: "@effect/language-service",
|
|
25945
|
-
version: "0.
|
|
25958
|
+
version: "0.85.0",
|
|
25946
25959
|
publishConfig: {
|
|
25947
25960
|
access: "public",
|
|
25948
25961
|
directory: "dist"
|
|
@@ -25985,16 +25998,16 @@ var package_default = {
|
|
|
25985
25998
|
perf: "tsx test/perf.ts"
|
|
25986
25999
|
},
|
|
25987
26000
|
devDependencies: {
|
|
25988
|
-
"@effect/platform-node": "^4.0.0-beta.
|
|
26001
|
+
"@effect/platform-node": "^4.0.0-beta.43",
|
|
25989
26002
|
"@types/pako": "^2.0.4",
|
|
25990
26003
|
"@typescript-eslint/project-service": "^8.52.0",
|
|
25991
|
-
effect: "^4.0.0-beta.
|
|
26004
|
+
effect: "^4.0.0-beta.43",
|
|
25992
26005
|
pako: "^2.1.0",
|
|
25993
26006
|
"ts-patch": "^3.3.0"
|
|
25994
26007
|
}
|
|
25995
26008
|
};
|
|
25996
26009
|
|
|
25997
|
-
// ../../node_modules/.pnpm/effect@4.0.0-beta.
|
|
26010
|
+
// ../../node_modules/.pnpm/effect@4.0.0-beta.43/node_modules/effect/dist/Graph.js
|
|
25998
26011
|
var TypeId33 = "~effect/collections/Graph";
|
|
25999
26012
|
var Edge = class extends Class3 {
|
|
26000
26013
|
};
|
|
@@ -29024,6 +29037,14 @@ function make26(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
29024
29037
|
),
|
|
29025
29038
|
([A, E, R]) => ({ A, E, R })
|
|
29026
29039
|
);
|
|
29040
|
+
const streamVarianceStruct = (type, atLocation) => map12(
|
|
29041
|
+
all3(
|
|
29042
|
+
varianceStructCovariantType(type, atLocation, "_A"),
|
|
29043
|
+
varianceStructCovariantType(type, atLocation, "_E"),
|
|
29044
|
+
varianceStructCovariantType(type, atLocation, "_R")
|
|
29045
|
+
),
|
|
29046
|
+
([A, E, R]) => ({ A, E, R })
|
|
29047
|
+
);
|
|
29027
29048
|
const layerVarianceStruct = (type, atLocation) => map12(
|
|
29028
29049
|
all3(
|
|
29029
29050
|
varianceStructContravariantType(type, atLocation, "_ROut"),
|
|
@@ -29070,6 +29091,21 @@ function make26(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
29070
29091
|
"TypeParser.strictEffectType",
|
|
29071
29092
|
(type) => type
|
|
29072
29093
|
);
|
|
29094
|
+
const streamType = cachedBy(
|
|
29095
|
+
fn3("TypeParser.streamType")(function* (type, atLocation) {
|
|
29096
|
+
if (supportedEffect() === "v3") {
|
|
29097
|
+
return yield* effectType(type, atLocation);
|
|
29098
|
+
}
|
|
29099
|
+
const typeIdSymbol = typeChecker.getPropertyOfType(type, "~effect/Stream");
|
|
29100
|
+
if (!typeIdSymbol) {
|
|
29101
|
+
return yield* typeParserIssue("Type is not a stream", type, atLocation);
|
|
29102
|
+
}
|
|
29103
|
+
const typeIdType = typeChecker.getTypeOfSymbolAtLocation(typeIdSymbol, atLocation);
|
|
29104
|
+
return yield* streamVarianceStruct(typeIdType, atLocation);
|
|
29105
|
+
}),
|
|
29106
|
+
"TypeParser.streamType",
|
|
29107
|
+
(type) => type
|
|
29108
|
+
);
|
|
29073
29109
|
const isEffectTypeSourceFile = cachedBy(
|
|
29074
29110
|
fn3("TypeParser.isEffectTypeSourceFile")(function* (sourceFile) {
|
|
29075
29111
|
const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile);
|
|
@@ -29641,33 +29677,33 @@ function make26(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
29641
29677
|
),
|
|
29642
29678
|
([Identifier, Service2]) => ({ Identifier, Service: Service2 })
|
|
29643
29679
|
);
|
|
29644
|
-
const serviceVarianceStruct = (type, atLocation) => map12(
|
|
29645
|
-
all3(
|
|
29646
|
-
varianceStructInvariantType(type, atLocation, "_Identifier"),
|
|
29647
|
-
varianceStructInvariantType(type, atLocation, "_Service")
|
|
29648
|
-
),
|
|
29649
|
-
([Identifier, Service2]) => ({ Identifier, Service: Service2 })
|
|
29650
|
-
);
|
|
29651
29680
|
const serviceType = cachedBy(
|
|
29652
29681
|
fn3("TypeParser.serviceType")(function* (type, atLocation) {
|
|
29682
|
+
if (supportedEffect() !== "v4") return yield* typeParserIssue("v4 only");
|
|
29653
29683
|
yield* pipeableType(type, atLocation);
|
|
29654
|
-
const
|
|
29655
|
-
|
|
29656
|
-
|
|
29657
|
-
if (propertiesSymbols.length === 0) {
|
|
29658
|
-
return yield* typeParserIssue("Type has no tag variance struct", type, atLocation);
|
|
29684
|
+
const typeIdSymbol = typeChecker.getPropertyOfType(type, "~effect/ServiceMap/Service");
|
|
29685
|
+
if (!typeIdSymbol) {
|
|
29686
|
+
return yield* typeParserIssue("Type has no service key type id", type, atLocation);
|
|
29659
29687
|
}
|
|
29660
|
-
|
|
29661
|
-
|
|
29662
|
-
|
|
29663
|
-
|
|
29664
|
-
|
|
29688
|
+
const identifierSymbol = typeChecker.getPropertyOfType(type, "Identifier");
|
|
29689
|
+
if (!identifierSymbol) {
|
|
29690
|
+
return yield* typeParserIssue("Type has no 'Identifier' property", type, atLocation);
|
|
29691
|
+
}
|
|
29692
|
+
const serviceSymbol = typeChecker.getPropertyOfType(type, "Service");
|
|
29693
|
+
if (!serviceSymbol) {
|
|
29694
|
+
return yield* typeParserIssue("Type has no 'Service' property", type, atLocation);
|
|
29695
|
+
}
|
|
29696
|
+
return {
|
|
29697
|
+
Identifier: typeChecker.getTypeOfSymbolAtLocation(identifierSymbol, atLocation),
|
|
29698
|
+
Service: typeChecker.getTypeOfSymbolAtLocation(serviceSymbol, atLocation)
|
|
29699
|
+
};
|
|
29665
29700
|
}),
|
|
29666
29701
|
"TypeParser.serviceType",
|
|
29667
29702
|
(type) => type
|
|
29668
29703
|
);
|
|
29669
29704
|
const contextTag = cachedBy(
|
|
29670
29705
|
fn3("TypeParser.contextTag")(function* (type, atLocation) {
|
|
29706
|
+
if (supportedEffect() !== "v3") return yield* typeParserIssue("v3 only");
|
|
29671
29707
|
yield* pipeableType(type, atLocation);
|
|
29672
29708
|
const propertiesSymbols = typeChecker.getPropertiesOfType(type).filter(
|
|
29673
29709
|
(_) => _.flags & ts.SymbolFlags.Property && !(_.flags & ts.SymbolFlags.Optional) && _.valueDeclaration
|
|
@@ -29808,6 +29844,19 @@ function make26(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
29808
29844
|
"TypeParser.promiseLike",
|
|
29809
29845
|
(type) => type
|
|
29810
29846
|
);
|
|
29847
|
+
const promiseType = cachedBy(
|
|
29848
|
+
function(type, atLocation) {
|
|
29849
|
+
const promiseSymbol = typeChecker.resolveName("Promise", void 0, ts.SymbolFlags.Type, false);
|
|
29850
|
+
if (!promiseSymbol) return typeParserIssue("global Promise type not found", type, atLocation);
|
|
29851
|
+
const globalPromiseType = typeChecker.getDeclaredTypeOfSymbol(promiseSymbol);
|
|
29852
|
+
if (type === globalPromiseType || "target" in type && type.target === globalPromiseType || typeChecker.isTypeAssignableTo(type, globalPromiseType)) {
|
|
29853
|
+
return succeed9(type);
|
|
29854
|
+
}
|
|
29855
|
+
return typeParserIssue("type is not a Promise", type, atLocation);
|
|
29856
|
+
},
|
|
29857
|
+
"TypeParser.promiseType",
|
|
29858
|
+
(type) => type
|
|
29859
|
+
);
|
|
29811
29860
|
const extendsSchemaClass = cachedBy(
|
|
29812
29861
|
fn3("TypeParser.extendsSchemaClass")(function* (atLocation) {
|
|
29813
29862
|
if (!atLocation.name) {
|
|
@@ -30805,6 +30854,7 @@ function make26(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
30805
30854
|
isServiceMapTypeSourceFile,
|
|
30806
30855
|
isNodeReferenceToServiceMapModuleApi,
|
|
30807
30856
|
effectType,
|
|
30857
|
+
streamType,
|
|
30808
30858
|
strictEffectType,
|
|
30809
30859
|
layerType,
|
|
30810
30860
|
fiberType,
|
|
@@ -30826,6 +30876,7 @@ function make26(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
|
|
|
30826
30876
|
singleArgCall,
|
|
30827
30877
|
scopeType,
|
|
30828
30878
|
promiseLike,
|
|
30879
|
+
promiseType,
|
|
30829
30880
|
extendsEffectTag,
|
|
30830
30881
|
extendsEffectService,
|
|
30831
30882
|
extendsServiceMapService,
|
|
@@ -33409,6 +33460,37 @@ var anyUnknownInErrorContext = createDiagnostic({
|
|
|
33409
33460
|
})
|
|
33410
33461
|
});
|
|
33411
33462
|
|
|
33463
|
+
// src/diagnostics/asyncFunction.ts
|
|
33464
|
+
var asyncFunction = createDiagnostic({
|
|
33465
|
+
name: "asyncFunction",
|
|
33466
|
+
code: 69,
|
|
33467
|
+
description: "Warns when declaring async functions and suggests using Effect values and Effect.gen for async control flow",
|
|
33468
|
+
group: "effectNative",
|
|
33469
|
+
severity: "off",
|
|
33470
|
+
fixable: false,
|
|
33471
|
+
supportedEffect: ["v3", "v4"],
|
|
33472
|
+
apply: fn3("asyncFunction.apply")(function* (sourceFile, report) {
|
|
33473
|
+
const ts = yield* service2(TypeScriptApi);
|
|
33474
|
+
const hasAsyncModifier = (node) => ts.getModifiers(node)?.some((modifier) => modifier.kind === ts.SyntaxKind.AsyncKeyword) === true;
|
|
33475
|
+
const visit = (node) => {
|
|
33476
|
+
if (!ts.isFunctionDeclaration(node) && !ts.isFunctionExpression(node) && !ts.isArrowFunction(node) && !ts.isMethodDeclaration(node)) {
|
|
33477
|
+
ts.forEachChild(node, visit);
|
|
33478
|
+
return void 0;
|
|
33479
|
+
}
|
|
33480
|
+
if (hasAsyncModifier(node)) {
|
|
33481
|
+
report({
|
|
33482
|
+
location: node,
|
|
33483
|
+
messageText: "This code declares an async function, consider representing this async control flow with Effect values and `Effect.gen`.",
|
|
33484
|
+
fixes: []
|
|
33485
|
+
});
|
|
33486
|
+
}
|
|
33487
|
+
ts.forEachChild(node, visit);
|
|
33488
|
+
return void 0;
|
|
33489
|
+
};
|
|
33490
|
+
ts.forEachChild(sourceFile, visit);
|
|
33491
|
+
})
|
|
33492
|
+
});
|
|
33493
|
+
|
|
33412
33494
|
// src/diagnostics/catchAllToMapError.ts
|
|
33413
33495
|
var catchAllToMapError = createDiagnostic({
|
|
33414
33496
|
name: "catchAllToMapError",
|
|
@@ -33487,7 +33569,7 @@ var catchAllToMapError = createDiagnostic({
|
|
|
33487
33569
|
const { failArg, failCall } = failCallInfo;
|
|
33488
33570
|
report({
|
|
33489
33571
|
location: transformation.callee,
|
|
33490
|
-
messageText:
|
|
33572
|
+
messageText: `\`Effect.mapError\` expresses the same error-type transformation more directly than \`Effect.${catchAllName}\` followed by \`Effect.fail\`.`,
|
|
33491
33573
|
fixes: [{
|
|
33492
33574
|
fixName: "catchAllToMapError_fix",
|
|
33493
33575
|
description: "Replace with Effect.mapError",
|
|
@@ -33551,7 +33633,7 @@ var catchUnfailableEffect = createDiagnostic({
|
|
|
33551
33633
|
if (E.flags & ts.TypeFlags.Never) {
|
|
33552
33634
|
report({
|
|
33553
33635
|
location: transformation.callee,
|
|
33554
|
-
messageText:
|
|
33636
|
+
messageText: "The previous Effect does not fail, so this error-handling branch will never run.",
|
|
33555
33637
|
fixes: []
|
|
33556
33638
|
});
|
|
33557
33639
|
}
|
|
@@ -33614,7 +33696,7 @@ var classSelfMismatch = createDiagnostic({
|
|
|
33614
33696
|
if (actualName !== expectedName) {
|
|
33615
33697
|
report({
|
|
33616
33698
|
location: selfTypeNode,
|
|
33617
|
-
messageText: `Self type parameter should be
|
|
33699
|
+
messageText: `The \`Self\` type parameter for this class should be \`${expectedName}\`.`,
|
|
33618
33700
|
fixes: [{
|
|
33619
33701
|
fixName: "classSelfMismatch_fix",
|
|
33620
33702
|
description: `Replace '${actualName}' with '${expectedName}'`,
|
|
@@ -33637,6 +33719,59 @@ var classSelfMismatch = createDiagnostic({
|
|
|
33637
33719
|
})
|
|
33638
33720
|
});
|
|
33639
33721
|
|
|
33722
|
+
// src/diagnostics/cryptoRandomUUIDInEffect.ts
|
|
33723
|
+
var makeCryptoRandomUUIDApply = (checkInEffect) => fn3(`cryptoRandomUUID${checkInEffect ? "InEffect" : ""}.apply`)(function* (sourceFile, report) {
|
|
33724
|
+
const ts = yield* service2(TypeScriptApi);
|
|
33725
|
+
const typeChecker = yield* service2(TypeCheckerApi);
|
|
33726
|
+
const typeCheckerUtils = yield* service2(TypeCheckerUtils);
|
|
33727
|
+
const typeParser = yield* service2(TypeParser);
|
|
33728
|
+
const cryptoSymbol = typeChecker.resolveName("crypto", void 0, ts.SymbolFlags.Value, false);
|
|
33729
|
+
if (!cryptoSymbol) return;
|
|
33730
|
+
const nodeToVisit = [];
|
|
33731
|
+
const appendNodeToVisit = (node) => {
|
|
33732
|
+
nodeToVisit.push(node);
|
|
33733
|
+
return void 0;
|
|
33734
|
+
};
|
|
33735
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
33736
|
+
while (nodeToVisit.length > 0) {
|
|
33737
|
+
const node = nodeToVisit.shift();
|
|
33738
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
33739
|
+
if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression) || ts.idText(node.expression.name) !== "randomUUID") continue;
|
|
33740
|
+
const symbol4 = typeChecker.getSymbolAtLocation(node.expression.expression);
|
|
33741
|
+
if (!symbol4) continue;
|
|
33742
|
+
if (typeCheckerUtils.resolveToGlobalSymbol(symbol4) !== cryptoSymbol) continue;
|
|
33743
|
+
const { inEffect } = yield* typeParser.findEnclosingScopes(node);
|
|
33744
|
+
if (inEffect !== checkInEffect) continue;
|
|
33745
|
+
report({
|
|
33746
|
+
location: node,
|
|
33747
|
+
messageText: checkInEffect ? "This Effect code uses `crypto.randomUUID()`, prefer the Effect `Random` module instead because it uses Effect-injected randomness rather than the `crypto` module behind the scenes." : "This code uses `crypto.randomUUID()`, prefer the Effect `Random` module instead because it uses Effect-injected randomness rather than the `crypto` module behind the scenes.",
|
|
33748
|
+
fixes: []
|
|
33749
|
+
});
|
|
33750
|
+
}
|
|
33751
|
+
});
|
|
33752
|
+
var cryptoRandomUUIDInEffect = createDiagnostic({
|
|
33753
|
+
name: "cryptoRandomUUIDInEffect",
|
|
33754
|
+
code: 67,
|
|
33755
|
+
description: "Warns when using crypto.randomUUID() inside Effect generators instead of the Effect Random module, which uses Effect-injected randomness rather than the crypto module behind the scenes",
|
|
33756
|
+
group: "effectNative",
|
|
33757
|
+
severity: "off",
|
|
33758
|
+
fixable: false,
|
|
33759
|
+
supportedEffect: ["v4"],
|
|
33760
|
+
apply: makeCryptoRandomUUIDApply(true)
|
|
33761
|
+
});
|
|
33762
|
+
|
|
33763
|
+
// src/diagnostics/cryptoRandomUUID.ts
|
|
33764
|
+
var cryptoRandomUUID = createDiagnostic({
|
|
33765
|
+
name: "cryptoRandomUUID",
|
|
33766
|
+
code: 66,
|
|
33767
|
+
description: "Warns when using crypto.randomUUID() outside Effect generators instead of the Effect Random module, which uses Effect-injected randomness rather than the crypto module behind the scenes",
|
|
33768
|
+
group: "effectNative",
|
|
33769
|
+
severity: "off",
|
|
33770
|
+
fixable: false,
|
|
33771
|
+
supportedEffect: ["v4"],
|
|
33772
|
+
apply: makeCryptoRandomUUIDApply(false)
|
|
33773
|
+
});
|
|
33774
|
+
|
|
33640
33775
|
// src/core/KeyBuilder.ts
|
|
33641
33776
|
var makeKeyBuilder = fn3("KeyBuilder")(
|
|
33642
33777
|
function* (sourceFile) {
|
|
@@ -33804,7 +33939,7 @@ var deterministicKeys = createDiagnostic({
|
|
|
33804
33939
|
if (actualIdentifier !== expectedKey) {
|
|
33805
33940
|
report({
|
|
33806
33941
|
location: keyStringLiteral,
|
|
33807
|
-
messageText: `
|
|
33942
|
+
messageText: `This key does not match the deterministic key for this declaration. The expected key is \`${expectedKey}\`.`,
|
|
33808
33943
|
fixes: [{
|
|
33809
33944
|
fixName: "deterministicKeys_fix",
|
|
33810
33945
|
description: `Replace '${actualIdentifier}' with '${expectedKey}'`,
|
|
@@ -33843,9 +33978,8 @@ var duplicatePackage = createDiagnostic({
|
|
|
33843
33978
|
const versions = Object.keys(resolvedPackages[packageName]);
|
|
33844
33979
|
report({
|
|
33845
33980
|
location: sourceFile.statements[0],
|
|
33846
|
-
messageText: `
|
|
33847
|
-
|
|
33848
|
-
If this is intended set the LSP config "allowedDuplicatedPackages" to ${JSON.stringify(options.allowedDuplicatedPackages.concat([packageName]))}.
|
|
33981
|
+
messageText: `Multiple versions of package \`${packageName}\` were detected: ${versions.join(", ")}. Package duplication can change runtime identity and type equality across Effect modules.
|
|
33982
|
+
If this is intentional, set the LSP config \`allowedDuplicatedPackages\` to ${JSON.stringify(options.allowedDuplicatedPackages.concat([packageName]))}.
|
|
33849
33983
|
|
|
33850
33984
|
${versions.map((version2) => `- found ${version2} at ${resolvedPackages[packageName][version2]}`).join("\n")}`,
|
|
33851
33985
|
fixes: []
|
|
@@ -33855,6 +33989,40 @@ ${versions.map((version2) => `- found ${version2} at ${resolvedPackages[packageN
|
|
|
33855
33989
|
})
|
|
33856
33990
|
});
|
|
33857
33991
|
|
|
33992
|
+
// src/diagnostics/effectDoNotation.ts
|
|
33993
|
+
var effectDoNotation = createDiagnostic({
|
|
33994
|
+
name: "effectDoNotation",
|
|
33995
|
+
code: 73,
|
|
33996
|
+
description: "Suggests using Effect.gen or Effect.fn instead of the Effect.Do notation helpers",
|
|
33997
|
+
group: "style",
|
|
33998
|
+
severity: "off",
|
|
33999
|
+
fixable: false,
|
|
34000
|
+
supportedEffect: ["v3", "v4"],
|
|
34001
|
+
apply: fn3("effectDoNotation.apply")(function* (sourceFile, report) {
|
|
34002
|
+
const ts = yield* service2(TypeScriptApi);
|
|
34003
|
+
const typeParser = yield* service2(TypeParser);
|
|
34004
|
+
const nodeToVisit = [];
|
|
34005
|
+
const appendNodeToVisit = (node) => {
|
|
34006
|
+
nodeToVisit.push(node);
|
|
34007
|
+
return void 0;
|
|
34008
|
+
};
|
|
34009
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
34010
|
+
while (nodeToVisit.length > 0) {
|
|
34011
|
+
const node = nodeToVisit.shift();
|
|
34012
|
+
const isReference2 = yield* orUndefined(typeParser.isNodeReferenceToEffectModuleApi("Do")(node));
|
|
34013
|
+
if (isReference2) {
|
|
34014
|
+
report({
|
|
34015
|
+
location: node,
|
|
34016
|
+
messageText: "This uses the Effect do emulation. `Effect.gen` or `Effect.fn` achieve the same result with native JS scopes.",
|
|
34017
|
+
fixes: []
|
|
34018
|
+
});
|
|
34019
|
+
continue;
|
|
34020
|
+
}
|
|
34021
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
34022
|
+
}
|
|
34023
|
+
})
|
|
34024
|
+
});
|
|
34025
|
+
|
|
33858
34026
|
// src/diagnostics/effectFnIife.ts
|
|
33859
34027
|
var effectFnIife = createDiagnostic({
|
|
33860
34028
|
name: "effectFnIife",
|
|
@@ -33953,7 +34121,7 @@ var effectFnIife = createDiagnostic({
|
|
|
33953
34121
|
const traceExpressionText = traceExpression ? sourceFile.text.slice(traceExpression.pos, traceExpression.end) : void 0;
|
|
33954
34122
|
report({
|
|
33955
34123
|
location: node,
|
|
33956
|
-
messageText:
|
|
34124
|
+
messageText: `\`${effectModuleName}.${kind}\` returns a reusable function that can take arguments, but it is invoked immediately here. \`Effect.gen\` represents the immediate-use form for this pattern${traceExpressionText ? ` with \`Effect.withSpan(${traceExpressionText})\` piped at the end to maintain tracing spans` : ``}.`,
|
|
33957
34125
|
fixes
|
|
33958
34126
|
});
|
|
33959
34127
|
}
|
|
@@ -34038,7 +34206,7 @@ var effectFnImplicitAny = createDiagnostic({
|
|
|
34038
34206
|
const parameterName = getParameterName(ts, parameter.name);
|
|
34039
34207
|
report({
|
|
34040
34208
|
location: parameter.name,
|
|
34041
|
-
messageText: `Parameter
|
|
34209
|
+
messageText: `Parameter \`${parameterName}\` implicitly has type \`any\` in \`Effect.fn\`, \`Effect.fnUntraced\`, or \`Effect.fnUntracedEager\`. No parameter type is available from an explicit annotation or contextual function type.`,
|
|
34042
34210
|
fixes: []
|
|
34043
34211
|
});
|
|
34044
34212
|
}
|
|
@@ -34634,7 +34802,7 @@ var effectFnOpportunity = createDiagnostic({
|
|
|
34634
34802
|
const expectedSignature = generateExpectedSignature();
|
|
34635
34803
|
report({
|
|
34636
34804
|
location: nameIdentifier ?? targetNode,
|
|
34637
|
-
messageText: `
|
|
34805
|
+
messageText: `This expression can be rewritten in the reusable function form \`${expectedSignature}\`.`,
|
|
34638
34806
|
fixes
|
|
34639
34807
|
});
|
|
34640
34808
|
}
|
|
@@ -34801,6 +34969,43 @@ var effectInVoidSuccess = createDiagnostic({
|
|
|
34801
34969
|
})
|
|
34802
34970
|
});
|
|
34803
34971
|
|
|
34972
|
+
// src/diagnostics/effectMapFlatten.ts
|
|
34973
|
+
var effectMapFlatten = createDiagnostic({
|
|
34974
|
+
name: "effectMapFlatten",
|
|
34975
|
+
code: 74,
|
|
34976
|
+
description: "Suggests using Effect.flatMap instead of Effect.map followed by Effect.flatten in piping flows",
|
|
34977
|
+
group: "style",
|
|
34978
|
+
severity: "suggestion",
|
|
34979
|
+
fixable: false,
|
|
34980
|
+
supportedEffect: ["v3", "v4"],
|
|
34981
|
+
apply: fn3("effectMapFlatten.apply")(function* (sourceFile, report) {
|
|
34982
|
+
const typeParser = yield* service2(TypeParser);
|
|
34983
|
+
const flows = yield* typeParser.pipingFlows(false)(sourceFile);
|
|
34984
|
+
for (const flow2 of flows) {
|
|
34985
|
+
for (let index = 0; index < flow2.transformations.length - 1; index++) {
|
|
34986
|
+
const mapTransformation = flow2.transformations[index];
|
|
34987
|
+
const flattenTransformation = flow2.transformations[index + 1];
|
|
34988
|
+
if (!mapTransformation || !flattenTransformation || !mapTransformation?.args || flattenTransformation?.args || mapTransformation.kind !== "pipe" && mapTransformation.kind !== "pipeable" || flattenTransformation.kind !== mapTransformation.kind) {
|
|
34989
|
+
continue;
|
|
34990
|
+
}
|
|
34991
|
+
const isMapCall = yield* orUndefined(
|
|
34992
|
+
typeParser.isNodeReferenceToEffectModuleApi("map")(mapTransformation.callee)
|
|
34993
|
+
);
|
|
34994
|
+
const isFlattenCall = yield* orUndefined(
|
|
34995
|
+
typeParser.isNodeReferenceToEffectModuleApi("flatten")(flattenTransformation.callee)
|
|
34996
|
+
);
|
|
34997
|
+
if (isMapCall && isFlattenCall) {
|
|
34998
|
+
report({
|
|
34999
|
+
location: flattenTransformation.callee,
|
|
35000
|
+
messageText: "`Effect.map` + `Effect.flatten` is the same as `Effect.flatMap` that expresses the same steps more directly.",
|
|
35001
|
+
fixes: []
|
|
35002
|
+
});
|
|
35003
|
+
}
|
|
35004
|
+
}
|
|
35005
|
+
}
|
|
35006
|
+
})
|
|
35007
|
+
});
|
|
35008
|
+
|
|
34804
35009
|
// src/diagnostics/effectMapVoid.ts
|
|
34805
35010
|
var effectMapVoid = createDiagnostic({
|
|
34806
35011
|
name: "effectMapVoid",
|
|
@@ -34846,7 +35051,7 @@ var effectMapVoid = createDiagnostic({
|
|
|
34846
35051
|
if (isNone2(match9)) continue;
|
|
34847
35052
|
report({
|
|
34848
35053
|
location: node.expression,
|
|
34849
|
-
messageText: "
|
|
35054
|
+
messageText: "This expression discards the success value through mapping. `Effect.asVoid` represents that form directly.",
|
|
34850
35055
|
fixes: [{
|
|
34851
35056
|
fixName: "effectMapVoid_fix",
|
|
34852
35057
|
description: "Replace with Effect.asVoid",
|
|
@@ -34901,7 +35106,7 @@ var effectSucceedWithVoid = createDiagnostic({
|
|
|
34901
35106
|
if (!tsUtils.isVoidExpression(argument)) continue;
|
|
34902
35107
|
report({
|
|
34903
35108
|
location: node,
|
|
34904
|
-
messageText: "Effect.void
|
|
35109
|
+
messageText: "`Effect.void` represents the same outcome as `Effect.succeed(undefined)` or `Effect.succeed(void 0)`.",
|
|
34905
35110
|
fixes: [{
|
|
34906
35111
|
fixName: "effectSucceedWithVoid_fix",
|
|
34907
35112
|
description: "Replace with Effect.void",
|
|
@@ -34963,7 +35168,7 @@ var extendsNativeError = createDiagnostic({
|
|
|
34963
35168
|
if (isNativeError) {
|
|
34964
35169
|
report({
|
|
34965
35170
|
location: node.name ?? typeExpression,
|
|
34966
|
-
messageText: "
|
|
35171
|
+
messageText: "This class extends the native `Error` type directly. Untagged native errors lose distinction in the Effect failure channel.",
|
|
34967
35172
|
fixes: []
|
|
34968
35173
|
});
|
|
34969
35174
|
}
|
|
@@ -35008,7 +35213,12 @@ var floatingEffect = createDiagnostic({
|
|
|
35008
35213
|
if (!isFloatingExpression(node)) continue;
|
|
35009
35214
|
const type = typeCheckerUtils.getTypeAtLocation(node.expression);
|
|
35010
35215
|
if (!type) continue;
|
|
35011
|
-
const effect2 = yield* option4(
|
|
35216
|
+
const effect2 = yield* option4(
|
|
35217
|
+
pipe(
|
|
35218
|
+
typeParser.effectType(type, node.expression),
|
|
35219
|
+
orElse5(() => typeParser.streamType(type, node.expression))
|
|
35220
|
+
)
|
|
35221
|
+
);
|
|
35012
35222
|
if (isSome2(effect2)) {
|
|
35013
35223
|
const allowedFloatingEffects = yield* pipe(
|
|
35014
35224
|
typeParser.fiberType(type, node.expression),
|
|
@@ -35017,10 +35227,9 @@ var floatingEffect = createDiagnostic({
|
|
|
35017
35227
|
);
|
|
35018
35228
|
if (isNone2(allowedFloatingEffects)) {
|
|
35019
35229
|
const isStrictEffect = yield* option4(typeParser.strictEffectType(type, node.expression));
|
|
35020
|
-
const name = isSome2(isStrictEffect) ? "Effect" : "Effect-able " + typeChecker.typeToString(type);
|
|
35021
35230
|
report({
|
|
35022
35231
|
location: node,
|
|
35023
|
-
messageText:
|
|
35232
|
+
messageText: isSome2(isStrictEffect) ? "This Effect value is neither yielded nor used in an assignment." : `This Effect-able \`${typeChecker.typeToString(type)}\` value is neither yielded nor assigned to a variable.`,
|
|
35024
35233
|
fixes: []
|
|
35025
35234
|
});
|
|
35026
35235
|
}
|
|
@@ -35064,6 +35273,7 @@ var genericEffectServices = createDiagnostic({
|
|
|
35064
35273
|
for (const [type, reportAt] of typesToCheck) {
|
|
35065
35274
|
yield* pipe(
|
|
35066
35275
|
typeParser.contextTag(type, node),
|
|
35276
|
+
orElse5(() => typeParser.serviceType(type, node)),
|
|
35067
35277
|
map12(() => {
|
|
35068
35278
|
report({
|
|
35069
35279
|
location: reportAt,
|
|
@@ -35115,7 +35325,7 @@ var makeGlobalConsoleApply = (checkInEffect) => fn3(`globalConsole${checkInEffec
|
|
|
35115
35325
|
if (inEffect !== checkInEffect) continue;
|
|
35116
35326
|
report({
|
|
35117
35327
|
location: node,
|
|
35118
|
-
messageText: checkInEffect ? `
|
|
35328
|
+
messageText: checkInEffect ? `This Effect code uses \`console.${method}\`, logging in Effect code is represented through \`${alternative}\`.` : `This code uses \`console.${method}\`, the corresponding Effect logging API is \`${alternative}\`.`,
|
|
35119
35329
|
fixes: []
|
|
35120
35330
|
});
|
|
35121
35331
|
}
|
|
@@ -35164,10 +35374,10 @@ var makeGlobalDateApply = (checkInEffect) => fn3(`globalDate${checkInEffect ? "I
|
|
|
35164
35374
|
let objectNode;
|
|
35165
35375
|
if (ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && ts.idText(node.expression.name) === "now") {
|
|
35166
35376
|
objectNode = node.expression.expression;
|
|
35167
|
-
messageText = checkInEffect ? "
|
|
35377
|
+
messageText = checkInEffect ? "This Effect code uses `Date.now()`, time access in Effect code is represented through `Clock` from Effect." : "This code uses `Date.now()`, time access is represented through `Clock` from Effect.";
|
|
35168
35378
|
} else if (ts.isNewExpression(node)) {
|
|
35169
35379
|
objectNode = node.expression;
|
|
35170
|
-
messageText = checkInEffect ? "
|
|
35380
|
+
messageText = checkInEffect ? "This Effect code constructs `new Date()`, date values in Effect code are represented through `DateTime` from Effect." : "This code constructs `new Date()`, date values are represented through `DateTime` from Effect.";
|
|
35171
35381
|
}
|
|
35172
35382
|
if (!messageText || !objectNode) continue;
|
|
35173
35383
|
const symbol4 = typeChecker.getSymbolAtLocation(objectNode);
|
|
@@ -35250,7 +35460,7 @@ var globalErrorInEffectCatch = createDiagnostic({
|
|
|
35250
35460
|
);
|
|
35251
35461
|
report({
|
|
35252
35462
|
location: node.expression,
|
|
35253
|
-
messageText: `The
|
|
35463
|
+
messageText: `The \`catch\` callback in \`${nodeText}\` returns the global \`Error\` type. Untagged errors merge together in the Effect error channel and lose type-level distinction; a tagged error preserves that distinction and can wrap the original error in a \`cause\` property.`,
|
|
35254
35464
|
fixes: []
|
|
35255
35465
|
});
|
|
35256
35466
|
}
|
|
@@ -35330,7 +35540,7 @@ var makeGlobalFetchApply = (checkInEffect) => fn3(`globalFetch${checkInEffect ?
|
|
|
35330
35540
|
if (!fetchSymbol) return;
|
|
35331
35541
|
const effectVersion = typeParser.supportedEffect();
|
|
35332
35542
|
const packageName = effectVersion === "v3" ? "@effect/platform" : "effect/unstable/http";
|
|
35333
|
-
const messageText = checkInEffect ? `
|
|
35543
|
+
const messageText = checkInEffect ? `This Effect code calls the global \`fetch\` function, HTTP requests in Effect code are represented through \`HttpClient\` from \`${packageName}\`.` : `This code uses the global \`fetch\` function, HTTP requests are represented through \`HttpClient\` from \`${packageName}\`.`;
|
|
35334
35544
|
const nodeToVisit = [];
|
|
35335
35545
|
const appendNodeToVisit = (node) => {
|
|
35336
35546
|
nodeToVisit.push(node);
|
|
@@ -35403,7 +35613,7 @@ var makeGlobalRandomApply = (checkInEffect) => fn3(`globalRandom${checkInEffect
|
|
|
35403
35613
|
if (inEffect !== checkInEffect) continue;
|
|
35404
35614
|
report({
|
|
35405
35615
|
location: node,
|
|
35406
|
-
messageText: checkInEffect ? "
|
|
35616
|
+
messageText: checkInEffect ? "This Effect code uses `Math.random()`, randomness is represented through the Effect `Random` service." : "This code uses `Math.random()`, randomness is represented through the Effect `Random` service.",
|
|
35407
35617
|
fixes: []
|
|
35408
35618
|
});
|
|
35409
35619
|
}
|
|
@@ -35434,12 +35644,12 @@ var globalRandom = createDiagnostic({
|
|
|
35434
35644
|
// src/diagnostics/globalTimersInEffect.ts
|
|
35435
35645
|
var timerAlternatives = {
|
|
35436
35646
|
"setTimeout": {
|
|
35437
|
-
inEffect: "
|
|
35438
|
-
outsideEffect: "
|
|
35647
|
+
inEffect: "This Effect code uses `setTimeout`, the corresponding timer API in this context is `Effect.sleep or Schedule` from Effect.",
|
|
35648
|
+
outsideEffect: "This code uses `setTimeout`, the corresponding Effect timer API is `Effect.sleep or Schedule` from Effect."
|
|
35439
35649
|
},
|
|
35440
35650
|
"setInterval": {
|
|
35441
|
-
inEffect: "
|
|
35442
|
-
outsideEffect: "
|
|
35651
|
+
inEffect: "This Effect code uses `setInterval`, the corresponding timer API in this context is `Schedule or Effect.repeat` from Effect.",
|
|
35652
|
+
outsideEffect: "This code uses `setInterval`, the corresponding Effect timer API is `Schedule or Effect.repeat` from Effect."
|
|
35443
35653
|
}
|
|
35444
35654
|
};
|
|
35445
35655
|
var makeGlobalTimersApply = (checkInEffect) => fn3(`globalTimers${checkInEffect ? "InEffect" : ""}.apply`)(function* (sourceFile, report) {
|
|
@@ -35681,7 +35891,7 @@ var instanceOfSchema = createDiagnostic({
|
|
|
35681
35891
|
if (isSchemaType._tag === "Some") {
|
|
35682
35892
|
report({
|
|
35683
35893
|
location: node,
|
|
35684
|
-
messageText: "
|
|
35894
|
+
messageText: "This code uses `instanceof` with an Effect Schema type. `Schema.is` is the schema-aware runtime check for this case.",
|
|
35685
35895
|
fixes: [{
|
|
35686
35896
|
fixName: "instanceOfSchema_fix",
|
|
35687
35897
|
description: "Replace with Schema.is",
|
|
@@ -35827,6 +36037,55 @@ var layerMergeAllWithDependencies = createDiagnostic({
|
|
|
35827
36037
|
})
|
|
35828
36038
|
});
|
|
35829
36039
|
|
|
36040
|
+
// src/diagnostics/lazyPromiseInEffectSync.ts
|
|
36041
|
+
var lazyPromiseInEffectSync = createDiagnostic({
|
|
36042
|
+
name: "lazyPromiseInEffectSync",
|
|
36043
|
+
code: 70,
|
|
36044
|
+
description: "Warns when Effect.sync lazily returns a Promise instead of using an async Effect constructor",
|
|
36045
|
+
group: "antipattern",
|
|
36046
|
+
severity: "warning",
|
|
36047
|
+
fixable: false,
|
|
36048
|
+
supportedEffect: ["v3", "v4"],
|
|
36049
|
+
apply: fn3("lazyPromiseInEffectSync.apply")(function* (sourceFile, report) {
|
|
36050
|
+
const ts = yield* service2(TypeScriptApi);
|
|
36051
|
+
const typeChecker = yield* service2(TypeCheckerApi);
|
|
36052
|
+
const typeCheckerUtils = yield* service2(TypeCheckerUtils);
|
|
36053
|
+
const typeParser = yield* service2(TypeParser);
|
|
36054
|
+
const nodeToVisit = [];
|
|
36055
|
+
const appendNodeToVisit = (node) => {
|
|
36056
|
+
nodeToVisit.push(node);
|
|
36057
|
+
return void 0;
|
|
36058
|
+
};
|
|
36059
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
36060
|
+
while (nodeToVisit.length > 0) {
|
|
36061
|
+
const node = nodeToVisit.shift();
|
|
36062
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
36063
|
+
if (!ts.isCallExpression(node)) continue;
|
|
36064
|
+
const isSyncCall = yield* orUndefined(
|
|
36065
|
+
typeParser.isNodeReferenceToEffectModuleApi("sync")(node.expression)
|
|
36066
|
+
);
|
|
36067
|
+
if (!isSyncCall) continue;
|
|
36068
|
+
const lazyArg = node.arguments[0];
|
|
36069
|
+
if (!lazyArg) continue;
|
|
36070
|
+
const lazyArgType = typeCheckerUtils.getTypeAtLocation(lazyArg);
|
|
36071
|
+
if (!lazyArgType) continue;
|
|
36072
|
+
const entries2 = typeCheckerUtils.unrollUnionMembers(lazyArgType).flatMap(
|
|
36073
|
+
(member) => typeChecker.getSignaturesOfType(member, ts.SignatureKind.Call).map(
|
|
36074
|
+
(signature) => typeParser.promiseType(typeChecker.getReturnTypeOfSignature(signature), lazyArg)
|
|
36075
|
+
)
|
|
36076
|
+
);
|
|
36077
|
+
if (entries2.length === 0) continue;
|
|
36078
|
+
const promiseReturn = yield* orUndefined(firstSuccessOf(entries2));
|
|
36079
|
+
if (!promiseReturn) continue;
|
|
36080
|
+
report({
|
|
36081
|
+
location: lazyArg,
|
|
36082
|
+
messageText: "This `Effect.sync` thunk returns a Promise. Use `Effect.promise` or `Effect.tryPromise` to represent async work.",
|
|
36083
|
+
fixes: []
|
|
36084
|
+
});
|
|
36085
|
+
}
|
|
36086
|
+
})
|
|
36087
|
+
});
|
|
36088
|
+
|
|
35830
36089
|
// src/diagnostics/leakingRequirements.ts
|
|
35831
36090
|
var leakingRequirements = createDiagnostic({
|
|
35832
36091
|
name: "leakingRequirements",
|
|
@@ -35951,7 +36210,7 @@ var leakingRequirements = createDiagnostic({
|
|
|
35951
36210
|
location: node,
|
|
35952
36211
|
messageText: `Methods of this Service require \`${requirementsStr}\` from every caller.
|
|
35953
36212
|
|
|
35954
|
-
|
|
36213
|
+
The requirement becomes part of the public service surface instead of remaining internal to Layer implementation.
|
|
35955
36214
|
|
|
35956
36215
|
Resolve these dependencies at Layer creation and provide them to each method, so the service's type reflects its purpose, not its implementation.
|
|
35957
36216
|
|
|
@@ -36148,7 +36407,7 @@ var missedPipeableOpportunity = createDiagnostic({
|
|
|
36148
36407
|
).trim() : "";
|
|
36149
36408
|
report({
|
|
36150
36409
|
location: flow2.node,
|
|
36151
|
-
messageText: `
|
|
36410
|
+
messageText: `This nested call structure has a pipeable form. \`${subjectText}.pipe(...)\` represents the same call sequence in pipe style and may be easier to read.`,
|
|
36152
36411
|
fixes: [{
|
|
36153
36412
|
fixName: "missedPipeableOpportunity_fix",
|
|
36154
36413
|
description: "Convert to pipe style",
|
|
@@ -36229,7 +36488,7 @@ var missingEffectContext = createDiagnostic({
|
|
|
36229
36488
|
(missingTypes) => missingTypes.length > 0 ? report(
|
|
36230
36489
|
{
|
|
36231
36490
|
location: node,
|
|
36232
|
-
messageText: `
|
|
36491
|
+
messageText: `This Effect requires a service that is missing from the expected Effect context: \`${sortTypes(missingTypes).map((_) => typeChecker.typeToString(_)).join(" | ")}\`.`,
|
|
36233
36492
|
fixes: []
|
|
36234
36493
|
}
|
|
36235
36494
|
) : void 0
|
|
@@ -36580,7 +36839,7 @@ var missingReturnYieldStar = createDiagnostic({
|
|
|
36580
36839
|
}];
|
|
36581
36840
|
report({
|
|
36582
36841
|
location: unwrapped,
|
|
36583
|
-
messageText:
|
|
36842
|
+
messageText: "This Effect never succeeds; using `return yield*` preserves a definitive generator exit point for type narrowing and tooling support.",
|
|
36584
36843
|
fixes: fix
|
|
36585
36844
|
});
|
|
36586
36845
|
}
|
|
@@ -36636,7 +36895,7 @@ var missingStarInYieldEffectGen = createDiagnostic({
|
|
|
36636
36895
|
brokenGenerators.forEach(
|
|
36637
36896
|
(pos) => report({
|
|
36638
36897
|
location: { pos, end: pos + "function".length },
|
|
36639
|
-
messageText: `
|
|
36898
|
+
messageText: "This uses `yield` for an `Effect` value. `yield*` is the Effect-aware form in this context.",
|
|
36640
36899
|
fixes: []
|
|
36641
36900
|
})
|
|
36642
36901
|
);
|
|
@@ -36658,7 +36917,7 @@ var missingStarInYieldEffectGen = createDiagnostic({
|
|
|
36658
36917
|
}] : [];
|
|
36659
36918
|
report({
|
|
36660
36919
|
location: node,
|
|
36661
|
-
messageText: `
|
|
36920
|
+
messageText: "This uses `yield` for an `Effect` value. `yield*` is the Effect-aware form in this context.",
|
|
36662
36921
|
fixes: fix
|
|
36663
36922
|
});
|
|
36664
36923
|
});
|
|
@@ -36726,7 +36985,7 @@ var multipleEffectProvide = createDiagnostic({
|
|
|
36726
36985
|
if (chunk.length < 2) continue;
|
|
36727
36986
|
report({
|
|
36728
36987
|
location: chunk[0].node,
|
|
36729
|
-
messageText: "
|
|
36988
|
+
messageText: "This expression chains multiple `Effect.provide` calls. Providing Layers in multiple calls in a chain can break service lifecycle behavior compared with a single combined provide with merged layers.",
|
|
36730
36989
|
fixes: [{
|
|
36731
36990
|
fixName: "multipleEffectProvide_fix",
|
|
36732
36991
|
description: "Combine into a single provide",
|
|
@@ -36760,6 +37019,74 @@ var multipleEffectProvide = createDiagnostic({
|
|
|
36760
37019
|
})
|
|
36761
37020
|
});
|
|
36762
37021
|
|
|
37022
|
+
// src/diagnostics/nestedEffectGenYield.ts
|
|
37023
|
+
var nestedEffectGenYield = createDiagnostic({
|
|
37024
|
+
name: "nestedEffectGenYield",
|
|
37025
|
+
code: 71,
|
|
37026
|
+
description: "Warns when yielding a nested bare Effect.gen inside an existing Effect generator context",
|
|
37027
|
+
group: "style",
|
|
37028
|
+
severity: "off",
|
|
37029
|
+
fixable: false,
|
|
37030
|
+
supportedEffect: ["v3", "v4"],
|
|
37031
|
+
apply: fn3("nestedEffectGenYield.apply")(function* (sourceFile, report) {
|
|
37032
|
+
const ts = yield* service2(TypeScriptApi);
|
|
37033
|
+
const typeParser = yield* service2(TypeParser);
|
|
37034
|
+
const nodeToVisit = [];
|
|
37035
|
+
const appendNodeToVisit = (node) => {
|
|
37036
|
+
nodeToVisit.push(node);
|
|
37037
|
+
return void 0;
|
|
37038
|
+
};
|
|
37039
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
37040
|
+
while (nodeToVisit.length > 0) {
|
|
37041
|
+
const node = nodeToVisit.shift();
|
|
37042
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
37043
|
+
if (!ts.isYieldExpression(node) || !node.asteriskToken || !node.expression) continue;
|
|
37044
|
+
const { inEffect } = yield* typeParser.findEnclosingScopes(node);
|
|
37045
|
+
if (!inEffect) continue;
|
|
37046
|
+
const bareNestedEffectGen = yield* orUndefined(typeParser.effectGen(node.expression));
|
|
37047
|
+
if (!bareNestedEffectGen) continue;
|
|
37048
|
+
report({
|
|
37049
|
+
location: node.expression,
|
|
37050
|
+
messageText: "This `yield*` is applied to a nested `Effect.gen(...)` that can be inlined in the parent Effect generator context.",
|
|
37051
|
+
fixes: []
|
|
37052
|
+
});
|
|
37053
|
+
}
|
|
37054
|
+
})
|
|
37055
|
+
});
|
|
37056
|
+
|
|
37057
|
+
// src/diagnostics/newPromise.ts
|
|
37058
|
+
var newPromise = createDiagnostic({
|
|
37059
|
+
name: "newPromise",
|
|
37060
|
+
code: 68,
|
|
37061
|
+
description: "Warns when constructing promises with new Promise instead of using Effect APIs",
|
|
37062
|
+
group: "effectNative",
|
|
37063
|
+
severity: "off",
|
|
37064
|
+
fixable: false,
|
|
37065
|
+
supportedEffect: ["v3", "v4"],
|
|
37066
|
+
apply: fn3("newPromise.apply")(function* (sourceFile, report) {
|
|
37067
|
+
const ts = yield* service2(TypeScriptApi);
|
|
37068
|
+
const typeChecker = yield* service2(TypeCheckerApi);
|
|
37069
|
+
const typeCheckerUtils = yield* service2(TypeCheckerUtils);
|
|
37070
|
+
const promiseSymbol = typeChecker.resolveName("Promise", void 0, ts.SymbolFlags.Value, false);
|
|
37071
|
+
if (!promiseSymbol) return;
|
|
37072
|
+
const visit = (node) => {
|
|
37073
|
+
if (ts.isNewExpression(node)) {
|
|
37074
|
+
const symbol4 = typeChecker.getSymbolAtLocation(node.expression);
|
|
37075
|
+
if (symbol4 && typeCheckerUtils.resolveToGlobalSymbol(symbol4) === promiseSymbol) {
|
|
37076
|
+
report({
|
|
37077
|
+
location: node,
|
|
37078
|
+
messageText: "This code constructs `new Promise(...)`, prefer Effect APIs such as `Effect.async`, `Effect.promise`, or `Effect.tryPromise` instead of manual Promise construction.",
|
|
37079
|
+
fixes: []
|
|
37080
|
+
});
|
|
37081
|
+
}
|
|
37082
|
+
}
|
|
37083
|
+
ts.forEachChild(node, visit);
|
|
37084
|
+
return void 0;
|
|
37085
|
+
};
|
|
37086
|
+
ts.forEachChild(sourceFile, visit);
|
|
37087
|
+
})
|
|
37088
|
+
});
|
|
37089
|
+
|
|
36763
37090
|
// src/diagnostics/nodeBuiltinImport.ts
|
|
36764
37091
|
var moduleAlternativesV3 = /* @__PURE__ */ new Map([
|
|
36765
37092
|
["fs", { alternative: "FileSystem", module: "fs", package: "@effect/platform" }],
|
|
@@ -36816,7 +37143,7 @@ var nodeBuiltinImport = createDiagnostic({
|
|
|
36816
37143
|
if (match9) {
|
|
36817
37144
|
report({
|
|
36818
37145
|
location: statement.moduleSpecifier,
|
|
36819
|
-
messageText: `
|
|
37146
|
+
messageText: `This module reference uses the \`${match9.module}\` module, the corresponding Effect API is \`${match9.alternative}\` from \`${match9.package}\`.`,
|
|
36820
37147
|
fixes: []
|
|
36821
37148
|
});
|
|
36822
37149
|
}
|
|
@@ -36829,7 +37156,7 @@ var nodeBuiltinImport = createDiagnostic({
|
|
|
36829
37156
|
if (match9) {
|
|
36830
37157
|
report({
|
|
36831
37158
|
location: arg,
|
|
36832
|
-
messageText: `
|
|
37159
|
+
messageText: `This module reference uses the \`${match9.module}\` module, the corresponding Effect API is \`${match9.alternative}\` from \`${match9.package}\`.`,
|
|
36833
37160
|
fixes: []
|
|
36834
37161
|
});
|
|
36835
37162
|
}
|
|
@@ -36883,7 +37210,7 @@ var nonObjectEffectServiceType = createDiagnostic({
|
|
|
36883
37210
|
const propertyValue = property.initializer;
|
|
36884
37211
|
const errorToReport = {
|
|
36885
37212
|
location: property.name,
|
|
36886
|
-
messageText: "Effect.Service
|
|
37213
|
+
messageText: "`Effect.Service` is declared with a primitive service type. `Effect.Service` models object-shaped services; primitive values use `Context.Tag` or `Effect.Tag` directly.",
|
|
36887
37214
|
fixes: []
|
|
36888
37215
|
};
|
|
36889
37216
|
if (propertyName === "succeed") {
|
|
@@ -37103,6 +37430,14 @@ var effectModuleMigrationDb = {
|
|
|
37103
37430
|
"yieldNow": asUnchanged,
|
|
37104
37431
|
"zip": asUnchanged,
|
|
37105
37432
|
"zipWith": asUnchanged,
|
|
37433
|
+
"annotateLogsScoped": asUnchanged,
|
|
37434
|
+
"awaitAllChildren": asUnchanged,
|
|
37435
|
+
"bind": asUnchanged,
|
|
37436
|
+
"bindTo": asUnchanged,
|
|
37437
|
+
"Do": asUnchanged,
|
|
37438
|
+
"let": asUnchanged,
|
|
37439
|
+
"partition": asUnchanged,
|
|
37440
|
+
"validate": asUnchanged,
|
|
37106
37441
|
// Renamed APIs (v3 name → v4 name)
|
|
37107
37442
|
"catchAll": asRenamedSameBehaviour("catch"),
|
|
37108
37443
|
"catchAllCause": asRenamedSameBehaviour("catchCause"),
|
|
@@ -37122,14 +37457,6 @@ var effectModuleMigrationDb = {
|
|
|
37122
37457
|
"serviceOptional": asRenamedSameBehaviour("serviceOption"),
|
|
37123
37458
|
"tapErrorCause": asRenamedSameBehaviour("tapCause"),
|
|
37124
37459
|
// Removed APIs
|
|
37125
|
-
"annotateLogsScoped": asUnchanged,
|
|
37126
|
-
"awaitAllChildren": asUnchanged,
|
|
37127
|
-
"bind": asUnchanged,
|
|
37128
|
-
"bindTo": asUnchanged,
|
|
37129
|
-
"Do": asUnchanged,
|
|
37130
|
-
"let": asUnchanged,
|
|
37131
|
-
"partition": asUnchanged,
|
|
37132
|
-
"validate": asUnchanged,
|
|
37133
37460
|
"catchSomeDefect": asRemoved(
|
|
37134
37461
|
"Use Effect.catchDefect or Effect.matchCause to handle specific defects."
|
|
37135
37462
|
),
|
|
@@ -37645,7 +37972,7 @@ var outdatedApi = createDiagnostic({
|
|
|
37645
37972
|
hasReported = true;
|
|
37646
37973
|
report({
|
|
37647
37974
|
location: propertyAccess.name,
|
|
37648
|
-
messageText:
|
|
37975
|
+
messageText: `This project targets Effect v4, but this code uses the Effect v3 API \`${propertyName}\`. The referenced API belongs to the v3 surface rather than the configured v4 surface.`,
|
|
37649
37976
|
fixes: []
|
|
37650
37977
|
});
|
|
37651
37978
|
}
|
|
@@ -37688,7 +38015,7 @@ var outdatedApi = createDiagnostic({
|
|
|
37688
38015
|
if (hasReported) {
|
|
37689
38016
|
report({
|
|
37690
38017
|
location: { pos: 0, end: 0 },
|
|
37691
|
-
messageText: "This project targets Effect v4, but
|
|
38018
|
+
messageText: "This project targets Effect v4, but this code uses Effect v3 APIs. The referenced API belongs to the v3 surface rather than the configured v4 surface.",
|
|
37692
38019
|
fixes: []
|
|
37693
38020
|
});
|
|
37694
38021
|
}
|
|
@@ -37864,7 +38191,7 @@ var overriddenSchemaConstructor = createDiagnostic({
|
|
|
37864
38191
|
};
|
|
37865
38192
|
report({
|
|
37866
38193
|
location: member,
|
|
37867
|
-
messageText: "
|
|
38194
|
+
messageText: "This Schema subclass defines its own constructor. For Schema classes, constructor overrides break decoding behavior for the class shape. Custom construction can be expressed through a static `new` method instead.",
|
|
37868
38195
|
fixes: (member.body ? [fixAsStaticNew] : []).concat([{
|
|
37869
38196
|
fixName: "overriddenSchemaConstructor_fix",
|
|
37870
38197
|
description: "Remove the constructor override",
|
|
@@ -37986,7 +38313,7 @@ var preferSchemaOverJson = createDiagnostic({
|
|
|
37986
38313
|
if (isSome2(match9)) {
|
|
37987
38314
|
report({
|
|
37988
38315
|
location: match9.value,
|
|
37989
|
-
messageText: "
|
|
38316
|
+
messageText: "This code uses `JSON.parse` or `JSON.stringify`. Effect Schema provides Effect-aware APIs for JSON parsing and stringifying.",
|
|
37990
38317
|
fixes: []
|
|
37991
38318
|
});
|
|
37992
38319
|
}
|
|
@@ -37994,6 +38321,63 @@ var preferSchemaOverJson = createDiagnostic({
|
|
|
37994
38321
|
})
|
|
37995
38322
|
});
|
|
37996
38323
|
|
|
38324
|
+
// src/diagnostics/processEnvInEffect.ts
|
|
38325
|
+
var isEnvPropertyAccess = (tsApi, node) => tsApi.isPropertyAccessExpression(node) && tsApi.idText(node.name) === "env";
|
|
38326
|
+
var isProcessEnvMemberAccess = (tsApi, node) => (tsApi.isPropertyAccessExpression(node) || tsApi.isElementAccessExpression(node)) && isEnvPropertyAccess(tsApi, node.expression);
|
|
38327
|
+
var makeProcessEnvApply = (checkInEffect) => fn3(`processEnv${checkInEffect ? "InEffect" : ""}.apply`)(function* (sourceFile, report) {
|
|
38328
|
+
const ts = yield* service2(TypeScriptApi);
|
|
38329
|
+
const typeChecker = yield* service2(TypeCheckerApi);
|
|
38330
|
+
const typeCheckerUtils = yield* service2(TypeCheckerUtils);
|
|
38331
|
+
const typeParser = yield* service2(TypeParser);
|
|
38332
|
+
const processSymbol = typeChecker.resolveName("process", void 0, ts.SymbolFlags.Value, false);
|
|
38333
|
+
if (!processSymbol) return;
|
|
38334
|
+
const nodeToVisit = [];
|
|
38335
|
+
const appendNodeToVisit = (node) => {
|
|
38336
|
+
nodeToVisit.push(node);
|
|
38337
|
+
return void 0;
|
|
38338
|
+
};
|
|
38339
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
38340
|
+
while (nodeToVisit.length > 0) {
|
|
38341
|
+
const node = nodeToVisit.shift();
|
|
38342
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
38343
|
+
if (!isProcessEnvMemberAccess(ts, node)) continue;
|
|
38344
|
+
const processNode = node.expression.expression;
|
|
38345
|
+
if (!ts.isIdentifier(processNode) || ts.idText(processNode) !== "process") continue;
|
|
38346
|
+
const symbol4 = typeChecker.getSymbolAtLocation(processNode);
|
|
38347
|
+
if (!symbol4) continue;
|
|
38348
|
+
if (typeCheckerUtils.resolveToGlobalSymbol(symbol4) !== processSymbol) continue;
|
|
38349
|
+
const { inEffect } = yield* typeParser.findEnclosingScopes(node);
|
|
38350
|
+
if (inEffect !== checkInEffect) continue;
|
|
38351
|
+
report({
|
|
38352
|
+
location: node,
|
|
38353
|
+
messageText: checkInEffect ? "This Effect code reads from `process.env`, environment configuration in Effect code is represented through `Config` from Effect." : "This code reads from `process.env`, environment configuration is represented through `Config` from Effect.",
|
|
38354
|
+
fixes: []
|
|
38355
|
+
});
|
|
38356
|
+
}
|
|
38357
|
+
});
|
|
38358
|
+
var processEnvInEffect = createDiagnostic({
|
|
38359
|
+
name: "processEnvInEffect",
|
|
38360
|
+
code: 65,
|
|
38361
|
+
description: "Warns when reading process.env inside Effect generators instead of using Effect Config",
|
|
38362
|
+
group: "effectNative",
|
|
38363
|
+
severity: "off",
|
|
38364
|
+
fixable: false,
|
|
38365
|
+
supportedEffect: ["v3", "v4"],
|
|
38366
|
+
apply: makeProcessEnvApply(true)
|
|
38367
|
+
});
|
|
38368
|
+
|
|
38369
|
+
// src/diagnostics/processEnv.ts
|
|
38370
|
+
var processEnv = createDiagnostic({
|
|
38371
|
+
name: "processEnv",
|
|
38372
|
+
code: 64,
|
|
38373
|
+
description: "Warns when reading process.env outside Effect generators instead of using Effect Config",
|
|
38374
|
+
group: "effectNative",
|
|
38375
|
+
severity: "off",
|
|
38376
|
+
fixable: false,
|
|
38377
|
+
supportedEffect: ["v3", "v4"],
|
|
38378
|
+
apply: makeProcessEnvApply(false)
|
|
38379
|
+
});
|
|
38380
|
+
|
|
37997
38381
|
// src/diagnostics/redundantSchemaTagIdentifier.ts
|
|
37998
38382
|
var redundantSchemaTagIdentifier = createDiagnostic({
|
|
37999
38383
|
name: "redundantSchemaTagIdentifier",
|
|
@@ -38104,9 +38488,7 @@ var returnEffectInGen = createDiagnostic({
|
|
|
38104
38488
|
}] : [];
|
|
38105
38489
|
report({
|
|
38106
38490
|
location: node,
|
|
38107
|
-
messageText:
|
|
38108
|
-
Maybe you wanted to return yield* instead?
|
|
38109
|
-
Nested Effect-able types may be intended if you plan to later manually flatten or unwrap this Effect, if so you can safely disable this diagnostic for this line through quickfixes.`,
|
|
38491
|
+
messageText: "This generator returns an Effect-able value directly, which produces a nested `Effect<Effect<...>>`. If the intended result is the inner Effect value, `return yield*` represents that form.",
|
|
38110
38492
|
fixes: fix
|
|
38111
38493
|
});
|
|
38112
38494
|
}),
|
|
@@ -38261,9 +38643,7 @@ var runEffectInsideEffect = createDiagnostic({
|
|
|
38261
38643
|
);
|
|
38262
38644
|
});
|
|
38263
38645
|
const v4MethodName = `${isEffectRunCall.value.methodName}With`;
|
|
38264
|
-
const messageText = supportedEffect === "v4" ?
|
|
38265
|
-
Consider extracting the current services by using for example Effect.services and then use Effect.${v4MethodName} with the extracted services instead.` : `Using ${nodeText} inside an Effect is not recommended. The same runtime should generally be used instead to run child effects.
|
|
38266
|
-
Consider extracting the Runtime by using for example Effect.runtime and then use Runtime.${isEffectRunCall.value.methodName} with the extracted runtime instead.`;
|
|
38646
|
+
const messageText = supportedEffect === "v4" ? `\`${nodeText}\` is called inside an Effect with a separate services invocation. In this context, child Effects run with the surrounding services, which can be accessed through \`Effect.services\` and \`Effect.${v4MethodName}\`.` : `\`${nodeText}\` is called inside an Effect with a separate runtime invocation. In this context, run child Effects with the surrounding runtime, which can be accessed through \`Effect.runtime\` and \`Runtime.${isEffectRunCall.value.methodName}\`.`;
|
|
38267
38647
|
report({
|
|
38268
38648
|
location: node.expression,
|
|
38269
38649
|
messageText,
|
|
@@ -38276,7 +38656,7 @@ Consider extracting the Runtime by using for example Effect.runtime and then use
|
|
|
38276
38656
|
} else {
|
|
38277
38657
|
report({
|
|
38278
38658
|
location: node.expression,
|
|
38279
|
-
messageText:
|
|
38659
|
+
messageText: `\`${nodeText}\` is called inside an existing Effect context. Here, the inner Effect can be used directly.`,
|
|
38280
38660
|
fixes: []
|
|
38281
38661
|
});
|
|
38282
38662
|
}
|
|
@@ -38331,7 +38711,7 @@ var schemaStructWithTag = createDiagnostic({
|
|
|
38331
38711
|
const otherProperties = arg.properties.filter((prop) => prop !== tagProperty);
|
|
38332
38712
|
report({
|
|
38333
38713
|
location: node,
|
|
38334
|
-
messageText: "Schema.Struct
|
|
38714
|
+
messageText: "This `Schema.Struct` includes a `_tag` field. `Schema.TaggedStruct` is the tagged-struct form for this pattern and makes the tag optional in the constructor.",
|
|
38335
38715
|
fixes: [{
|
|
38336
38716
|
fixName: "schemaStructWithTag_fix",
|
|
38337
38717
|
description: "Replace with Schema.TaggedStruct",
|
|
@@ -38424,7 +38804,7 @@ var schemaSyncInEffect = createDiagnostic({
|
|
|
38424
38804
|
const effectMethodName = syncToEffectMethod[isSchemaSyncCall.value.methodName];
|
|
38425
38805
|
report({
|
|
38426
38806
|
location: node.expression,
|
|
38427
|
-
messageText:
|
|
38807
|
+
messageText: `\`${nodeText}\` is used inside an Effect generator. \`Schema.${effectMethodName}\` preserves the typed Effect error channel for this operation without throwing.`,
|
|
38428
38808
|
fixes: []
|
|
38429
38809
|
});
|
|
38430
38810
|
}
|
|
@@ -38484,7 +38864,7 @@ var schemaUnionOfLiterals = createDiagnostic({
|
|
|
38484
38864
|
const schemaLiteralExpression = firstLiteralCall.expression;
|
|
38485
38865
|
report({
|
|
38486
38866
|
location: node,
|
|
38487
|
-
messageText: "
|
|
38867
|
+
messageText: "This `Schema.Union` contains multiple `Schema.Literal` members and can be simplified to a single `Schema.Literal` call.",
|
|
38488
38868
|
fixes: [{
|
|
38489
38869
|
fixName: "schemaUnionOfLiterals_fix",
|
|
38490
38870
|
description: "Replace with a single Schema.Literal call",
|
|
@@ -38547,8 +38927,7 @@ var scopeInLayerEffect = createDiagnostic({
|
|
|
38547
38927
|
map12(
|
|
38548
38928
|
() => report({
|
|
38549
38929
|
location: node,
|
|
38550
|
-
messageText: `
|
|
38551
|
-
Consider using "scoped" instead to get rid of the scope in the requirements.`,
|
|
38930
|
+
messageText: "This layer construction leaves `Scope` in the requirement set. The scoped API removes `Scope` from the resulting requirements.",
|
|
38552
38931
|
fixes: methodIdentifier ? [{
|
|
38553
38932
|
fixName: "scopeInLayerEffect_scoped",
|
|
38554
38933
|
description: "Use scoped for Layer creation",
|
|
@@ -38648,7 +39027,7 @@ var serviceNotAsClass = createDiagnostic({
|
|
|
38648
39027
|
const shapeText = typeArgs.length > 0 ? typeArgs.map((t) => sourceFile.text.substring(ts.getTokenPosOfNode(t, sourceFile), t.end)).join(", ") : "Shape";
|
|
38649
39028
|
report({
|
|
38650
39029
|
location: callExpr,
|
|
38651
|
-
messageText:
|
|
39030
|
+
messageText: `\`ServiceMap.Service\` is assigned to a variable here, but this API is intended for a class declaration shape such as \`class ${variableName} extends ServiceMap.Service<${variableName}, ${shapeText}>()("${argsText.replace(/['"]/g, "")}") {}\`.`,
|
|
38652
39031
|
fixes: [{
|
|
38653
39032
|
fixName: "serviceNotAsClass",
|
|
38654
39033
|
description: `Convert to class declaration`,
|
|
@@ -38861,7 +39240,7 @@ var tryCatchInEffectGen = createDiagnostic({
|
|
|
38861
39240
|
map12(() => {
|
|
38862
39241
|
report({
|
|
38863
39242
|
location: node,
|
|
38864
|
-
messageText: `
|
|
39243
|
+
messageText: `This Effect generator contains \`try/catch\`; in this context, error handling is expressed with Effect APIs such as ${alternatives.join(", ")}).`,
|
|
38865
39244
|
fixes: []
|
|
38866
39245
|
});
|
|
38867
39246
|
}),
|
|
@@ -38922,8 +39301,7 @@ var unknownInEffectCatch = createDiagnostic({
|
|
|
38922
39301
|
);
|
|
38923
39302
|
report({
|
|
38924
39303
|
location: node.expression,
|
|
38925
|
-
messageText: `The
|
|
38926
|
-
Consider wrapping unknown errors into Effect's Data.TaggedError for example, or narrow down the type to the specific error raised.`,
|
|
39304
|
+
messageText: `The \`catch\` callback in \`${nodeText}\` returns \`unknown\`, so the Effect error type stays untyped. A specific typed error preserves error-channel information, for example by narrowing the value or wrapping it in \`Data.TaggedError\`.`,
|
|
38927
39305
|
fixes: []
|
|
38928
39306
|
});
|
|
38929
39307
|
}
|
|
@@ -38937,6 +39315,56 @@ Consider wrapping unknown errors into Effect's Data.TaggedError for example, or
|
|
|
38937
39315
|
})
|
|
38938
39316
|
});
|
|
38939
39317
|
|
|
39318
|
+
// src/diagnostics/unnecessaryArrowBlock.ts
|
|
39319
|
+
var unnecessaryArrowBlock = createDiagnostic({
|
|
39320
|
+
name: "unnecessaryArrowBlock",
|
|
39321
|
+
code: 72,
|
|
39322
|
+
description: "Suggests using a concise arrow body when the block only returns an expression",
|
|
39323
|
+
group: "style",
|
|
39324
|
+
severity: "off",
|
|
39325
|
+
fixable: true,
|
|
39326
|
+
supportedEffect: ["v3", "v4"],
|
|
39327
|
+
apply: fn3("unnecessaryArrowBlock.apply")(function* (sourceFile, report) {
|
|
39328
|
+
const ts = yield* service2(TypeScriptApi);
|
|
39329
|
+
const nodeToVisit = [];
|
|
39330
|
+
const appendNodeToVisit = (node) => {
|
|
39331
|
+
nodeToVisit.push(node);
|
|
39332
|
+
return void 0;
|
|
39333
|
+
};
|
|
39334
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
39335
|
+
while (nodeToVisit.length > 0) {
|
|
39336
|
+
const node = nodeToVisit.shift();
|
|
39337
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
39338
|
+
if (!ts.isArrowFunction(node) || !ts.isBlock(node.body)) continue;
|
|
39339
|
+
if (node.body.statements.length !== 1) continue;
|
|
39340
|
+
const [statement] = node.body.statements;
|
|
39341
|
+
if (!ts.isReturnStatement(statement) || !statement.expression) continue;
|
|
39342
|
+
const returnedExpression = statement.expression;
|
|
39343
|
+
report({
|
|
39344
|
+
location: node.body,
|
|
39345
|
+
messageText: "This arrow function block only returns an expression and can use a concise body.",
|
|
39346
|
+
fixes: [{
|
|
39347
|
+
fixName: "unnecessaryArrowBlock_fix",
|
|
39348
|
+
description: "Use a concise arrow body",
|
|
39349
|
+
apply: gen3(function* () {
|
|
39350
|
+
const changeTracker = yield* service2(ChangeTracker);
|
|
39351
|
+
const replacementNode = ts.factory.updateArrowFunction(
|
|
39352
|
+
node,
|
|
39353
|
+
node.modifiers,
|
|
39354
|
+
node.typeParameters,
|
|
39355
|
+
node.parameters,
|
|
39356
|
+
node.type,
|
|
39357
|
+
node.equalsGreaterThanToken,
|
|
39358
|
+
ts.factory.createParenthesizedExpression(returnedExpression)
|
|
39359
|
+
);
|
|
39360
|
+
changeTracker.replaceNode(sourceFile, node, replacementNode);
|
|
39361
|
+
})
|
|
39362
|
+
}]
|
|
39363
|
+
});
|
|
39364
|
+
}
|
|
39365
|
+
})
|
|
39366
|
+
});
|
|
39367
|
+
|
|
38940
39368
|
// src/diagnostics/unnecessaryEffectGen.ts
|
|
38941
39369
|
var unnecessaryEffectGen = createDiagnostic({
|
|
38942
39370
|
name: "unnecessaryEffectGen",
|
|
@@ -39020,7 +39448,7 @@ var unnecessaryFailYieldableError = createDiagnostic({
|
|
|
39020
39448
|
map12(
|
|
39021
39449
|
() => report({
|
|
39022
39450
|
location: node,
|
|
39023
|
-
messageText:
|
|
39451
|
+
messageText: "This `yield* Effect.fail(...)` passes a yieldable error value. `yield*` represents that value directly without wrapping it in `Effect.fail`.",
|
|
39024
39452
|
fixes: [{
|
|
39025
39453
|
fixName: "unnecessaryFailYieldableError_fix",
|
|
39026
39454
|
description: "Replace yield* Effect.fail with yield*",
|
|
@@ -39125,7 +39553,7 @@ var unnecessaryPipeChain = createDiagnostic({
|
|
|
39125
39553
|
map12(({ innerCall, pipeCall }) => {
|
|
39126
39554
|
report({
|
|
39127
39555
|
location: node,
|
|
39128
|
-
messageText: `
|
|
39556
|
+
messageText: "This expression contains chained `pipe` calls that can be simplified to a single `pipe` call.",
|
|
39129
39557
|
fixes: [{
|
|
39130
39558
|
fixName: "unnecessaryPipeChain_fix",
|
|
39131
39559
|
description: "Rewrite as single pipe call",
|
|
@@ -39237,12 +39665,17 @@ var unsupportedServiceAccessors = createDiagnostic({
|
|
|
39237
39665
|
var diagnostics = [
|
|
39238
39666
|
outdatedApi,
|
|
39239
39667
|
anyUnknownInErrorContext,
|
|
39668
|
+
asyncFunction,
|
|
39240
39669
|
instanceOfSchema,
|
|
39241
39670
|
catchAllToMapError,
|
|
39242
39671
|
catchUnfailableEffect,
|
|
39243
39672
|
classSelfMismatch,
|
|
39673
|
+
cryptoRandomUUID,
|
|
39674
|
+
cryptoRandomUUIDInEffect,
|
|
39244
39675
|
duplicatePackage,
|
|
39676
|
+
effectDoNotation,
|
|
39245
39677
|
effectFnImplicitAny,
|
|
39678
|
+
effectMapFlatten,
|
|
39246
39679
|
effectGenUsesAdapter,
|
|
39247
39680
|
missingEffectContext,
|
|
39248
39681
|
missingEffectError,
|
|
@@ -39251,6 +39684,8 @@ var diagnostics = [
|
|
|
39251
39684
|
floatingEffect,
|
|
39252
39685
|
effectInFailure,
|
|
39253
39686
|
missingStarInYieldEffectGen,
|
|
39687
|
+
newPromise,
|
|
39688
|
+
lazyPromiseInEffectSync,
|
|
39254
39689
|
unnecessaryEffectGen,
|
|
39255
39690
|
unnecessaryFailYieldableError,
|
|
39256
39691
|
missingReturnYieldStar,
|
|
@@ -39259,6 +39694,8 @@ var diagnostics = [
|
|
|
39259
39694
|
genericEffectServices,
|
|
39260
39695
|
globalFetch,
|
|
39261
39696
|
globalFetchInEffect,
|
|
39697
|
+
processEnv,
|
|
39698
|
+
processEnvInEffect,
|
|
39262
39699
|
returnEffectInGen,
|
|
39263
39700
|
tryCatchInEffectGen,
|
|
39264
39701
|
importFromBarrel,
|
|
@@ -39276,6 +39713,8 @@ var diagnostics = [
|
|
|
39276
39713
|
strictEffectProvide,
|
|
39277
39714
|
unknownInEffectCatch,
|
|
39278
39715
|
runEffectInsideEffect,
|
|
39716
|
+
nestedEffectGenYield,
|
|
39717
|
+
unnecessaryArrowBlock,
|
|
39279
39718
|
schemaUnionOfLiterals,
|
|
39280
39719
|
schemaStructWithTag,
|
|
39281
39720
|
globalErrorInEffectCatch,
|
|
@@ -39330,9 +39769,15 @@ var metadata_default = {
|
|
|
39330
39769
|
name: "effect-native",
|
|
39331
39770
|
description: "Enable all Effect-native diagnostics at warning level.",
|
|
39332
39771
|
diagnosticSeverity: {
|
|
39772
|
+
asyncFunction: "warning",
|
|
39333
39773
|
instanceOfSchema: "warning",
|
|
39774
|
+
cryptoRandomUUID: "warning",
|
|
39775
|
+
cryptoRandomUUIDInEffect: "warning",
|
|
39776
|
+
newPromise: "warning",
|
|
39334
39777
|
globalFetch: "warning",
|
|
39335
39778
|
globalFetchInEffect: "warning",
|
|
39779
|
+
processEnv: "warning",
|
|
39780
|
+
processEnvInEffect: "warning",
|
|
39336
39781
|
preferSchemaOverJson: "warning",
|
|
39337
39782
|
extendsNativeError: "warning",
|
|
39338
39783
|
nodeBuiltinImport: "warning",
|
|
@@ -39395,7 +39840,7 @@ var metadata_default = {
|
|
|
39395
39840
|
{
|
|
39396
39841
|
start: 154,
|
|
39397
39842
|
end: 169,
|
|
39398
|
-
text: "Self type parameter should be
|
|
39843
|
+
text: "The `Self` type parameter for this class should be `InvalidContextTag`. effect(classSelfMismatch)"
|
|
39399
39844
|
}
|
|
39400
39845
|
]
|
|
39401
39846
|
}
|
|
@@ -39431,7 +39876,7 @@ var metadata_default = {
|
|
|
39431
39876
|
{
|
|
39432
39877
|
start: 86,
|
|
39433
39878
|
end: 91,
|
|
39434
|
-
text: "Parameter
|
|
39879
|
+
text: "Parameter `input` implicitly has type `any` in `Effect.fn`, `Effect.fnUntraced`, or `Effect.fnUntracedEager`. No parameter type is available from an explicit annotation or contextual function type. effect(effectFnImplicitAny)"
|
|
39435
39880
|
}
|
|
39436
39881
|
]
|
|
39437
39882
|
}
|
|
@@ -39452,7 +39897,7 @@ var metadata_default = {
|
|
|
39452
39897
|
{
|
|
39453
39898
|
start: 41,
|
|
39454
39899
|
end: 64,
|
|
39455
|
-
text: "Effect
|
|
39900
|
+
text: "This Effect value is neither yielded nor used in an assignment. effect(floatingEffect)"
|
|
39456
39901
|
}
|
|
39457
39902
|
]
|
|
39458
39903
|
}
|
|
@@ -39494,7 +39939,7 @@ var metadata_default = {
|
|
|
39494
39939
|
{
|
|
39495
39940
|
start: 160,
|
|
39496
39941
|
end: 167,
|
|
39497
|
-
text: "
|
|
39942
|
+
text: "This Effect requires a service that is missing from the expected Effect context: `Db`. effect(missingEffectContext)"
|
|
39498
39943
|
}
|
|
39499
39944
|
]
|
|
39500
39945
|
}
|
|
@@ -39557,7 +40002,7 @@ var metadata_default = {
|
|
|
39557
40002
|
{
|
|
39558
40003
|
start: 121,
|
|
39559
40004
|
end: 147,
|
|
39560
|
-
text: "
|
|
40005
|
+
text: "This Effect never succeeds; using `return yield*` preserves a definitive generator exit point for type narrowing and tooling support. effect(missingReturnYieldStar)"
|
|
39561
40006
|
}
|
|
39562
40007
|
]
|
|
39563
40008
|
}
|
|
@@ -39578,12 +40023,12 @@ var metadata_default = {
|
|
|
39578
40023
|
{
|
|
39579
40024
|
start: 75,
|
|
39580
40025
|
end: 83,
|
|
39581
|
-
text: "
|
|
40026
|
+
text: "This uses `yield` for an `Effect` value. `yield*` is the Effect-aware form in this context. effect(missingStarInYieldEffectGen)"
|
|
39582
40027
|
},
|
|
39583
40028
|
{
|
|
39584
40029
|
start: 105,
|
|
39585
40030
|
end: 128,
|
|
39586
|
-
text: "
|
|
40031
|
+
text: "This uses `yield` for an `Effect` value. `yield*` is the Effect-aware form in this context. effect(missingStarInYieldEffectGen)"
|
|
39587
40032
|
}
|
|
39588
40033
|
]
|
|
39589
40034
|
}
|
|
@@ -39603,7 +40048,7 @@ var metadata_default = {
|
|
|
39603
40048
|
{
|
|
39604
40049
|
start: 142,
|
|
39605
40050
|
end: 149,
|
|
39606
|
-
text: "Effect.Service
|
|
40051
|
+
text: "`Effect.Service` is declared with a primitive service type. `Effect.Service` models object-shaped services; primitive values use `Context.Tag` or `Effect.Tag` directly. effect(nonObjectEffectServiceType)"
|
|
39607
40052
|
}
|
|
39608
40053
|
]
|
|
39609
40054
|
}
|
|
@@ -39623,12 +40068,12 @@ var metadata_default = {
|
|
|
39623
40068
|
{
|
|
39624
40069
|
start: 0,
|
|
39625
40070
|
end: 0,
|
|
39626
|
-
text: "This project targets Effect v4, but
|
|
40071
|
+
text: "This project targets Effect v4, but this code uses Effect v3 APIs. The referenced API belongs to the v3 surface rather than the configured v4 surface. effect(outdatedApi)"
|
|
39627
40072
|
},
|
|
39628
40073
|
{
|
|
39629
40074
|
start: 126,
|
|
39630
40075
|
end: 133,
|
|
39631
|
-
text: "
|
|
40076
|
+
text: "This project targets Effect v4, but this code uses the Effect v3 API `runtime`. The referenced API belongs to the v3 surface rather than the configured v4 surface. effect(outdatedApi)"
|
|
39632
40077
|
}
|
|
39633
40078
|
]
|
|
39634
40079
|
}
|
|
@@ -39670,7 +40115,7 @@ var metadata_default = {
|
|
|
39670
40115
|
{
|
|
39671
40116
|
start: 123,
|
|
39672
40117
|
end: 185,
|
|
39673
|
-
text: "
|
|
40118
|
+
text: "This Schema subclass defines its own constructor. For Schema classes, constructor overrides break decoding behavior for the class shape. Custom construction can be expressed through a static `new` method instead. effect(overriddenSchemaConstructor)"
|
|
39674
40119
|
}
|
|
39675
40120
|
]
|
|
39676
40121
|
}
|
|
@@ -39712,7 +40157,7 @@ var metadata_default = {
|
|
|
39712
40157
|
{
|
|
39713
40158
|
start: 82,
|
|
39714
40159
|
end: 94,
|
|
39715
|
-
text: "
|
|
40160
|
+
text: "The previous Effect does not fail, so this error-handling branch will never run. effect(catchUnfailableEffect)"
|
|
39716
40161
|
}
|
|
39717
40162
|
]
|
|
39718
40163
|
}
|
|
@@ -39733,7 +40178,7 @@ var metadata_default = {
|
|
|
39733
40178
|
{
|
|
39734
40179
|
start: 64,
|
|
39735
40180
|
end: 137,
|
|
39736
|
-
text: `Effect.fn returns a reusable function that can take arguments, but
|
|
40181
|
+
text: '`Effect.fn` returns a reusable function that can take arguments, but it is invoked immediately here. `Effect.gen` represents the immediate-use form for this pattern with `Effect.withSpan("preview")` piped at the end to maintain tracing spans. effect(effectFnIife)'
|
|
39737
40182
|
}
|
|
39738
40183
|
]
|
|
39739
40184
|
}
|
|
@@ -39822,7 +40267,7 @@ var metadata_default = {
|
|
|
39822
40267
|
{
|
|
39823
40268
|
start: 56,
|
|
39824
40269
|
end: 73,
|
|
39825
|
-
text: "The
|
|
40270
|
+
text: "The `catch` callback in `Effect.tryPromise` returns the global `Error` type. Untagged errors merge together in the Effect error channel and lose type-level distinction; a tagged error preserves that distinction and can wrap the original error in a `cause` property. effect(globalErrorInEffectCatch)"
|
|
39826
40271
|
}
|
|
39827
40272
|
]
|
|
39828
40273
|
}
|
|
@@ -39869,6 +40314,27 @@ var metadata_default = {
|
|
|
39869
40314
|
]
|
|
39870
40315
|
}
|
|
39871
40316
|
},
|
|
40317
|
+
{
|
|
40318
|
+
name: "lazyPromiseInEffectSync",
|
|
40319
|
+
group: "antipattern",
|
|
40320
|
+
description: "Warns when Effect.sync lazily returns a Promise instead of using an async Effect constructor",
|
|
40321
|
+
defaultSeverity: "warning",
|
|
40322
|
+
fixable: false,
|
|
40323
|
+
supportedEffect: [
|
|
40324
|
+
"v3",
|
|
40325
|
+
"v4"
|
|
40326
|
+
],
|
|
40327
|
+
preview: {
|
|
40328
|
+
sourceText: 'import { Effect } from "effect"\n\nexport const preview = Effect.sync(() => Promise.resolve(1))\n',
|
|
40329
|
+
diagnostics: [
|
|
40330
|
+
{
|
|
40331
|
+
start: 68,
|
|
40332
|
+
end: 92,
|
|
40333
|
+
text: "This `Effect.sync` thunk returns a Promise. Use `Effect.promise` or `Effect.tryPromise` to represent async work. effect(lazyPromiseInEffectSync)"
|
|
40334
|
+
}
|
|
40335
|
+
]
|
|
40336
|
+
}
|
|
40337
|
+
},
|
|
39872
40338
|
{
|
|
39873
40339
|
name: "leakingRequirements",
|
|
39874
40340
|
group: "antipattern",
|
|
@@ -39885,7 +40351,7 @@ var metadata_default = {
|
|
|
39885
40351
|
{
|
|
39886
40352
|
start: 212,
|
|
39887
40353
|
end: 217,
|
|
39888
|
-
text: "Methods of this Service require `FileSystem` from every caller.\n\
|
|
40354
|
+
text: "Methods of this Service require `FileSystem` from every caller.\n\nThe requirement becomes part of the public service surface instead of remaining internal to Layer implementation.\n\nResolve these dependencies at Layer creation and provide them to each method, so the service's type reflects its purpose, not its implementation.\n\nTo suppress this diagnostic for specific dependency types that are intentionally passed through (e.g., HttpServerRequest), add `@effect-leakable-service` JSDoc to their interface declarations (e.g., the `FileSystem` interface), or to this service by adding a `@effect-expect-leaking FileSystem` JSDoc.\n\nMore info and examples at https://effect.website/docs/requirements-management/layers/#avoiding-requirement-leakage effect(leakingRequirements)"
|
|
39889
40355
|
}
|
|
39890
40356
|
]
|
|
39891
40357
|
}
|
|
@@ -39906,7 +40372,7 @@ var metadata_default = {
|
|
|
39906
40372
|
{
|
|
39907
40373
|
start: 348,
|
|
39908
40374
|
end: 373,
|
|
39909
|
-
text: "
|
|
40375
|
+
text: "This expression chains multiple `Effect.provide` calls. Providing Layers in multiple calls in a chain can break service lifecycle behavior compared with a single combined provide with merged layers. effect(multipleEffectProvide)"
|
|
39910
40376
|
}
|
|
39911
40377
|
]
|
|
39912
40378
|
}
|
|
@@ -39927,7 +40393,7 @@ var metadata_default = {
|
|
|
39927
40393
|
{
|
|
39928
40394
|
start: 91,
|
|
39929
40395
|
end: 115,
|
|
39930
|
-
text: "
|
|
40396
|
+
text: "This generator returns an Effect-able value directly, which produces a nested `Effect<Effect<...>>`. If the intended result is the inner Effect value, `return yield*` represents that form. effect(returnEffectInGen)"
|
|
39931
40397
|
}
|
|
39932
40398
|
]
|
|
39933
40399
|
}
|
|
@@ -39948,7 +40414,7 @@ var metadata_default = {
|
|
|
39948
40414
|
{
|
|
39949
40415
|
start: 101,
|
|
39950
40416
|
end: 115,
|
|
39951
|
-
text: "
|
|
40417
|
+
text: "`Effect.runSync` is called inside an Effect with a separate services invocation. In this context, child Effects run with the surrounding services, which can be accessed through `Effect.services` and `Effect.runSyncWith`. effect(runEffectInsideEffect)"
|
|
39952
40418
|
}
|
|
39953
40419
|
]
|
|
39954
40420
|
}
|
|
@@ -39968,7 +40434,7 @@ var metadata_default = {
|
|
|
39968
40434
|
{
|
|
39969
40435
|
start: 276,
|
|
39970
40436
|
end: 293,
|
|
39971
|
-
text: "
|
|
40437
|
+
text: "`Schema.decodeSync` is used inside an Effect generator. `Schema.decode` preserves the typed Effect error channel for this operation without throwing. effect(schemaSyncInEffect)"
|
|
39972
40438
|
}
|
|
39973
40439
|
]
|
|
39974
40440
|
}
|
|
@@ -39988,7 +40454,7 @@ var metadata_default = {
|
|
|
39988
40454
|
{
|
|
39989
40455
|
start: 211,
|
|
39990
40456
|
end: 338,
|
|
39991
|
-
text:
|
|
40457
|
+
text: "This layer construction leaves `Scope` in the requirement set. The scoped API removes `Scope` from the resulting requirements. effect(scopeInLayerEffect)"
|
|
39992
40458
|
}
|
|
39993
40459
|
]
|
|
39994
40460
|
}
|
|
@@ -40030,7 +40496,7 @@ var metadata_default = {
|
|
|
40030
40496
|
{
|
|
40031
40497
|
start: 91,
|
|
40032
40498
|
end: 151,
|
|
40033
|
-
text: "
|
|
40499
|
+
text: "This Effect generator contains `try/catch`; in this context, error handling is expressed with Effect APIs such as Effect.try, Effect.tryPromise, Effect.catch, Effect.catchTag). effect(tryCatchInEffectGen)"
|
|
40034
40500
|
}
|
|
40035
40501
|
]
|
|
40036
40502
|
}
|
|
@@ -40051,7 +40517,68 @@ var metadata_default = {
|
|
|
40051
40517
|
{
|
|
40052
40518
|
start: 56,
|
|
40053
40519
|
end: 73,
|
|
40054
|
-
text: "The
|
|
40520
|
+
text: "The `catch` callback in `Effect.tryPromise` returns `unknown`, so the Effect error type stays untyped. A specific typed error preserves error-channel information, for example by narrowing the value or wrapping it in `Data.TaggedError`. effect(unknownInEffectCatch)"
|
|
40521
|
+
}
|
|
40522
|
+
]
|
|
40523
|
+
}
|
|
40524
|
+
},
|
|
40525
|
+
{
|
|
40526
|
+
name: "asyncFunction",
|
|
40527
|
+
group: "effectNative",
|
|
40528
|
+
description: "Warns when declaring async functions and suggests using Effect values and Effect.gen for async control flow",
|
|
40529
|
+
defaultSeverity: "off",
|
|
40530
|
+
fixable: false,
|
|
40531
|
+
supportedEffect: [
|
|
40532
|
+
"v3",
|
|
40533
|
+
"v4"
|
|
40534
|
+
],
|
|
40535
|
+
preview: {
|
|
40536
|
+
sourceText: "\nexport const preview = async () => {\n await Promise.resolve(1)\n}\n",
|
|
40537
|
+
diagnostics: [
|
|
40538
|
+
{
|
|
40539
|
+
start: 24,
|
|
40540
|
+
end: 66,
|
|
40541
|
+
text: "This code declares an async function, consider representing this async control flow with Effect values and `Effect.gen`. effect(asyncFunction)"
|
|
40542
|
+
}
|
|
40543
|
+
]
|
|
40544
|
+
}
|
|
40545
|
+
},
|
|
40546
|
+
{
|
|
40547
|
+
name: "cryptoRandomUUID",
|
|
40548
|
+
group: "effectNative",
|
|
40549
|
+
description: "Warns when using crypto.randomUUID() outside Effect generators instead of the Effect Random module, which uses Effect-injected randomness rather than the crypto module behind the scenes",
|
|
40550
|
+
defaultSeverity: "off",
|
|
40551
|
+
fixable: false,
|
|
40552
|
+
supportedEffect: [
|
|
40553
|
+
"v4"
|
|
40554
|
+
],
|
|
40555
|
+
preview: {
|
|
40556
|
+
sourceText: "\nexport const preview = crypto.randomUUID()\n",
|
|
40557
|
+
diagnostics: [
|
|
40558
|
+
{
|
|
40559
|
+
start: 24,
|
|
40560
|
+
end: 43,
|
|
40561
|
+
text: "This code uses `crypto.randomUUID()`, prefer the Effect `Random` module instead because it uses Effect-injected randomness rather than the `crypto` module behind the scenes. effect(cryptoRandomUUID)"
|
|
40562
|
+
}
|
|
40563
|
+
]
|
|
40564
|
+
}
|
|
40565
|
+
},
|
|
40566
|
+
{
|
|
40567
|
+
name: "cryptoRandomUUIDInEffect",
|
|
40568
|
+
group: "effectNative",
|
|
40569
|
+
description: "Warns when using crypto.randomUUID() inside Effect generators instead of the Effect Random module, which uses Effect-injected randomness rather than the crypto module behind the scenes",
|
|
40570
|
+
defaultSeverity: "off",
|
|
40571
|
+
fixable: false,
|
|
40572
|
+
supportedEffect: [
|
|
40573
|
+
"v4"
|
|
40574
|
+
],
|
|
40575
|
+
preview: {
|
|
40576
|
+
sourceText: 'import { Effect } from "effect"\n\nexport const preview = Effect.gen(function*() {\n return crypto.randomUUID()\n})\n',
|
|
40577
|
+
diagnostics: [
|
|
40578
|
+
{
|
|
40579
|
+
start: 90,
|
|
40580
|
+
end: 109,
|
|
40581
|
+
text: "This Effect code uses `crypto.randomUUID()`, prefer the Effect `Random` module instead because it uses Effect-injected randomness rather than the `crypto` module behind the scenes. effect(cryptoRandomUUIDInEffect)"
|
|
40055
40582
|
}
|
|
40056
40583
|
]
|
|
40057
40584
|
}
|
|
@@ -40072,7 +40599,7 @@ var metadata_default = {
|
|
|
40072
40599
|
{
|
|
40073
40600
|
start: 14,
|
|
40074
40601
|
end: 26,
|
|
40075
|
-
text: "
|
|
40602
|
+
text: "This class extends the native `Error` type directly. Untagged native errors lose distinction in the Effect failure channel. effect(extendsNativeError)"
|
|
40076
40603
|
}
|
|
40077
40604
|
]
|
|
40078
40605
|
}
|
|
@@ -40093,7 +40620,7 @@ var metadata_default = {
|
|
|
40093
40620
|
{
|
|
40094
40621
|
start: 1,
|
|
40095
40622
|
end: 23,
|
|
40096
|
-
text: "
|
|
40623
|
+
text: "This code uses `console.log`, the corresponding Effect logging API is `Effect.log or Logger`. effect(globalConsole)"
|
|
40097
40624
|
}
|
|
40098
40625
|
]
|
|
40099
40626
|
}
|
|
@@ -40114,7 +40641,7 @@ var metadata_default = {
|
|
|
40114
40641
|
{
|
|
40115
40642
|
start: 83,
|
|
40116
40643
|
end: 103,
|
|
40117
|
-
text: "
|
|
40644
|
+
text: "This Effect code uses `console.log`, logging in Effect code is represented through `Effect.log or Logger`. effect(globalConsoleInEffect)"
|
|
40118
40645
|
}
|
|
40119
40646
|
]
|
|
40120
40647
|
}
|
|
@@ -40135,7 +40662,7 @@ var metadata_default = {
|
|
|
40135
40662
|
{
|
|
40136
40663
|
start: 24,
|
|
40137
40664
|
end: 34,
|
|
40138
|
-
text: "
|
|
40665
|
+
text: "This code uses `Date.now()`, time access is represented through `Clock` from Effect. effect(globalDate)"
|
|
40139
40666
|
}
|
|
40140
40667
|
]
|
|
40141
40668
|
}
|
|
@@ -40156,7 +40683,7 @@ var metadata_default = {
|
|
|
40156
40683
|
{
|
|
40157
40684
|
start: 95,
|
|
40158
40685
|
end: 105,
|
|
40159
|
-
text: "
|
|
40686
|
+
text: "This Effect code uses `Date.now()`, time access in Effect code is represented through `Clock` from Effect. effect(globalDateInEffect)"
|
|
40160
40687
|
}
|
|
40161
40688
|
]
|
|
40162
40689
|
}
|
|
@@ -40177,7 +40704,7 @@ var metadata_default = {
|
|
|
40177
40704
|
{
|
|
40178
40705
|
start: 24,
|
|
40179
40706
|
end: 29,
|
|
40180
|
-
text: "
|
|
40707
|
+
text: "This code uses the global `fetch` function, HTTP requests are represented through `HttpClient` from `@effect/platform`. effect(globalFetch)"
|
|
40181
40708
|
}
|
|
40182
40709
|
]
|
|
40183
40710
|
}
|
|
@@ -40213,7 +40740,7 @@ var metadata_default = {
|
|
|
40213
40740
|
{
|
|
40214
40741
|
start: 24,
|
|
40215
40742
|
end: 37,
|
|
40216
|
-
text: "
|
|
40743
|
+
text: "This code uses `Math.random()`, randomness is represented through the Effect `Random` service. effect(globalRandom)"
|
|
40217
40744
|
}
|
|
40218
40745
|
]
|
|
40219
40746
|
}
|
|
@@ -40234,7 +40761,7 @@ var metadata_default = {
|
|
|
40234
40761
|
{
|
|
40235
40762
|
start: 93,
|
|
40236
40763
|
end: 106,
|
|
40237
|
-
text: "
|
|
40764
|
+
text: "This Effect code uses `Math.random()`, randomness is represented through the Effect `Random` service. effect(globalRandomInEffect)"
|
|
40238
40765
|
}
|
|
40239
40766
|
]
|
|
40240
40767
|
}
|
|
@@ -40255,7 +40782,7 @@ var metadata_default = {
|
|
|
40255
40782
|
{
|
|
40256
40783
|
start: 1,
|
|
40257
40784
|
end: 26,
|
|
40258
|
-
text: "
|
|
40785
|
+
text: "This code uses `setTimeout`, the corresponding Effect timer API is `Effect.sleep or Schedule` from Effect. effect(globalTimers)"
|
|
40259
40786
|
}
|
|
40260
40787
|
]
|
|
40261
40788
|
}
|
|
@@ -40276,7 +40803,7 @@ var metadata_default = {
|
|
|
40276
40803
|
{
|
|
40277
40804
|
start: 83,
|
|
40278
40805
|
end: 108,
|
|
40279
|
-
text: "
|
|
40806
|
+
text: "This Effect code uses `setTimeout`, the corresponding timer API in this context is `Effect.sleep or Schedule` from Effect. effect(globalTimersInEffect)"
|
|
40280
40807
|
}
|
|
40281
40808
|
]
|
|
40282
40809
|
}
|
|
@@ -40297,7 +40824,28 @@ var metadata_default = {
|
|
|
40297
40824
|
{
|
|
40298
40825
|
start: 159,
|
|
40299
40826
|
end: 180,
|
|
40300
|
-
text: "
|
|
40827
|
+
text: "This code uses `instanceof` with an Effect Schema type. `Schema.is` is the schema-aware runtime check for this case. effect(instanceOfSchema)"
|
|
40828
|
+
}
|
|
40829
|
+
]
|
|
40830
|
+
}
|
|
40831
|
+
},
|
|
40832
|
+
{
|
|
40833
|
+
name: "newPromise",
|
|
40834
|
+
group: "effectNative",
|
|
40835
|
+
description: "Warns when constructing promises with new Promise instead of using Effect APIs",
|
|
40836
|
+
defaultSeverity: "off",
|
|
40837
|
+
fixable: false,
|
|
40838
|
+
supportedEffect: [
|
|
40839
|
+
"v3",
|
|
40840
|
+
"v4"
|
|
40841
|
+
],
|
|
40842
|
+
preview: {
|
|
40843
|
+
sourceText: "\nexport const preview = new Promise<number>((resolve) => resolve(1))\n",
|
|
40844
|
+
diagnostics: [
|
|
40845
|
+
{
|
|
40846
|
+
start: 24,
|
|
40847
|
+
end: 68,
|
|
40848
|
+
text: "This code constructs `new Promise(...)`, prefer Effect APIs such as `Effect.async`, `Effect.promise`, or `Effect.tryPromise` instead of manual Promise construction. effect(newPromise)"
|
|
40301
40849
|
}
|
|
40302
40850
|
]
|
|
40303
40851
|
}
|
|
@@ -40318,7 +40866,7 @@ var metadata_default = {
|
|
|
40318
40866
|
{
|
|
40319
40867
|
start: 15,
|
|
40320
40868
|
end: 24,
|
|
40321
|
-
text: "
|
|
40869
|
+
text: "This module reference uses the `fs` module, the corresponding Effect API is `FileSystem` from `@effect/platform`. effect(nodeBuiltinImport)"
|
|
40322
40870
|
}
|
|
40323
40871
|
]
|
|
40324
40872
|
}
|
|
@@ -40345,7 +40893,49 @@ export const preview = Effect.gen(function*() {
|
|
|
40345
40893
|
{
|
|
40346
40894
|
start: 142,
|
|
40347
40895
|
end: 158,
|
|
40348
|
-
text: "
|
|
40896
|
+
text: "This code uses `JSON.parse` or `JSON.stringify`. Effect Schema provides Effect-aware APIs for JSON parsing and stringifying. effect(preferSchemaOverJson)"
|
|
40897
|
+
}
|
|
40898
|
+
]
|
|
40899
|
+
}
|
|
40900
|
+
},
|
|
40901
|
+
{
|
|
40902
|
+
name: "processEnv",
|
|
40903
|
+
group: "effectNative",
|
|
40904
|
+
description: "Warns when reading process.env outside Effect generators instead of using Effect Config",
|
|
40905
|
+
defaultSeverity: "off",
|
|
40906
|
+
fixable: false,
|
|
40907
|
+
supportedEffect: [
|
|
40908
|
+
"v3",
|
|
40909
|
+
"v4"
|
|
40910
|
+
],
|
|
40911
|
+
preview: {
|
|
40912
|
+
sourceText: '/// <reference types="node" />\n\nexport const preview = process.env.PORT\n',
|
|
40913
|
+
diagnostics: [
|
|
40914
|
+
{
|
|
40915
|
+
start: 55,
|
|
40916
|
+
end: 71,
|
|
40917
|
+
text: "This code reads from `process.env`, environment configuration is represented through `Config` from Effect. effect(processEnv)"
|
|
40918
|
+
}
|
|
40919
|
+
]
|
|
40920
|
+
}
|
|
40921
|
+
},
|
|
40922
|
+
{
|
|
40923
|
+
name: "processEnvInEffect",
|
|
40924
|
+
group: "effectNative",
|
|
40925
|
+
description: "Warns when reading process.env inside Effect generators instead of using Effect Config",
|
|
40926
|
+
defaultSeverity: "off",
|
|
40927
|
+
fixable: false,
|
|
40928
|
+
supportedEffect: [
|
|
40929
|
+
"v3",
|
|
40930
|
+
"v4"
|
|
40931
|
+
],
|
|
40932
|
+
preview: {
|
|
40933
|
+
sourceText: '/// <reference types="node" />\nimport { Effect } from "effect"\n\nexport const preview = Effect.gen(function*() {\n return process.env.PORT\n})\n',
|
|
40934
|
+
diagnostics: [
|
|
40935
|
+
{
|
|
40936
|
+
start: 121,
|
|
40937
|
+
end: 137,
|
|
40938
|
+
text: "This Effect code reads from `process.env`, environment configuration in Effect code is represented through `Config` from Effect. effect(processEnvInEffect)"
|
|
40349
40939
|
}
|
|
40350
40940
|
]
|
|
40351
40941
|
}
|
|
@@ -40366,7 +40956,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40366
40956
|
{
|
|
40367
40957
|
start: 150,
|
|
40368
40958
|
end: 162,
|
|
40369
|
-
text: "
|
|
40959
|
+
text: "`Effect.mapError` expresses the same error-type transformation more directly than `Effect.catch` followed by `Effect.fail`. effect(catchAllToMapError)"
|
|
40370
40960
|
}
|
|
40371
40961
|
]
|
|
40372
40962
|
}
|
|
@@ -40387,7 +40977,28 @@ export const preview = Effect.gen(function*() {
|
|
|
40387
40977
|
{
|
|
40388
40978
|
start: 116,
|
|
40389
40979
|
end: 134,
|
|
40390
|
-
text: "
|
|
40980
|
+
text: "This key does not match the deterministic key for this declaration. The expected key is `@effect/harness-effect-v4/examples/diagnostics/deterministicKeys_preview/RenamedService`. effect(deterministicKeys)"
|
|
40981
|
+
}
|
|
40982
|
+
]
|
|
40983
|
+
}
|
|
40984
|
+
},
|
|
40985
|
+
{
|
|
40986
|
+
name: "effectDoNotation",
|
|
40987
|
+
group: "style",
|
|
40988
|
+
description: "Suggests using Effect.gen or Effect.fn instead of the Effect.Do notation helpers",
|
|
40989
|
+
defaultSeverity: "off",
|
|
40990
|
+
fixable: false,
|
|
40991
|
+
supportedEffect: [
|
|
40992
|
+
"v3",
|
|
40993
|
+
"v4"
|
|
40994
|
+
],
|
|
40995
|
+
preview: {
|
|
40996
|
+
sourceText: 'import { Effect } from "effect"\nimport { pipe } from "effect/Function"\n\nexport const preview = pipe(\n Effect.Do,\n Effect.bind("a", () => Effect.succeed(1)),\n Effect.let("b", ({ a }) => a + 1),\n Effect.bind("c", ({ b }) => Effect.succeed(b.toString()))\n)\n',
|
|
40997
|
+
diagnostics: [
|
|
40998
|
+
{
|
|
40999
|
+
start: 103,
|
|
41000
|
+
end: 112,
|
|
41001
|
+
text: "This uses the Effect do emulation. `Effect.gen` or `Effect.fn` achieve the same result with native JS scopes. effect(effectDoNotation)"
|
|
40391
41002
|
}
|
|
40392
41003
|
]
|
|
40393
41004
|
}
|
|
@@ -40408,7 +41019,28 @@ export const preview = Effect.gen(function*() {
|
|
|
40408
41019
|
{
|
|
40409
41020
|
start: 54,
|
|
40410
41021
|
end: 61,
|
|
40411
|
-
text: "
|
|
41022
|
+
text: "This expression can be rewritten in the reusable function form `Effect.fn(function*() { ... })`. effect(effectFnOpportunity)"
|
|
41023
|
+
}
|
|
41024
|
+
]
|
|
41025
|
+
}
|
|
41026
|
+
},
|
|
41027
|
+
{
|
|
41028
|
+
name: "effectMapFlatten",
|
|
41029
|
+
group: "style",
|
|
41030
|
+
description: "Suggests using Effect.flatMap instead of Effect.map followed by Effect.flatten in piping flows",
|
|
41031
|
+
defaultSeverity: "suggestion",
|
|
41032
|
+
fixable: false,
|
|
41033
|
+
supportedEffect: [
|
|
41034
|
+
"v3",
|
|
41035
|
+
"v4"
|
|
41036
|
+
],
|
|
41037
|
+
preview: {
|
|
41038
|
+
sourceText: 'import { Effect } from "effect"\n\nexport const preview = Effect.succeed(1).pipe(\n Effect.map((n) => Effect.succeed(n + 1)),\n Effect.flatten\n)\n',
|
|
41039
|
+
diagnostics: [
|
|
41040
|
+
{
|
|
41041
|
+
start: 126,
|
|
41042
|
+
end: 140,
|
|
41043
|
+
text: "`Effect.map` + `Effect.flatten` is the same as `Effect.flatMap` that expresses the same steps more directly. effect(effectMapFlatten)"
|
|
40412
41044
|
}
|
|
40413
41045
|
]
|
|
40414
41046
|
}
|
|
@@ -40429,7 +41061,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40429
41061
|
{
|
|
40430
41062
|
start: 82,
|
|
40431
41063
|
end: 92,
|
|
40432
|
-
text: "
|
|
41064
|
+
text: "This expression discards the success value through mapping. `Effect.asVoid` represents that form directly. effect(effectMapVoid)"
|
|
40433
41065
|
}
|
|
40434
41066
|
]
|
|
40435
41067
|
}
|
|
@@ -40450,7 +41082,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40450
41082
|
{
|
|
40451
41083
|
start: 56,
|
|
40452
41084
|
end: 81,
|
|
40453
|
-
text: "Effect.void
|
|
41085
|
+
text: "`Effect.void` represents the same outcome as `Effect.succeed(undefined)` or `Effect.succeed(void 0)`. effect(effectSucceedWithVoid)"
|
|
40454
41086
|
}
|
|
40455
41087
|
]
|
|
40456
41088
|
}
|
|
@@ -40492,7 +41124,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40492
41124
|
{
|
|
40493
41125
|
start: 116,
|
|
40494
41126
|
end: 172,
|
|
40495
|
-
text: "
|
|
41127
|
+
text: "This nested call structure has a pipeable form. `Schema.decodeEffect(User)({ id: 1 }).pipe(...)` represents the same call sequence in pipe style and may be easier to read. effect(missedPipeableOpportunity)"
|
|
40496
41128
|
}
|
|
40497
41129
|
]
|
|
40498
41130
|
}
|
|
@@ -40517,6 +41149,27 @@ export const preview = Effect.gen(function*() {
|
|
|
40517
41149
|
]
|
|
40518
41150
|
}
|
|
40519
41151
|
},
|
|
41152
|
+
{
|
|
41153
|
+
name: "nestedEffectGenYield",
|
|
41154
|
+
group: "style",
|
|
41155
|
+
description: "Warns when yielding a nested bare Effect.gen inside an existing Effect generator context",
|
|
41156
|
+
defaultSeverity: "off",
|
|
41157
|
+
fixable: false,
|
|
41158
|
+
supportedEffect: [
|
|
41159
|
+
"v3",
|
|
41160
|
+
"v4"
|
|
41161
|
+
],
|
|
41162
|
+
preview: {
|
|
41163
|
+
sourceText: 'import { Effect } from "effect"\n\nexport const preview = Effect.gen(function*() {\n yield* Effect.gen(function*() {\n return 1\n })\n})\n',
|
|
41164
|
+
diagnostics: [
|
|
41165
|
+
{
|
|
41166
|
+
start: 90,
|
|
41167
|
+
end: 132,
|
|
41168
|
+
text: "This `yield*` is applied to a nested `Effect.gen(...)` that can be inlined in the parent Effect generator context. effect(nestedEffectGenYield)"
|
|
41169
|
+
}
|
|
41170
|
+
]
|
|
41171
|
+
}
|
|
41172
|
+
},
|
|
40520
41173
|
{
|
|
40521
41174
|
name: "redundantSchemaTagIdentifier",
|
|
40522
41175
|
group: "style",
|
|
@@ -40554,7 +41207,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40554
41207
|
{
|
|
40555
41208
|
start: 64,
|
|
40556
41209
|
end: 136,
|
|
40557
|
-
text: "Schema.Struct
|
|
41210
|
+
text: "This `Schema.Struct` includes a `_tag` field. `Schema.TaggedStruct` is the tagged-struct form for this pattern and makes the tag optional in the constructor. effect(schemaStructWithTag)"
|
|
40558
41211
|
}
|
|
40559
41212
|
]
|
|
40560
41213
|
}
|
|
@@ -40574,7 +41227,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40574
41227
|
{
|
|
40575
41228
|
start: 64,
|
|
40576
41229
|
end: 118,
|
|
40577
|
-
text: "
|
|
41230
|
+
text: "This `Schema.Union` contains multiple `Schema.Literal` members and can be simplified to a single `Schema.Literal` call. effect(schemaUnionOfLiterals)"
|
|
40578
41231
|
}
|
|
40579
41232
|
]
|
|
40580
41233
|
}
|
|
@@ -40594,7 +41247,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40594
41247
|
{
|
|
40595
41248
|
start: 60,
|
|
40596
41249
|
end: 107,
|
|
40597
|
-
text: 'ServiceMap.Service
|
|
41250
|
+
text: '`ServiceMap.Service` is assigned to a variable here, but this API is intended for a class declaration shape such as `class Preview extends ServiceMap.Service<Preview, { port: number }>()("Preview") {}`. effect(serviceNotAsClass)'
|
|
40598
41251
|
}
|
|
40599
41252
|
]
|
|
40600
41253
|
}
|
|
@@ -40625,6 +41278,27 @@ export const preview = Effect.gen(function*() {
|
|
|
40625
41278
|
]
|
|
40626
41279
|
}
|
|
40627
41280
|
},
|
|
41281
|
+
{
|
|
41282
|
+
name: "unnecessaryArrowBlock",
|
|
41283
|
+
group: "style",
|
|
41284
|
+
description: "Suggests using a concise arrow body when the block only returns an expression",
|
|
41285
|
+
defaultSeverity: "off",
|
|
41286
|
+
fixable: true,
|
|
41287
|
+
supportedEffect: [
|
|
41288
|
+
"v3",
|
|
41289
|
+
"v4"
|
|
41290
|
+
],
|
|
41291
|
+
preview: {
|
|
41292
|
+
sourceText: "export const preview = (value: string) => {\n return value.trim()\n}\n",
|
|
41293
|
+
diagnostics: [
|
|
41294
|
+
{
|
|
41295
|
+
start: 42,
|
|
41296
|
+
end: 67,
|
|
41297
|
+
text: "This arrow function block only returns an expression and can use a concise body. effect(unnecessaryArrowBlock)"
|
|
41298
|
+
}
|
|
41299
|
+
]
|
|
41300
|
+
}
|
|
41301
|
+
},
|
|
40628
41302
|
{
|
|
40629
41303
|
name: "unnecessaryEffectGen",
|
|
40630
41304
|
group: "style",
|
|
@@ -40662,7 +41336,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40662
41336
|
{
|
|
40663
41337
|
start: 178,
|
|
40664
41338
|
end: 208,
|
|
40665
|
-
text: "This Effect.fail
|
|
41339
|
+
text: "This `yield* Effect.fail(...)` passes a yieldable error value. `yield*` represents that value directly without wrapping it in `Effect.fail`. effect(unnecessaryFailYieldableError)"
|
|
40666
41340
|
}
|
|
40667
41341
|
]
|
|
40668
41342
|
}
|
|
@@ -40704,7 +41378,7 @@ export const preview = Effect.gen(function*() {
|
|
|
40704
41378
|
{
|
|
40705
41379
|
start: 64,
|
|
40706
41380
|
end: 125,
|
|
40707
|
-
text: "
|
|
41381
|
+
text: "This expression contains chained `pipe` calls that can be simplified to a single `pipe` call. effect(unnecessaryPipeChain)"
|
|
40708
41382
|
}
|
|
40709
41383
|
]
|
|
40710
41384
|
}
|
|
@@ -42407,6 +43081,7 @@ function collectExportedItems(sourceFile, tsInstance, typeChecker, maxSymbolDept
|
|
|
42407
43081
|
const declaration = declarations && declarations.length > 0 ? declarations[0] : sourceFile;
|
|
42408
43082
|
const contextTagResult = yield* pipe(
|
|
42409
43083
|
typeParser.contextTag(type, declaration),
|
|
43084
|
+
orElse5(() => typeParser.serviceType(type, declaration)),
|
|
42410
43085
|
option4
|
|
42411
43086
|
);
|
|
42412
43087
|
if (isSome2(contextTagResult)) {
|