@devrune/cli 1.0.5 โ 1.0.6
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/index.js +41 -7
- package/package.json +3 -2
- package/scripts/index.ts +57 -15
package/dist/index.js
CHANGED
|
@@ -6,17 +6,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const select_1 = __importDefault(require("@inquirer/select"));
|
|
8
8
|
const util_1 = require("./util");
|
|
9
|
-
(0, util_1.isRootFolder)();
|
|
10
9
|
console.log("Welcome to DevRune CLI! Use this tool to generate features and check file name style guide.");
|
|
11
|
-
(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
async function run() {
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
if (args.includes('-h') || args.includes('--help')) {
|
|
13
|
+
console.log(`
|
|
14
|
+
DevRune CLI
|
|
15
|
+
|
|
16
|
+
โ๏ธโ๏ธโ๏ธImportant to call command only from folder where src is located, otherwise it won't work
|
|
17
|
+
|
|
18
|
+
Usage:
|
|
19
|
+
@devrune/cli Interactive mode
|
|
20
|
+
@devrune/cli --check Check folders style guide
|
|
21
|
+
@devrune/cli --feature Create new feature
|
|
22
|
+
@devrune/cli -h Help
|
|
23
|
+
`);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
(0, util_1.isRootFolder)();
|
|
27
|
+
if (args.includes('--check')) {
|
|
28
|
+
return require('./check-file-name-style-guide');
|
|
29
|
+
}
|
|
30
|
+
if (args.includes('--feature')) {
|
|
31
|
+
return require('./generate-feature');
|
|
32
|
+
}
|
|
33
|
+
// ๐ fallback to interactive mode
|
|
34
|
+
const answer = await (0, select_1.default)({
|
|
35
|
+
message: 'What do you want to create?',
|
|
36
|
+
choices: [
|
|
37
|
+
{
|
|
38
|
+
name: 'Check Style Guide ๐จ',
|
|
39
|
+
value: 'check',
|
|
40
|
+
description: 'Check project folders according style guide',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Create new feature ๐',
|
|
44
|
+
value: 'feature',
|
|
45
|
+
description: 'Create new feature',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
});
|
|
16
49
|
if (answer === 'check') {
|
|
17
50
|
require('./check-file-name-style-guide');
|
|
18
51
|
}
|
|
19
52
|
if (answer === 'feature') {
|
|
20
53
|
require('./generate-feature');
|
|
21
54
|
}
|
|
22
|
-
}
|
|
55
|
+
}
|
|
56
|
+
run();
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devrune/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"bin": {
|
|
5
5
|
"devrune": "./dist/index.js"
|
|
6
6
|
},
|
|
7
7
|
"scripts": {
|
|
8
8
|
"generate-feature": "ts-node ./scripts/generate-feature.ts",
|
|
9
|
-
"check-file-name": "ts-node ./scripts/check-file-name-style-guide.ts"
|
|
9
|
+
"check-file-name": "ts-node ./scripts/check-file-name-style-guide.ts",
|
|
10
|
+
"publish:lib": "npx tsc && npm publish --access public"
|
|
10
11
|
},
|
|
11
12
|
"devDependencies": {
|
|
12
13
|
"@types/node": "^25.3.0",
|
package/scripts/index.ts
CHANGED
|
@@ -2,22 +2,64 @@
|
|
|
2
2
|
import select from "@inquirer/select";
|
|
3
3
|
import { isRootFolder } from "./util";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
|
|
7
7
|
console.log("Welcome to DevRune CLI! Use this tool to generate features and check file name style guide.");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
).
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
async function run() {
|
|
11
|
+
const args = process.argv.slice(2);
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
if (args.includes('-h') || args.includes('--help')) {
|
|
15
|
+
console.log(`
|
|
16
|
+
DevRune CLI
|
|
17
|
+
|
|
18
|
+
โ๏ธโ๏ธโ๏ธImportant to call command only from folder where src is located, otherwise it won't work
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
@devrune/cli Interactive mode
|
|
22
|
+
@devrune/cli --check Check folders style guide
|
|
23
|
+
@devrune/cli --feature Create new feature
|
|
24
|
+
@devrune/cli -h Help
|
|
25
|
+
`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
isRootFolder();
|
|
30
|
+
|
|
31
|
+
if (args.includes('--check')) {
|
|
32
|
+
return require('./check-file-name-style-guide');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (args.includes('--feature')) {
|
|
36
|
+
return require('./generate-feature');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ๐ fallback to interactive mode
|
|
40
|
+
const answer = await select({
|
|
41
|
+
message: 'What do you want to create?',
|
|
42
|
+
choices: [
|
|
43
|
+
{
|
|
44
|
+
name: 'Check Style Guide ๐จ',
|
|
45
|
+
value: 'check',
|
|
46
|
+
description: 'Check project folders according style guide',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'Create new feature ๐',
|
|
50
|
+
value: 'feature',
|
|
51
|
+
description: 'Create new feature',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
22
54
|
});
|
|
23
55
|
|
|
56
|
+
if (answer === 'check') {
|
|
57
|
+
require('./check-file-name-style-guide');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (answer === 'feature') {
|
|
61
|
+
require('./generate-feature');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
run();
|