galbe 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/commands/generate/code/openapi.parser.ts +2 -2
- package/package.json +6 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -35
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
- package/.github/workflows/build_test.yml +0 -17
- package/.github/workflows/deploy_website.yml +0 -20
- package/.github/workflows/release.yml +0 -39
- package/.prettierrc +0 -10
- package/bun.lock +0 -904
- package/bunfig.toml +0 -2
- package/docs/CONTRIBUTING.md +0 -105
- package/docs/cli.md +0 -343
- package/docs/configuration.md +0 -80
- package/docs/context.md +0 -104
- package/docs/error-handler.md +0 -54
- package/docs/getting-started.md +0 -164
- package/docs/handler.md +0 -119
- package/docs/hooks.md +0 -90
- package/docs/plugins.md +0 -146
- package/docs/router.md +0 -10
- package/docs/routes.md +0 -133
- package/docs/schemas.md +0 -327
- package/test/hooks.test.ts +0 -200
- package/test/parser.test.ts +0 -1358
- package/test/plugins.test.ts +0 -239
- package/test/requests.test.ts +0 -917
- package/test/resources/image.png +0 -0
- package/test/resources/object.badSyntax.json +0 -8
- package/test/resources/object.json +0 -8
- package/test/resources/object.missing.json +0 -6
- package/test/resources/static/chameleon.png +0 -0
- package/test/resources/static/index.html +0 -13
- package/test/resources/static/sub/index.html +0 -13
- package/test/resources/static/sub/other.html +0 -13
- package/test/resources/test.route.comment.ts +0 -58
- package/test/resources/test.route.empty.ts +0 -9
- package/test/responses.test.ts +0 -483
- package/test/routeFiles.test.ts +0 -239
- package/test/router.test.ts +0 -231
- package/test/test.utils.ts +0 -109
- package/test/types.test.ts +0 -909
- package/tsconfig.json +0 -23
|
@@ -280,9 +280,9 @@ const parseEndpointDef = (method: string, path: string, def?: OpenAPIV3.Operatio
|
|
|
280
280
|
if (_p.$ref) continue
|
|
281
281
|
let p = _p as OpenAPIV3.ParameterObject
|
|
282
282
|
let o = (s: string) => {
|
|
283
|
-
const [
|
|
283
|
+
const [_, so] = [...(s.match(/^\$T.optional\((.*)\)$/) || [])]
|
|
284
284
|
s = so ?? s
|
|
285
|
-
return p.in !== 'path' && !p.required
|
|
285
|
+
return p.in !== 'path' && !p.required ? `$T.optional(${s})` : s
|
|
286
286
|
}
|
|
287
287
|
sp[p.in][p.name] = o(
|
|
288
288
|
unref(parseOapiSchema(p.schema, { description: p.description }), m => {
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "galbe",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Fast, lightweight and highly customizable JavaScript web framework based on Bun",
|
|
5
5
|
"author": "Pierre Caillaud M (https://github.com/pierre-cm)",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": "./bin/cli.ts",
|
|
8
8
|
"main": "./src/index.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"scripts/",
|
|
12
|
+
"src/"
|
|
13
|
+
],
|
|
9
14
|
"exports": {
|
|
10
15
|
".": "./src/index.ts",
|
|
11
16
|
"./schema": "./src/schema.ts",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve
|
|
4
|
-
title: '[bug] '
|
|
5
|
-
labels: bug
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Describe the bug**
|
|
10
|
-
|
|
11
|
-
<!-- A clear and concise description of what the bug is. -->
|
|
12
|
-
|
|
13
|
-
**Steps To Reproduce**
|
|
14
|
-
|
|
15
|
-
<!-- Steps to reproduce the behavior -->
|
|
16
|
-
|
|
17
|
-
**Expected behavior**
|
|
18
|
-
|
|
19
|
-
<!-- A clear and concise description of what you expected to happen. -->
|
|
20
|
-
|
|
21
|
-
**Screenshots**
|
|
22
|
-
|
|
23
|
-
<!-- If applicable, add screenshots to help explain your problem. -->
|
|
24
|
-
|
|
25
|
-
**Environment (please complete the following information):**
|
|
26
|
-
|
|
27
|
-
<!-- To help us diagnose the issue, please navigate to the root of your project in your terminal and execute "bunx galbe info". Then paste the output bellow -->
|
|
28
|
-
|
|
29
|
-
```txt
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Additional context**
|
|
34
|
-
|
|
35
|
-
<!-- Add any other context about the problem here. -->
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature request
|
|
3
|
-
about: Suggest an idea for this project
|
|
4
|
-
title: '[feat] '
|
|
5
|
-
labels: enhancement
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Is your feature request related to a problem? Please describe.**
|
|
10
|
-
|
|
11
|
-
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
|
12
|
-
|
|
13
|
-
**Describe the solution you'd like**
|
|
14
|
-
|
|
15
|
-
<!-- A clear and concise description of what you want to happen. -->
|
|
16
|
-
|
|
17
|
-
**Describe alternatives you've considered**
|
|
18
|
-
|
|
19
|
-
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
|
20
|
-
|
|
21
|
-
**Additional context**
|
|
22
|
-
|
|
23
|
-
<!-- Add any other context or screenshots about the feature request here. -->
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
name: Install & Test
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
pull_request:
|
|
5
|
-
jobs:
|
|
6
|
-
build:
|
|
7
|
-
name: Install & Test
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
steps:
|
|
10
|
-
- uses: actions/checkout@v4
|
|
11
|
-
- uses: oven-sh/setup-bun@v1
|
|
12
|
-
with:
|
|
13
|
-
bun-version: latest
|
|
14
|
-
- name: Install
|
|
15
|
-
run: bun install
|
|
16
|
-
- name: Test
|
|
17
|
-
run: bun test
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
name: Redeploy website
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main]
|
|
5
|
-
paths:
|
|
6
|
-
- 'docs/**'
|
|
7
|
-
jobs:
|
|
8
|
-
redeploy_website:
|
|
9
|
-
name: Update website with new doc
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- name: Trigger website deployment
|
|
13
|
-
run: |
|
|
14
|
-
curl -L \
|
|
15
|
-
-X POST \
|
|
16
|
-
-H "Accept: application/vnd.github+json" \
|
|
17
|
-
-H "Authorization: Bearer ${{ secrets.GH_WEBSITE_TOKEN }}" \
|
|
18
|
-
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
19
|
-
https://api.github.com/repos/pierre-cm/galbe-website/actions/workflows/static.yml/dispatches \
|
|
20
|
-
-d '{"ref":"main"}'
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
inputs:
|
|
6
|
-
scope:
|
|
7
|
-
description: 'Version bump scope (patch, minor, major)'
|
|
8
|
-
required: true
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
release:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
env:
|
|
14
|
-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
15
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
16
|
-
RELEASE_SCOPE: ${{ github.event.inputs.scope }}
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout repository
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
- name: Setup Bun
|
|
21
|
-
uses: oven-sh/setup-bun@v1
|
|
22
|
-
with:
|
|
23
|
-
bun-version: latest
|
|
24
|
-
registry-url: https://registry.npmjs.org
|
|
25
|
-
- name: Setup SSH
|
|
26
|
-
uses: webfactory/ssh-agent@v0.8.0
|
|
27
|
-
with:
|
|
28
|
-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
29
|
-
- name: Setup Git
|
|
30
|
-
run: |
|
|
31
|
-
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
|
32
|
-
git config user.name "${GITHUB_ACTOR}"
|
|
33
|
-
- name: Install dependencies
|
|
34
|
-
run: |
|
|
35
|
-
bun install
|
|
36
|
-
- name: Release
|
|
37
|
-
run: |
|
|
38
|
-
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
|
|
39
|
-
bun run release --increment $RELEASE_SCOPE --ci --no-git.requireCleanWorkingDir
|