Skip to content

Commit 0772197

Browse files
authored
Chore: update dependencies (#96)
* Chore: update dependencies * update changelog to prepare for 0.5.0 release * final update before releasing
1 parent 93883c5 commit 0772197

19 files changed

+3658
-4032
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## v0.5.0
6+
7+
- Chore: update dependencies in [#96](https://github.com/grafana/grafana-aws-sdk-react/pull/96)
8+
59
## v0.4.2
610

711
- Bump fast-loops from 1.1.3 to 1.1.4 in [#94](https://github.com/grafana/grafana-aws-sdk-react/pull/94)

jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// do not edit this file
44
module.exports = {
55
modulePaths: ['<rootDir>/src'],
6+
moduleNameMapper: {
7+
'\\.(css|scss|sass)$': 'identity-obj-proxy',
8+
},
69
setupFilesAfterEnv: ['<rootDir>/src/tests/setupTests.ts'],
710
testEnvironment: 'jest-environment-jsdom',
811
testMatch: [
@@ -28,4 +31,3 @@ module.exports = {
2831
},
2932
transformIgnorePatterns: [],
3033
};
31-

package.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grafana/aws-sdk",
3-
"version": "0.4.2",
3+
"version": "0.5.0",
44
"description": "Common AWS features for grafana",
55
"main": "dist/index.js",
66
"module": "dist/esm/index.js",
@@ -11,9 +11,9 @@
1111
"scripts": {
1212
"dev": "yarn bundle --watch --watch.onStart=\"yarn typecheck\"",
1313
"build": "yarn clean && yarn typecheck && yarn bundle",
14-
"bundle": "rollup -c rollup.config.ts",
14+
"bundle": "rollup -c rollup.config.ts --configPlugin esbuild",
1515
"clean": "rimraf ./dist ./compiled",
16-
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx ./src && spellcheck",
16+
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx ./src && yarn spellcheck",
1717
"spellcheck": "cspell -c cspell.config.json \"**/*.{ts,tsx,js,go,md,mdx,yml,yaml,json,scss,css}\"",
1818
"typecheck": "tsc -p ./tsconfig.build.json",
1919
"test": "jest --notify --watch",
@@ -28,40 +28,40 @@
2828
"license": "Apache-2.0",
2929
"dependencies": {
3030
"@grafana/async-query-data": "0.2.0",
31-
"@grafana/experimental": "1.7.12"
31+
"@grafana/experimental": "2.1.1"
3232
},
3333
"devDependencies": {
34-
"@grafana/data": "10.3.6",
35-
"@grafana/eslint-config": "^6.0.1",
36-
"@grafana/runtime": "10.3.6",
37-
"@grafana/ui": "10.3.6",
38-
"@rollup/plugin-node-resolve": "^15.0.1",
39-
"@swc/core": "^1.3.93",
40-
"@swc/jest": "^0.2.29",
41-
"@testing-library/jest-dom": "5.16.5",
42-
"@testing-library/react": "12.1.5",
34+
"@grafana/data": "11.2.2",
35+
"@grafana/eslint-config": "^7.0.0",
36+
"@grafana/runtime": "11.2.2",
37+
"@grafana/tsconfig": "^2.0.0",
38+
"@grafana/ui": "11.2.2",
39+
"@rollup/plugin-node-resolve": "^15.3.0",
40+
"@swc/core": "^1.7.28",
41+
"@swc/jest": "^0.2.36",
42+
"@testing-library/jest-dom": "6.5.0",
43+
"@testing-library/react": "16.0.1",
4344
"@testing-library/react-hooks": "8.0.1",
44-
"@types/jest": "27.4.1",
45-
"@types/lodash": "4.14.191",
46-
"@types/node": "16.18.6",
47-
"@types/react": "18.3.3",
45+
"@testing-library/user-event": "^14.5.2",
46+
"@types/jest": "29.5.13",
47+
"@types/lodash": "4.17.10",
48+
"@types/node": "22.7.4",
49+
"@types/react": "18.3.11",
4850
"@types/react-dom": "18.3.0",
49-
"@typescript-eslint/eslint-plugin": "^5.48.0",
50-
"cspell": "6.13.3",
51-
"esbuild": "^0.16.2",
52-
"eslint": "^8.49.0",
53-
"eslint-plugin-jsdoc": "^46.7.0",
54-
"eslint-plugin-react": "^7.31.11",
55-
"eslint-plugin-react-hooks": "^4.6.0",
56-
"jest": "27.5.1",
51+
"cspell": "8.14.4",
52+
"esbuild": "^0.24.0",
53+
"eslint-plugin-deprecation": "^3.0.0",
54+
"identity-obj-proxy": "^3.0.0",
55+
"jest": "29.7.0",
56+
"jest-environment-jsdom": "^29.7.0",
5757
"node-notifier": "^10.0.1",
58-
"react": "18.2.0",
59-
"react-dom": "18.2.0",
58+
"react": "18.3.1",
59+
"react-dom": "18.3.1",
6060
"react-select-event": "^5.5.1",
61-
"rimraf": "^3.0.2",
62-
"rollup": "2.79.1",
63-
"rollup-plugin-dts": "^5.0.0",
64-
"rollup-plugin-esbuild": "^5.0.0",
65-
"rollup-plugin-node-externals": "^5.0.2"
61+
"rimraf": "^6.0.1",
62+
"rollup": "4.24.0",
63+
"rollup-plugin-dts": "^6.1.1",
64+
"rollup-plugin-esbuild": "^6.1.1",
65+
"rollup-plugin-node-externals": "^7.1.3"
6666
}
6767
}

rollup.config.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,47 @@
11
import resolve from '@rollup/plugin-node-resolve';
2+
import { createRequire } from 'node:module';
23
import path from 'path';
34
import dts from 'rollup-plugin-dts';
45
import esbuild from 'rollup-plugin-esbuild';
5-
import { externals } from 'rollup-plugin-node-externals';
6+
import { nodeExternals } from 'rollup-plugin-node-externals';
67

7-
const packagePath = './package.json';
8-
const pkg = require(packagePath);
8+
const rq = createRequire(import.meta.url);
9+
const pkg = rq('./package.json');
10+
11+
const legacyOutputDefaults = {
12+
esModule: true,
13+
interop: 'compat',
14+
};
915

1016
export default [
1117
{
1218
input: 'src/index.ts',
1319
plugins: [
14-
externals({
20+
nodeExternals({
1521
deps: true,
1622
include: ['react', '@emotion/css', '@grafana/data', '@grafana/ui', '@grafana/runtime', 'lodash'],
17-
packagePath,
23+
packagePath: './package.json',
1824
}),
1925
resolve(),
20-
esbuild(),
26+
esbuild({
27+
target: 'es2018',
28+
tsconfig: 'tsconfig.build.json',
29+
}),
2130
],
2231
output: [
2332
{
2433
format: 'cjs',
2534
sourcemap: true,
2635
dir: path.dirname(pkg.main),
36+
...legacyOutputDefaults,
2737
},
2838
{
2939
format: 'esm',
3040
sourcemap: true,
3141
dir: path.dirname(pkg.module),
3242
preserveModules: true,
3343
preserveModulesRoot: './src',
44+
...legacyOutputDefaults,
3445
},
3546
],
3647
},

src/components/ConnectionConfig.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import '@testing-library/jest-dom/extend-expect';
21
import React from 'react';
32
import { render, screen, waitFor } from '@testing-library/react';
4-
import { AwsAuthDataSourceJsonData, AwsAuthDataSourceSecureJsonData, AwsAuthType, ConnectionConfigProps } from '../types';
3+
import {
4+
AwsAuthDataSourceJsonData,
5+
AwsAuthDataSourceSecureJsonData,
6+
AwsAuthType,
7+
ConnectionConfigProps,
8+
} from '../types';
59
import { ConnectionConfig } from './ConnectionConfig';
610
import selectEvent from 'react-select-event';
711
import { config } from '@grafana/runtime';
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@testing-library/jest-dom/extend-expect';
1+
import '@testing-library/jest-dom';
22
import React from 'react';
33
import { render, screen, fireEvent } from '@testing-library/react';
44
import { mockQuery } from './__mocks__/query';
@@ -13,28 +13,28 @@ const props: FillValueSelectProps<SQLQuery> = {
1313
};
1414

1515
describe('FillValueSelect', () => {
16-
it('should change the fill value mode', async () => {
17-
render(<FillValueSelect {...props} />);
18-
expect(screen.getByText('Previous Value')).toBeInTheDocument();
16+
it('should change the fill value mode', async () => {
17+
render(<FillValueSelect {...props} />);
18+
expect(screen.getByText('Previous Value')).toBeInTheDocument();
1919

20-
const selectEl = screen.getByLabelText('Fill with');
21-
expect(selectEl).toBeInTheDocument();
22-
await select(selectEl, 'NULL', { container: document.body });
20+
const selectEl = screen.getByLabelText('Fill with');
21+
expect(selectEl).toBeInTheDocument();
22+
await select(selectEl, 'NULL', { container: document.body });
2323

24-
expect(props.onChange).toHaveBeenCalledWith({ ...props.query, fillMode: { mode: FillValueOptions.Null } });
25-
expect(props.onRunQuery).toHaveBeenCalled();
26-
});
24+
expect(props.onChange).toHaveBeenCalledWith({ ...props.query, fillMode: { mode: FillValueOptions.Null } });
25+
expect(props.onRunQuery).toHaveBeenCalled();
26+
});
2727

28-
it('should change the fill value for a custom value', async () => {
29-
render(<FillValueSelect {...props} query={{ ...mockQuery, fillMode: { mode: FillValueOptions.Value } }} />);
28+
it('should change the fill value for a custom value', async () => {
29+
render(<FillValueSelect {...props} query={{ ...mockQuery, fillMode: { mode: FillValueOptions.Value } }} />);
3030

31-
const input = screen.getByLabelText('Value');
32-
fireEvent.change(input, { target: { value: '2', valueAsNumber: 2 } });
31+
const input = screen.getByLabelText('Value');
32+
fireEvent.change(input, { target: { value: '2', valueAsNumber: 2 } });
3333

34-
expect(props.onChange).toHaveBeenCalledWith({
35-
...props.query,
36-
fillMode: { mode: FillValueOptions.Value, value: 2 },
37-
});
38-
expect(props.onRunQuery).toHaveBeenCalled();
39-
});
34+
expect(props.onChange).toHaveBeenCalledWith({
35+
...props.query,
36+
fillMode: { mode: FillValueOptions.Value, value: 2 },
37+
});
38+
expect(props.onRunQuery).toHaveBeenCalled();
39+
});
4040
});
Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
2-
import { DataQuery, SelectableValue } from '@grafana/data';
2+
import { SelectableValue } from '@grafana/data';
3+
import { DataQuery } from '@grafana/schema';
34
import { Input, Select } from '@grafana/ui';
45
import { EditorField } from '@grafana/experimental';
56

@@ -32,45 +33,45 @@ export type FillValueSelectProps<TQuery extends DataQuery> = {
3233

3334
export function FillValueSelect<TQuery extends DataQuery & Record<string, any>>(props: FillValueSelectProps<TQuery>) {
3435
return (
35-
<>
36-
<EditorField label="Fill with" tooltip="value to fill missing points" htmlFor="fillWith">
37-
<Select
38-
id="fillWith"
39-
aria-label="Fill with"
40-
data-testid="table-fill-with-select"
41-
options={SelectableFillValueOptions}
42-
value={props.query.fillMode?.mode ?? FillValueOptions.Previous}
43-
onChange={({ value }) => {
44-
props.onChange({
45-
...props.query,
46-
// Keep the fillMode.value in case FillValueOptions.Value mode is selected back
47-
fillMode: { ...props.query.fillMode, mode: value },
48-
});
49-
props.onRunQuery?.();
50-
}}
51-
menuShouldPortal={true}
52-
/>
53-
</EditorField>
54-
{props.query.fillMode?.mode === FillValueOptions.Value && (
55-
<EditorField label="Value" htmlFor="valueToFill" width={6}>
56-
<Input
57-
id="valueToFill"
58-
aria-label="Value"
59-
type="number"
60-
value={props.query.fillMode.value}
61-
onChange={({ currentTarget }: React.FormEvent<HTMLInputElement>) =>
62-
props.onChange({
63-
...props.query,
64-
fillMode: {
65-
mode: FillValueOptions.Value,
66-
value: currentTarget.valueAsNumber,
67-
},
68-
})
69-
}
70-
onBlur={() => props.onRunQuery?.()}
71-
/>
72-
</EditorField>
73-
)}
74-
</>
36+
<>
37+
<EditorField label="Fill with" tooltip="value to fill missing points" htmlFor="fillWith">
38+
<Select
39+
id="fillWith"
40+
aria-label="Fill with"
41+
data-testid="table-fill-with-select"
42+
options={SelectableFillValueOptions}
43+
value={props.query.fillMode?.mode ?? FillValueOptions.Previous}
44+
onChange={({ value }) => {
45+
props.onChange({
46+
...props.query,
47+
// Keep the fillMode.value in case FillValueOptions.Value mode is selected back
48+
fillMode: { ...props.query.fillMode, mode: value },
49+
});
50+
props.onRunQuery?.();
51+
}}
52+
menuShouldPortal={true}
53+
/>
54+
</EditorField>
55+
{props.query.fillMode?.mode === FillValueOptions.Value && (
56+
<EditorField label="Value" htmlFor="valueToFill" width={6}>
57+
<Input
58+
id="valueToFill"
59+
aria-label="Value"
60+
type="number"
61+
value={props.query.fillMode.value}
62+
onChange={({ currentTarget }: React.FormEvent<HTMLInputElement>) =>
63+
props.onChange({
64+
...props.query,
65+
fillMode: {
66+
mode: FillValueOptions.Value,
67+
value: currentTarget.valueAsNumber,
68+
},
69+
})
70+
}
71+
onBlur={() => props.onRunQuery?.()}
72+
/>
73+
</EditorField>
74+
)}
75+
</>
7576
);
7677
}

src/sql/QueryEditor/FormatSelect.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import '@testing-library/jest-dom/extend-expect';
21
import React from 'react';
32
import { render, screen } from '@testing-library/react';
43
import { mockQuery, SQLOptions } from './__mocks__/query';

src/sql/QueryEditor/FormatSelect.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
2-
import { DataQuery, SelectableValue } from '@grafana/data';
2+
import { SelectableValue } from '@grafana/data';
3+
import { DataQuery } from '@grafana/schema';
34
import { Select } from '@grafana/ui';
45

56
export type FormatSelectProps<TQuery extends DataQuery, FormatOptions> = {
@@ -20,12 +21,14 @@ export function FormatSelect<TQuery extends DataQuery & Record<string, any>, For
2021
});
2122
props.onRunQuery?.();
2223
};
23-
return <Select
24-
aria-label="Format data frames as"
25-
id={props.id ?? 'formatAs'}
26-
options={props.options}
27-
value={props.query.format}
28-
onChange={onChangeFormat}
29-
menuShouldPortal={true}
30-
/>
24+
return (
25+
<Select
26+
aria-label="Format data frames as"
27+
id={props.id ?? 'formatAs'}
28+
options={props.options}
29+
value={props.query.format}
30+
onChange={onChangeFormat}
31+
menuShouldPortal={true}
32+
/>
33+
);
3134
}

src/sql/QueryEditor/QueryCodeEditor.test.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import '@testing-library/jest-dom/extend-expect';
21
import React from 'react';
3-
import { render, screen, waitFor } from '@testing-library/react';
2+
import { render, screen } from '@testing-library/react';
43
import { mockQuery } from './__mocks__/query';
54
import { QueryCodeEditor } from './QueryCodeEditor';
65

@@ -18,8 +17,6 @@ describe('QueryCodeEditor', () => {
1817
// so we cannot test a lot here
1918
it('should render', async () => {
2019
render(<QueryCodeEditor {...props} />);
21-
await waitFor(() => {
22-
expect(screen.getByText('Loading...')).toBeInTheDocument();
23-
});
20+
expect(await screen.findByTestId('Spinner')).toBeDefined();
2421
});
2522
});

src/sql/QueryEditor/QueryCodeEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defaults } from 'lodash';
22

33
import React, { useRef, useEffect } from 'react';
44
import { CodeEditor, CodeEditorSuggestionItem, CodeEditorMonacoOptions } from '@grafana/ui';
5-
import { DataQuery } from '@grafana/data';
5+
import { DataQuery } from '@grafana/schema';
66

77
type EditorProps = {
88
width?: number | string;

0 commit comments

Comments
 (0)