From f4c211932d358d9e5bb97937c5c2df4fe1de33d4 Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Mon, 4 Sep 2023 15:30:56 +0100 Subject: [PATCH] cleanup: merge react-hooks and root CONTRIBUTING guides --- CONTRIBUTING.md | 20 ++++++++++++++ src/platform/react-hooks/CONTRIBUTING.md | 33 ------------------------ 2 files changed, 20 insertions(+), 33 deletions(-) delete mode 100644 src/platform/react-hooks/CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d2b560c84..de0cdea3ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,3 +109,23 @@ When using the test webserver `npm run test:webserver` the following test variab - `tls_port` - TLS port to use for the tests, defaults to 443 - `tls` - true or false to enable/disable use of TLS respectively - `log_level` - Log level for the client libraries, defaults to 2, 4 is `MICRO` + +## React hooks + +The react sample application is configured to execute using Vite - which will load a sample web app that acts as a simple test harness for the hooks. + +You can run the dev server from the terminal using: + +```bash +npm run start:react +``` + +You'll need to provide an API key for the sample to work (or you'll just get a white page and some errors in the console). To do this, create the file `./src/platform/react-hooks/sample-app/.env` and add the following line: + +```.env +VITE_ABLY_API_KEY= +``` + +This API key will be loaded by the vite dev server at build time. + +You can run the unit tests by running `npm run test:react` in the terminal. diff --git a/src/platform/react-hooks/CONTRIBUTING.md b/src/platform/react-hooks/CONTRIBUTING.md deleted file mode 100644 index e113ceb326..0000000000 --- a/src/platform/react-hooks/CONTRIBUTING.md +++ /dev/null @@ -1,33 +0,0 @@ -## Contributing - -This repository is configured to execute using Vite - which will load a sample web app that acts as a simple test harness for the hooks. - -You can run the dev server from the terminal using: - -```bash -npm run start -``` - -You'll need to provide an API key for the sample to work (or you'll just get a white page and some errors in the console). To do this, create the file `./sample-app/.env` and add the following line: - -```.env -VITE_ABLY_API_KEY= -``` - -This API key will be loaded by the vite dev server at build time. - -You can run the `unit tests` by running `npm run test` in the terminal. - -You can build the published artefacts by running `npm run ci` in the terminal. The node module is distrubted as an ES6 module, and requires consumers to be able to import modules in their react apps. The test application and unit tests are excluded from the generated `dist` folder to prevent confusion at runtime. - -### Release process - -1. Create a new branch for the release, for example `release/1.2.3` -2. Update the CHANGELOG.md with any customer-affecting changes since the last release and add this to the git index -3. Run `npm version --no-git-tag-version` with the new version and add the changes to the git index -4. Update the version number in [AblyReactHooks.ts]('./src/AblyReactHooks.ts') -5. Create a PR for the release branch -6. Once the release PR is landed to the `main` branch, checkout the `main` branch locally (remember to pull the remote changes) -7. Run `git tag ` with the new version and push the tag to git -8. Run the GitHub action "Release NPM package" on the main branch -9. Visit https://github.com/ably-labs/react-hooks/tags and add release notes to the release (generally you can just copy the notes you added to the CHANGELOG)