Skip to content

Commit

Permalink
fix backoffice build
Browse files Browse the repository at this point in the history
  • Loading branch information
younes200 committed Oct 4, 2023
1 parent 5777f6c commit 621aa05
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 67 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
28 changes: 7 additions & 21 deletions apps/admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
{
"compilerOptions": {
"jsx": "react",
"module": "nodenext",
"moduleResolution": "nodenext",
"declaration": true,
"removeComments": true,
"allowSyntheticDefaultImports": true,
"target": "es6",
"lib": [
"esnext"
],
"sourceMap": true,
"outDir": "dist",
"skipLibCheck": true,
"esModuleInterop": true
},
"exclude": [
"node_modules",
"src/**/theme.bundle.js"
],
"extends": "@celluloid/config/tsconfig/react.json",
"include": [
"src"
"**/*.ts",
"**/*.tsx",
"tsup.config.ts"
],
"exclude": [
"node_modules"
]
}
11 changes: 8 additions & 3 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"version": "2.0.1",
"type": "module",
"scripts": {
"build": "esbuild src/index.ts --bundle --packages=external --platform=node --format=esm --outdir=dist --sourcemap",
"build": "tsup",
"dev": "tsx watch --clear-screen=false src ",
"start": "node dist",
"start": "node dist/index",
"test-start": "start-server-and-test 'node dist/index' 2021"
},
"dependencies": {
Expand All @@ -22,6 +22,8 @@
"express": "^4.18.2",
"express-session": "^1.17.3",
"lodash": "^4.17.21",
"passport": "^0.6.0",
"passport-local": "^1.0.0",
"redis": "^4.6.10",
"swagger-ui-express": "^5.0.0",
"trpc-openapi": "^1.2.0",
Expand All @@ -30,11 +32,14 @@
},
"devDependencies": {
"@types/express": "^4.17.17",
"@types/node": "^20.8.2",
"@types/swagger-ui-express": "^4.1.3",
"@types/uuid": "^9.0.4",
"esbuild": "^0.19.4",
"start-server-and-test": "^2.0.0",
"tslib": "^2.6.2",
"tsup": "^7.2.0",
"tsx": "^3.12.10",
"typescript": "^5.2.2",
"wait-port": "^1.0.4"
}
}
3 changes: 2 additions & 1 deletion apps/backend/src/passport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const loginStrategy = new LocalStrategy(

const user = await prisma.user.findUnique({
where: {
OR: [{ email: login }, { username: login, }]
//OR: [{ email: login }, { username: login, }]
email: login
}
});

Expand Down
20 changes: 4 additions & 16 deletions apps/backend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"esModuleInterop": true,
"composite": true,
"strict": true,
"outDir": "dist"
},
"extends": "@celluloid/config/tsconfig/node16.json",
"include": [
"src"
"**/*.ts",
"**/*.tsx",
"tsup.config.ts"
],
"exclude": [
"node_modules"
],
"references": [
{
"path": "../../packages/trpc"
}
]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/config/tsconfig/react.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"incremental": false,
"esModuleInterop": true,
"module": "esnext",
"resolveJsonModule": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"repository": "http://github.com/celluloid-edu/celluloid",
"author": "Younes Benaomar <younes.benaomar@gmail.com>",
"license": "MIT",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"src/index.ts"
"dist"
],
"prisma": {
"schema": "schema.prisma",
Expand Down Expand Up @@ -38,7 +39,6 @@
"@types/dotenv": "^6.0.0",
"copyfiles": "^2.4.1",
"dotenv-cli": "^7.2.1",
"esbuild": "^0.19.4",
"eslint": "^8.12.0",
"prisma": "^5.3.1",
"rimraf": "^5.0.1",
Expand Down
4 changes: 3 additions & 1 deletion packages/prisma/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrismaClient } from "@prisma/client";
import PrismaModule, { PrismaClient } from "@prisma/client";


