Skip to content

Commit

Permalink
chore: bump typings & fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperse-net committed Jul 27, 2024
1 parent 9b7cf60 commit 61c7789
Show file tree
Hide file tree
Showing 22 changed files with 327 additions and 169 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci-next-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ jobs:
- name: 📥 Monorepo install
uses: ./.github/actions/yarn-nm-install

# - name: Typecheck
# working-directory: packages/next-auth
# run: |
# yarn typecheck
- name: generate
working-directory: packages/next-auth
run: |
yarn generate
- name: Typecheck
working-directory: packages/next-auth
run: |
yarn typecheck
- name: Linter
working-directory: packages/next-auth
Expand Down
9 changes: 4 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
"[javascript]": {
"editor.formatOnSave": false
},
"eslint.experimental.useFlatConfig": true,
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
"editor.formatOnSave": false
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
}
"editor.formatOnSave": false
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"@hyperse/eslint-config-hyperse": "^1.0.10",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "^9.7.0",
"husky": "9.1.1",
"eslint": "^9.8.0",
"husky": "9.1.3",
"lint-staged": "15.2.7",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@hyperse/eslint-config-hyperse": "^1.0.10",
"@prisma/client": "^5.17.0",
"@types/node": "20.14.12",
"eslint": "^9.7.0",
"eslint": "^9.8.0",
"next": "^14.2.5",
"npm-run-all": "4.1.5",
"prisma": "^5.17.0",
Expand Down
9 changes: 7 additions & 2 deletions packages/next-auth/src/adapters/lucia-prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ model User {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("user")
}
model Authorized {
Expand All @@ -31,17 +33,20 @@ model Authorized {
updatedAt DateTime @updatedAt
@@index([userId])
@@map("authorized")
}
model Session {
id Int @id @default(autoincrement())
token String @unique
userId String
userId String
expiresAt DateTime @default(now())
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId])
}`;
@@map("session")
}
`;
2 changes: 1 addition & 1 deletion packages/next-auth/src/providers/github/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function authorizeCallbackHandler(
Authorization: `Bearer ${tokens.accessToken}`,
},
});
const githubUser: GitHubUser = await githubUserResponse.json();
const githubUser = (await githubUserResponse.json()) as GitHubUser;

