create-prisma-php-app 1.6.38 → 1.6.39
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 +34 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -398,6 +398,17 @@ async function installDependencies(baseDir, dependencies, isDev = false) {
|
|
|
398
398
|
cwd: baseDir,
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
|
+
async function uninstallDependencies(baseDir, dependencies, isDev = false) {
|
|
402
|
+
console.log("Uninstalling dependencies:");
|
|
403
|
+
dependencies.forEach((dep) => console.log(`- ${chalk.blue(dep)}`));
|
|
404
|
+
// Prepare the npm uninstall command with the appropriate flag for dev dependencies
|
|
405
|
+
const npmUninstallCommand = `npm uninstall ${isDev ? "--save-dev" : "--save"} ${dependencies.join(" ")}`;
|
|
406
|
+
// Execute the npm uninstall command
|
|
407
|
+
execSync(npmUninstallCommand, {
|
|
408
|
+
stdio: "inherit",
|
|
409
|
+
cwd: baseDir,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
401
412
|
function fetchPackageVersion(packageName) {
|
|
402
413
|
return new Promise((resolve, reject) => {
|
|
403
414
|
https
|
|
@@ -557,6 +568,29 @@ async function main() {
|
|
|
557
568
|
}
|
|
558
569
|
});
|
|
559
570
|
}
|
|
571
|
+
if (updateAnswer === null || updateAnswer === void 0 ? void 0 : updateAnswer.isUpdate) {
|
|
572
|
+
const updateUninstallDependencies = [];
|
|
573
|
+
if (!updateAnswer.tailwindcss) {
|
|
574
|
+
const tailwindFiles = ["postcss.config.js", "tailwind.config.js"];
|
|
575
|
+
tailwindFiles.forEach((file) => {
|
|
576
|
+
const filePath = path.join(projectPath, file);
|
|
577
|
+
if (fs.existsSync(filePath)) {
|
|
578
|
+
fs.unlinkSync(filePath); // Delete each file if it exists
|
|
579
|
+
console.log(`${file} was deleted successfully.`);
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
console.log(`${file} does not exist.`);
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
updateUninstallDependencies.push("tailwindcss", "autoprefixer", "postcss", "postcss-cli", "cssnano");
|
|
586
|
+
}
|
|
587
|
+
if (!updateAnswer.websocket) {
|
|
588
|
+
updateUninstallDependencies.push("chokidar-cli");
|
|
589
|
+
}
|
|
590
|
+
if (updateUninstallDependencies.length > 0) {
|
|
591
|
+
await uninstallDependencies(projectPath, updateUninstallDependencies, true);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
560
594
|
const version = await fetchPackageVersion("create-prisma-php-app");
|
|
561
595
|
const prismaPhpConfig = {
|
|
562
596
|
projectName: answer.projectName,
|