@stacksjs/bun-router 0.0.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 (131) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +397 -0
  3. package/bin/cli.ts +9 -0
  4. package/dist/auth.d.ts +77 -0
  5. package/dist/cache/lru-cache.d.ts +88 -0
  6. package/dist/cache/middleware-memoization.d.ts +101 -0
  7. package/dist/cache/route-cache-warmer.d.ts +125 -0
  8. package/dist/cache/sqlite-cache.d.ts +114 -0
  9. package/dist/cache/streaming-cache.d.ts +86 -0
  10. package/dist/chunk-r15a48wc.js +25448 -0
  11. package/dist/cli/colors.d.ts +12 -0
  12. package/dist/cli/index.d.ts +10 -0
  13. package/dist/cli/middleware.d.ts +31 -0
  14. package/dist/cli/openapi.d.ts +17 -0
  15. package/dist/cli/router.d.ts +15 -0
  16. package/dist/cli/routes.d.ts +30 -0
  17. package/dist/cli/utils.d.ts +68 -0
  18. package/dist/cli.d.ts +0 -0
  19. package/dist/cli.js +3195 -0
  20. package/dist/config.d.ts +274 -0
  21. package/dist/container/container.d.ts +141 -0
  22. package/dist/container/contextual-binding.d.ts +112 -0
  23. package/dist/container/decorators.d.ts +114 -0
  24. package/dist/container/service-provider.d.ts +221 -0
  25. package/dist/development/hot-reload.d.ts +129 -0
  26. package/dist/development/index.d.ts +144 -0
  27. package/dist/development/performance-profiler.d.ts +152 -0
  28. package/dist/development/route-debugger.d.ts +102 -0
  29. package/dist/development/route-inspector.d.ts +142 -0
  30. package/dist/development/typescript-utilities.d.ts +116 -0
  31. package/dist/docs.d.ts +10 -0
  32. package/dist/errors/circuit-breaker.d.ts +138 -0
  33. package/dist/errors/error-handler.d.ts +57 -0
  34. package/dist/errors/error-reporting.d.ts +135 -0
  35. package/dist/errors/exceptions.d.ts +178 -0
  36. package/dist/errors/graceful-degradation.d.ts +130 -0
  37. package/dist/errors/index.d.ts +6 -0
  38. package/dist/errors/router-errors.d.ts +97 -0
  39. package/dist/file-serving/static-files.d.ts +98 -0
  40. package/dist/index.d.ts +10 -0
  41. package/dist/index.js +13417 -0
  42. package/dist/middleware/auth.d.ts +34 -0
  43. package/dist/middleware/content_security_policy.d.ts +54 -0
  44. package/dist/middleware/cors.d.ts +5 -0
  45. package/dist/middleware/csrf.d.ts +7 -0
  46. package/dist/middleware/ddos_protection.d.ts +47 -0
  47. package/dist/middleware/file_security.d.ts +23 -0
  48. package/dist/middleware/file_upload.d.ts +41 -0
  49. package/dist/middleware/helmet.d.ts +54 -0
  50. package/dist/middleware/index.d.ts +55 -0
  51. package/dist/middleware/input_validation.d.ts +46 -0
  52. package/dist/middleware/json_body.d.ts +4 -0
  53. package/dist/middleware/performance_alerting.d.ts +88 -0
  54. package/dist/middleware/performance_dashboard.d.ts +97 -0
  55. package/dist/middleware/performance_monitor.d.ts +236 -0
  56. package/dist/middleware/pipeline.d.ts +90 -0
  57. package/dist/middleware/rate_limit.d.ts +33 -0
  58. package/dist/middleware/request_id.d.ts +4 -0
  59. package/dist/middleware/request_signing.d.ts +96 -0
  60. package/dist/middleware/request_tracer.d.ts +76 -0
  61. package/dist/middleware/response_cache.d.ts +90 -0
  62. package/dist/middleware/security.d.ts +70 -0
  63. package/dist/middleware/security_suite.d.ts +46 -0
  64. package/dist/middleware/session.d.ts +7 -0
  65. package/dist/model-binding/index.d.ts +17 -0
  66. package/dist/model-binding/model-middleware.d.ts +80 -0
  67. package/dist/model-binding/model-registry.d.ts +125 -0
  68. package/dist/model-binding.d.ts +123 -0
  69. package/dist/model-resolver-factory.d.ts +31 -0
  70. package/dist/observability/correlation.d.ts +131 -0
  71. package/dist/observability/health-checks.d.ts +129 -0
  72. package/dist/observability/index.d.ts +92 -0
  73. package/dist/observability/integration.d.ts +112 -0
  74. package/dist/observability/metrics.d.ts +135 -0
  75. package/dist/observability/tracing.d.ts +112 -0
  76. package/dist/optimization/bun-utilities.d.ts +106 -0
  77. package/dist/query-builder-integration.d.ts +24 -0
  78. package/dist/request/enhanced-request.d.ts +143 -0
  79. package/dist/request/macros.d.ts +267 -0
  80. package/dist/response/macros.d.ts +207 -0
  81. package/dist/response/response-factory.d.ts +93 -0
  82. package/dist/router/file-based-routing.d.ts +40 -0
  83. package/dist/router/file-streaming.d.ts +6 -0
  84. package/dist/router/fluent-router.d.ts +179 -0
  85. package/dist/router/fluent-routing.d.ts +198 -0
  86. package/dist/router/group-organization.d.ts +5 -0
  87. package/dist/router/handler-resolver.d.ts +13 -0
  88. package/dist/router/http-methods.d.ts +10 -0
  89. package/dist/router/index.d.ts +114 -0
  90. package/dist/router/middleware-integration.d.ts +86 -0
  91. package/dist/router/middleware.d.ts +5 -0
  92. package/dist/router/model-binding.d.ts +7 -0
  93. package/dist/router/optimized-route-matching.d.ts +6 -0
  94. package/dist/router/route-building.d.ts +5 -0
  95. package/dist/router/route-compiler.d.ts +67 -0
  96. package/dist/router/route-matching.d.ts +5 -0
  97. package/dist/router/route-trie.d.ts +69 -0
  98. package/dist/router/router.d.ts +133 -0
  99. package/dist/router/server.d.ts +5 -0
  100. package/dist/router/validation-integration.d.ts +116 -0
  101. package/dist/router/view-rendering.d.ts +5 -0
  102. package/dist/router/websocket.d.ts +5 -0
  103. package/dist/routing/route-caching.d.ts +105 -0
  104. package/dist/routing/route-throttling.d.ts +112 -0
  105. package/dist/routing/subdomain-routing.d.ts +159 -0
  106. package/dist/streaming/index.d.ts +15 -0
  107. package/dist/streaming/sse-handler.d.ts +81 -0
  108. package/dist/streaming/stream-handler.d.ts +81 -0
  109. package/dist/testing/auth-testing.d.ts +107 -0
  110. package/dist/testing/file-upload-testing.d.ts +139 -0
  111. package/dist/testing/index.d.ts +10 -0
  112. package/dist/testing/middleware-testing.d.ts +99 -0
  113. package/dist/testing/model-binding-testing.d.ts +132 -0
  114. package/dist/testing/performance-testing.d.ts +202 -0
  115. package/dist/testing/test-client.d.ts +58 -0
  116. package/dist/testing/test-request.d.ts +43 -0
  117. package/dist/testing/test-response.d.ts +45 -0
  118. package/dist/testing/types.d.ts +206 -0
  119. package/dist/testing/websocket-testing.d.ts +170 -0
  120. package/dist/types/controller-types.d.ts +303 -0
  121. package/dist/types/core.d.ts +526 -0
  122. package/dist/types/middleware-types.d.ts +315 -0
  123. package/dist/types/request-response-augmentation.d.ts +373 -0
  124. package/dist/types/route-inference.d.ts +287 -0
  125. package/dist/types.d.ts +1620 -0
  126. package/dist/utils/index.d.ts +1 -0
  127. package/dist/utils/query-preservation.d.ts +31 -0
  128. package/dist/utils.d.ts +69 -0
  129. package/dist/validation/validator.d.ts +169 -0
  130. package/dist/websocket/clustering.d.ts +114 -0
  131. package/package.json +81 -0
