@varlet/cli 3.7.4 → 3.8.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 +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/node/bin.js +3 -2
- package/lib/node/commands/preview.d.ts +4 -1
- package/lib/node/commands/preview.js +3 -2
- package/package.json +10 -10
package/README.md
CHANGED
package/README.zh-CN.md
CHANGED
package/lib/node/bin.js
CHANGED
|
@@ -58,9 +58,10 @@ program
|
|
|
58
58
|
program
|
|
59
59
|
.command('preview')
|
|
60
60
|
.description('Preview varlet site for production')
|
|
61
|
-
.
|
|
61
|
+
.option('-p, --port <port>', 'port number')
|
|
62
|
+
.action(async (options) => {
|
|
62
63
|
const { preview } = await import('./commands/preview.js');
|
|
63
|
-
return preview();
|
|
64
|
+
return preview(options);
|
|
64
65
|
});
|
|
65
66
|
program
|
|
66
67
|
.command('compile')
|
|
@@ -3,13 +3,14 @@ import logger from '../shared/logger.js';
|
|
|
3
3
|
import { x } from 'tinyexec';
|
|
4
4
|
import { SITE_OUTPUT_PATH } from '../shared/constant.js';
|
|
5
5
|
const { pathExistsSync } = fse;
|
|
6
|
-
export async function preview() {
|
|
6
|
+
export async function preview(options) {
|
|
7
|
+
const { port = 5500 } = options;
|
|
7
8
|
if (!pathExistsSync(SITE_OUTPUT_PATH)) {
|
|
8
9
|
logger.warning('Cannot find the site folder, you must first run the build command to build the document site');
|
|
9
10
|
return;
|
|
10
11
|
}
|
|
11
12
|
try {
|
|
12
|
-
await x('live-server', [
|
|
13
|
+
await x('live-server', [`--port=${Number(port)}`], { nodeOptions: { cwd: SITE_OUTPUT_PATH, stdio: 'inherit' } });
|
|
13
14
|
}
|
|
14
15
|
catch (e) {
|
|
15
16
|
logger.error(e.toString());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "cli of varlet",
|
|
6
6
|
"bin": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@babel/preset-typescript": "^7.24.7",
|
|
38
38
|
"@inquirer/prompts": "^6.0.1",
|
|
39
39
|
"@varlet/icon-builder": "0.2.14",
|
|
40
|
-
"@varlet/release": "^0.3.
|
|
40
|
+
"@varlet/release": "^0.3.2",
|
|
41
41
|
"@vitejs/plugin-vue": "5.1.4",
|
|
42
42
|
"@vitejs/plugin-vue-jsx": "4.0.1",
|
|
43
43
|
"@vue/babel-plugin-jsx": "1.2.5",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"vite": "5.4.6",
|
|
62
62
|
"vitest": "2.1.1",
|
|
63
63
|
"vue": "3.4.21",
|
|
64
|
-
"@varlet/
|
|
65
|
-
"@varlet/
|
|
64
|
+
"@varlet/shared": "3.8.0",
|
|
65
|
+
"@varlet/vite-plugins": "3.8.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/babel__core": "^7.20.1",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"@types/node": "^18.7.20",
|
|
75
75
|
"@types/sharp": "0.31.1",
|
|
76
76
|
"rimraf": "^5.0.1",
|
|
77
|
-
"@varlet/
|
|
78
|
-
"@varlet/
|
|
79
|
-
"@varlet/
|
|
77
|
+
"@varlet/touch-emulator": "3.8.0",
|
|
78
|
+
"@varlet/icons": "3.8.0",
|
|
79
|
+
"@varlet/ui": "3.8.0"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@vitest/coverage-istanbul": "2.0.5",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"live-server": "^1.2.1",
|
|
88
88
|
"vue": "3.4.21",
|
|
89
89
|
"vue-router": "4.2.0",
|
|
90
|
-
"@varlet/icons": "3.
|
|
91
|
-
"@varlet/ui": "3.
|
|
92
|
-
"@varlet/touch-emulator": "3.
|
|
90
|
+
"@varlet/icons": "3.8.0",
|
|
91
|
+
"@varlet/ui": "3.8.0",
|
|
92
|
+
"@varlet/touch-emulator": "3.8.0"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"dev": "tsc --watch",
|