@gmcb/cli 0.7.2 → 0.7.4
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/CHANGELOG.md +16 -0
- package/lib/actions/build.js +2 -2
- package/lib/actions/publish.js +1 -1
- package/lib/apis/index.d.ts +1 -0
- package/lib/apis/index.js +7 -4
- package/lib/scripts/publish.js +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.7.4](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.7.3...@gmcb/cli@0.7.4) (2026-07-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @gmcb/cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.7.3](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.7.2...@gmcb/cli@0.7.3) (2026-07-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @gmcb/cli
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.7.2](http://10.10.10.16/caoben/front-end/compare/@gmcb/cli@0.7.1...@gmcb/cli@0.7.2) (2026-07-07)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @gmcb/cli
|
package/lib/actions/build.js
CHANGED
|
@@ -48,7 +48,7 @@ async function getCommands(...args) {
|
|
|
48
48
|
if (config_1.CONFIG_DATA.branch && config_1.CONFIG_DATA.branch !== 'false') {
|
|
49
49
|
opts.branch = config_1.CONFIG_DATA.branch;
|
|
50
50
|
}
|
|
51
|
-
if (opts.branch) {
|
|
51
|
+
if (!opts.env && opts.branch) {
|
|
52
52
|
try {
|
|
53
53
|
const git = (0, simple_git_1.default)();
|
|
54
54
|
const branch = await git.branch();
|
|
@@ -66,7 +66,7 @@ async function getCommands(...args) {
|
|
|
66
66
|
}
|
|
67
67
|
let commands = ['cross-env', 'NODE_ENV=production'];
|
|
68
68
|
const bin = (0, utils_1.getBinPath)(opts.compiler);
|
|
69
|
-
const buildEnv = ['master', 'main'].includes(opts.branch) ? 'prod' : opts.branch
|
|
69
|
+
const buildEnv = opts.env || (['master', 'main'].includes(opts.branch) ? 'prod' : opts.branch);
|
|
70
70
|
if (buildEnv) {
|
|
71
71
|
commands.push(`BUILD_ENV=${buildEnv}`);
|
|
72
72
|
process.env.BUILD_ENV = buildEnv;
|
package/lib/actions/publish.js
CHANGED
|
@@ -69,7 +69,7 @@ async function default_1(...args) {
|
|
|
69
69
|
// --remote 则提示热更新还是整包更新
|
|
70
70
|
if (opts.win || opts.apk) {
|
|
71
71
|
pub.updateMode = 1;
|
|
72
|
-
if (opts.remote) {
|
|
72
|
+
if (opts.remote && !config_1.CONFIG_DATA.publish?.updateMode) {
|
|
73
73
|
const { updateMode } = await inquirer_1.default.prompt([
|
|
74
74
|
{
|
|
75
75
|
type: 'list',
|
package/lib/apis/index.d.ts
CHANGED
package/lib/apis/index.js
CHANGED
|
@@ -114,8 +114,9 @@ async function uploadVersion(params) {
|
|
|
114
114
|
async function publishVersion(params) {
|
|
115
115
|
try {
|
|
116
116
|
const { brandName, brandId, appId, username, password, remoteUrl, versionName, versionCode, channel, versionDesc, platform, ...rest } = params;
|
|
117
|
-
const publishType = Number(rest.publishType
|
|
118
|
-
const updateType = Number(rest.updateType
|
|
117
|
+
const publishType = Number(rest.publishType || 3);
|
|
118
|
+
const updateType = Number(rest.updateType || 2);
|
|
119
|
+
const updateMode = Number(rest.updateMode || 0);
|
|
119
120
|
const { data: { accessToken }, } = await login({ username, password });
|
|
120
121
|
(0, http_1.setToken)(accessToken);
|
|
121
122
|
const { data: pageData } = await getVersionPage({ appId, publishType, pageNo: 1, pageSize: 10 });
|
|
@@ -175,6 +176,7 @@ async function publishVersion(params) {
|
|
|
175
176
|
channelType: const_1.CHANNEL_TYPE[channel],
|
|
176
177
|
platformType: const_1.PLATFORM_TYPE[platform],
|
|
177
178
|
updateType,
|
|
179
|
+
updateMode,
|
|
178
180
|
versionName,
|
|
179
181
|
versionNum: versionCode,
|
|
180
182
|
versionDesc: versionDesc || '修复一些已知问题',
|
|
@@ -193,6 +195,7 @@ async function publishVersion(params) {
|
|
|
193
195
|
appId,
|
|
194
196
|
appName: appItem?.name,
|
|
195
197
|
updateType,
|
|
198
|
+
updateMode,
|
|
196
199
|
versionName,
|
|
197
200
|
versionNum: versionCode,
|
|
198
201
|
versionDesc: versionDesc || '修复一些已知问题',
|
|
@@ -217,8 +220,8 @@ async function publishVersion(params) {
|
|
|
217
220
|
}
|
|
218
221
|
let fallbackFullUrl = existingVersion?.fullPackageUrl || latest?.fullPackageUrl || '';
|
|
219
222
|
let fallbackResUrl = existingVersion?.resourcePackageUrl || latest?.resourcePackageUrl || '';
|
|
220
|
-
if (
|
|
221
|
-
const isHotUpdate =
|
|
223
|
+
if (publishType == 1 && fullUrl) {
|
|
224
|
+
const isHotUpdate = updateMode == 2;
|
|
222
225
|
const hotResUrl = isHotUpdate ? (config_1.CONFIG_DATA.publish['_remoteResourceUrl'] || '') : '';
|
|
223
226
|
resUrl = hotResUrl;
|
|
224
227
|
fallbackFullUrl = '';
|
package/lib/scripts/publish.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmcb/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "工茂草本前端命令行工具",
|
|
5
5
|
"author": "yinjiazeng@163.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"@types/rimraf": "^4.0.5",
|
|
60
60
|
"@types/user-home": "^2.0.2"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "eec287c5c332a287626860538cd6085e955f8315"
|
|
63
63
|
}
|