Skip to content

Commit

Permalink
feat: firestore hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
andipaetzold committed Oct 14, 2021
0 parents commit 37ac438
Show file tree
Hide file tree
Showing 34 changed files with 19,826 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
end_of_line = lf
charset = utf-8

indent_style = space
indent_size = 4

insert_final_newline = true
trim_trailing_whitespace = true

max_line_length = 125
3 changes: 3 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["config:js-lib"]
}
54 changes: 54 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build & Release

on:
- push

jobs:
build-test:
name: Build & Test
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get node version
id: node-version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Use node
uses: actions/[email protected]
with:
node-version: ${{ steps.node-version.outputs.NODE_VERSION }}
cache: "npm"

- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test -- --ci --runInBand --coverage

release:
name: Release
runs-on: ubuntu-20.04
needs: build-test
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get node version
id: node-version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
- name: Use node
uses: actions/[email protected]
with:
node-version: ${{ steps.node-version.outputs.NODE_VERSION }}
cache: "npm"

- name: Install dependencies
run: npm ci
- name: Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/lib/
/node_modules/
/test-results/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.11.1
26 changes: 26 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"branches": [
"main",
{
"name": "next",
"prerelease": true
},
{
"name": "next-major",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"message": "chore: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Andi Pätzold

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.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[![npm](https://img.shields.io/npm/v/react-firehooks)](https://www.npmjs.com/package/react-firehooks)
[![tests](https://github.com/andipaetzold/react-firehooks/actions/workflows/build-release.yml/badge.svg?branch=main)](https://github.com/andipaetzold/react-firehooks/actions/workflows/build-release.yml?query=branch%3Amain)
[![downloads](https://img.shields.io/npm/dm/react-firehooks)](https://www.npmjs.com/package/react-firehooks)
[![license](https://img.shields.io/github/license/andipaetzold/react-firehooks)](https://github.com/andipaetzold/react-firehooks/blob/main/LICENSE)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

# MDB Reader

Lightweight dependency-free collection of React hooks for Firebase.

## Installation

```sh
npm install react-firehooks
```

or

```sh
yarn add react-firehooks
```

## Compatibility

* [firebase](https://www.npmjs.com/package/firebase): 9.0.0 or greater
* [react](https://www.npmjs.com/package/react): 16.8.0 or greater

## Usage

TODO

## Development

### Build

To build the library, first install the dependencies, then run `npm run build` for a single build or `npm run watch` for automatic rebuilds.

```sh
npm install
npm run build
```

### Tests

To run the tests, first install the dependencies, then run `npm test`. Watch mode can be started with `npm test -- --watch`.

```sh
npm install
npm test
```

## Resources

TBD

## License

[MIT](LICENSE)
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
transform: {
"^.+\\.ts$": "ts-jest",
},
testRegex: "^.+\\.spec\\.ts$",
coverageDirectory: "test-results/coverage",
globals: {
"ts-jest": {
tsconfig: "tsconfig.jest.json",
},
},
};
Loading

0 comments on commit 37ac438

Please sign in to comment.