ylyx-cli 1.0.13 → 1.0.14

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
@@ -2,6 +2,8 @@
2
2
 
3
3
  公司内部使用的项目脚手架工具:支持交互式/命令式生成项目与代码模板,并提供 `.ylyxrc.json` 项目配置、环境配置切换(`isDev`)、以及一键部署(测试服上传/正式服打包压缩)等能力。
4
4
 
5
+ > 说明:当前部署/配置切换能力**暂时只针对 Vue2 项目约定**(如 `.env.production` 的 `VUE_APP_PUBLIC_URL` 等)。其它技术栈/项目结构可能需要你根据实际情况调整 `.ylyxrc.json` 与相关路径配置。
6
+
5
7
  ## 功能特性
6
8
 
7
9
  - 🚀 **快速生成项目代码**:内置多种模板,一键生成项目/组件/模块代码
package/lib/deploy.js CHANGED
@@ -254,8 +254,16 @@ function resolveDeployConfig(overrides = {}) {
254
254
  const inferredLocalDir =
255
255
  deploy.localDir ||
256
256
  inferredFromEnvProd ||
257
- (projectConfig && projectConfig.buildDir ? path.resolve(process.cwd(), projectConfig.buildDir) : null) ||
258
- './EXTERNAL_DIGIC';
257
+ (projectConfig && projectConfig.buildDir ? path.resolve(process.cwd(), projectConfig.buildDir) : null);
258
+
259
+ if (!inferredLocalDir) {
260
+ throw new Error(
261
+ '无法确定 deploy.localDir(本地打包目录)。请设置以下任意一种:\n' +
262
+ '- 在 .ylyxrc.json 配置 deploy.localDir\n' +
263
+ '- 在项目 .env.production 配置 VUE_APP_PUBLIC_URL(相对路径,如 /dist/app/)\n' +
264
+ '- 在 .ylyxrc.json 配置 buildDir(可相对/绝对路径)'
265
+ );
266
+ }
259
267
 
260
268
  const cfg = {
261
269
  env: overrides.env ?? deploy.env,
@@ -265,7 +273,7 @@ function resolveDeployConfig(overrides = {}) {
265
273
  username: overrides.username ?? deploy.username,
266
274
  password: overrides.password ?? deploy.password,
267
275
  localDir: overrides.localDir ?? inferredLocalDir,
268
- remoteDir: overrides.remoteDir ?? deploy.remoteDir ?? '/usr/local/nginx/html/EXTERNAL_DIGIC',
276
+ remoteDir: overrides.remoteDir ?? deploy.remoteDir,
269
277
  zipAfter: overrides.zipAfter ?? deploy.zipAfter ?? false,
270
278
  zipOutDir: overrides.zipOutDir ?? deploy.zipOutDir ?? path.join(process.cwd(), '.ylyx-deploy'),
271
279
  };
@@ -316,7 +324,9 @@ async function deploy(overrides = {}) {
316
324
  if (!cfg.host) throw new Error('缺少 deploy.host(测试服上传需要)');
317
325
  if (!cfg.username) throw new Error('缺少 deploy.username(测试服上传需要)');
318
326
  if (!cfg.password) throw new Error('缺少 deploy.password(测试服上传需要)');
319
- if (!remoteFolderPath) throw new Error('缺少 deploy.remoteDir(测试服上传需要)');
327
+ if (!remoteFolderPath) {
328
+ throw new Error('缺少 deploy.remoteDir(测试服上传需要):请在 .ylyxrc.json 的 deploy.remoteDir 配置远端部署目录');
329
+ }
320
330
 
321
331
  let Client;
322
332
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ylyx-cli",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "公司内部代码生成模板脚手架工具,支持快速生成项目初始结构和代码模板",
5
5
  "main": "lib/index.js",
6
6
  "bin": {