effect 2.3.6 → 2.3.7

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.
Files changed (48) hide show
  1. package/ModuleVersion/package.json +6 -0
  2. package/dist/cjs/GlobalValue.js +27 -2
  3. package/dist/cjs/GlobalValue.js.map +1 -1
  4. package/dist/cjs/ModuleVersion.js +49 -0
  5. package/dist/cjs/ModuleVersion.js.map +1 -0
  6. package/dist/cjs/index.js +4 -2
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/internal/cache.js +1 -1
  9. package/dist/cjs/internal/cache.js.map +1 -1
  10. package/dist/cjs/internal/effectable.js +2 -2
  11. package/dist/cjs/internal/effectable.js.map +1 -1
  12. package/dist/cjs/internal/fiberRuntime.js +3 -3
  13. package/dist/cjs/internal/fiberRuntime.js.map +1 -1
  14. package/dist/cjs/internal/option.js +2 -1
  15. package/dist/cjs/internal/option.js.map +1 -1
  16. package/dist/cjs/internal/version.js +8 -2
  17. package/dist/cjs/internal/version.js.map +1 -1
  18. package/dist/dts/ModuleVersion.d.ts +11 -0
  19. package/dist/dts/ModuleVersion.d.ts.map +1 -0
  20. package/dist/dts/index.d.ts +6 -0
  21. package/dist/dts/index.d.ts.map +1 -1
  22. package/dist/dts/internal/version.d.ts +2 -1
  23. package/dist/dts/internal/version.d.ts.map +1 -1
  24. package/dist/esm/GlobalValue.js +2 -2
  25. package/dist/esm/GlobalValue.js.map +1 -1
  26. package/dist/esm/ModuleVersion.js +17 -0
  27. package/dist/esm/ModuleVersion.js.map +1 -0
  28. package/dist/esm/index.js +6 -0
  29. package/dist/esm/index.js.map +1 -1
  30. package/dist/esm/internal/cache.js +1 -1
  31. package/dist/esm/internal/cache.js.map +1 -1
  32. package/dist/esm/internal/effectable.js +2 -2
  33. package/dist/esm/internal/effectable.js.map +1 -1
  34. package/dist/esm/internal/fiberRuntime.js +3 -3
  35. package/dist/esm/internal/fiberRuntime.js.map +1 -1
  36. package/dist/esm/internal/option.js +2 -1
  37. package/dist/esm/internal/option.js.map +1 -1
  38. package/dist/esm/internal/version.js +5 -1
  39. package/dist/esm/internal/version.js.map +1 -1
  40. package/package.json +9 -1
  41. package/src/GlobalValue.ts +2 -2
  42. package/src/ModuleVersion.ts +18 -0
  43. package/src/index.ts +7 -0
  44. package/src/internal/cache.ts +1 -1
  45. package/src/internal/effectable.ts +2 -2
  46. package/src/internal/fiberRuntime.ts +3 -3
  47. package/src/internal/option.ts +2 -1
  48. package/src/internal/version.ts +7 -1
@@ -7,7 +7,7 @@ import { pipeArguments } from "../Pipeable.js"
7
7
  import type * as Sink from "../Sink.js"
8
8
  import type * as Stream from "../Stream.js"
9
9
  import * as OpCodes from "./opCodes/effect.js"
10
- import { moduleVersion } from "./version.js"
10
+ import * as version from "./version.js"
11
11
 
12
12
  /** @internal */
13
13
  export const EffectTypeId: Effect.EffectTypeId = Symbol.for("effect/Effect") as Effect.EffectTypeId
@@ -30,7 +30,7 @@ export const effectVariance = {
30
30
  /* c8 ignore next */
31
31
  _A: (_: never) => _,
32
32
 
33
- _V: moduleVersion
33
+ _V: version.getCurrentVersion()
34
34
  }
35
35
 
36
36
  const sinkVariance = {
@@ -67,7 +67,7 @@ import { OpSupervision } from "./runtimeFlags.js"
67
67
  import * as supervisor from "./supervisor.js"
68
68
  import * as SupervisorPatch from "./supervisor/patch.js"
69
69
  import * as tracer from "./tracer.js"
70
- import { moduleVersion } from "./version.js"
70
+ import * as version from "./version.js"
71
71
 
72
72
  /** @internal */
73
73
  export const fiberStarted = metric.counter("effect_fiber_started")
@@ -1287,11 +1287,11 @@ export class FiberRuntime<in out A, in out E = never> implements Fiber.RuntimeFi
1287
1287
  // @ts-expect-error
1288
1288
  cur = this._tracer.context(
1289
1289
  () => {
1290
- if (moduleVersion !== (cur as core.Primitive)[EffectTypeId]._V) {
1290
+ if (version.getCurrentVersion() !== (cur as core.Primitive)[EffectTypeId]._V) {
1291
1291
  return core.dieMessage(
1292
1292
  `Cannot execute an Effect versioned ${
1293
1293
  (cur as core.Primitive)[EffectTypeId]._V
1294
- } with a Runtime of version ${moduleVersion}`
1294
+ } with a Runtime of version ${version.getCurrentVersion()}`
1295
1295
  )
1296
1296
  }
1297
1297
  // @ts-expect-error
@@ -42,6 +42,7 @@ const SomeProto = Object.assign(Object.create(CommonProto), {
42
42
  }
43
43
  })
44
44
 
45
+ const NoneHash = Hash.hash("None")
45
46
  const NoneProto = Object.assign(Object.create(CommonProto), {
46
47
  _tag: "None",
47
48
  _op: "None",
@@ -49,7 +50,7 @@ const NoneProto = Object.assign(Object.create(CommonProto), {
49
50
  return isOption(that) && isNone(that)
50
51
  },
51
52
  [Hash.symbol]<A>(this: Option.None<A>) {
52
- return Hash.combine(Hash.hash(this._tag))
53
+ return NoneHash
53
54
  },
54
55
  toJSON<A>(this: Option.None<A>) {
55
56
  return {
@@ -1 +1,7 @@
1
- export const moduleVersion = "2.3.6"
1
+ let moduleVersion = "2.3.7"
2
+
3
+ export const getCurrentVersion = () => moduleVersion
4
+
5
+ export const setCurrentVersion = (version: string) => {
6
+ moduleVersion = version
7
+ }