Bootstrap ProjectReactRuntime package

This commit is contained in:
Quixos Todo bootstrap
2026-09-05 10:18:09 -07:00
commit 9bbed0910e
20 changed files with 1452 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import fs from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { derived, type RuntimeContext } from "@quixos/camino-package-runtime";
const dirname = path.dirname(fileURLToPath(import.meta.url));
const componentSourcePath = path.join(dirname, "project-component.mjs");
export const source = async () => await fs.readFile(componentSourcePath, "utf8");
export const createComponent = (context: RuntimeContext) => context.objectId;
export const props = derived(async (context: RuntimeContext) => {
const projects = await context.edge("port:project-react:subject").resolve();
if (projects.length !== 1) {
throw new Error(`Project component ${context.objectId} has ${projects.length} subjects`);
}
return {
project_id: projects[0],
component_id: context.objectId,
name: await context.state<string>("port:project-react:name").live(),
tasks: await context.edge("port:project-react:tasks").resolve(),
};
});
export const stopWatch = () => null;