Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
Migrated to dart sass
Fix depreciation warnings with Sass slash as division
  • Loading branch information
cjsewell committed Dec 8, 2022
1 parent 218a7eb commit 11aa080
Show file tree
Hide file tree
Showing 7 changed files with 6,035 additions and 8,954 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
testEnvironment: 'jsdom',
transform: {
'.*': 'babel-jest',
},
Expand Down
14,858 changes: 5,968 additions & 8,890 deletions package-lock.json

Large diffs are not rendered by default.

106 changes: 53 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,77 +36,77 @@
"payment"
],
"peerDependencies": {
"react": "^15.0.0 || ^16.0.0 || ^17.0.0",
"prop-types": "^15.7.2"
"prop-types": "^15.7.2",
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
},
"dependencies": {
"payment": "^2.3.0"
"payment": "^2.4.4"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/core": "^7.10.2",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-proposal-decorators": "^7.10.1",
"@babel/plugin-proposal-do-expressions": "^7.10.1",
"@babel/plugin-proposal-export-default-from": "^7.10.1",
"@babel/plugin-proposal-export-namespace-from": "^7.10.1",
"@babel/plugin-proposal-function-sent": "^7.10.1",
"@babel/plugin-proposal-json-strings": "^7.10.1",
"@babel/plugin-proposal-logical-assignment-operators": "^7.10.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
"@babel/plugin-proposal-numeric-separator": "^7.10.1",
"@babel/plugin-proposal-optional-chaining": "^7.10.1",
"@babel/plugin-proposal-pipeline-operator": "^7.10.1",
"@babel/plugin-proposal-throw-expressions": "^7.10.1",
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.5",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-decorators": "^7.14.5",
"@babel/plugin-proposal-do-expressions": "^7.14.5",
"@babel/plugin-proposal-export-default-from": "^7.14.5",
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
"@babel/plugin-proposal-function-sent": "^7.14.5",
"@babel/plugin-proposal-json-strings": "^7.14.5",
"@babel/plugin-proposal-logical-assignment-operators": "^7.14.5",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
"@babel/plugin-proposal-numeric-separator": "^7.14.5",
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
"@babel/plugin-proposal-pipeline-operator": "^7.14.5",
"@babel/plugin-proposal-throw-expressions": "^7.14.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.1",
"@babel/plugin-transform-flow-strip-types": "^7.10.1",
"@babel/plugin-transform-object-assign": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-flow": "^7.10.1",
"@babel/preset-react": "^7.10.1",
"@size-limit/preset-small-lib": "^4.5.0",
"autoprefixer": "^9.8.0",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-flow-strip-types": "^7.14.5",
"@babel/plugin-transform-object-assign": "^7.14.5",
"@babel/preset-env": "^7.14.5",
"@babel/preset-flow": "^7.14.5",
"@babel/preset-react": "^7.14.5",
"@size-limit/preset-small-lib": "^4.12.0",
"autoprefixer": "^10.2.6",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.0.1",
"babel-jest": "^27.0.2",
"babel-plugin-array-includes": "^2.0.3",
"cross-env": "^7.0.2",
"date-fns": "^2.14.0",
"cross-env": "^7.0.3",
"date-fns": "^2.22.1",
"del-cli": "^3.0.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-flowtype": "^4.7.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.20.0",
"flow-bin": "^0.126.1",
"husky": "^4.2.5",
"jest": "^26.0.1",
"jsdom": "^16.2.2",
"node-sass": "^4.14.1",
"postcss": "^7.0.32",
"postcss-cli": "^7.1.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.2",
"eslint": "^7.28.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-flowtype": "^5.7.2",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.24.0",
"flow-bin": "^0.152.0",
"husky": "^6.0.0",
"jest": "^27.0.4",
"jsdom": "^16.6.0",
"postcss": "^8.3.2",
"postcss-cli": "^8.3.1",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"repo-tools": "^0.2.0",
"size-limit": "^4.5.0",
"stylelint": "^13.6.0",
"stylelint-config-standard": "^20.0.0",
"stylelint-declaration-strict-value": "^1.5.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"repo-tools": "^0.2.2",
"sass": "^1.34.1",
"size-limit": "^4.12.0",
"stylelint": "^13.13.1",
"stylelint-config-standard": "^22.0.0",
"stylelint-declaration-strict-value": "^1.7.12",
"stylelint-order": "^4.1.0",
"stylelint-scss": "^3.17.2",
"stylelint-scss": "^3.19.0",
"watch-run": "^1.2.5"
},
"scripts": {
"build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:styles",
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src -d lib",
"build:es": "cross-env NODE_ENV=production babel src -d es",
"build:styles": " node tools/build-styles",
"build:styles": "node tools/build-styles",
"watch": "npm run build && watch-run -p 'src/**/*.js' npm run build:es",
"clean": "del-cli es/* && del-cli lib/*",
"lint": "eslint --ext .js --ext .jsx src test tools",
Expand Down
10 changes: 6 additions & 4 deletions src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use 'sass:math';

$rccs-card-ratio: 1.5858 !default;
$rccs-size: 290px !default;
$rccs-font: 'Consolas', 'Courier', monospace !default;
Expand Down Expand Up @@ -70,7 +72,7 @@ $rccs-visaelectron-logo: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl
width: $rccs-size;

&__card {
height: $rccs-size / $rccs-card-ratio;
height: math.div($rccs-size, $rccs-card-ratio);
margin: 0 auto;
position: relative;
transform-style: preserve-3d;
Expand All @@ -81,7 +83,7 @@ $rccs-visaelectron-logo: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl
&--back {
backface-visibility: hidden;
background: $rccs-default-background;
border-radius: $rccs-size / 20;
border-radius: math.div($rccs-size, 20);
color: $rccs-light-text-color;
height: 100%;
left: 0;
Expand Down Expand Up @@ -358,11 +360,11 @@ $rccs-visaelectron-logo: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBl
background-image: url($rccs-chip-image);
background-repeat: no-repeat;
background-size: contain;
height: $rccs-size / 11;
height: math.div($rccs-size, 11);
left: 10%;
position: absolute;
top: 10%;
width: $rccs-size / 7;
width: math.div($rccs-size, 7);
}

&__issuer {
Expand Down
6 changes: 3 additions & 3 deletions test/__setup__/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';

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

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

window.matchMedia = () => ({
matches: false,
addListener: () => {},
removeListener: () => {},
addListener: () => undefined,
removeListener: () => undefined,
});
6 changes: 3 additions & 3 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ describe('ReactCreditCards', () => {
expect(mockCallback.mock.calls[0][1]).toEqual(true);
});

it('should handle new number props (Visa with 19 digits)', () => {
it('should handle new number props (Visa with 16 digits)', () => {
wrapper.setProps({
number: '4111111111111111342',
number: '4111111111111111',
focused: 'number',
});

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

expect(mockCallback.mock.calls[0][0]).toEqual({ maxLength: 19, issuer: 'visa' });
Expand Down
2 changes: 1 addition & 1 deletion tools/build-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { exec } = require('child_process');
const run = promisify(exec);

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

0 comments on commit 11aa080

Please sign in to comment.