Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dependencies): added new dependencies in package #1267

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/node_modules/@webex/webex-sign-in-page/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/node_modules/@webex/widget-call-history/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/node_modules/@webex/widget-number-pad/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/node_modules/@webex/widget-voice-mail/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

258 changes: 88 additions & 170 deletions rollup.calling-config.js
Original file line number Diff line number Diff line change
@@ -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()],
},
];
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
};
Loading