Skip to content

Commit dabaa94

Browse files
committed
🎉 feat: use @elysia scope
1 parent cc927ea commit dabaa94

5 files changed

Lines changed: 196 additions & 122 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Legacy
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
permissions:
12+
id-token: write
13+
14+
env:
15+
# Enable debug logging for actions
16+
ACTIONS_RUNNER_DEBUG: true
17+
18+
jobs:
19+
publish-npm:
20+
name: 'Publish: npm Registry'
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: 'Checkout'
24+
uses: actions/checkout@v4
25+
26+
- name: 'Setup Bun'
27+
uses: oven-sh/setup-bun@v1
28+
with:
29+
bun-version: latest
30+
registry-url: "https://registry.npmjs.org"
31+
32+
- uses: actions/setup-node@v5
33+
with:
34+
node-version: '24.x'
35+
registry-url: 'https://registry.npmjs.org'
36+
37+
- name: replace @elysia to @elysiajs
38+
run: sed -i 's/@elysia/@elysiajs/g' package.json
39+
40+
- name: Install packages
41+
run: bun install
42+
43+
- name: Build code
44+
run: bun run build
45+
46+
- name: Test
47+
run: bun run test
48+
49+
- name: 'Publish'
50+
run: |
51+
NODE_AUTH_TOKEN="" npm publish --provenance --access=public

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 1.4.15 - 1 Apr 2026
1+
# 1.4.15 - 24 Apr 2026
2+
Chore:
3+
- Published under @elysia scope
24

35
# 1.4.14 - 21 Jan 2026
46
Improvement:

README.md

