Skip to content

Commit

Permalink
Typescript support for Divider (#520)
Browse files Browse the repository at this point in the history
* First try for typescript support for Divider

* In the middle of using proptables from ts components in the storybook

* Lot's of lot's of tweeks to make prop tables in storybook working. This commit is kind of a proof of concept

* Remove classname, key and ref from props table

* Removed debug env

* Removed configuration of typescript in storybook main

* Remove old testing stuffs

* Remove old rollup typescript plugin

* Delete copy'n pasted babel typescript transpiler, we use rollup plugin instead

* Remove testing stuffs
  • Loading branch information
wenche authored and vnys committed Nov 13, 2020
1 parent d7a2815 commit df360ba
Show file tree
Hide file tree
Showing 12 changed files with 427 additions and 128 deletions.
6 changes: 3 additions & 3 deletions apps/storybook-react/stories/Divider/Divider.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React from 'react'
import styled from 'styled-components'
import { withKnobs, select } from '@storybook/addon-knobs'
import { Divider } from '@equinor/eds-core-react'
import mdx from './Divider.docs.mdx'
// import mdx from './Divider.docs.mdx'

export default {
title: 'Components/Divider',
parameters: {
/* parameters: {
docs: {
page: mdx,
},
},
}, */
component: Divider,
}

Expand Down
9 changes: 9 additions & 0 deletions libraries/core-react/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
verbose: true,
setupFilesAfterEnv: ['./rtl.setup.ts'],
transform: {
'.(ts|tsx)': 'ts-jest',
},
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
moduleFileExtensions: ['ts', 'tsx', 'js'],
}
14 changes: 7 additions & 7 deletions libraries/core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,22 @@
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@babel/preset-typescript": "^7.10.4",
"@rollup/plugin-babel": "^5.0.3",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"@rollup/plugin-typescript": "^5.0.2",
"@testing-library/jest-dom": "^5.9.0",
"@testing-library/react": "^10.2.1",
"@testing-library/user-event": "^10.3.2",
"@types/jest": "^26.0.10",
"@types/react": "^16.9.47",
"@types/react-dom": "^16.9.8",
"@types/styled-components": "^5.1.2",
"@types/testing-library__jest-dom": "^5.9.2",
"babel-plugin-react-docgen": "^4.1.0",
"babel-plugin-react-docgen-typescript": "^1.4.2",
"babel-plugin-styled-components": "^1.10.7",
"jest": "^26.0.1",
"jest-styled-components": "^6.3.4",
Expand All @@ -60,8 +66,8 @@
"react-dom": "^16.13.1",
"rollup": "^2.15.0",
"rollup-plugin-polyfill": "^3.0.0",
"rollup-plugin-typescript2": "^0.27.2",
"styled-components": "4.4.1",
"ts-jest": "^26.3.0",
"tslib": "^2.0.1",
"typescript": "^4.0.2"
},
Expand All @@ -71,12 +77,6 @@
"react-dom": "^16.8.6",
"styled-components": "^4.2.0"
},
"jest": {
"verbose": true,
"setupFilesAfterEnv": [
"./rtl.setup.js"
]
},
"dependencies": {
"@equinor/eds-icons": "workspace:*",
"@equinor/eds-tokens": "workspace:*",
Expand Down
Loading

0 comments on commit df360ba

Please sign in to comment.