From e275f93dc1c9ba123ca2842f0dff09cc297abff6 Mon Sep 17 00:00:00 2001 From: mong <mong@channel.io> Date: Wed, 15 Dec 2021 20:45:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?build(rollupconfig):=20aliasing=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20=ED=9B=84=20=ED=83=80=EC=9E=85=EC=9D=B4=20=EC=98=AC?= =?UTF-8?q?=EB=B0=94=EB=A5=B4=EA=B2=8C=20=EC=83=9D=EC=84=B1=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8D=98=20=EB=AC=B8=EC=A0=9C=EB=A5=BC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @rollup/plugin-alias를 제거하고 rollup-plugin-typescript2 를 사용하게 수정 --- package-lock.json | 531 ++++++++++++++++++++++- package.json | 9 +- rollup.config.js | 50 ++- src/components/Avatars/Avatar/Avatar.tsx | 5 +- tsconfig.compile.json | 22 - tsconfig.json | 2 +- 6 files changed, 572 insertions(+), 47 deletions(-) delete mode 100644 tsconfig.compile.json diff --git a/package-lock.json b/package-lock.json index 19ca1d7ef7..c9bfb2dd2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-commonjs": "^19.0.0", "@rollup/plugin-node-resolve": "^13.0.0", + "@rollup/plugin-typescript": "^8.3.0", "@rollup/plugin-url": "^6.0.0", "@semantic-release/git": "^9.0.0", "@storybook/addon-a11y": "^6.4.3", @@ -86,6 +87,7 @@ "regenerator-runtime": "^0.13.7", "rollup": "^2.50.5", "rollup-plugin-peer-deps-external": "^2.2.4", + "rollup-plugin-typescript2": "^0.31.1", "rollup-plugin-visualizer": "^5.5.2", "semantic-release": "^17.4.3", "styled-components": "^5.2.1", @@ -93,7 +95,10 @@ "ts-node": "^8.10.2", "ts-prune": "^0.9.1", "tsconfig-paths-webpack-plugin": "^3.5.2", - "typescript": "^4.4.3" + "tslib": "^2.3.1", + "ttypescript": "^1.5.13", + "typescript": "^4.4.3", + "typescript-transform-paths": "^3.3.1" }, "engines": { "node": "16.2.0", @@ -3809,6 +3814,24 @@ "rollup": "^2.42.0" } }, + "node_modules/@rollup/plugin-typescript": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.0.tgz", + "integrity": "sha512-I5FpSvLbtAdwJ+naznv+B4sjXZUcIvLLceYpITAn7wAP8W0wqc5noLdGIp9HGVntNhRWXctwPYrSSFQxtl0FPA==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^3.1.0", + "resolve": "^1.17.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0", + "tslib": "*", + "typescript": ">=3.7.0" + } + }, "node_modules/@rollup/plugin-url": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-url/-/plugin-url-6.0.0.tgz", @@ -6460,6 +6483,16 @@ "node": ">=4.2.0" } }, + "node_modules/@ts-type/package-dts": { + "version": "1.0.56", + "resolved": "https://registry.npmjs.org/@ts-type/package-dts/-/package-dts-1.0.56.tgz", + "integrity": "sha512-nBjbCaVV+R81jk7q/6sRuNYOhDAbBOmaCkPI2quK0Rnye2f4FUHX+4JL+3rDPiRPHxgX3pNfVKKHBlPAHiRddw==", + "dev": true, + "dependencies": { + "@types/semver": "^7.3.9", + "ts-type": "^2.1.2" + } + }, "node_modules/@types/aria-query": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.1.tgz", @@ -6507,6 +6540,13 @@ "@babel/types": "^7.3.0" } }, + "node_modules/@types/bluebird": { + "version": "3.5.36", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.36.tgz", + "integrity": "sha512-HBNx4lhkxN7bx6P0++W8E289foSu8kO8GCk2unhuVggO+cE7rh9DhZUyPhUxNRG9m+5B5BTKxZQ5ZP92x/mx9Q==", + "dev": true, + "peer": true + }, "node_modules/@types/color-convert": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.0.tgz", @@ -6901,6 +6941,12 @@ "integrity": "sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", + "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==", + "dev": true + }, "node_modules/@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -7440,6 +7486,18 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "node_modules/@yarn-tool/resolve-package": { + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/@yarn-tool/resolve-package/-/resolve-package-1.0.40.tgz", + "integrity": "sha512-5kKRhGb8OCdpzuoGkb9BQw6biyY0zYesV3VyvEzRtb/cqZ7AR6o0ajR6q83jTaCJfYUaJaUPyXVOSZAUjWJQDQ==", + "dev": true, + "dependencies": { + "@ts-type/package-dts": "^1.0.56", + "pkg-dir": "< 6 >= 5", + "tslib": "^2.3.1", + "upath2": "^3.1.10" + } + }, "node_modules/abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -24448,6 +24506,15 @@ "node": ">=0.10.0" } }, + "node_modules/path-is-network-drive": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/path-is-network-drive/-/path-is-network-drive-1.0.10.tgz", + "integrity": "sha512-D6kJYPUSKGZBpTM2nv10sOWNdC056p4JDx0y7ARe6gop0aXXm5G86Gn/SyKvaf0Ce8c9Guctf+J+qoFmzuhDQg==", + "dev": true, + "dependencies": { + "tslib": "^2.3.1" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -24463,6 +24530,15 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "node_modules/path-strip-sep": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-strip-sep/-/path-strip-sep-1.0.7.tgz", + "integrity": "sha512-9xDVZPblHde4lTuTDnwqBKr9LTbPZW+Iae63ho500+BpEiZe3X6wvLInHgbB6FSMtwCTvztljw3k2zcNDNESzg==", + "dev": true, + "dependencies": { + "tslib": "^2.3.1" + } + }, "node_modules/path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -27015,6 +27091,156 @@ "rollup": "*" } }, + "node_modules/rollup-plugin-typescript2": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.31.1.tgz", + "integrity": "sha512-sklqXuQwQX+stKi4kDfEkneVESPi3YM/2S899vfRdF9Yi40vcC50Oq4A4cSZJNXsAQE/UsBZl5fAOsBLziKmjw==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^4.1.0", + "@yarn-tool/resolve-package": "^1.0.36", + "find-cache-dir": "^3.3.1", + "fs-extra": "8.1.0", + "resolve": "1.20.0", + "tslib": "2.2.0" + }, + "peerDependencies": { + "rollup": ">=1.26.3", + "typescript": ">=2.4.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", + "integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==", + "dev": true, + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup-plugin-typescript2/node_modules/tslib": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", + "dev": true + }, + "node_modules/rollup-plugin-typescript2/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/rollup-plugin-visualizer": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.5.2.tgz", @@ -30199,6 +30425,28 @@ "ts-prune": "lib/index.js" } }, + "node_modules/ts-toolbelt": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz", + "integrity": "sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==", + "dev": true, + "peer": true + }, + "node_modules/ts-type": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ts-type/-/ts-type-2.1.2.tgz", + "integrity": "sha512-64/2XoaipFXa/bidwXChQCSJ3VaCUVKrEaRPXiP5gLIlkPoAHfnwOMC0EWr42DsTm/+qYYuNwzxc0VQroeDs+g==", + "dev": true, + "dependencies": { + "tslib": "^2.3.1", + "typedarray-dts": "^1.0.0" + }, + "peerDependencies": { + "@types/bluebird": "*", + "@types/node": "*", + "ts-toolbelt": "^9.6.0" + } + }, "node_modules/tsconfig-paths": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz", @@ -30350,6 +30598,23 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, + "node_modules/ttypescript": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.13.tgz", + "integrity": "sha512-KT/RBfGGlVJFqEI8cVvI3nMsmYcFvPSZh8bU0qX+pAwbi7/ABmYkzn7l/K8skw0xmYjVCoyaV6WLsBQxdadybQ==", + "dev": true, + "dependencies": { + "resolve": ">=1.9.0" + }, + "bin": { + "ttsc": "bin/tsc", + "ttsserver": "bin/tsserver" + }, + "peerDependencies": { + "ts-node": ">=8.0.2", + "typescript": ">=3.2.2" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -30399,6 +30664,12 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "node_modules/typedarray-dts": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typedarray-dts/-/typedarray-dts-1.0.0.tgz", + "integrity": "sha512-Ka0DBegjuV9IPYFT1h0Qqk5U4pccebNIJCGl8C5uU7xtOs+jpJvKGAY4fHGK25hTmXZOEUl9Cnsg5cS6K/b5DA==", + "dev": true + }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -30429,6 +30700,18 @@ "node": ">=4.2.0" } }, + "node_modules/typescript-transform-paths": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/typescript-transform-paths/-/typescript-transform-paths-3.3.1.tgz", + "integrity": "sha512-c+8Cqd2rsRtTU68rJI0NX/OtqgBDddNs1fIxm1nCNyhn0WpoyqtpUxc1w9Ke5c5kgE4/OT5xYbKf2cf694RYEg==", + "dev": true, + "dependencies": { + "minimatch": "^3.0.4" + }, + "peerDependencies": { + "typescript": ">=3.6.5" + } + }, "node_modules/uglify-js": { "version": "3.13.7", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.7.tgz", @@ -30816,6 +31099,21 @@ "yarn": "*" } }, + "node_modules/upath2": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/upath2/-/upath2-3.1.10.tgz", + "integrity": "sha512-7ph3GzTaVbQX+oIoMsGtM+9BAWQr+6Mn28TJKPu28+yGpZ+J4am590CPDBlDG0zyuo9T9T7o21ciqNzwIp/q0A==", + "dev": true, + "dependencies": { + "lodash": "^4.17.21", + "path-is-network-drive": "^1.0.10", + "path-strip-sep": "^1.0.7", + "tslib": "^2.3.1" + }, + "peerDependencies": { + "@types/node": "*" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -35260,6 +35558,16 @@ "resolve": "^1.19.0" } }, + "@rollup/plugin-typescript": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.3.0.tgz", + "integrity": "sha512-I5FpSvLbtAdwJ+naznv+B4sjXZUcIvLLceYpITAn7wAP8W0wqc5noLdGIp9HGVntNhRWXctwPYrSSFQxtl0FPA==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.1.0", + "resolve": "^1.17.0" + } + }, "@rollup/plugin-url": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-url/-/plugin-url-6.0.0.tgz", @@ -37086,6 +37394,16 @@ } } }, + "@ts-type/package-dts": { + "version": "1.0.56", + "resolved": "https://registry.npmjs.org/@ts-type/package-dts/-/package-dts-1.0.56.tgz", + "integrity": "sha512-nBjbCaVV+R81jk7q/6sRuNYOhDAbBOmaCkPI2quK0Rnye2f4FUHX+4JL+3rDPiRPHxgX3pNfVKKHBlPAHiRddw==", + "dev": true, + "requires": { + "@types/semver": "^7.3.9", + "ts-type": "^2.1.2" + } + }, "@types/aria-query": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.1.tgz", @@ -37133,6 +37451,13 @@ "@babel/types": "^7.3.0" } }, + "@types/bluebird": { + "version": "3.5.36", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.36.tgz", + "integrity": "sha512-HBNx4lhkxN7bx6P0++W8E289foSu8kO8GCk2unhuVggO+cE7rh9DhZUyPhUxNRG9m+5B5BTKxZQ5ZP92x/mx9Q==", + "dev": true, + "peer": true + }, "@types/color-convert": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.0.tgz", @@ -37510,6 +37835,12 @@ "integrity": "sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==", "dev": true }, + "@types/semver": { + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", + "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==", + "dev": true + }, "@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -37956,6 +38287,18 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "@yarn-tool/resolve-package": { + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/@yarn-tool/resolve-package/-/resolve-package-1.0.40.tgz", + "integrity": "sha512-5kKRhGb8OCdpzuoGkb9BQw6biyY0zYesV3VyvEzRtb/cqZ7AR6o0ajR6q83jTaCJfYUaJaUPyXVOSZAUjWJQDQ==", + "dev": true, + "requires": { + "@ts-type/package-dts": "^1.0.56", + "pkg-dir": "< 6 >= 5", + "tslib": "^2.3.1", + "upath2": "^3.1.10" + } + }, "abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -51050,6 +51393,15 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-is-network-drive": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/path-is-network-drive/-/path-is-network-drive-1.0.10.tgz", + "integrity": "sha512-D6kJYPUSKGZBpTM2nv10sOWNdC056p4JDx0y7ARe6gop0aXXm5G86Gn/SyKvaf0Ce8c9Guctf+J+qoFmzuhDQg==", + "dev": true, + "requires": { + "tslib": "^2.3.1" + } + }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -51062,6 +51414,15 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-strip-sep": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-strip-sep/-/path-strip-sep-1.0.7.tgz", + "integrity": "sha512-9xDVZPblHde4lTuTDnwqBKr9LTbPZW+Iae63ho500+BpEiZe3X6wvLInHgbB6FSMtwCTvztljw3k2zcNDNESzg==", + "dev": true, + "requires": { + "tslib": "^2.3.1" + } + }, "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", @@ -53034,6 +53395,121 @@ "dev": true, "requires": {} }, + "rollup-plugin-typescript2": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.31.1.tgz", + "integrity": "sha512-sklqXuQwQX+stKi4kDfEkneVESPi3YM/2S899vfRdF9Yi40vcC50Oq4A4cSZJNXsAQE/UsBZl5fAOsBLziKmjw==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^4.1.0", + "@yarn-tool/resolve-package": "^1.0.36", + "find-cache-dir": "^3.3.1", + "fs-extra": "8.1.0", + "resolve": "1.20.0", + "tslib": "2.2.0" + }, + "dependencies": { + "@rollup/pluginutils": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz", + "integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==", + "dev": true, + "requires": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + } + }, + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "tslib": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, "rollup-plugin-visualizer": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.5.2.tgz", @@ -55546,6 +56022,23 @@ "ts-morph": "^7.3.0" } }, + "ts-toolbelt": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz", + "integrity": "sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==", + "dev": true, + "peer": true + }, + "ts-type": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ts-type/-/ts-type-2.1.2.tgz", + "integrity": "sha512-64/2XoaipFXa/bidwXChQCSJ3VaCUVKrEaRPXiP5gLIlkPoAHfnwOMC0EWr42DsTm/+qYYuNwzxc0VQroeDs+g==", + "dev": true, + "requires": { + "tslib": "^2.3.1", + "typedarray-dts": "^1.0.0" + } + }, "tsconfig-paths": { "version": "3.11.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz", @@ -55667,6 +56160,15 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, + "ttypescript": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.13.tgz", + "integrity": "sha512-KT/RBfGGlVJFqEI8cVvI3nMsmYcFvPSZh8bU0qX+pAwbi7/ABmYkzn7l/K8skw0xmYjVCoyaV6WLsBQxdadybQ==", + "dev": true, + "requires": { + "resolve": ">=1.9.0" + } + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -55704,6 +56206,12 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typedarray-dts": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typedarray-dts/-/typedarray-dts-1.0.0.tgz", + "integrity": "sha512-Ka0DBegjuV9IPYFT1h0Qqk5U4pccebNIJCGl8C5uU7xtOs+jpJvKGAY4fHGK25hTmXZOEUl9Cnsg5cS6K/b5DA==", + "dev": true + }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -55724,6 +56232,15 @@ "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true }, + "typescript-transform-paths": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/typescript-transform-paths/-/typescript-transform-paths-3.3.1.tgz", + "integrity": "sha512-c+8Cqd2rsRtTU68rJI0NX/OtqgBDddNs1fIxm1nCNyhn0WpoyqtpUxc1w9Ke5c5kgE4/OT5xYbKf2cf694RYEg==", + "dev": true, + "requires": { + "minimatch": "^3.0.4" + } + }, "uglify-js": { "version": "3.13.7", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.7.tgz", @@ -56013,6 +56530,18 @@ "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", "dev": true }, + "upath2": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/upath2/-/upath2-3.1.10.tgz", + "integrity": "sha512-7ph3GzTaVbQX+oIoMsGtM+9BAWQr+6Mn28TJKPu28+yGpZ+J4am590CPDBlDG0zyuo9T9T7o21ciqNzwIp/q0A==", + "dev": true, + "requires": { + "lodash": "^4.17.21", + "path-is-network-drive": "^1.0.10", + "path-strip-sep": "^1.0.7", + "tslib": "^2.3.1" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 3e4a27fec5..7e7e607426 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "jest:watch": "cross-env BABEL_ENV=test jest --watch", "cleanBuild": "npx rimraf build", "compile": "tsc -p tsconfig.compile.json", - "prebuild": "npm run cleanBuild && npm run compile", + "prebuild": "npm run cleanBuild", "build": "npm run build:icon && npm run build:rollup", "build:rollup": "cross-env BABEL_ENV=build rollup -c", "build:storybook": "build-storybook", @@ -74,7 +74,6 @@ "@channel.io/stylelint-config": "^1.2.0", "@commitlint/cli": "^13.1.0", "@commitlint/config-conventional": "^13.1.0", - "@rollup/plugin-alias": "^3.1.8", "@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-commonjs": "^19.0.0", "@rollup/plugin-node-resolve": "^13.0.0", @@ -132,6 +131,7 @@ "regenerator-runtime": "^0.13.7", "rollup": "^2.50.5", "rollup-plugin-peer-deps-external": "^2.2.4", + "rollup-plugin-typescript2": "^0.31.1", "rollup-plugin-visualizer": "^5.5.2", "semantic-release": "^17.4.3", "styled-components": "^5.2.1", @@ -139,7 +139,10 @@ "ts-node": "^8.10.2", "ts-prune": "^0.9.1", "tsconfig-paths-webpack-plugin": "^3.5.2", - "typescript": "^4.4.3" + "tslib": "^2.3.1", + "ttypescript": "^1.5.13", + "typescript": "^4.4.3", + "typescript-transform-paths": "^3.3.1" }, "peerDependencies": { "react": ">=16.8.0", diff --git a/rollup.config.js b/rollup.config.js index b7b170eb42..6e5cc95fe9 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,29 +3,41 @@ import peerDepsExternal from 'rollup-plugin-peer-deps-external' import { nodeResolve } from '@rollup/plugin-node-resolve' import url from '@rollup/plugin-url' import commonjs from '@rollup/plugin-commonjs' -import alias from '@rollup/plugin-alias' import babel from '@rollup/plugin-babel' import { visualizer } from 'rollup-plugin-visualizer' -import path from 'path' +import typescript from 'rollup-plugin-typescript2' import packageJson from './package.json' const extensions = DEFAULT_EXTENSIONS.concat(['.ts', '.tsx']) -const rootDir = path.resolve(__dirname) - -const getPathByDirName = (dirName) => path.resolve(rootDir, 'src', dirName) - -const aliasPlugin = alias({ - entries: { - Components: getPathByDirName('components'), - Constants: getPathByDirName('constants'), - Foundation: getPathByDirName('foundation'), - Hooks: getPathByDirName('hooks'), - Layout: getPathByDirName('layout'), - Types: getPathByDirName('types'), - Utils: getPathByDirName('utils'), - Worklets: getPathByDirName('worklets'), +// Order Matters, must after rollup-plugin-node-resolve +// See Also: https://www.npmjs.com/package/rollup-plugin-typescript2 +const typescriptPlugin = typescript({ + typescript: require('ttypescript'), + tsconfig: './tsconfig.json', + useTsconfigDeclarationDir: true, + declarationDir: './build/src', + tsconfigDefaults: { + noEmit: false, + emitDeclarationOnly: true, + compilerOptions: { + plugins: [ + { transform: 'typescript-transform-paths' }, + { transform: 'typescript-transform-paths', afterDeclarations: true }, + ], + }, + exclude: [ + './src/index.ts', + './src/components/Icon/generated/**/*', + './src/layout/stories/**/*', + '**/*.stories.tsx', + '**/*.test.ts', + '**/*.test.tsx', + './src/__mocks__/**/*', + './src/utils/storyUtils.ts', + './src/utils/testUtils.tsx', + ], }, }) @@ -41,7 +53,6 @@ const commonPlugins = [ visualizer({ filename: 'stats.html', }), - aliasPlugin, ] const configGenerator = ({ @@ -61,7 +72,7 @@ const configGenerator = ({ }) export default [ - // CommonJS + // // CommonJS configGenerator({ output: { file: packageJson.main, @@ -72,6 +83,7 @@ export default [ mainFields: ['main', 'module'], extensions, }), + typescriptPlugin, ], }), // ESModules @@ -85,6 +97,8 @@ export default [ nodeResolve({ extensions, }), + typescriptPlugin, + // aliasPlugin, ], }), ] diff --git a/src/components/Avatars/Avatar/Avatar.tsx b/src/components/Avatars/Avatar/Avatar.tsx index 8656419b6c..c3aafa5905 100644 --- a/src/components/Avatars/Avatar/Avatar.tsx +++ b/src/components/Avatars/Avatar/Avatar.tsx @@ -2,10 +2,11 @@ import React, { forwardRef, useMemo } from 'react' import { noop, isEmpty } from 'lodash-es' -/* Internal denpendencies */ +/* Internal dependencies */ import { smoothCornersStyle } from 'Foundation' -import defaultAvatarUrl from 'Components/Avatars/assets/defaultAvatar.svg' import { Status } from 'Components/Status' +// eslint-disable-next-line no-restricted-imports +import defaultAvatarUrl from '../assets/defaultAvatar.svg' import useProgressiveImage from './useProgressiveImage' import AvatarProps, { AvatarSize } from './Avatar.types' import { AvatarImage, AvatarImageWrapper, AvatarWrapper, StatusWrapper } from './Avatar.styled' diff --git a/tsconfig.compile.json b/tsconfig.compile.json deleted file mode 100644 index 5eb927bc92..0000000000 --- a/tsconfig.compile.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": false, - "emitDeclarationOnly": true, - "declarationDir": "./build/src" - }, - "exclude": [ - "./src/index.ts", - "./src/components/Icon/generated/**/*", - "./src/layout/stories/**/*", - "**/*.stories.tsx", - "**/*.test.ts", - "**/*.test.tsx", - "./src/__mocks__/**/*", - "./src/utils/storyUtils.ts", - "./src/utils/testUtils.tsx", - ], - "files": [ - "./src/index.ts" - ] -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 7c96b2bf14..ccafcbf8bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "declaration": true, - "declarationDir": "./build", + "declarationDir": "./build/src", "noEmit": true, "module": "esnext", "target": "es5", From 6846d0a32c3f685290cdc0085ef2f67c89fee735 Mon Sep 17 00:00:00 2001 From: mong <mong@channel.io> Date: Wed, 15 Dec 2021 21:09:56 +0900 Subject: [PATCH 2/2] =?UTF-8?q?chore(rollupconfig):=20=EC=A3=BC=EC=84=9D?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C,=20=EC=A4=91=EB=B3=B5=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rollup.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 6e5cc95fe9..218faa46e3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -72,7 +72,7 @@ const configGenerator = ({ }) export default [ - // // CommonJS + // CommonJS configGenerator({ output: { file: packageJson.main, @@ -98,7 +98,6 @@ export default [ extensions, }), typescriptPlugin, - // aliasPlugin, ], }), ]