spell 0.8.7 → 0.8.8
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 +96 -36
- package/app/package.json +25 -1
- 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 +7 -1
- package/dist/epic/cli/epicGroups.js +2 -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/RepoInit.d.ts +116 -8
- package/dist/epic/command/RepoInit.js +308 -13
- package/dist/epic/command/Requests.d.ts +1 -0
- package/dist/epic/command/Requests.js +6 -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 +18 -3
- package/dist/epic/command/Worktrees.js +38 -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/EngineFiles.mjs +60 -0
- package/dist/epic/config/EpicConfig.d.ts +12 -2
- package/dist/epic/config/EpicConfig.js +9 -1
- package/dist/epic/config/GitHub.d.ts +41 -1
- package/dist/epic/config/GitHub.js +75 -3
- 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/PlanDocFiles.js +3 -2
- 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/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 +3 -1
- package/dist/ui/components/ui-parts/UIMeta.d.ts +1 -0
- 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/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 +4 -0
- package/epic/skills/isolate/SKILL.md +35 -0
- package/epic/src/AGENTS.md +6 -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
|
@@ -1,23 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Entry of `commands.js`: command reference pages (`templates/commands.html`, e.g. `dev/commands/commands.html`): draws the page's tables
|
|
3
|
+
* from the JSON beside it, then boots the docs bundle.
|
|
4
|
+
* - Loaded INSTEAD of `spell-ui.js`: it fetches, draws, then adds `spell-ui.js` (same folder), whatever happened
|
|
5
|
+
* (`drawThenBoot()`).
|
|
6
|
+
* - The data: `<page>.json5` (`body[data-commands]` overrides), read through the page's `ServerLink` (`getFile()`),
|
|
7
|
+
* so the page needs the PAGE SERVER (`epic pages open <page>`); from `file://` a notice where the tables go says so
|
|
8
|
+
* (`drawThenBoot()`).
|
|
9
|
+
* - JSON5, read by the kit's `parseJSON5()`; its old name, `<page>.json`, read when there's no `.json5` yet
|
|
10
|
+
* (`ServerLink.dataFileNames()`)
|
|
11
|
+
* - JSON: `{ families: [{ id, title, icon?, intro?, rows: [Row] }] }` (a family `id` shares the page's id space: never
|
|
12
|
+
* reuse a hand-written section's); `Row`:
|
|
13
|
+
* - `op` -- the operation, in words; `id?` -- anchor, default `<family id>-<slug of op>`
|
|
14
|
+
* - `cli`, `skill`, `yarn` -- `{ mark, names?, note? }`: `mark` one of `same` (✓, under the shared name),
|
|
15
|
+
* `other` (≈, another name), `could` (○, doesn't but could), `no` (—, couldn't really); `names` the commands:
|
|
16
|
+
* `spell compile`, `/epic`, `<package> <script>` (`root plan-doc`, `ui gen:icons`)
|
|
17
|
+
* - `runs` -- the tool doing the work (`src/window.mjs`, `status.py`, `prose`); `target`, `notes` -- text
|
|
18
|
+
* - in `target`, a roadmap id in parens, `(R3)`, links to `#r3`: the page's roadmap rows carry those ids
|
|
19
|
+
* - text fields: `` `code` `` becomes `<code>`; everything else is plain text, never markup
|
|
20
|
+
* - `sources` (top level, optional): what `spell commands` counts: `userSkills` (in `~/.claude/skills`),
|
|
21
|
+
* `ignore` (commands that need no row); ignored here
|
|
22
|
+
* - Built from elements (`el()`), never from markup in strings (epic `epic-engine` P3): Spell UI's own, as a page
|
|
23
|
+
* writes them (`<ui-section>`, `<ui-table>` round a real `<table>`, `<ui-statistic>`, `<ui-message>`), in the
|
|
24
|
+
* page's light DOM, so the runtime's contents, sticky titles, table widths and comment anchors take them as
|
|
25
|
+
* hand-written ones
|
|
26
|
+
* - Placeholders the template holds, all optional:
|
|
27
|
+
* - `[data-commands-families]`: REPLACED by one nested `<ui-section data-commands-family>` per family, numbered
|
|
28
|
+
* after its parent section
|
|
29
|
+
* - the sections take its place, so they're its section's children, as a page writes nested sections: inside the
|
|
30
|
+
* placeholder's box they took the reading column's indent twice (epic `epic-engine` P3, I31)
|
|
31
|
+
* - `[data-commands-stats]` (a `ui-statistics`)
|
|
32
|
+
* - `[data-commands-filter]` (a `ui-input`): hides rows without every typed word
|
|
33
|
+
* - BUNDLED (epic `coherence` C12): `node src/tools/bundle-spell-ui.js --data-pages` builds it into `commands.js`, a
|
|
34
|
+
* classic script with NO Spell UI in it (the page's `spell-ui.js` draws the `<ui-*>` markup); edit THIS, never
|
|
35
|
+
* the bundle. It imports the helpers that exist: the docs helpers' `el()` and start, the kit's `slug()` and
|
|
36
|
+
* `parseJSON5()`, `ServerLink`.
|
|
37
|
+
*/
|
|
38
|
+
import { slug } from "spell/util/string"
|
|
39
|
+
import { parseJSON5 } from "spell/util/spell/json"
|
|
40
|
+
import { ServerLink } from "spell/epic/review"
|
|
41
|
+
|
|
42
|
+
import { drawThenBoot, el, sectionNumber, withCode } from "./spell-doc-helpers.js"
|
|
43
|
+
|
|
44
|
+
/** Cell marks: the sign shown, the table cell's verdict class, the legend's words. */
|
|
45
|
+
const MARKS = {
|
|
10
46
|
same: { sign: "✓", cls: "yes positive", words: "does it, shared name" },
|
|
11
47
|
other: { sign: "≈", cls: "meh warning", words: "does it, other name" },
|
|
12
48
|
could: { sign: "○", cls: "", words: "doesn't, but could" },
|
|
13
49
|
no: { sign: "—", cls: "no negative", words: "couldn't really" }
|
|
14
|
-
}
|
|
15
|
-
|
|
50
|
+
}
|
|
51
|
+
/** Surface columns, in order: JSON key, header. */
|
|
52
|
+
const SURFACES = [
|
|
16
53
|
["cli", "CLI"],
|
|
17
54
|
["skill", "skill"],
|
|
18
55
|
["yarn", "yarn"]
|
|
19
|
-
]
|
|
20
|
-
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
/** The page's data: `<page>.json5` beside it, unless `<body data-commands>` names another. */
|
|
59
|
+
const DATA_FILE =
|
|
60
|
+
document.body.dataset.commands || location.pathname.replace(/[^/]*$/, (name) => name.replace(/\.html?$/, ".json5"))
|
|
61
|
+
|
|
21
62
|
void drawThenBoot({
|
|
22
63
|
load,
|
|
23
64
|
draw,
|
|
@@ -25,29 +66,42 @@ void drawThenBoot({
|
|
|
25
66
|
header: "Tables not drawn",
|
|
26
67
|
offServer: `This page draws its tables from ${DATA_FILE.split("/").pop()}`,
|
|
27
68
|
failure: "Couldn't draw the tables"
|
|
28
|
-
})
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
////////////////
|
|
72
|
+
// ## Start
|
|
73
|
+
////////////////
|
|
74
|
+
|
|
75
|
+
/** The page's data; throws when there's none. */
|
|
29
76
|
async function load() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
77
|
+
// not renamed yet (`epic migrate`): its old name
|
|
78
|
+
const text = await ServerLink.forPage().getFile(ServerLink.dataFileNames(DATA_FILE), { format: "text" })
|
|
79
|
+
if (text === undefined) throw new Error(`${DATA_FILE}: not found`)
|
|
80
|
+
return parseJSON5(text, DATA_FILE)
|
|
33
81
|
}
|
|
34
|
-
|
|
82
|
+
|
|
83
|
+
////////////////
|
|
84
|
+
// ## Drawing
|
|
85
|
+
////////////////
|
|
86
|
+
|
|
87
|
+
/** Fill every placeholder from `data`. */
|
|
35
88
|
function draw(data) {
|
|
36
|
-
const families = data.families ?? []
|
|
37
|
-
const holder = document.querySelector("[data-commands-families]")
|
|
89
|
+
const families = data.families ?? []
|
|
90
|
+
const holder = document.querySelector("[data-commands-families]")
|
|
38
91
|
if (holder) {
|
|
39
|
-
const number = sectionNumber(holder.closest("ui-section"))
|
|
40
|
-
holder.replaceWith(...families.map((each, i) => family(each, number ? `${number}.${i + 1} ` : "")))
|
|
92
|
+
const number = sectionNumber(holder.closest("ui-section"))
|
|
93
|
+
holder.replaceWith(...families.map((each, i) => family(each, number ? `${number}.${i + 1} ` : "")))
|
|
41
94
|
}
|
|
42
|
-
const stats = document.querySelector("[data-commands-stats]")
|
|
43
|
-
if (stats) stats.replaceChildren(...statistics(families))
|
|
44
|
-
const filter = document.querySelector("[data-commands-filter]")
|
|
45
|
-
if (filter) wireFilter(filter)
|
|
95
|
+
const stats = document.querySelector("[data-commands-stats]")
|
|
96
|
+
if (stats) stats.replaceChildren(...statistics(families))
|
|
97
|
+
const filter = document.querySelector("[data-commands-filter]")
|
|
98
|
+
if (filter) wireFilter(filter)
|
|
46
99
|
}
|
|
47
|
-
|
|
100
|
+
|
|
101
|
+
/** One family: a nested `<ui-section>` with its table. */
|
|
48
102
|
function family(each, prefix) {
|
|
49
|
-
const head = el("tr", {}, el("th", {}, "operation"), ...SURFACES.map(([, label]) => el("th", {}, label)))
|
|
50
|
-
head.append(el("th", {}, "runs"), el("th", {}, "target"))
|
|
103
|
+
const head = el("tr", {}, el("th", {}, "operation"), ...SURFACES.map(([, label]) => el("th", {}, label)))
|
|
104
|
+
head.append(el("th", {}, "runs"), el("th", {}, "target"))
|
|
51
105
|
return el(
|
|
52
106
|
"ui-section",
|
|
53
107
|
{
|
|
@@ -65,9 +119,10 @@ function family(each, prefix) {
|
|
|
65
119
|
{ celled: "", padding: "compact", appearance: "striped", unstackable: "" },
|
|
66
120
|
el("table", {}, el("thead", {}, head), el("tbody", {}, ...(each.rows ?? []).map((row) => operation(each, row))))
|
|
67
121
|
)
|
|
68
|
-
)
|
|
122
|
+
)
|
|
69
123
|
}
|
|
70
|
-
|
|
124
|
+
|
|
125
|
+
/** One operation's row; its notes go under the operation. */
|
|
71
126
|
function operation(each, row) {
|
|
72
127
|
return el(
|
|
73
128
|
"tr",
|
|
@@ -76,73 +131,99 @@ function operation(each, row) {
|
|
|
76
131
|
...SURFACES.map(([key]) => surface(row[key])),
|
|
77
132
|
el("td", {}, ...withCode(row.runs ?? "")),
|
|
78
133
|
el("td", {}, ...withCode(row.target ?? "", roadmapLinks))
|
|
79
|
-
)
|
|
134
|
+
)
|
|
80
135
|
}
|
|
81
|
-
|
|
136
|
+
|
|
137
|
+
/** One surface's cell: its mark, the names, the note. */
|
|
82
138
|
function surface(cell) {
|
|
83
|
-
if (!cell) return el("td")
|
|
84
|
-
const mark = MARKS[cell.mark] ?? { sign: "?", cls: "", words: "" }
|
|
85
|
-
const verdict = mark.cls ? { class: mark.cls, title: mark.words } : { title: mark.words }
|
|
86
|
-
return el("td", verdict, `${mark.sign} `, ...names(cell.names), cell.note ? notes(cell.note) : "")
|
|
139
|
+
if (!cell) return el("td")
|
|
140
|
+
const mark = MARKS[cell.mark] ?? { sign: "?", cls: "", words: "" }
|
|
141
|
+
const verdict = mark.cls ? { class: mark.cls, title: mark.words } : { title: mark.words }
|
|
142
|
+
return el("td", verdict, `${mark.sign} `, ...names(cell.names), cell.note ? notes(cell.note) : "")
|
|
87
143
|
}
|
|
88
|
-
|
|
144
|
+
|
|
145
|
+
/** A note under a cell's text, small and grey. */
|
|
89
146
|
function notes(value) {
|
|
90
|
-
return el("div", { class: "commands-notes" }, ...withCode(value))
|
|
147
|
+
return el("div", { class: "commands-notes" }, ...withCode(value))
|
|
91
148
|
}
|
|
92
|
-
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Names as code, comma-separated, yarn's grouped by script: `ts` (app, cli, core) rather than 3 `<package> ts`s.
|
|
152
|
+
* - a name of two words whose second has no space and isn't a CLI's (`spell ...`) is `<package> <script>`
|
|
153
|
+
*/
|
|
93
154
|
function names(value) {
|
|
94
|
-
if (!value) return []
|
|
95
|
-
const list = Array.isArray(value) ? value : [value]
|
|
96
|
-
const byScript =
|
|
97
|
-
const plain = []
|
|
155
|
+
if (!value) return []
|
|
156
|
+
const list = Array.isArray(value) ? value : [value]
|
|
157
|
+
const byScript = new Map()
|
|
158
|
+
const plain = []
|
|
98
159
|
for (const name of list) {
|
|
99
|
-
const words = name.split(" ")
|
|
160
|
+
const words = name.split(" ")
|
|
100
161
|
if (words.length === 2 && words[0] !== "spell" && !name.startsWith("/")) {
|
|
101
|
-
if (!byScript.has(words[1])) byScript.set(words[1], [])
|
|
102
|
-
byScript.get(words[1]).push(words[0])
|
|
103
|
-
} else plain.push([el("code", {}, name)])
|
|
162
|
+
if (!byScript.has(words[1])) byScript.set(words[1], [])
|
|
163
|
+
byScript.get(words[1]).push(words[0])
|
|
164
|
+
} else plain.push([el("code", {}, name)])
|
|
104
165
|
}
|
|
105
166
|
const grouped = [...byScript].map(([name, packages]) => [
|
|
106
167
|
el("code", {}, name),
|
|
107
168
|
" ",
|
|
108
169
|
el("span", { class: "commands-where" }, `(${packages.join(", ")})`)
|
|
109
|
-
])
|
|
110
|
-
return [...plain, ...grouped].flatMap((parts, i) => i ? [", ", ...parts] : parts)
|
|
170
|
+
])
|
|
171
|
+
return [...plain, ...grouped].flatMap((parts, i) => (i ? [", ", ...parts] : parts))
|
|
111
172
|
}
|
|
112
|
-
|
|
173
|
+
|
|
174
|
+
/** Headline numbers: operations, families, and how many each surface does. */
|
|
113
175
|
function statistics(families) {
|
|
114
|
-
const rows = families.flatMap((each) => each.rows ?? [])
|
|
176
|
+
const rows = families.flatMap((each) => each.rows ?? [])
|
|
115
177
|
return [
|
|
116
178
|
[rows.length, "operations"],
|
|
117
179
|
[does("cli"), "in the CLI"],
|
|
118
180
|
[does("skill"), "in a skill"],
|
|
119
181
|
[does("yarn"), "in yarn"]
|
|
120
|
-
].map(([value, label]) => el("ui-statistic", { value, label }))
|
|
182
|
+
].map(([value, label]) => el("ui-statistic", { value, label }))
|
|
183
|
+
|
|
184
|
+
/** How many rows surface `key` does, under either name. */
|
|
121
185
|
function does(key) {
|
|
122
|
-
return rows.filter((row) => ["same", "other"].includes(row[key]?.mark)).length
|
|
186
|
+
return rows.filter((row) => ["same", "other"].includes(row[key]?.mark)).length
|
|
123
187
|
}
|
|
124
|
-
__name(does, "does");
|
|
125
188
|
}
|
|
126
|
-
|
|
189
|
+
|
|
190
|
+
////////////////
|
|
191
|
+
// ## Filter
|
|
192
|
+
////////////////
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Hide the rows without every typed word, and the families left empty.
|
|
196
|
+
* - reads the value from the events' `detail`: during `ui-input` the element's `value` is still the old one
|
|
197
|
+
*/
|
|
127
198
|
function wireFilter(input) {
|
|
128
|
-
input.addEventListener("ui-typed", apply)
|
|
129
|
-
input.addEventListener("ui-changed", apply)
|
|
199
|
+
input.addEventListener("ui-typed", apply)
|
|
200
|
+
input.addEventListener("ui-changed", apply)
|
|
201
|
+
|
|
202
|
+
/** Apply the filter in `event`. */
|
|
130
203
|
function apply(event) {
|
|
131
|
-
const words = String(event.detail?.value ?? input.value ?? "")
|
|
204
|
+
const words = String(event.detail?.value ?? input.value ?? "")
|
|
205
|
+
.toLowerCase()
|
|
206
|
+
.split(/\s+/)
|
|
207
|
+
.filter(Boolean)
|
|
132
208
|
for (const section of document.querySelectorAll("ui-section[data-commands-family]")) {
|
|
133
|
-
let shown = 0
|
|
209
|
+
let shown = 0
|
|
134
210
|
for (const row of section.querySelectorAll("tbody tr")) {
|
|
135
|
-
const content = row.textContent.toLowerCase()
|
|
136
|
-
row.hidden = !words.every((word) => content.includes(word))
|
|
137
|
-
if (!row.hidden) shown
|
|
211
|
+
const content = row.textContent.toLowerCase()
|
|
212
|
+
row.hidden = !words.every((word) => content.includes(word))
|
|
213
|
+
if (!row.hidden) shown++
|
|
138
214
|
}
|
|
139
|
-
section.hidden = shown === 0
|
|
215
|
+
section.hidden = shown === 0
|
|
140
216
|
}
|
|
141
217
|
}
|
|
142
|
-
__name(apply, "apply");
|
|
143
218
|
}
|
|
144
|
-
|
|
219
|
+
|
|
220
|
+
////////////////
|
|
221
|
+
// ## Text
|
|
222
|
+
////////////////
|
|
223
|
+
|
|
224
|
+
/** `part` with each roadmap id in parens, `(R3)`, linked to its row, `#r3`. */
|
|
145
225
|
function roadmapLinks(part) {
|
|
146
|
-
return part
|
|
226
|
+
return part
|
|
227
|
+
.split(/\((R\d+)\)/)
|
|
228
|
+
.flatMap((piece, i) => (i % 2 ? ["(", el("a", { href: `#${piece.toLowerCase()}` }, piece), ")"] : [piece]))
|
|
147
229
|
}
|
|
148
|
-
__name(roadmapLinks, "roadmapLinks");
|