const existingUsers = await lucia.getAuthorized({
providerId: githubUser.id?.toString(),
Expand Down
2 changes: 1 addition & 1 deletion packages/next-auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"baseUrl": "./",
"jsx": "preserve",
"allowJs": false,
"noImplicitAny": true,
Expand Down
8 changes: 4 additions & 4 deletions packages/next-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@
"devDependencies": {
"@hyperse/eslint-config-hyperse": "^1.0.10",
"@tanstack/query-core": "^5.x",
"@tanstack/react-query": "^5.51.11",
"@tanstack/react-query": "^5.51.15",
"@trpc/server": "next",
"@types/node": "20.14.12",
"eslint": "^9.7.0",
"eslint": "^9.8.0",
"next": "^14.2.5",
"npm-run-all": "4.1.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rimraf": "6.0.1",
"rollup": "^4.19.0",
"rollup": "^4.19.1",
"rollup-plugin-preserve-directives": "0.4.0",
"typescript": "5.5.4",
"vite-tsconfig-paths": "4.3.2",
"vitest": "2.0.4"
},
"peerDependencies": {
"@tanstack/query-core": "^5.x",
"@tanstack/react-query": "^5.51.11",
"@tanstack/react-query": "^5.51.15",
"@trpc/server": "*",
"next": "^14.2.5",
"react": "^18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"baseUrl": "./",
"jsx": "preserve",
"allowJs": false,
"noImplicitAny": true,
Expand Down
5 changes: 1 addition & 4 deletions packages/next-demo/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"prisma.prisma"
]
"recommendations": ["dbaeumer.vscode-eslint", "prisma.prisma"]
}
5 changes: 0 additions & 5 deletions packages/next-demo/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never"
},
"files.associations": {
"*.css": "tailwindcss"
},
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
Expand Down
9 changes: 5 additions & 4 deletions packages/next-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"generate": "yarn mergePrisma && prisma generate",
"mergePrisma": "yarn node --import=@armit/path-alias/register ./prisma-merge.ts",
"mergePrisma": "yarn node --import=@hyperse/ts-node-paths/register ./prisma-merge.ts",
"prisma-studio": "prisma studio",
"db-seed": "prisma db seed",
"db-reset": "prisma migrate dev reset",
Expand Down Expand Up @@ -48,7 +48,7 @@
"@next/bundle-analyzer": "14.2.5",
"@prisma/client": "^5.17.0",
"@tanstack/query-core": "^5.x",
"@tanstack/react-query": "^5.51.11",
"@tanstack/react-query": "^5.51.15",
"@trpc/client": "next",
"@trpc/next": "next",
"@trpc/react-query": "next",
Expand Down Expand Up @@ -80,6 +80,7 @@
"@graphql-codegen/typescript-operations": "4.2.3",
"@hyperse/eslint-config-hyperse": "^1.0.10",
"@hyperse/tailwind-layer": "^1.0.4",
"@hyperse/ts-node-paths": "^1.0.9",
"@playwright/test": "^1.45.3",
"@types/node": "^20.14.12",
"@types/prettier": "3.0.0",
Expand All @@ -90,13 +91,13 @@
"cz-conventional-changelog": "3.3.0",
"dotenv": "^16.4.5",
"es-check": "7.2.1",
"eslint": "^9.7.0",
"eslint": "^9.8.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.40",
"prisma": "^5.17.0",
"size-limit": "11.1.4",
"start-server-and-test": "^2.0.4",
"tailwindcss": "^3.4.6",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4",
"vite-tsconfig-paths": "4.3.2",
"vitest": "^2.0.4"
Expand Down
3 changes: 3 additions & 0 deletions packages/next-demo/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ model User {
authorized Authorized[] @relation(name: "AuthorizedToUser")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("user")
}
model Authorized {
id String @id
Expand All @@ -32,6 +33,7 @@ model Authorized {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId])
@@map("authorized")
}
model Session {
id Int @id @default(autoincrement())
Expand All @@ -42,4 +44,5 @@ model Session {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId])
@@map("session")
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function LocaleSwitcherSelect({ children, defaultValue, label }: Props) {
const pathname = usePathname();

function onSelectChange(event: ChangeEvent<HTMLSelectElement>) {
const nextLocale = event.target.value;
const nextLocale = event.target.value as any;
startTransition(() => {
router.replace(pathname, { locale: nextLocale });
});
Expand Down
12 changes: 6 additions & 6 deletions packages/next-demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"module": "ESNext",
"moduleResolution": "Node",
"jsx": "preserve",
"baseUrl": "./src",
"baseUrl": "./",
"types": ["vitest/globals"],
"paths": {
"@/*": ["./*"],
"@hyperse/next-core": ["../../../packages/next-core/src/index.js"],
"@hyperse/next-auth": ["../../../packages/next-auth/src/index.js"],
"@hyperse/next-env": ["../../../packages/next-env/src/index.js"],
"@hyperse/next-prisma": ["../../../packages/next-prisma/src/index.js"]
"@/*": ["./src/*"],
"@hyperse/next-core": ["../next-core/src/index.js"],
"@hyperse/next-auth": ["../next-auth/src/index.js"],
"@hyperse/next-env": ["../next-env/src/index.js"],
"@hyperse/next-prisma": ["../next-prisma/src/index.js"]
},
"plugins": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@hyperse/eslint-config-hyperse": "^1.0.10",
"@types/node": "20.14.12",
"eslint": "^9.7.0",
"eslint": "^9.8.0",
"next": "^14.2.5",
"npm-run-all": "4.1.5",
"react": "18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-env/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"baseUrl": "./",
"jsx": "preserve",
"allowJs": false,
"noImplicitAny": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/next-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"devDependencies": {
"@hyperse/eslint-config-hyperse": "^1.0.10",
"@types/node": "20.14.12",
"eslint": "^9.7.0",
"eslint": "^9.8.0",
"fastify": "^4.28.1",
"graphql": "16.9.0",
"mercurius": "14.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-graphql/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"baseUrl": "./",
"jsx": "preserve",
"noImplicitAny": true,
"allowJs": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/next-prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"devDependencies": {
"@hyperse/eslint-config-hyperse": "^1.0.10",
"@types/node": "20.14.12",
"eslint": "^9.7.0",
"eslint": "^9.8.0",
"fastify": "^4.28.1",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-prisma/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "./src",
"baseUrl": "./",
"jsx": "preserve",
"allowJs": false,
"noEmit": false,
Expand Down
Loading

0 comments on commit 61c7789

Please sign in to comment.