@expressots/cli 1.7.1 → 1.8.1
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/README.md +8 -0
- package/bin/@types/config.d.ts +39 -39
- package/bin/@types/config.js +2 -2
- package/bin/@types/index.d.ts +1 -1
- package/bin/@types/index.js +17 -17
- package/bin/app.container.d.ts +1 -1
- package/bin/app.container.js +8 -8
- package/bin/cli.d.ts +2 -2
- package/bin/cli.js +38 -38
- package/bin/commands/__tests__/project.commands.spec.d.ts +1 -0
- package/bin/commands/__tests__/project.commands.spec.js +8 -0
- package/bin/commands/project.commands.d.ts +8 -8
- package/bin/commands/project.commands.js +137 -136
- package/bin/generate/cli.d.ts +4 -4
- package/bin/generate/cli.js +66 -66
- package/bin/generate/form.d.ts +20 -20
- package/bin/generate/form.js +30 -30
- package/bin/generate/index.d.ts +1 -1
- package/bin/generate/index.js +17 -17
- package/bin/generate/utils/command-utils.d.ts +123 -123
- package/bin/generate/utils/command-utils.js +314 -310
- package/bin/generate/utils/nonopininated-cmd.d.ts +9 -9
- package/bin/generate/utils/nonopininated-cmd.js +248 -248
- package/bin/generate/utils/opinionated-cmd.d.ts +11 -11
- package/bin/generate/utils/opinionated-cmd.js +481 -480
- package/bin/help/cli.d.ts +4 -4
- package/bin/help/cli.js +15 -15
- package/bin/help/form.d.ts +2 -2
- package/bin/help/form.js +28 -28
- package/bin/help/index.d.ts +1 -1
- package/bin/help/index.js +17 -2
- package/bin/index.d.ts +6 -4
- package/bin/index.js +22 -20
- package/bin/info/cli.d.ts +4 -4
- package/bin/info/cli.js +15 -15
- package/bin/info/form.d.ts +2 -2
- package/bin/info/form.js +36 -36
- package/bin/info/index.d.ts +1 -1
- package/bin/info/index.js +17 -17
- package/bin/new/cli.d.ts +4 -4
- package/bin/new/cli.js +65 -51
- package/bin/new/form.d.ts +2 -2
- package/bin/new/form.js +238 -213
- package/bin/new/index.d.ts +1 -1
- package/bin/new/index.js +17 -17
- package/bin/providers/cli.d.ts +4 -4
- package/bin/providers/cli.js +43 -38
- package/bin/providers/external/external.provider.d.ts +2 -0
- package/bin/providers/external/external.provider.js +49 -0
- package/bin/providers/index.d.ts +1 -1
- package/bin/providers/index.js +17 -17
- package/bin/providers/prisma/prisma.provider.d.ts +2 -2
- package/bin/providers/prisma/prisma.provider.js +272 -270
- package/bin/types.d.ts +1 -1
- package/bin/types.js +17 -17
- package/bin/utils/add-controller-to-module.d.ts +1 -1
- package/bin/utils/add-controller-to-module.js +46 -46
- package/bin/utils/add-module-to-container.d.ts +3 -3
- package/bin/utils/add-module-to-container.js +129 -129
- package/bin/utils/center-text.d.ts +2 -2
- package/bin/utils/center-text.js +10 -10
- package/bin/utils/cli-ui.d.ts +3 -3
- package/bin/utils/cli-ui.js +19 -19
- package/bin/utils/compiler.d.ts +15 -15
- package/bin/utils/compiler.js +93 -93
- package/bin/utils/find-folder.d.ts +5 -5
- package/bin/utils/find-folder.js +37 -37
- package/bin/utils/index.d.ts +1 -1
- package/bin/utils/index.js +17 -17
- package/bin/utils/verify-file-exists.d.ts +2 -2
- package/bin/utils/verify-file-exists.js +30 -30
- package/package.json +35 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare function hasFolder(rootDir: string, ignoreList?: Array<string>): {
|
|
2
|
-
found: boolean;
|
|
3
|
-
path: string | null;
|
|
4
|
-
};
|
|
5
|
-
export { hasFolder };
|
|
1
|
+
declare function hasFolder(rootDir: string, ignoreList?: Array<string>): {
|
|
2
|
+
found: boolean;
|
|
3
|
+
path: string | null;
|
|
4
|
+
};
|
|
5
|
+
export { hasFolder };
|
package/bin/utils/find-folder.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.hasFolder = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
function hasFolder(rootDir, ignoreList = []) {
|
|
10
|
-
function searchDir(directory) {
|
|
11
|
-
const files = fs_1.default.readdirSync(directory);
|
|
12
|
-
for (const file of files) {
|
|
13
|
-
if (ignoreList.includes(file))
|
|
14
|
-
continue; // Skip if the file/folder is in the ignore list
|
|
15
|
-
const filePath = path_1.default.join(directory, file);
|
|
16
|
-
const stats = fs_1.default.statSync(filePath);
|
|
17
|
-
if (stats.isDirectory()) {
|
|
18
|
-
if (file === "prisma") {
|
|
19
|
-
return filePath; // Return full path of the 'prisma' folder
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
const result = searchDir(filePath); // Search inside other directories recursively
|
|
23
|
-
if (result) {
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return null; // 'prisma' folder was not found in this directory
|
|
30
|
-
}
|
|
31
|
-
const foundPath = searchDir(rootDir);
|
|
32
|
-
return {
|
|
33
|
-
found: !!foundPath,
|
|
34
|
-
path: foundPath,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
exports.hasFolder = hasFolder;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hasFolder = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
function hasFolder(rootDir, ignoreList = []) {
|
|
10
|
+
function searchDir(directory) {
|
|
11
|
+
const files = fs_1.default.readdirSync(directory);
|
|
12
|
+
for (const file of files) {
|
|
13
|
+
if (ignoreList.includes(file))
|
|
14
|
+
continue; // Skip if the file/folder is in the ignore list
|
|
15
|
+
const filePath = path_1.default.join(directory, file);
|
|
16
|
+
const stats = fs_1.default.statSync(filePath);
|
|
17
|
+
if (stats.isDirectory()) {
|
|
18
|
+
if (file === "prisma") {
|
|
19
|
+
return filePath; // Return full path of the 'prisma' folder
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const result = searchDir(filePath); // Search inside other directories recursively
|
|
23
|
+
if (result) {
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return null; // 'prisma' folder was not found in this directory
|
|
30
|
+
}
|
|
31
|
+
const foundPath = searchDir(rootDir);
|
|
32
|
+
return {
|
|
33
|
+
found: !!foundPath,
|
|
34
|
+
path: foundPath,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.hasFolder = hasFolder;
|
package/bin/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./compiler";
|
|
1
|
+
export * from "./compiler";
|
package/bin/utils/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./compiler"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./compiler"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function verifyIfFileExists(path: string, schematic?: string): Promise<void>;
|
|
2
|
-
export { verifyIfFileExists };
|
|
1
|
+
declare function verifyIfFileExists(path: string, schematic?: string): Promise<void>;
|
|
2
|
+
export { verifyIfFileExists };
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.verifyIfFileExists = void 0;
|
|
7
|
-
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
-
const cli_ui_1 = require("./cli-ui");
|
|
10
|
-
async function verifyIfFileExists(path, schematic) {
|
|
11
|
-
const fileExists = node_fs_1.default.existsSync(path);
|
|
12
|
-
const fileName = path.split("/").pop();
|
|
13
|
-
if (fileExists) {
|
|
14
|
-
const answer = await inquirer_1.default.prompt([
|
|
15
|
-
{
|
|
16
|
-
type: "confirm",
|
|
17
|
-
name: "confirm",
|
|
18
|
-
message: `File [${fileName}] exists. Overwrite?`,
|
|
19
|
-
default: true,
|
|
20
|
-
},
|
|
21
|
-
]);
|
|
22
|
-
if (!answer.confirm) {
|
|
23
|
-
schematic
|
|
24
|
-
? (0, cli_ui_1.printGenerateError)(schematic, fileName)
|
|
25
|
-
: (0, cli_ui_1.printError)("File not created!", fileName);
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.verifyIfFileExists = verifyIfFileExists;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.verifyIfFileExists = void 0;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
+
const cli_ui_1 = require("./cli-ui");
|
|
10
|
+
async function verifyIfFileExists(path, schematic) {
|
|
11
|
+
const fileExists = node_fs_1.default.existsSync(path);
|
|
12
|
+
const fileName = path.split("/").pop();
|
|
13
|
+
if (fileExists) {
|
|
14
|
+
const answer = await inquirer_1.default.prompt([
|
|
15
|
+
{
|
|
16
|
+
type: "confirm",
|
|
17
|
+
name: "confirm",
|
|
18
|
+
message: `File [${fileName}] exists. Overwrite?`,
|
|
19
|
+
default: true,
|
|
20
|
+
},
|
|
21
|
+
]);
|
|
22
|
+
if (!answer.confirm) {
|
|
23
|
+
schematic
|
|
24
|
+
? (0, cli_ui_1.printGenerateError)(schematic, fileName)
|
|
25
|
+
: (0, cli_ui_1.printError)("File not created!", fileName);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.verifyIfFileExists = verifyIfFileExists;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressots/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Expressots CLI - modern, fast, lightweight nodejs web framework (@cli)",
|
|
5
5
|
"author": "Richard Zampieri",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"expressots": "bin/cli.js"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=18.
|
|
14
|
+
"node": ">=18.18.0"
|
|
15
15
|
},
|
|
16
16
|
"funding": {
|
|
17
17
|
"type": "github",
|
|
@@ -44,48 +44,52 @@
|
|
|
44
44
|
"lint": "eslint \"./src/**/*.ts\"",
|
|
45
45
|
"lint:fix": "eslint \"./src/**/*.ts\" --fix",
|
|
46
46
|
"release": "release-it",
|
|
47
|
-
"test": "vitest run",
|
|
47
|
+
"test": "vitest run --reporter default",
|
|
48
48
|
"test:watch": "vitest",
|
|
49
|
-
"
|
|
49
|
+
"coverage": "vitest run --coverage"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@expressots/boost-ts": "1.1.1",
|
|
53
53
|
"chalk-animation": "2.0.3",
|
|
54
54
|
"cli-progress": "3.11.2",
|
|
55
|
-
"cli-table3": "
|
|
55
|
+
"cli-table3": "0.6.4",
|
|
56
56
|
"degit": "2.8.4",
|
|
57
|
-
"glob": "10.
|
|
57
|
+
"glob": "10.4.1",
|
|
58
58
|
"inquirer": "8.0.0",
|
|
59
59
|
"mustache": "4.2.0",
|
|
60
|
+
"semver": "7.6.2",
|
|
60
61
|
"ts-node": "10.9.1",
|
|
61
62
|
"yargs": "17.6.2"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@commitlint/
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@types/
|
|
69
|
-
"@types/
|
|
70
|
-
"@types/
|
|
71
|
-
"@types/
|
|
72
|
-
"@types/
|
|
73
|
-
"@types/
|
|
74
|
-
"@
|
|
75
|
-
"@typescript-eslint/
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"eslint
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
65
|
+
"@codecov/vite-plugin": "^0.0.1-beta.9",
|
|
66
|
+
"@commitlint/cli": "19.2.1",
|
|
67
|
+
"@commitlint/config-conventional": "19.1.0",
|
|
68
|
+
"@release-it/conventional-changelog": "7.0.2",
|
|
69
|
+
"@types/chalk-animation": "1.6.1",
|
|
70
|
+
"@types/cli-progress": "3.11.0",
|
|
71
|
+
"@types/degit": "2.8.3",
|
|
72
|
+
"@types/inquirer": "9.0.3",
|
|
73
|
+
"@types/mustache": "4.2.2",
|
|
74
|
+
"@types/node": "20.12.7",
|
|
75
|
+
"@types/yargs": "17.0.22",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "7.6.0",
|
|
77
|
+
"@typescript-eslint/parser": "7.6.0",
|
|
78
|
+
"@vitest/coverage-v8": "1.4.0",
|
|
79
|
+
"chalk": "4.1.2",
|
|
80
|
+
"eslint": "8.57.0",
|
|
81
|
+
"eslint-config-prettier": "9.1.0",
|
|
82
|
+
"husky": "9.0.11",
|
|
83
|
+
"prettier": "3.2.5",
|
|
84
|
+
"reflect-metadata": "0.2.2",
|
|
85
|
+
"release-it": "16.3.0",
|
|
86
|
+
"rimraf": "5.0.5",
|
|
87
|
+
"shx": "0.3.4",
|
|
88
|
+
"ts-node-dev": "2.0.0",
|
|
89
|
+
"typescript": "5.2.2",
|
|
90
|
+
"vite": "5.2.8",
|
|
91
|
+
"vite-tsconfig-paths": "4.3.2",
|
|
92
|
+
"vitest": "1.4.0"
|
|
89
93
|
},
|
|
90
94
|
"release-it": {
|
|
91
95
|
"git": {
|