create-prisma-php-app 5.1.0-alpha.3 → 5.1.0-alpha.30

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 (41) hide show
  1. package/README.md +23 -2
  2. package/dist/.github/copilot-instructions.md +80 -33
  3. package/dist/AGENTS.md +59 -25
  4. package/dist/bootstrap.php +207 -187
  5. package/dist/index.js +2 -2
  6. package/dist/phpunit.xml +25 -0
  7. package/dist/postcss.config.js +4 -2
  8. package/dist/public/.htaccess +1 -1
  9. package/dist/public/js/pp-reactive-v2.min.js +1 -0
  10. package/dist/settings/bs-config.ts +44 -1
  11. package/dist/settings/run-postcss.ts +205 -0
  12. package/dist/settings/run-tests.ts +35 -0
  13. package/dist/src/Lib/Auth/Auth.php +12 -25
  14. package/dist/src/Lib/MCP/mcp-server.php +2 -3
  15. package/dist/src/Lib/Websocket/ConnectionManager.php +500 -47
  16. package/dist/src/Lib/Websocket/Socket.php +170 -0
  17. package/dist/src/Lib/Websocket/SocketPool.php +50 -0
  18. package/dist/src/Lib/Websocket/SocketRegistry.php +88 -0
  19. package/dist/src/Lib/Websocket/sockets.php +50 -0
  20. package/dist/src/Lib/Websocket/websocket-server.php +10 -3
  21. package/dist/src/app/globals.css +3 -1
  22. package/dist/src/app/layout.php +1 -1
  23. package/dist/tests/AuthTest.php +59 -0
  24. package/dist/tests/ConnectionManagerTest.php +277 -0
  25. package/dist/tests/CsrfTest.php +119 -0
  26. package/dist/tests/DeferComponentRootsTest.php +147 -0
  27. package/dist/tests/FeaturesTest.php +41 -0
  28. package/dist/tests/README.md +119 -0
  29. package/dist/tests/RpcWireContractTest.php +101 -0
  30. package/dist/tests/SocketPoolTest.php +69 -0
  31. package/dist/tests/SocketRegistryTest.php +77 -0
  32. package/dist/tests/SocketTest.php +124 -0
  33. package/dist/tests/SocketsRegistrationTest.php +40 -0
  34. package/dist/tests/Support/FakeConnection.php +62 -0
  35. package/dist/tests/Support/Features.php +38 -0
  36. package/dist/tests/Support/RequiresFeature.php +26 -0
  37. package/dist/tests/bootstrap.php +44 -0
  38. package/dist/ts/main.ts +5 -8
  39. package/dist/ts/tailwind-merge.ts +13 -0
  40. package/package.json +4 -4
  41. package/dist/public/js/pp-reactive-v2.js +0 -1
@@ -0,0 +1,44 @@
1
+ <?php
2
+
3
+ declare(strict_types=1);
4
+
5
+ /**
6
+ * Shared PHPUnit setup for the app-level test suite.
7
+ *
8
+ * Mirrors what the runtime gives app code — the composer autoloader and the
9
+ * path constants from `settings/paths.php` — without booting the framework:
10
+ * `bootstrap.php` (route resolution, CSRF cookie, rendering) is NOT loaded
11
+ * here, so tests exercise app classes directly.
12
+ *
13
+ * The real `.env` is deliberately NOT loaded. Tests run against deterministic
14
+ * environment defaults so the suite behaves the same on any machine and can
15
+ * never depend on (or leak) real secrets. Each default is only applied when
16
+ * the variable is not already set, so CI can still override.
17
+ */
18
+
19
+ require_once dirname(__DIR__) . '/vendor/autoload.php';
20
+ require_once dirname(__DIR__) . '/settings/paths.php';
21
+
22
+ // Keep the app in its non-production code paths during tests (dev origin
23
+ // relaxations, readable error messages).
24
+ if (getenv('APP_ENV') === false) {
25
+ putenv('APP_ENV=development');
26
+ $_ENV['APP_ENV'] = 'development';
27
+ }
28
+
29
+ // Deterministic secrets so Auth and Csrf construct without a real .env.
30
+ // HS256 requires at least 32 bytes of key material.
31
+ if (getenv('AUTH_SECRET') === false) {
32
+ putenv('AUTH_SECRET=test-secret-not-for-production-32bytes');
33
+ $_ENV['AUTH_SECRET'] = 'test-secret-not-for-production-32bytes';
34
+ }
35
+
36
+ if (getenv('FUNCTION_CALL_SECRET') === false) {
37
+ putenv('FUNCTION_CALL_SECRET=test-function-call-secret');
38
+ $_ENV['FUNCTION_CALL_SECRET'] = 'test-function-call-secret';
39
+ }
40
+
41
+ // Auth::signIn writes the session payload; give CLI tests a session store.
42
+ if (!isset($_SESSION)) {
43
+ $_SESSION = [];
44
+ }
package/dist/ts/main.ts CHANGED
@@ -11,17 +11,14 @@ import "/js/pp-reactive-v2.js";
11
11
 
12
12
  // createGlobalSingleton("myCustomFunction", myCustomFunction);
13
13
 
14
-
15
14
  // Imports goes here --End
16
15
 
17
16
  const pp = (globalThis as any).pp;
18
17
 
19
18
  if (document.readyState !== "loading") {
20
- pp?.mount?.();
19
+ pp?.mount?.();
21
20
  } else {
22
- document.addEventListener(
23
- "DOMContentLoaded",
24
- () => pp?.mount?.(),
25
- { once: true },
26
- );
27
- }
21
+ document.addEventListener("DOMContentLoaded", () => pp?.mount?.(), {
22
+ once: true,
23
+ });
24
+ }
@@ -0,0 +1,13 @@
1
+ import { twMerge } from "tailwind-merge";
2
+
3
+ export type MergeableClassName = string | false | null | undefined;
4
+
5
+ export function mergeTailwindClasses(
6
+ ...classNames: MergeableClassName[]
7
+ ): string {
8
+ return twMerge(
9
+ classNames
10
+ .filter((className): className is string => Boolean(className))
11
+ .join(" "),
12
+ );
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "5.1.0-alpha.3",
3
+ "version": "5.1.0-alpha.30",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -32,15 +32,15 @@
32
32
  "author": "Jefferson Abraham Omier <thesteelninjacode@gmail.com>",
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "chalk": "^5.6.2",
35
+ "chalk": "^6.0.0",
36
36
  "crypto-js": "^4.2.0",
37
37
  "prompts": "^2.4.2"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/crypto-js": "^4.2.2",
41
- "@types/node": "^25.0.3",
41
+ "@types/node": "^26.4.0",
42
42
  "@types/prompts": "^2.4.9",
43
43
  "ts-node": "^10.9.2",
44
- "typescript": "^5.9.3"
44
+ "typescript": "^7.0.2"
45
45
  }
46
46
  }