vector-framework 0.9.9 → 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 +76 -98
- package/dist/cli/index.js.map +1 -1
- package/dist/cli.js +134 -69
- 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 -21
- 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 +40 -20
- 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 +14 -9
- package/src/cache/manager.ts +23 -14
- package/src/cli/index.ts +83 -117
- package/src/core/config-loader.ts +19 -27
- package/src/core/router.ts +52 -18
- package/src/core/server.ts +43 -30
- 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,56 +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 ===
|
|
46
|
-
console.log(`\n→ Starting Vector ${isDev ? "development" : "production"} server\n`);
|
|
45
|
+
const isDev = command === 'dev';
|
|
47
46
|
let server = null;
|
|
48
47
|
let vector = null;
|
|
49
48
|
async function startServer() {
|
|
50
49
|
// Create a timeout promise that rejects after 10 seconds
|
|
51
50
|
const timeoutPromise = new Promise((_, reject) => {
|
|
52
51
|
setTimeout(() => {
|
|
53
|
-
reject(new Error(
|
|
52
|
+
reject(new Error('Server startup timed out (10s)'));
|
|
54
53
|
}, 10000);
|
|
55
54
|
});
|
|
56
55
|
// Create the actual server start promise
|
|
@@ -58,7 +57,6 @@ async function runDev() {
|
|
|
58
57
|
// Load configuration using ConfigLoader
|
|
59
58
|
const configLoader = new ConfigLoader(values.config);
|
|
60
59
|
const config = await configLoader.load();
|
|
61
|
-
const configSource = configLoader.getConfigSource();
|
|
62
60
|
// Merge CLI options with loaded config
|
|
63
61
|
// Only use CLI values if config doesn't have them
|
|
64
62
|
config.port = config.port ?? Number.parseInt(values.port);
|
|
@@ -70,11 +68,11 @@ async function runDev() {
|
|
|
70
68
|
// Only apply default CORS if config.cors is undefined (not set)
|
|
71
69
|
if (config.cors === undefined && values.cors) {
|
|
72
70
|
config.cors = {
|
|
73
|
-
origin:
|
|
71
|
+
origin: '*',
|
|
74
72
|
credentials: true,
|
|
75
|
-
allowHeaders:
|
|
76
|
-
allowMethods:
|
|
77
|
-
exposeHeaders:
|
|
73
|
+
allowHeaders: 'Content-Type, Authorization',
|
|
74
|
+
allowMethods: 'GET, POST, PUT, PATCH, DELETE, OPTIONS',
|
|
75
|
+
exposeHeaders: 'Authorization',
|
|
78
76
|
maxAge: 86400,
|
|
79
77
|
};
|
|
80
78
|
}
|
|
@@ -94,20 +92,11 @@ async function runDev() {
|
|
|
94
92
|
server = await vector.startServer(config);
|
|
95
93
|
// Verify the server is actually running
|
|
96
94
|
if (!server || !server.port) {
|
|
97
|
-
throw new Error(
|
|
95
|
+
throw new Error('Server started but is not responding correctly');
|
|
98
96
|
}
|
|
99
|
-
const
|
|
100
|
-
const reset =
|
|
101
|
-
|
|
102
|
-
const green = "\x1b[32m";
|
|
103
|
-
console.log(` ${gray}Config${reset} ${configSource === "user" ? "User config loaded" : "Using defaults"}`);
|
|
104
|
-
console.log(` ${gray}Routes${reset} ${config.routesDir}`);
|
|
105
|
-
if (isDev && values.watch) {
|
|
106
|
-
console.log(` ${gray}Watching${reset} All project files`);
|
|
107
|
-
}
|
|
108
|
-
console.log(` ${gray}CORS${reset} ${config.cors ? "Enabled" : "Disabled"}`);
|
|
109
|
-
console.log(` ${gray}Mode${reset} ${config.development ? "Development" : "Production"}\n`);
|
|
110
|
-
console.log(` ${green}Ready${reset} → ${cyan}http://${config.hostname}:${config.port}${reset}\n`);
|
|
97
|
+
const cyan = '\x1b[36m';
|
|
98
|
+
const reset = '\x1b[0m';
|
|
99
|
+
console.log(`\nListening on ${cyan}http://${config.hostname}:${config.port}${reset}\n`);
|
|
111
100
|
return { server, vector, config };
|
|
112
101
|
})();
|
|
113
102
|
// Race between server startup and timeout
|
|
@@ -130,16 +119,13 @@ async function runDev() {
|
|
|
130
119
|
const now = Date.now();
|
|
131
120
|
if (isReloading || now - lastReloadTime < 1000)
|
|
132
121
|
return;
|
|
122
|
+
const segments = filename ? filename.split(/[/\\]/) : [];
|
|
123
|
+
const excluded = segments.some((s) => ['node_modules', '.git', '.vector', 'dist'].includes(s));
|
|
133
124
|
if (filename &&
|
|
134
|
-
(filename.endsWith(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
!filename.
|
|
138
|
-
!filename.includes(".git") &&
|
|
139
|
-
!filename.includes(".vector") && // Ignore generated files
|
|
140
|
-
!filename.includes("dist") && // Ignore dist folder
|
|
141
|
-
!filename.includes("bun.lockb") && // Ignore lock files
|
|
142
|
-
!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
|
|
143
129
|
) {
|
|
144
130
|
// Track changed files
|
|
145
131
|
changedFiles.add(filename);
|
|
@@ -160,16 +146,6 @@ async function runDev() {
|
|
|
160
146
|
}
|
|
161
147
|
// Small delay to ensure file system operations complete
|
|
162
148
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
163
|
-
// Clear module cache to ensure fresh imports
|
|
164
|
-
// Note: Bun uses ESM and doesn't have require.cache
|
|
165
|
-
// The Loader API will handle module reloading automatically
|
|
166
|
-
if (typeof require !== 'undefined' && require.cache) {
|
|
167
|
-
for (const key in require.cache) {
|
|
168
|
-
if (!key.includes("node_modules")) {
|
|
169
|
-
delete require.cache[key];
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
149
|
// Restart the server
|
|
174
150
|
try {
|
|
175
151
|
const result = await startServer();
|
|
@@ -177,7 +153,7 @@ async function runDev() {
|
|
|
177
153
|
vector = result.vector;
|
|
178
154
|
}
|
|
179
155
|
catch (error) {
|
|
180
|
-
console.error(
|
|
156
|
+
console.error('\n[Reload Error]', error.message || error);
|
|
181
157
|
// Don't exit the process on reload failures, just continue watching
|
|
182
158
|
}
|
|
183
159
|
finally {
|
|
@@ -190,76 +166,78 @@ async function runDev() {
|
|
|
190
166
|
});
|
|
191
167
|
}
|
|
192
168
|
catch {
|
|
193
|
-
|
|
169
|
+
const yellow = '\x1b[33m';
|
|
170
|
+
const reset = '\x1b[0m';
|
|
171
|
+
console.warn(`${yellow}Warning: File watching not available${reset}`);
|
|
194
172
|
}
|
|
195
173
|
}
|
|
196
174
|
}
|
|
197
175
|
catch (error) {
|
|
198
|
-
const red =
|
|
199
|
-
const reset =
|
|
200
|
-
console.error(`\n${red}
|
|
201
|
-
|
|
202
|
-
if (error.message) {
|
|
203
|
-
console.error(`Message: ${error.message}`);
|
|
204
|
-
}
|
|
205
|
-
if (error.stack) {
|
|
206
|
-
console.error(`\nStack trace:`);
|
|
176
|
+
const red = '\x1b[31m';
|
|
177
|
+
const reset = '\x1b[0m';
|
|
178
|
+
console.error(`\n${red}Error: ${error.message || error}${reset}\n`);
|
|
179
|
+
if (error.stack && process.env.NODE_ENV === 'development') {
|
|
207
180
|
console.error(error.stack);
|
|
208
181
|
}
|
|
209
|
-
else if (!error.message) {
|
|
210
|
-
// If no message or stack, show the raw error
|
|
211
|
-
console.error(`Raw error:`, error);
|
|
212
|
-
}
|
|
213
|
-
// Ensure we exit with error code
|
|
214
182
|
process.exit(1);
|
|
215
183
|
}
|
|
216
184
|
}
|
|
217
185
|
async function runBuild() {
|
|
218
|
-
console.log("\n→ Building Vector application\n");
|
|
219
186
|
try {
|
|
220
|
-
const { RouteScanner } = await import(
|
|
221
|
-
const { RouteGenerator } = await import(
|
|
187
|
+
const { RouteScanner } = await import('../dev/route-scanner');
|
|
188
|
+
const { RouteGenerator } = await import('../dev/route-generator');
|
|
189
|
+
// Step 1: Scan and generate routes
|
|
222
190
|
const scanner = new RouteScanner(values.routes);
|
|
223
191
|
const generator = new RouteGenerator();
|
|
224
192
|
const routes = await scanner.scan();
|
|
225
193
|
await generator.generate(routes);
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
194
|
+
// Step 2: Build the application with Bun
|
|
195
|
+
if (typeof Bun !== 'undefined') {
|
|
196
|
+
// Build the CLI as an executable
|
|
229
197
|
const buildProcess = Bun.spawn([
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
198
|
+
'bun',
|
|
199
|
+
'build',
|
|
200
|
+
'src/cli/index.ts',
|
|
201
|
+
'--target',
|
|
202
|
+
'bun',
|
|
203
|
+
'--outfile',
|
|
204
|
+
'dist/server.js',
|
|
205
|
+
'--minify',
|
|
236
206
|
]);
|
|
237
|
-
await buildProcess.exited;
|
|
207
|
+
const exitCode = await buildProcess.exited;
|
|
208
|
+
if (exitCode !== 0) {
|
|
209
|
+
throw new Error(`Build failed with exit code ${exitCode}`);
|
|
210
|
+
}
|
|
238
211
|
}
|
|
239
212
|
else {
|
|
240
213
|
// For Node.js, use child_process
|
|
241
|
-
const { spawnSync } = await import(
|
|
242
|
-
spawnSync(
|
|
243
|
-
stdio:
|
|
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',
|
|
244
217
|
shell: true,
|
|
245
218
|
});
|
|
219
|
+
if (result.status !== 0) {
|
|
220
|
+
throw new Error(`Build failed with exit code ${result.status}`);
|
|
221
|
+
}
|
|
246
222
|
}
|
|
247
|
-
console.log(
|
|
223
|
+
console.log('\nBuild complete: dist/server.js\n');
|
|
248
224
|
}
|
|
249
225
|
catch (error) {
|
|
250
|
-
|
|
226
|
+
const red = '\x1b[31m';
|
|
227
|
+
const reset = '\x1b[0m';
|
|
228
|
+
console.error(`\n${red}Error: ${error.message || error}${reset}\n`);
|
|
251
229
|
process.exit(1);
|
|
252
230
|
}
|
|
253
231
|
}
|
|
254
232
|
switch (command) {
|
|
255
|
-
case
|
|
233
|
+
case 'dev':
|
|
256
234
|
await runDev();
|
|
257
235
|
break;
|
|
258
|
-
case
|
|
236
|
+
case 'build':
|
|
259
237
|
await runBuild();
|
|
260
238
|
break;
|
|
261
|
-
case
|
|
262
|
-
process.env.NODE_ENV =
|
|
239
|
+
case 'start':
|
|
240
|
+
process.env.NODE_ENV = 'production';
|
|
263
241
|
await runDev();
|
|
264
242
|
break;
|
|
265
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":";A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