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.
Files changed (2) hide show
  1. package/dist/index.js +30 -29
  2. 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
- const wsPath = path.join(projectPath, "src", "Lib", "Websocket");
701
- // Check if the websocket directory exists
702
- if (fs.existsSync(wsPath)) {
703
- // Use fs.rmSync with recursive option set to true to delete the directory and its contents
704
- fs.rmSync(wsPath, { recursive: true, force: true }); // force option is not necessary but can be used to ensure deletion
705
- console.log("Websocket directory was deleted successfully.");
706
- } else {
707
- console.log("Websocket directory does not exist.");
708
- }
709
- // Update settings directory if websocket is not chosen
710
- const settingsPath = path.join(projectPath, "settings");
711
- const websocketFiles = ["restart-websocket.cjs", "restart-websocket.bat"];
712
- websocketFiles.forEach((file) => {
713
- const filePath = path.join(settingsPath, file);
714
- if (fs.existsSync(filePath)) {
715
- fs.unlinkSync(filePath); // Delete each file if it exists
716
- console.log(`${file} was deleted successfully.`);
717
- } else {
718
- console.log(`${file} does not exist.`);
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.11.527",
3
+ "version": "1.11.528",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",