Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
feat: Upgrade to Foundry v2 (#12)
Browse files Browse the repository at this point in the history
* feat: upgrade to Foundry v2

* fix: import testing dep under new name

* fix: remove deprecated Circuit UI components

* ci: use different GitHub token

* fix: work around linter error
  • Loading branch information
connor-baer authored Dec 6, 2019
1 parent fe657ae commit f0258e7
Show file tree
Hide file tree
Showing 6 changed files with 1,693 additions and 2,251 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ jobs:
yarn --pure-lockfile
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
19 changes: 10 additions & 9 deletions files/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** @jsx jsx */
import styled from '@emotion/styled';
import { jsx, css } from '@emotion/core';
import { jsx, css, Global } from '@emotion/core';
import { ThemeProvider } from 'emotion-theming';
import {
Card,
Heading,
List,
Text,
theme as themes,
GlobalStyles
BaseStyles
} from '@sumup/circuit-ui';
import { ReactComponent as LogoIcon } from './assets/logo.svg';

Expand All @@ -33,15 +33,16 @@ const Container = styled('header')`
margin: 0 auto;
`;

const globalStyles = css`
body {
background-color: ${circuit.colors.n100};
}
`;

const App = () => (
<ThemeProvider theme={circuit}>
<GlobalStyles
custom={`
body {
background-color: ${circuit.colors.n100};
}
`}
/>
<BaseStyles />
<Global styles={globalStyles} />
<Container>
<Logo data-testid="sumup-logo" />
<Card>
Expand Down
8 changes: 4 additions & 4 deletions files/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Add custom Jest matchers for the DOM.
* https://github.com/gnapse/jest-dom#table-of-contents
* https://github.com/testing-library/jest-dom#readme
*/
import 'jest-dom/extend-expect';
import '@testing-library/jest-dom/extend-expect';

import serializer, { matchers } from 'jest-emotion';

Expand All @@ -11,7 +11,7 @@ import serializer, { matchers } from 'jest-emotion';
* in a test.
*
* https://github.com/emotion-js/emotion/tree/master/packages/jest-emotion#custom-matchers
* */
*/
// eslint-disable-next-line no-undef
expect.extend(matchers);

Expand All @@ -20,6 +20,6 @@ expect.extend(matchers);
* show up in snapshots.
*
* https://github.com/emotion-js/emotion/tree/master/packages/jest-emotion#snapshot-serializer
* */
*/
// eslint-disable-next-line no-undef
expect.addSnapshotSerializer(serializer);
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function updatePackageJson(appPath) {
const filepath = resolve(appPath, 'package.json');
const { default: packageJson } = await import(filepath);
const scripts = {
lint: 'foundry run eslint src/**/*.js',
lint: "foundry run eslint 'src/**/*.js'",
'create-component': 'foundry run plop component'
};
const updatedPackageJson = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"listr-verbose-renderer": "^0.5.0"
},
"devDependencies": {
"@sumup/foundry": "^1.0.0",
"@sumup/foundry": "^2.0.0-beta",
"license-checker": "^25.0.1"
},
"husky": {
Expand Down
Loading

0 comments on commit f0258e7

Please sign in to comment.