-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
421 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Linting & formatting using biome | ||
|
||
on: | ||
push: | ||
branches: ["master", "actions"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup bun | ||
uses: oven-sh/setup-bun@v1 | ||
- name: Install dependencies | ||
run: bun install --frozen-lockfile | ||
- name: Start EdgeDB | ||
uses: edgedb/setup-edgedb@v1 | ||
- name: Generate Query Builder | ||
run: bunx @edgedb/generate edgeql-js | ||
|
||
- name: Format code | ||
run: bun check:apply | ||
|
||
- name: Check for Changes | ||
id: check_changes | ||
run: | | ||
git diff --exit-code || echo "::set-output name=changes::true" | ||
- name: Commit Changes | ||
if: steps.check_changes.outputs.changes == 'true' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Auto-format code" | ||
- name: Push Changes | ||
if: steps.check_changes.outputs.changes == 'true' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
Lint: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
env: | ||
# Please never use this password in production | ||
# Here it is only in a temp databse | ||
DATABASE_URL: ws://127.0.0.1:8000 | ||
DATABASE_ACCOUNT: root | ||
DATABASE_PASSWORD: root | ||
JWT_SECRET: "long_string" | ||
PORT: "3000" | ||
ENV: "test" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup bun | ||
uses: oven-sh/setup-bun@v1 | ||
- name: Install dependencies | ||
run: bun install --frozen-lockfile | ||
- name: Start EdgeDB | ||
uses: edgedb/setup-edgedb@v1 | ||
- name: Generate Query Builder | ||
run: bunx @edgedb/generate edgeql-js | ||
|
||
- name: Run Tests | ||
run: bun test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"files": { | ||
"ignore": ["dist/**", "coverage/**", "docs/**", "dbschema/**"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
{ | ||
"name": "backend_v2", | ||
"version": "1.0.50", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"dev": "bun run --watch src/index.ts" | ||
}, | ||
"dependencies": { | ||
"@sinclair/typebox": "^0.32.20", | ||
"edgedb": "^1.4.1", | ||
"elysia": "latest", | ||
"elysia-http-status-code": "^1.0.9", | ||
"jsonwebtoken": "^9.0.2", | ||
"passport-local": "^1.0.0", | ||
"zod": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@edgedb/generate": "^0.4.1", | ||
"@types/jsonwebtoken": "^9.0.6", | ||
"bun-types": "latest" | ||
}, | ||
"module": "src/index.js" | ||
} | ||
"name": "backend_v2", | ||
"version": "1.0.50", | ||
"scripts": { | ||
"dev": "bun run --watch src/index.ts", | ||
|
||
"check": "biome check .", | ||
"check:apply": "biome check --apply ." | ||
}, | ||
"dependencies": { | ||
"edgedb": "^1.4.1", | ||
"elysia": "latest", | ||
"elysia-http-status-code": "^1.0.9", | ||
"jsonwebtoken": "^9.0.2", | ||
"zod": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.6.3", | ||
"@edgedb/generate": "^0.4.1", | ||
"@types/jsonwebtoken": "^9.0.6", | ||
"bun-types": "latest" | ||
}, | ||
"module": "src/index.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { Elysia } from "elysia"; | ||
import { router } from "./routes/auth"; | ||
import { edgedb } from "../dbschema/edgeql-js/imports"; | ||
import { router } from "./routes/auth"; | ||
|
||
export const client = edgedb.createClient() | ||
export const client = edgedb.createClient(); | ||
|
||
const app = new Elysia() | ||
.use(router) | ||
.get("/", () => ({ | ||
name: "Dlool", | ||
isDlool: true, | ||
version: "a2.0.0", | ||
})) | ||
.listen(3000); | ||
.use(router) | ||
.get("/", () => ({ | ||
name: "Dlool", | ||
isDlool: true, | ||
version: "a2.0.0", | ||
})) | ||
.listen(3000); | ||
|
||
console.log( | ||
`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`, | ||
`🦊 Elysia is running at ${app.server?.hostname}:${app.server?.port}`, | ||
); |
Oops, something went wrong.