@nice-move/cli 0.6.1 → 0.7.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.
- package/README.md +33 -6
- package/index.mjs +3 -1
- package/package.json +4 -4
- package/cmd/lint.mjs +0 -20
package/README.md
CHANGED
|
@@ -21,14 +21,28 @@ npm install @nice-move/cli --save-dev
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
24
|
+
npm exec nice-move <command>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Commands
|
|
28
28
|
|
|
29
|
-
### lint
|
|
29
|
+
### `lint commit`
|
|
30
30
|
|
|
31
|
-
Lint
|
|
31
|
+
Lint git commit message.
|
|
32
|
+
|
|
33
|
+
Use [commitlint](https://commitlint.js.org/) to enforcing [conventional commits](https://conventionalcommits.org/).
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
#!/bin/sh
|
|
37
|
+
|
|
38
|
+
# file: .git/hooks/commit-msg
|
|
39
|
+
|
|
40
|
+
npm exec nice-move lint commit
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### `lint staged`
|
|
44
|
+
|
|
45
|
+
Lint and format git staged files.
|
|
32
46
|
|
|
33
47
|
Install `eslint` / `stylelint` / `prettier` / `garou` when needed:
|
|
34
48
|
|
|
@@ -39,7 +53,7 @@ npm install eslint stylelint prettier garou --save-dev
|
|
|
39
53
|
Add configurations:
|
|
40
54
|
|
|
41
55
|
```jsonc
|
|
42
|
-
//
|
|
56
|
+
// file: package.json
|
|
43
57
|
{
|
|
44
58
|
"eslintConfig": {},
|
|
45
59
|
"prettier": {},
|
|
@@ -48,14 +62,27 @@ Add configurations:
|
|
|
48
62
|
}
|
|
49
63
|
```
|
|
50
64
|
|
|
65
|
+
```sh
|
|
66
|
+
#!/bin/sh
|
|
67
|
+
|
|
68
|
+
# file: .git/hooks/pre-commit
|
|
69
|
+
|
|
70
|
+
npm exec nice-move lint staged
|
|
71
|
+
```
|
|
72
|
+
|
|
51
73
|
Change a few files, then run:
|
|
52
74
|
|
|
53
75
|
```bash
|
|
54
76
|
git add .
|
|
55
|
-
|
|
77
|
+
npm exec nice-move lint staged
|
|
56
78
|
```
|
|
57
79
|
|
|
58
80
|
## Related
|
|
59
81
|
|
|
60
82
|
- [@nice-move/init](../init)
|
|
61
|
-
- [@nice-move/
|
|
83
|
+
- [@nice-move/commitlint-config](../commitlint-config)
|
|
84
|
+
- [@nice-move/eslint-config-base](../eslint-config-base)
|
|
85
|
+
- [@nice-move/eslint-config-react](../eslint-config-react)
|
|
86
|
+
- [@nice-move/eslint-config-vue](../eslint-config-vue)
|
|
87
|
+
- [@nice-move/stylelint-config](../stylelint-config)
|
|
88
|
+
- [@nice-move/prettier-config](../prettier-config)
|
package/index.mjs
CHANGED
|
@@ -8,6 +8,8 @@ process.on('SIGINT', () => {});
|
|
|
8
8
|
|
|
9
9
|
new Cheetor('./package.json', import.meta.url)
|
|
10
10
|
.website('https://www.npmjs.com/org/nice-move')
|
|
11
|
-
.
|
|
11
|
+
.commandSafe('@nice-move/lint/cmd/commit.mjs')
|
|
12
|
+
.commandSafe('@nice-move/lint/cmd/staged.mjs')
|
|
13
|
+
.commandSafe('@nice-move/lint/cmd/all.mjs')
|
|
12
14
|
.commandSmart(svgoCaller)
|
|
13
15
|
.setup();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Frontend develop helper for frontend development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"nice-move": "index.mjs"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nice-move/lint": "^0.
|
|
37
|
+
"@nice-move/lint": "^0.4.0",
|
|
38
38
|
"cheetor": "^0.12.2",
|
|
39
39
|
"execa": "^6.0.0",
|
|
40
40
|
"settingz": "^0.1.5"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": "^
|
|
43
|
+
"node": "^14.17.0 || >=16.13.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public",
|
|
47
47
|
"registry": "https://registry.npmjs.org/"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|
package/cmd/lint.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';
|
|
2
|
-
|
|
3
|
-
const requireJson = createRequire(import.meta.url);
|
|
4
|
-
|
|
5
|
-
const { description } = requireJson('@nice-move/lint/package.json');
|
|
6
|
-
|
|
7
|
-
export const command = 'lint';
|
|
8
|
-
|
|
9
|
-
export const describe = description;
|
|
10
|
-
|
|
11
|
-
export const builder = {
|
|
12
|
-
shell: {
|
|
13
|
-
alias: 'x',
|
|
14
|
-
default: false,
|
|
15
|
-
describe: 'skip parsing of tasks for better shell support',
|
|
16
|
-
type: 'boolean',
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { lint as handler } from '@nice-move/lint';
|