Skip to content

Commit d59f2f0

Browse files
committed
feat(renderer): add TS config.
1 parent 951b192 commit d59f2f0

File tree

6 files changed

+41
-5
lines changed

6 files changed

+41
-5
lines changed

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const camelToSnake = (string) => {
77
};
88

99
module.exports = {
10-
presets: ["@babel/preset-env", "@babel/preset-react"],
10+
presets: ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
1111
plugins: ["@babel/plugin-transform-runtime", "@babel/plugin-syntax-dynamic-import", "lodash", "@babel/plugin-proposal-class-properties" ],
1212
env: {
1313
cjs: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
},
4141
"devDependencies": {
4242
"@babel/plugin-transform-runtime": "^7.9.0",
43+
"@babel/preset-typescript": "^7.9.0",
4344
"@khala/commit-analyzer-wildcard": "^2.4.1",
4445
"@khala/npm-release-monorepo": "^2.4.1",
4546
"@khala/wildcard-release-notes": "^2.4.1",

packages/common/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"compilerOptions": {
33
"sourceMap": true,
44
"noImplicitAny": true,
5-
"module": "commonjs",
5+
"module": "ES6",
66
"target": "es5",
7-
"jsx": "react"
7+
"jsx": "react",
8+
"allowSyntheticDefaultImports": true
89
},
910
"include": ["./src/**/*.ts"],
1011
"exclude": ["./dist"]

packages/react-form-renderer/rollup.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import babel from 'rollup-plugin-babel';
44
import replace from 'rollup-plugin-replace';
55
import nodeGlobals from 'rollup-plugin-node-globals';
66
import { terser } from 'rollup-plugin-terser';
7+
import typescript from '@rollup/plugin-typescript';
78
import glob from 'glob';
89
import path from 'path';
910
import sourcemaps from 'rollup-plugin-sourcemaps';
1011

11-
const outputPaths = glob.sync(path.resolve(__dirname, './src/files/*.js'));
12+
const outputPaths = [...glob.sync(path.resolve(__dirname, './src/files/!(*.d.ts)')), ...glob.sync(path.resolve(__dirname, './src/files/*.js'))];
1213

1314
const globals = {
1415
react: 'React',
@@ -43,6 +44,9 @@ const plugins = [
4344
keep_classnames: true,
4445
keep_fnames: true
4546
}),
47+
typescript({
48+
allowSyntheticDefaultImports: true
49+
}),
4650
sourcemaps()
4751
];
4852

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../common/tsconfig.json

yarn.lock

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@
267267
"@babel/helper-replace-supers" "^7.8.6"
268268
"@babel/helper-split-export-declaration" "^7.8.3"
269269

270+
"@babel/helper-create-class-features-plugin@^7.9.6":
271+
version "7.9.6"
272+
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.9.6.tgz#965c8b0a9f051801fd9d3b372ca0ccf200a90897"
273+
integrity sha512-6N9IeuyHvMBRyjNYOMJHrhwtu4WJMrYf8hVbEHD3pbbbmNOk1kmXSQs7bA4dYDUaIx4ZEzdnvo6NwC3WHd/Qow==
274+
dependencies:
275+
"@babel/helper-function-name" "^7.9.5"
276+
"@babel/helper-member-expression-to-functions" "^7.8.3"
277+
"@babel/helper-optimise-call-expression" "^7.8.3"
278+
"@babel/helper-plugin-utils" "^7.8.3"
279+
"@babel/helper-replace-supers" "^7.9.6"
280+
"@babel/helper-split-export-declaration" "^7.8.3"
281+
270282
"@babel/helper-create-regexp-features-plugin@^7.7.0":
271283
version "7.7.2"
272284
resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.2.tgz#6f20443778c8fce2af2ff4206284afc0ced65db6"
@@ -482,7 +494,7 @@
482494
"@babel/traverse" "^7.7.0"
483495
"@babel/types" "^7.7.0"
484496

485-
"@babel/helper-replace-supers@^7.8.3":
497+
"@babel/helper-replace-supers@^7.8.3", "@babel/helper-replace-supers@^7.9.6":
486498
version "7.9.6"
487499
resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz#03149d7e6a5586ab6764996cd31d6981a17e1444"
488500
integrity sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==
@@ -1438,6 +1450,15 @@
14381450
"@babel/helper-plugin-utils" "^7.8.3"
14391451
"@babel/plugin-syntax-typescript" "^7.8.3"
14401452

1453+
"@babel/plugin-transform-typescript@^7.9.0":
1454+
version "7.9.6"
1455+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.9.6.tgz#2248971416a506fc78278fc0c0ea3179224af1e9"
1456+
integrity sha512-8OvsRdvpt3Iesf2qsAn+YdlwAJD7zJ+vhFZmDCa4b8dTp7MmHtKk5FF2mCsGxjZwuwsy/yIIay/nLmxST1ctVQ==
1457+
dependencies:
1458+
"@babel/helper-create-class-features-plugin" "^7.9.6"
1459+
"@babel/helper-plugin-utils" "^7.8.3"
1460+
"@babel/plugin-syntax-typescript" "^7.8.3"
1461+
14411462
"@babel/plugin-transform-unicode-regex@^7.7.0":
14421463
version "7.7.0"
14431464
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz#743d9bcc44080e3cc7d49259a066efa30f9187a3"
@@ -1627,6 +1648,14 @@
16271648
"@babel/helper-plugin-utils" "^7.0.0"
16281649
"@babel/plugin-transform-typescript" "^7.7.2"
16291650

1651+
"@babel/preset-typescript@^7.9.0":
1652+
version "7.9.0"
1653+
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.9.0.tgz#87705a72b1f0d59df21c179f7c3d2ef4b16ce192"
1654+
integrity sha512-S4cueFnGrIbvYJgwsVFKdvOmpiL0XGw9MFW9D0vgRys5g36PBhZRL8NX8Gr2akz8XRtzq6HuDXPD/1nniagNUg==
1655+
dependencies:
1656+
"@babel/helper-plugin-utils" "^7.8.3"
1657+
"@babel/plugin-transform-typescript" "^7.9.0"
1658+
16301659
"@babel/runtime-corejs2@^7.0.0", "@babel/runtime-corejs2@^7.6.3":
16311660
version "7.9.6"
16321661
resolved "https://registry.yarnpkg.com/@babel/runtime-corejs2/-/runtime-corejs2-7.9.6.tgz#acd5d6351384cc2828dc211aa5426a90476bf4a8"

0 commit comments

Comments
 (0)