@vaharoni/devops 1.2.15 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,16 +107,6 @@ export const prismaClientSingleton = () => {
107
107
  return client as unknown as ExtendedTransactionClient | FlatTransactionClient;
108
108
  };
109
109
 
110
- // Use the same global singleton key as db-client.ts (prismaGlobal)
111
- // This ensures all code importing from "db" uses the same transactional client
112
- declare global {
113
- // eslint-disable-next-line no-var
114
- var prismaGlobal:
115
- | ExtendedTransactionClient
116
- | FlatTransactionClient
117
- | undefined;
118
- }
119
-
120
110
  export type ExtendedTransactionClient = Prisma.TransactionClient & {
121
111
  $begin: () => Promise<FlatTransactionClient>;
122
112
  };
@@ -126,10 +116,16 @@ export type FlatTransactionClient = Prisma.TransactionClient & {
126
116
  $rollback: () => Promise<void>;
127
117
  };
128
118
 
119
+ // Use the same global singleton key as db-client.ts (prismaGlobal)
120
+ // This ensures all code importing from "db" uses the same transactional client
121
+ // Note: We don't redeclare the global type here to avoid conflicts with db-client.ts
122
+ // when the IDE loads both files. We use type assertions instead.
123
+ type TestPrismaGlobal = ExtendedTransactionClient | FlatTransactionClient | undefined;
124
+
129
125
  const prisma: ExtendedTransactionClient | FlatTransactionClient =
130
- globalThis.prismaGlobal ?? prismaClientSingleton();
126
+ (globalThis.prismaGlobal as TestPrismaGlobal) ?? prismaClientSingleton();
131
127
 
132
- globalThis.prismaGlobal = prisma;
128
+ (globalThis as { prismaGlobal: TestPrismaGlobal }).prismaGlobal = prisma;
133
129
 
134
130
  export { prisma };
135
131
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vaharoni/devops",
3
3
  "type": "module",
4
- "version": "1.2.15",
4
+ "version": "1.2.16",
5
5
  "description": "Devops utility",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -107,16 +107,6 @@ export const prismaClientSingleton = () => {
107
107
  return client as unknown as ExtendedTransactionClient | FlatTransactionClient;
108
108
  };
109
109
 
110
- // Use the same global singleton key as db-client.ts (prismaGlobal)
111
- // This ensures all code importing from "db" uses the same transactional client
112
- declare global {
113
- // eslint-disable-next-line no-var
114
- var prismaGlobal:
115
- | ExtendedTransactionClient
116
- | FlatTransactionClient
117
- | undefined;
118
- }
119
-
120
110
  export type ExtendedTransactionClient = Prisma.TransactionClient & {
121
111
  $begin: () => Promise<FlatTransactionClient>;
122
112
  };
@@ -126,10 +116,16 @@ export type FlatTransactionClient = Prisma.TransactionClient & {
126
116
  $rollback: () => Promise<void>;
127
117
  };
128
118
 
119
+ // Use the same global singleton key as db-client.ts (prismaGlobal)
120
+ // This ensures all code importing from "db" uses the same transactional client
121
+ // Note: We don't redeclare the global type here to avoid conflicts with db-client.ts
122
+ // when the IDE loads both files. We use type assertions instead.
123
+ type TestPrismaGlobal = ExtendedTransactionClient | FlatTransactionClient | undefined;
124
+
129
125
  const prisma: ExtendedTransactionClient | FlatTransactionClient =
130
- globalThis.prismaGlobal ?? prismaClientSingleton();
126
+ (globalThis.prismaGlobal as TestPrismaGlobal) ?? prismaClientSingleton();
131
127
 
132
- globalThis.prismaGlobal = prisma;
128
+ (globalThis as { prismaGlobal: TestPrismaGlobal }).prismaGlobal = prisma;
133
129
 
134
130
  export { prisma };
135
131