Skip to content

Commit

Permalink
feat(deps): upgrade all dependencies (#635)
Browse files Browse the repository at this point in the history
* feat(components): upgrade all dependencies

* chore: upgrade to Foundry v3

* refactor: apply import/order rule

* refactor: apply trailing comma rule

* refactor: apply quote props rule

* refactor: apply arrow parens rule

* feat: upgrade to latest @sumup/design-tokens

* test(components): update snapshot
  • Loading branch information
connor-baer authored Jul 9, 2020
1 parent 83c3d43 commit 2ca1f1c
Show file tree
Hide file tree
Showing 296 changed files with 3,913 additions and 3,402 deletions.
14 changes: 7 additions & 7 deletions .cz-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@ module.exports = {
{
value: 'style',
name:
'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)'
'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)',
},
{
value: 'refactor',
name:
'refactor: A code change that neither fixes a bug nor adds a feature'
'refactor: A code change that neither fixes a bug nor adds a feature',
},
{
value: 'perf',
name: 'perf: A code change that improves performance'
name: 'perf: A code change that improves performance',
},
{ value: 'test', name: 'test: Adding missing tests' },
{
value: 'chore',
name:
'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation'
'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation',
},
{ value: 'revert', name: 'revert: Revert to a commit' },
{ value: 'WIP', name: 'WIP: Work in progress' }
{ value: 'WIP', name: 'WIP: Work in progress' },
],

scopes: [
{ name: 'components' },
{ name: 'utils' },
{ name: 'docs' },
{ name: 'cli' },
{ name: 'configs' }
{ name: 'configs' },
],

allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix']
allowBreakingChanges: ['feat', 'fix'],
};
23 changes: 10 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,33 @@ module.exports = require('@sumup/foundry/eslint')(
language: 'TypeScript',
environments: ['Browser'],
frameworks: ['React', 'Emotion', 'Jest'],
openSource: true
openSource: true,
},
{
rules: {
'arrow-parens': 'off'
},
parserOptions: {
project: ['./tsconfig.eslint.json']
project: ['./tsconfig.eslint.json'],
},
overrides: [
{
files: [
'src/cli/migrate/__testfixtures__/**/*.input.*',
'src/cli/migrate/__testfixtures__/**/*.output.*'
'src/cli/migrate/__testfixtures__/**/*.output.*',
],
rules: {
'import/no-unresolved': 'off',
'notice/notice': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'prettier/prettier': 'off'
}
'prettier/prettier': 'off',
},
},
{
files: ['src/cli/migrate/*.ts'],
rules: {
// jscodeshift expect no return value for files
// that should not be transformed.
'consistent-return': 'off'
}
}
]
}
'consistent-return': 'off',
},
},
],
},
);
22 changes: 11 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@ module.exports = {
'!src/@(components|util|styles)/**/index.{ts,tsx,js,jsx}',
'!src/@(components|util|styles)/**/*.story.{ts,tsx,js,jsx}',
'!src/@(components|util|styles)/**/*.docs.mdx',
'!**/node_modules/**'
'!**/node_modules/**',
],
moduleDirectories: ['node_modules', 'src'],
// HACK: See https://github.com/storybookjs/storybook/pull/9292
moduleNameMapper: {
'react-syntax-highlighter/dist/esm/(.*)':
'react-syntax-highlighter/dist/cjs/$1'
'react-syntax-highlighter/dist/cjs/$1',
},
transform: {
'^.+\\.(js|jsx)$': 'babel-jest',
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(md|mdx)$': '<rootDir>/jest.mdxTransformer.js'
'^.+\\.(md|mdx)$': '<rootDir>/jest.mdxTransformer.js',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
globals: {
STORYBOOK: false,
__DEV__: false,
__PRODUCTION__: false,
__TEST__: true,
'STORYBOOK': false,
'__DEV__': false,
'__PRODUCTION__': false,
'__TEST__': true,
'ts-jest': {
tsConfig: {
jsx: 'react'
}
}
}
jsx: 'react',
},
},
},
};
2 changes: 1 addition & 1 deletion jest.mdxTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
module.exports = {
process() {
return 'null';
}
},
};
10 changes: 5 additions & 5 deletions jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
actHook,
userEvent,
wait,
axe
axe,
} from './src/util/test-utils';

global.axe = axe;
Expand All @@ -47,8 +47,8 @@ if (global.document) {
setEnd: () => {},
commonAncestorContainer: {
nodeName: 'BODY',
ownerDocument: document
}
ownerDocument: document,
},
});
}

Expand All @@ -61,6 +61,6 @@ expect.addSnapshotSerializer(
createSerializer({
classNameReplacer(className, index) {
return `circuit-${index}`;
}
})
},
}),
);
2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
*/

