@dhzh/eslint-config 1.22.0 → 1.23.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/dist/cli/index.cjs +73 -53
- package/dist/cli/index.js +73 -53
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -23,12 +23,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
|
|
25
25
|
// src/cli/index.ts
|
|
26
|
-
var
|
|
27
|
-
var
|
|
26
|
+
var p6 = __toESM(require("@clack/prompts"), 1);
|
|
27
|
+
var import_ansis6 = __toESM(require("ansis"), 1);
|
|
28
28
|
var import_cac = require("cac");
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
|
-
var version = "1.
|
|
31
|
+
var version = "1.23.0";
|
|
32
32
|
var package_default = {
|
|
33
33
|
name: "@dhzh/eslint-config",
|
|
34
34
|
type: "module",
|
|
@@ -153,15 +153,37 @@ var package_default = {
|
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
// src/cli/run.ts
|
|
156
|
-
var
|
|
157
|
-
var
|
|
156
|
+
var p5 = __toESM(require("@clack/prompts"), 1);
|
|
157
|
+
var import_ansis5 = __toESM(require("ansis"), 1);
|
|
158
158
|
|
|
159
|
-
// src/cli/stages/update-
|
|
159
|
+
// src/cli/stages/update-package-json.ts
|
|
160
160
|
var import_promises = __toESM(require("fs/promises"), 1);
|
|
161
161
|
var import_node_path = __toESM(require("path"), 1);
|
|
162
162
|
var import_node_process = __toESM(require("process"), 1);
|
|
163
|
-
var import_ansis = __toESM(require("ansis"), 1);
|
|
164
163
|
var p = __toESM(require("@clack/prompts"), 1);
|
|
164
|
+
var import_ansis = __toESM(require("ansis"), 1);
|
|
165
|
+
async function updatePackageJson() {
|
|
166
|
+
const cwd = import_node_process.default.cwd();
|
|
167
|
+
const pathPackageJSON = import_node_path.default.join(cwd, "package.json");
|
|
168
|
+
p.log.step(import_ansis.default.cyan`Bumping @dhzh/eslint-config to v${version}`);
|
|
169
|
+
const pkgContent = await import_promises.default.readFile(pathPackageJSON, "utf8");
|
|
170
|
+
const pkg = JSON.parse(pkgContent);
|
|
171
|
+
pkg.devDependencies ??= {};
|
|
172
|
+
pkg.devDependencies["@dhzh/eslint-config"] = `^${version}`;
|
|
173
|
+
pkg.devDependencies.eslint ??= package_default.devDependencies.eslint;
|
|
174
|
+
pkg.scripts ??= {};
|
|
175
|
+
pkg.scripts.lint = "eslint .";
|
|
176
|
+
pkg.scripts["lint-fix"] = "eslint --fix .";
|
|
177
|
+
await import_promises.default.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
|
|
178
|
+
p.log.success(import_ansis.default.green`Changes wrote to package.json`);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// src/cli/stages/update-eslint-config.ts
|
|
182
|
+
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
183
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
184
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
185
|
+
var import_ansis2 = __toESM(require("ansis"), 1);
|
|
186
|
+
var p2 = __toESM(require("@clack/prompts"), 1);
|
|
165
187
|
|
|
166
188
|
// src/cli/constants.ts
|
|
167
189
|
var vscodeSettingsString = `
|
|
@@ -282,67 +304,64 @@ export default defineConfig(${options.hasNest ? `{
|
|
|
282
304
|
},
|
|
283
305
|
}` : ""});
|
|
284
306
|
`;
|
|
307
|
+
var npmignoreString = `# If these files (ESLint flat config files) are not included in .npmignore,
|
|
308
|
+
# they will be published, and importing devDependencies in published files will trigger \`n/no-unpublished-import\` errors.
|
|
309
|
+
eslint.config.js
|
|
310
|
+
eslint.config.mjs
|
|
311
|
+
`;
|
|
285
312
|
|
|
286
313
|
// src/cli/stages/update-eslint-config.ts
|
|
287
314
|
async function updateEslintConfig(options) {
|
|
288
|
-
const cwd = import_node_process.default.cwd();
|
|
289
|
-
const pathPackageJSON = import_node_path.default.join(cwd, "package.json");
|
|
290
|
-
const pkgContent = await import_promises.default.readFile(pathPackageJSON, "utf8");
|
|
291
|
-
const pkg = JSON.parse(pkgContent);
|
|
292
|
-
const configFileName = pkg.type === "module" ? "eslint.config.js" : "eslint.config.mjs";
|
|
293
|
-
const pathFlatConfig = import_node_path.default.join(cwd, configFileName);
|
|
294
|
-
await import_promises.default.writeFile(pathFlatConfig, eslintConfigContent(options));
|
|
295
|
-
p.log.success(import_ansis.default.green`Created ${configFileName}`);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// src/cli/stages/update-package-json.ts
|
|
299
|
-
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
300
|
-
var import_node_path2 = __toESM(require("path"), 1);
|
|
301
|
-
var import_node_process2 = __toESM(require("process"), 1);
|
|
302
|
-
var p2 = __toESM(require("@clack/prompts"), 1);
|
|
303
|
-
var import_ansis2 = __toESM(require("ansis"), 1);
|
|
304
|
-
async function updatePackageJson() {
|
|
305
315
|
const cwd = import_node_process2.default.cwd();
|
|
306
316
|
const pathPackageJSON = import_node_path2.default.join(cwd, "package.json");
|
|
307
|
-
p2.log.step(import_ansis2.default.cyan`Bumping @dhzh/eslint-config to v${version}`);
|
|
308
317
|
const pkgContent = await import_promises2.default.readFile(pathPackageJSON, "utf8");
|
|
309
318
|
const pkg = JSON.parse(pkgContent);
|
|
310
|
-
pkg.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
pkg.scripts.lint = "eslint .";
|
|
315
|
-
pkg.scripts["lint-fix"] = "eslint --fix .";
|
|
316
|
-
await import_promises2.default.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
|
|
317
|
-
p2.log.success(import_ansis2.default.green`Changes wrote to package.json`);
|
|
319
|
+
const configFileName = pkg.type === "module" ? "eslint.config.js" : "eslint.config.mjs";
|
|
320
|
+
const pathFlatConfig = import_node_path2.default.join(cwd, configFileName);
|
|
321
|
+
await import_promises2.default.writeFile(pathFlatConfig, eslintConfigContent(options));
|
|
322
|
+
p2.log.success(import_ansis2.default.green`Created ${configFileName}`);
|
|
318
323
|
}
|
|
319
324
|
|
|
320
|
-
// src/cli/stages/update-
|
|
321
|
-
var import_node_fs = __toESM(require("fs"), 1);
|
|
325
|
+
// src/cli/stages/update-npmignore.ts
|
|
322
326
|
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
323
327
|
var import_node_path3 = __toESM(require("path"), 1);
|
|
324
328
|
var import_node_process3 = __toESM(require("process"), 1);
|
|
325
|
-
var import_ansis3 = require("ansis");
|
|
329
|
+
var import_ansis3 = __toESM(require("ansis"), 1);
|
|
326
330
|
var p3 = __toESM(require("@clack/prompts"), 1);
|
|
327
|
-
async function
|
|
331
|
+
async function updateNpmignore() {
|
|
328
332
|
const cwd = import_node_process3.default.cwd();
|
|
329
|
-
const
|
|
330
|
-
const
|
|
333
|
+
const npmignoreFileName = ".npmignore";
|
|
334
|
+
const npmignoreFilePath = import_node_path3.default.join(cwd, npmignoreFileName);
|
|
335
|
+
await import_promises3.default.writeFile(npmignoreFilePath, npmignoreString);
|
|
336
|
+
p3.log.success(import_ansis3.default.green`Created ${npmignoreFileName}`);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// src/cli/stages/update-vscode-settings.ts
|
|
340
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
341
|
+
var import_promises4 = __toESM(require("fs/promises"), 1);
|
|
342
|
+
var import_node_path4 = __toESM(require("path"), 1);
|
|
343
|
+
var import_node_process4 = __toESM(require("process"), 1);
|
|
344
|
+
var import_ansis4 = require("ansis");
|
|
345
|
+
var p4 = __toESM(require("@clack/prompts"), 1);
|
|
346
|
+
async function updateVscodeSettings() {
|
|
347
|
+
const cwd = import_node_process4.default.cwd();
|
|
348
|
+
const dotVscodePath = import_node_path4.default.join(cwd, ".vscode");
|
|
349
|
+
const settingsPath = import_node_path4.default.join(dotVscodePath, "settings.json");
|
|
331
350
|
if (!import_node_fs.default.existsSync(dotVscodePath)) {
|
|
332
|
-
await
|
|
351
|
+
await import_promises4.default.mkdir(dotVscodePath, { recursive: true });
|
|
333
352
|
}
|
|
334
353
|
if (import_node_fs.default.existsSync(settingsPath)) {
|
|
335
|
-
let settingsContent = await
|
|
354
|
+
let settingsContent = await import_promises4.default.readFile(settingsPath, "utf8");
|
|
336
355
|
settingsContent = settingsContent.trim().replace(/\s*\}$/, "");
|
|
337
356
|
settingsContent += settingsContent.endsWith(",") || settingsContent.endsWith("{") ? "" : ",";
|
|
338
357
|
settingsContent += `${vscodeSettingsString}}
|
|
339
358
|
`;
|
|
340
|
-
await
|
|
341
|
-
|
|
359
|
+
await import_promises4.default.writeFile(settingsPath, settingsContent, "utf8");
|
|
360
|
+
p4.log.success(import_ansis4.green`Updated .vscode/settings.json`);
|
|
342
361
|
} else {
|
|
343
|
-
await
|
|
362
|
+
await import_promises4.default.writeFile(settingsPath, `{${vscodeSettingsString}}
|
|
344
363
|
`, "utf8");
|
|
345
|
-
|
|
364
|
+
p4.log.success(import_ansis4.green`Created .vscode/settings.json`);
|
|
346
365
|
}
|
|
347
366
|
}
|
|
348
367
|
|
|
@@ -350,9 +369,10 @@ async function updateVscodeSettings() {
|
|
|
350
369
|
async function run(options) {
|
|
351
370
|
await updatePackageJson();
|
|
352
371
|
await updateEslintConfig(options);
|
|
372
|
+
await updateNpmignore();
|
|
353
373
|
await updateVscodeSettings();
|
|
354
|
-
|
|
355
|
-
|
|
374
|
+
p5.log.success(import_ansis5.default.green`Setup completed`);
|
|
375
|
+
p5.outro(`Now you can update the dependencies by run ${import_ansis5.default.blue("pnpm i")} and run ${import_ansis5.default.blue("eslint --fix")}
|
|
356
376
|
`);
|
|
357
377
|
}
|
|
358
378
|
|
|
@@ -360,16 +380,16 @@ async function run(options) {
|
|
|
360
380
|
var cli = (0, import_cac.cac)("@dhzh/eslint-config");
|
|
361
381
|
cli.command("", "Run the initialization or migration").action(async () => {
|
|
362
382
|
console.log("\n");
|
|
363
|
-
|
|
383
|
+
p6.intro(`${import_ansis6.default.green`@dhzh/eslint-config `}${import_ansis6.default.dim`v${version}`}`);
|
|
364
384
|
const options = {
|
|
365
385
|
hasNest: false
|
|
366
386
|
};
|
|
367
|
-
const hasNest = await
|
|
387
|
+
const hasNest = await p6.confirm({
|
|
368
388
|
message: "Is NestJS a part of the current project?",
|
|
369
389
|
initialValue: false
|
|
370
390
|
});
|
|
371
|
-
if (
|
|
372
|
-
|
|
391
|
+
if (p6.isCancel(hasNest)) {
|
|
392
|
+
p6.cancel("Operation cancelled");
|
|
373
393
|
throw new Error("Operation cancelled");
|
|
374
394
|
} else {
|
|
375
395
|
options.hasNest = hasNest;
|
|
@@ -377,8 +397,8 @@ cli.command("", "Run the initialization or migration").action(async () => {
|
|
|
377
397
|
try {
|
|
378
398
|
await run(options);
|
|
379
399
|
} catch (error) {
|
|
380
|
-
|
|
381
|
-
|
|
400
|
+
p6.log.error(import_ansis6.default.inverse.red(" Failed to migrate "));
|
|
401
|
+
p6.log.error(import_ansis6.default.red`✘ ${String(error)}`);
|
|
382
402
|
throw error;
|
|
383
403
|
}
|
|
384
404
|
});
|
package/dist/cli/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/cli/index.ts
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as p6 from "@clack/prompts";
|
|
3
|
+
import c5 from "ansis";
|
|
4
4
|
import { cac } from "cac";
|
|
5
5
|
|
|
6
6
|
// package.json
|
|
7
|
-
var version = "1.
|
|
7
|
+
var version = "1.23.0";
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@dhzh/eslint-config",
|
|
10
10
|
type: "module",
|
|
@@ -129,15 +129,37 @@ var package_default = {
|
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
// src/cli/run.ts
|
|
132
|
-
import * as
|
|
133
|
-
import
|
|
132
|
+
import * as p5 from "@clack/prompts";
|
|
133
|
+
import c4 from "ansis";
|
|
134
134
|
|
|
135
|
-
// src/cli/stages/update-
|
|
135
|
+
// src/cli/stages/update-package-json.ts
|
|
136
136
|
import fsp from "fs/promises";
|
|
137
137
|
import path from "path";
|
|
138
138
|
import process from "process";
|
|
139
|
-
import c from "ansis";
|
|
140
139
|
import * as p from "@clack/prompts";
|
|
140
|
+
import c from "ansis";
|
|
141
|
+
async function updatePackageJson() {
|
|
142
|
+
const cwd = process.cwd();
|
|
143
|
+
const pathPackageJSON = path.join(cwd, "package.json");
|
|
144
|
+
p.log.step(c.cyan`Bumping @dhzh/eslint-config to v${version}`);
|
|
145
|
+
const pkgContent = await fsp.readFile(pathPackageJSON, "utf8");
|
|
146
|
+
const pkg = JSON.parse(pkgContent);
|
|
147
|
+
pkg.devDependencies ??= {};
|
|
148
|
+
pkg.devDependencies["@dhzh/eslint-config"] = `^${version}`;
|
|
149
|
+
pkg.devDependencies.eslint ??= package_default.devDependencies.eslint;
|
|
150
|
+
pkg.scripts ??= {};
|
|
151
|
+
pkg.scripts.lint = "eslint .";
|
|
152
|
+
pkg.scripts["lint-fix"] = "eslint --fix .";
|
|
153
|
+
await fsp.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
|
|
154
|
+
p.log.success(c.green`Changes wrote to package.json`);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/cli/stages/update-eslint-config.ts
|
|
158
|
+
import fsp2 from "fs/promises";
|
|
159
|
+
import path2 from "path";
|
|
160
|
+
import process2 from "process";
|
|
161
|
+
import c2 from "ansis";
|
|
162
|
+
import * as p2 from "@clack/prompts";
|
|
141
163
|
|
|
142
164
|
// src/cli/constants.ts
|
|
143
165
|
var vscodeSettingsString = `
|
|
@@ -258,67 +280,64 @@ export default defineConfig(${options.hasNest ? `{
|
|
|
258
280
|
},
|
|
259
281
|
}` : ""});
|
|
260
282
|
`;
|
|
283
|
+
var npmignoreString = `# If these files (ESLint flat config files) are not included in .npmignore,
|
|
284
|
+
# they will be published, and importing devDependencies in published files will trigger \`n/no-unpublished-import\` errors.
|
|
285
|
+
eslint.config.js
|
|
286
|
+
eslint.config.mjs
|
|
287
|
+
`;
|
|
261
288
|
|
|
262
289
|
// src/cli/stages/update-eslint-config.ts
|
|
263
290
|
async function updateEslintConfig(options) {
|
|
264
|
-
const cwd = process.cwd();
|
|
265
|
-
const pathPackageJSON = path.join(cwd, "package.json");
|
|
266
|
-
const pkgContent = await fsp.readFile(pathPackageJSON, "utf8");
|
|
267
|
-
const pkg = JSON.parse(pkgContent);
|
|
268
|
-
const configFileName = pkg.type === "module" ? "eslint.config.js" : "eslint.config.mjs";
|
|
269
|
-
const pathFlatConfig = path.join(cwd, configFileName);
|
|
270
|
-
await fsp.writeFile(pathFlatConfig, eslintConfigContent(options));
|
|
271
|
-
p.log.success(c.green`Created ${configFileName}`);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// src/cli/stages/update-package-json.ts
|
|
275
|
-
import fsp2 from "fs/promises";
|
|
276
|
-
import path2 from "path";
|
|
277
|
-
import process2 from "process";
|
|
278
|
-
import * as p2 from "@clack/prompts";
|
|
279
|
-
import c2 from "ansis";
|
|
280
|
-
async function updatePackageJson() {
|
|
281
291
|
const cwd = process2.cwd();
|
|
282
292
|
const pathPackageJSON = path2.join(cwd, "package.json");
|
|
283
|
-
p2.log.step(c2.cyan`Bumping @dhzh/eslint-config to v${version}`);
|
|
284
293
|
const pkgContent = await fsp2.readFile(pathPackageJSON, "utf8");
|
|
285
294
|
const pkg = JSON.parse(pkgContent);
|
|
286
|
-
pkg.
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
pkg.scripts.lint = "eslint .";
|
|
291
|
-
pkg.scripts["lint-fix"] = "eslint --fix .";
|
|
292
|
-
await fsp2.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
|
|
293
|
-
p2.log.success(c2.green`Changes wrote to package.json`);
|
|
295
|
+
const configFileName = pkg.type === "module" ? "eslint.config.js" : "eslint.config.mjs";
|
|
296
|
+
const pathFlatConfig = path2.join(cwd, configFileName);
|
|
297
|
+
await fsp2.writeFile(pathFlatConfig, eslintConfigContent(options));
|
|
298
|
+
p2.log.success(c2.green`Created ${configFileName}`);
|
|
294
299
|
}
|
|
295
300
|
|
|
296
|
-
// src/cli/stages/update-
|
|
297
|
-
import fs from "fs";
|
|
301
|
+
// src/cli/stages/update-npmignore.ts
|
|
298
302
|
import fsp3 from "fs/promises";
|
|
299
303
|
import path3 from "path";
|
|
300
304
|
import process3 from "process";
|
|
301
|
-
import
|
|
305
|
+
import c3 from "ansis";
|
|
302
306
|
import * as p3 from "@clack/prompts";
|
|
303
|
-
async function
|
|
307
|
+
async function updateNpmignore() {
|
|
304
308
|
const cwd = process3.cwd();
|
|
305
|
-
const
|
|
306
|
-
const
|
|
309
|
+
const npmignoreFileName = ".npmignore";
|
|
310
|
+
const npmignoreFilePath = path3.join(cwd, npmignoreFileName);
|
|
311
|
+
await fsp3.writeFile(npmignoreFilePath, npmignoreString);
|
|
312
|
+
p3.log.success(c3.green`Created ${npmignoreFileName}`);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// src/cli/stages/update-vscode-settings.ts
|
|
316
|
+
import fs from "fs";
|
|
317
|
+
import fsp4 from "fs/promises";
|
|
318
|
+
import path4 from "path";
|
|
319
|
+
import process4 from "process";
|
|
320
|
+
import { green } from "ansis";
|
|
321
|
+
import * as p4 from "@clack/prompts";
|
|
322
|
+
async function updateVscodeSettings() {
|
|
323
|
+
const cwd = process4.cwd();
|
|
324
|
+
const dotVscodePath = path4.join(cwd, ".vscode");
|
|
325
|
+
const settingsPath = path4.join(dotVscodePath, "settings.json");
|
|
307
326
|
if (!fs.existsSync(dotVscodePath)) {
|
|
308
|
-
await
|
|
327
|
+
await fsp4.mkdir(dotVscodePath, { recursive: true });
|
|
309
328
|
}
|
|
310
329
|
if (fs.existsSync(settingsPath)) {
|
|
311
|
-
let settingsContent = await
|
|
330
|
+
let settingsContent = await fsp4.readFile(settingsPath, "utf8");
|
|
312
331
|
settingsContent = settingsContent.trim().replace(/\s*\}$/, "");
|
|
313
332
|
settingsContent += settingsContent.endsWith(",") || settingsContent.endsWith("{") ? "" : ",";
|
|
314
333
|
settingsContent += `${vscodeSettingsString}}
|
|
315
334
|
`;
|
|
316
|
-
await
|
|
317
|
-
|
|
335
|
+
await fsp4.writeFile(settingsPath, settingsContent, "utf8");
|
|
336
|
+
p4.log.success(green`Updated .vscode/settings.json`);
|
|
318
337
|
} else {
|
|
319
|
-
await
|
|
338
|
+
await fsp4.writeFile(settingsPath, `{${vscodeSettingsString}}
|
|
320
339
|
`, "utf8");
|
|
321
|
-
|
|
340
|
+
p4.log.success(green`Created .vscode/settings.json`);
|
|
322
341
|
}
|
|
323
342
|
}
|
|
324
343
|
|
|
@@ -326,9 +345,10 @@ async function updateVscodeSettings() {
|
|
|
326
345
|
async function run(options) {
|
|
327
346
|
await updatePackageJson();
|
|
328
347
|
await updateEslintConfig(options);
|
|
348
|
+
await updateNpmignore();
|
|
329
349
|
await updateVscodeSettings();
|
|
330
|
-
|
|
331
|
-
|
|
350
|
+
p5.log.success(c4.green`Setup completed`);
|
|
351
|
+
p5.outro(`Now you can update the dependencies by run ${c4.blue("pnpm i")} and run ${c4.blue("eslint --fix")}
|
|
332
352
|
`);
|
|
333
353
|
}
|
|
334
354
|
|
|
@@ -336,16 +356,16 @@ async function run(options) {
|
|
|
336
356
|
var cli = cac("@dhzh/eslint-config");
|
|
337
357
|
cli.command("", "Run the initialization or migration").action(async () => {
|
|
338
358
|
console.log("\n");
|
|
339
|
-
|
|
359
|
+
p6.intro(`${c5.green`@dhzh/eslint-config `}${c5.dim`v${version}`}`);
|
|
340
360
|
const options = {
|
|
341
361
|
hasNest: false
|
|
342
362
|
};
|
|
343
|
-
const hasNest = await
|
|
363
|
+
const hasNest = await p6.confirm({
|
|
344
364
|
message: "Is NestJS a part of the current project?",
|
|
345
365
|
initialValue: false
|
|
346
366
|
});
|
|
347
|
-
if (
|
|
348
|
-
|
|
367
|
+
if (p6.isCancel(hasNest)) {
|
|
368
|
+
p6.cancel("Operation cancelled");
|
|
349
369
|
throw new Error("Operation cancelled");
|
|
350
370
|
} else {
|
|
351
371
|
options.hasNest = hasNest;
|
|
@@ -353,8 +373,8 @@ cli.command("", "Run the initialization or migration").action(async () => {
|
|
|
353
373
|
try {
|
|
354
374
|
await run(options);
|
|
355
375
|
} catch (error) {
|
|
356
|
-
|
|
357
|
-
|
|
376
|
+
p6.log.error(c5.inverse.red(" Failed to migrate "));
|
|
377
|
+
p6.log.error(c5.red`✘ ${String(error)}`);
|
|
358
378
|
throw error;
|
|
359
379
|
}
|
|
360
380
|
});
|