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) diff --git a/src/platform/react-hooks/LICENSE b/src/platform/react-hooks/LICENSE deleted file mode 100644 index bef22a0d26..0000000000 --- a/src/platform/react-hooks/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 snakemode - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.