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 9ad9b34
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 63 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/sst.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ on:
UPSTASH_REDIS_REST_URL:
required: true

permissions:
id-token: write
contents: read
packages: read

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -39,10 +44,6 @@ jobs:
concurrency:
group: merge-${{ github.ref }}

permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sst.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
permissions:
id-token: write
contents: read
packages: read

jobs:
dev:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sst.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
permissions:
id-token: write
contents: read
packages: read

jobs:
prod:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sst.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
permissions:
id-token: write
contents: read
packages: read

jobs:
staging:
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@sgcarstrends:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
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 9ad9b34

Please sign in to comment.