create-prisma-php-app 1.11.527 → 1.11.528
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 +30 -29
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -227,6 +227,12 @@ function copyRecursiveSync(src, dest, answer) {
|
|
|
227
227
|
(dest.includes("tailwind.css") || dest.includes("styles.css"))
|
|
228
228
|
)
|
|
229
229
|
return;
|
|
230
|
+
if (
|
|
231
|
+
!answer.websocket &&
|
|
232
|
+
(dest.includes("restart-websocket.cjs") ||
|
|
233
|
+
dest.includes("restart-websocket.bat"))
|
|
234
|
+
)
|
|
235
|
+
return;
|
|
230
236
|
fs.copyFileSync(src, dest, 0);
|
|
231
237
|
}
|
|
232
238
|
}
|
|
@@ -234,6 +240,7 @@ function copyRecursiveSync(src, dest, answer) {
|
|
|
234
240
|
async function executeCopy(baseDir, directoriesToCopy, answer) {
|
|
235
241
|
directoriesToCopy.forEach(({ srcDir, destDir }) => {
|
|
236
242
|
if (!answer.prisma && srcDir === "/prisma-client-php") return;
|
|
243
|
+
if (!answer.websocket && srcDir === "/src/Lib/Websocket") return;
|
|
237
244
|
const sourcePath = path.join(__dirname, srcDir);
|
|
238
245
|
const destPath = path.join(baseDir, destDir);
|
|
239
246
|
copyRecursiveSync(sourcePath, destPath, answer);
|
|
@@ -696,29 +703,29 @@ async function main() {
|
|
|
696
703
|
// });
|
|
697
704
|
// }
|
|
698
705
|
// Update websocket if not chosen by the user
|
|
699
|
-
if (!answer.websocket) {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}
|
|
706
|
+
// if (!answer.websocket) {
|
|
707
|
+
// const wsPath = path.join(projectPath, "src", "Lib", "Websocket");
|
|
708
|
+
// // Check if the websocket directory exists
|
|
709
|
+
// if (fs.existsSync(wsPath)) {
|
|
710
|
+
// // Use fs.rmSync with recursive option set to true to delete the directory and its contents
|
|
711
|
+
// fs.rmSync(wsPath, { recursive: true, force: true }); // force option is not necessary but can be used to ensure deletion
|
|
712
|
+
// console.log("Websocket directory was deleted successfully.");
|
|
713
|
+
// } else {
|
|
714
|
+
// console.log("Websocket directory does not exist.");
|
|
715
|
+
// }
|
|
716
|
+
// // Update settings directory if websocket is not chosen
|
|
717
|
+
// const settingsPath = path.join(projectPath, "settings");
|
|
718
|
+
// const websocketFiles = ["restart-websocket.cjs", "restart-websocket.bat"];
|
|
719
|
+
// websocketFiles.forEach((file) => {
|
|
720
|
+
// const filePath = path.join(settingsPath, file);
|
|
721
|
+
// if (fs.existsSync(filePath)) {
|
|
722
|
+
// fs.unlinkSync(filePath); // Delete each file if it exists
|
|
723
|
+
// console.log(`${file} was deleted successfully.`);
|
|
724
|
+
// } else {
|
|
725
|
+
// console.log(`${file} does not exist.`);
|
|
726
|
+
// }
|
|
727
|
+
// });
|
|
728
|
+
// }
|
|
722
729
|
if (!answer.prisma) {
|
|
723
730
|
const prismaPath = path.join(projectPath, "prisma");
|
|
724
731
|
const prismClassPath = path.join(projectPath, "src", "Lib", "Prisma");
|
|
@@ -819,12 +826,6 @@ async function main() {
|
|
|
819
826
|
execSync(`php C:\\ProgramData\\ComposerSetup\\bin\\composer.phar install`, {
|
|
820
827
|
stdio: "inherit",
|
|
821
828
|
});
|
|
822
|
-
execSync(
|
|
823
|
-
`php C:\\ProgramData\\ComposerSetup\\bin\\composer.phar dump-autoload`,
|
|
824
|
-
{
|
|
825
|
-
stdio: "inherit",
|
|
826
|
-
}
|
|
827
|
-
);
|
|
828
829
|
console.log(
|
|
829
830
|
`${chalk.green("Success!")} Prisma PHP project successfully created in ${
|
|
830
831
|
answer.projectName
|