@tscircuit/cli 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +1 -0
- package/README.md +50 -0
- package/build-cli.ts +14 -0
- package/bun.lockb +0 -0
- package/cli.ts +12 -0
- package/dev-server-api/README.md +3 -0
- package/dev-server-api/bun.lockb +0 -0
- package/dev-server-api/edgespec.config.ts +4 -0
- package/dev-server-api/index.ts +1 -0
- package/dev-server-api/package-lock.json +1201 -0
- package/dev-server-api/package.json +24 -0
- package/dev-server-api/routes/api/dev_package_examples/create.ts +43 -0
- package/dev-server-api/routes/api/dev_package_examples/get.ts +37 -0
- package/dev-server-api/routes/api/dev_package_examples/list.ts +29 -0
- package/dev-server-api/routes/api/dev_package_examples/update.ts +31 -0
- package/dev-server-api/routes/api/health.ts +11 -0
- package/dev-server-api/src/db/create-schema.ts +14 -0
- package/dev-server-api/src/db/get-db.ts +78 -0
- package/dev-server-api/src/middlewares/with-db.ts +14 -0
- package/dev-server-api/src/middlewares/with-error-response.ts +24 -0
- package/dev-server-api/src/with-edge-spec.ts +8 -0
- package/dev-server-api/tsconfig.json +28 -0
- package/dev-server-frontend/.eslintrc.cjs +20 -0
- package/dev-server-frontend/README.md +3 -0
- package/dev-server-frontend/bun.lockb +0 -0
- package/dev-server-frontend/components.json +17 -0
- package/dev-server-frontend/index.html +13 -0
- package/dev-server-frontend/package.json +62 -0
- package/dev-server-frontend/postcss.config.js +6 -0
- package/dev-server-frontend/src/App.tsx +22 -0
- package/dev-server-frontend/src/ExampleContentView.tsx +60 -0
- package/dev-server-frontend/src/Header.tsx +53 -0
- package/dev-server-frontend/src/HeaderMenu.tsx +188 -0
- package/dev-server-frontend/src/components/command-k.tsx +62 -0
- package/dev-server-frontend/src/components/global-context-providers.tsx +11 -0
- package/dev-server-frontend/src/components/select-example-search.tsx +137 -0
- package/dev-server-frontend/src/components/ui/alert-dialog.tsx +139 -0
- package/dev-server-frontend/src/components/ui/alert.tsx +59 -0
- package/dev-server-frontend/src/components/ui/breadcrumb.tsx +115 -0
- package/dev-server-frontend/src/components/ui/button.tsx +57 -0
- package/dev-server-frontend/src/components/ui/card.tsx +76 -0
- package/dev-server-frontend/src/components/ui/command.tsx +153 -0
- package/dev-server-frontend/src/components/ui/context-menu.tsx +202 -0
- package/dev-server-frontend/src/components/ui/dialog.tsx +120 -0
- package/dev-server-frontend/src/components/ui/menubar.tsx +238 -0
- package/dev-server-frontend/src/components/ui/navigation-menu.tsx +128 -0
- package/dev-server-frontend/src/components/ui/popover.tsx +31 -0
- package/dev-server-frontend/src/components/ui/select.tsx +162 -0
- package/dev-server-frontend/src/components/ui/tabs.tsx +53 -0
- package/dev-server-frontend/src/components/ui/toggle-group.tsx +59 -0
- package/dev-server-frontend/src/components/ui/toggle.tsx +43 -0
- package/dev-server-frontend/src/components/ui/tooltip.tsx +28 -0
- package/dev-server-frontend/src/hooks/toast-if-api-not-connected.ts +23 -0
- package/dev-server-frontend/src/hooks/use-global-store.ts +42 -0
- package/dev-server-frontend/src/index.css +76 -0
- package/dev-server-frontend/src/lib/utils.ts +6 -0
- package/dev-server-frontend/src/main.tsx +13 -0
- package/dev-server-frontend/src/vite-env.d.ts +1 -0
- package/dev-server-frontend/tailwind.config.js +77 -0
- package/dev-server-frontend/tsconfig.json +26 -0
- package/dev-server-frontend/tsconfig.node.json +13 -0
- package/dev-server-frontend/vite.config.ts +23 -0
- package/dist/cli.js +1326 -0
- package/lib/cmd-fns/auth-login.ts +59 -0
- package/lib/cmd-fns/auth-logout.ts +3 -0
- package/lib/cmd-fns/auth-sessions-create.ts +3 -0
- package/lib/cmd-fns/auth-sessions-get.ts +3 -0
- package/lib/cmd-fns/auth-sessions-list.ts +5 -0
- package/lib/cmd-fns/config-print-config.ts +6 -0
- package/lib/cmd-fns/config-reveal-location.ts +5 -0
- package/lib/cmd-fns/config-set-log-requests.ts +7 -0
- package/lib/cmd-fns/config-set-registry.ts +7 -0
- package/lib/cmd-fns/config-set-session.ts +7 -0
- package/lib/cmd-fns/dev.ts +217 -0
- package/lib/cmd-fns/index.ts +27 -0
- package/lib/cmd-fns/package-examples-create.ts +33 -0
- package/lib/cmd-fns/package-examples-get.ts +20 -0
- package/lib/cmd-fns/package-examples-list.ts +18 -0
- package/lib/cmd-fns/package-files-create.ts +31 -0
- package/lib/cmd-fns/package-files-download.ts +29 -0
- package/lib/cmd-fns/package-files-get.ts +3 -0
- package/lib/cmd-fns/package-files-list.ts +28 -0
- package/lib/cmd-fns/package-files-upload-directory.ts +6 -0
- package/lib/cmd-fns/package-releases-create.ts +35 -0
- package/lib/cmd-fns/package-releases-get.ts +3 -0
- package/lib/cmd-fns/package-releases-list.ts +32 -0
- package/lib/cmd-fns/packages-create.ts +16 -0
- package/lib/cmd-fns/packages-get.ts +16 -0
- package/lib/cmd-fns/packages-list.ts +16 -0
- package/lib/cmd-fns/publish.ts +3 -0
- package/lib/cmd-fns/soupify.ts +27 -0
- package/lib/get-program.ts +191 -0
- package/lib/param-handlers/index.ts +16 -0
- package/lib/param-handlers/interact-for-local-directory.ts +58 -0
- package/lib/param-handlers/interact-for-local-file.ts +59 -0
- package/lib/param-handlers/interact-for-package-example-id.ts +25 -0
- package/lib/param-handlers/interact-for-package-name-with-version.ts +63 -0
- package/lib/param-handlers/interact-for-package-name.ts +45 -0
- package/lib/param-handlers/interact-for-package-release-id.ts +16 -0
- package/lib/param-handlers/param-handler-type.ts +7 -0
- package/lib/soupify.ts +71 -0
- package/lib/util/app-context.ts +14 -0
- package/lib/util/create-context-and-run-program.ts +116 -0
- package/package.json +62 -0
- package/tests/assets/example-project/examples/basic-capacitor.tsx +1 -0
- package/tests/assets/example-project/examples/basic-resistor.tsx +3 -0
- package/tests/assets/example-project/package.json +8 -0
- package/tests/assets/example-project/src/MyCircuit.tsx +3 -0
- package/tests/soupify.test.ts +9 -0
- package/tsconfig.json +109 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs"
|
|
3
|
+
|
|
4
|
+
import { cn } from "src/lib/utils"
|
|
5
|
+
|
|
6
|
+
const Tabs = TabsPrimitive.Root
|
|
7
|
+
|
|
8
|
+
const TabsList = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof TabsPrimitive.List>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<TabsPrimitive.List
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
))
|
|
21
|
+
TabsList.displayName = TabsPrimitive.List.displayName
|
|
22
|
+
|
|
23
|
+
const TabsTrigger = React.forwardRef<
|
|
24
|
+
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
26
|
+
>(({ className, ...props }, ref) => (
|
|
27
|
+
<TabsPrimitive.Trigger
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={cn(
|
|
30
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
))
|
|
36
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
37
|
+
|
|
38
|
+
const TabsContent = React.forwardRef<
|
|
39
|
+
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
40
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
41
|
+
>(({ className, ...props }, ref) => (
|
|
42
|
+
<TabsPrimitive.Content
|
|
43
|
+
ref={ref}
|
|
44
|
+
className={cn(
|
|
45
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
))
|
|
51
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
52
|
+
|
|
53
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
|
|
3
|
+
import { VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "src/lib/utils"
|
|
6
|
+
import { toggleVariants } from "src/components/ui/toggle"
|
|
7
|
+
|
|
8
|
+
const ToggleGroupContext = React.createContext<
|
|
9
|
+
VariantProps<typeof toggleVariants>
|
|
10
|
+
>({
|
|
11
|
+
size: "default",
|
|
12
|
+
variant: "default",
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const ToggleGroup = React.forwardRef<
|
|
16
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
17
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
|
18
|
+
VariantProps<typeof toggleVariants>
|
|
19
|
+
>(({ className, variant, size, children, ...props }, ref) => (
|
|
20
|
+
<ToggleGroupPrimitive.Root
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn("flex items-center justify-center gap-1", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
26
|
+
{children}
|
|
27
|
+
</ToggleGroupContext.Provider>
|
|
28
|
+
</ToggleGroupPrimitive.Root>
|
|
29
|
+
))
|
|
30
|
+
|
|
31
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
|
|
32
|
+
|
|
33
|
+
const ToggleGroupItem = React.forwardRef<
|
|
34
|
+
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
35
|
+
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
|
36
|
+
VariantProps<typeof toggleVariants>
|
|
37
|
+
>(({ className, children, variant, size, ...props }, ref) => {
|
|
38
|
+
const context = React.useContext(ToggleGroupContext)
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<ToggleGroupPrimitive.Item
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={cn(
|
|
44
|
+
toggleVariants({
|
|
45
|
+
variant: context.variant || variant,
|
|
46
|
+
size: context.size || size,
|
|
47
|
+
}),
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
</ToggleGroupPrimitive.Item>
|
|
54
|
+
)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
|
|
58
|
+
|
|
59
|
+
export { ToggleGroup, ToggleGroupItem }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "src/lib/utils"
|
|
6
|
+
|
|
7
|
+
const toggleVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-transparent",
|
|
13
|
+
outline:
|
|
14
|
+
"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-9 px-3",
|
|
18
|
+
sm: "h-8 px-2",
|
|
19
|
+
lg: "h-10 px-3",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
size: "default",
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const Toggle = React.forwardRef<
|
|
30
|
+
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
31
|
+
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
32
|
+
VariantProps<typeof toggleVariants>
|
|
33
|
+
>(({ className, variant, size, ...props }, ref) => (
|
|
34
|
+
<TogglePrimitive.Root
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
))
|
|
40
|
+
|
|
41
|
+
Toggle.displayName = TogglePrimitive.Root.displayName
|
|
42
|
+
|
|
43
|
+
export { Toggle, toggleVariants }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
3
|
+
|
|
4
|
+
import { cn } from "src/lib/utils"
|
|
5
|
+
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider
|
|
7
|
+
|
|
8
|
+
const Tooltip = TooltipPrimitive.Root
|
|
9
|
+
|
|
10
|
+
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const TooltipContent = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
15
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
16
|
+
<TooltipPrimitive.Content
|
|
17
|
+
ref={ref}
|
|
18
|
+
sideOffset={sideOffset}
|
|
19
|
+
className={cn(
|
|
20
|
+
"z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
))
|
|
26
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
27
|
+
|
|
28
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useEffect } from "react"
|
|
2
|
+
import axios from "axios"
|
|
3
|
+
import toast from "react-hot-toast"
|
|
4
|
+
|
|
5
|
+
export const useToastIfApiNotConnected = () => {
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
let lastWasConnected = true
|
|
8
|
+
const interval = setInterval(async () => {
|
|
9
|
+
try {
|
|
10
|
+
await axios.get("/api/health")
|
|
11
|
+
if (!lastWasConnected) {
|
|
12
|
+
toast.success("Reconnected to dev server API")
|
|
13
|
+
lastWasConnected = true
|
|
14
|
+
}
|
|
15
|
+
} catch (e) {
|
|
16
|
+
toast.error("Not connected to dev server API")
|
|
17
|
+
lastWasConnected = false
|
|
18
|
+
}
|
|
19
|
+
}, 5000)
|
|
20
|
+
|
|
21
|
+
return () => clearInterval(interval)
|
|
22
|
+
}, [])
|
|
23
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { create } from "zustand"
|
|
2
|
+
import { persist } from "zustand/middleware"
|
|
3
|
+
|
|
4
|
+
export interface GlobalState {
|
|
5
|
+
active_dev_example_package_id: string | null
|
|
6
|
+
|
|
7
|
+
view_mode: "schematic" | "pcb" | "split"
|
|
8
|
+
split_mode: "horizontal" | "vertical"
|
|
9
|
+
in_debug_mode: boolean
|
|
10
|
+
|
|
11
|
+
setActiveDevExamplePackageId: (id: string) => void
|
|
12
|
+
setViewMode: (mode: "schematic" | "pcb" | "split") => void
|
|
13
|
+
setSplitMode: (mode: "horizontal" | "vertical") => void
|
|
14
|
+
setDebugMode: (mode: boolean) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const useGlobalStore = create<GlobalState>()(
|
|
18
|
+
persist(
|
|
19
|
+
(set) => ({
|
|
20
|
+
active_dev_example_package_id: null,
|
|
21
|
+
view_mode: "schematic",
|
|
22
|
+
split_mode: "horizontal",
|
|
23
|
+
in_debug_mode: false,
|
|
24
|
+
|
|
25
|
+
setActiveDevExamplePackageId: (id: string) => {
|
|
26
|
+
set({ active_dev_example_package_id: id })
|
|
27
|
+
},
|
|
28
|
+
setViewMode: (mode: "schematic" | "pcb" | "split") => {
|
|
29
|
+
set({ view_mode: mode })
|
|
30
|
+
},
|
|
31
|
+
setSplitMode: (mode: "horizontal" | "vertical") => {
|
|
32
|
+
set({ split_mode: mode })
|
|
33
|
+
},
|
|
34
|
+
setDebugMode: (mode: boolean) => {
|
|
35
|
+
set({ in_debug_mode: mode })
|
|
36
|
+
},
|
|
37
|
+
}),
|
|
38
|
+
{
|
|
39
|
+
name: "global-store",
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
--background: 0 0% 100%;
|
|
8
|
+
--foreground: 224 71.4% 4.1%;
|
|
9
|
+
|
|
10
|
+
--card: 0 0% 100%;
|
|
11
|
+
--card-foreground: 224 71.4% 4.1%;
|
|
12
|
+
|
|
13
|
+
--popover: 0 0% 100%;
|
|
14
|
+
--popover-foreground: 224 71.4% 4.1%;
|
|
15
|
+
|
|
16
|
+
--primary: 220.9 39.3% 11%;
|
|
17
|
+
--primary-foreground: 210 20% 98%;
|
|
18
|
+
|
|
19
|
+
--secondary: 220 14.3% 95.9%;
|
|
20
|
+
--secondary-foreground: 220.9 39.3% 11%;
|
|
21
|
+
|
|
22
|
+
--muted: 220 14.3% 95.9%;
|
|
23
|
+
--muted-foreground: 220 8.9% 46.1%;
|
|
24
|
+
|
|
25
|
+
--accent: 220 14.3% 95.9%;
|
|
26
|
+
--accent-foreground: 220.9 39.3% 11%;
|
|
27
|
+
|
|
28
|
+
--destructive: 0 84.2% 60.2%;
|
|
29
|
+
--destructive-foreground: 210 20% 98%;
|
|
30
|
+
|
|
31
|
+
--border: 220 13% 91%;
|
|
32
|
+
--input: 220 13% 91%;
|
|
33
|
+
--ring: 224 71.4% 4.1%;
|
|
34
|
+
|
|
35
|
+
--radius: 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dark {
|
|
39
|
+
--background: 224 71.4% 4.1%;
|
|
40
|
+
--foreground: 210 20% 98%;
|
|
41
|
+
|
|
42
|
+
--card: 224 71.4% 4.1%;
|
|
43
|
+
--card-foreground: 210 20% 98%;
|
|
44
|
+
|
|
45
|
+
--popover: 224 71.4% 4.1%;
|
|
46
|
+
--popover-foreground: 210 20% 98%;
|
|
47
|
+
|
|
48
|
+
--primary: 210 20% 98%;
|
|
49
|
+
--primary-foreground: 220.9 39.3% 11%;
|
|
50
|
+
|
|
51
|
+
--secondary: 215 27.9% 16.9%;
|
|
52
|
+
--secondary-foreground: 210 20% 98%;
|
|
53
|
+
|
|
54
|
+
--muted: 215 27.9% 16.9%;
|
|
55
|
+
--muted-foreground: 217.9 10.6% 64.9%;
|
|
56
|
+
|
|
57
|
+
--accent: 215 27.9% 16.9%;
|
|
58
|
+
--accent-foreground: 210 20% 98%;
|
|
59
|
+
|
|
60
|
+
--destructive: 0 62.8% 30.6%;
|
|
61
|
+
--destructive-foreground: 210 20% 98%;
|
|
62
|
+
|
|
63
|
+
--border: 215 27.9% 16.9%;
|
|
64
|
+
--input: 215 27.9% 16.9%;
|
|
65
|
+
--ring: 216 12.2% 83.9%;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@layer base {
|
|
70
|
+
* {
|
|
71
|
+
@apply border-border;
|
|
72
|
+
}
|
|
73
|
+
body {
|
|
74
|
+
@apply bg-background text-foreground;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import ReactDOM from "react-dom/client"
|
|
3
|
+
import App from "./App.tsx"
|
|
4
|
+
import "./index.css"
|
|
5
|
+
import { GlobalContextProviders } from "./components/global-context-providers.tsx"
|
|
6
|
+
|
|
7
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
8
|
+
<React.StrictMode>
|
|
9
|
+
<GlobalContextProviders>
|
|
10
|
+
<App />
|
|
11
|
+
</GlobalContextProviders>
|
|
12
|
+
</React.StrictMode>
|
|
13
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
darkMode: ["class"],
|
|
4
|
+
content: [
|
|
5
|
+
'./pages/**/*.{ts,tsx}',
|
|
6
|
+
'./components/**/*.{ts,tsx}',
|
|
7
|
+
'./app/**/*.{ts,tsx}',
|
|
8
|
+
'./src/**/*.{ts,tsx}',
|
|
9
|
+
],
|
|
10
|
+
prefix: "",
|
|
11
|
+
theme: {
|
|
12
|
+
container: {
|
|
13
|
+
center: true,
|
|
14
|
+
padding: "2rem",
|
|
15
|
+
screens: {
|
|
16
|
+
"2xl": "1400px",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
extend: {
|
|
20
|
+
colors: {
|
|
21
|
+
border: "hsl(var(--border))",
|
|
22
|
+
input: "hsl(var(--input))",
|
|
23
|
+
ring: "hsl(var(--ring))",
|
|
24
|
+
background: "hsl(var(--background))",
|
|
25
|
+
foreground: "hsl(var(--foreground))",
|
|
26
|
+
primary: {
|
|
27
|
+
DEFAULT: "hsl(var(--primary))",
|
|
28
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
29
|
+
},
|
|
30
|
+
secondary: {
|
|
31
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
32
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
33
|
+
},
|
|
34
|
+
destructive: {
|
|
35
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
36
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
37
|
+
},
|
|
38
|
+
muted: {
|
|
39
|
+
DEFAULT: "hsl(var(--muted))",
|
|
40
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
41
|
+
},
|
|
42
|
+
accent: {
|
|
43
|
+
DEFAULT: "hsl(var(--accent))",
|
|
44
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
45
|
+
},
|
|
46
|
+
popover: {
|
|
47
|
+
DEFAULT: "hsl(var(--popover))",
|
|
48
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
49
|
+
},
|
|
50
|
+
card: {
|
|
51
|
+
DEFAULT: "hsl(var(--card))",
|
|
52
|
+
foreground: "hsl(var(--card-foreground))",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
borderRadius: {
|
|
56
|
+
lg: "var(--radius)",
|
|
57
|
+
md: "calc(var(--radius) - 2px)",
|
|
58
|
+
sm: "calc(var(--radius) - 4px)",
|
|
59
|
+
},
|
|
60
|
+
keyframes: {
|
|
61
|
+
"accordion-down": {
|
|
62
|
+
from: { height: "0" },
|
|
63
|
+
to: { height: "var(--radix-accordion-content-height)" },
|
|
64
|
+
},
|
|
65
|
+
"accordion-up": {
|
|
66
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
67
|
+
to: { height: "0" },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
animation: {
|
|
71
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
72
|
+
"accordion-up": "accordion-up 0.2s ease-out",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
plugins: [require("tailwindcss-animate")],
|
|
77
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
"baseUrl": ".",
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noUnusedLocals": false,
|
|
22
|
+
"noUnusedParameters": false ,
|
|
23
|
+
"noFallthroughCasesInSwitch": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["src/**/*.tsx", "src/**/*.ts"]
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"baseUrl": ".",
|
|
10
|
+
"jsx": "react-jsx"
|
|
11
|
+
},
|
|
12
|
+
"include": ["vite.config.ts", "src", "src/@"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from "vite"
|
|
2
|
+
import react from "@vitejs/plugin-react"
|
|
3
|
+
import path from "path"
|
|
4
|
+
|
|
5
|
+
// https://vitejs.dev/config/
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [react()],
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: [{ find: "src", replacement: path.resolve(__dirname, "src/") }],
|
|
10
|
+
},
|
|
11
|
+
server: {
|
|
12
|
+
proxy: {
|
|
13
|
+
"/api": "http://localhost:3021",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
optimizeDeps: {
|
|
17
|
+
needsInterop: ["@tscircuit/schematic-viewer"],
|
|
18
|
+
},
|
|
19
|
+
define: {
|
|
20
|
+
// Global var used by some dep inside schematic-viewer
|
|
21
|
+
global: {},
|
|
22
|
+
},
|
|
23
|
+
})
|