From aa6d904acc59cbd1a0160e6dbfa04cb3f94a9aed Mon Sep 17 00:00:00 2001 From: Gregor Anders Date: Tue, 16 Jun 2020 00:39:21 +0200 Subject: [PATCH 1/5] fix(vendor): add missing files add missing rollup configuration files #38 --- src/vendor/rollup-devexpress.config.js | 69 +++++++++++++++++ src/vendor/rollup-materialui-icons.config.js | 50 ++++++++++++ src/vendor/rollup-materialui.config.js | 80 ++++++++++++++++++++ src/vendor/rollup-mdi-material-ui.config.js | 49 ++++++++++++ 4 files changed, 248 insertions(+) create mode 100644 src/vendor/rollup-devexpress.config.js create mode 100644 src/vendor/rollup-materialui-icons.config.js create mode 100644 src/vendor/rollup-materialui.config.js create mode 100644 src/vendor/rollup-mdi-material-ui.config.js diff --git a/src/vendor/rollup-devexpress.config.js b/src/vendor/rollup-devexpress.config.js new file mode 100644 index 0000000..fb688d9 --- /dev/null +++ b/src/vendor/rollup-devexpress.config.js @@ -0,0 +1,69 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import resolve from '@rollup/plugin-node-resolve'; +import replace from '@rollup/plugin-replace'; +import typescript from '@rollup/plugin-typescript'; + +const isProd = process.env.NODE_ENV === 'production'; + +console.log('Production:', isProd); + +const exported = [ + { + name: '@devexpress/dx-react-core', + output: '@devexpress/dx-react-core', + external: ['react', 'react-is', 'react-dom', 'prop-types', '@material-ui/core', '@material-ui/styles'], + exports: { + 'react-dom': Object.keys(require('react-dom')), + '@devexpress/dx-react-core': Object.keys(require('@devexpress/dx-react-core')), + }, + }, + { + name: '@devexpress/dx-react-chart', + output: '@devexpress/dx-react-chart', + external: ['react', 'react-is', 'react-dom', 'prop-types', '@material-ui/core', '@material-ui/styles'], + exports: { + 'react-dom': Object.keys(require('react-dom')), + '@devexpress/dx-react-chart': Object.keys(require('@devexpress/dx-react-chart')), + }, + }, + { + name: '@devexpress/dx-react-chart-material-ui', + output: '@devexpress/dx-react-chart-material-ui', + external: ['react', 'react-is', 'react-dom', 'prop-types', '@material-ui/core', '@material-ui/styles'], + exports: { + 'react-dom': Object.keys(require('react-dom')), + '@devexpress/dx-react-chart-material-ui': Object.keys(require('@devexpress/dx-react-chart-material-ui')), + }, + }, +].map(({ name, external, output }) => ({ + input: `src/vendor/${name}/index.tsx`, + external, + output: [ + { + file: output ? `public/vendor/${output}.js` : `public/vendor/${name}.js`, + format: 'esm', // 'cjs' | 'umd' | 'iife' | 'es' | 'esm' + exports: 'named', + name, + sourcemap: isProd ? false : true, + }, + ], + plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify(isProd ? 'production' : 'development'), + }), + resolve({ + preferBuiltins: false, + }), + json(), + typescript({ + tsconfig: `src/vendor/${name}/tsconfig.json`, + }), + commonjs({ + include: ['node_modules/**'], + }), + ], +})); + +export default [...exported]; diff --git a/src/vendor/rollup-materialui-icons.config.js b/src/vendor/rollup-materialui-icons.config.js new file mode 100644 index 0000000..04ce619 --- /dev/null +++ b/src/vendor/rollup-materialui-icons.config.js @@ -0,0 +1,50 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import resolve from '@rollup/plugin-node-resolve'; +import replace from '@rollup/plugin-replace'; +import typescript from '@rollup/plugin-typescript'; + +const isProd = process.env.NODE_ENV === 'production'; + +console.log('Production:', isProd); + +const exported = [ + { + name: '@material-ui/icons', + output: '@material-ui/icons', + external: ['react', 'react-is', '@material-ui/styles', 'prop-types'], + exports: { + '@material-ui/icons': Object.keys(require('@material-ui/icons')), + }, + }, +].map(({ name, external, output }) => ({ + input: `src/vendor/${name}/index.tsx`, + external, + output: [ + { + file: output ? `public/vendor/${output}.js` : `public/vendor/${name}.js`, + format: 'esm', // 'cjs' | 'umd' | 'iife' | 'es' | 'esm' + exports: 'named', + name, + sourcemap: isProd ? false : true, + }, + ], + plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify(isProd ? 'production' : 'development'), + }), + resolve({ + preferBuiltins: false, + }), + json(), + typescript({ + tsconfig: `src/vendor/${name}/tsconfig.json`, + }), + commonjs({ + include: ['node_modules/**'], + }), + ], +})); + +export default [...exported]; diff --git a/src/vendor/rollup-materialui.config.js b/src/vendor/rollup-materialui.config.js new file mode 100644 index 0000000..08cc1ab --- /dev/null +++ b/src/vendor/rollup-materialui.config.js @@ -0,0 +1,80 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import resolve from '@rollup/plugin-node-resolve'; +import replace from '@rollup/plugin-replace'; +import typescript from '@rollup/plugin-typescript'; + +const isProd = process.env.NODE_ENV === 'production'; + +console.log('Production:', isProd); + +const exported = [ + { + name: '@material-ui/core', + output: '@material-ui/core', + external: ['react', 'react-is', 'react-dom', 'prop-types', '@material-ui/styles'], + exports: { + '@material-ui/core': Object.keys(require('@material-ui/core')), + }, + }, + { + name: '@material-ui/styles', + output: '@material-ui/styles', + external: ['react', 'react-is', 'prop-types'], + exports: { + '@material-ui/styles': Object.keys(require('@material-ui/styles')), + }, + }, + { + name: '@material-ui/lab', + output: '@material-ui/lab', + external: [ + 'react', + 'react-is', + 'react-dom', + 'prop-types', + '@material-ui/core', + '@material-ui/icons', + '@material-ui/styles', + ], + exports: { + '@material-ui/lab': Object.keys(require('@material-ui/lab')), + }, + }, + { + name: 'gsap', + external: [], + + exports: {}, + }, +].map(({ name, external, output }) => ({ + input: `src/vendor/${name}/index.tsx`, + external, + output: [ + { + file: output ? `public/vendor/${output}.js` : `public/vendor/${name}.js`, + format: 'esm', // 'cjs' | 'umd' | 'iife' | 'es' | 'esm' + exports: 'named', + name, + sourcemap: isProd ? false : true, + }, + ], + plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify(isProd ? 'production' : 'development'), + }), + resolve({ + preferBuiltins: false, + }), + json(), + typescript({ + tsconfig: `src/vendor/${name}/tsconfig.json`, + }), + commonjs({ + include: ['node_modules/**'], + }), + ], +})); + +export default [...exported]; diff --git a/src/vendor/rollup-mdi-material-ui.config.js b/src/vendor/rollup-mdi-material-ui.config.js new file mode 100644 index 0000000..179a62b --- /dev/null +++ b/src/vendor/rollup-mdi-material-ui.config.js @@ -0,0 +1,49 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import resolve from '@rollup/plugin-node-resolve'; +import replace from '@rollup/plugin-replace'; +import typescript from '@rollup/plugin-typescript'; + +const isProd = process.env.NODE_ENV === 'production'; + +console.log('Production:', isProd); + +const exported = [ + { + name: 'mdi-material-ui', + external: ['react', 'react-is', 'prop-types', '@material-ui/core', '@material-ui/styles'], + exports: { + 'mdi-material-ui': Object.keys(require('mdi-material-ui')), + }, + }, +].map(({ name, external, output }) => ({ + input: `src/vendor/${name}/index.tsx`, + external, + output: [ + { + file: output ? `public/vendor/${output}.js` : `public/vendor/${name}.js`, + format: 'esm', // 'cjs' | 'umd' | 'iife' | 'es' | 'esm' + exports: 'named', + name, + sourcemap: isProd ? false : true, + }, + ], + plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify(isProd ? 'production' : 'development'), + }), + resolve({ + preferBuiltins: false, + }), + json(), + typescript({ + tsconfig: `src/vendor/${name}/tsconfig.json`, + }), + commonjs({ + include: ['node_modules/**'], + }), + ], +})); + +export default [...exported]; From 838db0ab3c96e64e2eb29f3bbb040e72ba46f0b0 Mon Sep 17 00:00:00 2001 From: Gregor Anders Date: Tue, 16 Jun 2020 00:43:41 +0200 Subject: [PATCH 2/5] chore(release): bump version bump version to 0.0.10 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 901ee16..07e9e21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-react-playground", - "version": "0.0.9", + "version": "0.0.10", "description": "TypeScript React Playground", "scripts": { "start": "webpack-dev-server --open --progress --config webpack.config.js", From 87640ded6d3283cd8c8d7de0e4bb1f33debc57e1 Mon Sep 17 00:00:00 2001 From: Gregor Anders Date: Tue, 16 Jun 2020 00:44:04 +0200 Subject: [PATCH 3/5] docs(SECURITY): bump version bump version to 0.0.10 --- SECURITY.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 2476d4d..58e4715 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,8 +5,9 @@ ​ | Version | Supported | | ------- | ------------------ | -| 0.0.9 | :white_check_mark: | -| 0.0.8 | :white_check_mark: | +| 0.0.10 | :white_check_mark: | +| 0.0.9 | :x: | +| 0.0.8 | :x: | | 0.0.7 | :x: | | 0.0.6 | :x: | | 0.0.5 | :x: | From 870e0b485172f9de1caccf6b2d409115f8a5f948 Mon Sep 17 00:00:00 2001 From: Gregor Anders Date: Tue, 16 Jun 2020 00:46:13 +0200 Subject: [PATCH 4/5] chore(e2e): update update to 0.0.10 screenshots --- e2e/screenshots | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/screenshots b/e2e/screenshots index 1a8d8d2..a5f525f 160000 --- a/e2e/screenshots +++ b/e2e/screenshots @@ -1 +1 @@ -Subproject commit 1a8d8d2e8d86288221c22a702dd612bfce75d736 +Subproject commit a5f525f6f0ff01292fcd807f988a84efe82d69ed From b1c0b6fb7c078d7b2bd776915d9560e5b5dad7fd Mon Sep 17 00:00:00 2001 From: Gregor Anders Date: Tue, 16 Jun 2020 00:52:19 +0200 Subject: [PATCH 5/5] feat(materialui): add modules to importmap - add materialui modules to importmap - add devexpress react chart modules to importmap - add gsap module to importmap #38 --- public/importmap.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/public/importmap.json b/public/importmap.json index 0fc3ca5..6d298d6 100644 --- a/public/importmap.json +++ b/public/importmap.json @@ -2,6 +2,7 @@ "imports": { "clsx": "/ts-react-playground/vendor/clsx.js", "idb": "/ts-react-playground/vendor/idb.js", + "gsap": "/ts-react-playground/vendor/gsap.js", "faker": "/ts-react-playground/vendor/faker.js", "workbox-window": "/ts-react-playground/vendor/workbox-window.js", @@ -35,6 +36,17 @@ "@fortawesome/free-brands-svg-icons": "/ts-react-playground/vendor/@fortawesome/free-brands-svg-icons.js", "@fortawesome/react-fontawesome": "/ts-react-playground/vendor/@fortawesome/react-fontawesome.js", + "@material-ui/core": "/ts-react-playground/vendor/@material-ui/core.js", + "@material-ui/icons": "/ts-react-playground/vendor/@material-ui/icons.js", + "@material-ui/styles": "/ts-react-playground/vendor/@material-ui/styles.js", + "@material-ui/lab": "/ts-react-playground/vendor/@material-ui/lab.js", + + "mdi-material-ui": "/ts-react-playground/vendor/mdi-material-ui.js", + + "@devexpress/dx-react-core": "/ts-react-playground/vendor/@devexpress/dx-react-core.js", + "@devexpress/dx-react-chart": "/ts-react-playground/vendor/@devexpress/dx-react-chart.js", + "@devexpress/dx-react-chart-material-ui": "/ts-react-playground/vendor/@devexpress/dx-react-chart-material-ui.js", + "@app/index": "/ts-react-playground/script/index.js", "@app/application": "/ts-react-playground/script/application.js", "@app/loading": "/ts-react-playground/script/loading.js",