|
1 | 1 | # CodePush CLI |
2 | 2 |
|
3 | | -The CodePush CLI is a Node.js application that allows users to interact with CodePush Server. The is a fork of the `/cli` folder from the [deprecated codepush repo](https://github.com/microsoft/code-push-server). PRs welcome! |
| 3 | +`@johnhaup/code-push-cli` is a Node.js application that allows users to interact with CodePush Server. The is a fork of the `/cli` folder from the [deprecated codepush repo](https://github.com/microsoft/code-push-server). |
| 4 | + |
| 5 | +Note that the cli prefix has been changed from `code-push-standalone` to `code-push`. |
| 6 | + |
| 7 | +The goal of this repo is to cleanup and extend the existing `code-push-standalone` cli while keeping it fully backwards-compatible with the existing [Code Push Server](https://github.com/microsoft/code-push-server/tree/main/api#codepush-server). If you're hosting a modified version of the server, this cli might not be compatible with your backend. |
| 8 | + |
| 9 | +PRs welcome! |
4 | 10 |
|
5 | 11 | ## Installation |
6 | 12 |
|
7 | 13 | ```bash |
8 | 14 | npm install -g @johnhaup/code-push-cli |
9 | 15 | ``` |
10 | 16 |
|
| 17 | +## Local Development |
| 18 | + |
| 19 | +You can easily set up a mock server and test changes against it. |
| 20 | +If you're using VSCode and GitHub, follow these steps: |
| 21 | + |
| 22 | +#### Server |
| 23 | + |
| 24 | +1. Clone the [Code Push Server](https://github.com/microsoft/code-push-server/tree/main/api#codepush-server) repository to your local machine |
| 25 | +2. Copy the `.env.example` file to a new file named `.env` in the root directory: |
| 26 | + |
| 27 | +```bash |
| 28 | +cp .env.example .env |
| 29 | +``` |
| 30 | + |
| 31 | +3. Create a [GitHub OAuth app](https://github.com/settings/developers) |
| 32 | +4. Update the following in your `.env`: |
| 33 | + |
| 34 | +```bash |
| 35 | +GITHUB_CLIENT_ID= # From your GitHub OAuth app |
| 36 | +GITHUB_CLIENT_SECRET= # From your GitHub OAuth app |
| 37 | +EMULATED=true |
| 38 | +``` |
| 39 | + |
| 40 | +3. Install all necessary dependencies: |
| 41 | + |
| 42 | +```bash |
| 43 | +npm install |
| 44 | +``` |
| 45 | + |
| 46 | +4. Compile the server code: |
| 47 | + |
| 48 | +```bash |
| 49 | +npm run build |
| 50 | +``` |
| 51 | + |
| 52 | +5. Install [Azurite VSCode extension](https://marketplace.visualstudio.com/items?itemName=Azurite.azurite) |
| 53 | +6. Run `Azurite Start` from VSCode's command palette |
| 54 | +7. Run you local server: |
| 55 | + |
| 56 | +```bash |
| 57 | +npm run start:env |
| 58 | +``` |
| 59 | + |
| 60 | +#### CLI |
| 61 | + |
| 62 | +Back in this repo, you can build the cli locally and run commands with the `npm run code-push` prefix: |
| 63 | + |
| 64 | +```bash |
| 65 | +# Build your changes |
| 66 | +npm run build |
| 67 | + |
| 68 | +# Interact with local server |
| 69 | +npm run code-push register |
| 70 | +npm run code-push login |
| 71 | +# etc |
| 72 | +``` |
| 73 | + |
11 | 74 | ## Getting started |
12 | 75 |
|
13 | 76 | 1. Create a [CodePush account](#account-creation) push using the CodePush CLI. |
|
0 commit comments