dependency-cruiser 15.3.1-beta-2 → 15.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-cruiser",
3
- "version": "15.3.1-beta-2",
3
+ "version": "15.4.0",
4
4
  "description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
5
5
  "keywords": [
6
6
  "static analysis",
@@ -163,7 +163,7 @@
163
163
  "commander": "11.1.0",
164
164
  "enhanced-resolve": "5.15.0",
165
165
  "figures": "6.0.1",
166
- "ignore": "5.2.4",
166
+ "ignore": "5.3.0",
167
167
  "indent-string": "5.0.0",
168
168
  "interpret": "^3.1.1",
169
169
  "is-installed-globally": "1.0.0",
@@ -177,23 +177,23 @@
177
177
  "semver-try-require": "6.2.3",
178
178
  "teamcity-service-messages": "0.1.14",
179
179
  "tsconfig-paths-webpack-plugin": "4.1.0",
180
- "watskeburt": "2.0.1",
180
+ "watskeburt": "2.0.2",
181
181
  "wrap-ansi": "9.0.0"
182
182
  },
183
183
  "devDependencies": {
184
184
  "@babel/core": "7.23.3",
185
185
  "@babel/plugin-transform-modules-commonjs": "7.23.3",
186
186
  "@babel/preset-typescript": "7.23.3",
187
- "@swc/core": "1.3.96",
188
- "@types/lodash": "4.14.201",
189
- "@types/node": "20.9.0",
190
- "@types/prompts": "2.4.8",
191
- "@typescript-eslint/eslint-plugin": "6.10.0",
192
- "@typescript-eslint/parser": "6.10.0",
187
+ "@swc/core": "1.3.99",
188
+ "@types/lodash": "4.14.202",
189
+ "@types/node": "20.9.3",
190
+ "@types/prompts": "2.4.9",
191
+ "@typescript-eslint/eslint-plugin": "6.12.0",
192
+ "@typescript-eslint/parser": "6.12.0",
193
193
  "@vue/compiler-sfc": "3.3.8",
194
194
  "c8": "8.0.1",
195
195
  "coffeescript": "2.7.0",
196
- "eslint": "8.53.0",
196
+ "eslint": "8.54.0",
197
197
  "eslint-config-moving-meadow": "4.0.2",
198
198
  "eslint-config-prettier": "9.0.0",
199
199
  "eslint-plugin-budapestian": "6.0.0",
@@ -209,15 +209,15 @@
209
209
  "mocha": "10.2.0",
210
210
  "normalize-newline": "4.1.0",
211
211
  "npm-run-all": "4.1.5",
212
- "prettier": "3.0.3",
212
+ "prettier": "3.1.0",
213
213
  "proxyquire": "2.1.3",
214
214
  "shx": "0.3.4",
215
215
  "svelte": "3.59.1",
216
216
  "symlink-dir": "5.2.0",
217
- "typescript": "5.2.2",
217
+ "typescript": "5.3.2",
218
218
  "upem": "9.0.2",
219
219
  "vue-template-compiler": "2.7.15",
220
- "yarn": "1.22.19"
220
+ "yarn": "1.22.21"
221
221
  },
