mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Build: Introduce ESM and Treeshaking to NPM package builds (#51517)
* Revert "Chore: Bump terser to fix security vulnerability (#53052)"
This reverts commit 7ae74d2a18
.
* feat: use tsc and rollup directly with esbuild and publishConfig, files props
* refactor(grafana-data): fix isolatedModules re-export type error
* refactor(grafana-data): import paths from src not package name
* refactor(rollup): fix dts output.file
* chore(grafana-schema): delete dashboard_experimental.gen.ts - cannot work with isolatedModules
* refactor(grafana-e2e-selectors): fix export types isolatedModules error
* refactor(grafana-runtime): fix isolatedModules re-export type error
* refactor(grafana-ui): fix isolatedModules re-export type error
* feat(grafana-ui): use named imports for treeshaking
* refactor(grafana-ui): use named imports for treeshaking
* feat: react and react-dom as peerDeps for packages
* feat(grafana-ui): emotion packages as peerDeps
* feat(grafana-e2e): use tsc, rollup, esbuild for bundling
* chore(packages): clean up redundant dependencies
* chore(toolkit): deprecate unused package:build task
* chore(schema): put back dashboard_experimental and exclude to prevent isolatedModules error
* docs(packages): update readme
* chore(storybook): disable isolatedModules for builds
* chore: relax peerDeps for emotion and react
* revert(grafana-ui): put @emotion dependencies back
* refactor: replace relative package imports with package name
* build(packages): set emitDeclaration false for typecheck scripts to work
* test(publicdashboarddatasource): move test next to implementation. try to appease the betterer gods
* chore(storybook): override ts-node config for storybook compilation
* refactor(grafana-data): use ternary so babel doesnt complain about expecting flow types
* chore(toolkit): prefer files and publishConfig package.json props over copying
* build(npm): remove --contents dist arg from publishing commands
* chore(packages): introduce sideEffects prop to package.json to hint package can be treeshaken
* chore(packages): remove redundant index.js files
* feat(packages): set publishConfig.access to public
* feat(packages): use yarn berry and npm for packaging and publishing
* refactor(packages): simplify rollup configs
* chore(schema): add comment explaining need to exclude dashboard_experimental
* revert(toolkit): put back clean to prevent cli failures
* ci(packages): run packages:pack before a canary publish
* chore(gitignore): add npm-artifacts directory to ignore list
* test(publicdashboarddatasource): fix module mocking
* chore(packages): delete package.tgz when running clean
* chore(grafana-data): move dependencies from devDeps to prevent build resolution errors
This commit is contained in:
parent
610abc2af0
commit
d87bf30e9e
@ -1267,9 +1267,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"]
|
||||
],
|
||||
"packages/grafana-toolkit/src/cli/tasks/toolkit.build.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"packages/grafana-toolkit/src/cli/utils/githubRelease.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -125,6 +125,9 @@ pkg/cmd/grafana-server/__debug_bin
|
||||
/packages/**/compiled
|
||||
/packages/**/.rpt2_cache
|
||||
/packages/**/tsdoc-metadata.json
|
||||
/packages/**/package.tgz
|
||||
## CI places the packages in a different location
|
||||
/npm-artifacts/*.tgz
|
||||
|
||||
# Ignore go local build dependencies
|
||||
/scripts/go/bin/**
|
||||
|
@ -1,3 +0,0 @@
|
||||
FROM tutum/nginx
|
||||
RUN rm /etc/nginx/sites-enabled/default
|
||||
ADD sites-enabled /etc/nginx/sites-enabled
|
@ -1,14 +0,0 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
access_log /var/log/nginx/verdaccio.log;
|
||||
charset utf-8;
|
||||
location / {
|
||||
proxy_pass http://grafana-npm.local:4873/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-NginX-Proxy true;
|
||||
proxy_ssl_session_reuse off;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
}
|
||||
}
|
@ -2,25 +2,13 @@ version: '2'
|
||||
|
||||
services:
|
||||
verdaccio:
|
||||
image: verdaccio/verdaccio:4
|
||||
container_name: verdaccio_root_path
|
||||
image: verdaccio/verdaccio:5
|
||||
container_name: verdaccio
|
||||
ports:
|
||||
- "4873:4873"
|
||||
volumes:
|
||||
- verdaccio:/verdaccio
|
||||
|
||||
nginx:
|
||||
restart: always
|
||||
build: conf/nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- /www/public
|
||||
volumes_from:
|
||||
- verdaccio
|
||||
links:
|
||||
- verdaccio:verdaccio
|
||||
|
||||
volumes:
|
||||
verdaccio:
|
||||
driver: local
|
||||
|
17
package.json
17
package.json
@ -23,18 +23,19 @@
|
||||
"lint:sass": "yarn stylelint '{public/sass,packages}/**/*.scss' --cache",
|
||||
"test:ci": "yarn i18n:compile && mkdir -p reports/junit && JEST_JUNIT_OUTPUT_DIR=reports/junit jest --ci --reporters=default --reporters=jest-junit -w ${TEST_MAX_WORKERS:-100%}",
|
||||
"lint:fix": "yarn lint:ts --fix",
|
||||
"packages:build": "lerna run clean && lerna run build --ignore @grafana-plugins/input-datasource",
|
||||
"packages:build": "lerna run build --ignore @grafana-plugins/input-datasource",
|
||||
"packages:clean": "lerna run clean --parallel",
|
||||
"packages:docsExtract": "rm -rf ./reports/docs && lerna run docsExtract",
|
||||
"packages:docsToMarkdown": "api-documenter markdown --input-folder ./reports/docs/ --output-folder ./docs/sources/packages_api/ --hugo",
|
||||
"packages:prepare": "lerna version --no-push --no-git-tag-version --force-publish --exact",
|
||||
"packages:publish": "lerna publish from-package --contents dist --no-verify-access",
|
||||
"packages:publishCanary": "lerna publish from-package --contents dist --dist-tag canary --yes --no-verify-access",
|
||||
"packages:publishLatest": "lerna publish from-package --contents dist --yes --no-verify-access",
|
||||
"packages:publishNext": "lerna publish from-package --contents dist --dist-tag next --yes --no-verify-access",
|
||||
"packages:publishTest": "lerna publish from-package --contents dist --dist-tag test --yes --no-verify-access",
|
||||
"packages:publishDev": "lerna publish from-package --contents dist --dist-tag dev --yes --registry http://localhost:4873",
|
||||
"packages:pack": "lerna exec --no-private -- yarn pack",
|
||||
"packages:publish": "lerna exec --no-private -- npm publish package.tgz",
|
||||
"packages:publishCanary": "lerna exec --no-private -- npm publish package.tgz --tag canary",
|
||||
"packages:publishLatest": "lerna exec --no-private -- npm publish package.tgz",
|
||||
"packages:publishNext": "lerna exec --no-private -- npm publish package.tgz --tag next",
|
||||
"packages:publishTest": "lerna exec --no-private -- npm publish package.tgz --tag test",
|
||||
"packages:publishDev": "lerna exec --no-private -- npm publish package.tgz --tag dev --registry http://localhost:4873",
|
||||
"packages:typecheck": "lerna run typecheck",
|
||||
"packages:clean": "lerna run clean",
|
||||
"precommit": "yarn run lint-staged",
|
||||
"prettier:check": "prettier --check --list-different=false --loglevel=warn \"**/*.{ts,tsx,scss,md,mdx}\"",
|
||||
"prettier:checkDocs": "prettier --check --list-different=false --loglevel=warn \"docs/**/*.md\" \"*.md\" \"packages/**/*.{ts,tsx,scss,md,mdx}\"",
|
||||
|
@ -26,10 +26,10 @@ Alpha and beta releases are published under the `next` tag on npm.
|
||||
|
||||
### Automatic prereleases
|
||||
|
||||
Every commit to main that has changes within the `packages` directory is a subject of npm packages release. _ALL_ packages must be released under version from lerna.json file with commit SHA added to it:
|
||||
Every commit to main that has changes within the `packages` directory is a subject of npm packages release. _ALL_ packages must be released under version from lerna.json file with the drone build number added to it:
|
||||
|
||||
```
|
||||
<lerna.json version>-<COMMIT_SHA>
|
||||
<lerna.json version>-<DRONE_BUILD_NUMBER>
|
||||
```
|
||||
|
||||
### Manual release
|
||||
@ -41,8 +41,8 @@ Every commit to main that has changes within the `packages` directory is a subje
|
||||
1. Run `yarn packages:prepare` script from the root directory. This performs tests on the packages and prompts for the version of the packages. The version should be the same as the one being released.
|
||||
- Make sure you use semver convention. So, _place a dot between prerelease id and prerelease number_, i.e. 6.3.0-alpha.1
|
||||
- Make sure you confirm the version bump when prompted!
|
||||
2. Commit changes (lerna.json and package.json files) - _"Packages version update: \<VERSION\>"_
|
||||
3. Run `yarn packages:build` script that prepares distribution packages in `packages/grafana-*/dist`. These directories are going to be published to npm.
|
||||
2. Run `yarn packages:build` script that compiles distribution code in `packages/grafana-*/dist`.
|
||||
3. Run `yarn packages:pack` script to zip each package into `.tgz`. This is required for yarn berry to replace properties in the package.json files declared in `publishConfig`.
|
||||
4. Depending whether or not it's a prerelease:
|
||||
|
||||
- When releasing a prerelease run `packages:publishNext` to publish new versions.
|
||||
@ -56,7 +56,7 @@ Every commit to main that has changes within the `packages` directory is a subje
|
||||
To build individual packages, run:
|
||||
|
||||
```
|
||||
grafana-toolkit package:build --scope=<ui|toolkit|runtime|data>
|
||||
yarn packages:build --scope=@grafana/<data|e2e|e2e-selectors|runtime|schema|toolkit|ui>
|
||||
```
|
||||
|
||||
### Setting up @grafana/\* packages for local development
|
||||
@ -71,11 +71,10 @@ In this guide you will set up [Verdaccio](https://verdaccio.org/) registry local
|
||||
|
||||
From your terminal:
|
||||
|
||||
1. Modify `/etc/hosts` file and add the following entry: `127.0.0.1 grafana-npm.local`
|
||||
2. Navigate to `devenv/local-npm` directory.
|
||||
3. Run `docker-compose up`. This will start your local npm registry, available at http://grafana-npm.local:4873/
|
||||
4. Run `npm login --registry=http://grafana-npm.local:4873 --scope=@grafana` . This will allow you to publish any @grafana/\* package into the local registry.
|
||||
5. Run `npm config set @grafana:registry http://grafana-npm.local:4873`. This will config your npm to install @grafana scoped packages from your local registry.
|
||||
1. Navigate to `devenv/local-npm` directory.
|
||||
2. Run `docker-compose up`. This will start your local npm registry, available at http://localhost:4873/
|
||||
3. Run `npm login --registry=http://localhost:4873 --scope=@grafana` . This will allow you to publish any @grafana/\* package into the local registry.
|
||||
4. Run `npm config set @grafana:registry http://localhost:4873`. This will config your npm to install @grafana scoped packages from your local registry.
|
||||
|
||||
#### Publishing packages to local npm registry
|
||||
|
||||
@ -84,18 +83,18 @@ You need to follow [manual packages release procedure](#manual-release). The onl
|
||||
From your terminal:
|
||||
|
||||
1. Run `yarn packages:prepare`.
|
||||
2. Commit changes in package.json and lerna.json files
|
||||
3. Build packages: `yarn packages:build`
|
||||
2. Run `yarn packages:build`.
|
||||
3. Run `yarn packages:pack`.
|
||||
4. Run `yarn packages:publishDev`.
|
||||
5. Navigate to http://grafana-npm.local:4873 and verify that version was published
|
||||
5. Navigate to http://localhost:4873 and verify that version was published
|
||||
|
||||
Locally published packages will be published under `dev` channel, so in your plugin package.json file you can use that channel. For example:
|
||||
|
||||
```
|
||||
// plugin's package.json
|
||||
|
||||
{
|
||||
...
|
||||
dependencies: {
|
||||
//... other dependencies
|
||||
"@grafana/data": "dev"
|
||||
}
|
||||
```
|
||||
|
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./index.production.js');
|
||||
} else {
|
||||
module.exports = require('./index.development.js');
|
||||
}
|
@ -7,18 +7,30 @@
|
||||
"keywords": [
|
||||
"typescript"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/grafana/grafana.git",
|
||||
"directory": "packages/grafana-data"
|
||||
},
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE_APACHE2"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "grafana-toolkit package:build --scope=data",
|
||||
"bundle": "rollup -c rollup.config.ts",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"build": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.ts",
|
||||
"clean": "rimraf ./dist ./compiled ./package.tgz",
|
||||
"docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": "6.0.0",
|
||||
@ -27,16 +39,16 @@
|
||||
"d3-interpolate": "1.4.0",
|
||||
"date-fns": "2.29.1",
|
||||
"eventemitter3": "4.0.7",
|
||||
"history": "4.10.1",
|
||||
"lodash": "4.17.21",
|
||||
"marked": "4.0.18",
|
||||
"moment": "2.29.4",
|
||||
"moment-timezone": "0.5.34",
|
||||
"ol": "6.15.1",
|
||||
"papaparse": "5.3.2",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"regenerator-runtime": "0.13.9",
|
||||
"rxjs": "7.5.6",
|
||||
"tinycolor2": "1.4.2",
|
||||
"tslib": "2.4.0",
|
||||
"uplot": "1.6.22",
|
||||
"xss": "1.0.13"
|
||||
@ -65,14 +77,20 @@
|
||||
"@types/testing-library__jest-dom": "5.14.5",
|
||||
"@types/testing-library__react-hooks": "^3.2.0",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"history": "4.10.1",
|
||||
"esbuild": "^0.14.47",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.77.2",
|
||||
"rollup-plugin-sourcemaps": "0.6.3",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"rollup-plugin-dts": "^4.2.2",
|
||||
"rollup-plugin-esbuild": "^4.9.1",
|
||||
"rollup-plugin-node-externals": "^4.1.0",
|
||||
"sinon": "14.0.0",
|
||||
"tinycolor2": "1.4.2",
|
||||
"typescript": "4.7.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,44 +1,37 @@
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import json from '@rollup/plugin-json';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import path from 'path';
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
import { externals } from 'rollup-plugin-node-externals';
|
||||
|
||||
const pkg = require('./package.json');
|
||||
|
||||
const libraryName = pkg.name;
|
||||
|
||||
const buildCjsPackage = ({ env }) => {
|
||||
return {
|
||||
input: `compiled/index.js`,
|
||||
export default [
|
||||
{
|
||||
input: 'src/index.ts',
|
||||
plugins: [externals({ deps: true, packagePath: './package.json' }), resolve(), esbuild()],
|
||||
output: [
|
||||
{
|
||||
file: `dist/index.${env}.js`,
|
||||
name: libraryName,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
globals: {},
|
||||
dir: path.dirname(pkg.publishConfig.main),
|
||||
},
|
||||
{
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
dir: path.dirname(pkg.publishConfig.module),
|
||||
preserveModules: true,
|
||||
// @ts-expect-error (TS cannot assure that `process.env.PROJECT_CWD` is a string)
|
||||
preserveModulesRoot: path.join(process.env.PROJECT_CWD, `packages/grafana-data/src`),
|
||||
},
|
||||
],
|
||||
external: [
|
||||
'lodash',
|
||||
'rxjs',
|
||||
'@grafana/schema', // Load from host
|
||||
],
|
||||
plugins: [
|
||||
resolve(),
|
||||
json({
|
||||
include: [path.relative('.', require.resolve('moment-timezone/data/packed/latest.json'))], // absolute path throws an error for whatever reason
|
||||
}),
|
||||
commonjs({
|
||||
include: /node_modules/,
|
||||
}),
|
||||
resolve(),
|
||||
sourceMaps(),
|
||||
env === 'production' && terser(),
|
||||
],
|
||||
};
|
||||
};
|
||||
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|
||||
},
|
||||
{
|
||||
input: './compiled/index.d.ts',
|
||||
plugins: [dts()],
|
||||
output: {
|
||||
file: pkg.publishConfig.types,
|
||||
format: 'es',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -8,4 +8,4 @@ export * from './formatter';
|
||||
export * from './parser';
|
||||
export * from './durationutil';
|
||||
export { dateMath, rangeUtil };
|
||||
export { DateTimeOptions, setTimeZoneResolver, TimeZoneResolver, getTimeZone } from './common';
|
||||
export { type DateTimeOptions, setTimeZoneResolver, type TimeZoneResolver, getTimeZone } from './common';
|
||||
|
@ -7,7 +7,7 @@ export {
|
||||
getFieldColorModeForField,
|
||||
getFieldColorMode,
|
||||
fieldColorModeRegistry,
|
||||
FieldColorMode,
|
||||
type FieldColorMode,
|
||||
getFieldSeriesColor,
|
||||
} from './fieldColor';
|
||||
export { FieldConfigOptionsRegistry } from './FieldConfigOptionsRegistry';
|
||||
|
@ -17,12 +17,12 @@ export * from './themes';
|
||||
export * from './monaco';
|
||||
export * from './geo/layer';
|
||||
export {
|
||||
ValueMatcherOptions,
|
||||
BasicValueMatcherOptions,
|
||||
RangeValueMatcherOptions,
|
||||
type ValueMatcherOptions,
|
||||
type BasicValueMatcherOptions,
|
||||
type RangeValueMatcherOptions,
|
||||
} from './transformations/matchers/valueMatchers/types';
|
||||
export { LayoutModes, LayoutMode } from './types/layout';
|
||||
export { PanelPlugin, SetFieldConfigOptionsArgs, StandardOptionConfig } from './panel/PanelPlugin';
|
||||
export { LayoutModes, type LayoutMode } from './types/layout';
|
||||
export { PanelPlugin, type SetFieldConfigOptionsArgs, type StandardOptionConfig } from './panel/PanelPlugin';
|
||||
export { createFieldConfigRegistry } from './panel/registryFactories';
|
||||
export { QueryRunner, QueryRunnerOptions } from './types/queryRunner';
|
||||
export { GroupingToMatrixTransformerOptions } from './transformations/transformers/groupingToMatrix';
|
||||
export { type QueryRunner, type QueryRunnerOptions } from './types/queryRunner';
|
||||
export { type GroupingToMatrixTransformerOptions } from './transformations/transformers/groupingToMatrix';
|
||||
|
@ -36,13 +36,7 @@ export interface ThemeVizHue {
|
||||
* @internal
|
||||
*/
|
||||
export function createVisualizationColors(colors: ThemeColors): ThemeVisualizationColors {
|
||||
let hues: ThemeVizHue[] = [];
|
||||
|
||||
if (colors.mode === 'dark') {
|
||||
hues = getDarkHues();
|
||||
} else if (colors.mode === 'light') {
|
||||
hues = getLightHues();
|
||||
}
|
||||
const hues = colors.mode === 'light' ? getLightHues() : getDarkHues();
|
||||
|
||||
const byNameIndex: Record<string, string> = {};
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
export { createTheme } from './createTheme';
|
||||
export { ThemeRichColor, GrafanaTheme2 } from './types';
|
||||
export { ThemeColors } from './createColors';
|
||||
export { ThemeBreakpoints, ThemeBreakpointsKey } from './breakpoints';
|
||||
export { ThemeShadows } from './createShadows';
|
||||
export { ThemeShape } from './createShape';
|
||||
export { ThemeTypography, ThemeTypographyVariant } from './createTypography';
|
||||
export { ThemeTransitions } from './createTransitions';
|
||||
export { ThemeSpacing } from './createSpacing';
|
||||
export { ThemeZIndices } from './zIndex';
|
||||
export { ThemeVisualizationColors, ThemeVizColor, ThemeVizHue } from './createVisualizationColors';
|
||||
export type { ThemeRichColor, GrafanaTheme2 } from './types';
|
||||
export type { ThemeColors } from './createColors';
|
||||
export type { ThemeBreakpoints, ThemeBreakpointsKey } from './breakpoints';
|
||||
export type { ThemeShadows } from './createShadows';
|
||||
export type { ThemeShape } from './createShape';
|
||||
export type { ThemeTypography, ThemeTypographyVariant } from './createTypography';
|
||||
export type { ThemeTransitions } from './createTransitions';
|
||||
export type { ThemeSpacing } from './createSpacing';
|
||||
export type { ThemeZIndices } from './zIndex';
|
||||
export type { ThemeVisualizationColors, ThemeVizColor, ThemeVizHue } from './createVisualizationColors';
|
||||
|
||||
/** Exporting the module like this to be able to generate docs properly. */
|
||||
import * as colorManipulator from './colorManipulator';
|
||||
|
@ -5,12 +5,16 @@ export { standardTransformers } from './transformers';
|
||||
export * from './fieldReducer';
|
||||
export { transformDataFrame } from './transformDataFrame';
|
||||
export {
|
||||
TransformerRegistryItem,
|
||||
TransformerUIProps,
|
||||
type TransformerRegistryItem,
|
||||
type TransformerUIProps,
|
||||
standardTransformersRegistry,
|
||||
} from './standardTransformersRegistry';
|
||||
export { RegexpOrNamesMatcherOptions, ByNamesMatcherOptions, ByNamesMatcherMode } from './matchers/nameMatcher';
|
||||
export { RenameByRegexTransformerOptions } from './transformers/renameByRegex';
|
||||
export {
|
||||
type RegexpOrNamesMatcherOptions,
|
||||
type ByNamesMatcherOptions,
|
||||
ByNamesMatcherMode,
|
||||
} from './matchers/nameMatcher';
|
||||
export type { RenameByRegexTransformerOptions } from './transformers/renameByRegex';
|
||||
export { outerJoinDataFrames } from './transformers/joinDataFrames';
|
||||
export * from './transformers/histogram';
|
||||
export { ensureTimeField } from './transformers/convertFieldType';
|
||||
|
@ -1,7 +1,5 @@
|
||||
import { DataTransformerConfig } from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe/processDataFrame';
|
||||
import { Field, FieldType } from '../../types';
|
||||
import { DataTransformerConfig, Field, FieldType } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { ArrayVector } from '../../vector';
|
||||
import { ReducerID } from '../fieldReducer';
|
||||
|
@ -1,16 +1,11 @@
|
||||
import {
|
||||
ArrayVector,
|
||||
DataTransformerConfig,
|
||||
DataTransformerID,
|
||||
Field,
|
||||
FieldType,
|
||||
toDataFrame,
|
||||
transformDataFrame,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe';
|
||||
import { DataTransformerConfig, FieldType, Field } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { ArrayVector } from '../../vector';
|
||||
import { transformDataFrame } from '../transformDataFrame';
|
||||
|
||||
import { GroupingToMatrixTransformerOptions, groupingToMatrixTransformer } from './groupingToMatrix';
|
||||
import { DataTransformerID } from './ids';
|
||||
|
||||
describe('Grouping to Matrix', () => {
|
||||
beforeAll(() => {
|
||||
|
@ -1,14 +1,10 @@
|
||||
import {
|
||||
ArrayVector,
|
||||
DataTransformerConfig,
|
||||
DataTransformerID,
|
||||
FieldType,
|
||||
toDataFrame,
|
||||
transformDataFrame,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe';
|
||||
import { FieldType, DataTransformerConfig } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { ArrayVector } from '../../vector';
|
||||
import { transformDataFrame } from '../transformDataFrame';
|
||||
|
||||
import { DataTransformerID } from './ids';
|
||||
import { orderFieldsTransformer, OrderFieldsTransformerOptions } from './order';
|
||||
|
||||
describe('Order Transformer', () => {
|
||||
|
@ -1,14 +1,10 @@
|
||||
import {
|
||||
ArrayVector,
|
||||
DataTransformerConfig,
|
||||
DataTransformerID,
|
||||
FieldType,
|
||||
toDataFrame,
|
||||
transformDataFrame,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe';
|
||||
import { FieldType, DataTransformerConfig } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { ArrayVector } from '../../vector';
|
||||
import { transformDataFrame } from '../transformDataFrame';
|
||||
|
||||
import { DataTransformerID } from './ids';
|
||||
import { organizeFieldsTransformer, OrganizeFieldsTransformerOptions } from './organize';
|
||||
|
||||
describe('OrganizeFields Transformer', () => {
|
||||
|
@ -1,14 +1,10 @@
|
||||
import {
|
||||
ArrayVector,
|
||||
DataTransformerConfig,
|
||||
DataTransformerID,
|
||||
FieldType,
|
||||
toDataFrame,
|
||||
transformDataFrame,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe';
|
||||
import { FieldType, DataTransformerConfig } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { ArrayVector } from '../../vector';
|
||||
import { transformDataFrame } from '../transformDataFrame';
|
||||
|
||||
import { DataTransformerID } from './ids';
|
||||
import { renameFieldsTransformer, RenameFieldsTransformerOptions } from './rename';
|
||||
|
||||
describe('Rename Transformer', () => {
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { DataTransformerConfig, DataTransformerID, FieldType, toDataFrame, transformDataFrame } from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe';
|
||||
import { FieldType, DataTransformerConfig } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { transformDataFrame } from '../transformDataFrame';
|
||||
|
||||
import { DataTransformerID } from './ids';
|
||||
import { renameByRegexTransformer, RenameByRegexTransformerOptions } from './renameByRegex';
|
||||
|
||||
describe('Rename By Regex Transformer', () => {
|
||||
|
@ -1,14 +1,10 @@
|
||||
import {
|
||||
ArrayVector,
|
||||
DataTransformerConfig,
|
||||
DataTransformerID,
|
||||
FieldType,
|
||||
toDataFrame,
|
||||
transformDataFrame,
|
||||
} from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe';
|
||||
import { FieldType, DataTransformerConfig } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { ArrayVector } from '../../vector';
|
||||
import { transformDataFrame } from '../transformDataFrame';
|
||||
|
||||
import { DataTransformerID } from './ids';
|
||||
import { SeriesToColumnsOptions, seriesToColumnsTransformer } from './seriesToColumns';
|
||||
|
||||
describe('SeriesToColumns Transformer', () => {
|
||||
|
@ -1,7 +1,5 @@
|
||||
import { DataTransformerConfig } from '@grafana/data';
|
||||
|
||||
import { toDataFrame } from '../../dataframe/processDataFrame';
|
||||
import { Field, FieldType } from '../../types';
|
||||
import { DataTransformerConfig, Field, FieldType } from '../../types';
|
||||
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
|
||||
import { transformDataFrame } from '../transformDataFrame';
|
||||
|
||||
|
@ -36,7 +36,7 @@ export * from './live';
|
||||
export * from './variables';
|
||||
export * from './geometry';
|
||||
export { isUnsignedPluginSignature } from './pluginSignature';
|
||||
export {
|
||||
export type {
|
||||
CurrentUserDTO,
|
||||
BootData,
|
||||
OAuth,
|
||||
@ -46,7 +46,7 @@ export {
|
||||
LicenseInfo,
|
||||
PreloadPlugin,
|
||||
} from './config';
|
||||
export { FeatureToggles } from './featureToggles.gen';
|
||||
export type { FeatureToggles } from './featureToggles.gen';
|
||||
export * from './alerts';
|
||||
export * from './slider';
|
||||
export * from './accesscontrol';
|
||||
|
@ -3,8 +3,6 @@ import { Field } from '../types/dataFrame';
|
||||
import { GraphSeriesValue } from '../types/graph';
|
||||
import { TimeRange } from '../types/time';
|
||||
|
||||
// Types
|
||||
// import { NullValueMode, GraphSeriesValue, Field, TimeRange } from '@grafana/data';
|
||||
export interface FlotPairsOptions {
|
||||
xField: Field;
|
||||
yField: Field;
|
||||
|
@ -17,10 +17,10 @@ export { PanelOptionsEditorBuilder, FieldConfigEditorBuilder } from './OptionsUI
|
||||
export { arrayUtils };
|
||||
export { getFlotPairs, getFlotPairsConstant } from './flotPairs';
|
||||
export { locationUtil } from './location';
|
||||
export { urlUtil, UrlQueryMap, UrlQueryValue, serializeStateToUrlParam } from './url';
|
||||
export { urlUtil, type UrlQueryMap, type UrlQueryValue, serializeStateToUrlParam } from './url';
|
||||
export { DataLinkBuiltInVars, mapInternalLinkToExplore } from './dataLinks';
|
||||
export { DocsId } from './docs';
|
||||
export { makeClassES5Compatible } from './makeClassES5Compatible';
|
||||
export { anyToNumber } from './anyToNumber';
|
||||
export { withLoadingIndicator, WithLoadingIndicatorOptions } from './withLoadingIndicator';
|
||||
export { withLoadingIndicator, type WithLoadingIndicatorOptions } from './withLoadingIndicator';
|
||||
export { convertOldAngularValueMappings, LegacyMappingType } from './valueMappings';
|
||||
|
@ -1,13 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declarationDir": "dist",
|
||||
"outDir": "compiled",
|
||||
"rootDirs": ["."],
|
||||
"paths": {
|
||||
"@grafana/data": ["."]
|
||||
}
|
||||
"declarationDir": "./compiled",
|
||||
"emitDeclarationOnly": true,
|
||||
"isolatedModules": true,
|
||||
"rootDirs": ["."]
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"exclude": ["dist/**/*"],
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": ["src/**/*.ts*", "typings/jest", "../../public/app/types/jquery/*.ts", "../../public/app/types/*.d.ts"]
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./index.production.js');
|
||||
} else {
|
||||
module.exports = require('./index.development.js');
|
||||
}
|
@ -10,29 +10,43 @@
|
||||
"e2e",
|
||||
"typescript"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/grafana/grafana.git",
|
||||
"directory": "packages/grafana-e2e-selectors"
|
||||
},
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE_APACHE2"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "grafana-toolkit package:build --scope=e2e-selectors",
|
||||
"build": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.ts",
|
||||
"bundle": "rollup -c rollup.config.ts",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"clean": "rimraf ./dist ./compiled ./package.tgz",
|
||||
"docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "22.0.1",
|
||||
"@rollup/plugin-node-resolve": "13.3.0",
|
||||
"@types/node": "16.11.45",
|
||||
"esbuild": "^0.14.47",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.77.2",
|
||||
"rollup-plugin-sourcemaps": "0.6.3",
|
||||
"rollup-plugin-terser": "7.0.2"
|
||||
"rollup-plugin-dts": "^4.2.2",
|
||||
"rollup-plugin-esbuild": "^4.9.1",
|
||||
"rollup-plugin-node-externals": "^4.1.0"
|
||||
},
|
||||
"types": "src/index.ts",
|
||||
"dependencies": {
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"tslib": "2.4.0",
|
||||
|
@ -1,25 +1,37 @@
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import path from 'path';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
import { externals } from 'rollup-plugin-node-externals';
|
||||
|
||||
const pkg = require('./package.json');
|
||||
|
||||
const libraryName = pkg.name;
|
||||
|
||||
const buildCjsPackage = ({ env }) => {
|
||||
return {
|
||||
input: `compiled/index.js`,
|
||||
export default [
|
||||
{
|
||||
input: 'src/index.ts',
|
||||
plugins: [externals({ deps: true, packagePath: './package.json' }), resolve(), esbuild()],
|
||||
output: [
|
||||
{
|
||||
file: `dist/index.${env}.js`,
|
||||
name: libraryName,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
globals: {},
|
||||
dir: path.dirname(pkg.publishConfig.main),
|
||||
},
|
||||
{
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
dir: path.dirname(pkg.publishConfig.module),
|
||||
preserveModules: true,
|
||||
// @ts-expect-error (TS cannot assure that `process.env.PROJECT_CWD` is a string)
|
||||
preserveModulesRoot: path.join(process.env.PROJECT_CWD, `packages/grafana-e2e-selectors/src`),
|
||||
},
|
||||
],
|
||||
plugins: [resolve(), sourceMaps(), env === 'production' && terser()],
|
||||
};
|
||||
};
|
||||
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|
||||
},
|
||||
{
|
||||
input: './compiled/index.d.ts',
|
||||
plugins: [dts()],
|
||||
output: {
|
||||
file: pkg.publishConfig.types,
|
||||
format: 'es',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -18,4 +18,4 @@ export const selectors: { pages: E2ESelectors<typeof Pages>; components: E2ESele
|
||||
*
|
||||
* @alpha
|
||||
*/
|
||||
export { Pages, Components, E2ESelectors };
|
||||
export { Pages, Components, type E2ESelectors };
|
||||
|
@ -1,10 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declarationDir": "dist",
|
||||
"outDir": "compiled",
|
||||
"declarationDir": "./compiled",
|
||||
"emitDeclarationOnly": true,
|
||||
"isolatedModules": true,
|
||||
"rootDirs": ["."]
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"exclude": ["dist/**/*"],
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./index.production.js');
|
||||
} else {
|
||||
module.exports = require('./index.development.js');
|
||||
}
|
@ -16,34 +16,49 @@
|
||||
"directory": "packages/grafana-e2e"
|
||||
},
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"bin": {
|
||||
"grafana-e2e": "dist/bin/grafana-e2e.js"
|
||||
},
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE_APACHE2"
|
||||
],
|
||||
"bin": {
|
||||
"grafana-e2e": "bin/grafana-e2e.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "grafana-toolkit package:build --scope=e2e",
|
||||
"build": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.ts",
|
||||
"bundle": "rollup -c rollup.config.ts",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"clean": "rimraf ./dist ./compiled ./package.tgz",
|
||||
"docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log",
|
||||
"open": "cypress open",
|
||||
"start": "cypress run --browser=chrome",
|
||||
"start-benchmark": "CYPRESS_NO_COMMAND_LOG=1 yarn start",
|
||||
"test": "pushd test && node ../dist/bin/grafana-e2e.js run",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "22.0.1",
|
||||
"@rollup/plugin-node-resolve": "13.3.0",
|
||||
"@types/chrome-remote-interface": "0.31.4",
|
||||
"@types/lodash": "4.14.182",
|
||||
"@types/node": "16.11.45",
|
||||
"@types/uuid": "8.3.4",
|
||||
"esbuild": "^0.14.47",
|
||||
"rollup": "2.77.2",
|
||||
"rollup-plugin-copy": "3.4.0",
|
||||
"rollup-plugin-sourcemaps": "0.6.3",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"rollup-plugin-dts": "^4.2.2",
|
||||
"rollup-plugin-esbuild": "^4.9.1",
|
||||
"rollup-plugin-node-externals": "^4.1.0",
|
||||
"webpack": "5.74.0"
|
||||
},
|
||||
"types": "src/index.ts",
|
||||
"dependencies": {
|
||||
"@babel/core": "7.18.9",
|
||||
"@babel/preset-env": "7.18.9",
|
||||
|
@ -1,39 +1,43 @@
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import path from 'path';
|
||||
import copy from 'rollup-plugin-copy';
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
import { externals } from 'rollup-plugin-node-externals';
|
||||
|
||||
const { name } = require('./package.json');
|
||||
const pkg = require('./package.json');
|
||||
|
||||
const buildCjsPackage = ({ env }) => ({
|
||||
input: 'compiled/index.js',
|
||||
output: {
|
||||
file: `dist/index.${env}.js`,
|
||||
name,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
globals: {},
|
||||
export default [
|
||||
{
|
||||
input: 'src/index.ts',
|
||||
plugins: [
|
||||
copy({
|
||||
flatten: false,
|
||||
targets: [
|
||||
{ src: 'bin/**/*.*', dest: 'dist/bin/' },
|
||||
{ src: 'cli.js', dest: 'dist/' },
|
||||
{ src: 'cypress.json', dest: 'dist/' },
|
||||
{ src: 'cypress/**/*.*', dest: 'dist/cypress/' },
|
||||
],
|
||||
}),
|
||||
externals({ deps: true, packagePath: './package.json' }),
|
||||
resolve(),
|
||||
esbuild({ target: 'node16' }),
|
||||
],
|
||||
output: [
|
||||
{
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
dir: path.dirname(pkg.publishConfig.main),
|
||||
},
|
||||
],
|
||||
},
|
||||
external: ['@grafana/e2e-selectors'],
|
||||
plugins: [
|
||||
copy({
|
||||
flatten: false,
|
||||
targets: [
|
||||
{ src: 'bin/**/*.*', dest: 'dist/bin/' },
|
||||
{ src: 'cli.js', dest: 'dist/' },
|
||||
{ src: 'cypress.json', dest: 'dist/' },
|
||||
{ src: 'cypress/**/*.*', dest: 'dist/cypress/' },
|
||||
],
|
||||
}),
|
||||
commonjs({
|
||||
include: /node_modules/,
|
||||
}),
|
||||
resolve(),
|
||||
sourceMaps(),
|
||||
env === 'production' && terser(),
|
||||
],
|
||||
});
|
||||
|
||||
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|
||||
{
|
||||
input: './compiled/index.d.ts',
|
||||
plugins: [dts()],
|
||||
output: {
|
||||
file: pkg.publishConfig.types,
|
||||
format: 'es',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { setTimeRange, TimeRangeConfig } from './setTimeRange';
|
||||
|
||||
export { TimeRangeConfig };
|
||||
export type { TimeRangeConfig };
|
||||
|
||||
export const setDashboardTimeRange = (config: TimeRangeConfig) => setTimeRange(config);
|
||||
|
@ -1,11 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declarationDir": "dist",
|
||||
"outDir": "compiled",
|
||||
"declarationDir": "./compiled",
|
||||
"emitDeclarationOnly": true,
|
||||
"isolatedModules": true,
|
||||
"rootDirs": ["."],
|
||||
"types": ["cypress"]
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"exclude": ["dist/**/*"],
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": ["src/**/*.ts", "cypress/support/index.d.ts"]
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./index.production.js');
|
||||
} else {
|
||||
module.exports = require('./index.development.js');
|
||||
}
|
@ -8,18 +8,31 @@
|
||||
"grafana",
|
||||
"typescript"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/grafana/grafana.git",
|
||||
"directory": "packages/grafana-runtime"
|
||||
},
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE_APACHE2"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "grafana-toolkit package:build --scope=runtime",
|
||||
"build": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.ts",
|
||||
"bundle": "rollup -c rollup.config.ts",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"clean": "rimraf ./dist ./compiled ./package.tgz",
|
||||
"docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@grafana/agent-web": "^0.4.0",
|
||||
@ -29,8 +42,6 @@
|
||||
"@sentry/browser": "6.19.7",
|
||||
"history": "4.10.1",
|
||||
"lodash": "4.17.21",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"rxjs": "7.5.6",
|
||||
"systemjs": "0.20.19",
|
||||
"tslib": "2.4.0"
|
||||
@ -49,12 +60,21 @@
|
||||
"@types/react": "17.0.42",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"@types/systemjs": "^0.20.6",
|
||||
"esbuild": "^0.14.47",
|
||||
"lodash": "4.17.21",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.77.2",
|
||||
"rollup-plugin-dts": "^4.2.2",
|
||||
"rollup-plugin-esbuild": "^4.9.1",
|
||||
"rollup-plugin-node-externals": "^4.1.0",
|
||||
"rollup-plugin-sourcemaps": "0.6.3",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"typescript": "4.7.4"
|
||||
},
|
||||
"types": "src/index.ts"
|
||||
"peerDependencies": {
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,37 @@
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import path from 'path';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
import { externals } from 'rollup-plugin-node-externals';
|
||||
|
||||
const pkg = require('./package.json');
|
||||
|
||||
const libraryName = pkg.name;
|
||||
|
||||
const buildCjsPackage = ({ env }) => {
|
||||
return {
|
||||
input: `compiled/index.js`,
|
||||
export default [
|
||||
{
|
||||
input: 'src/index.ts',
|
||||
plugins: [externals({ deps: true, packagePath: './package.json' }), resolve(), esbuild()],
|
||||
output: [
|
||||
{
|
||||
file: `dist/index.${env}.js`,
|
||||
name: libraryName,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
globals: {},
|
||||
dir: path.dirname(pkg.publishConfig.main),
|
||||
},
|
||||
{
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
dir: path.dirname(pkg.publishConfig.module),
|
||||
preserveModules: true,
|
||||
// @ts-expect-error (TS cannot assure that `process.env.PROJECT_CWD` is a string)
|
||||
preserveModulesRoot: path.join(process.env.PROJECT_CWD, `packages/grafana-runtime/src`),
|
||||
},
|
||||
],
|
||||
external: ['lodash', 'react', '@grafana/ui', '@grafana/data', '@grafana/schema', '@grafana/e2e-selectors'], // Use Lodash from grafana
|
||||
plugins: [
|
||||
commonjs({
|
||||
include: /node_modules/,
|
||||
}),
|
||||
resolve(),
|
||||
sourceMaps(),
|
||||
env === 'production' && terser(),
|
||||
],
|
||||
};
|
||||
};
|
||||
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|
||||
},
|
||||
{
|
||||
input: './compiled/index.d.ts',
|
||||
plugins: [dts()],
|
||||
output: {
|
||||
file: pkg.publishConfig.types,
|
||||
format: 'es',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -6,26 +6,30 @@
|
||||
export * from './services';
|
||||
export * from './config';
|
||||
export * from './types';
|
||||
export { loadPluginCss, SystemJS, PluginCssOptions } from './utils/plugin';
|
||||
export { loadPluginCss, SystemJS, type PluginCssOptions } from './utils/plugin';
|
||||
export { reportMetaAnalytics, reportInteraction, reportPageview, reportExperimentView } from './utils/analytics';
|
||||
export { featureEnabled } from './utils/licensing';
|
||||
export { logInfo, logDebug, logWarning, logError } from './utils/logging';
|
||||
export {
|
||||
DataSourceWithBackend,
|
||||
HealthCheckError,
|
||||
HealthCheckResult,
|
||||
HealthCheckResultDetails,
|
||||
type HealthCheckResult,
|
||||
type HealthCheckResultDetails,
|
||||
HealthStatus,
|
||||
StreamOptionsProvider,
|
||||
type StreamOptionsProvider,
|
||||
} from './utils/DataSourceWithBackend';
|
||||
export {
|
||||
toDataQueryResponse,
|
||||
frameToMetricFindValue,
|
||||
BackendDataSourceResponse,
|
||||
DataResponse,
|
||||
type BackendDataSourceResponse,
|
||||
type DataResponse,
|
||||
} from './utils/queryResponse';
|
||||
export { PanelRenderer, PanelRendererProps } from './components/PanelRenderer';
|
||||
export { PanelDataErrorView, PanelDataErrorViewProps } from './components/PanelDataErrorView';
|
||||
export { PanelRenderer, type PanelRendererProps } from './components/PanelRenderer';
|
||||
export { PanelDataErrorView, type PanelDataErrorViewProps } from './components/PanelDataErrorView';
|
||||
export { toDataQueryError } from './utils/toDataQueryError';
|
||||
export { setQueryRunnerFactory, createQueryRunner, QueryRunnerFactory } from './services/QueryRunner';
|
||||
export { DataSourcePicker, DataSourcePickerProps, DataSourcePickerState } from './components/DataSourcePicker';
|
||||
export { setQueryRunnerFactory, createQueryRunner, type QueryRunnerFactory } from './services/QueryRunner';
|
||||
export {
|
||||
DataSourcePicker,
|
||||
type DataSourcePickerProps,
|
||||
type DataSourcePickerState,
|
||||
} from './components/DataSourcePicker';
|
||||
|
@ -1,11 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"declarationDir": "dist",
|
||||
"outDir": "compiled",
|
||||
"baseUrl": "./",
|
||||
"declarationDir": "./compiled",
|
||||
"emitDeclarationOnly": true,
|
||||
"isolatedModules": true,
|
||||
"rootDirs": ["."]
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"exclude": ["dist/**/*"],
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": [
|
||||
"src/**/*.ts*",
|
||||
|
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./index.production.js');
|
||||
} else {
|
||||
module.exports = require('./index.development.js');
|
||||
}
|
@ -7,6 +7,7 @@
|
||||
"keywords": [
|
||||
"typescript"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/grafana/grafana.git",
|
||||
@ -14,23 +15,35 @@
|
||||
},
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE_APACHE2"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "grafana-toolkit package:build --scope=schema",
|
||||
"build": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.ts",
|
||||
"bundle": "rollup -c rollup.config.ts",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"clean": "rimraf ./dist ./compiled ./package.tgz",
|
||||
"docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"@rollup/plugin-commonjs": "22.0.1",
|
||||
"@rollup/plugin-json": "4.1.0",
|
||||
"@rollup/plugin-node-resolve": "13.3.0",
|
||||
"@swc/helpers": "0.4.3",
|
||||
"esbuild": "^0.14.47",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.77.2",
|
||||
"rollup-plugin-sourcemaps": "0.6.3",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"rollup-plugin-dts": "^4.2.2",
|
||||
"rollup-plugin-esbuild": "^4.9.1",
|
||||
"rollup-plugin-node-externals": "^4.1.0",
|
||||
"typescript": "4.7.4"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -1,33 +1,37 @@
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import path from 'path';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
import { externals } from 'rollup-plugin-node-externals';
|
||||
|
||||
const pkg = require('./package.json');
|
||||
|
||||
const libraryName = pkg.name;
|
||||
|
||||
const buildCjsPackage = ({ env }) => {
|
||||
return {
|
||||
input: `compiled/index.js`,
|
||||
export default [
|
||||
{
|
||||
input: 'src/index.ts',
|
||||
plugins: [externals({ deps: true, packagePath: './package.json' }), resolve(), esbuild()],
|
||||
output: [
|
||||
{
|
||||
file: `dist/index.${env}.js`,
|
||||
name: libraryName,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
exports: 'named',
|
||||
globals: {},
|
||||
dir: path.dirname(pkg.publishConfig.main),
|
||||
},
|
||||
{
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
dir: path.dirname(pkg.publishConfig.module),
|
||||
preserveModules: true,
|
||||
// @ts-expect-error (TS cannot assure that `process.env.PROJECT_CWD` is a string)
|
||||
preserveModulesRoot: path.join(process.env.PROJECT_CWD, `packages/grafana-schema/src`),
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
commonjs({
|
||||
include: /node_modules/,
|
||||
}),
|
||||
resolve(),
|
||||
sourceMaps(),
|
||||
env === 'production' && terser(),
|
||||
],
|
||||
};
|
||||
};
|
||||
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|
||||
},
|
||||
{
|
||||
input: './compiled/index.d.ts',
|
||||
plugins: [dts()],
|
||||
output: {
|
||||
file: pkg.publishConfig.types,
|
||||
format: 'es',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"exclude": ["dist", "node_modules", "**/*.test.ts*"],
|
||||
// dashboard_experimental.gen.ts needs ignoring as isolatedModules requires it to contain an import or export statement.
|
||||
"exclude": ["dist/**/*", "src/schema/dashboard/dashboard_experimental.gen.ts", "**/*.test.ts*"],
|
||||
"extends": "./tsconfig.json"
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declarationDir": "dist",
|
||||
"outDir": "compiled",
|
||||
"declarationDir": "./compiled",
|
||||
"emitDeclarationOnly": true,
|
||||
"isolatedModules": true,
|
||||
"rootDirs": ["."]
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
// dashboard_experimental.gen.ts needs ignoring as isolatedModules requires it to contain an import or export statement.
|
||||
"exclude": ["dist/**/*", "src/schema/dashboard/dashboard_experimental.gen.ts"],
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": ["src/**/*.ts*"]
|
||||
}
|
||||
|
@ -18,9 +18,20 @@
|
||||
"bin": {
|
||||
"grafana-toolkit": "./bin/grafana-toolkit.js"
|
||||
},
|
||||
"publishConfig": {
|
||||
"bin": {
|
||||
"grafana-toolkit": "./dist/bin/grafana-toolkit.js"
|
||||
},
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md",
|
||||
"CHANGELOG.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "grafana-toolkit toolkit:build",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"clean": "rimraf ./dist ./compiled ./package.tgz",
|
||||
"precommit": "npm run lint & npm run typecheck",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
|
@ -30,6 +30,9 @@ export const run = (includeInternalScripts = false) => {
|
||||
.option('-s, --scope <packages>', 'packages=[data|runtime|ui|toolkit|e2e|e2e-selectors]')
|
||||
.description('Builds @grafana/* package to packages/grafana-*/dist')
|
||||
.action(async (cmd) => {
|
||||
console.warn(
|
||||
'@grafana/toolkit package:build task is deprecated and will be removed in @grafana/toolkit@10.0.0.'
|
||||
);
|
||||
await execTask(buildPackageTask)({
|
||||
scope: cmd.scope,
|
||||
});
|
||||
|
@ -22,34 +22,8 @@ const compile = () =>
|
||||
}
|
||||
});
|
||||
|
||||
const savePackage = ({ path, pkg }: { path: string; pkg: {} }) =>
|
||||
useSpinner('Updating package.json', async () => {
|
||||
new Promise<void>((resolve, reject) => {
|
||||
fs.writeFile(path, JSON.stringify(pkg, null, 2), (err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const preparePackage = async (pkg: any) => {
|
||||
pkg.bin = {
|
||||
'grafana-toolkit': './bin/grafana-toolkit.js',
|
||||
};
|
||||
|
||||
await savePackage({
|
||||
path: `${cwd}/dist/package.json`,
|
||||
pkg,
|
||||
});
|
||||
};
|
||||
|
||||
const copyFiles = () => {
|
||||
const files = [
|
||||
'README.md',
|
||||
'CHANGELOG.md',
|
||||
'config/circleci/config.yml',
|
||||
'bin/grafana-toolkit.js',
|
||||
'src/config/prettier.plugin.config.json',
|
||||
@ -115,7 +89,6 @@ const toolkitBuildTaskRunner: TaskRunner<ToolkitBuildOptions> = async () => {
|
||||
|
||||
await clean();
|
||||
await compile();
|
||||
await preparePackage(pkg);
|
||||
fs.mkdirSync('./dist/bin');
|
||||
fs.mkdirSync('./dist/sass');
|
||||
await copyFiles();
|
||||
|
@ -4,7 +4,7 @@
|
||||
"noUnusedLocals": false,
|
||||
"outDir": "compiled"
|
||||
},
|
||||
"exclude": ["../dist", "../node_modules"],
|
||||
"exclude": ["../dist/**/*"],
|
||||
"extends": "../tsconfig.json",
|
||||
"include": ["../src/**/*.ts", "../src/**/*.tsx", "../../../public/app/types/svg.d.ts"]
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./index.production.js');
|
||||
} else {
|
||||
module.exports = require('./index.development.js');
|
||||
}
|
@ -10,20 +10,33 @@
|
||||
"react-component",
|
||||
"typescript"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/grafana/grafana.git",
|
||||
"directory": "packages/grafana-ui"
|
||||
},
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"publishConfig": {
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/esm/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"access": "public"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"CHANGELOG.md",
|
||||
"LICENSE_APACHE2"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "grafana-toolkit package:build --scope=ui",
|
||||
"build": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.ts",
|
||||
"bundle": "rollup -c rollup.config.ts",
|
||||
"clean": "rimraf ./dist ./compiled",
|
||||
"clean": "rimraf ./dist ./compiled ./package.tgz",
|
||||
"docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log",
|
||||
"storybook": "start-storybook -p 9001 -c .storybook",
|
||||
"storybook:build": "build-storybook -o ./dist/storybook -c .storybook",
|
||||
"typecheck": "tsc --noEmit"
|
||||
"typecheck": "tsc --emitDeclarationOnly false --noEmit"
|
||||
},
|
||||
"browserslist": [
|
||||
"defaults",
|
||||
@ -66,12 +79,10 @@
|
||||
"rc-drawer": "4.4.3",
|
||||
"rc-slider": "9.7.5",
|
||||
"rc-time-picker": "^3.7.3",
|
||||
"react": "17.0.2",
|
||||
"react-beautiful-dnd": "13.1.0",
|
||||
"react-calendar": "3.7.0",
|
||||
"react-colorful": "5.5.1",
|
||||
"react-custom-scrollbars-2": "4.5.0",
|
||||
"react-dom": "17.0.2",
|
||||
"react-dropzone": "14.2.2",
|
||||
"react-highlight-words": "0.18.0",
|
||||
"react-hook-form": "7.5.3",
|
||||
@ -97,8 +108,6 @@
|
||||
"@babel/core": "7.18.9",
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"@mdx-js/react": "1.6.22",
|
||||
"@rollup/plugin-alias": "^3.1.9",
|
||||
"@rollup/plugin-commonjs": "22.0.1",
|
||||
"@rollup/plugin-node-resolve": "13.3.0",
|
||||
"@storybook/addon-a11y": "6.4.21",
|
||||
"@storybook/addon-actions": "6.4.21",
|
||||
@ -158,19 +167,23 @@
|
||||
"css-minimizer-webpack-plugin": "4.0.0",
|
||||
"csstype": "3.1.0",
|
||||
"enzyme": "3.11.0",
|
||||
"esbuild": "^0.14.47",
|
||||
"expose-loader": "4.0.0",
|
||||
"mock-raf": "1.0.1",
|
||||
"postcss": "8.4.14",
|
||||
"postcss-loader": "7.0.1",
|
||||
"process": "^0.11.10",
|
||||
"raw-loader": "4.0.2",
|
||||
"react": "17.0.2",
|
||||
"react-docgen-typescript-loader": "3.7.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "2.77.2",
|
||||
"rollup-plugin-sourcemaps": "0.6.3",
|
||||
"rollup-plugin-dts": "^4.2.2",
|
||||
"rollup-plugin-esbuild": "^4.9.1",
|
||||
"rollup-plugin-node-externals": "^4.1.0",
|
||||
"rollup-plugin-svg-import": "^1.6.0",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"sass-loader": "13.0.2",
|
||||
"storybook-dark-mode": "1.1.0",
|
||||
"style-loader": "3.3.1",
|
||||
@ -180,5 +193,8 @@
|
||||
"webpack": "5.74.0",
|
||||
"webpack-filter-warnings-plugin": "1.2.1"
|
||||
},
|
||||
"types": "src/index.ts"
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,55 +1,38 @@
|
||||
import alias from '@rollup/plugin-alias';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import path from 'path';
|
||||
import dts from 'rollup-plugin-dts';
|
||||
import esbuild from 'rollup-plugin-esbuild';
|
||||
import { externals } from 'rollup-plugin-node-externals';
|
||||
import svg from 'rollup-plugin-svg-import';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
|
||||
const pkg = require('./package.json');
|
||||
|
||||
const libraryName = pkg.name;
|
||||
|
||||
const buildCjsPackage = ({ env }) => {
|
||||
return {
|
||||
input: `compiled/index.js`,
|
||||
export default [
|
||||
{
|
||||
input: 'src/index.ts',
|
||||
plugins: [externals({ deps: true, packagePath: './package.json' }), resolve(), svg({ stringify: true }), esbuild()],
|
||||
output: [
|
||||
{
|
||||
dir: 'dist',
|
||||
name: libraryName,
|
||||
format: 'cjs',
|
||||
sourcemap: true,
|
||||
strict: false,
|
||||
exports: 'named',
|
||||
chunkFileNames: `[name].${env}.js`,
|
||||
globals: {
|
||||
react: 'React',
|
||||
'prop-types': 'PropTypes',
|
||||
},
|
||||
dir: path.dirname(pkg.publishConfig.main),
|
||||
},
|
||||
{
|
||||
format: 'esm',
|
||||
sourcemap: true,
|
||||
dir: path.dirname(pkg.publishConfig.module),
|
||||
preserveModules: true,
|
||||
// @ts-expect-error (TS cannot assure that `process.env.PROJECT_CWD` is a string)
|
||||
preserveModulesRoot: path.join(process.env.PROJECT_CWD, `packages/grafana-ui/src`),
|
||||
},
|
||||
],
|
||||
external: [
|
||||
'react',
|
||||
'react-dom',
|
||||
'@grafana/data',
|
||||
'@grafana/schema',
|
||||
'@grafana/e2e-selectors',
|
||||
'moment',
|
||||
'jquery', // required to use jquery.plot, which is assigned externally
|
||||
'react-inlinesvg', // required to mock Icon svg loading in tests
|
||||
'@emotion/react',
|
||||
'@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,
|
||||
}),
|
||||
resolve(),
|
||||
svg({ stringify: true }),
|
||||
env === 'production' && terser(),
|
||||
],
|
||||
};
|
||||
};
|
||||
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|
||||
},
|
||||
{
|
||||
input: './compiled/index.d.ts',
|
||||
plugins: [dts()],
|
||||
output: {
|
||||
file: pkg.publishConfig.types,
|
||||
format: 'es',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { css } from '@emotion/css';
|
||||
import memoizeOne from 'memoize-one';
|
||||
import RCCascader from 'rc-cascader';
|
||||
import React from 'react';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
|
||||
@ -71,7 +71,7 @@ const disableDivFocus = css(`
|
||||
|
||||
const DEFAULT_SEPARATOR = '/';
|
||||
|
||||
export class Cascader extends React.PureComponent<CascaderProps, CascaderState> {
|
||||
export class Cascader extends PureComponent<CascaderProps, CascaderState> {
|
||||
constructor(props: CascaderProps) {
|
||||
super(props);
|
||||
const searchableOptions = this.getSearchableOptions(props.options);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { css } from '@emotion/css';
|
||||
import { FocusScope } from '@react-aria/focus';
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { GrafanaTheme2, colorManipulator } from '@grafana/data';
|
||||
|
||||
@ -37,7 +37,7 @@ interface State<T> {
|
||||
activePicker: PickerType | keyof T;
|
||||
}
|
||||
|
||||
class UnThemedColorPickerPopover<T extends CustomPickersDescriptor> extends React.Component<Props<T>, State<T>> {
|
||||
class UnThemedColorPickerPopover<T extends CustomPickersDescriptor> extends Component<Props<T>, State<T>> {
|
||||
constructor(props: Props<T>) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { css } from '@emotion/css';
|
||||
import React, { FunctionComponent } from 'react';
|
||||
import React, { FunctionComponent, PureComponent } from 'react';
|
||||
|
||||
import { withTheme2, useStyles } from '../../themes';
|
||||
import { Button } from '../Button';
|
||||
@ -52,7 +52,7 @@ interface AxisSelectorState {
|
||||
yaxis: number;
|
||||
}
|
||||
|
||||
export class AxisSelector extends React.PureComponent<AxisSelectorProps, AxisSelectorState> {
|
||||
export class AxisSelector extends PureComponent<AxisSelectorProps, AxisSelectorState> {
|
||||
constructor(props: AxisSelectorProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
@ -1,4 +1,11 @@
|
||||
import { FileDropzone, DropzoneFile, FileDropzoneProps, FileDropzoneDefaultChildren } from './FileDropzone';
|
||||
import { FileListItem, FileListItemProps } from './FileListItem';
|
||||
|
||||
export { FileDropzone, FileDropzoneProps, DropzoneFile, FileListItem, FileListItemProps, FileDropzoneDefaultChildren };
|
||||
export {
|
||||
FileDropzone,
|
||||
type FileDropzoneProps,
|
||||
type DropzoneFile,
|
||||
FileListItem,
|
||||
type FileListItemProps,
|
||||
FileDropzoneDefaultChildren,
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { difference, isEqual } from 'lodash';
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { GraphSeriesXY } from '@grafana/data';
|
||||
|
||||
@ -19,7 +19,7 @@ export interface GraphSeriesTogglerState {
|
||||
toggledSeries: GraphSeriesXY[];
|
||||
}
|
||||
|
||||
export class GraphSeriesToggler extends React.Component<GraphSeriesTogglerProps, GraphSeriesTogglerState> {
|
||||
export class GraphSeriesToggler extends Component<GraphSeriesTogglerProps, GraphSeriesTogglerState> {
|
||||
constructor(props: GraphSeriesTogglerProps) {
|
||||
super(props);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { throttleTime } from 'rxjs/operators';
|
||||
import uPlot, { AlignedData } from 'uplot';
|
||||
@ -92,7 +92,7 @@ export interface GraphNGState {
|
||||
/**
|
||||
* "Time as X" core component, expects ascending x
|
||||
*/
|
||||
export class GraphNG extends React.Component<GraphNGProps, GraphNGState> {
|
||||
export class GraphNG extends Component<GraphNGProps, GraphNGState> {
|
||||
static contextType = PanelContextRoot;
|
||||
panelContext: PanelContext = {} as PanelContext;
|
||||
private plotInstance: React.RefObject<uPlot>;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { cx, css } from '@emotion/css';
|
||||
import React from 'react';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { stylesFactory } from '../../themes';
|
||||
|
||||
@ -26,7 +26,7 @@ const getStyles = stylesFactory((inlineList = false) => ({
|
||||
`,
|
||||
}));
|
||||
|
||||
export class AbstractList<T> extends React.PureComponent<AbstractListProps<T>> {
|
||||
export class AbstractList<T> extends PureComponent<AbstractListProps<T>> {
|
||||
constructor(props: AbstractListProps<T>) {
|
||||
super(props);
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { ListProps, AbstractList } from './AbstractList';
|
||||
|
||||
export class InlineList<T> extends React.PureComponent<ListProps<T>> {
|
||||
export class InlineList<T> extends PureComponent<ListProps<T>> {
|
||||
render() {
|
||||
return <AbstractList inline {...this.props} />;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { ListProps, AbstractList } from './AbstractList';
|
||||
|
||||
export class List<T> extends React.PureComponent<ListProps<T>> {
|
||||
export class List<T> extends PureComponent<ListProps<T>> {
|
||||
render() {
|
||||
return <AbstractList {...this.props} />;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
interface ModalsContextState {
|
||||
component: React.ComponentType<any> | null;
|
||||
@ -22,7 +22,7 @@ interface ModalsProviderProps {
|
||||
props?: any;
|
||||
}
|
||||
|
||||
export class ModalsProvider extends React.Component<ModalsProviderProps, ModalsContextState> {
|
||||
export class ModalsProvider extends Component<ModalsProviderProps, ModalsContextState> {
|
||||
constructor(props: ModalsProviderProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { css } from '@emotion/css';
|
||||
import type * as monacoType from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
import React from 'react';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { GrafanaTheme2, monacoLanguageRegistry } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
@ -14,7 +14,7 @@ import { CodeEditorProps, Monaco, MonacoEditor as MonacoEditorType, MonacoOption
|
||||
|
||||
type Props = CodeEditorProps & Themeable2;
|
||||
|
||||
class UnthemedCodeEditor extends React.PureComponent<Props> {
|
||||
class UnthemedCodeEditor extends PureComponent<Props> {
|
||||
completionCancel?: monacoType.IDisposable;
|
||||
monaco?: Monaco;
|
||||
|
||||
|
@ -7,7 +7,7 @@ import { PanelChrome as PanelChromeComponent, PanelChromeProps } from './PanelCh
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export { PanelChromeProps, PanelPadding } from './PanelChrome';
|
||||
export type { PanelChromeProps, PanelPadding } from './PanelChrome';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@ -30,14 +30,14 @@ PanelChrome.ErrorIndicator = ErrorIndicator;
|
||||
*/
|
||||
export {
|
||||
LoadingIndicator as PanelChromeLoadingIndicator,
|
||||
LoadingIndicatorProps as PanelChromeLoadingIndicatorProps,
|
||||
type LoadingIndicatorProps as PanelChromeLoadingIndicatorProps,
|
||||
} from './LoadingIndicator';
|
||||
|
||||
export {
|
||||
ErrorIndicator as PanelChromeErrorIndicator,
|
||||
ErrorIndicatorProps as PanelChromeErrorIndicatorProps,
|
||||
type ErrorIndicatorProps as PanelChromeErrorIndicatorProps,
|
||||
} from './ErrorIndicator';
|
||||
|
||||
export { usePanelContext, PanelContextProvider, PanelContext, PanelContextRoot } from './PanelContext';
|
||||
export { usePanelContext, PanelContextProvider, type PanelContext, PanelContextRoot } from './PanelContext';
|
||||
|
||||
export * from './types';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { css, cx } from '@emotion/css';
|
||||
import classnames from 'classnames';
|
||||
import { debounce } from 'lodash';
|
||||
import React, { Context } from 'react';
|
||||
import React, { Context, PureComponent } from 'react';
|
||||
import { Value, Editor as CoreEditor } from 'slate';
|
||||
import Plain from 'slate-plain-serializer';
|
||||
|
||||
@ -66,7 +66,7 @@ export interface QueryFieldState {
|
||||
* This component can only process strings. Internally it uses Slate Value.
|
||||
* Implement props.onTypeahead to use suggestions, see PromQueryField.tsx as an example.
|
||||
*/
|
||||
export class UnThemedQueryField extends React.PureComponent<QueryFieldProps, QueryFieldState> {
|
||||
export class UnThemedQueryField extends PureComponent<QueryFieldProps, QueryFieldState> {
|
||||
plugins: Plugin[];
|
||||
runOnChangeDebounced: Function;
|
||||
lastExecutedValue: Value | null = null;
|
||||
|
@ -3,5 +3,5 @@ export { SegmentAsync } from './SegmentAsync';
|
||||
export { SegmentSelect } from './SegmentSelect';
|
||||
export { SegmentInput } from './SegmentInput';
|
||||
export { SegmentSection } from './SegmentSection';
|
||||
export { SegmentProps } from './types';
|
||||
export type { SegmentProps } from './types';
|
||||
export { useExpandableLabel } from './useExpandableLabel';
|
||||
|
@ -35,4 +35,4 @@ export function AsyncMultiSelect<T>(props: AsyncMultiSelectProps<T>) {
|
||||
return <SelectBase {...props} isMulti />;
|
||||
}
|
||||
|
||||
export { SelectContainer, SelectContainerProps };
|
||||
export { SelectContainer, type SelectContainerProps };
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { cx } from '@emotion/css';
|
||||
import React, { ReactNode } from 'react';
|
||||
import React, { Component, ReactNode } from 'react';
|
||||
|
||||
import { GrafanaTheme } from '@grafana/data';
|
||||
|
||||
@ -7,7 +7,7 @@ import { withTheme2 } from '../../themes/ThemeContext';
|
||||
|
||||
import { getSelectStyles } from './getSelectStyles';
|
||||
|
||||
class UnthemedValueContainer extends React.Component<any & { theme: GrafanaTheme }> {
|
||||
class UnthemedValueContainer extends Component<any & { theme: GrafanaTheme }> {
|
||||
render() {
|
||||
const { children } = this.props;
|
||||
const { selectProps } = this.props;
|
||||
|
@ -1,5 +1,5 @@
|
||||
export {
|
||||
SingleStatBaseOptions,
|
||||
type SingleStatBaseOptions,
|
||||
sharedSingleStatMigrationHandler,
|
||||
convertOldAngularValueMapping,
|
||||
sharedSingleStatPanelChangedHandler,
|
||||
|
@ -6,7 +6,7 @@ import { Field, KeyValue, SelectableValue } from '@grafana/data';
|
||||
|
||||
import { TableStyles } from './styles';
|
||||
|
||||
export { TableFieldOptions, TableCellDisplayMode, FieldTextAlignment } from '@grafana/schema';
|
||||
export { type TableFieldOptions, TableCellDisplayMode, type FieldTextAlignment } from '@grafana/schema';
|
||||
|
||||
export interface TableRow {
|
||||
[x: string]: any;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { css } from '@emotion/css';
|
||||
import { debounce } from 'lodash';
|
||||
import React from 'react';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { GrafanaTheme, DataFrame, CSVConfig, readCSV } from '@grafana/data';
|
||||
|
||||
@ -25,7 +25,7 @@ interface State {
|
||||
/**
|
||||
* Expects the container div to have size set and will fill it 100%
|
||||
*/
|
||||
export class UnThemedTableInputCSV extends React.PureComponent<Props, State> {
|
||||
export class UnThemedTableInputCSV extends PureComponent<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { DataFrame, TimeRange } from '@grafana/data';
|
||||
|
||||
import { PropDiffFn } from '../../../../../packages/grafana-ui/src/components/GraphNG/GraphNG';
|
||||
import { withTheme2 } from '../../themes/ThemeContext';
|
||||
import { GraphNG, GraphNGProps } from '../GraphNG/GraphNG';
|
||||
import { GraphNG, GraphNGProps, PropDiffFn } from '../GraphNG/GraphNG';
|
||||
import { PanelContext, PanelContextRoot } from '../PanelChrome/PanelContext';
|
||||
import { PlotLegend } from '../uPlot/PlotLegend';
|
||||
import { UPlotConfigBuilder } from '../uPlot/config/UPlotConfigBuilder';
|
||||
@ -15,7 +14,7 @@ const propsToDiff: Array<string | PropDiffFn> = ['legend', 'options'];
|
||||
|
||||
type TimeSeriesProps = Omit<GraphNGProps, 'prepConfig' | 'propsToDiff' | 'renderLegend'>;
|
||||
|
||||
export class UnthemedTimeSeries extends React.Component<TimeSeriesProps> {
|
||||
export class UnthemedTimeSeries extends Component<TimeSeriesProps> {
|
||||
static contextType = PanelContextRoot;
|
||||
panelContext: PanelContext = {} as PanelContext;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Placement } from '@popperjs/core';
|
||||
import React from 'react';
|
||||
import { Component } from 'react';
|
||||
|
||||
import { PopoverContent } from './types';
|
||||
|
||||
@ -25,7 +25,7 @@ interface State {
|
||||
show: boolean;
|
||||
}
|
||||
|
||||
class PopoverController extends React.Component<Props, State> {
|
||||
class PopoverController extends Component<Props, State> {
|
||||
private hideTimeout: any;
|
||||
state = { show: false };
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
export { Tooltip, TooltipProps } from './Tooltip';
|
||||
export { Tooltip, type TooltipProps } from './Tooltip';
|
||||
export { PopoverController } from './PopoverController';
|
||||
export { TooltipPlacement, PopoverContent, PopoverContentProps } from './types';
|
||||
export type { TooltipPlacement, PopoverContent, PopoverContentProps } from './types';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { isEqual } from 'lodash';
|
||||
import React, { createRef } from 'react';
|
||||
import React, { createRef, PureComponent } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { FixedSizeList } from 'react-window';
|
||||
|
||||
@ -30,7 +30,7 @@ export interface State {
|
||||
typeaheadIndex: number | null;
|
||||
}
|
||||
|
||||
export class Typeahead extends React.PureComponent<Props, State> {
|
||||
export class Typeahead extends PureComponent<Props, State> {
|
||||
static contextType = ThemeContext;
|
||||
context!: React.ContextType<typeof ThemeContext>;
|
||||
listRef = createRef<FixedSizeList>();
|
||||
@ -209,7 +209,7 @@ interface PortalProps {
|
||||
style: string;
|
||||
}
|
||||
|
||||
class Portal extends React.PureComponent<PortalProps, {}> {
|
||||
class Portal extends PureComponent<PortalProps, {}> {
|
||||
node: HTMLElement;
|
||||
|
||||
constructor(props: PortalProps) {
|
||||
|
@ -1,3 +1,3 @@
|
||||
export { VizTooltip, VizTooltipContentProps, VizTooltipProps, ActiveDimensions } from './VizTooltip';
|
||||
export { VizTooltipContainer, VizTooltipContainerProps } from './VizTooltipContainer';
|
||||
export { SeriesTable, SeriesTableRow, SeriesTableProps, SeriesTableRowProps } from './SeriesTable';
|
||||
export { VizTooltip, type VizTooltipContentProps, type VizTooltipProps, type ActiveDimensions } from './VizTooltip';
|
||||
export { VizTooltipContainer, type VizTooltipContainerProps } from './VizTooltipContainer';
|
||||
export { SeriesTable, SeriesTableRow, type SeriesTableProps, type SeriesTableRowProps } from './SeriesTable';
|
||||
|
@ -7,23 +7,23 @@ import { Switch } from './Forms/Legacy/Switch/Switch';
|
||||
import { SecretFormField } from './SecretFormField/SecretFormField';
|
||||
|
||||
export { Icon } from './Icon/Icon';
|
||||
export { IconButton, IconButtonVariant } from './IconButton/IconButton';
|
||||
export { IconButton, type IconButtonVariant } from './IconButton/IconButton';
|
||||
export { ConfirmButton } from './ConfirmButton/ConfirmButton';
|
||||
export { DeleteButton } from './ConfirmButton/DeleteButton';
|
||||
export { Tooltip } from './Tooltip/Tooltip';
|
||||
export { PopoverContent } from './Tooltip/types';
|
||||
export type { PopoverContent } from './Tooltip/types';
|
||||
export { PopoverController } from './Tooltip/PopoverController';
|
||||
export { Popover } from './Tooltip/Popover';
|
||||
export { Portal, getPortalContainer, PortalContainer } from './Portal/Portal';
|
||||
export { CustomScrollbar, ScrollbarPosition } from './CustomScrollbar/CustomScrollbar';
|
||||
export { TabbedContainer, TabConfig } from './TabbedContainer/TabbedContainer';
|
||||
export { CustomScrollbar, type ScrollbarPosition } from './CustomScrollbar/CustomScrollbar';
|
||||
export { TabbedContainer, type TabConfig } from './TabbedContainer/TabbedContainer';
|
||||
|
||||
export { ClipboardButton } from './ClipboardButton/ClipboardButton';
|
||||
export { Cascader, CascaderOption } from './Cascader/Cascader';
|
||||
export { Cascader, type CascaderOption } from './Cascader/Cascader';
|
||||
export { ButtonCascader } from './ButtonCascader/ButtonCascader';
|
||||
export { InlineToast } from './InlineToast/InlineToast';
|
||||
|
||||
export { LoadingPlaceholder, LoadingPlaceholderProps } from './LoadingPlaceholder/LoadingPlaceholder';
|
||||
export { LoadingPlaceholder, type LoadingPlaceholderProps } from './LoadingPlaceholder/LoadingPlaceholder';
|
||||
export { ColorPicker, SeriesColorPicker } from './ColorPicker/ColorPicker';
|
||||
export { ColorPickerInput } from './ColorPicker/ColorPickerInput';
|
||||
export { SeriesColorPickerPopover, SeriesColorPickerPopoverWithTheme } from './ColorPicker/SeriesColorPickerPopover';
|
||||
@ -31,24 +31,24 @@ export { EmptySearchResult } from './EmptySearchResult/EmptySearchResult';
|
||||
export { UnitPicker } from './UnitPicker/UnitPicker';
|
||||
export { StatsPicker } from './StatsPicker/StatsPicker';
|
||||
export { RefreshPicker, defaultIntervals } from './RefreshPicker/RefreshPicker';
|
||||
export { TimeRangePicker, TimeRangePickerProps } from './DateTimePickers/TimeRangePicker';
|
||||
export { TimeRangePicker, type TimeRangePickerProps } from './DateTimePickers/TimeRangePicker';
|
||||
export { TimeOfDayPicker } from './DateTimePickers/TimeOfDayPicker';
|
||||
export { TimeZonePicker } from './DateTimePickers/TimeZonePicker';
|
||||
export { WeekStartPicker } from './DateTimePickers/WeekStartPicker';
|
||||
export { DatePicker, DatePickerProps } from './DateTimePickers/DatePicker/DatePicker';
|
||||
export { DatePicker, type DatePickerProps } from './DateTimePickers/DatePicker/DatePicker';
|
||||
export {
|
||||
DatePickerWithInput,
|
||||
DatePickerWithInputProps,
|
||||
type DatePickerWithInputProps,
|
||||
} from './DateTimePickers/DatePickerWithInput/DatePickerWithInput';
|
||||
export { DateTimePicker } from './DateTimePickers/DateTimePicker/DateTimePicker';
|
||||
export { List } from './List/List';
|
||||
export { TagsInput } from './TagsInput/TagsInput';
|
||||
export { Pagination } from './Pagination/Pagination';
|
||||
export { Tag, OnTagClick } from './Tags/Tag';
|
||||
export { Tag, type OnTagClick } from './Tags/Tag';
|
||||
export { TagList } from './Tags/TagList';
|
||||
export { FilterPill } from './FilterPill/FilterPill';
|
||||
|
||||
export { ConfirmModal, ConfirmModalProps } from './ConfirmModal/ConfirmModal';
|
||||
export { ConfirmModal, type ConfirmModalProps } from './ConfirmModal/ConfirmModal';
|
||||
export { QueryField } from './QueryField/QueryField';
|
||||
|
||||
export { CodeEditor } from './Monaco/CodeEditor';
|
||||
@ -56,11 +56,11 @@ export { CodeEditor } from './Monaco/CodeEditor';
|
||||
export { ReactMonacoEditorLazy as ReactMonacoEditor } from './Monaco/ReactMonacoEditorLazy';
|
||||
|
||||
export {
|
||||
Monaco,
|
||||
monacoTypes,
|
||||
MonacoEditor,
|
||||
MonacoOptions as CodeEditorMonacoOptions,
|
||||
CodeEditorSuggestionItem,
|
||||
type Monaco,
|
||||
type monacoTypes,
|
||||
type MonacoEditor,
|
||||
type MonacoOptions as CodeEditorMonacoOptions,
|
||||
type CodeEditorSuggestionItem,
|
||||
CodeEditorSuggestionItemKind,
|
||||
} from './Monaco/types';
|
||||
export { variableSuggestionToCodeEditorSuggestion } from './Monaco/utils';
|
||||
@ -77,7 +77,7 @@ export { PageToolbar } from './PageLayout/PageToolbar';
|
||||
export { SetInterval } from './SetInterval/SetInterval';
|
||||
|
||||
export { Table } from './Table/Table';
|
||||
export { TableCellDisplayMode, TableSortByFieldState } from './Table/types';
|
||||
export { TableCellDisplayMode, type TableSortByFieldState } from './Table/types';
|
||||
export { TableInputCSV } from './TableInputCSV/TableInputCSV';
|
||||
export { TabsBar } from './Tabs/TabsBar';
|
||||
export { Tab } from './Tabs/Tab';
|
||||
@ -104,33 +104,38 @@ export {
|
||||
VizTooltip,
|
||||
VizTooltipContainer,
|
||||
SeriesTable,
|
||||
SeriesTableProps,
|
||||
type SeriesTableProps,
|
||||
SeriesTableRow,
|
||||
SeriesTableRowProps,
|
||||
type SeriesTableRowProps,
|
||||
} from './VizTooltip';
|
||||
export { VizRepeater, VizRepeaterRenderValueProps } from './VizRepeater/VizRepeater';
|
||||
export { VizRepeater, type VizRepeaterRenderValueProps } from './VizRepeater/VizRepeater';
|
||||
export { graphTimeFormat, graphTickFormatter } from './Graph/utils';
|
||||
export {
|
||||
PanelChrome,
|
||||
PanelChromeProps,
|
||||
PanelPadding,
|
||||
PanelChromeType,
|
||||
type PanelChromeProps,
|
||||
type PanelPadding,
|
||||
type PanelChromeType,
|
||||
PanelChromeLoadingIndicator,
|
||||
PanelChromeLoadingIndicatorProps,
|
||||
type PanelChromeLoadingIndicatorProps,
|
||||
PanelChromeErrorIndicator,
|
||||
PanelChromeErrorIndicatorProps,
|
||||
type PanelChromeErrorIndicatorProps,
|
||||
PanelContextProvider,
|
||||
PanelContext,
|
||||
type PanelContext,
|
||||
PanelContextRoot,
|
||||
usePanelContext,
|
||||
} from './PanelChrome';
|
||||
export { VizLayout, VizLayoutComponentType, VizLayoutLegendProps, VizLayoutProps } from './VizLayout/VizLayout';
|
||||
export { VizLegendItem, SeriesVisibilityChangeBehavior } from './VizLegend/types';
|
||||
export {
|
||||
VizLayout,
|
||||
type VizLayoutComponentType,
|
||||
type VizLayoutLegendProps,
|
||||
type VizLayoutProps,
|
||||
} from './VizLayout/VizLayout';
|
||||
export { type VizLegendItem, SeriesVisibilityChangeBehavior } from './VizLegend/types';
|
||||
export { VizLegend } from './VizLegend/VizLegend';
|
||||
export { VizLegendListItem } from './VizLegend/VizLegendListItem';
|
||||
|
||||
export { Alert, AlertVariant } from './Alert/Alert';
|
||||
export { GraphSeriesToggler, GraphSeriesTogglerAPI } from './Graph/GraphSeriesToggler';
|
||||
export { Alert, type AlertVariant } from './Alert/Alert';
|
||||
export { GraphSeriesToggler, type GraphSeriesTogglerAPI } from './Graph/GraphSeriesToggler';
|
||||
export { Collapse, ControlledCollapse } from './Collapse/Collapse';
|
||||
export { CollapsableSection } from './Collapse/CollapsableSection';
|
||||
export { LogLabels } from './Logs/LogLabels';
|
||||
@ -144,10 +149,10 @@ export { FullWidthButtonContainer } from './Button/FullWidthButtonContainer';
|
||||
export { ClickOutsideWrapper } from './ClickOutsideWrapper/ClickOutsideWrapper';
|
||||
export * from './SingleStatShared/index';
|
||||
export { CallToActionCard } from './CallToActionCard/CallToActionCard';
|
||||
export { ContextMenu, ContextMenuProps } from './ContextMenu/ContextMenu';
|
||||
export { Menu, MenuProps } from './Menu/Menu';
|
||||
export { MenuGroup, MenuItemsGroup, MenuGroupProps } from './Menu/MenuGroup';
|
||||
export { MenuItem, MenuItemProps } from './Menu/MenuItem';
|
||||
export { ContextMenu, type ContextMenuProps } from './ContextMenu/ContextMenu';
|
||||
export { Menu, type MenuProps } from './Menu/Menu';
|
||||
export { MenuGroup, type MenuItemsGroup, type MenuGroupProps } from './Menu/MenuGroup';
|
||||
export { MenuItem, type MenuItemProps } from './Menu/MenuItem';
|
||||
export { WithContextMenu } from './ContextMenu/WithContextMenu';
|
||||
export { DataLinksInlineEditor } from './DataLinks/DataLinksInlineEditor/DataLinksInlineEditor';
|
||||
export { DataLinkInput } from './DataLinks/DataLinkInput';
|
||||
@ -161,7 +166,7 @@ export { JsonExplorer } from './JSONFormatter/json_explorer/json_explorer';
|
||||
export {
|
||||
ErrorBoundary,
|
||||
ErrorBoundaryAlert,
|
||||
ErrorBoundaryAlertProps,
|
||||
type ErrorBoundaryAlertProps,
|
||||
withErrorBoundary,
|
||||
} from './ErrorBoundary/ErrorBoundary';
|
||||
export { ErrorWithStack } from './ErrorBoundary/ErrorWithStack';
|
||||
@ -181,7 +186,7 @@ export { RangeSlider } from './Slider/RangeSlider';
|
||||
export { Form } from './Forms/Form';
|
||||
export { sharedInputStyle } from './Forms/commonStyles';
|
||||
export { InputControl } from './InputControl';
|
||||
export { Button, LinkButton, ButtonVariant, ButtonGroup, ButtonProps } from './Button';
|
||||
export { Button, LinkButton, type ButtonVariant, ButtonGroup, type ButtonProps } from './Button';
|
||||
export { ToolbarButton, ToolbarButtonRow } from './ToolbarButton';
|
||||
export { ValuePicker } from './ValuePicker/ValuePicker';
|
||||
export { fieldMatchersUI } from './MatchersUI/fieldMatchersUI';
|
||||
@ -206,14 +211,14 @@ export { getSelectStyles } from './Select/getSelectStyles';
|
||||
export * from './Select/types';
|
||||
|
||||
export { HorizontalGroup, VerticalGroup, Container } from './Layout/Layout';
|
||||
export { Badge, BadgeColor, BadgeProps } from './Badge/Badge';
|
||||
export { Badge, type BadgeColor, type BadgeProps } from './Badge/Badge';
|
||||
export { RadioButtonGroup } from './Forms/RadioButtonGroup/RadioButtonGroup';
|
||||
export { RadioButtonList } from './Forms/RadioButtonList/RadioButtonList';
|
||||
|
||||
export { Input, getInputStyles } from './Input/Input';
|
||||
export { AutoSizeInput } from './Input/AutoSizeInput';
|
||||
export { FilterInput } from './FilterInput/FilterInput';
|
||||
export { FormInputSize } from './Forms/types';
|
||||
export type { FormInputSize } from './Forms/types';
|
||||
export * from './SecretInput';
|
||||
export * from './SecretTextArea';
|
||||
|
||||
@ -225,12 +230,12 @@ export { FileUpload } from './FileUpload/FileUpload';
|
||||
export * from './FileDropzone';
|
||||
export { TimeRangeInput } from './DateTimePickers/TimeRangeInput';
|
||||
export { RelativeTimeRangePicker } from './DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker';
|
||||
export { Card, Props as CardProps, getCardStyles } from './Card/Card';
|
||||
export { CardContainer, CardContainerProps } from './Card/CardContainer';
|
||||
export { Card, type Props as CardProps, getCardStyles } from './Card/Card';
|
||||
export { CardContainer, type CardContainerProps } from './Card/CardContainer';
|
||||
export { FormattedValueDisplay } from './FormattedValueDisplay/FormattedValueDisplay';
|
||||
export { ButtonSelect } from './Dropdown/ButtonSelect';
|
||||
export { Dropdown } from './Dropdown/Dropdown';
|
||||
export { PluginSignatureBadge, PluginSignatureBadgeProps } from './PluginSignatureBadge/PluginSignatureBadge';
|
||||
export { PluginSignatureBadge, type PluginSignatureBadgeProps } from './PluginSignatureBadge/PluginSignatureBadge';
|
||||
|
||||
// Export this until we've figured out a good approach to inline form styles.
|
||||
export { InlineFormLabel } from './FormLabel/FormLabel';
|
||||
@ -256,13 +261,13 @@ export { UPlotChart } from './uPlot/Plot';
|
||||
export { PlotLegend } from './uPlot/PlotLegend';
|
||||
export * from './uPlot/geometries';
|
||||
export * from './uPlot/plugins';
|
||||
export { PlotTooltipInterpolator, PlotSelection } from './uPlot/types';
|
||||
export { UPlotConfigPrepFn } from './uPlot/config/UPlotConfigBuilder';
|
||||
export { GraphNG, GraphNGProps, FIXED_UNIT } from './GraphNG/GraphNG';
|
||||
export { type PlotTooltipInterpolator, type PlotSelection } from './uPlot/types';
|
||||
export { type UPlotConfigPrepFn } from './uPlot/config/UPlotConfigBuilder';
|
||||
export { GraphNG, type GraphNGProps, FIXED_UNIT } from './GraphNG/GraphNG';
|
||||
export { TimeSeries } from './TimeSeries/TimeSeries';
|
||||
export { useGraphNGContext } from './GraphNG/hooks';
|
||||
export { preparePlotFrame, buildScaleKey } from './GraphNG/utils';
|
||||
export { GraphNGLegendEvent } from './GraphNG/types';
|
||||
export { type GraphNGLegendEvent } from './GraphNG/types';
|
||||
export * from './PanelChrome/types';
|
||||
export { EmotionPerfTest } from './ThemeDemos/EmotionPerfTest';
|
||||
export { Label as BrowserLabel } from './BrowserLabel/Label';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { createRef } from 'react';
|
||||
import React, { Component, createRef } from 'react';
|
||||
import uPlot, { AlignedData, Options } from 'uplot';
|
||||
|
||||
import { PlotProps } from './types';
|
||||
@ -36,7 +36,7 @@ type UPlotChartState = {
|
||||
* Receives a data frame that is x-axis aligned, as of https://github.com/leeoniya/uPlot/tree/master/docs#data-format
|
||||
* Exposes context for uPlot instance access
|
||||
*/
|
||||
export class UPlotChart extends React.Component<PlotProps, UPlotChartState> {
|
||||
export class UPlotChart extends Component<PlotProps, UPlotChartState> {
|
||||
plotContainer = createRef<HTMLDivElement>();
|
||||
plotCanvasBBox = createRef<DOMRect>();
|
||||
|
||||
|
@ -11,35 +11,35 @@ export {
|
||||
LineInterpolation,
|
||||
ScaleDistribution,
|
||||
GraphGradientMode,
|
||||
LineStyle,
|
||||
PointsConfig,
|
||||
ScaleDistributionConfig,
|
||||
HideSeriesConfig,
|
||||
type LineStyle,
|
||||
type PointsConfig,
|
||||
type ScaleDistributionConfig,
|
||||
type HideSeriesConfig,
|
||||
BarAlignment,
|
||||
VisibilityMode as BarValueVisibility,
|
||||
ScaleOrientation,
|
||||
ScaleDirection,
|
||||
LineConfig,
|
||||
BarConfig,
|
||||
FillConfig,
|
||||
AxisConfig,
|
||||
HideableFieldConfig,
|
||||
type LineConfig,
|
||||
type BarConfig,
|
||||
type FillConfig,
|
||||
type AxisConfig,
|
||||
type HideableFieldConfig,
|
||||
StackingMode,
|
||||
StackingConfig,
|
||||
StackableFieldConfig,
|
||||
type StackingConfig,
|
||||
type StackableFieldConfig,
|
||||
GraphTresholdsStyleMode,
|
||||
GraphThresholdsStyleConfig,
|
||||
GraphFieldConfig,
|
||||
LegendPlacement,
|
||||
type GraphThresholdsStyleConfig,
|
||||
type GraphFieldConfig,
|
||||
type LegendPlacement,
|
||||
LegendDisplayMode,
|
||||
VizLegendOptions,
|
||||
OptionsWithLegend,
|
||||
TableFieldOptions,
|
||||
type VizLegendOptions,
|
||||
type OptionsWithLegend,
|
||||
type TableFieldOptions,
|
||||
TableCellDisplayMode,
|
||||
FieldTextAlignment,
|
||||
VizTextDisplayOptions,
|
||||
OptionsWithTextFormatting,
|
||||
type FieldTextAlignment,
|
||||
type VizTextDisplayOptions,
|
||||
type OptionsWithTextFormatting,
|
||||
TooltipDisplayMode,
|
||||
VizTooltipOptions,
|
||||
OptionsWithTooltip,
|
||||
type VizTooltipOptions,
|
||||
type OptionsWithTooltip,
|
||||
} from '@grafana/schema';
|
||||
|
@ -5,5 +5,5 @@ export { IndentationPlugin } from './indentation';
|
||||
export { NewlinePlugin } from './newline';
|
||||
export { RunnerPlugin } from './runner';
|
||||
export { SelectionShortcutsPlugin } from './selection_shortcuts';
|
||||
export { SlatePrism, Token } from './slate-prism';
|
||||
export { SlatePrism, type Token } from './slate-prism';
|
||||
export { SuggestionsPlugin } from './suggestions';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { UseFormReturn, FieldValues, FieldErrors } from 'react-hook-form';
|
||||
export { SubmitHandler as FormsOnSubmit, FieldErrors as FormFieldErrors } from 'react-hook-form';
|
||||
export type { SubmitHandler as FormsOnSubmit, FieldErrors as FormFieldErrors } from 'react-hook-form';
|
||||
|
||||
export type FormAPI<T> = Omit<UseFormReturn<T>, 'trigger' | 'handleSubmit'> & {
|
||||
errors: FieldErrors<T>;
|
||||
|
@ -1 +1 @@
|
||||
export { ActionMeta } from '../components/Select/types';
|
||||
export type { ActionMeta } from '../components/Select/types';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import React from 'react';
|
||||
import React, { Component } from 'react';
|
||||
|
||||
interface StateHolderProps<T> {
|
||||
logState?: boolean;
|
||||
@ -7,7 +7,7 @@ interface StateHolderProps<T> {
|
||||
children: (currentState: T, updateState: (nextState: T) => void) => React.ReactNode;
|
||||
}
|
||||
|
||||
export class UseState<T> extends React.Component<StateHolderProps<T>, { value: T; initialState: T }> {
|
||||
export class UseState<T> extends Component<StateHolderProps<T>, { value: T; initialState: T }> {
|
||||
constructor(props: StateHolderProps<T>) {
|
||||
super(props);
|
||||
this.state = {
|
||||
|
@ -1,11 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"declarationDir": "dist",
|
||||
"outDir": "compiled",
|
||||
"rootDirs": [".", "stories"]
|
||||
"declarationDir": "./compiled",
|
||||
"emitDeclarationOnly": true,
|
||||
"isolatedModules": true,
|
||||
"rootDirs": ["."]
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"exclude": ["dist/**/*"],
|
||||
"extends": "@grafana/tsconfig",
|
||||
"include": ["src/**/*.ts*", "../../public/app/types/*.d.ts", "../grafana-schema/src/schema/models.gen.ts"]
|
||||
"include": ["src/**/*.ts*", "../../public/app/types/*.d.ts"],
|
||||
// override for storybook which uses ts-node to compile main.ts / preview.ts files.
|
||||
"ts-node": {
|
||||
"compilerOptions": {
|
||||
"isolatedModules": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
|
||||
import { DataQuery } from '@grafana/data';
|
||||
import { getBackendSrv, getDataSourceSrv } from '@grafana/runtime';
|
||||
import { RichHistoryQuery } from 'app/types/explore';
|
||||
|
||||
import { DataQuery } from '../../../../packages/grafana-data';
|
||||
import { PreferencesService } from '../services/PreferencesService';
|
||||
import { RichHistorySearchFilters, RichHistorySettings, SortOrder } from '../utils/richHistoryTypes';
|
||||
|
||||
|
@ -1,15 +1,10 @@
|
||||
import { of } from 'rxjs';
|
||||
import { BackendSrv, BackendSrvRequest } from 'src/services';
|
||||
|
||||
import { DataQueryRequest, DataSourceInstanceSettings, DataSourceRef } from '@grafana/data';
|
||||
import { BackendSrvRequest, BackendSrv, DataSourceWithBackend } from '@grafana/runtime';
|
||||
import { MIXED_DATASOURCE_NAME } from 'app/plugins/datasource/mixed/MixedDataSource';
|
||||
|
||||
import {
|
||||
PUBLIC_DATASOURCE,
|
||||
PublicDashboardDataSource,
|
||||
} from '../../../../public/app/features/dashboard/services/PublicDashboardDataSource';
|
||||
import { MIXED_DATASOURCE_NAME } from '../../../../public/app/plugins/datasource/mixed/MixedDataSource';
|
||||
|
||||
import { DataSourceWithBackend } from './DataSourceWithBackend';
|
||||
import { PublicDashboardDataSource, PUBLIC_DATASOURCE } from './PublicDashboardDataSource';
|
||||
|
||||
const mockDatasourceRequest = jest.fn();
|
||||
|
||||
@ -19,8 +14,8 @@ const backendSrv = {
|
||||
},
|
||||
} as unknown as BackendSrv;
|
||||
|
||||
jest.mock('../services', () => ({
|
||||
...jest.requireActual('../services'),
|
||||
jest.mock('@grafana/runtime', () => ({
|
||||
...jest.requireActual('@grafana/runtime'),
|
||||
getBackendSrv: () => backendSrv,
|
||||
getDataSourceSrv: () => {
|
||||
return {
|
@ -23,6 +23,8 @@ import {
|
||||
ValueMap,
|
||||
ValueMapping,
|
||||
} from '@grafana/data';
|
||||
import { labelsToFieldsTransformer } from '@grafana/data/src/transformations/transformers/labelsToFields';
|
||||
import { mergeTransformer } from '@grafana/data/src/transformations/transformers/merge';
|
||||
import { getDataSourceSrv, setDataSourceSrv } from '@grafana/runtime';
|
||||
import { AxisPlacement, GraphFieldConfig } from '@grafana/ui';
|
||||
import { getAllOptionEditors, getAllStandardFieldConfigs } from 'app/core/components/OptionsUI/registry';
|
||||
@ -44,8 +46,6 @@ import { CloudWatchMetricsQuery, LegacyAnnotationQuery } from 'app/plugins/datas
|
||||
import { plugin as gaugePanelPlugin } from 'app/plugins/panel/gauge/module';
|
||||
import { plugin as statPanelPlugin } from 'app/plugins/panel/stat/module';
|
||||
|
||||
import { labelsToFieldsTransformer } from '../../../../../packages/grafana-data/src/transformations/transformers/labelsToFields';
|
||||
import { mergeTransformer } from '../../../../../packages/grafana-data/src/transformations/transformers/merge';
|
||||
import {
|
||||
migrateCloudWatchQuery,
|
||||
migrateMultipleStatsAnnotationQuery,
|
||||
|
@ -3,11 +3,8 @@ import React, { FC, useCallback } from 'react';
|
||||
|
||||
import { GrafanaTheme2, SelectableValue, StandardEditorProps } from '@grafana/data';
|
||||
import { Select, ColorPicker, useStyles2 } from '@grafana/ui';
|
||||
import { useFieldDisplayNames, useSelectOptions } from '@grafana/ui/src/components/MatchersUI/utils';
|
||||
|
||||
import {
|
||||
useFieldDisplayNames,
|
||||
useSelectOptions,
|
||||
} from '../../../../../packages/grafana-ui/src/components/MatchersUI/utils';
|
||||
import { ColorDimensionConfig } from '../types';
|
||||
|
||||
const fixedColorOption: SelectableValue<string> = {
|
||||
|
@ -3,12 +3,9 @@ import React, { FC, useCallback, useMemo } from 'react';
|
||||
|
||||
import { GrafanaTheme2, SelectableValue, StandardEditorProps } from '@grafana/data';
|
||||
import { InlineField, InlineFieldRow, Select, useStyles2 } from '@grafana/ui';
|
||||
import { useFieldDisplayNames, useSelectOptions } from '@grafana/ui/src/components/MatchersUI/utils';
|
||||
import { NumberInput } from 'app/core/components/OptionsUI/NumberInput';
|
||||
|
||||
import {
|
||||
useFieldDisplayNames,
|
||||
useSelectOptions,
|
||||
} from '../../../../../packages/grafana-ui/src/components/MatchersUI/utils';
|
||||
import { validateScaleOptions, validateScaleConfig } from '../scale';
|
||||
import { ScaleDimensionConfig, ScaleDimensionOptions } from '../types';
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { DataFrame, Field } from '@grafana/data';
|
||||
|
||||
import { getMinMaxAndDelta } from '../../../../packages/grafana-data/src/field/scale';
|
||||
import { getMinMaxAndDelta } from '@grafana/data/src/field/scale';
|
||||
|
||||
import { ScaleDimensionConfig, DimensionSupplier, ScaleDimensionOptions } from './types';
|
||||
import { findField, getLastNotNullFieldValue } from './utils';
|
||||
|
@ -2,11 +2,11 @@ import { fireEvent, render, screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import { DataQuery } from '@grafana/data';
|
||||
import { setDataSourceSrv } from '@grafana/runtime';
|
||||
import { configureStore } from 'app/store/configureStore';
|
||||
import { ExploreId, ExploreState } from 'app/types';
|
||||
|
||||
import { DataQuery } from '../../../../packages/grafana-data/src';
|
||||
import { UserState } from '../profile/state/reducers';
|
||||
|
||||
import { QueryRows } from './QueryRows';
|
||||
|
@ -1,9 +1,8 @@
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { SelectableValue } from '@grafana/data';
|
||||
import { Select } from '@grafana/ui';
|
||||
|
||||
import { SelectableValue } from '../../../../../packages/grafana-data/src';
|
||||
|
||||
import { RuleSettingsEditor } from './RuleSettingsEditor';
|
||||
import { RuleType, RuleSetting, PipeLineEntitiesInfo } from './types';
|
||||
|
||||
|
@ -10,11 +10,12 @@ import {
|
||||
TransformerRegistryItem,
|
||||
TransformerUIProps,
|
||||
} from '@grafana/data';
|
||||
import { ConvertFieldTypeTransformerOptions } from '@grafana/data/src/transformations/transformers/convertFieldType';
|
||||
import {
|
||||
ConvertFieldTypeOptions,
|
||||
ConvertFieldTypeTransformerOptions,
|
||||
} from '@grafana/data/src/transformations/transformers/convertFieldType';
|
||||
import { Button, InlineField, InlineFieldRow, Input, Select } from '@grafana/ui';
|
||||
|
||||
import { ConvertFieldTypeOptions } from '../../../../../packages/grafana-data/src/transformations/transformers/convertFieldType';
|
||||
import { FieldNamePicker } from '../../../../../packages/grafana-ui/src/components/MatchersUI/FieldNamePicker';
|
||||
import { FieldNamePicker } from '@grafana/ui/src/components/MatchersUI/FieldNamePicker';
|
||||
|
||||
const fieldNamePickerSettings: StandardEditorsRegistryItem<string, FieldNamePickerConfigSettings> = {
|
||||
settings: { width: 24 },
|
||||
|
@ -1,10 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
import { DataTransformerID, standardTransformers, TransformerRegistryItem, TransformerUIProps } from '@grafana/data';
|
||||
import { MergeTransformerOptions } from '@grafana/data/src/transformations/transformers/merge';
|
||||
import { FieldValidationMessage } from '@grafana/ui';
|
||||
|
||||
import { MergeTransformerOptions } from '../../../../../packages/grafana-data/src/transformations/transformers/merge';
|
||||
|
||||
export const MergeTransformerEditor: React.FC<TransformerUIProps<MergeTransformerOptions>> = ({
|
||||
input,
|
||||
options,
|
||||
|
@ -3,7 +3,8 @@ import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import selectEvent from 'react-select-event';
|
||||
|
||||
import { setDataSourceSrv } from '../../../../../../packages/grafana-runtime';
|
||||
import { setDataSourceSrv } from '@grafana/runtime';
|
||||
|
||||
import { AdHocVariableFilter } from '../../types';
|
||||
|
||||
import { AdHocFilter } from './AdHocFilter';
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user