Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
module.exports = {
"env": {
env: {
"browser": true,
"es6": true,
"node": true
"es2021": true,
"node": true,
"jest": true
},
"extends": [
extends: [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
parser: "@typescript-eslint/parser",
parserOptions: {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
plugins: [
"react",
"@typescript-eslint"
],
"rules": {
"no-console": 1,
rules: {
"no-console": 2,
"prefer-template": 1,
"no-unused-vars": 0,
"react/display-name": 0,
"react/prop-types": 0,
"react/react-in-jsx-scope": 0,
"react/no-unescaped-entities": 0,
"react/no-children-prop": 0
"react/no-children-prop": 0,
"prettier/prettier": ["error", { endOfLine: "auto" }],
},
settings: {
react: {
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
with:
node-version: "12"
- uses: actions/checkout@v2
- uses: borales/actions-yarn@v2.0.0
- uses: borales/actions-yarn@v2.3.0
with:
cmd: install
- uses: borales/actions-yarn@v2.0.0
- uses: borales/actions-yarn@v2.3.0
with:
cmd: lint
- uses: borales/actions-yarn@v2.0.0
- uses: borales/actions-yarn@v2.3.0
with:
cmd: test
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
"trailingComma": "all",
"arrowParens": "always",
"semi": true
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"**/.hg/store/**": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"editor.formatOnSave": false,
"[javascript]": {
"editor.formatOnSave": false
},
Expand Down
6 changes: 3 additions & 3 deletions graphql/modules/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const makePath = (parentPath: string | null | undefined, slug: string) => {
const updateAllChildPaths = async (
ctx: NexusContext,
parentId: string,
parentPath: string
parentPath: string,
) => {
const childPages = await ctx.db.page.findMany({
where: {
Expand All @@ -37,7 +37,7 @@ const updateAllChildPaths = async (
},
});
await updateAllChildPaths(ctx, child.id, childPath);
})
}),
);
};
nexusAddCrudResolvers(
Expand Down Expand Up @@ -108,5 +108,5 @@ nexusAddCrudResolvers(
},
{
aliasPrefix: "admin",
}
},
);
2 changes: 1 addition & 1 deletion graphql/modules/blogPost/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ schema.queryType({
...args,
},
ctx,
info
info,
);
},
});
Expand Down
4 changes: 2 additions & 2 deletions graphql/modules/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const setLoginHeader = (ctx: NexusContext, user: User) => {
"Set-Cookie",
`token=${token}; Path=/; expires=${expires}; HttpOnly; Domain=${
new URL(ROOT_URL).hostname
}`
}`,
);
};

Expand All @@ -28,7 +28,7 @@ const setLogoutHeader = (ctx: NexusContext) =>
"Set-Cookie",
`token=deleted; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; Domain=${
new URL(ROOT_URL).hostname
}`
}`,
);

schema.objectType({
Expand Down
4 changes: 2 additions & 2 deletions graphql/permissions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const isAuthenticated = rule({ cache: "contextual" })(
async (parent, args, ctx: NexusContext, info) => {
const userId = getUserId(ctx.token);
return Boolean(userId);
}
},
);

const isAdmin = rule({ cache: "contextual" })(
Expand All @@ -21,7 +21,7 @@ const isAdmin = rule({ cache: "contextual" })(
});

return user?.roles.some((r) => r.id === "admin") ?? false;
}
},
);

const rules = {
Expand Down
6 changes: 3 additions & 3 deletions graphql/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ use(
appSecret: APP_SECRET,
useCookie: true,
cookieName: "token",
})
}),
);
use(
prisma({
paginationStrategy: "prisma",
features: {
crud: true,
},
})
}),
);

use(
Expand All @@ -55,5 +55,5 @@ use(
options: {
allowExternalErrors: true,
},
})
}),
);
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const localeSubpaths = { en: "en", de: "de" };
const { ROOT_URL = "http://localhost:3000" } = process.env;

