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.
This commit is contained in:
Dax Raad
2025-12-09 11:52:53 -05:00
parent 80799b57fe
commit b2f59e9d08
+5
View File
@@ -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)