@effect-app/infra 2.69.0 → 2.70.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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @effect-app/infra
2
2
 
3
+ ## 2.70.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d29cb1b: refactor: drop optional identifier for Schema classes.
8
+
9
+ ### Patch Changes
10
+
11
+ - 4ae597d: update packages
12
+ - Updated dependencies [d29cb1b]
13
+ - effect-app@2.47.0
14
+
15
+ ## 2.69.1
16
+
17
+ ### Patch Changes
18
+
19
+ - b095bb5: tscp
20
+ - Updated dependencies [b095bb5]
21
+ - effect-app@2.46.1
22
+
3
23
  ## 2.69.0
4
24
 
5
25
  ### Minor Changes
@@ -10,9 +10,6 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
10
10
  to: EmailData | EmailData[];
11
11
  cc: EmailData | EmailData[];
12
12
  bcc: EmailData | EmailData[];
13
- headers?: {
14
- [key: string]: string;
15
- };
16
13
  replyTo?: EmailData;
17
14
  sendAt?: number;
18
15
  subject?: string;
@@ -26,6 +23,9 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
26
23
  sections?: {
27
24
  [key: string]: string;
28
25
  };
26
+ headers?: {
27
+ [key: string]: string;
28
+ };
29
29
  categories?: string[];
30
30
  category?: string;
31
31
  customArgs?: {
@@ -49,9 +49,6 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
49
49
  to: EmailData | EmailData[];
50
50
  cc: EmailData | EmailData[];
51
51
  bcc: EmailData | EmailData[];
52
- headers?: {
53
- [key: string]: string;
54
- };
55
52
  replyTo?: EmailData;
56
53
  sendAt?: number;
57
54
  subject?: string;
@@ -65,6 +62,9 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
65
62
  sections?: {
66
63
  [key: string]: string;
67
64
  };
65
+ headers?: {
66
+ [key: string]: string;
67
+ };
68
68
  categories?: string[];
69
69
  category?: string;
70
70
  customArgs?: {
@@ -88,9 +88,6 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
88
88
  to: EmailData | EmailData[];
89
89
  cc: EmailData | EmailData[];
90
90
  bcc: EmailData | EmailData[];
91
- headers?: {
92
- [key: string]: string;
93
- };
94
91
  replyTo?: EmailData;
95
92
  sendAt?: number;
96
93
  subject?: string;
@@ -104,6 +101,9 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
104
101
  sections?: {
105
102
  [key: string]: string;
106
103
  };
104
+ headers?: {
105
+ [key: string]: string;
106
+ };
107
107
  categories?: string[];
108
108
  category?: string;
109
109
  customArgs?: {
@@ -127,9 +127,6 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
127
127
  to: EmailData | EmailData[];
128
128
  cc: EmailData | EmailData[];
129
129
  bcc: EmailData | EmailData[];
130
- headers?: {
131
- [key: string]: string;
132
- };
133
130
  replyTo?: EmailData;
134
131
  sendAt?: number;
135
132
  subject?: string;
@@ -143,6 +140,9 @@ export declare function renderMessage(forceFake: boolean): (msg: EmailMsg) => {
143
140
  sections?: {
144
141
  [key: string]: string;
145
142
  };
143
+ headers?: {
144
+ [key: string]: string;
145
+ };
146
146
  categories?: string[];
147
147
  category?: string;
148
148
  customArgs?: {
@@ -24,7 +24,7 @@ declare const Emailer_base: (abstract new (service: {
24
24
  } & {
25
25
  use: <X>(body: (_: {
26
26
  sendMail: (msg: EmailMsgOptionalFrom) => Effect<void, SendMailError>;
27
- }) => X) => X extends Effect.Effect<infer A_1, infer E_1, infer R_3> ? Effect.Effect<A_1, E_1, R_3 | Emailer> : Effect.Effect<X, never, Emailer>;
27
+ }) => X) => X extends Effect.Effect<infer A_1, infer E_1, infer R_3> ? Effect.Effect<A_1, E_1, Emailer | R_3> : Effect.Effect<X, never, Emailer>;
28
28
  };
29
29
  export declare class Emailer extends Emailer_base {
30
30
  }
@@ -44,7 +44,7 @@ declare const MainFiberSet_base: (abstract new (service: {
44
44
  run: <R_1, XE extends never, XA extends unknown>(effect: Effect.Effect<XA, XE, R_1>) => Effect.Effect<Fiber.RuntimeFiber<XA, XE>, never, R_1>;
45
45
  add: (...fibers: Fiber.RuntimeFiber<never, never>[]) => Effect.Effect<void, never, never>;
46
46
  addAll: (fibers: readonly Fiber.RuntimeFiber<never, never>[]) => Effect.Effect<void, never, never>;
47
- }) => X) => X extends Effect.Effect<infer A_1, infer E_2, infer R_4> ? Effect.Effect<A_1, E_2, MainFiberSet | R_4> : Effect.Effect<X, never, MainFiberSet>;
47
+ }) => X) => X extends Effect.Effect<infer A_1, infer E_2, infer R_4> ? Effect.Effect<A_1, E_2, R_4 | MainFiberSet> : Effect.Effect<X, never, MainFiberSet>;
48
48
  };
