Skip to content

Commit 9704650

Browse files
authored
[IGNORE] fix datasource variable build configuration and bumo version (#383)
Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
1 parent b6208d5 commit 9704650

5 files changed

Lines changed: 26 additions & 17 deletions

File tree

datasourcevariable/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@perses-dev/datasource-variable-plugin",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"homepage": "https://github.com/perses/plugins/blob/main/README.md",
55
"repository": {
66
"type": "git",
@@ -11,7 +11,11 @@
1111
},
1212
"scripts": {
1313
"dev": "rsbuild dev",
14-
"build": "rsbuild build",
14+
"build": "npm run build-mf && concurrently \"npm:build:*\"",
15+
"build-mf": "rsbuild build",
16+
"build:cjs": "swc ./src -d dist/lib/cjs --strip-leading-paths --config-file ../.cjs.swcrc",
17+
"build:esm": "swc ./src -d dist/lib --strip-leading-paths --config-file ../.swcrc",
18+
"build:types": "tsc --project tsconfig.build.json",
1519
"lint": "eslint src --ext .ts,.tsx",
1620
"test": "cross-env LC_ALL=C TZ=UTC jest --passWithNoTests",
1721
"type-check": "tsc --noEmit"

datasourcevariable/src/DatasourceVariable.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ export const DatasourceVariableOptionEditor = (props: OptionsEditorProps<StaticL
4040

4141
// If there is no selected kind and there are available options, select the first one
4242
useEffect(() => {
43-
if (selectedKind.value === EMPTY_SELECTED_KIND.value && datasourcePluginKindSet.size > 0) {
44-
onChange({
45-
datasourcePluginKind: Array.from(datasourcePluginKindSet)[0],
46-
});
43+
const datasourcePluginKindArray = Array.from(datasourcePluginKindSet);
44+
if (
45+
selectedKind.value === EMPTY_SELECTED_KIND.value &&
46+
datasourcePluginKindArray.length > 0 &&
47+
datasourcePluginKindArray[0]
48+
) {
49+
onChange({ datasourcePluginKind: datasourcePluginKindArray[0] });
4750
}
4851
}, [selectedKind, datasourcePluginKind, onChange, datasourcePluginKindSet]);
4952

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": ["**/*.stories.*", "**/*.test.*", "**/*.map"],
4+
"compilerOptions": {
5+
"emitDeclarationOnly": true,
6+
"declaration": true,
7+
"preserveWatchOutput": true
8+
}
9+
}

datasourcevariable/tsconfig.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
{
2+
"extends": "../tsconfig.base.json",
23
"compilerOptions": {
3-
"target": "ES2020",
4-
"lib": ["DOM", "ES2020"],
5-
"module": "ESNext",
6-
"jsx": "react-jsx",
7-
"strict": true,
8-
"skipLibCheck": true,
9-
"isolatedModules": true,
10-
"resolveJsonModule": true,
11-
"moduleResolution": "bundler",
12-
"useDefineForClassFields": true
4+
"outDir": "./dist/lib",
5+
"rootDir": "./src"
136
},
147
"include": ["src"]
158
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)