Skip to content
Merged
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
1 change: 1 addition & 0 deletions next-react-query-tailwind/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx
GITHUB_GRAPHQL_ENDPOINT=https://api.github.com/graphql
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=NtgM2tvhvcE8NLnIigfGY4LmeFABj2/2fnrzyzS0syQ=
JWT_SECRET=7ZkCMuD69N2WBBDCDzxTTYvsNG8qPJHWeNYe37iZTkmQLUmujZUZ3RnkqP6yfxTU
JWT_SIGNING_KEY={"kty":"oct","kid":"6f3fzrvXzvbJ66XfW3QbeU6WfNWm3Z5KwKt5fDSOsdI","alg":"HS512","k":"mq_ZTza3MtzKDyy7r47-bOeZcvzfsy3VfIsdfT-n5W-KA4mxUy-6Yy9GjISuo3aNfPpzXRDIsM0mS-tFdCuULg"}
JWT_ENCRYPTION_KEY={"kty":"oct","kid":"noSwokthOcoRCtufQ3Eyp_x_cIshHpKBRanEVreZwnc","alg":"A256GCM","k":"GdCtl3XPLxKfdUQOFyWEPbe27tOPOJ9Z7-RPAdz_Vrc"}
2 changes: 2 additions & 0 deletions next-react-query-tailwind/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ yarn-error.log*
.vercel

src/lib/github.ts

public/mockServiceWorker.js
27 changes: 0 additions & 27 deletions next-react-query-tailwind/.storybook/main.js

This file was deleted.

71 changes: 71 additions & 0 deletions next-react-query-tailwind/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import type { StorybookConfig } from '@storybook/nextjs';
import path from 'path';

const config: StorybookConfig = {
stories: ['../src/pages/**/*.mdx', '../src/components/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: ['../public'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
{
name: '@storybook/addon-styling',
options: {
// Check out https://github.com/storybookjs/addon-styling/blob/main/docs/api.md
// For more details on this addon's options.
postCss: true,
},
},
'storybook-css-modules-preset',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
docs: {
autodocs: 'tag',
},
webpackFinal: async (config) => {
if (!config.resolve) {
config.resolve = {};
}
// Add alias for the public folder
config.resolve.alias = {
...config.resolve.alias,
'/assets': path.resolve(__dirname, '../public/assets'),
'@lib': path.resolve(__dirname, '../src/lib'),
'@components': path.resolve(__dirname, '../src/components'),
'@context': path.resolve(__dirname, '../src/context'),
};
config.resolve.fallback = {
fs: false,
assert: false,
buffer: false,
console: false,
constants: false,
crypto: false,
domain: false,
events: false,
http: false,
https: false,
os: false,
path: false,
punycode: false,
process: false,
querystring: false,
stream: false,
string_decoder: false,
sys: false,
timers: false,
tty: false,
url: false,
util: false,
vm: false,
zlib: false,
};

return config;
},
};

export default config;
30 changes: 0 additions & 30 deletions next-react-query-tailwind/.storybook/preview.js

This file was deleted.

20 changes: 20 additions & 0 deletions next-react-query-tailwind/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Preview } from '@storybook/react';
import { initialize, mswLoader } from 'msw-storybook-addon';
import '../src/styles/globals.css';

initialize();

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},
loaders: [mswLoader],
};

export default preview;
26 changes: 26 additions & 0 deletions next-react-query-tailwind/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
overwrite: true,
schema: 'github-schema-loader.js',
documents: ['./src/**/*.query.ts', './src/**/*.mutation.ts'],
generates: {
'src/lib/github.ts': {
plugins: [
'typescript',
'typescript-operations',
'typescript-react-query',
{
add: {
content: '// @ts-nocheck',
},
},
],
config: {
fetcher: 'graphql-request',
},
},
},
};

export default config;
13 changes: 0 additions & 13 deletions next-react-query-tailwind/codegen.yml

This file was deleted.

1 change: 1 addition & 0 deletions next-react-query-tailwind/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Used for __tests__/testing-library.js
// Learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';
import 'whatwg-fetch';
11 changes: 11 additions & 0 deletions next-react-query-tailwind/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { withAuth } from 'next-auth/middleware';

export default withAuth({
pages: {
signIn: '/signin',
},
});