49
49
  /**
50
50
  * Whenever you fork long running (e.g worker) fibers via e.g `Effect.forkScoped` or `Effect.forkDaemon`
@@ -20,12 +20,12 @@ export declare function makeRepoInternal<Evt = never>(): <ItemType extends strin
20
20
  config?: Omit<StoreConfig<Encoded>, "partitionValue"> & {
21
21
  partitionValue?: (a: Encoded) => string;
22
22
  };
23
- }) => Effect.Effect<Repository<T, Encoded, Evt, ItemType, IdKey, Exclude<R, RCtx>, RPublish>, E, R | RInitial | StoreMaker>;
23
+ }) => Effect.Effect<Repository<T, Encoded, Evt, ItemType, IdKey, Exclude<R, RCtx>, RPublish>, E, StoreMaker | R | RInitial>;
24
24
  Q: Q.Query<Encoded>;
25
25
  };
26
26
  export declare function makeStore<Encoded extends FieldValues>(): <ItemType extends string, R, E, T, IdKey extends keyof Encoded>(name: ItemType, schema: S.Schema<T, E, R>, mapTo: (e: E, etag: string | undefined) => Encoded, idKey: IdKey) => <RInitial = never, EInitial = never>(makeInitial?: Effect<readonly T[], EInitial, RInitial> | undefined, config?: Omit<StoreConfig<Encoded>, "partitionValue"> & {
27
27
  partitionValue?: (a: Encoded) => string;
28
- }) => Effect.Effect<import("../../../Store.js").Store<IdKey, Encoded, PersistenceModelType<Encoded>>, EInitial, R | RInitial | StoreMaker>;
28
+ }) => Effect.Effect<import("../../../Store.js").Store<IdKey, Encoded, PersistenceModelType<Encoded>>, EInitial, StoreMaker | R | RInitial>;
29
29
  export interface Repos<T, Encoded extends {
30
30
  id: string;
31
31
  }, RSchema, Evt, ItemType extends string, IdKey extends keyof T, RPublish> {
@@ -21,7 +21,7 @@ export declare const toFilter: <TFieldValues extends FieldValues, A, R, TFieldVa
21
21
  key: import("../filter/types/path/eager.js").Path<TFieldValues>;
22
22
  direction: "ASC" | "DESC";
23
23
  }[]];
24
- ttype: "one" | "count" | "many";
24
+ ttype: "one" | "many" | "count";
25
25
  mode: "project" | "collect" | "transform";
26
26
  filter: FilterResult[];
27
27
  };
@@ -54,15 +54,15 @@ declare const Operations_base: (abstract new (service: {
54
54
  update: (id: OperationId, progress: OperationProgress) => Effect.Effect<void, never, never>;
55
55
  }>) & {
56
56
  toLayer: {
57
- (): Layer.Layer<Operations, never, OperationsRepo | RequestFiberSet>;
57
+ (): Layer.Layer<Operations, never, RequestFiberSet | OperationsRepo>;
58
58
  <E_1, R_1>(eff: Effect.Effect<Omit<Operations, keyof Context.TagClassShape<any, any>>, E_1, R_1>): Layer.Layer<Operations, E_1, R_1>;
59
59
  };
60
60
  toLayerScoped: {
61
- (): Layer.Layer<Operations, never, OperationsRepo | RequestFiberSet>;
61
+ (): Layer.Layer<Operations, never, RequestFiberSet | OperationsRepo>;
62
62
  <E_1, R_2>(eff: Effect.Effect<Context.TagClassShape<any, any>, E_1, R_2>): Layer.Layer<Operations, E_1, Exclude<R_2, Scope.Scope>>;
63
63
  };
64
64
  of: (service: Context.TagClassShape<any, any>) => Operations;
65
- make: Effect.Effect<Operations, never, OperationsRepo | RequestFiberSet>;
65
+ make: Effect.Effect<Operations, never, RequestFiberSet | OperationsRepo>;
66
66
  } & Context.Tag<Operations, Operations> & {
67
67
  cleanup: Effect.Effect<void[], never, Operations>;
68
68
  register: (title: S.NonEmptyString2k) => Effect.Effect<S.StringId, never, Scope.Scope | Operations>;
@@ -13,6 +13,6 @@ export declare function makeSQLQueue<Evt extends {
13
13
  _tag: string;
14
14
  }, EvtE, DrainEvtE>(queueName: NonEmptyString255, queueDrainName: NonEmptyString255, schema: S.Schema<Evt, EvtE>, drainSchema: S.Schema<DrainEvt, DrainEvtE>): Effect.Effect<{
15
15
  publish: (messages_0: Evt, ...messages: Evt[]) => Effect.Effect<void, never, never>;
16
- drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, import("../RequestContext.js").LocaleRef | import("../Store/Memory.js").storeId | import("../Store/ContextMapContainer.js").ContextMapContainer>, Tracer.ParentSpan>>;
16
+ drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, import("../RequestContext.js").LocaleRef | import("../Store/ContextMapContainer.js").ContextMapContainer | import("../Store/Memory.js").storeId>, Tracer.ParentSpan>>;
17
17
  }, never, SqlClient.SqlClient>;
18
18
  //# sourceMappingURL=SQLQueue.d.ts.map
@@ -9,6 +9,6 @@ export declare function makeMemQueue<Evt extends {
9
9
  _tag: string;
10
10
  }, EvtE, DrainEvtE>(queueName: string, queueDrainName: string, schema: S.Schema<Evt, EvtE>, drainSchema: S.Schema<DrainEvt, DrainEvtE>): Effect.Effect<{
11
11
  publish: (messages_0: Evt, ...messages: Evt[]) => Effect.Effect<void, never, never>;
12
- drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, import("../RequestContext.js").LocaleRef | import("../Store/Memory.js").storeId | import("../Store/ContextMapContainer.js").ContextMapContainer>, Tracer.ParentSpan>>;
12
+ drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, import("../RequestContext.js").LocaleRef | import("../Store/ContextMapContainer.js").ContextMapContainer | import("../Store/Memory.js").storeId>, Tracer.ParentSpan>>;
13
13
  }, never, MemQueue>;
14
14
  //# sourceMappingURL=memQueue.d.ts.map
@@ -9,8 +9,8 @@ export declare function makeServiceBusQueue<Evt extends {
9
9
  id: StringId;
10
10
  _tag: string;
11
11
  }, EvtE, DrainEvtE>(queueName: string, queueDrainName: string, schema: S.Schema<Evt, EvtE>, drainSchema: S.Schema<DrainEvt, DrainEvtE>): Effect.Effect<{
12
- drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, import("effect/Scope").Scope | Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, import("../RequestContext.js").LocaleRef | import("../Store/Memory.js").storeId | import("../Store/ContextMapContainer.js").ContextMapContainer>, ServiceBusReceiverFactory>>;
12
+ drain: <DrainE, DrainR>(handleEvent: (ks: DrainEvt) => Effect<void, DrainE, DrainR>, sessionId?: string) => Effect.Effect<never, never, import("effect/Scope").Scope | Exclude<Exclude<Exclude<DrainR, Tracer.ParentSpan>, import("../RequestContext.js").LocaleRef | import("../Store/ContextMapContainer.js").ContextMapContainer | import("../Store/Memory.js").storeId>, ServiceBusReceiverFactory>>;
13
13
  publish: (messages_0: Evt, ...messages: Evt[]) => Effect.Effect<void, never, never>;
14
- }, never, ServiceBusReceiverFactory | import("@azure/service-bus").ServiceBusSender>;
15
- export declare function makeServiceBusLayers(url: string, queueName: string, queueDrainName: string): Layer.Layer<ServiceBusReceiverFactory | import("@azure/service-bus").ServiceBusSender, never, never>;
14
+ }, never, import("@azure/service-bus").ServiceBusSender | ServiceBusReceiverFactory>;
15
+ export declare function makeServiceBusLayers(url: string, queueName: string, queueDrainName: string): Layer.Layer<import("@azure/service-bus").ServiceBusSender | ServiceBusReceiverFactory, never, never>;
16
16
  //# sourceMappingURL=sbqueue.d.ts.map
@@ -27,9 +27,9 @@ declare const RequestContext_base: S.EnhancedClass<RequestContext, {
27
27
  } & S.WithDefaults<S.Schema<string & S.StringIdBrand & import("effect-app/ids").UserProfileIdBrand, string, never>>;
28
28
  }>>;
29
29
  }, RequestContext.Encoded, never, {
30
+ readonly name: string & S.NonEmptyString255Brand;
30
31
  readonly locale: "en" | "de";
31
32
  readonly namespace: string & S.NonEmptyString255Brand;
32
- readonly name: string & S.NonEmptyString255Brand;
33
33
  readonly span: {
34
34
  readonly traceId: string;
35
35
  readonly spanId: string;
@@ -1,6 +1,6 @@
1
1
  import { Context, Effect, Layer } from "effect-app";
2
2
  import { ContextMap } from "./service.js";
3
- declare const ContextMapContainer_base: Context.ReferenceClass<ContextMapContainer, "ContextMapContainer", ContextMap | "root">;
3
+ declare const ContextMapContainer_base: Context.ReferenceClass<ContextMapContainer, "ContextMapContainer", "root" | ContextMap>;
4
4
  export declare class ContextMapContainer extends ContextMapContainer_base {
5
5
  static readonly layer: Layer.Layer<ContextMapContainer, never, never>;
6
6
  }
@@ -92,7 +92,7 @@ declare const StoreMaker_base: (abstract new (service: {
92
92
  } & Context.Tag<StoreMaker, StoreMaker> & {} & {
93
93
  use: <X>(body: (_: {
94
94
  make: <IdKey extends keyof Encoded, Encoded extends FieldValues, R = never, E = never>(name: string, idKey: IdKey, seed?: Effect<Iterable<Encoded>, E, R>, config?: StoreConfig<Encoded>) => Effect<Store<IdKey, Encoded>, E, R>;
95
- }) => X) => X extends Effect.Effect<infer A_1, infer E_1, infer R_3> ? Effect.Effect<A_1, E_1, StoreMaker | R_3> : Effect.Effect<X, never, StoreMaker>;
95
+ }) => X) => X extends Effect.Effect<infer A_1, infer E_1, infer R_3> ? Effect.Effect<A_1, E_1, R_3 | StoreMaker> : Effect.Effect<X, never, StoreMaker>;
96
96
  };
97
97
  export declare class StoreMaker extends StoreMaker_base {
98
98
  }
@@ -127,7 +127,7 @@ declare const ContextMap_base: (abstract new (service: {
127
127
  use: <X>(body: (_: {
128
128
  get: (id: string) => string | undefined;
129
129
  set: (id: string, eTag: string | undefined) => void;
130
- }) => X) => X extends Effect.Effect<infer A_1, infer E_2, infer R_4> ? Effect.Effect<A_1, E_2, R_4 | ContextMap> : Effect.Effect<X, never, ContextMap>;
130
+ }) => X) => X extends Effect.Effect<infer A_1, infer E_2, infer R_4> ? Effect.Effect<A_1, E_2, ContextMap | R_4> : Effect.Effect<X, never, ContextMap>;
131
131
  };
132
132
  export declare class ContextMap extends ContextMap_base {
133
133
  }
@@ -29,7 +29,7 @@ export declare class ServiceBusReceiverFactory extends ServiceBusReceiverFactory
29
29
  static readonly Live: (queueName: string) => Layer.Layer<ServiceBusReceiverFactory, never, ServiceBusClient>;
30
30
  }
31
31
  export declare function sendMessages(messages: ServiceBusMessage | ServiceBusMessage[] | ServiceBusMessageBatch, options?: OperationOptionsBase): Effect.Effect<void, never, ServiceBusSender>;
32
- export declare function subscribe<RMsg, RErr>(hndlr: MessageHandlers<RMsg, RErr>, sessionId?: string): Effect.Effect<void, never, Scope.Scope | RMsg | RErr | ServiceBusReceiverFactory>;
32
+ export declare function subscribe<RMsg, RErr>(hndlr: MessageHandlers<RMsg, RErr>, sessionId?: string): Effect.Effect<void, never, Scope.Scope | ServiceBusReceiverFactory | RMsg | RErr>;
33
33
  export interface MessageHandlers<RMsg, RErr> {
34
34
  /**
35
35
  * Handler that processes messages from service bus.
@@ -1,5 +1,5 @@
1
1
  import { Effect } from "effect-app";
2
2
  import { HttpServerRequest, HttpServerResponse } from "effect-app/http";
3
3
  import { Locale } from "../../RequestContext.js";
4
- export declare const RequestContextMiddleware: (defaultLocale?: Locale) => <E, R>(app: import("@effect/platform/HttpApp").Default<E, R>) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, HttpServerRequest.HttpServerRequest | Exclude<Exclude<R, import("effect/Tracer").ParentSpan>, import("../../RequestContext.js").LocaleRef | import("../../Store/Memory.js").storeId | import("../../Store/ContextMapContainer.js").ContextMapContainer>>;
4
+ export declare const RequestContextMiddleware: (defaultLocale?: Locale) => <E, R>(app: import("@effect/platform/HttpApp").Default<E, R>) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, HttpServerRequest.HttpServerRequest | Exclude<Exclude<R, import("effect/Tracer").ParentSpan>, import("../../RequestContext.js").LocaleRef | import("../../Store/ContextMapContainer.js").ContextMapContainer | import("../../Store/Memory.js").storeId>>;
5
5
  //# sourceMappingURL=RequestContextMiddleware.d.ts.map
@@ -9,6 +9,6 @@ export declare const getRC: Effect.Effect<{
9
9
  namespace: NonEmptyString255;
10
10
  }, never, never>;
11
11
  export declare const setupRequestContextFromCurrent: (name?: string, options?: Tracer.SpanOptions) => <R, E, A>(self: Effect<A, E, R>) => Effect.Effect<A, E, Exclude<Exclude<R, Tracer.ParentSpan>, ContextMapContainer>>;
12
- export declare function setupRequestContext<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext): Effect.Effect<A, E, Exclude<Exclude<R, Tracer.ParentSpan>, LocaleRef | storeId | ContextMapContainer>>;
13
- export declare function setupRequestContextWithCustomSpan<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext, name: string, options?: Tracer.SpanOptions): Effect.Effect<A, E, Exclude<Exclude<R, Tracer.ParentSpan>, LocaleRef | storeId | ContextMapContainer>>;
12
+ export declare function setupRequestContext<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext): Effect.Effect<A, E, Exclude<Exclude<R, Tracer.ParentSpan>, LocaleRef | ContextMapContainer | storeId>>;
13
+ export declare function setupRequestContextWithCustomSpan<R, E, A>(self: Effect<A, E, R>, requestContext: RequestContext, name: string, options?: Tracer.SpanOptions): Effect.Effect<A, E, Exclude<Exclude<R, Tracer.ParentSpan>, LocaleRef | ContextMapContainer | storeId>>;
14
14
  //# sourceMappingURL=setupRequest.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/infra",
3
- "version": "2.69.0",
3
+ "version": "2.70.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -13,7 +13,7 @@
13
13
  "proper-lockfile": "^4.1.2",
14
14
  "pure-rand": "7.0.1",
15
15
  "query-string": "^9.2.2",
16
- "effect-app": "2.46.0"
16
+ "effect-app": "2.47.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@azure/cosmos": "^4.5.0",
@@ -363,15 +363,15 @@
363
363
  "sideEffects": false,
364
364
  "scripts": {
365
365
  "watch": "pnpm build:tsc -w",
366
- "build:tsc": "pnpm clean-dist && effect-app-cli packagejson tsc --build",
366
+ "build:tsc": "pnpm clean-dist && effect-app-cli packagejson tspc --build",
367
367
  "build": "pnpm build:tsc",
368
- "watch2": "pnpm clean-dist && NODE_OPTIONS=--max-old-space-size=6144 tsc -w",
368
+ "watch2": "pnpm clean-dist && NODE_OPTIONS=--max-old-space-size=6144 tspc -w",
369
369
  "clean": "rm -rf dist",
370
370
  "clean-dist": "sh ../../scripts/clean-dist.sh",
371
371
  "circular": "pnpm circular:src && pnpm circular:dist",
372
372
  "circular:src": "madge --circular --ts-config ./tsconfig.json --extensions ts ./src",
373
373
  "circular:dist": "madge --circular --extensions js ./dist",
374
- "compile": "NODE_OPTIONS=--max-old-space-size=6144 tsc --noEmit",
374
+ "compile": "NODE_OPTIONS=--max-old-space-size=6144 tspc --noEmit",
375
375
  "lint": "NODE_OPTIONS=--max-old-space-size=6144 ESLINT_TS=1 eslint ./src",
376
376
  "lint:watch": "ESLINT_TS=1 esw -w --changed --clear --ext ts,tsx .",
377
377
  "autofix": "pnpm lint --fix",
@@ -381,6 +381,6 @@
381
381
  "client": "node --experimental-specifier-resolution=node -r source-map-support/register ./dist/client.bin.js",
382
382
  "ncu": "ncu",
383
383
  "pub": "pnpm prepublish && npm publish --access public",
384
- "prepublish": "pnpm build && cp -f ./tsconfig.json ./tsconfig.json.bak && node ../../scripts/mergeTsConfig.cjs ./tsconfig.json"
384
+ "prepublish": "pnpm build && cp -f ./tsconfig.json ./tsconfig.json.bak && node ../../scripts/mergeTsConfig.mjs ./tsconfig.json"
385
385
  }
386
386
  }
@@ -11,7 +11,7 @@ import type * as EffectRequest from "effect/Request"
11
11
  import { SomeService } from "./query.test.js"
12
12
 
13
13
  class UserProfile extends Context.assignTag<UserProfile, UserProfile>("UserProfile")(
14
- Class<UserProfile>()({
14
+ Class<UserProfile>("UserProfile")({
15
15
  id: S.String
16
16
  })
17
17
  ) {
@@ -31,8 +31,7 @@ export class Some extends Context.TagMakeId("Some", Effect.succeed({ a: 1 }))<So
31
31
  export class ContextMaker extends Effect.Service<ContextMaker>()("ContextMaker", {
32
32
  effect: Effect.gen(function*() {
33
33
  yield* SomeService
34
- const SomeContext = Layer.sync(Some, () => new Some({ a: 1 }))
35
- return Layer.build(SomeContext)
34
+ return Effect.sync(() => Context.make(Some, new Some({ a: 1 })))
36
35
  })
37
36
  }) {}
38
37
 
@@ -1 +1 @@
1
- {"version":3,"file":"controller.test.d.ts","sourceRoot":"","sources":["../controller.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAA8B,MAAM,+BAA+B,CAAA;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAoC,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAClI,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;;;;;;;;AAE7C,cAAM,WAAY,SAAQ,gBAIzB;CACA;;;;;;AAED,cAAM,gBAAiB,SAAQ,qBAE7B;CAAG;AAEL,MA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;;;;;;;;qFAAiC,CAAA"}
@@ -13,7 +13,7 @@ const str = S.Struct({ _tag: S.Literal("string"), value: S.String })
13
13
  const num = S.Struct({ _tag: S.Literal("number"), value: S.Number })
14
14
  const someUnion = S.Union(str, num)
15
15
 
16
- export class Something extends S.Class<Something>()({
16
+ export class Something extends S.Class<Something>("Something")({
17
17
  id: S.StringId.withDefault,
18
18
  displayName: S.NonEmptyString255,
19
19
  name: S.NullOr(S.NonEmptyString255).withDefault,
@@ -467,22 +467,22 @@ it(
467
467
  () =>
468
468
  Effect
469
469
  .gen(function*() {
470
- class AA extends S.Class<AA>()({
470
+ class AA extends S.Class<AA>("AA")({
471
471
  id: S.Literal("AA"),
472
472
  a: S.Unknown
473
473
  }) {}
474
474
 
475
- class BB extends S.Class<BB>()({
475
+ class BB extends S.Class<BB>("BB")({
476
476
  id: S.Literal("BB"),
477
477
  b: S.Unknown
478
478
  }) {}
479
479
 
480
- class CC extends S.Class<CC>()({
480
+ class CC extends S.Class<CC>("CC")({
481
481
  id: S.Literal("CC"),
482
482
  c: S.Unknown
483
483
  }) {}
484
484
 
485
- class DD extends S.Class<DD>()({
485
+ class DD extends S.Class<DD>("DD")({
486
486
  id: S.Literal("DD"),
487
487
  d: S.Unknown
488
488
  }) {}
@@ -661,12 +661,12 @@ it(
661
661
  it("remove null from one constituent of a tagged union", () =>
662
662
  Effect
663
663
  .gen(function*() {
664
- class AA extends S.Class<AA>()({
664
+ class AA extends S.Class<AA>("AA")({
665
665
  id: S.Literal("AA"),
666
666
  a: S.String
667
667
  }) {}
668
668
 
669
- class BB extends S.Class<BB>()({
669
+ class BB extends S.Class<BB>("BB")({
670
670
  id: S.Literal("BB"),
671
671
  b: S.NullOr(S.Number)
672
672
  }) {}
@@ -709,22 +709,22 @@ it("remove null from one constituent of a tagged union", () =>
709
709
  it("refine 3", () =>
710
710
  Effect
711
711
  .gen(function*() {
712
- class AA extends S.Class<AA>()({
712
+ class AA extends S.Class<AA>("AA")({
713
713
  id: S.Literal("AA"),
714
714
  a: S.Unknown
715
715
  }) {}
716
716
 
717
- class BB extends S.Class<BB>()({
717
+ class BB extends S.Class<BB>("BB")({
718
718
  id: S.Literal("BB"),
719
719
  b: S.Unknown
720
720
  }) {}
721
721
 
722
- class CC extends S.Class<CC>()({
722
+ class CC extends S.Class<CC>("CC")({
723
723
  id: S.Literal("CC"),
724
724
  c: S.Unknown
725
725
  }) {}
726
726
 
727
- class DD extends S.Class<DD>()({
727
+ class DD extends S.Class<DD>("DD")({
728
728
  id: S.Literal("DD"),
729
729
  d: S.Unknown
730
730
  }) {}
@@ -747,7 +747,7 @@ it("refine 3", () =>
747
747
  it("my test", () =>
748
748
  Effect
749
749
  .gen(function*() {
750
- class AA extends S.Class<AA>()({
750
+ class AA extends S.Class<AA>("AA")({
751
751
  id: S.String,
752
752
  as: S.Array(S.String)
753
753
  }) {}
@@ -773,7 +773,7 @@ it("refine inner without imposing a projection", () =>
773
773
  b: S.Unknown
774
774
  }) {}
775
775
 
776
- class Data extends S.Class<Data>()({
776
+ class Data extends S.Class<Data>("Data")({
777
777
  id: S.String,
778
778
  union: S.Union(AA, BB)
779
779
  }) {}
@@ -940,7 +940,7 @@ it("distribution over union", () =>
940
940
  it("refine nested union", () =>
941
941
  Effect
942
942
  .gen(function*() {
943
- class TestNested extends S.Class<TestNested>()({ id: S.String, nested: TestUnion }) {}
943
+ class TestNested extends S.Class<TestNested>("TestNested")({ id: S.String, nested: TestUnion }) {}
944
944
 
945
945
  const repo = yield* makeRepo("test", TestNested, {})
946
946
 
@@ -19,7 +19,7 @@ export const rt = ManagedRuntime.make(Layer.mergeAll(
19
19
  Logger.minimumLogLevel(LogLevel.Debug)
20
20
  ))
21
21
 
22
- class Something extends S.Class<Something>()({
22
+ class Something extends S.Class<Something>("Something")({
23
23
  id: S.String,
24
24
  name: S.String,
25
25
  description: S.String,
package/tsconfig.json CHANGED
@@ -15,6 +15,32 @@
15
15
  "checkJs": true,
16
16
  "esModuleInterop": true,
17
17
  "skipLibCheck": true,
18
+ "plugins": [
19
+ {
20
+ "name": "ts-plugin-sort-import-suggestions",
21
+ "moveUpPatterns": [
22
+ "\\.{1,2}/",
23
+ "^(?:\\.\\./)+",
24
+ "^#",
25
+ "^@/",
26
+ "effect",
27
+ "^@effect/"
28
+ ],
29
+ "moveDownPatterns": [
30
+ "^node_modules/"
31
+ ],
32
+ "overrides": {
33
+ "effect-app": []
34
+ }
35
+ },
36
+ {
37
+ "name": "@effect/language-service",
38
+ "transform": "@effect/language-service/transform",
39
+ "diagnosticSeverity": {
40
+ "missingEffectServiceDependency": "error"
41
+ }
42
+ }
43
+ ],
18
44
  "module": "Node16",
19
45
  "lib": [
20
46
  "ES2023"