Skip to content

Commit ff2d2e8

Browse files
committed
Update dependencies and improve command handling in the tool editor
1 parent dfecb33 commit ff2d2e8

File tree

7 files changed

+33
-25
lines changed

7 files changed

+33
-25
lines changed

bun.lock

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"tailwindcss-animate": "^1.0.7",
5353
"uuid": "^11.1.0",
5454
"vite": "^6.3.5",
55+
"vite-tsconfig-paths": "^5.1.4",
5556
"zod": "^3.25.76"
5657
},
5758
"devDependencies": {
@@ -71,7 +72,7 @@
7172
"oxlint": "^1.12.0",
7273
"shadcn": "^2.10.0",
7374
"typescript": "^5.9.2",
74-
"vite-tsconfig-paths": "^5.1.4",
75-
"vitest": "^3.2.4"
75+
"vitest": "^3.2.4",
76+
"vitest-browser-react": "^1.0.1"
7677
}
77-
}
78+
}

registry/commandly/tool-editor/command-tree.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,12 @@ export function CommandTree() {
5454
const handleAddSubcommand = (parentId?: string) => {
5555
const prevIds = new Set(tool.commands.map((cmd) => cmd.id));
5656
toolBuilderActions.addSubcommand(parentId);
57-
setTimeout(() => {
58-
const newCmd = toolBuilderStore.state.tool.commands.find(
59-
(cmd) => !prevIds.has(cmd.id)
60-
);
61-
if (newCmd) {
62-
setLastAddedCommand({ id: newCmd.id, parentId });
63-
}
64-
}, 0);
57+
const newCmd = toolBuilderStore.state.tool.commands.find(
58+
(cmd) => !prevIds.has(cmd.id)
59+
);
60+
if (newCmd) {
61+
setLastAddedCommand({ id: newCmd.id, parentId });
62+
}
6563
};
6664

6765
useEffect(() => {

src/components/theme-switcher.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ import { Button } from "./ui/button";
1313
type Theme = "dark" | "light" | "system";
1414

1515
export function ThemeSwitcher() {
16-
if (typeof window === "undefined") {
17-
return null;
18-
}
1916
const { theme, setTheme } = useTheme();
2017
const ref = useRef<HTMLButtonElement>(null);
2118

@@ -102,8 +99,6 @@ export function ThemeProvider({
10299
});
103100

104101
useEffect(() => {
105-
if (typeof window === "undefined") return;
106-
107102
if (theme === "dark") {
108103
document.documentElement.classList.add("dark");
109104
} else {

src/routes/tools/$toolName/edit.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export const Route = createFileRoute("/tools/$toolName/edit")({
1717
newTool
1818
}),
1919
loader: async ({ params: { toolName }, deps: { newTool } }) => {
20-
if (typeof window === "undefined") {
21-
return null;
22-
}
23-
2420
if (newTool) {
2521
const newToolData = localStorage.getItem(`tool-${newTool}`);
2622
if (newToolData) {

src/routes/tools/$toolName/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ export const Route = createFileRoute("/tools/$toolName/")({
6565
newTool
6666
}),
6767
loader: async ({ params: { toolName }, deps: { newTool } }) => {
68-
if (typeof window === "undefined") {
69-
return null;
70-
}
71-
7268
if (newTool) {
7369
const newToolData = localStorage.getItem(`tool-${newTool}`);
7470
if (newToolData) {

vite.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default defineConfig({
88
projects: ["./tsconfig.json"]
99
}),
1010
tanstackStart({
11+
customViteReactPlugin: true,
1112
target: "github-pages",
1213
prerender: {
1314
enabled: true,
@@ -22,6 +23,14 @@ export default defineConfig({
2223
crawlLinks: true
2324
}
2425
},
26+
{
27+
path: "/tools",
28+
prerender: {
29+
outputPath: "tools.html",
30+
enabled: true,
31+
crawlLinks: true
32+
}
33+
},
2534
],
2635
spa: {
2736
enabled: true,

0 commit comments

Comments
 (0)