mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
update scalar config to use @scalar/types
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { Elysia, InternalRoute } from 'elysia'
|
||||
import { Elysia } from 'elysia'
|
||||
import { swagger } from '../src/index'
|
||||
import { plugin } from './plugin'
|
||||
import { registerSchemaPath } from '../src/utils'
|
||||
|
||||
const app = new Elysia()
|
||||
.use(
|
||||
@@ -39,6 +37,5 @@ const app = new Elysia()
|
||||
}
|
||||
})
|
||||
)
|
||||
// .use(plugin)
|
||||
.get('/id/:id?', 'a')
|
||||
.listen(3000)
|
||||
|
||||
@@ -36,11 +36,6 @@
|
||||
"types": "./dist/scalar/theme.d.ts",
|
||||
"import": "./dist/scalar/theme.mjs",
|
||||
"require": "./dist/cjs/scalar/theme.js"
|
||||
},
|
||||
"./scalar/types": {
|
||||
"types": "./dist/scalar/types/index.d.ts",
|
||||
"import": "./dist/scalar/types/index.mjs",
|
||||
"require": "./dist/cjs/scalar/types/index.js"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
@@ -66,7 +61,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@apidevtools/swagger-parser": "^10.1.0",
|
||||
"@scalar/api-reference": "^1.25.21",
|
||||
"@types/bun": "1.1.6",
|
||||
"elysia": ">= 1.1.0-rc.2",
|
||||
"eslint": "9.6.0",
|
||||
@@ -74,6 +68,7 @@
|
||||
"typescript": "^5.5.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@scalar/types": "^0.0.12",
|
||||
"openapi-types": "^12.1.3",
|
||||
"pathe": "^1.1.2"
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ScalarRender } from './scalar'
|
||||
import { filterPaths, registerSchemaPath } from './utils'
|
||||
|
||||
import type { OpenAPIV3 } from 'openapi-types'
|
||||
import type { ReferenceConfiguration } from '@scalar/api-reference'
|
||||
import type { ReferenceConfiguration } from '@scalar/types'
|
||||
import type { ElysiaSwaggerConfig } from './types'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import scalarElysiaTheme from './theme'
|
||||
import type { OpenAPIV3 } from 'openapi-types'
|
||||
import type { ReferenceConfiguration } from '@scalar/api-reference'
|
||||
import type { ReferenceConfiguration } from '@scalar/types'
|
||||
|
||||
export const ScalarRender = (
|
||||
info: OpenAPIV3.InfoObject,
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
export type SpecConfiguration = {
|
||||
/** URL to a Swagger/OpenAPI file */
|
||||
url?: string;
|
||||
/** Swagger/Open API spec */
|
||||
content?: string | Record<string, any> | (() => Record<string, any>);
|
||||
/** The result of @scalar/swagger-parser */
|
||||
preparsedContent?: Record<any, any>;
|
||||
};
|
||||
|
||||
export type ReferenceLayoutType = 'modern' | 'classic';
|
||||
|
||||
export type ThemeId = 'alternate' | 'default' | 'moon' | 'purple' | 'solarized' | 'none';
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import type { OpenAPIV3 } from 'openapi-types'
|
||||
import type { ReferenceConfiguration } from '@scalar/api-reference'
|
||||
import type { ReferenceConfiguration } from '@scalar/types'
|
||||
import type { SwaggerUIOptions } from './swagger/types'
|
||||
|
||||
export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
|
||||
@@ -44,7 +44,7 @@ export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
|
||||
/**
|
||||
* Scalar configuration to customize scalar
|
||||
*'
|
||||
* @see https://github.com/scalar/scalar
|
||||
* @see https://github.com/scalar/scalar/blob/main/documentation/configuration.md
|
||||
*/
|
||||
scalarConfig?: ReferenceConfiguration
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user