baraqex 1.0.76 → 2.0.0

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 (182) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +268 -315
  3. package/bin/baraqex.js +150 -12
  4. package/dist/browser.d.ts +1 -1
  5. package/dist/browser.d.ts.map +1 -1
  6. package/dist/browser.js +2319 -205
  7. package/dist/browser.js.map +4 -4
  8. package/dist/core/batch.d.ts +10 -0
  9. package/dist/core/batch.d.ts.map +1 -0
  10. package/dist/core/component.d.ts +69 -0
  11. package/dist/core/component.d.ts.map +1 -0
  12. package/dist/core/context.d.ts +22 -0
  13. package/dist/core/context.d.ts.map +1 -0
  14. package/dist/core/errors.d.ts +125 -0
  15. package/dist/core/errors.d.ts.map +1 -0
  16. package/dist/core/event-bus.d.ts +29 -0
  17. package/dist/core/event-bus.d.ts.map +1 -0
  18. package/dist/core/forms.d.ts +128 -0
  19. package/dist/core/forms.d.ts.map +1 -0
  20. package/dist/core/hooks.d.ts +84 -0
  21. package/dist/core/hooks.d.ts.map +1 -0
  22. package/dist/core/index.d.ts +23 -0
  23. package/dist/core/index.d.ts.map +1 -0
  24. package/dist/core/jsx-runtime.d.ts +45 -0
  25. package/dist/core/jsx-runtime.d.ts.map +1 -0
  26. package/dist/core/lifecycle-events.d.ts +71 -0
  27. package/dist/core/lifecycle-events.d.ts.map +1 -0
  28. package/dist/core/renderer.d.ts +39 -0
  29. package/dist/core/renderer.d.ts.map +1 -0
  30. package/dist/core/router.d.ts +108 -0
  31. package/dist/core/router.d.ts.map +1 -0
  32. package/dist/core/server-renderer.d.ts +26 -0
  33. package/dist/core/server-renderer.d.ts.map +1 -0
  34. package/dist/core/store.d.ts +102 -0
  35. package/dist/core/store.d.ts.map +1 -0
  36. package/dist/core/types.d.ts +66 -0
  37. package/dist/core/types.d.ts.map +1 -0
  38. package/dist/core/utils.d.ts +153 -0
  39. package/dist/core/utils.d.ts.map +1 -0
  40. package/dist/core/vdom.d.ts +29 -0
  41. package/dist/core/vdom.d.ts.map +1 -0
  42. package/dist/index.d.ts +39 -35
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +2592 -508
  45. package/dist/index.js.map +4 -4
  46. package/dist/server/auth.d.ts +8 -3
  47. package/dist/server/auth.d.ts.map +1 -1
  48. package/dist/server/index.d.ts +2 -2
  49. package/dist/server/index.d.ts.map +1 -1
  50. package/dist/server/index.js +173 -112
  51. package/dist/server/index.js.map +4 -4
  52. package/dist/server/middleware.d.ts +10 -1
  53. package/dist/server/middleware.d.ts.map +1 -1
  54. package/package.json +224 -124
  55. package/templates/basic-app/src/main.jsx +336 -0
  56. package/templates/complete-app/api/hello.js +0 -0
  57. package/templates/complete-app/client.js +58 -0
  58. package/templates/complete-app/lib/frontend-hamroun.js +182 -0
  59. package/templates/complete-app/package.json +18 -0
  60. package/templates/complete-app/pages/about.js +119 -0
  61. package/templates/complete-app/pages/about.jsx +0 -0
  62. package/templates/complete-app/pages/index.js +157 -0
  63. package/templates/complete-app/pages/index.jsx +0 -0
  64. package/templates/complete-app/pages/wasm-demo.js +290 -0
  65. package/templates/complete-app/pages/wasm-demo.jsx +0 -0
  66. package/templates/complete-app/public/client.js +89 -0
  67. package/templates/complete-app/public/index.html +118 -0
  68. package/templates/complete-app/public/styles.css +76 -0
  69. package/templates/complete-app/readme.md +188 -0
  70. package/templates/complete-app/server.js +226 -0
  71. package/templates/complete-app/server.ts +275 -0
  72. package/templates/complete-app/src/App.tsx +59 -0
  73. package/templates/complete-app/src/client.ts +61 -0
  74. package/templates/complete-app/src/client.tsx +18 -0
  75. package/templates/complete-app/src/pages/index.tsx +51 -0
  76. package/templates/complete-app/src/server.ts +218 -0
  77. package/templates/complete-app/tsconfig.json +22 -0
  78. package/templates/complete-app/tsconfig.server.json +19 -0
  79. package/templates/complete-app/vite.config.js +57 -0
  80. package/templates/complete-app/vite.config.ts +30 -0
  81. package/templates/complete-app/wasm/build.bat +0 -0
  82. package/templates/complete-app/wasm/build.sh +0 -0
  83. package/templates/complete-app/wasm/example.go +0 -0
  84. package/templates/fullstack-app/README.md +37 -0
  85. package/templates/fullstack-app/api/hello.js +11 -0
  86. package/templates/fullstack-app/api/hello.ts +18 -0
  87. package/templates/fullstack-app/api/users/[id].ts +73 -0
  88. package/templates/fullstack-app/api/users/index.ts +32 -0
  89. package/templates/fullstack-app/build/main.css +874 -0
  90. package/templates/fullstack-app/build/main.css.map +7 -0
  91. package/templates/fullstack-app/build/main.js +967 -0
  92. package/templates/fullstack-app/build/main.js.map +7 -0
  93. package/templates/fullstack-app/build.ts +210 -0
  94. package/templates/fullstack-app/index.html +36 -0
  95. package/templates/fullstack-app/package.json +35 -0
  96. package/templates/fullstack-app/postcss.config.js +6 -0
  97. package/templates/fullstack-app/process-tailwind.js +45 -0
  98. package/templates/fullstack-app/public/_redirects +1 -0
  99. package/templates/fullstack-app/public/route-handler.js +47 -0
  100. package/templates/fullstack-app/public/spa-fix.html +17 -0
  101. package/templates/fullstack-app/public/styles.css +975 -0
  102. package/templates/fullstack-app/public/tailwind.css +15 -0
  103. package/templates/fullstack-app/server.js +267 -0
  104. package/templates/fullstack-app/server.ts +474 -0
  105. package/templates/fullstack-app/src/README.md +55 -0
  106. package/templates/fullstack-app/src/client.js +87 -0
  107. package/templates/fullstack-app/src/components/ClientHome.tsx +0 -0
  108. package/templates/fullstack-app/src/components/ErrorBoundary.tsx +36 -0
  109. package/templates/fullstack-app/src/components/Layout.tsx +42 -0
  110. package/templates/fullstack-app/src/components/StateDemo.tsx +207 -0
  111. package/templates/fullstack-app/src/components/UserList.tsx +44 -0
  112. package/templates/fullstack-app/src/config.ts +42 -0
  113. package/templates/fullstack-app/src/data/api.ts +206 -0
  114. package/templates/fullstack-app/src/main.tsx +155 -0
  115. package/templates/fullstack-app/src/middleware.ts +28 -0
  116. package/templates/fullstack-app/src/pages/404.tsx +28 -0
  117. package/templates/fullstack-app/src/pages/[id].tsx +0 -0
  118. package/templates/fullstack-app/src/pages/_app.tsx +11 -0
  119. package/templates/fullstack-app/src/pages/_document.tsx +25 -0
  120. package/templates/fullstack-app/src/pages/_error.tsx +45 -0
  121. package/templates/fullstack-app/src/pages/about/index.tsx +67 -0
  122. package/templates/fullstack-app/src/pages/about.tsx +71 -0
  123. package/templates/fullstack-app/src/pages/api/users/[id].ts +73 -0
  124. package/templates/fullstack-app/src/pages/api/users/index.ts +43 -0
  125. package/templates/fullstack-app/src/pages/index.tsx +110 -0
  126. package/templates/fullstack-app/src/pages/users/[id].tsx +153 -0
  127. package/templates/fullstack-app/src/pages/users.tsx +60 -0
  128. package/templates/fullstack-app/src/pages/wasm-demo.tsx +1 -0
  129. package/templates/fullstack-app/src/router.ts +255 -0
  130. package/templates/fullstack-app/src/styles.css +5 -0
  131. package/templates/fullstack-app/tailwind.config.js +11 -0
  132. package/templates/fullstack-app/tsconfig.json +18 -0
  133. package/templates/fullstack-app/vite.config.js +87 -0
  134. package/templates/go/build.bat +36 -0
  135. package/templates/go/build.sh +43 -0
  136. package/templates/go/example.go +205 -0
  137. package/templates/go-wasm-app/README.md +38 -0
  138. package/templates/go-wasm-app/babel.config.js +21 -0
  139. package/templates/go-wasm-app/build-client.js +49 -0
  140. package/templates/go-wasm-app/build-wasm.js +237 -0
  141. package/templates/go-wasm-app/build.config.js +62 -0
  142. package/templates/go-wasm-app/build.js +218 -0
  143. package/templates/go-wasm-app/package.json +32 -0
  144. package/templates/go-wasm-app/public/index.html +128 -0
  145. package/templates/go-wasm-app/public/styles.css +197 -0
  146. package/templates/go-wasm-app/public/wasm/example.wasm +0 -0
  147. package/templates/go-wasm-app/public/wasm/wasm_exec.js +561 -0
  148. package/templates/go-wasm-app/public/wasm/wasm_exec_node.js +39 -0
  149. package/templates/go-wasm-app/server.js +70 -0
  150. package/templates/go-wasm-app/src/App.jsx +38 -0
  151. package/templates/go-wasm-app/src/app.js +173 -0
  152. package/templates/go-wasm-app/src/client.js +57 -0
  153. package/templates/go-wasm-app/src/components/Footer.jsx +13 -0
  154. package/templates/go-wasm-app/src/components/Header.jsx +19 -0
  155. package/templates/go-wasm-app/src/components/WasmDemo.jsx +120 -0
  156. package/templates/go-wasm-app/src/main.jsx +12 -0
  157. package/templates/go-wasm-app/src/wasm/example.go +75 -0
  158. package/templates/go-wasm-app/tsconfig.server.json +18 -0
  159. package/templates/go-wasm-app/vite.config.js +45 -0
  160. package/dist/forms/index.d.ts +0 -2
  161. package/dist/forms/index.d.ts.map +0 -1
  162. package/dist/forms/types.d.ts +0 -2
  163. package/dist/forms/types.d.ts.map +0 -1
  164. package/dist/frontend/components/WasmLoader.d.ts +0 -2
  165. package/dist/frontend/components/WasmLoader.d.ts.map +0 -1
  166. package/dist/frontend/hooks/useWasm.d.ts +0 -2
  167. package/dist/frontend/hooks/useWasm.d.ts.map +0 -1
  168. package/dist/frontend/index.d.ts +0 -2
  169. package/dist/frontend/index.d.ts.map +0 -1
  170. package/dist/router/index.d.ts +0 -2
  171. package/dist/router/index.d.ts.map +0 -1
  172. package/dist/router/types.d.ts +0 -2
  173. package/dist/router/types.d.ts.map +0 -1
  174. package/dist/store/index.d.ts +0 -2
  175. package/dist/store/index.d.ts.map +0 -1
  176. package/dist/store/types.d.ts +0 -2
  177. package/dist/store/types.d.ts.map +0 -1
  178. package/templates/basic-app/package-lock.json +0 -7173
  179. package/templates/fullstack-template/package-lock.json +0 -3558
  180. package/templates/ssr-template/package-lock.json +0 -5380
  181. package/templates/wasm/package-lock.json +0 -5347
  182. package/templates/wasm/public/example.wasm +0 -0
