prisma-laravel-migrate 3.1.17 → 3.1.18
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/dist/cli/cli.js +8 -7
- package/dist/cli/migrator.index.js +3 -3
- package/dist/cli/models.index.js +3 -3
- package/dist/cli/ts.index.js +4 -3
- package/dist/index.js +4 -3
- package/package.json +2 -3
package/dist/cli/cli.js
CHANGED
|
@@ -328,12 +328,12 @@ function decorate(name, opts) {
|
|
|
328
328
|
const suf = opts.tableSuffix ?? "";
|
|
329
329
|
return `${pre}${name}${suf}`.trim();
|
|
330
330
|
}
|
|
331
|
+
var config = {};
|
|
331
332
|
function addToConfig(key, value) {
|
|
332
|
-
|
|
333
|
-
global._config[key] = value;
|
|
333
|
+
config[key] = value;
|
|
334
334
|
}
|
|
335
335
|
function getConfig(key, property) {
|
|
336
|
-
const cfg =
|
|
336
|
+
const cfg = config;
|
|
337
337
|
const section = cfg[key];
|
|
338
338
|
return property ? section?.[property] : section;
|
|
339
339
|
}
|
|
@@ -3235,6 +3235,7 @@ async function generateTypesFromPrisma(options) {
|
|
|
3235
3235
|
mkdirSync(tsOutDir, { recursive: true });
|
|
3236
3236
|
}
|
|
3237
3237
|
addToConfig("typescript", cfg);
|
|
3238
|
+
addToConfig("model", { tablePrefix: cfg.tablePrefix, tableSuffix: cfg.tableSuffix });
|
|
3238
3239
|
global._config = global._config || {};
|
|
3239
3240
|
global._config.ts = {
|
|
3240
3241
|
prettier: !!cfg.prettier
|
|
@@ -3349,7 +3350,7 @@ async function runGenerators(configPath, skipPrismaGenerate = false) {
|
|
|
3349
3350
|
const { migCfg, modCfg, tsCfg } = await getLaravelGeneratorConfigs(datamodel);
|
|
3350
3351
|
const sdk = dmf.default ?? dmf;
|
|
3351
3352
|
const dmmf = await sdk.getDMMF({ datamodel });
|
|
3352
|
-
const
|
|
3353
|
+
const config2 = (conf) => {
|
|
3353
3354
|
return {
|
|
3354
3355
|
dmmf,
|
|
3355
3356
|
// pass the models block config directly
|
|
@@ -3362,9 +3363,9 @@ async function runGenerators(configPath, skipPrismaGenerate = false) {
|
|
|
3362
3363
|
version: ""
|
|
3363
3364
|
};
|
|
3364
3365
|
};
|
|
3365
|
-
await generateLaravelSchema(
|
|
3366
|
-
await generateLaravelModels(
|
|
3367
|
-
await generateTypesFromPrisma(
|
|
3366
|
+
await generateLaravelSchema(config2(migCfg));
|
|
3367
|
+
await generateLaravelModels(config2(modCfg));
|
|
3368
|
+
await generateTypesFromPrisma(config2(tsCfg));
|
|
3368
3369
|
};
|
|
3369
3370
|
if (skipPrismaGenerate) {
|
|
3370
3371
|
await doRun();
|
|
@@ -240,12 +240,12 @@ function decorate(name, opts) {
|
|
|
240
240
|
const suf = opts.tableSuffix ?? "";
|
|
241
241
|
return `${pre}${name}${suf}`.trim();
|
|
242
242
|
}
|
|
243
|
+
var config = {};
|
|
243
244
|
function addToConfig(key, value) {
|
|
244
|
-
|
|
245
|
-
global._config[key] = value;
|
|
245
|
+
config[key] = value;
|
|
246
246
|
}
|
|
247
247
|
function getConfig(key, property) {
|
|
248
|
-
const cfg =
|
|
248
|
+
const cfg = config;
|
|
249
249
|
const section = cfg[key];
|
|
250
250
|
return property ? section?.[property] : section;
|
|
251
251
|
}
|
package/dist/cli/models.index.js
CHANGED
|
@@ -77,12 +77,12 @@ function decorate(name, opts) {
|
|
|
77
77
|
const suf = opts.tableSuffix ?? "";
|
|
78
78
|
return `${pre}${name}${suf}`.trim();
|
|
79
79
|
}
|
|
80
|
+
var config = {};
|
|
80
81
|
function addToConfig(key, value) {
|
|
81
|
-
|
|
82
|
-
global._config[key] = value;
|
|
82
|
+
config[key] = value;
|
|
83
83
|
}
|
|
84
84
|
function getConfig(key, property) {
|
|
85
|
-
const cfg =
|
|
85
|
+
const cfg = config;
|
|
86
86
|
const section = cfg[key];
|
|
87
87
|
return property ? section?.[property] : section;
|
|
88
88
|
}
|
package/dist/cli/ts.index.js
CHANGED
|
@@ -167,12 +167,12 @@ function decorate(name, opts) {
|
|
|
167
167
|
const suf = opts.tableSuffix ?? "";
|
|
168
168
|
return `${pre}${name}${suf}`.trim();
|
|
169
169
|
}
|
|
170
|
+
var config = {};
|
|
170
171
|
function addToConfig(key, value) {
|
|
171
|
-
|
|
172
|
-
global._config[key] = value;
|
|
172
|
+
config[key] = value;
|
|
173
173
|
}
|
|
174
174
|
function getConfig(key, property) {
|
|
175
|
-
const cfg =
|
|
175
|
+
const cfg = config;
|
|
176
176
|
const section = cfg[key];
|
|
177
177
|
return property ? section?.[property] : section;
|
|
178
178
|
}
|
|
@@ -1689,6 +1689,7 @@ async function generateTypesFromPrisma(options) {
|
|
|
1689
1689
|
mkdirSync(tsOutDir, { recursive: true });
|
|
1690
1690
|
}
|
|
1691
1691
|
addToConfig("typescript", cfg);
|
|
1692
|
+
addToConfig("model", { tablePrefix: cfg.tablePrefix, tableSuffix: cfg.tableSuffix });
|
|
1692
1693
|
global._config = global._config || {};
|
|
1693
1694
|
global._config.ts = {
|
|
1694
1695
|
prettier: !!cfg.prettier
|
package/dist/index.js
CHANGED
|
@@ -392,12 +392,12 @@ function decorate(name, opts) {
|
|
|
392
392
|
const suf = opts.tableSuffix ?? "";
|
|
393
393
|
return `${pre}${name}${suf}`.trim();
|
|
394
394
|
}
|
|
395
|
+
var config = {};
|
|
395
396
|
function addToConfig(key, value) {
|
|
396
|
-
|
|
397
|
-
global._config[key] = value;
|
|
397
|
+
config[key] = value;
|
|
398
398
|
}
|
|
399
399
|
function getConfig(key, property) {
|
|
400
|
-
const cfg =
|
|
400
|
+
const cfg = config;
|
|
401
401
|
const section = cfg[key];
|
|
402
402
|
return property ? section?.[property] : section;
|
|
403
403
|
}
|
|
@@ -3230,6 +3230,7 @@ async function generateTypesFromPrisma(options) {
|
|
|
3230
3230
|
mkdirSync(tsOutDir, { recursive: true });
|
|
3231
3231
|
}
|
|
3232
3232
|
addToConfig("typescript", cfg);
|
|
3233
|
+
addToConfig("model", { tablePrefix: cfg.tablePrefix, tableSuffix: cfg.tableSuffix });
|
|
3233
3234
|
global._config = global._config || {};
|
|
3234
3235
|
global._config.ts = {
|
|
3235
3236
|
prettier: !!cfg.prettier
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-laravel-migrate",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.18",
|
|
4
4
|
"description": "Generate laravel migrations and/or models using prisma files",
|
|
5
5
|
"bin": {
|
|
6
6
|
"prisma-laravel-migrations": "./dist/cli/migrator.index.js",
|
|
@@ -54,8 +54,7 @@
|
|
|
54
54
|
"minimatch": "^10.0.3",
|
|
55
55
|
"node-diff3": "^3.1.2",
|
|
56
56
|
"pluralize": "^8.0.0",
|
|
57
|
-
"prettier": "^3.6.2"
|
|
58
|
-
"prisma-laravel-migrate": "^3.1.16"
|
|
57
|
+
"prettier": "^3.6.2"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@types/ejs": "^3.1.5",
|