Skip to content

Commit a283051

Browse files
author
Griko Nibras
committed
feat(docs): add api docs via typedoc
Signed-off-by: Griko Nibras <[email protected]>
1 parent 89a22f0 commit a283051

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.pnp.*
77
.yarn/*
88
dist/
9+
docs/
910
package-lock.json
1011
yarn.lock
1112

README.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ Toggle custom hook and component wrapper for React 🔦
1818
- [Toggle wrapper - `<ToggleWrap />`](#toggle-wrapper---togglewrap-)
1919
- [`<ClientOnly />`](#clientonly-)
2020
- [API](#api)
21-
- [Toggle hook](#toggle-hook)
22-
- [Toggle wrapper](#toggle-wrapper)
2321
- [Suggestions and/or questions](#suggestions-andor-questions)
2422
- [Maintainers](#maintainers)
2523
- [License](#license)
@@ -101,13 +99,7 @@ function App() {
10199

102100
## API
103101

104-
### Toggle hook
105-
106-
TODO
107-
108-
### Toggle wrapper
109-
110-
TODO
102+
Read the full API documentation on <https://use-toggle-api-docs.koding.ninja>.
111103

112104
## Suggestions and/or questions
113105

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
"scripts": {
2323
"# general commands": "##################################################",
2424
"build": "tsup",
25+
"build:docs": "typedoc",
2526
"deduplicate": "npx yarn-deduplicate && yarn install",
2627
"dev": "tsup --watch src",
2728
"lint": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\"",
28-
"prepare": "husky install $PWD/.husky",
29+
"prepare": "husky install $PWD/.husky && yarn build",
2930
"prepublishOnly": "yarn lint",
3031
"ship": "np",
3132
"type-check": "tsc --noEmit",
@@ -43,6 +44,7 @@
4344
"react": "^17",
4445
"react-dom": "^17",
4546
"tsup": "^5",
47+
"typedoc": "^0",
4648
"typescript": "^4"
4749
},
4850
"peerDependencies": {

tsconfig.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@
1616
"strictNullChecks": true,
1717
"target": "es2017"
1818
},
19-
"exclude": ["dist", "node_modules"]
19+
"exclude": ["dist", "docs", "node_modules"],
20+
"typedocOptions": {
21+
"entryPoints": ["src/index.ts"],
22+
"includeVersion": true,
23+
"out": "docs"
24+
}
2025
}

0 commit comments

Comments
 (0)