@c9up/helix 0.1.9 → 0.2.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 (51) hide show
  1. package/dist/cli/glob.d.ts.map +1 -1
  2. package/dist/cli/glob.js +9 -1
  3. package/dist/cli/glob.js.map +1 -1
  4. package/dist/cli/pool.d.ts.map +1 -1
  5. package/dist/cli/pool.js +1 -7
  6. package/dist/cli/pool.js.map +1 -1
  7. package/dist/cli/suites.d.ts +0 -9
  8. package/dist/cli/suites.d.ts.map +1 -1
  9. package/dist/cli/suites.js +1 -2
  10. package/dist/cli/suites.js.map +1 -1
  11. package/dist/runtime/asymmetric-brand.d.ts +20 -0
  12. package/dist/runtime/asymmetric-brand.d.ts.map +1 -0
  13. package/dist/runtime/asymmetric-brand.js +18 -0
  14. package/dist/runtime/asymmetric-brand.js.map +1 -0
  15. package/dist/runtime/asymmetric.d.ts +2 -10
  16. package/dist/runtime/asymmetric.d.ts.map +1 -1
  17. package/dist/runtime/asymmetric.js +3 -7
  18. package/dist/runtime/asymmetric.js.map +1 -1
  19. package/dist/runtime/cli-worker.js +1 -2
  20. package/dist/runtime/cli-worker.js.map +1 -1
  21. package/dist/runtime/equals.d.ts.map +1 -1
  22. package/dist/runtime/equals.js +6 -10
  23. package/dist/runtime/equals.js.map +1 -1
  24. package/dist/runtime/global-hooks.d.ts +1 -3
  25. package/dist/runtime/global-hooks.d.ts.map +1 -1
  26. package/dist/runtime/global-hooks.js +5 -22
  27. package/dist/runtime/global-hooks.js.map +1 -1
  28. package/dist/runtime/ipc-protocol.d.ts +21 -0
  29. package/dist/runtime/ipc-protocol.d.ts.map +1 -0
  30. package/dist/runtime/ipc-protocol.js +21 -0
  31. package/dist/runtime/ipc-protocol.js.map +1 -0
  32. package/dist/runtime/run.d.ts.map +1 -1
  33. package/dist/runtime/run.js +42 -13
  34. package/dist/runtime/run.js.map +1 -1
  35. package/dist/runtime/suite.d.ts +19 -5
  36. package/dist/runtime/suite.d.ts.map +1 -1
  37. package/dist/runtime/suite.js +11 -6
  38. package/dist/runtime/suite.js.map +1 -1
  39. package/dist/runtime/worker.d.ts.map +1 -1
  40. package/dist/runtime/worker.js +1 -1
  41. package/dist/runtime/worker.js.map +1 -1
  42. package/index.darwin-arm64.node +0 -0
  43. package/index.darwin-x64.node +0 -0
  44. package/index.linux-arm64-gnu.node +0 -0
  45. package/index.linux-x64-gnu.node +0 -0
  46. package/index.win32-x64-msvc.node +0 -0
  47. package/package.json +1 -4
  48. package/dist/japa/core.d.ts +0 -106
  49. package/dist/japa/core.d.ts.map +0 -1
  50. package/dist/japa/core.js +0 -128
  51. package/dist/japa/core.js.map +0 -1
