@effect/language-service 0.76.0 → 0.77.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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Pipeable.js
3
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Pipeable.js
4
4
  var pipeArguments = (self, args3) => {
5
5
  switch (args3.length) {
6
6
  case 0:
@@ -44,7 +44,7 @@ var Class = /* @__PURE__ */ (function() {
44
44
  return PipeableBase;
45
45
  })();
46
46
 
47
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Function.js
47
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Function.js
48
48
  var dual = function(arity, body) {
49
49
  if (typeof arity === "function") {
50
50
  return function() {
@@ -92,7 +92,7 @@ function pipe(a, ...args3) {
92
92
  return pipeArguments(a, args3);
93
93
  }
94
94
 
95
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Equivalence.js
95
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Equivalence.js
96
96
  var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
97
97
  function Array2(item) {
98
98
  return make((self, that) => {
@@ -104,7 +104,7 @@ function Array2(item) {
104
104
  });
105
105
  }
106
106
 
107
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/equal.js
107
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/internal/equal.js
108
108
  var getAllObjectKeys = (obj) => {
109
109
  const keys2 = new Set(Reflect.ownKeys(obj));
110
110
  if (obj.constructor === Object) return keys2;
@@ -127,7 +127,7 @@ var getAllObjectKeys = (obj) => {
127
127
  };
128
128
  var byReferenceInstances = /* @__PURE__ */ new WeakSet();
129
129
 
130
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Predicate.js
130
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Predicate.js
131
131
  function isString(input) {
132
132
  return typeof input === "string";
133
133
  }
@@ -148,7 +148,7 @@ function isObjectKeyword(input) {
148
148
  }
149
149
  var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObjectKeyword(self) && property in self);
150
150
 
151
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Hash.js
151
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Hash.js
152
152
  var symbol = "~effect/interfaces/Hash";
153
153
  var hash = (self) => {
154
154
  switch (typeof self) {
@@ -267,7 +267,7 @@ function withVisitedTracking(obj, fn2) {
267
267
  return result;
268
268
  }
269
269
 
270
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Equal.js
270
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Equal.js
271
271
  var symbol2 = "~effect/interfaces/Equal";
272
272
  function equals() {
273
273
  if (arguments.length === 1) {
@@ -429,7 +429,7 @@ var compareSets = /* @__PURE__ */ makeCompareSet(compareBoth);
429
429
  var isEqual = (u) => hasProperty(u, symbol2);
430
430
  var asEquivalence = () => equals;
431
431
 
432
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Redactable.js
432
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Redactable.js
433
433
  var symbolRedactable = /* @__PURE__ */ Symbol.for("~effect/Inspectable/redactable");
434
434
  var isRedactable = (u) => hasProperty(u, symbolRedactable);
435
435
  function redact(u) {
@@ -448,7 +448,7 @@ var emptyServiceMap = {
448
448
  }
449
449
  };
450
450
 
451
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Formatter.js
451
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Formatter.js
452
452
  function format(input, options) {
453
453
  const space = options?.space ?? 0;
454
454
  const seen = /* @__PURE__ */ new WeakSet();
@@ -527,7 +527,7 @@ function safeToString(input) {
527
527
  }
528
528
  }
529
529
 
530
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Inspectable.js
530
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Inspectable.js
531
531
  var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
532
532
  var toJson = (input) => {
533
533
  try {
@@ -571,7 +571,7 @@ var Class2 = class {
571
571
  }
572
572
  };
573
573
 
574
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Utils.js
574
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Utils.js
575
575
  var GenKindTypeId = "~effect/Utils/GenKind";
576
576
  var GenKindImpl = class {
577
577
  value;
@@ -639,7 +639,7 @@ var internalCall = isNotOptimizedAway ? standard[InternalTypeId] : forced[Intern
639
639
  var genConstructor = function* () {
640
640
  }.constructor;
641
641
 
642
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/core.js
642
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/internal/core.js
643
643
  var EffectTypeId = `~effect/Effect`;
644
644
  var ExitTypeId = `~effect/Exit`;
645
645
  var effectVariance = {
@@ -986,7 +986,7 @@ var DoneVoid = {
986
986
  value: void 0
987
987
  };
988
988
 
989
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/option.js
989
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/internal/option.js
990
990
  var TypeId = "~effect/data/Option";
991
991
  var CommonProto = {
992
992
  [TypeId]: {
@@ -1051,7 +1051,7 @@ var some = (value) => {
1051
1051
  return a;
1052
1052
  };
1053
1053
 
1054
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/result.js
1054
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/internal/result.js
1055
1055
  var TypeId2 = "~effect/data/Result";
1056
1056
  var CommonProto2 = {
1057
1057
  [TypeId2]: {
@@ -1122,7 +1122,7 @@ var succeed = (success) => {
1122
1122
  return a;
1123
1123
  };
1124
1124
 
1125
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Result.js
1125
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Result.js
1126
1126
  var succeed2 = succeed;
1127
1127
  var fail2 = fail;
1128
1128
  var isFailure2 = isFailure;
@@ -1130,7 +1130,7 @@ var isSuccess2 = isSuccess;
1130
1130
  var map = /* @__PURE__ */ dual(2, (self, f) => isSuccess2(self) ? succeed2(f(self.success)) : fail2(self.failure));
1131
1131
  var getOrElse = /* @__PURE__ */ dual(2, (self, onFailure) => isFailure2(self) ? onFailure(self.failure) : self.success);
1132
1132
 
1133
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Order.js
1133
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Order.js
1134
1134
  function make2(compare) {
1135
1135
  return (self, that) => self === that ? 0 : compare(self, that);
1136
1136
  }
@@ -1153,7 +1153,7 @@ var combine2 = /* @__PURE__ */ dual(2, (self, that) => make2((a1, a2) => {
1153
1153
  }));
1154
1154
  var mapInput = /* @__PURE__ */ dual(2, (self, f) => make2((b1, b2) => self(f(b1), f(b2))));
1155
1155
 
1156
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Option.js
1156
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Option.js
1157
1157
  var none2 = () => none;
1158
1158
  var some2 = some;
1159
1159
  var isNone2 = isNone;
@@ -1164,7 +1164,7 @@ var fromNullishOr = (a) => a == null ? none2() : some2(a);
1164
1164
  var getOrUndefined = /* @__PURE__ */ getOrElse2(constUndefined);
1165
1165
  var map2 = /* @__PURE__ */ dual(2, (self, f) => isNone2(self) ? none2() : some2(f(self.value)));
1166
1166
 
1167
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Filter.js
1167
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Filter.js
1168
1168
  var apply = (filter2, input, ...args3) => {
1169
1169
  const result = filter2(input, ...args3);
1170
1170
  if (result === true) return succeed2(input);
@@ -1172,10 +1172,10 @@ var apply = (filter2, input, ...args3) => {
1172
1172
  return result;
1173
1173
  };
1174
1174
 
1175
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/internal/array.js
1175
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/internal/array.js
1176
1176
  var isArrayNonEmpty = (self) => self.length > 0;
1177
1177
 
1178
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Record.js
1178
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Record.js
1179
1179
  var map3 = /* @__PURE__ */ dual(2, (self, f) => {
1180
1180
  const out = {
1181
1181
  ...self
@@ -1187,7 +1187,7 @@ var map3 = /* @__PURE__ */ dual(2, (self, f) => {
1187
1187
  });
1188
1188
  var keys = (self) => Object.keys(self);
1189
1189
 
1190
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Array.js
1190
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Array.js
1191
1191
  var Array3 = globalThis.Array;
1192
1192
  var fromIterable = (collection) => Array3.isArray(collection) ? collection : Array3.from(collection);
1193
1193
  var append = /* @__PURE__ */ dual(2, (self, last) => [...self, last]);
@@ -1292,7 +1292,7 @@ var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
1292
1292
  var dedupe = (self) => dedupeWith(self, asEquivalence());
1293
1293
  var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable(self).join(sep));
1294
1294
 
1295
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Data.js
1295
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Data.js
1296
1296
  var Class3 = class extends Class {
1297
1297
  constructor(props) {
1298
1298
  super();
@@ -1303,7 +1303,7 @@ var Class3 = class extends Class {
1303
1303
  };
1304
1304
  var TaggedError2 = TaggedError;
1305
1305
 
1306
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Encoding.js
1306
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Encoding.js
1307
1307
  var EncodingErrorTypeId = "~effect/encoding/EncodingError";
1308
1308
  var EncodingError = class extends (/* @__PURE__ */ TaggedError2("EncodingError")) {
1309
1309
  /**
@@ -1339,7 +1339,7 @@ var base64EncodeUint8Array = (bytes) => {
1339
1339
  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", "+", "/"];
1340
1340
  var base64UrlEncodeUint8Array = (data) => base64EncodeUint8Array(data).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
1341
1341
 
1342
- // ../../node_modules/.pnpm/effect@4.0.0-beta.12/node_modules/effect/dist/Graph.js
1342
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.14/node_modules/effect/dist/Graph.js
1343
1343
  var TypeId3 = "~effect/collections/Graph";
1344
1344
  var Edge = class extends Class3 {
1345
1345
  };
@@ -5270,6 +5270,73 @@ function make3(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
5270
5270
  "TypeParser.extendsEffectSqlModelClass",
5271
5271
  (atLocation) => atLocation
5272
5272
  );
5273
+ const isEffectSchemaModelTypeSourceFile = cachedBy(
5274
+ fn("TypeParser.isEffectSchemaModelTypeSourceFile")(function* (sourceFile) {
5275
+ const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile);
5276
+ if (!moduleSymbol) return yield* typeParserIssue("Node has no symbol", void 0, sourceFile);
5277
+ const classSymbol = typeChecker.tryGetMemberInModuleExports("Class", moduleSymbol);
5278
+ if (!classSymbol) return yield* typeParserIssue("Model's Class type not found", void 0, sourceFile);
5279
+ const generatedSymbol = typeChecker.tryGetMemberInModuleExports("Generated", moduleSymbol);
5280
+ if (!generatedSymbol) {
5281
+ return yield* typeParserIssue("Model's Generated type not found", void 0, sourceFile);
5282
+ }
5283
+ const fieldOptionSymbol = typeChecker.tryGetMemberInModuleExports("FieldOption", moduleSymbol);
5284
+ if (!fieldOptionSymbol) {
5285
+ return yield* typeParserIssue("Model's FieldOption type not found", void 0, sourceFile);
5286
+ }
5287
+ return sourceFile;
5288
+ }),
5289
+ "TypeParser.isEffectSchemaModelTypeSourceFile",
5290
+ (sourceFile) => sourceFile
5291
+ );
5292
+ const isNodeReferenceToEffectSchemaModelModuleApi = (memberName) => cachedBy(
5293
+ fn("TypeParser.isNodeReferenceToEffectSchemaModelModuleApi")(function* (node) {
5294
+ return yield* isNodeReferenceToExportOfPackageModule(
5295
+ node,
5296
+ "effect",
5297
+ isEffectSchemaModelTypeSourceFile,
5298
+ memberName
5299
+ );
5300
+ }),
5301
+ `TypeParser.isNodeReferenceToEffectSchemaModelModuleApi(${memberName})`,
5302
+ (node) => node
5303
+ );
5304
+ const extendsEffectSchemaModelClass = cachedBy(
5305
+ fn("TypeParser.extendsEffectSchemaModelClass")(function* (atLocation) {
5306
+ if (!atLocation.name) {
5307
+ return yield* typeParserIssue("Class has no name", void 0, atLocation);
5308
+ }
5309
+ const heritageClauses = atLocation.heritageClauses;
5310
+ if (!heritageClauses) {
5311
+ return yield* typeParserIssue("Class has no heritage clauses", void 0, atLocation);
5312
+ }
5313
+ for (const heritageClause of heritageClauses) {
5314
+ for (const typeX of heritageClause.types) {
5315
+ if (ts.isExpressionWithTypeArguments(typeX)) {
5316
+ const expression = typeX.expression;
5317
+ if (ts.isCallExpression(expression)) {
5318
+ const schemaCall = expression.expression;
5319
+ if (ts.isCallExpression(schemaCall) && schemaCall.typeArguments && schemaCall.typeArguments.length > 0) {
5320
+ const isEffectSchemaModelModuleApi = yield* pipe(
5321
+ isNodeReferenceToEffectSchemaModelModuleApi("Class")(schemaCall.expression),
5322
+ orUndefined
5323
+ );
5324
+ if (isEffectSchemaModelModuleApi) {
5325
+ return {
5326
+ className: atLocation.name,
5327
+ selfTypeNode: schemaCall.typeArguments[0]
5328
+ };
5329
+ }
5330
+ }
5331
+ }
5332
+ }
5333
+ }
5334
+ }
5335
+ return yield* typeParserIssue("Class does not extend effect's Model.Class", void 0, atLocation);
5336
+ }),
5337
+ "TypeParser.extendsEffectSchemaModelClass",
5338
+ (atLocation) => atLocation
5339
+ );
5273
5340
  const isEffectLayerTypeSourceFile = cachedBy(
5274
5341
  fn("TypeParser.isEffectLayerTypeSourceFile")(function* (sourceFile) {
5275
5342
  const moduleSymbol = typeChecker.getSymbolAtLocation(sourceFile);
@@ -5642,6 +5709,7 @@ function make3(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
5642
5709
  isNodeReferenceToEffectDataModuleApi,
5643
5710
  isNodeReferenceToEffectContextModuleApi,
5644
5711
  isNodeReferenceToEffectSqlModelModuleApi,
5712
+ isNodeReferenceToEffectSchemaModelModuleApi,
5645
5713
  isNodeReferenceToEffectLayerModuleApi,
5646
5714
  isNodeReferenceToEffectSchemaParserModuleApi,
5647
5715
  isServiceMapTypeSourceFile,
@@ -5679,6 +5747,7 @@ function make3(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
5679
5747
  extendsSchemaTaggedRequest,
5680
5748
  extendsSchemaRequestClass,
5681
5749
  extendsEffectSqlModelClass,
5750
+ extendsEffectSchemaModelClass,
5682
5751
  lazyExpression,
5683
5752
  emptyFunction,
5684
5753
  pipingFlows,
@@ -7200,6 +7269,7 @@ var classSelfMismatch = createDiagnostic({
7200
7269
  )
7201
7270
  ),
7202
7271
  orElse2(() => typeParser.extendsEffectSqlModelClass(node)),
7272
+ orElse2(() => typeParser.extendsEffectSchemaModelClass(node)),
7203
7273
  orElse2(() => void_)
7204
7274
  );
7205
7275
  if (result) {
@@ -9592,6 +9662,765 @@ var nonObjectEffectServiceType = createDiagnostic({
9592
9662
  })
9593
9663
  });
9594
9664
 
9665
+ // src/diagnostics/outdatedApi.db.ts
9666
+ var asUnchanged = {
9667
+ _tag: "Unchanged"
9668
+ };
9669
+ var asRenamedSameBehaviour = (newName) => ({
9670
+ _tag: "RenamedSameBehaviour",
9671
+ newName
9672
+ });
9673
+ var asRenamedAndNeedsOptions = (newName, optionsInstructions) => ({
9674
+ _tag: "RenamedAndNeedsOptions",
9675
+ newName,
9676
+ optionsInstructions
9677
+ });
9678
+ var asRemoved = (alternativePattern) => ({
9679
+ _tag: "Removed",
9680
+ alternativePattern
9681
+ });
9682
+ var effectModuleMigrationDb = {
9683
+ // Common APIs (in both v3 and v4, unchanged)
9684
+ "acquireRelease": asUnchanged,
9685
+ "acquireUseRelease": asUnchanged,
9686
+ "addFinalizer": asUnchanged,
9687
+ "all": asUnchanged,
9688
+ "andThen": asUnchanged,
9689
+ "annotateCurrentSpan": asUnchanged,
9690
+ "annotateLogs": asUnchanged,
9691
+ "annotateSpans": asUnchanged,
9692
+ "as": asUnchanged,
9693
+ "asSome": asUnchanged,
9694
+ "asVoid": asUnchanged,
9695
+ "cached": asUnchanged,
9696
+ "cachedInvalidateWithTTL": asUnchanged,
9697
+ "cachedWithTTL": asUnchanged,
9698
+ "catch": asUnchanged,
9699
+ "catchIf": asUnchanged,
9700
+ "catchTag": asUnchanged,
9701
+ "catchTags": asUnchanged,
9702
+ "clockWith": asUnchanged,
9703
+ "currentParentSpan": asUnchanged,
9704
+ "currentSpan": asUnchanged,
9705
+ "delay": asUnchanged,
9706
+ "die": asUnchanged,
9707
+ "ensuring": asUnchanged,
9708
+ "eventually": asUnchanged,
9709
+ "exit": asUnchanged,
9710
+ "fail": asUnchanged,
9711
+ "failCause": asUnchanged,
9712
+ "failCauseSync": asUnchanged,
9713
+ "failSync": asUnchanged,
9714
+ "fiberId": asUnchanged,
9715
+ "filter": asUnchanged,
9716
+ "filterMap": asRemoved(
9717
+ "Use Effect.filter or Effect.map with Option instead."
9718
+ ),
9719
+ "filterOrElse": asUnchanged,
9720
+ "filterOrFail": asUnchanged,
9721
+ "flatMap": asUnchanged,
9722
+ "flatten": asUnchanged,
9723
+ "flip": asUnchanged,
9724
+ "fn": asUnchanged,
9725
+ "fnUntraced": asUnchanged,
9726
+ "forEach": asUnchanged,
9727
+ "forever": asUnchanged,
9728
+ "forkIn": asUnchanged,
9729
+ "forkScoped": asUnchanged,
9730
+ "gen": asUnchanged,
9731
+ "ignore": asUnchanged,
9732
+ "interrupt": asUnchanged,
9733
+ "interruptible": asUnchanged,
9734
+ "interruptibleMask": asUnchanged,
9735
+ "isEffect": asUnchanged,
9736
+ "isFailure": asUnchanged,
9737
+ "isSuccess": asUnchanged,
9738
+ "linkSpans": asUnchanged,
9739
+ "log": asUnchanged,
9740
+ "logDebug": asUnchanged,
9741
+ "logError": asUnchanged,
9742
+ "logFatal": asUnchanged,
9743
+ "logInfo": asUnchanged,
9744
+ "logTrace": asUnchanged,
9745
+ "logWarning": asUnchanged,
9746
+ "logWithLevel": asUnchanged,
9747
+ "makeLatch": asRemoved(
9748
+ "Use Latch.make instead of Effect.makeLatch."
9749
+ ),
9750
+ "makeSemaphore": asRemoved(
9751
+ "Use Semaphore.make instead of Effect.makeSemaphore."
9752
+ ),
9753
+ "makeSpan": asUnchanged,
9754
+ "makeSpanScoped": asUnchanged,
9755
+ "map": asUnchanged,
9756
+ "mapBoth": asUnchanged,
9757
+ "mapError": asUnchanged,
9758
+ "match": asUnchanged,
9759
+ "matchCause": asUnchanged,
9760
+ "matchCauseEffect": asUnchanged,
9761
+ "matchEffect": asUnchanged,
9762
+ "never": asUnchanged,
9763
+ "onError": asUnchanged,
9764
+ "onExit": asUnchanged,
9765
+ "onInterrupt": asUnchanged,
9766
+ "option": asUnchanged,
9767
+ "orDie": asUnchanged,
9768
+ "orElseSucceed": asUnchanged,
9769
+ "promise": asUnchanged,
9770
+ "provide": asUnchanged,
9771
+ "provideService": asUnchanged,
9772
+ "provideServiceEffect": asUnchanged,
9773
+ "race": asUnchanged,
9774
+ "raceAll": asUnchanged,
9775
+ "raceFirst": asUnchanged,
9776
+ "repeat": asUnchanged,
9777
+ "repeatOrElse": asUnchanged,
9778
+ "replicate": asUnchanged,
9779
+ "replicateEffect": asUnchanged,
9780
+ "request": asUnchanged,
9781
+ "retry": asUnchanged,
9782
+ "retryOrElse": asUnchanged,
9783
+ "runCallback": asUnchanged,
9784
+ "runFork": asUnchanged,
9785
+ "runPromise": asUnchanged,
9786
+ "runPromiseExit": asUnchanged,
9787
+ "runSync": asUnchanged,
9788
+ "runSyncExit": asUnchanged,
9789
+ "sandbox": asUnchanged,
9790
+ "schedule": asUnchanged,
9791
+ "scheduleFrom": asUnchanged,
9792
+ "scope": asUnchanged,
9793
+ "scoped": asUnchanged,
9794
+ "scopedWith": asUnchanged,
9795
+ "serviceOption": asUnchanged,
9796
+ "sleep": asUnchanged,
9797
+ "spanAnnotations": asUnchanged,
9798
+ "spanLinks": asUnchanged,
9799
+ "succeed": asUnchanged,
9800
+ "succeedNone": asUnchanged,
9801
+ "succeedSome": asUnchanged,
9802
+ "suspend": asUnchanged,
9803
+ "sync": asUnchanged,
9804
+ "tap": asUnchanged,
9805
+ "tapDefect": asUnchanged,
9806
+ "tapError": asUnchanged,
9807
+ "tapErrorTag": asUnchanged,
9808
+ "timed": asUnchanged,
9809
+ "timeout": asUnchanged,
9810
+ "timeoutOption": asUnchanged,
9811
+ "tracer": asUnchanged,
9812
+ "try": asUnchanged,
9813
+ "tryPromise": asUnchanged,
9814
+ "uninterruptible": asUnchanged,
9815
+ "uninterruptibleMask": asUnchanged,
9816
+ "updateService": asUnchanged,
9817
+ "useSpan": asUnchanged,
9818
+ "void": asUnchanged,
9819
+ "when": asUnchanged,
9820
+ "whileLoop": asUnchanged,
9821
+ "withConcurrency": asUnchanged,
9822
+ "withExecutionPlan": asUnchanged,
9823
+ "withLogSpan": asUnchanged,
9824
+ "withParentSpan": asUnchanged,
9825
+ "withSpan": asUnchanged,
9826
+ "withSpanScoped": asUnchanged,
9827
+ "withTracer": asUnchanged,
9828
+ "withTracerEnabled": asUnchanged,
9829
+ "withTracerTiming": asUnchanged,
9830
+ "yieldNow": asUnchanged,
9831
+ "zip": asUnchanged,
9832
+ "zipWith": asUnchanged,
9833
+ // Renamed APIs (v3 name → v4 name)
9834
+ "catchAll": asRenamedSameBehaviour("catch"),
9835
+ "catchAllCause": asRenamedSameBehaviour("catchCause"),
9836
+ "catchAllDefect": asRenamedSameBehaviour("catchDefect"),
9837
+ "catchSome": asRemoved(
9838
+ "Use Effect.catchIf instead. Note: the API shape changed from returning Option<Effect> to taking a predicate and handler separately."
9839
+ ),
9840
+ "catchSomeCause": asRemoved(
9841
+ "Use Effect.catchCauseIf instead. Note: the API shape changed from returning Option<Effect> to taking a predicate and handler separately."
9842
+ ),
9843
+ "ensureErrorType": asRenamedSameBehaviour("satisfiesErrorType"),
9844
+ "ensureRequirementsType": asRenamedSameBehaviour("satisfiesServicesType"),
9845
+ "ensureSuccessType": asRenamedSameBehaviour("satisfiesSuccessType"),
9846
+ "fork": asRenamedSameBehaviour("forkChild"),
9847
+ "forkDaemon": asRenamedSameBehaviour("forkDetach"),
9848
+ "scopeWith": asRenamedSameBehaviour("scopedWith"),
9849
+ "serviceOptional": asRenamedSameBehaviour("serviceOption"),
9850
+ "tapErrorCause": asRenamedSameBehaviour("tapCause"),
9851
+ // Removed APIs
9852
+ "annotateLogsScoped": asUnchanged,
9853
+ "awaitAllChildren": asUnchanged,
9854
+ "bind": asUnchanged,
9855
+ "bindTo": asUnchanged,
9856
+ "Do": asUnchanged,
9857
+ "let": asUnchanged,
9858
+ "partition": asUnchanged,
9859
+ "validate": asUnchanged,
9860
+ "catchSomeDefect": asRemoved(
9861
+ "Use Effect.catchDefect or Effect.matchCause to handle specific defects."
9862
+ ),
9863
+ "forkAll": asRemoved(
9864
+ "Fork effects individually with Effect.forEach and Effect.forkChild, or use Effect.all with concurrency options."
9865
+ ),
9866
+ "forkWithErrorHandler": asRemoved(
9867
+ "Fork the effect with Effect.forkChild and observe the fiber result via Fiber.join or Fiber.await."
9868
+ ),
9869
+ "Tag": asRemoved(
9870
+ "Use ServiceMap.Service instead of Effect.Tag."
9871
+ ),
9872
+ "Service": asRemoved(
9873
+ "Use ServiceMap.Service instead of Effect.Service."
9874
+ ),
9875
+ "runtime": asRemoved(
9876
+ "Runtime has been removed in Effect v4. Use Effect.services to grab services and then run using Effect.runPromiseWith."
9877
+ ),
9878
+ "bindAll": asRemoved(
9879
+ "Use Effect.gen instead of Effect.bindAll."
9880
+ ),
9881
+ "EffectTypeId": asRemoved(
9882
+ "EffectTypeId has been removed in Effect v4."
9883
+ ),
9884
+ "acquireReleaseInterruptible": asRemoved(
9885
+ "Use Effect.acquireRelease instead."
9886
+ ),
9887
+ "allSuccesses": asRemoved(
9888
+ "Use Effect.all with the { mode: 'either' } option and filter successes."
9889
+ ),
9890
+ "allWith": asRemoved(
9891
+ "Use Effect.all with options instead."
9892
+ ),
9893
+ "allowInterrupt": asRemoved(
9894
+ "Use Effect.yieldNow instead."
9895
+ ),
9896
+ "ap": asRemoved(
9897
+ "Use Effect.map and Effect.flatMap to apply functions instead."
9898
+ ),
9899
+ "asSomeError": asRemoved(
9900
+ "Use Effect.mapError(Option.some) instead."
9901
+ ),
9902
+ "async": asRenamedAndNeedsOptions("callback", "Note: in v4 the callback receives a Scheduler as 'this' context."),
9903
+ "asyncEffect": asRemoved(
9904
+ "Use Effect.suspend combined with Effect.promise instead."
9905
+ ),
9906
+ "blocked": asRemoved(
9907
+ "The request batching API has been reworked in Effect v4."
9908
+ ),
9909
+ "cacheRequestResult": asRemoved(
9910
+ "The request batching API has been reworked in Effect v4."
9911
+ ),
9912
+ "cachedFunction": asRemoved(
9913
+ "Use Effect.cached or implement caching with a Ref instead."
9914
+ ),
9915
+ "cause": asRemoved(
9916
+ "Use Effect.matchCause or Effect.sandbox to access the cause."
9917
+ ),
9918
+ "checkInterruptible": asRemoved(
9919
+ "Interruption checking has been removed in Effect v4."
9920
+ ),
9921
+ "clock": asRemoved(
9922
+ "Use Effect.clockWith instead."
9923
+ ),
9924
+ "configProviderWith": asRemoved(
9925
+ "ConfigProvider access has been reworked in Effect v4."
9926
+ ),
9927
+ "console": asRemoved(
9928
+ "Use Effect.consoleWith or the Console service directly."
9929
+ ),
9930
+ "consoleWith": asRemoved(
9931
+ "Console access has been reworked in Effect v4."
9932
+ ),
9933
+ "context": asRemoved(
9934
+ "Use Effect.context is removed. Access services directly via yield* or Effect.provideService."
9935
+ ),
9936
+ "contextWith": asRemoved(
9937
+ "Use Effect.map with service access instead."
9938
+ ),
9939
+ "contextWithEffect": asRemoved(
9940
+ "Use Effect.flatMap with service access instead."
9941
+ ),
9942
+ "custom": asRemoved(
9943
+ "Use Effect.suspend or Effect.sync to create custom effects."
9944
+ ),
9945
+ "daemonChildren": asRemoved(
9946
+ "Use Effect.forkDetach to fork detached fibers instead."
9947
+ ),
9948
+ "descriptor": asRemoved(
9949
+ "Fiber descriptor access has been removed in Effect v4."
9950
+ ),
9951
+ "descriptorWith": asRemoved(
9952
+ "Fiber descriptor access has been removed in Effect v4."
9953
+ ),
9954
+ "dieMessage": asRemoved(
9955
+ "Use Effect.die(new Error(message)) instead."
9956
+ ),
9957
+ "dieSync": asRemoved(
9958
+ "Use Effect.die with a lazily evaluated value instead."
9959
+ ),
9960
+ "diffFiberRefs": asRemoved(
9961
+ "FiberRef has been replaced by ServiceMap.Reference in Effect v4."
9962
+ ),
9963
+ "disconnect": asRemoved(
9964
+ "Fiber disconnect has been removed in Effect v4."
9965
+ ),
9966
+ "dropUntil": asRemoved(
9967
+ "Use Array.dropUntil and Effect.forEach instead."
9968
+ ),
9969
+ "dropWhile": asRemoved(
9970
+ "Use Array.dropWhile and Effect.forEach instead."
9971
+ ),
9972
+ "either": asRenamedAndNeedsOptions(
9973
+ "result",
9974
+ "Note: returns Result.Result<A, E> instead of Either<E, A>. Use the Result module to work with the result."
9975
+ ),
9976
+ "ensuringChild": asRemoved(
9977
+ "Use Effect.onExit to manage child fiber cleanup instead."
9978
+ ),
9979
+ "ensuringChildren": asRemoved(
9980
+ "Use Effect.onExit to manage child fiber cleanup instead."
9981
+ ),
9982
+ "every": asRemoved(
9983
+ "Use Effect.forEach with a predicate check instead."
9984
+ ),
9985
+ "exists": asRemoved(
9986
+ "Use Effect.forEach with a predicate check instead."
9987
+ ),
9988
+ "fiberIdWith": asRemoved(
9989
+ "Use Effect.fiberId instead."
9990
+ ),
9991
+ "filterEffectOrElse": asRemoved(
9992
+ "Use Effect.filterOrElse with an effectful predicate instead."
9993
+ ),
9994
+ "filterEffectOrFail": asRemoved(
9995
+ "Use Effect.filterOrFail with an effectful predicate instead."
9996
+ ),
9997
+ "filterOrDie": asRemoved(
9998
+ "Use Effect.filterOrFail and Effect.orDie instead."
9999
+ ),
10000
+ "filterOrDieMessage": asRemoved(
10001
+ "Use Effect.filterOrFail and Effect.orDie instead."
10002
+ ),
10003
+ "finalizersMask": asRemoved(
10004
+ "Finalizer masking has been removed in Effect v4."
10005
+ ),
10006
+ "findFirst": asRemoved(
10007
+ "Use Effect.forEach with early return instead."
10008
+ ),
10009
+ "firstSuccessOf": asRemoved(
10010
+ "Use Effect.raceAll instead."
10011
+ ),
10012
+ "flipWith": asRemoved(
10013
+ "Use Effect.flip combined with the desired transformation instead."
10014
+ ),
10015
+ "fromFiber": asRemoved(
10016
+ "Use Fiber.join instead."
10017
+ ),
10018
+ "fromFiberEffect": asRemoved(
10019
+ "Use Effect.flatMap with Fiber.join instead."
10020
+ ),
10021
+ "fromNullable": asRemoved(
10022
+ "Use Effect.suspend with null checks instead."
10023
+ ),
10024
+ "functionWithSpan": asRemoved(
10025
+ "Use Effect.withSpan instead."
10026
+ ),
10027
+ "getFiberRefs": asRemoved(
10028
+ "FiberRef has been replaced by ServiceMap.Reference in Effect v4."
10029
+ ),
10030
+ "getRuntimeFlags": asRemoved(
10031
+ "Runtime flags have been removed in Effect v4."
10032
+ ),
10033
+ "head": asRemoved(
10034
+ "Use Array.head and Effect.flatMap instead."
10035
+ ),
10036
+ "if": asRemoved(
10037
+ "Use Effect.when instead of Effect.if."
10038
+ ),
10039
+ "ignoreLogged": asRemoved(
10040
+ "Logging configuration has been reworked in Effect v4."
10041
+ ),
10042
+ "inheritFiberRefs": asRemoved(
10043
+ "FiberRef has been replaced by ServiceMap.Reference in Effect v4."
10044
+ ),
10045
+ "interruptWith": asRemoved(
10046
+ "Use Effect.interrupt instead."
10047
+ ),
10048
+ "intoDeferred": asRemoved(
10049
+ "Use Deferred.complete instead."
10050
+ ),
10051
+ "iterate": asRemoved(
10052
+ "Use Effect.whileLoop or recursion with Effect.suspend instead."
10053
+ ),
10054
+ "labelMetrics": asRemoved(
10055
+ "Metric labeling has been reworked in Effect v4."
10056
+ ),
10057
+ "labelMetricsScoped": asRemoved(
10058
+ "Metric labeling has been reworked in Effect v4."
10059
+ ),
10060
+ "liftPredicate": asRemoved(
10061
+ "Use Effect.filterOrFail instead."
10062
+ ),
10063
+ "linkSpanCurrent": asRemoved(
10064
+ "Use Effect.linkSpans instead."
10065
+ ),
10066
+ "locally": asRemoved(
10067
+ "FiberRef.locally has been removed. Use Effect.provideService with ServiceMap.Reference instead."
10068
+ ),
10069
+ "locallyScoped": asRemoved(
10070
+ "FiberRef.locally has been removed. Use Effect.provideService with ServiceMap.Reference instead."
10071
+ ),
10072
+ "locallyScopedWith": asRemoved(
10073
+ "FiberRef.locally has been removed. Use Effect.provideService with ServiceMap.Reference instead."
10074
+ ),
10075
+ "locallyWith": asRemoved(
10076
+ "FiberRef.locally has been removed. Use Effect.provideService with ServiceMap.Reference instead."
10077
+ ),
10078
+ "logAnnotations": asRemoved(
10079
+ "Use Effect.annotateLogs instead."
10080
+ ),
10081
+ "loop": asRemoved(
10082
+ "Use Effect.whileLoop or recursion with Effect.suspend instead."
10083
+ ),
10084
+ "mapAccum": asRemoved(
10085
+ "Use Effect.gen with a mutable accumulator instead."
10086
+ ),
10087
+ "mapErrorCause": asRemoved(
10088
+ "Use Effect.sandbox and Effect.mapError instead."
10089
+ ),
10090
+ "mapInputContext": asRemoved(
10091
+ "Use Effect.provide with a layer instead."
10092
+ ),
10093
+ "merge": asRemoved(
10094
+ "Use Effect.match or Effect.exit instead."
10095
+ ),
10096
+ "mergeAll": asRemoved(
10097
+ "Use Effect.forEach with a mutable accumulator instead."
10098
+ ),
10099
+ "metricLabels": asRemoved(
10100
+ "Metric labeling has been reworked in Effect v4."
10101
+ ),
10102
+ "negate": asRemoved(
10103
+ "Use Effect.map with boolean negation instead."
10104
+ ),
10105
+ "none": asRemoved(
10106
+ "Use Effect.filterOrFail or Effect.option instead."
10107
+ ),
10108
+ "once": asRemoved(
10109
+ "Use Effect.cached instead."
10110
+ ),
10111
+ "optionFromOptional": asRemoved(
10112
+ "Use Effect.option instead."
10113
+ ),
10114
+ "orDieWith": asRemoved(
10115
+ "Use Effect.orDie or Effect.mapError combined with Effect.orDie instead."
10116
+ ),
10117
+ "orElse": asRemoved(
10118
+ "Use Effect.catch or Effect.matchEffect instead."
10119
+ ),
10120
+ "orElseFail": asRemoved(
10121
+ "Use Effect.mapError instead."
10122
+ ),
10123
+ "parallelErrors": asRemoved(
10124
+ "Use Effect.all with concurrency options instead."
10125
+ ),
10126
+ "parallelFinalizers": asRemoved(
10127
+ "Finalizer ordering configuration has been removed in Effect v4."
10128
+ ),
10129
+ "patchFiberRefs": asRemoved(
10130
+ "FiberRef has been replaced by ServiceMap.Reference in Effect v4."
10131
+ ),
10132
+ "patchRuntimeFlags": asRemoved(
10133
+ "Runtime flags have been removed in Effect v4."
10134
+ ),
10135
+ "raceWith": asRemoved(
10136
+ "Use Effect.race or Effect.raceFirst instead."
10137
+ ),
10138
+ "random": asRemoved(
10139
+ "Use Effect.randomWith instead."
10140
+ ),
10141
+ "randomWith": asRemoved(
10142
+ "Random access has been reworked in Effect v4."
10143
+ ),
10144
+ "reduce": asRemoved(
10145
+ "Use Effect.forEach with a mutable accumulator or Effect.gen instead."
10146
+ ),
10147
+ "reduceEffect": asRemoved(
10148
+ "Use Effect.forEach with a mutable accumulator or Effect.gen instead."
10149
+ ),
10150
+ "reduceRight": asRemoved(
10151
+ "Use Effect.forEach with a mutable accumulator or Effect.gen instead."
10152
+ ),
10153
+ "reduceWhile": asRemoved(
10154
+ "Use Effect.gen with early return instead."
10155
+ ),
10156
+ "repeatN": asRemoved(
10157
+ "Use Effect.repeat with a schedule instead."
10158
+ ),
10159
+ "runRequestBlock": asRemoved(
10160
+ "The request batching API has been reworked in Effect v4."
10161
+ ),
10162
+ "scheduleForked": asRemoved(
10163
+ "Use Effect.schedule combined with Effect.forkChild instead."
10164
+ ),
10165
+ "sequentialFinalizers": asRemoved(
10166
+ "Finalizer ordering configuration has been removed in Effect v4."
10167
+ ),
10168
+ "serviceConstants": asRemoved(
10169
+ "Service helpers have been removed. Use ServiceMap.Service and yield* to access services."
10170
+ ),
10171
+ "serviceFunction": asRemoved(
10172
+ "Service helpers have been removed. Use ServiceMap.Service and yield* to access services."
10173
+ ),
10174
+ "serviceFunctionEffect": asRemoved(
10175
+ "Service helpers have been removed. Use ServiceMap.Service and yield* to access services."
10176
+ ),
10177
+ "serviceFunctions": asRemoved(
10178
+ "Service helpers have been removed. Use ServiceMap.Service and yield* to access services."
10179
+ ),
10180
+ "serviceMembers": asRemoved(
10181
+ "Service helpers have been removed. Use ServiceMap.Service and yield* to access services."
10182
+ ),
10183
+ "setFiberRefs": asRemoved(
10184
+ "FiberRef has been replaced by ServiceMap.Reference in Effect v4."
10185
+ ),
10186
+ "step": asRemoved(
10187
+ "The request batching API has been reworked in Effect v4."
10188
+ ),
10189
+ "summarized": asRemoved(
10190
+ "Use Effect.gen to capture before/after state instead."
10191
+ ),
10192
+ "supervised": asRemoved(
10193
+ "Supervision has been reworked in Effect v4."
10194
+ ),
10195
+ "tagMetrics": asRemoved(
10196
+ "Metric labeling has been reworked in Effect v4."
10197
+ ),
10198
+ "tagMetricsScoped": asRemoved(
10199
+ "Metric labeling has been reworked in Effect v4."
10200
+ ),
10201
+ "takeUntil": asRemoved(
10202
+ "Use Array.takeUntil and Effect.forEach instead."
10203
+ ),
10204
+ "takeWhile": asRemoved(
10205
+ "Use Array.takeWhile and Effect.forEach instead."
10206
+ ),
10207
+ "tapBoth": asRemoved(
10208
+ "Use Effect.tap and Effect.tapError instead."
10209
+ ),
10210
+ "timedWith": asRemoved(
10211
+ "Use Effect.timed instead."
10212
+ ),
10213
+ "timeoutFail": asRemoved(
10214
+ "Use Effect.timeout combined with Effect.catchTag for TimeoutException instead."
10215
+ ),
10216
+ "timeoutFailCause": asRemoved(
10217
+ "Use Effect.timeout combined with Effect.sandbox instead."
10218
+ ),
10219
+ "timeoutTo": asRemoved(
10220
+ "Use Effect.timeoutOption and Effect.map instead."
10221
+ ),
10222
+ "tracerWith": asRemoved(
10223
+ "Use Effect.tracer instead."
10224
+ ),
10225
+ "transplant": asRemoved(
10226
+ "Fiber transplanting has been removed in Effect v4."
10227
+ ),
10228
+ "transposeMapOption": asRemoved(
10229
+ "Use Effect.map with Option operations instead."
10230
+ ),
10231
+ "transposeOption": asRemoved(
10232
+ "Use Effect.option instead."
10233
+ ),
10234
+ "tryMap": asRemoved(
10235
+ "Use Effect.map inside Effect.try instead."
10236
+ ),
10237
+ "tryMapPromise": asRemoved(
10238
+ "Use Effect.tryPromise instead."
10239
+ ),
10240
+ "unless": asRemoved(
10241
+ "Use Effect.when with a negated condition instead."
10242
+ ),
10243
+ "unlessEffect": asRemoved(
10244
+ "Use Effect.when with a negated effectful condition instead."
10245
+ ),
10246
+ "unsafeMakeLatch": asRemoved(
10247
+ "Use Effect.makeLatch instead."
10248
+ ),
10249
+ "unsafeMakeSemaphore": asRemoved(
10250
+ "Use Effect.makeSemaphore instead."
10251
+ ),
10252
+ "unsandbox": asRemoved(
10253
+ "Use Effect.catchCause instead."
10254
+ ),
10255
+ "updateFiberRefs": asRemoved(
10256
+ "FiberRef has been replaced by ServiceMap.Reference in Effect v4."
10257
+ ),
10258
+ "using": asRemoved(
10259
+ "Use Effect.scoped instead."
10260
+ ),
10261
+ "validateAll": asRemoved(
10262
+ "Use Effect.all with { mode: 'validate' } instead."
10263
+ ),
10264
+ "validateFirst": asRemoved(
10265
+ "Use Effect.all with { mode: 'validate' } instead."
10266
+ ),
10267
+ "validateWith": asRemoved(
10268
+ "Use Effect.all with { mode: 'validate' } instead."
10269
+ ),
10270
+ "whenEffect": asRemoved(
10271
+ "Use Effect.when with an effectful condition via Effect.flatMap instead."
10272
+ ),
10273
+ "whenFiberRef": asRemoved(
10274
+ "FiberRef has been replaced by ServiceMap.Reference in Effect v4."
10275
+ ),
10276
+ "whenLogLevel": asRemoved(
10277
+ "Log level checking has been reworked in Effect v4."
10278
+ ),
10279
+ "whenRef": asRemoved(
10280
+ "Use Ref.get and Effect.when instead."
10281
+ ),
10282
+ "withClock": asRemoved(
10283
+ "Clock configuration has been reworked in Effect v4."
10284
+ ),
10285
+ "withClockScoped": asRemoved(
10286
+ "Clock configuration has been reworked in Effect v4."
10287
+ ),
10288
+ "withConfigProvider": asRemoved(
10289
+ "ConfigProvider configuration has been reworked in Effect v4."
10290
+ ),
10291
+ "withConfigProviderScoped": asRemoved(
10292
+ "ConfigProvider configuration has been reworked in Effect v4."
10293
+ ),
10294
+ "withConsole": asRemoved(
10295
+ "Console configuration has been reworked in Effect v4."
10296
+ ),
10297
+ "withConsoleScoped": asRemoved(
10298
+ "Console configuration has been reworked in Effect v4."
10299
+ ),
10300
+ "withEarlyRelease": asRemoved(
10301
+ "Use Effect.scoped with manual resource management instead."
10302
+ ),
10303
+ "withFiberRuntime": asRenamedAndNeedsOptions(
10304
+ "withFiber",
10305
+ "Note: in v4, only the Fiber is provided (not the full FiberRuntime with status). The callback receives (fiber: Fiber<unknown, unknown>) instead of (fiber: FiberRuntime<A, E>, status: FiberStatus)."
10306
+ ),
10307
+ "withMaxOpsBeforeYield": asRemoved(
10308
+ "Use ServiceMap.Reference for MaxOpsBeforeYield configuration instead."
10309
+ ),
10310
+ "withMetric": asRemoved(
10311
+ "Metric configuration has been reworked in Effect v4."
10312
+ ),
10313
+ "withRandom": asRemoved(
10314
+ "Random configuration has been reworked in Effect v4."
10315
+ ),
10316
+ "withRandomFixed": asRemoved(
10317
+ "Random configuration has been reworked in Effect v4."
10318
+ ),
10319
+ "withRandomScoped": asRemoved(
10320
+ "Random configuration has been reworked in Effect v4."
10321
+ ),
10322
+ "withRequestBatching": asRemoved(
10323
+ "Request batching configuration has been reworked in Effect v4."
10324
+ ),
10325
+ "withRequestCache": asRemoved(
10326
+ "Request caching configuration has been reworked in Effect v4."
10327
+ ),
10328
+ "withRequestCaching": asRemoved(
10329
+ "Request caching configuration has been reworked in Effect v4."
10330
+ ),
10331
+ "withRuntimeFlagsPatch": asRemoved(
10332
+ "Runtime flags have been removed in Effect v4."
10333
+ ),
10334
+ "withRuntimeFlagsPatchScoped": asRemoved(
10335
+ "Runtime flags have been removed in Effect v4."
10336
+ ),
10337
+ "withScheduler": asRemoved(
10338
+ "Use ServiceMap.Reference for Scheduler configuration instead."
10339
+ ),
10340
+ "withSchedulingPriority": asRemoved(
10341
+ "Scheduling priority configuration has been removed in Effect v4."
10342
+ ),
10343
+ "withTracerScoped": asRemoved(
10344
+ "Use Effect.withTracer instead."
10345
+ ),
10346
+ "withUnhandledErrorLogLevel": asRemoved(
10347
+ "Use ServiceMap.Reference for UnhandledLogLevel configuration instead."
10348
+ ),
10349
+ "zipLeft": asRemoved(
10350
+ "Use Effect.tap instead of Effect.zipLeft."
10351
+ ),
10352
+ "zipRight": asRemoved(
10353
+ "Use Effect.andThen instead of Effect.zipRight."
10354
+ )
10355
+ };
10356
+
10357
+ // src/diagnostics/outdatedApi.ts
10358
+ var outdatedApi = createDiagnostic({
10359
+ name: "outdatedApi",
10360
+ code: 48,
10361
+ description: "Detects usage of APIs that have been removed or renamed in Effect v4",
10362
+ severity: "warning",
10363
+ apply: fn("outdatedApi.apply")(function* (sourceFile, report) {
10364
+ const typeParser = yield* service(TypeParser);
10365
+ const ts = yield* service(TypeScriptApi);
10366
+ const typeChecker = yield* service(TypeCheckerApi);
10367
+ const typeCheckerUtils = yield* service(TypeCheckerUtils);
10368
+ if (typeParser.supportedEffect() === "v3") return;
10369
+ let hasReported = false;
10370
+ function reportMigration(propertyAccess, propertyName, _migration) {
10371
+ hasReported = true;
10372
+ report({
10373
+ location: propertyAccess.name,
10374
+ messageText: `${propertyName} is an Effect v3 API, but the project is using Effect v4.`,
10375
+ fixes: []
10376
+ });
10377
+ }
10378
+ const checkPropertyAccessMigration = (propertyAccess, checkRightNode, migrationDb) => {
10379
+ if (!ts.isPropertyAccessExpression(propertyAccess)) return;
10380
+ const identifier2 = propertyAccess.name;
10381
+ if (!ts.isIdentifier(identifier2)) return;
10382
+ const identifierName = ts.idText(identifier2);
10383
+ const migration = migrationDb[identifierName];
10384
+ if (!migration) return;
10385
+ if (migration._tag === "Unchanged") return;
10386
+ const targetType = typeCheckerUtils.getTypeAtLocation(propertyAccess.expression);
10387
+ if (!targetType) return;
10388
+ const targetPropertySymbol = typeChecker.getPropertyOfType(targetType, identifierName);
10389
+ if (targetPropertySymbol) return;
10390
+ return pipe(
10391
+ checkRightNode(propertyAccess.expression),
10392
+ map5(() => reportMigration(propertyAccess, identifierName, migration)),
10393
+ ignore
10394
+ );
10395
+ };
10396
+ const nodeToVisit = [];
10397
+ const appendNodeToVisit = (node) => {
10398
+ nodeToVisit.push(node);
10399
+ return void 0;
10400
+ };
10401
+ ts.forEachChild(sourceFile, appendNodeToVisit);
10402
+ while (nodeToVisit.length > 0) {
10403
+ const node = nodeToVisit.shift();
10404
+ ts.forEachChild(node, appendNodeToVisit);
10405
+ const checkEffectMigration = checkPropertyAccessMigration(
10406
+ node,
10407
+ typeParser.importedEffectModule,
10408
+ effectModuleMigrationDb
10409
+ );
10410
+ if (checkEffectMigration) {
10411
+ yield* ignore(checkEffectMigration);
10412
+ }
10413
+ }
10414
+ if (hasReported) {
10415
+ report({
10416
+ location: { pos: 0, end: 0 },
10417
+ messageText: "This project targets Effect v4, but is using Effect v3 APIs. To find the correct API to use, clone and consult the github.com/effect-ts/effect-smol repository for the corresponding v4 replacement.",
10418
+ fixes: []
10419
+ });
10420
+ }
10421
+ })
10422
+ });
10423
+
9595
10424
  // src/diagnostics/outdatedEffectCodegen.ts
9596
10425
  var outdatedEffectCodegen = createDiagnostic({
9597
10426
  name: "outdatedEffectCodegen",
@@ -10962,6 +11791,7 @@ var unsupportedServiceAccessors = createDiagnostic({
10962
11791
 
10963
11792
  // src/diagnostics.ts
10964
11793
  var diagnostics = [
11794
+ outdatedApi,
10965
11795
  anyUnknownInErrorContext,
10966
11796
  instanceOfSchema,
10967
11797
  catchAllToMapError,
@@ -11130,7 +11960,7 @@ var effectSchemaSelfInClasses = createCompletion({
11130
11960
  );
11131
11961
  if (hasTaggedErrorCompletion) {
11132
11962
  completions2.push({
11133
- name: `TaggedError<${name}>`,
11963
+ name: `TaggedErrorClass<${name}>`,
11134
11964
  kind: ts.ScriptElementKind.constElement,
11135
11965
  insertText: isFullyQualified ? `${schemaIdentifier}.TaggedErrorClass<${name}>()("${errorTagKey}", {${"${0}"}}){}` : `TaggedErrorClass<${name}>()("${errorTagKey}", {${"${0}"}}){}`,
11136
11966
  replacementSpan,
@@ -11187,6 +12017,33 @@ var effectSchemaSelfInClasses = createCompletion({
11187
12017
  });
11188
12018
  }
11189
12019
  }
12020
+ if (typeParser.supportedEffect() === "v4") {
12021
+ const modelIdentifier = tsUtils.findImportedModuleIdentifierByPackageAndNameOrBarrel(
12022
+ sourceFile,
12023
+ "effect/unstable/schema",
12024
+ "Model"
12025
+ ) || tsUtils.findImportedModuleIdentifierByPackageAndNameOrBarrel(
12026
+ sourceFile,
12027
+ "effect/unstable",
12028
+ "Model"
12029
+ ) || "Model";
12030
+ const isModelFullyQualified = modelIdentifier === ts.idText(accessedObject);
12031
+ const hasModelClassCompletion = isModelFullyQualified || isSome2(
12032
+ yield* pipe(
12033
+ typeParser.isNodeReferenceToEffectSchemaModelModuleApi("Class")(accessedObject),
12034
+ option
12035
+ )
12036
+ );
12037
+ if (hasModelClassCompletion) {
12038
+ completions2.push({
12039
+ name: `Class<${name}>`,
12040
+ kind: ts.ScriptElementKind.constElement,
12041
+ insertText: isModelFullyQualified ? `${modelIdentifier}.Class<${name}>("${name}")({${"${0}"}}){}` : `Class<${name}>("${name}")({${"${0}"}}){}`,
12042
+ replacementSpan,
12043
+ isSnippet: true
12044
+ });
12045
+ }
12046
+ }
11190
12047
  return completions2;
11191
12048
  })
11192
12049
  });