@webjsdev/core 0.7.53 → 0.7.55

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
@@ -53,7 +53,15 @@ export type {
53
53
  WebjsTrailingSlash,
54
54
  WebjsCspConfig,
55
55
  WebjsDoctorConfig,
56
+ WebjsAuditConfig,
57
+ WebjsAuditIgnore,
56
58
  WebjsDoctorSeverity,
59
+ WebjsCiConfig,
60
+ WebjsCiStep,
61
+ WebjsCiNestedStep,
62
+ WebjsCiCommand,
63
+ WebjsCiGroup,
64
+ WebjsCiNestedGroup,
57
65
  } from './src/webjs-config.d.ts';
58
66
 
59
67
  // Compile-time serializability typing for server actions (#488): the opt-in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjsdev/core",
3
- "version": "0.7.53",
3
+ "version": "0.7.55",
4
4
  "type": "module",
5
5
  "description": "The runtime for WebJs, a full-stack JavaScript framework built on web components with server-side rendering and no build step. Ships the html and css template tags, the WebComponent base class, signals, directives, and the isomorphic renderers.",
6
6
  "types": "./index.d.ts",
@@ -144,6 +144,46 @@ export interface WebjsStartTasks {
144
144
  before?: string[];
145
145
  }
146
146
 
147
+ /** One command step of `webjs ci` (#1471). */
148
+ export interface WebjsCiCommand {
149
+ /** Shown in the step heading and its result line. */
150
+ title: string;
151
+ /** The shell command, run with `node_modules/.bin` on PATH and `CI=true` in the environment. */
152
+ run: string;
153
+ /** Extra environment for this step only, e.g. `{ WEBJS_E2E: '1' }`. */
154
+ env?: Record<string, string>;
155
+ }
156
+
157
+ /** A step inside a group: a nested group takes ONE slot of its parent and runs sequentially, so it cannot declare `parallel`. */
158
+ export interface WebjsCiNestedGroup {
159
+ /** The group name. */
160
+ title: string;
161
+ /** The group's steps, run in order. */
162
+ steps: WebjsCiNestedStep[];
163
+ }
164
+
165
+ /** A top-level group of `webjs ci` steps. */
166
+ export interface WebjsCiGroup extends WebjsCiNestedGroup {
167
+ /** How many steps run at once (default 1, sequential). Captured output is replayed whole per step, never interleaved. */
168
+ parallel?: number;
169
+ }
170
+
171
+ /** A top-level `webjs ci` step: a string is shorthand for a command whose title is the command. */
172
+ export type WebjsCiStep = string | WebjsCiCommand | WebjsCiGroup;
173
+
174
+ /** A step inside a group: the same shapes, minus `parallel` on a nested group. */
175
+ export type WebjsCiNestedStep = string | WebjsCiCommand | WebjsCiNestedGroup;
176
+
177
+ /**
178
+ * Local CI in `webjs.ci` (#1471): the step list `webjs ci` runs, and the same
179
+ * list a cloud pipeline runs through `npm run ci`. Read by the CLI
180
+ * (`packages/cli/lib/ci-config.js`), not the server.
181
+ */
182
+ export interface WebjsCiConfig {
183
+ /** The steps, run in order. A failing step fails the run. Required: a block with no steps is refused, since a run of zero steps would read as green. */
184
+ steps: WebjsCiStep[];
185
+ }
186
+
147
187
  /**
148
188
  * A severity a `webjs.doctor.gate` entry may declare, mirroring ESLint's
149
189
  * three-level scale. `error` fails the `webjs doctor` exit, `warn` reports
@@ -172,6 +212,27 @@ export interface WebjsDoctorConfig {
172
212
  gate?: Record<string, WebjsDoctorSeverity>;
173
213
  }
174
214
 
215
+ /** One advisory `webjs audit` accepts (#1492): its id and why that is safe. */
216
+ export interface WebjsAuditIgnore {
217
+ /** The advisory id, `GHSA-xxxx-xxxx-xxxx` or `CVE-YYYY-NNNN`. */
218
+ id: string;
219
+ /** Why accepting it is safe: which chain reaches it, and why that chain cannot reach users. Required. */
220
+ reason: string;
221
+ }
222
+
223
+ /**
224
+ * `webjs.audit` (#1492): the dependency audit's failing level and its
225
+ * allowlist, in one place. `webjs audit` runs `npm audit` or `bun audit` and
226
+ * fails on any advisory at or above `level` that `ignore` does not list. A
227
+ * malformed block exits 1, so an allowlist cannot silently stop applying.
228
+ */
229
+ export interface WebjsAuditConfig {
230
+ /** The lowest severity that fails the audit. Default `'high'`. */
231
+ level?: 'low' | 'moderate' | 'high' | 'critical';
232
+ /** Advisories with no patched release that the app's users cannot reach. */
233
+ ignore?: WebjsAuditIgnore[];
234
+ }
235
+
175
236
  /** The object form of `webjs.csp` (the non-boolean shape). */
176
237
  export interface WebjsCspConfig {
177
238
  /**
@@ -227,6 +288,24 @@ export interface WebjsConfig {
227
288
  dev?: WebjsDevTasks;
228
289
  start?: WebjsStartTasks;
229
290
 
291
+ /**
292
+ * The `webjs db` verb map (#1468), bring-your-own-ORM. Each key is a verb
293
+ * and its value the shell command `webjs db <verb>` runs instead of the
294
+ * drizzle-kit default (node_modules/.bin on PATH, extra args appended), so
295
+ * `webjs db migrate` keeps one spelling across ORMs:
296
+ * `{ migrate: 'prisma migrate deploy' }`. Any key is a verb; an unmapped one
297
+ * keeps its default, so an app with no block is unchanged. Read by the CLI
298
+ * (`packages/cli/lib/app-tasks.js`), NOT the server.
299
+ */
300
+ db?: Record<string, string>;
301
+
302
+ /**
303
+ * Local CI (#1471): the step list `webjs ci` runs locally and a cloud
304
+ * pipeline runs through `npm run ci`, so the two cannot drift. Read by the
305
+ * CLI (`packages/cli/lib/ci-config.js`), NOT the server.
306
+ */
307
+ ci?: WebjsCiConfig;
308
+
230
309
  /**
231
310
  * `webjs doctor` policy (#1257): which project-health checks the project
232
311
  * treats as fatal. Read by the CLI (`packages/cli/lib/doctor.js`), NOT the
@@ -234,6 +313,13 @@ export interface WebjsConfig {
234
313
  */
235
314
  doctor?: WebjsDoctorConfig;
236
315
 
316
+ /**
317
+ * `webjs audit` policy (#1492): the failing severity and the advisories the
318
+ * app accepts, each with a reason. Read by the CLI
319
+ * (`packages/cli/lib/audit.js`), NOT the server.
320
+ */
321
+ audit?: WebjsAuditConfig;
322
+
237
323
  /** Per-path response-header rules, shaped like Next's. */
238
324
  headers?: WebjsHeaderRule[];
239
325