From 29f59e7e865356e22842848a870dd82fa29fd88c Mon Sep 17 00:00:00 2001 From: "Leo Y. Li" Date: Sun, 31 Mar 2019 16:47:36 -0400 Subject: [PATCH] #1: optimize package bundling process --- addons/addon-contexts/.babelrc | 2 +- addons/addon-contexts/.gitignore | 2 +- addons/addon-contexts/package.json | 10 ++++---- addons/addon-contexts/tsconfig.json | 2 +- addons/addon-contexts/yarn.lock | 40 ++++++++--------------------- 5 files changed, 18 insertions(+), 38 deletions(-) diff --git a/addons/addon-contexts/.babelrc b/addons/addon-contexts/.babelrc index 9516c3041d46..358ae69ac458 100644 --- a/addons/addon-contexts/.babelrc +++ b/addons/addon-contexts/.babelrc @@ -9,5 +9,5 @@ "@babel/typescript", "@babel/react" ], - "plugins": ["@babel/proposal-class-properties", "@babel/proposal-object-rest-spread"] + "comments": false } diff --git a/addons/addon-contexts/.gitignore b/addons/addon-contexts/.gitignore index 491fc35975b1..f06235c460c2 100644 --- a/addons/addon-contexts/.gitignore +++ b/addons/addon-contexts/.gitignore @@ -1,2 +1,2 @@ node_modules -lib +dist diff --git a/addons/addon-contexts/package.json b/addons/addon-contexts/package.json index 1637d46a674c..97eef2b423e7 100644 --- a/addons/addon-contexts/package.json +++ b/addons/addon-contexts/package.json @@ -25,21 +25,21 @@ "prettier": "prettier --config .prettierrc --write '**/*.{ts,tsx}'", "type:check": "tsc --isolatedModules --noEmit ", "type:watch": "yarn type:check --watch", - "type:emit": "rm -rf dist && tsc --declaration --emitDeclarationOnly", + "type:emit": "rm -rf dist && tsc --declaration --removeComments --emitDeclarationOnly", "test": "jest --passWithNoTests", "build": "babel src --out-dir dist --extensions \".ts,.tsx\" --ignore src/@types", "prepare": "yarn test && yarn type:emit && yarn build" }, + "dependencies": { + "@storybook/addons": "^5.0.0", + "@storybook/components": "^5.0.0" + }, "devDependencies": { "@babel/cli": "7.2.3", "@babel/core": "7.4.0", - "@babel/plugin-proposal-class-properties": "7.4.0", - "@babel/plugin-proposal-object-rest-spread": "7.4.0", "@babel/preset-env": "7.4.2", "@babel/preset-react": "7.0.0", "@babel/preset-typescript": "7.3.3", - "@storybook/addons": "5.0.5", - "@storybook/components": "5.0.5", "@types/jest": "24.0.11", "@types/react": "16.8.10", "jest": "24.5.0", diff --git a/addons/addon-contexts/tsconfig.json b/addons/addon-contexts/tsconfig.json index 0b31bf6a1544..cd043e38f59c 100644 --- a/addons/addon-contexts/tsconfig.json +++ b/addons/addon-contexts/tsconfig.json @@ -10,5 +10,5 @@ "allowSyntheticDefaultImports": true }, "include": ["src"], - "exclude": ["node_modules", "scripts", "jest", "lib", "src-js"] + "exclude": ["src/register.ts"] } diff --git a/addons/addon-contexts/yarn.lock b/addons/addon-contexts/yarn.lock index d0e2736c2dea..9eb9cdd7ffa5 100644 --- a/addons/addon-contexts/yarn.lock +++ b/addons/addon-contexts/yarn.lock @@ -89,18 +89,6 @@ "@babel/traverse" "^7.4.0" "@babel/types" "^7.4.0" -"@babel/helper-create-class-features-plugin@^7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.0.tgz#30fd090e059d021995c1762a5b76798fa0b51d82" - integrity sha512-2K8NohdOT7P6Vyp23QH4w2IleP8yG3UJsbRKwA4YP6H8fErcLkFuuEEqbF2/BYBKSNci/FWJiqm6R3VhM/QHgw== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.0" - "@babel/helper-split-export-declaration" "^7.4.0" - "@babel/helper-define-map@^7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.0.tgz#cbfd8c1b2f12708e262c26f600cd16ed6a3bc6c9" @@ -264,14 +252,6 @@ "@babel/helper-remap-async-to-generator" "^7.1.0" "@babel/plugin-syntax-async-generators" "^7.2.0" -"@babel/plugin-proposal-class-properties@7.4.0": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.0.tgz#d70db61a2f1fd79de927eea91f6411c964e084b8" - integrity sha512-t2ECPNOXsIeK1JxJNKmgbzQtoG27KIlVE61vTqX0DKR9E9sZlVVxWUtEW9D5FlZ8b8j7SBNCHY47GgPKCKlpPg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-json-strings@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" @@ -981,7 +961,7 @@ resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.2.tgz#8013f2af54a2b7d735f71560ff360d3a8176a87b" integrity sha512-vTCdPp/T/Q3oSqwHmZ5Kpa9oI7iLtGl3RQaA/NyLHikvcrPxACkkKVr/XzkSPJWXHRhKGzVvb0urJsbMlRxi1Q== -"@storybook/addons@5.0.5", "@storybook/addons@^5.0.5": +"@storybook/addons@5.0.5", "@storybook/addons@^5.0.0": version "5.0.5" resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-5.0.5.tgz#5f979a5575c58b8a2dcb78c01795aa8321826e2b" integrity sha512-AsEdBCN8R03lwXUT4HjPn4yEER/oGGfbjza0ZLhUJ9JO3dcOuHk69a7ENOsM3BoJANRJuSxbfPwTNPe44Q8Vaw== @@ -1006,7 +986,7 @@ dependencies: core-js "^2.6.5" -"@storybook/components@^5.0.5": +"@storybook/components@^5.0.0": version "5.0.5" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-5.0.5.tgz#4e00d7da857c0e6f424ed514ef3eb25e3ce9acb2" integrity sha512-/zFLWF67r/jkT824jTVb2l15y6CYTxnCcW4vS2RPJAURGjC8szyfHHly8ydtcmgdgiGeGDBxUe8ltsMYV5Q0hw== @@ -3603,9 +3583,9 @@ map-visit@^1.0.0: object-visit "^1.0.0" mem@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.2.0.tgz#5ee057680ed9cb8dad8a78d820f9a8897a102025" - integrity sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA== + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== dependencies: map-age-cleaner "^0.1.1" mimic-fn "^2.0.0" @@ -3657,9 +3637,9 @@ mime-types@^2.1.12, mime-types@~2.1.19: mime-db "~1.38.0" mimic-fn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.0.0.tgz#0913ff0b121db44ef5848242c38bbb35d44cabde" - integrity sha512-jbex9Yd/3lmICXwYT6gA/j2mNQGU48wCh/VzRd+/Y/PjYQtlg1gLMdZqvu9s/xH7qKvngxRObl56XZR609IMbA== + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== min-document@^2.19.0: version "2.19.0" @@ -4295,7 +4275,7 @@ react-clientside-effect@^1.2.0: "@babel/runtime" "^7.0.0" shallowequal "^1.1.0" -react-dom@^16.8.1, react-dom@^16.8.6: +react-dom@16.8.6, react-dom@^16.8.1: version "16.8.6" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f" integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA== @@ -4396,7 +4376,7 @@ react-textarea-autosize@^7.0.4: "@babel/runtime" "^7.1.2" prop-types "^15.6.0" -react@^16.8.1, react@^16.8.6: +react@16.8.6, react@^16.8.1: version "16.8.6" resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe" integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==