tina4-nodejs 3.0.0-rc.2

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 (119) hide show
  1. package/BENCHMARK_REPORT.md +96 -0
  2. package/CARBONAH.md +140 -0
  3. package/CLAUDE.md +599 -0
  4. package/COMPARISON.md +194 -0
  5. package/README.md +595 -0
  6. package/package.json +59 -0
  7. package/packages/cli/src/bin.ts +110 -0
  8. package/packages/cli/src/commands/init.ts +194 -0
  9. package/packages/cli/src/commands/migrate.ts +96 -0
  10. package/packages/cli/src/commands/migrateCreate.ts +59 -0
  11. package/packages/cli/src/commands/routes.ts +61 -0
  12. package/packages/cli/src/commands/serve.ts +58 -0
  13. package/packages/cli/src/commands/test.ts +83 -0
  14. package/packages/core/gallery/auth/meta.json +1 -0
  15. package/packages/core/gallery/auth/src/routes/api/gallery/auth/login/post.ts +22 -0
  16. package/packages/core/gallery/auth/src/routes/api/gallery/auth/verify/get.ts +16 -0
  17. package/packages/core/gallery/auth/src/routes/gallery/auth/get.ts +97 -0
  18. package/packages/core/gallery/database/meta.json +1 -0
  19. package/packages/core/gallery/database/src/routes/api/gallery/db/notes/get.ts +13 -0
  20. package/packages/core/gallery/database/src/routes/api/gallery/db/notes/post.ts +17 -0
  21. package/packages/core/gallery/database/src/routes/api/gallery/db/tables/get.ts +23 -0
  22. package/packages/core/gallery/error-overlay/meta.json +1 -0
  23. package/packages/core/gallery/error-overlay/src/routes/api/gallery/crash/get.ts +17 -0
  24. package/packages/core/gallery/orm/meta.json +1 -0
  25. package/packages/core/gallery/orm/src/routes/api/gallery/products/get.ts +12 -0
  26. package/packages/core/gallery/orm/src/routes/api/gallery/products/post.ts +7 -0
  27. package/packages/core/gallery/queue/meta.json +1 -0
  28. package/packages/core/gallery/queue/src/routes/api/gallery/queue/produce/post.ts +16 -0
  29. package/packages/core/gallery/queue/src/routes/api/gallery/queue/status/get.ts +10 -0
  30. package/packages/core/gallery/rest-api/meta.json +1 -0
  31. package/packages/core/gallery/rest-api/src/routes/api/gallery/hello/get.ts +6 -0
  32. package/packages/core/gallery/rest-api/src/routes/api/gallery/hello/post.ts +7 -0
  33. package/packages/core/gallery/templates/meta.json +1 -0
  34. package/packages/core/gallery/templates/src/routes/gallery/page/get.ts +15 -0
  35. package/packages/core/gallery/templates/src/templates/gallery_page.twig +257 -0
  36. package/packages/core/public/css/tina4.css +2463 -0
  37. package/packages/core/public/css/tina4.min.css +1 -0
  38. package/packages/core/public/favicon.ico +0 -0
  39. package/packages/core/public/images/logo.svg +5 -0
  40. package/packages/core/public/images/tina4-logo-icon.webp +0 -0
  41. package/packages/core/public/js/frond.min.js +420 -0
  42. package/packages/core/public/js/tina4-dev-admin.min.js +327 -0
  43. package/packages/core/public/js/tina4.min.js +93 -0
  44. package/packages/core/public/swagger/index.html +90 -0
  45. package/packages/core/public/swagger/oauth2-redirect.html +63 -0
  46. package/packages/core/src/ai.ts +359 -0
  47. package/packages/core/src/api.ts +248 -0
  48. package/packages/core/src/auth.ts +287 -0
  49. package/packages/core/src/cache.ts +121 -0
  50. package/packages/core/src/constants.ts +48 -0
  51. package/packages/core/src/container.ts +90 -0
  52. package/packages/core/src/devAdmin.ts +2024 -0
  53. package/packages/core/src/devMailbox.ts +316 -0
  54. package/packages/core/src/dotenv.ts +172 -0
  55. package/packages/core/src/errorOverlay.test.ts +122 -0
  56. package/packages/core/src/errorOverlay.ts +278 -0
  57. package/packages/core/src/events.ts +112 -0
  58. package/packages/core/src/fakeData.ts +309 -0
  59. package/packages/core/src/graphql.ts +812 -0
  60. package/packages/core/src/health.ts +31 -0
  61. package/packages/core/src/htmlElement.ts +172 -0
  62. package/packages/core/src/i18n.ts +136 -0
  63. package/packages/core/src/index.ts +88 -0
  64. package/packages/core/src/logger.ts +226 -0
  65. package/packages/core/src/messenger.ts +822 -0
  66. package/packages/core/src/middleware.ts +138 -0
  67. package/packages/core/src/queue.ts +481 -0
  68. package/packages/core/src/queueBackends/kafkaBackend.ts +348 -0
  69. package/packages/core/src/queueBackends/rabbitmqBackend.ts +479 -0
  70. package/packages/core/src/rateLimiter.ts +107 -0
  71. package/packages/core/src/request.ts +189 -0
  72. package/packages/core/src/response.ts +146 -0
  73. package/packages/core/src/routeDiscovery.ts +87 -0
  74. package/packages/core/src/router.ts +398 -0
  75. package/packages/core/src/scss.ts +366 -0
  76. package/packages/core/src/server.ts +610 -0
  77. package/packages/core/src/service.ts +380 -0
  78. package/packages/core/src/session.ts +480 -0
  79. package/packages/core/src/sessionHandlers/mongoHandler.ts +286 -0
  80. package/packages/core/src/sessionHandlers/valkeyHandler.ts +184 -0
  81. package/packages/core/src/static.ts +58 -0
  82. package/packages/core/src/testing.ts +233 -0
  83. package/packages/core/src/types.ts +98 -0
  84. package/packages/core/src/watcher.ts +37 -0
  85. package/packages/core/src/websocket.ts +408 -0
  86. package/packages/core/src/wsdl.ts +546 -0
  87. package/packages/core/templates/errors/302.twig +14 -0
  88. package/packages/core/templates/errors/401.twig +9 -0
  89. package/packages/core/templates/errors/403.twig +29 -0
  90. package/packages/core/templates/errors/404.twig +29 -0
  91. package/packages/core/templates/errors/500.twig +38 -0
  92. package/packages/core/templates/errors/502.twig +9 -0
  93. package/packages/core/templates/errors/503.twig +12 -0
  94. package/packages/core/templates/errors/base.twig +37 -0
  95. package/packages/frond/src/engine.ts +1475 -0
  96. package/packages/frond/src/index.ts +2 -0
  97. package/packages/orm/src/adapters/firebird.ts +455 -0
  98. package/packages/orm/src/adapters/mssql.ts +440 -0
  99. package/packages/orm/src/adapters/mysql.ts +355 -0
  100. package/packages/orm/src/adapters/postgres.ts +362 -0
  101. package/packages/orm/src/adapters/sqlite.ts +270 -0
  102. package/packages/orm/src/autoCrud.ts +231 -0
  103. package/packages/orm/src/baseModel.ts +536 -0
  104. package/packages/orm/src/database.ts +321 -0
  105. package/packages/orm/src/fakeData.ts +118 -0
  106. package/packages/orm/src/index.ts +49 -0
  107. package/packages/orm/src/migration.ts +392 -0
  108. package/packages/orm/src/model.ts +56 -0
  109. package/packages/orm/src/query.ts +113 -0
  110. package/packages/orm/src/seeder.ts +120 -0
  111. package/packages/orm/src/sqlTranslation.ts +272 -0
  112. package/packages/orm/src/types.ts +110 -0
  113. package/packages/orm/src/validation.ts +93 -0
  114. package/packages/swagger/src/generator.ts +189 -0
  115. package/packages/swagger/src/index.ts +2 -0
  116. package/packages/swagger/src/ui.ts +48 -0
  117. package/skills/tina4-developer.skill +0 -0
  118. package/skills/tina4-js.skill +0 -0
  119. package/skills/tina4-maintainer.skill +0 -0
