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

Commit

Permalink
feat: migrating to t3-stack
Browse files Browse the repository at this point in the history
  • Loading branch information
CUexter committed Mar 6, 2023
1 parent bd19533 commit e82dc9d
Show file tree
Hide file tree
Showing 46 changed files with 6,343 additions and 11,981 deletions.
25 changes: 25 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Since the ".env" file is gitignored, you can use the ".env.example" file to
# build a new ".env" file when you clone the repo. Keep this file up-to-date
# when you add new variables to `.env`.

# This file will be committed to version control, so make sure not to have any
# secrets in it. If you are cloning this repo, create a copy of this file named
# ".env" and populate it with your secrets.

# When adding additional environment variables, the schema in "/env/schema.mjs"
# should be updated accordingly.

# Prisma
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
DATABASE_URL="file:./db.sqlite"

# Next Auth
# You can generate a new secret on the command line with:
# openssl rand -base64 32
# https://next-auth.js.org/configuration/options#secret
# NEXTAUTH_SECRET=""
NEXTAUTH_URL="http://localhost:3000"

# Next Auth Discord Provider
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
29 changes: 24 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
{
"extends": [
"next/core-web-vitals",
"prettier",
"plugin:storybook/recommended"
"overrides": [
{
"extends": [
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": "tsconfig.json"
}
}
],
"ignorePatterns": ["pb/*"]
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
"ignorePatterns": [
"./commitlint.config.js",
"./lint-staged.config.js",
"./jest.config.js"
],
"rules": {
"@typescript-eslint/consistent-type-imports": "warn"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: tj-actions/changed-files@v35
with:
files: |
./**/*.{js, jsx, json, css, scss, tsx, ts}
./src/*.{js, jsx, json, css, scss, tsx, ts}
pnpm-lock.yaml
- name: print output
Expand Down
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ husky-logs/*
# next.js
/.next/
/out/
next-env.d.ts

# production
/build
Expand All @@ -31,6 +32,9 @@ yarn-error.log*

# local env files
.env*.local
.env

*.tsbuildinfo

# vercel
.vercel
Expand All @@ -44,6 +48,8 @@ build.tar.gz
.eslintcache
.stylelintcache

/pb/*
!/pb/pb_migrations
# database
/prisma/db.sqlite
/prisma/db.sqlite-journal

/playwright-report
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

Empty file removed .prettierrc
Empty file.
7 changes: 3 additions & 4 deletions __tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { render, screen } from "@testing-library/react";
import Index from "@/pages/index";
import "@testing-library/jest-dom";

describe("Home", () => {
it("renders a heading", () => {
test("renders a heading", () => {
render(<Index />);

const heading = screen.getByRole("heading", {
name: /testing/i,
const heading = screen.getByRole("p", {
name: /Sign In/i,
});

expect(heading).toBeInTheDocument();
Expand Down
1 change: 1 addition & 0 deletions __tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@testing-library/jest-dom";
29 changes: 0 additions & 29 deletions components/appshell.tsx

This file was deleted.

221 changes: 0 additions & 221 deletions components/navbars.tsx

This file was deleted.

8 changes: 2 additions & 6 deletions e2e/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { test, expect } from "@playwright/test";
test("should navigate to the about page", async ({ page }) => {
// Start from the index page (the baseURL is set via the webServer in the playwright.config.ts)
await page.goto("/");
// Find an element with the text 'About Page' and click on it
await page.click("text=Testing");
// The new URL should be "/about" (baseURL is used there)
await expect(page).toHaveURL("http://localhost:3000/about");
// The new page should contain an h1 with "About Page"
await expect(page.locator("h1")).toContainText("About Page");
await page.click("text=Sign In");
await expect(page).toHaveURL(/\/api\/auth\/signin?/);
});
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const customJestConfig = {
modulePathIgnorePatterns: ["e2e"],
testEnvironment: "jest-environment-jsdom",
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
"^@/(.*)$": "<rootDir>/src/$1",
},
};

Expand Down
Loading

0 comments on commit e82dc9d

Please sign in to comment.