Skip to content

Commit b8e5417

Browse files
author
Oded Winberger
committed
init
1 parent a14654d commit b8e5417

File tree

18 files changed

+1135
-1440
lines changed

18 files changed

+1135
-1440
lines changed

.yarn/install-state.gz

-129 KB
Binary file not shown.

.yarn/plugins/@yarnpkg/plugin-typescript.cjs

+9
Large diffs are not rendered by default.

.yarnrc.yml

+2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ plugins:
55
spec: "@yarnpkg/plugin-workspace-tools"
66
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
77
spec: "@yarnpkg/plugin-interactive-tools"
8+
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
9+
spec: "@yarnpkg/plugin-typescript"
810

911
yarnPath: .yarn/releases/yarn-3.5.0.cjs

apps/admin/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@apollo/client": "^3.6.8",
12+
"@apollo/client": "^3.7.10",
1313
"apollo-hooks": "*",
1414
"lodash-es": "^4.17.21",
15-
"next": "12.3.1",
16-
"react": "17.0.2",
17-
"react-dom": "17.0.2",
15+
"next": "13.2.4",
16+
"react": "18.2.0",
17+
"react-dom": "18.2.0",
1818
"ui": "*"
1919
},
2020
"devDependencies": {
21-
"@types/lodash": "^4.14.191",
22-
"@types/node": "^18.14.2",
23-
"@types/react": "17.0.37",
24-
"eslint": "8.33.0",
25-
"next-transpile-modules": "9.0.0",
21+
"@types/lodash": "^4.14.192",
22+
"@types/node": "^18.15.10",
23+
"@types/react": "18.0.30",
24+
"eslint": "8.36.0",
25+
"next-transpile-modules": "10.0.0",
2626
"tsconfig": "*",
27-
"typescript": "^4.8.4"
27+
"typescript": "^5.0.2"
2828
}
2929
}

apps/admin/src/pages/Home/Home.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { Button } from 'ui';
33

