react-native-update-cli 2.8.5 → 2.9.1
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/lib/api.d.ts +18 -0
- package/lib/app.d.ts +38 -0
- package/lib/app.js +5 -4
- package/lib/bundle-pack.d.ts +1 -0
- package/lib/bundle-pack.js +104 -0
- package/lib/bundle-runner.d.ts +20 -0
- package/lib/bundle-runner.js +404 -0
- package/lib/bundle.d.ts +6 -0
- package/lib/bundle.js +73 -471
- package/lib/diff.d.ts +13 -0
- package/lib/diff.js +144 -123
- package/lib/exports.d.ts +12 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +5 -13
- package/lib/install.d.ts +4 -0
- package/lib/locales/en.d.ts +137 -0
- package/lib/locales/zh.d.ts +136 -0
- package/lib/module-manager.d.ts +20 -0
- package/lib/module-manager.js +3 -9
- package/lib/modules/app-module.d.ts +2 -0
- package/lib/modules/app-module.js +84 -44
- package/lib/modules/bundle-module.d.ts +2 -0
- package/lib/modules/bundle-module.js +7 -8
- package/lib/modules/index.d.ts +6 -0
- package/lib/modules/package-module.d.ts +2 -0
- package/lib/modules/user-module.d.ts +2 -0
- package/lib/modules/user-module.js +55 -44
- package/lib/modules/version-module.d.ts +2 -0
- package/lib/package.d.ts +59 -0
- package/lib/package.js +110 -139
- package/lib/provider.d.ts +26 -0
- package/lib/provider.js +115 -217
- package/lib/types.d.ts +120 -0
- package/lib/user.d.ts +8 -0
- package/lib/utils/add-gitignore.d.ts +1 -0
- package/lib/utils/app-info-parser/aab.d.ts +22 -0
- package/lib/utils/app-info-parser/aab.js +0 -4
- package/lib/utils/app-info-parser/apk.d.ts +14 -0
- package/lib/utils/app-info-parser/apk.js +6 -4
- package/lib/utils/app-info-parser/app.d.ts +4 -0
- package/lib/utils/app-info-parser/app.js +3 -0
- package/lib/utils/app-info-parser/index.d.ts +16 -0
- package/lib/utils/app-info-parser/index.js +2 -0
- package/lib/utils/app-info-parser/ipa.d.ts +14 -0
- package/lib/utils/app-info-parser/ipa.js +1 -1
- package/lib/utils/app-info-parser/resource-finder.d.ts +49 -0
- package/lib/utils/app-info-parser/utils.d.ts +31 -0
- package/lib/utils/app-info-parser/utils.js +1 -0
- package/lib/utils/app-info-parser/xml-parser/binary.d.ts +56 -0
- package/lib/utils/app-info-parser/xml-parser/manifest.d.ts +10 -0
- package/lib/utils/app-info-parser/zip.d.ts +18 -0
- package/lib/utils/app-info-parser/zip.js +7 -9
- package/lib/utils/check-lockfile.d.ts +1 -0
- package/lib/utils/check-plugin.d.ts +7 -0
- package/lib/utils/command-result.d.ts +3 -0
- package/lib/utils/command-result.js +35 -0
- package/lib/utils/constants.d.ts +9 -0
- package/lib/utils/dep-versions.d.ts +1 -0
- package/lib/utils/git.d.ts +8 -0
- package/lib/utils/http-helper.d.ts +4 -0
- package/lib/utils/i18n.d.ts +12 -0
- package/lib/utils/index.d.ts +22 -0
- package/lib/utils/index.js +52 -22
- package/lib/utils/latest-version/cli.d.ts +1 -0
- package/lib/utils/latest-version/cli.js +24 -60
- package/lib/utils/latest-version/index.d.ts +146 -0
- package/lib/utils/latest-version/index.js +22 -22
- package/lib/utils/options.d.ts +4 -0
- package/lib/utils/options.js +63 -0
- package/lib/utils/plugin-config.d.ts +9 -0
- package/lib/utils/zip-entries.d.ts +3 -0
- package/lib/versions.d.ts +43 -0
- package/lib/workflow-runner.d.ts +2 -0
- package/lib/workflow-runner.js +25 -0
- package/package.json +20 -5
- package/src/api.ts +1 -1
- package/src/app.ts +20 -11
- package/src/bundle-pack.ts +51 -0
- package/src/bundle-runner.ts +463 -0
- package/src/bundle.ts +184 -571
- package/src/diff.ts +208 -174
- package/src/index.ts +15 -17
- package/src/module-manager.ts +15 -15
- package/src/modules/app-module.ts +120 -48
- package/src/modules/bundle-module.ts +21 -11
- package/src/modules/package-module.ts +0 -1
- package/src/modules/user-module.ts +117 -58
- package/src/package.ts +163 -138
- package/src/provider.ts +164 -240
- package/src/types.ts +13 -8
- package/src/utils/app-info-parser/aab.ts +0 -7
- package/src/utils/app-info-parser/apk.ts +9 -6
- package/src/utils/app-info-parser/app.ts +5 -1
- package/src/utils/app-info-parser/index.ts +11 -6
- package/src/utils/app-info-parser/ipa.ts +1 -1
- package/src/utils/app-info-parser/utils.ts +3 -0
- package/src/utils/app-info-parser/xml-parser/manifest.ts +3 -1
- package/src/utils/app-info-parser/zip.ts +12 -14
- package/src/utils/command-result.ts +24 -0
- package/src/utils/index.ts +138 -39
- package/src/utils/latest-version/cli.ts +22 -20
- package/src/utils/latest-version/index.ts +20 -20
- package/src/utils/options.ts +56 -0
- package/src/utils/zip-entries.ts +1 -1
- package/src/workflow-runner.ts +24 -0
- package/index.js +0 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
addedToGitignore: string;
|
|
3
|
+
androidCrunchPngsWarning: string;
|
|
4
|
+
aabOpenApksFailed: string;
|
|
5
|
+
aabReadUniversalApkFailed: string;
|
|
6
|
+
aabUniversalApkNotFound: string;
|
|
7
|
+
aabBundletoolDownloadHint: string;
|
|
8
|
+
aabManifestNotFound: string;
|
|
9
|
+
aabParseResourcesWarning: string;
|
|
10
|
+
aabParseFailed: string;
|
|
11
|
+
aabParseManifestError: string;
|
|
12
|
+
aabParseResourcesError: string;
|
|
13
|
+
appId: string;
|
|
14
|
+
appIdMismatchApk: string;
|
|
15
|
+
appIdMismatchApp: string;
|
|
16
|
+
appIdMismatchIpa: string;
|
|
17
|
+
appKeyMismatchApk: string;
|
|
18
|
+
appKeyMismatchApp: string;
|
|
19
|
+
appKeyMismatchIpa: string;
|
|
20
|
+
appName: string;
|
|
21
|
+
appNameQuestion: string;
|
|
22
|
+
appNotSelected: string;
|
|
23
|
+
appUploadSuccess: string;
|
|
24
|
+
apkUploadSuccess: string;
|
|
25
|
+
boundTo: string;
|
|
26
|
+
buildTimeNotFound: string;
|
|
27
|
+
bundleCommandError: string;
|
|
28
|
+
bundleNotFound: string;
|
|
29
|
+
bundlingWithRN: string;
|
|
30
|
+
cancelled: string;
|
|
31
|
+
composingSourceMap: string;
|
|
32
|
+
copyFileFailed: string;
|
|
33
|
+
copyHarmonyBundleError: string;
|
|
34
|
+
copyingDebugId: string;
|
|
35
|
+
createAppSuccess: string;
|
|
36
|
+
deleteFile: string;
|
|
37
|
+
deletingFile: string;
|
|
38
|
+
enterAppIdQuestion: string;
|
|
39
|
+
enterNativePackageId: string;
|
|
40
|
+
errorInHarmonyApp: string;
|
|
41
|
+
expiredStatus: string;
|
|
42
|
+
failedToParseIcon: string;
|
|
43
|
+
failedToParseUpdateJson: string;
|
|
44
|
+
fileGenerated: string;
|
|
45
|
+
fileSizeExceeded: string;
|
|
46
|
+
forceHermes: string;
|
|
47
|
+
hermesEnabledCompiling: string;
|
|
48
|
+
ipaUploadSuccess: string;
|
|
49
|
+
keyStrings: string;
|
|
50
|
+
latestVersionTag: string;
|
|
51
|
+
lockBestPractice: string;
|
|
52
|
+
lockNotFound: string;
|
|
53
|
+
loggedOut: string;
|
|
54
|
+
loginExpired: string;
|
|
55
|
+
loginFirst: string;
|
|
56
|
+
multipleLocksFound: string;
|
|
57
|
+
nativePackageId: string;
|
|
58
|
+
nativeVersion: string;
|
|
59
|
+
nativeVersionNotFoundGte: string;
|
|
60
|
+
nativeVersionNotFoundLte: string;
|
|
61
|
+
nativeVersionNotFoundMatch: string;
|
|
62
|
+
nativePackageIdNotFound: string;
|
|
63
|
+
noPackagesFound: string;
|
|
64
|
+
offset: string;
|
|
65
|
+
operationComplete: string;
|
|
66
|
+
operationSuccess: string;
|
|
67
|
+
packageIdRequired: string;
|
|
68
|
+
packageUploadSuccess: string;
|
|
69
|
+
depsChangeSummary: string;
|
|
70
|
+
depsChangeTargetPackage: string;
|
|
71
|
+
depsChangeDependencyHeader: string;
|
|
72
|
+
depsChangeVersionHeader: string;
|
|
73
|
+
depsChangeAddedLabel: string;
|
|
74
|
+
depsChangeRemovedLabel: string;
|
|
75
|
+
depsChangeChangedLabel: string;
|
|
76
|
+
depsChangeArrow: string;
|
|
77
|
+
depsChangeRiskWarning: string;
|
|
78
|
+
depsChangeFetchFailed: string;
|
|
79
|
+
depsChangeNonBlockingHint: string;
|
|
80
|
+
packing: string;
|
|
81
|
+
pausedStatus: string;
|
|
82
|
+
platform: string;
|
|
83
|
+
platformPrompt: string;
|
|
84
|
+
platformQuestion: string;
|
|
85
|
+
platformRequired: string;
|
|
86
|
+
pluginDetectionError: string;
|
|
87
|
+
pluginDetected: string;
|
|
88
|
+
ppkPackageGenerated: string;
|
|
89
|
+
processingError: string;
|
|
90
|
+
processingPackage: string;
|
|
91
|
+
processingStringPool: string;
|
|
92
|
+
publishUsage: string;
|
|
93
|
+
rnuVersionNotFound: string;
|
|
94
|
+
rolloutConfigSet: string;
|
|
95
|
+
rolloutRangeError: string;
|
|
96
|
+
runningHermesc: string;
|
|
97
|
+
sentryCliNotFound: string;
|
|
98
|
+
sentryReleaseCreated: string;
|
|
99
|
+
totalApps: string;
|
|
100
|
+
totalPackages: string;
|
|
101
|
+
typeStrings: string;
|
|
102
|
+
unsupportedPlatform: string;
|
|
103
|
+
uploadBundlePrompt: string;
|
|
104
|
+
uploadingSourcemap: string;
|
|
105
|
+
usageDiff: string;
|
|
106
|
+
usageParseApk: string;
|
|
107
|
+
usageParseAab: string;
|
|
108
|
+
usageExtractApk: string;
|
|
109
|
+
usageParseApp: string;
|
|
110
|
+
usageParseIpa: string;
|
|
111
|
+
usageUploadApk: string;
|
|
112
|
+
usageUploadAab: string;
|
|
113
|
+
usageUploadApp: string;
|
|
114
|
+
usageUploadIpa: string;
|
|
115
|
+
versionBind: string;
|
|
116
|
+
welcomeMessage: string;
|
|
117
|
+
versionNameQuestion: string;
|
|
118
|
+
versionDescriptionQuestion: string;
|
|
119
|
+
versionMetaInfoQuestion: string;
|
|
120
|
+
updateNativePackageQuestion: string;
|
|
121
|
+
unnamed: string;
|
|
122
|
+
dryRun: string;
|
|
123
|
+
usingCustomVersion: string;
|
|
124
|
+
confirmDeletePackage: string;
|
|
125
|
+
deletePackageSuccess: string;
|
|
126
|
+
deletePackageError: string;
|
|
127
|
+
usageDeletePackage: string;
|
|
128
|
+
deleteVersionSuccess: string;
|
|
129
|
+
deleteVersionError: string;
|
|
130
|
+
bundleFileNotFound: string;
|
|
131
|
+
diffPackageGenerated: string;
|
|
132
|
+
nodeBsdiffRequired: string;
|
|
133
|
+
nodeHdiffpatchRequired: string;
|
|
134
|
+
apkExtracted: string;
|
|
135
|
+
};
|
|
136
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CLIModule, CLIProvider, CommandContext, CommandDefinition, CommandResult, CustomWorkflow } from './types';
|
|
2
|
+
export declare class ModuleManager {
|
|
3
|
+
private modules;
|
|
4
|
+
private provider;
|
|
5
|
+
private commands;
|
|
6
|
+
private workflows;
|
|
7
|
+
constructor();
|
|
8
|
+
registerModule(module: CLIModule): void;
|
|
9
|
+
unregisterModule(moduleName: string): void;
|
|
10
|
+
registerCommand(command: CommandDefinition): void;
|
|
11
|
+
registerWorkflow(workflow: CustomWorkflow): void;
|
|
12
|
+
executeCommand(commandName: string, context: CommandContext): Promise<CommandResult>;
|
|
13
|
+
executeWorkflow(workflowName: string, context: CommandContext): Promise<CommandResult>;
|
|
14
|
+
getProvider(): CLIProvider;
|
|
15
|
+
listCommands(): CommandDefinition[];
|
|
16
|
+
listWorkflows(): CustomWorkflow[];
|
|
17
|
+
listModules(): CLIModule[];
|
|
18
|
+
listAll(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const moduleManager: ModuleManager;
|
package/lib/module-manager.js
CHANGED
|
@@ -74,15 +74,6 @@ class ModuleManager {
|
|
|
74
74
|
this.workflows.set(workflow.name, workflow);
|
|
75
75
|
this.provider.registerWorkflow(workflow);
|
|
76
76
|
}
|
|
77
|
-
getRegisteredCommands() {
|
|
78
|
-
return Array.from(this.commands.values());
|
|
79
|
-
}
|
|
80
|
-
getRegisteredWorkflows() {
|
|
81
|
-
return Array.from(this.workflows.values());
|
|
82
|
-
}
|
|
83
|
-
getRegisteredModules() {
|
|
84
|
-
return Array.from(this.modules.values());
|
|
85
|
-
}
|
|
86
77
|
async executeCommand(commandName, context) {
|
|
87
78
|
const command = this.commands.get(commandName);
|
|
88
79
|
if (!command) {
|
|
@@ -102,6 +93,9 @@ class ModuleManager {
|
|
|
102
93
|
listWorkflows() {
|
|
103
94
|
return Array.from(this.workflows.values());
|
|
104
95
|
}
|
|
96
|
+
listModules() {
|
|
97
|
+
return Array.from(this.modules.values());
|
|
98
|
+
}
|
|
105
99
|
listAll() {
|
|
106
100
|
console.log('\n=== Registered Commands ===');
|
|
107
101
|
for (const command of this.commands.values()){
|
|
@@ -9,6 +9,23 @@ Object.defineProperty(exports, "appModule", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _app = require("../app");
|
|
12
|
+
const _options = require("../utils/options");
|
|
13
|
+
const allPlatforms = [
|
|
14
|
+
'ios',
|
|
15
|
+
'android',
|
|
16
|
+
'harmony'
|
|
17
|
+
];
|
|
18
|
+
const emptyAppsData = {
|
|
19
|
+
ios: [],
|
|
20
|
+
android: [],
|
|
21
|
+
harmony: []
|
|
22
|
+
};
|
|
23
|
+
function isPlatform(value) {
|
|
24
|
+
return value === 'ios' || value === 'android' || value === 'harmony';
|
|
25
|
+
}
|
|
26
|
+
function normalizePlatformOption(value) {
|
|
27
|
+
return isPlatform(value) ? value : '';
|
|
28
|
+
}
|
|
12
29
|
const appModule = {
|
|
13
30
|
name: 'app',
|
|
14
31
|
version: '1.0.0',
|
|
@@ -23,12 +40,14 @@ const appModule = {
|
|
|
23
40
|
description: 'Create the app',
|
|
24
41
|
execute: async (context)=>{
|
|
25
42
|
console.log('Creating app in workflow');
|
|
26
|
-
const
|
|
43
|
+
const name = (0, _options.getStringOption)(context.options, 'name');
|
|
44
|
+
const downloadUrl = (0, _options.getStringOption)(context.options, 'downloadUrl');
|
|
45
|
+
const platform = normalizePlatformOption(context.options.platform);
|
|
27
46
|
await _app.appCommands.createApp({
|
|
28
47
|
options: {
|
|
29
|
-
name
|
|
30
|
-
downloadUrl
|
|
31
|
-
platform
|
|
48
|
+
name,
|
|
49
|
+
downloadUrl,
|
|
50
|
+
platform
|
|
32
51
|
}
|
|
33
52
|
});
|
|
34
53
|
return {
|
|
@@ -41,15 +60,16 @@ const appModule = {
|
|
|
41
60
|
description: 'Select the created app',
|
|
42
61
|
execute: async (context, previousResult)=>{
|
|
43
62
|
console.log('Selecting app in workflow');
|
|
44
|
-
const
|
|
63
|
+
const state = (0, _options.toObjectState)(previousResult, {});
|
|
64
|
+
const platform = normalizePlatformOption(context.options.platform);
|
|
45
65
|
await _app.appCommands.selectApp({
|
|
46
66
|
args: [],
|
|
47
67
|
options: {
|
|
48
|
-
platform
|
|
68
|
+
platform
|
|
49
69
|
}
|
|
50
70
|
});
|
|
51
71
|
return {
|
|
52
|
-
...
|
|
72
|
+
...state,
|
|
53
73
|
appSelected: true
|
|
54
74
|
};
|
|
55
75
|
}
|
|
@@ -65,10 +85,10 @@ const appModule = {
|
|
|
65
85
|
description: 'List all apps',
|
|
66
86
|
execute: async (context)=>{
|
|
67
87
|
console.log('Listing all apps');
|
|
68
|
-
const
|
|
88
|
+
const platform = normalizePlatformOption(context.options.platform);
|
|
69
89
|
await _app.appCommands.apps({
|
|
70
90
|
options: {
|
|
71
|
-
platform
|
|
91
|
+
platform
|
|
72
92
|
}
|
|
73
93
|
});
|
|
74
94
|
return {
|
|
@@ -81,15 +101,16 @@ const appModule = {
|
|
|
81
101
|
description: 'Select target app for operations',
|
|
82
102
|
execute: async (context, previousResult)=>{
|
|
83
103
|
console.log('Selecting target app');
|
|
84
|
-
const
|
|
104
|
+
const state = (0, _options.toObjectState)(previousResult, {});
|
|
105
|
+
const platform = normalizePlatformOption(context.options.platform);
|
|
85
106
|
await _app.appCommands.selectApp({
|
|
86
107
|
args: [],
|
|
87
108
|
options: {
|
|
88
|
-
platform
|
|
109
|
+
platform
|
|
89
110
|
}
|
|
90
111
|
});
|
|
91
112
|
return {
|
|
92
|
-
...
|
|
113
|
+
...state,
|
|
93
114
|
targetAppSelected: true
|
|
94
115
|
};
|
|
95
116
|
}
|
|
@@ -105,32 +126,35 @@ const appModule = {
|
|
|
105
126
|
description: 'Scan apps on all platforms',
|
|
106
127
|
execute: async (context)=>{
|
|
107
128
|
console.log('🔍 Scanning apps on all platforms...');
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
for (const platform of platforms){
|
|
129
|
+
const appsData = {
|
|
130
|
+
ios: [],
|
|
131
|
+
android: [],
|
|
132
|
+
harmony: []
|
|
133
|
+
};
|
|
134
|
+
for (const platform of allPlatforms){
|
|
115
135
|
console.log(` Scanning ${platform} platform...`);
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
|
|
136
|
+
try {
|
|
137
|
+
const rawApps = await (0, _app.listApp)(platform);
|
|
138
|
+
const apps = rawApps.map((app, index)=>{
|
|
139
|
+
var _app_id, _app_name, _app_platform, _app_version;
|
|
140
|
+
return {
|
|
141
|
+
id: String((_app_id = app.id) != null ? _app_id : `${platform}-app-${index + 1}`),
|
|
142
|
+
name: (_app_name = app.name) != null ? _app_name : `App ${index + 1}`,
|
|
143
|
+
platform: (_app_platform = app.platform) != null ? _app_platform : platform,
|
|
144
|
+
version: typeof app.version === 'string' ? (_app_version = app.version) != null ? _app_version : 'unknown' : 'unknown',
|
|
145
|
+
status: app.status === 'inactive' ? 'inactive' : 'active'
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
appsData[platform] = apps;
|
|
149
|
+
console.log(` ✅ Found ${apps.length} apps`);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
appsData[platform] = [];
|
|
152
|
+
console.warn(` ⚠️ Failed to scan ${platform}:`, error);
|
|
153
|
+
}
|
|
130
154
|
}
|
|
131
155
|
console.log('✅ Platform scanning completed');
|
|
132
156
|
return {
|
|
133
|
-
platforms,
|
|
157
|
+
platforms: allPlatforms,
|
|
134
158
|
appsData,
|
|
135
159
|
scanned: true
|
|
136
160
|
};
|
|
@@ -141,16 +165,23 @@ const appModule = {
|
|
|
141
165
|
description: 'Analyze app status',
|
|
142
166
|
execute: async (context, previousResult)=>{
|
|
143
167
|
console.log('📊 Analyzing app status...');
|
|
144
|
-
const
|
|
168
|
+
const state = (0, _options.toObjectState)(previousResult, {});
|
|
169
|
+
var _state_appsData;
|
|
170
|
+
const appsData = (_state_appsData = state.appsData) != null ? _state_appsData : emptyAppsData;
|
|
145
171
|
const analysis = {
|
|
146
172
|
totalApps: 0,
|
|
147
173
|
activeApps: 0,
|
|
148
174
|
inactiveApps: 0,
|
|
149
|
-
platformDistribution: {
|
|
175
|
+
platformDistribution: {
|
|
176
|
+
ios: 0,
|
|
177
|
+
android: 0,
|
|
178
|
+
harmony: 0
|
|
179
|
+
},
|
|
150
180
|
issues: []
|
|
151
181
|
};
|
|
152
|
-
for (const
|
|
153
|
-
|
|
182
|
+
for (const platform of allPlatforms){
|
|
183
|
+
var _appsData_platform;
|
|
184
|
+
const platformApps = (_appsData_platform = appsData[platform]) != null ? _appsData_platform : [];
|
|
154
185
|
analysis.totalApps += platformApps.length;
|
|
155
186
|
analysis.platformDistribution[platform] = platformApps.length;
|
|
156
187
|
for (const app of platformApps){
|
|
@@ -168,10 +199,12 @@ const appModule = {
|
|
|
168
199
|
console.log(` Inactive apps: ${analysis.inactiveApps}`);
|
|
169
200
|
if (analysis.issues.length > 0) {
|
|
170
201
|
console.log('⚠️ Issues found:');
|
|
171
|
-
analysis.issues
|
|
202
|
+
for (const issue of analysis.issues){
|
|
203
|
+
console.log(` - ${issue}`);
|
|
204
|
+
}
|
|
172
205
|
}
|
|
173
206
|
return {
|
|
174
|
-
...
|
|
207
|
+
...state,
|
|
175
208
|
analysis
|
|
176
209
|
};
|
|
177
210
|
}
|
|
@@ -181,7 +214,16 @@ const appModule = {
|
|
|
181
214
|
description: 'Optimize app configuration',
|
|
182
215
|
execute: async (context, previousResult)=>{
|
|
183
216
|
console.log('⚡ Optimizing app configuration...');
|
|
184
|
-
const
|
|
217
|
+
const state = (0, _options.toObjectState)(previousResult, {});
|
|
218
|
+
const analysis = state.analysis;
|
|
219
|
+
if (!analysis) {
|
|
220
|
+
console.log(' No analysis data, skip optimization');
|
|
221
|
+
return {
|
|
222
|
+
...state,
|
|
223
|
+
optimizations: [],
|
|
224
|
+
optimized: false
|
|
225
|
+
};
|
|
226
|
+
}
|
|
185
227
|
const optimizations = [];
|
|
186
228
|
if (analysis.inactiveApps > 0) {
|
|
187
229
|
console.log(' Handling inactive apps...');
|
|
@@ -191,15 +233,13 @@ const appModule = {
|
|
|
191
233
|
console.log(' Many apps detected, suggest grouping...');
|
|
192
234
|
optimizations.push('Create app groups');
|
|
193
235
|
}
|
|
194
|
-
// Simulate optimization process
|
|
195
236
|
for (const optimization of optimizations){
|
|
196
237
|
console.log(` Executing: ${optimization}...`);
|
|
197
|
-
await new Promise((resolve)=>setTimeout(resolve, 800));
|
|
198
238
|
console.log(` ✅ ${optimization} completed`);
|
|
199
239
|
}
|
|
200
240
|
console.log('✅ App optimization completed');
|
|
201
241
|
return {
|
|
202
|
-
...
|
|
242
|
+
...state,
|
|
203
243
|
optimizations,
|
|
204
244
|
optimized: true
|
|
205
245
|
};
|
|
@@ -23,7 +23,7 @@ const bundleModule = {
|
|
|
23
23
|
description: 'Detect base version',
|
|
24
24
|
execute: async (context)=>{
|
|
25
25
|
console.log('🔍 Detecting base version...');
|
|
26
|
-
const { baseVersion
|
|
26
|
+
const { baseVersion } = context.options;
|
|
27
27
|
if (baseVersion) {
|
|
28
28
|
console.log(`✅ Using specified base version: ${baseVersion}`);
|
|
29
29
|
return {
|
|
@@ -31,9 +31,7 @@ const bundleModule = {
|
|
|
31
31
|
specified: true
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
await new Promise((resolve)=>setTimeout(resolve, 800));
|
|
36
|
-
const autoDetectedVersion = `v${Math.floor(Math.random() * 3) + 1}.${Math.floor(Math.random() * 10)}.${Math.floor(Math.random() * 10)}`;
|
|
34
|
+
const autoDetectedVersion = 'latest';
|
|
37
35
|
console.log(`✅ Auto detected base version: ${autoDetectedVersion}`);
|
|
38
36
|
return {
|
|
39
37
|
baseVersion: autoDetectedVersion,
|
|
@@ -46,6 +44,7 @@ const bundleModule = {
|
|
|
46
44
|
description: 'Build current version',
|
|
47
45
|
execute: async (context, previousResult)=>{
|
|
48
46
|
console.log('🏗️ Building current version...');
|
|
47
|
+
const state = previousResult && typeof previousResult === 'object' ? previousResult : {};
|
|
49
48
|
const { platform, dev = false, sourcemap = false, bundleName = 'index.bundlejs', entryFile = 'index.js', intermediaDir, taro = false, expo = false, rncli = false, hermes = false, output } = context.options;
|
|
50
49
|
console.log(`Building ${platform} platform...`);
|
|
51
50
|
console.log(` Entry file: ${entryFile}`);
|
|
@@ -73,16 +72,16 @@ const bundleModule = {
|
|
|
73
72
|
args: [],
|
|
74
73
|
options: buildOptions
|
|
75
74
|
});
|
|
75
|
+
const bundlePath = typeof output === 'string' ? output : '${tempDir}/output/${platform}.${time}.ppk';
|
|
76
76
|
const currentBuild = {
|
|
77
|
-
version:
|
|
77
|
+
version: typeof state.baseVersion === 'string' ? state.baseVersion : 'current',
|
|
78
78
|
platform,
|
|
79
|
-
bundlePath
|
|
80
|
-
size: Math.floor(Math.random() * 15) + 10,
|
|
79
|
+
bundlePath,
|
|
81
80
|
buildTime: Date.now()
|
|
82
81
|
};
|
|
83
82
|
console.log(`✅ Current version build completed: ${currentBuild.version}`);
|
|
84
83
|
return {
|
|
85
|
-
...
|
|
84
|
+
...state,
|
|
86
85
|
currentBuild
|
|
87
86
|
};
|
|
88
87
|
} catch (error) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { bundleModule } from './bundle-module';
|
|
2
|
+
export { versionModule } from './version-module';
|
|
3
|
+
export { appModule } from './app-module';
|
|
4
|
+
export { userModule } from './user-module';
|
|
5
|
+
export { packageModule } from './package-module';
|
|
6
|
+
export declare const builtinModules: import("..").CLIModule[];
|