Skip to content

Commit

Permalink
feat: initial template
Browse files Browse the repository at this point in the history
  • Loading branch information
vucinatim authored and janezicmatej committed Aug 9, 2024
0 parents commit f4bf2bf
Show file tree
Hide file tree
Showing 82 changed files with 13,590 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NEXT_PUBLIC_SENTRY_TRACE_SAMPLE_RATE=1.0 │ shared │
SENTRY_AUTH_TOKEN=...
NEXT_PUBLIC_SENTRY_DSN=...
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.next
.husky
build
node_modules
63 changes: 63 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"plugins": [
"react",
"react-hooks",
"@typescript-eslint",
"sonarjs",
"check-file"
],
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:sonarjs/recommended-legacy"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"no-console": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "error",
"react/react-in-jsx-scope": "off",
"check-file/filename-naming-convention": [
"error",
{
"./src/**/*.{jsx,tsx}": "KEBAB_CASE",
"./src/**/*.{js,ts}": "KEBAB_CASE"
},
{ "ignoreMiddleExtensions": true }
],
"@typescript-eslint/no-restricted-imports": [
"error",
{
"paths": [
{
"name": "process",
"message": "For environment variables, use `import env from '@/env';`"
}
]
}
],
"react/jsx-no-literals": [
"warn",
{
"noStrings": true,
"ignoreProps": true
}
]
},
"overrides": [
{
"files": ["src/components/ui/**/*.tsx"],
"rules": {
"react/prop-types": "off"
}
}
]
}
18 changes: 18 additions & 0 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: i18n
on:
# Only run on PRs into master
pull_request:
branches:
- master

jobs:
i18n:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Check Localization
run: |
pnpm i18n
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint
on:
push:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Lint
run: |
pnpm lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Typecheck
run: |
pnpm tsc
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: Run prettier
run: |
pnpm format
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Test'
on:
pull_request:
workflow_dispatch:
jobs:
test:
permissions:
checks: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: |
pnpm test
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local

# vercel
.vercel

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

# Sentry Config File
.sentryclirc
.env
5 changes: 5 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
npx --no -- commitlint --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.18.0
49 changes: 49 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Ignore artifacts:
build
coverage

# dependencies
/node_modules
/.pnp
.pnp.js
pnpm-lock.yaml

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local

# vercel
.vercel

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

# husky
/.husky/

# Ignore autogenerated files
.infisical.json
components.json

# Handlebars templates
zodios-client-template.hbs
19 changes: 19 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @ts-check
module.exports = {
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
quoteProps: 'as-needed',
jsxSingleQuote: false,
trailingComma: 'all',
bracketSpacing: true,
bracketSameLine: true,
arrowParens: 'always',
endOfLine: 'lf',
tailwindConfig: './tailwind.config.ts',
tailwindAttributes: ['className'],
tailwindFunctions: ['cn', 'tw', 'clsx', 'cva'],
plugins: ['prettier-plugin-organize-imports', 'prettier-plugin-tailwindcss'],
};
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": ["source.organizeImports", "source.fixAll"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.autoImportFileExcludePatterns": [
"@radix-ui",
"tailwindcss"
],
"eslint.rules.customizations": [
{
"rule": "prettier/prettier",
"severity": "warn"
}
],
"javascript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.importModuleSpecifier": "non-relative",
"tailwindCSS.experimental.classRegex": [
// Matches all objects with the name 'variants'
["variants \\=([^;]*);", "'([^']*)'"],
["variants \\=([^;]*);", "\"([^\"]*)\""],
["variants \\=([^;]*);", "\\`([^\\`]*)\\`"],
// Matches all objects that are a parameter of 'cva' function
["[^=]+ = cva\\(([^)]*)\\)", "'([^']*)'"],
["[^=]+ = cva\\(([^)]*)\\)", "\"([^\"]*)\""],
["[^=]+ = cva\\(([^)]*)\\)", "\\`([^\\`]*)\\`"]
]
}
Loading

0 comments on commit f4bf2bf

Please sign in to comment.