Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automation - Scripts and runners #64

Merged
merged 5 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
# React Hooks
# 🎒 React Hooks

A modular collection of React hooks.

🦄 TypeScript support • 🐐 Fully tested • 👾 Server rendering compatible

![Travis](https://img.shields.io/travis/com/simmo/hooks?style=flat-square)
![License](https://img.shields.io/github/license/simmo/hooks?style=flat-square)

## Help

Run `yarn go`

## Packages

See `./packages/*` for individual package installation details.

| Package | Version | Description |
| ------- | ------- | ----------- |
| [@hooks/before-unload](packages/before-unload) | ![npm](https://img.shields.io/npm/v/@hooks/before-unload?style=flat-square) | React hook to provide a message before the page is unloaded |
| [@hooks/boolean](packages/boolean) | ![npm](https://img.shields.io/npm/v/@hooks/boolean?style=flat-square) | React hook to store a boolean |
| [@hooks/geo-location](packages/geo-location) | ![npm](https://img.shields.io/npm/v/@hooks/geo-location?style=flat-square) | React hook to return geo location details |
| [@hooks/interval](packages/interval) | ![npm](https://img.shields.io/npm/v/@hooks/interval?style=flat-square) | React hook to wrap setInterval |
| [@hooks/media-query](packages/media-query) | ![npm](https://img.shields.io/npm/v/@hooks/media-query?style=flat-square) | React hook to respond to media queries |
| [@hooks/mount](packages/mount) | ![npm](https://img.shields.io/npm/v/@hooks/mount?style=flat-square) | React hook to execute callback on component mount |
| [@hooks/network-status](packages/network-status) | ![npm](https://img.shields.io/npm/v/@hooks/network-status?style=flat-square) | React hook return network status details |
| [@hooks/previous](packages/previous) | ![npm](https://img.shields.io/npm/v/@hooks/previous?style=flat-square) | React hook to remember a value between renders |
| [@hooks/queue](packages/queue) | ![npm](https://img.shields.io/npm/v/@hooks/queue?style=flat-square) | React hook to manage a queue |
| [@hooks/raf](packages/raf) | ![npm](https://img.shields.io/npm/v/@hooks/raf?style=flat-square) | React hook to wrap requestAnimationFrame |
| [@hooks/render-count](packages/render-count) | ![npm](https://img.shields.io/npm/v/@hooks/render-count?style=flat-square) | React hook to record the render count |
| [@hooks/stack](packages/stack) | ![npm](https://img.shields.io/npm/v/@hooks/stack?style=flat-square) | React hook to manage a stack |
| [@hooks/store](packages/store) | ![npm](https://img.shields.io/npm/v/@hooks/store?style=flat-square) | React hook to provide an observable global store |
| [@hooks/timeout](packages/timeout) | ![npm](https://img.shields.io/npm/v/@hooks/timeout?style=flat-square) | React hook to delay function execution |
| [@hooks/title](packages/title) | ![npm](https://img.shields.io/npm/v/@hooks/title?style=flat-square) | React hook to set the document title |
| [@hooks/unmount](packages/unmount) | ![npm](https://img.shields.io/npm/v/@hooks/unmount?style=flat-square) | React hook execute a callback on component unmount |
| Package | Version | Description |
| ------------------------------------------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [@hooks/before-unload](packages/before-unload) | ![npm](https://img.shields.io/npm/v/@hooks/before-unload?style=flat-square) | React hook to provide a message prompt before the page is unloaded |
| [@hooks/boolean](packages/boolean) | ![npm](https://img.shields.io/npm/v/@hooks/boolean?style=flat-square) | React hook to store a boolean |
| [@hooks/geo-location](packages/geo-location) | ![npm](https://img.shields.io/npm/v/@hooks/geo-location?style=flat-square) | React hook to return geo location details |
| [@hooks/interval](packages/interval) | ![npm](https://img.shields.io/npm/v/@hooks/interval?style=flat-square) | React hook to wrap setInterval |
| [@hooks/media-query](packages/media-query) | ![npm](https://img.shields.io/npm/v/@hooks/media-query?style=flat-square) | React hook to respond to media queries |
| [@hooks/mount](packages/mount) | ![npm](https://img.shields.io/npm/v/@hooks/mount?style=flat-square) | React hook to execute callback on component mount |
| [@hooks/network-status](packages/network-status) | ![npm](https://img.shields.io/npm/v/@hooks/network-status?style=flat-square) | React hook return network status details |
| [@hooks/previous](packages/previous) | ![npm](https://img.shields.io/npm/v/@hooks/previous?style=flat-square) | React hook to remember a value between renders |
| [@hooks/queue](packages/queue) | ![npm](https://img.shields.io/npm/v/@hooks/queue?style=flat-square) | React hook to manage a queue |
| [@hooks/raf](packages/raf) | ![npm](https://img.shields.io/npm/v/@hooks/raf?style=flat-square) | React hook to wrap requestAnimationFrame |
| [@hooks/render-count](packages/render-count) | ![npm](https://img.shields.io/npm/v/@hooks/render-count?style=flat-square) | React hook to record the render count |
| [@hooks/stack](packages/stack) | ![npm](https://img.shields.io/npm/v/@hooks/stack?style=flat-square) | React hook to manage a stack |
| [@hooks/store](packages/store) | ![npm](https://img.shields.io/npm/v/@hooks/store?style=flat-square) | React hook to provide an observable global store |
| [@hooks/timeout](packages/timeout) | ![npm](https://img.shields.io/npm/v/@hooks/timeout?style=flat-square) | React hook to delay function execution |
| [@hooks/title](packages/title) | ![npm](https://img.shields.io/npm/v/@hooks/title?style=flat-square) | React hook to set the document title |
| [@hooks/unmount](packages/unmount) | ![npm](https://img.shields.io/npm/v/@hooks/unmount?style=flat-square) | React hook execute a callback on component unmount |
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"lint": "eslint --ext .tsx,.ts ./packages",
"report": "node ./scripts/build-report.js",
"lerna": "lerna",
"readme": "node ./scripts/generateReadme"
"go": "node ./scripts"
},
"prettier": {
"arrowParens": "avoid",
Expand Down Expand Up @@ -72,13 +72,16 @@
"@types/testing-library__react-hooks": "^3.2.0",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"chalk": "^4.0.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react-hooks": "^3.0.0",
"inquirer": "^7.1.0",
"jest": "^25.2.7",
"jest-serializer-path": "^0.1.15",
"lerna": "^3.20.2",
"listr": "^0.14.3",
"ora": "^4.0.3",
"prettier": "^2.0.1",
"react": "^16.12.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/before-unload/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/before-unload
# 🎒 @hooks/before-unload

React hook to provide a message prompt before the page is unloaded

Expand Down
3 changes: 1 addition & 2 deletions packages/before-unload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/boolean/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/boolean
# 🎒 @hooks/boolean

React hook to store a boolean

Expand Down
3 changes: 1 addition & 2 deletions packages/boolean/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/geo-location/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/geo-location
# 🎒 @hooks/geo-location

React hook to return geo location details

Expand Down
3 changes: 1 addition & 2 deletions packages/geo-location/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/interval/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/interval
# 🎒 @hooks/interval

React hook to wrap setInterval

Expand Down
3 changes: 1 addition & 2 deletions packages/interval/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/media-query/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/media-query
# 🎒 @hooks/media-query

React hook to respond to media queries

Expand Down
3 changes: 1 addition & 2 deletions packages/media-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/mount/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/mount
# 🎒 @hooks/mount

React hook to execute callback on component mount

Expand Down
5 changes: 1 addition & 4 deletions packages/mount/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme",
"tsdoc": "typedoc --json ./docs.json --exclude *.test.ts ./",
"read": "node ./read"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/network-status/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/network-status
# 🎒 @hooks/network-status

React hook return network status details

Expand Down
3 changes: 1 addition & 2 deletions packages/network-status/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/previous/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/previous
# 🎒 @hooks/previous

React hook to remember a value between renders

Expand Down
5 changes: 1 addition & 4 deletions packages/previous/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme",
"tsdoc": "typedoc --json ./docs.json --exclude *.test.ts ./",
"read": "node ./read"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/queue/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/queue
# 🎒 @hooks/queue

React hook to manage a queue

Expand Down
5 changes: 1 addition & 4 deletions packages/queue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme",
"tsdoc": "typedoc --json ./docs.json --exclude *.test.ts ./",
"read": "node ./read"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/raf/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/raf
# 🎒 @hooks/raf

React hook to wrap requestAnimationFrame

Expand Down
3 changes: 1 addition & 2 deletions packages/raf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/render-count/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/render-count
# 🎒 @hooks/render-count

React hook to record the render count

Expand Down
3 changes: 1 addition & 2 deletions packages/render-count/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/stack
# 🎒 @hooks/stack

React hook to manage a stack

Expand Down
5 changes: 1 addition & 4 deletions packages/stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme",
"tsdoc": "typedoc --json ./docs.json --exclude *.test.ts ./",
"read": "node ./read"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/store/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/store
# 🎒 @hooks/store

React hook to provide an observable global store

Expand Down
3 changes: 1 addition & 2 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/timeout/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/timeout
# 🎒 @hooks/timeout

React hook to delay function execution

Expand Down
3 changes: 1 addition & 2 deletions packages/timeout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/title/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/title
# 🎒 @hooks/title

React hook to set the document title

Expand Down
3 changes: 1 addition & 2 deletions packages/title/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/unmount/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @hooks/unmount
# 🎒 @hooks/unmount

React hook execute a callback on component unmount

Expand Down
5 changes: 1 addition & 4 deletions packages/unmount/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"license": "MIT",
"scripts": {
"prepublishOnly": "yarn build",
"build": "node ../../scripts/build",
"docs": "node ../../scripts/generateProjectReadme",
"tsdoc": "typedoc --json ./docs.json --exclude *.test.ts ./",
"read": "node ./read"
"build": "node ../../scripts/build"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 6 additions & 0 deletions scripts/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rules": {
"@typescript-eslint/no-var-requires": 0,
"no-undef": 0
}
}
Loading