Skip to content

Commit bbd97a2

Browse files
committed
Dashboard: file organization refactor
1 parent cfcead7 commit bbd97a2

File tree

855 files changed

+1948
-2029
lines changed

Some content is hidden

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

855 files changed

+1948
-2029
lines changed

apps/dashboard/.eslintrc.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ module.exports = {
1010
"plugin:storybook/recommended",
1111
],
1212
overrides: [
13-
// disable restricted imports in tw-components
13+
// disable restricted imports in chakra
1414
{
15-
files: "src/tw-components/**/*",
15+
files: "src/chakra/**/*",
1616
rules: {
1717
"no-restricted-imports": ["off"],
1818
},
@@ -92,7 +92,7 @@ module.exports = {
9292
{
9393
paths: [
9494
{
95-
// these are provided by tw-components, so we don't want to import them from chakra directly
95+
// these are provided by chakra folder, so we don't want to import them from chakra directly
9696
importNames: [
9797
"Card",
9898
"Button",
@@ -127,7 +127,7 @@ module.exports = {
127127
"StackProps",
128128
],
129129
message:
130-
'Use the equivalent component from "tw-components" instead.',
130+
'import component from "chakra" folder instead if you have to use chakra component, But use shadcn component otherwise',
131131
name: "@chakra-ui/react",
132132
},
133133
{
@@ -151,12 +151,6 @@ module.exports = {
151151
'Use `import { useDashboardRouter } from "@/lib/DashboardRouter";` instead',
152152
name: "next/navigation",
153153
},
154-
{
155-
importNames: ["Link", "Table", "Sidebar"],
156-
message:
157-
'This is likely a mistake. If you really want to import this - postfix the imported name with Icon. Example - "LinkIcon"',
158-
name: "lucide-react",
159-
},
160154
{
161155
message:
162156
'Import "posthog-js" directly only within the analytics helpers ("src/@/analytics/*"). Use the exported helpers from "@/analytics/track" elsewhere.',

apps/dashboard/knip.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"$schema": "https://unpkg.com/knip@5/schema.json",
33
"ignore": [
44
"src/@/components/ui/**",
5-
"src/components/notices/AnnouncementBanner.tsx",
6-
"src/components/cmd-k-search/index.tsx",
5+
"src/@/components/misc/AnnouncementBanner.tsx",
6+
"src/@/components/cmd-k-search/index.tsx",
77
"src/lib/search.ts"
88
],
99
"ignoreBinaries": ["only-allow"],

apps/dashboard/src/@/actions/acceptInvite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use server";
22

3-
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
4-
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
3+
import { getAuthToken } from "@/api/auth-token";
4+
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
55

66
export async function acceptInvite(options: {
77
teamId: string;

apps/dashboard/src/@/actions/billing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use server";
22

3-
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
4-
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
3+
import { getAuthToken } from "@/api/auth-token";
4+
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
55

66
export async function reSubscribePlan(options: {
77
teamId: string;

apps/dashboard/src/@/actions/confirmEmail.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use server";
22

3-
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
4-
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
3+
import { getAuthToken } from "@/api/auth-token";
4+
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
55

66
export async function confirmEmailWithOTP(otp: string) {
77
const token = await getAuthToken();

apps/dashboard/src/@/actions/createTeam.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import "server-only";
44
// biome-ignore lint/style/useNodejsImportProtocol: breaks storybook if it's `node:` prefixed
55
import { randomBytes } from "crypto";
66
import { format } from "date-fns";
7+
import { getAuthToken } from "@/api/auth-token";
78
import type { Team } from "@/api/team";
8-
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
9-
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
9+
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
1010

1111
export async function createTeam(options?: { name?: string; slug?: string }) {
1212
const token = await getAuthToken();

apps/dashboard/src/@/actions/deleteTeam.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use server";
22
import "server-only";
3-
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
4-
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "../constants/public-envs";
3+
import { getAuthToken } from "@/api/auth-token";
4+
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
55

66
export async function deleteTeam(options: { teamId: string }) {
77
const token = await getAuthToken();

apps/dashboard/src/@/actions/getBalancesFromMoralis.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use server";
2-
import { defineDashboardChain } from "lib/defineDashboardChain";
32
import { isAddress, toTokens, ZERO_ADDRESS } from "thirdweb";
43
import { getWalletBalance } from "thirdweb/wallets";
5-
import { MORALIS_API_KEY } from "../constants/server-envs";
6-
import { serverThirdwebClient } from "../constants/thirdweb-client.server";
4+
import { MORALIS_API_KEY } from "@/constants/server-envs";
5+
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
6+
import { defineDashboardChain } from "@/lib/defineDashboardChain";
77

88
type BalanceQueryResponse = Array<{
99
balance: string;

apps/dashboard/src/@/actions/getWalletNFTs.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"use server";
22

3+
import { NEXT_PUBLIC_DASHBOARD_CLIENT_ID } from "@/constants/public-envs";
4+
import { MORALIS_API_KEY } from "@/constants/server-envs";
35
import {
46
generateAlchemyUrl,
57
transformAlchemyResponseToNFT,
6-
} from "lib/wallet/nfts/alchemy";
8+
} from "@/lib/wallet/nfts/alchemy";
79
import {
810
generateMoralisUrl,
911
transformMoralisResponseToNFT,
10-
} from "lib/wallet/nfts/moralis";
11-
import type { WalletNFT } from "lib/wallet/nfts/types";
12-
import { getVercelEnv } from "../../lib/vercel-utils";
13-
import { isAlchemySupported } from "../../lib/wallet/nfts/isAlchemySupported";
14-
import { isMoralisSupported } from "../../lib/wallet/nfts/isMoralisSupported";
15-
import { NEXT_PUBLIC_DASHBOARD_CLIENT_ID } from "../constants/public-envs";
16-
import { MORALIS_API_KEY } from "../constants/server-envs";
12+
} from "@/lib/wallet/nfts/moralis";
13+
import type { WalletNFT } from "@/lib/wallet/nfts/types";
14+
import { getVercelEnv } from "@/utils/vercel";
15+
import { isAlchemySupported } from "../lib/wallet/nfts/isAlchemySupported";
16+
import { isMoralisSupported } from "../lib/wallet/nfts/isMoralisSupported";
1717

1818
type WalletNFTApiReturn =
1919
| { result: WalletNFT[]; error?: undefined }

apps/dashboard/src/@/actions/proxies.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"use server";
22

3-
import { getAuthToken } from "../../app/(app)/api/lib/getAuthToken";
3+
import { getAuthToken } from "@/api/auth-token";
44
import {
55
NEXT_PUBLIC_ENGINE_CLOUD_URL,
66
NEXT_PUBLIC_THIRDWEB_API_HOST,
7-
} from "../constants/public-envs";
8-
import { ANALYTICS_SERVICE_URL } from "../constants/server-envs";
7+
} from "@/constants/public-envs";
8+
import { ANALYTICS_SERVICE_URL } from "@/constants/server-envs";
99

1010
type ProxyActionParams = {
1111
pathname: string;

0 commit comments

Comments
 (0)