Skip to content

Commit c7807db

Browse files
committed
docs: update for better readability of CLI config part
1 parent 970cba5 commit c7807db

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

README.md

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export default CodePush({
213213
> [!TIP]
214214
> For a more detailed and practical example, refer to the `CodePushDemoApp` in `example` directory.
215215
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.**
217217

218218
Then, implement three functions to upload the bundle file and create/update the release history.
219219
The CLI tool uses these functions to release CodePush updates and manage releases.
@@ -233,22 +233,15 @@ const Config: CliConfigInterface = {
233233
platform: "ios" | "android",
234234
identifier,
235235
): 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+
// ...
240237
},
241238

242239
getReleaseHistory: async (
243240
targetBinaryVersion: string,
244241
platform: "ios" | "android",
245242
identifier,
246243
): 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+
// ...
252245
},
253246

254247
setReleaseHistory: async (
@@ -258,20 +251,43 @@ const Config: CliConfigInterface = {
258251
platform: "ios" | "android",
259252
identifier,
260253
): 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+
// ...
267255
},
268256
};
269257

270258
module.exports = Config;
271259

272260
```
273261

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`.**
275291

276292
```diff
277293
{

0 commit comments

Comments
 (0)