create-prisma-php-app 1.6.58 → 1.6.60
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/index.js +10 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -457,7 +457,7 @@ const readJsonFile = (filePath) => {
|
|
|
457
457
|
return JSON.parse(jsonData);
|
|
458
458
|
};
|
|
459
459
|
async function main() {
|
|
460
|
-
var _a, _b, _c, _d;
|
|
460
|
+
var _a, _b, _c, _d, _e;
|
|
461
461
|
try {
|
|
462
462
|
const args = process.argv.slice(2);
|
|
463
463
|
let projectName = args[0];
|
|
@@ -466,9 +466,6 @@ async function main() {
|
|
|
466
466
|
if (projectName) {
|
|
467
467
|
let useTailwind = args.includes("--tailwindcss");
|
|
468
468
|
let useWebsocket = args.includes("--websocket");
|
|
469
|
-
const currentDir = process.cwd();
|
|
470
|
-
const configPath = path.join(currentDir, "prisma-php.json");
|
|
471
|
-
const localSettings = readJsonFile(configPath);
|
|
472
469
|
const predefinedAnswers = {
|
|
473
470
|
projectName,
|
|
474
471
|
tailwindcss: useTailwind,
|
|
@@ -479,18 +476,24 @@ async function main() {
|
|
|
479
476
|
console.log(chalk.red("Installation cancelled."));
|
|
480
477
|
return;
|
|
481
478
|
}
|
|
479
|
+
const currentDir = process.cwd();
|
|
480
|
+
const configPath = path.join(currentDir, "prisma-php.json");
|
|
481
|
+
const localSettings = readJsonFile(configPath);
|
|
482
|
+
console.log("🚀 ~ main ~ localSettings:", localSettings);
|
|
482
483
|
let excludeFiles = [];
|
|
483
484
|
(_a = localSettings.excludeFiles) === null || _a === void 0 ? void 0 : _a.map((file) => {
|
|
484
485
|
const filePath = path.join(currentDir, file);
|
|
486
|
+
console.log("🚀 ~ localSettings.excludeFiles?.map ~ filePath:", filePath);
|
|
485
487
|
if (fs.existsSync(filePath))
|
|
486
|
-
excludeFiles.push(
|
|
488
|
+
excludeFiles.push(filePath);
|
|
487
489
|
});
|
|
488
490
|
updateAnswer = {
|
|
489
491
|
projectName,
|
|
490
492
|
tailwindcss: (_b = answer === null || answer === void 0 ? void 0 : answer.tailwindcss) !== null && _b !== void 0 ? _b : false,
|
|
491
493
|
websocket: (_c = answer === null || answer === void 0 ? void 0 : answer.websocket) !== null && _c !== void 0 ? _c : false,
|
|
492
494
|
isUpdate: true,
|
|
493
|
-
excludeFiles: excludeFiles
|
|
495
|
+
excludeFiles: (_d = localSettings.excludeFiles) !== null && _d !== void 0 ? _d : [],
|
|
496
|
+
filePath: currentDir,
|
|
494
497
|
};
|
|
495
498
|
console.log("🚀 ~ main ~ answer:", answer);
|
|
496
499
|
}
|
|
@@ -641,7 +644,7 @@ async function main() {
|
|
|
641
644
|
tailwindcss: answer.tailwindcss,
|
|
642
645
|
websocket: answer.websocket,
|
|
643
646
|
version,
|
|
644
|
-
excludeFiles: (
|
|
647
|
+
excludeFiles: (_e = updateAnswer === null || updateAnswer === void 0 ? void 0 : updateAnswer.excludeFiles) !== null && _e !== void 0 ? _e : [],
|
|
645
648
|
};
|
|
646
649
|
fs.writeFileSync(path.join(projectPath, "prisma-php.json"), JSON.stringify(prismaPhpConfig, null, 2), { flag: "w" });
|
|
647
650
|
console.log(`${chalk.green("Success!")} Prisma PHP project successfully created in ${answer.projectName}!`);
|