bluera-knowledge 0.9.32 → 0.9.36

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 (198) hide show
  1. package/.claude/hooks/post-edit-check.sh +5 -3
  2. package/.claude/skills/atomic-commits/SKILL.md +3 -1
  3. package/.husky/pre-commit +3 -2
  4. package/.prettierrc +9 -0
  5. package/.versionrc.json +1 -1
  6. package/CHANGELOG.md +70 -0
  7. package/CLAUDE.md +6 -0
  8. package/README.md +25 -13
  9. package/bun.lock +277 -33
  10. package/dist/{chunk-L2YVNC63.js → chunk-6FHWC36B.js} +9 -1
  11. package/dist/chunk-6FHWC36B.js.map +1 -0
  12. package/dist/{chunk-RST4XGRL.js → chunk-DC7CGSGT.js} +288 -241
  13. package/dist/chunk-DC7CGSGT.js.map +1 -0
  14. package/dist/{chunk-6PBP5DVD.js → chunk-WFNPNAAP.js} +3212 -3054
  15. package/dist/chunk-WFNPNAAP.js.map +1 -0
  16. package/dist/{chunk-WT2DAEO7.js → chunk-Z2KKVH45.js} +548 -482
  17. package/dist/chunk-Z2KKVH45.js.map +1 -0
  18. package/dist/index.js +871 -758
  19. package/dist/index.js.map +1 -1
  20. package/dist/mcp/server.js +3 -3
  21. package/dist/watch.service-BJV3TI3F.js +7 -0
  22. package/dist/workers/background-worker-cli.js +97 -71
  23. package/dist/workers/background-worker-cli.js.map +1 -1
  24. package/eslint.config.js +43 -1
  25. package/package.json +18 -11
  26. package/plugin.json +8 -0
  27. package/python/requirements.txt +1 -1
  28. package/src/analysis/ast-parser.test.ts +12 -11
  29. package/src/analysis/ast-parser.ts +28 -22
  30. package/src/analysis/code-graph.test.ts +52 -62
  31. package/src/analysis/code-graph.ts +9 -13
  32. package/src/analysis/dependency-usage-analyzer.test.ts +91 -271
  33. package/src/analysis/dependency-usage-analyzer.ts +52 -24
  34. package/src/analysis/go-ast-parser.test.ts +22 -22
  35. package/src/analysis/go-ast-parser.ts +18 -25
  36. package/src/analysis/parser-factory.test.ts +9 -9
  37. package/src/analysis/parser-factory.ts +3 -3
  38. package/src/analysis/python-ast-parser.test.ts +27 -27
  39. package/src/analysis/python-ast-parser.ts +2 -2
  40. package/src/analysis/repo-url-resolver.test.ts +82 -82
  41. package/src/analysis/rust-ast-parser.test.ts +19 -19
  42. package/src/analysis/rust-ast-parser.ts +17 -27
  43. package/src/analysis/tree-sitter-parser.test.ts +3 -3
  44. package/src/analysis/tree-sitter-parser.ts +10 -16
  45. package/src/cli/commands/crawl.test.ts +40 -24
  46. package/src/cli/commands/crawl.ts +186 -166
  47. package/src/cli/commands/index-cmd.test.ts +90 -90
  48. package/src/cli/commands/index-cmd.ts +52 -36
  49. package/src/cli/commands/mcp.test.ts +6 -6
  50. package/src/cli/commands/mcp.ts +2 -2
  51. package/src/cli/commands/plugin-api.test.ts +16 -18
  52. package/src/cli/commands/plugin-api.ts +9 -6
  53. package/src/cli/commands/search.test.ts +16 -7
  54. package/src/cli/commands/search.ts +124 -87
  55. package/src/cli/commands/serve.test.ts +67 -25
  56. package/src/cli/commands/serve.ts +18 -3
  57. package/src/cli/commands/setup.test.ts +176 -101
  58. package/src/cli/commands/setup.ts +140 -117
  59. package/src/cli/commands/store.test.ts +82 -53
  60. package/src/cli/commands/store.ts +56 -37
  61. package/src/cli/program.ts +2 -2
  62. package/src/crawl/article-converter.test.ts +4 -1
  63. package/src/crawl/article-converter.ts +46 -31
  64. package/src/crawl/bridge.test.ts +240 -132
  65. package/src/crawl/bridge.ts +87 -30
  66. package/src/crawl/claude-client.test.ts +124 -56
  67. package/src/crawl/claude-client.ts +7 -15
  68. package/src/crawl/intelligent-crawler.test.ts +65 -22
  69. package/src/crawl/intelligent-crawler.ts +86 -53
  70. package/src/crawl/markdown-utils.ts +1 -4
  71. package/src/db/embeddings.ts +4 -6
  72. package/src/db/lance.test.ts +4 -4
  73. package/src/db/lance.ts +16 -12
  74. package/src/index.ts +26 -17
  75. package/src/logging/index.ts +1 -5
  76. package/src/logging/logger.ts +3 -5
  77. package/src/logging/payload.test.ts +1 -1
  78. package/src/logging/payload.ts +3 -5
  79. package/src/mcp/commands/index.ts +2 -2
  80. package/src/mcp/commands/job.commands.ts +12 -18
  81. package/src/mcp/commands/meta.commands.ts +13 -13
  82. package/src/mcp/commands/registry.ts +5 -8
  83. package/src/mcp/commands/store.commands.ts +19 -19
  84. package/src/mcp/handlers/execute.handler.test.ts +10 -10
  85. package/src/mcp/handlers/execute.handler.ts +4 -5
  86. package/src/mcp/handlers/index.ts +10 -14
  87. package/src/mcp/handlers/job.handler.test.ts +10 -10
  88. package/src/mcp/handlers/job.handler.ts +22 -25
  89. package/src/mcp/handlers/search.handler.test.ts +36 -65
  90. package/src/mcp/handlers/search.handler.ts +135 -104
  91. package/src/mcp/handlers/store.handler.test.ts +41 -52
  92. package/src/mcp/handlers/store.handler.ts +108 -88
  93. package/src/mcp/schemas/index.test.ts +73 -68
  94. package/src/mcp/schemas/index.ts +18 -12
  95. package/src/mcp/server.test.ts +1 -1
  96. package/src/mcp/server.ts +59 -46
  97. package/src/plugin/commands.test.ts +230 -95
  98. package/src/plugin/commands.ts +24 -25
  99. package/src/plugin/dependency-analyzer.test.ts +52 -52
  100. package/src/plugin/dependency-analyzer.ts +85 -22
  101. package/src/plugin/git-clone.test.ts +24 -13
  102. package/src/plugin/git-clone.ts +3 -7
  103. package/src/server/app.test.ts +109 -109
  104. package/src/server/app.ts +32 -23
  105. package/src/server/index.test.ts +64 -66
  106. package/src/services/chunking.service.test.ts +32 -32
  107. package/src/services/chunking.service.ts +16 -9
  108. package/src/services/code-graph.service.test.ts +30 -36
  109. package/src/services/code-graph.service.ts +24 -10
  110. package/src/services/code-unit.service.test.ts +55 -11
  111. package/src/services/code-unit.service.ts +85 -11
  112. package/src/services/config.service.test.ts +37 -18
  113. package/src/services/config.service.ts +30 -7
  114. package/src/services/index.service.test.ts +49 -18
  115. package/src/services/index.service.ts +98 -48
  116. package/src/services/index.ts +6 -9
  117. package/src/services/job.service.test.ts +22 -22
  118. package/src/services/job.service.ts +18 -18
  119. package/src/services/project-root.service.test.ts +1 -3
  120. package/src/services/search.service.test.ts +248 -120
  121. package/src/services/search.service.ts +286 -156
  122. package/src/services/services.test.ts +1 -1
  123. package/src/services/snippet.service.test.ts +14 -6
  124. package/src/services/snippet.service.ts +7 -5
  125. package/src/services/store.service.test.ts +68 -29
  126. package/src/services/store.service.ts +41 -12
  127. package/src/services/watch.service.test.ts +34 -14
  128. package/src/services/watch.service.ts +11 -1
  129. package/src/types/brands.test.ts +3 -1
  130. package/src/types/index.ts +2 -13
  131. package/src/types/search.ts +10 -8
  132. package/src/utils/type-guards.test.ts +20 -15
  133. package/src/utils/type-guards.ts +1 -1
  134. package/src/workers/background-worker-cli.ts +28 -30
  135. package/src/workers/background-worker.test.ts +54 -40
  136. package/src/workers/background-worker.ts +76 -60
  137. package/src/workers/pid-file.test.ts +167 -0
  138. package/src/workers/pid-file.ts +82 -0
  139. package/src/workers/spawn-worker.test.ts +22 -10
  140. package/src/workers/spawn-worker.ts +6 -6
  141. package/tests/analysis/ast-parser.test.ts +3 -3
  142. package/tests/analysis/code-graph.test.ts +5 -5
  143. package/tests/fixtures/code-snippets/api/error-handling.ts +4 -15
  144. package/tests/fixtures/code-snippets/api/rest-controller.ts +3 -9
  145. package/tests/fixtures/code-snippets/auth/jwt-auth.ts +5 -21
  146. package/tests/fixtures/code-snippets/auth/oauth-flow.ts +4 -4
  147. package/tests/fixtures/code-snippets/database/repository-pattern.ts +11 -3
  148. package/tests/fixtures/corpus/oss-repos/hono/src/adapter/aws-lambda/handler.ts +2 -2
  149. package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-pages/handler.ts +1 -1
  150. package/tests/fixtures/corpus/oss-repos/hono/src/adapter/cloudflare-workers/serve-static.ts +2 -2
  151. package/tests/fixtures/corpus/oss-repos/hono/src/client/client.ts +2 -2
  152. package/tests/fixtures/corpus/oss-repos/hono/src/client/types.ts +22 -20
  153. package/tests/fixtures/corpus/oss-repos/hono/src/context.ts +13 -10
  154. package/tests/fixtures/corpus/oss-repos/hono/src/helper/accepts/accepts.ts +10 -7
  155. package/tests/fixtures/corpus/oss-repos/hono/src/helper/adapter/index.ts +2 -2
  156. package/tests/fixtures/corpus/oss-repos/hono/src/helper/css/index.ts +1 -1
  157. package/tests/fixtures/corpus/oss-repos/hono/src/helper/factory/index.ts +16 -16
  158. package/tests/fixtures/corpus/oss-repos/hono/src/helper/ssg/ssg.ts +2 -2
  159. package/tests/fixtures/corpus/oss-repos/hono/src/hono-base.ts +3 -3
  160. package/tests/fixtures/corpus/oss-repos/hono/src/hono.ts +1 -1
  161. package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/css.ts +2 -2
  162. package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/intrinsic-element/components.ts +1 -1
  163. package/tests/fixtures/corpus/oss-repos/hono/src/jsx/dom/render.ts +7 -7
  164. package/tests/fixtures/corpus/oss-repos/hono/src/jsx/hooks/index.ts +3 -3
  165. package/tests/fixtures/corpus/oss-repos/hono/src/jsx/intrinsic-element/components.ts +1 -1
  166. package/tests/fixtures/corpus/oss-repos/hono/src/jsx/utils.ts +6 -6
  167. package/tests/fixtures/corpus/oss-repos/hono/src/middleware/jsx-renderer/index.ts +3 -3
  168. package/tests/fixtures/corpus/oss-repos/hono/src/middleware/serve-static/index.ts +1 -1
  169. package/tests/fixtures/corpus/oss-repos/hono/src/preset/quick.ts +1 -1
  170. package/tests/fixtures/corpus/oss-repos/hono/src/preset/tiny.ts +1 -1
  171. package/tests/fixtures/corpus/oss-repos/hono/src/router/pattern-router/router.ts +2 -2
  172. package/tests/fixtures/corpus/oss-repos/hono/src/router/reg-exp-router/node.ts +4 -4
  173. package/tests/fixtures/corpus/oss-repos/hono/src/router/reg-exp-router/router.ts +1 -1
  174. package/tests/fixtures/corpus/oss-repos/hono/src/router/trie-router/node.ts +1 -1
  175. package/tests/fixtures/corpus/oss-repos/hono/src/types.ts +166 -169
  176. package/tests/fixtures/corpus/oss-repos/hono/src/utils/body.ts +8 -8
  177. package/tests/fixtures/corpus/oss-repos/hono/src/utils/color.ts +3 -3
  178. package/tests/fixtures/corpus/oss-repos/hono/src/utils/cookie.ts +2 -2
  179. package/tests/fixtures/corpus/oss-repos/hono/src/utils/encode.ts +2 -2
  180. package/tests/fixtures/corpus/oss-repos/hono/src/utils/types.ts +30 -33
  181. package/tests/fixtures/corpus/oss-repos/hono/src/validator/validator.ts +2 -2
  182. package/tests/fixtures/test-server.ts +3 -2
  183. package/tests/helpers/performance-metrics.ts +8 -25
  184. package/tests/helpers/search-relevance.ts +14 -69
  185. package/tests/integration/cli-consistency.test.ts +6 -5
  186. package/tests/integration/python-bridge.test.ts +13 -3
  187. package/tests/mcp/server.test.ts +1 -1
  188. package/tests/services/code-unit.service.test.ts +48 -0
  189. package/tests/services/job.service.test.ts +124 -0
  190. package/tests/services/search.progressive-context.test.ts +2 -2
  191. package/.claude-plugin/plugin.json +0 -13
  192. package/dist/chunk-6PBP5DVD.js.map +0 -1
  193. package/dist/chunk-L2YVNC63.js.map +0 -1
  194. package/dist/chunk-RST4XGRL.js.map +0 -1
  195. package/dist/chunk-WT2DAEO7.js.map +0 -1
  196. package/dist/watch.service-YAIKKDCF.js +0 -7
  197. package/skills/atomic-commits/SKILL.md +0 -77
  198. /package/dist/{watch.service-YAIKKDCF.js.map → watch.service-BJV3TI3F.js.map} +0 -0
