Skip to content

Commit d5989d2

Browse files
committed
cant leave prettier
1 parent 890f25b commit d5989d2

File tree

469 files changed

+10669
-3978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

469 files changed

+10669
-3978
lines changed

.github/actions/pnpm_install/action.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ runs:
33
steps:
44
- uses: pnpm/action-setup@v4
55
with:
6-
version: "10.25.0"
76
run_install: false
87

98
- uses: actions/setup-node@v4

.prettierrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"parser": "typescript",
3+
"plugins": ["@prettier/plugin-oxc", "@trivago/prettier-plugin-sort-imports"],
4+
"importOrder": [
5+
"^\\./instrument$",
6+
"<THIRD_PARTY_MODULES>",
7+
"^@hypr/(.*)$",
8+
"^@/(.*)$",
9+
"^[./]"
10+
],
11+
"importOrderSeparation": true,
12+
"importOrderSortSpecifiers": true,
13+
"importOrderCaseInsensitive": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineWidth": 80
17+
}

apps/api/src/billing.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export async function syncBillingBridge(event: Stripe.Event) {
5050
const isCustomerEvent = (eventType: string) =>
5151
CUSTOMER_EVENTS.includes(eventType as Stripe.Event.Type);
5252

53-
const getCustomerId = (eventObject: Stripe.Event.Data.Object): string | null => {
53+
const getCustomerId = (
54+
eventObject: Stripe.Event.Data.Object,
55+
): string | null => {
5456
const obj = eventObject as {
5557
customer?: string | { id: string };
5658
id?: string;
@@ -83,10 +85,13 @@ const getStripeCustomer = async (customerId: string) => {
8385

8486
const isDeletedCustomer = (
8587
customer: Stripe.Customer | Stripe.DeletedCustomer,
86-
): customer is Stripe.DeletedCustomer => "deleted" in customer && customer.deleted === true;
88+
): customer is Stripe.DeletedCustomer =>
89+
"deleted" in customer && customer.deleted === true;
8790

8891
const getUserIdFromCustomer = (customer: Stripe.Customer): string | null => {
8992
const metadata = customer.metadata ?? {};
9093

91-
return metadata["userId"] || metadata["user_id"] || metadata["userID"] || null;
94+
return (
95+
metadata["userId"] || metadata["user_id"] || metadata["userID"] || null
96+
);
9297
};

apps/api/src/env.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export const env = createEnv({
88
process.env.NODE_ENV === "production"
99
? z.string().min(1) // Set in `api_cd.yaml` via the Fly CLI
1010
: z.string().optional(),
11-
NODE_ENV: z.enum(["development", "test", "production"]).default("development"),
11+
NODE_ENV: z
12+
.enum(["development", "test", "production"])
13+
.default("development"),
1214
LOAD_TEST: z.coerce.boolean().default(false),
1315
DATABASE_URL: z.string().min(1),
1416
SUPABASE_URL: z.url(),

apps/api/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ app.onError((err, c) => {
7070

7171
app.notFound((c) => c.text("not_found", 404));
7272

73-
app.get("/openapi.gen.json", openAPISpecs(routes, { documentation: openAPIDocumentation }));
73+
app.get(
74+
"/openapi.gen.json",
75+
openAPISpecs(routes, { documentation: openAPIDocumentation }),
76+
);
7477

7578
app.get(
7679
"/docs",

apps/api/src/instrument.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import * as Sentry from "@sentry/bun";
22

33
Sentry.init({
44
dsn: Bun.env.SENTRY_DSN,
5-
release: Bun.env.APP_VERSION ? `hyprnote-api@${Bun.env.APP_VERSION}` : undefined,
5+
release: Bun.env.APP_VERSION
6+
? `hyprnote-api@${Bun.env.APP_VERSION}`
7+
: undefined,
68
sampleRate: 1.0,
79
enabled: ["true", "1"].includes(Bun.env.LOAD_TEST),
810
});

apps/api/src/integration/loops.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export function classifyContactStatus(contact: LoopsContact): ContactStatus {
3838
return "unknown";
3939
}
4040

41-
export async function getContactByEmail(email: string): Promise<LoopsContact | null> {
41+
export async function getContactByEmail(
42+
email: string,
43+
): Promise<LoopsContact | null> {
4244
if (!env.LOOPS_API_KEY) {
4345
throw new Error("LOOPS_API_KEY not configured");
4446
}

apps/api/src/integration/slack.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export async function postThreadReply(
3737
});
3838

3939
if (!response.ok) {
40-
throw new Error(`Failed to post Slack message: ${response.status} ${response.statusText}`);
40+
throw new Error(
41+
`Failed to post Slack message: ${response.status} ${response.statusText}`,
42+
);
4143
}
4244

4345
const result: SlackPostMessageResponse = await response.json();
@@ -49,7 +51,9 @@ export async function postThreadReply(
4951
return result;
5052
} catch (error) {
5153
if (error instanceof Error && error.name === "AbortError") {
52-
throw new Error(`Slack API request timed out after ${SLACK_TIMEOUT_MS}ms`);
54+
throw new Error(
55+
`Slack API request timed out after ${SLACK_TIMEOUT_MS}ms`,
56+
);
5357
}
5458
throw error;
5559
} finally {

apps/api/src/integration/supabase.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ import { createClient } from "@supabase/supabase-js";
22

33
import { env } from "../env";
44

5-
export const supabaseAdmin = createClient(env.SUPABASE_URL, env.SUPABASE_SERVICE_ROLE_KEY);
5+
export const supabaseAdmin = createClient(
6+
env.SUPABASE_URL,
7+
env.SUPABASE_SERVICE_ROLE_KEY,
8+
);

apps/api/src/listen.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import type { Handler } from "hono";
22
import { upgradeWebSocket } from "hono/bun";
33

44
import type { AppBindings } from "./hono-bindings";
5-
import { createProxyFromRequest, normalizeWsData, WsProxyConnection } from "./stt";
5+
import {
6+
createProxyFromRequest,
7+
normalizeWsData,
8+
WsProxyConnection,
9+
} from "./stt";
610

711
export const listenSocketHandler: Handler<AppBindings> = async (c, next) => {
812
const emit = c.get("emit");
@@ -21,9 +25,11 @@ export const listenSocketHandler: Handler<AppBindings> = async (c, next) => {
2125
type: "stt.websocket.error",
2226
userId,
2327
provider,
24-
error: error instanceof Error ? error : new Error("upstream_connect_failed"),
28+
error:
29+
error instanceof Error ? error : new Error("upstream_connect_failed"),
2530
});
26-
const detail = error instanceof Error ? error.message : "upstream_connect_failed";
31+
const detail =
32+
error instanceof Error ? error.message : "upstream_connect_failed";
2733
const status = detail === "upstream_connect_timeout" ? 504 : 502;
2834
return c.json({ error: "upstream_connect_failed", detail }, status);
2935
}
@@ -58,7 +64,10 @@ export const listenSocketHandler: Handler<AppBindings> = async (c, next) => {
5864
type: "stt.websocket.error",
5965
userId,
6066
provider,
61-
error: event instanceof Error ? event : new Error("websocket_client_error"),
67+
error:
68+
event instanceof Error
69+
? event
70+
: new Error("websocket_client_error"),
6271
});
6372
connection.closeConnections(1011, "client_error");
6473
},

0 commit comments

Comments
 (0)