dependency-cruiser 18.0.0 → 18.1.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.
@@ -29,7 +29,7 @@ export function clearRegExpCache() {
29
29
  * This fills our current need. Later we can expand it to return all group
30
30
  * matches.
31
31
  *
32
- * @param {import("../../types/restrictions").IFromRestriction} pFromRestriction
32
+ * @param {import("../../types/restrictions.mjs").IFromRestriction} pFromRestriction
33
33
  * @param {string} pActualPath
34
34
  * @returns {string[]|null}
35
35
  */
@@ -6,10 +6,15 @@ import type {
6
6
  ModuleSystemType,
7
7
  ProtocolType,
8
8
  ExperimentalStatsType,
9
+ SeverityType,
9
10
  } from "./shared-types.mjs";
10
11
  import type { IViolation } from "./violations.mjs";
11
12
  import type { IRuleSummary } from "./rule-summary.mjs";
12
13
  import type { IChange } from "watskeburt";
14
+ import type {
15
+ IAvailableExtension,
16
+ IAvailableTranspiler,
17
+ } from "./environment.mjs";
13
18
 
14
19
  export interface IRevisionChange extends IChange {
15
20
  // optional because
@@ -359,6 +364,28 @@ export interface ISummary {
359
364
  * the number of warnings in the dependencies
360
365
  */
361
366
  warn: number;
367
+ /**
368
+ * information on the environment the cruise ran on
369
+ */
370
+ environment: {
371
+ version: string;
372
+ nodeVersionSupported: string;
373
+ nodeVersionFound: string;
374
+ osVersionFound: string;
375
+ transpilersFound: IAvailableTranspiler[];
376
+ extensionsFound: IAvailableExtension[];
377
+ /**
378
+ * Issues detected in the environment that might have influenced the cruise
379
+ * e.g. a missing (supported) typescript transpiler, while there's a tsconfig
380
+ */
381
+ issues?: IEnvironmentIssue[];
382
+ };
383
+ }
384
+
385
+ export interface IEnvironmentIssue {
386
+ severity: SeverityType;
387
+ name: string;
388
+ description: string;
362
389
  }
363
390
 
364
391
  /**
@@ -1,6 +1,10 @@
1
1
  import type { ICruiseResult } from "./cruise-result.mjs";
2
2
  import type { ICruiseOptions, IFormatOptions } from "./options.mjs";
3
3
  import type { IResolveOptions } from "./resolve-options.mjs";
4
+ import type {
5
+ IAvailableExtension,
6
+ IAvailableTranspiler,
7
+ } from "./environment.mjs";
4
8
 
5
9
  export type * from "./rule-set.mjs";
6
10
  export type * from "./options.mjs";
@@ -8,6 +12,7 @@ export type * from "./configuration.mjs";
8
12
  export type * from "./shared-types.mjs";
9
13
  export type * from "./cruise-result.mjs";
10
14
  export type * from "./resolve-options.mjs";
15
+ export type * from "./environment.mjs";
11
16
 
12
17
  /**
13
18
  * all supported extensions; for each extension whether or not
@@ -15,32 +20,6 @@ export type * from "./resolve-options.mjs";
15
20
  */
16
21
  export const allExtensions: IAvailableExtension[];
17
22
 
18
- export interface IAvailableExtension {
19
- /**
20
- * File extension (e.g. ".js", ".ts", ".jsx")
21
- */
22
- extension: string;
23
- /**
24
- * Whether or not the extension is available as supported in the current environment
25
- */
26
- available: boolean;
27
- }
28
-
29
- export interface IAvailableTranspiler {
30
- /**
31
- * The name of the transpiler (e.g. "typescript", "coffeescript")
32
- */
33
- name: string;
34
- /**
35
- * A semver version range (e.g. ">=2.0.0 <3.0.0")
36
- */
37
- version: string;
38
- /**
39
- * Whether or not the transpiler is available in the current environment
40
- */
41
- available: boolean;
42
- }
43
-
44
23
  export interface IReporterOutput {
45
24
  /**
46
25
  * The output proper of the reporter. For most reporters this will be
@@ -0,0 +1,29 @@
1
+ export interface IAvailableExtension {
2
+ /**
3
+ * File extension (e.g. ".js", ".ts", ".jsx")
4
+ */
5
+ extension: string;
6
+ /**
7
+ * Whether or not the extension is available as supported in the current environment
8
+ */
9
+ available: boolean;
10
+ }
11
+
12
+ export interface IAvailableTranspiler {
13
+ /**
14
+ * The name of the transpiler (e.g. "typescript", "coffeescript")
15
+ */
16
+ name: string;
17
+ /**
18
+ * A semver version range (e.g. ">=2.0.0 <3.0.0")
19
+ */
20
+ version: string;
21
+ /**
22
+ * The currently installed version (e.g. 2.3.4). '-' if not installed
23
+ */
24
+ currentVersion: string;
25
+ /**
26
+ * Whether or not the transpiler is available in the current environment
27
+ */
28
+ available: boolean;
29
+ }
@@ -14,10 +14,7 @@ import type { ModuleSystemType, OutputType } from "./shared-types.mjs";
14
14
 
15
15
  export type ExternalModuleResolutionStrategyType = "node_modules" | "yarn-pnp";
16
16
  export type ProgressType =
17
- | "cli-feedback"
18
- | "performance-log"
19
- | "ndjson"
20
- | "none";
17
+ "cli-feedback" | "performance-log" | "ndjson" | "none";
21
18
  export type ParserType = "acorn" | "tsc" | "swc";
22
19
 
23
20
  export interface ITsConfig {
@@ -128,13 +128,10 @@ export interface IRegularAllowedRuleType {
128
128
  }
129
129
 
130
130
  export type IAllowedRuleType =
131
- | IRegularAllowedRuleType
132
- | IReachabilityAllowedRuleType;
131
+ IRegularAllowedRuleType | IReachabilityAllowedRuleType;
133
132
 
134
133
  export type IAnyRuleType =
135
- | IForbiddenRuleType
136
- | IAllowedRuleType
137
- | IRequiredRuleType;
134
+ IForbiddenRuleType | IAllowedRuleType | IRequiredRuleType;
138
135
 
139
136
  export interface IFlattenedRuleSet {
140
137
  /**
@@ -75,11 +75,7 @@ export type DependencyType =
75
75
  export type ProtocolType = "data:" | "file:" | "node:";
76
76
 
77
77
  export type ViolationType =
78
- | "dependency"
79
- | "module"
80
- | "cycle"
81
- | "reachability"
82
- | "instability";
78
+ "dependency" | "module" | "cycle" | "reachability" | "instability";
83
79
 
84
80
  export type RuleScopeType = "module" | "folder";
85
81
 
@@ -54,13 +54,10 @@ export interface IStrictRegularAllowedRuleType extends IRegularAllowedRuleType {
54
54
  to: IStrictToRestriction;
55
55
  }
56
56
  export type IStrictAllowedRuleType =
57
- | IStrictRegularAllowedRuleType
58
- | IStrictReachabilityAllowedRuleType;
57
+ IStrictRegularAllowedRuleType | IStrictReachabilityAllowedRuleType;
59
58
 
60
59
  export type IStrictAnyRuleType =
61
- | IStrictForbiddenRuleType
62
- | IStrictAllowedRuleType
63
- | IStrictRequiredRuleType;
60
+ IStrictForbiddenRuleType | IStrictAllowedRuleType | IStrictRequiredRuleType;
64
61
 
65
62
  export interface IStrictRuleSet extends IFlattenedRuleSet {
66
63
  forbidden?: IStrictForbiddenRuleType[];