diff --git a/.commitlintrc.cjs b/.commitlintrc.cjs new file mode 100644 index 0000000..c34aa79 --- /dev/null +++ b/.commitlintrc.cjs @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'] +}; diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..ebd3799 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -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 diff --git a/.github/workflows/notify-discord.yml b/.github/workflows/notify-discord.yml new file mode 100644 index 0000000..9c19de1 --- /dev/null +++ b/.github/workflows/notify-discord.yml @@ -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. 🚀' diff --git a/bun.lockb b/bun.lockb index 29ff425..a31dd9c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c938645..5027b52 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" diff --git a/src/index.ts b/src/index.ts index 95d92ac..80cade5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,12 +25,12 @@ * 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'); @@ -38,14 +38,14 @@ 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: { @@ -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}` );