Skip to content

Commit e94c447

Browse files
V6 (#688)
* Update root deps * Fix root commands * Run fix * Switch from auto to changesets * Resolves #668 * Migrate to Bun runtime * Resolves #683 * Add missing deps * Update package.json * Bump deps * Build fixes * Fix lockfile * Update prisma.config.ts * Resolves #678 * For #682 * Resolves #591 * Update route.ts * Update route.ts * Fix docs package.json * Update Sentry * Resolves #578 * Remove dotenv * Resolves #682, resolves #590, resolves #293 * Update Geistdocs, resolves #685 * Remove unused shadcn/ui components * Fix docs links, for #621 * Resolves #621, resolves #647 * Resolves #486 * Resolves #471 * Add skill, resolves #454 * Add new frontmatter metadata * Resolves #179, resolves #273 * Resolves #382, resolves #413 * Resolves #372 * Update migration guides * Resolves #483 * Resolves #366 * Use nypm for package manager logic * Resolves #242 * Update package.json * Resolves #451 * Remove changesets * Run linter/formatter * Revert to shipit * Misc docs fixes * Add dotenv * Add branch support to init
1 parent 93322d4 commit e94c447

File tree

305 files changed

+12089
-37138
lines changed

Some content is hidden

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

305 files changed

+12089
-37138
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ updates:
1010

1111
# Maintain dependencies for npm
1212
- package-ecosystem: "npm"
13-
directory: "/"
13+
directories:
14+
- "/"
15+
- "/apps/*"
16+
- "/packages/*"
1417
open-pull-requests-limit: 10
1518
schedule:
1619
interval: "monthly"

.github/workflows/release.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,14 @@ jobs:
2424
- name: Install Node.js
2525
uses: actions/setup-node@v4
2626

27-
- uses: pnpm/action-setup@v4
28-
name: Install pnpm
29-
with:
30-
run_install: false
31-
32-
- name: Get pnpm store directory
33-
shell: bash
34-
run: |
35-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
36-
37-
- uses: actions/cache@v5
38-
name: Setup pnpm cache
39-
with:
40-
path: ${{ env.STORE_PATH }}
41-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42-
restore-keys: |
43-
${{ runner.os }}-pnpm-store-
27+
- name: Setup Bun
28+
uses: oven-sh/setup-bun@v2
4429

4530
- name: Install dependencies
46-
run: pnpm install
31+
run: bun install
4732

4833
- name: Build CLI
49-
run: npx tsup
34+
run: bunx tsup
5035

5136
- name: Create Release
5237
env:

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Next.js: debug server-side",
66
"type": "node-terminal",
77
"request": "launch",
8-
"command": "pnpm dev"
8+
"command": "bun dev"
99
},
1010
{
1111
"name": "Next.js: debug client-side (app)",

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ next-forge comes with batteries included:
7272
### Prerequisites
7373

7474
- Node.js 20+
75-
- [pnpm](https://pnpm.io) (or npm/yarn/bun)
75+
- [Bun](https://bun.sh) (or npm/yarn/pnpm)
7676
- [Stripe CLI](https://docs.stripe.com/stripe-cli) for local webhook testing
7777

7878
### Installation

apps/api/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vercel

apps/api/app/global-error.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { captureException } from "@sentry/nextjs";
66
import type NextError from "next/error";
77
import { useEffect } from "react";
88

9-
type GlobalErrorProperties = {
9+
interface GlobalErrorProperties {
1010
readonly error: NextError & { digest?: string };
1111
readonly reset: () => void;
12-
};
12+
}
1313

1414
const GlobalError = ({ error, reset }: GlobalErrorProperties) => {
1515
useEffect(() => {

apps/api/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { AnalyticsProvider } from "@repo/analytics/provider";
22
import type { ReactNode } from "react";
33

4-
type RootLayoutProperties = {
4+
interface RootLayoutProperties {
55
readonly children: ReactNode;
6-
};
6+
}
77

88
const RootLayout = ({ children }: RootLayoutProperties) => (
99
<html lang="en">

apps/api/app/webhooks/auth/route.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Webhook } from "svix";
1313
import { env } from "@/env";
1414

1515
const handleUserCreated = (data: UserJSON) => {
16-
analytics.identify({
16+
analytics?.identify({
1717
distinctId: data.id,
1818
properties: {
1919
email: data.email_addresses.at(0)?.email_address,
@@ -25,7 +25,7 @@ const handleUserCreated = (data: UserJSON) => {
2525
},
2626
});
2727

28-
analytics.capture({
28+
analytics?.capture({
2929
event: "User Created",
3030
distinctId: data.id,
3131
});
@@ -34,7 +34,7 @@ const handleUserCreated = (data: UserJSON) => {
3434
};
3535

3636
const handleUserUpdated = (data: UserJSON) => {
37-
analytics.identify({
37+
analytics?.identify({
3838
distinctId: data.id,
3939
properties: {
4040
email: data.email_addresses.at(0)?.email_address,
@@ -46,7 +46,7 @@ const handleUserUpdated = (data: UserJSON) => {
4646
},
4747
});
4848

49-
analytics.capture({
49+
analytics?.capture({
5050
event: "User Updated",
5151
distinctId: data.id,
5252
});
@@ -56,14 +56,14 @@ const handleUserUpdated = (data: UserJSON) => {
5656

5757
const handleUserDeleted = (data: DeletedObjectJSON) => {
5858
if (data.id) {
59-
analytics.identify({
59+
analytics?.identify({
6060
distinctId: data.id,
6161
properties: {
6262
deleted: new Date(),
6363
},
6464
});
6565

66-
analytics.capture({
66+
analytics?.capture({
6767
event: "User Deleted",
6868
distinctId: data.id,
6969
});
@@ -73,7 +73,7 @@ const handleUserDeleted = (data: DeletedObjectJSON) => {
7373
};
7474

7575
const handleOrganizationCreated = (data: OrganizationJSON) => {
76-
analytics.groupIdentify({
76+
analytics?.groupIdentify({
7777
groupKey: data.id,
7878
groupType: "company",
7979
distinctId: data.created_by,
@@ -84,7 +84,7 @@ const handleOrganizationCreated = (data: OrganizationJSON) => {
8484
});
8585

8686
if (data.created_by) {
87-
analytics.capture({
87+
analytics?.capture({
8888
event: "Organization Created",
8989
distinctId: data.created_by,
9090
});
@@ -94,7 +94,7 @@ const handleOrganizationCreated = (data: OrganizationJSON) => {
9494
};
9595

9696
const handleOrganizationUpdated = (data: OrganizationJSON) => {
97-
analytics.groupIdentify({
97+
analytics?.groupIdentify({
9898
groupKey: data.id,
9999
groupType: "company",
100100
distinctId: data.created_by,
@@ -105,7 +105,7 @@ const handleOrganizationUpdated = (data: OrganizationJSON) => {
105105
});
106106

107107
if (data.created_by) {
108-
analytics.capture({
108+
analytics?.capture({
109109
event: "Organization Updated",
110110
distinctId: data.created_by,
111111
});
@@ -117,13 +117,13 @@ const handleOrganizationUpdated = (data: OrganizationJSON) => {
117117
const handleOrganizationMembershipCreated = (
118118
data: OrganizationMembershipJSON
119119
) => {
120-
analytics.groupIdentify({
120+
analytics?.groupIdentify({
121121
groupKey: data.organization.id,
122122
groupType: "company",
123123
distinctId: data.public_user_data.user_id,
124124
});
125125

126-
analytics.capture({
126+
analytics?.capture({
127127
event: "Organization Member Created",
128128
distinctId: data.public_user_data.user_id,
129129
});
@@ -136,7 +136,7 @@ const handleOrganizationMembershipDeleted = (
136136
) => {
137137
// Need to unlink the user from the group
138138

139-
analytics.capture({
139+
analytics?.capture({
140140
event: "Organization Member Deleted",
141141
distinctId: data.public_user_data.user_id,
142142
});
@@ -227,7 +227,7 @@ export const POST = async (request: Request): Promise<Response> => {
227227
}
228228
}
229229

230-
await analytics.shutdown();
230+
await analytics?.shutdown();
231231

232232
return response;
233233
};

apps/api/app/webhooks/payments/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const handleCheckoutSessionCompleted = async (
3434
return;
3535
}
3636

37-
analytics.capture({
37+
analytics?.capture({
3838
event: "User Subscribed",
3939
distinctId: user.id,
4040
});
@@ -55,14 +55,14 @@ const handleSubscriptionScheduleCanceled = async (
5555
return;
5656
}
5757

58-
analytics.capture({
58+
analytics?.capture({
5959
event: "User Unsubscribed",
6060
distinctId: user.id,
6161
});
6262
};
6363

6464
export const POST = async (request: Request): Promise<Response> => {
65-
if (!env.STRIPE_WEBHOOK_SECRET) {
65+
if (!(stripe && env.STRIPE_WEBHOOK_SECRET)) {
6666
return NextResponse.json({ message: "Not configured", ok: false });
6767
}
6868

@@ -95,7 +95,7 @@ export const POST = async (request: Request): Promise<Response> => {
9595
}
9696
}
9797

98-
await analytics.shutdown();
98+
await analytics?.shutdown();
9999

100100
return NextResponse.json({ result: event, ok: true });
101101
} catch (error) {

apps/api/instrumentation-client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ import { initializeSentry } from "@repo/observability/client";
33

44
initializeSentry();
55
initializeAnalytics();
6+
7+
export { onRouterTransitionStart } from "@repo/observability/client";

0 commit comments

Comments
 (0)