spell 0.8.7 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README-epics.md +149 -49
- package/app/package.json +25 -1
- package/app/spaces/@spell/guides/SpellUI/SpellUI.spellml +486 -486
- package/app/spaces/@spell/sites/SpellApp/SpellApp.spellml +50 -124
- package/dist/app/app/pages/SiteBoardView.css +5 -5
- package/dist/app/app/pages/SiteBoardView.js +1 -1
- package/dist/app/app/pages/SiteEditorPage.js +6 -3
- package/dist/app/app/pages/SiteEdits.js +27 -10
- package/dist/app/app/pages/SiteWrites.js +11 -0
- package/dist/app/app/runner/spellRuntime.js +1 -0
- package/dist/cli/publish/PublishedPackage.d.ts +2 -1
- package/dist/cli/publish/PublishedPackage.js +6 -3
- package/dist/cli/publish/ScratchInstall.d.ts +14 -3
- package/dist/cli/publish/ScratchInstall.js +69 -8
- package/dist/epic/cli/EpicProgram.js +20 -5
- package/dist/epic/cli/epicGroups.js +7 -1
- package/dist/epic/command/BaseBranch.d.ts +35 -0
- package/dist/epic/command/BaseBranch.js +58 -0
- package/dist/epic/command/EpicCheckout.d.ts +1 -1
- package/dist/epic/command/EpicCheckout.js +4 -4
- package/dist/epic/command/EpicGuide.js +3 -2
- package/dist/epic/command/EpicTools.d.ts +5 -0
- package/dist/epic/command/EpicTools.js +14 -3
- package/dist/epic/command/MainMerge.d.ts +26 -15
- package/dist/epic/command/MainMerge.js +60 -16
- package/dist/epic/command/PullRequest.d.ts +45 -0
- package/dist/epic/command/PullRequest.js +100 -0
- package/dist/epic/command/RepoInit.d.ts +196 -39
- package/dist/epic/command/RepoInit.js +481 -60
- package/dist/epic/command/Requests.d.ts +1 -0
- package/dist/epic/command/Requests.js +7 -1
- package/dist/epic/command/SessionMoves.js +2 -1
- package/dist/epic/command/SkillsCheck.js +3 -2
- package/dist/epic/command/Stock.js +3 -1
- package/dist/epic/command/TurnEnd.d.ts +1 -1
- package/dist/epic/command/TurnEnd.js +4 -3
- package/dist/epic/command/Worktrees.d.ts +20 -3
- package/dist/epic/command/Worktrees.js +39 -7
- package/dist/epic/command/command.types.d.ts +3 -0
- package/dist/epic/components/__pack/epics.entry.js +43 -43
- package/dist/epic/components/__pack/epics.pack.js +36 -12794
- package/dist/epic/config/CodeHost.d.ts +96 -0
- package/dist/epic/config/CodeHost.js +89 -0
- package/dist/epic/config/EngineFiles.mjs +60 -0
- package/dist/epic/config/EpicConfig.d.ts +20 -3
- package/dist/epic/config/EpicConfig.js +25 -1
- package/dist/epic/config/EpicRepo.js +1 -1
- package/dist/epic/config/GitHub.d.ts +75 -3
- package/dist/epic/config/GitHub.js +106 -5
- package/dist/epic/config/GitLab.d.ts +138 -0
- package/dist/epic/config/GitLab.js +297 -0
- package/dist/epic/config/LayeredSettings.js +3 -2
- package/dist/epic/server/EpicServer.d.ts +1 -1
- package/dist/epic/server/EpicServer.js +26 -12
- package/dist/epic/tool/InboxPoller.mjs +2 -1
- package/dist/epic/tool/MigrateCommands.js +6 -8
- package/dist/epic/tool/PlanCommits.d.ts +7 -4
- package/dist/epic/tool/PlanCommits.js +7 -5
- package/dist/epic/tool/PlanDocCommands.js +3 -4
- package/dist/epic/tool/PlanDocFiles.d.ts +3 -1
- package/dist/epic/tool/PlanDocFiles.js +13 -5
- package/dist/epic/tool/ServedFolders.d.ts +1 -1
- package/dist/epic/tool/ServedFolders.js +4 -4
- package/dist/epic/tools/PageInboxes.js +3 -3
- package/dist/epic/tools/_assets/commands.entry.js +149 -68
- package/dist/epic/tools/_assets/commands.js +20 -2073
- package/dist/epic/tools/_assets/core-reference.entry.js +244 -124
- package/dist/epic/tools/_assets/core-reference.js +20 -2142
- package/dist/epic/tools/_assets/emoji/cldr/0.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/a.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/b.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/c.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/d.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/e.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/f.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/g.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/h.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/i.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/j.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/k.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/l.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/m.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/n.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/o.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/p.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/r.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/s.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/t.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/u.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/v.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/w.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/x.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/y.js +2 -2
- package/dist/epic/tools/_assets/emoji/cldr/z.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/0.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/a.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/b.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/c.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/d.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/e.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/f.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/g.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/h.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/i.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/j.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/k.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/l.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/m.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/n.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/o.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/p.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/q.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/r.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/s.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/t.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/u.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/v.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/w.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/x.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/y.js +2 -2
- package/dist/epic/tools/_assets/emoji/fomantic/z.js +2 -2
- package/dist/epic/tools/_assets/goals-live.js +318 -210
- package/dist/epic/tools/_assets/highlight.min.js +5764 -5269
- package/dist/epic/tools/_assets/lazy/code-engine.js +5 -1270
- package/dist/epic/tools/_assets/lazy/markdown-engine.js +67 -1513
- package/dist/epic/tools/_assets/lazy/markdown-sanitizer.js +3 -753
- package/dist/epic/tools/_assets/spell-comments.entry.js +282 -159
- package/dist/epic/tools/_assets/spell-comments.js +24 -3716
- package/dist/epic/tools/_assets/spell-doc-comments.js +1243 -816
- package/dist/epic/tools/_assets/spell-doc-helpers.js +298 -165
- package/dist/epic/tools/_assets/spell-doc-runtime.js +2760 -1415
- package/dist/epic/tools/_assets/spell-doc-toolbar.js +396 -227
- package/dist/epic/tools/_assets/spell-syntax.entry.js +505 -285
- package/dist/epic/tools/_assets/spell-syntax.js +22 -2916
- package/dist/epic/tools/_assets/spell-ui-sources.js +102 -60
- package/dist/epic/tools/_assets/spell-ui.entry.js +108 -40
- package/dist/epic/tools/_assets/spell-ui.js +3131 -46465
- package/dist/epic/tools/pages.d.ts +5 -6
- package/dist/epic/tools/pages.js +7 -6
- package/dist/epic/window.mjs +2 -3
- package/dist/parser/core/classes/View.d.ts +20 -0
- package/dist/parser/core/classes/View.js +91 -17
- package/dist/parser/core/core.declarations.json5 +18 -0
- package/dist/parser/core/core.scopes.js +5 -0
- package/dist/parser/core/sites.d.ts +10 -0
- package/dist/parser/core/sites.js +12 -0
- package/dist/parser/parser/tokenizer/Tokenizer.d.ts +9 -1
- package/dist/parser/parser/tokenizer/Tokenizer.js +43 -5
- package/dist/parser/parser/tokenizer/Tokens.d.ts +4 -0
- package/dist/parser/parser/tokenizer/Tokens.js +4 -0
- package/dist/parser/parser/tokenizer/tokenizer.types.d.ts +5 -0
- package/dist/parser/parser/tokenizer/tokenizer.types.js +2 -0
- package/dist/parser/py/core/spell_core/apps.py +2 -0
- package/dist/parser/spell/PARSING.md +21 -0
- package/dist/parser/spell/SpellParser.d.ts +2 -0
- package/dist/parser/spell/SpellParser.js +58 -3
- package/dist/parser/spell/SpellxTokenizer.js +2 -1
- package/dist/parser/spell/SpellxTwin.d.ts +4 -1
- package/dist/parser/spell/SpellxTwin.js +10 -3
- package/dist/parser/spell/builtinTypes.js +24 -1
- package/dist/parser/spell/ingest/PlaceIngest.js +3 -1
- package/dist/parser/spell/languages/Language.d.ts +11 -2
- package/dist/parser/spell/languages/en/words.js +3 -2
- package/dist/parser/spell/languages/es/words.js +7 -4
- package/dist/parser/spell/rules/Statement.js +1 -1
- package/dist/parser/spell/rules/classes/DrawSlot.js +6 -1
- package/dist/parser/spell/rules/sites/SitePage.d.ts +3 -3
- package/dist/parser/spell/rules/sites/SitePage.js +2 -2
- package/dist/parser/spell/rules/sites/sites.en.js +1 -1
- package/dist/parser/spell/rules/sites/sites.es.js +1 -1
- package/dist/parser/spell/rules/sites/sites.shared.d.ts +2 -2
- package/dist/parser/spell/spell.types.d.ts +7 -0
- package/dist/parser/spell/spellSyntax.es.json +6 -6
- package/dist/parser/spell/spellSyntax.json +6 -6
- package/dist/parser/spellx/SpellxView.js +2 -1
- package/dist/ui/components/ui-accordion/UIAccordion.d.ts +1 -0
- package/dist/ui/components/ui-ad/UIAd.d.ts +1 -0
- package/dist/ui/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
- package/dist/ui/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
- package/dist/ui/components/ui-button/UIButton.d.ts +8 -3
- package/dist/ui/components/ui-button/UIButton.fallback.d.ts +8 -3
- package/dist/ui/components/ui-button/UIButtons.d.ts +1 -0
- package/dist/ui/components/ui-button/UIOr.d.ts +1 -0
- package/dist/ui/components/ui-calendar/UICalendar.d.ts +6 -0
- package/dist/ui/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
- package/dist/ui/components/ui-card/UICards.d.ts +31 -0
- package/dist/ui/components/ui-checkbox/UICheckbox.d.ts +7 -0
- package/dist/ui/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
- package/dist/ui/components/ui-comment/UIComment.d.ts +1 -0
- package/dist/ui/components/ui-comment/UIComments.d.ts +1 -0
- package/dist/ui/components/ui-components/UIComponents.d.ts +1 -0
- package/dist/ui/components/ui-dimmer/UIDimmer.d.ts +1 -0
- package/dist/ui/components/ui-divider/UIDivider.d.ts +2 -0
- package/dist/ui/components/ui-dropdown/UIDropdown.d.ts +6 -0
- package/dist/ui/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
- package/dist/ui/components/ui-embed/UIEmbed.d.ts +1 -0
- package/dist/ui/components/ui-emoji/UIEmoji.d.ts +1 -0
- package/dist/ui/components/ui-feed/UIFeed.d.ts +1 -0
- package/dist/ui/components/ui-feed/UIFeedEvent.d.ts +1 -0
- package/dist/ui/components/ui-flag/UIFlag.d.ts +1 -0
- package/dist/ui/components/ui-flyout/UIFlyout.d.ts +1 -0
- package/dist/ui/components/ui-form/UIFields.d.ts +1 -0
- package/dist/ui/components/ui-form/UIRepeat.d.ts +1 -0
- package/dist/ui/components/ui-grid/UIColumn.d.ts +1 -0
- package/dist/ui/components/ui-grid/UIGrid.d.ts +1 -0
- package/dist/ui/components/ui-grid/UIRow.d.ts +1 -0
- package/dist/ui/components/ui-icon/UIIcon.d.ts +3 -2
- package/dist/ui/components/ui-icon/UIIcons.d.ts +1 -0
- package/dist/ui/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
- package/dist/ui/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
- package/dist/ui/components/ui-image/UIImages.d.ts +1 -0
- package/dist/ui/components/ui-include/UIInclude.d.ts +1 -0
- package/dist/ui/components/ui-input/UIInput.fallback.d.ts +9 -2
- package/dist/ui/components/ui-items/UIItems.d.ts +1 -0
- package/dist/ui/components/ui-keys/UIKeys.d.ts +1 -0
- package/dist/ui/components/ui-label/UILabel.d.ts +2 -0
- package/dist/ui/components/ui-label/UILabels.d.ts +1 -0
- package/dist/ui/components/ui-list/UIList.d.ts +2 -0
- package/dist/ui/components/ui-loader/UILoader.d.ts +1 -0
- package/dist/ui/components/ui-message/UIMessage.d.ts +2 -0
- package/dist/ui/components/ui-modal/UIModal.d.ts +1 -0
- package/dist/ui/components/ui-nag/UINag.d.ts +1 -0
- package/dist/ui/components/ui-page/UIPage.d.ts +15 -0
- package/dist/ui/components/ui-page/UIPage.es.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIActions.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIAuthor.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIAvatar.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIContent.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIDate.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIDescription.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIDetail.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIExtra.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIHeader.d.ts +15 -3
- package/dist/ui/components/ui-parts/UIHeader.en.d.ts +5 -2
- package/dist/ui/components/ui-parts/UIHeader.en.js +6 -3
- package/dist/ui/components/ui-parts/UIHeader.js +45 -5
- package/dist/ui/components/ui-parts/UIMeta.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIParts.css +18 -0
- package/dist/ui/components/ui-parts/UIParts.css.inline.js +1 -1
- package/dist/ui/components/ui-parts/UIParts.types.d.ts +15 -1
- package/dist/ui/components/ui-parts/UISummary.d.ts +1 -0
- package/dist/ui/components/ui-parts/UITitle.d.ts +1 -0
- package/dist/ui/components/ui-parts/UIValue.d.ts +1 -0
- package/dist/ui/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
- package/dist/ui/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
- package/dist/ui/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
- package/dist/ui/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
- package/dist/ui/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
- package/dist/ui/components/ui-progress/UIProgress.d.ts +2 -0
- package/dist/ui/components/ui-quote/UIQuote.d.ts +1 -0
- package/dist/ui/components/ui-rail/UIRail.d.ts +1 -0
- package/dist/ui/components/ui-rating/UIRating.d.ts +6 -0
- package/dist/ui/components/ui-rating/UIRating.fallback.d.ts +6 -0
- package/dist/ui/components/ui-reveal/UIReveal.d.ts +1 -0
- package/dist/ui/components/ui-search/UISearch.fallback.d.ts +13 -1
- package/dist/ui/components/ui-section/UISections.d.ts +1 -0
- package/dist/ui/components/ui-segment/UISegment.d.ts +2 -0
- package/dist/ui/components/ui-segment/UISegments.d.ts +1 -0
- package/dist/ui/components/ui-select/UISelect.d.ts +6 -0
- package/dist/ui/components/ui-select/UISelect.fallback.d.ts +6 -0
- package/dist/ui/components/ui-shape/UISide.d.ts +4 -0
- package/dist/ui/components/ui-sidebar/UIPushable.d.ts +1 -0
- package/dist/ui/components/ui-sidebar/UIPusher.d.ts +1 -0
- package/dist/ui/components/ui-sidebar/UISidebar.d.ts +1 -0
- package/dist/ui/components/ui-sides/UISides.d.ts +6 -0
- package/dist/ui/components/ui-sides/UISides.fallback.d.ts +6 -0
- package/dist/ui/components/ui-slider/UISlider.d.ts +7 -0
- package/dist/ui/components/ui-slider/UISlider.fallback.d.ts +7 -0
- package/dist/ui/components/ui-space/UISpace.d.ts +1 -0
- package/dist/ui/components/ui-statistic/UIStatistic.d.ts +1 -0
- package/dist/ui/components/ui-statistic/UIStatistics.d.ts +1 -0
- package/dist/ui/components/ui-step/UIStep.d.ts +1 -0
- package/dist/ui/components/ui-step/UISteps.d.ts +1 -0
- package/dist/ui/components/ui-table/UICell.d.ts +1 -0
- package/dist/ui/components/ui-terms/UITerm.d.ts +1 -0
- package/dist/ui/components/ui-terms/UITerms.d.ts +1 -0
- package/dist/ui/components/ui-theme-editor/UIColorChip.d.ts +1 -0
- package/dist/ui/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
- package/dist/ui/components/ui-toast/UIToast.d.ts +1 -0
- package/dist/ui/components/ui-toc/UIToc.d.ts +1 -0
- package/dist/ui/components/ui-transition/UITransition.d.ts +1 -0
- package/dist/ui/components/ui-video/UIAudio.d.ts +1 -0
- package/dist/ui/components/ui-video/UIVideo.d.ts +1 -0
- package/dist/ui/components/ui-visibility/UIVisibility.d.ts +1 -0
- package/dist/ui/components/ui-zoom/UIZoom.d.ts +1 -0
- package/dist/ui/jsx.d.ts +4 -4
- package/dist/ui/vocabulary/defaults.generated.js +1 -1
- package/dist/util/spell/constants.js +1 -1
- package/epic/.claude-plugin/plugin.json +1 -1
- package/epic/.codex-plugin/plugin.json +1 -1
- package/epic/hooks/handoff.mjs +4 -3
- package/epic/hooks/worktree.mjs +22 -3
- package/epic/package.json +41 -2
- package/epic/skills/details/SKILL.md +2 -1
- package/epic/skills/epic/SKILL.md +7 -1
- package/epic/skills/epic/guide.md +3 -0
- package/epic/skills/isolate/SKILL.md +53 -20
- package/epic/src/AGENTS.md +11 -2
- package/epic/templates/durable.html +1 -1
- package/epic/vscode/package.json +1 -1
- package/epic/vscode/spell-epic.vsix +0 -0
- package/package.json +1 -1
- package/parser/package.json +1 -1
- package/ui/package.json +15 -2
|
@@ -19,7 +19,7 @@ var ScratchInstall = class {
|
|
|
19
19
|
}
|
|
20
20
|
/** The scratch project's folder. */
|
|
21
21
|
dir;
|
|
22
|
-
/** Install, then run the
|
|
22
|
+
/** Install, then run the checks; every result, passed or failed. NEVER throws. */
|
|
23
23
|
async run() {
|
|
24
24
|
const checks = [];
|
|
25
25
|
const install = this.step("npm install of every .tgz, outside the checkout", () => this.install());
|
|
@@ -28,8 +28,10 @@ var ScratchInstall = class {
|
|
|
28
28
|
checks.push(this.step("node imports spell/util and spell/parser/parser", () => this.nodeImports()));
|
|
29
29
|
checks.push(await this.asyncStep("a Vite page draws <ui-button>, with one DOMElement", () => this.page()));
|
|
30
30
|
checks.push(this.step("npx spell help runs", () => this.spellHelp()));
|
|
31
|
-
if (this.packed.some((pkg) => pkg.name === "spell-epic"))
|
|
31
|
+
if (this.packed.some((pkg) => pkg.name === "spell-epic")) {
|
|
32
32
|
checks.push(this.step("npx epic --help runs (spell-epic's bin, on spell's code)", () => this.epicHelp()));
|
|
33
|
+
checks.push(await this.asyncStep("the epic server starts and serves an epic page", () => this.epicServer()));
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
36
|
if (checks.every((check) => check.ok)) rmSync(this.dir, { recursive: true, force: true });
|
|
35
37
|
else checks.push({ check: "scratch project kept, to look into", ok: true, detail: this.dir });
|
|
@@ -49,7 +51,7 @@ var ScratchInstall = class {
|
|
|
49
51
|
dependencies,
|
|
50
52
|
overrides
|
|
51
53
|
});
|
|
52
|
-
this.exec("npm", ["install", "--no-audit", "--no-fund", "--loglevel=error"], 6e5);
|
|
54
|
+
this.exec("npm", ["install", "--no-audit", "--no-fund", "--loglevel=error"], { timeout: 6e5 });
|
|
53
55
|
return `${this.packed.length} packages in ${this.dir}`;
|
|
54
56
|
}
|
|
55
57
|
/** Node imports two names, from the installed packages' built files. */
|
|
@@ -73,6 +75,56 @@ var ScratchInstall = class {
|
|
|
73
75
|
if (!/epic/.test(help)) throw new Error(`printed no help: ${help.slice(0, 200)}`);
|
|
74
76
|
return `${help.split("\n").length} lines`;
|
|
75
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* `epic init` in a scratch git repo, under a scratch `HOME` and on a free port: the epic server starts from the
|
|
80
|
+
* install, then an epic page and the epics pack answer. The server is stopped again, whatever happens.
|
|
81
|
+
* - `--no-plugin`: no Claude Code, no editor, no network; `--no-commit`, `--no-remote`: nothing to push
|
|
82
|
+
*/
|
|
83
|
+
async epicServer() {
|
|
84
|
+
const home = join(this.dir, "epic-home");
|
|
85
|
+
const repo = join(this.dir, "epic-repo");
|
|
86
|
+
for (const folder of [home, repo]) mkdirSync(folder, { recursive: true });
|
|
87
|
+
const port = await SRV.freePort();
|
|
88
|
+
const env = {
|
|
89
|
+
HOME: home,
|
|
90
|
+
CLAUDE_CONFIG_DIR: join(home, ".claude"),
|
|
91
|
+
SPELL_EPIC_PORT: String(port),
|
|
92
|
+
GIT_DIR: void 0,
|
|
93
|
+
GIT_INDEX_FILE: void 0,
|
|
94
|
+
GIT_WORK_TREE: void 0
|
|
95
|
+
};
|
|
96
|
+
const epic = /* @__PURE__ */ __name((...args) => this.exec("npx", ["--no-install", "epic", ...args], { cwd: repo, env }), "epic");
|
|
97
|
+
this.exec("git", ["init", "-q"], { cwd: repo, env });
|
|
98
|
+
this.exec(
|
|
99
|
+
"git",
|
|
100
|
+
[
|
|
101
|
+
"-c",
|
|
102
|
+
"user.name=Scratch",
|
|
103
|
+
"-c",
|
|
104
|
+
"user.email=scratch@example.com",
|
|
105
|
+
"commit",
|
|
106
|
+
"-q",
|
|
107
|
+
"--allow-empty",
|
|
108
|
+
"-m",
|
|
109
|
+
"scratch"
|
|
110
|
+
],
|
|
111
|
+
{ cwd: repo, env }
|
|
112
|
+
);
|
|
113
|
+
try {
|
|
114
|
+
epic("init", "--no-plugin", "--no-remote", "--no-commit", "--name", "Scratch", "--color", "teal");
|
|
115
|
+
epic("create", "hello", "--title", "Hello");
|
|
116
|
+
const base = `http://127.0.0.1:${port}`;
|
|
117
|
+
const page = await answerOf(`${base}/epics/hello/hello.plan.html`);
|
|
118
|
+
if (!page.includes("<epic-page")) throw new Error("its epic page holds no <epic-page>");
|
|
119
|
+
const pack = await answerOf(`${base}/_epic/pack/epics.pack.js`);
|
|
120
|
+
return `port ${port}: an epic page, ${page.length} bytes; the epics pack, ${pack.length} bytes`;
|
|
121
|
+
} finally {
|
|
122
|
+
try {
|
|
123
|
+
epic("server", "stop");
|
|
124
|
+
} catch {
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
76
128
|
/**
|
|
77
129
|
* A page importing `spell-ui` and `spell/element`, built by the installed Vite, served, and opened in headless
|
|
78
130
|
* Chromium: it draws a `<ui-button>`, whose class extends the page's own `E.DOMElement`.
|
|
@@ -85,7 +137,7 @@ var ScratchInstall = class {
|
|
|
85
137
|
this.exec(
|
|
86
138
|
"npx",
|
|
87
139
|
["--no-install", "vp", "build", "page", "--outDir", "../page-dist", "--emptyOutDir", "--minify", "false"],
|
|
88
|
-
3e5
|
|
140
|
+
{ timeout: 3e5 }
|
|
89
141
|
);
|
|
90
142
|
const built = join(this.dir, "page-dist");
|
|
91
143
|
const definitions = readdirSync(built, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".js")).map((entry) => readFileSync(join(entry.parentPath, entry.name), "utf8").match(DOM_ELEMENT_CLASS)?.length ?? 0).reduce((sum, count) => sum + count, 0);
|
|
@@ -112,15 +164,18 @@ var ScratchInstall = class {
|
|
|
112
164
|
////////////////
|
|
113
165
|
// ## Helpers
|
|
114
166
|
////////////////
|
|
115
|
-
/**
|
|
116
|
-
|
|
167
|
+
/**
|
|
168
|
+
* Run `command` in the scratch folder (or `cwd`); its output. Throws with its stderr when it fails.
|
|
169
|
+
* - `env`: added to this process's; the checkout's own `epic` variables never reach it
|
|
170
|
+
*/
|
|
171
|
+
exec(command, args, { timeout = 12e4, cwd = this.dir, env = {} } = {}) {
|
|
117
172
|
try {
|
|
118
173
|
return execFileSync(command, args, {
|
|
119
|
-
cwd
|
|
174
|
+
cwd,
|
|
120
175
|
encoding: "utf8",
|
|
121
176
|
timeout,
|
|
122
177
|
stdio: ["ignore", "pipe", "pipe"],
|
|
123
|
-
env: { ...process.env, npm_config_update_notifier: "false" }
|
|
178
|
+
env: { ...process.env, EPIC_CHECKOUT: void 0, npm_config_update_notifier: "false", ...env }
|
|
124
179
|
});
|
|
125
180
|
} catch (error) {
|
|
126
181
|
const { stderr, stdout } = error;
|
|
@@ -145,6 +200,12 @@ var ScratchInstall = class {
|
|
|
145
200
|
}
|
|
146
201
|
};
|
|
147
202
|
var DOM_ELEMENT_CLASS = /\bclass DOMElement\b|\bDOMElement = class\b/g;
|
|
203
|
+
async function answerOf(url) {
|
|
204
|
+
const reply = await fetch(url);
|
|
205
|
+
if (!reply.ok) throw new Error(`${url} answered ${reply.status}`);
|
|
206
|
+
return reply.text();
|
|
207
|
+
}
|
|
208
|
+
__name(answerOf, "answerOf");
|
|
148
209
|
var PAGE_HTML = `<!doctype html>
|
|
149
210
|
<html>
|
|
150
211
|
<head><meta charset="utf-8" /><title>spell scratch</title></head>
|
|
@@ -18,6 +18,7 @@ import { PersonCommands } from "../command/PersonCommands.js";
|
|
|
18
18
|
import { PluginInstall } from "../command/PluginInstall.js";
|
|
19
19
|
import { SkillsCheck } from "../command/SkillsCheck.js";
|
|
20
20
|
import { RepoInit } from "../command/RepoInit.js";
|
|
21
|
+
import { PullRequest } from "../command/PullRequest.js";
|
|
21
22
|
import { Repos } from "../command/Repos.js";
|
|
22
23
|
import { Requests } from "../command/Requests.js";
|
|
23
24
|
import { Sessions } from "../command/Sessions.js";
|
|
@@ -81,6 +82,9 @@ var EpicProgram = class _EpicProgram {
|
|
|
81
82
|
requests(epic.command("merge")).description(
|
|
82
83
|
"a standing epic's phase onto main at once, fast-forward only; run in the main checkout; a stray snapshot or generated file there is moved aside first, and --ditch moves up to 3 others too, once you say so"
|
|
83
84
|
).usage("<epic> [--ditch]").addHelpText("after", example("epic merge epic-workflow"));
|
|
85
|
+
this.verb(epic.command("pr"), (args) => new PullRequest().run(args)).description(
|
|
86
|
+
"push a branch (never forced) and open its pull request against the base branch, a merge request on GitLab; if one's open, says its address and that the push updated it"
|
|
87
|
+
).usage("<name> [--title <title>] [--body-file <file>]").addHelpText("after", example("epic pr seo --title 'Better titles' --body-file notes.md"));
|
|
84
88
|
}
|
|
85
89
|
////////////////
|
|
86
90
|
// ## Epic page: making and reading
|
|
@@ -445,9 +449,9 @@ var EpicProgram = class _EpicProgram {
|
|
|
445
449
|
"the VOICE a kind of page is written in (readme, code ...): its file, for a skill to read; or every voice"
|
|
446
450
|
).usage("[<name> | --for <kind>] [--json]").addHelpText("after", VOICE_HELP);
|
|
447
451
|
this.verb(epic.command("init"), (args) => new RepoInit().run(args)).description(
|
|
448
|
-
"set this repo up for epics, the one command to start (npx spell@next epic init): the plugin, its .epic/config.json5, the epic repo beside it (made, or cloned from the team's), shared on GitHub, the links and their .gitignore lines, your name and colour, then the epic server; safe to run again"
|
|
452
|
+
"set this repo up for epics, the one command to start (npx spell@next epic init): the plugin, its .epic/config.json5, the epic repo beside it (made, or cloned from the team's), shared on GitHub or GitLab, the links and their .gitignore lines, your name and colour, then the epic server; safe to run again"
|
|
449
453
|
).usage(
|
|
450
|
-
"[--name <name>] [--color <colour>] [--content-repo <name> | --remote <address> | --no-remote] [--public] [--no-plugin] [--no-commit] [--no-server] [--dry-run] [--json]"
|
|
454
|
+
"[--name <name>] [--color <colour>] [--content-repo <name> | --remote <address> | --no-remote] [--public] [--host github|gitlab] [--protected-base] [--no-plugin] [--no-commit] [--no-server] [--dry-run] [--json]"
|
|
451
455
|
).addHelpText("after", INIT_HELP);
|
|
452
456
|
this.verb(epic.command("whoami"), (args) => new PersonCommands().whoami(args)).description(
|
|
453
457
|
"who you are on the epics: your short name (kept, else your GitHub login, else git's user.name), your full name and GitHub login; with a name, keeps it; --rename also writes it over the old one on every page"
|
|
@@ -812,6 +816,7 @@ The keys (folders print absolute; the file's are relative to the main checkout)
|
|
|
812
816
|
contentFolder the epic repo: epics, guides, sagas, the logs
|
|
813
817
|
contentRemote its address, which everyone pulls from and pushes to ("": none); epic init writes it
|
|
814
818
|
baseBranch the branch worktrees start from and merge into
|
|
819
|
+
baseBranchProtected whether the base branch takes only pull requests: epic init opens one, epic merge refuses
|
|
815
820
|
worktreesFolder where new worktrees go, <worktreesFolder>/<name>; may be beside the repo
|
|
816
821
|
(../spell-app.worktrees), the old .claude/worktrees still read then
|
|
817
822
|
installCommand what makes a new worktree ready to run
|
|
@@ -872,10 +877,10 @@ From any folder of the repo (a worktree's too), each step skipped when it's done
|
|
|
872
877
|
window names from the repo's; a file already there is kept
|
|
873
878
|
../<repo>.epics the epic repo, a git repo of its own: epics/, sagas/, guides/, pages/;
|
|
874
879
|
cloned instead, when the config names the team's (contentRemote) and it isn't here
|
|
875
|
-
the epic repo the epic repo on GitHub, so the team shares the plans: asks what to call it
|
|
880
|
+
the epic repo the epic repo on GitHub or GitLab, so the team shares the plans: asks what to call it
|
|
876
881
|
(<repo>.epics) and "Private or public?" (private), makes it, pushes, and writes its
|
|
877
|
-
address in the config (contentRemote); needs
|
|
878
|
-
it, says how to get it
|
|
882
|
+
address in the config (contentRemote); needs the host's command (gh, glab), logged in:
|
|
883
|
+
without it, says how to get it
|
|
879
884
|
the links each of those folders linked in at the checkout's root
|
|
880
885
|
.gitignore the links listed between # shared:start and # shared:end
|
|
881
886
|
your name "What do you want to be called?" (--name), kept in ~/.spell-epic/person.json5
|
|
@@ -883,6 +888,8 @@ From any folder of the repo (a worktree's too), each step skipped when it's done
|
|
|
883
888
|
with the plans, in the epic repo's people/
|
|
884
889
|
the commit .epic/config.json5 and .gitignore committed on the base branch ("Commit ... on main?",
|
|
885
890
|
yes suggested); on another branch it says so; --no-commit skips it
|
|
891
|
+
a base branch that takes only pull requests: they go on a new branch, epic-setup, which it
|
|
892
|
+
pushes and opens a pull request for; local main stays as it was
|
|
886
893
|
the epic server started, serving this repo: its address printed; --no-server skips it
|
|
887
894
|
Then push the base branch: a teammate's epic init then clones the plans.
|
|
888
895
|
|
|
@@ -891,6 +898,14 @@ Then push the base branch: a teammate's epic init then clones the plans.
|
|
|
891
898
|
--public makes the epic repo public without asking; with no terminal to ask in, it's private unless --public.
|
|
892
899
|
A public one shows everything in the plans (epic pages, guides, comments) to anyone.
|
|
893
900
|
|
|
901
|
+
--protected-base: the base branch takes only pull requests (baseBranchProtected in the config). Without it,
|
|
902
|
+
epic init asks GitHub or GitLab, with its command (gh, glab) logged in and a remote there, and says in one line when
|
|
903
|
+
it found so.
|
|
904
|
+
|
|
905
|
+
--host github|gitlab: where the code is hosted (codeHost in the config). Left out, it's read off the origin
|
|
906
|
+
remote's address; for an address that doesn't say (git.acme.com), epic init asks in a terminal, and with no
|
|
907
|
+
terminal stays on GitHub and says so.
|
|
908
|
+
|
|
894
909
|
--name <name> is the name you go by on the epics, kept in ~/.spell-epic/person.json5 (epic whoami);
|
|
895
910
|
without it, epic init asks in a terminal, suggesting your GitHub login (else git's user.name), and takes that
|
|
896
911
|
anywhere else.
|
|
@@ -387,7 +387,7 @@ var GROUP_VERBS = {
|
|
|
387
387
|
example: "epic worktree remove seo",
|
|
388
388
|
flags: {
|
|
389
389
|
"--force": "git's: one with changes too",
|
|
390
|
-
"--branches": "and its branch in each repo, when merged (git branch -d)"
|
|
390
|
+
"--branches": "and its branch in each repo, when merged (git branch -d; a merged pull request counts, where main takes only those)"
|
|
391
391
|
}
|
|
392
392
|
},
|
|
393
393
|
{
|
|
@@ -1240,10 +1240,16 @@ var VERB_FLAGS = {
|
|
|
1240
1240
|
"--public": "make the epic repo public, without asking (else asked, or private)",
|
|
1241
1241
|
"--no-plugin": "don't install the epic plugin for Claude Code",
|
|
1242
1242
|
"--no-commit": "don't commit .epic/config.json5 and .gitignore on the base branch",
|
|
1243
|
+
"--protected-base": "the base branch takes only pull requests: put the two files on a new branch, epic-setup, and open one",
|
|
1243
1244
|
"--no-server": "don't start the epic server",
|
|
1245
|
+
"--host <github|gitlab>": "where the code is hosted, for an address that doesn't say",
|
|
1244
1246
|
"--dry-run": "only say what it would do",
|
|
1245
1247
|
"--json": "print what it did as JSON"
|
|
1246
1248
|
},
|
|
1249
|
+
pr: {
|
|
1250
|
+
"--title <title>": "the request's title (default: its one commit's subject, else the branch's name)",
|
|
1251
|
+
"--body-file <file>": "the request's description, from a file"
|
|
1252
|
+
},
|
|
1247
1253
|
whoami: {
|
|
1248
1254
|
"--rename": "keep the name, and write it over your old one wherever it says who wrote something",
|
|
1249
1255
|
"--dry-run": "with --rename: only say what it would change",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/****************
|
|
2
|
+
* ### `BaseBranch`
|
|
3
|
+
* Bringing the LOCAL base branch up to date with `origin`, for a repo whose base branch takes only pull requests
|
|
4
|
+
* (`baseBranchProtected`).
|
|
5
|
+
* - Why: new worktrees are cut from local `main`, and `epic worktree merge-main` merges local `main`.
|
|
6
|
+
* Nothing lands on it here any more, so without this it goes stale the moment GitHub merges a pull request.
|
|
7
|
+
* - Who: the worktree hook, before it makes a new worktree; `MainMerge`, before it merges.
|
|
8
|
+
* - Safe or not at all: fast-forward only, and only over a clean checkout.
|
|
9
|
+
* Offline, diverged, ahead or dirty, it changes nothing, says so in one line, and the caller carries on.
|
|
10
|
+
* - Its position: node's own modules and the kit's `Git` only, so plain `node` loads it (the worktree hook);
|
|
11
|
+
* NEVER an `enum` or a parameter property.
|
|
12
|
+
* - All `static`: no state.
|
|
13
|
+
****************/
|
|
14
|
+
export declare class BaseBranch {
|
|
15
|
+
/**
|
|
16
|
+
* Fast-forward branch `base` of main checkout `main` from `origin`, when that can be done safely.
|
|
17
|
+
* - `base` checked out there: `git merge --ff-only`, only with nothing uncommitted there
|
|
18
|
+
* - `base` not checked out there: `git fetch origin <base>:<base>`, which git itself does only as a fast-forward
|
|
19
|
+
* - NEVER throws
|
|
20
|
+
* - SIDE EFFECT: a fetch, and the local branch and its checkout moved
|
|
21
|
+
*/
|
|
22
|
+
static catchUp(main: string, base: string): BaseCatchUp;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* What `BaseBranch.catchUp()` did.
|
|
26
|
+
* - `action`:
|
|
27
|
+
* - `fast-forwarded`: it moved; `current`: nothing to do
|
|
28
|
+
* - `no remote`: no `origin`, or it has no such branch
|
|
29
|
+
* - `offline`, `ahead`, `diverged`, `dirty`, `failed`: left as it was
|
|
30
|
+
* - `line`: what to tell the person; `""`: nothing worth saying
|
|
31
|
+
*/
|
|
32
|
+
export type BaseCatchUp = {
|
|
33
|
+
action: "fast-forwarded" | "current" | "no remote" | "offline" | "ahead" | "diverged" | "dirty" | "failed";
|
|
34
|
+
line: string;
|
|
35
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/command/BaseBranch.ts
|
|
5
|
+
import { Git } from "spell/server/Git";
|
|
6
|
+
var BaseBranch = class {
|
|
7
|
+
static {
|
|
8
|
+
__name(this, "BaseBranch");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fast-forward branch `base` of main checkout `main` from `origin`, when that can be done safely.
|
|
12
|
+
* - `base` checked out there: `git merge --ff-only`, only with nothing uncommitted there
|
|
13
|
+
* - `base` not checked out there: `git fetch origin <base>:<base>`, which git itself does only as a fast-forward
|
|
14
|
+
* - NEVER throws
|
|
15
|
+
* - SIDE EFFECT: a fetch, and the local branch and its checkout moved
|
|
16
|
+
*/
|
|
17
|
+
static catchUp(main, base) {
|
|
18
|
+
if (!Git.out(["remote", "get-url", "origin"], main)) return { action: "no remote", line: "" };
|
|
19
|
+
const fetched = Git.run(["fetch", "-q", "origin", base], main, { timeout: NETWORK_TIMEOUT });
|
|
20
|
+
if (!fetched.ok) {
|
|
21
|
+
const why = firstLine(fetched.err) || "the fetch failed";
|
|
22
|
+
return { action: "offline", line: `couldn't reach origin (${why}): going on from local ${base}, maybe behind` };
|
|
23
|
+
}
|
|
24
|
+
const theirs = `refs/remotes/origin/${base}`;
|
|
25
|
+
const ours = `refs/heads/${base}`;
|
|
26
|
+
const [local, remote] = [Git.out(["rev-parse", ours], main), Git.out(["rev-parse", theirs], main)];
|
|
27
|
+
if (!local || !remote) return { action: "no remote", line: "" };
|
|
28
|
+
if (local === remote) return { action: "current", line: "" };
|
|
29
|
+
const behind = Git.out(["rev-list", "--count", `${ours}..${theirs}`], main) ?? "0";
|
|
30
|
+
const ahead = Git.out(["rev-list", "--count", `${theirs}..${ours}`], main) ?? "0";
|
|
31
|
+
if (ahead !== "0")
|
|
32
|
+
return behind === "0" ? {
|
|
33
|
+
action: "ahead",
|
|
34
|
+
line: `local ${base} is ${ahead} commit(s) ahead of origin's, which only a pull or merge request can bring there`
|
|
35
|
+
} : {
|
|
36
|
+
action: "diverged",
|
|
37
|
+
line: `local ${base} and origin's have diverged (${ahead} commit(s) only here): going on from local ${base}`
|
|
38
|
+
};
|
|
39
|
+
const onBase = Git.out(["branch", "--show-current"], main) === base;
|
|
40
|
+
if (onBase && Git.out(["status", "--porcelain", "--untracked-files=no"], main))
|
|
41
|
+
return { action: "dirty", line: `local ${base} has uncommitted changes: not fast-forwarded, going on from it` };
|
|
42
|
+
const moved = onBase ? Git.run(["merge", "-q", "--ff-only", theirs], main, { timeout: NETWORK_TIMEOUT }) : Git.run(["fetch", "-q", "origin", `${base}:${base}`], main, { timeout: NETWORK_TIMEOUT });
|
|
43
|
+
if (!moved.ok)
|
|
44
|
+
return {
|
|
45
|
+
action: "failed",
|
|
46
|
+
line: `couldn't fast-forward local ${base} (${firstLine(moved.err) || "git said no"}): going on from it`
|
|
47
|
+
};
|
|
48
|
+
return { action: "fast-forwarded", line: `local ${base} fast-forwarded from origin (${behind} commit(s))` };
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var NETWORK_TIMEOUT = 6e4;
|
|
52
|
+
function firstLine(text) {
|
|
53
|
+
return text.split("\n")[0]?.trim() ?? "";
|
|
54
|
+
}
|
|
55
|
+
__name(firstLine, "firstLine");
|
|
56
|
+
export {
|
|
57
|
+
BaseBranch
|
|
58
|
+
};
|
|
@@ -37,7 +37,7 @@ export declare class EpicCheckout {
|
|
|
37
37
|
*/
|
|
38
38
|
static mustGit(args: string[], cwd: string, options?: SRV.GitOptions): string;
|
|
39
39
|
/**
|
|
40
|
-
* The checkout this code is in
|
|
40
|
+
* The checkout this code is in (`EngineFiles.root`; the `epic/` of the `spell` package, in an npm install).
|
|
41
41
|
* - static: where the running `epic`'s own copy of every tool is (`EpicTools`)
|
|
42
42
|
*/
|
|
43
43
|
static readonly CODE_ROOT: string;
|
|
@@ -3,10 +3,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
3
3
|
|
|
4
4
|
// src/command/EpicCheckout.ts
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
|
-
import { join
|
|
7
|
-
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { join } from "node:path";
|
|
8
7
|
import { findUp } from "spell/util/node/findUp";
|
|
9
8
|
import { Git } from "spell/server/Git";
|
|
9
|
+
import { EngineFiles } from "../config/EngineFiles.mjs";
|
|
10
10
|
import { EpicCommandError } from "./command.types.js";
|
|
11
11
|
var CONFIG_FILE = ".epic/config.json5";
|
|
12
12
|
var EpicCheckout = class _EpicCheckout {
|
|
@@ -51,10 +51,10 @@ var EpicCheckout = class _EpicCheckout {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* The checkout this code is in
|
|
54
|
+
* The checkout this code is in (`EngineFiles.root`; the `epic/` of the `spell` package, in an npm install).
|
|
55
55
|
* - static: where the running `epic`'s own copy of every tool is (`EpicTools`)
|
|
56
56
|
*/
|
|
57
|
-
static CODE_ROOT =
|
|
57
|
+
static CODE_ROOT = EngineFiles.root;
|
|
58
58
|
};
|
|
59
59
|
export {
|
|
60
60
|
EpicCheckout
|
|
@@ -3,7 +3,8 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
3
3
|
|
|
4
4
|
// src/command/EpicGuide.ts
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
|
-
import { dirname
|
|
6
|
+
import { dirname } from "node:path";
|
|
7
|
+
import { EngineFiles } from "../config/EngineFiles.mjs";
|
|
7
8
|
import { EXIT, EpicCommandError, parseVerbArgs } from "./command.types.js";
|
|
8
9
|
var EpicGuide = class _EpicGuide {
|
|
9
10
|
static {
|
|
@@ -75,7 +76,7 @@ var EpicGuide = class _EpicGuide {
|
|
|
75
76
|
return EXIT.OK;
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
|
-
var GUIDE_FILE =
|
|
79
|
+
var GUIDE_FILE = EngineFiles.path("skills/epic/guide.md");
|
|
79
80
|
var TOPIC_HEADING = /^## ([\w-]+) -- (.+)$/m;
|
|
80
81
|
var FIRST_TOPIC = "workflow";
|
|
81
82
|
var TOPIC_WIDTH = 18;
|
|
@@ -38,6 +38,11 @@ export declare class EpicTools {
|
|
|
38
38
|
* - else `codeRoot`, the running `epic`'s checkout
|
|
39
39
|
*/
|
|
40
40
|
static codeOf(spec: ToolSpec, data: string, codeRoot?: string): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* `spec` as it runs from code folder `code`: as written in a checkout;
|
|
43
|
+
* in an npm install, the built `.js`, from the engine's folder, and no `tsx` (`EngineFiles`).
|
|
44
|
+
*/
|
|
45
|
+
private static builtTool;
|
|
41
46
|
/**
|
|
42
47
|
* Run the `epic` tool's command line `argv` (`add seo judgement "Title"`, the tool's own order) IN this process:
|
|
43
48
|
* `PlanDocCommands`, on the caller's checkout's epic pages (`PlanDocFiles`).
|
|
@@ -3,9 +3,10 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
3
3
|
|
|
4
4
|
// src/command/EpicTools.ts
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
|
-
import { join } from "node:path";
|
|
6
|
+
import { join, relative } from "node:path";
|
|
7
7
|
import { settingsParts } from "spell/server/page/settings";
|
|
8
8
|
import { CLI } from "spell/cli";
|
|
9
|
+
import { EngineFiles } from "../config/EngineFiles.mjs";
|
|
9
10
|
import { firstPackageDir, KIT_PACKAGES } from "../tools/packageDir.js";
|
|
10
11
|
import { EpicCheckout } from "./EpicCheckout.js";
|
|
11
12
|
import { EXIT } from "./command.types.js";
|
|
@@ -38,13 +39,14 @@ var EpicTools = class _EpicTools {
|
|
|
38
39
|
`);
|
|
39
40
|
return Promise.resolve(EXIT.ERRORS);
|
|
40
41
|
}
|
|
42
|
+
const tool = _EpicTools.builtTool(spec, code);
|
|
41
43
|
const toolCwd = spec.cwd && (existsSync(join(data, spec.cwd)) ? join(data, spec.cwd) : join(code, spec.cwd));
|
|
42
|
-
return CLI.runChild(process.execPath, [...CLI.toolArgs(
|
|
44
|
+
return CLI.runChild(process.execPath, [...CLI.toolArgs(tool, code), ...args], {
|
|
43
45
|
cwd: toolCwd || cwd,
|
|
44
46
|
env: {
|
|
45
47
|
...process.env,
|
|
46
48
|
EPIC_CHECKOUT: data,
|
|
47
|
-
...
|
|
49
|
+
...tool.tsx ? { TSX_TSCONFIG_PATH: join(code, tool.tsx) } : {},
|
|
48
50
|
...env
|
|
49
51
|
}
|
|
50
52
|
});
|
|
@@ -59,6 +61,15 @@ var EpicTools = class _EpicTools {
|
|
|
59
61
|
if (spec.package) return firstPackageDir(spec.package, data);
|
|
60
62
|
return spec.code === "caller" ? data : codeRoot;
|
|
61
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* `spec` as it runs from code folder `code`: as written in a checkout;
|
|
66
|
+
* in an npm install, the built `.js`, from the engine's folder, and no `tsx` (`EngineFiles`).
|
|
67
|
+
*/
|
|
68
|
+
static builtTool(spec, code) {
|
|
69
|
+
if (spec.package || !EngineFiles.isBuilt || code !== EngineFiles.root) return spec;
|
|
70
|
+
const { tsx: _tsx, ...plain } = spec;
|
|
71
|
+
return { ...plain, tool: relative(code, EngineFiles.path(spec.tool)) };
|
|
72
|
+
}
|
|
62
73
|
////////////////
|
|
63
74
|
// ## The `epic` tool, in this process
|
|
64
75
|
////////////////
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { type Generator, type MergeMainReport } from "./command.types";
|
|
2
|
-
/**
|
|
3
|
-
* The command that updates the snapshots of `tests` (relative to their package), run in the package.
|
|
4
|
-
* - `--update` AFTER the files: it takes an optional value, so before them it swallows the first one
|
|
5
|
-
*/
|
|
6
|
-
declare const SNAPSHOT_UPDATE: (tests: string[]) => string[];
|
|
7
2
|
/****************
|
|
8
3
|
* ### `MainMerge`
|
|
9
4
|
* `epic worktree merge-main`: merge `main` into this checkout's branch,
|
|
@@ -21,8 +16,11 @@ declare const SNAPSHOT_UPDATE: (tests: string[]) => string[];
|
|
|
21
16
|
* a file `main` changed, or in conflict, that the merged `.gitignore` ignores and one side's tree lacks,
|
|
22
17
|
* leaves the index and stays on disk (`untracked`).
|
|
23
18
|
* - e.g. the bundles the page server builds since 2026-10-07 (`spell bundle`)
|
|
24
|
-
* -
|
|
25
|
-
*
|
|
19
|
+
* - A root lockfile changed on both sides is rewritten by its own tool (`npm install --package-lock-only` ...), from
|
|
20
|
+
* the merged `package.json`, unless the checkout lists a generator of its own for it.
|
|
21
|
+
* - Snapshots are regenerated by the repo's own test runner (`snapshotUpdateOf()`), then each entry is compared to both
|
|
22
|
+
* sides: one NEITHER side had is new behaviour nobody reviewed, so it's reported (`review`), never hidden.
|
|
23
|
+
* - a repo with neither Vitest nor Vite+: its snapshot files are ordinary files, to resolve by hand if they conflict
|
|
26
24
|
* - Any OTHER file in conflict stops it mid-merge:
|
|
27
25
|
* Claude resolves those, `git add`s them, and runs it again with `--continue`.
|
|
28
26
|
* - A merge (or fast-forward) that changed a lockfile runs the checkout's install command after it (`reinstall()`).
|
|
@@ -35,8 +33,8 @@ export declare class MainMerge {
|
|
|
35
33
|
readonly root: string;
|
|
36
34
|
/** the generated outputs and their commands (tests pass their own) */
|
|
37
35
|
readonly generators: Generator[];
|
|
38
|
-
/** the command that updates the snapshots of `tests` */
|
|
39
|
-
readonly snapshotUpdate:
|
|
36
|
+
/** the command that updates the snapshots of `tests`; `null`: this repo has no runner we know */
|
|
37
|
+
readonly snapshotUpdate: SnapshotUpdate | null;
|
|
40
38
|
/** the command that installs the packages, as words; `[]`: none */
|
|
41
39
|
readonly install: string[];
|
|
42
40
|
/** the rename step's command, as words, the files appended; `[]`: no step */
|
|
@@ -51,8 +49,8 @@ export declare class MainMerge {
|
|
|
51
49
|
/**
|
|
52
50
|
* - `root`: the checkout (a worktree, usually)
|
|
53
51
|
* - `generators`: default the checkout's own list (`generatorsOf()`)
|
|
54
|
-
* - `snapshotUpdate`: default
|
|
55
|
-
* - `install`: default the checkout's `installCommand` (`.epic/config.json5`; `
|
|
52
|
+
* - `snapshotUpdate`: default the repo's own runner (`snapshotUpdateOf()`)
|
|
53
|
+
* - `install`: default the checkout's `installCommand` (`.epic/config.json5`; `npm install`)
|
|
56
54
|
* - `rename`: default `node bin/spell.mjs ui rename --write`
|
|
57
55
|
* - `kitRoot`: default the nearest folder at or above `root` with `bin/spell.mjs` (`kitRootOf()`):
|
|
58
56
|
* the merged checkout's own kit, so a worktree's child repo uses its worktree's kit, never main's
|
|
@@ -145,16 +143,28 @@ export declare class MainMerge {
|
|
|
145
143
|
static generatorsOf(root: string): Generator[];
|
|
146
144
|
/**
|
|
147
145
|
* The generators `files` need, in run order, each with the files it covers:
|
|
148
|
-
* `generators`' (a checkout's list, `generatorsOf()`), then one
|
|
146
|
+
* a root lockfile's own tool (`LOCKFILE_REGENERATORS`), `generators`' (a checkout's list, `generatorsOf()`), then one
|
|
147
|
+
* snapshot update per package.
|
|
149
148
|
* - a file no generator covers isn't in any step
|
|
149
|
+
* - a lockfile `generators` covers is theirs
|
|
150
|
+
* - `snapshotUpdate` `null`: no snapshot steps
|
|
150
151
|
* - `root`: the checkout, where each snapshot's package folder is looked for (`packageFolder()`); left out,
|
|
151
152
|
* `packages/<name>`
|
|
152
153
|
* - static: pure, but for looking in `root`
|
|
153
154
|
*/
|
|
154
|
-
static generatorsFor(files: string[], generators: Generator[], snapshotUpdate?:
|
|
155
|
+
static generatorsFor(files: string[], generators: Generator[], snapshotUpdate?: SnapshotUpdate | null, root?: string): {
|
|
155
156
|
generator: Generator;
|
|
156
157
|
files: string[];
|
|
157
158
|
}[];
|
|
159
|
+
/**
|
|
160
|
+
* The command that updates Vitest snapshots in checkout `root`, from the test runner its `package.json` names:
|
|
161
|
+
* - `vite-plus`: `<runner> vp test run <tests> --update`, Spell's
|
|
162
|
+
* - `vitest`: `<runner> vitest run <tests> --update`
|
|
163
|
+
* - neither (or no `package.json`): `null`, so `merge-main` never runs a command the repo hasn't got
|
|
164
|
+
* - `<runner>`: how the repo's lock file runs an installed program (`PACKAGE_RUNNERS`): `yarn`, `pnpm exec` ...,
|
|
165
|
+
* else `npx`
|
|
166
|
+
*/
|
|
167
|
+
static snapshotUpdateOf(root: string): SnapshotUpdate | null;
|
|
158
168
|
/**
|
|
159
169
|
* Package `name`'s folder in checkout `root`, from its root: where its snapshots are updated (its own
|
|
160
170
|
* `vitest.config.ts`).
|
|
@@ -172,14 +182,15 @@ export declare class MainMerge {
|
|
|
172
182
|
*/
|
|
173
183
|
static snapshotEntries(text: string): Map<string, string>;
|
|
174
184
|
}
|
|
185
|
+
/** A command that updates the snapshots of `tests` (paths from their package), as words. */
|
|
186
|
+
export type SnapshotUpdate = (tests: string[]) => string[];
|
|
175
187
|
/** What `new MainMerge()` takes: see its constructor. */
|
|
176
188
|
export type MainMergeProps = {
|
|
177
189
|
root: string;
|
|
178
190
|
generators?: Generator[];
|
|
179
|
-
snapshotUpdate?:
|
|
191
|
+
snapshotUpdate?: SnapshotUpdate | null;
|
|
180
192
|
install?: string[];
|
|
181
193
|
rename?: string[];
|
|
182
194
|
kitRoot?: string;
|
|
183
195
|
carryOn?: string[];
|
|
184
196
|
};
|
|
185
|
-
export {};
|