fix(build): ship jalaali types with production dependencies
Move @types/jalaali-js into dependencies and add a local module declaration so nest build works when installing without devDependencies. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Generated
+1
-2
@@ -17,6 +17,7 @@
|
|||||||
"@nestjs/passport": "^11.0.5",
|
"@nestjs/passport": "^11.0.5",
|
||||||
"@nestjs/platform-express": "^11.0.1",
|
"@nestjs/platform-express": "^11.0.1",
|
||||||
"@prisma/client": "6.16.0",
|
"@prisma/client": "6.16.0",
|
||||||
|
"@types/jalaali-js": "^1.2.0",
|
||||||
"axios": "^1.11.0",
|
"axios": "^1.11.0",
|
||||||
"bcrypt": "5.1.1",
|
"bcrypt": "5.1.1",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@@ -36,7 +37,6 @@
|
|||||||
"@nestjs/testing": "^11.0.1",
|
"@nestjs/testing": "^11.0.1",
|
||||||
"@types/bcrypt": "5.0.2",
|
"@types/bcrypt": "5.0.2",
|
||||||
"@types/express": "^5.0.0",
|
"@types/express": "^5.0.0",
|
||||||
"@types/jalaali-js": "^1.2.0",
|
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/multer": "^2.2.0",
|
"@types/multer": "^2.2.0",
|
||||||
"@types/node": "^22.0.0",
|
"@types/node": "^22.0.0",
|
||||||
@@ -3013,7 +3013,6 @@
|
|||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmmirror.com/@types/jalaali-js/-/jalaali-js-1.2.0.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/jalaali-js/-/jalaali-js-1.2.0.tgz",
|
||||||
"integrity": "sha512-DRQKjbfFe0/v3siCou9eFzYjDxJItkJpxbU+/CSptvoRqq2/VmTA6y8QvqK/VELKW6xX3qb174nLZlrFV9OT3Q==",
|
"integrity": "sha512-DRQKjbfFe0/v3siCou9eFzYjDxJItkJpxbU+/CSptvoRqq2/VmTA6y8QvqK/VELKW6xX3qb174nLZlrFV9OT3Q==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/jest": {
|
"node_modules/@types/jest": {
|
||||||
|
|||||||
+1
-1
@@ -58,6 +58,7 @@
|
|||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.14.2",
|
"class-validator": "^0.14.2",
|
||||||
"jalaali-js": "^2.0.1",
|
"jalaali-js": "^2.0.1",
|
||||||
|
"@types/jalaali-js": "^1.2.0",
|
||||||
"mysql2": "^3.23.1",
|
"mysql2": "^3.23.1",
|
||||||
"passport": "^0.7.0",
|
"passport": "^0.7.0",
|
||||||
"passport-jwt": "^4.0.1",
|
"passport-jwt": "^4.0.1",
|
||||||
@@ -72,7 +73,6 @@
|
|||||||
"@nestjs/testing": "^11.0.1",
|
"@nestjs/testing": "^11.0.1",
|
||||||
"@types/bcrypt": "5.0.2",
|
"@types/bcrypt": "5.0.2",
|
||||||
"@types/express": "^5.0.0",
|
"@types/express": "^5.0.0",
|
||||||
"@types/jalaali-js": "^1.2.0",
|
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/multer": "^2.2.0",
|
"@types/multer": "^2.2.0",
|
||||||
"@types/node": "^22.0.0",
|
"@types/node": "^22.0.0",
|
||||||
|
|||||||
@@ -434,12 +434,12 @@ export class TenantsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private handleUnique(error: unknown) {
|
private handleUnique(error: unknown) {
|
||||||
if (
|
if (!(error instanceof Prisma.PrismaClientKnownRequestError)) {
|
||||||
error instanceof Prisma.PrismaClientKnownRequestError &&
|
return;
|
||||||
error.code === 'P2002'
|
}
|
||||||
) {
|
if (error.code === 'P2002') {
|
||||||
const targets = Array.isArray(error.meta?.target)
|
const targets = Array.isArray(error.meta?.target)
|
||||||
? (error.meta?.target as string[])
|
? (error.meta.target as string[])
|
||||||
: [];
|
: [];
|
||||||
if (targets.includes('slug')) {
|
if (targets.includes('slug')) {
|
||||||
throw new ConflictException('slug تکراری است — این slug قبلاً برای نسخه دیگری ثبت شده');
|
throw new ConflictException('slug تکراری است — این slug قبلاً برای نسخه دیگری ثبت شده');
|
||||||
@@ -452,4 +452,5 @@ export class TenantsService {
|
|||||||
throw new ConflictException('slug یا domain تکراری است');
|
throw new ConflictException('slug یا domain تکراری است');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+19
@@ -0,0 +1,19 @@
|
|||||||
|
declare module 'jalaali-js' {
|
||||||
|
export function toJalaali(
|
||||||
|
gy: number,
|
||||||
|
gm: number,
|
||||||
|
gd: number,
|
||||||
|
): { jy: number; jm: number; jd: number }
|
||||||
|
|
||||||
|
export function toGregorian(
|
||||||
|
jy: number,
|
||||||
|
jm: number,
|
||||||
|
jd: number,
|
||||||
|
): { gy: number; gm: number; gd: number }
|
||||||
|
|
||||||
|
export function isValidJalaaliDate(jy: number, jm: number, jd: number): boolean
|
||||||
|
|
||||||
|
export function isLeapJalaaliYear(jy: number): boolean
|
||||||
|
|
||||||
|
export function jalaaliMonthLength(jy: number, jm: number): number
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user