Skip to content

Commit 882e75a

Browse files
authored
chore(april-fool): change hono is cool to hono is hot (#4035)
* april-fool: change `hono is cool` to `hono is hot` * chore: format * fix: test * chore * Update accept.test.ts * chore * chore * chore * chore * chore * chore * chore * all changed * chore: format
1 parent 2c3e1ae commit 882e75a

File tree

20 files changed

+50
-57
lines changed

20 files changed

+50
-57
lines changed

Diff for: docs/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ I want to write the code as I like.
1616
So, if you propose great ideas, but I do not appropriate them, the idea may not be accepted.
1717

1818
Although, don't worry!
19-
Hono is tested well, polished by the contributors, and used by many developers. And I'll try my best to make Hono cool, beautiful, and ultrafast.
19+
Hono is tested well, polished by the contributors, and used by many developers. And I'll try my best to make Hono cool and hot, beautiful, and ultrafast.
2020

2121
## Installing dependencies
2222

Diff for: runtime-tests/deno/middleware.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Deno.test('Basic Auth Middleware', async () => {
1313
const app = new Hono()
1414

1515
const username = 'hono'
16-
const password = 'acoolproject'
16+
const password = 'ahotproject'
1717

1818
app.use(
1919
'/auth/*',
@@ -29,7 +29,7 @@ Deno.test('Basic Auth Middleware', async () => {
2929
assertEquals(res.status, 401)
3030
assertEquals(await res.text(), 'Unauthorized')
3131

32-
const credential = 'aG9ubzphY29vbHByb2plY3Q='
32+
const credential = 'aG9ubzphaG90cHJvamVjdA=='
3333

3434
const req = new Request('http://localhost/auth/a')
3535
req.headers.set('Authorization', `Basic ${credential}`)

Diff for: runtime-tests/lambda-edge/index.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable quotes */
21
import type {
32
Callback,
43
CloudFrontConfig,

Diff for: src/adapter/cloudflare-pages/handler.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function createEventContext(
1818
env: {
1919
...context.env,
2020
ASSETS: { fetch: vi.fn(), ...context.env?.ASSETS },
21-
TOKEN: context.env?.TOKEN ?? 'HONOISCOOL',
21+
TOKEN: context.env?.TOKEN ?? 'HONOISHOT',
2222
},
2323
functionPath: '_worker.js',
2424
next: vi.fn(),
@@ -35,7 +35,7 @@ describe('Adapter for Cloudflare Pages', () => {
3535
const request = new Request('http://localhost/api/foo')
3636
const env = {
3737
ASSETS: { fetch },
38-
TOKEN: 'HONOISCOOL',
38+
TOKEN: 'HONOISHOT',
3939
}
4040
const waitUntil = vi.fn()
4141
const passThroughOnException = vi.fn()
@@ -59,7 +59,7 @@ describe('Adapter for Cloudflare Pages', () => {
5959
)
6060
expect(res.status).toBe(200)
6161
expect(await res.json()).toEqual({
62-
TOKEN: 'HONOISCOOL',
62+
TOKEN: 'HONOISHOT',
6363
requestURL: 'http://localhost/api/foo',
6464
})
6565
})
@@ -250,7 +250,7 @@ describe('serveStatic()', () => {
250250
const request = new Request('http://localhost/foo.png')
251251
const env = {
252252
ASSETS: { fetch: assetsFetch },
253-
TOKEN: 'HONOISCOOL',
253+
TOKEN: 'HONOISHOT',
254254
}
255255

256256
const eventContext = createEventContext({ request, env })
@@ -269,7 +269,7 @@ describe('serveStatic()', () => {
269269
const request = new Request('http://localhost/foo.png')
270270
const env = {
271271
ASSETS: { fetch: assetsFetch },
272-
TOKEN: 'HONOISCOOL',
272+
TOKEN: 'HONOISHOT',
273273
}
274274

275275
const eventContext = createEventContext({ request, env })

Diff for: src/adapter/service-worker/handler.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ beforeAll(() => {
1010
function fetch(this: undefined | typeof globalThis, arg0: string | Request) {
1111
if (this !== globalThis) {
1212
const error = new Error(
13-
// eslint-disable-next-line quotes
1413
"Failed to execute 'fetch' on 'WorkerGlobalScope': Illegal invocation"
1514
)
1615
error.name = 'TypeError'

Diff for: src/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ export class Context<
575575
* @example
576576
* ```ts
577577
* app.use('*', async (c, next) => {
578-
* c.set('message', 'Hono is cool!!')
578+
* c.set('message', 'Hono is hot!!')
579579
* await next()
580580
* })
581581
* ```

Diff for: src/helper/css/common.case.test.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable quotes */
21
/** @jsxImportSource ../../jsx */
32
import type {
43
Style as StyleComponent,

Diff for: src/helper/css/common.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const toHash = (str: string): string => {
5151

5252
const cssStringReStr: string = [
5353
'"(?:(?:\\\\[\\s\\S]|[^"\\\\])*)"', // double quoted string
54-
// eslint-disable-next-line quotes
54+
5555
"'(?:(?:\\\\[\\s\\S]|[^'\\\\])*)'", // single quoted string
5656
].join('|')
5757
const minifyCssRe: RegExp = new RegExp(

Diff for: src/helper/html/index.test.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { html, raw } from '.'
44
describe('Tagged Template Literals', () => {
55
it('Should escape special characters', () => {
66
const name = 'John "Johnny" Smith'
7-
// eslint-disable-next-line quotes
7+
88
expect(html`<p>I'm ${name}.</p>`.toString()).toBe("<p>I'm John &quot;Johnny&quot; Smith.</p>")
99
})
1010

@@ -35,7 +35,7 @@ describe('Tagged Template Literals', () => {
3535
const name = Promise.resolve('John "Johnny" Smith')
3636
const res = html`<p>I'm ${name}.</p>`
3737
expect(res).toBeInstanceOf(Promise)
38-
// eslint-disable-next-line quotes
38+
3939
expect((await res).toString()).toBe("<p>I'm John &quot;Johnny&quot; Smith.</p>")
4040
})
4141

@@ -59,10 +59,9 @@ describe('Tagged Template Literals', () => {
5959
])
6060
const res = html`<p>I'm ${name}.</p>`
6161
expect(res).toBeInstanceOf(Promise)
62-
// eslint-disable-next-line quotes
62+
6363
expect((await res).toString()).toBe("<p>I'm Hono.</p>")
6464
expect(await resolveCallback(await res, HtmlEscapedCallbackPhase.Stringify, false, {})).toBe(
65-
// eslint-disable-next-line quotes
6665
"<p>I'm Hono!.</p>"
6766
)
6867
})
@@ -73,7 +72,6 @@ describe('raw', () => {
7372
it('Should be marked as escaped.', () => {
7473
const name = 'John &quot;Johnny&quot; Smith'
7574
expect(html`<p>I'm ${raw(name)}.</p>`.toString()).toBe(
76-
// eslint-disable-next-line quotes
7775
"<p>I'm John &quot;Johnny&quot; Smith.</p>"
7876
)
7977
})

Diff for: src/jsx/dom/css.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const splitRule = (rule: string): string[] => {
2727
const char = rule[i]
2828

2929
// consume quote
30-
// eslint-disable-next-line quotes
30+
3131
if (char === "'" || char === '"') {
3232
const quote = char
3333
i++
@@ -44,7 +44,6 @@ const splitRule = (rule: string): string[] => {
4444
}
4545

4646
// comments are removed from the rule in advance
47-
4847
if (char === '{') {
4948
depth++
5049
continue

Diff for: src/middleware/basic-auth/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type BasicAuthOptions =
4949
* '/auth/*',
5050
* basicAuth({
5151
* username: 'hono',
52-
* password: 'acoolproject',
52+
* password: 'ahotproject',
5353
* })
5454
* )
5555
*

Diff for: src/middleware/bearer-auth/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type BearerAuthOptions =
6060
* ```ts
6161
* const app = new Hono()
6262
*
63-
* const token = 'honoiscool'
63+
* const token = 'honoishot'
6464
*
6565
* app.use('/api/*', bearerAuth({ token }))
6666
*

Diff for: src/middleware/body-limit/index.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ const buildRequestInit = (init: RequestInit = {}): RequestInit & { duplex: 'half
2020
describe('Body Limit Middleware', () => {
2121
let app: Hono
2222

23-
const exampleText = 'hono is so cool' // 15byte
24-
const exampleText2 = 'hono is so cool and cute' // 24byte
23+
const exampleText = 'hono is so hot' // 14byte
24+
const exampleText2 = 'hono is so hot and cute' // 23byte
2525

2626
beforeEach(() => {
2727
app = new Hono()
28-
app.use('*', bodyLimit({ maxSize: 15 }))
28+
app.use('*', bodyLimit({ maxSize: 14 }))
2929
app.get('/', (c) => c.text('index'))
3030
app.post('/body-limit-15byte', async (c) => {
3131
return c.text(await c.req.raw.text())

Diff for: src/middleware/context-storage/index.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('Context Storage Middleware', () => {
1212

1313
app.use(contextStorage())
1414
app.use(async (c, next) => {
15-
c.set('message', 'Hono is cool!!')
15+
c.set('message', 'Hono is hot!!')
1616
await next()
1717
})
1818
app.get('/', (c) => {
@@ -25,6 +25,6 @@ describe('Context Storage Middleware', () => {
2525

2626
it('Should get context', async () => {
2727
const res = await app.request('/')
28-
expect(await res.text()).toBe('Hono is cool!!')
28+
expect(await res.text()).toBe('Hono is hot!!')
2929
})
3030
})

Diff for: src/middleware/context-storage/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const asyncLocalStorage = new AsyncLocalStorage<Context>()
2929
* app.use(contextStorage())
3030
*
3131
* app.use(async (c, next) => {
32-
* c.set('message', 'Hono is cool!!)
32+
* c.set('message', 'Hono is hot!!)
3333
* await next()
3434
* })
3535
*

Diff for: src/middleware/etag/index.test.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ describe('Etag Middleware', () => {
66
const app = new Hono()
77
app.use('/etag/*', etag())
88
app.get('/etag/abc', (c) => {
9-
return c.text('Hono is cool')
9+
return c.text('Hono is hot')
1010
})
1111
app.get('/etag/def', (c) => {
12-
return c.json({ message: 'Hono is cool' })
12+
return c.json({ message: 'Hono is hot' })
1313
})
1414
let res = await app.request('http://localhost/etag/abc')
1515
expect(res.headers.get('ETag')).not.toBeFalsy()
16-
expect(res.headers.get('ETag')).toBe('"4e32298b1cb4edc595237405e5b696e105c2399a"')
16+
expect(res.headers.get('ETag')).toBe('"d104fafdb380655dab607c9bddc4d4982037afa1"')
1717

1818
res = await app.request('http://localhost/etag/def')
1919
expect(res.headers.get('ETag')).not.toBeFalsy()
20-
expect(res.headers.get('ETag')).toBe('"4515561204e8269cb4468d5b39288d8f2482dcfe"')
20+
expect(res.headers.get('ETag')).toBe('"67340414f1a52c4669a6cec71f0ae04532b29249"')
2121
})
2222

2323
it('Should return etag header with another algorithm', async () => {
@@ -35,21 +35,21 @@ describe('Etag Middleware', () => {
3535
})
3636
)
3737
app.get('/etag/abc', (c) => {
38-
return c.text('Hono is cool')
38+
return c.text('Hono is hot')
3939
})
4040
app.get('/etag/def', (c) => {
41-
return c.json({ message: 'Hono is cool' })
41+
return c.json({ message: 'Hono is hot' })
4242
})
4343
let res = await app.request('http://localhost/etag/abc')
4444
expect(res.headers.get('ETag')).not.toBeFalsy()
4545
expect(res.headers.get('ETag')).toBe(
46-
'"ee7e84f92c4f54fec768123ac23003a6eb8437db95bcfbfc35db477af1ccb49e"'
46+
'"ed00834279b4fd5dcdc7ab6a5c9774de8afb2de30da2c8e0f17d0952839b5370"'
4747
)
4848

4949
res = await app.request('http://localhost/etag/def')
5050
expect(res.headers.get('ETag')).not.toBeFalsy()
5151
expect(res.headers.get('ETag')).toBe(
52-
'"6ae7438c67f07b60b2ab069dbce206b00d3528c690840a77e0222d37398a8547"'
52+
'"83b61a767db6e22afea68dd645b4d4597a06276c8ce7f895ad865cf4ab154ec4"'
5353
)
5454
})
5555

@@ -159,12 +159,12 @@ describe('Etag Middleware', () => {
159159
const app = new Hono()
160160
app.use('/etag/*', etag({ weak: true }))
161161
app.get('/etag/abc', (c) => {
162-
return c.text('Hono is cool')
162+
return c.text('Hono is hot')
163163
})
164164

165165
const res = await app.request('http://localhost/etag/abc')
166166
expect(res.headers.get('ETag')).not.toBeFalsy()
167-
expect(res.headers.get('ETag')).toBe('W/"4e32298b1cb4edc595237405e5b696e105c2399a"')
167+
expect(res.headers.get('ETag')).toBe('W/"d104fafdb380655dab607c9bddc4d4982037afa1"')
168168
})
169169

170170
it('Should handle conditional GETs', async () => {
@@ -222,11 +222,11 @@ describe('Etag Middleware', () => {
222222
const app = new Hono()
223223
app.use('/etag/*', etag())
224224
app.use('/etag/*', etag())
225-
app.get('/etag/abc', (c) => c.text('Hono is cool'))
225+
app.get('/etag/abc', (c) => c.text('Hono is hot'))
226226

227227
const res = await app.request('http://localhost/etag/abc')
228228
expect(res.headers.get('ETag')).not.toBeFalsy()
229-
expect(res.headers.get('ETag')).toBe('"4e32298b1cb4edc595237405e5b696e105c2399a"')
229+
expect(res.headers.get('ETag')).toBe('"d104fafdb380655dab607c9bddc4d4982037afa1"')
230230
})
231231

232232
it('Should not override ETag headers from upstream', async () => {
@@ -251,20 +251,20 @@ describe('Etag Middleware', () => {
251251
})
252252
)
253253
app.get('/etag', (c) => {
254-
return c.text('Hono is cool', 200, {
254+
return c.text('Hono is hot', 200, {
255255
'cache-control': cacheControl,
256256
'x-message-retain': message,
257257
'x-message': message,
258258
})
259259
})
260260
const res = await app.request('/etag', {
261261
headers: {
262-
'If-None-Match': '"4e32298b1cb4edc595237405e5b696e105c2399a"',
262+
'If-None-Match': '"d104fafdb380655dab607c9bddc4d4982037afa1"',
263263
},
264264
})
265265
expect(res.status).toBe(304)
266266
expect(res.headers.get('ETag')).not.toBeFalsy()
267-
expect(res.headers.get('ETag')).toBe('"4e32298b1cb4edc595237405e5b696e105c2399a"')
267+
expect(res.headers.get('ETag')).toBe('"d104fafdb380655dab607c9bddc4d4982037afa1"')
268268
expect(res.headers.get('Cache-Control')).toBe(cacheControl)
269269
expect(res.headers.get('x-message-retain')).toBe(message)
270270
expect(res.headers.get('x-message')).toBeFalsy()
@@ -288,7 +288,7 @@ describe('Etag Middleware', () => {
288288
it('Should not generate etag', async () => {
289289
const app = new Hono()
290290
app.use('/etag/*', etag())
291-
app.get('/etag/no-digest', (c) => c.text('Hono is cool'))
291+
app.get('/etag/no-digest', (c) => c.text('Hono is hot'))
292292
const res = await app.request('/etag/no-digest')
293293
expect(res.status).toBe(200)
294294
expect(res.headers.get('ETag')).toBeNull()

Diff for: src/middleware/etag/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function initializeGenerator(
6868
*
6969
* app.use('/etag/*', etag())
7070
* app.get('/etag/abc', (c) => {
71-
* return c.text('Hono is cool')
71+
* return c.text('Hono is hot')
7272
* })
7373
* ```
7474
*/

Diff for: src/middleware/request-id/index.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ describe('Request ID Middleware', () => {
2020
it('Should return custom request id', async () => {
2121
const res = await app.request('http://localhost/requestId', {
2222
headers: {
23-
'X-Request-Id': 'hono-is-cool',
23+
'X-Request-Id': 'hono-is-hot',
2424
},
2525
})
2626
expect(res).not.toBeNull()
2727
expect(res.status).toBe(200)
28-
expect(res.headers.get('X-Request-Id')).toBe('hono-is-cool')
29-
expect(await res.text()).toBe('hono-is-cool')
28+
expect(res.headers.get('X-Request-Id')).toBe('hono-is-hot')
29+
expect(await res.text()).toBe('hono-is-hot')
3030
})
3131

3232
it('Should return random request id without using request header', async () => {
@@ -136,13 +136,13 @@ describe('Request ID Middleware with custom header', () => {
136136
it('Should return custom request id', async () => {
137137
const res = await app.request('http://localhost/requestId', {
138138
headers: {
139-
'Hono-Request-Id': 'hono-is-cool',
139+
'Hono-Request-Id': 'hono-is-hot',
140140
},
141141
})
142142
expect(res).not.toBeNull()
143143
expect(res.status).toBe(200)
144-
expect(res.headers.get('Hono-Request-Id')).toBe('hono-is-cool')
145-
expect(await res.text()).toBe('hono-is-cool')
144+
expect(res.headers.get('Hono-Request-Id')).toBe('hono-is-hot')
145+
expect(await res.text()).toBe('hono-is-hot')
146146
})
147147

148148
it('Should not return request id', async () => {

0 commit comments

Comments
 (0)