Skip to content

Commit 255b810

Browse files
authored
v3.0.2
* fix(types): update `see` paths that are not valid and add missing * fix(docs): update `see` paths that are not valid * fix(docs): remove see parameter from generated api docs * fix(docs): update `book.json` to have v3.0.0 selected
1 parent ee47d1e commit 255b810

34 files changed

+453
-315
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If you're not, you can access the library on [unpkg](https://unpkg.com/redux-fir
4343

4444
### Older Versions
4545

46-
Interested in support for versions of [`react-redux`](https://github.com/reduxjs/react-redux) before v6 or the [new react context API](https://reactjs.org/docs/context.html)? Checkout the `v2.*.*` versions (installed through `npm i --save react-redux-firebase^@2.5.0`).
46+
Interested in support for versions of [`react-redux`](https://github.com/reduxjs/react-redux) before v6 or the [new react context API](https://reactjs.org/docs/context.html)? Checkout [the `v2.*.*` versions](https://github.com/prescottprue/react-redux-firebase/tree/v2) (installed through `npm i --save react-redux-firebase^@2.5.0`).
4747

4848
## Use
4949

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* [useFirebase](/docs/api/useFirebase.md)
3232
* [useFirebaseConnect](/docs/api/useFirebaseConnect.md)
3333
* [useFirestore](/docs/api/useFirestore.md)
34+
* [useFirestoreConnect](/docs/api/useFirebaseConnect.md)
3435
* HOCs
3536
* [firebaseConnect](/docs/api/firebaseConnect.md)
3637
* [withFirebase](/docs/api/withFirebase.md)

bin/api-docs-generate.js

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
/* eslint-disable no-console */
22
const exec = require('child-process-promise').exec
33
const fs = require('fs')
4+
const { promisify } = require('util')
5+
6+
const readFilePromise = promisify(fs.readFile)
7+
const writeFilePromise = promisify(fs.writeFile)
48

59
const SRC_FOLDER = 'src'
10+
const API_DOCS_FOLDER = 'docs/api'
611
const pathsToSkip = ['index.js', 'utils', '.DS_Store', 'actions']
712
const fileRenames = {
813
'createFirebaseInstance.js': 'firebaseInstance'
914
}
1015

16+
/**
17+
* Remove see field from markdown file
18+
* @param {string} filePath - Path of file to remove see field from
19+
* @returns {Promise} Resolves after all instances of see parameter are removed
20+
*/
21+
function removeSeeFromMarkdown(filePath) {
22+
return readFilePromise(filePath).then(fileContentsBuffer => {
23+
const fileContents = fileContentsBuffer.toString()
24+
const cleanedContents = fileContents.replace(/\n-.*\*\*See.*/g, '')
25+
return writeFilePromise(filePath, cleanedContents)
26+
})
27+
}
28+
1129
/**
1230
* @param {object} file - File object for which to generate docs
1331
* @returns {Promise} Resolves after running docs generation
@@ -16,11 +34,14 @@ function generateDocForFile(file) {
1634
return exec(
1735
`$(npm bin)/documentation build ${SRC_FOLDER}/${
1836
file.src
19-
} -f md -o docs/api/${file.dest} --shallow`
37+
} -f md -o ${API_DOCS_FOLDER}/${file.dest} --shallow`
2038
)
2139
.then(res => {
2240
console.log('Successfully generated', file.dest || file)
23-
return res
41+
return removeSeeFromMarkdown(
42+
`${process.cwd()}/${API_DOCS_FOLDER}/${file.dest}`
43+
)
44+
// return res
2445
})
2546
.catch(error => {
2647
console.log('error generating doc: ', error.message || error)

book.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"gitbookConfigURL": "https://storage.googleapis.com/docs.react-redux-firebase.com/book.json",
2323
"options": [
2424
{
25-
"value": "http://docs.react-redux-firebase.com/history/v2.0.0/",
26-
"text": "Version 2.0.0",
27-
"selected": true
25+
"value": "http://react-redux-firebase.com/",
26+
"text": "Version 3.0.0",
27+
"selected": true
2828
},
2929
{
30-
"value": "http://docs.react-redux-firebase.com/history/v3.0.0/",
31-
"text": "Version 3.0.0"
30+
"value": "http://docs.react-redux-firebase.com/history/v2.0.0/",
31+
"text": "Version 2.0.0"
3232
},
3333
{
3434
"value": "http://docs.react-redux-firebase.com/history/v1.5.0/",

docs/api/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
Just like [redux](http://redux.js.org/docs/api/index.html), the react-redux-firebase API surface is intentionally as small as possible.
44

55
## Top-Level Exports
6-
* [firebaseConnect](/docs/api/firebaseConnect.md#firebaseconnect)
7-
* [firestoreConnect](/docs/api/firestoreConnect.md#firebaseconnect)
8-
* [withFirebase](/docs/api/withFirebase.md)
9-
* [withFirestore](/docs/api/withFirestore.md)
106
* [useFirebase](/docs/api/useFirebase.md#usefirebase)
117
* [useFirebaseConnect](/docs/api/useFirebaseConnect.md#usefirebaseconnect)
128
* [useFirestore](/docs/api/useFirestore.md#usefirestore)
139
* [useFirestoreConnect](/docs/api/useFirestoreConnect.md#usefirebaseconnect)
10+
* [firebaseConnect](/docs/api/firebaseConnect.md#firebaseconnect)
11+
* [withFirebase](/docs/api/withFirebase.md)
12+
* [firestoreConnect](/docs/api/firestoreConnect.md)
13+
* [withFirestore](/docs/api/withFirestore.md)
1414
* [reducer](/docs/api/reducer.md) (also exported as `firebaseReducer`)
1515
* [constants](/docs/api/constants.md)
1616
* [actionTypes](/docs/api/constants.md)
17-
* [helpers](/docs/api/helpers.md)
1817
* [isLoaded](/docs/api/helpers.md#isLoaded)
1918
* [isEmpty](/docs/api/helpers.md#isEmpty)
2019
* [populate](/docs/api/helpers.md#populate)

docs/api/ReactReduxFirebaseProvider.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77

88
## ReactReduxFirebaseProvider
99

10-
- **See: [http://docs.react-redux-firebase.com/history/v3.0.0/docs/api/ReactReduxFirebaseProvider.html][3]**
1110

12-
Provider for context containing extended firebase instance created
13-
by react-redux-firebase
11+
Provider for context containing extended firebase
12+
instance created by react-redux-firebase.
1413

1514
### Parameters
1615

@@ -28,7 +27,7 @@ Returns **React.Context.Provider** Provider for react-redux-firebase context
2827

2928
[2]: #parameters
3029

31-
[3]: http://docs.react-redux-firebase.com/history/v3.0.0/docs/api/ReactReduxFirebaseProvider.html
30+
[3]: https://react-redux-firebase.com/api/docs/ReactReduxFirebaseProvider.html
3231

3332
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
3433

docs/api/ReduxFirestoreProvider.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
## ReduxFirestoreProvider
99

10-
- **See: [http://docs.react-redux-firebase.com/history/v3.0.0/docs/api/ReduxFirestoreProvider.html][3]**
1110

1211
Provider for context containing extended firestore instance created
1312
by react-redux-firebase
@@ -28,7 +27,7 @@ Returns **React.Context.Provider** Provider for redux-firestore context
2827

2928
[2]: #parameters
3029

31-
[3]: http://docs.react-redux-firebase.com/history/v3.0.0/docs/api/ReduxFirestoreProvider.html
30+
[3]: https://react-redux-firebase.com/docs/api/ReduxFirestoreProvider.html
3231

3332
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
3433

docs/api/firebaseConnect.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
## firebaseConnect
1111

12-
- **See: [http://react-redux-firebase.com/api/firebaseConnect.html][5]**
12+
**Extends React.Component**
13+
14+
15+
React Higher Order Component that automatically listens/unListens to
16+
Firebase Real Time Database on mount/unmount of the component. This uses
17+
React's Component Lifecycle hooks.
1318

1419
### Parameters
1520

@@ -104,7 +109,7 @@ Returns **React.Component** Component wrapped in context
104109

105110
[4]: #parameters-1
106111

107-
[5]: http://react-redux-firebase.com/api/firebaseConnect.html
112+
[5]: https://react-redux-firebase.com/docs/api/firebaseConnect.html
108113

109114
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
110115

0 commit comments

Comments
 (0)