mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
🎉 feat: 0.8.4
This commit is contained in:
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,12 +1,18 @@
|
||||
# 0.8.3 - 8 Jan 2023
|
||||
# 0.8.4 - 24 Jan 2024
|
||||
Feature:
|
||||
- [#96](https://github.com/elysiajs/elysia-swagger/pull/96) move to scalar configuration prop
|
||||
- [#95](https://github.com/elysiajs/elysia-swagger/pulls?q=is%3Apr+is%3Aclosed) Scalar CDN option
|
||||
- [#92](https://github.com/elysiajs/elysia-swagger/pull/92) update scalar to 1.13.0 and using latest instead of hardcoded version
|
||||
|
||||
# 0.8.3 - 8 Jan 2024
|
||||
Bug fix:
|
||||
- Using local Scalar API reference instead of leftover one (oppsie 👉👈)
|
||||
|
||||
# 0.8.2 - 8 Jan 2023
|
||||
# 0.8.2 - 8 Jan 2024
|
||||
Improvement:
|
||||
- Extract type inference to reduce bundle-size
|
||||
|
||||
# 0.8.1 - 7 Jan 2023
|
||||
# 0.8.1 - 7 Jan 2024
|
||||
Change:
|
||||
- Using Scalar provider as new default
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@ import { Elysia } from 'elysia'
|
||||
import { swagger } from '../src/index'
|
||||
import { plugin } from './plugin'
|
||||
|
||||
const app = new Elysia({
|
||||
// aot: false
|
||||
})
|
||||
const app = new Elysia()
|
||||
.use(
|
||||
swagger({
|
||||
documentation: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@elysiajs/swagger",
|
||||
"version": "0.8.3",
|
||||
"version": "0.8.4",
|
||||
"description": "Plugin for Elysia to auto-generate Swagger page",
|
||||
"author": {
|
||||
"name": "saltyAom",
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import scalarElysiaTheme from './theme'
|
||||
import type { ReferenceConfiguration } from './types'
|
||||
|
||||
export const ScalarRender = (version: string, config: ReferenceConfiguration, cdn: string) => `<!doctype html>
|
||||
export const ScalarRender = (
|
||||
version: string,
|
||||
config: ReferenceConfiguration,
|
||||
cdn: string
|
||||
) => `<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>API Reference</title>
|
||||
@@ -21,7 +25,14 @@ export const ScalarRender = (version: string, config: ReferenceConfiguration, cd
|
||||
<body>
|
||||
<script
|
||||
id="api-reference"
|
||||
data-configuration="JSON.stringify(${Bun.inspect(config)})"></script>
|
||||
<script src="${cdn ? cdn:`https://cdn.jsdelivr.net/npm/@scalar/api-reference@${version}/dist/browser/standalone.min.js`}"></script>
|
||||
data-url="${config.spec?.url}"
|
||||
data-configuration='${JSON.stringify(config)}'
|
||||
>
|
||||
</script>
|
||||
<script src="${
|
||||
cdn
|
||||
? cdn
|
||||
: `https://cdn.jsdelivr.net/npm/@scalar/api-reference@${version}/dist/browser/standalone.min.js`
|
||||
}"></script>
|
||||
</body>
|
||||
</html>`
|
||||
|
||||
Reference in New Issue
Block a user