diff --git a/config/webpack.config.js b/config/webpack.config.js index 24900f56d01241fcb729c480b0d4e58c53de5099..64d82e714c453bda74f9310babfd3b895c8841c0 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -381,6 +381,11 @@ module.exports = { include: /node_modules/, loader: 'babel-loader', }, + { + test: /marked\/.*\.js?$/, + include: /node_modules/, + loader: 'babel-loader', + }, { test: /swagger-ui-dist\/.*\.js?$/, include: /node_modules/, diff --git a/package.json b/package.json index dc6575ea5538c2e316c2860376da04b742fc2d0a..735aeee3c2f4bbd80df491f69e0be20163fa465d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "@gitlab/favicon-overlay": "2.0.0", "@gitlab/fonts": "^1.3.0", "@gitlab/svgs": "3.83.0", - "@gitlab/ui": "^74.3.0", + "@gitlab/ui": "^74.4.0", "@gitlab/visual-review-tools": "1.7.3", "@gitlab/web-ide": "^0.0.1-dev-20240208022507", "@mattiasbuelens/web-streams-adapter": "^0.1.0", diff --git a/storybook/config/webpack.config.js b/storybook/config/webpack.config.js index 04728a5506221c116b86dbc4b748657db21a60e7..e480a5bf66a7fc54430babd146c7b0b756c807b9 100644 --- a/storybook/config/webpack.config.js +++ b/storybook/config/webpack.config.js @@ -113,6 +113,20 @@ const sassLoaderOptions = { importer: sassSmartImporter, }; +// Some dependencies need to be transpiled for webpack to be happy +const transpileDependencyConfig = { + loader: 'babel-loader', + options: { + presets: [['@babel/preset-env', { targets: { esmodules: true } }]], + plugins: [ + // See: https://gitlab.com/gitlab-org/gitlab/-/issues/336216 + '@babel/plugin-proposal-optional-chaining', + // See: https://gitlab.com/gitlab-org/gitlab/-/issues/336216 + '@babel/plugin-proposal-nullish-coalescing-operator', + ], + }, +}; + module.exports = function storybookWebpackConfig({ config }) { // Add any missing extensions from the main GitLab webpack config config.resolve.extensions = Array.from( @@ -151,6 +165,10 @@ module.exports = function storybookWebpackConfig({ config }) { esModule: false, }, }, + { + test: /marked\/.*\.js?$/, + use: transpileDependencyConfig, + }, ]; // Silence webpack warnings about moment/pikaday not being able to resolve. diff --git a/yarn.lock b/yarn.lock index aeeb4ed000edd130fc34e466a1cba5a3cb4d1275..a2d015f28bec820f01653b178af21dfba249d181 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1321,16 +1321,18 @@ resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.83.0.tgz#5d6799e5fe3fb564b7e4190d90876469bd1608ba" integrity sha512-881f6OsxREgBXYn9fkg+XGweBFbrGdrssrIzFIZFSG95GF/K+HILw1mXZ9nq7C5Xb5JDWPKJGYnKuHw5vvWm5Q== -"@gitlab/ui@^74.3.0": - version "74.3.0" - resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-74.3.0.tgz#f5a7ee3f31fd8cd221ccf56b82f65e390ef8f142" - integrity sha512-q5twfOd8nrD0bGK+UiUnJ3c2yIJlYG+qdl3/HKoMBcqXu0IJA4XcvM9Fp1gUYdZ23ritSbFwPVjPGoryeGjjbw== +"@gitlab/ui@^74.4.0": + version "74.4.0" + resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-74.4.0.tgz#c5ec6d96e25e4a230eb42decb8da6592998cfc5b" + integrity sha512-5v67k2joXVbe9DsTCSrgn9foC8yEQPi8I26ldPJUtznqwsUxV1K+swSFwfHJ0iaNP0iEyFc6sDlYXNNL7EDknw== dependencies: "@floating-ui/dom" "1.4.3" bootstrap-vue "2.23.1" echarts "^5.3.2" iframe-resizer "^4.3.2" lodash "^4.17.20" + marked "^12.0.0" + marked-bidi "^1.0.8" portal-vue "^2.1.6" vue-runtime-helpers "^1.1.2" @@ -9212,10 +9214,15 @@ markdownlint@~0.29.0: markdown-it "13.0.1" markdownlint-micromark "0.1.5" -marked-bidi@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/marked-bidi/-/marked-bidi-1.0.3.tgz#7e637e0e04f7f297939af6b6472c27ac94266947" - integrity sha512-nmphpzT5K1jcSZxb7/hhzSfLCpXHdsdrtM/580o3xgtR4YdOEUr/usYcoR8UsV9gcgxL8LDCfYiDy//isSaILA== +marked-bidi@^1.0.3, marked-bidi@^1.0.8: + version "1.0.9" + resolved "https://registry.yarnpkg.com/marked-bidi/-/marked-bidi-1.0.9.tgz#16ca7d87f9acc87f8ce1ec34b34c1c20e825720b" + integrity sha512-nVFPysVKno/KBRF2vPurez/nmN3sdhB+Sm0qBxJgqPkk0ltYUs96SNswE4YcGUcCq8Smk0mHmURM/y15zKt7eA== + +marked@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-12.0.0.tgz#051ea8c8c7f65148a63003df1499515a2c6de716" + integrity sha512-Vkwtq9rLqXryZnWaQc86+FHLC6tr/fycMfYAhiOIXkrNmeGAyhSxjqu0Rs1i0bBqw5u0S7+lV9fdH2ZSVaoa0w== marked@^4.0.18: version "4.0.18"