diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml new file mode 100644 index 0000000000..a15fc1061e --- /dev/null +++ b/.github/workflows/test-and-publish.yml @@ -0,0 +1,46 @@ +name: react-query tests + +on: + push: + branches: + - 'master' + pull_request: + +jobs: + test: + name: 'node ${{ matrix.node }} ${{ matrix.os }} ' + runs-on: '${{ matrix.os }}' + strategy: + matrix: + os: [ubuntu-latest] + node: [12, 10] + steps: + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - run: npm i -g yarn + - run: yarn --frozen-lockfile + - run: yarn test:ci + + publish-module: + name: 'Publish Module to NPM' + needs: test + if: github.ref == 'refs/heads/master' #publish only when merged in master, not on PR + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm i -g yarn + - run: yarn --frozen-lockfile + - run: npx semantic-release@17 + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + GH_TOKEN: ${{secrets.GH_TOKEN}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index a3b6e0dd07..0000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: react-query tests - -on: - push: - branches: - - 'master' - pull_request: - -jobs: - test: - name: 'node ${{ matrix.node }} ${{ matrix.os }} ' - runs-on: '${{ matrix.os }}' - strategy: - matrix: - os: [ubuntu-latest] - node: [12, 10] - steps: - - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - uses: actions/checkout@v2-beta - with: - fetch-depth: 1 - - run: npm i -g yarn - - run: yarn --frozen-lockfile - - run: yarn test:ci diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..fc194bcd78 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,114 @@ +# Contributing + +## Questions + +If you have questions about implementation details, help or support, then please use our dedicated community forum at [Github Discussions](https://github.com/tannerlinsley/react-query/discussions) **PLEASE NOTE:** If you choose to instead open an issue for your question, your issue will be immediately closed and redirected to the forum. + +## Reporting Issues + +If you have found what you think is a bug, please [file an issue](https://github.com/tannerlinsley/react-query/issues/new). **PLEASE NOTE:** Issues that are identified as implementation questions or non-issues will be immediately closed and redirected to [Github Discussions](https://github.com/tannerlinsley/react-query/discussions) + +## Suggesting new features + +If you are here to suggest a feature, first create an issue if it does not already exist. From there, we will discuss use-cases for the feature and then finally discuss how it could be implemented. + +## Development + +If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started: + +- Fork this repository +- Install dependencies by running `$ yarn` +- Link `react-query` locally by running `$ yarn link` +- Auto-build files as you edit by running `$ yarn start` +- Implement your changes and tests to files in the `src/` directory and corresponding test files +- To run examples, follow their individual directions. Usually this is just `$ yarn && yarn start`. +- To run examples using your local build, link to the local `react-query` by running `$ yarn link react-query` from the example's directory +- Document your changes in the appropriate doc page +- Git stage your required chnages and commit (see below commit guidelines) +- Submit PR for review + +## Commit message conventions + +`react-query` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines). + +We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. + +### Commit Message Format + +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type**, a **scope** and a **subject**: + +``` +(): + + + +