@webjsdev/server 0.8.65 → 0.8.67

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.d.ts CHANGED
@@ -25,7 +25,8 @@ import type { LayoutProps, PageProps, RouteHandlerContext } from '@webjsdev/core
25
25
 
26
26
  // The `./testing` subpath types are re-exported wholesale (the helpers ship
27
27
  // from both the main entry and the subpath; this avoids duplicating them).
28
- export * from './src/testing.d.ts';
28
+ import type { Handle } from './src/testing.js';
29
+ export * from './src/testing.js';
29
30
 
30
31
  // ---------------------------------------------------------------------------
31
32
  // Shared local types
@@ -34,8 +35,10 @@ export * from './src/testing.d.ts';
34
35
  /** A webjs middleware: receives the request + a `next()` continuation. */
35
36
  export type Middleware = (req: Request, next: () => Promise<Response>) => Promise<Response> | Response;
36
37
 
37
- // `Handle` is re-exported from ./src/testing.d.ts (the `export *` above), so it
38
- // is not re-declared here. `RequestHandler.handle` / `Handle` reference it.
38
+ // `Handle` is re-exported from ./src/testing.js (the `export *` above), so it
39
+ // is not re-declared here. It is IMPORTED as well, because `export *` re-exports
40
+ // a name without creating a local binding, so `RequestHandler.handle` below
41
+ // could not otherwise see it.
39
42
 
