@callidescope/nx 0.0.29 → 0.0.31

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.
@@ -128,19 +128,19 @@ declare interface InferTargetsArguments {
128
128
  declare interface LoadedRunConfiguration {
129
129
  readonly configuration: ResolvedCallidescopeConfiguration;
130
130
  /**
131
- * Where the configuration was read from, or nothing when none was found.
131
+ * Where the configuration was read from.
132
132
  *
133
133
  * The path the loader settled on rather than the one it was handed, since a
134
- * search may have answered — and a run resolves a project's own
135
- * configuration relative to it.
134
+ * relative path is resolved before it is read — and a run resolves a
135
+ * project's own configuration relative to it.
136
136
  */
137
- readonly path: string | undefined;
137
+ readonly path: string;
138
138
  }
139
139
 
140
140
  /** Arguments for loading the configuration one run is judged by. */
141
141
  declare interface LoadRunConfigurationArguments {
142
- /** Resolved from this plugin's `nx.json` registration when omitted. */
143
- readonly configurationPath?: string | undefined;
142
+ /** The workspace configuration file, as this plugin's registration names it. */
143
+ readonly configurationPath: string;
144
144
  readonly workspaceRoot: string;
145
145
  }
146
146
 
@@ -148,7 +148,7 @@ declare interface LoadRunConfigurationArguments {
148
148
  export declare interface LookupArguments {
149
149
  /** Each `<file>#<qualified-name>`, the form every callidescope stack prints. */
150
150
  readonly addresses: readonly string[];
151
- readonly configurationPath?: string | undefined;
151
+ readonly configurationPath: string;
152
152
  /** Workspace-relative directories the lookup resolves the address against. */
153
153
  readonly directories: readonly string[];
154
154
  readonly format?: CallidescopeOutputFormat | undefined;
@@ -180,7 +180,7 @@ export declare class MainModule {
180
180
  *
181
181
  * `codependix-nx-projects` declares a near-identical shape and reads it out of the
182
182
  * graph the same way. They are deliberately not shared: the two packages sit
183
- * in different toolchains, and `configuration/eslint.config.ts` lets this one
183
+ * in different toolchains, and `projects/configuration/eslint.config.ts` lets this one
184
184
  * depend on nothing but `logging` precisely so `@nx/devkit` cannot spread. A
185
185
  * package extracted to hold both would have to be depended on by both, which
186
186
  * is the coupling that rule exists to prevent.
@@ -206,15 +206,20 @@ export declare class OptionsModule {
206
206
  * from being built.
207
207
  */
208
208
  export declare class OptionsService {
209
- constructor();
209
+ private readonly configurationService;
210
+ constructor(configurationService: ConfigurationService);
210
211
  /** Narrows an untrusted value to an array without widening it to `any`. */
211
212
  private isUnknownArray;
212
- /** Reads one `nx.json` plugin entry, if it is this plugin's registration. */
213
- private readEntryConfigurationPath;
214
- /** Reads this plugin's `configurationPath` out of an `nx.json`, if it names one. */
215
- private readRegisteredConfigurationPath;
216
213
  /** Reads a string field from an untrusted record, or `undefined`. */
217
214
  private readString;
215
+ /**
216
+ * Reads the `configuration` option of an executor, refusing a missing one.
217
+ *
218
+ * Nx validates the option against `schema.json`, but a target written by hand
219
+ * reaches an executor unchecked, so the same refusal the plugin option gets —
220
+ * decided by the configuration layer — is applied here.
221
+ */
222
+ readConfiguration(value: unknown): string;
218
223
  /**
219
224
  * Narrows an untrusted output format to one callidescope renders.
220
225
  *
@@ -223,6 +228,17 @@ export declare class OptionsService {
223
228
  * configuration chose rather than reaching the renderer.
224
229
  */
225
230
  readFormat(value: unknown): CallidescopeOutputFormat | undefined;
231
+ /**
232
+ * Reads the two options every lookup executor shares, the configuration
233
+ * path refused when missing and the format narrowed.
234
+ */
235
+ readLookupOptions(options: {
236
+ configuration: unknown;
237
+ format?: unknown;
238
+ }): {
239
+ configurationPath: string;
240
+ format: CallidescopeOutputFormat | undefined;
241
+ };
226
242
  /**
227
243
  * Reads a list of strings out of an executor's options.
228
244
  *
@@ -234,19 +250,12 @@ export declare class OptionsService {
234
250
  */
235
251
  readStringList(value: unknown): string[];
236
252
  /**
237
- * Resolves the configuration path a workspace means, without assuming one.
253
+ * Resolves the effective plugin options from an untrusted value.
238
254
  *
239
- * Nx passes plugin options to `createNodes` and to executors, but not to
240
- * anything run outside Nx, so a caller that has a filesystem resolves the
241
- * path itself rather than assuming a workspace keeps its configuration at
242
- * the root. `exists` is supplied by the caller because the callers do not
243
- * agree on what a filesystem is.
255
+ * Every field has a default except `configurationPath`: the workspace
256
+ * configuration is never searched for, so a registration that does not name
257
+ * it is refused rather than guessed at.
244
258
  */
245
- resolveConfigurationPath(args: {
246
- exists: (candidatePath: string) => boolean;
247
- nxConfiguration: unknown;
248
- }): string;
249
- /** Resolves the effective plugin options from an untrusted value. */
250
259
  resolvePluginOptions(options: unknown): CallidescopePluginOptions;
251
260
  }
252
261
 
@@ -628,26 +637,17 @@ declare interface ResolveTraceScopeArguments {
628
637
  }
629
638
 
630
639
  /**
631
- * Finds and reads the callidescope configuration one run is judged by.
640
+ * Reads the callidescope configuration one run is judged by.
632
641
  *
633
642
  * Its own service rather than more of `PluginService`, because every target
634
- * here starts by answering the same question — which configuration file is
635
- * this run's — and none of them can be written until it is answered. Keeping
643
+ * here starts by reading the same file — the one its `configurationPath` names
644
+ * — and none of them can be written until it is read. Keeping
636
645
  * it apart also keeps the verdict and the inference in `PluginService` beside
637
646
  * each other, which is where the rules a reader comes looking for are.
638
647
  */
639
648
  declare class RunConfigurationService {
640
649
  private readonly configurationService;
641
- private readonly optionsService;
642
- constructor(configurationService: ConfigurationService, optionsService: OptionsService);
643
- /**
644
- * Reads the workspace's `nx.json`, so this plugin's own registration can be
645
- * consulted for a configuration path an executor was not given.
646
- *
647
- * Unreadable or malformed is not an error: the caller falls back to the
648
- * conventional filenames, which a workspace with no registration gets anyway.
649
- */
650
- private readNxConfiguration;
650
+ constructor(configurationService: ConfigurationService);
651
651
  /**
652
652
  * Resolves and loads the configuration one run is judged by.
653
653
  *
@@ -668,8 +668,8 @@ declare type RunGateArguments = Omit<RunTraceArguments, "format">;
668
668
 
669
669
  /** Arguments for tracing one resolved selection. */
670
670
  declare interface RunTraceArguments {
671
- /** Resolved from this plugin's `nx.json` registration when omitted. */
672
- readonly configurationPath?: string | undefined;
671
+ /** The workspace configuration file, as this plugin's registration names it. */
672
+ readonly configurationPath: string;
673
673
  readonly directories: readonly string[];
674
674
  /** What the run prints. Defaults to markdown when omitted. */
675
675
  readonly format?: CallidescopeOutputFormat | undefined;
package/dist/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as e, a as t, b as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, y as v } from "../plugin-context.utilities-ByGoz-_t.js";
1
+ import { _ as e, a as t, b as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, y as v } from "../plugin-context.utilities-B2BXtiTJ.js";
2
2
  import y from "node:path";
3
3
  //#region projects/ic-suite/callidescope/callidescope-nx/src/index.ts
4
4
  var b = {
package/package.json CHANGED
@@ -4,11 +4,11 @@
4
4
  "url": "https://github.com/organizzolini/codebase/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@callidescope/cli": "0.0.29",
8
- "@callidescope/configuration": "0.0.29",
9
- "@callidescope/core": "0.0.28",
10
- "@callidescope/graph": "0.0.28",
11
- "@callidescope/output": "0.0.28",
7
+ "@callidescope/cli": "0.0.31",
8
+ "@callidescope/configuration": "0.0.31",
9
+ "@callidescope/core": "0.0.30",
10
+ "@callidescope/graph": "0.0.30",
11
+ "@callidescope/output": "0.0.30",
12
12
  "@nestjs/common": "^11.1.21 || ^12.0.1",
13
13
  "@nestjs/core": "^11.1.21 || ^12.0.1",
14
14
  "@nx/devkit": "^23.0.0",
@@ -79,5 +79,5 @@
79
79
  "strict": true
80
80
  },
81
81
  "types": "./dist/src/index.d.ts",
82
- "version": "0.0.29"
82
+ "version": "0.0.31"
83
83
  }
@@ -7,8 +7,8 @@
7
7
  "items": { "type": "string" },
8
8
  "type": "array"
9
9
  },
10
- "configurationPath": {
11
- "description": "Path to the callidescope configuration file, relative to the workspace root.",
10
+ "configuration": {
11
+ "description": "Required. Path to the callidescope configuration file, relative to the workspace root.",
12
12
  "type": "string"
13
13
  },
14
14
  "format": {
@@ -32,7 +32,7 @@
32
32
  "type": "boolean"
33
33
  }
34
34
  },
35
- "required": ["addresses"],
35
+ "required": ["addresses", "configuration"],
36
36
  "title": "Callidescope breadth",
37
37
  "type": "object"
38
38
  }
@@ -7,8 +7,8 @@
7
7
  "items": { "type": "string" },
8
8
  "type": "array"
9
9
  },
10
- "configurationPath": {
11
- "description": "Path to the callidescope configuration file, relative to the workspace root.",
10
+ "configuration": {
11
+ "description": "Required. Path to the callidescope configuration file, relative to the workspace root.",
12
12
  "type": "string"
13
13
  },
14
14
  "format": {
@@ -32,7 +32,7 @@
32
32
  "type": "boolean"
33
33
  }
34
34
  },
35
- "required": ["addresses"],
35
+ "required": ["addresses", "configuration"],
36
36
  "title": "Callidescope depth",
37
37
  "type": "object"
38
38
  }
@@ -2,8 +2,8 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "description": "Fail a project whose call stacks broke the depth or breadth limits it is held to, resolved against the project and its Nx dependencies.",
4
4
  "properties": {
5
- "configurationPath": {
6
- "description": "Path to the callidescope configuration file, relative to the workspace root.",
5
+ "configuration": {
6
+ "description": "Required. Path to the callidescope configuration file, relative to the workspace root.",
7
7
  "type": "string"
8
8
  },
9
9
  "projects": {
@@ -22,7 +22,7 @@
22
22
  "type": "boolean"
23
23
  }
24
24
  },
25
- "required": [],
25
+ "required": ["configuration"],
26
26
  "title": "Callidescope gate",
27
27
  "type": "object"
28
28
  }
@@ -2,8 +2,8 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "description": "Trace a project's call stacks with callidescope, following its Nx dependencies.",
4
4
  "properties": {
5
- "configurationPath": {
6
- "description": "Path to the callidescope configuration file, relative to the workspace root.",
5
+ "configuration": {
6
+ "description": "Required. Path to the callidescope configuration file, relative to the workspace root.",
7
7
  "type": "string"
8
8
  },
9
9
  "format": {
@@ -27,7 +27,7 @@
27
27
  "type": "boolean"
28
28
  }
29
29
  },
30
- "required": [],
30
+ "required": ["configuration"],
31
31
  "title": "Callidescope trace",
32
32
  "type": "object"
33
33
  }