Skip to content

Commit

Permalink
Update/remove various npm dependencies to fix syntax highlighting (#47)
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Volz <[email protected]>

Signed-off-by: Julius Volz <[email protected]>
  • Loading branch information
juliusv committed Nov 10, 2022
1 parent 7023849 commit 171530e
Show file tree
Hide file tree
Showing 10 changed files with 10,989 additions and 12,194 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ assets-compress:

.PHONY: ui-install
ui-install:
cd $(REACT_APP_PATH) && npm install --legacy-peer-deps
cd $(REACT_APP_PATH) && npm install

.PHONY: build-ui
build-ui:
Expand Down
23,152 changes: 10,980 additions & 12,172 deletions app/package-lock.json

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@lezer/highlight": "^1.1.1",
"@prometheus-io/codemirror-promql": "^0.39.1",
"@reach/router": "^1.3.4",
"bootstrap": "^4.5.3",
"flot": "^4.2.1",
"fuzzy": "^0.1.3",
Expand Down Expand Up @@ -68,10 +67,7 @@
},
"proxy": "http://localhost:8080",
"devDependencies": {
"@bahmutov/add-typescript-to-cypress": "^2.1.2",
"@testing-library/react-hooks": "^5.1.3",
"@types/enzyme": "^3.10.8",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/flot": "0.0.31",
"@types/jest": "^26.0.23",
"@types/jquery": "^3.5.5",
Expand All @@ -85,8 +81,6 @@
"@types/react-resize-detector": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"eslint-config-prettier": "^7.1.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.7.2",
Expand All @@ -96,7 +90,6 @@
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.3.0",
"react-test-renderer": "^17.0.2",
"redux-devtools": "^3.7.0",
"typescript": "^4.2.4"
}
}
5 changes: 1 addition & 4 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FC } from 'react';
import { Router } from '@reach/router';

import TopNav from './TopNav';
import PromLens from './pages/PromLens';
Expand All @@ -13,9 +12,7 @@ const App: FC<PathPrefixProps> = ({ pathPrefix }) => {
<TopNav pathPrefix={pathPrefix} />
{/* Without primary={false}, the page doesn't scroll to the top upon page change.
See https://github.com/reach/router/issues/242#issuecomment-467082358 */}
<Router primary={false} basepath={`${pathPrefix}/`}>
<PromLens path="/" pathPrefix={pathPrefix} />
</Router>
<PromLens pathPrefix={pathPrefix} />
</DndProvider>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/src/PromLens/NodeVisualizer/Graph/GraphHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('GraphHelpers', () => {
try {
formatValue(undefined as any);
} catch (error) {
expect(error.message).toEqual("couldn't format a value, this is a bug");
expect((error as Error).message).toEqual("couldn't format a value, this is a bug");
}
});
});
Expand Down
3 changes: 1 addition & 2 deletions app/src/PromLens/PromLensUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { FC, useState, useMemo } from 'react';

import ASTNode from '../promql/ast';
import QueryList from './QueryList/QueryList';
import { RouteComponentProps } from '@reach/router';
import NodeVisualizer from './NodeVisualizer/NodeVisualizer';
import { denormalizeAST } from '../state/normalizeAST';
import { connect } from 'react-redux';
Expand All @@ -27,7 +26,7 @@ interface PromLensUIOwnProps {
initialTrigger: boolean;
}

const PromLens: FC<PromLensUIStateProps & PromLensUIOwnProps & RouteComponentProps & PathPrefixProps> = ({
const PromLens: FC<PromLensUIStateProps & PromLensUIOwnProps & PathPrefixProps> = ({
pathPrefix,
serverSettings,
datasources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DurationEditor: FC<DurationEditorProps> = ({ duration: initialDuration, on
onUpdate(parseDuration(duration));
setDurationError('');
} catch (error) {
setDurationError(error.message);
setDurationError((error as Error).message);
}
};

Expand Down
6 changes: 2 additions & 4 deletions app/src/pages/PromLens.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React, { FC, useState, useEffect } from 'react';

import { RouteComponentProps } from '@reach/router';
import { Container, Alert } from 'react-bootstrap';
import { createStore } from 'redux';
import { importState, setServerSettings, setExpr } from '../state/actions';
Expand Down Expand Up @@ -105,7 +103,7 @@ const examplePageState = {
version: 1,
} as ExportedStateV1;

const PromLens: FC<RouteComponentProps & PathPrefixProps> = ({ pathPrefix }) => {
const PromLens: FC<PathPrefixProps> = ({ pathPrefix }) => {
const [pageConfig, setPageConfig] = useState<PageConfig | null>(null);
const [pageConfigLoading, setPageConfigLoading] = useState<boolean>(true);
const [pageConfigError, setPageConfigError] = useState<string | null>(null);
Expand Down Expand Up @@ -169,7 +167,7 @@ const PromLens: FC<RouteComponentProps & PathPrefixProps> = ({ pathPrefix }) =>
// TODO: Somewhat duplicated with access in PromLensUI.
localStorage.setItem('promlens.show-example-page-link', 'false');
} catch (error) {
setStateImportError(error);
setStateImportError((error as Error).message);
}
} else {
// If no initial page state is provided and Grafana datasources contain a default server,
Expand Down
2 changes: 1 addition & 1 deletion app/src/promAPI/promAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class PromAPI {
setError(undefined);
setData(apiRes.data!);
} catch (error) {
setError(error);
setError(error as Error);
} finally {
setLoading(false);
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ then
fi

cd app
npm i --legacy-peer-deps
npm i
npm run build

0 comments on commit 171530e

Please sign in to comment.