Skip to content

Commit

Permalink
Update schema to use package
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Dec 25, 2024
1 parent 8444268 commit be43c8f
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 71 deletions.
1 change: 1 addition & 0 deletions .github/workflows/sst.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
permissions:
id-token: write
contents: read
packages: read

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/sst.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- "main"
- "release/**"

permissions:
id-token: write
contents: read

jobs:
dev:
uses: ./.github/workflows/sst.deploy.yml
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/sst.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"

permissions:
id-token: write
contents: read

jobs:
prod:
uses: ./.github/workflows/sst.deploy.yml
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/sst.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
tags-ignore:
- "*"

permissions:
id-token: write
contents: read

jobs:
staging:
uses: ./.github/workflows/sst.deploy.yml
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@sgcarstrends:registry=https://npm.pkg.github.com/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@hono/zod-validator": "^0.4.2",
"@neondatabase/serverless": "^0.10.4",
"@sgcarstrends/schema": "^0.2.1",
"@upstash/ratelimit": "^2.0.3",
"@upstash/redis": "^1.34.0",
"date-fns": "^2.30.0",
Expand Down
40 changes: 40 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/getCarsByFuelType.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import db from "@/config/db";
import { getLatestMonth } from "@/lib/getLatestMonth";
import { cars } from "@/schema";
import { cars } from "@sgcarstrends/schema";
import type { FuelType } from "@/types";
import getTrailingTwelveMonths from "@/utils/getTrailingTwelveMonths";
import { and, asc, between, desc, eq, ilike, or } from "drizzle-orm";
Expand Down
54 changes: 0 additions & 54 deletions src/schema.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/v1/routes/cars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import redis from "@/config/redis";
import { getLatestMonth } from "@/lib/getLatestMonth";
import { getUniqueMonths } from "@/lib/getUniqueMonths";
import { groupMonthsByYear } from "@/lib/groupMonthsByYear";
import { cars } from "@/schema";
import { cars } from "@sgcarstrends/schema";
import { CarQuerySchema, MonthsQuerySchema } from "@/schemas";
import type { Make } from "@/types";
import getTrailingTwelveMonths from "@/utils/getTrailingTwelveMonths";
Expand Down
2 changes: 1 addition & 1 deletion src/v1/routes/coe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import redis from "@/config/redis";
import { getLatestMonth } from "@/lib/getLatestMonth";
import { getUniqueMonths } from "@/lib/getUniqueMonths";
import { groupMonthsByYear } from "@/lib/groupMonthsByYear";
import { coe } from "@/schema";
import { coe } from "@sgcarstrends/schema";
import { type COE, COEQuerySchema, MonthsQuerySchema } from "@/schemas";
import { zValidator } from "@hono/zod-validator";
import { and, asc, desc, eq, gte, lte } from "drizzle-orm";
Expand Down
2 changes: 1 addition & 1 deletion src/v1/routes/makes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CACHE_TTL } from "@/config";
import db from "@/config/db";
import redis from "@/config/redis";
import { cars } from "@/schema";
import { cars } from "@sgcarstrends/schema";
import { MakeParamSchema, MakeQuerySchema } from "@/schemas";
import { zValidator } from "@hono/zod-validator";
import { and, asc, desc, eq, ilike } from "drizzle-orm";
Expand Down
2 changes: 1 addition & 1 deletion src/v1/routes/months.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getLatestMonth } from "@/lib/getLatestMonth";
import { cars, coe } from "@/schema";
import { cars, coe } from "@sgcarstrends/schema";
import { LatestMonthQuerySchema } from "@/schemas";
import { zValidator } from "@hono/zod-validator";
import { Hono } from "hono";
Expand Down

0 comments on commit be43c8f

Please sign in to comment.