@ripplo/testing 0.2.0 → 0.3.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/README.md CHANGED
@@ -272,10 +272,9 @@ import { tests } from "./tests/index.js";
272
272
 
273
273
  const ripplo = createRipplo(
274
274
  {
275
- appUrl: process.env.APP_URL ?? "https://localhost:3001",
276
- engineUrl: `${process.env.APP_URL ?? "https://localhost:3001"}/ripplo`,
275
+ appUrl: "https://localhost:3001",
276
+ engineUrl: "https://localhost:3001/ripplo",
277
277
  projectId: "<your-project-id>",
278
- webhookSecret: process.env.RIPPLO_WEBHOOK_SECRET ?? "",
279
278
  },
280
279
  { preconditions, observers, tests },
281
280
  );
@@ -283,6 +282,8 @@ const ripplo = createRipplo(
283
282
  export default ripplo;
284
283
  ```
285
284
 
285
+ `webhookSecret` is read from `RIPPLO_WEBHOOK_SECRET` in `.ripplo/.env` (auto-loaded by the CLI before each compile). You can still pass it explicitly to `createRipplo` if you need to.
286
+
286
287
  ### App server — the implementations funnel
287
288
 
288
289
  ```typescript
package/dist/assert.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as ObserverHandle, a as ObserverInput, b as ObserverBudgetTier } from './types-yIhY8cwG.js';
1
+ import { O as ObserverHandle, a as ObserverInput, b as ObserverBudgetTier } from './types-Degkxs1f.js';
2
2
  import { U as UnlabeledStep } from './step-De52hTLd.js';
3
3
  import { CheckLocator, AnyLocator } from './locators.js';
4
4
  import 'zod';
package/dist/assert.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  readObserverBudget,
6
6
  readObserverName
7
- } from "./chunk-P4ZI7G5M.js";
7
+ } from "./chunk-76BU4M6E.js";
8
8
  import {
9
9
  createStep
10
10
  } from "./chunk-MGATMMCZ.js";
@@ -1,4 +1,4 @@
1
- import { O as ObserverHandle, P as Precondition, l as PreconditionData, j as TestDefinition, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, f as ObserverContext, h as ObserverOutcome, S as SetupContext, m as TestValue, T as TeardownContext } from './types-yIhY8cwG.js';
1
+ import { O as ObserverHandle, P as Precondition, l as PreconditionData, j as TestDefinition, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, f as ObserverContext, h as ObserverOutcome, S as SetupContext, m as TestValue, T as TeardownContext, n as UserDslConfig } from './types-Degkxs1f.js';
2
2
  import { ObserverBudget } from '@ripplo/spec';
3
3
  import { S as Step } from './step-De52hTLd.js';
4
4
 
@@ -75,6 +75,6 @@ type RipploBuilder = RipploInstance;
75
75
  declare function precondition(name: string): PreconditionNeedsSetup;
76
76
  declare function observer(name: string): ObserverNeedsInput;
77
77
  declare function test(id: string, options?: TestOptions): TestNeedsName;
78
- declare function createRipplo<P extends PreconditionRegistry, O extends ObserverRegistry>(rawConfig: DslConfig, registries: RipploRegistries<P, O>): RipploInstance<P, O>;
78
+ declare function createRipplo<P extends PreconditionRegistry, O extends ObserverRegistry>(rawConfig: UserDslConfig, registries: RipploRegistries<P, O>): RipploInstance<P, O>;
79
79
 
80
80
  export { type ObserverImplFn as O, type PreconditionImpl as P, type ResolveDeps as R, type ObserverRegistry as a, type PreconditionRecord as b, type PreconditionRegistry as c, type RipploBuilder as d, type RipploInstance as e, type RipploRegistries as f, createRipplo as g, observer as o, precondition as p, test as t };
@@ -28,6 +28,9 @@ var dslConfigSchema = z.object({
28
28
  watchPaths: z.array(z.string()).optional(),
29
29
  webhookSecret: z.string()
30
30
  });
31
+ var userDslConfigSchema = dslConfigSchema.extend({
32
+ webhookSecret: z.string().optional()
33
+ });
31
34
  function readTestValue(value) {
32
35
  return value.value;
33
36
  }
