diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 79e232a..6109130 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,13 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: 'github-actions' + directory: '/' schedule: - interval: "daily" - - package-ecosystem: "npm" - directory: "/" + interval: 'daily' + - package-ecosystem: 'npm' + directory: '/' schedule: - interval: "daily" + interval: 'daily' allow: - - dependency-name: "@scalar/*" + - dependency-name: '@scalar/*' diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 4371445..ac74d35 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -14,7 +14,7 @@ jobs: id: metadata uses: dependabot/fetch-metadata@v1 with: - github-token: "${{ secrets.GITHUB_TOKEN }}" + github-token: '${{ secrets.GITHUB_TOKEN }}' - name: Approve PR if: contains(steps.metadata.outputs.dependency-names, '@scalar') run: gh pr review --approve "$PR_URL" @@ -26,4 +26,4 @@ jobs: run: gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.prettierrc b/.prettierrc index ad81017..c2c3f61 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,9 +1,13 @@ { + "plugins": ["@trivago/prettier-plugin-sort-imports"], "trailingComma": "all", "quoteProps": "consistent", "tabWidth": 2, "semi": false, "singleQuote": true, "singleAttributePerLine": true, - "bracketSameLine": true + "bracketSameLine": true, + "importOrder": ["^[./]"], + "importOrderSeparation": true, + "importOrderSortSpecifiers": true } diff --git a/db/schema.ts b/db/schema.ts index cf2e284..b63dca1 100644 --- a/db/schema.ts +++ b/db/schema.ts @@ -1,5 +1,5 @@ -import { text, integer, sqliteTable } from 'drizzle-orm/sqlite-core' import { sql } from 'drizzle-orm' +import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core' export const Specs = sqliteTable('Specs', { id: text('id').primaryKey(), diff --git a/functions/api/share.ts b/functions/api/share.ts index 62dd7fe..05bfa28 100644 --- a/functions/api/share.ts +++ b/functions/api/share.ts @@ -1,7 +1,8 @@ +import { sql } from 'drizzle-orm' import { drizzle } from 'drizzle-orm/d1' +import { customAlphabet, nanoid } from 'nanoid' + import { Specs } from '../../db/schema' -import { nanoid, customAlphabet } from 'nanoid' -import { sql } from 'drizzle-orm' export interface Env { // If you set another name in wrangler.toml as the value for 'binding', diff --git a/functions/api/share/[id].ts b/functions/api/share/[id].ts index b0becba..0ded94d 100644 --- a/functions/api/share/[id].ts +++ b/functions/api/share/[id].ts @@ -1,6 +1,7 @@ +import { sql } from 'drizzle-orm' import { drizzle } from 'drizzle-orm/d1' + import { Specs } from '../../../db/schema' -import { sql } from 'drizzle-orm' export interface Env { // If you set another name in wrangler.toml as the value for 'binding', diff --git a/functions/files/[[id]].ts b/functions/files/[[id]].ts index 0e1c04f..9ec289e 100644 --- a/functions/files/[[id]].ts +++ b/functions/files/[[id]].ts @@ -1,8 +1,9 @@ -import { drizzle } from 'drizzle-orm/d1' -import { Specs } from '../../db/schema' +import { normalize } from '@scalar/openapi-parser' import { sql } from 'drizzle-orm' +import { drizzle } from 'drizzle-orm/d1' import YAML from 'yaml' -import { normalize } from '@scalar/openapi-parser' + +import { Specs } from '../../db/schema' export interface Env { // If you set another name in wrangler.toml as the value for 'binding', diff --git a/index.html b/index.html index b1e2363..af473ce 100644 --- a/index.html +++ b/index.html @@ -2,14 +2,30 @@ - - - + + + Scalar Sandbox - + -
- +
+ diff --git a/migrations/meta/0000_snapshot.json b/migrations/meta/0000_snapshot.json index 18ccb5d..c0ea1a0 100644 --- a/migrations/meta/0000_snapshot.json +++ b/migrations/meta/0000_snapshot.json @@ -49,4 +49,4 @@ "tables": {}, "columns": {} } -} \ No newline at end of file +} diff --git a/migrations/meta/0001_snapshot.json b/migrations/meta/0001_snapshot.json index 228239c..1dac133 100644 --- a/migrations/meta/0001_snapshot.json +++ b/migrations/meta/0001_snapshot.json @@ -56,4 +56,4 @@ "tables": {}, "columns": {} } -} \ No newline at end of file +} diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json index ff03985..91e8941 100644 --- a/migrations/meta/_journal.json +++ b/migrations/meta/_journal.json @@ -17,4 +17,4 @@ "breakpoints": true } ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index 88b5b60..afd7ad8 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "db:generate": "drizzle-kit generate:sqlite --schema=./db/schema.ts --out=./migrations", "db:migrate": "wrangler d1 migrations apply DB --local", "db:migrate:production": "wrangler d1 migrations apply DB", - "db:up": "drizzle-kit up:sqlite" + "db:up": "drizzle-kit up:sqlite", + "format": "pnpm prettier --write .", + "format:check": "pnpm prettier --check ." }, "dependencies": { "@headlessui/vue": "^1.7.17", @@ -30,6 +32,7 @@ "yaml": "^2.3.4" }, "devDependencies": { + "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@vitejs/plugin-vue": "^5.0.3", "concurrently": "^8.2.2", "drizzle-kit": "^0.20.13", diff --git a/src/.eslintrc.js b/src/.eslintrc.js index e4f518a..3cc1111 100644 --- a/src/.eslintrc.js +++ b/src/.eslintrc.js @@ -80,4 +80,4 @@ module.exports = { }, ], }, -}; \ No newline at end of file +} diff --git a/src/App.vue b/src/App.vue index 65e9210..e4ef73e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,17 +1,17 @@