Repository navigation
Bugs #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs #28
Changes from all commits
dc4593c
f20e3fa
4b9aaae
3bb1afe
be0e65d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.2.0 | ||
| 0.2.1 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,16 +34,6 @@ export const projectsRoutes = new Elysia() | |||||||||||||||||||||||
| set.status = 400; | ||||||||||||||||||||||||
| return { error: "name is required" }; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| if (body?.repoUrl) { | ||||||||||||||||||||||||
| const projects = await listProjects(); | ||||||||||||||||||||||||
| const normalize = (u: string) => u.replace(/\.git$/, "").replace(/\/+$/, "").toLowerCase(); | ||||||||||||||||||||||||
| const incoming = normalize(body.repoUrl); | ||||||||||||||||||||||||
| const duplicate = projects.find((p) => p.repoUrl && normalize(p.repoUrl) === incoming); | ||||||||||||||||||||||||
| if (duplicate) { | ||||||||||||||||||||||||
| set.status = 409; | ||||||||||||||||||||||||
| return { error: `A project with this repository URL already exists: "${duplicate.name}"` }; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| const project = await createProject({ | ||||||||||||||||||||||||
| name: body.name, | ||||||||||||||||||||||||
| description: body.description, | ||||||||||||||||||||||||
|
|
@@ -55,23 +45,16 @@ export const projectsRoutes = new Elysia() | |||||||||||||||||||||||
| port: body.port ? Number(body.port) : null, | ||||||||||||||||||||||||
| sourceDir: body.sourceDir || null, | ||||||||||||||||||||||||
| sourceType: body.sourceType || "git", | ||||||||||||||||||||||||
| projectType: body.projectType || "web", | ||||||||||||||||||||||||
| buildCommand: body.buildCommand || undefined, | ||||||||||||||||||||||||
| startCommand: body.startCommand || undefined, | ||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||
| return project; | ||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
| .patch( | ||||||||||||||||||||||||
| "/projects/:id", | ||||||||||||||||||||||||
| async ({ params: { id }, body, set }: any) => { | ||||||||||||||||||||||||
| if (body?.repoUrl) { | ||||||||||||||||||||||||
| const projects = await listProjects(); | ||||||||||||||||||||||||
| const normalize = (u: string) => u.replace(/\.git$/, "").replace(/\/+$/, "").toLowerCase(); | ||||||||||||||||||||||||
| const incoming = normalize(body.repoUrl); | ||||||||||||||||||||||||
| const duplicate = projects.find((p) => p.id !== id && p.repoUrl && normalize(p.repoUrl) === incoming); | ||||||||||||||||||||||||
| if (duplicate) { | ||||||||||||||||||||||||
| set.status = 409; | ||||||||||||||||||||||||
| return { error: `A project with this repository URL already exists: "${duplicate.name}"` }; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| const project = await updateProject(id, { | ||||||||||||||||||||||||
| name: body?.name, | ||||||||||||||||||||||||
| description: body?.description, | ||||||||||||||||||||||||
|
|
@@ -82,6 +65,9 @@ export const projectsRoutes = new Elysia() | |||||||||||||||||||||||
| memoryLimitMb: body?.memoryLimitMb, | ||||||||||||||||||||||||
| port: body?.port ? Number(body.port) : body?.port === null ? null : undefined, | ||||||||||||||||||||||||
| sourceDir: body?.sourceDir ?? undefined, | ||||||||||||||||||||||||
| projectType: body?.projectType ?? undefined, | ||||||||||||||||||||||||
| buildCommand: "buildCommand" in (body ?? {}) ? (body.buildCommand ?? "") || null : undefined, | ||||||||||||||||||||||||
| startCommand: "startCommand" in (body ?? {}) ? (body.startCommand ?? "") || null : undefined, | ||||||||||||||||||||||||
|
Comment on lines
+69
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Guard primitive PATCH bodies before using Because Suggested fix async ({ params: { id }, body, set }: any) => {
+ if (body === null || typeof body !== "object" || Array.isArray(body)) {
+ set.status = 400;
+ return { error: "body must be an object" };
+ }
+
const project = await updateProject(id, {
...
- buildCommand: "buildCommand" in (body ?? {}) ? ...
+ buildCommand: Object.prototype.hasOwnProperty.call(body, "buildCommand") ? ...📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||
| if (!project) { | ||||||||||||||||||||||||
| set.status = 404; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ALTER TABLE `projects` ADD `project_type` text DEFAULT 'web' NOT NULL; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALTER TABLE `projects` ADD `build_command` text;--> statement-breakpoint | ||
| ALTER TABLE `projects` ADD `start_command` text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Lftobs/dequel
Length of output: 490
🏁 Script executed:
Repository: Lftobs/dequel
Length of output: 7245
🏁 Script executed:
Repository: Lftobs/dequel
Length of output: 24922
🏁 Script executed:
Repository: Lftobs/dequel
Length of output: 7105
Align
@sinclair/typeboxwith the installed Elysia package.apps/api/package.jsondeclareselysia: ^1.1.26, butapps/api/bun.lockresolveselysia@1.4.28, whose peer dependency requires@sinclair/typebox >= 0.34.0 < 1. If you stay with Elysia 1.1.x, update the lockfile to match; if Elysia 1.4.x is intended, update the package range to avoid drift.🤖 Prompt for AI Agents