diff --git a/components.json b/components.json
index 9ef749f..3ba65bf 100644
--- a/components.json
+++ b/components.json
@@ -11,6 +11,6 @@
},
"aliases": {
"components": "src/components",
- "utils": "~/utils/utils.ts"
+ "utils": "~/utils/utils"
}
}
diff --git a/drizzle/0000_tidy_vermin.sql b/drizzle/0000_yielding_mongoose.sql
similarity index 93%
rename from drizzle/0000_tidy_vermin.sql
rename to drizzle/0000_yielding_mongoose.sql
index 8bfe562..c99527c 100644
--- a/drizzle/0000_tidy_vermin.sql
+++ b/drizzle/0000_yielding_mongoose.sql
@@ -24,20 +24,20 @@ CREATE TABLE `service` (
`deployed_generation_id` text,
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE cascade,
- FOREIGN KEY (`latest_generation_id`) REFERENCES `service_generation`(`id`) ON UPDATE no action ON DELETE no action DEFERRABLE INITIALLY DEFERRED, -- MODIFIED TO ADD DEFERRED CONSTRAINTS
+ FOREIGN KEY (`latest_generation_id`) REFERENCES `service_generation`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`deployed_generation_id`) REFERENCES `service_generation`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `service_deployment` (
`id` text PRIMARY KEY DEFAULT (uuid_generate_v7()) NOT NULL,
- `project_deployment_id` text NOT NULL,
+ `project_deployment_id` text,
`service_id` text NOT NULL,
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
`deployed_by` text,
`build_logs` blob,
`status` integer NOT NULL,
FOREIGN KEY (`project_deployment_id`) REFERENCES `project_deployment`(`id`) ON UPDATE no action ON DELETE cascade,
- FOREIGN KEY (`service_id`) REFERENCES `service_generation`(`id`) ON UPDATE no action ON DELETE cascade,
+ FOREIGN KEY (`service_id`) REFERENCES `service`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`deployed_by`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
@@ -53,7 +53,7 @@ CREATE TABLE `service_domain` (
--> statement-breakpoint
CREATE TABLE `service_generation` (
`id` text PRIMARY KEY DEFAULT (uuid_generate_v7()) NOT NULL,
- `service_id` text NOT NULL DEFERRABLE INITIALLY DEFERRED,
+ `service_id` text NOT NULL,
`deployment_id` text,
`source` integer NOT NULL,
`environment` text,
@@ -88,9 +88,7 @@ CREATE TABLE `service_generation` (
`logging_max_size` text DEFAULT '-1' NOT NULL,
`logging_max_files` integer DEFAULT 1 NOT NULL,
`created_at` integer DEFAULT CURRENT_TIMESTAMP NOT NULL,
-
- -- MODIFIED TO ADD DEFERRED CONSTRAINTS
- FOREIGN KEY (`service_id`) REFERENCES `service`(`id`) ON UPDATE no action ON DELETE cascade DEFERRABLE INITIALLY DEFERRED,
+ FOREIGN KEY (`service_id`) REFERENCES `service`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`deployment_id`) REFERENCES `service_deployment`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
@@ -162,4 +160,4 @@ CREATE INDEX `name_project_idx` ON `service` (`name`,`project_id`);--> statement
CREATE UNIQUE INDEX `name_project_unq` ON `service` (`name`,`project_id`);--> statement-breakpoint
CREATE INDEX `proj_generation_idx` ON `service_generation` (`id`,`service_id`);--> statement-breakpoint
CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);--> statement-breakpoint
-CREATE INDEX `username_idx` ON `users` (`username`);
+CREATE INDEX `username_idx` ON `users` (`username`);
\ No newline at end of file
diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json
index 7109a44..608684b 100644
--- a/drizzle/meta/0000_snapshot.json
+++ b/drizzle/meta/0000_snapshot.json
@@ -1,7 +1,7 @@
{
- "version": "5",
+ "version": "6",
"dialect": "sqlite",
- "id": "f5624a74-60b3-4d72-90e0-67670f26b0cd",
+ "id": "4d1c3e48-c40b-401f-bb7b-742335b9ec44",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"project_deployment": {
@@ -266,7 +266,7 @@
"name": "project_deployment_id",
"type": "text",
"primaryKey": false,
- "notNull": true,
+ "notNull": false,
"autoincrement": false
},
"service_id": {
@@ -321,10 +321,10 @@
"onDelete": "cascade",
"onUpdate": "no action"
},
- "service_deployment_service_id_service_generation_id_fk": {
- "name": "service_deployment_service_id_service_generation_id_fk",
+ "service_deployment_service_id_service_id_fk": {
+ "name": "service_deployment_service_id_service_id_fk",
"tableFrom": "service_deployment",
- "tableTo": "service_generation",
+ "tableTo": "service",
"columnsFrom": [
"service_id"
],
diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json
index 132562d..97beffb 100644
--- a/drizzle/meta/_journal.json
+++ b/drizzle/meta/_journal.json
@@ -1,12 +1,12 @@
{
- "version": "5",
+ "version": "6",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
- "version": "5",
- "when": 1715730366620,
- "tag": "0000_tidy_vermin",
+ "version": "6",
+ "when": 1716431990235,
+ "tag": "0000_yielding_mongoose",
"breakpoints": true
}
]
diff --git a/next.config.mjs b/next.config.mjs
index e2315c0..7b1bba6 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -1,4 +1,9 @@
/** @type {import("next").NextConfig} */
-const config = {};
+const config = {
+ eslint: {
+ // will fix linting closer to a stable release
+ ignoreDuringBuilds: true,
+ },
+};
export default config;
diff --git a/package.json b/package.json
index 8ad4852..7754e68 100644
--- a/package.json
+++ b/package.json
@@ -26,6 +26,7 @@
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
+ "@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d2597b8..e73d704 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -29,6 +29,9 @@ dependencies:
'@radix-ui/react-label':
specifier: ^2.0.2
version: 2.0.2(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-navigation-menu':
+ specifier: ^1.1.4
+ version: 1.1.4(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
'@radix-ui/react-radio-group':
specifier: ^1.1.3
version: 1.1.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
@@ -2119,6 +2122,40 @@ packages:
react-remove-scroll: 2.5.5(@types/react@18.2.46)(react@18.2.0)
dev: false
+ /@radix-ui/react-navigation-menu@1.1.4(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
+ resolution: {integrity: sha512-Cc+seCS3PmWmjI51ufGG7zp1cAAIRqHVw7C9LOA2TZ+R4hG6rDvHcTqIsEEFLmZO3zNVH72jOOE7kKNy8W+RtA==}
+ peerDependencies:
+ '@types/react': '*'
+ '@types/react-dom': '*'
+ react: ^16.8 || ^17.0 || ^18.0
+ react-dom: ^16.8 || ^17.0 || ^18.0
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+ '@types/react-dom':
+ optional: true
+ dependencies:
+ '@babel/runtime': 7.23.9
+ '@radix-ui/primitive': 1.0.1
+ '@radix-ui/react-collection': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-context': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-direction': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-id': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-use-previous': 1.0.1(@types/react@18.2.46)(react@18.2.0)
+ '@radix-ui/react-visually-hidden': 1.0.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0)
+ '@types/react': 18.2.46
+ '@types/react-dom': 18.2.18
+ react: 18.2.0
+ react-dom: 18.2.0(react@18.2.0)
+ dev: false
+
/@radix-ui/react-popper@1.1.3(@types/react-dom@18.2.18)(@types/react@18.2.46)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==}
peerDependencies:
diff --git a/src/app/(dashboard)/project/[projectId]/(home)/page.tsx b/src/app/(dashboard)/project/[projectId]/(home)/page.tsx
index 57bbfdb..b187def 100644
--- a/src/app/(dashboard)/project/[projectId]/(home)/page.tsx
+++ b/src/app/(dashboard)/project/[projectId]/(home)/page.tsx
@@ -1,3 +1,3 @@
export default function ProjectHome() {
- return
hello world
;
+ return todo: overall project stats here
;
}
diff --git a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/advanced/DeploymentSettings.tsx b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/advanced/DeploymentSettings.tsx
index 4495e78..dd1fae3 100644
--- a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/advanced/DeploymentSettings.tsx
+++ b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/advanced/DeploymentSettings.tsx
@@ -1,5 +1,6 @@
"use client";
+import Dockerode from "dockerode";
import { z } from "zod";
import {
Form,
@@ -26,7 +27,7 @@ import { type RouterOutputs } from "~/trpc/shared";
const formValidator = z.object({
replicas: z.coerce.number().int().min(0),
maxReplicasPerNode: z.number().int().positive().nullable(),
- deployMode: z.enum(["replicated", "global"]),
+ deployMode: z.nativeEnum(DockerDeployMode),
zeroDowntime: z.boolean(),
entrypoint: z.string().optional().nullable(),
command: z.string().optional().nullable(),
@@ -41,16 +42,18 @@ export default function DeploymentSettings({
service: RouterOutputs["projects"]["services"]["get"];
}) {
const update = api.projects.services.update.useMutation();
+ const latestGen = service.latestGeneration!;
+
const form = useForm(formValidator, {
defaultValues: {
- replicas: service.replicas,
- maxReplicasPerNode: service.maxReplicasPerNode,
- deployMode: service.deployMode,
- zeroDowntime: service.zeroDowntime,
- entrypoint: service.entrypoint,
- command: service.command,
- max_memory: service.max_memory,
- max_cpu: service.max_cpu,
+ replicas: latestGen.replicas,
+ maxReplicasPerNode: latestGen.maxReplicasPerNode,
+ deployMode: latestGen.deployMode,
+ zeroDowntime: latestGen.zeroDowntime,
+ entrypoint: latestGen.entrypoint,
+ command: latestGen.command,
+ max_memory: latestGen.max_memory,
+ max_cpu: latestGen.max_cpu,
},
});
diff --git a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx
index 450c262..97419ec 100644
--- a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx
+++ b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/domains/DomainsList.tsx
@@ -49,7 +49,7 @@ export default function DomainsList({
const form = useForm>({
defaultValues: {
- domains: service.data?.domains.map((newDomain) => ({
+ domains: service.data?.latestGeneration?.domains.map((newDomain) => ({
...newDomain,
domainId: newDomain.id,
id: undefined,
@@ -68,7 +68,7 @@ export default function DomainsList({
// reset the dirty state
form.resetField("domains", {
defaultValue:
- service.data?.domains.map((newDomain) => ({
+ service.data?.latestGeneration?.domains.map((newDomain) => ({
...newDomain,
domainId: newDomain.id,
})) ?? [],
@@ -97,7 +97,7 @@ export default function DomainsList({
}),
// domains that don't exist anymore
- ...(service.data?.domains
+ ...(service.data?.latestGeneration?.domains
.filter(
(d) =>
!data.domains.some(
diff --git a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/BuildMethod.tsx b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/BuildMethod.tsx
index 259e3f5..c2f4937 100644
--- a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/BuildMethod.tsx
+++ b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/BuildMethod.tsx
@@ -5,7 +5,7 @@ import { type z } from "zod";
import { Label } from "~/components/ui/label";
import { SimpleFormField } from "~/hooks/forms";
import { ServiceBuildMethod } from "~/server/db/types";
-import { type formValidator } from "../page";
+import { type formValidator } from "./_form";
export default function SourceBuildMethod() {
const form = useFormContext>();
diff --git a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/SourceGitHub.tsx b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/SourceGitHub.tsx
index 6e5161b..4286d47 100644
--- a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/SourceGitHub.tsx
+++ b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/SourceGitHub.tsx
@@ -4,7 +4,7 @@ import { useFormContext } from "react-hook-form";
import { useDebounce } from "use-debounce";
import { type z } from "zod";
import { SimpleFormField } from "~/hooks/forms";
-import { type formValidator } from "../page";
+import { type formValidator } from "./_form";
import GithubRepoPreview from "./GitHubRepoPreview";
export default function SourceGitHub() {
diff --git a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/_form.tsx b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/_form.tsx
new file mode 100644
index 0000000..f9e3248
--- /dev/null
+++ b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/_components/_form.tsx
@@ -0,0 +1,18 @@
+import { z } from "zod";
+import { ServiceSource, ServiceBuildMethod } from "~/server/db/types";
+import { zDockerImage } from "~/server/utils/zod";
+
+export const formValidator = z.object({
+ source: z.nativeEnum(ServiceSource),
+
+ dockerImage: zDockerImage.nullable(),
+ dockerRegistryUsername: z.string().optional(),
+ dockerRegistryPassword: z.string().optional(),
+
+ githubUsername: z.string().optional(),
+ githubRepository: z.string().optional(),
+ githubBranch: z.string().optional(),
+
+ buildMethod: z.nativeEnum(ServiceBuildMethod),
+ buildPath: z.string().default("/"),
+});
diff --git a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/page.tsx b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/page.tsx
index c550628..2f152d0 100644
--- a/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/page.tsx
+++ b/src/app/(dashboard)/project/[projectId]/service/[serviceId]/source/page.tsx
@@ -1,33 +1,17 @@
"use client";
import { useEffect } from "react";
import { toast } from "sonner";
-import { z } from "zod";
import LoadingScreen from "~/components/LoadingScreen";
import { Button } from "~/components/ui/button";
import { Form } from "~/components/ui/form";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs";
import { FormSubmit, SimpleFormField, useForm } from "~/hooks/forms";
import { ServiceBuildMethod, ServiceSource } from "~/server/db/types";
-import { zDockerImage } from "~/server/utils/zod";
import { api } from "~/trpc/react";
import { useService } from "../_hooks/service";
import SourceBuildMethod from "./_components/BuildMethod";
import SourceGitHub from "./_components/SourceGitHub";
-
-export const formValidator = z.object({
- source: z.nativeEnum(ServiceSource),
-
- dockerImage: zDockerImage.nullable(),
- dockerRegistryUsername: z.string().optional(),
- dockerRegistryPassword: z.string().optional(),
-
- githubUsername: z.string().optional(),
- githubRepository: z.string().optional(),
- githubBranch: z.string().optional(),
-
- buildMethod: z.nativeEnum(ServiceBuildMethod),
- buildPath: z.string().default("/"),
-});
+import { formValidator } from "./_components/_form";
export default function SourcePage() {
const { data, refetch } = useService();
@@ -155,7 +139,7 @@ export default function SourcePage() {
[ServiceSource.Docker]: "docker",
[ServiceSource.GitHub]: "GitHub",
[ServiceSource.Git]: "Git",
- }[data.source] || "docker"
+ }[data.latestGeneration?.source ?? ServiceSource.Docker] || "docker"
}
className="col-span-2 w-full"
>
diff --git a/src/app/(dashboard)/settings/sessions/Sessions.tsx b/src/app/(dashboard)/settings/sessions/Sessions.tsx
index 301ee11..e339dc1 100644
--- a/src/app/(dashboard)/settings/sessions/Sessions.tsx
+++ b/src/app/(dashboard)/settings/sessions/Sessions.tsx
@@ -1,6 +1,6 @@
import { Card } from "~/components/ui/card";
import UAParser from "ua-parser-js";
-import { RelativeDate } from "~/components/RelativeDate";
+import { RelativeDate } from "~/components/Date";
type SessionData = {
lastUA: string | null;
diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx
index deb4f64..07e5ee8 100644
--- a/src/components/ui/badge.tsx
+++ b/src/components/ui/badge.tsx
@@ -1,7 +1,7 @@
-import * as React from "react"
-import { cva, type VariantProps } from "class-variance-authority"
+import * as React from "react";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "~/utils/utils.ts"
+import { cn } from "~/utils/utils";
const badgeVariants = cva(
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
@@ -20,8 +20,8 @@ const badgeVariants = cva(
defaultVariants: {
variant: "default",
},
- }
-)
+ },
+);
export interface BadgeProps
extends React.HTMLAttributes,
@@ -30,7 +30,7 @@ export interface BadgeProps
function Badge({ className, variant, ...props }: BadgeProps) {
return (
- )
+ );
}
-export { Badge, badgeVariants }
+export { Badge, badgeVariants };
diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx
index 7b1b46d..6382f94 100644
--- a/src/components/ui/checkbox.tsx
+++ b/src/components/ui/checkbox.tsx
@@ -1,10 +1,10 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
-import { CheckIcon } from "@radix-ui/react-icons"
+import * as React from "react";
+import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
+import { CheckIcon } from "@radix-ui/react-icons";
-import { cn } from "~/utils/utils.ts"
+import { cn } from "~/utils/utils";
const Checkbox = React.forwardRef<
React.ElementRef,
@@ -14,7 +14,7 @@ const Checkbox = React.forwardRef<
ref={ref}
className={cn(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
- className
+ className,
)}
{...props}
>
@@ -24,7 +24,7 @@ const Checkbox = React.forwardRef<
-))
-Checkbox.displayName = CheckboxPrimitive.Root.displayName
+));
+Checkbox.displayName = CheckboxPrimitive.Root.displayName;
-export { Checkbox }
+export { Checkbox };
diff --git a/src/components/ui/drawer.tsx b/src/components/ui/drawer.tsx
index 4279143..2042c87 100644
--- a/src/components/ui/drawer.tsx
+++ b/src/components/ui/drawer.tsx
@@ -1,9 +1,9 @@
-"use client"
+"use client";
-import * as React from "react"
-import { Drawer as DrawerPrimitive } from "vaul"
+import * as React from "react";
+import { Drawer as DrawerPrimitive } from "vaul";
-import { cn } from "~/utils/utils.ts"
+import { cn } from "~/utils/utils";
const Drawer = ({
shouldScaleBackground = true,
@@ -13,14 +13,14 @@ const Drawer = ({
shouldScaleBackground={shouldScaleBackground}
{...props}
/>
-)
-Drawer.displayName = "Drawer"
+);
+Drawer.displayName = "Drawer";
-const DrawerTrigger = DrawerPrimitive.Trigger
+const DrawerTrigger = DrawerPrimitive.Trigger;
-const DrawerPortal = DrawerPrimitive.Portal
+const DrawerPortal = DrawerPrimitive.Portal;
-const DrawerClose = DrawerPrimitive.Close
+const DrawerClose = DrawerPrimitive.Close;
const DrawerOverlay = React.forwardRef<
React.ElementRef,
@@ -31,8 +31,8 @@ const DrawerOverlay = React.forwardRef<
className={cn("fixed inset-0 z-50 bg-black/80", className)}
{...props}
/>
-))
-DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
+));
+DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
const DrawerContent = React.forwardRef<
React.ElementRef,
@@ -44,7 +44,7 @@ const DrawerContent = React.forwardRef<
ref={ref}
className={cn(
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
- className
+ className,
)}
{...props}
>
@@ -52,8 +52,8 @@ const DrawerContent = React.forwardRef<
{children}
-))
-DrawerContent.displayName = "DrawerContent"
+));
+DrawerContent.displayName = "DrawerContent";
const DrawerHeader = ({
className,
@@ -63,8 +63,8 @@ const DrawerHeader = ({
className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
{...props}
/>
-)
-DrawerHeader.displayName = "DrawerHeader"
+);
+DrawerHeader.displayName = "DrawerHeader";
const DrawerFooter = ({
className,
@@ -74,8 +74,8 @@ const DrawerFooter = ({
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
{...props}
/>
-)
-DrawerFooter.displayName = "DrawerFooter"
+);
+DrawerFooter.displayName = "DrawerFooter";
const DrawerTitle = React.forwardRef<
React.ElementRef,
@@ -85,12 +85,12 @@ const DrawerTitle = React.forwardRef<
ref={ref}
className={cn(
"text-lg font-semibold leading-none tracking-tight",
- className
+ className,
)}
{...props}
/>
-))
-DrawerTitle.displayName = DrawerPrimitive.Title.displayName
+));
+DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
const DrawerDescription = React.forwardRef<
React.ElementRef,
@@ -101,8 +101,8 @@ const DrawerDescription = React.forwardRef<
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
-))
-DrawerDescription.displayName = DrawerPrimitive.Description.displayName
+));
+DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
export {
Drawer,
@@ -115,4 +115,4 @@ export {
DrawerFooter,
DrawerTitle,
DrawerDescription,
-}
+};
diff --git a/src/components/ui/radio-group.tsx b/src/components/ui/radio-group.tsx
index 1ab4014..4e7ec57 100644
--- a/src/components/ui/radio-group.tsx
+++ b/src/components/ui/radio-group.tsx
@@ -1,10 +1,10 @@
-"use client"
+"use client";
-import * as React from "react"
-import { CheckIcon } from "@radix-ui/react-icons"
-import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
+import * as React from "react";
+import { CheckIcon } from "@radix-ui/react-icons";
+import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
-import { cn } from "~/utils/utils.ts"
+import { cn } from "~/utils/utils";
const RadioGroup = React.forwardRef<
React.ElementRef,
@@ -16,9 +16,9 @@ const RadioGroup = React.forwardRef<
{...props}
ref={ref}
/>
- )
-})
-RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
+ );
+});
+RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
const RadioGroupItem = React.forwardRef<
React.ElementRef,
@@ -29,7 +29,7 @@ const RadioGroupItem = React.forwardRef<
ref={ref}
className={cn(
"aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
- className
+ className,
)}
{...props}
>
@@ -37,8 +37,8 @@ const RadioGroupItem = React.forwardRef<
- )
-})
-RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
+ );
+});
+RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
-export { RadioGroup, RadioGroupItem }
+export { RadioGroup, RadioGroupItem };
diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx
index 02d5f4e..709d7b1 100644
--- a/src/components/ui/textarea.tsx
+++ b/src/components/ui/textarea.tsx
@@ -1,6 +1,6 @@
-import * as React from "react"
+import * as React from "react";
-import { cn } from "~/utils/utils.ts"
+import { cn } from "~/utils/utils";
export interface TextareaProps
extends React.TextareaHTMLAttributes {}
@@ -11,14 +11,14 @@ const Textarea = React.forwardRef(
- )
- }
-)
-Textarea.displayName = "Textarea"
+ );
+ },
+);
+Textarea.displayName = "Textarea";
-export { Textarea }
+export { Textarea };
diff --git a/src/server/docker/docker.ts b/src/server/docker/docker.ts
index bde7179..da5b8eb 100644
--- a/src/server/docker/docker.ts
+++ b/src/server/docker/docker.ts
@@ -20,7 +20,7 @@ export class Docker extends Dockerode {
*/
static demuxStream() {
return new Transform({
- transform(chunk: Buffer, encoding?: unknown, callback: () => void) {
+ transform(chunk: Buffer, encoding: unknown, callback: () => void) {
if (chunk.length < 8) {
this.push(chunk);
callback();
diff --git a/src/server/managers/Project.ts b/src/server/managers/Project.ts
index dc5fbf2..296404e 100644
--- a/src/server/managers/Project.ts
+++ b/src/server/managers/Project.ts
@@ -63,7 +63,7 @@ export default class ProjectManager {
where: eq(service.projectId, this.projectData.id),
});
- return serviceData.map((data) => new ServiceManager(data));
+ return serviceData.map((data) => new ServiceManager(data, this));
}
/**
diff --git a/src/server/managers/Service.ts b/src/server/managers/Service.ts
index 6d93b8a..ec0b634 100644
--- a/src/server/managers/Service.ts
+++ b/src/server/managers/Service.ts
@@ -70,7 +70,18 @@ export default class ServiceManager {
]);
// compare the two
- return diff(deployed, latest);
+ return diff(
+ {
+ ...deployed,
+ id: undefined,
+ deploymentId: undefined,
+ },
+ {
+ ...latest,
+ id: undefined,
+ deploymentId: undefined,
+ },
+ );
}
/**