Skip to content

Commit

Permalink
refactor: ordering imports by vs-code
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanCassiere committed Jun 24, 2024
1 parent 0bd9f39 commit a608fb3
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/config/db/drizzle.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";

import * as schema from "./schema";
import { env } from "@/config/env";
import * as schema from "./schema";

const client = postgres(env.DATABASE_URL);
export const db = drizzle(client, { schema, logger: true });
2 changes: 1 addition & 1 deletion src/config/db/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pgTable, timestamp, text, index, jsonb, boolean } from "drizzle-orm/pg-core";
import { relations } from "drizzle-orm";
import { boolean, index, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";

export const logs = pgTable(
"logs",
Expand Down
2 changes: 1 addition & 1 deletion src/routers/docs/v2.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Hono } from "hono";
import { apiReference } from "@scalar/hono-api-reference";
import { Hono } from "hono";

import type { ServerContext } from "@/types/hono";

Expand Down
2 changes: 1 addition & 1 deletion src/routers/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { rateLimiter } from "hono-rate-limiter";

import type { ServerContext } from "@/types/hono";

import servicesRouter from "./services";
import logsRouter from "./logging";
import servicesRouter from "./services";

const app = new Hono<ServerContext>();

Expand Down
10 changes: 5 additions & 5 deletions src/routers/v2/logging/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { and, eq, lt } from "drizzle-orm";
import { Hono } from "hono";
import { HTTPException } from "hono/http-exception";
import { and, eq, lt } from "drizzle-orm";

import { db } from "@/config/db";
import { env } from "@/config/env";
import { logs as logsTable } from "@/config/db/schema";
import { createV2ErrResponse, parseSearchParams, v2_serviceValidation } from "@/utils/server-helpers";
import { ENDPOINT_MESSAGES } from "@/utils/messages";
import { createDbId } from "@/utils/db";
import { env } from "@/config/env";
import type { ServerContext } from "@/types/hono";
import { createDbId } from "@/utils/db";
import { ENDPOINT_MESSAGES } from "@/utils/messages";
import { createV2ErrResponse, parseSearchParams, v2_serviceValidation } from "@/utils/server-helpers";

import { createLogOutputSchema, createLogSchema, getLogsFiltersSchema, getLogsOutputSchema } from "./schemas";

Expand Down
6 changes: 3 additions & 3 deletions src/routers/v2/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { HTTPException } from "hono/http-exception";

import { db } from "@/config/db";
import { services as servicesTable } from "@/config/db/schema";
import type { ServerContext } from "@/types/hono";
import { createDbId } from "@/utils/db";
import { ENDPOINT_MESSAGES } from "@/utils/messages";
import {
createV2ErrResponse,
v2_serviceValidation,
adminServiceValidation,
createV2ErrResponse,
parseSearchParams,
v2_serviceValidation,
} from "@/utils/server-helpers";
import type { ServerContext } from "@/types/hono";

import {
createServiceInputSchema,
Expand Down
2 changes: 1 addition & 1 deletion src/types/hono.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { HttpBindings } from "@hono/node-server";
import type { services as servicesTable } from "@/config/db/schema";
import type { HttpBindings } from "@hono/node-server";

type Service = typeof servicesTable.$inferSelect;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/openapi-docs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";

type OpenApiDocTransformer = (filename: string, source_path: string, dirVersion: string, doc: string) => string;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/package.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from "node:path";
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { z } from "zod";

const PackageSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion src/utils/server-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { HTTPException } from "hono/http-exception";

import { db } from "@/config/db";
import { env } from "@/config/env";
import type { Context } from "hono";
import type { ServerContext } from "@/types/hono";
import type { Context } from "hono";

import { ENDPOINT_MESSAGES } from "./messages";

Expand Down

0 comments on commit a608fb3

Please sign in to comment.