mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Frontend: Set moduleResolution to bundler in TSconfig (#96450)
* build(typescript): switch module resolution to bundler for exports imports goodness * chore: bump react-calendar and temp patch prometheus-io package * Wip * feat(decoupled-plugin): fix types errors in tests by including testing-library/jest-dom * chore(betterer): pass custom tsconfig so betterer continues to run
This commit is contained in:
parent
3f04989223
commit
a33f16d568
@ -53,9 +53,9 @@
|
|||||||
"watch": "yarn start -d watch,start core:start --watchTheme",
|
"watch": "yarn start -d watch,start core:start --watchTheme",
|
||||||
"ci:test-frontend": "yarn run test:ci",
|
"ci:test-frontend": "yarn run test:ci",
|
||||||
"i18n:stats": "node ./scripts/cli/reportI18nStats.mjs",
|
"i18n:stats": "node ./scripts/cli/reportI18nStats.mjs",
|
||||||
"betterer": "betterer",
|
"betterer": "betterer --tsconfig ./scripts/cli/tsconfig.json",
|
||||||
"betterer:json": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/bettererResultsToJson.ts",
|
"betterer:json": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/bettererResultsToJson.ts",
|
||||||
"betterer:merge": "betterer merge",
|
"betterer:merge": "betterer merge --tsconfig ./scripts/cli/tsconfig.json",
|
||||||
"betterer:stats": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/reportBettererStats.ts",
|
"betterer:stats": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/reportBettererStats.ts",
|
||||||
"betterer:issues": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/generateBettererIssues.ts",
|
"betterer:issues": "ts-node --transpile-only --project ./scripts/cli/tsconfig.json ./scripts/cli/generateBettererIssues.ts",
|
||||||
"generate-icons-bundle-cache-file": "node ./scripts/generate-icon-bundle.js",
|
"generate-icons-bundle-cache-file": "node ./scripts/generate-icon-bundle.js",
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
"rc-slider": "11.1.7",
|
"rc-slider": "11.1.7",
|
||||||
"rc-time-picker": "^3.7.3",
|
"rc-time-picker": "^3.7.3",
|
||||||
"rc-tooltip": "6.2.1",
|
"rc-tooltip": "6.2.1",
|
||||||
"react-calendar": "5.1.0",
|
"react-calendar": "^5.1.0",
|
||||||
"react-colorful": "5.6.1",
|
"react-colorful": "5.6.1",
|
||||||
"react-custom-scrollbars-2": "4.5.0",
|
"react-custom-scrollbars-2": "4.5.0",
|
||||||
"react-dropzone": "14.3.5",
|
"react-dropzone": "14.3.5",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { UseFormSetValue } from 'react-hook-form/dist/types/form';
|
import { UseFormSetValue } from 'react-hook-form';
|
||||||
|
|
||||||
import { AppEvents } from '@grafana/data';
|
import { AppEvents } from '@grafana/data';
|
||||||
import { getAppEvents, getBackendSrv } from '@grafana/runtime';
|
import { getAppEvents, getBackendSrv } from '@grafana/runtime';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { ReactElement } from 'react';
|
import { ReactElement } from 'react';
|
||||||
import { Validate } from 'react-hook-form';
|
import { Validate, UseFormSetValue } from 'react-hook-form';
|
||||||
import { UseFormSetValue } from 'react-hook-form/dist/types/form';
|
|
||||||
|
|
||||||
import { IconName, SelectableValue } from '@grafana/data';
|
import { IconName, SelectableValue } from '@grafana/data';
|
||||||
import { Settings } from 'app/types';
|
import { Settings } from 'app/types';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { findByText, render, screen } from '@testing-library/react';
|
import { findByText, render, screen } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent, { UserEvent } from '@testing-library/user-event';
|
||||||
import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DataSourceInstanceSettings,
|
DataSourceInstanceSettings,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export * from './endpoints.gen';
|
export * from './endpoints.gen';
|
||||||
import { BaseQueryFn, EndpointDefinition } from '@reduxjs/toolkit/dist/query';
|
import { BaseQueryFn, EndpointDefinition } from '@reduxjs/toolkit/query';
|
||||||
|
|
||||||
import { generatedAPI } from './endpoints.gen';
|
import { generatedAPI } from './endpoints.gen';
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { act, render, screen, waitFor } from '@testing-library/react';
|
import { act, render, screen, waitFor } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent, { UserEvent } from '@testing-library/user-event';
|
||||||
import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup';
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
"@grafana/e2e-selectors": "11.4.0-pre",
|
"@grafana/e2e-selectors": "11.4.0-pre",
|
||||||
"@grafana/plugin-configs": "11.4.0-pre",
|
"@grafana/plugin-configs": "11.4.0-pre",
|
||||||
"@testing-library/dom": "10.4.0",
|
"@testing-library/dom": "10.4.0",
|
||||||
|
"@testing-library/jest-dom": "6.6.3",
|
||||||
"@testing-library/react": "16.0.1",
|
"@testing-library/react": "16.0.1",
|
||||||
"@testing-library/user-event": "14.5.2",
|
"@testing-library/user-event": "14.5.2",
|
||||||
"@types/jest": "29.5.14",
|
"@types/jest": "29.5.14",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"jsx": "react-jsx"
|
"jsx": "react-jsx",
|
||||||
|
"types": ["node", "jest", "@testing-library/jest-dom"]
|
||||||
},
|
},
|
||||||
"extends": "@grafana/plugin-configs/tsconfig.json",
|
"extends": "@grafana/plugin-configs/tsconfig.json",
|
||||||
"include": ["."]
|
"include": ["."]
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
"@grafana/e2e-selectors": "11.4.0-pre",
|
"@grafana/e2e-selectors": "11.4.0-pre",
|
||||||
"@grafana/plugin-configs": "11.4.0-pre",
|
"@grafana/plugin-configs": "11.4.0-pre",
|
||||||
"@testing-library/dom": "10.4.0",
|
"@testing-library/dom": "10.4.0",
|
||||||
|
"@testing-library/jest-dom": "6.6.3",
|
||||||
"@testing-library/react": "16.0.1",
|
"@testing-library/react": "16.0.1",
|
||||||
"@testing-library/user-event": "14.5.2",
|
"@testing-library/user-event": "14.5.2",
|
||||||
"@types/debounce-promise": "3.1.9",
|
"@types/debounce-promise": "3.1.9",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"jsx": "react-jsx"
|
"jsx": "react-jsx",
|
||||||
|
"types": ["node", "jest", "@testing-library/jest-dom"]
|
||||||
},
|
},
|
||||||
"extends": "@grafana/plugin-configs/tsconfig.json",
|
"extends": "@grafana/plugin-configs/tsconfig.json",
|
||||||
"include": ["."]
|
"include": ["."]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"moduleResolution": "node",
|
||||||
"module": "commonjs"
|
"module": "commonjs"
|
||||||
},
|
},
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
"useUnknownInCatchVariables": true,
|
"useUnknownInCatchVariables": true,
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
"tsBuildInfoFile": "./tsconfig.tsbuildinfo",
|
"tsBuildInfoFile": "./tsconfig.tsbuildinfo",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"]
|
"@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"]
|
||||||
|
48
yarn.lock
48
yarn.lock
@ -2785,6 +2785,7 @@ __metadata:
|
|||||||
"@grafana/ui": "npm:11.4.0-pre"
|
"@grafana/ui": "npm:11.4.0-pre"
|
||||||
"@kusto/monaco-kusto": "npm:^10.0.0"
|
"@kusto/monaco-kusto": "npm:^10.0.0"
|
||||||
"@testing-library/dom": "npm:10.4.0"
|
"@testing-library/dom": "npm:10.4.0"
|
||||||
|
"@testing-library/jest-dom": "npm:6.6.3"
|
||||||
"@testing-library/react": "npm:16.0.1"
|
"@testing-library/react": "npm:16.0.1"
|
||||||
"@testing-library/user-event": "npm:14.5.2"
|
"@testing-library/user-event": "npm:14.5.2"
|
||||||
"@types/jest": "npm:29.5.14"
|
"@types/jest": "npm:29.5.14"
|
||||||
@ -3075,6 +3076,7 @@ __metadata:
|
|||||||
"@grafana/schema": "npm:11.4.0-pre"
|
"@grafana/schema": "npm:11.4.0-pre"
|
||||||
"@grafana/ui": "npm:11.4.0-pre"
|
"@grafana/ui": "npm:11.4.0-pre"
|
||||||
"@testing-library/dom": "npm:10.4.0"
|
"@testing-library/dom": "npm:10.4.0"
|
||||||
|
"@testing-library/jest-dom": "npm:6.6.3"
|
||||||
"@testing-library/react": "npm:16.0.1"
|
"@testing-library/react": "npm:16.0.1"
|
||||||
"@testing-library/user-event": "npm:14.5.2"
|
"@testing-library/user-event": "npm:14.5.2"
|
||||||
"@types/debounce-promise": "npm:3.1.9"
|
"@types/debounce-promise": "npm:3.1.9"
|
||||||
@ -3990,7 +3992,7 @@ __metadata:
|
|||||||
rc-time-picker: "npm:^3.7.3"
|
rc-time-picker: "npm:^3.7.3"
|
||||||
rc-tooltip: "npm:6.2.1"
|
rc-tooltip: "npm:6.2.1"
|
||||||
react: "npm:18.2.0"
|
react: "npm:18.2.0"
|
||||||
react-calendar: "npm:5.1.0"
|
react-calendar: "npm:^5.1.0"
|
||||||
react-colorful: "npm:5.6.1"
|
react-colorful: "npm:5.6.1"
|
||||||
react-custom-scrollbars-2: "npm:4.5.0"
|
react-custom-scrollbars-2: "npm:4.5.0"
|
||||||
react-dom: "npm:18.2.0"
|
react-dom: "npm:18.2.0"
|
||||||
@ -7242,7 +7244,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@storybook/icons@npm:^1.2.12, @storybook/icons@npm:^1.2.5":
|
"@storybook/icons@npm:^1.2.12":
|
||||||
version: 1.2.12
|
version: 1.2.12
|
||||||
resolution: "@storybook/icons@npm:1.2.12"
|
resolution: "@storybook/icons@npm:1.2.12"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -7252,6 +7254,16 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@storybook/icons@npm:^1.2.5":
|
||||||
|
version: 1.2.9
|
||||||
|
resolution: "@storybook/icons@npm:1.2.9"
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
|
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
|
checksum: 10/e57959b8b542aa3b8e9a6e980cf5280733c04ee6af3121bfc9c0273d005a20557f4e4e2c036dbd6b16f08728a0bcdc16c7685d2dcfe97ec181cc1b409c72414e
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@storybook/manager-api@npm:8.4.4, @storybook/manager-api@npm:^8.0.0, @storybook/manager-api@npm:^8.4.2":
|
"@storybook/manager-api@npm:8.4.4, @storybook/manager-api@npm:^8.0.0, @storybook/manager-api@npm:^8.4.2":
|
||||||
version: 8.4.4
|
version: 8.4.4
|
||||||
resolution: "@storybook/manager-api@npm:8.4.4"
|
resolution: "@storybook/manager-api@npm:8.4.4"
|
||||||
@ -8331,7 +8343,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@testing-library/jest-dom@npm:6.6.3, @testing-library/jest-dom@npm:^6.1.2":
|
"@testing-library/jest-dom@npm:6.6.3":
|
||||||
version: 6.6.3
|
version: 6.6.3
|
||||||
resolution: "@testing-library/jest-dom@npm:6.6.3"
|
resolution: "@testing-library/jest-dom@npm:6.6.3"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -8346,6 +8358,21 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@testing-library/jest-dom@npm:^6.1.2":
|
||||||
|
version: 6.6.1
|
||||||
|
resolution: "@testing-library/jest-dom@npm:6.6.1"
|
||||||
|
dependencies:
|
||||||
|
"@adobe/css-tools": "npm:^4.4.0"
|
||||||
|
aria-query: "npm:^5.0.0"
|
||||||
|
chalk: "npm:^3.0.0"
|
||||||
|
css.escape: "npm:^1.5.1"
|
||||||
|
dom-accessibility-api: "npm:^0.6.3"
|
||||||
|
lodash: "npm:^4.17.21"
|
||||||
|
redent: "npm:^3.0.0"
|
||||||
|
checksum: 10/006357d7547cc50624564a1b0e9986d0f0252365a6e5ac1c7c989032159c47226adfbd9a9ac17eef236738e9597541d344176176b5c3ed0e06e8f4b33387e135
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"@testing-library/react-hooks@npm:^8.0.1":
|
"@testing-library/react-hooks@npm:^8.0.1":
|
||||||
version: 8.0.1
|
version: 8.0.1
|
||||||
resolution: "@testing-library/react-hooks@npm:8.0.1"
|
resolution: "@testing-library/react-hooks@npm:8.0.1"
|
||||||
@ -9961,14 +9988,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/types@npm:8.14.0, @typescript-eslint/types@npm:^8.9.0":
|
"@typescript-eslint/types@npm:8.14.0":
|
||||||
version: 8.14.0
|
version: 8.14.0
|
||||||
resolution: "@typescript-eslint/types@npm:8.14.0"
|
resolution: "@typescript-eslint/types@npm:8.14.0"
|
||||||
checksum: 10/1924aef8efdf5399d6cc9ef3a5307fda39b1a2be129ab8cb24a46dc0a37156230e77f2809ab709d5d0a43891b6ffd67ce45292724e8f8164ac19e1786c5f4644
|
checksum: 10/1924aef8efdf5399d6cc9ef3a5307fda39b1a2be129ab8cb24a46dc0a37156230e77f2809ab709d5d0a43891b6ffd67ce45292724e8f8164ac19e1786c5f4644
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@typescript-eslint/types@npm:8.9.0":
|
"@typescript-eslint/types@npm:8.9.0, @typescript-eslint/types@npm:^8.9.0":
|
||||||
version: 8.9.0
|
version: 8.9.0
|
||||||
resolution: "@typescript-eslint/types@npm:8.9.0"
|
resolution: "@typescript-eslint/types@npm:8.9.0"
|
||||||
checksum: 10/4d087153605ec23c980f9bc807b122edefff828e0c3b52ef531f4b8e1d30078c39f95e84019370a395bf97eed0d7886cc50b8cd545c287f8a2a21b301272377a
|
checksum: 10/4d087153605ec23c980f9bc807b122edefff828e0c3b52ef531f4b8e1d30078c39f95e84019370a395bf97eed0d7886cc50b8cd545c287f8a2a21b301272377a
|
||||||
@ -24738,7 +24765,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"react-calendar@npm:5.1.0":
|
"react-calendar@npm:^5.1.0":
|
||||||
version: 5.1.0
|
version: 5.1.0
|
||||||
resolution: "react-calendar@npm:5.1.0"
|
resolution: "react-calendar@npm:5.1.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -28986,7 +29013,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"tslib@npm:2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.4.1, tslib@npm:^2.6.2, tslib@npm:^2.7.0, tslib@npm:^2.8.0":
|
"tslib@npm:2, tslib@npm:^2.7.0, tslib@npm:^2.8.0":
|
||||||
version: 2.8.1
|
version: 2.8.1
|
||||||
resolution: "tslib@npm:2.8.1"
|
resolution: "tslib@npm:2.8.1"
|
||||||
checksum: 10/3e2e043d5c2316461cb54e5c7fe02c30ef6dccb3384717ca22ae5c6b5bc95232a6241df19c622d9c73b809bea33b187f6dbc73030963e29950c2141bc32a79f7
|
checksum: 10/3e2e043d5c2316461cb54e5c7fe02c30ef6dccb3384717ca22ae5c6b5bc95232a6241df19c622d9c73b809bea33b187f6dbc73030963e29950c2141bc32a79f7
|
||||||
@ -29021,6 +29048,13 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.4.1, tslib@npm:^2.6.2":
|
||||||
|
version: 2.8.0
|
||||||
|
resolution: "tslib@npm:2.8.0"
|
||||||
|
checksum: 10/1bc7c43937477059b4d26f2dbde7e49ef0fb4f38f3014e0603eaea76d6a885742c8b1762af45949145e5e7408a736d20ded949da99dabc8ccba1fc5531d2d927
|
||||||
|
languageName: node
|
||||||
|
linkType: hard
|
||||||
|
|
||||||
"tsutils@npm:^3.21.0":
|
"tsutils@npm:^3.21.0":
|
||||||
version: 3.21.0
|
version: 3.21.0
|
||||||
resolution: "tsutils@npm:3.21.0"
|
resolution: "tsutils@npm:3.21.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user