Skip to content

Commit a3a14b6

Browse files
chore: Reorganize README.md and add guide for updating Cadence IDL files (#1131)
* Reorganize README.md into separate sections for Usage and Development * Add guide for updating Cadence IDLs under the Development section * Fix minor formatting issues & typos Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
1 parent 9eebe90 commit a3a14b6

1 file changed

Lines changed: 41 additions & 14 deletions

File tree

README.md

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ This web UI is used to view workflows from [Cadence][cadence], see what's runnin
99

1010
## Getting Started
1111

12+
### Using cadence-web
13+
14+
The latest version of `cadence-web` is included in the `cadence` composed docker containers in the [main Cadence repository][cadence]. Follow the instructions there to get started.
15+
16+
```
17+
docker-compose -f docker/docker-compose.yml up
18+
```
19+
1220
### Configuration
1321

14-
Set these environment variables if you need to change their defaults
22+
Set these environment variables if you need to change their defaults.
1523

1624
| Variable | Description | Default |
1725
| ---------------------------- | ----------------------------------------------------------------------------- | ---------------- |
@@ -47,13 +55,7 @@ Feature flags control various UI features and functionality in `cadence-web`. Th
4755

4856
**Note:** For advanced customization, feature flags can be modified through resolvers in the dynamic config system ([`src/config/dynamic/resolvers`](src/config/dynamic/resolvers)).
4957

50-
### Using cadence-web
51-
52-
The latest version of `cadence-web` is included in the `cadence` composed docker containers in the [main Cadence repository][cadence]. Follow the instructions there to get started.
5358

54-
```
55-
docker-compose -f docker/docker-compose.yml up
56-
```
5759

5860
### Using TLS for gRPC
5961

@@ -82,11 +84,11 @@ docker run -it --rm \
8284
- Replace `/path/on/host/ca.pem` with the actual location of your CA certificate on the host system.
8385
- `CADENCE_GRPC_TLS_CA_FILE` must point to the path inside the container where the certificate is mounted.
8486

85-
### Building & developing cadence-web
87+
## Building & developing cadence-web
8688

8789
`cadence-web` requires node `v18` or greater to be able to run correctly.
8890

89-
#### Creating a production build
91+
### Creating a production build
9092

9193
To create a production build, follow these steps:
9294

@@ -110,7 +112,7 @@ npm start
110112

111113
4. Once the webapp is ready, access it through `localhost:8088` (port can be changed using `CADENCE_WEB_PORT` environment variable)
112114

113-
#### Running development environment
115+
### Running development environment
114116

115117
To run the development server, follow these steps:
116118

@@ -128,15 +130,15 @@ npm run dev
128130

129131
3. Once the webapp is ready, access it through `localhost:8088` (port can be changed using `CADENCE_WEB_PORT` environment variable)
130132

131-
Note: For contribution we recommend using dev containers, check [VSCode Dev Containers](#using-vscode-dev-containers) section for more information
133+
Note: For contribution we recommend using dev containers, check [VSCode Dev Containers](#using-vscode-dev-containers) for more information
132134

133135
#### Using VSCode Dev Containers
134136

135137
1. Set up the [Remote Containers plugin](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) in VSCode.
136138
2. Open the cadence-web directory in VSCode.
137139
3. Make sure to update `CADENCE_GRPC_PEERS` with the correct host. (If you are connecting to a server on a container host machine use `host.docker.internal:7833`, where `7833` is the gRPC port for a running [cadence-frontend](https://github.com/cadence-workflow/cadence/tree/master/service/frontend) service)
138140
4. Use the Command Palette to select the 'Reopen folder in Container' option
139-
5. Follow same commands listed in [Running development environment](#running-development-environment) section.
141+
5. Follow the same commands listed in [Running development environment](#running-development-environment).
140142

141143
#### Developing cadence-web against cadence composed docker
142144

@@ -146,11 +148,36 @@ To start development against dockerized cadence services, run the following comm
146148
docker-compose -f docker-compose-backend-services.yml up
147149
```
148150

149-
You can customize the YAML file or reuse configurations from the [cadence repository](https://github.com/cadence-workflow/cadence/tree/master/docker). (In case of reusing exsisting files: ensure that cadence-web is not included in the composed container services, or just remove it)
151+
You can customize the YAML file or reuse configurations from the [cadence repository](https://github.com/cadence-workflow/cadence/tree/master/docker). (In case of reusing existing files: ensure that cadence-web is not included in the composed container services, or just remove it)
150152

151153
After running `cadence`, start `cadence-web` for development using one of the previous methods ([Running development environment](#running-development-environment), [VSCode Dev Containers](#using-vscode-dev-containers))
152154

153-
#### NPM scripts
155+
### Updating IDLs
156+
157+
To update the Cadence IDL files:
158+
159+
1. Update the commit hash in `package.json` under `config.cadence_idl_version` to the latest commit hash from the [cadence-idl repository](https://github.com/cadence-workflow/cadence-idl).
160+
161+
2. Download the new IDL files:
162+
```
163+
npm run install-idl
164+
```
165+
166+
3. Generate TypeScript types from the IDL files:
167+
```
168+
npm run generate:idl
169+
```
170+
171+
4. Check for errors:
172+
```
173+
npm run lint && npm run typecheck && npm run test
174+
```
175+
176+
5. Run cadence-web locally to sanity-check if everything works as expected (see [Running development environment](#running-development-environment))
177+
178+
6. Fix any errors that arise from the updated IDL files.
179+
180+
### NPM scripts
154181

155182
| script | Description |
156183
| ----------------- | ----------------------------------------------------------------------------------------------- |

0 commit comments

Comments
 (0)