@@ -1,106 +0,0 @@
1
- /**
2
- * `@japa/runner/core`, as much of it as a PLUGIN touches.
3
- *
4
- * An official Japa plugin does not talk to the runner through an interface — it
5
- * imports the classes and instruments them:
6
- *
7
- * import { Test, TestContext } from "@japa/runner/core"
8
- * TestContext.getter("assert", () => new Assert(), true)
9
- * Test.executed((test, hasError) => { … })
10
- *
11
- * Nothing helix does at runtime can change what that import resolves to, which
12
- * is why "the API is the same shape" was never enough. What CAN change it is
13
- * module resolution: `japa-alias.mjs` redirects the specifier to this file, and
14
- * these two classes forward to helix's own registry. The plugin is then
15
- * instrumenting helix without knowing it.
16
- *
17
- * Deliberately not a reimplementation of Japa's classes: only the STATIC
18
- * surface a plugin uses is here. Anything else a plugin reached for would be
19
- * absent rather than wrong, which is the failure mode to prefer.
20
- */
21
- import { Emitter } from "../runtime/emitter.js";
22
- /**
23
- * `Emitter` is helix's own — same event names, same node shapes, verified by
24
- * the golden journals. A plugin subscribing through it subscribes to the run.
25
- */
26
- export { Emitter };
27
- /**
28
- * Japa's `Refiner` — a filter collector. Standalone until something reads it,
29
- * which is why `configure({ refiner })` is where one becomes load-bearing; this
30
- * class is what a plugin constructs to put there.
31
- */
32
- export declare class Refiner {
33
- readonly filters: {
34
- tests: string[];
35
- groups: string[];
36
- tags: string[];
37
- matchAll: boolean;
38
- };
39
- add(layer: "tests" | "groups" | "tags", values: string[]): this;
40
- matchAllTags(toggle?: boolean): this;
41
- }
42
- /**
43
- * Raised by the classes a plugin can IMPORT but not construct.
44
- *
45
- * They exist so an import resolves and `instanceof` answers — a helix group is
46
- * not a Japa `Group`, and `false` is the right answer. Constructing one is what
47
- * cannot work: helix builds its own tree and drives its own run, so a Japa
48
- * `Suite` or `Runner` built here would be an object nothing ever looks at.
49
- */
50
- export declare class JapaClassNotConstructibleError extends Error {
51
- constructor(name: string);
52
- }
53
- /** Japa's `BaseReporter`. Reporters are the CLI's — see `runner.registerReporter`. */
54
- export declare class BaseReporter {
55
- constructor();
56
- }
57
- /** Japa's `Group`. helix builds groups from the file's own `describe`/`test`. */
58
- export declare class Group {
59
- constructor();
60
- }
61
- /** Japa's `Suite`. helix's suites come from the config, one per worker. */
62
- export declare class Suite {
63
- constructor();
64
- }
65
- /** Japa's `Runner`. The CLI owns execution — see `RunnerNotDrivableError`. */
66
- export declare class Runner {
67
- constructor();
68
- }
69
- /** What a plugin's `Test.executed` callback receives. */
70
- export type ExecutedCallback = (test: {
71
- options: unknown;
72
- context: unknown;
73
- }, hasError: boolean) => void | Promise<void>;
74
- /**
75
- * Japa's `Test` — the static hooks a plugin registers on it. Instances come
76
- * from helix's own runtime, so nothing here constructs a test.
77
- */
78
- export declare class Test {
79
- /**
80
- * Tells the shim apart from the real `@japa/runner/core`. A plugin never
81
- * needs it; it exists so "which one did this import resolve to?" has an
82
- * answer, which is a question that costs an afternoon otherwise.
83
- */
84
- static readonly isHelixShim = true;
85
- /** Run after every test of the run (Japa `Test.executed`). */
86
- static executed(callback: ExecutedCallback): void;
87
- /** Japa's `Test.macro`, mapped onto helix's context registry. */
88
- static macro(name: string, value: unknown): void;
89
- }
90
- /**
91
- * Japa's `TestContext` — the registrars a plugin uses to put something on every
92
- * test's context.
93
- */
94
- export declare class TestContext {
95
- /** @see Test.isHelixShim */
96
- static readonly isHelixShim = true;
97
- /**
98
- * Add a lazily-computed property (Japa `TestContext.getter`). Japa's third
99
- * argument asks for the value to be cached per context; helix's getters are
100
- * always cached per context, so it is accepted and has nothing to change.
101
- */
102
- static getter(name: string, accumulator: () => unknown, _singleton?: boolean): void;
103
- /** Add a shared property (Japa `TestContext.macro`). */
104
- static macro(name: string, value: unknown): void;
105
- }
106
- //# sourceMappingURL=core.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/japa/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;GAIG;AACH,qBAAa,OAAO;IACnB,QAAQ,CAAC,OAAO,EAAE;QACjB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,QAAQ,EAAE,OAAO,CAAC;KAClB,CAAwD;IAEzD,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAK/D,YAAY,CAAC,MAAM,UAAO,GAAG,IAAI;CAIjC;AAED;;;;;;;GAOG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;gBAC5C,IAAI,EAAE,MAAM;CASxB;AAED,sFAAsF;AACtF,qBAAa,YAAY;;CAIxB;AAED,iFAAiF;AACjF,qBAAa,KAAK;;CAIjB;AAED,2EAA2E;AAC3E,qBAAa,KAAK;;CAIjB;AAED,8EAA8E;AAC9E,qBAAa,MAAM;;CAIlB;AAED,yDAAyD;AACzD,MAAM,MAAM,gBAAgB,GAAG,CAC9B,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC5C,QAAQ,EAAE,OAAO,KACb,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;GAGG;AAEH,qBAAa,IAAI;IAChB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,WAAW,QAAQ;IAEnC,8DAA8D;IAC9D,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAIjD,iEAAiE;IACjE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;CAGhD;AAED;;;GAGG;AAEH,qBAAa,WAAW;IACvB,4BAA4B;IAC5B,MAAM,CAAC,QAAQ,CAAC,WAAW,QAAQ;IAEnC;;;;OAIG;IACH,MAAM,CAAC,MAAM,CACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,OAAO,EAC1B,UAAU,CAAC,EAAE,OAAO,GAClB,IAAI;IAIP,wDAAwD;IACxD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;CAGhD"}
package/dist/japa/core.js DELETED
@@ -1,128 +0,0 @@
1
- /**
2
- * `@japa/runner/core`, as much of it as a PLUGIN touches.
3
- *
4
- * An official Japa plugin does not talk to the runner through an interface — it
5
- * imports the classes and instruments them:
6
- *
7
- * import { Test, TestContext } from "@japa/runner/core"
8
- * TestContext.getter("assert", () => new Assert(), true)
9
- * Test.executed((test, hasError) => { … })
10
- *
11
- * Nothing helix does at runtime can change what that import resolves to, which
12
- * is why "the API is the same shape" was never enough. What CAN change it is
13
- * module resolution: `japa-alias.mjs` redirects the specifier to this file, and
14
- * these two classes forward to helix's own registry. The plugin is then
15
- * instrumenting helix without knowing it.
16
- *
17
- * Deliberately not a reimplementation of Japa's classes: only the STATIC
18
- * surface a plugin uses is here. Anything else a plugin reached for would be
19
- * absent rather than wrong, which is the failure mode to prefer.
20
- */
21
- import { TestContextRegistry } from "../runtime/context.js";
22
- import { Emitter } from "../runtime/emitter.js";
23
- import { registerExecutedHook } from "../runtime/test-context.js";
24
- /**
25
- * `Emitter` is helix's own — same event names, same node shapes, verified by
26
- * the golden journals. A plugin subscribing through it subscribes to the run.
27
- */
28
- export { Emitter };
29
- /**
30
- * Japa's `Refiner` — a filter collector. Standalone until something reads it,
31
- * which is why `configure({ refiner })` is where one becomes load-bearing; this
32
- * class is what a plugin constructs to put there.
33
- */
34
- export class Refiner {
35
- filters = { tests: [], groups: [], tags: [], matchAll: false };
36
- add(layer, values) {
37
- this.filters[layer].push(...values);
38
- return this;
39
- }
40
- matchAllTags(toggle = true) {
41
- this.filters.matchAll = toggle;
42
- return this;
43
- }
44
- }
45
- /**
46
- * Raised by the classes a plugin can IMPORT but not construct.
47
- *
48
- * They exist so an import resolves and `instanceof` answers — a helix group is
49
- * not a Japa `Group`, and `false` is the right answer. Constructing one is what
50
- * cannot work: helix builds its own tree and drives its own run, so a Japa
51
- * `Suite` or `Runner` built here would be an object nothing ever looks at.
52
- */
53
- export class JapaClassNotConstructibleError extends Error {
54
- constructor(name) {
55
- super(`new ${name}() is not available on helix: it builds its own test tree ` +
56
- "and drives its own run, so an instance here would be one nothing " +
57
- `reads. The class exists so \`import { ${name} }\` resolves and ` +
58
- "`instanceof` answers.");
59
- this.name = "JapaClassNotConstructibleError";
60
- }
61
- }
62
- /** Japa's `BaseReporter`. Reporters are the CLI's — see `runner.registerReporter`. */
63
- export class BaseReporter {
64
- constructor() {
65
- throw new JapaClassNotConstructibleError("BaseReporter");
66
- }
67
- }
68
- /** Japa's `Group`. helix builds groups from the file's own `describe`/`test`. */
69
- export class Group {
70
- constructor() {
71
- throw new JapaClassNotConstructibleError("Group");
72
- }
73
- }
74
- /** Japa's `Suite`. helix's suites come from the config, one per worker. */
75
- export class Suite {
76
- constructor() {
77
- throw new JapaClassNotConstructibleError("Suite");
78
- }
79
- }
80
- /** Japa's `Runner`. The CLI owns execution — see `RunnerNotDrivableError`. */
81
- export class Runner {
82
- constructor() {
83
- throw new JapaClassNotConstructibleError("Runner");
84
- }
85
- }
86
- /**
87
- * Japa's `Test` — the static hooks a plugin registers on it. Instances come
88
- * from helix's own runtime, so nothing here constructs a test.
89
- */
90
- // biome-ignore lint/complexity/noStaticOnlyClass: stands in for a class Japa exports — an object literal breaks the day a plugin writes `instanceof` or `extends`, which is the one place being a class is the point.
91
- export class Test {
92
- /**
93
- * Tells the shim apart from the real `@japa/runner/core`. A plugin never
94
- * needs it; it exists so "which one did this import resolve to?" has an
95
- * answer, which is a question that costs an afternoon otherwise.
96
- */
97
- static isHelixShim = true;
98
- /** Run after every test of the run (Japa `Test.executed`). */
99
- static executed(callback) {
100
- registerExecutedHook(callback);
101
- }
102
- /** Japa's `Test.macro`, mapped onto helix's context registry. */
103
- static macro(name, value) {
104
- TestContextRegistry.macro(name, value);
105
- }
106
- }
107
- /**
108
- * Japa's `TestContext` — the registrars a plugin uses to put something on every
109
- * test's context.
110
- */
111
- // biome-ignore lint/complexity/noStaticOnlyClass: same as `Test` above — it replaces an exported class, not a namespace.
112
- export class TestContext {
113
- /** @see Test.isHelixShim */
114
- static isHelixShim = true;
115
- /**
116
- * Add a lazily-computed property (Japa `TestContext.getter`). Japa's third
117
- * argument asks for the value to be cached per context; helix's getters are
118
- * always cached per context, so it is accepted and has nothing to change.
119
- */
120
- static getter(name, accumulator, _singleton) {
121
- TestContextRegistry.getter(name, () => accumulator());
122
- }
123
- /** Add a shared property (Japa `TestContext.macro`). */
124
- static macro(name, value) {
125
- TestContextRegistry.macro(name, value);
126
- }
127
- }
128
- //# sourceMappingURL=core.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/japa/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,oBAAoB,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