dependency-cruiser 14.1.1 → 14.1.2

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 (77) hide show
  1. package/bin/depcruise-baseline.mjs +3 -3
  2. package/bin/depcruise-fmt.mjs +3 -3
  3. package/bin/dependency-cruise.mjs +3 -3
  4. package/bin/wrap-stream-in-html.mjs +1 -1
  5. package/package.json +15 -10
  6. package/src/cache/cache.mjs +12 -10
  7. package/src/cache/find-content-changes.mjs +9 -7
  8. package/src/cache/helpers.mjs +4 -4
  9. package/src/cache/metadata-strategy.mjs +5 -4
  10. package/src/cli/assert-node-environment-suitable.mjs +1 -1
  11. package/src/cli/format-meta-info.mjs +4 -4
  12. package/src/cli/format.mjs +1 -1
  13. package/src/cli/index.mjs +6 -7
  14. package/src/cli/init-config/find-extensions.mjs +7 -4
  15. package/src/cli/init-config/normalize-init-options.mjs +1 -1
  16. package/src/cli/init-config/write-run-scripts-to-manifest.mjs +1 -1
  17. package/src/cli/listeners/cli-feedback.mjs +5 -5
  18. package/src/cli/listeners/ndjson.mjs +2 -2
  19. package/src/cli/listeners/performance-log/format-helpers.mjs +7 -8
  20. package/src/cli/listeners/performance-log/index.mjs +3 -3
  21. package/src/cli/normalize-cli-options.mjs +1 -1
  22. package/src/config-utl/extract-babel-config.mjs +5 -5
  23. package/src/config-utl/extract-depcruise-config/index.mjs +2 -2
  24. package/src/config-utl/extract-ts-config.mjs +7 -7
  25. package/src/enrich/add-validations.mjs +2 -2
  26. package/src/enrich/derive/folders/aggregate-to-folders.mjs +12 -10
  27. package/src/enrich/derive/folders/index.mjs +3 -3
  28. package/src/enrich/derive/metrics/get-module-metrics.mjs +4 -4
  29. package/src/enrich/derive/reachable.mjs +3 -3
  30. package/src/enrich/enrich-modules.mjs +3 -3
  31. package/src/enrich/soften-known-violations.mjs +16 -16
  32. package/src/enrich/summarize/index.mjs +2 -2
  33. package/src/enrich/summarize/summarize-folders.mjs +2 -2
  34. package/src/enrich/summarize/summarize-modules.mjs +14 -14
  35. package/src/extract/ast-extractors/extract-typescript-deps.mjs +8 -8
  36. package/src/extract/ast-extractors/swc-dependency-visitor.mjs +4 -4
  37. package/src/extract/gather-initial-sources.mjs +3 -3
  38. package/src/extract/get-dependencies.mjs +20 -20
  39. package/src/extract/index.mjs +17 -16
  40. package/src/extract/parse/to-javascript-ast.mjs +3 -3
  41. package/src/extract/parse/to-swc-ast.mjs +1 -1
  42. package/src/extract/parse/to-typescript-ast.mjs +5 -5
  43. package/src/extract/resolve/index.mjs +1 -1
  44. package/src/extract/resolve/module-classifiers.mjs +7 -7
  45. package/src/extract/resolve/resolve-amd.mjs +1 -1
  46. package/src/extract/resolve/resolve-cjs.mjs +1 -1
  47. package/src/extract/resolve/resolve.mjs +4 -4
  48. package/src/extract/transpile/babel-wrap.mjs +1 -1
  49. package/src/extract/transpile/coffeescript-wrap.mjs +3 -3
  50. package/src/extract/transpile/livescript-wrap.mjs +2 -2
  51. package/src/extract/transpile/meta.mjs +5 -5
  52. package/src/extract/transpile/svelte-wrap.mjs +3 -3
  53. package/src/extract/transpile/typescript-wrap.mjs +3 -3
  54. package/src/extract/transpile/vue-template-wrap.cjs +3 -3
  55. package/src/main/cruise.mjs +5 -6
  56. package/src/main/format.mjs +1 -1
  57. package/src/main/index.d.ts +1 -1
  58. package/src/main/index.mjs +4 -4
  59. package/src/main/options/assert-validity.mjs +1 -1
  60. package/src/main/report-wrap.mjs +8 -8
  61. package/src/main/resolve-options/normalize.mjs +2 -2
  62. package/src/main/rule-set/assert-validity.mjs +1 -1
  63. package/src/meta.js +1 -1
  64. package/src/report/dot/index.mjs +1 -1
  65. package/src/report/dot/prepare-custom-level.mjs +4 -4
  66. package/src/report/dot/prepare-flat-level.mjs +1 -1
  67. package/src/report/dot/prepare-folder-level.mjs +3 -3
  68. package/src/report/error-html/index.mjs +1 -1
  69. package/src/report/error-html/utl.mjs +1 -1
  70. package/src/report/error.mjs +15 -15
  71. package/src/report/markdown.mjs +7 -7
  72. package/src/validate/index.d.ts +0 -2
  73. package/src/validate/match-dependency-rule.mjs +2 -2
  74. package/src/validate/match-folder-dependency-rule.mjs +6 -4
  75. package/src/validate/match-module-rule.mjs +5 -5
  76. package/src/validate/matchers.mjs +17 -17
  77. package/src/validate/violates-required-rule.mjs +2 -2
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { program } from "commander";
3
- import assertNodeEnvironmentSuitable from "../src/cli/assert-node-environment-suitable.mjs";
4
- import meta from "../src/meta.js";
5
- import cli from "../src/cli/index.mjs";
3
+ import assertNodeEnvironmentSuitable from "#cli/assert-node-environment-suitable.mjs";
4
+ import cli from "#cli/index.mjs";
5
+ import meta from "#meta.js";
6
6
 
