@friggframework/core 2.0.0--canary.461.4e09240.0 → 2.0.0--canary.461.23a07de.0
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.
- package/database/utils/prisma-runner.js +29 -22
- package/package.json +5 -5
|
@@ -55,7 +55,7 @@ async function runPrismaGenerate(dbType, verbose = false) {
|
|
|
55
55
|
|
|
56
56
|
// In Lambda, also check the layer path (/opt/nodejs/node_modules)
|
|
57
57
|
const lambdaLayerClientPath = `/opt/nodejs/node_modules/generated/prisma-${dbType}/client.js`;
|
|
58
|
-
|
|
58
|
+
|
|
59
59
|
const clientExists = fs.existsSync(generatedClientPath) || (isLambdaEnvironment && fs.existsSync(lambdaLayerClientPath));
|
|
60
60
|
|
|
61
61
|
if (clientExists) {
|
|
@@ -154,35 +154,38 @@ async function checkDatabaseState(dbType) {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
157
|
+
* Gets the path to the Prisma CLI entry point
|
|
158
|
+
*
|
|
159
|
+
* IMPORTANT: We invoke prisma/build/index.js directly instead of .bin/prisma
|
|
160
|
+
* because .bin/prisma uses __dirname to find WASM files, and when the symlink
|
|
161
|
+
* is resolved during Lambda packaging, __dirname points to .bin/ instead of
|
|
162
|
+
* prisma/build/, causing WASM files to not be found.
|
|
163
|
+
*
|
|
164
|
+
* @returns {string} Command to run Prisma CLI (e.g., 'node /path/to/index.js' or 'npx prisma')
|
|
162
165
|
*/
|
|
163
166
|
function getPrismaBinaryPath() {
|
|
164
167
|
const fs = require('fs');
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return 'npx';
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Check function's own node_modules first (standalone dbMigrate)
|
|
172
|
-
const functionPrisma = '/var/task/node_modules/.bin/prisma';
|
|
168
|
+
|
|
169
|
+
// Check function's bundled Prisma (Lambda) - use actual CLI location
|
|
170
|
+
const functionPrisma = '/var/task/node_modules/prisma/build/index.js';
|
|
173
171
|
if (fs.existsSync(functionPrisma)) {
|
|
174
|
-
return functionPrisma
|
|
172
|
+
return `node ${functionPrisma}`;
|
|
175
173
|
}
|
|
176
174
|
|
|
177
|
-
//
|
|
178
|
-
const layerPrisma = '/opt/nodejs/node_modules
|
|
175
|
+
// Check Lambda layer path - use actual CLI location
|
|
176
|
+
const layerPrisma = '/opt/nodejs/node_modules/prisma/build/index.js';
|
|
179
177
|
if (fs.existsSync(layerPrisma)) {
|
|
180
|
-
return layerPrisma
|
|
178
|
+
return `node ${layerPrisma}`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Check local node_modules - use actual CLI location
|
|
182
|
+
const localPrisma = path.join(process.cwd(), 'node_modules', 'prisma', 'build', 'index.js');
|
|
183
|
+
if (fs.existsSync(localPrisma)) {
|
|
184
|
+
return `node ${localPrisma}`;
|
|
181
185
|
}
|
|
182
186
|
|
|
183
|
-
//
|
|
184
|
-
|
|
185
|
-
return 'npx';
|
|
187
|
+
// Fallback to npx (local dev)
|
|
188
|
+
return 'npx prisma';
|
|
186
189
|
}
|
|
187
190
|
|
|
188
191
|
/**
|
|
@@ -215,7 +218,11 @@ async function runPrismaMigrate(command = 'dev', verbose = false) {
|
|
|
215
218
|
console.log(chalk.gray(`Running: ${displayCmd}`));
|
|
216
219
|
}
|
|
217
220
|
|
|
218
|
-
|
|
221
|
+
// Execute the command (prismaBin might be 'node /path/to/index.js' or 'npx prisma')
|
|
222
|
+
const [command, ...commandArgs] = prismaBin.split(' ');
|
|
223
|
+
const fullArgs = [...commandArgs, ...args];
|
|
224
|
+
|
|
225
|
+
const proc = spawn(command, fullArgs, {
|
|
219
226
|
stdio: 'inherit',
|
|
220
227
|
env: {
|
|
221
228
|
...process.env,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.461.
|
|
4
|
+
"version": "2.0.0--canary.461.23a07de.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@friggframework/eslint-config": "2.0.0--canary.461.
|
|
41
|
-
"@friggframework/prettier-config": "2.0.0--canary.461.
|
|
42
|
-
"@friggframework/test": "2.0.0--canary.461.
|
|
40
|
+
"@friggframework/eslint-config": "2.0.0--canary.461.23a07de.0",
|
|
41
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.23a07de.0",
|
|
42
|
+
"@friggframework/test": "2.0.0--canary.461.23a07de.0",
|
|
43
43
|
"@prisma/client": "^6.17.0",
|
|
44
44
|
"@types/lodash": "4.17.15",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "23a07deb3c1d4751e363d3346eec9a1ab53bfe08"
|
|
83
83
|
}
|