Skip to content

Commit 79282f1

Browse files
tot-rafranpeza
andauthored
3.2.0 Some formatting (#125) (#127)
* Some formatting (#125) * Upgrade dependencies * Format source Co-authored-by: Francisco Pérez Zamora <[email protected]> * updated CHANGELOG.md revert react to v16 because of react-diff-viewer bump prism for npm audit remove changelog-verify for npm audit * cleanup Co-authored-by: franpeza <[email protected]> Co-authored-by: Francisco Pérez Zamora <[email protected]>
1 parent 95f3b9c commit 79282f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+6943
-14237
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
*/examples
44
*/test
55
repository.json
6+
.deploy

.eslintrc

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"parser": "@babel/eslint-parser",
3+
"extends": [
4+
"eslint:recommended",
5+
"pipedrive",
6+
"plugin:prettier/recommended"
7+
],
8+
"env": {
9+
"browser": true,
10+
"jest": true
11+
},
12+
"overrides": [
13+
{
14+
"files": "**/*.{ts,tsx}",
15+
"parser": "@typescript-eslint/parser",
16+
"extends": [
17+
"plugin:@typescript-eslint/recommended",
18+
"plugin:react/recommended",
19+
"plugin:react/jsx-runtime",
20+
"pipedrive",
21+
"plugin:prettier/recommended"
22+
],
23+
"env": {
24+
"browser": true
25+
},
26+
"settings": {
27+
"react": {
28+
"version": "detect"
29+
}
30+
}
31+
},
32+
{
33+
"files": "**/*.jsx",
34+
"parser": "@babel/eslint-parser",
35+
"extends": [
36+
"eslint:recommended",
37+
"plugin:react/recommended",
38+
"plugin:react/jsx-runtime",
39+
"pipedrive",
40+
"plugin:prettier/recommended"
41+
],
42+
"settings": {
43+
"react": {
44+
"version": "detect"
45+
}
46+
},
47+
"rules": {
48+
"react/prop-types": "off"
49+
}
50+
}
51+
]
52+
}

CHANGELOG.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [3.2.0] - 2022-05-05
11+
12+
### Updated
13+
14+
- `eslint` libraries were being listed as dependencies but not config was set. So an eslint config was added.
15+
- Same thing with `prettier`, it was listed as a dependency and executed on commit (not configured for ts files though) but some files were not formatted with it.
16+
- Some unused dependencies were removed from both `dependencies` and `devDependencies`.
17+
- Removed react-hot-loader because it was not proper configured. I have already a working version with [react-refresh-webpack-plugin](https://github.com/pmmmwh/react-refresh-webpack-plugin) planned for a future PR.
18+
- Some libraries (mostly for the frontend part compilation) were upgrades in order to `improve` the generation of the bundle.
19+
- Some `general cleanup`: removed unused imports, unused declarations, etc.
20+
1021
## [3.1.0] - 2022-05-05
1122

1223
### Added
24+
1325
- Added dependency to winston
1426
- Added an instance of logger in logger.ts and removed the logging functions
1527
- Replace every use of the previous logger functions with calls to the logger exposed from logger.ts
1628

1729
### Fixed
30+
1831
- npm lock version 2
1932
- graphql & @apollo/federation version compatibility
2033
- mysql2 & knex version compatibility
@@ -232,7 +245,8 @@ DELETE /schema/:schemaId
232245
- Frontend app
233246
- Examples of gateway + 2 federated services
234247

235-
[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v3.0.1...HEAD
248+
[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v3.2.0...HEAD
249+
[3.2.0]: https://github.com/pipedrive/graphql-schema-registry/compare/v3.1.0...v3.2.0
236250
[3.1.0]: https://github.com/pipedrive/graphql-schema-registry/compare/v3.0.1...v3.1.0
237251
[3.0.1]: https://github.com/pipedrive/graphql-schema-registry/compare/v3.0.0...v3.0.1
238252
[3.0.0]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.4...v3.0.0

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WORKDIR /app
88
USER nobody
99
ADD package.json package-lock.json ./
1010
RUN npm install
11-
ADD webpack.config.cjs babel.config.cjs ./
11+
ADD webpack.config.js babel.config.js ./
1212
ADD client ./client
1313
RUN npm run build-frontend
1414

Dockerfile.CI

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WORKDIR /app
77
USER nobody
88
ADD git_src/package.json git_src/package-lock.json ./
99
RUN npm install
10-
ADD git_src/webpack.config.cjs git_src/babel.config.cjs ./
10+
ADD git_src/webpack.config.js git_src/babel.config.js ./
1111
ADD git_src/client ./client
1212
RUN npm run build-frontend
1313

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Graphql schema storage as dockerized on-premise service for federated graphql ga
2626
(Pull requests are encouraged on these topics)
2727

2828
- Usage tracking (to avoid breaking changes) - needs a separate docker sub-process in golang
29-
- registered clients (based on headers, including apollo-* ones)
29+
- registered clients (based on headers, including apollo-\* ones)
3030
- schema usage breakdown by multiple facets - property, day, query name, client name
3131
- fixed data retention
3232
- schema linting rules (camelCase, mandatory descriptions, too big objects, inconsistent pagination, dates not in DateTime...)

babel.config.cjs

-24
This file was deleted.

babel.config.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = (api) => {
2+
// This caches the Babel config
3+
api.cache.using(() => process.env.NODE_ENV);
4+
return {
5+
presets: [
6+
[
7+
'@babel/preset-env',
8+
{
9+
modules: 'auto',
10+
useBuiltIns: 'usage',
11+
corejs: '3',
12+
},
13+
],
14+
[
15+
'@babel/preset-react',
16+
{ development: !api.env('production'), runtime: 'automatic' },
17+
],
18+
],
19+
plugins: [
20+
['babel-plugin-styled-components'],
21+
['@babel/plugin-transform-runtime'],
22+
[
23+
'prismjs',
24+
{
25+
languages: ['graphql'],
26+
theme: 'okaidia',
27+
css: true,
28+
},
29+
],
30+
],
31+
};
32+
};

client/App.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import {
32
ApolloClient,
43
InMemoryCache,

client/components/Main.jsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import React from 'react';
2-
import { Tabs, Box, Tab, Container, AppBar } from '@material-ui/core';
32
import { HashRouter as Router, Route, Redirect } from 'react-router-dom';
4-
import { hot } from 'react-hot-loader';
53

64
import TopMenu from './TopMenu';
75
import TabPanel from './TabPanel';
@@ -54,4 +52,4 @@ const Main = () => {
5452
);
5553
};
5654

57-
export default hot(module)(Main);
55+
export default Main;

client/components/SourceCodeWithHighlight.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react';
2-
31
import usePrism from '../utils/usePrism';
42
import { OverflowScroll } from './styled';
53

client/components/SourceCodeWithHighlightAndCopy.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import CheckIcon from '@material-ui/icons/Check';
32
import FilterNoneIcon from '@material-ui/icons/FilterNone';
43
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';

client/components/SpinnerCenter.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import CircularProgress from '@material-ui/core/CircularProgress';
32

43
import { FlexCenter } from './styled';

client/components/TabPanel.jsx

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import React from 'react';
2-
31
import PropTypes from 'prop-types';
4-
import { Box } from '@material-ui/core';
52

63
function TabPanel(props) {
74
const { children, value, index, ...other } = props;

client/components/TopLevelTab.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import Tabs from '@material-ui/core/Tabs';
32
import { Link, useRouteMatch } from 'react-router-dom';
43

client/components/TopMenu.jsx

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { AppBar, IconButton, Tab, Tabs, Toolbar } from '@material-ui/core';
2-
import React from 'react';
1+
import { AppBar, Tab, Tabs } from '@material-ui/core';
32
import ReactLogo from './logo';
43
import { useHistory } from 'react-router-dom';
54

6-
export default ({ UITabs, selectedTab, handleChange }) => {
7-
let history = useHistory();
5+
export default function TopMenu({ UITabs, selectedTab, handleChange }) {
6+
const history = useHistory();
87

98
return (
109
<AppBar
@@ -24,16 +23,16 @@ export default ({ UITabs, selectedTab, handleChange }) => {
2423
onChange={handleChange}
2524
aria-label="simple tabs example"
2625
>
27-
{/*<React.Fragment>*/}
26+
{/* <React.Fragment>*/}
2827
{UITabs.map((tab, i) => (
2928
<Tab
3029
key={i}
3130
onClick={() => history.push(tab.href)}
3231
label={tab.Title}
3332
/>
3433
))}
35-
{/*</React.Fragment>*/}
34+
{/* </React.Fragment>*/}
3635
</Tabs>
3736
</AppBar>
3837
);
39-
};
38+
}

client/components/logo.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react';
2-
31
export default function Logo() {
42
return (
53
<div>

client/entry-standalone.jsx

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// eslint-disable-next-line
22
__webpack_public_path__ = '/assets/';
33

4-
import 'react-hot-loader';
5-
6-
import React from 'react';
74
import ReactDOM from 'react-dom';
85

96
import App from './App';

client/persisted-queries/PersistedQuery.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import { useState } from 'react';
22

33
import { EntryPanel } from '../components/styled';
44
import QueryName from './QueryName';

client/persisted-queries/QueryName.jsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import React from 'react';
2-
31
import { EntryName } from '../components/styled';
42

53
import { DocumentQueryEntry } from './styled';
64

7-
const QueryName = ({ entry, revealed, onClick }) => {
5+
const QueryName = ({ entry, onClick }) => {
86
return (
97
<DocumentQueryEntry onClick={onClick}>
108
<div>

client/persisted-queries/Tab.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { useQuery } from '@apollo/client';
32
import { PERSISTED_QUERIES_COUNT } from '../utils/queries';
43

client/persisted-queries/index.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { useQuery } from '@apollo/client';
32

43
import SpinnerCenter from '../components/SpinnerCenter';

client/schema/index.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { HashRouter as Router, Route } from 'react-router-dom';
32
import { useQuery } from '@apollo/client';
43

client/schema/service-details/CodeDiff.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer';
32

43
const newStyles = {

client/schema/service-details/DeactivateSchemaButton.jsx

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import { useMutation } from '@apollo/client';
32
import { Button } from '@material-ui/core';
43
import DeleteIcon from '@material-ui/icons/Delete';
@@ -8,19 +7,13 @@ import {
87
DEACTIVATE_SCHEMA_ENTRY,
98
ACTIVATE_SCHEMA_ENTRY,
109
} from '../../utils/mutations';
11-
import { useParams } from 'react-router-dom';
1210

1311
const DeactivateSchemaButton = ({ schema }) => {
14-
const { serviceName } = useParams();
15-
const [
16-
deactivateSchema,
17-
{ loading: deleting, error: deleteError },
18-
] = useMutation(DEACTIVATE_SCHEMA_ENTRY);
12+
const [deactivateSchema, { loading: deleting, error: deleteError }] =
13+
useMutation(DEACTIVATE_SCHEMA_ENTRY);
1914

20-
const [
21-
activateSchema,
22-
{ loading: activating, error: activateError },
23-
] = useMutation(ACTIVATE_SCHEMA_ENTRY);
15+
const [activateSchema, { loading: activating, error: activateError }] =
16+
useMutation(ACTIVATE_SCHEMA_ENTRY);
2417

2518
const deleteErrorMessage = deleteError ? deleteError.message : null;
2619
const activateErrorMessage = activateError ? activateError.message : null;

client/schema/service-details/Empty.jsx

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react';
2-
31
import { Container, SelectServiceGuide } from '../styled';
42

53
const Empty = () => {

client/schema/service-details/ServiceSchemas.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from 'react';
1+
import { useState } from 'react';
22
import { useQuery } from '@apollo/client';
33

44
import SpinnerCenter from '../../components/SpinnerCenter';

client/schema/service-details/VersionCharDelta.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react';
21
import {
32
VersionChars,
43
VersionCharsPositive,

client/schema/service-details/VersionDetails.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import { useState } from 'react';
22
import { Button, ButtonGroup, Tabs, Tab } from '@material-ui/core';
33
import TabPanel from '../../components/TabPanel';
44

@@ -22,7 +22,7 @@ import CodeDiff from './CodeDiff';
2222

2323
const VersionDetails = () => {
2424
const [revealed, setRevealed] = useState(null);
25-
const [value, setValue] = React.useState(0);
25+
const [value, setValue] = useState(0);
2626

2727
const handleChange = (event, newValue) => {
2828
setValue(newValue);

client/schema/service-details/VersionsList.jsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
2-
import { Link, useHistory, useParams } from 'react-router-dom';
3-
import { format, formatDistance } from 'date-fns';
1+
import { useHistory, useParams } from 'react-router-dom';
2+
import { formatDistance } from 'date-fns';
43

54
import { EntryGrid } from '../../components/styled';
65
import { FlexRow, VersionRow, VersionTag } from '../styled';
@@ -12,7 +11,7 @@ import VersionCharDelta from './VersionCharDelta';
1211
const VersionsList = ({ service }) => {
1312
const { serviceName, schemaId } = useParams();
1413
const selectedSchema = parseInt(schemaId, 10);
15-
let history = useHistory();
14+
const history = useHistory();
1615

1716
if (!service) {
1817
return;

0 commit comments

Comments
 (0)