package/COMPARISON.md ADDED
@@ -0,0 +1,194 @@
1
+ # Tina4 v3 — Framework Feature & Performance Report
2
+
3
+ **Date:** 2026-03-21 | **Goal:** Outperform the competition on features and close the performance gap
4
+
5
+ ---
6
+
7
+ ## Performance Benchmarks
8
+
9
+ ### Python — Tina4 vs Competition
10
+
11
+ Real HTTP benchmarks — identical JSON endpoint, 5000 requests, 50 concurrent.
12
+
13
+ | Framework | JSON req/s | 100-item list req/s | Server | Deps |
14
+ |-----------|:---------:|:-------------------:|--------|:----:|
15
+ | Starlette 0.52 | 16,202 | 7,351 | uvicorn (C) | 4 |
16
+ | FastAPI 0.115 | 11,855 | 2,476 | uvicorn (C) | 12+ |
17
+ | **Tina4 Python 3.0** | **8,316** | **5,688** | **built-in** | **0** |
18
+ | Bottle 0.13 | ~7,000 | ~5,000 | built-in | 0 |
19
+ | Flask 3.1 | 4,953 | 3,899 | Werkzeug | 6 |
20
+ | Django 5.2 | ~3,500 | ~2,800 | runserver | 20+ |
21
+
22
+ ### PHP — Tina4 vs Competition
23
+
24
+ | Framework | Typical JSON req/s | Deps |
25
+ |-----------|:-----------------:|:----:|
26
+ | Swoole (async) | ~30,000 | ext |
27
+ | Slim 4 | ~5,000 | 10+ |
28
+ | **Tina4 PHP 3.0** | **TBD** | **0** |
29
+ | Symfony 7 | ~2,500 | 30+ |
30
+ | Laravel 11 | ~2,000 | 50+ |
31
+ | CodeIgniter 4 | ~3,500 | 15+ |
32
+
33
+ ### Ruby — Tina4 vs Competition
34
+
35
+ | Framework | Typical JSON req/s | Deps |
36
+ |-----------|:-----------------:|:----:|
37
+ | Roda | ~15,000 | 1 |
38
+ | **Tina4 Ruby 3.0** | **TBD** | **0** |
39
+ | Sinatra 4 | ~4,000 | 5 |
40
+ | Hanami 2 | ~3,000 | 20+ |
41
+ | Rails 7 | ~1,500 | 40+ |
42
+
43
+ ### Node.js — Tina4 vs Competition
44
+
45
+ | Framework | Typical JSON req/s | Deps |
46
+ |-----------|:-----------------:|:----:|
47
+ | Fastify | ~50,000 | 10+ |
48
+ | Koa | ~20,000 | 5 |
49
+ | **Tina4 Node.js 3.0** | **TBD** | **0** |
50
+ | Express 5 | ~15,000 | 3 |
51
+ | NestJS | ~12,000 | 20+ |
52
+ | Hapi | ~10,000 | 5 |
53
+
54
+ **TBD benchmarks:** Run `tina4 serve` on each framework and benchmark with `hey`. Coming in rc.3.
55
+
56
+ ---
57
+
58
+ ## Out-of-Box Feature Comparison (38 features)
59
+
60
+ ✅ = ships with core install, no extra packages | ❌ = requires additional install
61
+
62
+ ### Python Frameworks
63
+
64
+ | Feature | Tina4 | Flask | FastAPI | Django | Starlette | Bottle |
65
+ |---------|:-----:|:-----:|:-------:|:------:|:---------:|:------:|
66
+ | **CORE WEB** | | | | | | |
67
+ | Routing (decorators) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
68
+ | Typed path parameters | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
69
+ | Middleware system | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
70
+ | Static file serving | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
71
+ | CORS built-in | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ |
72
+ | Rate limiting | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
73
+ | WebSocket | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ |
74
+ | **DATA** | | | | | | |
75
+ | ORM | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
76
+ | 5 database drivers | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
77
+ | Migrations | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
78
+ | Seeder / fake data | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
79
+ | Sessions | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
80
+ | Response caching | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
81
+ | **AUTH** | | | | | | |
82
+ | JWT built-in | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
83
+ | Password hashing | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
84
+ | CSRF protection | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
85
+ | **FRONTEND** | | | | | | |
86
+ | Template engine | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ |
87
+ | CSS framework | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
88
+ | SCSS compiler | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
89
+ | Frontend JS helpers | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
90
+ | **API** | | | | | | |
91
+ | Swagger/OpenAPI | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
92
+ | GraphQL | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
93
+ | SOAP/WSDL | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
94
+ | HTTP client | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
95
+ | Queue system | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
96
+ | **DEV EXPERIENCE** | | | | | | |
97
+ | CLI scaffolding | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
98
+ | Dev admin dashboard | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
99
+ | Error overlay | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
100
+ | Live reload | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
101
+ | Auto-CRUD generator | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
102
+ | Gallery / examples | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
103
+ | AI assistant context | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
104
+ | Inline testing | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
105
+ | **ARCHITECTURE** | | | | | | |
106
+ | Zero dependencies | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
107
+ | Dependency injection | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
108
+ | Event system | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ |
109
+ | i18n / translations | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ |
110
+ | HTML builder | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
111
+
112
+ ### Feature Count — Python
113
+
114
+ | Framework | Features | Deps | JSON req/s |
115
+ |-----------|:-------:|:----:|:---------:|
116
+ | **Tina4** | **38/38** | **0** | **8,316** |
117
+ | Django | 22/38 | 20+ | ~3,500 |
118
+ | Flask | 7/38 | 6 | 4,953 |
119
+ | FastAPI | 8/38 | 12+ | 11,855 |
120
+ | Starlette | 6/38 | 4 | 16,202 |
121
+ | Bottle | 5/38 | 0 | ~7,000 |
122
+
123
+ ### Cross-Language Feature Count
124
+
125
+ | Framework | Language | Features | Deps |
126
+ |-----------|---------|:-------:|:----:|
127
+ | **Tina4** | Python/PHP/Ruby/Node.js | **38/38** | **0** |
128
+ | Laravel | PHP | 25/38 | 50+ |
129
+ | Rails | Ruby | 24/38 | 40+ |
130
+ | Django | Python | 22/38 | 20+ |
131
+ | NestJS | Node.js | 16/38 | 20+ |
132
+ | FastAPI | Python | 8/38 | 12+ |
133
+ | Flask | Python | 7/38 | 6 |
134
+ | Starlette | Python | 6/38 | 4 |
135
+ | Bottle | Python | 5/38 | 0 |
136
+ | Express | Node.js | 4/38 | 3 |
137
+ | Sinatra | Ruby | 4/38 | 5 |
138
+
139
+ ---
140
+
141
+ ## Tina4 Performance Roadmap
142
+
143
+ ### v3.1 — Close the Gap
144
+ - [ ] Pre-compile Frond template expressions (target: 5x template rendering)
145
+ - [ ] Pre-compile regex in `_resolve()` and `_eval_expr()` (target: 3x variable lookup)
146
+ - [ ] Optional uvicorn/hypercorn detection for production (target: 16K+ req/s)
147
+ - [ ] Connection pooling for database adapters
148
+
149
+ ### v3.2 — Overtake
150
+ - [ ] Compiled template bytecode (match Jinja2 speed)
151
+ - [ ] HTTP/2 support in built-in server
152
+ - [ ] Response streaming for large payloads
153
+ - [ ] Worker process support (multi-core)
154
+
155
+ ### v3.3 — Lead
156
+ - [ ] HTTP/3 (QUIC) support
157
+ - [ ] gRPC built-in
158
+ - [ ] Edge runtime support (Cloudflare Workers, Deno Deploy)
159
+
160
+ ---
161
+
162
+ ## Deployment Size
163
+
164
+ | Framework | Core Size | With Deps | Competitors |
165
+ |-----------|:---------:|:---------:|------------|
166
+ | Tina4 Python | ~2.4 MB | 2.4 MB (0 deps) | Django 25 MB, Flask 4.2 MB |
167
+ | Tina4 PHP | ~1.0 MB | 1.0 MB (0 deps) | Laravel 50+ MB, Symfony 30+ MB |
168
+ | Tina4 Ruby | ~892 KB | 892 KB (0 deps) | Rails 40+ MB, Sinatra 5 MB |
169
+ | Tina4 Node.js | ~1.8 MB | 1.8 MB (0 deps) | Express 2 MB, NestJS 20+ MB |
170
+
171
+ Zero dependencies means core size **is** deployment size. No `node_modules` bloat, no `vendor/` sprawl, no `site-packages` explosion.
172
+
173
+ ---
174
+
175
+ ## Cross-Platform Support
176
+
177
+ All 4 Tina4 frameworks run on:
178
+
179
+ - **macOS** (Intel + Apple Silicon)
180
+ - **Linux** (x86_64 + ARM64)
181
+ - **Windows** (10/11)
182
+ - **Docker** (any base image with the language runtime)
183
+ - **WSL2**
184
+
185
+ No C extensions, no native binaries, no compile step required. Pure Python/PHP/Ruby/JavaScript.
186
+
187
+ ---
188
+
189
+ ## Notes
190
+
191
+ - Performance numbers are from development servers on Apple Silicon
192
+ - Production deployments with gunicorn/uvicorn/puma/php-fpm would be faster for all frameworks
193
+ - Tina4's competitive advantage is **features per dependency** — 38 features with 0 deps
194
+ - The zero-dep philosophy means Tina4 works anywhere Python/PHP/Ruby/Node.js runs — no compiler needed, no native extensions, no build step