dependency-cruiser 11.14.1 → 11.14.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-cruiser",
3
- "version": "11.14.1",
3
+ "version": "11.14.2",
4
4
  "description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
5
5
  "keywords": [
6
6
  "static analysis",
@@ -152,32 +152,33 @@
152
152
  "glob": "7.2.0",
153
153
  "handlebars": "4.7.7",
154
154
  "indent-string": "^4.0.0",
155
- "inquirer": "^8.2.4",
156
155
  "json5": "2.2.1",
157
156
  "lodash": "4.17.21",
157
+ "prompts": "2.4.2",
158
158
  "safe-regex": "2.1.1",
159
159
  "semver": "^7.3.7",
160
160
  "semver-try-require": "^5.0.2",
161
161
  "teamcity-service-messages": "0.1.14",
162
162
  "tsconfig-paths-webpack-plugin": "4.0.0",
163
- "watskeburt": "0.6.0",
163
+ "watskeburt": "0.7.0",
164
164
  "wrap-ansi": "^7.0.0"
165
165
  },
166
166
  "devDependencies": {
167
- "@babel/core": "7.18.9",
167
+ "@babel/core": "7.18.10",
168
168
  "@babel/plugin-transform-modules-commonjs": "7.18.6",
169
169
  "@babel/preset-typescript": "7.18.6",
170
- "@swc/core": "1.2.220",
170
+ "@swc/core": "1.2.231",
171
171
  "@types/lodash": "4.14.182",
172
- "@types/node": "18.6.2",
173
- "@typescript-eslint/eslint-plugin": "5.31.0",
174
- "@typescript-eslint/parser": "5.31.0",
172
+ "@types/node": "18.7.3",
173
+ "@types/prompts": "2.0.14",
174
+ "@typescript-eslint/eslint-plugin": "5.33.0",
175
+ "@typescript-eslint/parser": "5.33.0",
175
176
  "@vue/compiler-sfc": "3.2.37",
176
177
  "c8": "7.12.0",
177
178
  "chai": "4.3.6",
178
179
  "chai-json-schema": "1.5.1",
179
180
  "coffeescript": "2.7.0",
180
- "eslint": "^8.20.0",
181
+ "eslint": "8.22.0",
181
182
  "eslint-config-moving-meadow": "3.0.0",
182
183
  "eslint-config-prettier": "8.5.0",
183
184
  "eslint-plugin-budapestian": "4.0.0",
@@ -198,7 +199,7 @@
198
199
  "svelte": "3.49.0",
199
200
  "symlink-dir": "5.0.1",
200
201
  "typescript": "4.7.4",
201
- "upem": "^7.0.0",
202
+ "upem": "7.0.2",
202
203
  "vue-template-compiler": "2.7.8",
203
204
  "yarn": "1.22.19"
204
205
  },
@@ -224,11 +225,6 @@
224
225
  "policy": "wanted",
225
226
  "because": "https://github.com/typicode/husky/issues/822"
226
227
  },