@@ -66,7 +69,7 @@ function makeObserverHandle({
66
69
  export {
67
70
  DEFAULT_WATCH_PATHS,
68
71
  DEFAULT_IGNORE_PATHS,
69
- dslConfigSchema,
72
+ userDslConfigSchema,
70
73
  readTestValue,
71
74
  createTestValue,
72
75
  readPreconditionName,
@@ -1,6 +1,6 @@
1
1
  import { Observer, Precondition, WorkflowSpec } from '@ripplo/spec';
2
- import { d as RipploBuilder } from './builder-dqXTFZ4j.js';
3
- import { e as DslConfig } from './types-yIhY8cwG.js';
2
+ import { d as RipploBuilder } from './builder-CiAO8dEG.js';
3
+ import { e as DslConfig } from './types-Degkxs1f.js';
4
4
  import './step-De52hTLd.js';
5
5
  import 'zod';
6
6
 
@@ -1,5 +1,5 @@
1
- import { c as PreconditionRegistry, a as ObserverRegistry, O as ObserverImplFn, P as PreconditionImpl, e as RipploInstance } from './builder-dqXTFZ4j.js';
2
- import { h as ObserverOutcome, C as CookieEntry, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, O as ObserverHandle, P as Precondition } from './types-yIhY8cwG.js';
1
+ import { c as PreconditionRegistry, a as ObserverRegistry, O as ObserverImplFn, P as PreconditionImpl, e as RipploInstance } from './builder-CiAO8dEG.js';
2
+ import { h as ObserverOutcome, C as CookieEntry, e as DslConfig, g as ObserverDefinition, k as PreconditionDefinition, U as UnimplementedItems, O as ObserverHandle, P as Precondition } from './types-Degkxs1f.js';
3
3
 
4
4
  interface EngineResult {
5
5
  readonly cookies: ReadonlyArray<CookieEntry>;
package/dist/express.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Router } from 'express';
2
- import { P as PreconditionEngine } from './engine-CphCJ1ZS.js';
3
- import './builder-dqXTFZ4j.js';
4
- import './types-yIhY8cwG.js';
2
+ import { P as PreconditionEngine } from './engine-L0JWPRkj.js';
3
+ import './builder-CiAO8dEG.js';
4
+ import './types-Degkxs1f.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
package/dist/fastify.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { FastifyInstance } from 'fastify';
2
- import { P as PreconditionEngine } from './engine-CphCJ1ZS.js';
3
- import './builder-dqXTFZ4j.js';
4
- import './types-yIhY8cwG.js';
2
+ import { P as PreconditionEngine } from './engine-L0JWPRkj.js';
3
+ import './builder-CiAO8dEG.js';
4
+ import './types-Degkxs1f.js';
5
5
  import 'zod';
6
6
  import './step-De52hTLd.js';
7
7
  import '@ripplo/spec';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { O as ObserverImplFn, a as ObserverRegistry, P as PreconditionImpl, b as PreconditionRecord, c as PreconditionRegistry, R as ResolveDeps, d as RipploBuilder, e as RipploInstance, f as RipploRegistries, g as createRipplo, o as observer, p as precondition, t as test } from './builder-dqXTFZ4j.js';
1
+ export { O as ObserverImplFn, a as ObserverRegistry, P as PreconditionImpl, b as PreconditionRecord, c as PreconditionRegistry, R as ResolveDeps, d as RipploBuilder, e as RipploInstance, f as RipploRegistries, g as createRipplo, o as observer, p as precondition, t as test } from './builder-CiAO8dEG.js';
2
2
  import { CompileResult } from './compiler.js';
3
3
  export { CompiledTest, compile } from './compiler.js';
4
- export { E as EngineImpls, a as EngineResult, b as ExecuteBatchOptions, N as NotImplemented, O as ObserverImplFnFor, P as PreconditionEngine, c as PreconditionImplFor, d as createEngine, n as notImplemented } from './engine-CphCJ1ZS.js';
5
- import { C as CookieEntry } from './types-yIhY8cwG.js';
6
- export { c as CookieOptions, D as DEFAULT_IGNORE_PATHS, d as DEFAULT_WATCH_PATHS, e as DslConfig, f as ObserverContext, g as ObserverDefinition, O as ObserverHandle, a as ObserverInput, h as ObserverOutcome, P as Precondition, i as PreconditionDeps, S as SetupContext, T as TeardownContext, j as TestDefinition } from './types-yIhY8cwG.js';
4
+ export { E as EngineImpls, a as EngineResult, b as ExecuteBatchOptions, N as NotImplemented, O as ObserverImplFnFor, P as PreconditionEngine, c as PreconditionImplFor, d as createEngine, n as notImplemented } from './engine-L0JWPRkj.js';
5
+ import { C as CookieEntry } from './types-Degkxs1f.js';
6
+ export { c as CookieOptions, D as DEFAULT_IGNORE_PATHS, d as DEFAULT_WATCH_PATHS, e as DslConfig, f as ObserverContext, g as ObserverDefinition, O as ObserverHandle, a as ObserverInput, h as ObserverOutcome, P as Precondition, i as PreconditionDeps, S as SetupContext, T as TeardownContext, j as TestDefinition } from './types-Degkxs1f.js';
7
7
  export { D as DslNodeInput } from './step-De52hTLd.js';
8
8
  import '@ripplo/spec';
9
9
  import 'zod';
package/dist/index.js CHANGED
@@ -2,7 +2,6 @@ import {
2
2
  DEFAULT_IGNORE_PATHS,
3
3
  DEFAULT_WATCH_PATHS,
4
4
  createTestValue,
5
- dslConfigSchema,
6
5
  makeObserverHandle,
7
6
  readObserverBudget,
8
7
  readObserverDescription,
@@ -11,8 +10,9 @@ import {
11
10
  readPreconditionDependsOn,
12
11
  readPreconditionDescription,
13
12
  readPreconditionName,
14
- readTestValue
15
- } from "./chunk-P4ZI7G5M.js";
13
+ readTestValue,
14
+ userDslConfigSchema
15
+ } from "./chunk-76BU4M6E.js";
16
16
  import {
17
17
  compile
18
18
  } from "./chunk-KNF4K4JH.js";
@@ -66,7 +66,14 @@ function test(id, options) {
66
66
  return buildTestName(id, options?.uiOnly);
67
67
  }
68
68
  function createRipplo(rawConfig, registries) {
69
- const config = dslConfigSchema.parse(rawConfig);
69
+ const parsed = userDslConfigSchema.parse(rawConfig);
70
+ const webhookSecret = parsed.webhookSecret ?? process.env["RIPPLO_WEBHOOK_SECRET"] ?? "";
71
+ if (webhookSecret.length === 0) {
72
+ throw new Error(
73
+ "RIPPLO_WEBHOOK_SECRET is required. Set it in .ripplo/.env or pass webhookSecret to createRipplo()."
74
+ );
75
+ }
76
+ const config = { ...parsed, webhookSecret };
70
77
  const { observers, preconditions, tests } = registries;
71
78
  validateUniqueNames(preconditions, observers, tests);
72
79
  const preconditionDefs = Object.values(preconditions).map((p) => stubPreconditionDef(p));
@@ -1,8 +1,8 @@
1
1
  import { Codec } from '@ripplo/spec';
2
2
  import { z } from 'zod';
3
3
  import { CompileResult } from './compiler.js';
4
- import './builder-dqXTFZ4j.js';
5
- import './types-yIhY8cwG.js';
4
+ import './builder-CiAO8dEG.js';
5
+ import './types-Degkxs1f.js';
6
6
  import './step-De52hTLd.js';
7
7
 
8
8
  declare const LOCKFILE_RELATIVE_PATH = ".ripplo/ripplo.lock";
package/dist/nextjs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { P as PreconditionEngine } from './engine-CphCJ1ZS.js';
2
- import './builder-dqXTFZ4j.js';
3
- import './types-yIhY8cwG.js';
1
+ import { P as PreconditionEngine } from './engine-L0JWPRkj.js';
2
+ import './builder-CiAO8dEG.js';
3
+ import './types-Degkxs1f.js';
4
4
  import 'zod';
5
5
  import './step-De52hTLd.js';
6
6
  import '@ripplo/spec';
@@ -12,6 +12,15 @@ declare const dslConfigSchema: z.ZodObject<{
12
12
  webhookSecret: z.ZodString;
13
13
  }, z.core.$strip>;
14
14
  type DslConfig = z.infer<typeof dslConfigSchema>;
15
+ declare const userDslConfigSchema: z.ZodObject<{
16
+ appUrl: z.ZodString;
17
+ engineUrl: z.ZodString;
18
+ ignorePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ projectId: z.ZodString;
20
+ watchPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
+ webhookSecret: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ type UserDslConfig = z.infer<typeof userDslConfigSchema>;
15
24
  interface CookieOptions {
16
25
  readonly domain: string | undefined;
17
26
  readonly expires: number | undefined;
@@ -112,4 +121,4 @@ interface ObserverDefinition {
112
121
  readonly run: (ctx: ObserverContext, params: Record<string, string>) => Promise<ObserverOutcome>;
113
122
  }
114
123
 
115
- export { type CookieEntry as C, DEFAULT_IGNORE_PATHS as D, type ObserverHandle as O, type Precondition as P, type SetupContext as S, type TeardownContext as T, type UnimplementedItems as U, type ObserverInput as a, type ObserverBudgetTier as b, type CookieOptions as c, DEFAULT_WATCH_PATHS as d, type DslConfig as e, type ObserverContext as f, type ObserverDefinition as g, type ObserverOutcome as h, type PreconditionDeps as i, type TestDefinition as j, type PreconditionDefinition as k, type PreconditionData as l, type TestValue as m };
124
+ export { type CookieEntry as C, DEFAULT_IGNORE_PATHS as D, type ObserverHandle as O, type Precondition as P, type SetupContext as S, type TeardownContext as T, type UnimplementedItems as U, type ObserverInput as a, type ObserverBudgetTier as b, type CookieOptions as c, DEFAULT_WATCH_PATHS as d, type DslConfig as e, type ObserverContext as f, type ObserverDefinition as g, type ObserverOutcome as h, type PreconditionDeps as i, type TestDefinition as j, type PreconditionDefinition as k, type PreconditionData as l, type TestValue as m, type UserDslConfig as n };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ripplo/testing",
3
3
  "description": "TypeScript DSL for defining and running Ripplo e2e workflow tests",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"