Skip to content

Commit ab3b0e6

Browse files
committed
chore: introduce package-level path aliases
1 parent 280eb97 commit ab3b0e6

14 files changed

Lines changed: 24 additions & 26 deletions

File tree

packages/nextjs-plugin/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": ["@tsconfig/node24/tsconfig.json"],
33
"compilerOptions": {
4+
"baseUrl": ".",
45
"outDir": "./dist",
56
"declaration": true,
67
"declarationMap": true,

packages/web-extension/entrypoints/background.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
isDetectionMessage,
77
isDevToolsQueryMessage,
88
sendMessageToTab,
9-
} from "../utils/messaging";
10-
import type { NextjsDetectionResult } from "../utils/nextjs-detector";
9+
} from "~/utils/messaging";
10+
import type { NextjsDetectionResult } from "~/utils/nextjs-detector";
1111

1212
interface TabState {
1313
detectionResult: NextjsDetectionResult | null;

packages/web-extension/entrypoints/content.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import debounce from "debounce";
22
import { defineContentScript } from "wxt/utils/define-content-script";
3-
import { ExtensionMessageType, sendMessage } from "../utils/messaging";
4-
import { detectNextjs } from "../utils/nextjs-detector";
3+
import { ExtensionMessageType, sendMessage } from "~/utils/messaging";
4+
import { detectNextjs } from "~/utils/nextjs-detector";
55

66
export default defineContentScript({
77
matches: ["<all_urls>"],

packages/web-extension/entrypoints/devtools-panel/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
filterSpansWithoutChildren,
66
mapServerEventToSpanTree,
77
type SpanTree,
8-
} from "../../utils/spans";
9-
import { useWS } from "../../utils/ws";
8+
} from "~/utils/spans";
9+
import { useWS } from "~/utils/ws";
1010
import { ConnectionBanner } from "./components/connection-banner";
1111
import SidePanel from "./components/panel";
1212
import HttpRequestsTable, {

packages/web-extension/entrypoints/devtools-panel/components/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cn } from "../../../utils/style";
1+
import { cn } from "~/utils/style";
22

33
export interface CardProps {
44
children: React.ReactNode;

packages/web-extension/entrypoints/devtools-panel/components/connection-banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useMemo } from "react";
2-
import { ConnectionStatus } from "../../../utils/ws";
2+
import { ConnectionStatus } from "~/utils/ws";
33

44
export function ConnectionBanner({ status }: { status: ConnectionStatus }) {
55
const colorClass = useMemo(() => {

packages/web-extension/entrypoints/devtools-panel/components/panel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import {
88
useState,
99
} from "react";
1010
import type { RequestSpan, ResponseSpan, Span } from "@/packages/types";
11-
import { cn } from "../../../utils/style";
12-
import { formatDuration } from "../../../utils/time";
13-
import { assertType } from "../../../utils/type";
11+
import { cn } from "~/utils/style";
12+
import { formatDuration } from "~/utils/time";
13+
import { assertType } from "~/utils/type";
1414
import { Card } from "./card";
1515
import { CodeBlock } from "./code-block";
1616
import { CollapsibleSection } from "./collapsible-section";

packages/web-extension/entrypoints/devtools-panel/components/table.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useCallback, useMemo, useRef, useState } from "react";
22
import type { RequestSpan, ResponseSpan, Span } from "@/packages/types";
3-
import type { SpanTree } from "../../../utils/spans";
4-
import { cn } from "../../../utils/style";
5-
import { formatDuration } from "../../../utils/time";
3+
import type { SpanTree } from "~/utils/spans";
4+
import { cn } from "~/utils/style";
5+
import { formatDuration } from "~/utils/time";
66

77
type SpanNode = {
88
// Server span data (from span-start/span-end events)
@@ -158,11 +158,8 @@ export function transformSpanTreeToTableData(
158158
}
159159
}
160160

161-
// Convert SpanTree (Record) to array of nodes for processing
162-
const nodes = Object.values(spanTree);
163-
164161
// Find root nodes (nodes without parents or with parents not in the current tree)
165-
const rootNodes = nodes.filter((node) => {
162+
const rootNodes = Object.values(spanTree).filter((node) => {
166163
const parentId = node.parentSpanId;
167164
return !parentId || !spanTree[parentId];
168165
});

packages/web-extension/entrypoints/devtools-panel/components/waterfall-chart.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useMemo } from "react";
2-
import type { SpanNode, SpanTree } from "../../../utils/spans";
3-
import { cn } from "../../../utils/style";
4-
import { formatDuration } from "../../../utils/time";
2+
import type { SpanNode, SpanTree } from "~/utils/spans";
3+
import { cn } from "~/utils/style";
4+
import { formatDuration } from "~/utils/time";
55

66
interface TimingData {
77
id: string;

packages/web-extension/entrypoints/devtools-panel/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import ReactDOM from "react-dom/client";
33
import App from "./App";
4-
import "../../assets/tailwind.css";
4+
import "~/assets/tailwind.css";
55

66
const rootElement = document.getElementById("root");
77
if (!rootElement) throw new Error("Failed to find the root element");

0 commit comments

Comments
 (0)