chore: restructure packages of the project (#7)

* chore: restructure validation package

* chore: move zod only to validation package

* chore: rename packages from alparr to homarr

* chore: move mantine core, dates and icons library to ui package, move most other mantine packages to seperate packages for further customization and centralization

* chore: fix formatting

* fix: wrong typecheck command in turbo generator

* chore: fix formatting

* chore: address pull request feedback

* chore: fix ci check issues
This commit is contained in:
Meier Lukas
2024-01-02 14:18:37 +01:00
committed by GitHub
parent a082f70470
commit fa19966fcc
67 changed files with 562 additions and 304 deletions

View File

@@ -3,7 +3,7 @@ import { DrizzleAdapter } from "@auth/drizzle-adapter";
import NextAuth from "next-auth";
import Credentials from "next-auth/providers/credentials";
import { db } from "@alparr/db";
import { db } from "@homarr/db";
import { credentialsConfiguration } from "./providers/credentials";
import { EmptyNextAuthProvider } from "./providers/empty";

View File

@@ -1,5 +1,5 @@
{
"name": "@alparr/auth",
"name": "@homarr/auth",
"version": "0.1.0",
"private": true,
"main": "./index.ts",
@@ -12,7 +12,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@alparr/db": "workspace:^0.1.0",
"@homarr/db": "workspace:^0.1.0",
"@auth/core": "^0.18.4",
"@auth/drizzle-adapter": "^0.3.9",
"@t3-oss/env-nextjs": "^0.7.1",
@@ -21,14 +21,13 @@
"next": "^14.0.3",
"next-auth": "5.0.0-beta.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"zod": "^3.22.2"
"react-dom": "18.2.0"
},
"devDependencies": {
"@alparr/eslint-config": "workspace:^0.2.0",
"@alparr/prettier-config": "workspace:^0.1.0",
"@alparr/tsconfig": "workspace:^0.1.0",
"@alparr/validation": "workspace:^0.1.0",
"@homarr/eslint-config": "workspace:^0.2.0",
"@homarr/prettier-config": "workspace:^0.1.0",
"@homarr/tsconfig": "workspace:^0.1.0",
"@homarr/validation": "workspace:^0.1.0",
"@types/bcrypt": "5.0.2",
"@types/cookies": "0.7.10",
"eslint": "^8.53.0",
@@ -38,8 +37,8 @@
"eslintConfig": {
"root": true,
"extends": [
"@alparr/eslint-config/base"
"@homarr/eslint-config/base"
]
},
"prettier": "@alparr/prettier-config"
"prettier": "@homarr/prettier-config"
}

View File

@@ -1,9 +1,9 @@
import type Credentials from "@auth/core/providers/credentials";
import bcrypt from "bcrypt";
import { db, eq } from "@alparr/db";
import { users } from "@alparr/db/schema/sqlite";
import { signInSchema } from "@alparr/validation";
import { db, eq } from "@homarr/db";
import { users } from "@homarr/db/schema/sqlite";
import { validation } from "@homarr/validation";
type CredentialsConfiguration = Parameters<typeof Credentials>[0];
@@ -21,7 +21,7 @@ export const credentialsConfiguration = {
},
},
async authorize(credentials) {
const data = await signInSchema.parseAsync(credentials);
const data = await validation.user.signIn.parseAsync(credentials);
const user = await db.query.users.findFirst({
where: eq(users.name, data.name),

View File

@@ -1,5 +1,5 @@
{
"extends": "@alparr/tsconfig/base.json",
"extends": "@homarr/tsconfig/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},