galbe 0.1.3 → 0.1.6
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/.github/workflows/release.yml +39 -0
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/bin/cli.ts +9 -12
- package/bun.lockb +0 -0
- package/bunfig.toml +2 -0
- package/package.json +15 -4
|
@@ -0,0 +1,39 @@
|
|
|
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 & build
|
|
34
|
+
run: |
|
|
35
|
+
bun install & bun run build
|
|
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
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Galbe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
1
|
# Galbe
|
|
2
|
+
|
|
3
|
+
[](https://github.com/pierre-cm/galbe/actions/workflows/build_test.yml)
|
|
4
|
+
[](https://github.com/pierre-cm/galbe/blob/main/LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/galbe)
|
|
6
|
+
|
|
7
|
+
Galbe is a fast, lightweight and highly customizable JavaScript web framework based on [Bun](https://bun.sh).
|
|
8
|
+
|
|
9
|
+
> [!IMPORTANT]
|
|
10
|
+
> Galbe is currently under active development and not guaranteed to be stable. Future releases may potentially introduce breaking changes.
|
|
11
|
+
|
|
12
|
+
## Getting started
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
bun create galbe
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Documentation
|
|
19
|
+
|
|
20
|
+
The detailed documentation is available at [galbe.dev](https://galbe.dev).
|
|
21
|
+
|
|
22
|
+
## Contributing
|
package/bin/cli.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { $, Glob } from 'bun'
|
|
4
4
|
import type { RouteMeta } from '../src/routes'
|
|
5
5
|
import { program } from 'commander'
|
|
6
6
|
import { relative, resolve } from 'path'
|
|
7
|
-
import { mkdir, readdir, rm } from 'fs/promises'
|
|
7
|
+
import { mkdir, readdir, lstat, rm } from 'fs/promises'
|
|
8
8
|
import { metaAnalysis } from '../src/routes'
|
|
9
9
|
import { randomUUID } from 'crypto'
|
|
10
|
-
import { glob } from 'glob'
|
|
11
10
|
import { Galbe } from '../src'
|
|
12
11
|
|
|
13
12
|
const ROOT = process.cwd()
|
|
@@ -19,22 +18,20 @@ const parseRoutes = async (routes?: string | string[]): Promise<{ path: string;
|
|
|
19
18
|
if (!routes) return []
|
|
20
19
|
let files: { path: string; meta: RouteMeta }[] = []
|
|
21
20
|
if (typeof routes === 'string') {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (file.type === 'File') files.push({ path, meta: await metaAnalysis(path) })
|
|
26
|
-
else if (file.type === 'Directory') {
|
|
21
|
+
for await (const path of new Glob(routes).scan({ cwd: ROOT, absolute: true, onlyFiles: false })) {
|
|
22
|
+
const isDir = (await lstat(path)).isDirectory()
|
|
23
|
+
if (isDir) {
|
|
27
24
|
files = files.concat(
|
|
28
25
|
await Promise.all(
|
|
29
26
|
(
|
|
30
|
-
await readdir(
|
|
27
|
+
await readdir(path)
|
|
31
28
|
).map(async f => ({
|
|
32
|
-
path:
|
|
33
|
-
meta: await metaAnalysis(
|
|
29
|
+
path: f,
|
|
30
|
+
meta: await metaAnalysis(path)
|
|
34
31
|
}))
|
|
35
32
|
)
|
|
36
33
|
)
|
|
37
|
-
}
|
|
34
|
+
} else files.push({ path, meta: await metaAnalysis(path) })
|
|
38
35
|
}
|
|
39
36
|
}
|
|
40
37
|
if (Array.isArray(routes)) for (const r of routes) files = files.concat(await parseRoutes(r))
|
package/bun.lockb
CHANGED
|
Binary file
|
package/bunfig.toml
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "galbe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
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",
|
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"build": "bun ./scripts/build.ts",
|
|
31
31
|
"clean": "rm -rf dist",
|
|
32
32
|
"test": "bun test",
|
|
33
|
-
"postinstall": "bun run ./scripts/postinstall.ts"
|
|
33
|
+
"postinstall": "bun run ./scripts/postinstall.ts",
|
|
34
|
+
"release": "release-it"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@types/bun": "^1.0.4"
|
|
37
|
+
"@types/bun": "^1.0.4",
|
|
38
|
+
"release-it": "^17.1.1"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"typescript": "^5.0.0"
|
|
@@ -45,5 +47,14 @@
|
|
|
45
47
|
"acorn": "^8.11.2",
|
|
46
48
|
"acorn-walk": "^8.3.0",
|
|
47
49
|
"commander": "^11.1.0"
|
|
50
|
+
},
|
|
51
|
+
"release-it": {
|
|
52
|
+
"git": {
|
|
53
|
+
"pushRepo": "git@github.com:pierre-cm/galbe.git"
|
|
54
|
+
},
|
|
55
|
+
"github": {
|
|
56
|
+
"requireBranch": "main",
|
|
57
|
+
"release": "true"
|
|
58
|
+
}
|
|
48
59
|
}
|
|
49
|
-
}
|
|
60
|
+
}
|