Skip to content

Commit 26da45b

Browse files
committed
Updated dependencies
Migrated to dart sass Fix depreciation warnings with Sass slash as division
1 parent 43ebc23 commit 26da45b

File tree

7 files changed

+6035
-8954
lines changed

7 files changed

+6035
-8954
lines changed

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
testEnvironment: 'jsdom',
23
transform: {
34
'.*': 'babel-jest',
45
},

package-lock.json

Lines changed: 5968 additions & 8890 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -36,77 +36,77 @@
3636
"payment"
3737
],
3838
"peerDependencies": {
39-
"react": "^15.0.0 || ^16.0.0",
40-
"prop-types": "^15.7.2"
39+
"prop-types": "^15.7.2",
40+
"react": "^16.13.1 || ^17.0.0"
4141
},
4242
"dependencies": {
43-
"payment": "^2.3.0"
43+
"payment": "^2.4.4"
4444
},
4545
"devDependencies": {
46-
"@babel/cli": "^7.10.1",
47-
"@babel/core": "^7.10.2",
48-
"@babel/plugin-proposal-class-properties": "^7.10.1",
49-
"@babel/plugin-proposal-decorators": "^7.10.1",
50-
"@babel/plugin-proposal-do-expressions": "^7.10.1",
51-
"@babel/plugin-proposal-export-default-from": "^7.10.1",
52-
"@babel/plugin-proposal-export-namespace-from": "^7.10.1",
53-
"@babel/plugin-proposal-function-sent": "^7.10.1",
54-
"@babel/plugin-proposal-json-strings": "^7.10.1",
55-
"@babel/plugin-proposal-logical-assignment-operators": "^7.10.1",
56-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
57-
"@babel/plugin-proposal-numeric-separator": "^7.10.1",
58-
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
59-
"@babel/plugin-proposal-pipeline-operator": "^7.10.1",
60-
"@babel/plugin-proposal-throw-expressions": "^7.10.1",
46+
"@babel/cli": "^7.14.5",
47+
"@babel/core": "^7.14.5",
48+
"@babel/plugin-proposal-class-properties": "^7.14.5",
49+
"@babel/plugin-proposal-decorators": "^7.14.5",
50+
"@babel/plugin-proposal-do-expressions": "^7.14.5",
51+
"@babel/plugin-proposal-export-default-from": "^7.14.5",
52+
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
53+
"@babel/plugin-proposal-function-sent": "^7.14.5",
54+
"@babel/plugin-proposal-json-strings": "^7.14.5",
55+
"@babel/plugin-proposal-logical-assignment-operators": "^7.14.5",
56+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
57+
"@babel/plugin-proposal-numeric-separator": "^7.14.5",
58+
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
59+
"@babel/plugin-proposal-pipeline-operator": "^7.14.5",
60+
"@babel/plugin-proposal-throw-expressions": "^7.14.5",
6161
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
62-
"@babel/plugin-syntax-import-meta": "^7.10.1",
63-
"@babel/plugin-transform-flow-strip-types": "^7.10.1",
64-
"@babel/plugin-transform-object-assign": "^7.10.1",
65-
"@babel/preset-env": "^7.10.2",
66-
"@babel/preset-flow": "^7.10.1",
67-
"@babel/preset-react": "^7.10.1",
68-
"@size-limit/preset-small-lib": "^4.5.0",
69-
"autoprefixer": "^9.8.0",
62+
"@babel/plugin-syntax-import-meta": "^7.10.4",
63+
"@babel/plugin-transform-flow-strip-types": "^7.14.5",
64+
"@babel/plugin-transform-object-assign": "^7.14.5",
65+
"@babel/preset-env": "^7.14.5",
66+
"@babel/preset-flow": "^7.14.5",
67+
"@babel/preset-react": "^7.14.5",
68+
"@size-limit/preset-small-lib": "^4.12.0",
69+
"autoprefixer": "^10.2.6",
7070
"babel-core": "^7.0.0-bridge.0",
7171
"babel-eslint": "^10.1.0",
72-
"babel-jest": "^26.0.1",
72+
"babel-jest": "^27.0.2",
7373
"babel-plugin-array-includes": "^2.0.3",
74-
"cross-env": "^7.0.2",
75-
"date-fns": "^2.14.0",
74+
"cross-env": "^7.0.3",
75+
"date-fns": "^2.22.1",
7676
"del-cli": "^3.0.1",
7777
"enzyme": "^3.11.0",
78-
"enzyme-adapter-react-16": "^1.15.2",
79-
"eslint": "^6.8.0",
80-
"eslint-config-airbnb": "^18.1.0",
81-
"eslint-plugin-babel": "^5.3.0",
82-
"eslint-plugin-flowtype": "^4.7.0",
83-
"eslint-plugin-import": "^2.20.2",
84-
"eslint-plugin-jsx-a11y": "^6.2.3",
85-
"eslint-plugin-react": "^7.20.0",
86-
"flow-bin": "^0.126.1",
87-
"husky": "^4.2.5",
88-
"jest": "^26.0.1",
89-
"jsdom": "^16.2.2",
90-
"node-sass": "^4.14.1",
91-
"postcss": "^7.0.32",
92-
"postcss-cli": "^7.1.1",
78+
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
79+
"eslint": "^7.28.0",
80+
"eslint-config-airbnb": "^18.2.1",
81+
"eslint-plugin-babel": "^5.3.1",
82+
"eslint-plugin-flowtype": "^5.7.2",
83+
"eslint-plugin-import": "^2.23.4",
84+
"eslint-plugin-jsx-a11y": "^6.4.1",
85+
"eslint-plugin-react": "^7.24.0",
86+
"flow-bin": "^0.152.0",
87+
"husky": "^6.0.0",
88+
"jest": "^27.0.4",
89+
"jsdom": "^16.6.0",
90+
"postcss": "^8.3.2",
91+
"postcss-cli": "^8.3.1",
9392
"prop-types": "^15.7.2",
94-
"react": "^16.13.1",
95-
"react-dom": "^16.13.1",
96-
"repo-tools": "^0.2.0",
97-
"size-limit": "^4.5.0",
98-
"stylelint": "^13.6.0",
99-
"stylelint-config-standard": "^20.0.0",
100-
"stylelint-declaration-strict-value": "^1.5.0",
93+
"react": "^17.0.2",
94+
"react-dom": "^17.0.2",
95+
"repo-tools": "^0.2.2",
96+
"sass": "^1.34.1",
97+
"size-limit": "^4.12.0",
98+
"stylelint": "^13.13.1",
99+
"stylelint-config-standard": "^22.0.0",
100+
"stylelint-declaration-strict-value": "^1.7.12",
101101
"stylelint-order": "^4.1.0",
102-
"stylelint-scss": "^3.17.2",
102+
"stylelint-scss": "^3.19.0",
103103
"watch-run": "^1.2.5"
104104
},
105105
"scripts": {
106106
"build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:styles",
107107
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src -d lib",
108108
"build:es": "cross-env NODE_ENV=production babel src -d es",
109-
"build:styles": " node tools/build-styles",
109+
"build:styles": "node tools/build-styles",
110110
"watch": "npm run build && watch-run -p 'src/**/*.js' npm run build:es",
111111
"clean": "del-cli es/* && del-cli lib/*",
112112
"lint": "eslint --ext .js --ext .jsx src test tools",

src/styles.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:math';
2+
13
$rccs-card-ratio: 1.5858 !default;
24
$rccs-size: 290px !default;
35
$rccs-font: 'Consolas', 'Courier', monospace !default;
@@ -70,7 +72,7 @@ $rccs-visaelectron-logo: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl
7072
width: $rccs-size;
7173

7274
&__card {
73-
height: $rccs-size / $rccs-card-ratio;
75+
height: math.div($rccs-size, $rccs-card-ratio);
7476
margin: 0 auto;
7577
position: relative;
7678
transform-style: preserve-3d;
@@ -81,7 +83,7 @@ $rccs-visaelectron-logo: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl
8183
&--back {
8284
backface-visibility: hidden;
8385
background: $rccs-default-background;
84-
border-radius: $rccs-size / 20;
86+
border-radius: math.div($rccs-size, 20);
8587
color: $rccs-light-text-color;
8688
height: 100%;
8789
left: 0;
@@ -358,11 +360,11 @@ $rccs-visaelectron-logo: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl
358360
background-image: url($rccs-chip-image);
359361
background-repeat: no-repeat;
360362
background-size: contain;
361-
height: $rccs-size / 11;
363+
height: math.div($rccs-size, 11);
362364
left: 10%;
363365
position: absolute;
364366
top: 10%;
365-
width: $rccs-size / 7;
367+
width: math.div($rccs-size, 7);
366368
}
367369

368370
&__issuer {

test/__setup__/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Enzyme from 'enzyme';
2-
import Adapter from 'enzyme-adapter-react-16';
2+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
33

44
Enzyme.configure({ adapter: new Adapter() });
55

@@ -10,6 +10,6 @@ document.body.appendChild(react);
1010

1111
window.matchMedia = () => ({
1212
matches: false,
13-
addListener: () => {},
14-
removeListener: () => {},
13+
addListener: () => undefined,
14+
removeListener: () => undefined,
1515
});

test/index.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ describe('ReactCreditCards', () => {
240240
expect(mockCallback.mock.calls[0][1]).toEqual(true);
241241
});
242242

243-
it('should handle new number props (Visa with 19 digits)', () => {
243+
it('should handle new number props (Visa with 16 digits)', () => {
244244
wrapper.setProps({
245-
number: '4111111111111111342',
245+
number: '4111111111111111',
246246
focused: 'number',
247247
});
248248

249249
expect(wrapper.find('.rccs__card').hasClass('rccs__card--visa')).toBe(true);
250-
expect(wrapper.find('.rccs__number').text()).toBe('4111 1111 1111 1111342');
250+
expect(wrapper.find('.rccs__number').text()).toBe('4111 1111 1111 1111');
251251
expect(wrapper.find('.rccs__number').hasClass('rccs--focused')).toBe(true);
252252

253253
expect(mockCallback.mock.calls[0][0]).toEqual({ maxLength: 19, issuer: 'visa' });

tools/build-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { exec } = require('child_process');
55
const run = promisify(exec);
66

77
run('rm -rf .tmp/')
8-
.then(() => run('node-sass -o .tmp/ src/styles.scss'))
8+
.then(() => run('sass src/styles.scss .tmp/styles.css'))
99
.then(() => run('postcss .tmp/styles.css --use autoprefixer --no-map -d .tmp/'))
1010
.then(() => run('mv .tmp/styles.css .tmp/styles-compiled.css'))
1111
.then(() => run('mkdir -p es lib'))

0 commit comments

Comments
 (0)