react-native-update-cli 2.7.1 → 2.7.2
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/cli.json +1 -0
- package/lib/esm/api..mjs +183 -0
- package/lib/esm/app..mjs +130 -0
- package/lib/esm/bundle..mjs +823 -0
- package/lib/esm/exports..mjs +11 -0
- package/lib/esm/index..mjs +122 -0
- package/lib/esm/install..mjs +18 -0
- package/lib/esm/locales/en..mjs +131 -0
- package/lib/esm/locales/zh..mjs +130 -0
- package/lib/esm/module-manager..mjs +109 -0
- package/lib/esm/modules/app-module..mjs +213 -0
- package/lib/esm/modules/bundle-module..mjs +178 -0
- package/lib/esm/modules/index..mjs +17 -0
- package/lib/esm/modules/package-module..mjs +6 -0
- package/lib/esm/modules/user-module..mjs +351 -0
- package/lib/esm/modules/version-module..mjs +6 -0
- package/lib/esm/package..mjs +316 -0
- package/lib/esm/provider..mjs +293 -0
- package/lib/esm/types..mjs +1 -0
- package/lib/esm/user..mjs +36 -0
- package/lib/esm/utils/add-gitignore..mjs +32 -0
- package/lib/esm/utils/app-info-parser/aab..mjs +215 -0
- package/lib/esm/utils/app-info-parser/apk..mjs +75 -0
- package/lib/esm/utils/app-info-parser/app..mjs +3 -0
- package/lib/esm/utils/app-info-parser/index..mjs +44 -0
- package/lib/esm/utils/app-info-parser/ipa..mjs +73 -0
- package/lib/esm/utils/app-info-parser/resource-finder..mjs +401 -0
- package/lib/esm/utils/app-info-parser/utils..mjs +121 -0
- package/lib/esm/utils/app-info-parser/xml-parser/binary..mjs +569 -0
- package/lib/esm/utils/app-info-parser/xml-parser/manifest..mjs +200 -0
- package/lib/esm/utils/app-info-parser/zip..mjs +65 -0
- package/lib/esm/utils/check-lockfile..mjs +78 -0
- package/lib/esm/utils/check-plugin..mjs +25 -0
- package/lib/esm/utils/constants..mjs +19 -0
- package/lib/esm/utils/dep-versions..mjs +33 -0
- package/lib/esm/utils/git..mjs +43 -0
- package/lib/esm/utils/http-helper..mjs +70 -0
- package/lib/esm/utils/i18n..mjs +23 -0
- package/lib/esm/utils/index..mjs +316 -0
- package/lib/esm/utils/latest-version/cli..mjs +294 -0
- package/lib/esm/utils/latest-version/index..mjs +238 -0
- package/lib/esm/utils/plugin-config..mjs +23 -0
- package/lib/esm/versions..mjs +290 -0
- package/package.json +19 -2
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { appCommands } from "../app";
|
|
2
|
+
export const appModule = {
|
|
3
|
+
name: 'app',
|
|
4
|
+
version: '1.0.0',
|
|
5
|
+
commands: [],
|
|
6
|
+
workflows: [
|
|
7
|
+
{
|
|
8
|
+
name: 'setup-app',
|
|
9
|
+
description: 'Setup a new app with initial configuration',
|
|
10
|
+
steps: [
|
|
11
|
+
{
|
|
12
|
+
name: 'create',
|
|
13
|
+
description: 'Create the app',
|
|
14
|
+
execute: async (context)=>{
|
|
15
|
+
console.log('Creating app in workflow');
|
|
16
|
+
const { name, downloadUrl, platform } = context.options;
|
|
17
|
+
await appCommands.createApp({
|
|
18
|
+
options: {
|
|
19
|
+
name: name || '',
|
|
20
|
+
downloadUrl: downloadUrl || '',
|
|
21
|
+
platform: platform || ''
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
appCreated: true
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'select',
|
|
31
|
+
description: 'Select the created app',
|
|
32
|
+
execute: async (context, previousResult)=>{
|
|
33
|
+
console.log('Selecting app in workflow');
|
|
34
|
+
const { platform } = context.options;
|
|
35
|
+
await appCommands.selectApp({
|
|
36
|
+
args: [],
|
|
37
|
+
options: {
|
|
38
|
+
platform: platform || ''
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
...previousResult,
|
|
43
|
+
appSelected: true
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'manage-apps',
|
|
51
|
+
description: 'Manage multiple apps',
|
|
52
|
+
steps: [
|
|
53
|
+
{
|
|
54
|
+
name: 'list-apps',
|
|
55
|
+
description: 'List all apps',
|
|
56
|
+
execute: async (context)=>{
|
|
57
|
+
console.log('Listing all apps');
|
|
58
|
+
const { platform } = context.options;
|
|
59
|
+
await appCommands.apps({
|
|
60
|
+
options: {
|
|
61
|
+
platform: platform || ''
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
appsListed: true
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'select-target-app',
|
|
71
|
+
description: 'Select target app for operations',
|
|
72
|
+
execute: async (context, previousResult)=>{
|
|
73
|
+
console.log('Selecting target app');
|
|
74
|
+
const { platform } = context.options;
|
|
75
|
+
await appCommands.selectApp({
|
|
76
|
+
args: [],
|
|
77
|
+
options: {
|
|
78
|
+
platform: platform || ''
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
...previousResult,
|
|
83
|
+
targetAppSelected: true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'multi-platform-app-management',
|
|
91
|
+
description: 'Multi-platform app unified management workflow',
|
|
92
|
+
steps: [
|
|
93
|
+
{
|
|
94
|
+
name: 'scan-platforms',
|
|
95
|
+
description: 'Scan apps on all platforms',
|
|
96
|
+
execute: async (context)=>{
|
|
97
|
+
console.log('🔍 Scanning apps on all platforms...');
|
|
98
|
+
const platforms = [
|
|
99
|
+
'ios',
|
|
100
|
+
'android',
|
|
101
|
+
'harmony'
|
|
102
|
+
];
|
|
103
|
+
const appsData = {};
|
|
104
|
+
for (const platform of platforms){
|
|
105
|
+
console.log(` Scanning ${platform} platform...`);
|
|
106
|
+
// Simulate getting app list
|
|
107
|
+
await new Promise((resolve)=>setTimeout(resolve, 500));
|
|
108
|
+
const appCount = Math.floor(Math.random() * 5) + 1;
|
|
109
|
+
const apps = Array.from({
|
|
110
|
+
length: appCount
|
|
111
|
+
}, (_, i)=>({
|
|
112
|
+
id: `${platform}_app_${i + 1}`,
|
|
113
|
+
name: `App ${i + 1}`,
|
|
114
|
+
platform,
|
|
115
|
+
version: `1.${i}.0`,
|
|
116
|
+
status: Math.random() > 0.2 ? 'active' : 'inactive'
|
|
117
|
+
}));
|
|
118
|
+
appsData[platform] = apps;
|
|
119
|
+
console.log(` ✅ Found ${appCount} apps`);
|
|
120
|
+
}
|
|
121
|
+
console.log('✅ Platform scanning completed');
|
|
122
|
+
return {
|
|
123
|
+
platforms,
|
|
124
|
+
appsData,
|
|
125
|
+
scanned: true
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'analyze-apps',
|
|
131
|
+
description: 'Analyze app status',
|
|
132
|
+
execute: async (context, previousResult)=>{
|
|
133
|
+
console.log('📊 Analyzing app status...');
|
|
134
|
+
const { appsData } = previousResult;
|
|
135
|
+
const analysis = {
|
|
136
|
+
totalApps: 0,
|
|
137
|
+
activeApps: 0,
|
|
138
|
+
inactiveApps: 0,
|
|
139
|
+
platformDistribution: {},
|
|
140
|
+
issues: []
|
|
141
|
+
};
|
|
142
|
+
for (const [platform, apps] of Object.entries(appsData)){
|
|
143
|
+
const platformApps = apps;
|
|
144
|
+
analysis.totalApps += platformApps.length;
|
|
145
|
+
analysis.platformDistribution[platform] = platformApps.length;
|
|
146
|
+
for (const app of platformApps){
|
|
147
|
+
if (app.status === 'active') {
|
|
148
|
+
analysis.activeApps++;
|
|
149
|
+
} else {
|
|
150
|
+
analysis.inactiveApps++;
|
|
151
|
+
analysis.issues.push(`${platform}/${app.name}: App is inactive`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
console.log('📈 Analysis results:');
|
|
156
|
+
console.log(` Total apps: ${analysis.totalApps}`);
|
|
157
|
+
console.log(` Active apps: ${analysis.activeApps}`);
|
|
158
|
+
console.log(` Inactive apps: ${analysis.inactiveApps}`);
|
|
159
|
+
if (analysis.issues.length > 0) {
|
|
160
|
+
console.log('⚠️ Issues found:');
|
|
161
|
+
analysis.issues.forEach((issue)=>console.log(` - ${issue}`));
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
...previousResult,
|
|
165
|
+
analysis
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'optimize-apps',
|
|
171
|
+
description: 'Optimize app configuration',
|
|
172
|
+
execute: async (context, previousResult)=>{
|
|
173
|
+
console.log('⚡ Optimizing app configuration...');
|
|
174
|
+
const { analysis } = previousResult;
|
|
175
|
+
const optimizations = [];
|
|
176
|
+
if (analysis.inactiveApps > 0) {
|
|
177
|
+
console.log(' Handling inactive apps...');
|
|
178
|
+
optimizations.push('Reactivate inactive apps');
|
|
179
|
+
}
|
|
180
|
+
if (analysis.totalApps > 10) {
|
|
181
|
+
console.log(' Many apps detected, suggest grouping...');
|
|
182
|
+
optimizations.push('Create app groups');
|
|
183
|
+
}
|
|
184
|
+
// Simulate optimization process
|
|
185
|
+
for (const optimization of optimizations){
|
|
186
|
+
console.log(` Executing: ${optimization}...`);
|
|
187
|
+
await new Promise((resolve)=>setTimeout(resolve, 800));
|
|
188
|
+
console.log(` ✅ ${optimization} completed`);
|
|
189
|
+
}
|
|
190
|
+
console.log('✅ App optimization completed');
|
|
191
|
+
return {
|
|
192
|
+
...previousResult,
|
|
193
|
+
optimizations,
|
|
194
|
+
optimized: true
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
options: {
|
|
200
|
+
includeInactive: {
|
|
201
|
+
hasValue: false,
|
|
202
|
+
default: true,
|
|
203
|
+
description: 'Include inactive apps'
|
|
204
|
+
},
|
|
205
|
+
autoOptimize: {
|
|
206
|
+
hasValue: false,
|
|
207
|
+
default: true,
|
|
208
|
+
description: 'Auto optimize configuration'
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { bundleCommands } from "../bundle";
|
|
2
|
+
export const bundleModule = {
|
|
3
|
+
name: 'bundle',
|
|
4
|
+
version: '1.0.0',
|
|
5
|
+
commands: [],
|
|
6
|
+
workflows: [
|
|
7
|
+
{
|
|
8
|
+
name: 'incremental-build',
|
|
9
|
+
description: 'Incremental build workflow - generate diff packages',
|
|
10
|
+
steps: [
|
|
11
|
+
{
|
|
12
|
+
name: 'detect-base-version',
|
|
13
|
+
description: 'Detect base version',
|
|
14
|
+
execute: async (context)=>{
|
|
15
|
+
console.log('🔍 Detecting base version...');
|
|
16
|
+
const { baseVersion, platform } = context.options;
|
|
17
|
+
if (baseVersion) {
|
|
18
|
+
console.log(`✅ Using specified base version: ${baseVersion}`);
|
|
19
|
+
return {
|
|
20
|
+
baseVersion,
|
|
21
|
+
specified: true
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
console.log('Auto detecting latest version...');
|
|
25
|
+
await new Promise((resolve)=>setTimeout(resolve, 800));
|
|
26
|
+
const autoDetectedVersion = `v${Math.floor(Math.random() * 3) + 1}.${Math.floor(Math.random() * 10)}.${Math.floor(Math.random() * 10)}`;
|
|
27
|
+
console.log(`✅ Auto detected base version: ${autoDetectedVersion}`);
|
|
28
|
+
return {
|
|
29
|
+
baseVersion: autoDetectedVersion,
|
|
30
|
+
specified: false
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'build-current-version',
|
|
36
|
+
description: 'Build current version',
|
|
37
|
+
execute: async (context, previousResult)=>{
|
|
38
|
+
console.log('🏗️ Building current version...');
|
|
39
|
+
const { platform, dev = false, sourcemap = false, bundleName = 'index.bundlejs', entryFile = 'index.js', intermediaDir, taro = false, expo = false, rncli = false, hermes = false, output } = context.options;
|
|
40
|
+
console.log(`Building ${platform} platform...`);
|
|
41
|
+
console.log(` Entry file: ${entryFile}`);
|
|
42
|
+
console.log(` Bundle name: ${bundleName}`);
|
|
43
|
+
console.log(` Development mode: ${dev}`);
|
|
44
|
+
console.log(` Source maps: ${sourcemap}`);
|
|
45
|
+
try {
|
|
46
|
+
const buildOptions = {
|
|
47
|
+
platform,
|
|
48
|
+
dev,
|
|
49
|
+
sourcemap,
|
|
50
|
+
bundleName,
|
|
51
|
+
entryFile,
|
|
52
|
+
taro,
|
|
53
|
+
expo,
|
|
54
|
+
rncli,
|
|
55
|
+
hermes,
|
|
56
|
+
intermediaDir: '${tempDir}/intermedia/${platform}',
|
|
57
|
+
output: '${tempDir}/output/${platform}.${time}.ppk'
|
|
58
|
+
};
|
|
59
|
+
if (intermediaDir) {
|
|
60
|
+
buildOptions.intermediaDir = intermediaDir;
|
|
61
|
+
}
|
|
62
|
+
await bundleCommands.bundle({
|
|
63
|
+
args: [],
|
|
64
|
+
options: buildOptions
|
|
65
|
+
});
|
|
66
|
+
const currentBuild = {
|
|
67
|
+
version: `v${Math.floor(Math.random() * 3) + 2}.0.0`,
|
|
68
|
+
platform,
|
|
69
|
+
bundlePath: `./build/current_${platform}.ppk`,
|
|
70
|
+
size: Math.floor(Math.random() * 15) + 10,
|
|
71
|
+
buildTime: Date.now()
|
|
72
|
+
};
|
|
73
|
+
console.log(`✅ Current version build completed: ${currentBuild.version}`);
|
|
74
|
+
return {
|
|
75
|
+
...previousResult,
|
|
76
|
+
currentBuild
|
|
77
|
+
};
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error('❌ Current version build failed:', error);
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
validate: (context)=>{
|
|
86
|
+
if (!context.options.platform) {
|
|
87
|
+
console.error('❌ Incremental build requires platform specification');
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
return true;
|
|
91
|
+
},
|
|
92
|
+
options: {
|
|
93
|
+
platform: {
|
|
94
|
+
hasValue: true,
|
|
95
|
+
description: 'Target platform (required)'
|
|
96
|
+
},
|
|
97
|
+
baseVersion: {
|
|
98
|
+
hasValue: true,
|
|
99
|
+
description: 'Base version (auto detect if not specified)'
|
|
100
|
+
},
|
|
101
|
+
skipValidation: {
|
|
102
|
+
hasValue: false,
|
|
103
|
+
default: false,
|
|
104
|
+
description: 'Skip diff package validation'
|
|
105
|
+
},
|
|
106
|
+
dev: {
|
|
107
|
+
hasValue: false,
|
|
108
|
+
default: false,
|
|
109
|
+
description: 'Development mode build'
|
|
110
|
+
},
|
|
111
|
+
bundleName: {
|
|
112
|
+
hasValue: true,
|
|
113
|
+
default: 'index.bundlejs',
|
|
114
|
+
description: 'Bundle file name'
|
|
115
|
+
},
|
|
116
|
+
entryFile: {
|
|
117
|
+
hasValue: true,
|
|
118
|
+
default: 'index.js',
|
|
119
|
+
description: 'Entry file'
|
|
120
|
+
},
|
|
121
|
+
sourcemap: {
|
|
122
|
+
hasValue: false,
|
|
123
|
+
default: false,
|
|
124
|
+
description: 'Generate source maps'
|
|
125
|
+
},
|
|
126
|
+
output: {
|
|
127
|
+
hasValue: true,
|
|
128
|
+
description: 'Custom output path for diff package'
|
|
129
|
+
},
|
|
130
|
+
intermediaDir: {
|
|
131
|
+
hasValue: true,
|
|
132
|
+
description: 'Intermediate directory'
|
|
133
|
+
},
|
|
134
|
+
taro: {
|
|
135
|
+
hasValue: false,
|
|
136
|
+
default: false,
|
|
137
|
+
description: 'Use Taro CLI'
|
|
138
|
+
},
|
|
139
|
+
expo: {
|
|
140
|
+
hasValue: false,
|
|
141
|
+
default: false,
|
|
142
|
+
description: 'Use Expo CLI'
|
|
143
|
+
},
|
|
144
|
+
rncli: {
|
|
145
|
+
hasValue: false,
|
|
146
|
+
default: false,
|
|
147
|
+
description: 'Use React Native CLI'
|
|
148
|
+
},
|
|
149
|
+
hermes: {
|
|
150
|
+
hasValue: false,
|
|
151
|
+
default: false,
|
|
152
|
+
description: 'Force enable Hermes'
|
|
153
|
+
},
|
|
154
|
+
name: {
|
|
155
|
+
hasValue: true,
|
|
156
|
+
description: 'Version name for publishing'
|
|
157
|
+
},
|
|
158
|
+
description: {
|
|
159
|
+
hasValue: true,
|
|
160
|
+
description: 'Version description for publishing'
|
|
161
|
+
},
|
|
162
|
+
metaInfo: {
|
|
163
|
+
hasValue: true,
|
|
164
|
+
description: 'Meta information for publishing'
|
|
165
|
+
},
|
|
166
|
+
rollout: {
|
|
167
|
+
hasValue: true,
|
|
168
|
+
description: 'Rollout percentage'
|
|
169
|
+
},
|
|
170
|
+
dryRun: {
|
|
171
|
+
hasValue: false,
|
|
172
|
+
default: false,
|
|
173
|
+
description: 'Dry run mode'
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { appModule } from "./app-module";
|
|
2
|
+
import { bundleModule } from "./bundle-module";
|
|
3
|
+
import { packageModule } from "./package-module";
|
|
4
|
+
import { userModule } from "./user-module";
|
|
5
|
+
import { versionModule } from "./version-module";
|
|
6
|
+
export { bundleModule } from "./bundle-module";
|
|
7
|
+
export { versionModule } from "./version-module";
|
|
8
|
+
export { appModule } from "./app-module";
|
|
9
|
+
export { userModule } from "./user-module";
|
|
10
|
+
export { packageModule } from "./package-module";
|
|
11
|
+
export const builtinModules = [
|
|
12
|
+
bundleModule,
|
|
13
|
+
versionModule,
|
|
14
|
+
appModule,
|
|
15
|
+
userModule,
|
|
16
|
+
packageModule
|
|
17
|
+
];
|