module.exports = require('@sumup/foundry/lint-staged')({
language: 'TypeScript'
language: 'TypeScript',
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
"@storybook/preset-typescript": "^3.0.0",
"@storybook/react": "^5.2.0",
"@storybook/source-loader": "^5.2.4",
"@sumup/design-tokens": "^1.0.0-alpha.5",
"@sumup/foundry": "^2.1.0",
"@sumup/design-tokens": "^1.0.0",
"@sumup/foundry": "^3.0.0",
"@sumup/icons": "^1.0.0",
"@sumup/intl": "^1.0.0",
"@svgr/webpack": "^4.3.3",
Expand Down
9 changes: 1 addition & 8 deletions prettier.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,4 @@
* limitations under the License.
*/

module.exports = require('@sumup/foundry/prettier')(
{},
{
trailingComma: 'none',
arrowParens: 'avoid',
quoteProps: 'as-needed'
}
);
module.exports = require('@sumup/foundry/prettier')();
2 changes: 1 addition & 1 deletion scripts/static-styles/__fixtures__/functional-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function FunctionalComponent({ label, value }) {

FunctionalComponent.propTypes = {
label: PropTypes.string,
value: PropTypes.string
value: PropTypes.string,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion scripts/static-styles/__fixtures__/styled-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const StyledComponent = styled.input(baseStyles, disabledStyles);

StyledComponent.propTypes = {
label: PropTypes.string,
disabled: PropTypes.bool
disabled: PropTypes.bool,
};

/**
Expand Down
17 changes: 9 additions & 8 deletions scripts/static-styles/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
import yargs from 'yargs';
import { keys } from 'lodash/fp';

import extractStaticStyles from '.';
import config from './config';

import extractStaticStyles from '.';

const themeOpts = keys(config.themes);
const componentOpts = config.components.map(({ name }) => name);

Expand All @@ -27,7 +28,7 @@ function main() {
.option('theme', {
desc: 'The name of the theme to use.',
choices: themeOpts,
default: 'light'
default: 'light',
})
.option('components', {
desc:
Expand All @@ -36,7 +37,7 @@ function main() {
options: ['all', 'none', ...componentOpts],
type: 'array',
default: 'all',
coerce: val => {
coerce: (val) => {
if (val.length === 1) {
if (val[0] === 'all') {
return componentOpts;
Expand All @@ -49,29 +50,29 @@ function main() {
}
}
return val;
}
},
})
.option('global', {
desc: 'Whether to include global styles.',
type: 'boolean',
default: false
default: false,
})
.option('customProperties', {
desc: 'Whether to use CSS custom properties (variables).',
type: 'boolean',
default: false
default: false,
})
.option('pretty', {
desc: 'Whether the CSS should be formatted with prettier.',
type: 'boolean',
default: false
default: false,
})
.option('filePath', {
desc:
// eslint-disable-next-line max-len
'Path to the file where the stylesheet should be saved, relative to the current directory.',
type: 'string',
normalize: true
normalize: true,
})
.showHelpOnFail(true)
.help()
Expand Down
6 changes: 3 additions & 3 deletions scripts/static-styles/component-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ export default function componentStyles({ components, theme } = {}) {
// Reset all props to `null`.
const baseProps = entries(props).reduce(
(acc, [prop]) => ({ ...acc, [prop]: null }),
requiredProps
requiredProps,
);

// Render the plain base component.
renderFn(Component, baseProps, name);

// Render each prop variation (not combination).
entries(props).forEach(([key, variations]) => {
variations.forEach(value => {
variations.forEach((value) => {
renderFn(Component, { ...baseProps, [key]: value }, name);
});
});
}
},
);

const styleSheet = entries(styleSheets)
Expand Down
10 changes: 5 additions & 5 deletions scripts/static-styles/component-styles.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Component styles', () => {
const { components } = config;
const actual = componentStyles({
theme,
components
components,
});
expect(typeof actual).toBe('string');
components.forEach(({ name }) => {
Expand All @@ -39,13 +39,13 @@ describe('Component styles', () => {
component: fixtures.StyledComponent,
props: {
value: PropTypes.string,
disabled: PropTypes.bool
}
disabled: PropTypes.bool,
},
};
const components = [component];
const actual = componentStyles({
theme,
components
components,
});
expect(typeof actual).toBe('string');
expect(actual).toMatchSnapshot();
Expand All @@ -56,7 +56,7 @@ describe('Component styles', () => {
const components = [component];
const actual = componentStyles({
theme,
components
components,
});
expect(typeof actual).toBe('string');
expect(actual).toMatchSnapshot();
Expand Down
14 changes: 7 additions & 7 deletions scripts/static-styles/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { light } from '@sumup/design-tokens';
// Toggle
// } from '../../src';

const element = props => <div {...props} />;
const element = (props) => <div {...props} />;

export const PropTypes = {
string: ['string'],
Expand All @@ -47,14 +47,14 @@ export const PropTypes = {
return [element];
}
return null;
}
},
};

const requiredPropTypes = {
string: 'string',
bool: true,
func: () => {},
element
element,
};

function getVariations(name, prop, propOverrides) {
Expand All @@ -77,8 +77,8 @@ function getProps(props, propOverrides) {
console.warn(
[
`No variations found for prop "${name}" of type "${type}"`,
'Please provide a custom override.'
].join(' ')
'Please provide a custom override.',
].join(' '),
);
return acc;
}
Expand All @@ -103,7 +103,7 @@ export function getComponentInfo(component, propOverrides = {}) {
component,
name: kebabCase(displayName),
props: getProps(props, propOverrides),
requiredProps: getRequiredProps(props)
requiredProps: getRequiredProps(props),
};
} catch (error) {
console.error(component);
Expand Down Expand Up @@ -184,5 +184,5 @@ export default {
// }),
// getComponentInfo(TextArea),
// getComponentInfo(Toggle)
]
],
};
Loading

0 comments on commit 2ca1f1c

Please sign in to comment.