@shivaedev/server 0.38.0 → 0.38.2

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,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.38.2 - 2026-11-20
4
+
5
+ ### Changed
6
+
7
+ - Update `@shivaedev/admin` from 0.27.1 to 0.27.2.
8
+ - Update `@shivaedev/contract` from 0.51.0 to 0.52.0.
9
+ - Update `@shivaedev/identity` from 0.34.2 to 0.35.0.
10
+
11
+ ## 0.38.1 - 2026-11-20
12
+
13
+ ### Changed
14
+
15
+ - Update `@shivaedev/admin` from 0.27.0 to 0.27.1.
16
+ - Update `@shivaedev/contract` from 0.50.0 to 0.51.0.
17
+ - Update `@shivaedev/identity` from 0.34.1 to 0.34.2.
18
+
3
19
  ## 0.38.0 - 2026-11-20
4
20
 
5
21
  ### Changed
package/README.md CHANGED
@@ -138,9 +138,9 @@ A service may come from another registration in the same list. The `replacements
138
138
 
139
139
  `appModules` returns an Effect that rejects duplicate queue names before building any host. `DuplicateModuleQueue` from `@shivaedev/server/DuplicateModuleQueue.ts` identifies `queue`, `firstModule` and `secondModule`, naming a defined module by its own name; repeating a name within one module also fails. It combines the native RPC groups, handler Layers, the migration loaders and schema components of the modules that declare `migrations`, skipping the rest. It includes each admin registration's group and handlers and exposes their merged registry as `modules.admin`. Migration numbers belong to one application-wide sequence. Existing hosts can continue to supply their groups, handlers, services and migrations directly.
140
140
 
141
- The host builds `services` once for its lifetime and builds `requestServices` once per RPC call, including each call on a persistent WebSocket connection. Native RPC middleware supplies the request services after the contract's identity middleware resolves the caller. Declare `selfSubject` or `accountSubject` on contracts whose request services require `Subject`, `SessionUser` and `Identity`. Request services yield global dependencies from the enclosing environment; leave those global Layers out of the request Layer so they are reused. `appModules` rejects global services that require caller context or a service registered in the request slot.
141
+ The host builds `services` once for its lifetime and builds `requestServices` once per RPC call, including each call on a persistent WebSocket connection. Native RPC middleware supplies the request services after the identity middleware of the module or contract resolves the caller. Declare `selfSubject` or `accountSubject` on contracts whose request services require `Subject`, `SessionUser` and `Identity`. Request services yield global dependencies from the enclosing environment; leave those global Layers out of the request Layer so they are reused. `appModules` rejects global services that require caller context or a service registered in the request slot.
142
142
 
143
- A `defineService` declares its dependencies in `requires` and its operations yield them. Keep each operation in an `Effect.fn` file beside `service.ts`, with a span named for the final segment of the PascalCase service ID and the operation: `RequestViewService.read` for a service ID ending in `/RequestViewService`. Register its Layer in `requestServices` when those dependencies include the caller. Its initializer can capture caller values and allocate an `Effect.cached` value: repeated reads share that value within one request, and the next request computes it again. Handlers yield the service and call its methods. Register an infallible acquisition Layer in this slot; operation failures keep their contract's typed error channel. The host-version stream does not acquire application request services.
143
+ A `defineService` declares its dependencies in `requires` and its operations yield them. Keep each operation in an `Effect.fn` file beside `service.ts`, with a span named for the final segment of the PascalCase service ID and the operation: `RequestViewService.read` for a service ID ending in `/RequestViewService`. Register its Layer in `requestServices` when those dependencies include the caller. Its initializer can capture caller values and allocate an `Effect.cached` value: repeated reads share that value within one request, and the next request computes it again. Operations yield the service and call its methods. Register an infallible acquisition Layer in this slot; operation failures keep their contract's typed error channel. The host-version stream does not acquire application request services.
144
144
 
145
145
  Pass `{ replacements: Layer.succeed(MyPort, implementation) }` as the second argument to `appModules`. Replacements take precedence over the combined default `ports` before module `services` acquire dependencies. Leave these ports unprovided in the module's service Layer; an adapter already captured by `Layer.provide` inside that Layer cannot be replaced from outside it. Missing ports and replacement Layer requirements remain in the host's requirement type. `workerHost` takes the same composition, provides its services to all module workers after database preparation, and scopes their lifetime to the returned Layer. Supply the shared `PgBoss` client through the service Layer in each process; the host and worker use the same module ports and replacements.
146
146
 
@@ -17,7 +17,7 @@ export function prepareMigrations(migrations) {
17
17
  }
18
18
  function waitForMigrations(migrations) {
19
19
  return Effect.gen(function* () {
20
- const progressInterval = Duration.fromInputUnsafe(migrations.progressInterval ?? "30 seconds");
20
+ const progressInterval = migrations.progressInterval ?? Duration.seconds(30);
21
21
  let pending = { components: [], migrations: [] };
22
22
  let progress;
23
23
  function log(message) {
@@ -1 +1 @@
1
- {"version":3,"file":"prepareMigrations.js","sourceRoot":"","sources":["../src/prepareMigrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAkC,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AAGxH,MAAM,UAAU,iBAAiB,CAAO,UAAkC;IACzE,QAAQ,UAAU,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC;QACtC,KAAK,OAAO,EAAE,CAAC;YACd,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,GAAG,UAAU,CAAC;YACpD,OAAO,wBAAwB,CAAC,MAAM,CAAC,CAAC;QACzC,CAAC;QACD,KAAK,MAAM;YACV,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAC;QACtC,KAAK,SAAS;YACb,OAAO,eAAe,CAAC,EAAE,GAAG,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,IAAI,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACpH,CAAC;AACF,CAAC;AAED,SAAS,iBAAiB,CAAO,UAAkC;IAClE,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC1B,MAAM,gBAAgB,GAAG,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,gBAAgB,IAAI,YAAY,CAAC,CAAC;QAC/F,IAAI,OAAO,GAA8B,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,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AAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/server",
3
- "version": "0.38.0",
3
+ "version": "0.38.2",
4
4
  "description": "The Effect application host: HTTP and RPC serving, health, OTLP export, database and migrations, and development mode",
5
5
  "keywords": [
6
6
  "effect"
@@ -47,10 +47,10 @@
47
47
  ],
48
48
  "dependencies": {
49
49
  "@shivaedev/changes": "0.14.1",
50
- "@shivaedev/contract": "0.50.0",
50
+ "@shivaedev/contract": "0.52.0",
51
51
  "@shivaedev/errors": "0.14.0",
52
52
  "@shivaedev/http": "0.9.1",
53
- "@shivaedev/identity": "0.34.1",
53
+ "@shivaedev/identity": "0.35.0",
54
54
  "@shivaedev/local-postgres": "0.16.2",
55
55
  "@shivaedev/sql": "0.52.0"
56
56
  },
@@ -59,14 +59,14 @@
59
59
  "@effect/sql-pg": "4.1.4",
60
60
  "@effect/vitest": "4.1.4",
61
61
  "@shivaedev/access": "0.6.6",
62
- "@shivaedev/admin": "0.27.0",
62
+ "@shivaedev/admin": "0.27.2",
63
63
  "@shivaedev/jobs": "0.43.1",
64
- "@shivaedev/quality": "0.78.6",
64
+ "@shivaedev/quality": "0.80.0",
65
65
  "@shivaedev/rate-limit": "0.6.15",
66
66
  "@shivaedev/service": "0.9.2",
67
- "@shivaedev/test-kits": "0.13.5",
67
+ "@shivaedev/test-kits": "0.13.7",
68
68
  "@shivaedev/test-sql": "0.25.5",
69
- "@shivaedev/test-story": "0.49.1",
69
+ "@shivaedev/test-story": "0.50.1",
70
70
  "@types/node": "24.19.2",
71
71
  "better-auth": "1.7.22",
72
72
  "effect": "4.1.4",
@@ -78,7 +78,7 @@
78
78
  "@effect/platform-node": "4.1.4",
79
79
  "@effect/sql-pg": "4.1.4",
80
80
  "@effect/vitest": "4.1.4",
81
- "@shivaedev/admin": "0.27.0",
81
+ "@shivaedev/admin": "0.27.2",
82
82
  "better-auth": "1.7.22",
83
83
  "effect": "4.1.4"
84
84
  },
@@ -20,7 +20,7 @@ export function prepareMigrations<R, E>(migrations: MigrationOptions<R, E>) {
20
20
 
21
21
  function waitForMigrations<R, E>(migrations: MigrationOptions<R, E>) {
22
22
  return Effect.gen(function* () {
23
- const progressInterval = Duration.fromInputUnsafe(migrations.progressInterval ?? "30 seconds");
23
+ const progressInterval = migrations.progressInterval ?? Duration.seconds(30);
24
24
  let pending: PendingPostgresMigrations = { components: [], migrations: [] };
25
25
  let progress: Fiber.Fiber<never> | undefined;
26
26
  function log(message: string) {