Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
馃帀 first pass at setting up the project
Browse files Browse the repository at this point in the history
first pass at setting up the project

馃帀 Initial commit
  • Loading branch information
TimMikeladze committed Dec 29, 2022
0 parents commit 995338c
Show file tree
Hide file tree
Showing 67 changed files with 19,395 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Run this command to generate a key: openssl rand -base64 32
NEXTAUTH_SECRET=""
# Add next-auth provider secrets here
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
41 changes: 41 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# JetBrains IDE files
.idea/

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarn-debug.log*

# local env files
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

src/generated
64 changes: 64 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"plugins": ["prettier", "unused-imports", "sort-keys-fix"],
"extends": ["next", "next/core-web-vitals", "prettier", "plugin:typescript-sort-keys/recommended", "plugin:@dword-design/import-alias/recommended"],
"rules": {
"prettier/prettier": "error",
"camelcase": "off",
"import/prefer-default-export": "off",
"react/jsx-filename-extension": "off",
"react/jsx-props-no-spreading": "off",
"react/no-unused-prop-types": "off",
"react/require-default-props": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never",
"js": "never",
"jsx": "never"
}
],
"quotes": "off",
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["hrefLeft", "hrefRight"],
"aspects": ["invalidHref", "preferButton"]
}
],
"@dword-design/import-alias/prefer-alias": [
"error",
{
"alias": {
"@": "./src/"
}
}
]
},
"overrides": [
{
"files": "**/*.+(ts|tsx)",
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint/eslint-plugin"],
"extends": ["plugin:@typescript-eslint/recommended", "prettier"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-use-before-define": [0],
"@typescript-eslint/no-use-before-define": [1],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/quotes": [
2,
"backtick",
{
"avoidEscape": true
}
],
"unused-imports/no-unused-imports": "error"
}
}
]
}
1 change: 1 addition & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Main CI workflow

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
run-ci:
name: Run Type Check & Linters
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies (with cache)
uses: bahmutov/npm-install@v1

- name: Check types
run: yarn type-check

- name: Check linting
run: yarn lint

- name: Test
run: yarn test:ci
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# JetBrains IDE files
.idea/

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarn-debug.log*

# local env files
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

8 changes: 8 additions & 0 deletions .husky/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
command_exists () {
command -v "$1" >/dev/null 2>&1
}

# Workaround for Windows 10, Git Bash and Yarn
if command_exists winpty && test -t 1; then
exec < /dev/tty
fi
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact = true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}
33 changes: 33 additions & 0 deletions .storybook/i18next.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {initReactI18next} from 'react-i18next';
import i18n from 'i18next';
import LanguageDetector from 'i18next-browser-languagedetector';

const ns = ['common'];
const supportedLngs = ['en'];

i18n.use(LanguageDetector)
.use(initReactI18next)
.init({
//debug: true,
lng: 'en',
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
debug: true,
defaultNS: 'common',
ns,
supportedLngs,
});

supportedLngs.forEach((lang) => {
ns.forEach((n) => {
i18n.addResourceBundle(
lang,
n,
require(`../public/locales/${lang}/${n}.json`)
);
});
});

export default i18n;
48 changes: 48 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const path = require('path');
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-dark-mode',
{
name: 'storybook-addon-turbo-build',
options: {
optimizationLevel: 2,
},
},
],
framework: '@storybook/react',
core: {
builder: '@storybook/builder-webpack5',
},
webpackFinal: async (config, { configType }) => {
config.resolve.alias = {
...config.resolve.alias,
'next-i18next': 'react-i18next',
'@': path.resolve(__dirname, '../src'),
};

config.module.rules.push({
test: /\.graphql$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader',
});

return config;
},
babel: async (options) => ({
...options,
presets: [
['@babel/preset-env', { shippedProposals: true }],
'@babel/preset-typescript',
['@babel/preset-react', { runtime: 'automatic' }],
],
plugins: ['@babel/plugin-transform-typescript', ...options.plugins],
}),
typescript: {
check: false,
reactDocgen: false,
},
};
7 changes: 7 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- .storybook/preview-head.html -->

<link rel="preconnect" href="https://fonts.bunny.net" />
<link
href="https://fonts.bunny.net/css?family=inter:100,200,300,400,500,600,700,800,900"
rel="stylesheet"
/>
46 changes: 46 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import '../src/styles/globals.css';

import React from 'react';
import AppBase from '../src/components/AppBase';
import { themes } from '@storybook/theming';
import i18n from './i18next.js';

import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { initializeApollo } from '../src/graphql/apollo';
import { ApolloProvider } from '@apollo/client';

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
viewport: {
viewports: INITIAL_VIEWPORTS,
defaultViewport: 'iphone12',
},
darkMode: {
// Override the default dark theme
dark: { ...themes.dark, appBg: 'black' },
// Override the default light theme
light: { ...themes.light, appBg: 'light' },
},
i18n,
locale: 'en',
locales: {
en: 'English',
},
};

export const decorators = [
(Story) =>
React.createElement(
ApolloProvider,
{
client: initializeApollo({ initialState: {} }),
},
React.createElement(AppBase, {}, React.createElement(Story)),
),
];
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2023 Tim Mikeladze

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Empty file added README.md
Empty file.
16 changes: 16 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
overwrite: true,
schema: `src/graphql/schema.graphql`,
generates: {
'src/generated/graphql.ts': {
plugins: [`typescript`, `typescript-resolvers`],
},
},
hooks: {
afterAllFileWrite: [`yarn codegen:zeus`],
},
};

export default config;
Loading

0 comments on commit 995338c

Please sign in to comment.