@fougere/testing 0.9.2-alpha.0 → 0.10.0-alpha.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.
Files changed (96) hide show
  1. package/README.md +1 -1
  2. package/dist/{comparison.d.ts → DoorContractCase.d.ts} +5 -13
  3. package/dist/DoorContractCase.d.ts.map +1 -0
  4. package/dist/{comparison.js → DoorContractCase.js} +31 -31
  5. package/dist/DoorContractCase.js.map +1 -0
  6. package/dist/DoorInput.d.ts +5 -0
  7. package/dist/DoorInput.d.ts.map +1 -0
  8. package/dist/DoorInput.js +2 -0
  9. package/dist/DoorInput.js.map +1 -0
  10. package/dist/DoorOptions.d.ts +7 -0
  11. package/dist/DoorOptions.d.ts.map +1 -0
  12. package/dist/DoorOptions.js +2 -0
  13. package/dist/DoorOptions.js.map +1 -0
  14. package/dist/all.d.ts +4 -4
  15. package/dist/all.d.ts.map +1 -1
  16. package/dist/all.js +3 -3
  17. package/dist/all.js.map +1 -1
  18. package/dist/app/TestApp.d.ts +15 -0
  19. package/dist/app/TestApp.d.ts.map +1 -0
  20. package/dist/{app.js → app/TestApp.js} +3 -3
  21. package/dist/app/TestApp.js.map +1 -0
  22. package/dist/{app.d.ts → app/TestAppOptions.d.ts} +2 -14
  23. package/dist/app/TestAppOptions.d.ts.map +1 -0
  24. package/dist/app/TestAppOptions.js +2 -0
  25. package/dist/app/TestAppOptions.js.map +1 -0
  26. package/dist/facades/CheckOptions.d.ts +6 -0
  27. package/dist/facades/CheckOptions.d.ts.map +1 -0
  28. package/dist/facades/CheckOptions.js +2 -0
  29. package/dist/facades/CheckOptions.js.map +1 -0
  30. package/dist/{doors.d.ts → facades/Verdict.d.ts} +4 -8
  31. package/dist/facades/Verdict.d.ts.map +1 -0
  32. package/dist/{doors.js → facades/Verdict.js} +4 -4
  33. package/dist/facades/Verdict.js.map +1 -0
  34. package/dist/index.d.ts +8 -5
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +7 -5
  37. package/dist/index.js.map +1 -1
  38. package/dist/load.d.ts +19 -5
  39. package/dist/load.d.ts.map +1 -1
  40. package/dist/load.js +29 -9
  41. package/dist/load.js.map +1 -1
  42. package/dist/spans.d.ts +18 -0
  43. package/dist/spans.d.ts.map +1 -0
  44. package/dist/spans.js +56 -0
  45. package/dist/spans.js.map +1 -0
  46. package/dist/statements.d.ts +17 -0
  47. package/dist/statements.d.ts.map +1 -0
  48. package/dist/statements.js +37 -0
  49. package/dist/statements.js.map +1 -0
  50. package/dist/stub/Port.d.ts +3 -0
  51. package/dist/stub/Port.d.ts.map +1 -0
  52. package/dist/stub/Port.js +2 -0
  53. package/dist/stub/Port.js.map +1 -0
  54. package/dist/{stub.d.ts → stub/Stub.d.ts} +2 -3
  55. package/dist/stub/Stub.d.ts.map +1 -0
  56. package/dist/{stub.js → stub/Stub.js} +1 -1
  57. package/dist/stub/Stub.js.map +1 -0
  58. package/dist/{sync.d.ts → sync/SyncDrift.d.ts} +2 -10
  59. package/dist/sync/SyncDrift.d.ts.map +1 -0
  60. package/dist/{sync.js → sync/SyncDrift.js} +5 -18
  61. package/dist/sync/SyncDrift.js.map +1 -0
  62. package/dist/sync/SyncedRemote.d.ts +10 -0
  63. package/dist/sync/SyncedRemote.d.ts.map +1 -0
  64. package/dist/sync/SyncedRemote.js +15 -0
  65. package/dist/sync/SyncedRemote.js.map +1 -0
  66. package/dist/vitest.d.ts.map +1 -1
  67. package/dist/vitest.js +4 -0
  68. package/dist/vitest.js.map +1 -1
  69. package/package.json +20 -10
  70. package/src/{comparison.ts → DoorContractCase.ts} +34 -40
  71. package/src/DoorInput.ts +1 -0
  72. package/src/DoorOptions.ts +7 -0
  73. package/src/all.ts +7 -5
  74. package/src/{app.ts → app/TestApp.ts} +4 -26
  75. package/src/app/TestAppOptions.ts +25 -0
  76. package/src/facades/CheckOptions.ts +6 -0
  77. package/src/{doors.ts → facades/Verdict.ts} +5 -9
  78. package/src/index.ts +8 -8
  79. package/src/load.ts +52 -13
  80. package/src/spans.ts +66 -0
  81. package/src/statements.ts +41 -0
  82. package/src/stub/Port.ts +2 -0
  83. package/src/{stub.ts → stub/Stub.ts} +1 -3
  84. package/src/{sync.ts → sync/SyncDrift.ts} +3 -23
  85. package/src/sync/SyncedRemote.ts +22 -0
  86. package/src/vitest.ts +4 -0
  87. package/dist/app.d.ts.map +0 -1
  88. package/dist/app.js.map +0 -1
  89. package/dist/comparison.d.ts.map +0 -1
  90. package/dist/comparison.js.map +0 -1
  91. package/dist/doors.d.ts.map +0 -1
  92. package/dist/doors.js.map +0 -1
  93. package/dist/stub.d.ts.map +0 -1
  94. package/dist/stub.js.map +0 -1
  95. package/dist/sync.d.ts.map +0 -1
  96. package/dist/sync.js.map +0 -1
