Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 62 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
filter: blob:none
- uses: actions/setup-node@v6
with:
node-version: "24"
- uses: nubjs/setup-nub@v0
with:
nub-version: ^0.9.0
cache: true
cache-dependency-path: |
nub.lock
package.json
- uses: moonrepo/setup-toolchain@v0
with:
moon-version: "2.5.5"
- run: nub install --frozen-lockfile
- run: nubx playwright install --with-deps chromium
- name: Check affected tasks
id: ci
run: moon ci
- uses: moonrepo/run-report-action@v1
if: "!cancelled() && steps.ci.outcome != 'skipped'"
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
skip-comment: true
- uses: actions/upload-artifact@v7
if: always()
with:
name: moon-reports-${{ github.run_attempt }}
path: |
.moon/cache/ciReport.json
.moon/cache/runReport.json
include-hidden-files: true
if-no-files-found: ignore
retention-days: 14
- uses: actions/upload-artifact@v7
if: always()
with:
name: test-results-${{ github.run_attempt }}
path: test-results/
if-no-files-found: ignore
retention-days: 1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.task/
.moon/cache/
node_modules/
dist/
.npmrc
Expand Down
6 changes: 6 additions & 0 deletions .moon/tasks/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
implicitInputs:
- moon.yml
- package.json
- nub.lock
- /.moon/**/*.yml
- /.github/workflows/ci.yaml
11 changes: 11 additions & 0 deletions .moon/workspace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
defaultProject: solid-static
projects:
solid-static: .
versionConstraint: ">=2.5.4 <3.0.0"
vcs:
client: git
defaultBranch: master
pipeline:
installDependencies: false
syncProjects: false
syncWorkspace: false
3 changes: 3 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json"
}
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

## Verification

- after significant changes run `task check`
- after significant changes run `moon run solid-static:check`

## Releases

- agent can do `task publish` if human asks for it explicitly. Verbs: "publish"/"release"
- agent can do `moon run solid-static:publish` if human asks for it explicitly. Verbs: "publish"/"release"
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,29 @@ staticSite({

Add `.tsx`, `.md`, or `.mdx` pages under `src/pages`. The directory structure determines each page's route. Markdown pages must declare a SolidJS layout in their frontmatter.

### Markdown headings and tables of contents

`createHtmlMarkdownProcessor()` assigns stable, GitHub-style IDs to headings.
Repeated headings receive unique suffixes, with numbering scoped to each document.
Markdown and MDX pages using `solidMarkdown()` also receive heading IDs.

Rendered content collection entries expose `rendered.html` and
`rendered.headings`. Each heading contains `depth` (1–6), `slug` (the HTML ID),
and plain `text`. Build a table of contents from this metadata instead of parsing
the HTML a second time:

```tsx
<nav aria-label="On this page">
<For each={entry.rendered.headings.filter(heading => heading.depth === 2)}>
{heading => <a href={`#${heading.slug}`}>{heading.text}</a>}
</For>
</nav>
<article innerHTML={entry.rendered.html} />
```

Custom Markdown processors can provide the same metadata through their result's
`data.headings`. Results without heading metadata produce an empty headings list.

### Client islands

Import a self-mounting browser entry with the `?island` query, then reference the returned URL from a module script. The page remains static HTML; only the named entry and its imports are compiled for the browser.
Expand Down Expand Up @@ -212,6 +235,33 @@ export default function Page() {

When `src` contains image metadata, specifying only `width` or `height` infers the other dimension while preserving the aspect ratio. The returned promise resolves to a `GetImageResult` containing the generated `src`, inferred `attributes`, normalized `options`, original `rawOptions`, and an Astro-compatible `srcSet` object. Generated URLs work in both the Vite development server and production builds. `getImage()` throws if called in the browser.

## Development and CI

Install Node.js 24, Nub 0.9, and Moon 2.5.5, then run:

```sh
nub install --frozen-lockfile
nubx playwright install chromium
moon run solid-static:check
```

`moon.yml` owns the build, lint, typecheck, unit, and browser tasks. Tests depend
on the package build because Vite fixtures resolve the package's exported runtime
from `dist`. A clean checkout does not need prebuilt artifacts.

The standalone GitHub workflow follows [Moon's CI guide](https://moonrepo.dev/docs/guides/ci):
full Git history, dependency installation, then `moon ci` to select affected
tasks and run their dependencies. It uploads native reports and keeps
publication out of CI. There is no separate CI-only task graph or persisted
Moon workspace cache.

The same project tasks can be registered as `solid-static` in a parent Moon
workspace. Consumers should depend on `solid-static:build` and use a workspace
package dependency. The parent owns dependency and browser installation; the
submodule's standalone workflow does not run inside the parent's workflow.

To publish an explicitly approved release, use `moon run solid-static:publish`.

## Documentation

Dedicated documentation is not available yet. For the concepts and intended behavior, see the corresponding Astro guides:
Expand Down
91 changes: 0 additions & 91 deletions Taskfile.yaml

This file was deleted.

79 changes: 79 additions & 0 deletions moon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
toolchains:
default: system
tasks:
lint:
command: nubx oxlint --config .oxlintrc.json src e2e playwright.config.ts
inputs:
- .oxlintrc.json
- src/**/*
- e2e/**/*
- playwright.config.ts
- package.json
- /nub.lock
build:
command: nubx tsc -p tsconfig.build.json
inputs:
- src/**/*
- package.json
- tsconfig.json
- tsconfig.build.json
- /nub.lock
outputs:
- dist/**/*
typecheck:
command: nubx tsc
inputs:
- src/**/*
- package.json
- tsconfig.json
- /nub.lock
typecheck-playwright:
command: nubx tsc -p tsconfig.playwright.json
inputs:
- src/**/*
- e2e/**/*
- package.json
- playwright.config.ts
- tsconfig.json
- tsconfig.playwright.json
- /nub.lock
test-unit:
command: nubx vitest run
deps:
- ~:build
inputs:
- src/**/*
- package.json
- tsconfig.json
- vitest.config.ts
- /nub.lock
test-e2e:
command: nubx playwright test
deps:
- ~:build
inputs:
- src/**/*
- e2e/**/*
- playwright.config.ts
- tsconfig.playwright.json
- package.json
- /nub.lock
check:
deps:
- ~:lint
- ~:typecheck
- ~:typecheck-playwright
- ~:test-unit
- ~:test-e2e
options:
runInCI: false
inputs: []
publish:
command: nub publish --access public
deps:
- ~:check
- ~:build
options:
cache: false
runInCI: false
inputs: []
Loading
Loading