File tree Expand file tree Collapse file tree 7 files changed +33
-25
lines changed
registry/commandly/tool-editor Expand file tree Collapse file tree 7 files changed +33
-25
lines changed Original file line number Diff line number Diff line change 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" : {
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+ }
Original file line number Diff line number Diff 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 ( ( ) => {
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ import { Button } from "./ui/button";
1313type Theme = "dark" | "light" | "system" ;
1414
1515export 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 {
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments