mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
🎉 feat: 1.0
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,3 +1,13 @@
|
|||||||
|
|
||||||
|
# 1.0.0-beta.1 - 17 Feb 2024
|
||||||
|
Change:
|
||||||
|
- Add support for Elysia 1.0
|
||||||
|
|
||||||
|
|
||||||
|
# 1.0.0-beta.0 - 6 Feb 2024
|
||||||
|
Change:
|
||||||
|
- Add support for Elysia 1.0
|
||||||
|
|
||||||
# 0.8.5 - 24 Jan 2024
|
# 0.8.5 - 24 Jan 2024
|
||||||
Bug fix:
|
Bug fix:
|
||||||
- [#39](https://github.com/elysiajs/elysia-swagger/issues/39) Array type does not work
|
- [#39](https://github.com/elysiajs/elysia-swagger/issues/39) Array type does not work
|
||||||
|
|||||||
108
package.json
108
package.json
@@ -1,55 +1,55 @@
|
|||||||
{
|
{
|
||||||
"name": "@elysiajs/swagger",
|
"name": "@elysiajs/swagger",
|
||||||
"version": "0.8.5",
|
"version": "1.0.0-beta.1",
|
||||||
"description": "Plugin for Elysia to auto-generate Swagger page",
|
"description": "Plugin for Elysia to auto-generate Swagger page",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "saltyAom",
|
"name": "saltyAom",
|
||||||
"url": "https://github.com/SaltyAom",
|
"url": "https://github.com/SaltyAom",
|
||||||
"email": "saltyaom@gmail.com"
|
"email": "saltyaom@gmail.com"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
"bun": "./dist/index.js",
|
"bun": "./dist/index.js",
|
||||||
"node": "./dist/cjs/index.js",
|
"node": "./dist/cjs/index.js",
|
||||||
"require": "./dist/cjs/index.js",
|
"require": "./dist/cjs/index.js",
|
||||||
"import": "./dist/index.js",
|
"import": "./dist/index.js",
|
||||||
"default": "./dist/index.js"
|
"default": "./dist/index.js"
|
||||||
},
|
},
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"elysia",
|
"elysia",
|
||||||
"swagger"
|
"swagger"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/elysiajs/elysia-swagger",
|
"homepage": "https://github.com/elysiajs/elysia-swagger",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/elysiajs/elysia-swagger"
|
"url": "https://github.com/elysiajs/elysia-swagger"
|
||||||
},
|
},
|
||||||
"bugs": "https://github.com/elysiajs/elysia-swagger/issues",
|
"bugs": "https://github.com/elysiajs/elysia-swagger/issues",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "bun run --watch example/index.ts",
|
"dev": "bun run --watch example/index.ts",
|
||||||
"test": "bun test && npm run test:node",
|
"test": "bun test && npm run test:node",
|
||||||
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
|
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
|
||||||
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
|
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
|
||||||
"release": "npm run build && npm run test && npm publish --access public"
|
"release": "npm run build && npm run test && npm publish --access public"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"elysia": ">= 0.8.0"
|
"elysia": ">= 1.0.0-beta.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@apidevtools/swagger-parser": "^10.1.0",
|
"@apidevtools/swagger-parser": "^10.1.0",
|
||||||
"@scalar/api-reference": "^1.12.5",
|
"@scalar/api-reference": "^1.12.5",
|
||||||
"@types/lodash.clonedeep": "^4.5.7",
|
"@types/bun": "^1.0.4",
|
||||||
"@types/node": "^20.1.4",
|
"@types/lodash.clonedeep": "^4.5.7",
|
||||||
"bun-types": "^0.7.0",
|
"@types/node": "^20.1.4",
|
||||||
"elysia": "0.8.0",
|
"elysia": "1.0.0-beta.5",
|
||||||
"eslint": "^8.40.0",
|
"eslint": "^8.40.0",
|
||||||
"rimraf": "4.3",
|
"rimraf": "4.3",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash.clonedeep": "^4.5.0",
|
"lodash.clonedeep": "^4.5.0",
|
||||||
"openapi-types": "^12.1.3"
|
"openapi-types": "^12.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ export const swagger =
|
|||||||
).get(
|
).get(
|
||||||
`${path}/json`,
|
`${path}/json`,
|
||||||
() => {
|
() => {
|
||||||
const routes = app.routes as InternalRoute[]
|
const routes = app.router.history as InternalRoute[]
|
||||||
|
|
||||||
if (routes.length !== totalRoutes) {
|
if (routes.length !== totalRoutes) {
|
||||||
totalRoutes = routes.length
|
totalRoutes = routes.length
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export const registerSchemaPath = ({
|
|||||||
contentType?: string | string[]
|
contentType?: string | string[]
|
||||||
path: string
|
path: string
|
||||||
method: HTTPMethod
|
method: HTTPMethod
|
||||||
hook?: LocalHook<any, any>
|
hook?: LocalHook<any, any, any, any, any, any, any>
|
||||||
models: Record<string, TSchema>
|
models: Record<string, TSchema>
|
||||||
}) => {
|
}) => {
|
||||||
if (hook) hook = deepClone(hook)
|
if (hook) hook = deepClone(hook)
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||||
"types": ["bun-types"], /* Specify type package names to be included without being referenced in a source file. */
|
|
||||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||||
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
||||||
// "resolveJsonModule": true, /* Enable importing .json files. */
|
// "resolveJsonModule": true, /* Enable importing .json files. */
|
||||||
|
|||||||
Reference in New Issue
Block a user