From 401a7f0543ad259a16648c68d670661456a9818c Mon Sep 17 00:00:00 2001 From: Matthew Keller Date: Wed, 6 Mar 2024 14:23:32 -0500 Subject: [PATCH] [DOC] add a bit more detail to the js client DEVELOP.md (#1829) --- clients/js/DEVELOP.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/clients/js/DEVELOP.md b/clients/js/DEVELOP.md index c82fd15327e..1604251477e 100644 --- a/clients/js/DEVELOP.md +++ b/clients/js/DEVELOP.md @@ -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. @@ -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 @@ -45,6 +60,7 @@ git tag js_release_alpha_A.B.C 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 @@ -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