Skip to content

Commit f6258b2

Browse files
committed
chore: Add local dev directions
1 parent d28c253 commit f6258b2

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,76 @@
11
# CodePush CLI
22

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!
410

511
## Installation
612

713
```bash
814
npm install -g @johnhaup/code-push-cli
915
```
1016

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+
1174
## Getting started
1275

1376
1. Create a [CodePush account](#account-creation) push using the CodePush CLI.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "./script/cli.js",
66
"scripts": {
77
"start": "node ./bin/script/cli.js",
8+
"code-push": "node ./bin/script/cli.js",
89
"build": "tsc",
910
"prettier": "prettier --write \"./**/*.ts\"",
1011
"lint": "npx eslint ./script/**/*.ts",

0 commit comments

Comments
 (0)