Skip to content

Commit

Permalink
Typescript setup for core-react (#515)
Browse files Browse the repository at this point in the history
* Add typescript packages

* Add tsconfig

* Couldn't do it without the tslib deps, even if it's supposed to be a dep on rollup-plugin-typescript2

* Disable ts checks as a baseline before porting
  • Loading branch information
wenche authored and vnys committed Nov 13, 2020
1 parent 6c3d18f commit 1bd85f7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion libraries/core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
"react-dom": "^16.13.1",
"rollup": "^2.15.0",
"rollup-plugin-polyfill": "^3.0.0",
"styled-components": "4.4.1",
"ts-jest": "^26.3.0",
"rollup-plugin-typescript2": "^0.27.2",
"styled-components": "4.4.1",
"tslib": "^2.0.1",
"typescript": "^4.0.2"
},
Expand Down
12 changes: 8 additions & 4 deletions libraries/core-react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import babel from '@rollup/plugin-babel'
import polyfill from 'rollup-plugin-polyfill'
import typescript from '@rollup/plugin-typescript'

import typescript from 'rollup-plugin-typescript2'
import pkg from './package.json'

const peerDeps = Object.keys(pkg.peerDependencies || {})
Expand All @@ -29,8 +28,13 @@ export default [
},
plugins: [
json(),
resolve({ extensions }),
typescript(),
resolve({ extensions: ['.jsx', '.js'] }),
typescript({
tsconfig: 'tsconfig.json',
typescript: require('typescript'),
include: ['*.ts+(|x)', '**/*.ts+(|x)', '*.js+(|x)', '**/*.js+(|x)'],
exclude: ['node_modules/**'],
}),
babel({
exclude: 'node_modules/**',
babelHelpers: 'bundled',
Expand Down
1 change: 1 addition & 0 deletions libraries/core-react/src/Avatar/Avatar.tokens.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
export const avatar = {
enabled: {
border: {
Expand Down
1 change: 1 addition & 0 deletions libraries/core-react/src/Avatar/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// @ts-nocheck
export { Avatar } from './Avatar'
1 change: 1 addition & 0 deletions libraries/core-react/src/Divider/Divider.tokens.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { tokens } from '@equinor/eds-tokens'

const {
Expand Down
1 change: 1 addition & 0 deletions libraries/core-react/src/Divider/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// @ts-nocheck
export { Divider } from './Divider'

0 comments on commit 1bd85f7

Please sign in to comment.