@varlet/cli 3.7.4 → 3.8.0-alpha.1735486215545

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 CHANGED
@@ -139,6 +139,8 @@ varlet-cli build
139
139
  ```shell
140
140
  # playground-ignore
141
141
  varlet-cli preview
142
+ # set port number
143
+ varlet-cli preview -p <port>
142
144
  ```
143
145
 
144
146
  #### Compile component library
package/README.zh-CN.md CHANGED
@@ -138,6 +138,8 @@ varlet-cli build
138
138
  ```shell
139
139
  # playground-ignore
140
140
  varlet-cli preview
141
+ # set port number
142
+ varlet-cli preview -p <port>
141
143
  ```
142
144
 
143
145
  #### 构建组件库
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
- .action(async () => {
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')
@@ -1 +1,4 @@
1
- export declare function preview(): Promise<void>;
1
+ export type PreviewCommandOptions = {
2
+ port?: string;
3
+ };
4
+ export declare function preview(options: PreviewCommandOptions): Promise<void>;
@@ -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', ['--port=5500'], { nodeOptions: { cwd: SITE_OUTPUT_PATH, stdio: 'inherit' } });
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.7.4",
3
+ "version": "3.8.0-alpha.1735486215545",
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.1",
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/vite-plugins": "3.7.4",
65
- "@varlet/shared": "3.7.4"
64
+ "@varlet/vite-plugins": "3.8.0-alpha.1735486215545",
65
+ "@varlet/shared": "3.8.0-alpha.1735486215545"
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/icons": "3.7.4",
78
- "@varlet/ui": "3.7.4",
79
- "@varlet/touch-emulator": "3.7.4"
77
+ "@varlet/icons": "3.8.0-alpha.1735486215545",
78
+ "@varlet/ui": "3.8.0-alpha.1735486215545",
79
+ "@varlet/touch-emulator": "3.8.0-alpha.1735486215545"
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.7.4",
91
- "@varlet/ui": "3.7.4",
92
- "@varlet/touch-emulator": "3.7.4"
90
+ "@varlet/icons": "3.8.0-alpha.1735486215545",
91
+ "@varlet/ui": "3.8.0-alpha.1735486215545",
92
+ "@varlet/touch-emulator": "3.8.0-alpha.1735486215545"
93
93
  },
94
94
  "scripts": {
95
95
  "dev": "tsc --watch",