create-prisma-php-app 1.20.520 → 1.20.522

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/.htaccess CHANGED
@@ -15,7 +15,7 @@ RewriteEngine On
15
15
  </IfModule>
16
16
 
17
17
  # Exclude static files from being redirected
18
- RewriteCond %{REQUEST_URI} !\.(css|js|png|jpg|jpeg|gif|svg|webp|woff|woff2|ttf|eot|ico|pdf)$ [NC]
18
+ RewriteCond %{REQUEST_URI} !\.(css|js|png|jpe?g|gif|svg|webp|woff2?|ttf|eot|ico|pdf|mp4|webm|mp3|ogg)$ [NC]
19
19
  RewriteCond %{REQUEST_URI} !^/bootstrap.php
20
20
  RewriteRule ^(.*)$ bootstrap.php [QSA,L]
21
21
 
@@ -658,6 +658,8 @@ try {
658
658
  $pathname = $uri ? "/" . $uri : "/";
659
659
  $_fileToInclude = basename($_contentToInclude);
660
660
 
661
+ authenticateUserToken();
662
+
661
663
  if (empty($_contentToInclude)) {
662
664
  if (!$isXFilRequest) {
663
665
  // Set the header and output a JSON response for permission denied
@@ -687,7 +689,7 @@ try {
687
689
  header('Content-Type: application/json');
688
690
  echo json_encode([
689
691
  'success' => false,
690
- 'error' => 'File not found'
692
+ 'error' => 'Not found'
691
693
  ]);
692
694
  http_response_code(404); // Set HTTP status code to 404 Not Found
693
695
  }
package/dist/index.js CHANGED
@@ -142,6 +142,7 @@ async function updatePackageJson(baseDir, answer) {
142
142
  Object.assign({}, packageJson.scripts),
143
143
  { "create-swagger-docs": "node settings/swagger-setup.js" }
144
144
  );
145
+ answersToInclude.push("create-swagger-docs");
145
146
  }
146
147
  // Initialize with existing scripts
147
148
  let updatedScripts = Object.assign({}, packageJson.scripts);
@@ -345,20 +346,22 @@ function modifyLayoutPHP(baseDir, answer) {
345
346
  let indexContent = fs.readFileSync(layoutPath, "utf8");
346
347
  let stylesAndLinks = "";
347
348
  if (!answer.backendOnly) {
348
- stylesAndLinks = `\n <link href="<?php echo $baseUrl; ?>/css/index.css" rel="stylesheet">\n <script src="<?php echo $baseUrl; ?>/js/index.js"></script>`;
349
+ stylesAndLinks = `\n <link href="<?= $baseUrl; ?>/css/index.css" rel="stylesheet">\n <script src="<?= $baseUrl; ?>/js/index.js"></script>`;
349
350
  }
350
351
  // Tailwind CSS link or CDN script
351
352
  let tailwindLink = "";
352
353
  if (!answer.backendOnly) {
353
354
  tailwindLink = answer.tailwindcss
354
- ? ` <link href="<?php echo $baseUrl; ?>/css/styles.css" rel="stylesheet"> ${stylesAndLinks}`
355
+ ? ` <link href="<?= $baseUrl; ?>/css/styles.css" rel="stylesheet"> ${stylesAndLinks}`
355
356
  : ` <script src="https://cdn.tailwindcss.com"></script> ${stylesAndLinks}`;
356
357
  }
357
358
  // Insert before the closing </head> tag
359
+ const breakLine = tailwindLink.length > 0 ? "\n" : "";
358
360
  indexContent = indexContent.replace(
359
361
  "</head>",
360
- `${tailwindLink}\n <!-- Dynamic Head -->
361
- <?php echo implode("\\n", $mainLayoutHead); ?></head>`
362
+ `${tailwindLink}${breakLine} <!-- Dynamic Head -->
363
+ <?= implode("\\n", $mainLayoutHead); ?>
364
+ </head>`
362
365
  );
363
366
  fs.writeFileSync(layoutPath, indexContent, { flag: "w" });
364
367
  console.log(