declare global {
Expand All @@ -17,3 +17,5 @@ export const prisma = global.prisma || new PrismaClient({
if (process.env.NODE_ENV !== "production") global.prisma = prisma;

export * from "@prisma/client";

export default PrismaModule;
11 changes: 7 additions & 4 deletions packages/trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
"name": "@celluloid/trpc",
"private": true,
"version": "2.0.1",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"type": "module",
"main": "dist/index.js",
"files": [
"src/index.ts"
"dist"
],
"scripts": {
"build": "esbuild src/index.ts --bundle --packages=external --platform=node --format=esm --outdir=dist --sourcemap",
"build": "tsup",
"build1": "esbuild src/index.ts --bundle --packages=external --platform=neutral --format=esm --outdir=dist --sourcemap",
"dev": "esbuild src/index.ts --bundle --packages=external --platform=node --format=esm --outdir=dist --sourcemap --watch"
},
"dependencies": {
Expand All @@ -24,7 +27,7 @@
},
"devDependencies": {
"@types/uuid": "^9.0.4",
"esbuild": "^0.19.4",
"tsup": "^7.2.0",
"tsx": "^3.12.10"
}
}
3 changes: 1 addition & 2 deletions packages/trpc/src/routers/project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Prisma, UserRole } from '@celluloid/prisma';
import { prisma } from "@celluloid/prisma"
import { Prisma, prisma, UserRole } from '@celluloid/prisma';
import { TRPCError } from '@trpc/server';
import { z } from 'zod';

Expand Down
14 changes: 4 additions & 10 deletions packages/trpc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"esModuleInterop": true,
"composite": true,
"strict": true,
"outDir": "dist"
},
"extends": "@celluloid/config/tsconfig/node16.json",
"include": [
"src"
"**/*.ts",
"**/*.tsx",
"tsup.config.ts"
],
"exclude": [
"node_modules"
Expand Down
12 changes: 12 additions & 0 deletions packages/trpc/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "tsup";

const isProduction = process.env.NODE_ENV === "production";

export default defineConfig({
clean: true,
dts: true,
entry: ["src/index.ts"],
format: ["cjs", "esm"],
minify: isProduction,
sourcemap: true,
});
23 changes: 17 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,6 @@ __metadata:
"@types/dotenv": ^6.0.0
copyfiles: ^2.4.1
dotenv-cli: ^7.2.1
esbuild: ^0.19.4
eslint: ^8.12.0
prisma: ^5.3.1
rimraf: ^5.0.1
Expand Down Expand Up @@ -1873,9 +1872,9 @@ __metadata:
bcryptjs: ^2.4.3
change-case: ^4.1.2
dotenv: ^16.3.1
esbuild: ^0.19.4
lodash: ^4.17.21
trpc-openapi: ^1.2.0
tsup: ^7.2.0
tsx: ^3.12.10
uuid: ^9.0.1
zod: ^3.22.2
Expand Down Expand Up @@ -5392,6 +5391,13 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:^20.8.2":
version: 20.8.2
resolution: "@types/node@npm:20.8.2"
checksum: 3da73e25d821bfcdb7de98589027e08bb4848e55408671c4a83ec0341e124b5313a0b20e1e4b4eff1168ea17a86f622ad73fcb04b761abd77496b9a27cbd5de5
languageName: node
linkType: hard

"@types/nodemailer-direct-transport@npm:*":
version: 1.0.33
resolution: "@types/nodemailer-direct-transport@npm:1.0.33"
Expand Down Expand Up @@ -7320,6 +7326,7 @@ __metadata:
"@celluloid/trpc": "*"
"@trpc/server": ^10.38.5
"@types/express": ^4.17.17
"@types/node": ^20.8.2
"@types/swagger-ui-express": ^4.1.3
"@types/uuid": ^9.0.4
bcryptjs: ^2.4.3
Expand All @@ -7328,15 +7335,19 @@ __metadata:
cookie-parser: ^1.4.6
cors: ^2.8.5
dotenv: ^16.3.1
esbuild: ^0.19.4
express: ^4.18.2
express-session: ^1.17.3
lodash: ^4.17.21
passport: ^0.6.0
passport-local: ^1.0.0
redis: ^4.6.10
start-server-and-test: ^2.0.0
swagger-ui-express: ^5.0.0
trpc-openapi: ^1.2.0
tslib: ^2.6.2
tsup: ^7.2.0
tsx: ^3.12.10
typescript: ^5.2.2
uuid: ^9.0.1
wait-port: ^1.0.4
zod: ^3.22.2
Expand Down Expand Up @@ -23566,7 +23577,7 @@ __metadata:
languageName: node
linkType: hard

"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0":
"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.2.0, tslib@npm:^2.6.2":
version: 2.6.2
resolution: "tslib@npm:2.6.2"
checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad
Expand Down Expand Up @@ -23922,7 +23933,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.0.2, typescript@npm:^5.0.4":
"typescript@npm:^5.0.2, typescript@npm:^5.0.4, typescript@npm:^5.2.2":
version: 5.2.2
resolution: "typescript@npm:5.2.2"
bin:
Expand All @@ -23942,7 +23953,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@^5.0.2#~builtin<compat/typescript>, typescript@patch:typescript@^5.0.4#~builtin<compat/typescript>":
"typescript@patch:typescript@^5.0.2#~builtin<compat/typescript>, typescript@patch:typescript@^5.0.4#~builtin<compat/typescript>, typescript@patch:typescript@^5.2.2#~builtin<compat/typescript>":
version: 5.2.2
resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin<compat/typescript>::version=5.2.2&hash=1f5320"
bin:
Expand Down

0 comments on commit 621aa05

Please sign in to comment.