export const config = {
matcher: [],
};
119 changes: 65 additions & 54 deletions next-react-query-tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,75 @@
"lint": "next lint",
"test": "jest",
"format": "prettier --write ./src",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook",
"codegen": "graphql-codegen --config codegen.yml"
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"codegen": "graphql-codegen --config codegen.ts"
},
"dependencies": {
"@headlessui/react": "^1.4.1",
"@heroicons/react": "^1.0.5",
"classnames": "^2.3.1",
"date-fns": "^2.25.0",
"graphql": "^15.7.0",
"graphql-request": "^3.6.1",
"next": "^12.0.7",
"next-auth": "^3.29.0",
"prism-react-renderer": "^1.2.1",
"react": "17.0.2",
"react-content-loader": "^6.0.3",
"react-dom": "17.0.2",
"react-markdown": "^7.1.1",
"react-query": "^3.29.0",
"rehype-raw": "^6.1.1",
"remark-gfm": "^3.0.1",
"use-error-boundary": "^2.0.6"
"@headlessui/react": "1.7.15",
"@heroicons/react": "2.0.18",
"@tanstack/react-query": "4.32.0",
"@tanstack/react-query-devtools": "4.32.0",
"classnames": "2.3.2",
"date-fns": "2.30.0",
"graphql": "16.7.1",
"graphql-request": "6.1.0",
"next": "13.4.11",
"next-auth": "4.22.3",
"prism-react-renderer": "2.0.6",
"react": "18.2.0",
"react-content-loader": "6.2.1",
"react-dom": "18.2.0",
"react-markdown": "8.0.7",
"rehype-raw": "6.1.1",
"remark-gfm": "3.0.1",
"use-error-boundary": "2.0.6"
},
"devDependencies": {
"@babel/core": "^7.15.8",
"@graphql-codegen/cli": "2.2.1",
"@graphql-codegen/typescript": "2.2.4",
"@graphql-codegen/typescript-document-nodes": "2.1.6",
"@graphql-codegen/typescript-operations": "2.1.8",
"@graphql-codegen/typescript-react-query": "^3.0.3",
"@octokit/graphql-schema": "^10.73.0",
"@storybook/addon-actions": "^6.3.12",
"@storybook/addon-essentials": "^6.3.12",
"@storybook/addon-links": "^6.3.12",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/react": "^6.3.12",
"@tailwindcss/typography": "^0.5.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.2",
"@types/react": "17.0.32",
"autoprefixer": "^10.4.0",
"babel-loader": "^8.2.3",
"eslint": "7.32.0",
"eslint-config-next": "^11.1.2",
"eslint-plugin-testing-library": "^5.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.3.1",
"jest-mock": "^27.4.2",
"msw": "^0.35.0",
"msw-storybook-addon": "^1.4.1",
"postcss": "^8.4.5",
"prettier": "^2.4.1",
"storybook-addon-next-router": "^3.0.8",
"storybook-css-modules-preset": "^1.1.1",
"tailwindcss": "^3.0.2",
"typescript": "^4.5.3"
"@graphql-codegen/add": "5.0.0",
"@graphql-codegen/cli": "4.0.1",
"@graphql-codegen/typescript": "4.0.1",
"@graphql-codegen/typescript-document-nodes": "4.0.1",
"@graphql-codegen/typescript-operations": "4.0.1",
"@graphql-codegen/typescript-react-query": "4.1.0",
"@octokit/graphql-schema": "14.23.0",
"@storybook/addon-actions": "7.1.0",
"@storybook/addon-essentials": "7.1.0",
"@storybook/addon-interactions": "7.1.0",
"@storybook/addon-links": "7.1.0",
"@storybook/addon-postcss": "2.0.0",
"@storybook/addon-styling": "1.3.4",
"@storybook/blocks": "7.1.0",
"@storybook/nextjs": "7.1.0",
"@storybook/react": "7.1.0",
"@storybook/testing-library": "0.2.0",
"@tailwindcss/typography": "0.5.9",
"@tanstack/eslint-plugin-query": "4.29.25",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@types/jest": "29.5.3",
"@types/node": "20.4.2",
"@types/react": "18.2.15",
"autoprefixer": "10.4.14",
"eslint": "8.45.0",
"eslint-config-next": "13.4.11",
"eslint-plugin-storybook": "0.6.13",
"eslint-plugin-testing-library": "5.11.0",
"identity-obj-proxy": "3.0.0",
"isomorphic-unfetch": "4.0.2",
"jest": "29.6.1",
"jest-environment-jsdom": "29.6.1",
"jest-mock": "29.6.1",
"msw": "1.2.3",
"msw-storybook-addon": "1.8.0",
"postcss": "8.4.27",
"prettier": "3.0.0",
"storybook": "7.1.0",
"storybook-css-modules-preset": "1.1.1",
"tailwindcss": "3.3.3",
"typescript": "5.1.6",
"whatwg-fetch": "3.6.17"
},
"msw": {
"workerDirectory": "public"
Expand Down
Loading