package/package.json CHANGED
@@ -1,124 +1,224 @@
1
- {
2
- "name": "baraqex",
3
- "version": "1.0.76",
4
- "description": "A powerful full-stack framework for modern web development",
5
- "main": "dist/index.js",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "type": "module",
9
- "exports": {
10
- ".": {
11
- "browser": "./dist/browser.js",
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.cjs",
14
- "types": "./dist/index.d.ts"
15
- },
16
- "./browser": {
17
- "import": "./dist/browser.js",
18
- "types": "./dist/browser.d.ts"
19
- },
20
- "./server": {
21
- "import": "./dist/server.js",
22
- "types": "./dist/server.d.ts"
23
- }
24
- },
25
- "browser": {
26
- "./dist/index.js": "./dist/browser.js",
27
- "crypto": false,
28
- "fs": false,
29
- "path": false,
30
- "http": false,
31
- "https": false,
32
- "express": false,
33
- "cors": false,
34
- "mongodb": false,
35
- "mysql2": false,
36
- "pg": false,
37
- "bcryptjs": false,
38
- "jsonwebtoken": false
39
- },
40
- "files": [
41
- "dist/",
42
- "templates/",
43
- "bin/",
44
- "README.md"
45
- ],
46
- "bin": {
47
- "baraqex": "./bin/baraqex.js"
48
- },
49
- "scripts": {
50
- "build": "npm run clean && npm run build:esm",
51
- "build:types": "tsc --emitDeclarationOnly",
52
- "build:esm": "node build.mjs",
53
- "clean": "rimraf dist",
54
- "test": "jest",
55
- "dev": "tsc --watch",
56
- "prepublishOnly": "npm run build"
57
- },
58
- "keywords": [
59
- "framework",
60
- "frontend",
61
- "backend",
62
- "fullstack",
63
- "react",
64
- "ssr",
65
- "wasm",
66
- "go"
67
- ],
68
- "author": "Mohamed X",
69
- "license": "MIT",
70
- "dependencies": {
71
- "chokidar": "^4.0.3",
72
- "frontend-hamroun": "^1.2.35",
73
- "glob": "^11.0.2",
74
- "open": "^10.1.2",
75
- "ws": "^8.18.2"
76
- },
77
- "peerDependencies": {
78
- "cors": "^2.8.5",
79
- "express": "^4.18.0"
80
- },
81
- "peerDependenciesMeta": {
82
- "express": {
83
- "optional": true
84
- },
85
- "cors": {
86
- "optional": true
87
- },
88
- "mongodb": {
89
- "optional": true
90
- },
91
- "mysql2": {
92
- "optional": true
93
- },
94
- "pg": {
95
- "optional": true
96
- },
97
- "bcryptjs": {
98
- "optional": true
99
- },
100
- "jsonwebtoken": {
101
- "optional": true
102
- }
103
- },
104
- "devDependencies": {
105
- "@types/bcryptjs": "^2.4.6",
106
- "@types/cors": "^2.8.18",
107
- "@types/express": "^5.0.2",
108
- "@types/node": "^20.0.0",
109
- "@types/pg": "^8.15.4",
110
- "esbuild": "^0.19.0",
111
- "jest": "^29.0.0",
112
- "rimraf": "^5.0.0",
113
- "typescript": "^5.0.0"
114
- },
115
- "optionalDependencies": {
116
- "bcryptjs": "^2.4.3",
117
- "cors": "^2.8.5",
118
- "express": "^4.18.0",
119
- "jsonwebtoken": "^9.0.0",
120
- "mongodb": "^6.0.0",
121
- "mysql2": "^3.6.0",
122
- "pg": "^8.11.0"
123
- }
124
- }
1
+ {
2
+ "name": "baraqex",
3
+ "version": "2.0.0",
4
+ "description": "A full-stack WebAssembly framework for building fast, modern web applications.",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "browser": "./dist/browser.js",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs",
14
+ "types": "./dist/index.d.ts"
15
+ },
16
+ "./browser": {
17
+ "import": "./dist/browser.js",
18
+ "types": "./dist/browser.d.ts"
19
+ },
20
+ "./server": {
21
+ "node": "./dist/server/index.js",
22
+ "import": "./dist/server/index.js",
23
+ "types": "./dist/server/index.d.ts"
24
+ },
25
+ "./server/database": {
26
+ "import": "./dist/server/database.js",
27
+ "types": "./dist/server/database.d.ts"
28
+ },
29
+ "./server/auth": {
30
+ "import": "./dist/server/auth.js",
31
+ "types": "./dist/server/auth.d.ts"
32
+ },
33
+ "./server/middleware": {
34
+ "import": "./dist/server/middleware.js",
35
+ "types": "./dist/server/middleware.d.ts"
36
+ },
37
+ "./server/api-router": {
38
+ "import": "./dist/server/api-router.js",
39
+ "types": "./dist/server/api-router.d.ts"
40
+ },
41
+ "./wasm": {
42
+ "import": "./dist/wasm.js",
43
+ "types": "./dist/wasm.d.ts"
44
+ },
45
+ "./server/wasm": {
46
+ "import": "./dist/server/wasm.js",
47
+ "types": "./dist/server/wasm.d.ts"
48
+ },
49
+ "./jsx-runtime": {
50
+ "import": "./dist/jsx-runtime.js",
51
+ "types": "./dist/jsx-runtime.d.ts"
52
+ },
53
+ "./hooks": {
54
+ "import": "./dist/hooks.js",
55
+ "types": "./dist/hooks.d.ts"
56
+ },
57
+ "./router": {
58
+ "import": "./dist/router.js",
59
+ "types": "./dist/router.d.ts"
60
+ },
61
+ "./store": {
62
+ "import": "./dist/store.js",
63
+ "types": "./dist/store.d.ts"
64
+ },
65
+ "./forms": {
66
+ "import": "./dist/forms.js",
67
+ "types": "./dist/forms.d.ts"
68
+ },
69
+ "./package.json": "./package.json"
70
+ },
71
+ "browser": {
72
+ "./dist/index.js": "./dist/browser.js",
73
+ "crypto": false,
74
+ "fs": false,
75
+ "path": false,
76
+ "http": false,
77
+ "https": false,
78
+ "express": false,
79
+ "cors": false,
80
+ "mongodb": false,
81
+ "mysql2": false,
82
+ "pg": false,
83
+ "bcryptjs": false,
84
+ "jsonwebtoken": false
85
+ },
86
+ "sideEffects": false,
87
+ "files": [
88
+ "dist/",
89
+ "bin/",
90
+ "README.md",
91
+ "LICENSE",
92
+ "CHANGELOG.md",
93
+ "templates/basic-app/",
94
+ "templates/fullstack-template/",
95
+ "templates/fullstack-app/",
96
+ "templates/ssr-template/",
97
+ "templates/wasm/",
98
+ "templates/complete-app/",
99
+ "templates/go-wasm-app/",
100
+ "templates/go/",
101
+ "!templates/**/node_modules/",
102
+ "!templates/**/dist/",
103
+ "!templates/**/package-lock.json",
104
+ "!templates/wasm/public/*.wasm"
105
+ ],
106
+ "bin": {
107
+ "baraqex": "./bin/baraqex.js"
108
+ },
109
+ "scripts": {
110
+ "build": "npm run clean && npm run build:esm && npm run build:types",
111
+ "build:types": "tsc --emitDeclarationOnly",
112
+ "build:esm": "node build.mjs",
113
+ "clean": "rimraf dist",
114
+ "test": "jest",
115
+ "test:unit": "jest tests/server --coverage",
116
+ "test:integration": "jest tests/server/integration.test.ts",
117
+ "test:coverage": "jest --coverage",
118
+ "test:coverage:report": "jest --coverage && start coverage/lcov-report/index.html",
119
+ "test:watch": "jest --watch",
120
+ "test:benchmarks": "jest benchmarks --verbose",
121
+ "test:ci": "jest --coverage --ci --reporters=default --reporters=jest-junit",
122
+ "lint": "eslint src --ext .ts,.tsx",
123
+ "lint:fix": "eslint src --ext .ts,.tsx --fix",
124
+ "typecheck": "tsc --noEmit",
125
+ "dev": "tsc --watch",
126
+ "prepublishOnly": "npm run test && npm run build",
127
+ "prepare": "npm run build",
128
+ "release": "npm run test && npm run build && npm publish",
129
+ "release:beta": "npm run test && npm run build && npm publish --tag beta",
130
+ "docs": "typedoc --out docs src/index.ts",
131
+ "size": "size-limit",
132
+ "benchmark": "jest benchmarks --verbose"
133
+ },
134
+ "keywords": [
135
+ "baraqex",
136
+ "framework",
137
+ "fullstack",
138
+ "frontend",
139
+ "backend",
140
+ "jsx",
141
+ "ssr",
142
+ "server-side-rendering",
143
+ "wasm",
144
+ "webassembly",
145
+ "go",
146
+ "golang",
147
+ "typescript",
148
+ "javascript",
149
+ "express",
150
+ "api",
151
+ "rest",
152
+ "web",
153
+ "app",
154
+ "universal",
155
+ "isomorphic",
156
+ "virtual-dom",
157
+ "hooks",
158
+ "react"
159
+ ],
160
+ "author": {
161
+ "name": "Mohamed X",
162
+ "url": "https://github.com/mohamedx2"
163
+ },
164
+ "license": "MIT",
165
+ "repository": {
166
+ "type": "git",
167
+ "url": "git+https://github.com/mohamedx2/baraqex.git"
168
+ },
169
+ "bugs": {
170
+ "url": "https://github.com/mohamedx2/baraqex/issues"
171
+ },
172
+ "homepage": "https://www.baraqex.tech",
173
+ "funding": {
174
+ "type": "github",
175
+ "url": "https://github.com/sponsors/mohamedx2"
176
+ },
177
+ "engines": {
178
+ "node": ">=18.0.0",
179
+ "npm": ">=8.0.0"
180
+ },
181
+ "dependencies": {
182
+ "bcryptjs": "^2.4.3",
183
+ "boxen": "^7.1.1",
184
+ "chalk": "^5.3.0",
185
+ "chokidar": "^4.0.3",
186
+ "commander": "^11.0.0",
187
+ "cors": "^2.8.5",
188
+ "express": "^4.18.2",
189
+ "figlet": "^1.7.0",
190
+ "fs-extra": "^11.1.1",
191
+ "glob": "^11.0.2",
192
+ "gradient-string": "^3.0.0",
193
+ "inquirer": "^9.2.10",
194
+ "jsonwebtoken": "^9.0.2",
195
+ "mongodb": "^5.7.0",
196
+ "mysql2": "^3.6.1",
197
+ "nanospinner": "^1.1.0",
198
+ "open": "^10.1.2",
199
+ "ora": "^7.0.1",
200
+ "pg": "^8.11.3",
201
+ "terminal-link": "^3.0.0",
202
+ "update-notifier": "^6.0.2",
203
+ "ws": "^8.18.2"
204
+ },
205
+ "peerDependencies": {},
206
+ "peerDependenciesMeta": {},
207
+ "devDependencies": {
208
+ "@jest/globals": "^30.2.0",
209
+ "@types/bcryptjs": "^2.4.6",
210
+ "@types/cors": "^2.8.18",
211
+ "@types/express": "^5.0.2",
212
+ "@types/jest": "^30.0.0",
213
+ "@types/jsonwebtoken": "^9.0.10",
214
+ "@types/node": "^20.0.0",
215
+ "@types/pg": "^8.15.4",
216
+ "@types/supertest": "^6.0.3",
217
+ "esbuild": "^0.19.0",
218
+ "jest": "^29.7.0",
219
+ "rimraf": "^5.0.0",
220
+ "supertest": "^7.2.2",
221
+ "ts-jest": "^29.4.6",
222
+ "typescript": "^5.9.3"
223
+ }
224
+ }