Skip to content

Commit 041aed5

Browse files
authored
Merge pull request thedevs-network#657 from thedevs-network/chore/update-deps
Update dependencies and delete v1 API
2 parents d5debac + ea63139 commit 041aed5

Some content is hidden

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

98 files changed

+21172
-51925
lines changed

.babelrc

-10
This file was deleted.

.docker.env

-15
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ DB_USER=
1818
DB_PASSWORD=
1919
DB_SSL=false
2020

21-
# ONLY NEEDED FOR MIGRATION !!1!
22-
# Neo4j database credential details
23-
NEO4J_DB_URI=bolt://localhost
24-
NEO4J_DB_USERNAME=neo4j
25-
NEO4J_DB_PASSWORD=pass
26-
2721
# Redis host and port
2822
REDIS_HOST=redis
2923
REDIS_PORT=6379
@@ -65,15 +59,6 @@ RECAPTCHA_SECRET_KEY=
6559
# Get it from https://developers.google.com/safe-browsing/v4/get-started
6660
GOOGLE_SAFE_BROWSING_KEY=
6761

68-
# Google Analytics tracking ID for universal analytics.
69-
# Example: UA-XXXX-XX
70-
GOOGLE_ANALYTICS=
71-
GOOGLE_ANALYTICS_UNIVERSAL=
72-
73-
# Google Analytics tracking ID for universal analytics
74-
# This one is used for links
75-
# GOOGLE_ANALYTICS_UNIVERSAL=
76-
7762
# Your email host details to use to send verification emails.
7863
# More info on http://nodemailer.com/
7964
# Mail from example "Kutt <[email protected]>". Leave empty to use MAIL_USER

.eslintrc

