vector-framework 1.0.0 → 1.1.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.
- package/README.md +6 -5
- package/dist/cache/manager.d.ts +5 -2
- package/dist/cache/manager.d.ts.map +1 -1
- package/dist/cache/manager.js +21 -7
- package/dist/cache/manager.js.map +1 -1
- package/dist/cli/index.js +62 -83
- package/dist/cli/index.js.map +1 -1
- package/dist/cli.js +108 -37
- package/dist/core/config-loader.d.ts +2 -2
- package/dist/core/config-loader.d.ts.map +1 -1
- package/dist/core/config-loader.js +16 -18
- package/dist/core/config-loader.js.map +1 -1
- package/dist/core/router.d.ts +2 -0
- package/dist/core/router.d.ts.map +1 -1
- package/dist/core/router.js +52 -16
- package/dist/core/router.js.map +1 -1
- package/dist/core/server.d.ts +4 -3
- package/dist/core/server.d.ts.map +1 -1
- package/dist/core/server.js +39 -18
- package/dist/core/server.js.map +1 -1
- package/dist/core/vector.d.ts +7 -7
- package/dist/core/vector.d.ts.map +1 -1
- package/dist/core/vector.js +20 -21
- package/dist/core/vector.js.map +1 -1
- package/dist/dev/route-scanner.d.ts +1 -1
- package/dist/dev/route-scanner.d.ts.map +1 -1
- package/dist/dev/route-scanner.js +40 -42
- package/dist/dev/route-scanner.js.map +1 -1
- package/dist/http.d.ts +2 -2
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +70 -63
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/middleware/manager.d.ts +1 -1
- package/dist/middleware/manager.d.ts.map +1 -1
- package/dist/middleware/manager.js.map +1 -1
- package/dist/utils/path.d.ts +1 -0
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +9 -3
- package/dist/utils/path.js.map +1 -1
- package/package.json +12 -8
- package/src/cache/manager.ts +23 -14
- package/src/cli/index.ts +66 -89
- package/src/core/config-loader.ts +18 -20
- package/src/core/router.ts +52 -18
- package/src/core/server.ts +42 -28
- package/src/core/vector.ts +25 -35
- package/src/dev/route-scanner.ts +41 -47
- package/src/http.ts +82 -112
- package/src/index.ts +3 -3
- package/src/middleware/manager.ts +4 -11
- package/src/utils/path.ts +13 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Blazing fast, secure, and developer-friendly API framework for Bun**
|
|
4
4
|
|
|
5
|
-
- **
|
|
5
|
+
- **100,000+ requests/second** - Optimized for extreme performance
|
|
6
6
|
- **Single dependency** - Only itty-router, minimizing security risks
|
|
7
7
|
- **Zero build step** - Native TypeScript execution with Bun
|
|
8
8
|
- **Encore-like DX** - Declarative, type-safe APIs you'll love
|
|
@@ -254,7 +254,7 @@ export const example = route(
|
|
|
254
254
|
|
|
255
255
|
### Error Handling
|
|
256
256
|
|
|
257
|
-
Vector provides comprehensive error responses
|
|
257
|
+
Vector provides comprehensive error responses. Requests with a malformed URL are automatically rejected with a `400 Bad Request` before reaching your handler. Unhandled exceptions in handlers return a `500 Internal Server Error`.
|
|
258
258
|
|
|
259
259
|
```typescript
|
|
260
260
|
import { APIError } from "vector-framework";
|
|
@@ -445,7 +445,7 @@ Vector automatically discovers and loads route files from your `routesDir` (defa
|
|
|
445
445
|
- `*.interface.ts`, `*.type.ts` - Type definition files
|
|
446
446
|
- `*.d.ts` - TypeScript declaration files
|
|
447
447
|
|
|
448
|
-
You can customize the exclusion patterns using the `routeExcludePatterns` configuration option:
|
|
448
|
+
You can customize the exclusion patterns using the `routeExcludePatterns` configuration option. Both single-segment (`*`) and multi-segment (`**`) glob patterns are supported:
|
|
449
449
|
|
|
450
450
|
```typescript
|
|
451
451
|
// vector.config.ts
|
|
@@ -456,7 +456,8 @@ const config: VectorConfigSchema = {
|
|
|
456
456
|
"*.test.ts",
|
|
457
457
|
"*.spec.ts",
|
|
458
458
|
"*.mock.ts",
|
|
459
|
-
"
|
|
459
|
+
"**/__tests__/**", // Exclude any nested __tests__ directory
|
|
460
|
+
"_*.ts", // Exclude files starting with underscore
|
|
460
461
|
],
|
|
461
462
|
};
|
|
462
463
|
```
|
|
@@ -470,7 +471,7 @@ Vector achieves exceptional performance through:
|
|
|
470
471
|
- **Optimized Routing**: Efficient regex-based route matching
|
|
471
472
|
- **Smart Caching**: Built-in response caching with configurable TTL
|
|
472
473
|
|
|
473
|
-
Benchmarks show Vector handling **
|
|
474
|
+
Benchmarks show Vector handling **100,000+ requests/second** on standard hardware.
|
|
474
475
|
|
|
475
476
|
## Why Vector?
|
|
476
477
|
|
package/dist/cache/manager.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { CacheHandler, DefaultVectorTypes, GetCacheType, VectorTypes } from
|
|
1
|
+
import type { CacheHandler, DefaultVectorTypes, GetCacheType, VectorTypes } from '../types';
|
|
2
2
|
export declare class CacheManager<TTypes extends VectorTypes = DefaultVectorTypes> {
|
|
3
3
|
private cacheHandler;
|
|
4
4
|
private memoryCache;
|
|
5
5
|
private cleanupInterval;
|
|
6
|
+
private inflight;
|
|
6
7
|
setCacheHandler(handler: CacheHandler): void;
|
|
7
8
|
get<T = GetCacheType<TTypes>>(key: string, factory: () => Promise<T>, ttl?: number): Promise<T>;
|
|
8
9
|
private getFromMemoryCache;
|
|
@@ -14,7 +15,9 @@ export declare class CacheManager<TTypes extends VectorTypes = DefaultVectorType
|
|
|
14
15
|
set<T = GetCacheType<TTypes>>(key: string, value: T, ttl?: number): Promise<void>;
|
|
15
16
|
delete(key: string): boolean;
|
|
16
17
|
has(key: string): boolean;
|
|
17
|
-
generateKey(request: Request
|
|
18
|
+
generateKey(request: Request & {
|
|
19
|
+
_parsedUrl?: URL;
|
|
20
|
+
}, options?: {
|
|
18
21
|
authUser?: any;
|
|
19
22
|
}): string;
|
|
20
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/cache/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/cache/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAO5F,qBAAa,YAAY,CAAC,MAAM,SAAS,WAAW,GAAG,kBAAkB;IACvE,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,WAAW,CAAsC;IACzD,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,QAAQ,CAAwC;IAExD,eAAe,CAAC,OAAO,EAAE,YAAY;IAI/B,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,EAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,GAAG,GAAE,MAAiC,GACrC,OAAO,CAAC,CAAC,CAAC;YAYC,kBAAkB;IA+BhC,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,cAAc;IActB,KAAK,IAAI,IAAI;IAQP,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,EAChC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,GAAG,GAAE,MAAiC,GACrC,OAAO,CAAC,IAAI,CAAC;IAchB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAYzB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG;QAAE,UAAU,CAAC,EAAE,GAAG,CAAA;KAAE,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG,MAAM;CAW3F"}
|
package/dist/cache/manager.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DEFAULT_CONFIG } from
|
|
1
|
+
import { DEFAULT_CONFIG } from '../constants';
|
|
2
2
|
export class CacheManager {
|
|
3
3
|
cacheHandler = null;
|
|
4
4
|
memoryCache = new Map();
|
|
5
5
|
cleanupInterval = null;
|
|
6
|
+
inflight = new Map();
|
|
6
7
|
setCacheHandler(handler) {
|
|
7
8
|
this.cacheHandler = handler;
|
|
8
9
|
}
|
|
@@ -21,9 +22,22 @@ export class CacheManager {
|
|
|
21
22
|
if (this.isCacheValid(cached, now)) {
|
|
22
23
|
return cached.value;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
this.
|
|
26
|
-
|
|
25
|
+
// Deduplicate concurrent requests for the same key (cache stampede prevention)
|
|
26
|
+
if (this.inflight.has(key)) {
|
|
27
|
+
return (await this.inflight.get(key));
|
|
28
|
+
}
|
|
29
|
+
const promise = (async () => {
|
|
30
|
+
const value = await factory();
|
|
31
|
+
this.setInMemoryCache(key, value, ttl);
|
|
32
|
+
return value;
|
|
33
|
+
})();
|
|
34
|
+
this.inflight.set(key, promise);
|
|
35
|
+
try {
|
|
36
|
+
return await promise;
|
|
37
|
+
}
|
|
38
|
+
finally {
|
|
39
|
+
this.inflight.delete(key);
|
|
40
|
+
}
|
|
27
41
|
}
|
|
28
42
|
isCacheValid(entry, now) {
|
|
29
43
|
return entry !== undefined && entry.expires > now;
|
|
@@ -84,14 +98,14 @@ export class CacheManager {
|
|
|
84
98
|
return true;
|
|
85
99
|
}
|
|
86
100
|
generateKey(request, options) {
|
|
87
|
-
const url = new URL(request.url);
|
|
101
|
+
const url = request._parsedUrl ?? new URL(request.url);
|
|
88
102
|
const parts = [
|
|
89
103
|
request.method,
|
|
90
104
|
url.pathname,
|
|
91
105
|
url.search,
|
|
92
|
-
options?.authUser?.id
|
|
106
|
+
options?.authUser?.id != null ? String(options.authUser.id) : 'anonymous',
|
|
93
107
|
];
|
|
94
|
-
return parts.join(
|
|
108
|
+
return parts.join(':');
|
|
95
109
|
}
|
|
96
110
|
}
|
|
97
111
|
//# sourceMappingURL=manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/cache/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/cache/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQ9C,MAAM,OAAO,YAAY;IACf,YAAY,GAAwB,IAAI,CAAC;IACzC,WAAW,GAA4B,IAAI,GAAG,EAAE,CAAC;IACjD,eAAe,GAAiB,IAAI,CAAC;IACrC,QAAQ,GAA8B,IAAI,GAAG,EAAE,CAAC;IAExD,eAAe,CAAC,OAAqB;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,GAAG,CACP,GAAW,EACX,OAAyB,EACzB,MAAc,cAAc,CAAC,SAAS;QAEtC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;YACb,OAAO,OAAO,EAAE,CAAC;QACnB,CAAC;QAED,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,CAAe,CAAC;QAC5D,CAAC;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IACpD,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAC9B,GAAW,EACX,OAAyB,EACzB,GAAW;QAEX,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEzC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YACnC,OAAO,MAAO,CAAC,KAAU,CAA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C,GAAG,CAAC,CAAC;IACtC,CAAC;IAED,GAAG,CAAC,GAAW;QACb,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YAChC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW,CAAC,OAAuC,EAAE,OAA4B;QAC/E,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvD,MAAM,KAAK,GAAG;YACZ,OAAO,CAAC,MAAM;YACd,GAAG,CAAC,QAAQ;YACZ,GAAG,CAAC,MAAM;YACV,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW;SAC1E,CAAC;QAEF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { watch } from
|
|
3
|
-
import { parseArgs } from
|
|
4
|
-
import { getVectorInstance } from
|
|
5
|
-
import { ConfigLoader } from
|
|
2
|
+
import { watch } from 'node:fs';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
import { getVectorInstance } from '../core/vector';
|
|
5
|
+
import { ConfigLoader } from '../core/config-loader';
|
|
6
6
|
// Compatibility layer for both Node and Bun
|
|
7
|
-
const args = typeof Bun !==
|
|
7
|
+
const args = typeof Bun !== 'undefined' ? Bun.argv.slice(2) : process.argv.slice(2);
|
|
8
8
|
const { values, positionals } = parseArgs({
|
|
9
9
|
args,
|
|
10
10
|
options: {
|
|
11
11
|
port: {
|
|
12
|
-
type:
|
|
13
|
-
short:
|
|
14
|
-
default:
|
|
12
|
+
type: 'string',
|
|
13
|
+
short: 'p',
|
|
14
|
+
default: '3000',
|
|
15
15
|
},
|
|
16
16
|
host: {
|
|
17
|
-
type:
|
|
18
|
-
short:
|
|
19
|
-
default:
|
|
17
|
+
type: 'string',
|
|
18
|
+
short: 'h',
|
|
19
|
+
default: 'localhost',
|
|
20
20
|
},
|
|
21
21
|
routes: {
|
|
22
|
-
type:
|
|
23
|
-
short:
|
|
24
|
-
default:
|
|
22
|
+
type: 'string',
|
|
23
|
+
short: 'r',
|
|
24
|
+
default: './routes',
|
|
25
25
|
},
|
|
26
26
|
watch: {
|
|
27
|
-
type:
|
|
28
|
-
short:
|
|
27
|
+
type: 'boolean',
|
|
28
|
+
short: 'w',
|
|
29
29
|
default: true,
|
|
30
30
|
},
|
|
31
31
|
cors: {
|
|
32
|
-
type:
|
|
32
|
+
type: 'boolean',
|
|
33
33
|
default: true,
|
|
34
34
|
},
|
|
35
35
|
config: {
|
|
36
|
-
type:
|
|
37
|
-
short:
|
|
36
|
+
type: 'string',
|
|
37
|
+
short: 'c',
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
strict: true,
|
|
41
41
|
allowPositionals: true,
|
|
42
42
|
});
|
|
43
|
-
const command = positionals[0] ||
|
|
43
|
+
const command = positionals[0] || 'dev';
|
|
44
44
|
async function runDev() {
|
|
45
|
-
const isDev = command ===
|
|
45
|
+
const isDev = command === 'dev';
|
|
46
46
|
let server = null;
|
|
47
47
|
let vector = null;
|
|
48
48
|
async function startServer() {
|
|
49
49
|
// Create a timeout promise that rejects after 10 seconds
|
|
50
50
|
const timeoutPromise = new Promise((_, reject) => {
|
|
51
51
|
setTimeout(() => {
|
|
52
|
-
reject(new Error(
|
|
52
|
+
reject(new Error('Server startup timed out (10s)'));
|
|
53
53
|
}, 10000);
|
|
54
54
|
});
|
|
55
55
|
// Create the actual server start promise
|
|
@@ -68,11 +68,11 @@ async function runDev() {
|
|
|
68
68
|
// Only apply default CORS if config.cors is undefined (not set)
|
|
69
69
|
if (config.cors === undefined && values.cors) {
|
|
70
70
|
config.cors = {
|
|
71
|
-
origin:
|
|
71
|
+
origin: '*',
|
|
72
72
|
credentials: true,
|
|
73
|
-
allowHeaders:
|
|
74
|
-
allowMethods:
|
|
75
|
-
exposeHeaders:
|
|
73
|
+
allowHeaders: 'Content-Type, Authorization',
|
|
74
|
+
allowMethods: 'GET, POST, PUT, PATCH, DELETE, OPTIONS',
|
|
75
|
+
exposeHeaders: 'Authorization',
|
|
76
76
|
maxAge: 86400,
|
|
77
77
|
};
|
|
78
78
|
}
|
|
@@ -92,10 +92,10 @@ async function runDev() {
|
|
|
92
92
|
server = await vector.startServer(config);
|
|
93
93
|
// Verify the server is actually running
|
|
94
94
|
if (!server || !server.port) {
|
|
95
|
-
throw new Error(
|
|
95
|
+
throw new Error('Server started but is not responding correctly');
|
|
96
96
|
}
|
|
97
|
-
const cyan =
|
|
98
|
-
const reset =
|
|
97
|
+
const cyan = '\x1b[36m';
|
|
98
|
+
const reset = '\x1b[0m';
|
|
99
99
|
console.log(`\nListening on ${cyan}http://${config.hostname}:${config.port}${reset}\n`);
|
|
100
100
|
return { server, vector, config };
|
|
101
101
|
})();
|
|
@@ -119,16 +119,13 @@ async function runDev() {
|
|
|
119
119
|
const now = Date.now();
|
|
120
120
|
if (isReloading || now - lastReloadTime < 1000)
|
|
121
121
|
return;
|
|
122
|
+
const segments = filename ? filename.split(/[/\\]/) : [];
|
|
123
|
+
const excluded = segments.some((s) => ['node_modules', '.git', '.vector', 'dist'].includes(s));
|
|
122
124
|
if (filename &&
|
|
123
|
-
(filename.endsWith(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
!filename.
|
|
127
|
-
!filename.includes(".git") &&
|
|
128
|
-
!filename.includes(".vector") && // Ignore generated files
|
|
129
|
-
!filename.includes("dist") && // Ignore dist folder
|
|
130
|
-
!filename.includes("bun.lockb") && // Ignore lock files
|
|
131
|
-
!filename.endsWith(".generated.ts") // Ignore generated files
|
|
125
|
+
(filename.endsWith('.ts') || filename.endsWith('.js') || filename.endsWith('.json')) &&
|
|
126
|
+
!excluded &&
|
|
127
|
+
!filename.includes('bun.lockb') && // Ignore lock files
|
|
128
|
+
!filename.endsWith('.generated.ts') // Ignore generated files
|
|
132
129
|
) {
|
|
133
130
|
// Track changed files
|
|
134
131
|
changedFiles.add(filename);
|
|
@@ -149,16 +146,6 @@ async function runDev() {
|
|
|
149
146
|
}
|
|
150
147
|
// Small delay to ensure file system operations complete
|
|
151
148
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
152
|
-
// Clear module cache to ensure fresh imports
|
|
153
|
-
// Note: Bun uses ESM and doesn't have require.cache
|
|
154
|
-
// The Loader API will handle module reloading automatically
|
|
155
|
-
if (typeof require !== 'undefined' && require.cache) {
|
|
156
|
-
for (const key in require.cache) {
|
|
157
|
-
if (!key.includes("node_modules")) {
|
|
158
|
-
delete require.cache[key];
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
149
|
// Restart the server
|
|
163
150
|
try {
|
|
164
151
|
const result = await startServer();
|
|
@@ -166,7 +153,7 @@ async function runDev() {
|
|
|
166
153
|
vector = result.vector;
|
|
167
154
|
}
|
|
168
155
|
catch (error) {
|
|
169
|
-
console.error(
|
|
156
|
+
console.error('\n[Reload Error]', error.message || error);
|
|
170
157
|
// Don't exit the process on reload failures, just continue watching
|
|
171
158
|
}
|
|
172
159
|
finally {
|
|
@@ -179,17 +166,17 @@ async function runDev() {
|
|
|
179
166
|
});
|
|
180
167
|
}
|
|
181
168
|
catch {
|
|
182
|
-
const yellow =
|
|
183
|
-
const reset =
|
|
169
|
+
const yellow = '\x1b[33m';
|
|
170
|
+
const reset = '\x1b[0m';
|
|
184
171
|
console.warn(`${yellow}Warning: File watching not available${reset}`);
|
|
185
172
|
}
|
|
186
173
|
}
|
|
187
174
|
}
|
|
188
175
|
catch (error) {
|
|
189
|
-
const red =
|
|
190
|
-
const reset =
|
|
176
|
+
const red = '\x1b[31m';
|
|
177
|
+
const reset = '\x1b[0m';
|
|
191
178
|
console.error(`\n${red}Error: ${error.message || error}${reset}\n`);
|
|
192
|
-
if (error.stack && process.env.NODE_ENV ===
|
|
179
|
+
if (error.stack && process.env.NODE_ENV === 'development') {
|
|
193
180
|
console.error(error.stack);
|
|
194
181
|
}
|
|
195
182
|
process.exit(1);
|
|
@@ -197,25 +184,25 @@ async function runDev() {
|
|
|
197
184
|
}
|
|
198
185
|
async function runBuild() {
|
|
199
186
|
try {
|
|
200
|
-
const { RouteScanner } = await import(
|
|
201
|
-
const { RouteGenerator } = await import(
|
|
187
|
+
const { RouteScanner } = await import('../dev/route-scanner');
|
|
188
|
+
const { RouteGenerator } = await import('../dev/route-generator');
|
|
202
189
|
// Step 1: Scan and generate routes
|
|
203
190
|
const scanner = new RouteScanner(values.routes);
|
|
204
191
|
const generator = new RouteGenerator();
|
|
205
192
|
const routes = await scanner.scan();
|
|
206
193
|
await generator.generate(routes);
|
|
207
194
|
// Step 2: Build the application with Bun
|
|
208
|
-
if (typeof Bun !==
|
|
195
|
+
if (typeof Bun !== 'undefined') {
|
|
209
196
|
// Build the CLI as an executable
|
|
210
197
|
const buildProcess = Bun.spawn([
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
198
|
+
'bun',
|
|
199
|
+
'build',
|
|
200
|
+
'src/cli/index.ts',
|
|
201
|
+
'--target',
|
|
202
|
+
'bun',
|
|
203
|
+
'--outfile',
|
|
204
|
+
'dist/server.js',
|
|
205
|
+
'--minify',
|
|
219
206
|
]);
|
|
220
207
|
const exitCode = await buildProcess.exited;
|
|
221
208
|
if (exitCode !== 0) {
|
|
@@ -224,41 +211,33 @@ async function runBuild() {
|
|
|
224
211
|
}
|
|
225
212
|
else {
|
|
226
213
|
// For Node.js, use child_process
|
|
227
|
-
const { spawnSync } = await import(
|
|
228
|
-
const result = spawnSync(
|
|
229
|
-
|
|
230
|
-
"src/cli/index.ts",
|
|
231
|
-
"--target",
|
|
232
|
-
"bun",
|
|
233
|
-
"--outfile",
|
|
234
|
-
"dist/server.js",
|
|
235
|
-
"--minify",
|
|
236
|
-
], {
|
|
237
|
-
stdio: "inherit",
|
|
214
|
+
const { spawnSync } = await import('child_process');
|
|
215
|
+
const result = spawnSync('bun', ['build', 'src/cli/index.ts', '--target', 'bun', '--outfile', 'dist/server.js', '--minify'], {
|
|
216
|
+
stdio: 'inherit',
|
|
238
217
|
shell: true,
|
|
239
218
|
});
|
|
240
219
|
if (result.status !== 0) {
|
|
241
220
|
throw new Error(`Build failed with exit code ${result.status}`);
|
|
242
221
|
}
|
|
243
222
|
}
|
|
244
|
-
console.log(
|
|
223
|
+
console.log('\nBuild complete: dist/server.js\n');
|
|
245
224
|
}
|
|
246
225
|
catch (error) {
|
|
247
|
-
const red =
|
|
248
|
-
const reset =
|
|
226
|
+
const red = '\x1b[31m';
|
|
227
|
+
const reset = '\x1b[0m';
|
|
249
228
|
console.error(`\n${red}Error: ${error.message || error}${reset}\n`);
|
|
250
229
|
process.exit(1);
|
|
251
230
|
}
|
|
252
231
|
}
|
|
253
232
|
switch (command) {
|
|
254
|
-
case
|
|
233
|
+
case 'dev':
|
|
255
234
|
await runDev();
|
|
256
235
|
break;
|
|
257
|
-
case
|
|
236
|
+
case 'build':
|
|
258
237
|
await runBuild();
|
|
259
238
|
break;
|
|
260
|
-
case
|
|
261
|
-
process.env.NODE_ENV =
|
|
239
|
+
case 'start':
|
|
240
|
+
process.env.NODE_ENV = 'production';
|
|
262
241
|
await runDev();
|
|
263
242
|
break;
|
|
264
243
|
default:
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,4CAA4C;AAC5C,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,4CAA4C;AAC5C,MAAM,IAAI,GAAG,OAAO,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEpF,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACxC,IAAI;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,MAAM;SAChB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,WAAW;SACrB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,UAAU;SACpB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,GAAG;YACV,OAAO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