[v9.0.x] Grafana UI: Fix nonexistent indexof module for plugin tests (#50572)

* Grafana UI: Fix nonexistent indexof module for plugin tests (#50529)

* fix(grafana-ui): prevent module resolution failure where component-indexof appears as indexof

* chore(grafana-ui): update comment explaining need for alias plugin

(cherry picked from commit 6a4906ef7e)

* chore: refresh yarn.lock

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-06-10 11:32:58 +02:00
committed by GitHub
co-authored by Jack Westbrook
parent e760ffab0a
commit 5a5ecbe00b
3 changed files with 59 additions and 2 deletions
+2
View File
@@ -97,6 +97,7 @@
"@babel/core": "7.17.8",
"@grafana/tsconfig": "^1.2.0-rc1",
"@mdx-js/react": "1.6.22",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "22.0.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@storybook/addon-a11y": "6.4.21",
@@ -169,6 +170,7 @@
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-svg-import": "^1.6.0",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-visualizer": "^5.6.0",
"sass-loader": "13.0.0",
"storybook-dark-mode": "1.1.0",
"style-loader": "3.3.1",
+5 -1
View File
@@ -1,3 +1,4 @@
import alias from '@rollup/plugin-alias';
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import svg from 'rollup-plugin-svg-import';
@@ -39,6 +40,9 @@ const buildCjsPackage = ({ env }) => {
'@emotion/css',
],
plugins: [
// rc-time-picker has a transitive dependency on component-indexof which
// when bundled via `component-classes` imports a nonexistent `indexof` module.
alias({ entries: [{ find: 'indexof', replacement: 'component-indexof' }] }),
commonjs({
include: /node_modules/,
ignoreTryCatch: false,
@@ -49,4 +53,4 @@ const buildCjsPackage = ({ env }) => {
],
};
};
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
export default [buildCjsPackage({ env: 'development' })];
+52 -1
View File
@@ -4230,6 +4230,7 @@ __metadata:
"@react-aria/menu": 3.4.4
"@react-aria/overlays": 3.8.2
"@react-stately/menu": 3.2.7
"@rollup/plugin-alias": ^3.1.9
"@rollup/plugin-commonjs": 22.0.0
"@rollup/plugin-node-resolve": 13.3.0
"@sentry/browser": 6.19.7
@@ -4342,6 +4343,7 @@ __metadata:
rollup-plugin-sourcemaps: 0.6.3
rollup-plugin-svg-import: ^1.6.0
rollup-plugin-terser: 7.0.2
rollup-plugin-visualizer: ^5.6.0
rxjs: 7.5.5
sass-loader: 13.0.0
slate: 0.47.8
@@ -6937,6 +6939,17 @@ __metadata:
languageName: node
linkType: hard
"@rollup/plugin-alias@npm:^3.1.9":
version: 3.1.9
resolution: "@rollup/plugin-alias@npm:3.1.9"
dependencies:
slash: ^3.0.0
peerDependencies:
rollup: ^1.20.0||^2.0.0
checksum: cefae9dfb7c30f0dc78d24f4ad9ccb8a0878397b313c0fa9d0f519667394941c58a930d968d841e25aee43b0fb892d1e3f7edbb55e8197f191cce7da6a50b882
languageName: node
linkType: hard
"@rollup/plugin-commonjs@npm:22.0.0":
version: 22.0.0
resolution: "@rollup/plugin-commonjs@npm:22.0.0"
@@ -25072,7 +25085,7 @@ __metadata:
languageName: node
linkType: hard
"nanoid@npm:^3.3.3, nanoid@npm:^3.3.4":
"nanoid@npm:^3.1.32, nanoid@npm:^3.3.3, nanoid@npm:^3.3.4":
version: 3.3.4
resolution: "nanoid@npm:3.3.4"
bin:
@@ -30846,6 +30859,22 @@ __metadata:
languageName: node
linkType: hard
"rollup-plugin-visualizer@npm:^5.6.0":
version: 5.6.0
resolution: "rollup-plugin-visualizer@npm:5.6.0"
dependencies:
nanoid: ^3.1.32
open: ^8.4.0
source-map: ^0.7.3
yargs: ^17.3.1
peerDependencies:
rollup: ^2.0.0
bin:
rollup-plugin-visualizer: dist/bin/cli.js
checksum: 1036a3873f3b6a0c46d692538aaac5dc9f7a7b2a5aec9e7ab816aaf8a31576ae750f415e1019e401707d18490b634a982fbe8c22d9761cafbd9b12c756e7fd99
languageName: node
linkType: hard
"rollup@npm:2.74.1":
version: 2.74.1
resolution: "rollup@npm:2.74.1"
@@ -35698,6 +35727,13 @@ __metadata:
languageName: node
linkType: hard
"yargs-parser@npm:^21.0.0":
version: 21.0.1
resolution: "yargs-parser@npm:21.0.1"
checksum: c3ea2ed12cad0377ce3096b3f138df8267edf7b1aa7d710cd502fe16af417bafe4443dd71b28158c22fcd1be5dfd0e86319597e47badf42ff83815485887323a
languageName: node
linkType: hard
"yargs-unparser@npm:2.0.0":
version: 2.0.0
resolution: "yargs-unparser@npm:2.0.0"
@@ -35725,6 +35761,21 @@ __metadata:
languageName: node
linkType: hard
"yargs@npm:^17.3.1":
version: 17.5.1
resolution: "yargs@npm:17.5.1"
dependencies:
cliui: ^7.0.2
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.0.0
checksum: 00d58a2c052937fa044834313f07910fd0a115dec5ee35919e857eeee3736b21a4eafa8264535800ba8bac312991ce785ecb8a51f4d2cc8c4676d865af1cfbde
languageName: node
linkType: hard
"yauzl@npm:^2.10.0":
version: 2.10.0
resolution: "yauzl@npm:2.10.0"