From f12ff60e922c1e7582d9c3aa0aafe393ea0996c8 Mon Sep 17 00:00:00 2001 From: Kesava Krishnan Madavan Date: Fri, 22 Nov 2024 12:01:26 +0530 Subject: [PATCH] chore(release): central cc widgets --- .../central-widgets/package.json | 40 +++++++++++++++++++ .../central-widgets/src/index.ts | 11 +++++ .../central-widgets/src/station-login.ts | 1 + .../central-widgets/src/store.ts | 1 + .../central-widgets/src/user-state.ts | 1 + .../central-widgets/tsconfig.json | 11 +++++ .../central-widgets/webpack.config.js | 12 ++++++ .../contact-center/station-login/package.json | 4 +- packages/contact-center/store/package.json | 4 +- .../contact-center/user-state/package.json | 4 +- tooling/src/publish.js | 3 ++ 11 files changed, 83 insertions(+), 9 deletions(-) create mode 100644 packages/contact-center/central-widgets/package.json create mode 100644 packages/contact-center/central-widgets/src/index.ts create mode 100644 packages/contact-center/central-widgets/src/station-login.ts create mode 100644 packages/contact-center/central-widgets/src/store.ts create mode 100644 packages/contact-center/central-widgets/src/user-state.ts create mode 100644 packages/contact-center/central-widgets/tsconfig.json create mode 100644 packages/contact-center/central-widgets/webpack.config.js diff --git a/packages/contact-center/central-widgets/package.json b/packages/contact-center/central-widgets/package.json new file mode 100644 index 00000000..9e4f482d --- /dev/null +++ b/packages/contact-center/central-widgets/package.json @@ -0,0 +1,40 @@ +{ + "name": "@webex/cc-widgets", + "description": "Webex Contact Center Widgets", + "version": "1.28.0-ccwidgets.1", + "main": "dist/index.js", + "publishConfig": { + "access": "public" + }, + "files": [ + "dist/", + "package.json" + ], + "scripts": { + "build": "yarn run -T tsc", + "build:src": "webpack && yarn run build" + }, + "devDependencies": { + "@webex/cc-store": "workspace:*", + "@webex/cc-station-login": "workspace:*", + "@webex/cc-user-state": "workspace:*", + "@babel/core": "7.25.2", + "@babel/preset-env": "7.25.4", + "@babel/preset-react": "7.24.7", + "@babel/preset-typescript": "7.25.9", + "@testing-library/dom": "10.4.0", + "@testing-library/jest-dom": "6.6.2", + "@testing-library/react": "16.0.1", + "@types/jest": "29.5.14", + "@types/react-test-renderer": "18", + "babel-jest": "29.7.0", + "babel-loader": "9.2.1", + "file-loader": "6.2.0", + "ts-loader": "9.5.1", + "typescript": "5.6.3", + "webpack": "5.94.0", + "webpack-cli": "5.1.4", + "webpack-merge": "6.0.1" + }, + "stableVersion": "1.0.0" +} diff --git a/packages/contact-center/central-widgets/src/index.ts b/packages/contact-center/central-widgets/src/index.ts new file mode 100644 index 00000000..98d1ae14 --- /dev/null +++ b/packages/contact-center/central-widgets/src/index.ts @@ -0,0 +1,11 @@ +import store from '@webex/cc-store' +import {StationLogin, WebStationLogin} from '@webex/cc-station-login'; +import {UserState, WebUserState} from '@webex/cc-user-state'; + +export { + store, + StationLogin, + WebStationLogin, + UserState, + WebUserState +} \ No newline at end of file diff --git a/packages/contact-center/central-widgets/src/station-login.ts b/packages/contact-center/central-widgets/src/station-login.ts new file mode 100644 index 00000000..7224748f --- /dev/null +++ b/packages/contact-center/central-widgets/src/station-login.ts @@ -0,0 +1 @@ +export * from '@webex/cc-station-login'; \ No newline at end of file diff --git a/packages/contact-center/central-widgets/src/store.ts b/packages/contact-center/central-widgets/src/store.ts new file mode 100644 index 00000000..e103e3f4 --- /dev/null +++ b/packages/contact-center/central-widgets/src/store.ts @@ -0,0 +1 @@ +export * from '@webex/cc-store'; \ No newline at end of file diff --git a/packages/contact-center/central-widgets/src/user-state.ts b/packages/contact-center/central-widgets/src/user-state.ts new file mode 100644 index 00000000..acab1078 --- /dev/null +++ b/packages/contact-center/central-widgets/src/user-state.ts @@ -0,0 +1 @@ +export * from '@webex/cc-user-state'; \ No newline at end of file diff --git a/packages/contact-center/central-widgets/tsconfig.json b/packages/contact-center/central-widgets/tsconfig.json new file mode 100644 index 00000000..50b68ce6 --- /dev/null +++ b/packages/contact-center/central-widgets/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.json", + "include": [ + "./src" + ], + "compilerOptions": { + "outDir": "./dist", + "declaration": true, + "declarationDir": "./dist/types" + }, +} \ No newline at end of file diff --git a/packages/contact-center/central-widgets/webpack.config.js b/packages/contact-center/central-widgets/webpack.config.js new file mode 100644 index 00000000..33a77150 --- /dev/null +++ b/packages/contact-center/central-widgets/webpack.config.js @@ -0,0 +1,12 @@ +const {merge} = require('webpack-merge'); +const path = require('path'); + +const baseConfig = require('../../../webpack.config'); + +module.exports = merge(baseConfig, { + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'index.js', // Set the output filename to index.js + libraryTarget: 'commonjs2', + } +}); diff --git a/packages/contact-center/station-login/package.json b/packages/contact-center/station-login/package.json index 43cc49cd..e4f4bfa9 100644 --- a/packages/contact-center/station-login/package.json +++ b/packages/contact-center/station-login/package.json @@ -3,9 +3,7 @@ "description": "Webex Contact Center Widgets: Station Login", "version": "1.28.0-ccwidgets.1", "main": "dist/index.js", - "publishConfig": { - "access": "public" - }, + "private": true, "files": [ "dist/", "package.json" diff --git a/packages/contact-center/store/package.json b/packages/contact-center/store/package.json index 61c70fb9..0daf43c1 100644 --- a/packages/contact-center/store/package.json +++ b/packages/contact-center/store/package.json @@ -4,9 +4,7 @@ "version": "1.28.0-ccwidgets.1", "main": "dist/index.js", "license": "MIT", - "publishConfig": { - "access": "public" - }, + "private": true, "files": [ "dist/", "package.json" diff --git a/packages/contact-center/user-state/package.json b/packages/contact-center/user-state/package.json index 4b494cef..074a8127 100644 --- a/packages/contact-center/user-state/package.json +++ b/packages/contact-center/user-state/package.json @@ -3,9 +3,7 @@ "description": "Webex Contact Center Widgets: User State", "version": "1.28.0-ccwidgets.1", "main": "dist/index.js", - "publishConfig": { - "access": "public" - }, + "private": true, "files": [ "dist/", "package.json" diff --git a/tooling/src/publish.js b/tooling/src/publish.js index 2a4bf926..a9c13c3f 100644 --- a/tooling/src/publish.js +++ b/tooling/src/publish.js @@ -40,6 +40,9 @@ function versionAndPublish() { try { const packageJsonPath = path.join(contactCenterPath, dirent.name, 'package.json'); const packageData = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); + if(packageData.private){ + return; + } console.log(`Removing stable version from package.json for ${dirent.name}`); removeStableVersion(packageJsonPath, packageData);