40
43
  /**
41
44
  * The `ActionResult<T>` envelope a server action / page action returns.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjsdev/server",
3
- "version": "0.8.65",
3
+ "version": "0.8.67",
4
4
  "type": "module",
5
5
  "description": "The server for WebJs, a full-stack JavaScript framework built on web components with server-side rendering and no build step. Provides the file-based router, SSR, server actions, route handlers, middleware, and live reload on Node 24+ or Bun.",
6
6
  "main": "index.js",
@@ -28,7 +28,6 @@
28
28
  "README.md"
29
29
  ],
30
30
  "dependencies": {
31
- "@webjsdev/core": "^0.7.51",
32
31
  "ws": "^8.20.0"
33
32
  },
34
33
  "publishConfig": {
@@ -54,5 +53,11 @@
54
53
  },
55
54
  "optionalDependencies": {
56
55
  "amaro": "^1.1.10"
56
+ },
57
+ "peerDependencies": {
58
+ "@webjsdev/core": "^0.7.51"
59
+ },
60
+ "devDependencies": {
61
+ "@webjsdev/core": "^0.7.51"
57
62
  }
58
63
  }
@@ -41,9 +41,9 @@ import { fileURLToPath } from 'node:url';
41
41
  * `integer` leaf types.
42
42
  *
43
43
  * So a value is type-checked only when its schema declares `type: "boolean"` or
44
- * `type: "integer"`, or an `enum`. Today that is 9 of the 17 top-level keys; the
45
- * other 8 (`headers`, `redirects`, `allowedOrigins`, `basePath`, `csp`, `dev`,
46
- * `start`, `doctor`) pass whatever they hold, `csp` because its schema is a
44
+ * `type: "integer"`, or an `enum`. Today that is 9 of the 19 top-level keys; the
45
+ * other 10 (`headers`, `redirects`, `allowedOrigins`, `basePath`, `csp`, `dev`,
46
+ * `start`, `db`, `doctor`, `ci`) pass whatever they hold, `csp` because its schema is a
47
47
  * `oneOf` with no `type` at all and the rest because theirs is `array`,
48
48
  * `string`, or `object`. That is enough for the case this exists to close, a
49
49
  * typo'd top-level key silently dropped, plus the leaf kinds a schema can decide
@@ -217,6 +217,11 @@
217
217
  }
218
218
  }
219
219
  },
220
+ "db": {
221
+ "description": "The `webjs db` verb map (#1468), bring-your-own-ORM. Read by the CLI (readDbCommands in packages/cli/lib/app-tasks.js), NOT the server. Each key is a verb and its value the shell command `webjs db <verb>` runs instead of the drizzle-kit default (run with node_modules/.bin on PATH, extra CLI args appended), so `webjs db migrate` keeps one spelling across ORMs: { \"migrate\": \"prisma migrate deploy\" }. Any key is a verb (a new one adds a subcommand); an unmapped verb keeps its default (drizzle-kit for generate / migrate / push / studio, db/seed.server.ts for seed), so an app with no block is unchanged.",
222
+ "type": "object",
223
+ "additionalProperties": { "type": "string" }
224
+ },
220
225
  "doctor": {
221
226
  "description": "`webjs doctor` policy (#1257). Read by the CLI (readDoctorPolicy in packages/cli/lib/doctor.js), NOT the server.",
222
227
  "type": "object",
@@ -232,6 +237,71 @@
232
237
  }
233
238
  }
234
239
  }
240
+ },
241
+ "ci": {
242
+ "description": "Local CI (#1471): the step list `webjs ci` runs on a developer machine, and the same list a cloud pipeline runs by calling `npm run ci`, so the two cannot drift. Read by the CLI (readCiConfig in packages/cli/lib/ci-config.js), NOT the server. A step is a string (shorthand for a command whose title is the command), a { title, run, env? } command, or a { title, steps, parallel? } group. `parallel` is a slot count (default 1, sequential); a group nested inside a parallel group takes ONE slot and runs its steps in order, so it cannot declare `parallel` itself.",
243
+ "type": "object",
244
+ "additionalProperties": false,
245
+ "required": ["steps"],
246
+ "properties": {
247
+ "steps": {
248
+ "description": "The steps, run in order. Required: a block with no steps is refused, since a run of zero steps would read as green. Every child gets CI=true and node_modules/.bin on PATH. A failing step fails the run (exit 1); --fail-fast stops at the first failure.",
249
+ "type": "array",
250
+ "items": { "$ref": "#/definitions/ciStep" }
251
+ }
252
+ }
253
+ }
254
+ },
255
+ "definitions": {
256
+ "ciCommand": {
257
+ "description": "One command step of `webjs ci`.",
258
+ "type": "object",
259
+ "additionalProperties": false,
260
+ "required": ["title", "run"],
261
+ "properties": {
262
+ "title": { "description": "Shown in the step heading and its result line.", "type": "string", "minLength": 1 },
263
+ "run": { "description": "The shell command, run with node_modules/.bin on PATH and CI=true in the environment.", "type": "string", "minLength": 1 },
264
+ "env": {
265
+ "description": "Extra environment for this step only, e.g. { \"WEBJS_E2E\": \"1\" }.",
266
+ "type": "object",
267
+ "additionalProperties": { "type": "string" }
268
+ }
269
+ }
270
+ },
271
+ "ciStep": {
272
+ "description": "A top-level `webjs ci` step: a string (a command whose title is the command), a command object, or a group that may run its steps in parallel.",
273
+ "oneOf": [
274
+ { "type": "string", "minLength": 1 },
275
+ { "$ref": "#/definitions/ciCommand" },
276
+ {
277
+ "description": "A group of steps. `parallel` is a slot count; each nested group takes one slot and runs sequentially.",
278
+ "type": "object",
279
+ "additionalProperties": false,
280
+ "required": ["title", "steps"],
281
+ "properties": {
282
+ "title": { "description": "The group name, shown in the progress line.", "type": "string", "minLength": 1 },
283
+ "parallel": { "description": "How many steps run at once (default 1, sequential).", "type": "integer", "minimum": 1 },
284
+ "steps": { "description": "The group's steps.", "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/ciNestedStep" } }
285
+ }
286
+ }
287
+ ]
288
+ },
289
+ "ciNestedStep": {
290
+ "description": "A step inside a group: the same shapes as a top-level step, except a nested group cannot declare `parallel` (it occupies one slot of its parent and runs sequentially).",
291
+ "oneOf": [
292
+ { "type": "string", "minLength": 1 },
293
+ { "$ref": "#/definitions/ciCommand" },
294
+ {
295
+ "description": "A nested group: one slot of the parent, steps run in order.",
296
+ "type": "object",
297
+ "additionalProperties": false,
298
+ "required": ["title", "steps"],
299
+ "properties": {
300
+ "title": { "description": "The group name.", "type": "string", "minLength": 1 },
301
+ "steps": { "description": "The group's steps.", "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/ciNestedStep" } }
302
+ }
303
+ }
304
+ ]
235
305
  }
236
306
  }
237
307
  }