44
function Home() {
55
const { data } = useSearchArticlesQuery();
6-
6+
const articles = data?.articles;
7+
console.log('articles', articles);
8+
const flatArticles = articles?.results.flatMap(({}) => {})
79
return (
810
<div>
911
<h1>Admin</h1>

apps/admin/src/pages/Home/querySearchArticles.graphql

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ query SearchArticles($input: ArticlesInput) {
33
results {
44
id
55
title
6+
preview
7+
content
8+
author {
9+
id
10+
name
11+
avatar
12+
email
13+
}
14+
lead
15+
createdAt
16+
updatedAt
617
}
718
}
819
}

apps/api/package.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,43 @@
1717
"devDependencies": {
1818
"@boost/module": "^4.0.0",
1919
"@faker-js/faker": "^7.6.0",
20-
"@graphql-codegen/cli": "^3.2.1",
21-
"@graphql-codegen/schema-ast": "^2.5.1",
22-
"@graphql-codegen/typescript": "^2.7.4",
23-
"@graphql-codegen/typescript-operations": "^2.5.4",
24-
"@graphql-codegen/typescript-react-apollo": "^3.3.4",
25-
"@types/body-parser": "^1.19.0",
26-
"@types/cors": "^2.8.10",
27-
"@types/express": "^4.17.14",
28-
"@types/jest": "^29.4.0",
29-
"@types/jsonwebtoken": "^8.5.8",
30-
"@types/node": "^18.14.2",
31-
"esbuild-register": "^3.3.2",
32-
"eslint": "^8.33.0",
33-
"jest": "^29.4.1",
34-
"nodemon": "^2.0.20",
20+
"@graphql-codegen/cli": "^3.2.2",
21+
"@graphql-codegen/schema-ast": "^3.0.1",
22+
"@graphql-codegen/typescript": "^3.0.2",
23+
"@graphql-codegen/typescript-operations": "^3.0.2",
24+
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
25+
"@types/body-parser": "^1.19.2",
26+
"@types/cors": "^2.8.13",
27+
"@types/express": "^4.17.17",
28+
"@types/jest": "^29.5.0",
29+
"@types/jsonwebtoken": "^9.0.1",
30+
"@types/node": "^18.15.10",
31+
"esbuild-register": "^3.4.2",
32+
"eslint": "^8.36.0",
33+
"jest": "^29.5.0",
34+
"nodemon": "^2.0.22",
3535
"scripts": "*",
3636
"ts-node-dev": "^2.0.0",
3737
"tsconfig": "*",
38-
"typescript": "^4.8.4"
38+
"typescript": "^5.0.2"
3939
},
4040
"jest": {
4141
"preset": "scripts/jest/node"
4242
},
4343
"dependencies": {
44-
"@apollo/server": "^4.4.0",
45-
"@pothos/core": "^3.22.5",
46-
"@pothos/plugin-prisma": "^3.35.4",
47-
"@prisma/client": "^4.5.0",
48-
"body-parser": "^1.19.2",
49-
"cloudinary": "^1.32.0",
44+
"@apollo/server": "^4.5.0",
45+
"@pothos/core": "^3.29.0",
46+
"@pothos/plugin-prisma": "^3.47.0",
47+
"@prisma/client": "^4.11.0",
48+
"body-parser": "^1.20.2",
49+
"cloudinary": "^1.35.0",
5050
"cors": "^2.8.5",
5151
"express": "^4.18.2",
52-
"graphql": "^16.3.0",
53-
"graphql-scalars": "^1.20.1",
54-
"jsonwebtoken": "^8.5.1",
52+
"graphql": "^16.6.0",
53+
"graphql-scalars": "^1.21.3",
54+
"jsonwebtoken": "^9.0.0",
5555
"logger": "*",
56-
"prisma": "^4.5.0"
56+
"prisma": "^4.11.0"
5757
},
5858
"prisma": {
5959
"schema": "src/prisma/schema.prisma",
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const updateFieldHelper = (value: any) => {
1+
export default function updateFieldHelper(value: unknown) {
22
return value !== null ? value : undefined;
3-
};
4-
5-
export default updateFieldHelper;
3+
}

apps/api/src/main.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import { ApolloServer } from '@apollo/server';
2-
import { expressMiddleware } from '@apollo/server/express4';
32
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
3+
import { Context } from './context';
4+
import cors from 'cors';
45
import express from 'express';
6+
import { expressMiddleware } from '@apollo/server/express4';
57
import http from 'http';
6-
import cors from 'cors';
78
import { json } from 'body-parser';
8-
99
import { schema } from './schema';
10-
import { Context } from './context';
1110

1211
const PORT = Number(process.env.PORT) || 8080;
1312

1413
// Add production app url here
15-
const allowedOrigins = ['http://localhost:3000'];
14+
const allowedOrigins = ['http://localhost:3000', 'http://localhost:3001'];
1615

1716
const app = express();
1817
const httpServer = http.createServer(app);

apps/api/src/schema/Article/queries.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,13 @@ builder.queryType({
164164
],
165165
};
166166

167-
const totalCount = await db.article.count({
168-
where: filter,
169-
});
167+
const totalCount = await db.article.count({ where: filter });
170168

171169
if (incomingCursor) {
172170
results = await db.article.findMany({
173171
take: 9,
174172
skip: 1,
175-
cursor: {
176-
id: incomingCursor,
177-
},
173+
cursor: { id: incomingCursor },
178174
where: filter,
179175
include: { author: true },
180176
orderBy: {

apps/web/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@apollo/client": "^3.6.8",
12+
"@apollo/client": "^3.7.10",
1313
"apollo-hooks": "*",
1414
"lodash-es": "^4.17.21",
15-
"next": "12.3.1",
16-
"react": "17.0.2",
17-
"react-dom": "17.0.2",
15+
"next": "13.2.4",
16+
"react": "18.2.0",
17+
"react-dom": "18.2.0",
1818
"ui": "*"
1919
},
2020
"devDependencies": {
21-
"@types/lodash": "^4.14.191",
22-
"@types/node": "^18.14.2",
23-
"@types/react": "17.0.37",
24-
"eslint": "8.33.0",
25-
"next-transpile-modules": "9.0.0",
21+
"@types/lodash": "^4.14.192",
22+
"@types/node": "^18.15.10",
23+
"@types/react": "18.0.30",
24+
"eslint": "8.36.0",
25+
"next-transpile-modules": "10.0.0",
2626
"tsconfig": "*",
27-
"typescript": "^4.8.4"
27+
"typescript": "^5.0.2"
2828
}
2929
}

apps/web/src/pages/Home/querySearchArticles.graphql

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ query SearchArticles($input: ArticlesInput) {
33
results {
44
id
55
title
6+
preview
7+
content
8+
author {
9+
id
10+
name
11+
avatar
12+
email
13+
}
14+
lead
15+
createdAt
16+
updatedAt
617
}
718
}
819
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
},
2222
"devDependencies": {
2323
"eslint-config-custom": "latest",
24-
"prettier": "latest",
25-
"turbo": "latest"
24+
"prettier": "^2.8.7",
25+
"turbo": "^1.8.6"
2626
},
2727
"engines": {
2828
"npm": ">=7.0.0",

packages/apollo-hooks/generated/index.tsx

+12-9
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export type Article = {
2828
isPublished: Scalars['Boolean'];
2929
lead: Scalars['String'];
3030
preview: Scalars['String'];
31-
tags: Array<Scalars['String']>;
3231
title: Scalars['String'];
3332
updatedAt: Scalars['Date'];
3433
};
@@ -54,7 +53,6 @@ export type CreateArticleInput = {
5453
content: Scalars['String'];
5554
lead: Scalars['String'];
5655
preview: Scalars['String'];
57-
tags: Array<Scalars['String']>;
5856
title: Scalars['String'];
5957
};
6058

@@ -64,7 +62,6 @@ export type Mutation = {
6462
deleteArticle: Article;
6563
signUp: User;
6664
updateArticle: Article;
67-
uploadImage: Scalars['String'];
6865
};
6966

7067

@@ -91,11 +88,6 @@ export type MutationUpdateArticleArgs = {
9188
input: CreateArticleInput;
9289
};
9390

94-
95-
export type MutationUploadImageArgs = {
96-
path: Scalars['String'];
97-
};
98-
9991
export type Query = {
10092
__typename?: 'Query';
10193
getArticle: Article;
@@ -152,7 +144,7 @@ export type SearchArticlesQueryVariables = Exact<{
152144
}>;
153145

154146

155-
export type SearchArticlesQuery = { __typename?: 'Query', articles: { __typename?: 'ArticlesResponse', results: Array<{ __typename?: 'Article', id: string, title: string }> } };
147+
export type SearchArticlesQuery = { __typename?: 'Query', articles: { __typename?: 'ArticlesResponse', results: Array<{ __typename?: 'Article', id: string, title: string, preview: string, content: string, lead: string, createdAt: any, updatedAt: any, author: { __typename?: 'User', id: string, name: string, avatar?: string | null, email: string } }> } };
156148

157149

158150
export const SearchArticlesDocument = gql`
@@ -161,6 +153,17 @@ export const SearchArticlesDocument = gql`
161153
results {
162154
id
163155
title
156+
preview
157+
content
158+
author {
159+
id
160+
name
161+
avatar
162+
email
163+
}
164+
lead
165+
createdAt
166+
updatedAt
164167
}
165168
}
166169
}

packages/apollo-hooks/package.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
"generate": "graphql-codegen --config ./codegen.yml && yarn build"
2020
},
2121
"devDependencies": {
22-
"@graphql-codegen/cli": "^3.2.1",
23-
"@graphql-codegen/typescript-operations": "^2.2.2",
24-
"@graphql-codegen/typescript-react-apollo": "^3.2.4",
25-
"@types/jest": "^29.4.0",
26-
"@types/react": "^17.0.39",
27-
"@types/react-dom": "^17.0.8",
28-
"eslint": "^8.33.0",
29-
"jest": "^29.4.1",
30-
"react": "^17.0.2",
22+
"@graphql-codegen/cli": "^3.2.2",
23+
"@graphql-codegen/typescript-operations": "^3.0.2",
24+
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
25+
"@types/jest": "^29.5.0",
26+
"@types/react": "^18.0.30",
27+
"@types/react-dom": "^18.0.11",
28+
"eslint": "^8.36.0",
29+
"jest": "^29.5.0",
30+
"react": "^18.2.0",
3131
"scripts": "*",
3232
"tsconfig": "*",
33-
"tsup": "^6.1.2",
34-
"typescript": "^4.8.4"
33+
"tsup": "^6.7.0",
34+
"typescript": "^5.0.2"
3535
},
3636
"jest": {
3737
"preset": "scripts/jest/node"

packages/config/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"prettier-preset.js"
99
],
1010
"dependencies": {
11-
"@typescript-eslint/eslint-plugin": "^5.52.0",
12-
"eslint-config-next": "^13.1.6",
13-
"eslint-config-prettier": "^8.3.0",
14-
"prettier": "2.8.1"
11+
"@typescript-eslint/eslint-plugin": "^5.57.0",
12+
"eslint-config-next": "^13.2.4",
13+
"eslint-config-prettier": "^8.8.0",
14+
"prettier": "2.8.7"
1515
}
1616
}

packages/ui/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
1919
},
2020
"devDependencies": {
21-
"@types/react": "^17.0.37",
22-
"@types/react-dom": "^17.0.11",
23-
"eslint": "^8.33.0",
21+
"@types/react": "^18.0.30",
22+
"@types/react-dom": "^18.0.11",
23+
"eslint": "^8.36.0",
2424
"eslint-config-custom": "*",
25-
"react": "^17.0.2",
25+
"react": "^18.2.0",
2626
"tsconfig": "*",
2727
"tsup": "^6.7.0",
28-
"typescript": "^4.8.4"
28+
"typescript": "^5.0.2"
2929
}
3030
}

0 commit comments

Comments
 (0)