From c4963eeb794e0978a46455ef37c38ab3c278cefb Mon Sep 17 00:00:00 2001 From: Eshank Vaish <48060426+eshankvaish@users.noreply.github.com> Date: Sun, 1 Dec 2024 11:58:24 +0530 Subject: [PATCH] feat: add support for manual chunking --- package-lock.json | 48 +++++++++++++++++++++++------------------------ package.json | 9 ++++----- vite.config.ts | 44 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 38d800c0d..993542d62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.6", + "version": "1.1.6-beta-2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.6", + "version": "1.1.6-beta-2", "license": "ISC", "dependencies": { "@types/react-dates": "^21.8.6", @@ -18,7 +18,6 @@ "marked": "^13.0.3", "react-dates": "^21.8.0", "react-diff-viewer-continued": "^3.4.0", - "react-monaco-editor": "^0.54.0", "sass": "^1.69.7", "tslib": "2.7.0" }, @@ -49,11 +48,8 @@ "husky": "^7.0.4", "lint-staged": "^12.5.0", "moment": "^2.29.4", - "monaco-editor": "0.44.0", - "monaco-yaml": "5.1.1", "prettier": "^3.1.1", "react-ga4": "^1.4.1", - "react-mde": "^11.5.0", "react-toastify": "9.1.3", "typescript": "5.5.4", "vite": "5.4.11", @@ -68,11 +64,14 @@ "@rjsf/validator-ajv8": "^5.13.3", "@typeform/embed-react": "2.20.0", "dompurify": "^3.0.2", + "monaco-editor": "0.44.0", + "monaco-yaml": "5.1.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-draggable": "^4.4.5", "react-ga4": "^1.4.1", "react-mde": "^11.5.0", + "react-monaco-editor": "^0.54.0", "react-router-dom": "^5.3.0", "react-select": "5.8.0", "rxjs": "^7.8.1", @@ -3140,7 +3139,7 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "peer": true }, "node_modules/@types/json5": { "version": "0.0.29", @@ -6965,7 +6964,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", - "dev": true + "peer": true }, "node_modules/jsonfile": { "version": "4.0.0", @@ -7544,13 +7543,14 @@ "node_modules/monaco-editor": { "version": "0.44.0", "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.44.0.tgz", - "integrity": "sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q==" + "integrity": "sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q==", + "peer": true }, "node_modules/monaco-languageserver-types": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/monaco-languageserver-types/-/monaco-languageserver-types-0.3.4.tgz", "integrity": "sha512-d58sP5yNhjs8uG1ESXs0hFnuX2YfdMhiGeWhdgTUZyG9aaWgyI4dDwrK1khf1mPF2u9Sljv42sfYqPFZnqYMYg==", - "dev": true, + "peer": true, "dependencies": { "monaco-types": "^0.1.0", "vscode-languageserver-protocol": "^3.0.0", @@ -7564,7 +7564,7 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/monaco-marker-data-provider/-/monaco-marker-data-provider-1.2.4.tgz", "integrity": "sha512-4DsPgsAqpTyUDs3humXRBPUJoihTv+L6v9aupQWD80X2YXaCXUd11mWYeSCYHuPgdUmjFaNWCEOjQ6ewf/QA1Q==", - "dev": true, + "peer": true, "dependencies": { "monaco-types": "^0.1.0" }, @@ -7576,7 +7576,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/monaco-types/-/monaco-types-0.1.0.tgz", "integrity": "sha512-aWK7SN9hAqNYi0WosPoMjenMeXJjwCxDibOqWffyQ/qXdzB/86xshGQobRferfmNz7BSNQ8GB0MD0oby9/5fTQ==", - "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/remcohaszing" } @@ -7585,7 +7585,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/monaco-worker-manager/-/monaco-worker-manager-2.0.1.tgz", "integrity": "sha512-kdPL0yvg5qjhKPNVjJoym331PY/5JC11aPJXtCZNwWRvBr6jhkIamvYAyiY5P1AWFmNOy0aRDRoMdZfa71h8kg==", - "dev": true, + "peer": true, "peerDependencies": { "monaco-editor": ">=0.30.0" } @@ -7594,7 +7594,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/monaco-yaml/-/monaco-yaml-5.1.1.tgz", "integrity": "sha512-BuZ0/ZCGjrPNRzYMZ/MoxH8F/SdM+mATENXnpOhDYABi1Eh+QvxSszEct+ACSCarZiwLvy7m6yEF/pvW8XJkyQ==", - "dev": true, + "peer": true, "workspaces": [ "examples/*" ], @@ -7623,7 +7623,7 @@ "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "dev": true, + "peer": true, "bin": { "prettier": "bin-prettier.js" }, @@ -7943,8 +7943,7 @@ "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, "node_modules/path-exists": { "version": "4.0.0", @@ -8362,7 +8361,7 @@ "version": "11.5.0", "resolved": "https://registry.npmjs.org/react-mde/-/react-mde-11.5.0.tgz", "integrity": "sha512-CH/VK6d+tpVjJ8rTXfh1dDt6GWedTgCU0668p8toqhAc3vy0Lu872O2RKYDSpkUrlbHI08fjUPTl++nExp6gag==", - "dev": true, + "peer": true, "peerDependencies": { "react": "^17.0.0", "react-dom": "^17.0.0" @@ -8383,6 +8382,7 @@ "version": "0.54.0", "resolved": "https://registry.npmjs.org/react-monaco-editor/-/react-monaco-editor-0.54.0.tgz", "integrity": "sha512-9JwO69851mfpuhYLHlKbae7omQWJ/2ICE2lbL0VHyNyZR8rCOH7440u+zAtDgiOMpLwmYdY1sEZCdRefywX6GQ==", + "peer": true, "dependencies": { "prop-types": "^15.8.1" }, @@ -10317,7 +10317,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", - "dev": true, + "peer": true, "engines": { "node": ">=14.0.0" } @@ -10326,7 +10326,7 @@ "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", - "dev": true, + "peer": true, "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" @@ -10336,19 +10336,18 @@ "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", - "dev": true + "peer": true }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", - "dev": true + "peer": true }, "node_modules/vscode-uri": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", - "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", - "dev": true + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" }, "node_modules/vue-tsc": { "version": "2.0.29", @@ -10587,6 +10586,7 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "peer": true, "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index da943b130..13496c1ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.1.6", + "version": "1.1.6-beta-2", "description": "Supporting common component library", "type": "module", "main": "dist/index.js", @@ -60,11 +60,8 @@ "husky": "^7.0.4", "lint-staged": "^12.5.0", "moment": "^2.29.4", - "monaco-editor": "0.44.0", - "monaco-yaml": "5.1.1", "prettier": "^3.1.1", "react-ga4": "^1.4.1", - "react-mde": "^11.5.0", "react-toastify": "9.1.3", "typescript": "5.5.4", "vite": "5.4.11", @@ -79,11 +76,14 @@ "@rjsf/validator-ajv8": "^5.13.3", "@typeform/embed-react": "2.20.0", "dompurify": "^3.0.2", + "monaco-editor": "0.44.0", + "monaco-yaml": "5.1.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-draggable": "^4.4.5", "react-ga4": "^1.4.1", "react-mde": "^11.5.0", + "react-monaco-editor": "^0.54.0", "react-router-dom": "^5.3.0", "react-select": "5.8.0", "rxjs": "^7.8.1", @@ -99,7 +99,6 @@ "jsonpath-plus": "^10.0.0", "react-dates": "^21.8.0", "react-diff-viewer-continued": "^3.4.0", - "react-monaco-editor": "^0.54.0", "sass": "^1.69.7", "tslib": "2.7.0" }, diff --git a/vite.config.ts b/vite.config.ts index 27c24e525..b969bcb98 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -51,6 +51,50 @@ export default defineConfig({ output: { assetFileNames: 'assets/[name][extname]', entryFileNames: '[name].js', + manualChunks(id: string) { + if ( + id.includes('/node_modules/monaco-editor') || + id.includes('/node_modules/react-monaco-editor') + ) { + return '@monaco-editor' + } + + if (id.includes('/node_modules/react-dates')) { + return '@react-dates' + } + + if (id.includes('/node_modules/framer-motion')) { + return '@framer-motion' + } + + if (id.includes('/node_modules/moment')) { + return '@moment' + } + + if (id.includes('/node_modules/react-select')) { + return '@react-select' + } + + if (id.includes('/node_modules/')) { + return '@vendor' + } + + if (id.includes('src/Common/CodeEditor')) { + return '@code-editor' + } + + if (id.includes('src/Common/RJSF')) { + return '@common-rjsf' + } + + if (id.includes('src/Assets/Icons')) { + return '@src-assets-icons' + } + + if (id.includes('src/Assets/Img')) { + return '@src-assets-images' + } + } }, }, },