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
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ insert_final_newline = false
indent_style = tab
charset = utf-8
trim_trailing_whitespace = true
tab_width = 4
tab_width = 4

[*.{yaml,yml}]
indent_style = space
indent_size = 2
4 changes: 1 addition & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@
# Drizzle
DATABASE_URL="mysql://root:password@localhost:3306/ynot-dev"

# Example:
# SERVERVAR="foo"
# NEXT_PUBLIC_CLIENTVAR="bar"
NEXT_PUBLIC_BASE_URL="https://y-not.dev"
129 changes: 72 additions & 57 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,61 +1,76 @@
/** @type {import("eslint").Linter.Config} */
const config = {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true
},
"plugins": [
"@typescript-eslint",
"drizzle"
],
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
],
"rules": {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": {
"attributes": false
}
}
],
"drizzle/enforce-delete-with-where": [
"error",
{
"drizzleObjectName": [
"db",
"ctx.db"
]
}
],
"drizzle/enforce-update-with-where": [
"error",
{
"drizzleObjectName": [
"db",
"ctx.db"
]
}
]
}
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true
},
"plugins": [
"@typescript-eslint",
"drizzle"
],
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked"
],
"rules": {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"no-restricted-imports": ["error", {
"paths": [
{
"name": "next/navigation",
"importNames": ["redirect", "usePathname", "useRouter", "getPathname"],
"message": "Please use the peer component from `@/i18n/navigation` instead.",
},
{
"name": "next/link",
"importNames": ["Link", 'default'],
"message": "Please use the peer component from `@/i18n/navigation` instead.",
}
]
}],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": {
"attributes": false
}
}
],
"drizzle/enforce-delete-with-where": [
"error",
{
"drizzleObjectName": [
"db",
"ctx.db"
]
}
],
"drizzle/enforce-update-with-where": [
"error",
{
"drizzleObjectName": [
"db",
"ctx.db"
]
}
]
}
}
module.exports = config;
41 changes: 36 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,54 @@
name: CI

on: [push, pull_request]
on:
push:
pull_request:
types: [opened, reopened]

jobs:
build:
typecheck-and-lint:
name: Typecheck and Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install Dependencies
run: npm install -g pnpm && pnpm install
run: pnpm install

- name: Copy .env.example files
shell: bash
run: find . -type f -name ".env.example" -exec sh -c 'cp "$1" "${1%.*}"' _ {} \;

- name: Typecheck
run: pnpm typecheck
run: pnpm run typecheck

- name: Lint
run: pnpm lint
run: pnpm run lint
build:
name: Build
runs-on: ubuntu-latest
needs: typecheck-and-lint
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install Dependencies
run: pnpm install

- name: Copy .env.example files
shell: bash
run: find . -type f -name ".env.example" -exec sh -c 'cp "$1" "${1%.*}"' _ {} \;

- name: Build
run: pnpm run build
22 changes: 22 additions & 0 deletions .github/workflows/localeChecks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Locale Checks

on:
push:
pull_request:
types: [opened, reopened]

jobs:
locale-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Dependencies
run: npm install

- name: JSONify Locales
run: npm run locales:JSONify

- name: Check Locales
run: npm run locales:check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
/JSONLocales

# database
/prisma/db.sqlite
Expand Down
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"typescript.preferences.autoImportSpecifierExcludeRegexes": [
"@radix-ui",
"radix-ui",
"next/router",
"next/dist",
"react-day-picker",
"^lucide-react/dist/lucide-react.suffixed$",
"react-email"
],
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.removeUnusedImports": "explicit"
},
"typescript.tsdk": "node_modules\\typescript\\lib"
}
9 changes: 9 additions & 0 deletions global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { locales } from '@/i18n/config';
import fr from '@/i18n/locales/fr';

declare module 'next-intl' {
interface AppConfig {
Locale: (typeof locales)[number];
Messages: typeof fr;
}
}
3 changes: 3 additions & 0 deletions lucide-react.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module 'lucide-react' {
export * from 'lucide-react/dist/lucide-react.suffixed'
}
Loading