Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more workflows #100

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
13 changes: 13 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint Commit Messages
on: [pull_request, push]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
with:
configFile: .commitlintrc.cjs
16 changes: 16 additions & 0 deletions .github/workflows/notify-discord.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Discord notification

on:
release:
types: [published]

jobs:
discord-notification:
runs-on: ubuntu-latest
steps:
- name: Discord notification 📯
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: '${{ github.event.repository.name }} [${{ github.event.release.tag_name }}](${{ github.event.release.html_url }}) has been released. 🚀'
Binary file modified bun.lockb
Binary file not shown.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test": "bun test",
"dev": "bun run --watch src/index.ts",
"start": "bun run src/index.ts",
"lint": "eslint -c .eslintrc.cjs src/**/*.ts*"
"lint": "eslint -c .eslintrc.cjs src/**.ts*"
},
"keywords": [
"GeoStyler",
Expand All @@ -35,6 +35,8 @@
"loggisch": "^0.0.1"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"bun-types": "latest"
},
"funding": "https://opencollective.com/geostyler"
Expand Down
30 changes: 15 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
import { Elysia } from "elysia";
import { swagger } from '@elysiajs/swagger'
import { html } from '@elysiajs/html'
import { transFormApi, transform } from "./routes/api";
import { Elysia } from 'elysia';
import { swagger } from '@elysiajs/swagger';
import { html } from '@elysiajs/html';
import { transFormApi, transform } from './routes/api';
import loggisch from 'loggisch';
import { versions, versionsApi } from "./routes/info";
import { versions, versionsApi } from './routes/info';

loggisch.setLogLevel('trace');

const port = process.env.NODE_API_PORT || 8888;

export const app = new Elysia()
.get('/', ({ redirect }) => {
return redirect('/api-docs')
return redirect('/api-docs');
})
.use(swagger({
path: "/api-docs",
path: '/api-docs',
exclude: [
"/api-docs",
"/api-docs/json",
"/"
'/api-docs',
'/api-docs/json',
'/'
],
documentation: {
info: {
Expand All @@ -55,15 +55,15 @@ export const app = new Elysia()
}
}
}))
.group("/info", (app) => app
.group('/info', (a) => a
.use(html())
.get("/versions", versions, versionsApi)
.get('/versions', versions, versionsApi)
)
.group("/api", (app) => app
.post("/transform", transform, transFormApi)
.group('/api', (a) => a
.post('/transform', transform, transFormApi)
)
.listen(port);

console.log(
loggisch.info(
`🦊 Elysia is running at http://${app.server?.hostname}:${app.server?.port}`
);