core: add project update timestamps to track when projects were last modified
Projects now track when they were last updated, making it easier for users to see recent activity and identify stale projects in their workspace.pull/5292/head
parent
c4401290db
commit
036f5d4eef
|
|
@ -18,6 +18,7 @@ export namespace Project {
|
|||
vcs: z.literal("git").optional(),
|
||||
time: z.object({
|
||||
created: z.number(),
|
||||
updated: z.number().optional(),
|
||||
initialized: z.number().optional(),
|
||||
}),
|
||||
})
|
||||
|
|
@ -38,6 +39,7 @@ export namespace Project {
|
|||
vcs: Info.shape.vcs.parse(Flag.OPENCODE_FAKE_VCS),
|
||||
time: {
|
||||
created: Date.now(),
|
||||
updated: Date.now(),
|
||||
},
|
||||
}
|
||||
await Storage.write<Info>(["project", "global"], project)
|
||||
|
|
@ -84,12 +86,15 @@ export namespace Project {
|
|||
await migrateFromGlobal(projectID, worktree)
|
||||
}
|
||||
const project: Info = {
|
||||
...existing,
|
||||
id: projectID,
|
||||
worktree,
|
||||
vcsDir,
|
||||
vcs: "git",
|
||||
time: {
|
||||
created: Date.now(),
|
||||
...existing?.time,
|
||||
updated: Date.now(),
|
||||
},
|
||||
}
|
||||
await Storage.write<Info>(["project", projectID], project)
|
||||
|
|
|
|||
Loading…
Reference in New Issue