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 f7017fb
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 60 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/sst.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
environment: ${{ inputs.environment }}
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
SG_CARS_TRENDS_API_TOKEN: ${{ secrets.SG_CARS_TRENDS_API_TOKEN }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
Expand All @@ -42,6 +43,7 @@ jobs:
permissions:
id-token: write
contents: read
packages: read

steps:
- uses: actions/checkout@v4
Expand All @@ -53,7 +55,9 @@ jobs:
node-version: latest
cache: "pnpm"
- name: Install dependencies
run: pnpm install
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc # Add auth token to .npmrc
pnpm install
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ROLE_TO_ASSUME }}
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
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 f7017fb

Please sign in to comment.