diff --git a/.prettierignore b/.prettierignore index bd5535a..e88fe36 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ pnpm-lock.yaml +pnpm-workspace.yaml diff --git a/apps/web/.prettierignore b/apps/web/.prettierignore new file mode 100644 index 0000000..ed0d3af --- /dev/null +++ b/apps/web/.prettierignore @@ -0,0 +1,2 @@ +.next +public diff --git a/apps/web/components.json b/apps/web/components.json index 2bde29b..3a923ac 100644 --- a/apps/web/components.json +++ b/apps/web/components.json @@ -5,7 +5,7 @@ "tsx": true, "tailwind": { "config": "tailwind.config.js", - "css": "app/globals.css", + "css": "src/app/globals.css", "baseColor": "slate", "cssVariables": true }, @@ -13,4 +13,4 @@ "components": "~/components", "utils": "~/lib/utils" } -} \ No newline at end of file +} diff --git a/apps/web/package.json b/apps/web/package.json index 77b9904..fe4f4da 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -31,6 +31,7 @@ "typescript": "^5.6.3" }, "devDependencies": { + "@codecompose/typescript-config": "^1.1.3", "@repo/eslint-config": "workspace:*", "@repo/typescript-config": "workspace:*", "autoprefixer": "^10.4.20", diff --git a/apps/web/public/next.svg b/apps/web/public/next.svg deleted file mode 100644 index 5174b28..0000000 --- a/apps/web/public/next.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/web/public/vercel.svg b/apps/web/public/vercel.svg deleted file mode 100644 index d2f8422..0000000 --- a/apps/web/public/vercel.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/web/app/components/card-with-action.tsx b/apps/web/src/app/components/card-with-action.tsx similarity index 90% rename from apps/web/app/components/card-with-action.tsx rename to apps/web/src/app/components/card-with-action.tsx index 1fa796a..507a83c 100644 --- a/apps/web/app/components/card-with-action.tsx +++ b/apps/web/src/app/components/card-with-action.tsx @@ -1,4 +1,4 @@ -import { Button } from "~/components/ui/button.jsx"; +import { Button } from "~/components/ui/button"; import { Card, CardContent, @@ -6,7 +6,7 @@ import { CardFooter, CardHeader, CardTitle, -} from "~/components/ui/card.jsx"; +} from "~/components/ui/card"; export default function CardWithAction(props: { title: string; diff --git a/apps/web/app/components/counter-view.tsx b/apps/web/src/app/components/counter-view.tsx similarity index 82% rename from apps/web/app/components/counter-view.tsx rename to apps/web/src/app/components/counter-view.tsx index 121885d..cd320a9 100644 --- a/apps/web/app/components/counter-view.tsx +++ b/apps/web/src/app/components/counter-view.tsx @@ -1,8 +1,8 @@ import type { Counter } from "@repo/common"; import { doc } from "firebase/firestore"; -import { useTypedDocument } from "~/lib/firestore.js"; -import { refs } from "~/refs.js"; -import KeyValueList from "./key-value-list.jsx"; +import { useTypedDocument } from "~/lib/firestore"; +import { refs } from "~/refs"; +import KeyValueList from "./key-value-list"; export function CounterView(props: { counterId: string }) { const [counter, isLoading] = useTypedDocument( diff --git a/apps/web/app/components/key-value-list.tsx b/apps/web/src/app/components/key-value-list.tsx similarity index 92% rename from apps/web/app/components/key-value-list.tsx rename to apps/web/src/app/components/key-value-list.tsx index 2fc6d78..a2a36a6 100644 --- a/apps/web/app/components/key-value-list.tsx +++ b/apps/web/src/app/components/key-value-list.tsx @@ -1,12 +1,7 @@ import type { FsTimestamp } from "@repo/common"; import { isDefined } from "@repo/common"; import { Timestamp } from "firebase/firestore"; -import { - Table, - TableBody, - TableCell, - TableRow, -} from "~/components/ui/table.jsx"; +import { Table, TableBody, TableCell, TableRow } from "~/components/ui/table"; type FsValue = string | number | boolean | null | FsTimestamp; diff --git a/apps/web/app/favicon.ico b/apps/web/src/app/favicon.ico similarity index 100% rename from apps/web/app/favicon.ico rename to apps/web/src/app/favicon.ico diff --git a/apps/web/app/globals.css b/apps/web/src/app/globals.css similarity index 100% rename from apps/web/app/globals.css rename to apps/web/src/app/globals.css diff --git a/apps/web/app/layout.tsx b/apps/web/src/app/layout.tsx similarity index 100% rename from apps/web/app/layout.tsx rename to apps/web/src/app/layout.tsx diff --git a/apps/web/app/page.tsx b/apps/web/src/app/page.tsx similarity index 89% rename from apps/web/app/page.tsx rename to apps/web/src/app/page.tsx index b049f90..01226b4 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -1,10 +1,10 @@ "use client"; import { areWeThereYet } from "@repo/common"; -import { CardDescription } from "~/components/ui/card.jsx"; -import { add, multiply, reset } from "~/lib/api.js"; -import CardWithAction from "./components/card-with-action.jsx"; -import { CounterView } from "./components/counter-view.jsx"; +import { CardDescription } from "~/components/ui/card"; +import { add, multiply, reset } from "~/lib/api"; +import CardWithAction from "./components/card-with-action"; +import { CounterView } from "./components/counter-view"; export default function Home() { return ( diff --git a/apps/web/components/ui/button.tsx b/apps/web/src/components/ui/button.tsx similarity index 98% rename from apps/web/components/ui/button.tsx rename to apps/web/src/components/ui/button.tsx index fcdfa4a..036149d 100644 --- a/apps/web/components/ui/button.tsx +++ b/apps/web/src/components/ui/button.tsx @@ -1,8 +1,7 @@ import { Slot } from "@radix-ui/react-slot"; import { cva, type VariantProps } from "class-variance-authority"; import * as React from "react"; - -import { cn } from "~/lib/utils.js"; +import { cn } from "~/lib/utils"; const buttonVariants = cva( "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-950 disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-zinc-300", diff --git a/apps/web/components/ui/card.tsx b/apps/web/src/components/ui/card.tsx similarity index 98% rename from apps/web/components/ui/card.tsx rename to apps/web/src/components/ui/card.tsx index bc673d2..f413007 100644 --- a/apps/web/components/ui/card.tsx +++ b/apps/web/src/components/ui/card.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { cn } from "~/lib/utils.js"; +import { cn } from "~/lib/utils"; const Card = React.forwardRef< HTMLDivElement, diff --git a/apps/web/components/ui/table.tsx b/apps/web/src/components/ui/table.tsx similarity index 98% rename from apps/web/components/ui/table.tsx rename to apps/web/src/components/ui/table.tsx index 8342987..3b9ae7c 100644 --- a/apps/web/components/ui/table.tsx +++ b/apps/web/src/components/ui/table.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { cn } from "~/lib/utils.js"; +import { cn } from "~/lib/utils"; const Table = React.forwardRef< HTMLTableElement, diff --git a/apps/web/lib/api.ts b/apps/web/src/lib/api.ts similarity index 100% rename from apps/web/lib/api.ts rename to apps/web/src/lib/api.ts diff --git a/apps/web/lib/firebase.ts b/apps/web/src/lib/firebase.ts similarity index 100% rename from apps/web/lib/firebase.ts rename to apps/web/src/lib/firebase.ts diff --git a/apps/web/lib/firestore.ts b/apps/web/src/lib/firestore.ts similarity index 100% rename from apps/web/lib/firestore.ts rename to apps/web/src/lib/firestore.ts diff --git a/apps/web/lib/utils.ts b/apps/web/src/lib/utils/cn.ts similarity index 100% rename from apps/web/lib/utils.ts rename to apps/web/src/lib/utils/cn.ts diff --git a/apps/web/lib/utils/fetch.ts b/apps/web/src/lib/utils/fetch.ts similarity index 100% rename from apps/web/lib/utils/fetch.ts rename to apps/web/src/lib/utils/fetch.ts diff --git a/apps/web/src/lib/utils/index.ts b/apps/web/src/lib/utils/index.ts new file mode 100644 index 0000000..d35f7f8 --- /dev/null +++ b/apps/web/src/lib/utils/index.ts @@ -0,0 +1,2 @@ +export * from "./cn"; +export * from "./fetch"; diff --git a/apps/web/refs.ts b/apps/web/src/refs.ts similarity index 74% rename from apps/web/refs.ts rename to apps/web/src/refs.ts index 66ea4e5..27dcc53 100644 --- a/apps/web/refs.ts +++ b/apps/web/src/refs.ts @@ -1,5 +1,5 @@ import { collection } from "firebase/firestore"; -import { db } from "~/lib/firebase.js"; +import { db } from "~/lib/firebase"; export const refs = { counters: collection(db, "counters"), diff --git a/apps/web/tailwind.config.cjs b/apps/web/tailwind.config.cjs index 0dd6920..7d4a1a2 100644 --- a/apps/web/tailwind.config.cjs +++ b/apps/web/tailwind.config.cjs @@ -1,7 +1,7 @@ -/** @type {import('tailwindcss').Config} */ +/** @type {import("tailwindcss").Config} */ module.exports = { darkMode: ["class"], - content: ["./components/**/*.{ts,tsx}", "./app/**/*.{ts,tsx}"], + content: ["./src/components/**/*.{ts,tsx}", "./src/app/**/*.{ts,tsx}"], theme: { container: { center: true, diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index 74f58bd..975302d 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -1,27 +1,9 @@ { - "compilerOptions": { - "target": "es2020", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "noEmit": true, - "esModuleInterop": true, - "module": "nodenext", - "moduleResolution": "nodenext", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "paths": { - "~/*": ["./*"] + "extends": "@codecompose/typescript-config/nextjs.json", + "include": ["src", ".next/types/**/*.ts"], + "references": [ + { + "path": "../../packages/common" } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + ] } diff --git a/packages/backend/package.json b/packages/backend/package.json index f8480d2..e36f80d 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -26,6 +26,7 @@ "firebase-functions": "^5.1.1" }, "devDependencies": { + "@codecompose/typescript-config": "^1.1.3", "@repo/eslint-config": "workspace:*", "@repo/typescript-config": "workspace:*", "@types/node": "^22.7.5", diff --git a/packages/backend/src/firebase.ts b/packages/backend/src/firebase.ts index 2386c7a..af416ad 100644 --- a/packages/backend/src/firebase.ts +++ b/packages/backend/src/firebase.ts @@ -9,7 +9,6 @@ export type { Firestore } from "firebase-admin/firestore"; export type { UpdateData } from "firebase-admin/firestore"; - if (!admin.apps.length) { admin.initializeApp(); diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index e5c30d3..f72c584 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -1,3 +1,2 @@ -export type * from './firebase'; -export type * from './utils/index.js'; - +export type * from "./firebase"; +export type * from "./utils/index.js"; diff --git a/packages/backend/src/utils/index.ts b/packages/backend/src/utils/index.ts index 09ffd20..88c237d 100644 --- a/packages/backend/src/utils/index.ts +++ b/packages/backend/src/utils/index.ts @@ -1,3 +1,3 @@ -export * from "./assertions.js"; -export * from "./timer.js"; +export * from "./assertions"; +export * from "./timer"; // Compare this snippet from packages/backend/src/utils/index.ts: diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json index 778189b..8ebfb86 100644 --- a/packages/backend/tsconfig.json +++ b/packages/backend/tsconfig.json @@ -1,13 +1,8 @@ { - "extends": "@repo/typescript-config/library.json", - "compilerOptions": { - "target": "esnext", - "rootDir": "src", - "outDir": "dist", - "composite": true, - "paths": { - "~/*": ["./*"] + "extends": "@codecompose/typescript-config/library.json", + "references": [ + { + "path": "../common" } - }, - "include": ["src"] + ] } diff --git a/packages/backend/tsup.config.ts b/packages/backend/tsup.config.ts index 64a3ea0..fb0a9ae 100644 --- a/packages/backend/tsup.config.ts +++ b/packages/backend/tsup.config.ts @@ -8,9 +8,7 @@ export default defineConfig({ */ "utils/index": "src/utils/index.ts", - /** - * Files - */ + /** Files */ firebase: "src/firebase.ts", }, format: ["esm"], diff --git a/packages/common/package.json b/packages/common/package.json index 493617f..5a5e2fa 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -22,6 +22,7 @@ "remeda": "^2.15.0" }, "devDependencies": { + "@codecompose/typescript-config": "^1.1.3", "@repo/eslint-config": "workspace:*", "@repo/typescript-config": "workspace:*", "eslint": "^8.57.1", diff --git a/packages/common/src/document-types.ts b/packages/common/src/document-types.ts index 27a1148..419630e 100644 --- a/packages/common/src/document-types.ts +++ b/packages/common/src/document-types.ts @@ -1,6 +1,4 @@ -/** - * This file contains Firestore document types - */ +/** This file contains Firestore document types */ import type { Timestamp } from "firebase/firestore"; diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index ce900e8..cef872b 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -1,3 +1,3 @@ -export * from "./are-we-there-yet.js"; -export * from "./document-types.js"; -export * from "./utils/index.js"; +export * from "./are-we-there-yet"; +export * from "./document-types"; +export * from "./utils"; diff --git a/packages/common/src/utils/index.ts b/packages/common/src/utils/index.ts index 8f40458..f7d085a 100644 --- a/packages/common/src/utils/index.ts +++ b/packages/common/src/utils/index.ts @@ -1,5 +1,5 @@ -export * from "./get-error-message.js"; -export * from "./invariant.js"; -export * from "./is-empty.js"; -export * from "./is-present.js"; -export * from "./unique.js"; +export * from "./get-error-message"; +export * from "./invariant"; +export * from "./is-empty"; +export * from "./is-present"; +export * from "./unique"; diff --git a/packages/common/src/utils/is-empty.ts b/packages/common/src/utils/is-empty.ts index b29a94e..f0e3ca1 100644 --- a/packages/common/src/utils/is-empty.ts +++ b/packages/common/src/utils/is-empty.ts @@ -1,5 +1,6 @@ /** - * Arrays only. Typically isEmpty does more than that, but we don't need it here. + * Arrays only. Typically isEmpty does more than that, but we don't need it + * here. */ export function isEmpty(array: T[]): array is [] { return array.length === 0; diff --git a/packages/common/src/utils/is-present.ts b/packages/common/src/utils/is-present.ts index 45e9087..77093a1 100644 --- a/packages/common/src/utils/is-present.ts +++ b/packages/common/src/utils/is-present.ts @@ -1,6 +1,4 @@ -/** - * Copied from ts-is-present - */ +/** Copied from ts-is-present */ export function isPresent(t: T | undefined | null | void): t is T { return t !== undefined && t !== null; } diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index 1d82d14..66e1140 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -1,10 +1,3 @@ { - "extends": "@repo/typescript-config/library.json", - "compilerOptions": { - "target": "esnext", - "rootDir": "src", - "outDir": "dist", - "composite": true - }, - "include": ["src"] + "extends": "@codecompose/typescript-config/library.json" } diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 53bfd67..a00e3b1 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -9,6 +9,7 @@ ], "license": "MIT", "devDependencies": { + "@codecompose/typescript-config": "^1.1.3", "@typescript-eslint/eslint-plugin": "^8.8.1", "@typescript-eslint/parser": "^8.8.1", "@vercel/style-guide": "^6.0.0", diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json deleted file mode 100644 index 26dda1b..0000000 --- a/packages/typescript-config/base.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "The common base settings", - "compilerOptions": { - "target": "ES2022", - "composite": false, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "inlineSources": false, - "isolatedModules": true, - "moduleResolution": "node", - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "skipLibCheck": true, - "strict": true - } -} diff --git a/packages/typescript-config/library.json b/packages/typescript-config/library.json deleted file mode 100644 index 9d77d95..0000000 --- a/packages/typescript-config/library.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "A shared library", - "extends": "./base.json", - "compilerOptions": { - "lib": ["ESNext"], - "declaration": true, - "declarationMap": true - } -} diff --git a/packages/typescript-config/nextjs.json b/packages/typescript-config/nextjs.json deleted file mode 100644 index 82befe0..0000000 --- a/packages/typescript-config/nextjs.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "A Next.js application", - "extends": "./base.json", - "compilerOptions": { - "allowJs": true, - "declaration": false, - "declarationMap": false, - "incremental": true, - "jsx": "preserve", - "lib": ["dom", "dom.iterable", "esnext"], - "module": "esnext", - "noEmit": true, - "resolveJsonModule": true, - "strict": false, - "target": "ES2020" - }, - "include": ["src", "next-env.d.ts"] -} diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json deleted file mode 100644 index 27c0e60..0000000 --- a/packages/typescript-config/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "@repo/typescript-config", - "version": "0.0.0", - "private": true, - "license": "MIT", - "publishConfig": { - "access": "public" - } -} diff --git a/packages/typescript-config/service.json b/packages/typescript-config/service.json deleted file mode 100644 index a2c38ed..0000000 --- a/packages/typescript-config/service.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "display": "A backend service", - "extends": "./base.json", - "compilerOptions": { - "module": "nodenext", - "moduleResolution": "nodenext", - "outDir": "dist", - "lib": ["esnext"], - "sourceMap": true, - "types": ["node"] - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 000edb9..9ca8d88 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,6 +81,9 @@ importers: specifier: ^5.6.3 version: 5.6.3 devDependencies: + '@codecompose/typescript-config': + specifier: ^1.1.3 + version: 1.1.3 '@repo/eslint-config': specifier: workspace:* version: link:../../packages/eslint-config @@ -121,6 +124,9 @@ importers: specifier: ^5.1.1 version: 5.1.1(firebase-admin@12.6.0(encoding@0.1.13)) devDependencies: + '@codecompose/typescript-config': + specifier: ^1.1.3 + version: 1.1.3 '@repo/eslint-config': specifier: workspace:* version: link:../eslint-config @@ -158,6 +164,9 @@ importers: specifier: ^2.15.0 version: 2.15.0 devDependencies: + '@codecompose/typescript-config': + specifier: ^1.1.3 + version: 1.1.3 '@repo/eslint-config': specifier: workspace:* version: link:../eslint-config @@ -182,6 +191,9 @@ importers: packages/eslint-config: devDependencies: + '@codecompose/typescript-config': + specifier: ^1.1.3 + version: 1.1.3 '@typescript-eslint/eslint-plugin': specifier: ^8.8.1 version: 8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@2.3.3))(typescript@5.6.3))(eslint@9.12.0(jiti@2.3.3))(typescript@5.6.3) @@ -207,7 +219,11 @@ importers: specifier: ^5.6.3 version: 5.6.3 - packages/typescript-config: {} + packages/typescript-config: + devDependencies: + '@codecompose/typescript-config': + specifier: ^1.1.3 + version: 1.1.3 services/api: dependencies: @@ -251,6 +267,9 @@ importers: specifier: ^3.23.8 version: 3.23.8 devDependencies: + '@codecompose/typescript-config': + specifier: ^1.1.3 + version: 1.1.3 '@repo/eslint-config': specifier: workspace:* version: link:../../packages/eslint-config @@ -330,6 +349,9 @@ importers: specifier: ^2.15.0 version: 2.15.0 devDependencies: + '@codecompose/typescript-config': + specifier: ^1.1.3 + version: 1.1.3 '@repo/eslint-config': specifier: workspace:* version: link:../../packages/eslint-config @@ -489,6 +511,9 @@ packages: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} + '@codecompose/typescript-config@1.1.3': + resolution: {integrity: sha512-Idjz3rkoopGTWpGGM+9aOknfp6x56DUZ7dPrigq52dN7U08JlUFKo5qTqjgqy9gpGA79UEesUz8564/jQlvpGQ==} + '@colors/colors@1.5.0': resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} @@ -7616,6 +7641,8 @@ snapshots: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 + '@codecompose/typescript-config@1.1.3': {} + '@colors/colors@1.5.0': optional: true diff --git a/services/api/package.json b/services/api/package.json index a566c67..afaff24 100644 --- a/services/api/package.json +++ b/services/api/package.json @@ -33,6 +33,7 @@ "zod": "^3.23.8" }, "devDependencies": { + "@codecompose/typescript-config": "^1.1.3", "@repo/eslint-config": "workspace:*", "@repo/typescript-config": "workspace:*", "@types/body-parser": "^1.19.5", diff --git a/services/api/src/index.ts b/services/api/src/index.ts index 6101558..394446b 100644 --- a/services/api/src/index.ts +++ b/services/api/src/index.ts @@ -4,4 +4,4 @@ */ import "firebase-functions/logger/compat"; -export * from "./server.js"; +export * from "./server"; diff --git a/services/api/src/lib/utils/index.ts b/services/api/src/lib/utils/index.ts index 00b222a..bbafb55 100644 --- a/services/api/src/lib/utils/index.ts +++ b/services/api/src/lib/utils/index.ts @@ -1 +1 @@ -export * from "./verify-api-key.js"; +export * from "./verify-api-key"; diff --git a/services/api/src/server.ts b/services/api/src/server.ts index 010fca1..3047a7c 100644 --- a/services/api/src/server.ts +++ b/services/api/src/server.ts @@ -5,8 +5,8 @@ import express from "express"; import { defineSecret } from "firebase-functions/params"; import { onRequest } from "firebase-functions/v2/https"; import NoCache from "nocache"; -import { region } from "~/config.js"; -import v1 from "./v1/index.js"; +import { region } from "~/config"; +import v1 from "./v1"; const demoApiKey = defineSecret("DEMO_API_KEY"); diff --git a/services/api/src/v1/handlers.ts b/services/api/src/v1/handlers.ts index 514c737..402d9d1 100644 --- a/services/api/src/v1/handlers.ts +++ b/services/api/src/v1/handlers.ts @@ -5,7 +5,7 @@ import type { Request, Response } from "express"; import { FieldValue } from "firebase-admin/firestore"; import { getDocument } from "firestore-server-utils"; import { z } from "zod"; -import { refs } from "~/refs.js"; +import { refs } from "~/refs"; export async function reset(_req: Request, res: Response) { await refs.counters.doc("my_counter").set({ diff --git a/services/api/src/v1/index.ts b/services/api/src/v1/index.ts index e37d33e..5378562 100644 --- a/services/api/src/v1/index.ts +++ b/services/api/src/v1/index.ts @@ -1,7 +1,7 @@ import type { Router } from "express"; import express from "express"; -import { verifyApiKey } from "~/lib/utils/index.js"; -import { add, multiply, reset } from "./handlers.js"; +import { verifyApiKey } from "~/lib/utils"; +import { add, multiply, reset } from "./handlers"; const router: Router = express.Router(); diff --git a/services/api/tsconfig.json b/services/api/tsconfig.json index 7c8b6f8..1bbbd2d 100644 --- a/services/api/tsconfig.json +++ b/services/api/tsconfig.json @@ -1,11 +1,11 @@ { - "extends": "@repo/typescript-config/service.json", - "compilerOptions": { - "outDir": "dist", - "baseUrl": ".", - "paths": { - "~/*": ["src/*"] + "extends": "@codecompose/typescript-config/service.json", + "references": [ + { + "path": "../../packages/common" + }, + { + "path": "../../packages/backend" } - }, - "include": ["src"] + ] } diff --git a/services/api/turbo.json b/services/api/turbo.json index 3ff3d1c..6148196 100644 --- a/services/api/turbo.json +++ b/services/api/turbo.json @@ -1,38 +1,19 @@ { - "extends": [ - "//" - ], - "globalDependencies": [ - ".env" - ], + "extends": ["//"], + "globalDependencies": [".env"], "tasks": { "build": { - "env": [ - "DEMO_ENV_VAR" - ], - "dependsOn": [ - "^build" - ], - "outputs": [ - "dist/**" - ] + "env": ["DEMO_ENV_VAR"], + "dependsOn": ["^build"], + "outputs": ["dist/**"] }, "test": { - "dependsOn": [ - "^build" - ], - "outputs": [ - "coverage/**" - ], - "inputs": [ - "src/**/*.tsx", - "src/**/*.ts" - ] + "dependsOn": ["^build"], + "outputs": ["coverage/**"], + "inputs": ["src/**/*.tsx", "src/**/*.ts"] }, "lint": { - "dependsOn": [ - "^lint" - ] + "dependsOn": ["^lint"] } } } diff --git a/services/fns/package.json b/services/fns/package.json index 829bea1..e06ea7a 100644 --- a/services/fns/package.json +++ b/services/fns/package.json @@ -34,6 +34,7 @@ "remeda": "^2.15.0" }, "devDependencies": { + "@codecompose/typescript-config": "^1.1.3", "@repo/eslint-config": "workspace:*", "@repo/typescript-config": "workspace:*", "@types/body-parser": "^1.19.5", diff --git a/services/fns/src/counters-on-write.ts b/services/fns/src/counters-on-write.ts index 30728f0..c88fa7d 100644 --- a/services/fns/src/counters-on-write.ts +++ b/services/fns/src/counters-on-write.ts @@ -2,7 +2,7 @@ import { areWeThereYet, type Counter } from "@repo/common"; import type { UpdateData } from "firebase-admin/firestore"; import { FieldValue } from "firebase-admin/firestore"; import functions from "firebase-functions"; -import { counterFlagThreshold, region } from "~/config.js"; +import { counterFlagThreshold, region } from "~/config"; /** * This is a bit of a contrived example, and by no means a demonstration of diff --git a/services/fns/src/index.ts b/services/fns/src/index.ts index 99ebd14..3e4730d 100644 --- a/services/fns/src/index.ts +++ b/services/fns/src/index.ts @@ -9,4 +9,4 @@ */ import "firebase-functions/logger/compat"; -export * from "./counters-on-write.js"; +export * from "./counters-on-write"; diff --git a/services/fns/tsconfig.json b/services/fns/tsconfig.json index 7c8b6f8..1bbbd2d 100644 --- a/services/fns/tsconfig.json +++ b/services/fns/tsconfig.json @@ -1,11 +1,11 @@ { - "extends": "@repo/typescript-config/service.json", - "compilerOptions": { - "outDir": "dist", - "baseUrl": ".", - "paths": { - "~/*": ["src/*"] + "extends": "@codecompose/typescript-config/service.json", + "references": [ + { + "path": "../../packages/common" + }, + { + "path": "../../packages/backend" } - }, - "include": ["src"] + ] } diff --git a/services/fns/turbo.json b/services/fns/turbo.json index 319111c..2fbd3ec 100644 --- a/services/fns/turbo.json +++ b/services/fns/turbo.json @@ -1,36 +1,19 @@ { - "extends": [ - "//" - ], - "globalDependencies": [ - ".env" - ], + "extends": ["//"], + "globalDependencies": [".env"], "globalEnv": [], "tasks": { "build": { - "dependsOn": [ - "^build" - ], - "outputs": [ - "dist/**" - ] + "dependsOn": ["^build"], + "outputs": ["dist/**"] }, "test": { - "dependsOn": [ - "^build" - ], - "outputs": [ - "coverage/**" - ], - "inputs": [ - "src/**/*.tsx", - "src/**/*.ts" - ] + "dependsOn": ["^build"], + "outputs": ["coverage/**"], + "inputs": ["src/**/*.tsx", "src/**/*.ts"] }, "lint": { - "dependsOn": [ - "^lint" - ] + "dependsOn": ["^lint"] } } }