@buenojs/bueno 0.8.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.
- package/.env.example +109 -0
- package/.github/workflows/ci.yml +31 -0
- package/LICENSE +21 -0
- package/README.md +892 -0
- package/architecture.md +652 -0
- package/bun.lock +70 -0
- package/dist/cli/index.js +3233 -0
- package/dist/index.js +9014 -0
- package/package.json +77 -0
- package/src/cache/index.ts +795 -0
- package/src/cli/ARCHITECTURE.md +837 -0
- package/src/cli/bin.ts +10 -0
- package/src/cli/commands/build.ts +425 -0
- package/src/cli/commands/dev.ts +248 -0
- package/src/cli/commands/generate.ts +541 -0
- package/src/cli/commands/help.ts +55 -0
- package/src/cli/commands/index.ts +112 -0
- package/src/cli/commands/migration.ts +355 -0
- package/src/cli/commands/new.ts +804 -0
- package/src/cli/commands/start.ts +208 -0
- package/src/cli/core/args.ts +283 -0
- package/src/cli/core/console.ts +349 -0
- package/src/cli/core/index.ts +60 -0
- package/src/cli/core/prompt.ts +424 -0
- package/src/cli/core/spinner.ts +265 -0
- package/src/cli/index.ts +135 -0
- package/src/cli/templates/deploy.ts +295 -0
- package/src/cli/templates/docker.ts +307 -0
- package/src/cli/templates/index.ts +24 -0
- package/src/cli/utils/fs.ts +428 -0
- package/src/cli/utils/index.ts +8 -0
- package/src/cli/utils/strings.ts +197 -0
- package/src/config/env.ts +408 -0
- package/src/config/index.ts +506 -0
- package/src/config/loader.ts +329 -0
- package/src/config/merge.ts +285 -0
- package/src/config/types.ts +320 -0
- package/src/config/validation.ts +441 -0
- package/src/container/forward-ref.ts +143 -0
- package/src/container/index.ts +386 -0
- package/src/context/index.ts +360 -0
- package/src/database/index.ts +1142 -0
- package/src/database/migrations/index.ts +371 -0
- package/src/database/schema/index.ts +619 -0
- package/src/frontend/api-routes.ts +640 -0
- package/src/frontend/bundler.ts +643 -0
- package/src/frontend/console-client.ts +419 -0
- package/src/frontend/console-stream.ts +587 -0
- package/src/frontend/dev-server.ts +846 -0
- package/src/frontend/file-router.ts +611 -0
- package/src/frontend/frameworks/index.ts +106 -0
- package/src/frontend/frameworks/react.ts +85 -0
- package/src/frontend/frameworks/solid.ts +104 -0
- package/src/frontend/frameworks/svelte.ts +110 -0
- package/src/frontend/frameworks/vue.ts +92 -0
- package/src/frontend/hmr-client.ts +663 -0
- package/src/frontend/hmr.ts +728 -0
- package/src/frontend/index.ts +342 -0
- package/src/frontend/islands.ts +552 -0
- package/src/frontend/isr.ts +555 -0
- package/src/frontend/layout.ts +475 -0
- package/src/frontend/ssr/react.ts +446 -0
- package/src/frontend/ssr/solid.ts +523 -0
- package/src/frontend/ssr/svelte.ts +546 -0
- package/src/frontend/ssr/vue.ts +504 -0
- package/src/frontend/ssr.ts +699 -0
- package/src/frontend/types.ts +2274 -0
- package/src/health/index.ts +604 -0
- package/src/index.ts +410 -0
- package/src/lock/index.ts +587 -0
- package/src/logger/index.ts +444 -0
- package/src/logger/transports/index.ts +969 -0
- package/src/metrics/index.ts +494 -0
- package/src/middleware/built-in.ts +360 -0
- package/src/middleware/index.ts +94 -0
- package/src/modules/filters.ts +458 -0
- package/src/modules/guards.ts +405 -0
- package/src/modules/index.ts +1256 -0
- package/src/modules/interceptors.ts +574 -0
- package/src/modules/lazy.ts +418 -0
- package/src/modules/lifecycle.ts +478 -0
- package/src/modules/metadata.ts +90 -0
- package/src/modules/pipes.ts +626 -0
- package/src/router/index.ts +339 -0
- package/src/router/linear.ts +371 -0
- package/src/router/regex.ts +292 -0
- package/src/router/tree.ts +562 -0
- package/src/rpc/index.ts +1263 -0
- package/src/security/index.ts +436 -0
- package/src/ssg/index.ts +631 -0
- package/src/storage/index.ts +456 -0
- package/src/telemetry/index.ts +1097 -0
- package/src/testing/index.ts +1586 -0
- package/src/types/index.ts +236 -0
- package/src/types/optional-deps.d.ts +219 -0
- package/src/validation/index.ts +276 -0
- package/src/websocket/index.ts +1004 -0
- package/tests/integration/cli.test.ts +1016 -0
- package/tests/integration/fullstack.test.ts +234 -0
- package/tests/unit/cache.test.ts +174 -0
- package/tests/unit/cli-commands.test.ts +892 -0
- package/tests/unit/cli.test.ts +1258 -0
- package/tests/unit/container.test.ts +279 -0
- package/tests/unit/context.test.ts +221 -0
- package/tests/unit/database.test.ts +183 -0
- package/tests/unit/linear-router.test.ts +280 -0
- package/tests/unit/lock.test.ts +336 -0
- package/tests/unit/middleware.test.ts +184 -0
- package/tests/unit/modules.test.ts +142 -0
- package/tests/unit/pubsub.test.ts +257 -0
- package/tests/unit/regex-router.test.ts +265 -0
- package/tests/unit/router.test.ts +373 -0
- package/tests/unit/rpc.test.ts +1248 -0
- package/tests/unit/security.test.ts +174 -0
- package/tests/unit/telemetry.test.ts +371 -0
- package/tests/unit/test-cache.test.ts +110 -0
- package/tests/unit/test-database.test.ts +282 -0
- package/tests/unit/tree-router.test.ts +325 -0
- package/tests/unit/validation.test.ts +794 -0
- package/tsconfig.json +27 -0
package/.env.example
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Bueno Framework Environment Configuration
|
|
2
|
+
# Copy this file to .env and customize as needed
|
|
3
|
+
|
|
4
|
+
# ============= Server Configuration =============
|
|
5
|
+
# Server port (default: 3000)
|
|
6
|
+
BUENO_PORT=3000
|
|
7
|
+
# Server host (default: localhost)
|
|
8
|
+
BUENO_HOST=localhost
|
|
9
|
+
# Enable development mode (default: false)
|
|
10
|
+
BUENO_DEV=false
|
|
11
|
+
# Alternative: Standard PORT variable
|
|
12
|
+
# PORT=3000
|
|
13
|
+
# Alternative: Standard HOST variable
|
|
14
|
+
# HOST=localhost
|
|
15
|
+
|
|
16
|
+
# ============= Database Configuration =============
|
|
17
|
+
# Database connection URL (PostgreSQL, MySQL, or SQLite)
|
|
18
|
+
DATABASE_URL=postgres://user:password@localhost:5432/myapp
|
|
19
|
+
# Or use Bueno-specific variable
|
|
20
|
+
# BUENO_DATABASE_URL=postgres://user:password@localhost:5432/myapp
|
|
21
|
+
|
|
22
|
+
# Connection pool size (default: 10)
|
|
23
|
+
BUENO_DB_POOL_SIZE=10
|
|
24
|
+
|
|
25
|
+
# Enable database metrics (default: true)
|
|
26
|
+
BUENO_DB_METRICS=true
|
|
27
|
+
|
|
28
|
+
# Slow query threshold in milliseconds (default: 100)
|
|
29
|
+
BUENO_DB_SLOW_QUERY=100
|
|
30
|
+
|
|
31
|
+
# ============= Cache Configuration =============
|
|
32
|
+
# Redis connection URL (required if using Redis cache)
|
|
33
|
+
REDIS_URL=redis://localhost:6379
|
|
34
|
+
# Or use Bueno-specific variable
|
|
35
|
+
# BUENO_REDIS_URL=redis://localhost:6379
|
|
36
|
+
|
|
37
|
+
# Cache driver: "redis" or "memory" (default: memory)
|
|
38
|
+
BUENO_CACHE_DRIVER=memory
|
|
39
|
+
|
|
40
|
+
# Default TTL in seconds (default: 3600)
|
|
41
|
+
BUENO_CACHE_TTL=3600
|
|
42
|
+
|
|
43
|
+
# Key prefix for namespacing (default: "")
|
|
44
|
+
BUENO_CACHE_PREFIX=myapp:
|
|
45
|
+
|
|
46
|
+
# Enable cache metrics (default: true)
|
|
47
|
+
# BUENO_CACHE_METRICS=true
|
|
48
|
+
|
|
49
|
+
# ============= Logger Configuration =============
|
|
50
|
+
# Log level: debug, info, warn, error, fatal (default: info)
|
|
51
|
+
LOG_LEVEL=info
|
|
52
|
+
# Or use Bueno-specific variable
|
|
53
|
+
# BUENO_LOG_LEVEL=info
|
|
54
|
+
|
|
55
|
+
# Pretty print logs (default: true in development)
|
|
56
|
+
BUENO_LOG_PRETTY=true
|
|
57
|
+
|
|
58
|
+
# ============= Health Check Configuration =============
|
|
59
|
+
# Enable health check endpoints (default: true)
|
|
60
|
+
BUENO_HEALTH_ENABLED=true
|
|
61
|
+
|
|
62
|
+
# Health check endpoint path (default: /health)
|
|
63
|
+
BUENO_HEALTH_PATH=/health
|
|
64
|
+
|
|
65
|
+
# Readiness check endpoint path (default: /ready)
|
|
66
|
+
BUENO_READY_PATH=/ready
|
|
67
|
+
|
|
68
|
+
# ============= Metrics Configuration =============
|
|
69
|
+
# Enable metrics collection (default: true)
|
|
70
|
+
BUENO_METRICS_ENABLED=true
|
|
71
|
+
|
|
72
|
+
# Collection interval in milliseconds (default: 60000)
|
|
73
|
+
BUENO_METRICS_INTERVAL=60000
|
|
74
|
+
|
|
75
|
+
# ============= Telemetry Configuration =============
|
|
76
|
+
# Enable OpenTelemetry tracing (default: false)
|
|
77
|
+
BUENO_TELEMETRY_ENABLED=false
|
|
78
|
+
|
|
79
|
+
# Service name for tracing (default: bueno-app)
|
|
80
|
+
BUENO_SERVICE_NAME=my-bueno-app
|
|
81
|
+
|
|
82
|
+
# OTLP endpoint URL
|
|
83
|
+
BUENO_OTEL_ENDPOINT=http://localhost:4318
|
|
84
|
+
# Or use standard OTEL variable
|
|
85
|
+
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
|
|
86
|
+
|
|
87
|
+
# Sampling rate 0.0 to 1.0 (default: 1.0)
|
|
88
|
+
# BUENO_SAMPLE_RATE=1.0
|
|
89
|
+
|
|
90
|
+
# ============= Frontend Configuration =============
|
|
91
|
+
# Frontend dev server port (default: 3001)
|
|
92
|
+
BUENO_FRONTEND_PORT=3001
|
|
93
|
+
|
|
94
|
+
# Enable Hot Module Replacement (default: true)
|
|
95
|
+
BUENO_HMR=true
|
|
96
|
+
|
|
97
|
+
# ============= Security Configuration =============
|
|
98
|
+
# JWT secret for authentication
|
|
99
|
+
# JWT_SECRET=your-super-secret-key-here
|
|
100
|
+
|
|
101
|
+
# Session secret
|
|
102
|
+
# SESSION_SECRET=your-session-secret-here
|
|
103
|
+
|
|
104
|
+
# ============= Storage Configuration =============
|
|
105
|
+
# S3-compatible storage configuration
|
|
106
|
+
# AWS_ACCESS_KEY_ID=your-access-key
|
|
107
|
+
# AWS_SECRET_ACCESS_KEY=your-secret-key
|
|
108
|
+
# AWS_REGION=us-east-1
|
|
109
|
+
# S3_BUCKET=my-bucket
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Setup Bun
|
|
16
|
+
uses: oven-sh/setup-bun@v1
|
|
17
|
+
with:
|
|
18
|
+
bun-version: latest
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: bun install
|
|
22
|
+
|
|
23
|
+
- name: Run tests
|
|
24
|
+
run: bun test
|
|
25
|
+
|
|
26
|
+
- name: Upload coverage to Codecov
|
|
27
|
+
uses: codecov/codecov-action@v4
|
|
28
|
+
with:
|
|
29
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
30
|
+
files: ./coverage/coverage-final.json
|
|
31
|
+
fail_ci_if_error: false
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sivaraj D <sivarajd@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|