create-prisma-php-app 4.1.0 → 4.1.1
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/prisma-php.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import chalk from"chalk";import{spawn}from"child_process";import fs from"fs";import path from"path";import prompts from"prompts";const args=process.argv.slice(2),isNonInteractive=args.includes("-y"),readJsonFile=e=>{const o=fs.readFileSync(e,"utf8");return JSON.parse(o)},executeCommand=(e,o=[],n={})=>new Promise((r,s)=>{const t=spawn(e,o,{stdio:"inherit",shell:!0,...n});t.on("error",e=>{console.error(`Execution error: ${e.message}`),s(e)}),t.on("close",e=>{0===e?r():s(new Error(`Process exited with code ${e}`))})});async function getAnswer(e){const o=[{type:"toggle",name:"shouldProceed",message:`This command will update the ${chalk.blue("create-prisma-php-app")} package and overwrite all default files. ${chalk.blue("Do you want to proceed")}?`,initial:!1,active:"Yes",inactive:"No"}];e||o.push({type:e=>e?"text":null,name:"versionTag",message:`Enter version tag (e.g., ${chalk.cyan("latest")}, ${chalk.cyan("v4-alpha")}, ${chalk.cyan("1.2.3")}), or press Enter for ${chalk.green("latest")}:`,initial:"latest",validate:e=>!(!e||""===e.trim())||"Version tag cannot be empty"});const n=await prompts(o,{onCancel:()=>{console.warn(chalk.red("Operation cancelled by the user.")),process.exit(0)}});if(0===Object.keys(n).length)return null;let r="latest";return e?r=e:n.versionTag&&(r=n.versionTag),{shouldProceed:n.shouldProceed,versionTag:r}}const commandsToExecute={update:"npx pp update project"},parseVersionFromArgs=e=>{const o=e.find(e=>e.startsWith("@")||e.match(/^\d+\.\d+\.\d+/));if(o)return o.startsWith("@")?o.slice(1):o},main=async()=>{if(0===args.length)return console.log("No command provided."),console.log("\nUsage:"),console.log(` ${chalk.cyan("npx pp update project")} - Update to latest version`),console.log(` ${chalk.cyan("npx pp update project @v4-alpha")} - Update to specific tag`),console.log(` ${chalk.cyan("npx pp update project @1.2.3")} - Update to specific version`),void console.log(` ${chalk.cyan("npx pp update project -y")} - Update without prompts (non-interactive)`);const e=parseVersionFromArgs(args),o=`npx pp ${args.filter(e=>!e.startsWith("@")&&!e.match(/^\d+\.\d+\.\d+/)&&"-y"!==e).join(" ")}`;if(!Object.values(commandsToExecute).includes(o))return console.log("Command not recognized or not allowed."),console.log("\nAvailable commands:"),console.log(` ${chalk.cyan("update project")} - Update project files`),void console.log(` ${chalk.cyan("-y")} - Non-interactive mode (skip prompts)`);if(o===commandsToExecute.update)try{let o;if(isNonInteractive)o={shouldProceed:!0,versionTag:e||"latest"},console.log(chalk.blue("Running in non-interactive mode..."));else if(o=await getAnswer(e),!o?.shouldProceed)return void console.log(chalk.red("Operation cancelled by the user."));const n=process.cwd(),r=path.join(n,"prisma-php.json");if(!fs.existsSync(r))return void console.error(chalk.red("The configuration file 'prisma-php.json' was not found in the current directory."));const s=readJsonFile(r),t=o.versionTag||"latest",a=`create-prisma-php-app@${t}`;console.log(chalk.blue(`\nUpdating to: ${chalk.green(a)}\n`));const c=[s.projectName];s.backendOnly&&c.push("--backend-only"),s.swaggerDocs&&c.push("--swagger-docs"),s.tailwindcss&&c.push("--tailwindcss"),s.websocket&&c.push("--websocket"),s.prisma&&c.push("--prisma"),s.docker&&c.push("--docker"),s.mcp&&c.push("--mcp"),s.typescript&&c.push("--typescript"),console.log("Executing command...\n"),await executeCommand("npx",[a,...c]),s.version=t,fs.writeFileSync(r,JSON.stringify(s,null,2)),console.log(chalk.green(`\n✓ Project updated successfully to version ${t}!`)),console.log(chalk.blue("Updated configuration saved to prisma-php.json"))}catch(e){e instanceof Error?e.message.includes("no such file or directory")?console.error(chalk.red("The configuration file 'prisma-php.json' was not found in the current directory.")):console.error(chalk.red(`Error during update: ${e.message}`)):console.error("Error in script execution:",e)}};main().catch(e=>{console.error("Unhandled error in main function:",e)});
|
|
2
|
+
import chalk from"chalk";import{spawn}from"child_process";import fs from"fs";import path from"path";import prompts from"prompts";const args=process.argv.slice(2),isNonInteractive=args.includes("-y"),readJsonFile=e=>{const o=fs.readFileSync(e,"utf8");return JSON.parse(o)},executeCommand=(e,o=[],n={})=>new Promise((r,s)=>{const t=spawn(e,o,{stdio:"inherit",shell:!0,...n});t.on("error",e=>{console.error(`Execution error: ${e.message}`),s(e)}),t.on("close",e=>{0===e?r():s(new Error(`Process exited with code ${e}`))})});async function getAnswer(e){const o=[{type:"toggle",name:"shouldProceed",message:`This command will update the ${chalk.blue("create-prisma-php-app")} package and overwrite all default files. ${chalk.blue("Do you want to proceed")}?`,initial:!1,active:"Yes",inactive:"No"}];e||o.push({type:e=>e?"text":null,name:"versionTag",message:`Enter version tag (e.g., ${chalk.cyan("latest")}, ${chalk.cyan("v4-alpha")}, ${chalk.cyan("1.2.3")}), or press Enter for ${chalk.green("latest")}:`,initial:"latest",validate:e=>!(!e||""===e.trim())||"Version tag cannot be empty"});const n=await prompts(o,{onCancel:()=>{console.warn(chalk.red("Operation cancelled by the user.")),process.exit(0)}});if(0===Object.keys(n).length)return null;let r="latest";return e?r=e:n.versionTag&&(r=n.versionTag),{shouldProceed:n.shouldProceed,versionTag:r}}const commandsToExecute={update:"npx pp update project"},parseVersionFromArgs=e=>{const o=e.find(e=>e.startsWith("@")||e.match(/^\d+\.\d+\.\d+/));if(o)return o.startsWith("@")?o.slice(1):o},main=async()=>{if(0===args.length)return console.log("No command provided."),console.log("\nUsage:"),console.log(` ${chalk.cyan("npx pp update project")} - Update to latest version`),console.log(` ${chalk.cyan("npx pp update project @v4-alpha")} - Update to specific tag`),console.log(` ${chalk.cyan("npx pp update project @1.2.3")} - Update to specific version`),void console.log(` ${chalk.cyan("npx pp update project -y")} - Update without prompts (non-interactive)`);const e=parseVersionFromArgs(args),o=`npx pp ${args.filter(e=>!e.startsWith("@")&&!e.match(/^\d+\.\d+\.\d+/)&&"-y"!==e).join(" ")}`;if(!Object.values(commandsToExecute).includes(o))return console.log("Command not recognized or not allowed."),console.log("\nAvailable commands:"),console.log(` ${chalk.cyan("update project")} - Update project files`),void console.log(` ${chalk.cyan("-y")} - Non-interactive mode (skip prompts)`);if(o===commandsToExecute.update)try{let o;if(isNonInteractive)o={shouldProceed:!0,versionTag:e||"latest"},console.log(chalk.blue("Running in non-interactive mode..."));else if(o=await getAnswer(e),!o?.shouldProceed)return void console.log(chalk.red("Operation cancelled by the user."));const n=process.cwd(),r=path.join(n,"prisma-php.json");if(!fs.existsSync(r))return void console.error(chalk.red("The configuration file 'prisma-php.json' was not found in the current directory."));const s=readJsonFile(r),t=o.versionTag||"latest",a=`create-prisma-php-app@${t}`;console.log(chalk.blue(`\nUpdating to: ${chalk.green(a)}\n`));const c=[s.projectName];s.backendOnly&&c.push("--backend-only"),s.swaggerDocs&&c.push("--swagger-docs"),s.tailwindcss&&c.push("--tailwindcss"),s.websocket&&c.push("--websocket"),s.prisma&&c.push("--prisma"),s.docker&&c.push("--docker"),s.mcp&&c.push("--mcp"),s.typescript&&c.push("--typescript"),isNonInteractive&&c.push("-y"),console.log("Executing command...\n"),await executeCommand("npx",[a,...c]),s.version=t,fs.writeFileSync(r,JSON.stringify(s,null,2)),console.log(chalk.green(`\n✓ Project updated successfully to version ${t}!`)),console.log(chalk.blue("Updated configuration saved to prisma-php.json"))}catch(e){e instanceof Error?e.message.includes("no such file or directory")?console.error(chalk.red("The configuration file 'prisma-php.json' was not found in the current directory.")):console.error(chalk.red(`Error during update: ${e.message}`)):console.error("Error in script execution:",e)}};main().catch(e=>{console.error("Unhandled error in main function:",e)});
|
package/dist/src/app/index.php
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<ol class="list-inside list-decimal text-sm/6 text-center sm:text-left">
|
|
9
9
|
<li class="mb-2 tracking-[-.01em]">
|
|
10
10
|
Get started by editing
|
|
11
|
-
<code class="bg-text-foreground/[.05] dark:bg-white/
|
|
11
|
+
<code class="bg-text-foreground/[.05] dark:bg-white/6 px-1 py-0.5 rounded font-semibold">
|
|
12
12
|
src/app/index.php
|
|
13
13
|
</code>
|
|
14
14
|
.
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</div>
|
|
47
47
|
</main>
|
|
48
48
|
|
|
49
|
-
<footer class="row-start-3 flex gap-
|
|
49
|
+
<footer class="row-start-3 flex gap-6 flex-wrap items-center justify-center">
|
|
50
50
|
<a
|
|
51
51
|
class="flex items-center gap-2 hover:underline hover:underline-offset-4"
|
|
52
52
|
href="https://prismaphp.tsnc.tech/docs?doc=learning-path"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<div class="flex flex-col min-h-
|
|
1
|
+
<div class="flex flex-col min-h-screen items-center justify-center space-y-4 text-center">
|
|
2
2
|
<div class="space-y-2">
|
|
3
3
|
<h1 class="text-4xl font-bold tracking-tighter sm:text-5xl md:text-6xl">404 Not Found</h1>
|
|
4
|
-
<p class="max-w-
|
|
4
|
+
<p class="max-w-150 text-gray-500 md:text-xl/relaxed lg:text-base/relaxed xl:text-xl/relaxed dark:text-gray-400">
|
|
5
5
|
Sorry, we couldn't find the page you're looking for.
|
|
6
6
|
</p>
|
|
7
7
|
</div>
|