🎉 feat: 0.8.4

This commit is contained in:
saltyaom
2024-01-24 14:12:39 +07:00
parent c94d2bcfde
commit 48d525a0c1
4 changed files with 25 additions and 10 deletions

View File

@@ -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

View File

@@ -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: {

View File

@@ -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",

View File

@@ -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>`