Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
3d408d1
feat(playground): add CodeMirror 6 deps and vitest setup
BrainRTP May 1, 2026
34613c6
feat(playground): add /playground/ route skeleton
BrainRTP May 1, 2026
2947cf5
feat(playground): vanilla-TS editor + panels modules with CM6 init
BrainRTP May 1, 2026
32957d7
feat(playground): two-pane layout, theme tokens, mobile stack
BrainRTP May 1, 2026
e4a178d
feat(playground): resizable pane divider with drag + clamping
BrainRTP May 1, 2026
5955217
feat(playground): add @lezer/highlight and @codemirror/autocomplete
BrainRTP May 2, 2026
c70833e
feat(playground): HOCON tokenizer with comments, strings, keys, numbe…
BrainRTP May 2, 2026
a6b85c9
feat(playground): HOCON StreamLanguage with HighlightStyle and themed…
BrainRTP May 2, 2026
6254559
feat(playground): 10 HOCON snippets via autocompletion source
BrainRTP May 2, 2026
cc0c6c7
feat(playground): add @codemirror/lint
BrainRTP May 2, 2026
9d18cdc
feat(playground): tokenizeText wrapper with multi-line offsets
BrainRTP May 2, 2026
2de1085
feat(playground): recursive-descent HOCON parser with diagnostics
BrainRTP May 2, 2026
97d535d
feat(playground): substitution resolver with cycle detection and warn…
BrainRTP May 2, 2026
0adf7a2
feat(playground): CM6 linter extension wrapping HOCON parse+resolve
BrainRTP May 2, 2026
0080cb0
feat(playground): ValidationPanel renders diagnostics with click-to-jump
BrainRTP May 2, 2026
5468676
feat(playground): ResolvedJsonPanel renders JSON tree with copy button
BrainRTP May 2, 2026
9cfe9e5
feat(playground): wire debounced parse pipeline into editor + panels
BrainRTP May 2, 2026
9a7deae
feat(playground): catalog types + menu/item/click key definitions
BrainRTP May 2, 2026
ffb5f90
feat(playground): action/rule/activator catalogs from docs + examples
BrainRTP May 2, 2026
23241f1
feat(playground): materials/sounds subsets + catalog aggregator
BrainRTP May 2, 2026
2096775
feat(playground): scope detector with bracket-balance walk
BrainRTP May 2, 2026
33a2049
feat(playground): scope-aware completion source with enum value detec…
BrainRTP May 2, 2026
17041bd
feat(playground): hover-docs tooltip extension reading catalog
BrainRTP May 2, 2026
a261db8
feat(playground): formatHocon line-by-line indenter
BrainRTP May 2, 2026
19e5c61
feat(playground): wire catalog completions, hover docs, format command
BrainRTP May 2, 2026
b748ba0
feat(playground): add pako 2.x for share-url deflate
BrainRTP May 2, 2026
b174147
feat(playground): URL-safe deflate-base64 share encode/decode
BrainRTP May 2, 2026
26abed6
feat(playground): LocalStorage history with FIFO 5 + identity-skip
BrainRTP May 2, 2026
ddca4eb
feat(playground): HistoryDropdown renders entries with relative times…
BrainRTP May 2, 2026
79bb6a2
feat(playground): Toast + history-dropdown HTML scaffolding + styles
BrainRTP May 2, 2026
7e65d62
feat(playground): wire share button, history dropdown, hash-on-load
BrainRTP May 2, 2026
e7af7dd
feat(playground): tutorial types, lessons loader, mini-markdown + 2 s…
BrainRTP May 2, 2026
c7cc5b5
feat(playground): tutorial engine - runCheck + progress storage + hel…
BrainRTP May 2, 2026
e257727
feat(playground): TutorialPanel with progressive hints + Next gate
BrainRTP May 2, 2026
469d9ec
feat(playground): wire tutorial mode with URL params and progress
BrainRTP May 2, 2026
13345b7
feat(playground): tutorial panel styles
BrainRTP May 2, 2026
1d95757
feat(playground): add Playground sidebar entry with beta badge
BrainRTP May 2, 2026
2e2ac6d
feat(playground): add /playground/about/ page with overview + CTAs
BrainRTP May 2, 2026
45bd7ea
ci(playground): add vitest + astro-build workflow
BrainRTP May 2, 2026
e018455
docs(playground): mention playground + npm test in README
BrainRTP May 2, 2026
52ea9d1
feat(playground): smart Enter, closeBrackets, dark-themed CM6 ui, jso…
BrainRTP May 2, 2026
a36b88c
feat(playground): JSON syntax highlighting in ResolvedJsonPanel
BrainRTP May 2, 2026
be270bf
feat(playground): scope hint in footer + auto-open autocomplete on { …
BrainRTP May 2, 2026
14a66b0
feat(playground): per-key sub-scopes (slot/enchantments/firework/effe…
BrainRTP May 2, 2026
f778d5d
feat(playground): warn on unknown keys, skip custom blocks (unknown s…
BrainRTP May 2, 2026
08e9bb0
feat(playground): separate Warnings tab + yellow squiggle + tab counters
BrainRTP May 2, 2026
1bbaaf1
feat(playground): inline color swatches for color = #hex / [r,g,b] wi…
BrainRTP May 2, 2026
70c4716
feat(playground): always-on color swatch with hex priority + checker …
BrainRTP May 2, 2026
0143382
feat(playground): error on key:value or stray tokens in array, warn o…
BrainRTP May 2, 2026
b2c08e2
fix(playground): wire completionKeymap (Ctrl+Space), correct hint tex…
BrainRTP May 2, 2026
1d77b05
feat(playground): array-context scope offers only skeleton snippet (i…
BrainRTP May 2, 2026
caa67a6
feat(playground): toggle for warning squiggles in editor (Warnings ta…
BrainRTP May 2, 2026
42b5de6
fix(playground): warning toggle dispatches diagnostics immediately, d…
BrainRTP May 2, 2026
0694314
refactor(playground): validate lessons at load + sanity test for ship…
BrainRTP May 2, 2026
928d94b
refactor(playground): single stripStringsAndComments util used by 4 s…
BrainRTP May 2, 2026
8ee6221
test(playground): color match ignored inside strings/comments
BrainRTP May 2, 2026
f723270
refactor(playground): warning toggle via per-editor Facet/StateField,…
BrainRTP May 2, 2026
55d284a
refactor(playground): extract PlaygroundApp class, main.ts becomes 14…
BrainRTP May 2, 2026
e7fde86
feat(playground): scope-ranges API for cursor-position queries from AST
BrainRTP May 2, 2026
c222e88
test+fix(playground): quoted dotted keys, triple-quoted parser, scope…
BrainRTP May 2, 2026
fd32d71
refactor(playground): drop tutorialMode flag, lazy import, switchMode…
BrainRTP May 2, 2026
b4ca132
refactor(playground): scope.ts uses shared stripStringsAndComments, r…
BrainRTP May 2, 2026
7ec548d
refactor(playground): single childScopeOf/arrayPositionScope source o…
BrainRTP May 2, 2026
845411f
refactor(playground): decompose PlaygroundApp - extract Tutorial/Hist…
BrainRTP May 2, 2026
182605d
fix(playground): runtime rewrite of sidebar Playground link to curren…
BrainRTP May 2, 2026
cd43004
fix(playground): declare facet before StateField (TDZ in module init …
BrainRTP May 2, 2026
2c9d49c
fix(playground): list-of-objects warning only for keys with childrenS…
BrainRTP May 2, 2026
1088892
feat(playground): i18n with en + ru, community-extensible registry
BrainRTP May 2, 2026
dff7bae
feat(playground): per-mode drafts + Reset button with confirmation
BrainRTP May 2, 2026
95393a8
feat(playground): tutorial nav (Prev / All lessons / counter) + topic…
BrainRTP May 2, 2026
b9e27bc
feat(playground): i18n diagnostic messages via stable codes
BrainRTP May 2, 2026
909dc7e
fix(config): include base in starlight favicon path
BrainRTP May 3, 2026
b63fcdc
feat(playground): shape-check (assert against resolved JSON)
BrainRTP May 3, 2026
9b960e6
feat(playground): basics batch 1 - strings, values, lists/objects
BrainRTP May 3, 2026
b5e52c4
fix(playground): handle stale lesson id in TutorialController.enter()
BrainRTP May 3, 2026
49b032a
feat(playground): basics rework - separators + dotted keys
BrainRTP May 3, 2026
5f3ebca
feat(playground): basics batch 2 - inline + object variables
BrainRTP May 3, 2026
ead3f0b
feat(playground): batch 3 - menu topic (size, items, slots, name+mate…
BrainRTP May 3, 2026
e1cfce2
feat(playground): batch 4 - items topic (lore, enchantments, flags, c…
BrainRTP May 3, 2026
3284d0e
feat(playground): batch 5 - actions topic (message, command, multi, c…
BrainRTP May 3, 2026
6c25ff3
feat(hocon): duplicate-key object merge per HOCON spec
BrainRTP May 3, 2026
110bee2
feat(hocon): array-append `+=` operator support
BrainRTP May 3, 2026
aeb73db
feat(hocon): inline spread `${ref}` inside object literals
BrainRTP May 3, 2026
7858879
feat(playground): batch 6 - templates pt 1 (include, +=, object-merge)
BrainRTP May 3, 2026
ed4db86
feat(playground): batch 7 - templates pt 2 (defaults-merge, optional,…
BrainRTP May 3, 2026
4d7a1a3
feat(playground): batch 8 - conditions topic (rules + bindings)
BrainRTP May 3, 2026
71f1c6e
feat(playground): markdown link support `[text](url)` in lesson intros
BrainRTP May 3, 2026
31222e0
docs(playground): clarify duration format + link to HOCON spec in 03-…
BrainRTP May 3, 2026
77c57eb
style(playground): tutorial link color - sky blue, calmer than browse…
BrainRTP May 3, 2026
3de2274
fix(playground): render lesson goal text through inline markdown
BrainRTP May 3, 2026
ec30a3e
fix(playground): use catalog-known menu-root keys in lessons 03 + 04
BrainRTP May 3, 2026
a5623b6
feat(playground): fenced code block support in lesson markdown
BrainRTP May 3, 2026
1ac3326
fix(playground): lesson 06 puts `name` inside items, not at menu-root
BrainRTP May 3, 2026
0701641
feat(playground): i18n catalog descriptions in autocomplete + hover
BrainRTP May 3, 2026
dc3a429
fix(playground): lesson 07 puts `click` inside items, uses real action
BrainRTP May 3, 2026
7e78caf
fix(playground): swap synthetic keys in lessons 02 + 24 for catalog-k…
BrainRTP May 3, 2026
888c325
feat(catalog): recognize `defaults` as a menu-root user-template key
BrainRTP May 3, 2026
4c2d40a
feat(playground): HOCON syntax highlight in fenced code blocks
BrainRTP May 3, 2026
f19c947
style(playground): one-key-per-line for HOCON objects with >=2 entries
BrainRTP May 3, 2026
85b1a91
fix(playground): name the actual variable in lesson 07's prose
BrainRTP May 3, 2026
3819ce2
refactor(playground): renumber lessons from 0-based to 1-based IDs
BrainRTP May 3, 2026
edc6069
feat(playground): markdown image support + numbered rows in lessons p…
BrainRTP May 3, 2026
6aef809
feat(playground): wiki: link scheme - lesson markdown deep-links to docs
BrainRTP May 4, 2026
6d534bc
feat(playground): expand wiki link coverage to remaining lessons
BrainRTP May 4, 2026
1df820f
feat(playground): more specific wiki anchors + orphan-ref guard test
BrainRTP May 4, 2026
c780481
Fix
BrainRTP May 4, 2026
b833b52
fix(playground): wiki-links resolveWikiUrl typecheck via keyof WikiEntry
BrainRTP May 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
vitest:
name: vitest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5

- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm

- run: npm ci

- run: npm test

build:
name: astro build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5

- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm

- run: npm ci

- run: npm run build
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ npm install
npm run dev # http://localhost:4321/docs/
npm run build # static output in ./dist
npm run preview # serve ./dist locally
npm test # vitest unit tests for the playground
```

Requires Node 20+ (CI runs Node 22).
Expand Down Expand Up @@ -46,6 +47,16 @@ astro.config.mjs Astro + Starlight configuration (sidebar, locales, the
- English content lives at `/docs/en/...`.
- Russian content lives at `/docs/ru/...`. Pages without a Russian translation fall back to English with a "translate this page" notice.

## Playground

`/docs/playground/` is a browser-side editor for HOCON menu configs (CodeMirror 6 + custom HOCON parser, no backend). It lives outside the Starlight content layout so it can use the full viewport.

- Source: `src/lib/playground/`
- Pages: `src/pages/playground.astro` (editor), `src/pages/playground/about.astro` (overview)
- Styles: `src/styles/playground.css` (scoped via `<style is:global>` on the page; intentionally not registered in `astro.config.mjs > customCss` so the rest of the docs site is unaffected)
- Tests: `npm test` (vitest + happy-dom)
- Extend autocomplete data in `src/lib/playground/catalog/`, add lessons in `src/lib/playground/tutorial/lessons/`.

## Image paths

`base` is set to `/docs/` because the site lives at `https://abstractmenus.github.io/docs/`. Astro does not auto-prefix `base` for raw URLs inside Markdown. Reference public assets with the base included:
Expand Down
30 changes: 29 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export default defineConfig({
starlight({
title: "AbstractMenus",
description: "Documentation for the AbstractMenus Paper/Folia GUI plugin.",
favicon: "/favicon.ico",
// Astro 6 requires public-asset URLs to include the configured base.
// Starlight passes this through verbatim into <link rel="icon" href=...>.
favicon: BASE + "favicon.ico",
logo: { src: "./src/assets/logo.png", alt: "AbstractMenus" },
social: [
{ icon: "discord", label: "Discord", href: "https://discord.gg/4VGP3Gv" },
Expand Down Expand Up @@ -188,6 +190,15 @@ export default defineConfig({
},
],
},
{
label: 'Playground',
translations: { ru: 'Песочница' },
// Full URL because Starlight rewrites relative links per locale
// (would otherwise become /docs/en/playground/, which 404s).
link: SITE + BASE + 'playground/',
badge: { text: 'beta', variant: 'note' },
attrs: { 'data-playground-link': 'true' },
},
{
slug: "changelog",
attrs: { "data-changelog-link": "true" },
Expand Down Expand Up @@ -257,6 +268,23 @@ export default defineConfig({
"})();",
].join(""),
},
{
// Sidebar's Playground entry has to be a full URL because Starlight
// would otherwise rewrite a relative path through the locale segment
// and 404. The static URL is a production fallback; this script
// rewrites it to the current origin on every load so the link works
// identically in dev (localhost), preview, and production.
tag: "script",
content: [
"(function(){",
"function fix(){",
"var as=document.querySelectorAll('a[data-playground-link]');",
"for(var i=0;i<as.length;i++){as[i].href=window.location.origin+'" + BASE + "playground/';}",
"}",
"if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',fix);}else{fix();}",
"})();",
].join(""),
},
],
}),
mdx(),
Expand Down
Loading
Loading