@h3ravel/foundation 0.1.0-alpha.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.
@@ -0,0 +1,118 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>{{ statusCode || 500 }} | Something went wrong</title>
8
+ <style>
9
+ :root {
10
+ --primary-blue: #0970ce;
11
+ --dark-blue: #0359a9;
12
+ }
13
+
14
+ body {
15
+ margin: 0;
16
+ padding: 0;
17
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
18
+ background: #f5f6f7;
19
+ color: #111827;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ height: 100vh;
24
+ }
25
+
26
+ .error-container {
27
+ background: #fff;
28
+ border-radius: 10px;
29
+ padding: 40px;
30
+ text-align: center;
31
+ max-width: 420px;
32
+ width: 100%;
33
+ border: 1px solid #e5e7eb;
34
+ }
35
+
36
+ h1 {
37
+ font-size: 3rem;
38
+ margin: 0 0 10px;
39
+ color: var(--primary-blue);
40
+ }
41
+
42
+ p {
43
+ color: #4b5563;
44
+ margin: 10px 0 25px;
45
+ }
46
+
47
+ a {
48
+ display: inline-block;
49
+ padding: 10px 20px;
50
+ border-radius: 8px;
51
+ background: var(--primary-blue);
52
+ color: #fff;
53
+ text-decoration: none;
54
+ transition: background 0.2s ease;
55
+ }
56
+
57
+ a:hover {
58
+ background: var(--dark-blue);
59
+ }
60
+
61
+ .debug-section {
62
+ text-align: left;
63
+ margin-top: 30px;
64
+ padding: 20px;
65
+ background: #f9fafb;
66
+ border: 1px solid #e5e7eb;
67
+ border-radius: 8px;
68
+ overflow-x: auto;
69
+ }
70
+
71
+ .debug-section h2 {
72
+ color: var(--dark-blue);
73
+ margin-bottom: 10px;
74
+ }
75
+
76
+ pre {
77
+ background: #f3f4f6;
78
+ padding: 10px;
79
+ border-radius: 6px;
80
+ font-size: 0.85rem;
81
+ overflow-x: auto;
82
+ }
83
+
84
+ pre.details {
85
+ white-space: pre-wrap;
86
+ word-wrap: break-word;
87
+ }
88
+ </style>
89
+ </head>
90
+
91
+ <body>
92
+ <div class="error-container">
93
+ <h1>{{ statusCode || 500 }}</h1>
94
+ <h2>{{ statusText || 'Something went wrong' }}</h2>
95
+
96
+ @if(!debug)
97
+ <p>{{ message || 'An unexpected error occurred. Please try again later.' }}</p>
98
+ @endif
99
+
100
+ <p style="margin-top: 1.5rem;">
101
+ <a href="/">← Go back home</a>
102
+ </p>
103
+
104
+ @if(debug)
105
+ <div class="debug-section">
106
+ <h2>Error Details</h2>
107
+ <pre class="details">{{ exception?.message }}</pre>
108
+
109
+ @if(exception?.stack)
110
+ <h2>Stack Trace</h2>
111
+ <pre>{{ exception.stack }}</pre>
112
+ @endif
113
+ </div>
114
+ @endif
115
+ </div>
116
+ </body>
117
+
118
+ </html>
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@h3ravel/foundation",
3
+ "version": "0.1.0-alpha.1",
4
+ "description": "H3ravel Foundation for shared and reuseable services.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "types": "./dist/index.d.ts",
8
+ "module": "./dist/index.js",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.cjs"
13
+ },
14
+ "./*": "./*"
15
+ },
16
+ "typesVersions": {
17
+ "*": {
18
+ "*": [
19
+ "dist/index.d.ts"
20
+ ]
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "tsconfig.json"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "homepage": "https://h3ravel.toneflix.net",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/h3ravel/framework.git",
34
+ "directory": "packages/foundation"
35
+ },
36
+ "keywords": [
37
+ "h3ravel",
38
+ "modern",
39
+ "web",
40
+ "H3",
41
+ "framework",
42
+ "nodejs",
43
+ "typescript",
44
+ "laravel",
45
+ "Foundation",
46
+ "Illuminate"
47
+ ],
48
+ "devDependencies": {
49
+ "@types/supertest": "^6.0.3",
50
+ "supertest": "^7.1.4",
51
+ "@h3ravel/contracts": "^0.29.0-alpha.1"
52
+ },
53
+ "dependencies": {
54
+ "h3": "2.0.1-rc.5",
55
+ "@h3ravel/musket": "^0.6.10",
56
+ "@h3ravel/shared": "^0.29.0-alpha.1",
57
+ "@h3ravel/support": "^0.17.0-alpha.1"
58
+ },
59
+ "scripts": {
60
+ "build": "tsdown --config-loader unconfig",
61
+ "dev": "tsx watch src/index.ts",
62
+ "start": "node dist/index.js",
63
+ "lint": "eslint . --ext .ts",
64
+ "test": "jest --passWithNoTests",
65
+ "release:patch": "pnpm build && pnpm version patch && git add . && git commit -m \"version: bump foundation package and publish\" && pnpm publish --tag latest",
66
+ "version-patch": "pnpm version patch"
67
+ }
68
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist"
5
+ },
6
+ "exclude": ["dist", "node_modules"]
7
+ }