qdmp-cli 0.0.1 → 0.0.3

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
@@ -4,9 +4,9 @@
4
4
 
5
5
 
6
6
  ## ✨ 功能特性
7
- - 项目初始化与模板管理
7
+ - 项目初始化与模板选择
8
8
  - 用户认证与权限管理
9
- - 小程序版本上传与发布
9
+ - 小程序版本上传
10
10
  - 开发工作流自动化
11
11
 
12
12
  ## 🚀 快速开始
@@ -15,3 +15,30 @@
15
15
  ```bash
16
16
  npm install -g qdmp-cli
17
17
  ```
18
+
19
+ ### 根目录下配置 qdmp.json
20
+ ```json
21
+ {
22
+ "appId": "your_app_id",
23
+ }
24
+ ```
25
+ ### 初始化项目
26
+ ```bash
27
+ qdmp-cli create [options] <app-name>
28
+ ```
29
+ ### 查看可选模版
30
+ ```bash
31
+ qdmp-cli list
32
+ ```
33
+ ### 登录
34
+ ```bash
35
+ qdmp-cli login
36
+ ```
37
+ ### 查看当前用户
38
+ ```bash
39
+ qdmp-cli getMe
40
+ ```
41
+ ### 上传版本
42
+ ```bash
43
+ qdmp-cli upload
44
+ ```
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "qdmp-cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "qdmp-cli",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
10
- "bin": "./index.js",
11
- "keywords": [],
10
+ "bin": {
11
+ "qdmp": "./index.js",
12
+ "qdmp-cli": "./index.js"
13
+ },
14
+ "keywords": [
15
+ "千岛小程序",
16
+ "千岛小程序脚手架"
17
+ ],
12
18
  "author": "zhangyanran",
13
19
  "license": "ISC",
14
20
  "dependencies": {
@@ -20,9 +26,5 @@
20
26
  "ora": "^8.2.0",
21
27
  "shelljs": "^0.10.0",
22
28
  "table": "^6.9.0"
23
- },
24
- "publishConfig": {
25
- "@frontend:registry": " http://g.echo.tech/api/v4/projects/1107/packages/npm/"
26
29
  }
27
-
28
30
  }
package/utils/common.js CHANGED
@@ -47,7 +47,7 @@ export const isUrlAccessible = async (url) => {
47
47
  */
48
48
  export async function renameDistFolder(dirname, newname) {
49
49
  try {
50
- execSync(`rm -rf ./h5`, { stdio: "inherit" });
50
+ if (fs.existsSync(newname)) return true;
51
51
  execSync(`mv ${dirname} ${newname}`, { stdio: "inherit" });
52
52
  return true;
53
53
  } catch (e) {
@@ -89,7 +89,14 @@ async function compressProject(output, dirname = "") {
89
89
  */
90
90
  async function copyDistFolder(dirname) {
91
91
  try {
92
- execSync(`cp -r ${dirname} ./${WORKSPACE_DIR}`, {
92
+ const indexPath = execSync(`find ${dirname} -name index.html -print -quit`)
93
+ .toString()
94
+ .trim();
95
+ if (!indexPath) {
96
+ throw new Error("未找到index.html文件");
97
+ }
98
+ const parentDir = path.dirname(indexPath);
99
+ execSync(`cp -r ${parentDir} ./${WORKSPACE_DIR}`, {
93
100
  stdio: "inherit",
94
101
  });
95
102
  return true;