Skip to content

Commit 6008849

Browse files
committed
docs: add docs
1 parent 7505c0c commit 6008849

File tree

11 files changed

+179
-74
lines changed

11 files changed

+179
-74
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Deploy Documentation
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build_docs:
8+
name: Build and Deploy Documentation
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checking out Repository
12+
uses: actions/checkout@v1
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v1
15+
- name: Install Dependencies
16+
run: yarn bootstrap
17+
- name: Build and Deploy Production Files
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: yarn deploy-docs

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Run Tests
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
test:
11+
name: Run Testing Suite
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checking out Repository
15+
uses: actions/checkout@v2
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: 12.x
20+
- name: Install Dependencies
21+
run: yarn bootstrap
22+
- name: Run Tests
23+
run: yarn test
24+
- name: Build Project
25+
run: yarn build
26+
- name: Upload Test Coverage to CodeCov
27+
uses: codecov/[email protected]
28+
with:
29+
token: ${{ secrets.CODECOV_TOKEN }}

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
},
1919
"homepage": "https://github.com/react-restart/hooks#readme",
2020
"scripts": {
21+
"bootstrap": "yarn && yarn --cwd www",
2122
"test": "jest --coverage",
2223
"tdd": "jest --watch",
2324
"build:pick": "cherry-pick --name=@restart/hooks --cwd=lib --input-dir=../src --cjs-dir=cjs --esm-dir=esm",
2425
"build": "rimraf lib && 4c build src && yarn build:pick",
26+
"deploy-docs": "yarn --cwd www build --prefix-paths && gh-pages -d www/public",
2527
"prepublishOnly": "yarn build"
2628
},
2729
"jest": {
@@ -65,6 +67,7 @@
6567
"enzyme": "^3.10.0",
6668
"enzyme-adapter-react-16": "^1.15.1",
6769
"eslint": "^6.7.0",
70+
"gh-pages": "^2.2.0",
6871
"husky": "^4.2.3",
6972
"jest": "^25.1.0",
7073
"lint-staged": "^10.0.8",
File renamed without changes.

src/useSet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class ObservableSet<V> extends Set<V> {
4949
*
5050
* @param init initial Set values
5151
*/
52-
function useSet<V>(init?: Iterable<V>) {
52+
function useSet<V>(init?: Iterable<V>): ObservableSet<V> {
5353
const forceUpdate = useForceUpdate()
5454
return useStableMemo(() => new ObservableSet<V>(forceUpdate, init), [])
5555
}

www/gatsby-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
options: {
1212
sources: [`${__dirname}/../src`],
1313
getImportName(docNode) {
14-
return `import { ${docNode.name} } from '${docNode.packageName}'`
14+
return `import ${docNode.name} from '${docNode.packageName}/${docNode.name}'`
1515
},
1616
},
1717
},

www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "gatsby build"
88
},
99
"dependencies": {
10-
"@docpocalypse/gatsby-theme": "^0.11.24",
10+
"@docpocalypse/gatsby-theme": "^0.11.25",
1111
"gatsby": "^2.21.24",
1212
"gatsby-plugin-typedoc": "^0.3.11",
1313
"react": "^16.13.1",

www/src/pages/index.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
11
# Getting Started
2+
3+
`@restart/hooks` is a utility library of React hooks. There is a hook for almost any use case.
4+
Try them all!
5+
6+
## Installation
7+
8+
Install via your favorite package manager:
9+
10+
```sh
11+
npm install @restart/hooks
12+
```
13+
14+
## Usage
15+
16+
Check out the indivudal API docs for each hook for descriptions of what it does and
17+
how to use it.

www/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,10 +1226,10 @@
12261226
optionalDependencies:
12271227
fibers "^5.0.0"
12281228

1229-
"@docpocalypse/gatsby-theme@^0.11.24":
1230-
version "0.11.24"
1231-
resolved "https://registry.yarnpkg.com/@docpocalypse/gatsby-theme/-/gatsby-theme-0.11.24.tgz#7c11df19f572c45177fe88f6f4ceb265bb631167"
1232-
integrity sha512-Q//H4vEVAVD6miyfZcyoMH5TBKMWu9CDFW2DOyGlgucF76LaIm3USf4aNwB2xdEgvLHGdav9CiEvCTC7j3tg0Q==
1229+
"@docpocalypse/gatsby-theme@^0.11.25":
1230+
version "0.11.25"
1231+
resolved "https://registry.yarnpkg.com/@docpocalypse/gatsby-theme/-/gatsby-theme-0.11.25.tgz#2a4fb4517cef3d6c66fc91e3ca6cf753f680574f"
1232+
integrity sha512-olyXoPP7ABMqQCNA1xD1psSPrV6n3v3XIwuqJ7CDwQme/miCUifrIjeyG6YSHD2nHwXvedd/ZYJf3OFnto7Atw==
12331233
dependencies:
12341234
"@docpocalypse/code-live" "^0.4.18"
12351235
"@docpocalypse/gatsby-theme-core" "^0.8.17"

0 commit comments

Comments
 (0)