Skip to content

Commit

Permalink
refactor: build api,auth,db with tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
ixahmedxi committed Jun 10, 2024
1 parent 2ff74e7 commit 482acbb
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 16 deletions.
10 changes: 4 additions & 6 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ const withBundleAnalyzer = bundleAnalyzerPlugin({
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
transpilePackages: [
'@orbitkit/db',
'@orbitkit/auth',
'@orbitkit/env',
'@orbitkit/api',
],
transpilePackages: ['@orbitkit/env'],
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
experimental: {
typedRoutes: true,
},
};

export default withBundleAnalyzer(nextConfig);
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "module",
"scripts": {
"build": "next build",
"dev": "next dev --turbo",
"dev": "next dev",
"lint": "eslint . --max-warnings 0",
"start": "next start",
"test:e2e": "playwright test",
Expand Down
7 changes: 6 additions & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
"sideEffects": false,
"type": "module",
"exports": {
".": "./src/index.ts"
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"dev": "tsc -w -p tsconfig.build.json",
"lint": "eslint . --max-warnings 0",
"typecheck": "tsc"
},
Expand Down
10 changes: 10 additions & 0 deletions packages/api/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"tsBuildInfoFile": "tsconfig.build.tsbuildinfo",
"outDir": "dist",
"rootDir": "src",
"noEmit": false
},
"include": ["src/**/*.ts"]
}
23 changes: 18 additions & 5 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,26 @@
"sideEffects": false,
"type": "module",
"exports": {
".": "./src/index.ts",
"./env": "./src/env.js",
"./providers/github": "./src/providers/github.ts",
"./providers/google": "./src/providers/google.ts",
"./actions/logout": "./src/actions/logout.ts"
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./providers/github": {
"types": "./dist/providers/github.d.ts",
"default": "./dist/providers/github.js"
},
"./providers/google": {
"types": "./dist/providers/google.d.ts",
"default": "./dist/providers/google.js"
},
"./actions/logout": {
"types": "./dist/actions/logout.d.ts",
"default": "./dist/actions/logout.js"
}
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"dev": "tsc -w -p tsconfig.build.json",
"lint": "eslint . --max-warnings 0",
"typecheck": "tsc"
},
Expand Down
10 changes: 10 additions & 0 deletions packages/auth/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"tsBuildInfoFile": "tsconfig.build.tsbuildinfo",
"outDir": "dist",
"rootDir": "src",
"noEmit": false
},
"include": ["src/**/*.ts"]
}
13 changes: 10 additions & 3 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
"sideEffects": false,
"type": "module",
"exports": {
".": "./src/index.ts",
"./schema": "./src/schema/index.ts",
"./env": "./src/env.js"
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./schema": {
"types": "./dist/schema/index.d.ts",
"default": "./dist/schema/index.js"
}
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"db:check": "drizzle-kit check",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
Expand All @@ -21,6 +27,7 @@
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio",
"db:up": "drizzle-kit up",
"dev": "tsc -w -p tsconfig.build.json",
"lint": "eslint . --max-warnings 0",
"typecheck": "tsc"
},
Expand Down
10 changes: 10 additions & 0 deletions packages/db/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"tsBuildInfoFile": "tsconfig.build.tsbuildinfo",
"outDir": "dist",
"rootDir": "src",
"noEmit": false
},
"include": ["src/**/*.ts"]
}
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://turbo.build/schema.json",
"ui": "stream",
"globalPassThroughEnv": [
"VERCEL_URL",
"NODE_ENV",
Expand Down

0 comments on commit 482acbb

Please sign in to comment.