Skip to content

Commit

Permalink
v3.0.2
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
prescottprue authored Oct 13, 2019
1 parent ee47d1e commit 255b810
Show file tree
Hide file tree
Showing 34 changed files with 453 additions and 315 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If you're not, you can access the library on [unpkg](https://unpkg.com/redux-fir

### Older Versions

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`).
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`).

## Use

Expand Down
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* [useFirebase](/docs/api/useFirebase.md)
* [useFirebaseConnect](/docs/api/useFirebaseConnect.md)
* [useFirestore](/docs/api/useFirestore.md)
* [useFirestoreConnect](/docs/api/useFirebaseConnect.md)
* HOCs
* [firebaseConnect](/docs/api/firebaseConnect.md)
* [withFirebase](/docs/api/withFirebase.md)
Expand Down
25 changes: 23 additions & 2 deletions bin/api-docs-generate.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
/* eslint-disable no-console */
const exec = require('child-process-promise').exec
const fs = require('fs')
const { promisify } = require('util')

const readFilePromise = promisify(fs.readFile)
const writeFilePromise = promisify(fs.writeFile)

const SRC_FOLDER = 'src'
const API_DOCS_FOLDER = 'docs/api'
const pathsToSkip = ['index.js', 'utils', '.DS_Store', 'actions']
const fileRenames = {
'createFirebaseInstance.js': 'firebaseInstance'
}

/**
* Remove see field from markdown file
* @param {string} filePath - Path of file to remove see field from
* @returns {Promise} Resolves after all instances of see parameter are removed
*/
function removeSeeFromMarkdown(filePath) {
return readFilePromise(filePath).then(fileContentsBuffer => {
const fileContents = fileContentsBuffer.toString()
const cleanedContents = fileContents.replace(/\n-.*\*\*See.*/g, '')
return writeFilePromise(filePath, cleanedContents)
})
}

/**
* @param {object} file - File object for which to generate docs
* @returns {Promise} Resolves after running docs generation
Expand All @@ -16,11 +34,14 @@ function generateDocForFile(file) {
return exec(
`$(npm bin)/documentation build ${SRC_FOLDER}/${
file.src
} -f md -o docs/api/${file.dest} --shallow`
} -f md -o ${API_DOCS_FOLDER}/${file.dest} --shallow`
)
.then(res => {
console.log('Successfully generated', file.dest || file)
return res
return removeSeeFromMarkdown(
`${process.cwd()}/${API_DOCS_FOLDER}/${file.dest}`
)
// return res
})
.catch(error => {
console.log('error generating doc: ', error.message || error)
Expand Down
10 changes: 5 additions & 5 deletions book.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"gitbookConfigURL": "https://storage.googleapis.com/docs.react-redux-firebase.com/book.json",
"options": [
{
"value": "http://docs.react-redux-firebase.com/history/v2.0.0/",
"text": "Version 2.0.0",
"selected": true
"value": "http://react-redux-firebase.com/",
"text": "Version 3.0.0",
"selected": true
},
{
"value": "http://docs.react-redux-firebase.com/history/v3.0.0/",
"text": "Version 3.0.0"
"value": "http://docs.react-redux-firebase.com/history/v2.0.0/",
"text": "Version 2.0.0"
},
{
"value": "http://docs.react-redux-firebase.com/history/v1.5.0/",
Expand Down
9 changes: 4 additions & 5 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
Just like [redux](http://redux.js.org/docs/api/index.html), the react-redux-firebase API surface is intentionally as small as possible.

## Top-Level Exports
* [firebaseConnect](/docs/api/firebaseConnect.md#firebaseconnect)
* [firestoreConnect](/docs/api/firestoreConnect.md#firebaseconnect)
* [withFirebase](/docs/api/withFirebase.md)
* [withFirestore](/docs/api/withFirestore.md)
* [useFirebase](/docs/api/useFirebase.md#usefirebase)
* [useFirebaseConnect](/docs/api/useFirebaseConnect.md#usefirebaseconnect)
* [useFirestore](/docs/api/useFirestore.md#usefirestore)
* [useFirestoreConnect](/docs/api/useFirestoreConnect.md#usefirebaseconnect)
* [firebaseConnect](/docs/api/firebaseConnect.md#firebaseconnect)
* [withFirebase](/docs/api/withFirebase.md)
* [firestoreConnect](/docs/api/firestoreConnect.md)
* [withFirestore](/docs/api/withFirestore.md)
* [reducer](/docs/api/reducer.md) (also exported as `firebaseReducer`)
* [constants](/docs/api/constants.md)
* [actionTypes](/docs/api/constants.md)
* [helpers](/docs/api/helpers.md)
* [isLoaded](/docs/api/helpers.md#isLoaded)
* [isEmpty](/docs/api/helpers.md#isEmpty)
* [populate](/docs/api/helpers.md#populate)
Expand Down
7 changes: 3 additions & 4 deletions docs/api/ReactReduxFirebaseProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@

## ReactReduxFirebaseProvider

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

Provider for context containing extended firebase instance created
by react-redux-firebase
Provider for context containing extended firebase
instance created by react-redux-firebase.

### Parameters

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

[2]: #parameters

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

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

Expand Down
3 changes: 1 addition & 2 deletions docs/api/ReduxFirestoreProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

## ReduxFirestoreProvider

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

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

[2]: #parameters

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

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

Expand Down
9 changes: 7 additions & 2 deletions docs/api/firebaseConnect.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@

## firebaseConnect

- **See: [http://react-redux-firebase.com/api/firebaseConnect.html][5]**
**Extends React.Component**


React Higher Order Component that automatically listens/unListens to
Firebase Real Time Database on mount/unmount of the component. This uses
React's Component Lifecycle hooks.

### Parameters

Expand Down Expand Up @@ -104,7 +109,7 @@ Returns **React.Component** Component wrapped in context

[4]: #parameters-1

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

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

Expand Down
Loading

0 comments on commit 255b810

Please sign in to comment.