module.exports = {
swcMinify: true,
publicRuntimeConfig: {
localeSubpaths,
ROOT_URL,
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,43 @@
"postinstall": "patch-package"
},
"dependencies": {
"@apollo/client": "^3.1.3",
"@apollo/client": "^3.3.16",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@ra-data-prisma/backend": "^3.0.1",
"@ra-data-prisma/dataprovider": "^3.1.0",
"@react-page/editor": "^0.23.3",
"@react-page/plugins-slate": "^0.23.3",
"@react-page/editor": "^4.3.1",
"@react-page/plugins-slate": "^4.3.1",
"@types/bcryptjs": "^2.4.2",
"@types/styled-components": "^5.1.2",
"@types/uuid": "^8.3.0",
"accept-language-parser": "^1.5.0",
"apollo-upload-client": "^14.1.1",
"aws-sdk": "^2.734.0",
"aws-sdk": "^2.1046.0",
"bcryptjs": "^2.4.3",
"browser-image-resizer": "^2.1.3",
"dayjs": "^1.8.33",
"gql": "^1.1.2",
"minimist": "^1.2.5",
"next": "9.5.2",
"next": "12",
"next-i18next": "^6.0.2",
"next-seo": "^4.7.3",
"next-server-context": "^1.0.0",
"next-with-apollo": "^5.1.0",
"nexus": "^0.26.1",
"nexus": "^1.1.0",
"nexus-plugin-jwt-auth": "^1.3.1",
"nexus-plugin-prisma": "^0.17.0",
"nexus-plugin-prisma": "^0.35.0",
"nexus-plugin-shield": "^0.2.0",
"patch-package": "^6.2.2",
"path": "^0.12.7",
"postinstall-postinstall": "^2.1.0",
"react": "16.13.1",
"react": "^17.0.2",
"react-admin": "^3.8.1",
"react-dom": "16.13.1",
"react-dom": "^17.0.2",
"react-rectangle": "^1.3.3",
"styled-components": "^5.1.1",
"styled-reset": "^4.2.2",
"ts-node": "^8.10.2",
"ts-node": "^9.1.1",
"uuid": "^8.3.0"
},
"devDependencies": {
Expand All @@ -70,24 +70,24 @@
"@types/node": "^14.0.27",
"@types/react": "^16.9.46",
"@types/styled-components": "^5.1.2",
"@typescript-eslint/eslint-plugin": "^3.9.0",
"@typescript-eslint/parser": "^3.9.0",
"apollo": "^2.30.2",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^5.7.0",
"apollo": "^2.33.9",
"babel-jest": "^26.3.0",
"babel-plugin-styled-components": "^1.11.1",
"concurrently": "^5.3.0",
"concurrently": "^6.4.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.3",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.20.5",
"jest": "^26.4.0",
"prettier": "^2.0.5",
"jest": "^27.4.5",
"prettier": "^2.2.1",
"ts-jest": "^26.2.0",
"typescript": "^3.9.7"
"typescript": "^4.4.4"
},
"resolutions": {
"graphql": "14.7.0"
"graphql": "15.5.0"
}
}
13 changes: 0 additions & 13 deletions patches/nexus+0.26.1.patch

This file was deleted.

183 changes: 0 additions & 183 deletions patches/nexus-plugin-prisma+0.17.0.patch

This file was deleted.

10 changes: 2 additions & 8 deletions src/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,8 @@ const nextI18Next = new NextI18Next({

export default nextI18Next;

const {
useTranslation,
Trans,
appWithTranslation,
Link,
Router,
i18n,
} = nextI18Next;
const { useTranslation, Trans, appWithTranslation, Link, Router, i18n } =
nextI18Next;

/*
moment.locale(["de"]);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/layout/components/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const HeadingBase = styled.h1<{ level?: Level }>`
? "fontHeading"
: p.level === 2
? "fontHeading2"
: "fontHeading3"
: "fontHeading3",
)};
margin-bottom: 0.5em;
`;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/layout/components/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const useStyles = makeStyles((theme: Theme) =>
flexGrow: 1,
padding: theme.spacing(3),
},
})
}),
);

type Props = {
Expand Down
16 changes: 5 additions & 11 deletions src/modules/layout/components/stories/MainMenu.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import React from "react"
import React from "react";
// import { action } from "@storybook/addon-actions";
import MainMenu from "../MainMenu"


import MainMenu from "../MainMenu";

export default {
component: MainMenu,
title: 'layout/MainMenu',
title: "layout/MainMenu",
};

export const defaultView = () => (
<MainMenu />
)



export const defaultView = () => <MainMenu header={null} />;
2 changes: 1 addition & 1 deletion src/modules/reactPage/components/ImageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ImageInput: React.FC<ImageInputProps> = ({
const shouldResize = file.size > 512 * 1024;
const resizedFile = shouldResize
? await import("browser-image-resizer").then((r) =>
r.readAndCompressImage(file, config)
r.readAndCompressImage(file, config),
)
: file;

Expand Down
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const withApolloClient = withApollo(
cache: new InMemoryCache().restore(initialState || {}),
}) as any;
},
{ getDataFromTree }
{ getDataFromTree },
);

const getDefaultLayout = (el: any) => <BasePageLayout>{el}</BasePageLayout>;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class MyDocument extends Document {
originalRenderPage({
enhanceApp: (App) => (props) =>
muiSheet.collect(
styledComponentsSheet.collectStyles(<App {...props} />)
styledComponentsSheet.collectStyles(<App {...props} />),
),
});

Expand Down
Loading