Lines changed: 125 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,125 @@
1-
# @elysiajs/openapi
2-
Plugin for [elysia](https://github.com/elysiajs/elysia) to auto-generate API documentation page.
3-
4-
## Installation
5-
```bash
6-
bun add @elysiajs/openapi
7-
```
8-
9-
## Example
10-
```typescript
11-
import { Elysia, t } from 'elysia'
12-
import { openapi } from '@elysiajs/openapi'
13-
14-
const app = new Elysia()
15-
.use(openapi())
16-
.get('/', () => 'hi', { response: t.String({ description: 'sample description' }) })
17-
.post(
18-
'/json/:id',
19-
({ body, params: { id }, query: { name } }) => ({
20-
...body,
21-
id,
22-
name
23-
}),
24-
{
25-
params: t.Object({
26-
id: t.String()
27-
}),
28-
query: t.Object({
29-
name: t.String()
30-
}),
31-
body: t.Object({
32-
username: t.String(),
33-
password: t.String()
34-
}),
35-
response: t.Object({
36-
username: t.String(),
37-
password: t.String(),
38-
id: t.String(),
39-
name: t.String()
40-
}, { description: 'sample description' })
41-
}
42-
)
43-
.listen(8080);
44-
```
45-
46-
Then go to `http://localhost:8080/openapi`.
47-
48-
# config
49-
50-
## enabled
51-
@default true
52-
Enable/Disable the plugin
53-
54-
## documentation
55-
OpenAPI documentation information
56-
57-
@see https://spec.openapis.org/oas/v3.0.3.html
58-
59-
## exclude
60-
Configuration to exclude paths or methods from documentation
61-
62-
## exclude.methods
63-
List of methods to exclude from documentation
64-
65-
## exclude.paths
66-
List of paths to exclude from documentation
67-
68-
## exclude.staticFile
69-
@default true
70-
71-
Exclude static file routes from documentation
72-
73-
## exclude.tags
74-
List of tags to exclude from documentation
75-
76-
## path
77-
@default '/openapi'
78-
79-
The endpoint to expose OpenAPI documentation frontend
80-
81-
## provider
82-
@default 'scalar'
83-
84-
OpenAPI documentation frontend between:
85-
- [Scalar](https://github.com/scalar/scalar)
86-
- [SwaggerUI](https://github.com/swagger-api/swagger-ui)
87-
- null: disable frontend
88-
89-
## references
90-
Additional OpenAPI reference for each endpoint
91-
92-
## scalar
93-
Scalar configuration, refers to [Scalar config](https://github.com/scalar/scalar/blob/main/documentation/configuration.md)
94-
95-
## specPath
96-
@default '/${path}/json'
97-
98-
The endpoint to expose OpenAPI specification in JSON format
99-
100-
## swagger
101-
Swagger config, refers to [Swagger config](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)
1+
# @elysia/openapi
2+
3+
[Elysia](https://github.com/elysiajs/elysia) plugin to add OpenAPI documentation.
4+
5+
## Installation
6+
7+
```bash
8+
bun add @elysia/openapi
9+
```
10+
11+
## Example
12+
13+
```typescript
14+
import { Elysia, t } from 'elysia'
15+
import { openapi } from '@elysia/openapi'
16+
17+
const app = new Elysia()
18+
.use(openapi())
19+
.get('/', () => 'hi', {
20+
response: t.String({ description: 'sample description' })
21+
})
22+
.post(
23+
'/json/:id',
24+
({ body, params: { id }, query: { name } }) => ({
25+
...body,
26+
id,
27+
name
28+
}),
29+
{
30+
params: t.Object({
31+
id: t.String()
32+
}),
33+
query: t.Object({
34+
name: t.String()
35+
}),
36+
body: t.Object({
37+
username: t.String(),
38+
password: t.String()
39+
}),
40+
response: t.Object(
41+
{
42+
username: t.String(),
43+
password: t.String(),
44+
id: t.String(),
45+
name: t.String()
46+
},
47+
{ description: 'sample description' }
48+
)
49+
}
50+
)
51+
.listen(3000)
52+
```
53+
54+
Then go to `http://localhost:3000/openapi`.
55+
56+
# config
57+
58+
## enabled
59+
60+
@default true
61+
Enable/Disable the plugin
62+
63+
## documentation
64+
65+
OpenAPI documentation information
66+
67+
@see https://spec.openapis.org/oas/v3.0.3.html
68+
69+
## exclude
70+
71+
Configuration to exclude paths or methods from documentation
72+
73+
## exclude.methods
74+
75+
List of methods to exclude from documentation
76+
77+
## exclude.paths
78+
79+
List of paths to exclude from documentation
80+
81+
## exclude.staticFile
82+
83+
@default true
84+
85+
Exclude static file routes from documentation
86+
87+
## exclude.tags
88+
89+
List of tags to exclude from documentation
90+
91+
## path
92+
93+
@default '/openapi'
94+
95+
The endpoint to expose OpenAPI documentation frontend
96+
97+
## provider
98+
99+
@default 'scalar'
100+
101+
OpenAPI documentation frontend between:
102+
103+
- [Scalar](https://github.com/scalar/scalar)
104+
- [SwaggerUI](https://github.com/swagger-api/swagger-ui)
105+
- null: disable frontend
106+
107+
## references
108+
109+
Additional OpenAPI reference for each endpoint
110+
111+
## scalar
112+
113+
Scalar configuration, refers to [Scalar config](https://github.com/scalar/scalar/blob/main/documentation/configuration.md)
114+
115+
## specPath
116+
117+
@default '/${path}/json'
118+
119+
The endpoint to expose OpenAPI specification in JSON format
120+
121+
## swagger
122+
123+
Swagger config, refers to [Swagger config](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)
124+
125+
See [documentation](https://elysiajs.com/plugins/openapi.html) for more details.

bun.lock

Lines changed: 8 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@elysiajs/openapi",
3-
"version": "1.4.14",
4-
"description": "Plugin for Elysia to auto-generate API documentation",
2+
"name": "@elysia/openapi",
3+
"version": "1.4.15",
4+
"description": "Elysia plugin to add OpenAPI documentation",
55
"author": {
66
"name": "saltyAom",
77
"url": "https://github.com/SaltyAom",
@@ -74,17 +74,17 @@
7474
"release": "npm run build && npm run test && npm publish --access public"
7575
},
7676
"devDependencies": {
77-
"@apidevtools/swagger-parser": "^12.0.0",
78-
"@scalar/types": "^0.2.13",
77+
"@apidevtools/swagger-parser": "^12.1.0",
78+
"@scalar/types": "^0.2.16",
7979
"@sinclair/typemap": "^0.10.1",
8080
"@types/bun": "1.2.20",
81-
"effect": "^3.17.13",
81+
"effect": "^3.21.2",
8282
"elysia": "1.4.19",
8383
"eslint": "9.6.0",
8484
"openapi-types": "^12.1.3",
85-
"tsup": "^8.5.0",
86-
"typescript": "^5.9.2",
87-
"zod": "^4.2.1"
85+
"tsup": "^8.5.1",
86+
"typescript": "^5.9.3",
87+
"zod": "^4.3.6"
8888
},
8989
"peerDependencies": {
9090
"elysia": ">= 1.4.0"

0 commit comments

Comments
 (0)