diff --git a/AGENTS.md b/AGENTS.md index 46a33216..0e7218d2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,8 +13,7 @@ proceed with caution when making any changes to this codebase. When making changes that may impact existing functionality, ensure that all changelogs are up-to-date, and that version bumps are done according to semantic versioning. -When adding new functionality, write Jest unit tests, and Cypress end-to-end -and component tests. +When adding new functionality, write Jest unit tests, and Playwright end-to-end tests. ## Setup commands diff --git a/docker/Dockerfile.ci-operator-buildroot b/docker/Dockerfile.ci-operator-buildroot index 62b8ac4e..511d237d 100644 --- a/docker/Dockerfile.ci-operator-buildroot +++ b/docker/Dockerfile.ci-operator-buildroot @@ -44,10 +44,6 @@ ENV PATH=$NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH # Install global npm package dependencies. RUN npm install -g yarn -# Install Cypress related dependencies. -# https://docs.cypress.io/app/get-started/install-cypress#Linux-Prerequisites -RUN dnf install -y xorg-x11-server-Xvfb gtk3-devel nss alsa-lib - # Clean up temporary files. RUN dnf clean all diff --git a/package.json b/package.json index c17c85f0..99487775 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "build-libs": "yarn workspaces foreach -A --include 'packages/lib-*' run build", "build-samples": "yarn workspaces foreach -A --include 'packages/sample-*' run build", "build-samples-prod": "yarn workspaces foreach -A --include 'packages/sample-*' run build-prod", + "build-samples-rspack": "yarn workspaces foreach -A --include 'packages/sample-*' run build-rspack", "run-samples": "yarn workspaces foreach -Api --include 'packages/sample-*' run http-server", "lint": "yarn eslint packages", "test": "yarn jest", diff --git a/packages/lib-webpack/CHANGELOG.md b/packages/lib-webpack/CHANGELOG.md index 6d80527b..bbc2586b 100644 --- a/packages/lib-webpack/CHANGELOG.md +++ b/packages/lib-webpack/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog for `@openshift/dynamic-plugin-sdk-webpack` +## 5.2.0 - 2026-06-07 + +- Add rspack compatibility: `DynamicRemotePlugin` now works with both webpack and rspack bundlers ([#285]) +- Add `@rspack/core` and `webpack` to optional peer dependencies ([#285]) + ## 5.1.1 - 2026-04-16 - Fix bug in `PatchEntryCallbackPlugin` where compilation fails when using webpack-dev-server ([#314]) @@ -77,6 +82,7 @@ [#256]: https://github.com/openshift/dynamic-plugin-sdk/pull/256 [#259]: https://github.com/openshift/dynamic-plugin-sdk/pull/259 [#280]: https://github.com/openshift/dynamic-plugin-sdk/pull/280 +[#285]: https://github.com/openshift/dynamic-plugin-sdk/pull/285 [#289]: https://github.com/openshift/dynamic-plugin-sdk/pull/289 [#296]: https://github.com/openshift/dynamic-plugin-sdk/pull/296 [#314]: https://github.com/openshift/dynamic-plugin-sdk/pull/314 diff --git a/packages/lib-webpack/package.json b/packages/lib-webpack/package.json index da1e5dfd..d57f30e7 100644 --- a/packages/lib-webpack/package.json +++ b/packages/lib-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@openshift/dynamic-plugin-sdk-webpack", - "version": "5.1.1", + "version": "5.2.0", "description": "Allows building dynamic plugin assets with webpack", "license": "Apache-2.0", "repository": { @@ -26,8 +26,17 @@ "api-extractor-local": "yarn run api-extractor --local" }, "peerDependencies": { + "@rspack/core": "^2.0.6", "webpack": "^5.100.0" }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + }, "dependencies": { "lodash": "^4.17.23", "semver": "^7.7.3", diff --git a/packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts b/packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts index 1f2eaa91..704bae34 100644 --- a/packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts +++ b/packages/lib-webpack/src/webpack/DynamicRemotePlugin.ts @@ -210,8 +210,14 @@ export class DynamicRemotePlugin implements WebpackPluginInstance { const moduleFederationLibraryType = moduleFederationSettings.libraryType ?? 'jsonp'; const moduleFederationSharedScope = moduleFederationSettings.sharedScopeName ?? 'default'; + // Rspack's renamed ModuleFederationPlugin to ModuleFederationPluginV1. + // Their ModuleFederationPlugin implements module federation 1.5+ + const isRspack = 'rspack' in compiler; + const { - ModuleFederationPlugin = compiler.webpack.container.ModuleFederationPlugin, + ModuleFederationPlugin = isRspack + ? (compiler as any).rspack.container.ModuleFederationPluginV1 + : compiler.webpack.container.ModuleFederationPlugin, ContainerPlugin = compiler.webpack.container.ContainerPlugin, } = moduleFederationSettings.pluginOverride ?? {}; diff --git a/packages/sample-app/.eslintrc.js b/packages/sample-app/.eslintrc.js index 13086c2d..c68ebee2 100644 --- a/packages/sample-app/.eslintrc.js +++ b/packages/sample-app/.eslintrc.js @@ -1,14 +1,4 @@ module.exports = { root: true, extends: ['plugin:@monorepo/eslint-plugin-internal/react-typescript-prettier'], - overrides: [ - { - files: ['*.cy.ts', '*.cy.tsx'], - rules: { - // Suppress false positives due to https://docs.cypress.io/api/commands/then - 'promise/always-return': 'off', - 'promise/catch-or-return': 'off', - }, - }, - ], }; diff --git a/packages/sample-app/package.json b/packages/sample-app/package.json index e910658d..af4df043 100644 --- a/packages/sample-app/package.json +++ b/packages/sample-app/package.json @@ -7,9 +7,11 @@ "clean": "rm -rf dist", "build": "yarn clean && yarn webpack", "build-prod": "yarn clean && NODE_ENV=production yarn webpack", + "build-rspack": "yarn clean && NODE_ENV=production yarn rspack", "analyze": "yarn clean && NODE_ENV=production ANALYZE_BUNDLES=true yarn webpack", "lint": "yarn run -T eslint $INIT_CWD", - "webpack": "node -r ts-node/register ./node_modules/.bin/webpack", + "webpack": "WEBPACK=1 node -r ts-node/register ./node_modules/.bin/webpack", + "rspack": "RSPACK=1 node -r ts-node/register ./node_modules/.bin/rspack -c webpack.config.ts", "http-server": "http-server dist -p 9000 -c-1", "test-e2e": "yarn run -T playwright test --headed", "test-e2e-headless": "yarn run -T playwright test" @@ -22,6 +24,9 @@ "@patternfly/react-styles": "^6.4.0", "@patternfly/react-table": "^6.4.0", "@patternfly/react-tokens": "^6.4.0", + "@rspack/cli": "^2.0.6", + "@rspack/core": "^2.0.6", + "@types/webpack-bundle-analyzer": "~4.7.0", "copy-webpack-plugin": "^13.0.1", "css-loader": "^7.1.2", "css-minimizer-webpack-plugin": "7.0.2", diff --git a/packages/sample-app/webpack.config.ts b/packages/sample-app/webpack.config.ts index 304e3d3a..a17ccf73 100644 --- a/packages/sample-app/webpack.config.ts +++ b/packages/sample-app/webpack.config.ts @@ -1,162 +1,194 @@ import path from 'path'; -import CopyPlugin from 'copy-webpack-plugin'; -import CSSMinimizerPlugin from 'css-minimizer-webpack-plugin'; +import type { Configuration as RspackConfiguration } from '@rspack/core'; import HTMLPlugin from 'html-webpack-plugin'; import { escapeRegExp } from 'lodash'; -import MiniCSSExtractPlugin from 'mini-css-extract-plugin'; -import type { Configuration as WebpackConfiguration, WebpackPluginInstance } from 'webpack'; -import { container, EnvironmentPlugin } from 'webpack'; +import type { Configuration as WebpackConfiguration } from 'webpack'; import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import { appSharedModules } from './src/shared-modules'; const isProd = process.env.NODE_ENV === 'production'; const analyzeBundles = process.env.ANALYZE_BUNDLES === 'true'; +const isRunningWebpack = !!process.env.WEBPACK; +const isRunningRspack = !!process.env.RSPACK; + +if (!isRunningWebpack && !isRunningRspack) { + throw new Error('Unknown bundler'); +} + const pathTo = (relativePath: string) => path.resolve(__dirname, relativePath); export const getNodeModulesTest = (modulePaths: string[]) => new RegExp(`/node_modules/(${modulePaths.map(escapeRegExp).join('|')})/`); -const plugins: WebpackPluginInstance[] = [ - new EnvironmentPlugin({ - NODE_ENV: 'development', - }), - new container.ModuleFederationPlugin({ - shared: appSharedModules, - }), - new HTMLPlugin({ - template: pathTo('src/app-index.html.ejs'), - title: 'Sample Plugin Host Application', - chunks: ['app'], - }), - new CopyPlugin({ - patterns: [{ from: 'src/images/favicon.png', to: 'images' }], - }), -]; +async function buildConfig(): Promise { + const { + EnvironmentPlugin, + ModuleFederationPlugin, + CopyPlugin, + MiniCSSExtractPlugin, + CSSMinimizerPlugin, + } = isRunningWebpack + ? await Promise.all([ + import('webpack'), + import('copy-webpack-plugin'), + import('mini-css-extract-plugin'), + import('css-minimizer-webpack-plugin'), + ]).then(([webpack, copyPlugin, miniCssExtract, cssMinimizer]) => ({ + EnvironmentPlugin: webpack.EnvironmentPlugin, + ModuleFederationPlugin: webpack.container.ModuleFederationPlugin, + CopyPlugin: copyPlugin.default, + MiniCSSExtractPlugin: miniCssExtract.default, + CSSMinimizerPlugin: cssMinimizer.default, + })) + : await import('@rspack/core').then((rspack) => ({ + EnvironmentPlugin: rspack.EnvironmentPlugin, + ModuleFederationPlugin: rspack.container.ModuleFederationPluginV1, + CopyPlugin: rspack.CopyRspackPlugin, + MiniCSSExtractPlugin: rspack.CssExtractRspackPlugin, + CSSMinimizerPlugin: rspack.LightningCssMinimizerRspackPlugin, + })); -const config: WebpackConfiguration = { - mode: isProd ? 'production' : 'development', - entry: { - app: './src/app.tsx', - }, - output: { - path: pathTo('dist'), - filename: isProd ? '[name].[contenthash].bundle.js' : '[name].bundle.js', - chunkFilename: isProd ? 'chunks/[id].[chunkhash].min.js' : 'chunks/[id].js', - }, - resolve: { - extensions: ['.ts', '.tsx', '.js', '.jsx'], - }, - module: { - rules: [ - { - test: /\.(jsx?|tsx?)$/, - exclude: [/\/node_modules\//, /\.test\.(jsx?|tsx?)$/], - use: [ - { - loader: 'ts-loader', - options: { - configFile: pathTo('tsconfig.json'), + const plugins = [ + new EnvironmentPlugin({ + NODE_ENV: 'development', + }), + new ModuleFederationPlugin({ + name: 'sample_app', + shared: appSharedModules, + }), + new HTMLPlugin({ + template: pathTo('src/app-index.html.ejs'), + title: 'Sample Plugin Host Application', + chunks: ['app'], + }), + new CopyPlugin({ + patterns: [{ from: 'src/images/favicon.png', to: 'images' }], + }), + ...(isProd + ? [ + new MiniCSSExtractPlugin({ + filename: '[name].[contenthash].css', + chunkFilename: '[id].[chunkhash].css', + }), + ] + : []), + ...(analyzeBundles + ? [ + new BundleAnalyzerPlugin({ + analyzerMode: 'static', + reportFilename: pathTo('dist/bundle-report.html'), + openAnalyzer: false, + }), + ] + : []), + ]; + + return { + mode: isProd ? 'production' : 'development', + entry: { + app: './src/app.tsx', + }, + output: { + path: pathTo('dist'), + filename: isProd ? '[name].[contenthash].bundle.js' : '[name].bundle.js', + chunkFilename: isProd ? 'chunks/[id].[chunkhash].min.js' : 'chunks/[id].js', + }, + resolve: { + extensions: ['.ts', '.tsx', '.js', '.jsx'], + }, + module: { + rules: [ + { + test: /\.(jsx?|tsx?)$/, + exclude: [/\/node_modules\//, /\.test\.(jsx?|tsx?)$/], + use: [ + { + loader: 'ts-loader', + options: { + configFile: pathTo('tsconfig.json'), + }, }, - }, - ], - }, - { - test: /\.(svg|ttf|eot|otf|woff2?)$/, - include: getNodeModulesTest([ - '@patternfly/react-core/dist/styles/assets/fonts', - '@patternfly/react-core/dist/styles/assets/pficon', - ]), - type: 'asset', - parser: { - dataUrlCondition: { - maxSize: 50 * 1024, // Files smaller than 50 kB will be inlined as data URLs - }, - }, - generator: { - filename: isProd ? 'fonts/[contenthash][ext]' : 'fonts/[name][ext]', + ], }, - }, - { - test: /\.(svg|png|jpg|jpeg|gif)$/, - include: [ - getNodeModulesTest([ - '@patternfly/react-core/dist/styles/assets/images', - '@patternfly/react-styles/css/assets/images', + { + test: /\.(svg|ttf|eot|otf|woff2?)$/, + include: getNodeModulesTest([ + '@patternfly/react-core/dist/styles/assets/fonts', + '@patternfly/react-core/dist/styles/assets/pficon', ]), - pathTo('src'), - ], - type: 'asset', - parser: { - dataUrlCondition: { - maxSize: 50 * 1024, // Files smaller than 50 kB will be inlined as data URLs + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 50 * 1024, // Files smaller than 50 kB will be inlined as data URLs + }, + }, + generator: { + filename: isProd ? 'fonts/[contenthash][ext]' : 'fonts/[name][ext]', }, }, - generator: { - filename: isProd ? 'images/[contenthash][ext]' : 'images/[name][ext]', + { + test: /\.(svg|png|jpg|jpeg|gif)$/, + include: [ + getNodeModulesTest([ + '@patternfly/react-core/dist/styles/assets/images', + '@patternfly/react-styles/css/assets/images', + ]), + pathTo('src'), + ], + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 50 * 1024, // Files smaller than 50 kB will be inlined as data URLs + }, + }, + generator: { + filename: isProd ? 'images/[contenthash][ext]' : 'images/[name][ext]', + }, }, - }, - { - test: /\.(css)$/, - include: [ - getNodeModulesTest([ - '@patternfly/react-core/dist/styles', - '@patternfly/react-styles/css', - ]), - pathTo('src'), - ], - use: [isProd ? MiniCSSExtractPlugin.loader : 'style-loader', 'css-loader'], - }, - ], - }, - plugins, - devtool: isProd ? 'source-map' : 'cheap-source-map', - optimization: { - minimize: isProd, - minimizer: [ - '...', // The '...' string represents the webpack default TerserPlugin instance - new CSSMinimizerPlugin(), - ], - splitChunks: { - cacheGroups: { - vendorReact: { - test: getNodeModulesTest(['react', 'react-dom']), - name: 'vendor-react', - chunks: 'all', + { + test: /\.(css)$/, + include: [ + getNodeModulesTest([ + '@patternfly/react-core/dist/styles', + '@patternfly/react-styles/css', + ]), + pathTo('src'), + ], + use: [isProd ? MiniCSSExtractPlugin.loader : 'style-loader', 'css-loader'], }, - vendorPatternFly: { - test: getNodeModulesTest([ - '@patternfly/react-core', - '@patternfly/react-icons', - '@patternfly/react-styles', - '@patternfly/react-table', - '@patternfly/react-tokens', - ]), - name: 'vendor-patternfly', - chunks: 'all', + ], + }, + plugins, + devtool: isProd ? 'source-map' : 'cheap-source-map', + optimization: { + minimize: isProd, + minimizer: [ + '...', // The '...' string represents the webpack default TerserPlugin instance + new CSSMinimizerPlugin(), + ], + splitChunks: { + cacheGroups: { + vendorReact: { + test: getNodeModulesTest(['react', 'react-dom']), + name: 'vendor-react', + chunks: 'all', + }, + vendorPatternFly: { + test: getNodeModulesTest([ + '@patternfly/react-core', + '@patternfly/react-icons', + '@patternfly/react-styles', + '@patternfly/react-table', + '@patternfly/react-tokens', + ]), + name: 'vendor-patternfly', + chunks: 'all', + }, }, }, }, - }, -}; - -if (isProd) { - plugins.push( - new MiniCSSExtractPlugin({ - filename: '[name].[contenthash].css', - chunkFilename: '[id].[chunkhash].css', - }), - ); -} - -if (analyzeBundles) { - plugins.push( - new BundleAnalyzerPlugin({ - analyzerMode: 'static', - reportFilename: pathTo('dist/bundle-report.html'), - openAnalyzer: false, - }), - ); + }; } -export default config; +export default buildConfig(); diff --git a/packages/sample-plugin/package.json b/packages/sample-plugin/package.json index dbd26840..5323ddb1 100644 --- a/packages/sample-plugin/package.json +++ b/packages/sample-plugin/package.json @@ -7,8 +7,10 @@ "clean": "rm -rf dist", "build": "yarn clean && yarn webpack", "build-prod": "yarn clean && NODE_ENV=production yarn webpack", + "build-rspack": "yarn clean && NODE_ENV=production yarn rspack", "lint": "yarn run -T eslint $INIT_CWD", - "webpack": "node -r ts-node/register ./node_modules/.bin/webpack", + "webpack": "WEBPACK=1 node -r ts-node/register ./node_modules/.bin/webpack", + "rspack": "RSPACK=1 node -r ts-node/register ./node_modules/.bin/rspack -c webpack.config.ts", "http-server": "http-server dist -p 9001 -c-1 --cors" }, "devDependencies": { @@ -16,6 +18,8 @@ "@openshift/dynamic-plugin-sdk": "portal:../lib-core", "@openshift/dynamic-plugin-sdk-webpack": "portal:../lib-webpack", "@patternfly/react-core": "^6.4.0", + "@rspack/cli": "^2.0.6", + "@rspack/core": "^2.0.6", "css-loader": "^7.1.2", "css-minimizer-webpack-plugin": "7.0.2", "http-server": "^14.1.1", diff --git a/packages/sample-plugin/webpack.config.ts b/packages/sample-plugin/webpack.config.ts index 1075b83e..7b94dd21 100644 --- a/packages/sample-plugin/webpack.config.ts +++ b/packages/sample-plugin/webpack.config.ts @@ -1,83 +1,100 @@ import path from 'path'; import { pluginSharedModules } from '@monorepo/sample-app/src/shared-modules'; import { DynamicRemotePlugin } from '@openshift/dynamic-plugin-sdk-webpack'; -import CSSMinimizerPlugin from 'css-minimizer-webpack-plugin'; -import type { Configuration as WebpackConfiguration, WebpackPluginInstance } from 'webpack'; -import { EnvironmentPlugin } from 'webpack'; +import type { Configuration as RspackConfiguration } from '@rspack/core'; +import type { Configuration as WebpackConfiguration } from 'webpack'; import extensions from './plugin-extensions'; import pluginMetadata from './plugin-metadata'; const isProd = process.env.NODE_ENV === 'production'; +const isRunningWebpack = !!process.env.WEBPACK; +const isRunningRspack = !!process.env.RSPACK; + +if (!isRunningWebpack && !isRunningRspack) { + throw new Error('Unknown bundler'); +} + const pathTo = (relativePath: string) => path.resolve(__dirname, relativePath); -const plugins: WebpackPluginInstance[] = [ - new EnvironmentPlugin({ - NODE_ENV: 'development', - }), - new DynamicRemotePlugin({ - pluginMetadata, - extensions, - sharedModules: pluginSharedModules, - entryScriptFilename: isProd ? 'plugin-entry.[contenthash].min.js' : 'plugin-entry.js', - }), -]; +async function buildConfig(): Promise { + const { EnvironmentPlugin, CSSMinimizerPlugin } = isRunningWebpack + ? await Promise.all([import('webpack'), import('css-minimizer-webpack-plugin')]).then( + ([webpack, cssMinimizer]) => ({ + EnvironmentPlugin: webpack.EnvironmentPlugin, + CSSMinimizerPlugin: cssMinimizer.default, + }), + ) + : await import('@rspack/core').then((rspack) => ({ + EnvironmentPlugin: rspack.EnvironmentPlugin, + CSSMinimizerPlugin: rspack.LightningCssMinimizerRspackPlugin, + })); + + const plugins = [ + new EnvironmentPlugin({ + NODE_ENV: 'development', + }), + new DynamicRemotePlugin({ + pluginMetadata, + extensions, + sharedModules: pluginSharedModules, + entryScriptFilename: isProd ? 'plugin-entry.[contenthash].min.js' : 'plugin-entry.js', + }), + ]; -const config: WebpackConfiguration = { - mode: isProd ? 'production' : 'development', - entry: {}, // Plugin container entry is generated by DynamicRemotePlugin - output: { - path: pathTo('dist'), - publicPath: 'http://localhost:9001/', - chunkFilename: isProd ? 'chunks/[id].[chunkhash].min.js' : 'chunks/[id].js', - assetModuleFilename: isProd ? 'assets/[contenthash][ext]' : 'assets/[name][ext]', - }, - resolve: { - extensions: ['.ts', '.tsx', '.js', '.jsx'], - }, - module: { - rules: [ - { - test: /\.(jsx?|tsx?)$/, - exclude: /\/node_modules\//, - use: [ - { - loader: 'ts-loader', - options: { - configFile: pathTo('tsconfig.json'), + return { + mode: isProd ? 'production' : 'development', + entry: {}, + output: { + path: pathTo('dist'), + publicPath: 'http://localhost:9001/', + chunkFilename: isProd ? 'chunks/[id].[chunkhash].min.js' : 'chunks/[id].js', + assetModuleFilename: isProd ? 'assets/[contenthash][ext]' : 'assets/[name][ext]', + }, + resolve: { + extensions: ['.ts', '.tsx', '.js', '.jsx'], + }, + module: { + rules: [ + { + test: /\.(jsx?|tsx?)$/, + exclude: /\/node_modules\//, + use: [ + { + loader: 'ts-loader', + options: { + configFile: pathTo('tsconfig.json'), + }, + }, + ], + }, + { + test: /\.(svg|png|jpg|jpeg|gif)$/, + include: pathTo('src'), + type: 'asset', + parser: { + dataUrlCondition: { + maxSize: 50 * 1024, }, }, - ], - }, - { - test: /\.(svg|png|jpg|jpeg|gif)$/, - include: pathTo('src'), - type: 'asset', - parser: { - dataUrlCondition: { - maxSize: 50 * 1024, // Files smaller than 50 kB will be inlined as data URLs + generator: { + filename: isProd ? 'images/[contenthash][ext]' : 'images/[name][ext]', }, }, - generator: { - filename: isProd ? 'images/[contenthash][ext]' : 'images/[name][ext]', + { + test: /\.(css)$/, + include: pathTo('src'), + use: ['style-loader', 'css-loader'], }, - }, - { - test: /\.(css)$/, - include: pathTo('src'), - use: ['style-loader', 'css-loader'], - }, - ], - }, - plugins, - devtool: isProd ? 'source-map' : 'cheap-source-map', - optimization: { - minimize: isProd, - minimizer: [ - '...', // The '...' string represents the webpack default TerserPlugin instance - new CSSMinimizerPlugin(), - ], - }, -}; + ], + }, + plugins, + devtool: isProd ? 'source-map' : 'cheap-source-map', + optimization: { + minimize: isProd, + minimizer: ['...', new CSSMinimizerPlugin()], + }, + }; +} -export default config; +export default buildConfig(); diff --git a/test-prow-e2e.sh b/test-prow-e2e.sh index bd826404..cc01820b 100755 --- a/test-prow-e2e.sh +++ b/test-prow-e2e.sh @@ -15,7 +15,11 @@ trap copyArtifacts EXIT yarn install yarn build-libs + +# Webpack yarn build-samples +yarn test-e2e -# Run Playwright E2E tests (webServer config starts http-server automatically) +# Rspack +yarn build-samples-rspack yarn test-e2e diff --git a/yarn.lock b/yarn.lock index 425b0934..a8f43f22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -406,6 +406,34 @@ __metadata: languageName: node linkType: hard +"@emnapi/core@npm:1.10.0": + version: 1.10.0 + resolution: "@emnapi/core@npm:1.10.0" + dependencies: + "@emnapi/wasi-threads": "npm:1.2.1" + tslib: "npm:^2.4.0" + checksum: 10c0/f51d08227857b60632de7714d708124f0e100a1462dde6df8221760939aa3204a73193830371830fac0716f3ccd2129f2cac1b17cd7d7958bc4da9018a296edb + languageName: node + linkType: hard + +"@emnapi/runtime@npm:1.10.0": + version: 1.10.0 + resolution: "@emnapi/runtime@npm:1.10.0" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10c0/953f14991d1aefb92ee6f8eb27dea725e484791a53a0cb5f47d9e0087b9a2c929ff2e92adf95af15d6ad456db6300c6b761ebf72b50a875b874a83520b3ba093 + languageName: node + linkType: hard + +"@emnapi/wasi-threads@npm:1.2.1": + version: 1.2.1 + resolution: "@emnapi/wasi-threads@npm:1.2.1" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10c0/32fcfa81ab396533b2ec1f4082b1ff779a05d9c836bbbd3f4398405b0e6814c0d9503b7993130e37bc6941dbc1ded49f55e9700ae9ca4e803bab2b5bc5deb331 + languageName: node + linkType: hard + "@eslint-community/eslint-utils@npm:^4.1.2, @eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": version: 4.9.1 resolution: "@eslint-community/eslint-utils@npm:4.9.1" @@ -974,6 +1002,9 @@ __metadata: "@patternfly/react-styles": "npm:^6.4.0" "@patternfly/react-table": "npm:^6.4.0" "@patternfly/react-tokens": "npm:^6.4.0" + "@rspack/cli": "npm:^2.0.6" + "@rspack/core": "npm:^2.0.6" + "@types/webpack-bundle-analyzer": "npm:~4.7.0" copy-webpack-plugin: "npm:^13.0.1" css-loader: "npm:^7.1.2" css-minimizer-webpack-plugin: "npm:7.0.2" @@ -1000,6 +1031,8 @@ __metadata: "@openshift/dynamic-plugin-sdk": "portal:../lib-core" "@openshift/dynamic-plugin-sdk-webpack": "portal:../lib-webpack" "@patternfly/react-core": "npm:^6.4.0" + "@rspack/cli": "npm:^2.0.6" + "@rspack/core": "npm:^2.0.6" css-loader: "npm:^7.1.2" css-minimizer-webpack-plugin: "npm:7.0.2" http-server: "npm:^14.1.1" @@ -1013,6 +1046,18 @@ __metadata: languageName: unknown linkType: soft +"@napi-rs/wasm-runtime@npm:1.1.4": + version: 1.1.4 + resolution: "@napi-rs/wasm-runtime@npm:1.1.4" + dependencies: + "@tybys/wasm-util": "npm:^0.10.1" + peerDependencies: + "@emnapi/core": ^1.7.1 + "@emnapi/runtime": ^1.7.1 + checksum: 10c0/2e88e1955258949ccf2d18c79975821ad38071b465ef126a5e14110977b97868867b016c1ad046e963cccc42c0bd9db6c8ff5fd1ebb61b87bb3487f339041658 + languageName: node + linkType: hard + "@nodelib/fs.scandir@npm:2.1.5": version: 2.1.5 resolution: "@nodelib/fs.scandir@npm:2.1.5" @@ -1098,7 +1143,13 @@ __metadata: semver: "npm:^7.7.3" yup: "npm:^1.7.1" peerDependencies: + "@rspack/core": ^2.0.6 webpack: ^5.100.0 + peerDependenciesMeta: + "@rspack/core": + optional: true + webpack: + optional: true languageName: node linkType: soft @@ -1110,7 +1161,13 @@ __metadata: semver: "npm:^7.7.3" yup: "npm:^1.7.1" peerDependencies: + "@rspack/core": ^2.0.6 webpack: ^5.100.0 + peerDependenciesMeta: + "@rspack/core": + optional: true + webpack: + optional: true languageName: node linkType: soft @@ -1122,7 +1179,13 @@ __metadata: semver: "npm:^7.7.3" yup: "npm:^1.7.1" peerDependencies: + "@rspack/core": ^2.0.6 webpack: ^5.100.0 + peerDependenciesMeta: + "@rspack/core": + optional: true + webpack: + optional: true languageName: unknown linkType: soft @@ -1386,6 +1449,151 @@ __metadata: languageName: node linkType: hard +"@rspack/binding-darwin-arm64@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-darwin-arm64@npm:2.0.6" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rspack/binding-darwin-x64@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-darwin-x64@npm:2.0.6" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rspack/binding-linux-arm64-gnu@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-linux-arm64-gnu@npm:2.0.6" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rspack/binding-linux-arm64-musl@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-linux-arm64-musl@npm:2.0.6" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rspack/binding-linux-x64-gnu@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-linux-x64-gnu@npm:2.0.6" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rspack/binding-linux-x64-musl@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-linux-x64-musl@npm:2.0.6" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rspack/binding-wasm32-wasi@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-wasm32-wasi@npm:2.0.6" + dependencies: + "@emnapi/core": "npm:1.10.0" + "@emnapi/runtime": "npm:1.10.0" + "@napi-rs/wasm-runtime": "npm:1.1.4" + conditions: cpu=wasm32 + languageName: node + linkType: hard + +"@rspack/binding-win32-arm64-msvc@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-win32-arm64-msvc@npm:2.0.6" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rspack/binding-win32-ia32-msvc@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-win32-ia32-msvc@npm:2.0.6" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rspack/binding-win32-x64-msvc@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding-win32-x64-msvc@npm:2.0.6" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rspack/binding@npm:2.0.6": + version: 2.0.6 + resolution: "@rspack/binding@npm:2.0.6" + dependencies: + "@rspack/binding-darwin-arm64": "npm:2.0.6" + "@rspack/binding-darwin-x64": "npm:2.0.6" + "@rspack/binding-linux-arm64-gnu": "npm:2.0.6" + "@rspack/binding-linux-arm64-musl": "npm:2.0.6" + "@rspack/binding-linux-x64-gnu": "npm:2.0.6" + "@rspack/binding-linux-x64-musl": "npm:2.0.6" + "@rspack/binding-wasm32-wasi": "npm:2.0.6" + "@rspack/binding-win32-arm64-msvc": "npm:2.0.6" + "@rspack/binding-win32-ia32-msvc": "npm:2.0.6" + "@rspack/binding-win32-x64-msvc": "npm:2.0.6" + dependenciesMeta: + "@rspack/binding-darwin-arm64": + optional: true + "@rspack/binding-darwin-x64": + optional: true + "@rspack/binding-linux-arm64-gnu": + optional: true + "@rspack/binding-linux-arm64-musl": + optional: true + "@rspack/binding-linux-x64-gnu": + optional: true + "@rspack/binding-linux-x64-musl": + optional: true + "@rspack/binding-wasm32-wasi": + optional: true + "@rspack/binding-win32-arm64-msvc": + optional: true + "@rspack/binding-win32-ia32-msvc": + optional: true + "@rspack/binding-win32-x64-msvc": + optional: true + checksum: 10c0/b6b7084327974e246c377c3a8012b5156ad6447484e5616de1b0a19a8598747deb7841a200b8336551f8ef73fa7523212db59f1ff21e76e2304ff6fb3f397d73 + languageName: node + linkType: hard + +"@rspack/cli@npm:^2.0.6": + version: 2.0.6 + resolution: "@rspack/cli@npm:2.0.6" + peerDependencies: + "@rspack/core": ^2.0.0-0 + "@rspack/dev-server": ^2.0.0-0 + peerDependenciesMeta: + "@rspack/dev-server": + optional: true + bin: + rspack: ./bin/rspack.js + checksum: 10c0/706ce5186a1cb09e22e4bd994839e677a6d7a42c4768266a6c54c5001a6d2ca839ee134b06edb374706c44425a7b602841fc54a867b506e9d6de6b00471403ea + languageName: node + linkType: hard + +"@rspack/core@npm:^2.0.6": + version: 2.0.6 + resolution: "@rspack/core@npm:2.0.6" + dependencies: + "@rspack/binding": "npm:2.0.6" + peerDependencies: + "@module-federation/runtime-tools": ^0.24.1 || ^2.0.0 + "@swc/helpers": ^0.5.23 + peerDependenciesMeta: + "@module-federation/runtime-tools": + optional: true + "@swc/helpers": + optional: true + checksum: 10c0/a1e574103e1a6c053b450a5f3573a29892a7fcd3c215d446071ea59141261ccf7a261c115ab0b64e67934a5cc373936c2e0aa43603efc73bd323490b093c131a + languageName: node + linkType: hard + "@rushstack/node-core-library@npm:5.23.1": version: 5.23.1 resolution: "@rushstack/node-core-library@npm:5.23.1" @@ -1583,6 +1791,15 @@ __metadata: languageName: node linkType: hard +"@tybys/wasm-util@npm:^0.10.1": + version: 0.10.1 + resolution: "@tybys/wasm-util@npm:0.10.1" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10c0/b255094f293794c6d2289300c5fbcafbb5532a3aed3a5ffd2f8dc1828e639b88d75f6a376dd8f94347a44813fd7a7149d8463477a9a49525c8b2dcaa38c2d1e8 + languageName: node + linkType: hard + "@types/argparse@npm:1.0.38": version: 1.0.38 resolution: "@types/argparse@npm:1.0.38" @@ -1884,6 +2101,17 @@ __metadata: languageName: node linkType: hard +"@types/webpack-bundle-analyzer@npm:~4.7.0": + version: 4.7.0 + resolution: "@types/webpack-bundle-analyzer@npm:4.7.0" + dependencies: + "@types/node": "npm:*" + tapable: "npm:^2.2.0" + webpack: "npm:^5" + checksum: 10c0/dd5294ab9654081848066b14b8f01fcabb61b0e3ed4975f1613cc5da0f473b4496164a3fce3ac63027a15bb2f27d9442562f5099e764d6c03f72fe5a69fcc9bc + languageName: node + linkType: hard + "@types/yargs-parser@npm:*": version: 21.0.0 resolution: "@types/yargs-parser@npm:21.0.0" @@ -2517,6 +2745,20 @@ __metadata: languageName: node linkType: hard +"async-function@npm:^1.0.0": + version: 1.0.0 + resolution: "async-function@npm:1.0.0" + checksum: 10c0/669a32c2cb7e45091330c680e92eaeb791bc1d4132d827591e499cd1f776ff5a873e77e5f92d0ce795a8d60f10761dec9ddfe7225a5de680f5d357f67b1aac73 + languageName: node + linkType: hard + +"async-generator-function@npm:^1.0.0": + version: 1.0.0 + resolution: "async-generator-function@npm:1.0.0" + checksum: 10c0/2c50ef856c543ad500d8d8777d347e3c1ba623b93e99c9263ecc5f965c1b12d2a140e2ab6e43c3d0b85366110696f28114649411cbcd10b452a92a2318394186 + languageName: node + linkType: hard + "async@npm:^2.6.2": version: 2.6.4 resolution: "async@npm:2.6.4" @@ -2808,6 +3050,16 @@ __metadata: languageName: node linkType: hard +"call-bind-apply-helpers@npm:^1.0.1, call-bind-apply-helpers@npm:^1.0.2": + version: 1.0.2 + resolution: "call-bind-apply-helpers@npm:1.0.2" + dependencies: + es-errors: "npm:^1.3.0" + function-bind: "npm:^1.1.2" + checksum: 10c0/47bd9901d57b857590431243fea704ff18078b16890a6b3e021e12d279bbf211d039155e27d7566b374d49ee1f8189344bac9833dec7a20cdec370506361c938 + languageName: node + linkType: hard + "call-bind@npm:^1.0.0, call-bind@npm:^1.0.2": version: 1.0.5 resolution: "call-bind@npm:1.0.5" @@ -3662,6 +3914,17 @@ __metadata: languageName: node linkType: hard +"dunder-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "dunder-proto@npm:1.0.1" + dependencies: + call-bind-apply-helpers: "npm:^1.0.1" + es-errors: "npm:^1.3.0" + gopd: "npm:^1.2.0" + checksum: 10c0/199f2a0c1c16593ca0a145dbf76a962f8033ce3129f01284d48c45ed4e14fea9bbacd7b3610b6cdc33486cef20385ac054948fefc6272fcce645c09468f93031 + languageName: node + linkType: hard + "electron-to-chromium@npm:^1.5.328": version: 1.5.336 resolution: "electron-to-chromium@npm:1.5.336" @@ -3797,6 +4060,13 @@ __metadata: languageName: node linkType: hard +"es-define-property@npm:^1.0.1": + version: 1.0.1 + resolution: "es-define-property@npm:1.0.1" + checksum: 10c0/3f54eb49c16c18707949ff25a1456728c883e81259f045003499efba399c08bad00deebf65cccde8c0e07908c1a225c9d472b7107e558f2a48e28d530e34527c + languageName: node + linkType: hard + "es-errors@npm:^1.3.0": version: 1.3.0 resolution: "es-errors@npm:1.3.0" @@ -3811,6 +4081,15 @@ __metadata: languageName: node linkType: hard +"es-object-atoms@npm:^1.0.0, es-object-atoms@npm:^1.1.1": + version: 1.1.1 + resolution: "es-object-atoms@npm:1.1.1" + dependencies: + es-errors: "npm:^1.3.0" + checksum: 10c0/65364812ca4daf48eb76e2a3b7a89b3f6a2e62a1c420766ce9f692665a29d94fe41fe88b65f24106f449859549711e4b40d9fb8002d862dfd7eb1c512d10be0c + languageName: node + linkType: hard + "es-to-primitive@npm:^1.2.1": version: 1.2.1 resolution: "es-to-primitive@npm:1.2.1" @@ -4596,6 +4875,13 @@ __metadata: languageName: node linkType: hard +"generator-function@npm:^2.0.0": + version: 2.0.1 + resolution: "generator-function@npm:2.0.1" + checksum: 10c0/8a9f59df0f01cfefafdb3b451b80555e5cf6d76487095db91ac461a0e682e4ff7a9dbce15f4ecec191e53586d59eece01949e05a4b4492879600bbbe8e28d6b8 + languageName: node + linkType: hard + "gensync@npm:^1.0.0-beta.2": version: 1.0.0-beta.2 resolution: "gensync@npm:1.0.0-beta.2" @@ -4610,15 +4896,24 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2": - version: 1.2.2 - resolution: "get-intrinsic@npm:1.2.2" +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2": + version: 1.3.1 + resolution: "get-intrinsic@npm:1.3.1" dependencies: + async-function: "npm:^1.0.0" + async-generator-function: "npm:^1.0.0" + call-bind-apply-helpers: "npm:^1.0.2" + es-define-property: "npm:^1.0.1" + es-errors: "npm:^1.3.0" + es-object-atoms: "npm:^1.1.1" function-bind: "npm:^1.1.2" - has-proto: "npm:^1.0.1" - has-symbols: "npm:^1.0.3" - hasown: "npm:^2.0.0" - checksum: 10c0/4e7fb8adc6172bae7c4fe579569b4d5238b3667c07931cd46b4eee74bbe6ff6b91329bec311a638d8e60f5b51f44fe5445693c6be89ae88d4b5c49f7ff12db0b + generator-function: "npm:^2.0.0" + get-proto: "npm:^1.0.1" + gopd: "npm:^1.2.0" + has-symbols: "npm:^1.1.0" + hasown: "npm:^2.0.2" + math-intrinsics: "npm:^1.1.0" + checksum: 10c0/9f4ab0cf7efe0fd2c8185f52e6f637e708f3a112610c88869f8f041bb9ecc2ce44bf285dfdbdc6f4f7c277a5b88d8e94a432374d97cca22f3de7fc63795deb5d languageName: node linkType: hard @@ -4629,6 +4924,16 @@ __metadata: languageName: node linkType: hard +"get-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "get-proto@npm:1.0.1" + dependencies: + dunder-proto: "npm:^1.0.1" + es-object-atoms: "npm:^1.0.0" + checksum: 10c0/9224acb44603c5526955e83510b9da41baf6ae73f7398875fba50edc5e944223a89c4a72b070fcd78beb5f7bdda58ecb6294adc28f7acfc0da05f76a2399643c + languageName: node + linkType: hard + "get-stream@npm:^6.0.0": version: 6.0.1 resolution: "get-stream@npm:6.0.1" @@ -4717,12 +5022,10 @@ __metadata: languageName: node linkType: hard -"gopd@npm:^1.0.1": - version: 1.0.1 - resolution: "gopd@npm:1.0.1" - dependencies: - get-intrinsic: "npm:^1.1.3" - checksum: 10c0/505c05487f7944c552cee72087bf1567debb470d4355b1335f2c262d218ebbff805cd3715448fe29b4b380bae6912561d0467233e4165830efd28da241418c63 +"gopd@npm:^1.0.1, gopd@npm:^1.2.0": + version: 1.2.0 + resolution: "gopd@npm:1.2.0" + checksum: 10c0/50fff1e04ba2b7737c097358534eacadad1e68d24cccee3272e04e007bed008e68d2614f3987788428fd192a5ae3889d08fb2331417e4fc4a9ab366b2043cead languageName: node linkType: hard @@ -4788,17 +5091,10 @@ __metadata: languageName: node linkType: hard -"has-proto@npm:^1.0.1": - version: 1.0.1 - resolution: "has-proto@npm:1.0.1" - checksum: 10c0/c8a8fe411f810b23a564bd5546a8f3f0fff6f1b692740eb7a2fdc9df716ef870040806891e2f23ff4653f1083e3895bf12088703dd1a0eac3d9202d3a4768cd0 - languageName: node - linkType: hard - -"has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": - version: 1.0.3 - resolution: "has-symbols@npm:1.0.3" - checksum: 10c0/e6922b4345a3f37069cdfe8600febbca791c94988c01af3394d86ca3360b4b93928bbf395859158f88099cb10b19d98e3bbab7c9ff2c1bd09cf665ee90afa2c3 +"has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3, has-symbols@npm:^1.1.0": + version: 1.1.0 + resolution: "has-symbols@npm:1.1.0" + checksum: 10c0/dde0a734b17ae51e84b10986e651c664379018d10b91b6b0e9b293eddb32f0f069688c841fb40f19e9611546130153e0a2a48fd7f512891fb000ddfa36f5a20e languageName: node linkType: hard @@ -4827,7 +5123,7 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.0, hasown@npm:^2.0.3": +"hasown@npm:^2.0.0, hasown@npm:^2.0.2, hasown@npm:^2.0.3": version: 2.0.3 resolution: "hasown@npm:2.0.3" dependencies: @@ -6246,9 +6542,9 @@ __metadata: linkType: hard "lodash@npm:^4.17.14, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.23": - version: 4.18.1 - resolution: "lodash@npm:4.18.1" - checksum: 10c0/757228fc68805c59789e82185135cf85f05d0b2d3d54631d680ca79ec21944ec8314d4533639a14b8bcfbd97a517e78960933041a5af17ecb693ec6eecb99a27 + version: 4.17.23 + resolution: "lodash@npm:4.17.23" + checksum: 10c0/1264a90469f5bb95d4739c43eb6277d15b6d9e186df4ac68c3620443160fc669e2f14c11e7d8b2ccf078b81d06147c01a8ccced9aab9f9f63d50dcf8cace6bf6 languageName: node linkType: hard @@ -6366,6 +6662,13 @@ __metadata: languageName: node linkType: hard +"math-intrinsics@npm:^1.1.0": + version: 1.1.0 + resolution: "math-intrinsics@npm:1.1.0" + checksum: 10c0/7579ff94e899e2f76ab64491d76cf606274c874d8f2af4a442c016bd85688927fcfca157ba6bf74b08e9439dc010b248ce05b96cc7c126a354c3bae7fcb48b7f + languageName: node + linkType: hard + "mdn-data@npm:2.0.28": version: 2.0.28 resolution: "mdn-data@npm:2.0.28" @@ -8535,7 +8838,7 @@ __metadata: languageName: node linkType: hard -"tapable@npm:^2.0.0, tapable@npm:^2.2.1, tapable@npm:^2.3.0": +"tapable@npm:^2.0.0, tapable@npm:^2.2.0, tapable@npm:^2.2.1, tapable@npm:^2.3.0": version: 2.3.0 resolution: "tapable@npm:2.3.0" checksum: 10c0/cb9d67cc2c6a74dedc812ef3085d9d681edd2c1fa18e4aef57a3c0605fdbe44e6b8ea00bd9ef21bc74dd45314e39d31227aa031ebf2f5e38164df514136f2681 @@ -8790,7 +9093,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.3, tslib@npm:^2.3.1, tslib@npm:^2.7.0, tslib@npm:^2.8.1": +"tslib@npm:^2.0.3, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.7.0, tslib@npm:^2.8.1": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62 @@ -9132,7 +9435,7 @@ __metadata: languageName: node linkType: hard -"webpack@npm:^5.100.0": +"webpack@npm:^5, webpack@npm:^5.100.0": version: 5.106.2 resolution: "webpack@npm:5.106.2" dependencies: