Skip to content

Commit

Permalink
🎉 feat: 0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Jan 24, 2024
1 parent c94d2bc commit 48d525a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 1 addition & 3 deletions example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
17 changes: 14 additions & 3 deletions src/scalar/index.ts
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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>`

0 comments on commit 48d525a

Please sign in to comment.