@foal/cli 4.1.0 → 4.3.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.
|
@@ -34,18 +34,19 @@ function connectAngular(path) {
|
|
|
34
34
|
})
|
|
35
35
|
.modify('angular.json', content => {
|
|
36
36
|
const config = JSON.parse(content);
|
|
37
|
+
const projectName = Object.keys(config.projects)[0];
|
|
37
38
|
// Proxy configuration
|
|
38
|
-
config.projects[
|
|
39
|
-
config.projects[
|
|
40
|
-
config.projects[
|
|
41
|
-
config.projects[
|
|
39
|
+
config.projects[projectName].architect ||= {};
|
|
40
|
+
config.projects[projectName].architect.serve ||= {};
|
|
41
|
+
config.projects[projectName].architect.serve.options ||= {};
|
|
42
|
+
config.projects[projectName].architect.serve.options.proxyConfig = 'src/proxy.conf.json';
|
|
42
43
|
// Output build directory
|
|
43
44
|
const outputPath = (0, path_1.join)((0, path_1.relative)(path, process.cwd()), 'public')
|
|
44
45
|
// Make projects generated on Windows build on Unix.
|
|
45
46
|
.replace(/\\/g, '/');
|
|
46
|
-
config.projects[
|
|
47
|
-
config.projects[
|
|
48
|
-
config.projects[
|
|
47
|
+
config.projects[projectName].architect.build ||= {};
|
|
48
|
+
config.projects[projectName].architect.build.options ||= {};
|
|
49
|
+
config.projects[projectName].architect.build.options.outputPath = outputPath;
|
|
49
50
|
return JSON.stringify(config, null, 2);
|
|
50
51
|
});
|
|
51
52
|
}
|
|
@@ -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.
|
|
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.
|
|
35
|
+
"@types/mocha": "10.0.6",
|
|
36
36
|
"@types/node": "18.18.6",
|
|
37
|
-
"concurrently": "~8.2.
|
|
38
|
-
"mocha": "~10.
|
|
39
|
-
"supertest": "~6.3.
|
|
37
|
+
"concurrently": "~8.2.2",
|
|
38
|
+
"mocha": "~10.3.0",
|
|
39
|
+
"supertest": "~6.3.4",
|
|
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.
|
|
31
|
+
"@types/mocha": "10.0.6",
|
|
32
32
|
"@types/node": "18.18.6",
|
|
33
|
-
"concurrently": "~8.2.
|
|
34
|
-
"mocha": "~10.
|
|
35
|
-
"supertest": "~6.3.
|
|
33
|
+
"concurrently": "~8.2.2",
|
|
34
|
+
"mocha": "~10.3.0",
|
|
35
|
+
"supertest": "~6.3.4",
|
|
36
36
|
"supervisor": "~0.12.0",
|
|
37
37
|
"eslint": "~8.48.0",
|
|
38
38
|
"@typescript-eslint/eslint-plugin": "~6.5.0",
|
package/lib/rmdir/rmdir.util.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rmdir = void 0;
|
|
4
4
|
// std
|
|
5
|
-
const
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "4.3.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": "~
|
|
65
|
-
"node-fetch": "~2.
|
|
64
|
+
"commander": "~12.0.0",
|
|
65
|
+
"node-fetch": "~2.7.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@types/mocha": "10.0.
|
|
68
|
+
"@types/mocha": "10.0.6",
|
|
69
69
|
"@types/node": "18.18.6",
|
|
70
70
|
"copyfiles": "~2.4.1",
|
|
71
|
-
"mocha": "~10.
|
|
72
|
-
"rimraf": "~5.0.
|
|
73
|
-
"ts-node": "~10.9.
|
|
71
|
+
"mocha": "~10.3.0",
|
|
72
|
+
"rimraf": "~5.0.5",
|
|
73
|
+
"ts-node": "~10.9.2",
|
|
74
74
|
"typescript": "~4.9.5"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "04d935b29d248b850c3ae236007758a55a05bb4c"
|
|
77
77
|
}
|