Skip to content

Commit

Permalink
feat: add biome
Browse files Browse the repository at this point in the history
  • Loading branch information
cstrnt committed Aug 7, 2024
1 parent cc68c06 commit 40e4204
Show file tree
Hide file tree
Showing 324 changed files with 3,681 additions and 5,000 deletions.
13 changes: 0 additions & 13 deletions .eslintrc.js

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"recommendations": [
"svelte.svelte-vscode"
]
}
"recommendations": ["svelte.svelte-vscode"]
}
6 changes: 2 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"[typescript][typescriptreact][typescriptangular]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.workingDirectories": ["apps", "packages"],
"prettier.enable": true
"editor.defaultFormatter": "biomejs.biome"
}
}
4 changes: 2 additions & 2 deletions apps/cdn/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ABBY_WINDOW_KEY, type AbbyDataResponse } from "@tryabby/core";
import { Hono } from "hono";
import { ZoneCache } from "./lib/cache";
import { ABBY_WINDOW_KEY, AbbyDataResponse } from "@tryabby/core";

import { cors } from "hono/cors";
import { timing } from "hono/timing";
import { logger } from "hono/logger";
import { timing } from "hono/timing";
import { ConfigService } from "./lib/config";

const cache = new ZoneCache<{
Expand Down
12 changes: 8 additions & 4 deletions apps/cdn/src/lib/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ export class ZoneCache<TNamespaces extends Record<string, unknown>> {
}

public async get<TName extends keyof TNamespaces>(
c: Context,
_c: Context,
namespace: TName,
key: string
): Promise<[TNamespaces[TName] | undefined, "stale" | "hit" | "miss" | "error"]> {
): Promise<
[TNamespaces[TName] | undefined, "stale" | "hit" | "miss" | "error"]
> {
try {
const res = await caches.default.match(new Request(this.createCacheKey(namespace, key)));
const res = await caches.default.match(
new Request(this.createCacheKey(namespace, key))
);
if (!res) {
return [undefined, "miss"];
}
Expand All @@ -76,7 +80,7 @@ export class ZoneCache<TNamespaces extends Record<string, unknown>> {
const res = new Response(JSON.stringify(entry), {
headers: {
"Content-Type": "application/json",
"Cache-Control": `public, s-maxage=60`,
"Cache-Control": "public, s-maxage=60",
},
});

Expand Down
6 changes: 3 additions & 3 deletions apps/cdn/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AbbyDataResponse, HttpService } from "@tryabby/core";
import { type AbbyDataResponse, HttpService } from "@tryabby/core";

import type { ZoneCache } from "./cache";
import { Context } from "hono";
import type { Context } from "hono";
import { endTime, startTime } from "hono/timing";
import type { ZoneCache } from "./cache";

export class ConfigService {
constructor(
Expand Down
6 changes: 1 addition & 5 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"start": "next start"
},
"dependencies": {
"@types/node": "^18.0.0",
"@types/react": "18.0.26",
"@types/react-dom": "^18.0.5",
"eslint": "8.29.0",
"eslint-config-next": "13.0.6",
"next": "14.1.1",
"next-plausible": "^3.11.3",
"nextra": "2.13.2",
Expand All @@ -23,7 +20,6 @@
"typescript": "5.5.4"
},
"devDependencies": {
"eslint-config-custom": "workspace:^0.0.0",
"tsconfig": "workspace:^0.0.0"
}
}
1 change: 0 additions & 1 deletion apps/docs/theme.config.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
import { useRouter } from "next/router";

export default {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/abby.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable turbo/no-undeclared-env-vars */
import { defineConfig } from "@tryabby/core";

export default defineConfig(
{
// biome-ignore lint/style/noNonNullAssertion:>
projectId: process.env.NEXT_PUBLIC_ABBY_PROJECT_ID!,
currentEnvironment: process.env.VERCEL_ENV ?? process.env.NODE_ENV,
apiUrl: process.env.NEXT_PUBLIC_ABBY_API_URL,
Expand Down
22 changes: 10 additions & 12 deletions apps/web/emails/ContactFormularEmail.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

import { Container } from "@react-email/container";
import { Head } from "@react-email/head";
import { Html } from "@react-email/html";
import { Preview } from "@react-email/preview";
import { Section } from "@react-email/section";
import * as React from "react";
import { ABBY_BASE_URL } from "@tryabby/core";

export type Props = {
Expand All @@ -20,7 +18,7 @@ export default function ContactFormularEmail({
name,
message,
}: Props) {
const baseUrl =
const _baseUrl =
process.env.NODE_ENV === "development"
? "http://localhost:3000/"
: ABBY_BASE_URL;
Expand Down Expand Up @@ -60,11 +58,11 @@ const container = {
width: "465px",
};

const logo = {
const _logo = {
margin: "0 auto",
};

const h1 = {
const _h1 = {
color: "#000",
fontFamily:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
Expand All @@ -75,32 +73,32 @@ const h1 = {
padding: "0",
};

const avatar = {
const _avatar = {
borderRadius: "100%",
};

const link = {
const _link = {
color: "#067df7",
textDecoration: "none",
};

const text = {
const _text = {
color: "#000",
fontFamily:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
fontSize: "14px",
lineHeight: "24px",
};

const black = {
const _black = {
color: "black",
};

const center = {
const _center = {
verticalAlign: "middle",
};

const btn = {
const _btn = {
backgroundColor: "#000",
borderRadius: "5px",
color: "#fff",
Expand All @@ -113,6 +111,6 @@ const btn = {
textAlign: "center" as const,
};

const spacing = {
const _spacing = {
marginBottom: "26px",
};
4 changes: 2 additions & 2 deletions apps/web/emails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { render } from "@react-email/render";
import { env } from "env/server.mjs";
import { createTransport } from "nodemailer";
import InviteEmail, { Props as InviteEmailProps } from "./invite";
import ContactFormularEmail, {
Props as ContactMailProps,
type Props as ContactMailProps,
} from "./ContactFormularEmail";
import InviteEmail, { type Props as InviteEmailProps } from "./invite";

const transporter = createTransport({
pool: true,
Expand Down
15 changes: 6 additions & 9 deletions apps/web/emails/invite.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { Project } from "@prisma/client";
import type { Project } from "@prisma/client";
import { Button } from "@react-email/button";
import { Container } from "@react-email/container";
import { Head } from "@react-email/head";
import { Hr } from "@react-email/hr";
import { Html } from "@react-email/html";
import { Img } from "@react-email/img";
import { Link } from "@react-email/link";
import { Preview } from "@react-email/preview";
import { Section } from "@react-email/section";
import { Text } from "@react-email/text";
import * as React from "react";
import { ABBY_BASE_URL } from "@tryabby/core";

export type Props = {
Expand Down Expand Up @@ -88,7 +85,7 @@ const container = {
width: "465px",
};

const logo = {
const _logo = {
margin: "0 auto",
};

Expand All @@ -103,7 +100,7 @@ const h1 = {
padding: "0",
};

const avatar = {
const _avatar = {
borderRadius: "100%",
};

Expand All @@ -120,11 +117,11 @@ const text = {
lineHeight: "24px",
};

const black = {
const _black = {
color: "black",
};

const center = {
const _center = {
verticalAlign: "middle",
};

Expand All @@ -141,6 +138,6 @@ const btn = {
textAlign: "center" as const,
};

const spacing = {
const _spacing = {
marginBottom: "26px",
};
4 changes: 2 additions & 2 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { remarkCodeHike } from "@code-hike/mdx";
// @ts-check
import bundleAnalzyer from "@next/bundle-analyzer";
import { withPlausibleProxy } from "next-plausible";
import mdx from "@next/mdx";
import { remarkCodeHike } from "@code-hike/mdx";
import { withPlausibleProxy } from "next-plausible";
import theme from "shiki/themes/poimandres.json" assert { type: "json" };

const withMDX = mdx({
Expand Down
10 changes: 2 additions & 8 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"dev": "next dev",
"postinstall": "pnpm run db:generate",
"db:generate": "prisma generate",
"lint": "next lint",
"start": "next start",
"seed:events": "ts-node --compiler-options {\\\"module\\\":\\\"CommonJS\\\"} prisma/seedEvents.ts",
"db:migrate": "prisma migrate dev",
Expand All @@ -34,8 +33,6 @@
"@monaco-editor/react": "^4.5.1",
"@next-auth/prisma-adapter": "1.0.5",
"@next/mdx": "14.0.4",
"@planetscale/database": "^1.11.0",
"@prisma/adapter-planetscale": "5.6.0",
"@prisma/client": "5.6.0",
"@radix-ui/react-avatar": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.5",
Expand Down Expand Up @@ -118,6 +115,7 @@
"tailwind-merge": "^1.13.1",
"tailwindcss-animate": "^1.0.6",
"ts-pattern": "^4.2.2",
"vite": "5.4.0",
"zod": "^3.21.4",
"zustand": "^4.4.1"
},
Expand All @@ -133,12 +131,8 @@
"@types/prettier": "^2.7.2",
"@types/react": "18.0.14",
"@types/react-dom": "18.0.05",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vitejs/plugin-react": "4.2.1",
"autoprefixer": "^10.4.14",
"eslint": "^8.38.0",
"eslint-config-next": "13.0.2",
"jsdom": "^20.0.3",
"postcss": "^8.4.21",
"prettier": "^2.8.7",
Expand All @@ -149,7 +143,7 @@
"tsconfig-paths": "^4.2.0",
"typescript": "5.5.4",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "2.0.4"
"vitest": "2.0.5"
},
"ct3aMetadata": {
"initVersion": "6.11.1"
Expand Down
4 changes: 0 additions & 4 deletions apps/web/prettier.config.cjs

This file was deleted.

6 changes: 2 additions & 4 deletions apps/web/prisma/generateCoupons.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PrismaClient } from "@prisma/client";
import fs from "node:fs/promises";
import path from "node:path";
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

Expand All @@ -10,9 +10,7 @@ async function main() {
const fileName = path.join(__dirname, "./coupons.csv");

const items = Array.from({ length: COUPON_CODE_AMOUNT }).map(() => ({
stripePriceId:
// eslint-disable-next-line turbo/no-undeclared-env-vars
"STARTUP_LIFETIME",
stripePriceId: "STARTUP_LIFETIME",
}));

const codes = await prisma.$transaction(
Expand Down
Loading

0 comments on commit 40e4204

Please sign in to comment.