227
- {
228
- "package": "inquirer",
229
- "policy": "wanted",
230
- "because": "version 9 only exports ejs - and we use cjs and don't transpile"
231
- },
232
228
  {
233
229
  "package": "indent-string",
234
230
  "policy": "wanted",
@@ -1,141 +1,141 @@
1
- const inquirer = require("inquirer");
1
+ const prompts = require("prompts");
2
2
  const {
3
+ isLikelyMonoRepo,
4
+ getMonoRepoPackagesCandidates,
3
5
  getSourceFolderCandidates,
4
6
  getTestFolderCandidates,
5
- hasBabelConfigCandidates,
6
- getBabelConfigCandidates,
7
7
  hasJSConfigCandidates,
8
- getJSConfigCandidates,
9
8
  hasTSConfigCandidates,
9
+ hasTestsWithinSource,
10
+ toSourceLocationArray,
11
+ getJSConfigCandidates,
10
12
  getTSConfigCandidates,
13
+ hasBabelConfigCandidates,
14
+ getBabelConfigCandidates,
11
15
  hasWebpackConfigCandidates,
12
16
  getWebpackConfigCandidates,
13
- getMonoRepoPackagesCandidates,
14
- hasTestsWithinSource,
15
- isLikelyMonoRepo,
16
- toSourceLocationArray,
17
17
  } = require("./environment-helpers");
18
18
  const { validateLocation } = require("./inquirer-validators");
19
19
 
20
- const INQUIRER_QUESTIONS = [
20
+ function toPromptChoice(pString) {
21
+ return {
22
+ title: pString,
23
+ value: pString,
24
+ };
25
+ }
26
+
27
+ /** @type {import('@types/prompts').PromptObject[]} */
28
+ const QUESTIONS = [
21
29
  {
22
30
  name: "isMonoRepo",
23
- type: "confirm",
24
- message: "This looks like a mono repo. Is that correct?",
25
- default: isLikelyMonoRepo(),
26
- when: () => isLikelyMonoRepo(),
31
+ type: () => (isLikelyMonoRepo() ? "confirm" : false),
32
+ message: "This looks like mono repo. Is that correct?",
33
+ initial: isLikelyMonoRepo(),
27
34
  },
28
35
  {
29
36
  name: "sourceLocation",
30
- type: "input",
37
+ type: (_, pAnswers) => (pAnswers.isMonoRepo ? "text" : false),
31
38
  message: "Mono repo it is! Where do your packages live?",
32
- default: getMonoRepoPackagesCandidates(),
39
+ initial: getMonoRepoPackagesCandidates(),
33
40
  validate: validateLocation,
34
- when: (pAnswers) => pAnswers.isMonoRepo,
35
41
  },
36
42
  {
37
43
  name: "combinedDependencies",
38
- type: "confirm",
44
+ type: (_, pAnswers) => (pAnswers.isMonoRepo ? "confirm" : false),
39
45
  message:
40
46
  "Do your packages use dependencies declared in the root of your repo?",
41
- default: false,
42
- when: (pAnswers) => pAnswers.isMonoRepo,
47
+ initial: false,
43
48
  },
44
49
  {
45
50
  name: "sourceLocation",
46
- type: "input",
51
+ type: (_, pAnswers) => (pAnswers.isMonoRepo ? false : "text"),
47
52
  message: "Where do your source files live?",
48
- default: getSourceFolderCandidates(),
53
+ initial: getSourceFolderCandidates(),
49
54
  validate: validateLocation,
50
- when: (pAnswers) => !pAnswers.isMonoRepo,
51
55
  },
52
56
  {
53
57
  name: "hasTestsOutsideSource",
54
- type: "confirm",
58
+ type: (_, pAnswers) => (pAnswers.isMonoRepo ? false : "confirm"),
55
59
  message: "Do your test files live in a separate folder?",
56
- default: (pAnswers) => {
60
+ initial: (_, pAnswers) => {
57
61
  return !hasTestsWithinSource(
58
62
  getTestFolderCandidates(),
59
63
  toSourceLocationArray(pAnswers.sourceLocation)
60
64
  );
61
65
  },
62
- when: (pAnswers) => !pAnswers.isMonoRepo,
63
66
  },
64
67
  {
65
68
  name: "testLocation",
66
- type: "input",
69
+ type: (_, pAnswers) =>
70
+ pAnswers.hasTestsOutsideSource && !pAnswers.isMonoRepo ? "text" : false,
67
71
  message: "Where do your test files live?",
68
- default: getTestFolderCandidates(),
72
+ initial: getTestFolderCandidates(),
69
73
  validate: validateLocation,
70
- when: (pAnswers) => pAnswers.hasTestsOutsideSource && !pAnswers.isMonoRepo,
71
74
  },
72
75
  {
73
76
  name: "useJsConfig",
74
- type: "confirm",
77
+ type: () =>
78
+ hasJSConfigCandidates() && !hasTSConfigCandidates() ? "confirm" : false,
75
79
  message: "Looks like you're using a 'jsconfig.json'. Use that?",
76
- default: true,
77
- when: () => hasJSConfigCandidates() && !hasTSConfigCandidates(),
80
+ initial: true,
78
81
  },
79
82
  {
80
83
  name: "jsConfig",
81
- type: "list",
82
- message: "Full path to your 'jsconfig.json':",
83
- choices: getJSConfigCandidates(),
84
- when: (pAnswers) => pAnswers.useJsConfig,
84
+ type: (_, pAnswers) => (pAnswers.useJsConfig ? "select" : false),
85
+ message: "Full path to your 'jsconfig.json",
86
+ choices: getJSConfigCandidates().map((pCandidate) => ({
87
+ title: pCandidate,
88
+ value: pCandidate,
89
+ })),
85
90
  },
86
91
  {
87
92
  name: "useTsConfig",
88
- type: "confirm",
89
- message: "Looks like you're using TypeScript. Use a 'tsconfig.json'?",
90
- default: true,
91
- when: () => hasTSConfigCandidates(),
93
+ type: () => (hasTSConfigCandidates() ? "confirm" : false),
94
+ message: "Looks like you're using a 'tsconfig.json'. Use that?",
95
+ initial: true,
92
96
  },
93
97
  {
94
98
  name: "tsConfig",
95
- type: "list",
96
- message: "Full path to your 'tsconfig.json':",
97
- choices: getTSConfigCandidates(),
98
- when: (pAnswers) => pAnswers.useTsConfig,
99
+ type: (_, pAnswers) => (pAnswers.useTsConfig ? "select" : false),
100
+ message: "Full path to your 'tsconfig.json",
101
+ choices: getTSConfigCandidates().map(toPromptChoice),
99
102
  },
100
103
  {
101
104
  name: "tsPreCompilationDeps",
102
- type: "confirm",
105
+ type: (_, pAnswers) => (pAnswers.useTsConfig ? "confirm" : false),
103
106
  message:
104
107
  "Also regard TypeScript dependencies that exist only before compilation?",
105
- when: (pAnswers) => pAnswers.useTsConfig,
108
+ initial: true,
106
109
  },
107
110
  {
108
111
  name: "useBabelConfig",
109
- type: "confirm",
112
+ type: () => (hasBabelConfigCandidates() ? "confirm" : false),
110
113
  message: "Looks like you're using Babel. Use a babel config?",
111
- default: true,
112
- when: () => hasBabelConfigCandidates(),
114
+ initial: true,
113
115
  },
114
116
  {
115
117
  name: "babelConfig",
116
- type: "list",
118
+ type: (_, pAnswers) => (pAnswers.useBabelConfig ? "select" : false),
117
119
  message: "Full path to your babel config:",
118
- choices: getBabelConfigCandidates(),
119
- when: (pAnswers) => pAnswers.useBabelConfig,
120
+ choices: getBabelConfigCandidates().map(toPromptChoice),
120
121
  },
121
122
  {
122
- name: "useWebpackConfig",
123
- type: "confirm",
123
+ name: "useWebPackConfig",
124
+ type: () => (hasWebpackConfigCandidates() ? "confirm" : false),
124
125
  message: "Looks like you're using webpack - specify a webpack config?",
125
- default: true,
126
- when: () => hasWebpackConfigCandidates(),
126
+ initial: true,
127
127
  },
128
128
  {
129
129
  name: "webpackConfig",
130
- type: "list",
130
+ type: (_, pAnswers) => (pAnswers.useWebpackConfig ? "select" : false),
131
131
  message: "Full path to your webpack config:",
132
- choices: getWebpackConfigCandidates(),
133
- when: (pAnswers) => pAnswers.useWebpackConfig,
132
+ choices: getWebpackConfigCandidates().map(toPromptChoice),
134
133
  },
135
134
  ];
135
+
136
136
  /**
137
137
  * @return {Promise<import("../../../types/init-config").IPartialInitConfig>}
138
138
  */
139
139
  module.exports = function getUserInput() {
140
- return inquirer.prompt(INQUIRER_QUESTIONS);
140
+ return prompts(QUESTIONS);
141
141
  };
package/src/meta.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* generated - don't edit */
2
2
 
3
3
  module.exports = {
4
- version: "11.14.1",
4
+ version: "11.14.2",
5
5
  engines: {
6
6
  node: "^12.20||^14||>=16",
7
7
  },