create-prisma-php-app 4.0.0-alpha.23 → 4.0.0-alpha.25

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
@@ -140,7 +140,6 @@ const npmPinnedVersions = {
140
140
  "@types/prompts": "^2.4.9",
141
141
  "browser-sync": "^3.0.4",
142
142
  chalk: "^5.5.0",
143
- "chokidar-cli": "^3.0.0",
144
143
  cssnano: "^7.1.0",
145
144
  "http-proxy-middleware": "^3.0.5",
146
145
  "npm-run-all": "^4.1.5",
@@ -165,7 +164,7 @@ const composerPinnedVersions = {
165
164
  "brick/math": "^0.13.1",
166
165
  "cboden/ratchet": "^0.4.4",
167
166
  "tsnc/prisma-php": "^1.0.0",
168
- "php-mcp/server": "3.3",
167
+ "php-mcp/server": "3.3.0",
169
168
  };
170
169
  function composerPkg(name) {
171
170
  return composerPinnedVersions[name]
@@ -345,9 +344,6 @@ async function main() {
345
344
  if (answer.mcp) {
346
345
  composerDependencies.push("php-mcp/server");
347
346
  }
348
- if (answer.websocket || answer.mcp) {
349
- npmDependencies.push(npmPkg("chokidar-cli"));
350
- }
351
347
  if (answer.prisma) {
352
348
  execSync("npm install -g prisma-client-php", { stdio: "inherit" });
353
349
  }
@@ -542,11 +538,6 @@ async function main() {
542
538
  updateUninstallComposerDependencies.push("php-mcp/server");
543
539
  }
544
540
  }
545
- // Uninstall chokidar-cli only if NEITHER feature needs it
546
- const needsChokidar = !!(updateAnswer.websocket || updateAnswer.mcp);
547
- if (!needsChokidar && isNpmPackageInstalled("chokidar-cli")) {
548
- updateUninstallNpmDependencies.push("chokidar-cli");
549
- }
550
541
  if (!updateAnswer.prisma) {
551
542
  const prismaPackages = [
552
543
  "prisma",
@@ -12,6 +12,9 @@ final class AuthMiddleware
12
12
  {
13
13
  public static function handle($requestPathname)
14
14
  {
15
+ $singInRoute = "/signin";
16
+ $deniedRoute = "/denied";
17
+
15
18
  if (AuthConfig::IS_ALL_ROUTES_PRIVATE) {
16
19
  $isLogin = Auth::getInstance()->isAuthenticated();
17
20
  $isApiAuthRoute = stripos($requestPathname, AuthConfig::API_AUTH_PREFIX) === 0;
@@ -42,7 +45,7 @@ final class AuthMiddleware
42
45
 
43
46
  // Redirect to the default home route if the user is already authenticated
44
47
  if (!$isLogin && !$isPublicRoute) {
45
- Request::redirect("/signin");
48
+ Request::redirect($singInRoute);
46
49
  }
47
50
  } else {
48
51
  // Skip the middleware if the route is public
@@ -52,7 +55,7 @@ final class AuthMiddleware
52
55
 
53
56
  // Check if the user is authorized to access the route or redirect to login
54
57
  if (!self::isAuthorized()) {
55
- Request::redirect('/signin');
58
+ Request::redirect($singInRoute);
56
59
  }
57
60
  }
58
61
 
@@ -65,7 +68,7 @@ final class AuthMiddleware
65
68
  // echo "You are authorized to access this route";
66
69
  } elseif ($matchValue === "Role mismatch") {
67
70
  // echo "You are not authorized to access this route";
68
- Request::redirect('/denied');
71
+ Request::redirect($deniedRoute);
69
72
  } else {
70
73
  // echo "Unexpected error encountered";
71
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "4.0.0-alpha.23",
3
+ "version": "4.0.0-alpha.25",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",