From 6cbb7c6a934a8b4f86090fc9b59fef9f77d9725c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Ravent=C3=B3s?= <36898236+Iru89@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:32:02 +0100 Subject: [PATCH] dx-bundler-rspack: create a dx package to build with rspack #BLT-1197 (#2934) ## Description Create a new dx package that has the dependencies to build a project using as bundler rspack It also contains a file rspack.config.ts. As explained in the README you have to copy this file to the root of the botonic project. ## Context In the README you can also see the scripts to use rspack to build the project locally or to make a builder for production. --- package-lock.json | 1579 +++++++++++++++-- packages/botonic-dx-bundler-rspack/.gitignore | 3 + packages/botonic-dx-bundler-rspack/README.md | 31 + .../baseline/rspack.config.ts | 380 ++++ .../botonic-dx-bundler-rspack/package.json | 34 + .../botonic-dx-bundler-rspack/tsconfig.json | 6 + 6 files changed, 1843 insertions(+), 190 deletions(-) create mode 100644 packages/botonic-dx-bundler-rspack/.gitignore create mode 100644 packages/botonic-dx-bundler-rspack/README.md create mode 100644 packages/botonic-dx-bundler-rspack/baseline/rspack.config.ts create mode 100644 packages/botonic-dx-bundler-rspack/package.json create mode 100644 packages/botonic-dx-bundler-rspack/tsconfig.json diff --git a/package-lock.json b/package-lock.json index 166a36b0c5..35cfc4a15a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1828,6 +1828,10 @@ "resolved": "packages/botonic-dx", "link": true }, + "node_modules/@botonic/dx-bundler-rspack": { + "resolved": "packages/botonic-dx-bundler-rspack", + "link": true + }, "node_modules/@botonic/eslint-config": { "resolved": "packages/botonic-eslint-config", "link": true @@ -3062,6 +3066,37 @@ "version": "2.0.5", "license": "MIT" }, + "node_modules/@module-federation/runtime": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@module-federation/runtime/-/runtime-0.5.1.tgz", + "integrity": "sha512-xgiMUWwGLWDrvZc9JibuEbXIbhXg6z2oUkemogSvQ4LKvrl/n0kbqP1Blk669mXzyWbqtSp6PpvNdwaE1aN5xQ==", + "dependencies": { + "@module-federation/sdk": "0.5.1" + } + }, + "node_modules/@module-federation/runtime-tools": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@module-federation/runtime-tools/-/runtime-tools-0.5.1.tgz", + "integrity": "sha512-nfBedkoZ3/SWyO0hnmaxuz0R0iGPSikHZOAZ0N/dVSQaIzlffUo35B5nlC2wgWIc0JdMZfkwkjZRrnuuDIJbzg==", + "dependencies": { + "@module-federation/runtime": "0.5.1", + "@module-federation/webpack-bundler-runtime": "0.5.1" + } + }, + "node_modules/@module-federation/sdk": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@module-federation/sdk/-/sdk-0.5.1.tgz", + "integrity": "sha512-exvchtjNURJJkpqjQ3/opdbfeT2wPKvrbnGnyRkrwW5o3FH1LaST1tkiNviT6OXTexGaVc2DahbdniQHVtQ7pA==" + }, + "node_modules/@module-federation/webpack-bundler-runtime": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@module-federation/webpack-bundler-runtime/-/webpack-bundler-runtime-0.5.1.tgz", + "integrity": "sha512-mMhRFH0k2VjwHt3Jol9JkUsmI/4XlrAoBG3E0o7HoyoPYv1UFOWyqAflfANcUPgbYpvqmyLzDcO+3IT36LXnrA==", + "dependencies": { + "@module-federation/runtime": "0.5.1", + "@module-federation/sdk": "0.5.1" + } + }, "node_modules/@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.3", "dev": true, @@ -3875,6 +3910,11 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@polka/url": { + "version": "1.0.0-next.28", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.28.tgz", + "integrity": "sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==" + }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "license": "BSD-3-Clause" @@ -3919,192 +3959,911 @@ "version": "1.1.0", "license": "BSD-3-Clause" }, - "node_modules/@rtsao/scc": { + "node_modules/@rspack/binding": { "version": "1.1.0", - "license": "MIT" - }, - "node_modules/@samverschueren/stream-to-observable": { - "version": "0.3.1", - "license": "MIT", - "dependencies": { - "any-observable": "^0.3.0" - }, - "engines": { - "node": ">=6" - }, - "peerDependenciesMeta": { - "rxjs": { - "optional": true - }, - "zen-observable": { - "optional": true - } - } + "resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-1.1.0.tgz", + "integrity": "sha512-zLduWacrw/bBYiFvhjN70f+AJxXnTzevywXp54vso8d0Nz7z4KIycdz/Ua5AGRUkG2ZuQw6waypN5pXf48EBcA==", + "optionalDependencies": { + "@rspack/binding-darwin-arm64": "1.1.0", + "@rspack/binding-darwin-x64": "1.1.0", + "@rspack/binding-linux-arm64-gnu": "1.1.0", + "@rspack/binding-linux-arm64-musl": "1.1.0", + "@rspack/binding-linux-x64-gnu": "1.1.0", + "@rspack/binding-linux-x64-musl": "1.1.0", + "@rspack/binding-win32-arm64-msvc": "1.1.0", + "@rspack/binding-win32-ia32-msvc": "1.1.0", + "@rspack/binding-win32-x64-msvc": "1.1.0" + } + }, + "node_modules/@rspack/binding-darwin-arm64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-1.1.0.tgz", + "integrity": "sha512-02YmzmtKMNHCSMzVT5sgbJuPDn+HunkrtWq0D95Fh9sGKYap9cs0JOpzTfyAL3KXJ9JzVfOAZA3VgVQOBaQNWQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/@segment/loosely-validate-event": { - "version": "2.0.0", - "dependencies": { - "component-type": "^1.2.1", - "join-component": "^1.1.0" - } + "node_modules/@rspack/binding-darwin-x64": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-1.1.0.tgz", + "integrity": "sha512-HtBh8p6hml7BWNtZaqWFtGbOFP/tvFDn1uPWmA3R32WTILUXNRWXIsLDY95U3Z2U1Gt3SL58SOpJjXlFIb6wZg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/@sideway/address": { - "version": "4.1.5", - "license": "BSD-3-Clause", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } + "node_modules/@rspack/binding-linux-arm64-gnu": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.0.tgz", + "integrity": "sha512-Q/i50Pieii3akdv5Q6my6QelV5Dpc8O/Ir4udpjYl0pbSdKamdI8M85fxrMxGAGcoNSD+X52fDvxJujXWMcP0w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@sideway/address/node_modules/@hapi/hoek": { - "version": "9.3.0", - "license": "BSD-3-Clause" + "node_modules/@rspack/binding-linux-arm64-musl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.0.tgz", + "integrity": "sha512-H7Eu3xC7LWPpxrI47n8X361eEGGpQOjZIWTz8tLdn4oNS2D9kqsBYES7LsuuLTTH4ueHTDuEtDdfZpBsE+qesw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@sideway/formula": { - "version": "3.0.1", - "license": "BSD-3-Clause" + "node_modules/@rspack/binding-linux-x64-gnu": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.0.tgz", + "integrity": "sha512-dIZSutPo2z/OaO2f6SVlcYA6lGBH+4TrRtWmMyPshpTNPrkCGGfDhC43fZ4jCiUj2PO/Hcn8jyKhci4leBsVBA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@sideway/pinpoint": { - "version": "2.0.0", - "license": "BSD-3-Clause" + "node_modules/@rspack/binding-linux-x64-musl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.0.tgz", + "integrity": "sha512-f6L2JWgbG9PKWnVw2YNZdntjzia1V2w2Xq458HkCQUDwhnEipWXaZ2zhfD9jcb4UYoMP8/2uD3B96sSFFNTdrQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "license": "MIT" + "node_modules/@rspack/binding-win32-arm64-msvc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.0.tgz", + "integrity": "sha512-opo6XR4iXh/QkHiauVQBlU2xR2JyjDmSwgkION27oszu81nr+IajTSXQX96x5I6Bq48GQLU4rItHse/doctQDA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@sindresorhus/is": { - "version": "0.7.0", - "license": "MIT", - "engines": { - "node": ">=4" - } + "node_modules/@rspack/binding-win32-ia32-msvc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.1.0.tgz", + "integrity": "sha512-FBcG+OPJokSE3nPi1+ZamLK2V4IWdNC+GMr0z7LUrBiKc5lO70y5VkldfyPV1Z+doSuroVINlhK+lRHdQgGwYg==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@sinonjs/commons": { - "version": "3.0.1", - "license": "BSD-3-Clause", - "dependencies": { - "type-detect": "4.0.8" - } + "node_modules/@rspack/binding-win32-x64-msvc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.0.tgz", + "integrity": "sha512-H/6Glp1nZvxWAD5+2hRrp1kBs9f+pLb/un2TdFSUNd2tyXq5GyHCe70+N9psbe/jjGxD8e1vPNQtN/VvkuR0Zg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "license": "BSD-3-Clause", + "node_modules/@rspack/cli": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/cli/-/cli-1.1.0.tgz", + "integrity": "sha512-+xUJhXyJ0gwP/5cNlXIiETZySUXOXiYf8DKPPHQcSf8MuTXnseX5tdC2mhbdHkaYuni9MqlBD+1ppyuvl/49sw==", "dependencies": { - "@sinonjs/commons": "^3.0.0" + "@discoveryjs/json-ext": "^0.5.7", + "@rspack/dev-server": "1.0.9", + "colorette": "2.0.19", + "exit-hook": "^4.0.0", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "semver": "^7.6.2", + "webpack-bundle-analyzer": "4.6.1", + "yargs": "17.6.2" + }, + "bin": { + "rspack": "bin/rspack.js" + }, + "peerDependencies": { + "@rspack/core": "^1.0.0-alpha || ^1.x" } }, - "node_modules/@testing-library/dom": { - "version": "8.20.1", - "dev": true, - "license": "MIT", + "node_modules/@rspack/cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^5.0.1", - "aria-query": "5.1.3", - "chalk": "^4.1.0", - "dom-accessibility-api": "^0.5.9", - "lz-string": "^1.5.0", - "pretty-format": "^27.0.2" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { "node": ">=12" } }, - "node_modules/@testing-library/dom/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, + "node_modules/@rspack/cli/node_modules/colorette": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", + "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" + }, + "node_modules/@rspack/cli/node_modules/exit-hook": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-4.0.0.tgz", + "integrity": "sha512-Fqs7ChZm72y40wKjOFXBKg7nJZvQJmewP5/7LtePDdnah/+FH9Hp5sgMujSCMPXlxOAW2//1jrW9pnsY7o20vQ==", "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@testing-library/dom/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "node_modules/@rspack/cli/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@testing-library/dom/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", + "node_modules/@rspack/cli/node_modules/yargs": { + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "dependencies": { - "color-name": "~1.1.4" + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=7.0.0" + "node": ">=12" } }, - "node_modules/@testing-library/dom/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/@testing-library/dom/node_modules/has-flag": { - "version": "4.0.0", - "dev": true, - "license": "MIT", + "node_modules/@rspack/core": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rspack/core/-/core-1.1.0.tgz", + "integrity": "sha512-+IYWSe9D3wB97VVBfaojuWLv3wGIBe9pfJkxNObkorN60Nj3UHYzBLuACrHn4hW2mZjAWrv06ReHXJUEGzQqaQ==", + "dependencies": { + "@module-federation/runtime-tools": "0.5.1", + "@rspack/binding": "1.1.0", + "@rspack/lite-tapable": "1.0.1", + "caniuse-lite": "^1.0.30001616" + }, "engines": { - "node": ">=8" + "node": ">=16.0.0" + }, + "peerDependencies": { + "@swc/helpers": ">=0.5.1" + }, + "peerDependenciesMeta": { + "@swc/helpers": { + "optional": true + } } }, - "node_modules/@testing-library/dom/node_modules/pretty-format": { - "version": "27.5.1", - "dev": true, - "license": "MIT", + "node_modules/@rspack/dev-server": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@rspack/dev-server/-/dev-server-1.0.9.tgz", + "integrity": "sha512-VF+apLFfl5LWIhVbfkJ5ccU0Atl5mi+sGTkx+XtE1tbUmMJkde0nm/4+eaQCud7oGl+ZCzt4kW14uuzLSiEGDw==", "dependencies": { - "ansi-regex": "^5.0.1", - "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" + "chokidar": "^3.6.0", + "connect-history-api-fallback": "^2.0.0", + "express": "^4.19.2", + "http-proxy-middleware": "^2.0.6", + "mime-types": "^2.1.35", + "p-retry": "4.6.2", + "webpack-dev-middleware": "^7.4.2", + "webpack-dev-server": "5.0.4", + "ws": "^8.16.0" }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "peerDependencies": { + "@rspack/core": "*" } }, - "node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/ansi-styles": { - "version": "5.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" + "node_modules/@rspack/dev-server/node_modules/@types/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" + }, + "node_modules/@rspack/dev-server/node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@testing-library/dom/node_modules/react-is": { - "version": "17.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/@testing-library/dom/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", + "node_modules/@rspack/dev-server/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", "dependencies": { - "has-flag": "^4.0.0" + "fast-deep-equal": "^3.1.3" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "ajv": "^8.8.2" } }, - "node_modules/@testing-library/react": { - "version": "12.1.5", + "node_modules/@rspack/dev-server/node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@rspack/dev-server/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@rspack/dev-server/node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@rspack/dev-server/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/@rspack/dev-server/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@rspack/dev-server/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/@rspack/dev-server/node_modules/open": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", + "dependencies": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@rspack/dev-server/node_modules/p-retry": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz", + "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==", + "dependencies": { + "@types/retry": "0.12.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@rspack/dev-server/node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@rspack/dev-server/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/@rspack/dev-server/node_modules/webpack-dev-server": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.0.4.tgz", + "integrity": "sha512-dljXhUgx3HqKP2d8J/fUMvhxGhzjeNVarDLcbO/EWMSgRizDkxHQDZQaLFL5VJY9tRBj2Gz+rvCEYYvhbqPHNA==", + "dependencies": { + "@types/bonjour": "^3.5.13", + "@types/connect-history-api-fallback": "^1.5.4", + "@types/express": "^4.17.21", + "@types/serve-index": "^1.9.4", + "@types/serve-static": "^1.15.5", + "@types/sockjs": "^0.3.36", + "@types/ws": "^8.5.10", + "ansi-html-community": "^0.0.8", + "bonjour-service": "^1.2.1", + "chokidar": "^3.6.0", + "colorette": "^2.0.10", + "compression": "^1.7.4", + "connect-history-api-fallback": "^2.0.0", + "default-gateway": "^6.0.3", + "express": "^4.17.3", + "graceful-fs": "^4.2.6", + "html-entities": "^2.4.0", + "http-proxy-middleware": "^2.0.3", + "ipaddr.js": "^2.1.0", + "launch-editor": "^2.6.1", + "open": "^10.0.3", + "p-retry": "^6.2.0", + "rimraf": "^5.0.5", + "schema-utils": "^4.2.0", + "selfsigned": "^2.4.1", + "serve-index": "^1.9.1", + "sockjs": "^0.3.24", + "spdy": "^4.0.2", + "webpack-dev-middleware": "^7.1.0", + "ws": "^8.16.0" + }, + "bin": { + "webpack-dev-server": "bin/webpack-dev-server.js" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + }, + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/@rspack/dev-server/node_modules/webpack-dev-server/node_modules/@types/retry": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.2.tgz", + "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==" + }, + "node_modules/@rspack/dev-server/node_modules/webpack-dev-server/node_modules/p-retry": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz", + "integrity": "sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA==", + "dependencies": { + "@types/retry": "0.12.2", + "is-network-error": "^1.0.0", + "retry": "^0.13.1" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@rspack/lite-tapable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rspack/lite-tapable/-/lite-tapable-1.0.1.tgz", + "integrity": "sha512-VynGOEsVw2s8TAlLf/uESfrgfrq2+rcXB1muPJYBWbsm1Oa6r5qVQhjA5ggM6z/coYPrsVMgovl3Ff7Q7OCp1w==", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@rspack/plugin-react-refresh": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rspack/plugin-react-refresh/-/plugin-react-refresh-1.0.0.tgz", + "integrity": "sha512-WvXkLewW5G0Mlo5H1b251yDh5FFiH4NDAbYlFpvFjcuXX2AchZRf9zdw57BDE/ADyWsJgA8kixN/zZWBTN3iYA==", + "dependencies": { + "error-stack-parser": "^2.0.6", + "html-entities": "^2.1.0" + }, + "peerDependencies": { + "react-refresh": ">=0.10.0 <1.0.0" + }, + "peerDependenciesMeta": { + "react-refresh": { + "optional": true + } + } + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "license": "MIT" + }, + "node_modules/@samverschueren/stream-to-observable": { + "version": "0.3.1", + "license": "MIT", + "dependencies": { + "any-observable": "^0.3.0" + }, + "engines": { + "node": ">=6" + }, + "peerDependenciesMeta": { + "rxjs": { + "optional": true + }, + "zen-observable": { + "optional": true + } + } + }, + "node_modules/@segment/loosely-validate-event": { + "version": "2.0.0", + "dependencies": { + "component-type": "^1.2.1", + "join-component": "^1.1.0" + } + }, + "node_modules/@sideway/address": { + "version": "4.1.5", + "license": "BSD-3-Clause", + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/address/node_modules/@hapi/hoek": { + "version": "9.3.0", + "license": "BSD-3-Clause" + }, + "node_modules/@sideway/formula": { + "version": "3.0.1", + "license": "BSD-3-Clause" + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "license": "BSD-3-Clause" + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "license": "MIT" + }, + "node_modules/@sindresorhus/is": { + "version": "0.7.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "license": "BSD-3-Clause", + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@swc/core": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.9.1.tgz", + "integrity": "sha512-OnPc+Kt5oy3xTvr/KCUOqE9ptJcWbyQgAUr1ydh9EmbBcmJTaO1kfQCxm/axzJi6sKeDTxL9rX5zvLOhoYIaQw==", + "hasInstallScript": true, + "dependencies": { + "@swc/counter": "^0.1.3", + "@swc/types": "^0.1.14" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/swc" + }, + "optionalDependencies": { + "@swc/core-darwin-arm64": "1.9.1", + "@swc/core-darwin-x64": "1.9.1", + "@swc/core-linux-arm-gnueabihf": "1.9.1", + "@swc/core-linux-arm64-gnu": "1.9.1", + "@swc/core-linux-arm64-musl": "1.9.1", + "@swc/core-linux-x64-gnu": "1.9.1", + "@swc/core-linux-x64-musl": "1.9.1", + "@swc/core-win32-arm64-msvc": "1.9.1", + "@swc/core-win32-ia32-msvc": "1.9.1", + "@swc/core-win32-x64-msvc": "1.9.1" + }, + "peerDependencies": { + "@swc/helpers": "*" + }, + "peerDependenciesMeta": { + "@swc/helpers": { + "optional": true + } + } + }, + "node_modules/@swc/core-darwin-arm64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.9.1.tgz", + "integrity": "sha512-2/ncHSCdAh5OHem1fMITrWEzzl97OdMK1PHc9CkxSJnphLjRubfxB5sbc5tDhcO68a5tVy+DxwaBgDec3PXnOg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-darwin-x64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.9.1.tgz", + "integrity": "sha512-4MDOFC5zmNqRJ9RGFOH95oYf27J9HniLVpB1pYm2gGeNHdl2QvDMtx2QTuMHQ6+OTn/3y1BHYuhBGp7d405oLA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm-gnueabihf": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.9.1.tgz", + "integrity": "sha512-eVW/BjRW8/HpLe3+1jRU7w7PdRLBgnEEYTkHJISU8805/EKT03xNZn6CfaBpKfeAloY4043hbGzE/NP9IahdpQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.9.1.tgz", + "integrity": "sha512-8m3u1v8R8NgI/9+cHMkzk14w87blSy3OsQPWPfhOL+XPwhyLPvat+ahQJb2nZmltjTgkB4IbzKFSfbuA34LmNA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-musl": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.9.1.tgz", + "integrity": "sha512-hpT0sQAZnW8l02I289yeyFfT9llGO9PzKDxUq8pocKtioEHiElRqR53juCWoSmzuWi+6KX7zUJ0NKCBrc8pmDg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.9.1.tgz", + "integrity": "sha512-sGFdpdAYusk/ropHiwtXom2JrdaKPxl8MqemRv6dvxZq1Gm/GdmOowxdXIPjCgBGMgoXVcgNviH6CgiO5q+UtA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-musl": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.9.1.tgz", + "integrity": "sha512-YtNLNwIWs0Z2+XgBs6+LrCIGtfCDtNr4S4b6Q5HDOreEIGzSvhkef8eyBI5L+fJ2eGov4b7iEo61C4izDJS5RA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-arm64-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.9.1.tgz", + "integrity": "sha512-qSxD3uZW2vSiHqUt30vUi0PB92zDh9bjqh5YKpfhhVa7h1vt/xXhlid8yMvSNToTfzhRrTEffOAPUr7WVoyQUA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-ia32-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.9.1.tgz", + "integrity": "sha512-C3fPEwyX/WRPlX6zIToNykJuz1JkZX0sk8H1QH2vpnKuySUkt/Ur5K2FzLgSWzJdbfxstpgS151/es0VGAD+ZA==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-x64-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.9.1.tgz", + "integrity": "sha512-2XZ+U1AyVsOAXeH6WK1syDm7+gwTjA8fShs93WcbxnK7HV+NigDlvr4124CeJLTHyh3fMh1o7+CnQnaBJhlysQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==" + }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@swc/types": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.14.tgz", + "integrity": "sha512-PbSmTiYCN+GMrvfjrMo9bdY+f2COnwbdnoMw7rqU/PI5jXpKjxOGZ0qqZCImxnT81NkNsKnmEpvu+hRXLBeCJg==", + "dependencies": { + "@swc/counter": "^0.1.3" + } + }, + "node_modules/@testing-library/dom": { + "version": "8.20.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.1.3", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@testing-library/dom/node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/chalk": { + "version": "4.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@testing-library/dom/node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@testing-library/dom/node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/dom/node_modules/pretty-format": { + "version": "27.5.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/react-is": { + "version": "17.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@testing-library/dom/node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/react": { + "version": "12.1.5", "dev": true, "license": "MIT", "dependencies": { @@ -10064,6 +10823,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/default-gateway": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", + "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + "dependencies": { + "execa": "^5.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/defaults": { "version": "1.0.4", "license": "MIT", @@ -10441,6 +11211,11 @@ "node": ">=4" } }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==" + }, "node_modules/duplexer3": { "version": "0.1.5", "license": "BSD-3-Clause" @@ -10613,6 +11388,14 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "dependencies": { + "stackframe": "^1.3.4" + } + }, "node_modules/es-abstract": { "version": "1.23.3", "license": "MIT", @@ -13086,6 +13869,20 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/gzip-size": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", + "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", + "dependencies": { + "duplexer": "^0.1.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/handle-thing": { "version": "2.0.1", "license": "MIT" @@ -13381,8 +14178,9 @@ } }, "node_modules/html-webpack-plugin": { - "version": "5.6.0", - "license": "MIT", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.3.tgz", + "integrity": "sha512-QSf1yjtSAsmf7rYBV7XX86uua4W/vkhIt0xNXKbsi2foEeW7vjJQz4bhnpL3xH+l1ryl1680uNv968Z+X6jSYg==", "dependencies": { "@types/html-minifier-terser": "^6.0.0", "html-minifier-terser": "^6.0.2", @@ -18535,6 +19333,14 @@ "node": "*" } }, + "node_modules/mrmime": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.1.tgz", + "integrity": "sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "license": "MIT" @@ -19263,6 +20069,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "bin": { + "opener": "bin/opener-bin.js" + } + }, "node_modules/openurl": { "version": "1.1.1", "license": "MIT" @@ -20819,6 +21633,14 @@ "react": "^16.3.0 || ^17.0.0" } }, + "node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-router": { "version": "5.3.4", "license": "MIT", @@ -22001,6 +22823,19 @@ "node": ">=10" } }, + "node_modules/sirv": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.19.tgz", + "integrity": "sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==", + "dependencies": { + "@polka/url": "^1.0.0-next.20", + "mrmime": "^1.0.0", + "totalist": "^1.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/sisteransi": { "version": "1.0.5", "license": "MIT" @@ -22265,6 +23100,11 @@ "node": ">=8" } }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" + }, "node_modules/static-eval": { "version": "2.0.2", "dev": true, @@ -23257,6 +24097,14 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/totalist": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", + "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", + "engines": { + "node": ">=6" + } + }, "node_modules/touch": { "version": "3.1.1", "license": "ISC", @@ -23483,8 +24331,9 @@ } }, "node_modules/tslib": { - "version": "2.7.0", - "license": "0BSD" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -24006,71 +24855,185 @@ "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" }, - "engines": { - "node": ">=10.13.0" + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/wbuf": { + "version": "1.7.3", + "license": "MIT", + "dependencies": { + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/webpack": { + "version": "5.95.0", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", + "acorn": "^8.7.1", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-bundle-analyzer": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.6.1.tgz", + "integrity": "sha512-oKz9Oz9j3rUciLNfpGFjOb49/jEpXNmWdVH8Ls//zNcnLlQdTGXQQMsBbb/gR7Zl8WNLxVCq+0Hqbx3zv6twBw==", + "dependencies": { + "acorn": "^8.0.4", + "acorn-walk": "^8.0.0", + "chalk": "^4.1.0", + "commander": "^7.2.0", + "gzip-size": "^6.0.0", + "lodash": "^4.17.20", + "opener": "^1.5.2", + "sirv": "^1.0.7", + "ws": "^7.3.1" + }, + "bin": { + "webpack-bundle-analyzer": "lib/bin/analyzer.js" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/wbuf": { - "version": "1.7.3", - "license": "MIT", + "node_modules/webpack-bundle-analyzer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { - "minimalistic-assert": "^1.0.0" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/wcwidth": { - "version": "1.0.1", - "license": "MIT", - "dependencies": { - "defaults": "^1.0.3" + "node_modules/webpack-bundle-analyzer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/webpack-bundle-analyzer/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" } }, - "node_modules/webidl-conversions": { - "version": "7.0.0", - "license": "BSD-2-Clause", + "node_modules/webpack-bundle-analyzer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "engines": { - "node": ">=12" + "node": ">=8" } }, - "node_modules/webpack": { - "version": "5.95.0", - "license": "MIT", + "node_modules/webpack-bundle-analyzer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dependencies": { - "@types/estree": "^1.0.5", - "@webassemblyjs/ast": "^1.12.1", - "@webassemblyjs/wasm-edit": "^1.12.1", - "@webassemblyjs/wasm-parser": "^1.12.1", - "acorn": "^8.7.1", - "acorn-import-attributes": "^1.9.5", - "browserslist": "^4.21.10", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.1", - "es-module-lexer": "^1.2.1", - "eslint-scope": "5.1.1", - "events": "^3.2.0", - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.11", - "json-parse-even-better-errors": "^2.3.1", - "loader-runner": "^4.2.0", - "mime-types": "^2.1.27", - "neo-async": "^2.6.2", - "schema-utils": "^3.2.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.10", - "watchpack": "^2.4.1", - "webpack-sources": "^3.2.3" - }, - "bin": { - "webpack": "bin/webpack.js" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=8" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "engines": { + "node": ">=8.3.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" }, "peerDependenciesMeta": { - "webpack-cli": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { "optional": true } } @@ -25200,6 +26163,242 @@ "node": ">=20.0.0" } }, + "packages/botonic-dx-bundler-rspack": { + "name": "@botonic/dx-bundler-rspack", + "version": "0.30.0-alpha.4", + "license": "MIT", + "dependencies": { + "@rspack/cli": "^1.1.0", + "@rspack/core": "^1.1.0", + "@rspack/plugin-react-refresh": "^1.0.0", + "@swc/core": "^1.9.1", + "@swc/helpers": "^0.5.15", + "css-loader": "^7.1.2", + "html-webpack-plugin": "^5.6.3", + "node-polyfill-webpack-plugin": "^4.0.0", + "null-loader": "^4.0.1", + "react-refresh": "^0.14.2", + "sass-loader": "^16.0.3", + "style-loader": "^4.0.0", + "ts-node": "^10.9.2" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/css-loader": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-7.1.2.tgz", + "integrity": "sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA==", + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.33", + "postcss-modules-extract-imports": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.5", + "postcss-modules-scope": "^3.2.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.27.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/domain-browser": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-5.7.0.tgz", + "integrity": "sha512-edTFu0M/7wO1pXY6GDxVNVW086uqwWYIHP98txhcPyV995X21JIH2DtYp33sQJOupYoXKe9RwTw2Ya2vWaquTQ==", + "engines": { + "node": ">=4" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/node-polyfill-webpack-plugin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-4.0.0.tgz", + "integrity": "sha512-WLk77vLpbcpmTekRj6s6vYxk30XoyaY5MDZ4+9g8OaKoG3Ij+TjOqhpQjVUlfDZBPBgpNATDltaQkzuXSnnkwg==", + "dependencies": { + "assert": "^2.1.0", + "browserify-zlib": "^0.2.0", + "buffer": "^6.0.3", + "console-browserify": "^1.2.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.12.0", + "domain-browser": "^5.7.0", + "events": "^3.3.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "process": "^0.11.10", + "punycode": "^2.3.1", + "querystring-es3": "^0.2.1", + "readable-stream": "^4.5.2", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "string_decoder": "^1.3.0", + "timers-browserify": "^2.0.12", + "tty-browserify": "^0.0.1", + "type-fest": "^4.18.2", + "url": "^0.11.3", + "util": "^0.12.5", + "vm-browserify": "^1.1.2" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "webpack": ">=5" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/sass-loader": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.3.tgz", + "integrity": "sha512-gosNorT1RCkuCMyihv6FBRR7BMV06oKRAs+l4UMp1mlcVg9rWN6KMmUj3igjQwmYys4mDP3etEYJgiHRbgHCHA==", + "dependencies": { + "neo-async": "^2.6.2" + }, + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "sass": "^1.3.0", + "sass-embedded": "*", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/style-loader": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-4.0.0.tgz", + "integrity": "sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA==", + "engines": { + "node": ">= 18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.27.0" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/type-fest": { + "version": "4.26.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.1.tgz", + "integrity": "sha512-yOGpmOAL7CkKe/91I5O3gPICmJNLJ1G4zFYVAsRHg7M64biSnPtRj0WNQt++bRkjYOqjWXrhnUw1utzmVErAdg==", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/url": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.4.tgz", + "integrity": "sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.12.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "packages/botonic-dx-bundler-rspack/node_modules/url/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==" + }, "packages/botonic-eslint-config": { "name": "@botonic/eslint-config", "version": "0.30.0", diff --git a/packages/botonic-dx-bundler-rspack/.gitignore b/packages/botonic-dx-bundler-rspack/.gitignore new file mode 100644 index 0000000000..a333853593 --- /dev/null +++ b/packages/botonic-dx-bundler-rspack/.gitignore @@ -0,0 +1,3 @@ +#not adding lock to avoid noise in repository +#since it only contains dev deps, upgrading too far will not breaking in runtime +package-lock.json diff --git a/packages/botonic-dx-bundler-rspack/README.md b/packages/botonic-dx-bundler-rspack/README.md new file mode 100644 index 0000000000..7f4198b501 --- /dev/null +++ b/packages/botonic-dx-bundler-rspack/README.md @@ -0,0 +1,31 @@ +# Botonic bundler Rspack + +## What Does This Package Do? + +This package simplifies the configuration of a rspack bundler to build a Botonic project. + +## IMPORTANT + +- Webviews imported inside the webviews/index.ts must be classes or functions but cannot be arrow functions. + +## Setup + +- Install this package. + +``` +npm install -D @botonic/dx-bundler-rspack +``` + +- Copy `baseline/rspack.config.js` file to the root of your project. + +- Add this script to your package.json to build for production and start for development in local. + +``` +... +"scipts": { + ... + "build_production": "ENVIRONMENT=production NODE_ENV=production rspack build --env target=all --mode=production", + "start": "ENVIRONMENT=local NODE_ENV=development rspack serve --env target=dev --mode=development", + ... +} +``` diff --git a/packages/botonic-dx-bundler-rspack/baseline/rspack.config.ts b/packages/botonic-dx-bundler-rspack/baseline/rspack.config.ts new file mode 100644 index 0000000000..415fdce0b2 --- /dev/null +++ b/packages/botonic-dx-bundler-rspack/baseline/rspack.config.ts @@ -0,0 +1,380 @@ +import { Configuration } from '@rspack/cli' +import * as rspack from '@rspack/core' +import ReactRefreshPlugin from '@rspack/plugin-react-refresh' +import HtmlWebpackPlugin from 'html-webpack-plugin' +import NodePolyfillPlugin from 'node-polyfill-webpack-plugin' +import path from 'path' + +const ROOT_PATH = path.resolve(__dirname, 'src') +const OUTPUT_PATH = path.resolve(__dirname, 'dist') +const NODE_MODULES_PATH = path.resolve(__dirname, 'node_modules') +const WEBVIEWS_PATH = path.resolve(OUTPUT_PATH, 'webviews') +const BOTONIC_PATH = path.resolve(NODE_MODULES_PATH, '@botonic', 'react') + +enum BotonicTarget { + ALL = 'all', + DEV = 'dev', + NODE = 'node', + WEBVIEWS = 'webviews', + WEBCHAT = 'webchat', +} + +const WEBPACK_ENTRIES_DIRNAME = 'webpack-entries' +const WEBPACK_ENTRIES = { + DEV: 'dev-entry.ts', + NODE: 'node-entry.ts', + WEBCHAT: 'webchat-entry.ts', + WEBVIEWS: 'webviews-entry.ts', +} + +const TEMPLATES = { + WEBCHAT: 'webchat.template.html', + WEBVIEWS: 'webview.template.html', +} + +const UMD_LIBRARY_TARGET = 'umd' + +const LIBRARY_NAME = { + BOTONIC: 'Botonic', + WEBVIEW: 'BotonicWebview', + BOT: 'bot', +} + +const FILENAME = { + WEBCHAT: 'webchat.botonic.js', + WEBVIEWS: 'webviews.js', + BOT: 'bot.js', +} + +enum Mode { + development = 'development', + production = 'production', +} + +const HUBTYPE_DEFAULTS = { + API_URL: 'https://api.hubtype.com', + WEBCHAT_PUSHER_KEY: '434ca667c8e6cb3f641c', // pragma: allowlist secret +} + +const CONFIG_ENVIRONMENTS = ['production', 'staging', 'local'] + +const resolveConfig = { + extensions: ['.*', '.js', '.jsx', '.ts', '.tsx'], + alias: { + BotonicProject: ROOT_PATH, + react: path.resolve('./node_modules/react'), + // 'styled-components': path.resolve('./node_modules/styled-components'), + '@botonic/react': BOTONIC_PATH, + }, +} + +const isDev = String(process.env.ENVIRONMENT) === 'local' + +const typescriptLoaderConfig = + // exclude: /node_modules[/\\](?!(@botonic\/(core|react))[/\\])/, + [ + { + test: /\.tsx?$/, + exclude: [/node_modules/], + use: { + loader: 'builtin:swc-loader', + options: { + jsc: { + parser: { + syntax: 'typescript', + tsx: true, + }, + keepClassNames: true, + }, + }, + }, + type: 'javascript/auto', + }, + { + test: /\.jsx?$/, + exclude: [/node_modules/], + use: { + loader: 'builtin:swc-loader', + options: { + jsc: { + parser: { + syntax: 'ecmascript', + jsx: true, + }, + transform: { + react: { + pragma: 'React.createElement', + pragmaFrag: 'React.Fragment', + throwIfNamespace: true, + development: isDev, + refresh: isDev, + useBuiltins: false, + }, + }, + keepClassNames: true, + }, + }, + }, + type: 'javascript/auto', + }, + ] + +const fileLoaderConfig = [ + { + test: /\.(png|jpe?g|gif|svg)$/i, + type: 'asset/resource', + }, + { + test: /^BUILD_ID$/, + type: 'asset/source', + }, +] + +const nullLoaderConfig = { + test: /\.(scss|css)$/, + use: 'null-loader', +} + +const stylesLoaderConfig = [ + { + test: /\.(sass|scss|css)$/, + use: ['style-loader', 'css-loader', 'sass-loader'], + type: 'javascript/auto', + }, +] + +function log(message: string) { + // using errors to avoid screwing up webpack-bundle-analyzer when running with --profile + console.error(message) +} + +function getHtmlWebpackPlugin(templateName: string) { + return new HtmlWebpackPlugin({ + template: path.resolve(BOTONIC_PATH, 'src', templateName), + filename: 'index.html', + }) +} + +function getConfigEnvironment() { + const configEnvironment = String(process.env.ENVIRONMENT).toLowerCase() + if (!CONFIG_ENVIRONMENTS.includes(configEnvironment)) { + console.error( + `You need to set env var ENVIRONMENT to one of these: ${CONFIG_ENVIRONMENTS}. Current value: ${configEnvironment}` + ) + // eslint-disable-next-line no-process-exit + process.exit(1) + } + return configEnvironment +} + +function getPlugins(mode: string, target: string) { + const environment = getConfigEnvironment() + log( + `Generating bundle for: ${target}\nWebpack running on mode '${mode}' with env var ENVIRONMENT set to: ${environment}` + ) + + const plugins = [ + new rspack.EnvironmentPlugin({ + NODE_ENV: process.env.NODE_ENV, + HUBTYPE_API_URL: process.env.HUBTYPE_API_URL || HUBTYPE_DEFAULTS.API_URL, + BOTONIC_TARGET: BotonicTarget.NODE, + WEBCHAT_PUSHER_KEY: + process.env.WEBCHAT_PUSHER_KEY || HUBTYPE_DEFAULTS.WEBCHAT_PUSHER_KEY, + ENVIRONMENT: process.env.ENVIRONMENT, + }), + new rspack.ProgressPlugin(), + ] + + if (isDev) { + // @ts-ignore + plugins.push(new ReactRefreshPlugin()) + } + + return plugins +} + +function sourceMap(mode: string) { + if (mode === Mode.production) { + return 'hidden-source-map' + } else if (mode === Mode.development) { + return 'eval-cheap-source-map' + } else { + throw new Error( + 'Invalid mode argument (' + mode + '). See package.json scripts' + ) + } +} + +// Not work for Webviews, not keep fnames +const minimizerPlugin = new rspack.SwcJsMinimizerRspackPlugin({ + minimizerOptions: { + minify: true, + compress: { + keep_classnames: true, + keep_fargs: false, + keep_fnames: true, + }, + mangle: { + keep_fnames: true, + keep_classnames: true, + }, + }, +}) + +function botonicDevConfig(mode: Mode): Configuration { + return { + optimization: { + minimize: false, + }, + mode, + devtool: sourceMap(mode), + target: 'web', + entry: path.resolve(WEBPACK_ENTRIES_DIRNAME, WEBPACK_ENTRIES.DEV), + module: { + rules: [ + ...typescriptLoaderConfig, + ...fileLoaderConfig, + ...stylesLoaderConfig, + ], + }, + output: { + path: OUTPUT_PATH, + filename: FILENAME.WEBCHAT, + library: LIBRARY_NAME.BOTONIC, + libraryTarget: UMD_LIBRARY_TARGET, + libraryExport: 'app', + assetModuleFilename: 'assets/[hash][ext][query]', + }, + resolve: resolveConfig, + devServer: { + static: [OUTPUT_PATH], + liveReload: true, + historyApiFallback: true, + hot: true, + }, + plugins: [ + getHtmlWebpackPlugin(TEMPLATES.WEBCHAT), + new NodePolyfillPlugin({ onlyAliases: ['stream'] }), + new rspack.NormalModuleReplacementPlugin(/node:stream/, resource => { + resource.request = resource.request.replace(/^node:/, '') + }), + ...getPlugins(mode, BotonicTarget.DEV), + ], + } +} + +function botonicWebchatConfig(mode: Mode): Configuration { + return { + optimization: { + minimize: true, + minimizer: [minimizerPlugin], + }, + mode, + devtool: sourceMap(mode), + target: 'web', + entry: path.resolve(WEBPACK_ENTRIES_DIRNAME, WEBPACK_ENTRIES.WEBCHAT), + output: { + path: OUTPUT_PATH, + filename: FILENAME.WEBCHAT, + library: LIBRARY_NAME.BOTONIC, + libraryTarget: UMD_LIBRARY_TARGET, + libraryExport: 'app', + assetModuleFilename: 'assets/[hash][ext][query]', + }, + module: { + rules: [ + ...typescriptLoaderConfig, + ...fileLoaderConfig, + ...stylesLoaderConfig, + ], + }, + resolve: resolveConfig, + plugins: [ + getHtmlWebpackPlugin(TEMPLATES.WEBCHAT), + ...getPlugins(mode, BotonicTarget.WEBCHAT), + ], + } +} + +function botonicWebviewsConfig(mode: Mode): Configuration { + return { + optimization: { + sideEffects: true, // critical so that tree-shaking discards browser code from @botonic/react + usedExports: true, + minimize: true, + minimizer: mode === Mode.production ? [minimizerPlugin] : [], + }, + mode, + devtool: sourceMap(mode), + target: 'web', + entry: path.resolve(WEBPACK_ENTRIES_DIRNAME, WEBPACK_ENTRIES.WEBVIEWS), + output: { + path: WEBVIEWS_PATH, + filename: FILENAME.WEBVIEWS, + library: LIBRARY_NAME.WEBVIEW, + libraryTarget: UMD_LIBRARY_TARGET, + libraryExport: 'app', + assetModuleFilename: '../assets/[hash][ext][query]', + }, + module: { + rules: [ + ...typescriptLoaderConfig, + ...fileLoaderConfig, + ...stylesLoaderConfig, + ], + }, + resolve: resolveConfig, + plugins: [ + getHtmlWebpackPlugin(TEMPLATES.WEBVIEWS), + ...getPlugins(mode, BotonicTarget.WEBVIEWS), + ], + } +} + +function botonicServerConfig(mode: string): Configuration { + return { + optimization: { + sideEffects: true, // critical so that tree-shaking discards browser code from @botonic/react + minimize: true, + minimizer: mode === Mode.production ? [minimizerPlugin] : [], + }, + context: ROOT_PATH, + // 'mode' removed so that we're forced to be explicit + target: 'node', + entry: path.resolve(WEBPACK_ENTRIES_DIRNAME, WEBPACK_ENTRIES.NODE), + output: { + filename: FILENAME.BOT, + library: LIBRARY_NAME.BOT, + libraryTarget: 'umd', + libraryExport: 'app', + assetModuleFilename: 'assets/[hash][ext][query]', + }, + module: { + rules: [...typescriptLoaderConfig, ...fileLoaderConfig, nullLoaderConfig], + }, + resolve: resolveConfig, + plugins: getPlugins(mode, BotonicTarget.NODE), + } +} + +export default function ( + env: { target: string }, + argv: { mode: Mode } +): Configuration[] { + if (env.target === BotonicTarget.ALL) { + return [ + botonicServerConfig(argv.mode), + botonicWebviewsConfig(argv.mode), + botonicWebchatConfig(argv.mode), + ] + } else if (env.target === BotonicTarget.DEV) { + return [botonicDevConfig(argv.mode)] + } else if (env.target === BotonicTarget.NODE) { + return [botonicServerConfig(argv.mode)] + } else if (env.target === BotonicTarget.WEBVIEWS) { + return [botonicWebviewsConfig(argv.mode)] + } else if (env.target === BotonicTarget.WEBCHAT) { + return [botonicWebchatConfig(argv.mode)] + } + throw new Error(`Invalid target ${env.target}`) +} diff --git a/packages/botonic-dx-bundler-rspack/package.json b/packages/botonic-dx-bundler-rspack/package.json new file mode 100644 index 0000000000..7c0d3091d8 --- /dev/null +++ b/packages/botonic-dx-bundler-rspack/package.json @@ -0,0 +1,34 @@ +{ + "name": "@botonic/dx-bundler-rspack", + "version": "0.30.0-alpha.4", + "description": "Build Botonic bots with RSPack", + "scripts": { + "build": "echo Skipping build...", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@rspack/cli": "^1.1.0", + "@rspack/core": "^1.1.0", + "@rspack/plugin-react-refresh": "^1.0.0", + "@swc/core": "^1.9.1", + "@swc/helpers": "^0.5.15", + "css-loader": "^7.1.2", + "html-webpack-plugin": "^5.6.3", + "node-polyfill-webpack-plugin": "^4.0.0", + "null-loader": "^4.0.1", + "react-refresh": "^0.14.2", + "sass-loader": "^16.0.3", + "style-loader": "^4.0.0", + "ts-node": "^10.9.2" + }, + "author": "", + "license": "MIT", + "keywords": [ + "bot-framework", + "javascript", + "typescript" + ], + "engines": { + "node": ">=20.0.0" + } +} diff --git a/packages/botonic-dx-bundler-rspack/tsconfig.json b/packages/botonic-dx-bundler-rspack/tsconfig.json new file mode 100644 index 0000000000..09713eb8d3 --- /dev/null +++ b/packages/botonic-dx-bundler-rspack/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.cjs.base.json", + "compilerOptions": { + "baseUrl": "./" + } +}