Skip to content

Commit

Permalink
feat: migrate to nextjs 14 with sass
Browse files Browse the repository at this point in the history
  • Loading branch information
everton-dgn committed Jan 25, 2024
1 parent 1d5be34 commit c879651
Show file tree
Hide file tree
Showing 217 changed files with 12,590 additions and 6,937 deletions.
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

2 changes: 2 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEXT_PUBLIC_ALLOW_ORIGIN=https://pizzaria-toffanetto.querocriarsite.com
NEXT_PUBLIC_API_BASE_URL=
3 changes: 3 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NEXT_PUBLIC_ALLOW_ORIGIN=https://pizzaria-toffanetto.querocriarsite.com
BASE_URL_TEST=http://localhost:3000
NEXT_PUBLIC_API_BASE_URL=
19 changes: 15 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
node_modules
public/*
.next
**/*.js
dist
build
yarn.lock
.gitignore
.prettierignore
.gitattributes
coverage
.tsBuildInfoFile
.stylelintcache
vitest.config.mts
vitest.setup.ts
next.config.js
stylelint.config.js
next-env.d.ts
playwright.config.ts
playwright-report
156 changes: 156 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"env": {
"browser": true,
"es2022": true,
"node": true
},
"settings": {
"playwright": {
"additionalAssertFunctionNames": ["assertCustomCondition"]
},
"react": {
"version": "detect"
},
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"project": "tsconfig.json"
}
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"react-hooks",
"@typescript-eslint",
"sonarjs",
"promise",
"prettier",
"testing-library",
"jest-dom",
"jest",
"jsx-a11y",
"import",
"eslint-plugin-import-helpers"
],
"extends": [
"standard-with-typescript",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:promise/recommended",
"plugin:jsx-a11y/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:import/warnings",
"plugin:@next/next/recommended",
"plugin:sonarjs/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:jest-dom/recommended",
"plugin:testing-library/react",
"plugin:jest/style",
"plugin:playwright/recommended",
"next/core-web-vitals"
],
"rules": {
"import-helpers/order-imports": [
"warn",
{
"newlinesBetween": "always",
"groups": [
["/^react$/", "/next/"],
"module",
"/^(providers|components)/",
"/constants/",
["/hooks/", "/helperFunctions/", "/testHelpers/"],
["/infra/", "/data/", "/validation/"],
"/^assets/",
["/^theme$/", "/styles/", "/@types/"],
["parent", "sibling", "index"]
],
"alphabetize": { "order": "asc", "ignoreCase": true }
}
],
"@typescript-eslint/no-misused-promises": "off",
"jsx-a11y/label-has-associated-control": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/click-events-have-key-events": "off",
"@typescript-eslint/no-confusing-void-expression": "off",
"@typescript-eslint/unbound-method": "off",
"import/no-unresolved": [2, { "commonjs": true, "amd": true }],
"import/named": 2,
"import/namespace": 2,
"import/default": 2,
"import/export": 2,
"import/no-duplicates": "error",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-floating-promises": [
"error",
{
"ignoreVoid": false
}
],
"@next/next/no-img-element": "off",
"object-shorthand": "warn",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/ban-ts-comment": "off",
"no-console": "error",
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }],
"react/function-component-definition": [
"error",
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "error",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"jsx-a11y/anchor-is-valid": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"@typescript-eslint-in-jsx-scope": "off",
"@typescript-eslint/no-non-null-assertion": "warn",
"space-before-function-paren": "off",
"eslint-disable-next-line": "off",
"react/display-name": "off",
"prettier/prettier": "error"
},
"overrides": [
{
"files": ["src/**/*.test.{ts,tsx}"],
"plugins": ["jest-dom", "testing-library", "jest"],
"extends": [
"plugin:jest-dom/recommended",
"plugin:testing-library/react",
"plugin:jest/style"
],
"excludedFiles": ["**/*.spec.ts"]
},
{
"files": ["src/**/*.spec.{ts,tsx}"],
"rules": {
"jest-dom/prefer-in-document": "off",
"testing-library/prefer-screen-queries": "off"
}
}
]
}
41 changes: 0 additions & 41 deletions .eslintrc.json

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/deploy-vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy to Vercel

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: Deploy to Vercel
uses: amondnet/vercel-action@v20
with:
vercel-args: '--prod'
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID}}
vercel-project-id: ${{ secrets.PROJECT_ID}}
33 changes: 33 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Install dependencies
run: npm install -g yarn && yarn

- name: Install Playwright Browsers
run: yarn playwright install --with-deps

- name: Run Playwright tests
run: yarn playwright test

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
32 changes: 24 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
/playwright-report

# next.js
/.next/
/out/

# envs
.env.production
.env.development

# production
/build

Expand All @@ -23,18 +26,31 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
pnpm-debug.log*

# vercel
.vercel

# jetbrains and vscode
.idea/
.vscode/

# storybook
/storybook-static
/src/stories

# typescript incremental features
tsconfig.tsbuildinfo

# linters
.eslintcache
.stylelintcache
.husky

# https
certificates

# pwa
**/public/workbox-*.js
**/public/sw.js
**/public/fallback-*.js
8 changes: 8 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"src/**/*.{ts,tsx}": [
"yarn format",
"yarn lint:fix",
"yarn test:ci related"
],
"src/**/*.scss": ["yarn lint:css:fix"]
}
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public/*
.storybook
.next
yarn.lock
.gitignore
.eslintcache
.gitattributes
coverage
storybook-static
.tsBuildInfoFile
.stylelintcache
Loading

0 comments on commit c879651

Please sign in to comment.