create-valaxy 0.3.1 → 0.3.4
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 +1 -1
- package/index.js +12 -12
- package/package.json +8 -8
- package/template/.github/workflows/gh-pages.yml +1 -1
- package/template/package.json +2 -2
- package/template/tsconfig.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
@@ -8,7 +8,7 @@ const path = require('path')
|
|
8
8
|
const argv = require('minimist')(process.argv.slice(2))
|
9
9
|
const prompts = require('prompts')
|
10
10
|
const execa = require('execa')
|
11
|
-
const
|
11
|
+
const { bold, dim, blue, yellow, green, cyan, red, gray } = require('kolorist')
|
12
12
|
const { version } = require('./package.json')
|
13
13
|
|
14
14
|
const cwd = process.cwd()
|
@@ -20,7 +20,7 @@ const renameFiles = {
|
|
20
20
|
|
21
21
|
async function init() {
|
22
22
|
console.log()
|
23
|
-
console.log(` ${
|
23
|
+
console.log(` ${bold('🌌 Valaxy')} ${blue(`v${version}`)}`)
|
24
24
|
console.log()
|
25
25
|
|
26
26
|
let targetDir = argv._[0]
|
@@ -43,7 +43,7 @@ async function init() {
|
|
43
43
|
else {
|
44
44
|
const existing = fs.readdirSync(root)
|
45
45
|
if (existing.length) {
|
46
|
-
console.log(
|
46
|
+
console.log(yellow(` Target directory "${targetDir}" is not empty.`))
|
47
47
|
/**
|
48
48
|
* @type {{ yes: boolean }}
|
49
49
|
*/
|
@@ -61,9 +61,9 @@ async function init() {
|
|
61
61
|
}
|
62
62
|
}
|
63
63
|
|
64
|
-
console.log(` ${
|
64
|
+
console.log(` ${dim('📁')} ${dim(root)}`)
|
65
65
|
console.log()
|
66
|
-
console.log(
|
66
|
+
console.log(dim(' Scaffolding project in ') + targetDir + dim(' ...'))
|
67
67
|
|
68
68
|
const templateDir = path.join(__dirname, 'template')
|
69
69
|
const write = (file, content) => {
|
@@ -93,7 +93,7 @@ async function init() {
|
|
93
93
|
: /yarn/.test(process.env.npm_execpath) ? 'yarn' : 'npm'
|
94
94
|
|
95
95
|
const related = path.relative(cwd, root)
|
96
|
-
console.log(
|
96
|
+
console.log(green(' Done.\n'))
|
97
97
|
|
98
98
|
/**
|
99
99
|
* @type {{ yes: boolean }}
|
@@ -120,14 +120,14 @@ async function init() {
|
|
120
120
|
await execa(agent, ['run', 'dev'], { stdio: 'inherit', cwd: root })
|
121
121
|
}
|
122
122
|
else {
|
123
|
-
console.log(
|
123
|
+
console.log(dim('\n start it later by:\n'))
|
124
124
|
if (root !== cwd)
|
125
|
-
console.log(
|
125
|
+
console.log(blue(` cd ${bold(related)}`))
|
126
126
|
|
127
|
-
console.log(
|
128
|
-
console.log(
|
127
|
+
console.log(blue(` ${pkgManager === 'yarn' ? 'yarn' : `${pkgManager} install`}`))
|
128
|
+
console.log(blue(` ${pkgManager === 'yarn' ? 'yarn dev' : `${pkgManager} run dev`}`))
|
129
129
|
console.log()
|
130
|
-
console.log(` ${
|
130
|
+
console.log(` ${cyan('✨')}`)
|
131
131
|
console.log()
|
132
132
|
}
|
133
133
|
}
|
@@ -187,7 +187,7 @@ async function getValidPackageName(projectName) {
|
|
187
187
|
function emptyDir(dir) {
|
188
188
|
if (!fs.existsSync(dir))
|
189
189
|
return
|
190
|
-
console.log(
|
190
|
+
console.log(red(' Remove ') + gray(dir))
|
191
191
|
fs.rmSync(dir, { recursive: true, force: true })
|
192
192
|
}
|
193
193
|
|
package/package.json
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-valaxy",
|
3
|
-
"version": "0.3.
|
4
|
-
"main": "index.js",
|
3
|
+
"version": "0.3.4",
|
5
4
|
"description": "Create Starter Template for Valaxy",
|
6
|
-
"homepage": "https://valaxy.yyj.moe",
|
7
|
-
"repository": {
|
8
|
-
"type": "git",
|
9
|
-
"url": "https://github.com/YunYouJun/valaxy"
|
10
|
-
},
|
11
5
|
"author": {
|
12
6
|
"email": "me@yunyoujun.cn",
|
13
7
|
"name": "YunYouJun",
|
14
8
|
"url": "https://www.yunyoujun.cn"
|
15
9
|
},
|
10
|
+
"repository": {
|
11
|
+
"type": "git",
|
12
|
+
"url": "https://github.com/YunYouJun/valaxy"
|
13
|
+
},
|
16
14
|
"funding": "https://github.com/sponsors/YunYouJun",
|
15
|
+
"main": "index.js",
|
16
|
+
"homepage": "https://valaxy.yyj.moe",
|
17
17
|
"bin": {
|
18
18
|
"create-valaxy": "index.js"
|
19
19
|
},
|
@@ -21,8 +21,8 @@
|
|
21
21
|
"node": ">=14.0.0"
|
22
22
|
},
|
23
23
|
"dependencies": {
|
24
|
-
"chalk": "4",
|
25
24
|
"execa": "5",
|
25
|
+
"kolorist": "^1.5.1",
|
26
26
|
"minimist": "^1.2.6",
|
27
27
|
"prompts": "^2.4.2"
|
28
28
|
}
|
package/template/package.json
CHANGED