zmp-cli 3.5.3-0 → 3.5.3-rc.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.git.md ADDED
@@ -0,0 +1,37 @@
1
+ # ZMP-CLI
2
+ CLI dùng để start, build, deploy Zalo Mini App
3
+
4
+ ## Contribute
5
+ Project bao gồm các nhánh:
6
+ - master: nhánh chính tương ứng với version đang release
7
+ - develop: nhánh chính, source code mới nhất bao gồm các tính năng chuẩn bị cho lần release tiếp theo
8
+ - feature/*: nhánh tương ứng với chức năng đang phát triển (xoá sau khi hoàn thành)
9
+ - release/*-rc: nhánh tương ứng với các release candidate (xoá sau khi hoàn thành)
10
+ - hotfix/*: nhánh tương ứng với bug cần fix cho version đang release (xoá sau khi hoàn thành)
11
+
12
+ Suggest sử dụng git flow để quản lí các nhánh:
13
+ 1. Cài đặt và tìm hiểu git flow theo [hướng dẫn](https://danielkummer.github.io/git-flow-cheatsheet/index.vi_VN.html)
14
+ 2. Init git flow tương ứng với các branch trên: ```git flow init```
15
+
16
+ Phát triển một tính năng mới:
17
+ 1. Để bắt đầu code tính năng mới: ```git flow feature start feature_1```
18
+ 2. Sau khi code và test xong: ```git flow feature finish feature_1```, tính năng sẽ được merge vào nhánh develop
19
+
20
+ Tạo một release candidate (suffix "-rc"):
21
+ 1. ```git flow release start <major>.<minor>.<patch>-rc```
22
+ 2. Sau khi test xong: ```git flow release finish <major>.<minor>.<patch>-rc```, tính năng sẽ được merge vào nhánh master để chờ release và nhánh develop
23
+
24
+ Để fix bug trên bản release:
25
+ 1. ```git flow hotfix start bug-a```
26
+ 2. Sau khi fix xong: ```git flow hotfix finish bug-a```, tính năng sẽ được merge vào nhánh master để chờ release và nhánh develop
27
+
28
+ Để fix bug trên bản release-candidate:
29
+ 1. Tạo nhánh mới từ nhánh rc muốn fix với refix: ```git branch ```
30
+ 2. Sau khi fix xong: ```git flow hotfix finish bug-a```, tính năng sẽ được merge vào nhánh master để chờ release và nhánh develop
31
+
32
+ Để release nhánh master:
33
+ 1. ```npm run release```
34
+ 2. Nhập version:
35
+ - patch: fix bug
36
+ - minor: thêm tính năng
37
+ - major: thay đổi lớn có ảnh hưởng tới version cũ
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  module.exports = {
4
+ filename: {
5
+ appConfig: 'app-config.json',
6
+ zmpConfig: 'zmp-cli.json'
7
+ },
4
8
  api_domain: {
5
9
  dev: 'https://dev-zmp-api.developers.zalo.me/',
6
10
  prod: 'https://zmp-api.developers.zalo.me/'
7
11
  },
8
12
  zdn_url: {
9
- dev: 'https://dev.h5.zalo.me/zapps/',
10
- prod: 'https://h5.zdn.vn/zapps/'
13
+ dev: '//dev.h5.zalo.me/zapps/',
14
+ prod: '//h5.zdn.vn/zapps/'
11
15
  },
12
16
  path: {
13
17
  login: 'admin/login',
@@ -19,24 +23,30 @@ module.exports = {
19
23
  getAppInfo: 'app/get-info'
20
24
  },
21
25
  dirname: __dirname,
22
- root_env: "".concat(process.cwd(), "/.env"),
26
+ root_env: function root_env() {
27
+ return "".concat(process.cwd(), "/.env");
28
+ },
23
29
  env: {
24
30
  appId: 'APP_ID',
25
31
  token: 'ZMP_TOKEN'
26
32
  },
27
33
  error_code: {
34
+ app_config_not_found: -1400,
28
35
  permission_denied: -2001,
29
36
  request_timeout: -2003
30
37
  },
31
38
  error_msg: {
39
+ app_config_not_found: "App config not found. Please re-init project. (Tips: Run 'zmp init')",
32
40
  permission_denied: "Permission denied. Please login again. (Tips: Run 'zmp login')",
33
41
  request_timeout: 'Request Timeout'
34
42
  },
35
43
  resumable_option: {
36
- chunkSize: 10 * 1024,
44
+ chunkSize: 512 * 1000,
45
+ // bytes -> 512kb/chunk
37
46
  simultaneousUploads: 4,
38
47
  testChunks: true,
39
48
  throttleProgressCallbacks: 1,
40
- method: 'octet'
49
+ method: 'octet',
50
+ forceChunkSize: false
41
51
  }
42
52
  };
package/config/index.js CHANGED
@@ -39,11 +39,11 @@ module.exports = {
39
39
  request_timeout: 'Request Timeout',
40
40
  },
41
41
  resumable_option: {
42
- chunkSize: 10 * 1024,
42
+ chunkSize: 512 * 1000, // bytes -> 512kb/chunk
43
43
  simultaneousUploads: 4,
44
44
  testChunks: true,
45
45
  throttleProgressCallbacks: 1,
46
46
  method: 'octet',
47
- forceChunkSize: true,
47
+ forceChunkSize: false,
48
48
  },
49
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-cli",
3
- "version": "3.5.3-0",
3
+ "version": "3.5.3-rc.0",
4
4
  "description": "ZMP command line utility (CLI)",
5
5
  "main": "index.js",
6
6
  "bin": {