meocli 0.0.7 → 0.0.8
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 +7 -6
- package/dist/commands/pr/index.d.ts +1 -0
- package/dist/commands/pr/index.js +12 -3
- package/oclif.manifest.json +8 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ $ pnpm run dev hello world
|
|
|
22
22
|
$ pnpm run prod hello world
|
|
23
23
|
$ pnpm run dev hello foo -f bar
|
|
24
24
|
<!-- prettier -->
|
|
25
|
-
$ pnpm run dev pr ./tmp/test.svg
|
|
25
|
+
$ pnpm run dev pr ./tmp/test.svg --verbose
|
|
26
26
|
$ pnpm run dev pr ./tmp/test.json --config=auto --ignore=auto
|
|
27
27
|
$ pnpm run dev pr ./tmp/test.svg --config=built_in --ignore=auto
|
|
28
28
|
```
|
|
@@ -43,7 +43,7 @@ $ npm install -g meocli
|
|
|
43
43
|
$ me COMMAND
|
|
44
44
|
running command...
|
|
45
45
|
$ me (--version)
|
|
46
|
-
meocli/0.0.
|
|
46
|
+
meocli/0.0.8 win32-x64 node-v24.12.0
|
|
47
47
|
$ me --help [COMMAND]
|
|
48
48
|
USAGE
|
|
49
49
|
$ me COMMAND
|
|
@@ -91,7 +91,7 @@ EXAMPLES
|
|
|
91
91
|
hello friend from oclif! (./src/commands/hello/index.ts)
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
_See code: [src/commands/hello/index.ts](https://github.com/meme2046/meocli/blob/v0.0.
|
|
94
|
+
_See code: [src/commands/hello/index.ts](https://github.com/meme2046/meocli/blob/v0.0.8/src/commands/hello/index.ts)_
|
|
95
95
|
|
|
96
96
|
## `me hello world`
|
|
97
97
|
|
|
@@ -109,7 +109,7 @@ EXAMPLES
|
|
|
109
109
|
hello world! (./src/commands/hello/world.ts)
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
_See code: [src/commands/hello/world.ts](https://github.com/meme2046/meocli/blob/v0.0.
|
|
112
|
+
_See code: [src/commands/hello/world.ts](https://github.com/meme2046/meocli/blob/v0.0.8/src/commands/hello/world.ts)_
|
|
113
113
|
|
|
114
114
|
## `me help [COMMAND]`
|
|
115
115
|
|
|
@@ -427,7 +427,7 @@ Use Prettier to format file
|
|
|
427
427
|
|
|
428
428
|
```
|
|
429
429
|
USAGE
|
|
430
|
-
$ me pr FILEPATH [-c <value>] [--ignore <value>]
|
|
430
|
+
$ me pr FILEPATH [-c <value>] [--ignore <value>] [-v]
|
|
431
431
|
|
|
432
432
|
ARGUMENTS
|
|
433
433
|
FILEPATH file path that need to be formatted by Prettier
|
|
@@ -435,6 +435,7 @@ ARGUMENTS
|
|
|
435
435
|
FLAGS
|
|
436
436
|
-c, --config=<value> [default: built_in] built_in:使用内置规则(默认值), 传入路径则是使用自定义配置,
|
|
437
437
|
auto:自动检测config file
|
|
438
|
+
-v, --verbose Show verbose output
|
|
438
439
|
--ignore=<value> [default: built_in] built_in:使用内置规则(默认值), 传入路径则是使用自定义规则,
|
|
439
440
|
auto:自动检测ignore file
|
|
440
441
|
|
|
@@ -447,5 +448,5 @@ EXAMPLES
|
|
|
447
448
|
$ me pr ./src/file.ts --config ./.prettierrc.yaml
|
|
448
449
|
```
|
|
449
450
|
|
|
450
|
-
_See code: [src/commands/pr/index.ts](https://github.com/meme2046/meocli/blob/v0.0.
|
|
451
|
+
_See code: [src/commands/pr/index.ts](https://github.com/meme2046/meocli/blob/v0.0.8/src/commands/pr/index.ts)_
|
|
451
452
|
<!-- commandsstop -->
|
|
@@ -8,6 +8,7 @@ export default class Prettier extends Command {
|
|
|
8
8
|
static flags: {
|
|
9
9
|
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
ignore: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
12
|
};
|
|
12
13
|
run(): Promise<void>;
|
|
13
14
|
private detectPackageManager;
|
|
@@ -31,6 +31,11 @@ export default class Prettier extends Command {
|
|
|
31
31
|
description: 'built_in:使用内置规则(默认值), 传入路径则是使用自定义规则, auto:自动检测ignore file',
|
|
32
32
|
required: false,
|
|
33
33
|
}),
|
|
34
|
+
verbose: Flags.boolean({
|
|
35
|
+
char: 'v',
|
|
36
|
+
default: false,
|
|
37
|
+
description: 'Show verbose output',
|
|
38
|
+
}),
|
|
34
39
|
// 'no-config': Flags.boolean({
|
|
35
40
|
// default: false,
|
|
36
41
|
// description: 'Disable config file detection',
|
|
@@ -43,7 +48,11 @@ export default class Prettier extends Command {
|
|
|
43
48
|
async run() {
|
|
44
49
|
const { args, flags } = await this.parse(Prettier);
|
|
45
50
|
const { filePath } = args;
|
|
46
|
-
const { config, ignore } = flags;
|
|
51
|
+
const { config, ignore, verbose } = flags;
|
|
52
|
+
if (verbose) {
|
|
53
|
+
process.env.DEBUG = 'oclif:me:pr';
|
|
54
|
+
require('debug').enable(process.env.DEBUG);
|
|
55
|
+
}
|
|
47
56
|
// 检查文件是否存在
|
|
48
57
|
if (!existsSync(filePath)) {
|
|
49
58
|
this.error(`file『${filePath}』not found`);
|
|
@@ -102,8 +111,8 @@ export default class Prettier extends Command {
|
|
|
102
111
|
prettierArgs = completeArgs;
|
|
103
112
|
}
|
|
104
113
|
}
|
|
105
|
-
this.debug(prettierBin);
|
|
106
|
-
this.debug(JSON.stringify(prettierArgs));
|
|
114
|
+
this.debug('prettier path:', prettierBin);
|
|
115
|
+
this.debug('args:', JSON.stringify(prettierArgs));
|
|
107
116
|
// this.log(`Formatting file: ${filePath}`)
|
|
108
117
|
const { stderr, stdout } = await execa(prettierBin, prettierArgs, {
|
|
109
118
|
env: { ...process.env },
|
package/oclif.manifest.json
CHANGED
|
@@ -97,6 +97,13 @@
|
|
|
97
97
|
"hasDynamicHelp": false,
|
|
98
98
|
"multiple": false,
|
|
99
99
|
"type": "option"
|
|
100
|
+
},
|
|
101
|
+
"verbose": {
|
|
102
|
+
"char": "v",
|
|
103
|
+
"description": "Show verbose output",
|
|
104
|
+
"name": "verbose",
|
|
105
|
+
"allowNo": false,
|
|
106
|
+
"type": "boolean"
|
|
100
107
|
}
|
|
101
108
|
},
|
|
102
109
|
"hasDynamicHelp": false,
|
|
@@ -116,5 +123,5 @@
|
|
|
116
123
|
]
|
|
117
124
|
}
|
|
118
125
|
},
|
|
119
|
-
"version": "0.0.
|
|
126
|
+
"version": "0.0.8"
|
|
120
127
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meocli",
|
|
3
3
|
"description": "A new CLI generated with oclif",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"author": "meme2046",
|
|
6
6
|
"bin": {
|
|
7
7
|
"me": "./bin/run.js"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"@oclif/plugin-help": "^6",
|
|
13
13
|
"@oclif/plugin-plugins": "^5",
|
|
14
14
|
"@prettier/plugin-xml": "^3.4.2",
|
|
15
|
+
"debug": "^4.4.3",
|
|
15
16
|
"execa": "^9.6.1",
|
|
16
17
|
"prettier": "^3.7.4",
|
|
17
18
|
"prettier-plugin-nginx": "^1.0.3",
|