diff --git a/libraries/core-react/package.json b/libraries/core-react/package.json index 261ca4a15f..ae9559f374 100644 --- a/libraries/core-react/package.json +++ b/libraries/core-react/package.json @@ -55,7 +55,7 @@ "@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": "^4.2.1", "babel-plugin-styled-components": "^1.10.7", "jest": "^26.0.1", "jest-styled-components": "^6.3.4", diff --git a/libraries/core-react/pnpm-lock.yaml b/libraries/core-react/pnpm-lock.yaml index 7f3a4b1892..fdbe3284e7 100644 --- a/libraries/core-react/pnpm-lock.yaml +++ b/libraries/core-react/pnpm-lock.yaml @@ -23,7 +23,7 @@ devDependencies: '@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: 4.2.1 babel-plugin-styled-components: 1.10.7_styled-components@4.4.1 jest: 26.0.1 jest-styled-components: 6.3.4_styled-components@4.4.1 @@ -102,6 +102,29 @@ packages: node: '>=6.9.0' resolution: integrity: sha512-KQmV9yguEjQsXqyOUGKjS4+3K8/DlOCE2pZcq4augdQmtTy5iv5EHtmMSJ7V4c1BIPjuwtZYqYLCq9Ga+hGBRQ== + /@babel/core/7.11.6: + dependencies: + '@babel/code-frame': 7.10.4 + '@babel/generator': 7.11.6 + '@babel/helper-module-transforms': 7.11.0 + '@babel/helpers': 7.10.4 + '@babel/parser': 7.11.5 + '@babel/template': 7.10.4 + '@babel/traverse': 7.11.5 + '@babel/types': 7.11.5 + convert-source-map: 1.7.0 + debug: 4.2.0 + gensync: 1.0.0-beta.1 + json5: 2.1.3 + lodash: 4.17.20 + resolve: 1.17.0 + semver: 5.7.1 + source-map: 0.5.7 + dev: true + engines: + node: '>=6.9.0' + resolution: + integrity: sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg== /@babel/generator/7.10.2: dependencies: '@babel/types': 7.10.2 @@ -119,6 +142,14 @@ packages: dev: true resolution: integrity: sha512-Rn26vueFx0eOoz7iifCN2UHT6rGtnkSGWSoDRIy8jZN3B91PzeSULbswfLoOWuTuAcNwpG/mxy+uCTDnZ9Mp1g== + /@babel/generator/7.11.6: + dependencies: + '@babel/types': 7.11.5 + jsesc: 2.5.2 + source-map: 0.5.7 + dev: true + resolution: + integrity: sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA== /@babel/helper-annotate-as-pure/7.10.1: dependencies: '@babel/types': 7.10.2 @@ -266,6 +297,12 @@ packages: dev: true resolution: integrity: sha512-SFxgwYmZ3HZPyZwJRiVNLRHWuW2OgE5k2nrVs6D9Iv4PPnXVffuEHy83Sfx/l4SqF+5kyJXjAyUmrG7tNm+qVg== + /@babel/helper-module-imports/7.10.4: + dependencies: + '@babel/types': 7.11.5 + dev: true + resolution: + integrity: sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw== /@babel/helper-module-transforms/7.10.1: dependencies: '@babel/helper-module-imports': 7.10.1 @@ -278,6 +315,18 @@ packages: dev: true resolution: integrity: sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg== + /@babel/helper-module-transforms/7.11.0: + dependencies: + '@babel/helper-module-imports': 7.10.4 + '@babel/helper-replace-supers': 7.10.4 + '@babel/helper-simple-access': 7.10.4 + '@babel/helper-split-export-declaration': 7.11.0 + '@babel/template': 7.10.4 + '@babel/types': 7.11.5 + lodash: 4.17.20 + dev: true + resolution: + integrity: sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg== /@babel/helper-optimise-call-expression/7.10.1: dependencies: '@babel/types': 7.10.2 @@ -339,6 +388,13 @@ packages: dev: true resolution: integrity: sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw== + /@babel/helper-simple-access/7.10.4: + dependencies: + '@babel/template': 7.10.4 + '@babel/types': 7.11.5 + dev: true + resolution: + integrity: sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw== /@babel/helper-split-export-declaration/7.10.1: dependencies: '@babel/types': 7.10.2 @@ -376,6 +432,14 @@ packages: dev: true resolution: integrity: sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw== + /@babel/helpers/7.10.4: + dependencies: + '@babel/template': 7.10.4 + '@babel/traverse': 7.11.5 + '@babel/types': 7.11.5 + dev: true + resolution: + integrity: sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA== /@babel/highlight/7.10.1: dependencies: '@babel/helper-validator-identifier': 7.10.1 @@ -406,6 +470,13 @@ packages: hasBin: true resolution: integrity: sha512-MggwidiH+E9j5Sh8pbrX5sJvMcsqS5o+7iB42M9/k0CD63MjYbdP4nhSh7uB5wnv2/RVzTZFTxzF/kIa5mrCqA== + /@babel/parser/7.11.5: + dev: true + engines: + node: '>=6.0.0' + hasBin: true + resolution: + integrity: sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q== /@babel/plugin-proposal-async-generator-functions/7.10.1_@babel+core@7.10.2: dependencies: '@babel/core': 7.10.2 @@ -1156,6 +1227,12 @@ packages: regenerator-runtime: 0.13.5 resolution: integrity: sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg== + /@babel/runtime/7.11.2: + dependencies: + regenerator-runtime: 0.13.7 + dev: true + resolution: + integrity: sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw== /@babel/template/7.10.1: dependencies: '@babel/code-frame': 7.10.1 @@ -1167,8 +1244,8 @@ packages: /@babel/template/7.10.4: dependencies: '@babel/code-frame': 7.10.4 - '@babel/parser': 7.11.4 - '@babel/types': 7.11.0 + '@babel/parser': 7.11.5 + '@babel/types': 7.11.5 dev: true resolution: integrity: sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== @@ -1200,6 +1277,20 @@ packages: dev: true resolution: integrity: sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg== + /@babel/traverse/7.11.5: + dependencies: + '@babel/code-frame': 7.10.4 + '@babel/generator': 7.11.6 + '@babel/helper-function-name': 7.10.4 + '@babel/helper-split-export-declaration': 7.11.0 + '@babel/parser': 7.11.5 + '@babel/types': 7.11.5 + debug: 4.2.0 + globals: 11.12.0 + lodash: 4.17.20 + dev: true + resolution: + integrity: sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ== /@babel/types/7.10.2: dependencies: '@babel/helper-validator-identifier': 7.10.1 @@ -1216,6 +1307,14 @@ packages: dev: true resolution: integrity: sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA== + /@babel/types/7.11.5: + dependencies: + '@babel/helper-validator-identifier': 7.10.4 + lodash: 4.17.20 + to-fast-properties: 2.0.0 + dev: true + resolution: + integrity: sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q== /@bcoe/v8-coverage/0.2.3: dev: true resolution: @@ -1940,18 +2039,22 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - /ast-types/0.11.3: + /ast-types/0.13.4: + dependencies: + tslib: 2.0.1 dev: true engines: - node: '>= 0.8' + node: '>=4' resolution: - integrity: sha512-XA5o5dsNw8MhyW0Q7MWXJWc4oOzZKbdsEJq45h7c8q/d9DwWZ5F2ugUc1PuMLPGsUnphCt/cNDHu8JeBbxf1qA== - /ast-types/0.13.3: + integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w== + /ast-types/0.14.2: + dependencies: + tslib: 2.0.1 dev: true engines: node: '>=4' resolution: - integrity: sha512-XTZ7xGML849LkQP86sWdQzfhwbt3YwIO6MqbX9mUNYY98VKaaVZP7YNNm70IpwecbkkxmfC5IYAzOQ/2p29zRA== + integrity: sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA== /async-each/1.0.3: dev: true optional: true @@ -2022,14 +2125,14 @@ packages: node: '>= 10.14.2' resolution: integrity: sha512-+AuoehOrjt9irZL7DOt2+4ZaTM6dlu1s5TTS46JBa0/qem4dy7VNW3tMb96qeEqcIh20LD73TVNtmVEeymTG7w== - /babel-plugin-react-docgen/4.1.0: + /babel-plugin-react-docgen/4.2.1: dependencies: - lodash: 4.17.15 + ast-types: 0.14.2 + lodash: 4.17.20 react-docgen: 5.3.0 - recast: 0.14.7 dev: true resolution: - integrity: sha512-vzpnBlfGv8XOhJM2zbPyyqw2OLEbelgZZsaaRRTpVwNKuYuc+pUg4+dy7i9gCRms0uOQn4osX571HRcCJMJCmA== + integrity: sha512-UQ0NmGHj/HAqi5Bew8WvNfCk8wSsmdgNd8ZdMjBCICtyCJCq9LiqgqvjCYe570/Wg7AQArSq1VQ60Dd/CHN7mQ== /babel-plugin-styled-components/1.10.7_styled-components@4.4.1: dependencies: '@babel/helper-annotate-as-pure': 7.10.1 @@ -2526,6 +2629,19 @@ packages: dev: true resolution: integrity: sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + /debug/4.2.0: + dependencies: + ms: 2.1.2 + dev: true + engines: + node: '>=6.0' + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + resolution: + integrity: sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== /decamelize/1.2.0: dev: true engines: @@ -4132,6 +4248,10 @@ packages: /lodash/4.17.19: resolution: integrity: sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== + /lodash/4.17.20: + dev: true + resolution: + integrity: sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== /loose-envify/1.4.0: dependencies: js-tokens: 4.0.0 @@ -4316,10 +4436,10 @@ packages: dev: true resolution: integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - /neo-async/2.6.1: + /neo-async/2.6.2: dev: true resolution: - integrity: sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== /nice-try/1.0.5: dev: true resolution: @@ -4735,12 +4855,12 @@ packages: integrity: sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== /react-docgen/5.3.0: dependencies: - '@babel/core': 7.10.2 - '@babel/runtime': 7.10.2 - ast-types: 0.13.3 + '@babel/core': 7.11.6 + '@babel/runtime': 7.11.2 + ast-types: 0.13.4 commander: 2.20.3 doctrine: 3.0.0 - neo-async: 2.6.1 + neo-async: 2.6.2 node-dir: 0.1.17 strip-indent: 3.0.0 dev: true @@ -4820,17 +4940,6 @@ packages: optional: true resolution: integrity: sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - /recast/0.14.7: - dependencies: - ast-types: 0.11.3 - esprima: 4.0.1 - private: 0.1.8 - source-map: 0.6.1 - dev: true - engines: - node: '>= 4' - resolution: - integrity: sha512-/nwm9pkrcWagN40JeJhkPaRxiHXBRkXyRh/hgU088Z/v+qCy+zIHHY6bC6o7NaKAxPqtE6nD8zBH1LfU0/Wx6A== /redent/3.0.0: dependencies: indent-string: 4.0.0 @@ -4855,6 +4964,10 @@ packages: /regenerator-runtime/0.13.5: resolution: integrity: sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA== + /regenerator-runtime/0.13.7: + dev: true + resolution: + integrity: sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== /regenerator-transform/0.14.4: dependencies: '@babel/runtime': 7.10.2 @@ -5937,7 +6050,7 @@ specifiers: '@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: ^4.2.1 babel-plugin-styled-components: ^1.10.7 csstype: ^3.0.3 focus-visible: ^5.1.0 diff --git a/libraries/core-react/rollup.config.js b/libraries/core-react/rollup.config.js index 9ada900d87..7dad299830 100644 --- a/libraries/core-react/rollup.config.js +++ b/libraries/core-react/rollup.config.js @@ -18,6 +18,9 @@ const globals = { } const extensions = ['.jsx', '.js', '.tsx', '.ts'] + +const buildForStorybook = process.env.STORYBOOK + export default [ { input: './src/index.ts', @@ -35,7 +38,10 @@ export default [ babelHelpers: 'bundled', presets: ['@babel/preset-env', '@babel/preset-react'], extensions, - plugins: ['babel-plugin-styled-components'], + plugins: [ + 'babel-plugin-styled-components', + ...(buildForStorybook ? ['babel-plugin-react-docgen'] : []), + ], }), commonjs(), polyfill(['focus-visible']), @@ -49,10 +55,7 @@ export default [ sourcemap: true, globals, }, - { - file: pkg.main, - format: 'cjs', - }, + ...(buildForStorybook ? [] : [{ file: pkg.main, format: 'cjs' }]), ], }, ]