Skip to content

Commit e22a991

Browse files
Merge branch 'release/1.6.0'
2 parents cfaa9b6 + 40ac913 commit e22a991

21 files changed

+784
-405
lines changed

.auto-changelog

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"commitLimit": false,
3+
"ignoreCommitPattern": "Bump .* version|Merge tag .+ into develop",
4+
"package": true,
5+
"sortCommits": "date-desc",
6+
"startingVersion": "1.0.1",
7+
"template": "keepachangelog"
8+
}

.babelrc

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"presets": ["@babel/preset-env", "@babel/preset-react"]
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": "last 1 version, not dead, > 0.2%"
7+
}
8+
],
9+
"@babel/preset-react"
10+
]
311
}

.browserslistrc

-3
This file was deleted.

.editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ end_of_line = lf
99
insert_final_newline = true
1010
indent_style = tab
1111

12+
[*.yml]
13+
indent_style = space
14+
indent_size = 2
15+
1216
[{.babelrc,package.json}]
1317
indent_style = space
1418
indent_size = 2

.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"rules": {
1818
"max-classes-per-file": "off",
19+
"no-plusplus": "off",
1920
"react/jsx-props-no-spreading": "off"
2021
}
2122
}

.github/dependabot.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "saturday"
9+
assignees:
10+
- "wimpyprogrammer"
11+
12+
- package-ecosystem: "npm"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
day: "saturday"
17+
assignees:
18+
- "wimpyprogrammer"
19+
versioning-strategy: "widen"

.github/workflows/security-scan.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Security Scan
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
schedule:
9+
# 02:27 on Thursdays
10+
- cron: "27 2 * * 4"
11+
workflow_dispatch:
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
language: ["javascript"]
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v1
29+
with:
30+
languages: ${{ matrix.language }}
31+
32+
- name: Autobuild
33+
uses: github/codeql-action/autobuild@v1
34+
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v1

.github/workflows/tests.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
schedule:
9+
# 07:34 on Saturdays
10+
- cron: "34 7 * * SAT"
11+
workflow_dispatch:
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node-version: [12.x, 16.x, lts/*]
22+
react-version: [0.13, 0.14, 15, 16]
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v2
27+
with:
28+
fetch-depth: "2"
29+
30+
- name: Test on Node ${{ matrix.node-version }}
31+
uses: actions/[email protected]
32+
with:
33+
node-version: ${{ matrix.node-version }}
34+
35+
- run: npm install
36+
- run: npx enzyme-adapter-react-install 16
37+
env:
38+
NPM_CONFIG_LEGACY_PEER_DEPS: true
39+
REACT: ${{ matrix.react-version }}
40+
- run: npm run lint
41+
- run: npm run build
42+
- run: npm run test
43+
- run: npx testpack-cli --keep=@babel/*,create-react-class,enzyme*,jest*,react* .babelrc jest.config.js test-*.js src/*.spec.js
44+
45+
- name: Upload test coverage report to Codecov
46+
uses: codecov/[email protected]
47+
with:
48+
fail_ci_if_error: false
49+
50+
- name: Run Snyk to check for vulnerabilities
51+
if: ${{ github.actor != 'dependabot[bot]' }}
52+
uses: snyk/actions/node@master
53+
env:
54+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.publishrc

-14
This file was deleted.

.release-it.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"hooks": {
3+
"before:init": ["npm run lint", "npm test"],
4+
"after:bump": "npm run build"
5+
},
6+
"git": {
7+
"changelog": false,
8+
"commit": false,
9+
"requireBranch": "main",
10+
"tagName": "${version}"
11+
}
12+
}

.travis.yml

-14
This file was deleted.

CHANGELOG.md

+220
Large diffs are not rendered by default.

jest.config.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
clearMocks: true,
3+
collectCoverageFrom: [
4+
'src/**/!(*.spec).js',
5+
],
6+
collectCoverage: true,
7+
setupFilesAfterEnv: [
8+
'<rootDir>/test-shims.js',
9+
'<rootDir>/test-setup.js',
10+
'jest-extended/all',
11+
],
12+
testEnvironment: 'node',
13+
testMatch: [
14+
'**/src/*.spec.js?(x)',
15+
],
16+
verbose: true,
17+
};

package.json

