MCPcopy
hub / github.com/github/awesome-copilot / createInitialState

Function createInitialState

extensions/site-studio/extension.mjs:537–559  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

535}
536
537function createInitialState() {
538 const ts = nowIso();
539 const { id, pack } = getTemplatePackOrThrow(DEFAULT_TEMPLATE_PACK);
540 return {
541 sections: pack.sections.map((section) => ({
542 ...section,
543 status: "Not Started",
544 notes: [],
545 content: cloneJson(pack.defaultContent?.[section.id] || {}),
546 filesChanged: [],
547 lastModified: ts,
548 })),
549 templatePackId: id,
550 fieldSuggestions: cloneJson(pack.fieldSuggestions || {}),
551 sectionSchemas: cloneJson(pack.sectionSchemas || {}),
552 changeLog: [],
553 contentProposals: [],
554 milestones: [],
555 theme: { style: "dark", palette: "#050A14/#2F80ED" },
556 branch: readBranchFromGit(),
557 lastUpdated: ts,
558 };
559}
560
561let persistQueue = Promise.resolve();
562function persistState() {

Callers 2

normalizeStateFunction · 0.85
loadStateFunction · 0.85

Calls 4

nowIsoFunction · 0.85
getTemplatePackOrThrowFunction · 0.85
cloneJsonFunction · 0.85
readBranchFromGitFunction · 0.85

Tested by

no test coverage detected