diff --git a/package.json b/package.json index 4a0c286cd52..8cd3a59251b 100644 --- a/package.json +++ b/package.json @@ -53,9 +53,9 @@ "watch": "yarn start -d watch,start core:start --watchTheme", "ci:test-frontend": "yarn run test:ci", "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: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: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", diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index af7a754703a..68c418c2813 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -89,7 +89,7 @@ "rc-slider": "11.1.7", "rc-time-picker": "^3.7.3", "rc-tooltip": "6.2.1", - "react-calendar": "5.1.0", + "react-calendar": "^5.1.0", "react-colorful": "5.6.1", "react-custom-scrollbars-2": "4.5.0", "react-dropzone": "14.3.5", diff --git a/public/app/features/auth-config/components/ServerDiscoveryField.tsx b/public/app/features/auth-config/components/ServerDiscoveryField.tsx index 5c8a2e3f441..71dd8f7a70f 100644 --- a/public/app/features/auth-config/components/ServerDiscoveryField.tsx +++ b/public/app/features/auth-config/components/ServerDiscoveryField.tsx @@ -1,5 +1,5 @@ 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 { getAppEvents, getBackendSrv } from '@grafana/runtime'; diff --git a/public/app/features/auth-config/types.ts b/public/app/features/auth-config/types.ts index e35622b06c5..7f15496ecd7 100644 --- a/public/app/features/auth-config/types.ts +++ b/public/app/features/auth-config/types.ts @@ -1,6 +1,5 @@ import { ReactElement } from 'react'; -import { Validate } from 'react-hook-form'; -import { UseFormSetValue } from 'react-hook-form/dist/types/form'; +import { Validate, UseFormSetValue } from 'react-hook-form'; import { IconName, SelectableValue } from '@grafana/data'; import { Settings } from 'app/types'; diff --git a/public/app/features/datasources/components/picker/DataSourcePicker.test.tsx b/public/app/features/datasources/components/picker/DataSourcePicker.test.tsx index d6accb33324..727cd1a2e59 100644 --- a/public/app/features/datasources/components/picker/DataSourcePicker.test.tsx +++ b/public/app/features/datasources/components/picker/DataSourcePicker.test.tsx @@ -1,6 +1,5 @@ import { findByText, render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup'; +import userEvent, { UserEvent } from '@testing-library/user-event'; import { DataSourceInstanceSettings, diff --git a/public/app/features/migrate-to-cloud/api/index.ts b/public/app/features/migrate-to-cloud/api/index.ts index 85af33ebdfd..c39331c8edb 100644 --- a/public/app/features/migrate-to-cloud/api/index.ts +++ b/public/app/features/migrate-to-cloud/api/index.ts @@ -1,5 +1,5 @@ export * from './endpoints.gen'; -import { BaseQueryFn, EndpointDefinition } from '@reduxjs/toolkit/dist/query'; +import { BaseQueryFn, EndpointDefinition } from '@reduxjs/toolkit/query'; import { generatedAPI } from './endpoints.gen'; diff --git a/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/Filters.test.tsx b/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/Filters.test.tsx index c53a21e423c..9ae9327dae4 100644 --- a/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/Filters.test.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/Filters.test.tsx @@ -1,6 +1,5 @@ import { act, render, screen, waitFor } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; -import { UserEvent } from '@testing-library/user-event/dist/types/setup/setup'; +import userEvent, { UserEvent } from '@testing-library/user-event'; import * as React from 'react'; import { of } from 'rxjs'; diff --git a/public/app/plugins/datasource/azuremonitor/package.json b/public/app/plugins/datasource/azuremonitor/package.json index 0f5ddb846d7..1bebca032ee 100644 --- a/public/app/plugins/datasource/azuremonitor/package.json +++ b/public/app/plugins/datasource/azuremonitor/package.json @@ -28,6 +28,7 @@ "@grafana/e2e-selectors": "11.4.0-pre", "@grafana/plugin-configs": "11.4.0-pre", "@testing-library/dom": "10.4.0", + "@testing-library/jest-dom": "6.6.3", "@testing-library/react": "16.0.1", "@testing-library/user-event": "14.5.2", "@types/jest": "29.5.14", diff --git a/public/app/plugins/datasource/azuremonitor/tsconfig.json b/public/app/plugins/datasource/azuremonitor/tsconfig.json index baaaea04185..40352099203 100644 --- a/public/app/plugins/datasource/azuremonitor/tsconfig.json +++ b/public/app/plugins/datasource/azuremonitor/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "jsx": "react-jsx" + "jsx": "react-jsx", + "types": ["node", "jest", "@testing-library/jest-dom"] }, "extends": "@grafana/plugin-configs/tsconfig.json", "include": ["."] diff --git a/public/app/plugins/datasource/cloud-monitoring/package.json b/public/app/plugins/datasource/cloud-monitoring/package.json index 7b505cd0eda..b8e82012218 100644 --- a/public/app/plugins/datasource/cloud-monitoring/package.json +++ b/public/app/plugins/datasource/cloud-monitoring/package.json @@ -29,6 +29,7 @@ "@grafana/e2e-selectors": "11.4.0-pre", "@grafana/plugin-configs": "11.4.0-pre", "@testing-library/dom": "10.4.0", + "@testing-library/jest-dom": "6.6.3", "@testing-library/react": "16.0.1", "@testing-library/user-event": "14.5.2", "@types/debounce-promise": "3.1.9", diff --git a/public/app/plugins/datasource/cloud-monitoring/tsconfig.json b/public/app/plugins/datasource/cloud-monitoring/tsconfig.json index baaaea04185..40352099203 100644 --- a/public/app/plugins/datasource/cloud-monitoring/tsconfig.json +++ b/public/app/plugins/datasource/cloud-monitoring/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { - "jsx": "react-jsx" + "jsx": "react-jsx", + "types": ["node", "jest", "@testing-library/jest-dom"] }, "extends": "@grafana/plugin-configs/tsconfig.json", "include": ["."] diff --git a/scripts/cli/tsconfig.json b/scripts/cli/tsconfig.json index be60908b35d..9ad59a649d1 100644 --- a/scripts/cli/tsconfig.json +++ b/scripts/cli/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "moduleResolution": "node", "module": "commonjs" }, "extends": "../../tsconfig.json", diff --git a/tsconfig.json b/tsconfig.json index c24104df189..42db6464f66 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,7 @@ "useUnknownInCatchVariables": true, "incremental": true, "isolatedModules": true, + "moduleResolution": "bundler", "tsBuildInfoFile": "./tsconfig.tsbuildinfo", "paths": { "@grafana/schema/dist/esm/*": ["../packages/grafana-schema/src/*"] diff --git a/yarn.lock b/yarn.lock index 5dfb36f7583..b24653cca4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2785,6 +2785,7 @@ __metadata: "@grafana/ui": "npm:11.4.0-pre" "@kusto/monaco-kusto": "npm:^10.0.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/user-event": "npm:14.5.2" "@types/jest": "npm:29.5.14" @@ -3075,6 +3076,7 @@ __metadata: "@grafana/schema": "npm:11.4.0-pre" "@grafana/ui": "npm:11.4.0-pre" "@testing-library/dom": "npm:10.4.0" + "@testing-library/jest-dom": "npm:6.6.3" "@testing-library/react": "npm:16.0.1" "@testing-library/user-event": "npm:14.5.2" "@types/debounce-promise": "npm:3.1.9" @@ -3990,7 +3992,7 @@ __metadata: rc-time-picker: "npm:^3.7.3" rc-tooltip: "npm:6.2.1" react: "npm:18.2.0" - react-calendar: "npm:5.1.0" + react-calendar: "npm:^5.1.0" react-colorful: "npm:5.6.1" react-custom-scrollbars-2: "npm:4.5.0" react-dom: "npm:18.2.0" @@ -7242,7 +7244,7 @@ __metadata: languageName: node linkType: hard -"@storybook/icons@npm:^1.2.12, @storybook/icons@npm:^1.2.5": +"@storybook/icons@npm:^1.2.12": version: 1.2.12 resolution: "@storybook/icons@npm:1.2.12" peerDependencies: @@ -7252,6 +7254,16 @@ __metadata: languageName: node 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": version: 8.4.4 resolution: "@storybook/manager-api@npm:8.4.4" @@ -8331,7 +8343,7 @@ __metadata: languageName: node 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 resolution: "@testing-library/jest-dom@npm:6.6.3" dependencies: @@ -8346,6 +8358,21 @@ __metadata: languageName: node 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": version: 8.0.1 resolution: "@testing-library/react-hooks@npm:8.0.1" @@ -9961,14 +9988,14 @@ __metadata: languageName: node 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 resolution: "@typescript-eslint/types@npm:8.14.0" checksum: 10/1924aef8efdf5399d6cc9ef3a5307fda39b1a2be129ab8cb24a46dc0a37156230e77f2809ab709d5d0a43891b6ffd67ce45292724e8f8164ac19e1786c5f4644 languageName: node 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 resolution: "@typescript-eslint/types@npm:8.9.0" checksum: 10/4d087153605ec23c980f9bc807b122edefff828e0c3b52ef531f4b8e1d30078c39f95e84019370a395bf97eed0d7886cc50b8cd545c287f8a2a21b301272377a @@ -24738,7 +24765,7 @@ __metadata: languageName: node linkType: hard -"react-calendar@npm:5.1.0": +"react-calendar@npm:^5.1.0": version: 5.1.0 resolution: "react-calendar@npm:5.1.0" dependencies: @@ -28986,7 +29013,7 @@ __metadata: languageName: node 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 resolution: "tslib@npm:2.8.1" checksum: 10/3e2e043d5c2316461cb54e5c7fe02c30ef6dccb3384717ca22ae5c6b5bc95232a6241df19c622d9c73b809bea33b187f6dbc73030963e29950c2141bc32a79f7 @@ -29021,6 +29048,13 @@ __metadata: languageName: node 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": version: 3.21.0 resolution: "tsutils@npm:3.21.0"