Skip to content

Commit

Permalink
[DOC] add a bit more detail to the js client DEVELOP.md (#1829)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlabasterAxe authored Mar 6, 2024
1 parent 362d350 commit 401a7f0
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions clients/js/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,34 @@ This readme is helpful for local dev.

- Make sure you have Java installed (for the generator). You can download it from [java.com](https://java.com)
- Make sure you set ALLOW_RESET=True for your Docker Container. If you don't do this, tests won't pass.

```
environment:
- IS_PERSISTENT=TRUE
- ALLOW_RESET=True
```

- Make sure you are running the docker backend at localhost:8000 (\*there is probably a way to stand up the fastapi server by itself and programmatically in the loop of generating this, but not prioritizing it for now. It may be important for the release)

### Generating
### Running the Examples

To get started developing on the JS client libraries, you'll want to run the examples.

1. `yarn` to install deps.
1. `yarn build` to build the library.
1. `cd examples/browser` or `cd examples/node`
1. `yarn` to install example deps.
1. `yarn dev` to run the example.

### Generating REST Client Code

If you modify the REST API, you'll need to regenerate the generated code that underlies the JavaScript client libraries.

1. `yarn` to install deps
2. `yarn genapi`
3. Examples are in the `examples` folder. There is one for the browser and one for node. Run them with `yarn dev`, eg `cd examples/browser && yarn dev`

### Running test
### Running tests

`yarn test` will launch a test docker backend, run a db cleanup and run tests.
`yarn test:run` will run against the docker backend you have running. But CAUTION, it will delete data. This is the easiest and fastest way to run tests.
Expand All @@ -29,8 +43,9 @@ environment:
#### Automatically

##### Increase the version number

1. Create a new PR for the release that upgrades the version in code. Name it `js_release/A.B.C` for production releases and `js_release_alpha/A.B.C` for alpha releases. In the package.json update the version number to the new version. For production releases this is just the version number, for alpha
releases this is the version number with '-alphaX' appended to it. For example, if the current version is 1.0.0, the alpha release would be 1.0.0-alpha1 for the first alpha release, 1.0.0-alpha2 for the second alpha release, etc.
releases this is the version number with '-alphaX' appended to it. For example, if the current version is 1.0.0, the alpha release would be 1.0.0-alpha1 for the first alpha release, 1.0.0-alpha2 for the second alpha release, etc.
2. Add the "release" label to this PR
3. Once the PR is merged, tag your commit SHA with the release version

Expand All @@ -45,6 +60,7 @@ git tag js_release_alpha_A.B.C <SHA>
4. You need to then wait for the github action for main for `chroma js release` to complete on main.

##### Perform the release

1. Push your tag to origin to create the release

```bash
Expand All @@ -55,12 +71,12 @@ git push origin js_release_A.B.C

git push origin js_release_alpha_A.B.C
```

2. This will trigger a Github action which performs the release

#### Manually
`npm run release` pushes the `package.json` defined packaged to the package manager for authenticated users. It will build, test, and then publish the new version.


`npm run release` pushes the `package.json` defined packaged to the package manager for authenticated users. It will build, test, and then publish the new version.

### Useful links

Expand Down

0 comments on commit 401a7f0

Please sign in to comment.