Skip to content

Commit

Permalink
chore(deps): Upgrade to the latest version of all dependencies
Browse files Browse the repository at this point in the history
There is a security vulnerability in 'deep-extend', which is used by 'kcd-scripts'. This commit upgrades 'kcd-scripts' as well as all other dependencies to their latest verion.
It also ignores the 'react/no-unused-state' rule due to an issue with react context (jsx-eslint/eslint-plugin-react#1910)
  • Loading branch information
green-arrow committed Mar 9, 2019
1 parent 5f4d581 commit ef0cfe5
Show file tree
Hide file tree
Showing 7 changed files with 4,334 additions and 2,780 deletions.
50 changes: 35 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "react-firestore",
"version": "0.0.0-semantically-released",
"description":
"React components to fetch data from firestore using render props",
"description": "React components to fetch data from firestore using render props",
"author": "Andrew Walton",
"license": "MIT",
"homepage": "https://github.com/green-arrow/react-firestore#readme",
Expand All @@ -25,40 +24,61 @@
"test:build": "kcd-scripts test --no-watch",
"build-and-test": "npm run build -s && npm run test:build -s",
"validate": "kcd-scripts validate lint,build-and-test,test:cover",
"precommit": "kcd-scripts precommit",
"prepare": "npm run build"
},
"files": ["dist", "preact"],
"husky": {
"hooks": {
"pre-commit": "kcd-scripts pre-commit"
}
},
"files": [
"dist",
"preact"
],
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js",
"rules": {
"max-lines": "off",
"no-eq-null": "off",
"eqeqeq": "off",
"react/jsx-indent": "off",
"complexity": ["error", 12]
"react/no-unused-state": "off",
"complexity": [
"error",
12
]
}
},
"eslintIgnore": ["node_modules", "coverage", "dist"],
"keywords": ["react", "firestore", "firebase"],
"eslintIgnore": [
"node_modules",
"coverage",
"dist",
"__tests__"
],
"keywords": [
"react",
"firestore",
"firebase"
],
"dependencies": {
"hoist-non-react-statics": "^2.3.1"
"@babel/runtime": "^7.3.4",
"hoist-non-react-statics": "^3.3.0"
},
"peerDependencies": {
"prop-types": ">=15",
"react": ">=16.3"
},
"devDependencies": {
"commitizen": "^2.9.6",
"commitizen": "^3.0.7",
"cz-conventional-changelog": "^2.1.0",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.9.1",
"kcd-scripts": "^0.32.1",
"preact": "^8.2.7",
"prop-types": "^15.6.0",
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-test-renderer": "^16.8.1"
"kcd-scripts": "^1.1.0",
"preact": "^8.4.2",
"prop-types": "^15.7.2",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-test-renderer": "^16.8.4"
},
"config": {
"commitizen": {
Expand Down
11 changes: 4 additions & 7 deletions src/FirestoreCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class FirestoreCollection extends Component {
};

componentDidMount() {
this.setupFirestoreListener(this.props);
this.setupFirestoreListener();
}

componentWillUnmount() {
Expand All @@ -47,9 +47,7 @@ class FirestoreCollection extends Component {
) {
this.handleUnsubscribe();

this.setState({ isLoading: true }, () =>
this.setupFirestoreListener(this.props),
);
this.setState({ isLoading: true }, () => this.setupFirestoreListener());
}
}

Expand All @@ -59,9 +57,8 @@ class FirestoreCollection extends Component {
}
}

setupFirestoreListener = props => {
const { firestore } = props;
const { path, ...queryProps } = props;
setupFirestoreListener = () => {
const { firestore, path, ...queryProps } = this.props;
const collectionRef = firestore.collection(path);
const query = this.buildQuery(collectionRef, queryProps);

Expand Down
11 changes: 4 additions & 7 deletions src/FirestoreDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FirestoreDocument extends Component {
};

componentDidMount() {
this.setupFirestoreListener(this.props);
this.setupFirestoreListener();
}

componentWillUnmount() {
Expand All @@ -29,9 +29,7 @@ class FirestoreDocument extends Component {
if (nextProps.path !== this.props.path) {
this.handleUnsubscribe();

this.setState({ isLoading: true }, () =>
this.setupFirestoreListener(this.props),
);
this.setState({ isLoading: true }, () => this.setupFirestoreListener());
}
}

Expand All @@ -41,9 +39,8 @@ class FirestoreDocument extends Component {
}
}

setupFirestoreListener = props => {
const { firestore } = props;
const { path } = props;
setupFirestoreListener = () => {
const { firestore, path } = this.props;
const documentRef = firestore.doc(path);

this.unsubscribe = documentRef.onSnapshot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ test('injects component with firestore database', () => {
});

test('throws an error when the FirestoreProvider is missing', () => {
const consoleError = console.error;
console.error = () => {};

const mockFunctionalComponent = jest.fn().mockReturnValue(<div />);
const Component = withFirestore(mockFunctionalComponent);

expect(() => mount(<Component />)).toThrowError(
'FirestoreProvider is missing',
);

console.error = consoleError;
});
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ef0cfe5

Please # to comment.