create-prisma-php-app 1.6.30 → 1.6.32

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 CHANGED
@@ -411,7 +411,7 @@ async function main() {
411
411
  console.log("🚀 ~ main ~ projectName:", projectName);
412
412
  let answer = null;
413
413
  if (projectName) {
414
- let useTailwind = args.includes("--tailwind");
414
+ let useTailwind = args.includes("--tailwindcss");
415
415
  let useWebsocket = args.includes("--websocket");
416
416
  const predefinedAnswers = {
417
417
  projectName,
@@ -493,16 +493,12 @@ async function main() {
493
493
  PHP_ROOT_PATH_EXE: "D:\\\\xampp\\\\php\\\\php.exe",
494
494
  PHP_GENERATE_CLASS_PATH: "src/lib/prisma/classes",
495
495
  };`;
496
- console.log("🚀 ~ main ~ settingsCode:", settingsCode);
497
496
  fs.writeFileSync(settingsPath, settingsCode, { flag: "w" });
498
- // Create public directory
499
497
  const publicDirPath = path.join(projectPath, "public");
500
498
  if (!fs.existsSync(publicDirPath)) {
501
499
  fs.mkdirSync(publicDirPath);
502
500
  }
503
- // Update css if tailwindcss is not chosen by the user
504
501
  if (!answer.tailwindcss) {
505
- // delete specific files of tailwindcss if not chosen
506
502
  const cssPath = path.join(projectPath, "src", "app", "css");
507
503
  const tailwindFiles = ["tailwind.css", "styles.css"];
508
504
  tailwindFiles.forEach((file) => {
@@ -1,5 +1,33 @@
1
1
  #!/usr/bin/env node
2
- import{spawn}from"child_process";import fs from"fs";import path from"path";import prompts from"prompts";import{fileURLToPath}from"url";const __filename=fileURLToPath(import.meta.url),__dirname=path.dirname(__filename),args=process.argv.slice(2),readJsonFile=r=>{const e=fs.readFileSync(r,"utf8");return JSON.parse(e)},executeCommand=(r,e=[],o={})=>new Promise(((s,t)=>{const i=spawn(r,e,Object.assign({stdio:"inherit",shell:!0},o));i.on("error",(r=>{t(r)})),i.on("close",(r=>{0===r?s():t(new Error(`Process exited with code ${r}`))}))}));
2
+ import { spawn } from "child_process";
3
+ import fs from "fs";
4
+ import path from "path";
5
+ import prompts from "prompts";
6
+ import { fileURLToPath } from "url";
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ const args = process.argv.slice(2);
10
+ const readJsonFile = (filePath) => {
11
+ const jsonData = fs.readFileSync(filePath, "utf8");
12
+ return JSON.parse(jsonData);
13
+ };
14
+ const executeCommand = (command, args = [], options = {}) => {
15
+ return new Promise((resolve, reject) => {
16
+ const process = spawn(command, args, Object.assign({ stdio: "inherit", shell: true }, options));
17
+ process.on("error", (error) => {
18
+ console.error(`Execution error: ${error.message}`);
19
+ reject(error);
20
+ });
21
+ process.on("close", (code) => {
22
+ if (code === 0) {
23
+ resolve();
24
+ }
25
+ else {
26
+ reject(new Error(`Process exited with code ${code}`));
27
+ }
28
+ });
29
+ });
30
+ };
3
31
  const main = async () => {
4
32
  if (args.length > 0 && args[0] === "update") {
5
33
  try {
@@ -16,11 +44,13 @@ const main = async () => {
16
44
  const currentDir = process.cwd();
17
45
  const configPath = path.join(currentDir, "prisma-php.json");
18
46
  const localSettings = readJsonFile(configPath);
47
+ console.log("🚀 ~ main ~ localSettings:", localSettings);
19
48
  const commandArgs = [localSettings.projectName];
20
49
  if (localSettings.tailwindcss)
21
50
  commandArgs.push("--tailwindcss");
22
51
  if (localSettings.websocket)
23
52
  commandArgs.push("--websocket");
53
+ console.log("🚀 ~ main ~ commandArgs:", commandArgs);
24
54
  console.log("Executing command...\n");
25
55
  await executeCommand("npx", [
26
56
  "create-prisma-php-app@alpha-update-command",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.6.30",
3
+ "version": "1.6.32",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",