@@ -54,8 +54,8 @@ type BlankRecordToNever<T> = T extends any
54
54
  ? T extends null
55
55
  ? null
56
56
  : keyof T extends never
57
- ? never
58
- : T
57
+ ? never
58
+ : T
59
59
  : never
60
60
 
61
61
  type ClientResponseOfEndpoint<T extends Endpoint = Endpoint> = T extends {
@@ -69,15 +69,16 @@ type ClientResponseOfEndpoint<T extends Endpoint = Endpoint> = T extends {
69
69
  export interface ClientResponse<
70
70
  T,
71
71
  U extends number = StatusCode,
72
- F extends ResponseFormat = ResponseFormat
73
- > extends globalThis.Response {
72
+ F extends ResponseFormat = ResponseFormat,
73
+ >
74
+ extends globalThis.Response {
74
75
  readonly body: ReadableStream | null
75
76
  readonly bodyUsed: boolean
76
77
  ok: U extends SuccessStatusCode
77
78
  ? true
78
79
  : U extends Exclude<StatusCode, SuccessStatusCode>
79
- ? false
80
- : boolean
80
+ ? false
81
+ : boolean
81
82
  status: U
82
83
  statusText: string
83
84
  headers: Headers
@@ -87,8 +88,8 @@ export interface ClientResponse<
87
88
  json(): F extends 'text'
88
89
  ? Promise<never>
89
90
  : F extends 'json'
90
- ? Promise<BlankRecordToNever<T>>
91
- : Promise<unknown>
91
+ ? Promise<BlankRecordToNever<T>>
92
+ : Promise<unknown>
92
93
  text(): F extends 'text' ? (T extends string ? Promise<T> : Promise<never>) : Promise<string>
93
94
  blob(): Promise<Blob>
94
95
  formData(): Promise<FormData>
@@ -147,25 +148,26 @@ export type InferRequestOptionsType<T> = T extends (
147
148
  type PathToChain<
148
149
  Path extends string,
149
150
  E extends Schema,
150
- Original extends string = Path
151
+ Original extends string = Path,
151
152
  > = Path extends `/${infer P}`
152
153
  ? PathToChain<P, E, Path>
153
154
  : Path extends `${infer P}/${infer R}`
154
- ? { [K in P]: PathToChain<R, E, Original> }
155
- : {
156
- [K in Path extends '' ? 'index' : Path]: ClientRequest<
157
- E extends Record<string, unknown> ? E[Original] : never
158
- >
159
- }
155
+ ? { [K in P]: PathToChain<R, E, Original> }
156
+ : {
157
+ [K in Path extends '' ? 'index' : Path]: ClientRequest<
158
+ E extends Record<string, unknown> ? E[Original] : never
159
+ >
160
+ }
160
161
 
161
162
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
162
- export type Client<T> = T extends Hono<any, infer S, any>
163
- ? S extends Record<infer K, Schema>
164
- ? K extends string
165
- ? PathToChain<K, S>
163
+ export type Client<T> =
164
+ T extends Hono<any, infer S, any>
165
+ ? S extends Record<infer K, Schema>
166
+ ? K extends string
167
+ ? PathToChain<K, S>
168
+ : never
166
169
  : never
167
170
  : never
168
- : never
169
171
 
170
172
  export type Callback = (opts: CallbackOptions) => unknown
171
173
 
@@ -134,8 +134,10 @@ interface TextRespond {
134
134
  status?: U,
135
135
  headers?: HeaderRecord
136
136
  ): Response & TypedResponse<T, U, 'text'>
137
- <T extends string, U extends StatusCode = StatusCode>(text: T, init?: ResponseInit): Response &
138
- TypedResponse<T, U, 'text'>
137
+ <T extends string, U extends StatusCode = StatusCode>(
138
+ text: T,
139
+ init?: ResponseInit
140
+ ): Response & TypedResponse<T, U, 'text'>
139
141
  }
140
142
 
141
143
  /**
@@ -154,7 +156,7 @@ interface TextRespond {
154
156
  interface JSONRespond {
155
157
  <
156
158
  T extends JSONValue | SimplifyDeepArray<unknown> | InvalidJSONValue,
157
- U extends StatusCode = StatusCode
159
+ U extends StatusCode = StatusCode,
158
160
  >(
159
161
  object: T,
160
162
  status?: U,
@@ -162,7 +164,7 @@ interface JSONRespond {
162
164
  ): JSONRespondReturn<T, U>
163
165
  <
164
166
  T extends JSONValue | SimplifyDeepArray<unknown> | InvalidJSONValue,
165
- U extends StatusCode = StatusCode
167
+ U extends StatusCode = StatusCode,
166
168
  >(
167
169
  object: T,
168
170
  init?: ResponseInit
@@ -177,7 +179,7 @@ interface JSONRespond {
177
179
  */
178
180
  type JSONRespondReturn<
179
181
  T extends JSONValue | SimplifyDeepArray<unknown> | InvalidJSONValue,
180
- U extends StatusCode
182
+ U extends StatusCode,
181
183
  > = Response &
182
184
  TypedResponse<
183
185
  SimplifyDeepArray<T> extends JSONValue
@@ -205,9 +207,10 @@ interface HTMLRespond {
205
207
  status?: StatusCode,
206
208
  headers?: HeaderRecord
207
209
  ): T extends string ? Response : Promise<Response>
208
- <T extends string | Promise<string>>(html: T, init?: ResponseInit): T extends string
209
- ? Response
210
- : Promise<Response>
210
+ <T extends string | Promise<string>>(
211
+ html: T,
212
+ init?: ResponseInit
213
+ ): T extends string ? Response : Promise<Response>
211
214
  }
212
215
 
213
216
  /**
@@ -345,7 +348,7 @@ export class Context<
345
348
  E extends Env = any,
346
349
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
347
350
  P extends string = any,
348
- I extends Input = {}
351
+ I extends Input = {},
349
352
  > {
350
353
  #rawRequest: Request
351
354
  #req: HonoRequest<P, I['out']> | undefined
@@ -835,7 +838,7 @@ export class Context<
835
838
  */
836
839
  json: JSONRespond = <
837
840
  T extends JSONValue | SimplifyDeepArray<unknown> | InvalidJSONValue,
838
- U extends StatusCode = StatusCode
841
+ U extends StatusCode = StatusCode,
839
842
  >(
840
843
  object: T,
841
844
  arg?: U | ResponseInit,
@@ -34,13 +34,16 @@ export const parseAccept = (acceptHeader: string): Accept[] => {
34
34
  const params = parts.slice(1) // ['q=0.9', 'image/webp']
35
35
  const q = params.find((param) => param.startsWith('q='))
36
36
 
37
- const paramsObject = params.reduce((acc, param) => {
38
- const keyValue = param.split('=')
39
- const key = keyValue[0].trim()
40
- const value = keyValue[1].trim()
41
- acc[key] = value
42
- return acc
43
- }, {} as { [key: string]: string })
37
+ const paramsObject = params.reduce(
38
+ (acc, param) => {
39
+ const keyValue = param.split('=')
40
+ const key = keyValue[0].trim()
41
+ const value = keyValue[1].trim()
42
+ acc[key] = value
43
+ return acc
44
+ },
45
+ {} as { [key: string]: string }
46
+ )
44
47
 
45
48
  return {
46
49
  type: type,
@@ -28,8 +28,8 @@ export const env = <T extends Record<string, unknown>, C extends Context = Conte
28
28
  },
29
29
  workerd: () => c.env,
30
30
  // On Fastly Compute, you can use the ConfigStore to manage user-defined data.
31
- fastly: () => ({} as T),
32
- other: () => ({} as T),
31
+ fastly: () => ({}) as T,
32
+ other: () => ({}) as T,
33
33
  }
34
34
 
35
35
  return runtimeEnvHandlers[runtime]()
@@ -26,7 +26,7 @@ type CssClassName = HtmlEscapedString & CssClassNameCommon
26
26
 
27
27
  type usedClassNameData = [
28
28
  Record<string, string>, // class name to add
29
- Record<string, true> // class name already added
29
+ Record<string, true>, // class name already added
30
30
  ]
31
31
 
32
32
  interface CssType {
@@ -10,9 +10,9 @@ import type { Env, H, HandlerResponse, Input, MiddlewareHandler } from '../../ty
10
10
  type InitApp<E extends Env = Env> = (app: Hono<E>) => void
11
11
 
12
12
  export interface CreateHandlersInterface<E extends Env, P extends string> {
13
- <I extends Input = {}, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>): [
14
- H<E, P, I, R>
15
- ]
13
+ <I extends Input = {}, R extends HandlerResponse<any> = any>(
14
+ handler1: H<E, P, I, R>
15
+ ): [H<E, P, I, R>]
16
16
  // handler x2
17
17
  <I extends Input = {}, I2 extends Input = I, R extends HandlerResponse<any> = any>(
18
18
  handler1: H<E, P, I, R>,
@@ -24,7 +24,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
24
24
  I extends Input = {},
25
25
  I2 extends Input = I,
26
26
  I3 extends Input = I & I2,
27
- R extends HandlerResponse<any> = any
27
+ R extends HandlerResponse<any> = any,
28
28
  >(
29
29
  handler1: H<E, P, I, R>,
30
30
  handler2: H<E, P, I2, R>,
@@ -37,7 +37,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
37
37
  I2 extends Input = I,
38
38
  I3 extends Input = I & I2,
39
39
  I4 extends Input = I & I2 & I3,
40
- R extends HandlerResponse<any> = any
40
+ R extends HandlerResponse<any> = any,
41
41
  >(
42
42
  handler1: H<E, P, I, R>,
43
43
  handler2: H<E, P, I2, R>,
@@ -52,7 +52,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
52
52
  I3 extends Input = I & I2,
53
53
  I4 extends Input = I & I2 & I3,
54
54
  I5 extends Input = I & I2 & I3 & I4,
55
- R extends HandlerResponse<any> = any
55
+ R extends HandlerResponse<any> = any,
56
56
  >(
57
57
  handler1: H<E, P, I, R>,
58
58
  handler2: H<E, P, I2, R>,
@@ -69,7 +69,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
69
69
  I4 extends Input = I & I2 & I3,
70
70
  I5 extends Input = I & I2 & I3 & I4,
71
71
  I6 extends Input = I & I2 & I3 & I4 & I5,
72
- R extends HandlerResponse<any> = any
72
+ R extends HandlerResponse<any> = any,
73
73
  >(
74
74
  handler1: H<E, P, I, R>,
75
75
  handler2: H<E, P, I2, R>,
@@ -88,7 +88,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
88
88
  I5 extends Input = I & I2 & I3 & I4,
89
89
  I6 extends Input = I & I2 & I3 & I4 & I5,
90
90
  I7 extends Input = I & I2 & I3 & I4 & I5 & I6,
91
- R extends HandlerResponse<any> = any
91
+ R extends HandlerResponse<any> = any,
92
92
  >(
93
93
  handler1: H<E, P, I, R>,
94
94
  handler2: H<E, P, I2, R>,
@@ -104,7 +104,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
104
104
  H<E, P, I4, R>,
105
105
  H<E, P, I5, R>,
106
106
  H<E, P, I6, R>,
107
- H<E, P, I7, R>
107
+ H<E, P, I7, R>,
108
108
  ]
109
109
 
110
110
  // handler x8
@@ -117,7 +117,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
117
117
  I6 extends Input = I & I2 & I3 & I4 & I5,
118
118
  I7 extends Input = I & I2 & I3 & I4 & I5 & I6,
119
119
  I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7,
120
- R extends HandlerResponse<any> = any
120
+ R extends HandlerResponse<any> = any,
121
121
  >(
122
122
  handler1: H<E, P, I, R>,
123
123
  handler2: H<E, P, I2, R>,
@@ -135,7 +135,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
135
135
  H<E, P, I5, R>,
136
136
  H<E, P, I6, R>,
137
137
  H<E, P, I7, R>,
138
- H<E, P, I8, R>
138
+ H<E, P, I8, R>,
139
139
  ]
140
140
 
141
141
  // handler x9
@@ -149,7 +149,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
149
149
  I7 extends Input = I & I2 & I3 & I4 & I5 & I6,
150
150
  I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7,
151
151
  I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8,
152
- R extends HandlerResponse<any> = any
152
+ R extends HandlerResponse<any> = any,
153
153
  >(
154
154
  handler1: H<E, P, I, R>,
155
155
  handler2: H<E, P, I2, R>,
@@ -169,7 +169,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
169
169
  H<E, P, I6, R>,
170
170
  H<E, P, I7, R>,
171
171
  H<E, P, I8, R>,
172
- H<E, P, I9, R>
172
+ H<E, P, I9, R>,
173
173
  ]
174
174
 
175
175
  // handler x10
@@ -184,7 +184,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
184
184
  I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7,
185
185
  I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8,
186
186
  I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9,
187
- R extends HandlerResponse<any> = any
187
+ R extends HandlerResponse<any> = any,
188
188
  >(
189
189
  handler1: H<E, P, I, R>,
190
190
  handler2: H<E, P, I2, R>,
@@ -206,7 +206,7 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
206
206
  H<E, P, I7, R>,
207
207
  H<E, P, I8, R>,
208
208
  H<E, P, I9, R>,
209
- H<E, P, I10, R>
209
+ H<E, P, I10, R>,
210
210
  ]
211
211
  }
212
212
 
@@ -240,7 +240,7 @@ export const createFactory = <E extends Env = any, P extends string = any>(init?
240
240
  export const createMiddleware = <
241
241
  E extends Env = any,
242
242
  P extends string = string,
243
- I extends Input = {}
243
+ I extends Input = {},
244
244
  >(
245
245
  middleware: MiddlewareHandler<E, P, I>
246
246
  ): MiddlewareHandler<E, P, I> => createFactory<E, P>().createMiddleware<I>(middleware)
@@ -169,7 +169,7 @@ export interface ToSSGOptions {
169
169
  export const fetchRoutesContent = function* <
170
170
  E extends Env = Env,
171
171
  S extends Schema = {},
172
- BasePath extends string = '/'
172
+ BasePath extends string = '/',
173
173
  >(
174
174
  app: Hono<E, S, BasePath>,
175
175
  beforeRequestHook?: BeforeRequestHook,
@@ -323,7 +323,7 @@ export interface ToSSGInterface {
323
323
  export interface ToSSGAdaptorInterface<
324
324
  E extends Env = Env,
325
325
  S extends Schema = {},
326
- BasePath extends string = '/'
326
+ BasePath extends string = '/',
327
327
  > {
328
328
  (app: Hono<E, S, BasePath>, options?: ToSSGOptions): Promise<ToSSGResult>
329
329
  }
@@ -171,7 +171,7 @@ class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string =
171
171
  const strict = options.strict ?? true
172
172
  delete options.strict
173
173
  Object.assign(this, options)
174
- this.getPath = strict ? options.getPath ?? getPath : getPathNoStrict
174
+ this.getPath = strict ? (options.getPath ?? getPath) : getPathNoStrict
175
175
  }
176
176
 
177
177
  private clone(): Hono<E, S, BasePath> {
@@ -208,7 +208,7 @@ class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string =
208
208
  SubPath extends string,
209
209
  SubEnv extends Env,
210
210
  SubSchema extends Schema,
211
- SubBasePath extends string
211
+ SubBasePath extends string,
212
212
  >(
213
213
  path: SubPath,
214
214
  app: Hono<SubEnv, SubSchema, SubBasePath>
@@ -434,7 +434,7 @@ class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string =
434
434
  resolved || (c.finalized ? c.res : this.notFoundHandler(c))
435
435
  )
436
436
  .catch((err: Error) => this.handleError(err, c))
437
- : res ?? this.notFoundHandler(c)
437
+ : (res ?? this.notFoundHandler(c))
438
438
  }
439
439
 
440
440
  const composed = compose<Context>(matchResult[0], this.errorHandler, this.notFoundHandler)
@@ -16,7 +16,7 @@ import type { BlankEnv, BlankSchema, Env, Schema } from './types'
16
16
  export class Hono<
17
17
  E extends Env = BlankEnv,
18
18
  S extends Schema = BlankSchema,
19
- BasePath extends string = '/'
19
+ BasePath extends string = '/',
20
20
  > extends HonoBase<E, S, BasePath> {
21
21
  /**
22
22
  * Creates an instance of the Hono class.
@@ -66,7 +66,7 @@ interface CreateCssJsxDomObjectsType {
66
66
  {
67
67
  toString(this: CssClassName): string
68
68
  },
69
- FC<PropsWithChildren<void>>
69
+ FC<PropsWithChildren<void>>,
70
70
  ]
71
71
  }
72
72
 
@@ -133,7 +133,7 @@ export const createCssJsxDomObjects: CreateCssJsxDomObjectsType = ({ id }) => {
133
133
  ),
134
134
  },
135
135
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
136
- } as any)
136
+ }) as any
137
137
 
138
138
  return [cssObject, Style] as const
139
139
  }
@@ -108,7 +108,7 @@ const documentMetadataTag = (
108
108
  existingElements = head.querySelectorAll<HTMLElement>(tag)
109
109
  }
110
110
 
111
- precedence = supportSort ? precedence ?? '' : undefined
111
+ precedence = supportSort ? (precedence ?? '') : undefined
112
112
  if (supportSort) {
113
113
  restProps[dataPrecedenceAttr] = precedence
114
114
  }
@@ -51,7 +51,7 @@ export type NodeObject = {
51
51
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
52
  any[][], // stash for hooks
53
53
  LocalJSXContexts, // context
54
- [Context, Function, NodeObject] // [context, error handler, node] for closest error boundary or suspense
54
+ [Context, Function, NodeObject], // [context, error handler, node] for closest error boundary or suspense
55
55
  ]
56
56
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
57
  | [number, any[][]]
@@ -88,7 +88,7 @@ export type Context =
88
88
  UpdateHook, // update hook
89
89
  boolean, // is in view transition
90
90
  boolean, // is in top level render
91
- [Context, Function, NodeObject][] // [context, error handler, node] stack for this context
91
+ [Context, Function, NodeObject][], // [context, error handler, node] stack for this context
92
92
  ]
93
93
  | [PendingType, boolean, UpdateHook, boolean]
94
94
  | [PendingType, boolean, UpdateHook]
@@ -462,8 +462,8 @@ export const build = (context: Context, node: NodeObject, children?: Child[]): v
462
462
  const oldVChildren: Node[] | undefined = buildWithPreviousChildren
463
463
  ? [...(node.pC as Node[])]
464
464
  : node.vC
465
- ? [...node.vC]
466
- : undefined
465
+ ? [...node.vC]
466
+ : undefined
467
467
  const vChildren: Node[] = []
468
468
  let prevNode: Node | undefined
469
469
  for (let i = 0; i < children.length; i++) {
@@ -491,8 +491,8 @@ export const build = (context: Context, node: NodeObject, children?: Child[]): v
491
491
  isNodeString(child)
492
492
  ? (c) => isNodeString(c)
493
493
  : child.key !== undefined
494
- ? (c) => c.key === (child as Node).key && c.tag === (child as Node).tag
495
- : (c) => c.tag === (child as Node).tag
494
+ ? (c) => c.key === (child as Node).key && c.tag === (child as Node).tag
495
+ : (c) => c.tag === (child as Node).tag
496
496
  )
497
497
 
498
498
  if (i !== -1) {
@@ -769,4 +769,4 @@ export const createPortal = (children: Child, container: HTMLElement, key?: stri
769
769
  e: container,
770
770
  p: 1,
771
771
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
772
- } as any)
772
+ }) as any
@@ -16,7 +16,7 @@ export type EffectData = [
16
16
  (() => void | (() => void)) | undefined, // layout effect
17
17
  (() => void) | undefined, // cleanup
18
18
  (() => void) | undefined, // effect
19
- (() => void) | undefined // insertion effect
19
+ (() => void) | undefined, // insertion effect
20
20
  ]
21
21
 
22
22
  const resolvedPromiseValueMap: WeakMap<Promise<unknown>, unknown> = new WeakMap<
@@ -36,7 +36,7 @@ const isDepsChanged = (
36
36
  let viewTransitionState:
37
37
  | [
38
38
  boolean, // isUpdating
39
- boolean // useViewTransition() is called
39
+ boolean, // useViewTransition() is called
40
40
  ]
41
41
  | undefined = undefined
42
42
 
@@ -208,7 +208,7 @@ export const useState: UseStateType = <T>(
208
208
  if (pendingStack.length) {
209
209
  const [pendingType, pendingPromise] = pendingStack.at(-1) as [
210
210
  PendingType | 3,
211
- Promise<void>
211
+ Promise<void>,
212
212
  ]
213
213
  Promise.all([
214
214
  pendingType === 3
@@ -85,7 +85,7 @@ const documentMetadataTag = (tag: string, children: Child, props: Props, sort: b
85
85
 
86
86
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
87
87
  let { precedence, blocking, ...restProps } = props
88
- precedence = sort ? precedence ?? '' : undefined
88
+ precedence = sort ? (precedence ?? '') : undefined
89
89
  if (sort) {
90
90
  restProps[dataPrecedenceAttr] = precedence
91
91
  }
@@ -25,12 +25,12 @@ export const styleObjectForEach = (
25
25
  v == null
26
26
  ? null
27
27
  : typeof v === 'number'
28
- ? !key.match(
29
- /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/
30
- )
31
- ? `${v}px`
32
- : `${v}`
33
- : v
28
+ ? !key.match(
29
+ /^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/
30
+ )
31
+ ? `${v}px`
32
+ : `${v}`
33
+ : v
34
34
  )
35
35
  }
36
36
  }
@@ -37,8 +37,8 @@ const createRenderer =
37
37
  typeof options?.docType === 'string'
38
38
  ? options.docType
39
39
  : options?.docType === false
40
- ? ''
41
- : '<!DOCTYPE html>'
40
+ ? ''
41
+ : '<!DOCTYPE html>'
42
42
 
43
43
  const currentLayout = component
44
44
  ? jsx(
@@ -148,7 +148,7 @@ export const jsxRenderer = (
148
148
  export const useRequestContext = <
149
149
  E extends Env = any,
150
150
  P extends string = any,
151
- I extends Input = {}
151
+ I extends Input = {},
152
152
  >(): Context<E, P, I> => {
153
153
  const c = useContext(RequestContext)
154
154
  if (!c) {
@@ -97,7 +97,7 @@ export const serveStatic = <E extends Env = Env>(
97
97
  }
98
98
 
99
99
  const mimeType = options.mimes
100
- ? getMimeType(path, options.mimes) ?? getMimeType(path)
100
+ ? (getMimeType(path, options.mimes) ?? getMimeType(path))
101
101
  : getMimeType(path)
102
102
 
103
103
  if (mimeType) {
@@ -13,7 +13,7 @@ import type { BlankEnv, BlankSchema, Env, Schema } from '../types'
13
13
  export class Hono<
14
14
  E extends Env = BlankEnv,
15
15
  S extends Schema = BlankSchema,
16
- BasePath extends string = '/'
16
+ BasePath extends string = '/',
17
17
  > extends HonoBase<E, S, BasePath> {
18
18
  constructor(options: HonoOptions<E> = {}) {
19
19
  super(options)
@@ -11,7 +11,7 @@ import type { BlankEnv, BlankSchema, Env, Schema } from '../types'
11
11
  export class Hono<
12
12
  E extends Env = BlankEnv,
13
13
  S extends Schema = BlankSchema,
14
- BasePath extends string = '/'
14
+ BasePath extends string = '/',
15
15
  > extends HonoBase<E, S, BasePath> {
16
16
  constructor(options: HonoOptions<E> = {}) {
17
17
  super(options)
@@ -23,8 +23,8 @@ export class PatternRouter<T> implements Router<T> {
23
23
  return match
24
24
  ? `/(?<${match[1]}>${match[2] || '[^/]+'})`
25
25
  : part === '/*'
26
- ? '/[^/]+'
27
- : part.replace(/[.\\+*[^\]$()]/g, '\\$&')
26
+ ? '/[^/]+'
27
+ : part.replace(/[.\\+*[^\]$()]/g, '\\$&')
28
28
  }
29
29
  )
30
30
 
@@ -73,8 +73,8 @@ export class Node {
73
73
  ? ['', '', ONLY_WILDCARD_REG_EXP_STR] // '*' matches to all the trailing paths
74
74
  : ['', '', LABEL_REG_EXP_STR]
75
75
  : token === '/*'
76
- ? ['', '', TAIL_WILDCARD_REG_EXP_STR] // '/path/to/*' is /\/path\/to(?:|/.*)$
77
- : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/)
76
+ ? ['', '', TAIL_WILDCARD_REG_EXP_STR] // '/path/to/*' is /\/path\/to(?:|/.*)$
77
+ : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/)
78
78
 
79
79
  let node
80
80
  if (pattern) {
@@ -138,8 +138,8 @@ export class Node {
138
138
  (typeof c.varIndex === 'number'
139
139
  ? `(${k})@${c.varIndex}`
140
140
  : regExpMetaChars.has(k)
141
- ? `\\${k}`
142
- : k) + c.buildRegExpStr()
141
+ ? `\\${k}`
142
+ : k) + c.buildRegExpStr()
143
143
  )
144
144
  })
145
145
 
@@ -259,7 +259,7 @@ export class RegExpRouter<T> implements Router<T> {
259
259
  routes.push(
260
260
  ...(Object.keys(r[METHOD_NAME_ALL]).map((path) => [path, r[METHOD_NAME_ALL][path]]) as [
261
261
  string,
262
- HandlerWithMetadata<T>[]
262
+ HandlerWithMetadata<T>[],
263
263
  ][])
264
264
  )
265
265
  }
@@ -103,7 +103,7 @@ export class Node<T> {
103
103
  handlerSet.possibleKeys.forEach((key) => {
104
104
  const processed = processedSet[handlerSet.name]
105
105
  handlerSet.params[key] =
106
- params[key] && !processed ? params[key] : nodeParams[key] ?? params[key]
106
+ params[key] && !processed ? params[key] : (nodeParams[key] ?? params[key])
107
107
  processedSet[handlerSet.name] = true
108
108
  })
109
109
  handlerSets.push(handlerSet)