package/README.md CHANGED
@@ -25,7 +25,7 @@ checkDoors(app, Product); // local · REST · GraphQL · RPC answer the sam
25
25
  ```
26
26
 
27
27
  `checkDoorContract(app, Product, cases)` runs handler-specific invocation cases through
28
- the same four-door harness. It is useful when the handler must observe a distinction such
28
+ the same four-facade harness. It is useful when the handler must observe a distinction such
29
29
  as omitted (`undefined`) versus explicitly supplied `null`.
30
30
 
31
31
  `testApp()` takes no argument: a file under `fronds/catalog/tests/` says its subject is
@@ -1,15 +1,7 @@
1
1
  import { type App } from '@fougere/core';
2
2
  import { type SchemaView } from '@fougere/schema';
3
- import { type SampleOptions } from './sample.js';
4
- export interface DoorOptions extends SampleOptions {
5
- given?: Record<string, unknown>;
6
- /** The audience, when the app serves named surfaces. */
7
- surface?: string;
8
- }
9
- export interface DoorInput {
10
- id?: string;
11
- input?: Record<string, unknown>;
12
- }
3
+ import type { DoorOptions } from './DoorOptions.js';
4
+ import type { DoorInput } from './DoorInput.js';
13
5
  export interface DoorContractCase {
14
6
  /** What this case proves — becomes the test name. */
15
7
  name: string;
@@ -19,8 +11,8 @@ export interface DoorContractCase {
19
11
  /** The protocol envelopes are removed before this value is compared. */
20
12
  expected: unknown;
21
13
  }
22
- /** One entity, four doors, the same answers. */
14
+ /** One entity, four facades, the same answers. */
23
15
  export declare function checkDoors(app: App, entity: SchemaView, options?: DoorOptions): void;
24
- /** Run one hand-written invocation contract through every door. */
16
+ /** Run one hand-written invocation contract through every facade. */
25
17
  export declare function checkDoorContract(app: App, entity: SchemaView, cases: readonly DoorContractCase[], options?: Pick<DoorOptions, 'surface'>): void;
26
- //# sourceMappingURL=comparison.d.ts.map
18
+ //# sourceMappingURL=DoorContractCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoorContractCase.d.ts","sourceRoot":"","sources":["../src/DoorContractCase.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA0BhD,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wEAAwE;IACxE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,WAAgB,GAAG,IAAI,CA8ExF;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAClC,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAM,GACzC,IAAI,CAeN"}
@@ -5,7 +5,7 @@ import { serveRest, serveRpc, tableOf } from '@fougere/app';
5
5
  import { lowerFirst } from '@fougere/schema';
6
6
  import { listQuery, findQuery, mutationFor, at } from './gql.js';
7
7
  import { sampleInput } from './sample.js';
8
- /** The rows a door hands back, with its own envelope taken off. */
8
+ /** The rows a facade hands back, with its own envelope taken off. */
9
9
  function rowsOf(value) {
10
10
  if (Array.isArray(value))
11
11
  return [...value];
@@ -21,71 +21,71 @@ function written(value, sent) {
21
21
  return wire(row);
22
22
  return wire(Object.fromEntries(Object.keys(sent).map((key) => [key, row[key]])));
23
23
  }
24
- /** One entity, four doors, the same answers. */
24
+ /** One entity, four facades, the same answers. */
25
25
  export function checkDoors(app, entity, options = {}) {
26
26
  const name = lowerFirst(entity.name ?? '');
27
- const doors = doorsOf(app, entity, name, options.surface);
27
+ const facades = facadesOf(app, entity, name, options.surface);
28
28
  const inputOf = () => sampleInput(entity, options.given ?? {}, options);
29
- describe(`${entity.name} — the doors agree`, () => {
29
+ describe(`${entity.name} — the facades agree`, () => {
30
30
  it('on create, over what the caller sent', async () => {
31
31
  const sent = inputOf();
32
- const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door) => doors[door]('create', { input: sent })));
32
+ const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((facade) => facades[facade]('create', { input: sent })));
33
33
  const [local, ...others] = answers.map((answer) => written(answer, sent));
34
34
  for (const [index, other] of others.entries()) {
35
35
  expect(other, `${['rpc', 'rest', 'graphql'][index]} ≠ local`).toEqual(local);
36
36
  }
37
37
  });
38
38
  it('on list', async () => {
39
- await doors.local('create', { input: inputOf() });
40
- const local = wire(rowsOf(await doors.local('list')));
39
+ await facades.local('create', { input: inputOf() });
40
+ const local = wire(rowsOf(await facades.local('list')));
41
41
  expect(Array.isArray(local) && local.length > 0, 'nothing to compare').toBe(true);
42
- expect(wire(rowsOf(await doors.rpc('list'))), 'rpc ≠ local').toEqual(local);
43
- expect(wire(rowsOf(await doors.rest('list'))), 'rest ≠ local').toEqual(local);
44
- expect(wire(rowsOf(await doors.graphql('list'))), 'graphql ≠ local').toEqual(local);
42
+ expect(wire(rowsOf(await facades.rpc('list'))), 'rpc ≠ local').toEqual(local);
43
+ expect(wire(rowsOf(await facades.rest('list'))), 'rest ≠ local').toEqual(local);
44
+ expect(wire(rowsOf(await facades.graphql('list'))), 'graphql ≠ local').toEqual(local);
45
45
  });
46
46
  it('on findById', async () => {
47
- const row = await doors.local('create', { input: inputOf() });
48
- const local = wire(await doors.local('findById', { id: row.id }));
49
- expect(wire(await doors.rpc('findById', { id: row.id })), 'rpc ≠ local').toEqual(local);
50
- expect(wire(await doors.rest('findById', { id: row.id })), 'rest ≠ local').toEqual(local);
51
- expect(wire(await doors.graphql('findById', { id: row.id })), 'graphql ≠ local').toEqual(local);
47
+ const row = await facades.local('create', { input: inputOf() });
48
+ const local = wire(await facades.local('findById', { id: row.id }));
49
+ expect(wire(await facades.rpc('findById', { id: row.id })), 'rpc ≠ local').toEqual(local);
50
+ expect(wire(await facades.rest('findById', { id: row.id })), 'rest ≠ local').toEqual(local);
51
+ expect(wire(await facades.graphql('findById', { id: row.id })), 'graphql ≠ local').toEqual(local);
52
52
  });
53
53
  it('on update, over what the caller sent', async () => {
54
- const rows = await Promise.all([1, 2, 3, 4].map(() => doors.local('create', { input: inputOf() })));
54
+ const rows = await Promise.all([1, 2, 3, 4].map(() => facades.local('create', { input: inputOf() })));
55
55
  const patch = inputOf();
56
56
  const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql']
57
- .map((door, index) => doors[door]('update', { id: rows[index].id, input: patch })));
57
+ .map((facade, index) => facades[facade]('update', { id: rows[index].id, input: patch })));
58
58
  const [local, ...others] = answers.map((answer) => written(answer, patch));
59
59
  for (const [index, other] of others.entries()) {
60
60
  expect(other, `${['rpc', 'rest', 'graphql'][index]} ≠ local`).toEqual(local);
61
61
  }
62
62
  });
63
63
  it('on delete', async () => {
64
- const rows = await Promise.all([1, 2, 3, 4].map(() => doors.local('create', { input: inputOf() })));
65
- const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door, index) => doors[door]('delete', { id: rows[index].id })));
64
+ const rows = await Promise.all([1, 2, 3, 4].map(() => facades.local('create', { input: inputOf() })));
65
+ const answers = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((facade, index) => facades[facade]('delete', { id: rows[index].id })));
66
66
  // REST answers a deletion with no content at all, which is the protocol saying yes.
67
67
  const onTheWire = answers.map((answer) => (answer === undefined || answer === null ? true : wire(answer)));
68
- expect(new Set(onTheWire).size, `the doors disagree: ${JSON.stringify(onTheWire)}`).toBe(1);
68
+ expect(new Set(onTheWire).size, `the facades disagree: ${JSON.stringify(onTheWire)}`).toBe(1);
69
69
  });
70
70
  it('on a refusal', async () => {
71
- // A refusal is where the doors diverge most, and where each is most tempted to
71
+ // A refusal is where the facades diverge most, and where each is most tempted to
72
72
  // answer in its own words. What must match is that it WAS refused.
73
73
  const bad = { ...inputOf(), __unknown__: 'x' };
74
- const refusals = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((door) => refused(() => doors[door]('create', { input: bad }))));
74
+ const refusals = await Promise.all(['local', 'rpc', 'rest', 'graphql'].map((facade) => refused(() => facades[facade]('create', { input: bad }))));
75
75
  expect(refusals[0], 'local accepted a body outside the contract').toBe(true);
76
- expect(refusals, `the doors disagree: ${JSON.stringify(refusals)}`).toEqual([true, true, true, true]);
76
+ expect(refusals, `the facades disagree: ${JSON.stringify(refusals)}`).toEqual([true, true, true, true]);
77
77
  });
78
78
  });
79
79
  }
80
- /** Run one hand-written invocation contract through every door. */
80
+ /** Run one hand-written invocation contract through every facade. */
81
81
  export function checkDoorContract(app, entity, cases, options = {}) {
82
82
  const name = lowerFirst(entity.name ?? '');
83
- const doors = doorsOf(app, entity, name, options.surface);
83
+ const facades = facadesOf(app, entity, name, options.surface);
84
84
  const names = ['local', 'rpc', 'rest', 'graphql'];
85
- describe(`${entity.name} — its invocation contract crosses every door`, () => {
85
+ describe(`${entity.name} — its invocation contract crosses every facade`, () => {
86
86
  for (const one of cases) {
87
87
  it(one.name, async () => {
88
- const answers = await Promise.all(names.map((door) => doors[door](one.operation, one.input)));
88
+ const answers = await Promise.all(names.map((facade) => facades[facade](one.operation, one.input)));
89
89
  for (const [index, answer] of answers.entries()) {
90
90
  expect(wire(answer), `${names[index]} disagrees with the canonical invocation`).toEqual(wire(one.expected));
91
91
  }
@@ -102,8 +102,8 @@ async function refused(call) {
102
102
  return true;
103
103
  }
104
104
  }
105
- /** The four doors, each reduced to `(op, input) => answer` so the tests above read alike. */
106
- function doorsOf(app, entity, name, surface) {
105
+ /** The four facades, each reduced to `(op, input) => answer` so the tests above read alike. */
106
+ function facadesOf(app, entity, name, surface) {
107
107
  const run = createLocalRunner(app, surface);
108
108
  const state = {};
109
109
  const invocation = (call = {}) => ({
@@ -124,7 +124,7 @@ function doorsOf(app, entity, name, surface) {
124
124
  return answer.result;
125
125
  },
126
126
  rest: async (op, call) => {
127
- // The route the REST door itself would match, read from its own table — rebuilding
127
+ // The route the REST facade itself would match, read from its own table — rebuilding
128
128
  // the path here would be a second opinion on where an entity lives.
129
129
  const route = tableOf(app).find((one) => one.entityName === name && one.operationName === op);
130
130
  if (!route)
@@ -150,4 +150,4 @@ function doorsOf(app, entity, name, surface) {
150
150
  },
151
151
  };
152
152
  }
153
- //# sourceMappingURL=comparison.js.map
153
+ //# sourceMappingURL=DoorContractCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoorContractCase.js","sourceRoot":"","sources":["../src/DoorContractCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAY,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAmB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,SAAS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,IAAI,EAAE,EAAE,CAAC,CAAC;YAEnF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAY,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5E,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM;gBAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAChG,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface DoorInput {
2
+ id?: string;
3
+ input?: Record<string, unknown>;
4
+ }
5
+ //# sourceMappingURL=DoorInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoorInput.d.ts","sourceRoot":"","sources":["../src/DoorInput.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IAAG,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DoorInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoorInput.js","sourceRoot":"","sources":["../src/DoorInput.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { type SampleOptions } from './sample.js';
2
+ export interface DoorOptions extends SampleOptions {
3
+ given?: Record<string, unknown>;
4
+ /** The audience, when the app serves named surfaces. */
5
+ surface?: string;
6
+ }
7
+ //# sourceMappingURL=DoorOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoorOptions.d.ts","sourceRoot":"","sources":["../src/DoorOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DoorOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DoorOptions.js","sourceRoot":"","sources":["../src/DoorOptions.ts"],"names":[],"mappings":""}
package/dist/all.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import type { App } from '@fougere/core';
2
2
  import type { SchemaView } from '@fougere/schema';
3
- import { type CheckOptions } from './doors.js';
4
- import { type DoorOptions } from './comparison.js';
3
+ import { type CheckOptions } from './facades/CheckOptions.js';
4
+ import { type DoorOptions } from './DoorOptions.js';
5
5
  export interface CheckAllOptions extends DoorOptions, CheckOptions {
6
6
  /** Entities to leave out, by name — one whose rows a test cannot seed, typically. */
7
7
  except?: string[];
8
- /** Skip the four-door comparison. The contract and the leak are still checked. */
9
- doors?: boolean;
8
+ /** Skip the four-facade comparison. The contract and the leak are still checked. */
9
+ facades?: boolean;
10
10
  }
11
11
  /** Every entity the app SERVES, with its handler. */
12
12
  export declare function servedEntities(app: App): {
package/dist/all.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,WAAW,eAAgB,SAAQ,WAAW,EAAE,YAAY;IAChE,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,EAAE,CAS/E;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI,CAetE"}
1
+ {"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,eAAgB,SAAQ,WAAW,EAAE,YAAY;IAChE,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,EAAE,CAS/E;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI,CAetE"}
package/dist/all.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect } from 'vitest';
2
- import { checkContract, checkOutput } from './doors.js';
3
- import { checkDoors } from './comparison.js';
2
+ import { checkContract, checkOutput } from './facades/Verdict.js';
3
+ import { checkDoors } from './DoorContractCase.js';
4
4
  /** Every entity the app SERVES, with its handler. */
5
5
  export function servedEntities(app) {
6
6
  const served = [];
@@ -25,7 +25,7 @@ export function checkAll(app, options = {}) {
25
25
  for (const { entity } of served) {
26
26
  checkContract(app, entity, options);
27
27
  checkOutput(app, entity, options);
28
- if (options.doors !== false)
28
+ if (options.facades !== false)
29
29
  checkDoors(app, entity, options);
30
30
  }
31
31
  }
package/dist/all.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"all.js","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAqB,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAoB,MAAM,iBAAiB,CAAC;AAS/D,qDAAqD;AACrD,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,MAAM,MAAM,GAA2C,EAAE,CAAC;IAC1D,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAClH,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACpC,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,QAAQ,CAAC,GAAQ,EAAE,OAAO,GAAoB,EAAE;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KAAK;YAAE,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type App } from '@fougere/core';
2
+ import { type Stub } from '../stub/Stub.js';
3
+ import type { TestAppOptions } from './TestAppOptions.js';
4
+ /** An app, plus the doubles standing in front of its ports and the facts it announced. */
5
+ export interface TestApp extends App {
6
+ /** The double installed for a port, to state a return or read what was called. */
7
+ stub<T>(port: abstract new (...args: never[]) => T): Stub<T>;
8
+ /** What was announced under a fact's name, in order. */
9
+ announced(fact: {
10
+ name: string;
11
+ } | string): unknown[];
12
+ }
13
+ /** An app to ask questions of, wired the conventional way. */
14
+ export declare function testApp(options?: TestAppOptions): Promise<TestApp>;
15
+ //# sourceMappingURL=TestApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestApp.d.ts","sourceRoot":"","sources":["../../src/app/TestApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,0FAA0F;AAC1F,MAAM,WAAW,OAAQ,SAAQ,GAAG;IAClC,kFAAkF;IAClF,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7D,wDAAwD;IACxD,SAAS,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC;CACvD;AAED,8DAA8D;AAC9D,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyC5E"}
@@ -1,8 +1,8 @@
1
1
  import { boot } from '@fougere/compiler';
2
2
  import { createContainer } from '@fougere/container';
3
3
  import { resolveStorage } from '@fougere/defaults';
4
- import { installStubs } from './stub.js';
5
- import { scopeOfRun } from './scope.js';
4
+ import { installStubs } from '../stub/Stub.js';
5
+ import { scopeOfRun } from '../scope.js';
6
6
  import { lowerFirst } from '@fougere/schema';
7
7
  /** An app to ask questions of, wired the conventional way. */
8
8
  export async function testApp(options = {}) {
@@ -47,4 +47,4 @@ function currentTestPath() {
47
47
  const globals = globalThis;
48
48
  return globals.__vitest_worker__?.filepath;
49
49
  }
50
- //# sourceMappingURL=app.js.map
50
+ //# sourceMappingURL=TestApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestApp.js","sourceRoot":"","sources":["../../src/app/TestApp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAiB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAa,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAW7C,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAO,GAAmB,EAAE;IACxD,MAAM,EAAE,GAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,UAAU,EAAE,CAAC;IAC3E,uFAAuF;IACvF,iFAAiF;IACjF,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;QACxD,CAAC,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,QAAQ,IAAI,eAAe,EAAE,CAAC,CAAC;IAE5D,mFAAmF;IACnF,yFAAyF;IACzF,M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MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;YACxC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,KAAK,CACb,UAAW,IAAa,CAAC,IAAI,gDAAiD,IAAa,CAAC,IAAI,OAAO,CACxG,CAAC;YACJ,CAAC;YACD,OAAO,KAAgB,CAAC;QAC1B,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,kEAAkE;AAClE,SAAS,eAAe;IACtB,MAAM,OAAO,GAAG,UAA2D,CAAC;IAC5E,OAAO,OAAO,CAAC,iBAAiB,EAAE,QAAQ,CAAC;AAC7C,CAAC"}
@@ -1,5 +1,4 @@
1
- import { type App } from '@fougere/core';
2
- import { type Port, type Stub } from './stub.js';
1
+ import type { Port } from '../stub/Port.js';
3
2
  export interface TestAppOptions {
4
3
  /** The project to scan. */
5
4
  root?: string;
@@ -23,15 +22,4 @@ export interface TestAppOptions {
23
22
  */
24
23
  stub?: Port[];
25
24
  }
26
- /** An app, plus the doubles standing in front of its ports and the facts it announced. */
27
- export interface TestApp extends App {
28
- /** The double installed for a port, to state a return or read what was called. */
29
- stub<T>(port: abstract new (...args: never[]) => T): Stub<T>;
30
- /** What was announced under a fact's name, in order. */
31
- announced(fact: {
32
- name: string;
33
- } | string): unknown[];
34
- }
35
- /** An app to ask questions of, wired the conventional way. */
36
- export declare function testApp(options?: TestAppOptions): Promise<TestApp>;
37
- //# sourceMappingURL=app.d.ts.map
25
+ //# sourceMappingURL=TestAppOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestAppOptions.d.ts","sourceRoot":"","sources":["../../src/app/TestAppOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;CACf"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TestAppOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestAppOptions.js","sourceRoot":"","sources":["../../src/app/TestAppOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { type SampleOptions } from '../sample.js';
2
+ export interface CheckOptions extends SampleOptions {
3
+ /** Values the generator cannot invent — the id of a row a `ref()` points at. */
4
+ given?: Record<string, unknown>;
5
+ }
6
+ //# sourceMappingURL=CheckOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckOptions.d.ts","sourceRoot":"","sources":["../../src/facades/CheckOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CheckOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckOptions.js","sourceRoot":"","sources":["../../src/facades/CheckOptions.ts"],"names":[],"mappings":""}
@@ -1,19 +1,15 @@
1
1
  import { type App } from '@fougere/core';
2
2
  import { type SchemaView, type ValidationError } from '@fougere/schema';
3
- import { type SampleOptions } from './sample.js';
4
- /** The one shape both the local validator and a door already speak. */
3
+ import type { CheckOptions } from './CheckOptions.js';
4
+ /** The one shape both the local validator and a facade already speak. */
5
5
  export interface Verdict {
6
6
  success: boolean;
7
7
  errors?: ValidationError[];
8
8
  }
9
- /** What a door answers, in the shape a verdict is compared in. */
9
+ /** What a facade answers, in the shape a verdict is compared in. */
10
10
  export declare function verdictOf(call: () => Promise<unknown>): Promise<Verdict>;
11
- export interface CheckOptions extends SampleOptions {
12
- /** Values the generator cannot invent — the id of a row a `ref()` points at. */
13
- given?: Record<string, unknown>;
14
- }
15
11
  /** The declared contract, posed to the façade that will receive it. */
16
12
  export declare function checkContract(app: App, entity: SchemaView, options?: CheckOptions): void;
17
13
  /** What may leave, checked against what the entity says may leave. */
18
14
  export declare function checkOutput(app: App, entity: SchemaView, options?: CheckOptions): void;
19
- //# sourceMappingURL=doors.d.ts.map
15
+ //# sourceMappingURL=Verdict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Verdict.d.ts","sourceRoot":"","sources":["../../src/facades/Verdict.ts"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEhF,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,yEAAyE;AACzE,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,oEAAoE;AACpE,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAS9E;AAOD,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,IAAI,CAiB5F;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,IAAI,CA2B1F"}
@@ -3,9 +3,9 @@ import { createLocalRunner, validationErrorsOf } from '@fougere/core';
3
3
  import { Invocation } from '@fougere/core/contract';
4
4
  import { lowerFirst, Visibility } from '@fougere/schema';
5
5
  import { Cases } from '@fougere/schema';
6
- import { derivedCases } from './derive.js';
7
- import { sampleInput, replaySeed } from './sample.js';
8
- /** What a door answers, in the shape a verdict is compared in. */
6
+ import { derivedCases } from '../derive.js';
7
+ import { sampleInput, replaySeed } from '../sample.js';
8
+ /** What a facade answers, in the shape a verdict is compared in. */
9
9
  export async function verdictOf(call) {
10
10
  try {
11
11
  await call();
@@ -55,4 +55,4 @@ export function checkOutput(app, entity, options = {}) {
55
55
  });
56
56
  });
57
57
  }
58
- //# sourceMappingURL=doors.js.map
58
+ //# sourceMappingURL=Verdict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Verdict.js","sourceRoot":"","sources":["../../src/facades/Verdict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAY,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAyC,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AASvD,oEAAoE;AACpE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAA4B;IAC1D,IAAI,CAAC;QACH,MAAM,IAAI,EAAE,CAAC;QACb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KA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C,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,EAAE,CACvD,CAAC;YAE7B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;YACtE,MAAM,GAAG,GAAG,MAAM,GAAG,CACnB,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAC5B,EAAE,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,EAAE,CACvD,CAAC;YAE7B,kFAAkF;YAClF,yEAAyE;YACzE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  export { sampleInput } from './sample.js';
2
2
  export { Cases, type ValidationCase } from '@fougere/schema';
3
- export { testApp } from './app.js';
4
- export { checkContract, checkOutput, verdictOf, type Verdict } from './doors.js';
5
- export { stubOf, type Port, type Stub } from './stub.js';
3
+ export { testApp } from './app/TestApp.js';
4
+ export { checkContract, checkOutput, verdictOf, type Verdict } from './facades/Verdict.js';
5
+ export { type Port } from './stub/Port.js';
6
+ export { stubOf, type Stub } from './stub/Stub.js';
6
7
  export { frondOf, type Scope } from './scope.js';
7
- export { loadScript } from './load.js';
8
- export { checkDoorContract, checkDoors, } from './comparison.js';
8
+ export { loadScript, reachableOps } from './load.js';
9
+ export { statementsOf } from './statements.js';
10
+ export { spansOf } from './spans.js';
11
+ export { checkDoorContract, checkDoors } from './DoorContractCase.js';
9
12
  export { at } from './gql.js';
10
13
  export { driftOf, agrees, explain, type CardDrift } from './remotes.js';
11
14
  export { checkAll } from './all.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,12 +1,14 @@
1
1
  export { sampleInput } from './sample.js';
2
2
  // The derivation itself lives with the axes it reads.
3
3
  export { Cases } from '@fougere/schema';
4
- export { testApp } from './app.js';
5
- export { checkContract, checkOutput, verdictOf } from './doors.js';
6
- export { stubOf } from './stub.js';
4
+ export { testApp } from './app/TestApp.js';
5
+ export { checkContract, checkOutput, verdictOf } from './facades/Verdict.js';
6
+ export { stubOf } from './stub/Stub.js';
7
7
  export { frondOf } from './scope.js';
8
- export { loadScript } from './load.js';
9
- export { checkDoorContract, checkDoors, } from './comparison.js';
8
+ export { loadScript, reachableOps } from './load.js';
9
+ export { statementsOf } from './statements.js';
10
+ export { spansOf } from './spans.js';
11
+ export { checkDoorContract, checkDoors } from './DoorContractCase.js';
10
12
  export { at } from './gql.js';
11
13
  export { driftOf, agrees, explain } from './remotes.js';
12
14
  export { checkAll } from './all.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,sDAAsD;AACtD,OAAO,EAAE,KAAK,EAAuB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAgB,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,MAAM,EAAwB,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,OAAO,EAAc,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAkB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,sDAAsD;AACtD,OAAO,EAAE,KAAK,EAAuB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAgB,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,MAAM,EAAa,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAc,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAkB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC"}
package/dist/load.d.ts CHANGED
@@ -1,17 +1,31 @@
1
- import type { App } from '@fougere/core';
1
+ import type { FrondDescriptor } from '@fougere/core/descriptor';
2
+ /**
3
+ * What a load script is read from: the fronds, and nothing else.
4
+ *
5
+ * An `App` satisfies it, and so does a scan — which is what lets `fougere load` answer without
6
+ * booting the project it describes. A boot runs migrations and seeds, so a command that wrote a
7
+ * scenario would also write to the target's database.
8
+ */
9
+ interface Serving {
10
+ fronds: readonly FrondDescriptor[];
11
+ }
2
12
  export interface LoadOptions {
3
- /** Where the calls go. The RPC door of a running app. */
4
- door?: string;
13
+ /** Where the calls go. The RPC facade of a running app. */
14
+ facade?: string;
15
+ /** The topology statement, so an op that crosses a process is given the time to. */
16
+ remotes?: Record<string, string>;
5
17
  /** Values the generator cannot invent, by entity name — the id a `ref()` points at. */
6
18
  given?: Record<string, Record<string, unknown>>;
7
19
  }
8
20
  interface Reachable {
9
21
  method: string;
10
22
  input: unknown;
23
+ /** How many times this op's work crosses a process — what its budget is a function of. */
24
+ hops: number;
11
25
  }
12
26
  /** Every operation the app answers, with a body for those that take one. */
13
- export declare function reachableOps(app: App, given?: LoadOptions['given']): Reachable[];
27
+ export declare function reachableOps(app: Serving, given?: LoadOptions['given'], remotes?: Record<string, string>): Reachable[];
14
28
  /** A k6 scenario, written from what the app answers. */
15
- export declare function loadScript(app: App, options?: LoadOptions): string;
29
+ export declare function loadScript(app: Serving, options?: LoadOptions): string;
16
30
  export {};
17
31
  //# sourceMappingURL=load.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIzC,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjD;AAED,UAAU,SAAS;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,GAAE,WAAW,CAAC,OAAO,CAAM,GAAG,SAAS,EAAE,CAiBpF;AAED,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,GAAE,WAAgB,GAAG,MAAM,CAmDtE"}
1
+ {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;;GAMG;AACH,UAAU,OAAO;IACf,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;CACpC;AAID,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjD;AAED,UAAU,SAAS;I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