7
7
  function formatError(pError) {
8
8
  process.stderr.write(pError.message);
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { program } from "commander";
4
- import assertNodeEnvironmentSuitable from "../src/cli/assert-node-environment-suitable.mjs";
5
- import meta from "../src/meta.js";
6
- import format from "../src/cli/format.mjs";
4
+ import assertNodeEnvironmentSuitable from "#cli/assert-node-environment-suitable.mjs";
5
+ import format from "#cli/format.mjs";
6
+ import meta from "#meta.js";
7
7
 
8
8
  function formatError(pError) {
9
9
  process.stderr.write(pError.message);
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { EOL } from "node:os";
3
3
  import { program } from "commander";
4
- import assertNodeEnvironmentSuitable from "../src/cli/assert-node-environment-suitable.mjs";
5
- import meta from "../src/meta.js";
6
- import cli from "../src/cli/index.mjs";
4
+ import assertNodeEnvironmentSuitable from "#cli/assert-node-environment-suitable.mjs";
5
+ import cli from "#cli/index.mjs";
6
+ import meta from "#meta.js";
7
7
 
8
8
  try {
9
9
  assertNodeEnvironmentSuitable();
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import wrapStreamInHtml from "../src/cli/tools/wrap-stream-in-html.mjs";
3
+ import wrapStreamInHtml from "#cli/tools/wrap-stream-in-html.mjs";
4
4
 
5
5
  wrapStreamInHtml(process.stdin, process.stdout);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-cruiser",
3
- "version": "14.1.1",
3
+ "version": "14.1.2",
4
4
  "description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
5
5
  "keywords": [
6
6
  "static analysis",
@@ -44,6 +44,11 @@
44
44
  "depcruise-wrap-stream-in-html": "bin/wrap-stream-in-html.mjs"
45
45
  },
46
46
  "main": "src/main/index.mjs",
47
+ "imports": {
48
+ "#configuration-schema": "./src/schema/configuration.schema.mjs",
49
+ "#cruise-result-schema": "./src/schema/cruise-result.schema.mjs",
50
+ "#*": "./src/*"
51
+ },
47
52
  "exports": {
48
53
  ".": {
49
54
  "import": "./src/main/index.mjs",
@@ -155,7 +160,7 @@
155
160
  "acorn-walk": "8.2.0",
156
161
  "ajv": "8.12.0",
157
162
  "chalk": "5.3.0",
158
- "commander": "11.0.0",
163
+ "commander": "11.1.0",
159
164
  "enhanced-resolve": "5.15.0",
160
165
  "figures": "5.0.0",
161
166
  "ignore": "5.2.4",
@@ -176,15 +181,15 @@
176
181
  "wrap-ansi": "8.1.0"
177
182
  },
178
183
  "devDependencies": {
179
- "@babel/core": "7.23.0",
184
+ "@babel/core": "7.23.2",
180
185
  "@babel/plugin-transform-modules-commonjs": "7.23.0",
181
- "@babel/preset-typescript": "7.23.0",
182
- "@swc/core": "1.3.92",
186
+ "@babel/preset-typescript": "7.23.2",
187
+ "@swc/core": "1.3.93",
183
188
  "@types/lodash": "4.14.199",
184
- "@types/node": "20.8.3",
185
- "@types/prompts": "2.4.5",
186
- "@typescript-eslint/eslint-plugin": "6.7.4",
187
- "@typescript-eslint/parser": "6.7.4",
189
+ "@types/node": "20.8.6",
190
+ "@types/prompts": "2.4.6",
191
+ "@typescript-eslint/eslint-plugin": "6.8.0",
192
+ "@typescript-eslint/parser": "6.8.0",
188
193
  "@vue/compiler-sfc": "3.3.4",
189
194
  "c8": "8.0.1",
190
195
  "coffeescript": "2.7.0",
@@ -200,7 +205,7 @@
200
205
  "eslint-plugin-unicorn": "^48.0.1",
201
206
  "husky": "8.0.3",
202
207
  "intercept-stdout": "0.1.2",
203
- "lint-staged": "14.0.1",
208
+ "lint-staged": "15.0.1",
204
209
  "mocha": "10.2.0",
205
210
  "normalize-newline": "4.1.0",
206
211
  "npm-run-all": "4.1.5",
@@ -1,11 +1,13 @@
1
1
  // @ts-check
2
2
  import { readFile, mkdir, writeFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
- import { scannableExtensions } from "../extract/transpile/meta.mjs";
5
- import { bus } from "../utl/bus.mjs";
6
4
  import { optionsAreCompatible } from "./options-compatible.mjs";
7
5
  import MetadataStrategy from "./metadata-strategy.mjs";
8
6
  import ContentStrategy from "./content-strategy.mjs";
7
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
8
+ import { scannableExtensions } from "#extract/transpile/meta.mjs";
9
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
10
+ import { bus } from "#utl/bus.mjs";
9
11
 
10
12
  const CACHE_FILE_NAME = "cache.json";
11
13
 
@@ -36,19 +38,19 @@ export default class Cache {
36
38
  pCruiseOptions,
37
39
  {
38
40
  extensions: new Set(
39
- scannableExtensions.concat(pCruiseOptions.extraExtensionsToScan)
41
+ scannableExtensions.concat(pCruiseOptions.extraExtensionsToScan),
40
42
  ),
41
- }
43
+ },
42
44
  ));
43
45
  bus.debug("cache: - comparing");
44
46
  return (
45
47
  this.cacheStrategy.revisionDataEqual(
46
48
  pCachedCruiseResult.revisionData,
47
- this.revisionData
49
+ this.revisionData,
48
50
  ) &&
49
51
  optionsAreCompatible(
50
52
  pCachedCruiseResult.summary.optionsUsed,
51
- pCruiseOptions
53
+ pCruiseOptions,
52
54
  )
53
55
  );
54
56
  }
@@ -60,7 +62,7 @@ export default class Cache {
60
62
  async read(pCacheFolder) {
61
63
  try {
62
64
  return JSON.parse(
63
- await readFile(join(pCacheFolder, CACHE_FILE_NAME), "utf8")
65
+ await readFile(join(pCacheFolder, CACHE_FILE_NAME), "utf8"),
64
66
  );
65
67
  } catch (pError) {
66
68
  return { modules: [], summary: {} };
@@ -81,10 +83,10 @@ export default class Cache {
81
83
  JSON.stringify(
82
84
  this.cacheStrategy.prepareRevisionDataForSaving(
83
85
  pCruiseResult,
84
- lRevisionData
85
- )
86
+ lRevisionData,
87
+ ),
86
88
  ),
87
- "utf8"
89
+ "utf8",
88
90
  );
89
91
  }
90
92
  }
@@ -1,8 +1,6 @@
1
1
  /* eslint-disable no-inline-comments */
2
2
  // @ts-check
3
3
  import { join } from "node:path/posix";
4
- import { bus } from "../utl/bus.mjs";
5
- import findAllFiles from "../utl/find-all-files.mjs";
6
4
  import {
7
5
  getFileHashSync,
8
6
  excludeFilter,
@@ -10,6 +8,10 @@ import {
10
8
  hasInterestingExtension,
11
9
  moduleIsInterestingForDiff,
12
10
  } from "./helpers.mjs";
11
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
12
+ import { bus } from "#utl/bus.mjs";
13
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
14
+ import findAllFiles from "#utl/find-all-files.mjs";
13
15
 
14
16
  /**
15
17
  * @param {Set<string>} pFileSet
@@ -19,7 +21,7 @@ import {
19
21
  function diffCachedModuleAgainstFileSet(
20
22
  pFileSet,
21
23
  pBaseDirectory,
22
- pFileHashFunction = getFileHashSync
24
+ pFileHashFunction = getFileHashSync,
23
25
  ) {
24
26
  return (pModule) => {
25
27
  if (!moduleIsInterestingForDiff(pModule)) {
@@ -31,7 +33,7 @@ function diffCachedModuleAgainstFileSet(
31
33
  }
32
34
 
33
35
  const lNewCheckSum = pFileHashFunction(
34
- join(pBaseDirectory, pModule.source)
36
+ join(pBaseDirectory, pModule.source),
35
37
  );
36
38
  if (lNewCheckSum !== pModule.checksum) {
37
39
  return {
@@ -72,7 +74,7 @@ function diffCachedModuleAgainstFileSet(
72
74
  export default function findContentChanges(
73
75
  pDirectory,
74
76
  pCachedCruiseResult,
75
- pOptions
77
+ pOptions,
76
78
  ) {
77
79
  bus.debug("cache: - getting revision data");
78
80
  const lFileSet = new Set(
@@ -80,12 +82,12 @@ export default function findContentChanges(
80
82
  baseDir: pOptions.baseDir,
81
83
  excludeFilterFn: excludeFilter(pOptions.exclude),
82
84
  includeOnlyFilterFn: includeOnlyFilter(pOptions.includeOnly),
83
- }).filter(hasInterestingExtension(pOptions.extensions))
85
+ }).filter(hasInterestingExtension(pOptions.extensions)),
84
86
  );
85
87
 
86
88
  bus.debug("cache: - getting (cached - new)");
87
89
  const lDiffCachedVsNew = pCachedCruiseResult.modules.map(
88
- diffCachedModuleAgainstFileSet(lFileSet, pOptions.baseDir)
90
+ diffCachedModuleAgainstFileSet(lFileSet, pOptions.baseDir),
89
91
  );
90
92
 
91
93
  bus.debug("cache: - getting (new - cached)");
@@ -4,7 +4,7 @@ import { readFileSync } from "node:fs";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { extname } from "node:path";
6
6
  import memoize from "lodash/memoize.js";
7
- import { filenameMatchesPattern } from "../graph-utl/match-facade.mjs";
7
+ import { filenameMatchesPattern } from "#graph-utl/match-facade.mjs";
8
8
 
9
9
  /**
10
10
  * @param {string} pString
@@ -101,10 +101,10 @@ export function hasInterestingExtension(pExtensions) {
101
101
  export function changeHasInterestingExtension(pExtensions) {
102
102
  return (pChange) => {
103
103
  const lNameHasInterestingExtension = hasInterestingExtension(pExtensions)(
104
- pChange.name
104
+ pChange.name,
105
105
  );
106
106
  const lOldNameHasInterestingExtension = Boolean(
107
- pChange.oldName && hasInterestingExtension(pExtensions)(pChange.oldName)
107
+ pChange.oldName && hasInterestingExtension(pExtensions)(pChange.oldName),
108
108
  );
109
109
  return lNameHasInterestingExtension || lOldNameHasInterestingExtension;
110
110
  };
@@ -128,7 +128,7 @@ const DEFAULT_INTERESTING_CHANGE_TYPES = new Set([
128
128
  export function isInterestingChangeType(pInterestingChangeTypes) {
129
129
  return (pChange) =>
130
130
  (pInterestingChangeTypes ?? DEFAULT_INTERESTING_CHANGE_TYPES).has(
131
- pChange.changeType
131
+ pChange.changeType,
132
132
  );
133
133
  }
134
134
 
@@ -2,7 +2,6 @@
2
2
  // @ts-check
3
3
  import { isDeepStrictEqual } from "node:util";
4
4
  import { getSHA, list } from "watskeburt";
5
- import { bus } from "../utl/bus.mjs";
6
5
  import {
7
6
  isInterestingChangeType,
8
7
  addCheckSumToChangeSync,
@@ -10,6 +9,8 @@ import {
10
9
  includeOnlyFilter,
11
10
  changeHasInterestingExtension,
12
11
  } from "./helpers.mjs";
12
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
13
+ import { bus } from "#utl/bus.mjs";
13
14
 
14
15
  export default class MetaDataStrategy {
15
16
  /**
@@ -27,7 +28,7 @@ export default class MetaDataStrategy {
27
28
  _pDirectory,
28
29
  _pCachedCruiseResult,
29
30
  pCruiseOptions,
30
- pOptions
31
+ pOptions,
31
32
  ) {
32
33
  const lOptions = {
33
34
  shaRetrievalFn: getSHA,
@@ -45,7 +46,7 @@ export default class MetaDataStrategy {
45
46
  const lChanges = lDiff
46
47
  .filter(({ name }) => excludeFilter(pCruiseOptions.exclude)(name))
47
48
  .filter(({ name }) =>
48
- includeOnlyFilter(pCruiseOptions.includeOnly)(name)
49
+ includeOnlyFilter(pCruiseOptions.includeOnly)(name),
49
50
  )
50
51
  .filter(changeHasInterestingExtension(lOptions.extensions))
51
52
  .filter(isInterestingChangeType(lOptions.interestingChangeTypes));
@@ -56,7 +57,7 @@ export default class MetaDataStrategy {
56
57
  };
57
58
  } catch (pError) {
58
59
  throw new Error(
59
- `The --cache option works in concert with git - and it seems either the current folder isn't version managed or git isn't installed. Error:${`\n\n ${pError}\n`}`
60
+ `The --cache option works in concert with git - and it seems either the current folder isn't version managed or git isn't installed. Error:${`\n\n ${pError}\n`}`,
60
61
  );
61
62
  }
62
63
  }
@@ -1,5 +1,5 @@
1
1
  import satisfies from "semver/functions/satisfies.js";
2
- import meta from "../meta.js";
2
+ import meta from "#meta.js";
3
3
 
4
4
  export default function assertNodeEnvironmentSuitable(pNodeVersion) {
5
5
  // not using default parameter here because the check should run
@@ -1,7 +1,7 @@
1
1
  import chalk from "chalk";
2
2
  import figures from "figures";
3
3
 
4
- import { getAvailableTranspilers, allExtensions } from "../main/index.mjs";
4
+ import { getAvailableTranspilers, allExtensions } from "#main/index.mjs";
5
5
 
6
6
  function bool2Symbol(pBool) {
7
7
  return pBool ? chalk.green(figures.tick) : chalk.red(figures.cross);
@@ -13,7 +13,7 @@ function formatTranspilers() {
13
13
  `${pAll} ${bool2Symbol(pThis.available)} ${pThis.name} (${
14
14
  pThis.version
15
15
  })\n`,
16
- ` ${bool2Symbol(true)} javascript (>es1)\n`
16
+ ` ${bool2Symbol(true)} javascript (>es1)\n`,
17
17
  );
18
18
  }
19
19
 
@@ -21,7 +21,7 @@ function formatExtensions(pExtensions) {
21
21
  return pExtensions.reduce(
22
22
  (pAll, pThis) =>
23
23
  `${pAll} ${bool2Symbol(pThis.available)} ${pThis.extension}\n`,
24
- ""
24
+ "",
25
25
  );
26
26
  }
27
27
 
@@ -30,7 +30,7 @@ export default function formatMetaInfo() {
30
30
  Supported:
31
31
 
32
32
  If you need a supported, but not enabled transpiler ('${chalk.red(
33
- figures.cross
33
+ figures.cross,
34
34
  )}' below), just install
35
35
  it in the same folder dependency-cruiser is installed. E.g. 'npm i livescript'
36
36
  will enable livescript support if it's installed in your project folder.
@@ -1,7 +1,7 @@
1
- import _format from "../main/format.mjs";
2
1
  import assertFileExistence from "./utl/assert-file-existence.mjs";
3
2
  import normalizeOptions from "./normalize-cli-options.mjs";
4
3
  import { getInStream, write } from "./utl/io.mjs";
4
+ import _format from "#main/format.mjs";
5
5
 
6
6
  /**
7
7
  *
package/src/cli/index.mjs CHANGED
@@ -4,15 +4,14 @@ import set from "lodash/set.js";
4
4
  import isInstalledGlobally from "is-installed-globally";
5
5
  import chalk from "chalk";
6
6
 
7
- import cruise from "../main/cruise.mjs";
8
- import { INFO, bus } from "../utl/bus.mjs";
9
-
10
7
  import assertFileExistence from "./utl/assert-file-existence.mjs";
11
8
  import normalizeCliOptions from "./normalize-cli-options.mjs";
12
9
  import { write } from "./utl/io.mjs";
13
10
  import setUpCliFeedbackListener from "./listeners/cli-feedback.mjs";
14
11
  import setUpPerformanceLogListener from "./listeners/performance-log/index.mjs";
15
12
  import setUpNDJSONListener from "./listeners/ndjson.mjs";
13
+ import cruise from "#main/cruise.mjs";
14
+ import { INFO, bus } from "#utl/bus.mjs";
16
15
 
17
16
  async function extractResolveOptions(pCruiseOptions) {
18
17
  let lResolveOptions = {};
@@ -21,7 +20,7 @@ async function extractResolveOptions(pCruiseOptions) {
21
20
 
22
21
  if (lWebPackConfigFileName) {
23
22
  const { default: extractWebpackResolveConfig } = await import(
24
- "../config-utl/extract-webpack-resolve-config.mjs"
23
+ "#config-utl/extract-webpack-resolve-config.mjs"
25
24
  );
26
25
  lResolveOptions = await extractWebpackResolveConfig(
27
26
  lWebPackConfigFileName,
@@ -35,7 +34,7 @@ async function extractResolveOptions(pCruiseOptions) {
35
34
  async function addKnownViolations(pCruiseOptions) {
36
35
  if (pCruiseOptions.knownViolationsFile) {
37
36
  const { default: extractKnownViolations } = await import(
38
- "../config-utl/extract-known-violations.mjs"
37
+ "#config-utl/extract-known-violations.mjs"
39
38
  );
40
39
  const lKnownViolations = await extractKnownViolations(
41
40
  pCruiseOptions.knownViolationsFile,
@@ -57,7 +56,7 @@ async function extractTSConfigOptions(pCruiseOptions) {
57
56
 
58
57
  if (lTSConfigFileName) {
59
58
  const { default: extractTSConfig } = await import(
60
- "../config-utl/extract-ts-config.mjs"
59
+ "#config-utl/extract-ts-config.mjs"
61
60
  );
62
61
  lReturnValue = extractTSConfig(lTSConfigFileName);
63
62
  }
@@ -71,7 +70,7 @@ async function extractBabelConfigOptions(pCruiseOptions) {
71
70
  pCruiseOptions?.ruleSet?.options?.babelConfig?.fileName ?? null;
72
71
  if (lBabelConfigFileName) {
73
72
  const { default: extractBabelConfig } = await import(
74
- "../config-utl/extract-babel-config.mjs"
73
+ "#config-utl/extract-babel-config.mjs"
75
74
  );
76
75
  lReturnValue = extractBabelConfig(lBabelConfigFileName);
77
76
  }
@@ -1,8 +1,11 @@
1
1
  // @ts-check
2
2
  /* eslint-disable security/detect-object-injection */
3
- import getExtension from "../../utl/get-extension.mjs";
4
- import { scannableExtensions } from "../../extract/transpile/meta.mjs";
5
- import findAllFiles from "../../utl/find-all-files.mjs";
3
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
4
+ import { scannableExtensions } from "#extract/transpile/meta.mjs";
5
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
6
+ import getExtension from "#utl/get-extension.mjs";
7
+ // @ts-expect-error ts(2307) - the ts compiler is not privy to the existence of #imports in package.json
8
+ import findAllFiles from "#utl/find-all-files.mjs";
6
9
 
7
10
  /**
8
11
  * @param {Record<string,number>} pAll
@@ -42,7 +45,7 @@ export default function findExtensions(pDirectories, pOptions) {
42
45
  ignoreFileContents: lOptions?.ignoreFileContents,
43
46
  })
44
47
  .map(getExtension)
45
- .filter(Boolean)
48
+ .filter(Boolean),
46
49
  )
47
50
  .reduce(reduceToCounts, {});
48
51
 
@@ -1,5 +1,4 @@
1
1
  import has from "lodash/has.js";
2
- import meta from "../../meta.js";
3
2
  import {
4
3
  getSourceFolderCandidates,
5
4
  getTestFolderCandidates,
@@ -7,6 +6,7 @@ import {
7
6
  toSourceLocationArray,
8
7
  } from "./environment-helpers.mjs";
9
8
  import findExtensions from "./find-extensions.mjs";
9
+ import meta from "#meta.js";
10
10
 
11
11
  /**
12
12
  * @param {import("./types.js").IInitConfig} pInitOptions
@@ -2,10 +2,10 @@
2
2
  import { writeFileSync } from "node:fs";
3
3
  import figures from "figures";
4
4
  import chalk from "chalk";
5
- import wrapAndIndent from "../../utl/wrap-and-indent.mjs";
6
5
  import { PACKAGE_MANIFEST as _PACKAGE_MANIFEST } from "../defaults.mjs";
7
6
  import { readManifest } from "./environment-helpers.mjs";
8
7
  import { folderNameArrayToRE } from "./utl.mjs";
8
+ import wrapAndIndent from "#utl/wrap-and-indent.mjs";
9
9
 
10
10
  const PACKAGE_MANIFEST = `./${_PACKAGE_MANIFEST}`;
11
11
 
@@ -1,6 +1,6 @@
1
1
  import chalk from "chalk";
2
2
  import figures from "figures";
3
- import { SUMMARY } from "../../utl/bus.mjs";
3
+ import { SUMMARY } from "#utl/bus.mjs";
4
4
 
5
5
  const FULL_ON = 100;
6
6
 
@@ -19,7 +19,7 @@ function getPercentageBar(pPercentage, pParameters) {
19
19
  const lBlanks = lParameters.barSize - lBlocks;
20
20
 
21
21
  return `${chalk.green(lParameters.block.repeat(lBlocks))}${chalk.green(
22
- lParameters.blank.repeat(lBlanks)
22
+ lParameters.blank.repeat(lBlanks),
23
23
  )} ${Math.round(FULL_ON * lPercentage)}%`;
24
24
  }
25
25
 
@@ -36,7 +36,7 @@ function getProgressMessageWriter(pStream, pState, pMaxLogLevel) {
36
36
  if (pStream.isTTY && lOptions.level <= pMaxLogLevel) {
37
37
  pStream.clearLine(1);
38
38
  pStream.write(
39
- ` ${getPercentageBar(lOptions.complete)} ${pMessage} ...\n`
39
+ ` ${getPercentageBar(lOptions.complete)} ${pMessage} ...\n`,
40
40
  );
41
41
  pStream.moveCursor(0, -1);
42
42
  }
@@ -57,14 +57,14 @@ function getStartWriter(pStream) {
57
57
  export default function setUpCliFeedbackListener(
58
58
  pEventEmitter,
59
59
  pMaxLogLevel = SUMMARY,
60
- pStream = process.stderr
60
+ pStream = process.stderr,
61
61
  ) {
62
62
  const lState = {
63
63
  complete: 0,
64
64
  };
65
65
  pEventEmitter.on(
66
66
  "progress",
67
- getProgressMessageWriter(pStream, lState, pMaxLogLevel)
67
+ getProgressMessageWriter(pStream, lState, pMaxLogLevel),
68
68
  );
69
69
 
70
70
  pEventEmitter.on("write-start", getStartWriter(pStream));
@@ -1,5 +1,5 @@
1
1
  import { EOL } from "node:os";
2
- import { INFO, SUMMARY } from "../../utl/bus.mjs";
2
+ import { INFO, SUMMARY } from "#utl/bus.mjs";
3
3
 
4
4
  const MICRO_SECONDS_PER_SECOND = 1000000;
5
5
 
@@ -72,7 +72,7 @@ function getProgressWriter(pStream, pState, pMaxLevel) {
72
72
  export default function setUpNDJSONListener(
73
73
  pEventEmitter,
74
74
  pMaxLevel = INFO,
75
- pStream = process.stderr
75
+ pStream = process.stderr,
76
76
  ) {
77
77
  let lState = {
78
78
  runStartTime: new Date(Date.now()).toISOString(),
@@ -1,6 +1,5 @@
1
-
2
1
  import chalk from "chalk";
3
- import { INFO } from "../../../utl/bus.mjs";
2
+ import { INFO } from "#utl/bus.mjs";
4
3
 
5
4
  const MS_PER_SECOND = 1000;
6
5
  const MS_PER_MICRO_SECOND = 0.001;
@@ -39,7 +38,7 @@ export function formatDividerLine() {
39
38
  const lMessageColumnHDivider = "-".repeat(MAX_EXPECTED_MESSAGE_LENGTH);
40
39
 
41
40
  return `${`${lNumberColumnDivider} `.repeat(
42
- NUMBER_OF_COLUMNS - 1
41
+ NUMBER_OF_COLUMNS - 1,
43
42
  )}${lMessageColumnHDivider}\n`;
44
43
  }
45
44
 
@@ -54,7 +53,7 @@ export function formatHeader() {
54
53
  pad("⏱ system") +
55
54
  pad("⏱ user") +
56
55
  pad("⏱ real")
57
- }after step...\n`
56
+ }after step...\n`,
58
57
  )
59
58
  .concat(formatDividerLine());
60
59
  }
@@ -66,24 +65,24 @@ function formatMessage(pMessage, pLevel) {
66
65
  export function formatTime(
67
66
  pNumber,
68
67
  pConversionMultiplier = MS_PER_SECOND,
69
- pLevel
68
+ pLevel,
70
69
  ) {
71
70
  return formatMessage(
72
71
  gTimeFormat(pConversionMultiplier * pNumber)
73
72
  .padStart(MAX_EXPECTED_METRIC_LENGTH)
74
73
  .concat(" "),
75
- pLevel
74
+ pLevel,
76
75
  );
77
76
  }
78
77
 
79
78
  export function formatMemory(pBytes, pLevel) {
80
79
  const lReturnValue = gSizeFormat(pBytes / K).padStart(
81
- MAX_EXPECTED_METRIC_LENGTH
80
+ MAX_EXPECTED_METRIC_LENGTH,
82
81
  );
83
82
 
84
83
  return formatMessage(
85
84
  (pBytes < 0 ? chalk.blue(lReturnValue) : lReturnValue).concat(" "),
86
- pLevel
85
+ pLevel,
87
86
  );
88
87
  }
89
88
 
@@ -1,5 +1,5 @@
1
- import { INFO, SUMMARY } from "../../../utl/bus.mjs";
2
1
  import { getHeader, getProgressLine, getEndText } from "./handlers.mjs";
2
+ import { INFO, SUMMARY } from "#utl/bus.mjs";
3
3
 
4
4
  function getHeaderWriter(pStream, pMaxLevel) {
5
5
  return (_pMessage, pOptions) => {
@@ -16,7 +16,7 @@ function getProgressWriter(pStream, pState, pMaxLevel) {
16
16
  pMessage,
17
17
  pState,
18
18
  lOptions.level,
19
- pMaxLevel
19
+ pMaxLevel,
20
20
  );
21
21
  pStream.write(lProgressLine);
22
22
  };
@@ -32,7 +32,7 @@ function getEndWriter(pStream, pState, pMaxLevel) {
32
32
  export default function setUpPerformanceLogListener(
33
33
  pEventEmitter,
34
34
  pMaxLevel = INFO,
35
- pStream = process.stderr
35
+ pStream = process.stderr,
36
36
  ) {
37
37
  let lState = {
38
38
  previousMessage: "nodejs starting",
@@ -3,7 +3,6 @@ import { isAbsolute } from "node:path";
3
3
  import set from "lodash/set.js";
4
4
  import get from "lodash/get.js";
5
5
  import has from "lodash/has.js";
6
- import loadConfig from "../config-utl/extract-depcruise-config/index.mjs";
7
6
  import {
8
7
  RULES_FILE_NAME_SEARCH_ARRAY,
9
8
  DEFAULT_BASELINE_FILE_NAME,
@@ -14,6 +13,7 @@ import {
14
13
  BABEL_CONFIG,
15
14
  OLD_DEFAULT_RULES_FILE_NAME,
16
15
  } from "./defaults.mjs";
16
+ import loadConfig from "#config-utl/extract-depcruise-config/index.mjs";
17
17
 
18
18
  function getOptionValue(pDefault) {
19
19
  return (pValue) => (typeof pValue === "string" ? pValue : pDefault);