diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..3b66287 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/README.md b/README.md index 1a6992e..b3196ac 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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 ` + + diff --git a/src/pages/playground/about.astro b/src/pages/playground/about.astro new file mode 100644 index 0000000..6a32bb5 --- /dev/null +++ b/src/pages/playground/about.astro @@ -0,0 +1,72 @@ +--- +const BASE = import.meta.env.BASE_URL; +--- + + + + + + + About - HOCON Playground - AbstractMenus + + + + +
+
+ + AbstractMenus + Playground + + +
+ +
+

HOCON Playground

+

Browser-side editor for AbstractMenus menu configs. No server, no install. Edit, validate, share.

+ +

Two modes

+ + +

What it does

+ + +

Limitations (MVP)

+ + +

Open it

+

+ Open editor + Start tutorial +

+
+
+ + + + diff --git a/src/styles/playground.css b/src/styles/playground.css new file mode 100644 index 0000000..0b85f2f --- /dev/null +++ b/src/styles/playground.css @@ -0,0 +1,989 @@ +/* Standalone playground page styles. Scoped via the page