@nice-move/init 0.3.12 → 0.3.13
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/action/git-file.mjs +2 -0
- package/action/registry.mjs +1 -0
- package/bin/index.mjs +0 -0
- package/index.mjs +1 -1
- package/lib/latest.mjs +16 -17
- package/lib/utils.mjs +7 -1
- package/package.json +4 -4
- package/prompt/dependencies.mjs +10 -12
- package/prompt/git-init.mjs +1 -0
- package/prompt/index.mjs +1 -0
package/action/git-file.mjs
CHANGED
|
@@ -28,6 +28,7 @@ function getPlatform(context) {
|
|
|
28
28
|
]),
|
|
29
29
|
].sort();
|
|
30
30
|
}
|
|
31
|
+
|
|
31
32
|
throw new Error('fail');
|
|
32
33
|
} catch {
|
|
33
34
|
return Types[type()];
|
|
@@ -51,6 +52,7 @@ export async function GitFile() {
|
|
|
51
52
|
.onFail()
|
|
52
53
|
.onDone((oldText = '') => {
|
|
53
54
|
const platform = getPlatform(oldText);
|
|
55
|
+
|
|
54
56
|
return download(`https://gitignore.io/api/node,${platform}`)
|
|
55
57
|
.then((newText) => {
|
|
56
58
|
const [match] = oldText.match(regexp) || [];
|
package/action/registry.mjs
CHANGED
package/bin/index.mjs
CHANGED
|
File without changes
|
package/index.mjs
CHANGED
|
@@ -30,8 +30,8 @@ export async function init() {
|
|
|
30
30
|
].filter((func) => typeof func === 'function');
|
|
31
31
|
|
|
32
32
|
for (const action of actions) {
|
|
33
|
-
// eslint-disable-next-line no-await-in-loop
|
|
34
33
|
const io = await action();
|
|
34
|
+
|
|
35
35
|
if (io && io.catch) {
|
|
36
36
|
io.catch((error) => {
|
|
37
37
|
console.warn(error.message);
|
package/lib/latest.mjs
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
ava: '^
|
|
3
|
-
|
|
4
|
-
eslint: '^
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
typescript: '^4.5.2',
|
|
2
|
+
ava: '^4.0.1',
|
|
3
|
+
eslint: '^8.8.0',
|
|
4
|
+
'eslint-plugin-ava': '^13.2.0',
|
|
5
|
+
garou: '^0.3.11',
|
|
6
|
+
prettier: '^2.5.1',
|
|
7
|
+
stylelint: '^14.3.0',
|
|
8
|
+
typescript: '^4.5.5',
|
|
10
9
|
'@bring-it/cli': '^0.5.6',
|
|
11
|
-
'@playwright/test': '^1.
|
|
12
|
-
'@types/react': '^16.14.
|
|
13
|
-
postcss: '^8.
|
|
10
|
+
'@playwright/test': '^1.18.1',
|
|
11
|
+
'@types/react': '^16.14.23',
|
|
12
|
+
postcss: '^8.4.6',
|
|
14
13
|
react: '~16.14.0',
|
|
15
14
|
'react-dom': '~16.14.0',
|
|
16
15
|
rustywind: '^0.12.2',
|
|
17
|
-
tailwindcss: '~
|
|
16
|
+
tailwindcss: '~3.0.19',
|
|
18
17
|
vue: '~2.6.14',
|
|
19
|
-
'eslint-config-base': '^0.
|
|
20
|
-
'stylelint-config': '^0.6.
|
|
21
|
-
'prettier-config': '^0.5.
|
|
22
|
-
'commitlint-config': '^0.
|
|
23
|
-
cli: '^0.
|
|
18
|
+
'eslint-config-base': '^0.6.1',
|
|
19
|
+
'stylelint-config': '^0.6.14',
|
|
20
|
+
'prettier-config': '^0.5.2',
|
|
21
|
+
'commitlint-config': '^0.5.0',
|
|
22
|
+
cli: '^0.7.0',
|
|
24
23
|
lts: '^12.22.0 || ^14.17.0 || >=16.13.0',
|
|
25
24
|
};
|
package/lib/utils.mjs
CHANGED
|
@@ -12,13 +12,16 @@ export function download(url) {
|
|
|
12
12
|
if (response.statusCode === 301) {
|
|
13
13
|
return download(response.headers.location);
|
|
14
14
|
}
|
|
15
|
+
|
|
15
16
|
return response.text();
|
|
16
17
|
})
|
|
17
18
|
.then((response) => {
|
|
18
19
|
const data = response.trim();
|
|
20
|
+
|
|
19
21
|
if (data) {
|
|
20
22
|
return data;
|
|
21
23
|
}
|
|
24
|
+
|
|
22
25
|
throw new Error('template download fail');
|
|
23
26
|
});
|
|
24
27
|
}
|
|
@@ -26,6 +29,7 @@ export function download(url) {
|
|
|
26
29
|
export async function gitSupport() {
|
|
27
30
|
try {
|
|
28
31
|
const { stdout } = await execa('git', ['--version']);
|
|
32
|
+
|
|
29
33
|
return Boolean(stdout);
|
|
30
34
|
} catch {
|
|
31
35
|
return false;
|
|
@@ -57,5 +61,7 @@ export async function getAuthor(author) {
|
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
export async function getAuthorName(author) {
|
|
60
|
-
|
|
64
|
+
const info = await getAuthor(author);
|
|
65
|
+
|
|
66
|
+
return info.name || 'Unknown';
|
|
61
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/init",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Initialize your frontend workspaces",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
"main": "index.mjs",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"centra": "^2.5.0",
|
|
44
|
-
"chalk": "^
|
|
44
|
+
"chalk": "^5.0.0",
|
|
45
45
|
"deepmerge": "^4.2.2",
|
|
46
46
|
"execa": "^6.0.0",
|
|
47
47
|
"fs-chain": "^8.1.1",
|
|
48
48
|
"is-git-dirty": "^2.0.1",
|
|
49
49
|
"is-git-repository": "^2.0.0",
|
|
50
50
|
"ora": "^6.0.1",
|
|
51
|
-
"os-locale": "^6.0.
|
|
51
|
+
"os-locale": "^6.0.2",
|
|
52
52
|
"parse-author": "^2.0.0",
|
|
53
53
|
"prompts": "^2.4.2",
|
|
54
54
|
"semver-regex": "^4.0.2",
|
|
55
|
-
"settingz": "^0.1.
|
|
55
|
+
"settingz": "^0.1.5",
|
|
56
56
|
"stringify-author": "^0.1.3",
|
|
57
57
|
"user-meta": "^1.0.0",
|
|
58
58
|
"validate-npm-package-name": "^3.0.0",
|
package/prompt/dependencies.mjs
CHANGED
|
@@ -49,7 +49,7 @@ function action(isGit, wanted = {}) {
|
|
|
49
49
|
const useLint = eslint || stylelint || prettier || garou;
|
|
50
50
|
|
|
51
51
|
const prepublishOnly = [
|
|
52
|
-
useLint ? 'npm run lint' : undefined,
|
|
52
|
+
useLint ? 'npm run lint:staged' : undefined,
|
|
53
53
|
ava ? 'npm test' : undefined,
|
|
54
54
|
].filter(Boolean);
|
|
55
55
|
|
|
@@ -62,7 +62,12 @@ function action(isGit, wanted = {}) {
|
|
|
62
62
|
if (commitlint) {
|
|
63
63
|
await new Text()
|
|
64
64
|
.onDone(() =>
|
|
65
|
-
[
|
|
65
|
+
[
|
|
66
|
+
'#!/bin/sh',
|
|
67
|
+
'',
|
|
68
|
+
'npx --no-install nice-move lint commit',
|
|
69
|
+
'',
|
|
70
|
+
].join('\n'),
|
|
66
71
|
)
|
|
67
72
|
.output('.githooks/commit-msg');
|
|
68
73
|
}
|
|
@@ -91,24 +96,17 @@ function action(isGit, wanted = {}) {
|
|
|
91
96
|
},
|
|
92
97
|
}
|
|
93
98
|
: undefined,
|
|
94
|
-
commitlint
|
|
99
|
+
useLint || commitlint
|
|
95
100
|
? {
|
|
96
|
-
commitlint: {
|
|
97
|
-
extends: '@nice-move/commitlint-config',
|
|
98
|
-
},
|
|
99
101
|
devDependencies: {
|
|
100
|
-
|
|
101
|
-
'@nice-move/commitlint-config': latest['commitlint-config'],
|
|
102
|
+
'@nice-move/cli': latest.cli,
|
|
102
103
|
},
|
|
103
104
|
}
|
|
104
105
|
: undefined,
|
|
105
106
|
useLint
|
|
106
107
|
? {
|
|
107
|
-
devDependencies: {
|
|
108
|
-
'@nice-move/cli': latest.cli,
|
|
109
|
-
},
|
|
110
108
|
scripts: {
|
|
111
|
-
lint: 'nice-move lint',
|
|
109
|
+
'lint:staged': 'nice-move lint staged',
|
|
112
110
|
},
|
|
113
111
|
}
|
|
114
112
|
: undefined,
|
package/prompt/git-init.mjs
CHANGED