@@ -213,7 +213,7 @@ export default CodePush({
213
213
> [ !TIP]
214
214
> For a more detailed and practical example, refer to the ` CodePushDemoApp ` in ` example ` directory.
215
215
216
- (1) Create a ` code-push.config.ts ` file in the root directory of your project.
216
+ ** (1) Create a ` code-push.config.ts ` file in the root directory of your project.**
217
217
218
218
Then, implement three functions to upload the bundle file and create/update the release history.
219
219
The CLI tool uses these functions to release CodePush updates and manage releases.
@@ -233,22 +233,15 @@ const Config: CliConfigInterface = {
233
233
platform : " ios" | " android" ,
234
234
identifier ,
235
235
): Promise <{downloadUrl: string }> => {
236
- // Implements a function to upload the bundle file.
237
- // The `downloadUrl` returned by this function is recorded in `ReleaseHistoryInterface` data
238
- // and used by the library runtime to download the bundle file from this URL.
239
- return {downloadUrl: " https://your.cdn.com/bundles/path/to/codepush-bundle" };
236
+ // ...
240
237
},
241
238
242
239
getReleaseHistory : async (
243
240
targetBinaryVersion : string ,
244
241
platform : " ios" | " android" ,
245
242
identifier ,
246
243
): Promise <ReleaseHistoryInterface > => {
247
- // Retrieves the release history of a specific binary app by fetching a JSON file or calling an API.
248
- // It's used for printing release history with the `show-history` command,
249
- // loading existing release history during the `release` command,
250
- // or fetching release history to modify information in the `update-history` command.
251
- // (Similar to the `releaseHistoryFetcher` function in the library runtime options.)
244
+ // ...
252
245
},
253
246
254
247
setReleaseHistory : async (
@@ -258,20 +251,43 @@ const Config: CliConfigInterface = {
258
251
platform : " ios" | " android" ,
259
252
identifier ,
260
253
): Promise <void > => {
261
- // upload JSON file located at `jsonFilePath` or call API using `releaseInfo` metadata.
262
- // If using a JSON file, modifying the existing file should be allowed.
263
- // (Overwriting the file is recommended.)
264
- // It's used for creating a new release record for new binary build with the `create-history` command,
265
- // appending a new record to an existing release history with the `release` command,
266
- // or modifying an exsisting release history with the `update-history` command.
254
+ // ...
267
255
},
268
256
};
269
257
270
258
module .exports = Config ;
271
259
272
260
```
273
261
274
- (2) For ` code-push.config.ts ` (TypeScript) to work properly, you may need to update your ` tsconfig.json ` .
262
+ ** ` bundleUploader ` **
263
+ - Implements a function to upload the bundle file.
264
+ - The ` downloadUrl ` returned by this function is recorded in ` ReleaseHistoryInterface ` data
265
+ and is used by the library runtime to download the bundle file from this URL.
266
+ - Used in the following cases:
267
+ - Creating a new CodePush update with the ` release ` command.
268
+
269
+
270
+ ** ` getReleaseHistory ` **
271
+ - Retrieves the release history of a specific binary app by fetching a JSON file or calling an API.
272
+ - Used in the following cases:
273
+ - Printing the release history with the ` show-history ` command.
274
+ - Loading existing release history during the ` release ` command.
275
+ - Fetching release history to modify information in the ` update-history ` command.
276
+
277
+ (Similar to the ` releaseHistoryFetcher ` function in the library runtime options.)
278
+
279
+
280
+ ** ` setReleaseHistory ` **
281
+ - Uploads a JSON file located at ` jsonFilePath ` or calls an API using ` releaseInfo ` metadata.
282
+ - If using a JSON file, ** modifying the existing file should be allowed.**
283
+ (Overwriting the file is recommended.)
284
+ - Used in the following cases:
285
+ - Creating a new release record for a new binary build with the ` create-history ` command.
286
+ - Appending a new record to an existing release history with the ` release ` command.
287
+ - Modifying an existing release history with the ` update-history ` command.
288
+
289
+
290
+ ** (2) For ` code-push.config.ts ` (TypeScript) to work properly, you may need to update your ` tsconfig.json ` .**
275
291
276
292
``` diff
277
293
{
0 commit comments