+8-26
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,22 @@
11
{
22
"extends": [
3-
"eslint:recommended",
4-
"plugin:@typescript-eslint/eslint-recommended",
5-
"plugin:prettier/recommended"
3+
"next/core-web-vitals",
4+
"plugin:@typescript-eslint/recommended",
5+
"prettier"
66
],
7-
"parser": "@typescript-eslint/parser",
87
"parserOptions": {
8+
"ecmaVersion": "latest",
9+
"sourceType": "module",
910
"project": ["./tsconfig.json", "./client/tsconfig.json"]
1011
},
11-
"plugins": ["@typescript-eslint"],
12+
"plugins": ["@typescript-eslint", "prettier"],
1213
"rules": {
13-
"eqeqeq": ["warn", "always", { "null": "ignore" }],
14-
"no-useless-return": "warn",
15-
"no-var": "warn",
16-
"no-console": "warn",
17-
"no-unused-vars": "off",
18-
"max-len": ["warn", { "comments": 80 }],
19-
"no-param-reassign": 0,
20-
"require-atomic-updates": 0,
21-
"@typescript-eslint/interface-name-prefix": "off",
22-
"@typescript-eslint/no-unused-vars": "off", // "warn" for production
23-
"@typescript-eslint/no-explicit-any": "off", // "warn" for production
24-
"@typescript-eslint/no-var-requires": "off",
25-
"@typescript-eslint/camelcase": "off",
26-
"@typescript-eslint/no-object-literal-type-assertion": "off",
27-
"@typescript-eslint/no-parameter-properties": "off",
28-
"@typescript-eslint/explicit-function-return-type": "off"
14+
"@typescript-eslint/no-explicit-any": ["off"]
2915
},
3016
"env": {
3117
"es6": true,
3218
"browser": true,
33-
"node": true,
34-
"mocha": true
35-
},
36-
"globals": {
37-
"assert": true
19+
"node": true
3820
},
3921
"settings": {
4022
"react": {

.example.env

-15
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ DB_USER=
1818
DB_PASSWORD=
1919
DB_SSL=false
2020

21-
# ONLY NEEDED FOR MIGRATION !!1!
22-
# Neo4j database credential details
23-
NEO4J_DB_URI=bolt://localhost
24-
NEO4J_DB_USERNAME=neo4j
25-
NEO4J_DB_PASSWORD=pass
26-
2721
# Redis host and port
2822
REDIS_HOST=127.0.0.1
2923
REDIS_PORT=6379
@@ -68,15 +62,6 @@ RECAPTCHA_SECRET_KEY=
6862
# Get it from https://developers.google.com/safe-browsing/v4/get-started
6963
GOOGLE_SAFE_BROWSING_KEY=
7064

71-
# Google Analytics tracking ID for universal analytics.
72-
# Example: UA-XXXX-XX
73-
GOOGLE_ANALYTICS=
74-
GOOGLE_ANALYTICS_UNIVERSAL=
75-
76-
# Google Analytics tracking ID for universal analytics
77-
# This one is used for links
78-
# GOOGLE_ANALYTICS_UNIVERSAL=
79-
8065
# Your email host details to use to send verification emails.
8166
# More info on http://nodemailer.com/
8267
# Mail from example "Kutt <[email protected]>". Leave empty to use MAIL_USER

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint:nofix

MIGRATION.md

-44
This file was deleted.

README.md

-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ _Contributions and bug reports are welcome._
1313
[![GitHub license](https://img.shields.io/github/license/thedevs-network/kutt.svg)](https://github.com/thedevs-network/kutt/blob/develop/LICENSE)
1414
[![Twitter](https://img.shields.io/twitter/url/https/github.com/thedevs-network/kutt/.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fthedevs-network%2Fkutt%2F)
1515

16-
## Migration from v1
17-
18-
The new version of Kutt is here. In version 2, we used TypeScript and we moved from Neo4j to PostgreSQL database in favor of performance and we're working on adding new features.
19-
20-
If you're coming from v1, refer to [MIGRATION.md](MIGRATION.md) to migrate data from Neo4j to PostgreSQL.
21-
2216
## Table of Contents
2317

2418
- [Key Features](#key-features)

client/components/ALink.tsx

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import { Box, BoxProps } from "reflexbox/styled-components";
1+
import { FC } from "react";
2+
import { Box, BoxProps } from "rebass/styled-components";
23
import styled, { css } from "styled-components";
34
import { ifProp } from "styled-tools";
5+
import Link from "next/link";
46

57
interface Props extends BoxProps {
68
href?: string;
79
title?: string;
810
target?: string;
911
rel?: string;
1012
forButton?: boolean;
13+
isNextLink?: boolean;
1114
}
12-
const ALink = styled(Box).attrs({
13-
as: "a"
14-
})<Props>`
15+
const StyledBox = styled(Box)<Props>`
1516
cursor: pointer;
1617
color: #2196f3;
1718
border-bottom: 1px dotted transparent;
@@ -28,6 +29,20 @@ const ALink = styled(Box).attrs({
2829
)}
2930
`;
3031

32+
export const ALink: FC<Props> = (props) => {
33+
if (props.isNextLink) {
34+
const { href, target, title, rel, ...rest } = props;
35+
return (
36+
<Link href={href} target={target} title={title} rel={rel} passHref>
37+
<StyledBox as="a" {...rest} />
38+
</Link>
39+
);
40+
}
41+
return <StyledBox as="a" {...props} />;
42+
};
43+
44+
ALink.displayName = "ALink";
45+
3146
ALink.defaultProps = {
3247
pb: "1px",
3348
forButton: false

client/components/Animation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { fadeInVertical } from "../helpers/animations";
2-
import { Flex } from "reflexbox/styled-components";
2+
import { Flex } from "rebass/styled-components";
33
import styled from "styled-components";
44
import { prop } from "styled-tools";
55
import { FC } from "react";
@@ -10,7 +10,7 @@ interface Props extends React.ComponentProps<typeof Flex> {
1010
}
1111

1212
const Animation: FC<Props> = styled(Flex)<Props>`
13-
animation: ${props => fadeInVertical(props.offset)}
13+
animation: ${(props) => fadeInVertical(props.offset)}
1414
${prop("duration", "0.3s")} ease-out;
1515
`;
1616

client/components/AppWrapper.tsx

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Flex } from "reflexbox/styled-components";
1+
import { Flex } from "rebass/styled-components";
22
import React, { useEffect } from "react";
33
import styled from "styled-components";
4-
import Router from "next/router";
54

65
import { useStoreState, useStoreActions } from "../store";
76
import PageLoading from "./PageLoading";
@@ -22,11 +21,11 @@ const Wrapper = styled(Flex)`
2221
`;
2322

2423
const AppWrapper = ({ children }: { children: any }) => {
25-
const isAuthenticated = useStoreState(s => s.auth.isAuthenticated);
26-
const logout = useStoreActions(s => s.auth.logout);
27-
const fetched = useStoreState(s => s.settings.fetched);
28-
const loading = useStoreState(s => s.loading.loading);
29-
const getSettings = useStoreActions(s => s.settings.getSettings);
24+
const isAuthenticated = useStoreState((s) => s.auth.isAuthenticated);
25+
const logout = useStoreActions((s) => s.auth.logout);
26+
const fetched = useStoreState((s) => s.settings.fetched);
27+
const loading = useStoreState((s) => s.loading.loading);
28+
const getSettings = useStoreActions((s) => s.settings.getSettings);
3029

3130
const isVerifyEmailPage =
3231
typeof window !== "undefined" &&
@@ -36,7 +35,7 @@ const AppWrapper = ({ children }: { children: any }) => {
3635
if (isAuthenticated && !fetched && !isVerifyEmailPage) {
3736
getSettings().catch(() => logout());
3837
}
39-
}, [isVerifyEmailPage]);
38+
}, [isAuthenticated, fetched, isVerifyEmailPage, getSettings, logout]);
4039

4140
return (
4241
<Wrapper

client/components/Button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled, { css } from "styled-components";
22
import { switchProp, prop, ifProp } from "styled-tools";
3-
import { Flex, BoxProps } from "reflexbox/styled-components";
3+
import { Flex, BoxProps } from "rebass/styled-components";
44

55
interface Props extends BoxProps {
66
color?: "purple" | "gray" | "blue" | "red";

client/components/Divider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Flex } from "reflexbox/styled-components";
1+
import { Flex } from "rebass/styled-components";
22
import styled from "styled-components";
33

44
import { Colors } from "../consts";

client/components/Extensions.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import styled from "styled-components";
3-
import { Flex } from "reflexbox/styled-components";
3+
import { Flex } from "rebass/styled-components";
44
import SVG from "react-inlinesvg"; // TODO: another solution
55
import { Colors } from "../consts";
66
import { ColCenterH } from "./Layout";
@@ -62,7 +62,7 @@ const Icon = styled(SVG)`
6262
width: 18px;
6363
height: 18px;
6464
margin-right: 16px;
65-
fill: ${props => props.color || "#333"};
65+
fill: ${(props) => props.color || "#333"};
6666
6767
@media only screen and (max-width: 768px) {
6868
width: 13px;

client/components/Features.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React from "react";
2-
import styled from "styled-components";
3-
import { Flex } from "reflexbox/styled-components";
2+
import { Flex } from "rebass/styled-components";
43

54
import FeaturesItem from "./FeaturesItem";
65
import { ColCenterH } from "./Layout";
76
import { Colors } from "../consts";
8-
import Text, { H3 } from "./Text";
7+
import { H3 } from "./Text";
98

109
const Features = () => (
1110
<ColCenterH

client/components/FeaturesItem.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React, { FC } from "react";
1+
import React, { FC, ReactNode } from "react";
22
import styled from "styled-components";
3-
import { Flex } from "reflexbox/styled-components";
3+
import { Flex } from "rebass/styled-components";
44

55
import { fadeIn } from "../helpers/animations";
66
import Icon from "./Icon";
@@ -9,6 +9,7 @@ import { Icons } from "./Icon/Icon";
99
interface Props {
1010
title: string;
1111
icon: Icons;
12+
children?: ReactNode;
1213
}
1314

1415
const Block = styled(Flex).attrs({

client/components/Footer.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Text from "./Text";
1111
const { publicRuntimeConfig } = getConfig();
1212

1313
const Footer: FC = () => {
14-
const { isAuthenticated } = useStoreState(s => s.auth);
14+
const { isAuthenticated } = useStoreState((s) => s.auth);
1515

1616
useEffect(() => {
1717
showRecaptcha();
@@ -27,7 +27,7 @@ const Footer: FC = () => {
2727
{!isAuthenticated && <ReCaptcha />}
2828
<Text fontSize={[12, 13]} py={2}>
2929
Made with love by{" "}
30-
<ALink href="//thedevs.network/" title="The Devs">
30+
<ALink href="//thedevs.network/" title="The Devs" target="_blank">
3131
The Devs
3232
</ALink>
3333
.{" | "}
@@ -39,11 +39,11 @@ const Footer: FC = () => {
3939
GitHub
4040
</ALink>
4141
{" | "}
42-
<ALink href="/terms" title="Terms of Service">
42+
<ALink href="/terms" title="Terms of Service" isNextLink>
4343
Terms of Service
4444
</ALink>
4545
{" | "}
46-
<ALink href="/report" title="Report abuse">
46+
<ALink href="/report" title="Report abuse" isNextLink>
4747
Report Abuse
4848
</ALink>
4949
{publicRuntimeConfig.CONTACT_EMAIL && (

0 commit comments

Comments
 (0)