@foal/cli 4.2.0 → 4.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.
@@ -27,16 +27,16 @@
27
27
  "@foal/core": "^4.0.0",
28
28
  "@foal/typeorm": "^4.0.0",
29
29
  "source-map-support": "~0.5.21",
30
- "sqlite3": "~5.1.6",
30
+ "sqlite3": "~5.1.7",
31
31
  "typeorm": "0.3.17"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@foal/cli": "^4.0.0",
35
- "@types/mocha": "10.0.1",
35
+ "@types/mocha": "10.0.6",
36
36
  "@types/node": "18.18.6",
37
- "concurrently": "~8.2.1",
38
- "mocha": "~10.2.0",
39
- "supertest": "~6.3.3",
37
+ "concurrently": "~8.2.2",
38
+ "mocha": "~10.4.0",
39
+ "supertest": "~7.0.0",
40
40
  "supervisor": "~0.12.0",
41
41
  "eslint": "~8.48.0",
42
42
  "@typescript-eslint/eslint-plugin": "~6.5.0",
@@ -28,11 +28,11 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@foal/cli": "^4.0.0",
31
- "@types/mocha": "10.0.1",
31
+ "@types/mocha": "10.0.6",
32
32
  "@types/node": "18.18.6",
33
- "concurrently": "~8.2.1",
34
- "mocha": "~10.2.0",
35
- "supertest": "~6.3.3",
33
+ "concurrently": "~8.2.2",
34
+ "mocha": "~10.4.0",
35
+ "supertest": "~7.0.0",
36
36
  "supervisor": "~0.12.0",
37
37
  "eslint": "~8.48.0",
38
38
  "@typescript-eslint/eslint-plugin": "~6.5.0",
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rmdir = void 0;
4
4
  // std
5
- const fs_1 = require("fs");
6
- const path_1 = require("path");
7
- const util_1 = require("util");
5
+ const promises_1 = require("node:fs/promises");
8
6
  /**
9
7
  * Remove a directory and all its contents, including any subdirectories and files.
10
8
  *
@@ -13,9 +11,8 @@ const util_1 = require("util");
13
11
  * @returns {Promise<void>}
14
12
  */
15
13
  async function rmdir(path) {
16
- let contents;
17
14
  try {
18
- contents = await (0, util_1.promisify)(fs_1.readdir)(path);
15
+ await (0, promises_1.readdir)(path);
19
16
  }
20
17
  catch (error) {
21
18
  if (error.code === 'ENOENT') {
@@ -23,16 +20,6 @@ async function rmdir(path) {
23
20
  }
24
21
  throw error;
25
22
  }
26
- await Promise.all(contents.map(content => {
27
- const subPath = (0, path_1.join)(path, content);
28
- return (0, util_1.promisify)(fs_1.stat)(subPath)
29
- .then(stats => {
30
- if (stats.isDirectory()) {
31
- return rmdir(subPath);
32
- }
33
- return (0, util_1.promisify)(fs_1.unlink)(subPath);
34
- });
35
- }));
36
- await (0, util_1.promisify)(fs_1.rmdir)(path);
23
+ await (0, promises_1.rm)(path, { recursive: true });
37
24
  }
38
25
  exports.rmdir = rmdir;
@@ -27,11 +27,16 @@ async function runScript({ name }, argv, log = console.log) {
27
27
  }
28
28
  const args = (0, get_command_line_arguments_util_1.getCommandLineArguments)(argv);
29
29
  if (schema) {
30
- const ajv = new ajv_1.default({ useDefaults: true });
30
+ const ajv = new ajv_1.default({ useDefaults: true, allErrors: true });
31
31
  (0, ajv_formats_1.default)(ajv);
32
32
  if (!ajv.validate(schema, args)) {
33
33
  ajv.errors.forEach(err => {
34
- log(`Error: The command line arguments ${err.message}.`);
34
+ if (err.instancePath) {
35
+ log(`Script error: the value of "${err.instancePath.split('/')[1]}" ${err.message}.`);
36
+ }
37
+ else {
38
+ log(`Script error: arguments ${err.message}.`);
39
+ }
35
40
  });
36
41
  return;
37
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foal/cli",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "CLI tool for FoalTS",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -61,17 +61,17 @@
61
61
  "ajv-formats": "~2.1.1",
62
62
  "cli-spinner": "~0.2.10",
63
63
  "colors": "1.4.0",
64
- "commander": "~11.1.0",
65
- "node-fetch": "~2.6.7"
64
+ "commander": "~12.0.0",
65
+ "node-fetch": "~2.7.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@types/mocha": "10.0.1",
68
+ "@types/mocha": "10.0.6",
69
69
  "@types/node": "18.18.6",
70
70
  "copyfiles": "~2.4.1",
71
- "mocha": "~10.2.0",
72
- "rimraf": "~5.0.1",
73
- "ts-node": "~10.9.1",
71
+ "mocha": "~10.4.0",
72
+ "rimraf": "~5.0.5",
73
+ "ts-node": "~10.9.2",
74
74
  "typescript": "~4.9.5"
75
75
  },
76
- "gitHead": "359331eb0b82cd8aed8c4124002b7f2ba8222284"
76
+ "gitHead": "7940702713d1c4fbd4bf12747deadafcf1daa3b9"
77
77
  }