chore: migrate to `yarn v4` (#299)
* changeset * chore: migrate to `yarn v4` * remove changeset * fixed Github Actions for `hello` * fix gitignore * add dependencies * add ci for oauth-providers * add dependencies * add `publint` * update mswpull/300/head
parent
954069dabe
commit
bd18b966ee
|
@ -0,0 +1,25 @@
|
|||
name: ci-oauth-providers
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'packages/oauth-providers/**'
|
||||
pull_request:
|
||||
branches: ['*']
|
||||
paths:
|
||||
- 'packages/oauth-providers/**'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./packages/oauth-providers
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18.x
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- run: yarn test
|
|
@ -1,9 +1,16 @@
|
|||
dist
|
||||
|
||||
node_modules
|
||||
.yarn/*
|
||||
yarn-error.log
|
||||
*.tgz
|
||||
|
||||
.yarn/*
|
||||
!.yarn/cache
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
yarn-error.log
|
||||
|
||||
# for debug or playing
|
||||
sandbox
|
|
@ -1,7 +1,12 @@
|
|||
{
|
||||
"deno.enable": false,
|
||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
"source.fixAll.eslint": "explicit"
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,5 @@
|
|||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.0.2.cjs
|
||||
|
||||
nmHoistingLimits: 'workspaces'
|
|
@ -24,7 +24,7 @@
|
|||
"build:swagger-ui": "yarn workspace @hono/swagger-ui build",
|
||||
"build:esbuild-transpiler": "yarn workspace @hono/esbuild-transpiler build",
|
||||
"build:oauth-providers": "yarn workspace @hono/oauth-providers build",
|
||||
"build": "run-p build:*"
|
||||
"build": "run-p 'build:*'"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
@ -57,5 +57,6 @@
|
|||
"tsup": "^7.2.0",
|
||||
"typescript": "^5.2.2",
|
||||
"vitest": "^0.34.2"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@4.0.2"
|
||||
}
|
|
@ -14,7 +14,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -30,7 +29,11 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@clerk/backend": "^0.30.1",
|
||||
"@types/react": "^18",
|
||||
"hono": "^3.7.3",
|
||||
"node-fetch-native": "^1.4.0"
|
||||
"jest": "^29.7.0",
|
||||
"node-fetch-native": "^1.4.0",
|
||||
"react": "^18.2.0",
|
||||
"rimraf": "^5.0.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -55,9 +54,10 @@
|
|||
"hono": ">=3.9.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.19.5",
|
||||
"esbuild": "^0.19.9",
|
||||
"esbuild-wasm": "^0.19.5",
|
||||
"hono": "^3.9.2",
|
||||
"tsup": "^8.0.1",
|
||||
"vitest": "^0.34.6"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
},
|
||||
"homepage": "https://github.com/honojs/middleware",
|
||||
"author": "codehex",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
"dist"
|
||||
],
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -36,6 +35,8 @@
|
|||
"hono": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"hono": "^3.9.2"
|
||||
"hono": "^3.9.2",
|
||||
"tsup": "^8.0.1",
|
||||
"vitest": "^1.0.4"
|
||||
}
|
||||
}
|
|
@ -14,7 +14,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -28,7 +27,9 @@
|
|||
"hono": ">=3.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"hono": "^3.9.2"
|
||||
"hono": "^3.9.2",
|
||||
"jest": "^29.7.0",
|
||||
"rimraf": "^5.0.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@medley/router": "^0.2.1"
|
||||
|
|
|
@ -3,5 +3,5 @@ module.exports = {
|
|||
testEnvironmentOptions: {
|
||||
customExportConditions: [''],
|
||||
},
|
||||
modulePathIgnorePatterns: ['handlers']
|
||||
modulePathIgnorePatterns: ['handlers'],
|
||||
}
|
|
@ -103,8 +103,9 @@
|
|||
"hono": "^3.9.2",
|
||||
"jest": "^29.7.0",
|
||||
"jest-environment-miniflare": "^2.14.1",
|
||||
"msw": "^2.0.4",
|
||||
"msw": "^2.0.11",
|
||||
"patch-package": "^8.0.0",
|
||||
"publint": "^0.2.6",
|
||||
"ts-jest": "^29.1.1",
|
||||
"tsup": "^8.0.0",
|
||||
"typescript": "^5.2.2"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -34,7 +33,8 @@
|
|||
"devDependencies": {
|
||||
"@builder.io/qwik": "^1.2.0",
|
||||
"@builder.io/qwik-city": "^1.2.0",
|
||||
"hono": "^3.1.5"
|
||||
"hono": "^3.1.5",
|
||||
"rimraf": "^5.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
"replacer": "dist/replacer.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/honojs/middleware.git"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
"release": "yarn build && yarn test && yarn publint && yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -34,6 +33,8 @@
|
|||
"devDependencies": {
|
||||
"@trpc/server": "^10.10.0",
|
||||
"hono": "^3.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"zod": "^3.20.2"
|
||||
},
|
||||
"engines": {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -33,6 +32,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@sinclair/typebox": "^0.31.15",
|
||||
"hono": "^3.1.2"
|
||||
"hono": "^3.1.2",
|
||||
"jest": "^29.7.0",
|
||||
"rimraf": "^5.0.5"
|
||||
}
|
||||
}
|
|
@ -33,7 +33,7 @@ describe('Basic', () => {
|
|||
}
|
||||
}
|
||||
output: {
|
||||
success: true
|
||||
success: boolean
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,9 @@ describe('Basic', () => {
|
|||
age: 20,
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -67,6 +70,9 @@ describe('Basic', () => {
|
|||
age: '20',
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -109,6 +115,9 @@ describe('With Hook', () => {
|
|||
title: 'Hello',
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -123,6 +132,9 @@ describe('With Hook', () => {
|
|||
title: 'Hello',
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -34,6 +33,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"hono": "^3.5.8",
|
||||
"jest": "^29.7.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"typia": "^5.0.4"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
import { Hono } from 'hono'
|
||||
import type { Equal, Expect } from 'hono/utils/types'
|
||||
import typia, { tags } from 'typia'
|
||||
import type { tags } from 'typia'
|
||||
import typia from 'typia'
|
||||
import { typiaValidator } from '../src'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
@ -49,6 +50,9 @@ describe('Basic', () => {
|
|||
age: 30,
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -66,6 +70,9 @@ describe('Basic', () => {
|
|||
age: 18,
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -110,6 +117,9 @@ describe('With Hook', () => {
|
|||
title: 'Hello',
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -124,6 +134,9 @@ describe('With Hook', () => {
|
|||
title: 'Hello',
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -32,7 +31,9 @@
|
|||
"valibot": "^0.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"hono": "^3.1.0",
|
||||
"valibot": "^0.13.1"
|
||||
"hono": "^3.11.5",
|
||||
"jest": "^29.7.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"valibot": "^0.24.1"
|
||||
}
|
||||
}
|
|
@ -33,7 +33,7 @@ describe('Basic', () => {
|
|||
}
|
||||
}
|
||||
output: {
|
||||
success: true
|
||||
success: boolean
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,9 @@ describe('Basic', () => {
|
|||
name: 'Superman',
|
||||
age: 20,
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
method: 'POST',
|
||||
})
|
||||
const res = await app.request(req)
|
||||
|
@ -66,6 +69,9 @@ describe('Basic', () => {
|
|||
name: 'Superman',
|
||||
age: '20',
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
method: 'POST',
|
||||
})
|
||||
const res = await app.request(req)
|
||||
|
@ -108,6 +114,9 @@ describe('With Hook', () => {
|
|||
id: 123,
|
||||
title: 'Hello',
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
method: 'POST',
|
||||
})
|
||||
const res = await app.request(req)
|
||||
|
@ -122,6 +131,9 @@ describe('With Hook', () => {
|
|||
id: '123',
|
||||
title: 'Hello',
|
||||
}),
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
method: 'POST',
|
||||
})
|
||||
const res = await app.request(req)
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -42,14 +41,16 @@
|
|||
"zod": "3.*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@hono/zod-validator": "^0.1.11",
|
||||
"hono": "^3.11.3",
|
||||
"jest": "^29.7.0",
|
||||
"openapi3-ts": "^4.1.2",
|
||||
"tsup": "^8.0.1",
|
||||
"vitest": "^1.0.1",
|
||||
"zod": "^3.22.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@asteasolutions/zod-to-openapi": "^5.5.0",
|
||||
"@hono/zod-validator": "^0.1.9"
|
||||
"@hono/zod-validator": "^0.1.11"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
"release": "yarn publish"
|
||||
},
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"access": "public"
|
||||
|
@ -33,6 +32,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"hono": "^3.5.2",
|
||||
"jest": "^29.7.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"zod": "3.19.1"
|
||||
}
|
||||
}
|
|
@ -14,20 +14,27 @@ describe('Basic', () => {
|
|||
age: z.number(),
|
||||
})
|
||||
|
||||
const querySchema = z.object({
|
||||
name: z.string().optional()
|
||||
}).optional()
|
||||
|
||||
const route = app.post('/author', zValidator('json', jsonSchema), zValidator('query', querySchema), (c) => {
|
||||
const data = c.req.valid('json')
|
||||
const query = c.req.valid('query')
|
||||
|
||||
return c.jsonT({
|
||||
success: true,
|
||||
message: `${data.name} is ${data.age}`,
|
||||
queryName: query?.name,
|
||||
const querySchema = z
|
||||
.object({
|
||||
name: z.string().optional(),
|
||||
})
|
||||
})
|
||||
.optional()
|
||||
|
||||
const route = app.post(
|
||||
'/author',
|
||||
zValidator('json', jsonSchema),
|
||||
zValidator('query', querySchema),
|
||||
(c) => {
|
||||
const data = c.req.valid('json')
|
||||
const query = c.req.valid('query')
|
||||
|
||||
return c.jsonT({
|
||||
success: true,
|
||||
message: `${data.name} is ${data.age}`,
|
||||
queryName: query?.name,
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
type Actual = ExtractSchema<typeof route>
|
||||
type Expected = {
|
||||
|
@ -39,9 +46,11 @@ describe('Basic', () => {
|
|||
age: number
|
||||
}
|
||||
} & {
|
||||
query?: {
|
||||
name?: string | undefined
|
||||
} | undefined
|
||||
query?:
|
||||
| {
|
||||
name?: string | undefined
|
||||
}
|
||||
| undefined
|
||||
}
|
||||
output: {
|
||||
success: boolean
|
||||
|
@ -62,6 +71,9 @@ describe('Basic', () => {
|
|||
age: 20,
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -69,7 +81,7 @@ describe('Basic', () => {
|
|||
expect(await res.json()).toEqual({
|
||||
success: true,
|
||||
message: 'Superman is 20',
|
||||
queryName: 'Metallo'
|
||||
queryName: 'Metallo',
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -122,6 +134,9 @@ describe('With Hook', () => {
|
|||
title: 'Hello',
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
@ -136,6 +151,9 @@ describe('With Hook', () => {
|
|||
title: 'Hello',
|
||||
}),
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
const res = await app.request(req)
|
||||
expect(res).not.toBeNull()
|
||||
|
|
Loading…
Reference in New Issue