+17-41
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
{
22
"name": "react-component-update",
3-
"version": "1.5.0",
3+
"version": "1.6.0",
44
"description": "Extends the native React Component to streamline updates",
55
"main": "lib/index.js",
66
"files": [
77
"lib/**/!(*.spec).js"
88
],
99
"engines": {
10-
"node": ">=10"
10+
"node": ">=12"
1111
},
1212
"scripts": {
13-
"clean": "rimraf lib",
14-
"build": "npm run clean && babel src --out-dir lib",
15-
"build-and-test": "npm run test && npm run build",
16-
"install-react": "enzyme-adapter-react-install 16",
13+
"build": "babel src --out-dir lib --delete-dir-on-start",
14+
"changelog": "npx auto-changelog",
1715
"lint": "eslint ./ --report-unused-disable-directives",
18-
"test": "jest",
19-
"travisci": "npm run install-react && npm run lint && npm run test && codecov",
20-
"prepublish": "npx publish-please guard",
21-
"publish-please": "npx publish-please"
16+
"release": "npx release-it --no-increment",
17+
"test": "jest"
2218
},
2319
"repository": {
2420
"type": "git",
@@ -35,43 +31,23 @@
3531
"@babel/core": "^7.2.2",
3632
"@babel/preset-env": "^7.2.0",
3733
"@babel/preset-react": "^7.0.0",
38-
"babel-jest": "^26.3.0",
39-
"chai": "^4.0.2",
40-
"codecov": "^3.0.0",
34+
"babel-jest": "^27.0.1",
4135
"create-react-class": "^15.6.0",
42-
"dirty-chai": "^2.0.0",
4336
"enzyme": "^3.6.0",
4437
"enzyme-adapter-react-16": "^1.5.0",
4538
"enzyme-adapter-react-helper": "^1.3.0",
46-
"eslint": "^7.8.0",
47-
"eslint-config-airbnb": "^18.2.0",
48-
"eslint-plugin-import": "^2.13.0",
39+
"eslint": "^8.4.1",
40+
"eslint-config-airbnb": "^19.0.2",
41+
"eslint-plugin-import": "^2.25.3",
4942
"eslint-plugin-jsx-a11y": "^6.1.0",
50-
"eslint-plugin-react": "^7.11.0",
51-
"jest": "^26.4.2",
52-
"lodash.uniqueid": "^4.0.1",
53-
"react": "*",
54-
"react-dom": "*",
55-
"react-test-renderer": "*",
56-
"rimraf": "^3.0.2",
57-
"sinon": "^9.0.3",
58-
"sinon-chai": "^3.0.0"
43+
"eslint-plugin-react": "^7.27.1",
44+
"jest": "^27.0.3",
45+
"jest-extended": "^1.2.0",
46+
"react": "<17",
47+
"react-dom": "<17",
48+
"react-test-renderer": "<17"
5949
},
6050
"peerDependencies": {
61-
"react": "*"
62-
},
63-
"jest": {
64-
"coverageDirectory": "./coverage/",
65-
"collectCoverage": true,
66-
"collectCoverageFrom": [
67-
"src/**/!(*.spec).js"
68-
],
69-
"setupFiles": [
70-
"<rootDir>/test-shims.js",
71-
"<rootDir>/test-setup.js"
72-
],
73-
"testMatch": [
74-
"**/src/*.spec.js?(x)"
75-
]
51+
"react": "<17"
7652
}
7753
}

src/component.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@ class ReactComponentUpdate extends Component {
1010
this.componentDidMountOrUpdate(this.props, this.state);
1111
}
1212

13-
componentWillReceiveProps(nextProps) {
14-
this.componentWillMountOrReceiveProps(nextProps);
13+
componentWillReceiveProps(nextProps, maybeContext) {
14+
this.componentWillMountOrReceiveProps(nextProps, maybeContext);
1515
}
1616

17-
componentDidUpdate(prevProps, prevState) {
18-
this.componentDidMountOrUpdate(prevProps, prevState);
17+
componentDidUpdate(prevProps, prevState, maybeContext) {
18+
this.componentDidMountOrUpdate(prevProps, prevState, maybeContext);
1919
}
2020

21-
componentWillMountOrReceiveProps(nextProps) {}
21+
/* istanbul ignore next */
22+
componentWillMountOrReceiveProps(nextProps, maybeContext) { }
2223

23-
componentDidMountOrUpdate(prevProps, prevState) {}
24+
/* istanbul ignore next */
25+
componentDidMountOrUpdate(prevProps, prevState, maybeContext) { }
2426
}
2527

2628
export default ReactComponentUpdate;

0 commit comments

Comments
 (0)