@@ -0,0 +1 @@
1
+ export * from './query-preservation';
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Generate the client-side script for query preservation
3
+ * This script intercepts link clicks and preserves specified query params
4
+ */
5
+ export declare function generateQueryPreservationScript(config: QueryPreservationConfig): string;
6
+ /**
7
+ * Inject the query preservation script into HTML content
8
+ * Inserts before </head> or </body> if </head> not found
9
+ */
10
+ export declare function injectQueryPreservationScript(html: string, config: QueryPreservationConfig): string;
11
+ /**
12
+ * Build a URL with preserved query parameters
13
+ * Server-side utility for generating links
14
+ */
15
+ export declare function buildUrlWithPreservedParams(path: string, currentUrl: string | URL, config: QueryPreservationConfig, additionalParams?: Record<string, string>): string;
16
+ /**
17
+ * Default configuration
18
+ */
19
+ export declare const defaultQueryPreservationConfig: QueryPreservationConfig;
20
+ /**
21
+ * Query Parameter Preservation
22
+ *
23
+ * Automatically preserves specified query parameters across navigation.
24
+ * This is useful for maintaining state like siteId, theme, locale, etc.
25
+ */
26
+ export declare interface QueryPreservationConfig {
27
+ enabled?: boolean
28
+ preserve?: string[]
29
+ exclude?: string[]
30
+ routes?: string[]
31
+ }
@@ -0,0 +1,69 @@
1
+ import type { ActionHandler, ActionHandlerClass, RouteHandler } from './types';
2
+ /**
3
+ * Normalizes a path by ensuring it starts with a forward slash and has no trailing slash
4
+ * @param path The path to normalize
5
+ */
6
+ export declare function normalizePath(path: string): string;
7
+ /**
8
+ * Converts a string path to an action path for dynamic imports
9
+ * @param path The path to convert (e.g., 'Actions/Home/IndexAction')
10
+ */
11
+ export declare function toActionPath(path: string): string;
12
+ /**
13
+ * Checks if a handler is a class constructor implementing ActionHandlerClass
14
+ * @param handler The handler to check
15
+ */
16
+ export declare function isActionClass(handler: ActionHandler): handler is new () => ActionHandlerClass;
17
+ /**
18
+ * Checks if a handler is a route handler function
19
+ * @param handler The handler to check
20
+ */
21
+ export declare function isRouteHandler(handler: ActionHandler): handler is RouteHandler;
22
+ /**
23
+ * Extracts named parameters from a path pattern
24
+ * @param pattern The path pattern (e.g., '/users/{id}/posts/{postId}')
25
+ */
26
+ export declare function extractParamNames(pattern: string): string[];
27
+ /**
28
+ * Creates a regex pattern from a path pattern
29
+ * @param pattern The path pattern
30
+ */
31
+ export declare function createPathRegex(pattern: string): RegExp;
32
+ /**
33
+ * Matches a path against a pattern and extracts parameters
34
+ * @param pattern The path pattern (e.g., '/users/{id}')
35
+ * @param path The actual path (e.g., '/users/123')
36
+ * @param params Output parameter object that will contain extracted parameters
37
+ * @param constraints Optional constraints for route parameters
38
+ * @returns Boolean indicating whether the path matches the pattern
39
+ */
40
+ export declare function matchPath(pattern: string, path: string, params: Record<string, string>, constraints?: Record<string, string>): boolean;
41
+ /**
42
+ * Joins path segments ensuring proper formatting
43
+ * @param segments Path segments to join
44
+ */
45
+ export declare function joinPaths(...segments: string[]): string;
46
+ /**
47
+ * Validates a route path format
48
+ * @param path The path to validate
49
+ */
50
+ export declare function validatePath(path: string): boolean;
51
+ /**
52
+ * Check if a file exists at the given path
53
+ * @param path The file path to check
54
+ */
55
+ export declare function fileExists(path: string): Promise<boolean>;
56
+ /**
57
+ * Resolve a view name to an actual file path
58
+ * @param viewName The view name (without extension)
59
+ * @param viewsPath The base path for views
60
+ * @param extensions File extensions to try
61
+ */
62
+ export declare function resolveViewPath(viewName: string, viewsPath: string, extensions: string[]): Promise<string | null>;
63
+ /**
64
+ * Basic HTML template processing - replaces {{ varName }} with the corresponding value
65
+ * @param template The HTML template string
66
+ * @param data The data to inject into the template
67
+ */
68
+ export declare function processHtmlTemplate(template: string, data: Record<string, any>): string;
69
+ export * from './utils/query-preservation';
@@ -0,0 +1,169 @@
1
+ /**
2
+ * Validation middleware factory
3
+ */
4
+ export declare function createValidationMiddleware(rules: ValidationRules, config?: ValidatorConfig): void;
5
+ /**
6
+ * Factory function to create validation rule builder
7
+ */
8
+ export declare function rule(): ValidationRuleBuilder;
9
+ /**
10
+ * Built-in validation rules
11
+ */
12
+ export declare const BuiltInRules: {
13
+ required: { name: 'required'; validate: (value) => unknown; message: 'The :field field is required.' };
14
+ string: {
15
+ name: 'string';
16
+ validate: unknown;
17
+ message: 'The :field field must be a string.'
18
+ };
19
+ number: {
20
+ name: 'number';
21
+ validate: unknown
22
+ };
23
+ integer: {
24
+ name: 'integer';
25
+ validate: unknown
26
+ };
27
+ boolean: {
28
+ name: 'boolean';
29
+ validate: unknown;
30
+ message: 'The :field field must be true or false.'
31
+ };
32
+ email: { name: 'email'; validate: (value) => unknown };
33
+ url: { name: 'url'; validate: (value) => unknown };
34
+ min: { name: 'min'; validate: (value, parameters) => unknown };
35
+ max: { name: 'max'; validate: (value, parameters) => unknown };
36
+ between: { name: 'between'; validate: (value, parameters) => unknown };
37
+ in: { name: 'in'; validate: (value, parameters) => unknown; message: (field, parameters) => unknown };
38
+ notIn: { name: 'not_in'; validate: (value, parameters) => unknown; message: (field, parameters) => unknown };
39
+ regex: { name: 'regex'; validate: (value, parameters) => unknown };
40
+ alpha: {
41
+ name: 'alpha';
42
+ validate: unknown
43
+ };
44
+ alphaNum: {
45
+ name: 'alpha_num';
46
+ validate: unknown
47
+ };
48
+ alphaDash: {
49
+ name: 'alpha_dash';
50
+ validate: unknown
51
+ };
52
+ date: { name: 'date'; validate: (value) => unknown };
53
+ dateAfter: { name: 'after'; validate: (value, parameters) => unknown };
54
+ dateBefore: { name: 'before'; validate: (value, parameters) => unknown };
55
+ confirmed: { name: 'confirmed'; validate: (value, parameters, field, data) => unknown };
56
+ same: { name: 'same'; validate: (value, parameters, field, data) => unknown };
57
+ different: { name: 'different'; validate: (value, parameters, field, data) => unknown; message: (field, parameters) => unknown };
58
+ json: { name: 'json'; validate: (value) => unknown; message: 'The :field field must be valid JSON.' };
59
+ uuid: { name: 'uuid'; validate: (value) => unknown };
60
+ array: {
61
+ name: 'array';
62
+ validate: unknown
63
+ };
64
+ object: {
65
+ name: 'object';
66
+ validate: unknown
67
+ }
68
+ };
69
+ /**
70
+ * Database validation rules (require external implementation)
71
+ */
72
+ export declare const DatabaseRules: {
73
+ unique: { name: 'unique'; validate: (_value, _parameters) => unknown; message: 'The :field field must be unique.' };
74
+ exists: { name: 'exists'; validate: (_value, _parameters) => unknown; message: 'The selected :field is invalid.' }
75
+ };
76
+ /**
77
+ * Global validator instance
78
+ */
79
+ export declare const globalValidator: Validator;
80
+ /**
81
+ * Validation helper functions
82
+ */
83
+ export declare const ValidationHelpers: {
84
+ /**
85
+ * Create validation rules object
86
+ */
87
+ rules(rules: Record<string, string | ValidationRuleBuilder>): unknown;
88
+ /**
89
+ * Validate single value
90
+ */
91
+ async validateValue(value: any, rules: string, field = 'value'): unknown;
92
+ /**
93
+ * Check if value passes validation
94
+ */
95
+ async passes(value: any, rules: string): unknown;
96
+ /**
97
+ * Check if value fails validation
98
+ */
99
+ async fails(value: any, rules: string): unknown
100
+ };
101
+ export declare interface ValidationRule {
102
+ name: string
103
+ validate: (value: any, parameters: string[], field: string, data: Record<string, any>) => Promise<boolean> | boolean
104
+ message: string | ((field: string, parameters: string[]) => string)
105
+ }
106
+ export declare interface ValidationRules {
107
+
108
+ }
109
+ export declare interface ValidationErrors {
110
+
111
+ }
112
+ export declare interface ValidatorConfig {
113
+ stopOnFirstFailure?: boolean
114
+ customMessages?: Record<string, string>
115
+ customAttributes?: Record<string, string>
116
+ bail?: boolean
117
+ }
118
+ /**
119
+ * Main validator class
120
+ */
121
+ export declare class Validator {
122
+ private rules: Record<string, ValidationRule>;
123
+ private config: ValidatorConfig;
124
+ constructor(config?: ValidatorConfig);
125
+ registerRule(rule: ValidationRule): void;
126
+ registerRules(rules: Record<string, ValidationRule>): void;
127
+ private parseRuleString(ruleString: string): Array<{ name: string, parameters: string[] }>;
128
+ validate(data: Record<string, any>, rules: ValidationRules): Promise<ValidationErrors>;
129
+ validateOrFail(data: Record<string, any>, rules: ValidationRules): Promise<void>;
130
+ private getNestedValue(obj: Record<string, any>, path: string): any;
131
+ private formatErrorMessage(rule: ValidationRule, field: string, parameters: string[]): string;
132
+ private replacePlaceholders(message: string, field: string, parameters: string[]): string;
133
+ }
134
+ /**
135
+ * Validation rule builder for fluent API
136
+ */
137
+ export declare class ValidationRuleBuilder {
138
+ private rules: string[];
139
+ required(): this;
140
+ string(): this;
141
+ number(): this;
142
+ integer(): this;
143
+ boolean(): this;
144
+ email(): this;
145
+ url(): this;
146
+ min(value: number): this;
147
+ max(value: number): this;
148
+ between(min: number, max: number): this;
149
+ in(values: string[]): this;
150
+ notIn(values: string[]): this;
151
+ regex(pattern: string): this;
152
+ alpha(): this;
153
+ alphaNum(): this;
154
+ alphaDash(): this;
155
+ date(): this;
156
+ after(date: string): this;
157
+ before(date: string): this;
158
+ confirmed(field?: string): this;
159
+ same(field: string): this;
160
+ different(field: string): this;
161
+ json(): this;
162
+ uuid(): this;
163
+ array(): this;
164
+ object(): this;
165
+ unique(table: string, column?: string): this;
166
+ exists(table: string, column?: string): this;
167
+ custom(ruleName: string, parameters: string[]): this;
168
+ build(): string;
169
+ }
@@ -0,0 +1,114 @@
1
+ import type { ServerWebSocket } from 'bun';
2
+ import type { Buffer } from 'node:buffer';
3
+ /**
4
+ * WebSocket cluster helpers
5
+ */
6
+ export declare const WebSocketClusterHelpers: {
7
+ /**
8
+ * Create room-based chat system
9
+ */
10
+ createChatSystem: (cluster: WebSocketCluster) => any;
11
+ /**
12
+ * Create real-time notifications system
13
+ */
14
+ createNotificationSystem: (cluster: WebSocketCluster) => any;
15
+ /**
16
+ * Create presence system
17
+ */
18
+ createPresenceSystem: (cluster: WebSocketCluster) => any
19
+ };
20
+ export declare interface WebSocketClusterConfig {
21
+ workers?: number
22
+ maxConnections?: number
23
+ heartbeatInterval?: number
24
+ compression?: boolean
25
+ backpressureLimit?: number
26
+ closeOnBackpressureLimit?: boolean
27
+ idleTimeout?: number
28
+ maxPayloadLength?: number
29
+ }
30
+ export declare interface ClusterMessage {
31
+ type: 'broadcast' | 'direct' | 'join' | 'leave' | 'heartbeat' | 'stats'
32
+ workerId?: string
33
+ targetId?: string
34
+ roomId?: string
35
+ data?: any
36
+ timestamp: number
37
+ }
38
+ export declare interface WebSocketConnection {
39
+ id: string
40
+ workerId: string
41
+ socket: ServerWebSocket<any>
42
+ rooms: Set<string>
43
+ metadata: Record<string, any>
44
+ lastHeartbeat: number
45
+ connected: boolean
46
+ }
47
+ export declare interface WebSocketRoom {
48
+ id: string
49
+ connections: Set<string>
50
+ metadata: Record<string, any>
51
+ created: number
52
+ }
53
+ export declare interface ClusterStats {
54
+ totalConnections: number
55
+ totalRooms: number
56
+ workerStats: Record<string, {
57
+ connections: number
58
+ rooms: number
59
+ memoryUsage: number
60
+ uptime: number
61
+ }>
62
+ messagesSent: number
63
+ messagesReceived: number
64
+ bytesTransferred: number
65
+ }
66
+ /**
67
+ * WebSocket cluster manager for distributing connections across workers
68
+ */
69
+ export declare class WebSocketCluster {
70
+ private config: Required<WebSocketClusterConfig>;
71
+ private workers: any;
72
+ private connections: any;
73
+ private rooms: any;
74
+ private messageHandlers: any;
75
+ private stats: ClusterStats;
76
+ private heartbeatTimer?: Timer;
77
+ private isMainWorker: boolean;
78
+ private workerId: string;
79
+ constructor(config?: WebSocketClusterConfig);
80
+ createServer(options?: {
81
+ port?: number
82
+ hostname?: string
83
+ onConnection?: (ws: ServerWebSocket<any>, request: Request) => void
84
+ onMessage?: (ws: ServerWebSocket<any>, message: string | Buffer) => void
85
+ onClose?: (ws: ServerWebSocket<any>, code?: number, reason?: string) => void
86
+ onError?: (ws: ServerWebSocket<any>, error: Error) => void
87
+ }): any;
88
+ joinRoom(connectionId: string, roomId: string, metadata?: Record<string, any>): boolean;
89
+ leaveRoom(connectionId: string, roomId: string): boolean;
90
+ broadcastToRoom(roomId: string, message: string | Buffer, excludeConnectionId?: string): number;
91
+ sendToConnection(connectionId: string, message: string | Buffer): boolean;
92
+ getStats(): ClusterStats;
93
+ getRoomConnections(roomId: string): string[];
94
+ getConnectionRooms(connectionId: string): string[];
95
+ closeConnection(connectionId: string, code?: number, reason?: string): boolean;
96
+ shutdown(): void;
97
+ private generateConnectionId(): string;
98
+ private generateWorkerId(): string;
99
+ private initializeStats(): ClusterStats;
100
+ private setupWorkerCommunication(): void;
101
+ private handleWorkerMessage(message: ClusterMessage): void;
102
+ private handleClusterMessage(connection: WebSocketConnection, message: ClusterMessage): void;
103
+ private broadcastToWorkers(message: ClusterMessage): void;
104
+ private startHeartbeat(): void;
105
+ private updateWorkerStats(): void;
106
+ }
107
+ /**
108
+ * WebSocket cluster factory
109
+ */
110
+ export declare class WebSocketClusterFactory {
111
+ static create(config?: WebSocketClusterConfig): WebSocketCluster;
112
+ static createHighPerformance(): WebSocketCluster;
113
+ static createDevelopment(): WebSocketCluster;
114
+ }
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@stacksjs/bun-router",
3
+ "type": "module",
4
+ "version": "0.0.2",
5
+ "description": "A",
6
+ "author": "Chris Breuer <chris@stacksjs.org>",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/stacksjs/bun-router#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/stacksjs/bun-router.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/stacksjs/bun-router/issues"
15
+ },
16
+ "keywords": [
17
+ "router",
18
+ "route",
19
+ "server",
20
+ "laravel",
21
+ "fast",
22
+ "bun",
23
+ "typescript"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./*": {
31
+ "import": "./dist/*"
32
+ }
33
+ },
34
+ "module": "./dist/index.js",
35
+ "types": "./dist/index.d.ts",
36
+ "bin": {
37
+ "bun-router": "./dist/cli.js",
38
+ "router": "./bin/cli.ts"
39
+ },
40
+ "files": [
41
+ "README.md",
42
+ "dist"
43
+ ],
44
+ "scripts": {
45
+ "build": "bun --bun build.ts && bun run compile",
46
+ "compile": "bun build ./bin/cli.ts --compile --minify --outfile bin/router",
47
+ "compile:all": "bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64 && bun run compile:darwin-x64 && bun run compile:darwin-arm64",
48
+ "compile:linux-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-x64 --outfile bin/router-linux-x64",
49
+ "compile:linux-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-linux-arm64 --outfile bin/router-linux-arm64",
50
+ "compile:windows-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-windows-x64 --outfile bin/router-windows-x64.exe",
51
+ "compile:darwin-x64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-x64 --outfile bin/router-darwin-x64",
52
+ "compile:darwin-arm64": "bun build ./bin/cli.ts --compile --minify --target=bun-darwin-arm64 --outfile bin/router-darwin-arm64",
53
+ "zip": "bun run zip:all",
54
+ "zip:all": "bun run zip:linux-x64 && bun run zip:linux-arm64 && bun run zip:windows-x64 && bun run zip:darwin-x64 && bun run zip:darwin-arm64",
55
+ "zip:linux-x64": "zip -j bin/router-linux-x64.zip bin/router-linux-x64",
56
+ "zip:linux-arm64": "zip -j bin/router-linux-arm64.zip bin/router-linux-arm64",
57
+ "zip:windows-x64": "zip -j bin/router-windows-x64.zip bin/router-windows-x64.exe",
58
+ "zip:darwin-x64": "zip -j bin/router-darwin-x64.zip bin/router-darwin-x64",
59
+ "zip:darwin-arm64": "zip -j bin/router-darwin-arm64.zip bin/router-darwin-arm64",
60
+ "lint": "bunx --bun eslint .",
61
+ "lint:fix": "bunx --bun eslint . --fix",
62
+ "fresh": "bunx rimraf node_modules/ bun.lock && bun i",
63
+ "changelog": "bunx changelogen --output CHANGELOG.md",
64
+ "prepublishOnly": "bun --bun run build && bun run compile:all && bun run zip",
65
+ "release": "bun run changelog && bunx bumpp package.json --all",
66
+ "test": "bun test",
67
+ "dev:docs": "bun --bun vitepress dev docs",
68
+ "build:docs": "bun --bun vitepress build docs",
69
+ "preview:docs": "bun --bun vitepress preview docs",
70
+ "typecheck": "bunx --bun tsc --noEmit"
71
+ },
72
+ "dependencies": {
73
+ "@stacksjs/clapp": "^0.2.0",
74
+ "bun-query-builder": "^0.1.10",
75
+ "openapi-types": "^12.1.3",
76
+ "ts-rate-limiter": "^0.4.0"
77
+ },
78
+ "lint-staged": {
79
+ "*.{js,ts}": "bunx --bun eslint . --fix"
80
+ }
81
+ }