222
222
  "overrides": {
223
223
  "semver": "^7.5.4",
@@ -25,10 +25,10 @@ module.exports = {
25
25
  from: {
26
26
  orphan: true,
27
27
  pathNot: [
28
- '(^|/)\\.[^/]+\\.(js|cjs|mjs|ts|json)$', // dot files
29
- '\\.d\\.ts$', // TypeScript declaration files
30
- '(^|/)tsconfig\\.json$', // TypeScript config
31
- '(^|/)(babel|webpack)\\.config\\.(js|cjs|mjs|ts|json)$' // other configs
28
+ '(^|/)[.][^/]+[.](js|cjs|mjs|ts|json)$', // dot files
29
+ '[.]d[.]ts$', // TypeScript declaration files
30
+ '(^|/)tsconfig[.]json$', // TypeScript config
31
+ '(^|/)(babel|webpack)[.]config[.](js|cjs|mjs|ts|json)$' // other configs
32
32
  ]
33
33
  },
34
34
  to: {},
@@ -136,7 +136,7 @@ module.exports = {
136
136
  severity: 'error',
137
137
  from: {},
138
138
  to: {
139
- path: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
139
+ path: '[.](spec|test)[.](js|mjs|cjs|ts|ls|coffee|litcoffee|coffee[.]md)$'
140
140
  }
141
141
  },
142
142
  {
@@ -150,7 +150,7 @@ module.exports = {
150
150
  'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration',
151
151
  from: {
152
152
  path: '{{sourceLocationRE}}',
153
- pathNot: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
153
+ pathNot: '[.](spec|test)[.](js|mjs|cjs|ts|ls|coffee|litcoffee|coffee[.]md)$'
154
154
  },
155
155
  to: {
156
156
  dependencyTypes: [
@@ -24,12 +24,12 @@ function mergeDependencyArray(pClosestDependencyKey, pFurtherDependencyKey) {
24
24
  return uniq(pClosestDependencyKey.concat(pFurtherDependencyKey));
25
25
  }
26
26
 
27
- function isInterestingKey(pKey) {
28
- return pKey.endsWith("ependencies") || pKey === "workspaces";
27
+ function isDependencyKey(pKey) {
28
+ return pKey.endsWith("ependencies");
29
29
  }
30
30
 
31
31
  function getDependencyKeys(pPackage) {
32
- return Object.keys(pPackage).filter(isInterestingKey);
32
+ return Object.keys(pPackage).filter(isDependencyKey);
33
33
  }
34
34
 
35
35
  function getJointUniqueDependencyKeys(pClosestPackage, pFurtherPackage) {
@@ -40,10 +40,6 @@ function getJointUniqueDependencyKeys(pClosestPackage, pFurtherPackage) {
40
40
  );
41
41
  }
42
42
 
43
- function isAnArrayKey(pKey) {
44
- return pKey.startsWith("bundle") || pKey === "workspaces";
45
- }
46
-
47
43
  /**
48
44
  * returns an object with
49
45
  * - the *dependencies keys from both passed packages
@@ -67,7 +63,7 @@ export default function mergeManifests(pClosestManifest, pFurtherManifest) {
67
63
  )
68
64
  .map((pKey) => ({
69
65
  key: pKey,
70
- value: isAnArrayKey(pKey)
66
+ value: pKey.startsWith("bundle")
71
67
  ? mergeDependencyArray(
72
68
  pClosestManifest?.[pKey] ?? [],
73
69
  pFurtherManifest?.[pKey] ?? [],
@@ -216,20 +216,12 @@ export function getAliasTypes(
216
216
  pResolveOptions,
217
217
  pManifest,
218
218
  ) {
219
- if (isRelativeModuleName(pModuleName)) {
220
- return [];
219
+ if (isSubpathImport(pModuleName, pManifest)) {
220
+ return ["aliased", "aliased-subpath-import"];
221
221
  }
222
222
  if (isWebPackAliased(pModuleName, pResolveOptions.alias)) {
223
223
  return ["aliased", "aliased-webpack"];
224
224
  }
225
- // the order of these ifs is deliberate - node native stuff first, then things
226
- // bolted on by bundlers & transpilers. The order of subpath imports and workspaces
227
- // isn't _that_ important, as they can't be confused
228
- // - subpath imports _must_ start with a #
229
- // - workspaces (or actualy: package names) are forbidden to even _contain_ a #
230
- if (isSubpathImport(pModuleName, pManifest)) {
231
- return ["aliased", "aliased-subpath-import"];
232
- }
233
225
  if (isWorkspaceAliased(pModuleName, pResolvedModuleName, pManifest)) {
234
226
  return ["aliased", "aliased-workspace"];
235
227
  }
package/src/meta.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* generated - don't edit */
2
2
 
3
3
  module.exports = {
4
- version: "15.3.1-beta-2",
4
+ version: "15.4.0",
5
5
  engines: {
6
6
  node: "^18.17||>=20",
7
7
  },