From fef99a946fbce7b175d0bfa53c1f453039e13d73 Mon Sep 17 00:00:00 2001 From: Jenitha Inbaraj Date: Thu, 23 Feb 2023 12:57:34 +0530 Subject: [PATCH 1/3] fix(dependencies): added new dependencies in package --- .../@webex/webex-sign-in-page/package.json | 6 +- .../@webex/widget-call-history/package.json | 6 +- .../@webex/widget-number-pad/package.json | 6 +- .../@webex/widget-voice-mail/package.json | 6 +- rollup.calling-config.js | 258 ++++++------------ 5 files changed, 100 insertions(+), 182 deletions(-) diff --git a/packages/node_modules/@webex/webex-sign-in-page/package.json b/packages/node_modules/@webex/webex-sign-in-page/package.json index a90cbd101..8c9c1439e 100644 --- a/packages/node_modules/@webex/webex-sign-in-page/package.json +++ b/packages/node_modules/@webex/webex-sign-in-page/package.json @@ -1,9 +1,9 @@ { "name": "@webex/webex-sign-in-page", "description": "webex sign in page", - "main": "./dist/cjs/index.ts", - "src": "./src/index.ts", - "module": "./dist/es/index.ts", + "main": "dist/cjs/index.ts", + "src": "src/index.ts", + "module": "dist/es/index.ts", "keywords": [], "author": "devsupport@webex.com", "license": "MIT", diff --git a/packages/node_modules/@webex/widget-call-history/package.json b/packages/node_modules/@webex/widget-call-history/package.json index d2bde0676..89bee796f 100644 --- a/packages/node_modules/@webex/widget-call-history/package.json +++ b/packages/node_modules/@webex/widget-call-history/package.json @@ -1,9 +1,9 @@ { "name": "@webex/widget-call-history", "description": "widget call history", - "main": "./dist/cjs/index.ts", - "src": "./src/index.ts", - "module": "./dist/es/index.ts", + "main": "dist/cjs/index.ts", + "src": "src/index.ts", + "module": "dist/es/index.ts", "keywords": [], "author": "devsupport@webex.com", "license": "MIT", diff --git a/packages/node_modules/@webex/widget-number-pad/package.json b/packages/node_modules/@webex/widget-number-pad/package.json index faf534d7e..8df5474d3 100644 --- a/packages/node_modules/@webex/widget-number-pad/package.json +++ b/packages/node_modules/@webex/widget-number-pad/package.json @@ -1,9 +1,9 @@ { "name": "@webex/widget-number-pad", "description": "widget number pad", - "main": "./dist/cjs/index.ts", - "src": "./src/index.ts", - "module": "./dist/es/index.ts", + "main": "dist/cjs/index.ts", + "src": "src/index.ts", + "module": "dist/es/index.ts", "keywords": [], "author": "devsupport@webex.com", "license": "MIT", diff --git a/packages/node_modules/@webex/widget-voice-mail/package.json b/packages/node_modules/@webex/widget-voice-mail/package.json index 069f04996..f7260f0d9 100644 --- a/packages/node_modules/@webex/widget-voice-mail/package.json +++ b/packages/node_modules/@webex/widget-voice-mail/package.json @@ -1,9 +1,9 @@ { "name": "@webex/widget-voice-mail", "description": "widget voice mail", - "main": "./dist/cjs/index.ts", - "src": "./src/index.ts", - "module": "./dist/es/index.ts", + "main": "dist/cjs/index.ts", + "src": "src/index.ts", + "module": "dist/es/index.ts", "keywords": [], "author": "devsupport@webex.com", "license": "MIT", diff --git a/rollup.calling-config.js b/rollup.calling-config.js index a539c6f0a..3e61c5e99 100644 --- a/rollup.calling-config.js +++ b/rollup.calling-config.js @@ -1,174 +1,92 @@ -// import resolve from '@rollup/plugin-node-resolve'; -// import commonjs from '@rollup/plugin-commonjs'; -// // import typescript from 'rollup-plugin-typescript2'; -// import external from 'rollup-plugin-peer-deps-external'; -// // import dts from 'rollup-plugin-dts'; -// import visualizer from 'rollup-plugin-visualizer'; -// import license from 'rollup-plugin-license'; -// import del from 'rollup-plugin-delete'; -// import scss from 'rollup-plugin-scss'; -// import { terser } from 'rollup-plugin-terser'; -// import copy from 'rollup-plugin-copy'; -// // import typescript from 'typescript' -// // import ts from 'rollup-plugin-typescript2'; -// const packageJson = require('./packages/node_modules/@webex/widget-call-history/package.json'); +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +// import typescript from 'rollup-plugin-typescript2'; +import external from 'rollup-plugin-peer-deps-external'; +// import dts from 'rollup-plugin-dts'; +import visualizer from 'rollup-plugin-visualizer'; +import license from 'rollup-plugin-license'; +import del from 'rollup-plugin-delete'; +import scss from 'rollup-plugin-scss'; +import { terser } from 'rollup-plugin-terser'; +import copy from 'rollup-plugin-copy'; +// import typescript from 'typescript' +// import ts from 'rollup-plugin-typescript2'; +const packageJson = require('package.json'); +const moduleName = packageJson.name.replace('@', '').replace('/', '-'); -// const moduleName = packageJson.name.replace('@', '').replace('/', '-'); -// const outputFolderRootPath = './packages/node_modules/@webex/widget-call-history/'; -// // const packageJson = require('./packages/node_modules/@webex/widgets'); - - -// export default [ -// { -// input: packageJson.src, -// output: [ -// { -// file: packageJson.main, -// format: 'cjs', -// sourcemap: true, -// name: moduleName, -// }, -// { -// file: `${packageJson.main.slice(0, -3)}.min.js`, -// format: 'cjs', -// sourcemap: true, -// plugins: [terser()], -// }, -// { -// file: packageJson.module, -// format: 'esm', -// sourcemap: true, -// }, -// { -// file: `${packageJson.module.slice(0, -3)}.min.js`, -// format: 'esm', -// sourcemap: true, -// plugins: [terser()], -// }, -// ], -// plugins: [ -// del({ targets: outputFolderRootPath + 'dist/*' }), -// external(), -// resolve({ -// browser: true, -// }), -// commonjs(), -// // ts({ -// // typescript -// // }), -// // typescript({ -// // tsconfig: './tsconfig.json', -// // outputToFilesystem: true, -// // }), -// scss({ -// output: outputFolderRootPath + `dist/css/${moduleName}.css`, -// failOnError: true, -// }), -// copy({ -// targets: [ -// { src: 'src/localization/locales', dest: outputFolderRootPath + 'dist/cjs/' }, -// { -// src: 'src/localization/locales', -// dest: outputFolderRootPath + 'dist/esm/', -// }, -// ], -// }), -// license({ -// banner: ` -// Webex Calling -// Copyright (c) <%= new Date().toISOString() %> Cisco Systems, Inc and its affiliates. -// This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. -// `, -// }), -// visualizer({ -// filename: 'coverage/bundle-analysis-esm.html', -// title: 'Webex Calling Components ESM Bundle Analysis', -// }), -// ], -// }, -// // /* Rollup Types */ -// // { -// // input: outputFolderRootPath + 'esm/src/index.d.ts', -// // output: [{ file: outputFolderRootPath + 'dist/esm/src/index.ts', format: 'esm' }], -// // external: [/\.css$/, /\.scss$/], -// // plugins: [dts()], -// // }, -// ]; - - -import babel from 'rollup-plugin-babel'; -import url from '@rollup/plugin-url'; -import clear from 'rollup-plugin-clear'; -import postcss from 'rollup-plugin-postcss'; -import localResolve from 'rollup-plugin-local-resolve'; -import {base64} from '@webex/common'; - -export default { - plugins: [ - // Clears the destination directory before building - clear({ - // required, point out which directories should be clear. - targets: ['es'] - }), - // Finds the index.js file when importing via folder - localResolve(), - // Convert css to css modules - postcss({ - modules: { - generateScopedName: (name, filename, css) => { - const cssHash = base64.encode(css).substring(0, 8); - const paths = filename.split('/'); - const index = paths.indexOf('widget-call-history'); - let componentName; - - if (index !== -1) { - componentName = paths[index + 1]; - } - else { - componentName = filename; - } - - return `${componentName}__${name}__${cssHash}`; - } +export default [ + { + input: packageJson.src, + output: [ + { + file: packageJson.main, + format: 'cjs', + sourcemap: true, + name: moduleName, + }, + { + file: `${packageJson.main.slice(0, -3)}.min.js`, + format: 'cjs', + sourcemap: true, + plugins: [terser()], + }, + { + file: packageJson.module, + format: 'esm', + sourcemap: true, }, - // Don't use sass loader due to momentum-ui issues - use: [], - config: false - }), - // Inline images - url({ - limit: 100 * 1024 // inline files < 100k, copy files > 100k - }), - // Audio files for ringtones - url({ - limit: 0, - include: ['**/*.mp3'] - }), - babel({ - babelrc: false, - exclude: 'node_modules/**', - plugins: [ - [ - // Support for @autobind decorators - '@babel/plugin-proposal-decorators', + { + file: `${packageJson.module.slice(0, -3)}.min.js`, + format: 'esm', + sourcemap: true, + plugins: [terser()], + }, + ], + plugins: [ + del({ targets: 'dist/*' }), + external(), + resolve({ + browser: true, + }), + commonjs(), + ts({ + typescript + }), + typescript({ + tsconfig: './tsconfig.json', + outputToFilesystem: true, + }), + scss({ + output: `dist/css/${moduleName}.css`, + failOnError: true, + }), + copy({ + targets: [ + { src: 'src/localization/locales', dest: 'dist/cjs/' }, { - legacy: true - } + src: 'src/localization/locales', + dest: 'dist/esm/', + }, ], - '@babel/plugin-proposal-nullish-coalescing-operator', - '@babel/plugin-proposal-optional-chaining' - ], - presets: [ - '@babel/preset-react' - ] - }) - ], - input: 'src/index.ts', - output: [{ - dir: 'es', - format: 'esm', - sourcemap: true - }], - external: ['react', 'react-dom', 'prop-types', 'classnames', '@momentum-ui/react'] -}; - + }), + license({ + banner: ` + Webex Calling + Copyright (c) <%= new Date().toISOString() %> Cisco Systems, Inc and its affiliates. + This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. + `, + }), + visualizer({ + filename: 'coverage/bundle-analysis-esm.html', + title: 'Webex Calling Components ESM Bundle Analysis', + }), + ], + }, + /* Rollup Types */ + { + input: 'esm/src/index.d.ts', + output: [{ file: 'dist/esm/src/index.ts', format: 'esm' }], + external: [/\.css$/, /\.scss$/], + plugins: [dts()], + }, +]; From 21232c80f6101dac7c0f827f68f1d3a8effe3fd0 Mon Sep 17 00:00:00 2001 From: Jenitha Inbaraj Date: Thu, 23 Feb 2023 14:21:59 +0530 Subject: [PATCH 2/3] fix(dependencies): added new dependencies in package --- rollup.config.js | 2 +- scripts/webpack/webpack.base.babel.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 4891cafab..1de975415 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -71,5 +71,5 @@ export default { format: 'esm', sourcemap: true }], - external: ['react', 'react-dom', 'prop-types', 'classnames', '@momentum-ui/react'] + external: ['react', 'react-dom', 'prop-types', 'classnames', '@momentum-ui/react', '@momentum-ui/react-collaboration'] }; diff --git a/scripts/webpack/webpack.base.babel.js b/scripts/webpack/webpack.base.babel.js index b0c14032c..0a789ed84 100644 --- a/scripts/webpack/webpack.base.babel.js +++ b/scripts/webpack/webpack.base.babel.js @@ -136,6 +136,10 @@ module.exports = (options, env) => { path.resolve(__dirname, '..', '..', 'packages', 'node_modules'), path.resolve(__dirname, '..', '..', 'samples') ], + exclude: [ + path.resolve(__dirname, '..', '..', 'packages', 'node_modules','@momentum-ui','react-collaboration'), + path.resolve(__dirname, '..', '..', 'packages', 'node_modules','@momentum-ui/react-collaboration') + ], use: [ { // Adding sass converted files to our main.css does not work on IE/Edge From d12fac1617410dc61e3e049a3796f5f3247dc097 Mon Sep 17 00:00:00 2001 From: Jenitha Inbaraj Date: Thu, 23 Feb 2023 14:46:30 +0530 Subject: [PATCH 3/3] fix(dependencies): added new dependencies in package --- package-lock.json | 22 ---------------------- scripts/webpack/webpack.base.babel.js | 8 ++++++++ 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03b82b211..98b1212e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3384,7 +3384,6 @@ "react-aria": "^3.10.0", "react-aria-modal": "^2.11.1", "react-focus-lock": "^1.19.1", - "react-toastify": "^9.0.8", "react-uid": "^2.2.0", "react-verification-input": "^2.0.1", "sass": "1.49.9", @@ -48861,18 +48860,6 @@ "object-assign": "^4.1.1" } }, - "node_modules/react-toastify": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.1.tgz", - "integrity": "sha512-pkFCla1z3ve045qvjEmn2xOJOy4ZciwRXm1oMPULVkELi5aJdHCN/FHnuqXq8IwGDLB7PPk2/J6uP9D8ejuiRw==", - "dependencies": { - "clsx": "^1.1.1" - }, - "peerDependencies": { - "react": ">=16", - "react-dom": ">=16" - } - }, "node_modules/react-transform-hmr": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/react-transform-hmr/-/react-transform-hmr-1.0.4.tgz", @@ -60905,7 +60892,6 @@ "react-aria": "^3.10.0", "react-aria-modal": "^2.11.1", "react-focus-lock": "^1.19.1", - "react-toastify": "^9.0.8", "react-uid": "^2.2.0", "react-verification-input": "^2.0.1", "sass": "1.49.9", @@ -96794,14 +96780,6 @@ } } }, - "react-toastify": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-9.1.1.tgz", - "integrity": "sha512-pkFCla1z3ve045qvjEmn2xOJOy4ZciwRXm1oMPULVkELi5aJdHCN/FHnuqXq8IwGDLB7PPk2/J6uP9D8ejuiRw==", - "requires": { - "clsx": "^1.1.1" - } - }, "react-transform-hmr": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/react-transform-hmr/-/react-transform-hmr-1.0.4.tgz", diff --git a/scripts/webpack/webpack.base.babel.js b/scripts/webpack/webpack.base.babel.js index 0a789ed84..5de9a9021 100644 --- a/scripts/webpack/webpack.base.babel.js +++ b/scripts/webpack/webpack.base.babel.js @@ -97,6 +97,10 @@ module.exports = (options, env) => { include: [ path.resolve(__dirname, '..', '..', 'packages', 'node_modules') ], + exclude: [ + path.resolve(__dirname, '..', '..', 'packages', 'node_modules','@momentum-ui','react-collaboration'), + path.resolve(__dirname, '..', '..', 'packages', 'node_modules','@momentum-ui/react-collaboration') + ], use: [ { loader: MiniCssExtractPlugin.loader @@ -128,6 +132,10 @@ module.exports = (options, env) => { // Do not transform vendor`s CSS with CSS-modules test: /\.css$/, include: [path.resolve(__dirname, '..', '..', 'node_modules')], + exclude: [ + path.resolve(__dirname, '..', '..', 'packages', 'node_modules','@momentum-ui','react-collaboration'), + path.resolve(__dirname, '..', '..', 'packages', 'node_modules','@momentum-ui/react-collaboration') + ], use: ['style-loader', 'css-loader'] }, {