diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 00f10c4..55300e0 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,11 +1,22 @@
name: Docs
-# Builds the documentation site with DocFX and publishes it to GitHub Pages. One workflow, two sites:
-# - in StellarEngine-Core: the site of the core (docfx.json): Docs/, the API reference, the schemas, the installer;
-# - in the mirror (StellarEngine-Mono), recognized by the .orchestra file scripts/mirror.ps1 puts at its root:
-# the site of the orchestra (scripts/orchestra-site.ps1), the core and every module in one site.
-# Pull requests and manual runs on other branches only build; the site is deployed from master only.
-# Repository setting required once: Settings -> Pages -> Source = "GitHub Actions".
+# Publishes the documentation of this repository to GitHub Pages for the Prometheus site (the team site).
+# GitHub Pages is only the storage of the site: static files (the installer, the schemas), the documentation as data
+# (bundle/) and a small embed that redirects to the site when the site is up.
+#
+# This file is a thin wrapper and does not need updates: the steps (ci.py, the bundle builder, the embed) are
+# downloaded from the site on every run (/docs-kit.zip), so they are always the same version as the site.
+# What to build is described by the repository itself in prometheus.json (format prometheus-repo/1, see the DOCS
+# page of the site); without it: Docs/ and the API of the projects in docfx.json.
+# If the site is down, the static files and a page that leads to the site are published; the next run fixes the rest.
+#
+# Repository settings:
+# Settings -> Pages -> Source = "GitHub Actions" (once)
+# Variables (optional): PROMETHEUS_SITE (https://notagood.org by default),
+# PROMETHEUS_PROJECT, PROMETHEUS_TITLE (override prometheus.json)
+# Secrets (optional): PROMETHEUS_SYNC_KEY an API key of the site with the "sync" scope: the site learns about
+# the new build at once instead of on its next check
+# Pull requests and manual runs on other branches only build; Pages is deployed from master only.
on:
push:
@@ -24,49 +35,88 @@ env:
DOCFX_VERSION: '2.81.0'
DOTNET_NOLOGO: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
+ PROMETHEUS_SITE: ${{ vars.PROMETHEUS_SITE || 'https://notagood.org' }}
+ PROMETHEUS_PROJECT: ${{ vars.PROMETHEUS_PROJECT }}
+ PROMETHEUS_TITLE: ${{ vars.PROMETHEUS_TITLE }}
+ OUT: artifacts/pages
jobs:
build:
- name: Build site
- runs-on: ubuntu-latest
+ name: Build
+ runs-on: ubuntu-latest # pwsh, python3 and bash are there: "prepare" scripts may use any of them
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET
+ if: hashFiles('global.json') != ''
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- # Installed outside the checkout so the repository NuGet.config (local "packages" feed) is not involved.
+ - name: Setup .NET (no global.json)
+ if: hashFiles('global.json') == ''
+ uses: actions/setup-dotnet@v5
+ with:
+ dotnet-version: '9.0.x'
+
+ # Installed outside the checkout so a repository NuGet.config (a local feed) is not involved.
- name: Install DocFX
working-directory: ${{ runner.temp }}
run: dotnet tool install docfx --version "$DOCFX_VERSION" --tool-path "$RUNNER_TEMP/docfx"
- - name: Choose the site
- id: site
- shell: pwsh
+ - name: Prometheus
+ id: prometheus
+ continue-on-error: true
run: |
- # The local feed of an installation: empty here, but NuGet wants the folder it names to exist
- New-Item -ItemType Directory -Force packages | Out-Null
- if (Test-Path .orchestra) {
- ./scripts/orchestra-site.ps1
- "config=docfx.orchestra.json" >> $env:GITHUB_OUTPUT
- "output=artifacts/docs/orchestra-site" >> $env:GITHUB_OUTPUT
- } else {
- "config=docfx.json" >> $env:GITHUB_OUTPUT
- "output=artifacts/docs/site" >> $env:GITHUB_OUTPUT
- }
+ set -euo pipefail
+ # NuGet wants the local feed folder of an installation to exist, even empty
+ mkdir -p packages
+ curl -fsSL --retry 2 "$PROMETHEUS_SITE/docs-kit.zip" -o "$RUNNER_TEMP/kit.zip"
+ unzip -q -o "$RUNNER_TEMP/kit.zip" -d "$RUNNER_TEMP/kit"
+ python3 -m pip install --quiet pyyaml
+ python3 "$RUNNER_TEMP/kit/ci.py" --out "$OUT" --docfx "$RUNNER_TEMP/docfx/docfx"
- # metadata (the API reference from the managed projects), then build
- - name: Build documentation
- run: '"$RUNNER_TEMP/docfx/docfx" "${{ steps.site.outputs.config }}" --warningsAsErrors'
+ # The site is down or the build failed: publish the static files and a page that leads to the site.
+ # Self-contained on purpose (no kit): the installer and the schemas keep their addresses whatever happens.
+ - name: Fallback
+ if: steps.prometheus.outcome == 'failure'
+ run: |
+ echo "::warning title=Prometheus::The documentation was not built (is $PROMETHEUS_SITE up?); publishing the static files only"
+ mkdir -p "$OUT" && touch "$OUT/.nojekyll"
+ python3 - <<'PY'
+ import glob, html, json, os, re, shutil
+ out = os.environ["OUT"]
+ cfg = json.load(open("prometheus.json", encoding="utf-8-sig")) if os.path.isfile("prometheus.json") else {}
+ static = cfg.get("static") or next((a.get("docfx") if isinstance(a, dict) else a for a in cfg.get("api") or []), None) \
+ or ("docfx.json" if os.path.isfile("docfx.json") else None)
+ for config in ([static] if isinstance(static, str) else static or []):
+ if not os.path.isfile(config):
+ continue
+ base = os.path.dirname(os.path.abspath(config))
+ for r in json.load(open(config, encoding="utf-8-sig")).get("build", {}).get("resource", []):
+ src, dest = os.path.join(base, r.get("src", "")), os.path.join(out, r.get("dest", ""))
+ for pattern in r.get("files", []):
+ for f in glob.glob(os.path.join(src, pattern), recursive=True):
+ if os.path.isfile(f):
+ t = os.path.join(dest, os.path.relpath(f, src))
+ os.makedirs(os.path.dirname(t), exist_ok=True)
+ shutil.copy2(f, t)
+ repo = os.environ.get("GITHUB_REPOSITORY", "").rsplit("/", 1)[-1]
+ project = os.environ.get("PROMETHEUS_PROJECT") or cfg.get("project") or re.sub(r"[^a-z0-9]+", "-", repo.lower()).strip("-")
+ url = html.escape(f"{os.environ['PROMETHEUS_SITE'].rstrip('/')}/docs/{project}")
+ title = html.escape(os.environ.get("PROMETHEUS_TITLE") or cfg.get("title") or repo)
+ with open(os.path.join(out, "index.html"), "w", encoding="utf-8") as f:
+ f.write(f'
{title}'
+ f''
+ f'{title} documentation
')
+ PY
- name: Upload Pages artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v5
with:
- path: ${{ steps.site.outputs.output }}
+ path: ${{ env.OUT }}
deploy:
name: Deploy to GitHub Pages
@@ -87,3 +137,13 @@ jobs:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v5
+
+ # The site would notice the new bundle on its next check anyway; this makes it immediate.
+ - name: Nudge the site
+ continue-on-error: true
+ env:
+ KEY: ${{ secrets.PROMETHEUS_SYNC_KEY }}
+ run: |
+ if [ -z "$KEY" ]; then echo "::notice::PROMETHEUS_SYNC_KEY is not set: the site picks the docs up on its next check"; exit 0; fi
+ sleep 30 # Pages needs a moment to serve the new files
+ curl -fsS -X POST -H "Authorization: Bearer $KEY" "$PROMETHEUS_SITE/api/v1/sync"
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 6be51fd..c3f2d00 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -68,7 +68,7 @@ jobs:
shell: pwsh
run: |
New-Item -ItemType Directory -Force packages | Out-Null
- ./scripts/build.ps1 -Configuration Debug -SkipTests -Install -NoUserRegistration
+ ./scripts/build.ps1 -Configuration Debug -SkipTests -Install -NoUserRegistration -SkipModules
- name: Build and test the module
if: env.IS_CORE != 'true'
diff --git a/.gitignore b/.gitignore
index 65937a5..33ae65d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,8 +16,6 @@
/StellarEngine.*.slnf
# The bare repository scripts/mirror.ps1 builds the snapshots of the orchestra in
/.mirror/
-# The DocFX project of the orchestra site, generated by scripts/orchestra-site.ps1
-/docfx.orchestra.json
# ---- Build output ----
[Bb]in/
diff --git a/Docs/Architecture/NativeAbi.md b/Docs/Architecture/NativeAbi.md
index 3cae2f5..3cd5611 100644
--- a/Docs/Architecture/NativeAbi.md
+++ b/Docs/Architecture/NativeAbi.md
@@ -230,7 +230,7 @@ The native core follows the handle and umbrella rules of the Kernel:
```
A native project of a module gets the include directories, `STELLAR_KERNEL_STATIC` and the import libraries from
-`Shared/Build/Stellar.Native.Module.props` (see [Modules](https://quantumdevteam.github.io/StellarEngine-Mono/guide/Modules.html)); the toolchain itself comes from
+`Shared/Build/Stellar.Native.Module.props` (see [Modules](../Engine/Modules.md)); the toolchain itself comes from
`Shared/Build/Stellar.Native.props`, shared with the core. Inside a module, paths start at the root of the module.
Headers of the C++/CLI wrapper end with `.cli.h`: MSVC also searches the folders of the open includes, and a wrapper
diff --git a/Docs/Architecture/Sdk.md b/Docs/Architecture/Sdk.md
index bbc0796..eb60aac 100644
--- a/Docs/Architecture/Sdk.md
+++ b/Docs/Architecture/Sdk.md
@@ -33,7 +33,7 @@ The SDK itself comes from the local feed through `NuGet.config`. `stellar projec
generate both files; a project under the root of the installation also finds the `NuGet.config` of the root.
A module project needs even less: it is nearly empty, and the SDK takes its kind, version and dependencies from its
-descriptor. See [Modules](https://quantumdevteam.github.io/StellarEngine-Mono/guide/Modules.html). Every property: [Sdk.Properties](../Reference/Sdk.Properties.md).
+descriptor. See [Modules](../Engine/Modules.md). Every property: [Sdk.Properties](../Reference/Sdk.Properties.md).
## Kinds of projects
diff --git a/Docs/Architecture/Tools.md b/Docs/Architecture/Tools.md
index 9dd801d..6643782 100644
--- a/Docs/Architecture/Tools.md
+++ b/Docs/Architecture/Tools.md
@@ -83,7 +83,7 @@ Later additions win, and anything no compiler claims is packed as is by `RawReso
| `stellar uninstall [path]` | Remove an installation: unregister it, drop its packages from the NuGet cache, remove what the installer made; `--all`, `--artifacts`, `--dry-run` |
| `stellar modules list` | Show the manifest in load order |
| `stellar modules sync` | Find the modules, apply the manifest, check the rules, regenerate the catalog |
-| `stellar modules new`, `templates`, `add`, `enable`, `disable`, `reset`, `build` | See [Modules](https://quantumdevteam.github.io/StellarEngine-Mono/guide/Modules.html) |
+| `stellar modules new`, `templates`, `add`, `enable`, `disable`, `reset`, `build` | See [Modules](../Engine/Modules.md) |
| `stellar solution sync [directory]` | Write the `.sln` again: the projects of the solution, the engine when `"Engine"` is `Sources` |
| `stellar run [target]` | Build and run a game or a tool of the solution, or several at once; see [`.stellar.solution`](../Formats/SolutionFile.md) |
| `stellar project new ` | Create a solution and its project in a folder of its own; `--flat` for the project alone |
diff --git a/Docs/Engine/Architecture.md b/Docs/Engine/Architecture.md
index ebdad9a..6643a4b 100644
--- a/Docs/Engine/Architecture.md
+++ b/Docs/Engine/Architecture.md
@@ -4,7 +4,7 @@
> It is intended to explain *how the system is structured* and *why it is structured this way*,
> without going into low-level implementation details.
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
---
diff --git a/Docs/Engine/DesignPhilosophy.md b/Docs/Engine/DesignPhilosophy.md
index de4652b..1e13e39 100644
--- a/Docs/Engine/DesignPhilosophy.md
+++ b/Docs/Engine/DesignPhilosophy.md
@@ -4,7 +4,7 @@
> It explains *why* the project exists, *how decisions are made*,
> and *what kind of system StellarEngine intentionally aims to be*.
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
---
diff --git a/Docs/Engine/Documentation.md b/Docs/Engine/Documentation.md
new file mode 100644
index 0000000..a46389f
--- /dev/null
+++ b/Docs/Engine/Documentation.md
@@ -0,0 +1,103 @@
+# Writing the documentation
+
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
+
+The documentation of the engine is Markdown in the repositories, next to the code it describes. The docs site reads
+it; nothing about it is edited on the site.
+
+## Where it is read
+
+Every repository publishes a bundle of its documentation to its GitHub Pages: its `Docs/` and the API reference made
+from the XML comments of its code. The docs site shows the bundles, one project each:
+
+| Project | Repository | What |
+|---|---|---|
+| `stellar-engine` | StellarEngine-Mono, the mirror | the whole engine: the guide (`Docs/Engine` of the core), the core with its API, every module and tool |
+| `stellar-core` | StellarEngine-Core | the core alone: `Docs/` without `Docs/Engine`, its API |
+| a module or a tool | its own repository | its `Docs/` |
+
+The address of the docs site is set once, in `StellarDocsUri` of `Shared/Build/Stellar.Versions.props`, with the
+projects of the core and of the engine next to it. The tools take them from there; Markdown never names the site.
+GitHub Pages also keeps the installer and the JSON schemas at the addresses of `StellarSiteUri`.
+
+## What a repository publishes
+
+`prometheus.json` at the root of a repository says what goes into its bundle: the project, its title, where its
+version is, the folders of articles, the API, the static files, and where links out of the bundle go.
+
+```json
+{
+ "format": "prometheus-repo/1",
+ "project": "stellar-filesystem",
+ "title": "Stellar.FileSystem",
+ "version": { "file": "Stellar.FileSystem.stellar.module", "regex": "\"Version\"\\s*:\\s*\"([^\"]+)\"" },
+ "docs": [ { "path": "Docs" } ],
+ "static": "docfx.json"
+}
+```
+
+A module gets one from `stellar modules new`. Its `project` is a guess made from the id of the module: it must be the
+name of the card of the module on the docs site.
+
+The core does not write its description by hand. Its `prometheus.json` names `scripts/prometheus.ps1`, which the docs
+workflow runs first: it writes the description of the core, or, in the mirror, that of the whole engine, with every
+module and tool that has a `Docs/toc.yml`. Only this script knows the layout of the engine. To look at what it
+writes:
+
+```powershell
+powershell -File scripts/prometheus.ps1 -Print
+```
+
+The format of `prometheus.json` belongs to the docs site, which documents every field.
+
+## Links
+
+| To | Write | Example |
+|---|---|---|
+| a page of the same bundle | a relative path to the `.md` file | `[Modules](Modules.md)` |
+| a page of the same repository, published by another project | a relative path too; `links` of `prometheus.json` says which project | from `Docs/Architecture/Sdk.md`: `[Modules](../Engine/Modules.md)` |
+| a page of another repository | `prometheus:/`, the page being its path in `Docs/` without `.md` | `[the guide](prometheus:stellar-engine/guide/Install)` |
+| a file that is not documentation (README, LICENSE) | its address on GitHub | `https://github.com/QuantumDevTeam/StellarEngine-Core#readme` |
+
+Relative links work on GitHub as well as on the site. A `prometheus:` link works on the site only: use it between
+repositories, where nothing else can.
+
+Never write the address of the docs site or of GitHub Pages into a page: when the site moves, the pages stay right.
+
+## Checking it on a machine
+
+The builder of the bundle comes from the docs site, in `docs-kit.zip`. A bundle built on a machine shows the broken
+links of the pages before a push. In the core, the description is written to a file of its own first, so that
+`prometheus.json` of the repository stays as it is:
+
+```powershell
+powershell -File scripts/prometheus.ps1 -Output artifacts/prometheus.json
+python build_bundle.py --config artifacts/prometheus.json --out artifacts/bundle
+```
+
+A module has its description committed: `python build_bundle.py --out artifacts/bundle` in its folder.
+
+The whole run of the workflow, the static files and the embed included, is `ci.py` of the same kit, in the folder of
+the repository. It runs the `prepare` script of `prometheus.json` (PowerShell 7, or Windows PowerShell where there is
+no other), which writes the description into `artifacts/prometheus/`: `prometheus.json` of the repository stays as it
+is.
+
+```powershell
+$env:PROMETHEUS_SITE = 'https://notagood.org'
+python ci.py --out artifacts/pages --skip-metadata
+```
+
+`--skip-metadata` takes the API made before (`docfx metadata docfx.json`); without it, `--docfx` names the `docfx`
+to run.
+
+A `warning` line names a link that does not lead anywhere. The docs workflow prints the same lines, and publishes
+anyway.
+
+## Publishing
+
+A push to the default branch runs the docs workflow of the repository: it builds the bundle and puts it on GitHub
+Pages, and the docs site picks it up within minutes (at once, when the repository has the key of the site). A
+release of the mirror makes the new version of the engine appear on the site.
+
+Settings of a repository, once: Settings → Pages → Source = GitHub Actions; the card of the project on the docs site
+points at `https://quantumdevteam.github.io//bundle/`.
diff --git a/Docs/Engine/FAQ.md b/Docs/Engine/FAQ.md
new file mode 100644
index 0000000..1602627
--- /dev/null
+++ b/Docs/Engine/FAQ.md
@@ -0,0 +1,81 @@
+# Questions
+
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
+
+Short answers to what comes up first. The pages they point at say it in full.
+
+## Installing and building
+
+**Does `build.ps1 -Install` remove the old installation first?**
+No. `-Uninstall` is a mode of its own: it does its work and stops, and it is refused together with `-Install` or
+`-Pack`. An install only replaces the `stellar` command with the one it has just packed. Everything the installation
+holds stays: `stellar install` never overwrites a file. See [the layout](Repository.md).
+
+**Why does `-Install` pack when `-Pack` is not given?**
+An installation needs its local feed, `packages/`, so `-Install` implies `-Pack`. Packing in turn needs the native
+core: the package of Stellar.Core carries it with its wrapper, so `-Pack` cannot be combined with `-SkipNative`.
+
+**Does `build.ps1` check the toolchain?**
+The installer does ([Installing](Install.md)): it checks Git, the .NET SDK and Visual Studio first and prints what is
+missing. `build.ps1` assumes them and stops at the first tool that is not there.
+
+**Can the engine be built on Linux?**
+Not yet. `build.ps1` already picks the right wrapper there (the P/Invoke one) and `-SkipNative` builds and tests the
+managed part. The native projects are Visual Studio projects, though, and games and modules target Windows, so
+packing and installing need Windows.
+
+**What are the `Cli` and `Managed` wrappers?**
+Two wrappers of the native core with the same classes. `Cli` is C++/CLI: Windows only, and only where Visual Studio
+has its C++/CLI component. `Managed` is C# over the P/Invoke exports of the native core: it works everywhere and with
+Native AOT. `StellarNativeWrapper` chooses; by default the SDK takes `Cli` where it was built. See
+[Native core](../Architecture/NativeAbi.md).
+
+## Finding the installation
+
+**How does a game find the engine?**
+Through `$(StellarRoot)`, which Stellar.Sdk sets: the `StellarRoot` property, the `STELLAR_ROOT` variable, a folder
+above the project with `manifests/engine.manifest.json`, or the registry of the user, `~/.stellar`, for the orchestra
+version of its Stellar.Sdk. Its packages come from `packages/` of that installation, through its `NuGet.config`. See
+[the layout](Repository.md).
+
+**What is in `~/.stellar`?**
+Where each orchestra version is installed: `installations.json`, and `installations.props` made from it for MSBuild.
+One installation per version, and one version per root. What an orchestra holds is in its own `manifests/`.
+
+## Modules
+
+**Why is `Modules` empty in `manifests/engine.manifest.json`?**
+Modules are found by themselves: a folder of `modules/` with a `.stellar.module` file is a module. The manifest
+only holds what this installation does differently: a module that lives elsewhere (`Path`), one turned off
+(`Enabled`), another version or way of linking it (`Link`). `stellar modules add`, `enable`, `disable` and `reset`
+write it. The full list of modules is the generated catalog in `manifests/.generated/`. See
+[Engine manifest](../Formats/EngineManifest.md).
+
+**What does `Link` of a module mean?**
+How projects reference it. `Default`: as the project decides (`StellarPrecompiled`), sources in Debug and packages
+otherwise. `Sources`: always the sources, through a project reference. `Package`: always the package of the local
+feed. A module the manifest declares with a `Version` and no folder is always a package.
+
+**What writes the catalog of modules, and when?**
+`stellar modules sync`, and `stellar install` through it: it finds the modules, applies the manifest, checks the rule
+of the levels and writes `stellar.modules.props` for MSBuild and `stellar.modules.json` for tools, only when they
+change. A module project learns its level, version and dependencies from it. See [Modules](Modules.md).
+
+**Why do I not list `Stellar.Kernel` and `Stellar.Core` as dependencies?**
+Every project gets them implicitly, and a game gets `Stellar.Runtime` too, which its launcher calls. A dependency on
+them in a descriptor is dropped with a warning. A project turns one off with `StellarImplicitKernelReference`,
+`StellarImplicitCoreReference` or `StellarImplicitRuntimeReference` set to `false`; empty means on. See
+[SDK properties](../Reference/Sdk.Properties.md).
+
+## The build of a game
+
+**What is in `bin/` of a game?**
+`.exe` (the apphost of .NET) and `.Launcher.dll`, which calls `StellarRuntime.Run`; the game itself,
+`.dll`, a library; `.stellar.runtime.config.json`, its modules in load order and its settings; the engine
+(`Stellar.Kernel`, `Stellar.Core`, `Stellar.Runtime`) with the native core and its wrapper; compiled resources in
+`Resources/`. See [Runtime](../Architecture/Runtime.md).
+
+**Sources or packages?**
+A game takes the engine as packages. With `"Engine": "Sources"` in its `.stellar.solution` it takes the sources in
+Debug, and packages in every other configuration. On a machine without the sources of the core it takes packages
+anyway, with a warning.
diff --git a/Docs/Engine/GitPolicy.md b/Docs/Engine/GitPolicy.md
index ca1589a..7faa385 100644
--- a/Docs/Engine/GitPolicy.md
+++ b/Docs/Engine/GitPolicy.md
@@ -1,6 +1,6 @@
# StellarEngine — Git & Collaboration Policy
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
## 1. Purpose of This Document
@@ -209,5 +209,5 @@ Each contributor:
Also see:
- [Versioning.md](Versioning.md)
-- [CONTRIBUTING.md](../../CONTRIBUTING.md)
-- [README.md](../../README.md)
\ No newline at end of file
+- [CONTRIBUTING.md](https://github.com/QuantumDevTeam/StellarEngine-Core/blob/master/CONTRIBUTING.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
diff --git a/Docs/Engine/Install.md b/Docs/Engine/Install.md
index 3751e1d..0ec5df2 100644
--- a/Docs/Engine/Install.md
+++ b/Docs/Engine/Install.md
@@ -78,3 +78,6 @@ the installation in the NuGet cache and the build output go. Modules, tools and
git clone https://github.com/QuantumDevTeam/StellarEngine-Core.git StellarEngine
powershell -File StellarEngine\scripts\build.ps1 -Configuration Release -Install
```
+
+It builds the core, installs it, then builds and packs every module of `modules/`, so that games which take the
+engine as packages find them; `-SkipModules` leaves the modules for later (`stellar modules build --pack`).
diff --git a/Docs/Engine/Marks.md b/Docs/Engine/Marks.md
index 38de814..2b4b236 100644
--- a/Docs/Engine/Marks.md
+++ b/Docs/Engine/Marks.md
@@ -1,6 +1,6 @@
# Marks
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
A mark is metadata in a comment of the code: `#` and a name in angle brackets, capital letters, digits, `-` and `_`.
`MVP` as a mark in C# is a comment `// #` followed by ``. It is found in comments only, in C#, C++, shaders,
diff --git a/Docs/Engine/Modules.md b/Docs/Engine/Modules.md
index c15ef83..764aa3e 100644
--- a/Docs/Engine/Modules.md
+++ b/Docs/Engine/Modules.md
@@ -1,6 +1,6 @@
# Modules
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
A module is a folder with a [`.stellar.module`](../Formats/ModuleDescriptor.md) file. Everything else follows from
it: the installation finds it, the SDK builds it, the analyzers keep its architecture, the packages carry it. The rule
@@ -18,7 +18,7 @@ stellar modules build --tests --pack
| Step | What happens |
|---|---|
-| `modules new` | Renders `Shared/Templates/Modules/` into `modules//`, with its documentation site (`Docs/`, `docfx.json`, a Pages workflow, a placeholder icon in `Branding/`), and syncs |
+| `modules new` | Renders `Shared/Templates/Modules/` into `modules//`, with its documentation (`Docs/`, `prometheus.json`, `docfx.json`, the docs workflow, a placeholder icon in `Branding/`), and syncs |
| `modules sync` | Finds the modules, applies the manifest, checks the rules, writes the catalog |
| `modules build` | For each module in load order, with the dependencies of the selected ones: native projects (MSBuild of Visual Studio), the managed project, the package (`--pack`), the tests (`--tests`) |
| `modules list` | The modules in load order, where each came from, how it is linked |
diff --git a/Docs/Engine/PostInstallSetup.md b/Docs/Engine/PostInstallSetup.md
index b02eb18..2b6490d 100644
--- a/Docs/Engine/PostInstallSetup.md
+++ b/Docs/Engine/PostInstallSetup.md
@@ -1,6 +1,6 @@
# Setting up the machine after the install
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
What to know once the installation stands: how git behaves in a tree of nested repositories.
diff --git a/Docs/Engine/Repository.md b/Docs/Engine/Repository.md
index ca3a5e9..a225ab9 100644
--- a/Docs/Engine/Repository.md
+++ b/Docs/Engine/Repository.md
@@ -1,6 +1,6 @@
# Repository and installation layout
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
## One tree: the core is the root
@@ -33,7 +33,8 @@ cd StellarEngine
powershell -File scripts/build.ps1 -Configuration Release -Install
```
-`build.ps1 -Install` builds the core, fills `packages/` and runs `stellar install` in place. Running it again after
+`build.ps1 -Install` builds the core, fills `packages/` and runs `stellar install` in place, then builds and packs the
+modules of `modules/` (`-SkipModules` leaves them). Running it again after
`git pull` updates the core and keeps everything the installation holds: `stellar install` never overwrites a file.
`Stellar.Tools.Environment.StellarInstallation` is the single description of this tree in code. MSBuild has its own
@@ -59,7 +60,8 @@ So a module or a game inside the installation needs nothing, and one elsewhere u
```
What an orchestra holds stays in its own `manifests/`. `stellar install` registers the installation, registering a
-version again moves it; `stellar install --no-user-registration` leaves the registry alone.
+version again moves it, and a root installed again with another orchestra keeps only that one;
+`stellar install --no-user-registration` leaves the registry alone.
### Uninstalling
@@ -157,23 +159,23 @@ snapshot stays local and the script prints the push command; `-Tag` marks a rele
### Sites
-Every repository publishes its documentation with DocFX to GitHub Pages, by the same `.github/workflows/docs.yml`.
-Each site says where it is: the site of the engine is about the engine as a whole, the site of a component about that
-component alone.
+The documentation is read on the docs site (`StellarDocsUri`). Every repository publishes its part to its GitHub
+Pages with the same `.github/workflows/docs.yml`, a copy of the workflow of the docs site that never needs updating:
+it takes the steps from the site on every run. What a repository publishes is in `prometheus.json` at its root.
-| Site | Address | Content |
+| Project of the docs site | Built from | Content |
|---|---|---|
-| the engine | `StellarEngineSiteUri`, built from the mirror | the home of StellarEngine: getting started, the guide (`Docs/Engine/` of the core: installing, architecture, modules, this page, the project), the core under `/core/`, each component under `/modules//` or `/tools//`, the installer and the schemas |
-| the core | `StellarSiteUri` | the core alone: `Docs/` without `Docs/Engine/`, the API reference of `Stellar.Kernel`, `Stellar.Core`, `Stellar.Runtime` and `Stellar.Tools`, the JSON schemas (`/schemas/`), the installer (`/install.ps1`) |
-| a module | the same host, `//` | its `Docs/` and README; `stellar modules new` creates them with `docfx.json` and the workflow |
+| the engine, `StellarEngineDocsProject` | the mirror | the guide (`Docs/Engine/` of the core: installing, architecture, modules, this page, the project), the core under `core/` with its API, each module and tool with a `Docs/toc.yml` under `modules//` or `tools//` |
+| the core, `StellarDocsProject` | the core | `Docs/` without `Docs/Engine/`, the API reference of `Stellar.Kernel`, `Stellar.Core`, `Stellar.Runtime` and `Stellar.Tools` |
+| a module | its repository | its `Docs/`; `stellar modules new` creates them with `prometheus.json` and the workflow |
-Both addresses are set once, in `Shared/Build/Stellar.Versions.props`. The pages about the engine as a whole live in
-the core, in `Docs/Engine/`, since the mirror is generated and holds nothing of its own; the site of the core leaves
-them out and links to the site of the engine instead.
+GitHub Pages of the core keeps the installer (`/install.ps1`) and the JSON schemas (`/schemas/`) at `StellarSiteUri`.
+All the addresses and projects are set once, in `Shared/Build/Stellar.Versions.props`. The pages about the engine as
+a whole live in the core, in `Docs/Engine/`, since the mirror is generated and holds nothing of its own.
-The workflow tells the mirror by the `.orchestra` file `scripts/mirror.ps1` puts at the root of each snapshot (the
-commits and the repositories it was made of): there it runs `scripts/orchestra-site.ps1`, which writes
-`docfx.orchestra.json`, and builds that instead of `docfx.json`.
+`prometheus.json` of the core names `scripts/prometheus.ps1`, which the workflow runs first: it describes the core, or,
+where the `.orchestra` file of `scripts/mirror.ps1` is (the mirror), the whole engine. See
+[Writing the documentation](Documentation.md).
### Releases
diff --git a/Docs/Engine/Versioning.md b/Docs/Engine/Versioning.md
index 237f177..4480db3 100644
--- a/Docs/Engine/Versioning.md
+++ b/Docs/Engine/Versioning.md
@@ -1,6 +1,6 @@
# StellarEngine — Versioning Policy
-- [README.md](../../README.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
## 1. General Concept
@@ -139,5 +139,5 @@ git show origin/master:Shared/Build/Stellar.Versions.props
Also see:
- [GitPolicy.md](GitPolicy.md)
-- [CONTRIBUTING.md](../../CONTRIBUTING.md)
-- [README.md](../../README.md)
\ No newline at end of file
+- [CONTRIBUTING.md](https://github.com/QuantumDevTeam/StellarEngine-Core/blob/master/CONTRIBUTING.md)
+- [README.md](https://github.com/QuantumDevTeam/StellarEngine-Core#readme)
diff --git a/Docs/Engine/toc.yml b/Docs/Engine/toc.yml
index 1fbc3b1..fa4ff28 100644
--- a/Docs/Engine/toc.yml
+++ b/Docs/Engine/toc.yml
@@ -1,4 +1,4 @@
-# Navigation of the guide of the whole engine, on the site of the engine (scripts/orchestra-site.ps1).
+# Navigation of the guide of the whole engine, in the documentation of the engine (scripts/prometheus.ps1).
# The pages live in the core, the only place they can, and are published with the orchestra, not with the core.
- name: Installing
href: Install.md
@@ -14,15 +14,19 @@
href: PostInstallSetup.md
- name: Marks
href: Marks.md
+- name: Writing the documentation
+ href: Documentation.md
+- name: Questions
+ href: FAQ.md
- name: Project
items:
- name: README
- href: ../../README.md
+ href: https://github.com/QuantumDevTeam/StellarEngine-Core#readme
- name: Contributing
- href: ../../CONTRIBUTING.md
+ href: https://github.com/QuantumDevTeam/StellarEngine-Core/blob/master/CONTRIBUTING.md
- name: Git policy
href: GitPolicy.md
- name: Versioning
href: Versioning.md
- name: License
- href: ../../LICENSE.md
+ href: https://github.com/QuantumDevTeam/StellarEngine-Core/blob/master/LICENSE.md
diff --git a/Docs/Formats/EngineManifest.md b/Docs/Formats/EngineManifest.md
index 7b1eac4..d6125f8 100644
--- a/Docs/Formats/EngineManifest.md
+++ b/Docs/Formats/EngineManifest.md
@@ -68,7 +68,7 @@ stellar modules reset Stellar.Physics # removes the entry
| File | For |
|---|---|
-| `stellar.modules.props` | The catalog MSBuild imports, see [Modules](https://quantumdevteam.github.io/StellarEngine-Mono/guide/Modules.html) |
+| `stellar.modules.props` | The catalog MSBuild imports, see [Modules](../Engine/Modules.md) |
| `stellar.modules.json` | The same modules in load order, for tools that read JSON |
## Validation
diff --git a/Docs/Migration-0.11.md b/Docs/Migration-0.11.md
index 9c611ca..fe483a8 100644
--- a/Docs/Migration-0.11.md
+++ b/Docs/Migration-0.11.md
@@ -23,6 +23,15 @@ Stellar.Sdk, so change `0.4.1` to `0.4.2` in that of every solution:
{ "msbuild-sdks": { "Stellar.Sdk": "0.4.2" } }
```
+## Installing
+
+`scripts/build.ps1 -Install` also builds and packs the modules of `modules/` after the core, with their tests unless
+`-SkipTests`: a game built against packages finds them in `packages/` without `stellar modules build --pack` by hand.
+`-SkipModules` turns it off.
+
+`stellar install` keeps one registration per root in `~/.stellar`: an installation updated to 0.11 replaces the
+entry of its old orchestra version instead of keeping both.
+
## Resources
Compiled resources lie in `Resources` next to the application, not `resources`: only a system that tells case apart sees
@@ -60,4 +69,4 @@ told there instead of being lost.
## Marks
-Marks in the comments of the code, checked by git and by the workflows: [Marks](https://quantumdevteam.github.io/StellarEngine-Mono/guide/Marks.html).
+Marks in the comments of the code, checked by git and by the workflows: [Marks](Engine/Marks.md).
diff --git a/Docs/Migration-0.8.md b/Docs/Migration-0.8.md
index b45b0d8..08b4ee2 100644
--- a/Docs/Migration-0.8.md
+++ b/Docs/Migration-0.8.md
@@ -42,7 +42,7 @@ built against the 0.7.0 packages of earlier states of this repository.
```
- A module is a folder with a [`.stellar.module`](Formats/ModuleDescriptor.md): its kind, version, description and
- dependencies come from there, and the project file is nearly empty. See [Modules](https://quantumdevteam.github.io/StellarEngine-Mono/guide/Modules.html).
+ dependencies come from there, and the project file is nearly empty. See [Modules](Engine/Modules.md).
`stellar modules new` creates the folder, the descriptor, the projects and the tests.
- The SDK version moved to `global.json`.
- Dependencies are plain `StellarDependency` items: the descriptor makes them, a project may add or remove some.
diff --git a/Docs/Reference/Sdk.Properties.md b/Docs/Reference/Sdk.Properties.md
index b4dcccf..ff8f55b 100644
--- a/Docs/Reference/Sdk.Properties.md
+++ b/Docs/Reference/Sdk.Properties.md
@@ -27,7 +27,7 @@ The project wins over `config/`, `config/` over the defaults.
| `StellarRoot` | `STELLAR_ROOT`, a `manifests/` above, the user registry | The root of the installation |
| `StellarHome` | `STELLAR_HOME`, or `~/.stellar` | The registry of the user, read only when nothing else gave `StellarRoot` |
| `StellarPackagesDir` | `$(StellarRoot)packages/` | The local feed |
-| `StellarArtifactsDir` | `$(StellarRoot)artifacts/` | Everything built: `bin/` and `obj/`, see [the layout](https://quantumdevteam.github.io/StellarEngine-Mono/guide/Repository.html) |
+| `StellarArtifactsDir` | `$(StellarRoot)artifacts/` | Everything built: `bin/` and `obj/`, see [the layout](../Engine/Repository.md) |
| `StellarIsEngineProject` | `true` under `$(StellarRoot)`, but in `projects/` | The engine side (modules, tools): sources in Debug, `artifacts/`. A game or a library is not |
| `StellarUseArtifactsOutput` | `true` on the engine side, `false` for games | `false`: the plain `bin/` and `obj/` next to the project |
| `StellarArtifactsName` | `$(MSBuildProjectName)` | The folder of the project in `artifacts/bin` and `artifacts/obj` |
diff --git a/Docs/index.md b/Docs/index.md
index 334443f..399b5fa 100644
--- a/Docs/index.md
+++ b/Docs/index.md
@@ -2,10 +2,10 @@
# StellarEngine-Core
-The core of [StellarEngine](https://quantumdevteam.github.io/StellarEngine-Mono/): the one component installed into the
+The core of [StellarEngine](prometheus:stellar-engine): the one component installed into the
root of every installation. This site is about the core alone: how it is built, the formats it reads, the SDK it gives
modules and games, and its API. Everything about the engine as a whole (installing it, getting started, the
-architecture, the modules, the orchestra) is on the [site of the engine](https://quantumdevteam.github.io/StellarEngine-Mono/).
+architecture, the modules, the orchestra) is on the [site of the engine](prometheus:stellar-engine).
## What the core is
diff --git a/Docs/toc.yml b/Docs/toc.yml
index cc3371d..f8ae818 100644
--- a/Docs/toc.yml
+++ b/Docs/toc.yml
@@ -1,5 +1,5 @@
-# Navigation of the site of the core (DocFX). Paths are relative to this file.
-# Docs/Engine/ is not here: it is the guide of the whole engine, on the site of the engine (scripts/orchestra-site.ps1).
+# Navigation of the documentation of the core (the bundle of the site). Paths are relative to this file.
+# Docs/Engine/ is not here: it is the guide of the whole engine, in the documentation of the engine (scripts/prometheus.ps1).
- name: Home
href: index.md
- name: Architecture
@@ -47,4 +47,4 @@
- name: API
href: ../artifacts/docs/api/
- name: StellarEngine
- href: https://quantumdevteam.github.io/StellarEngine-Mono/
+ href: prometheus:stellar-engine
diff --git a/Kernel/src/Managed/Stellar.Kernel/LoggingSystem/LoggerFormat.cs b/Kernel/src/Managed/Stellar.Kernel/LoggingSystem/LoggerFormat.cs
index 12319b2..3e0cab4 100644
--- a/Kernel/src/Managed/Stellar.Kernel/LoggingSystem/LoggerFormat.cs
+++ b/Kernel/src/Managed/Stellar.Kernel/LoggingSystem/LoggerFormat.cs
@@ -39,11 +39,11 @@ LogFormat Exception
"\e[31m|\e[0m " +
"\e[36m{5}\e[0m" +
"\e[31m:\e[0m" +
- "\e[36m{6}\e[0m " +
+ "\e[36m{6}\e[0m" +
"\e[31m:\e[0m" +
"\e[36m{7}\e[0m " +
"\e[31m:\e[0m " +
- "\e[36m{8}\e[0m " +
+ "\e[36m{8}\e[0m" +
"\e[31m.\e[0m" +
"\e[36m{9}\e[0m " +
"\e[31m-\e[0m " +
@@ -64,11 +64,11 @@ LogFormat Exception
"\e[31m|\e[0m " +
"\e[36m{5}\e[0m" +
"\e[31m:\e[0m" +
- "\e[36m{6}\e[0m " +
+ "\e[36m{6}\e[0m" +
"\e[31m:\e[0m" +
"\e[36m{7}\e[0m " +
"\e[31m:\e[0m " +
- "\e[36m{8}\e[0m " +
+ "\e[36m{8}\e[0m" +
"\e[31m.\e[0m" +
"\e[36m{9}\e[0m " +
"\e[31m-\e[0m " +
@@ -89,11 +89,11 @@ LogFormat Exception
"\e[31m|\e[0m " +
"\e[36m{5}\e[0m" +
"\e[31m:\e[0m" +
- "\e[36m{6}\e[0m " +
+ "\e[36m{6}\e[0m" +
"\e[31m:\e[0m" +
"\e[36m{7}\e[0m " +
"\e[31m:\e[0m " +
- "\e[36m{8}\e[0m " +
+ "\e[36m{8}\e[0m" +
"\e[31m.\e[0m" +
"\e[36m{9}\e[0m " +
"\e[31m-\e[0m " +
@@ -114,11 +114,11 @@ LogFormat Exception
"\e[31m|\e[0m " +
"\e[36m{5}\e[0m" +
"\e[31m:\e[0m" +
- "\e[36m{6}\e[0m " +
+ "\e[36m{6}\e[0m" +
"\e[31m:\e[0m" +
"\e[36m{7}\e[0m " +
"\e[31m:\e[0m " +
- "\e[36m{8}\e[0m " +
+ "\e[36m{8}\e[0m" +
"\e[31m.\e[0m" +
"\e[36m{9}\e[0m " +
"\e[31m-\e[0m " +
@@ -143,7 +143,7 @@ LogFormat Exception
"\e[31m:\e[0m" +
"\e[36m{7}\e[0m " +
"\e[31m:\e[0m " +
- "\e[36m{8}\e[0m " +
+ "\e[36m{8}\e[0m" +
"\e[31m.\e[0m" +
"\e[36m{9}\e[0m " +
"\e[31m-\e[0m " +
@@ -164,11 +164,11 @@ LogFormat Exception
"\e[31m|\e[0m " +
"\e[36m{5}\e[0m" +
"\e[31m:\e[0m" +
- "\e[36m{6}\e[0m " +
+ "\e[36m{6}\e[0m" +
"\e[31m:\e[0m" +
"\e[36m{7}\e[0m " +
"\e[31m:\e[0m " +
- "\e[36m{8}\e[0m " +
+ "\e[36m{8}\e[0m" +
"\e[31m.\e[0m" +
"\e[36m{9}\e[0m " +
"\e[31m-\e[0m " +
diff --git a/README.md b/README.md
index ee2f060..8b88d8d 100644
--- a/README.md
+++ b/README.md
@@ -77,6 +77,7 @@ powershell -File scripts/build.ps1
| `-Pack` | Also fills the local feed, `packages/` |
| `-Install` | Also runs `stellar install` here; implies `-Pack` |
| `-NoUserRegistration` | With `-Install`: do not register the installation for the current user (`~/.stellar`) |
+| `-SkipModules` | With `-Install`: do not build and pack the modules of `modules/`, which it does by default |
| `-Uninstall` | Instead of building: `stellar uninstall` here, then `artifacts/`. Modules, tools and games stay |
| `-All` | With `-Uninstall`: also the files you may have edited (`config/`, isolation files, the manifest) |
| `-KeepArtifacts` | With `-Uninstall`: keep the build output |
@@ -109,7 +110,7 @@ Every module and tool is a repository of its own, cloned into its folder of the
|---|---|
| `scripts/solution.ps1` | Writes `StellarEngine.sln`: the core and every project of `modules/` and `tools/`, for the IDE. Ignored by git; run it again when a module or a project appears |
| `scripts/mirror.ps1` | Makes a snapshot of the committed state of every component as one commit of the mirror (StellarEngine-Mono), the core at the root and each component in its folder. `-Tag v0.8.0`, `-Push` |
-| `scripts/orchestra-site.ps1` | Generates the DocFX project of the orchestra site (`docfx.orchestra.json`): the core and every module in one site. The docs workflow runs it in the mirror |
+| `scripts/prometheus.ps1` | Writes `prometheus.json`, what the docs workflow publishes: the core, or in the mirror the whole engine. `-Print` shows it. See [Writing the documentation](Docs/Engine/Documentation.md) |
See [Components and the mirror](Docs/Engine/Repository.md#components-and-the-mirror).
diff --git a/SDK/src/Stellar.Cli/Commands/InstallCommand.cs b/SDK/src/Stellar.Cli/Commands/InstallCommand.cs
index 4081785..9fd417d 100644
--- a/SDK/src/Stellar.Cli/Commands/InstallCommand.cs
+++ b/SDK/src/Stellar.Cli/Commands/InstallCommand.cs
@@ -1,16 +1,42 @@
using System.ComponentModel;
+
using Spectre.Console.Cli;
+
using Stellar.Tools.Environment;
using Stellar.Tools.Installation;
namespace Stellar.Cli.Commands;
+///
+/// What install and uninstall take from the machine.
+///
+internal static class InstallationPaths
+{
+ ///
+ /// The root a command acts on: the argument, $STELLAR_ROOT or the current directory.
+ ///
+ public static string Root(string? path)
+ {
+ return path
+ ?? Environment.GetEnvironmentVariable(StellarInstallation.EnvironmentVariable)
+ ?? Environment.CurrentDirectory;
+ }
+
+ ///
+ /// The NuGet package cache of the user: $NUGET_PACKAGES, or ~/.nuget/packages.
+ ///
+ public static string PackageCache()
+ {
+ return Tools.Installation.PackageCache.Location();
+ }
+}
+
public sealed class InstallSettings
: CommandSettings
{
[CommandArgument(0, "[PATH]")]
- [Description(
- "The checkout of StellarEngine-Core to turn into an installation. $STELLAR_ROOT or the current directory when omitted")]
+ [Description("The checkout of StellarEngine-Core to turn into an installation. " +
+ "$STELLAR_ROOT or the current directory when omitted")]
public string? Path { get; set; }
[CommandOption("--no-user-registration")]
@@ -32,27 +58,3 @@ public override int Execute(CommandContext context, InstallSettings settings)
return 0;
}
}
-
-///
-/// What install and uninstall take from the machine.
-///
-internal static class InstallationPaths
-{
- ///
- /// The root a command acts on: the argument, $STELLAR_ROOT or the current directory.
- ///
- public static string Root(string? path)
- {
- return path
- ?? Environment.GetEnvironmentVariable(StellarInstallation.EnvironmentVariable)
- ?? Environment.CurrentDirectory;
- }
-
- ///
- /// The NuGet package cache of the user: $NUGET_PACKAGES, or ~/.nuget/packages.
- ///
- public static string PackageCache()
- {
- return Stellar.Tools.Installation.PackageCache.Location();
- }
-}
diff --git a/SDK/src/Stellar.Tools/Environment/InstallationRegistry.cs b/SDK/src/Stellar.Tools/Environment/InstallationRegistry.cs
index f20fcbe..335f175 100644
--- a/SDK/src/Stellar.Tools/Environment/InstallationRegistry.cs
+++ b/SDK/src/Stellar.Tools/Environment/InstallationRegistry.cs
@@ -1,3 +1,5 @@
+// ReSharper disable PropertyCanBeMadeInitOnly.Global
+
using System;
using System.Collections.Generic;
using System.IO;
@@ -45,8 +47,9 @@ public sealed class InstallationRegistryFile
/// while it evaluates a project. Tools change the JSON through this class only, so both stay in step.
///
///
-/// One installation per orchestra version: registering a version again moves it to the new root. What an orchestra
-/// holds (modules, versions) is not here: it is in the manifests of the installation itself.
+/// One installation per orchestra version, and one version per root: registering a version again moves it to the
+/// new root, and a root installed again with a newer orchestra keeps only that one. What an orchestra holds (modules,
+/// versions) is not here: it is in the manifests of the installation itself.
///
///
/// An instance is a folder, not a global: tests and sandboxes create their own.
@@ -94,9 +97,9 @@ public static string UserDirectory
{
get
{
- var fromVariable = System.Environment.GetEnvironmentVariable(EnvironmentVariable);
+ string? fromVariable = System.Environment.GetEnvironmentVariable(EnvironmentVariable);
return !string.IsNullOrWhiteSpace(fromVariable)
- ? Path.GetFullPath(fromVariable!)
+ ? Path.GetFullPath(fromVariable)
: Path.Combine(
System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile), ".stellar");
}
@@ -124,22 +127,24 @@ public IReadOnlyList List()
/// The installation, or null if the version is not registered.
public StellarInstallation? Find(string orchesterVersion)
{
- var entry = Read().Installations.FirstOrDefault(installation =>
+ RegisteredInstallation? entry = Read().Installations.FirstOrDefault(installation =>
string.Equals(installation.OrchesterVersion, orchesterVersion, StringComparison.Ordinal));
return entry is null ? null : new StellarInstallation(entry.Root);
}
///
- /// Registers an installation for an orchestra version, replacing the one registered for it before.
+ /// Registers an installation for an orchestra version, replacing the one registered for it before and what was
+ /// registered for the same root.
///
public void Register(string orchesterVersion, StellarInstallation installation)
{
if (string.IsNullOrWhiteSpace(orchesterVersion))
throw new ArgumentException("The orchestra version must not be empty", nameof(orchesterVersion));
- var file = Read();
+ InstallationRegistryFile file = Read();
file.Installations.RemoveAll(entry =>
- string.Equals(entry.OrchesterVersion, orchesterVersion, StringComparison.Ordinal));
+ string.Equals(entry.OrchesterVersion, orchesterVersion, StringComparison.Ordinal)
+ || RootComparer.Equals(Normalize(entry.Root), Normalize(installation.Root)));
file.Installations.Add(new RegisteredInstallation
{ OrchesterVersion = orchesterVersion, Root = installation.Root });
Write(file);
@@ -151,8 +156,8 @@ public void Register(string orchesterVersion, StellarInstallation installation)
/// The orchestra versions that were registered for it.
public IReadOnlyList Unregister(StellarInstallation installation)
{
- var file = Read();
- var removed = file.Installations
+ InstallationRegistryFile file = Read();
+ List removed = file.Installations
.Where(entry => RootComparer.Equals(Normalize(entry.Root), Normalize(installation.Root)))
.ToList();
@@ -182,7 +187,8 @@ private void Write(InstallationRegistryFile file)
// Nothing registered: the registry leaves nothing behind, and an empty folder goes with it
Delete(File);
Delete(MSBuildFile);
- if (System.IO.Directory.Exists(Directory) && !System.IO.Directory.EnumerateFileSystemEntries(Directory).Any())
+ if (System.IO.Directory.Exists(Directory) &&
+ !System.IO.Directory.EnumerateFileSystemEntries(Directory).Any())
System.IO.Directory.Delete(Directory);
return;
}
@@ -198,13 +204,14 @@ internal static string RenderMSBuild(InstallationRegistryFile file)
{
var builder = new StringBuilder();
builder.AppendLine("");
- builder.AppendLine($" ");
+ builder.AppendLine(
+ $" ");
builder.AppendLine(" ");
- foreach (var entry in file.Installations)
+ foreach (RegisteredInstallation entry in file.Installations)
{
- var version = SecurityElement.Escape(entry.OrchesterVersion);
- var root = SecurityElement.Escape(entry.Root.TrimEnd('/', '\\') + Path.DirectorySeparatorChar);
+ string version = SecurityElement.Escape(entry.OrchesterVersion);
+ string root = SecurityElement.Escape(entry.Root.TrimEnd('/', '\\') + Path.DirectorySeparatorChar);
builder.AppendLine(
$" {root}");
}
diff --git a/SDK/src/Stellar.Tools/Environment/StellarVersions.cs b/SDK/src/Stellar.Tools/Environment/StellarVersions.cs
index a2a4d01..61edc4d 100644
--- a/SDK/src/Stellar.Tools/Environment/StellarVersions.cs
+++ b/SDK/src/Stellar.Tools/Environment/StellarVersions.cs
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
+
using Stellar.Tools.Diagnostics;
namespace Stellar.Tools.Environment;
@@ -57,9 +58,31 @@ public static class StellarVersions
///
public static string SchemasUri => Get("StellarSchemasUri");
+ ///
+ /// Gets the address of the docs site, ending with a slash: a page of a project is
+ /// {DocsUri}{project}/{page}.
+ ///
+ public static string DocsUri => Get("StellarDocsUri");
+
+ /// Gets the project of the core on the docs site.
+ public static string DocsProject => Get("StellarDocsProject");
+
+ /// Gets the project of the whole engine on the docs site: the guide, the core and every module.
+ public static string EngineDocsProject => Get("StellarEngineDocsProject");
+
+ ///
+ /// Gets the address of a page of a project on the docs site.
+ ///
+ /// The project, for example .
+ /// The page: its path in Docs/ without .md; empty for the home of the project.
+ public static string DocsPage(string project, string page = "")
+ {
+ return DocsUri + project + (string.IsNullOrEmpty(page) ? string.Empty : "/" + page.TrimStart('/'));
+ }
+
private static string Get(string key)
{
- return Metadata.TryGetValue(key, out var value)
+ return Metadata.TryGetValue(key, out string? value)
? value
: throw new ToolException($"{key} is missing from the assembly metadata of Stellar.Tools");
}
diff --git a/SDK/src/Stellar.Tools/Installation/EngineInstaller.cs b/SDK/src/Stellar.Tools/Installation/EngineInstaller.cs
index 960e093..51d5cc2 100644
--- a/SDK/src/Stellar.Tools/Installation/EngineInstaller.cs
+++ b/SDK/src/Stellar.Tools/Installation/EngineInstaller.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.IO;
+
using Stellar.Kernel.Configuration.Manifest;
using Stellar.Tools.Diagnostics;
using Stellar.Tools.Environment;
@@ -41,7 +42,7 @@ public static void Install(StellarInstallation installation, IToolLogger logger,
throw new ToolException(
$"{installation.Root} is not a checkout of StellarEngine-Core: the root of an installation is the core itself");
- foreach (var directory in new[]
+ foreach (string directory in new[]
{
installation.Modules, installation.Packages, installation.Manifests, installation.Config,
installation.Tools, installation.ResourceCompilers, installation.Projects
diff --git a/SDK/src/Stellar.Tools/Modules/ModuleScaffolder.cs b/SDK/src/Stellar.Tools/Modules/ModuleScaffolder.cs
index 6379e57..166a883 100644
--- a/SDK/src/Stellar.Tools/Modules/ModuleScaffolder.cs
+++ b/SDK/src/Stellar.Tools/Modules/ModuleScaffolder.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
+
using Stellar.Kernel.Modules;
using Stellar.Tools.Diagnostics;
using Stellar.Tools.Environment;
@@ -22,7 +23,8 @@ public sealed record ModuleRequest(
ModuleLevel Level,
string? Description,
string Template,
- string? Directory = null);
+ string? Directory = null
+);
///
/// Creates modules from Shared/Templates/Modules, and registers them with the installation.
@@ -80,12 +82,12 @@ public string Create(ModuleRequest request)
if (Array.IndexOf(ModuleResolver.CoreModules, request.Id) >= 0)
throw new ToolException($"{request.Id} is part of the core");
- var template = Path.Combine(TemplatesDirectory, request.Template);
+ string template = Path.Combine(TemplatesDirectory, request.Template);
if (!Directory.Exists(template))
throw new ToolException(
$"Unknown module template '{request.Template}'. Available: {string.Join(", ", ListTemplates())}");
- var directory = Path.GetFullPath(request.Directory ?? Path.Combine(_installation.Modules, request.Id));
+ string directory = Path.GetFullPath(request.Directory ?? Path.Combine(_installation.Modules, request.Id));
_renderer.Render(template, directory, Values(request));
ModuleFeed.EnsureReachable(_installation, directory, _logger);
@@ -99,10 +101,10 @@ public string Create(ModuleRequest request)
///
public Dictionary Values(ModuleRequest request)
{
- var shortName = request.Id.StartsWith("Stellar.", StringComparison.Ordinal)
+ string shortName = request.Id.StartsWith("Stellar.", StringComparison.Ordinal)
? request.Id.Substring("Stellar.".Length)
: request.Id;
- var description = request.Description ?? $"The {shortName} module of StellarEngine";
+ string description = request.Description ?? $"The {shortName} module of StellarEngine";
return new Dictionary
{
@@ -121,6 +123,10 @@ public Dictionary Values(ModuleRequest request)
["CoreSiteUri"] = StellarVersions.SiteUri,
["EngineSiteUri"] = StellarVersions.EngineSiteUri,
["ModuleSiteUri"] = new Uri(new Uri(StellarVersions.SiteUri), "/" + request.Id + "/").AbsoluteUri,
+ // The project of the module on the docs site (prometheus.json): a guess the author changes when the card
+ // of the module on the site is named otherwise
+ ["ModuleDocsProject"] = "stellar-" + shortName.ToLowerInvariant().Replace(".", "-"),
+ ["EngineDocsProject"] = StellarVersions.EngineDocsProject,
["OrchesterVersion"] = StellarVersions.Orchester,
["StellarRoot"] = _installation.Root,
["StellarSchemasUri"] = StellarVersions.SchemasUri
diff --git a/SDK/src/Stellar.Tools/Modules/ModuleSynchronizer.cs b/SDK/src/Stellar.Tools/Modules/ModuleSynchronizer.cs
index f64a5e9..2604dcc 100644
--- a/SDK/src/Stellar.Tools/Modules/ModuleSynchronizer.cs
+++ b/SDK/src/Stellar.Tools/Modules/ModuleSynchronizer.cs
@@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.Linq;
+
+using Stellar.Kernel.Configuration.Manifest;
using Stellar.Tools.Diagnostics;
using Stellar.Tools.Environment;
using Stellar.Tools.Manifests;
@@ -27,17 +29,17 @@ public static class ModuleSynchronizer
/// Thrown if the modules break the rules.
public static ModuleSet Load(StellarInstallation installation)
{
- var manifest = EngineManifestStore.Load(installation.EngineManifest);
- var resolution = ModuleResolver.Resolve(installation, manifest);
+ EngineManifest manifest = EngineManifestStore.Load(installation.EngineManifest);
+ ModuleResolution resolution = ModuleResolver.Resolve(installation, manifest);
if (!resolution.IsValid)
throw Failure(resolution.Errors);
- var graph = ModuleGraph.Analyze(resolution.Modules.Select(module => module.Descriptor));
+ ModuleGraphResult graph = ModuleGraph.Analyze(resolution.Modules.Select(module => module.Descriptor));
if (!graph.IsValid)
throw Failure(graph.Errors);
- var byId = resolution.Modules.ToDictionary(module => module.Id);
+ Dictionary byId = resolution.Modules.ToDictionary(module => module.Id);
return new ModuleSet(resolution, graph.LoadOrder.Select(descriptor => byId[descriptor.Id]).ToList());
}
@@ -50,15 +52,15 @@ public static ModuleSet Load(StellarInstallation installation)
/// Thrown if the modules break the rules. Nothing is written then.
public static ModuleSet Synchronize(StellarInstallation installation, IToolLogger logger)
{
- var set = Load(installation);
+ ModuleSet set = Load(installation);
- foreach (var warning in set.Resolution.Warnings)
+ foreach (string warning in set.Resolution.Warnings)
logger.Warning(warning);
- var catalogChanged =
+ bool catalogChanged =
FileWriter.WriteAllText(installation.ModuleCatalog, ModuleCatalogGenerator.Render(set.LoadOrder));
- var lockChanged = FileWriter.WriteAllText(installation.ModuleLock,
- StellarJson.Serialize(new ModuleLockFile(set.LoadOrder)));
+ bool lockChanged =
+ FileWriter.WriteAllText(installation.ModuleLock, StellarJson.Serialize(new ModuleLockFile(set.LoadOrder)));
if (catalogChanged || lockChanged)
logger.Info($"Module catalog updated: {set.LoadOrder.Count} module(s), {installation.ModuleCatalog}");
diff --git a/SDK/tests/Stellar.Tools.Tests/InstallationTests.cs b/SDK/tests/Stellar.Tools.Tests/InstallationTests.cs
index bc4ca5d..353a529 100644
--- a/SDK/tests/Stellar.Tools.Tests/InstallationTests.cs
+++ b/SDK/tests/Stellar.Tools.Tests/InstallationTests.cs
@@ -1,4 +1,5 @@
using System.Diagnostics;
+
using Stellar.Tools.Diagnostics;
using Stellar.Tools.Environment;
using Stellar.Tools.Installation;
@@ -35,8 +36,9 @@ public void Register_KeepsOneInstallationPerOrchestra_AndWritesTheMSBuildView()
registry.Find("0.8.0")!.Root.Should().Be(second.Root);
registry.Find("0.9.0")!.Root.Should().Be(other.Root);
- var props = File.ReadAllText(registry.MSBuildFile);
- props.Should().Contain("'$(StellarOrchesterVersion)' == '0.8.0'\">" + second.Root + Path.DirectorySeparatorChar);
+ string props = File.ReadAllText(registry.MSBuildFile);
+ props.Should()
+ .Contain("'$(StellarOrchesterVersion)' == '0.8.0'\">" + second.Root + Path.DirectorySeparatorChar);
props.Should().Contain("'$(StellarOrchesterVersion)' == '0.9.0'\">" + other.Root + Path.DirectorySeparatorChar);
props.Should().NotContain(first.Root + Path.DirectorySeparatorChar + "<");
}
@@ -49,9 +51,10 @@ public void Unregister_RemovesEveryVersionOfTheRoot_AndTheLastOneLeavesNothing()
var installation = new StellarInstallation(Path.Combine(directory.Path, "engine"));
var other = new StellarInstallation(Path.Combine(directory.Path, "other"));
- registry.Register("0.8.0", installation);
- registry.Register("0.9.0", installation);
registry.Register("1.0.0", other);
+ File.WriteAllText(registry.File, File.ReadAllText(registry.File).Replace("\"Installations\": [",
+ $"\"Installations\": [ {{ \"OrchesterVersion\": \"0.8.0\", \"Root\": {Json(installation.Root)} }}, " +
+ $"{{ \"OrchesterVersion\": \"0.9.0\", \"Root\": {Json(installation.Root)} }},"));
registry.Unregister(installation).Should().BeEquivalentTo("0.8.0", "0.9.0");
registry.List().Should().ContainSingle().Which.OrchesterVersion.Should().Be("1.0.0");
@@ -60,6 +63,27 @@ public void Unregister_RemovesEveryVersionOfTheRoot_AndTheLastOneLeavesNothing()
Directory.Exists(registry.Directory).Should().BeFalse();
}
+ private static string Json(string text)
+ {
+ return System.Text.Json.JsonSerializer.Serialize(text);
+ }
+
+ [Fact]
+ public void Register_ANewOrchestraInTheSameRoot_ReplacesTheOldOne()
+ {
+ using var directory = new TempDirectory();
+ var registry = new InstallationRegistry(Path.Combine(directory.Path, "home"));
+ var installation = new StellarInstallation(Path.Combine(directory.Path, "engine"));
+ var other = new StellarInstallation(Path.Combine(directory.Path, "other"));
+
+ registry.Register("0.9.0", other);
+ registry.Register("0.10.0", installation);
+ registry.Register("0.11.0", installation);
+
+ registry.List().Select(entry => $"{entry.OrchesterVersion} {entry.Root}")
+ .Should().Equal($"0.11.0 {installation.Root}", $"0.9.0 {other.Root}");
+ }
+
[Fact]
public void TryLocate_FindsTheInstallationOfThisOrchestraInTheRegistry()
{
@@ -78,18 +102,19 @@ public void TryLocate_FindsTheInstallationOfThisOrchestraInTheRegistry()
public class UninstallerTests
{
private static (StellarInstallation Installation, InstallationRegistry Registry, string Cache) Installed(
- TempDirectory directory)
+ TempDirectory directory
+ )
{
directory.Write("Shared/Templates/Installation/config/Stellar.Sdk.props", "settings {{OrchesterVersion}}");
directory.Write("Shared/Templates/Installation/projects/Directory.Build.props", "isolation");
- var installation = FakeCore.Create(directory);
+ StellarInstallation installation = FakeCore.Create(directory);
var registry = new InstallationRegistry(Path.Combine(directory.Path, "home"));
EngineInstaller.Install(installation, NullToolLogger.Instance, registry);
directory.Write("packages/Stellar.Kernel.0.8.0.nupkg");
directory.Write("packages/Stellar.Sdk.0.4.0-preview.1.nupkg");
- var cache = Path.Combine(directory.Path, "nuget");
+ string cache = Path.Combine(directory.Path, "nuget");
directory.Write("nuget/stellar.kernel/0.8.0/stellar.kernel.nuspec");
directory.Write("nuget/stellar.kernel/0.7.0/stellar.kernel.nuspec");
directory.Write("nuget/stellar.sdk/0.4.0-preview.1/stellar.sdk.nuspec");
@@ -103,7 +128,7 @@ public void Uninstall_RefusesADirectoryThatIsNotTheCore()
{
using var directory = new TempDirectory();
- var action = () => EngineUninstaller.Uninstall(new StellarInstallation(directory.Path),
+ Func action = () => EngineUninstaller.Uninstall(new StellarInstallation(directory.Path),
NullToolLogger.Instance, new UninstallOptions());
action.Should().Throw().WithMessage("*not a checkout of StellarEngine-Core*");
@@ -113,12 +138,12 @@ public void Uninstall_RefusesADirectoryThatIsNotTheCore()
public void Uninstall_LeavesAPlainCheckout_AndNeverTouchesTheContentOfTheUser()
{
using var directory = new TempDirectory();
- var (installation, registry, cache) = Installed(directory);
+ (StellarInstallation installation, InstallationRegistry registry, string cache) = Installed(directory);
directory.Write("modules/Stellar.FileSystem/Stellar.FileSystem.stellar.module", "{}");
directory.Write("projects/MyGame/MyGame.csproj", "");
directory.Write("tools/StellarEditor/README.md");
- var report = EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
+ UninstallReport report = EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
new UninstallOptions { Registry = registry, PackageCache = cache });
// The machine forgot it
@@ -132,7 +157,7 @@ public void Uninstall_LeavesAPlainCheckout_AndNeverTouchesTheContentOfTheUser()
Directory.Exists(Path.Combine(cache, "newtonsoft.json", "13.0.3")).Should().BeTrue();
// What the installer made is gone
- foreach (var path in new[]
+ foreach (string path in new[]
{
installation.Packages, installation.Manifests, installation.Config,
Path.Combine(installation.Modules, "Directory.Build.props"),
@@ -153,12 +178,12 @@ public void Uninstall_LeavesAPlainCheckout_AndNeverTouchesTheContentOfTheUser()
public void Uninstall_RemovesEmptyFoldersOfTheInstaller()
{
using var directory = new TempDirectory();
- var (installation, registry, cache) = Installed(directory);
+ (StellarInstallation installation, InstallationRegistry registry, string cache) = Installed(directory);
EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
new UninstallOptions { Registry = registry, PackageCache = cache });
- foreach (var path in new[] { installation.Modules, installation.Projects, installation.Tools })
+ foreach (string path in new[] { installation.Modules, installation.Projects, installation.Tools })
Directory.Exists(path).Should().BeFalse(path);
}
@@ -166,11 +191,11 @@ public void Uninstall_RemovesEmptyFoldersOfTheInstaller()
public void Uninstall_KeepsEditedFiles_UnlessAll()
{
using var directory = new TempDirectory();
- var (installation, registry, _) = Installed(directory);
- var settings = Path.Combine(installation.Config, "Stellar.Sdk.props");
+ (StellarInstallation installation, InstallationRegistry registry, _) = Installed(directory);
+ string settings = Path.Combine(installation.Config, "Stellar.Sdk.props");
File.WriteAllText(settings, "my settings");
- var report = EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
+ UninstallReport report = EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
new UninstallOptions { Registry = registry });
File.ReadAllText(settings).Should().Be("my settings");
@@ -186,9 +211,9 @@ public void Uninstall_KeepsEditedFiles_UnlessAll()
public void Uninstall_DryRun_ChangesNothing()
{
using var directory = new TempDirectory();
- var (installation, registry, cache) = Installed(directory);
+ (StellarInstallation installation, InstallationRegistry registry, string cache) = Installed(directory);
- var report = EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
+ UninstallReport report = EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
new UninstallOptions { Registry = registry, PackageCache = cache, DryRun = true });
report.Unregistered.Should().Equal(StellarVersions.Orchester);
@@ -207,16 +232,21 @@ public void Uninstall_RemovesALinkAsALink_NeverWhatItPointsAt()
using var directory = new TempDirectory();
using var outside = new TempDirectory();
- var precious = outside.Write("precious.txt", "keep me");
- var (installation, registry, _) = Installed(directory);
-
- var junction = Path.Combine(installation.Packages, "linked");
- using (var mklink = Process.Start(new ProcessStartInfo("cmd.exe", $"/c mklink /J \"{junction}\" \"{outside.Path}\"")
- { CreateNoWindow = true, UseShellExecute = false }))
+ string precious = outside.Write("precious.txt", "keep me");
+ (StellarInstallation installation, InstallationRegistry registry, _) = Installed(directory);
+
+ string junction = Path.Combine(installation.Packages, "linked");
+ using (Process? mklink = Process.Start(
+ new ProcessStartInfo("cmd.exe", $"/c mklink /J \"{junction}\" \"{outside.Path}\"")
+ { CreateNoWindow = true, UseShellExecute = false }))
+ {
mklink!.WaitForExit();
+ }
+
Directory.Exists(junction).Should().BeTrue("the junction must exist for this test to mean anything");
- EngineUninstaller.Uninstall(installation, NullToolLogger.Instance, new UninstallOptions { Registry = registry });
+ EngineUninstaller.Uninstall(installation, NullToolLogger.Instance,
+ new UninstallOptions { Registry = registry });
Directory.Exists(installation.Packages).Should().BeFalse();
File.ReadAllText(precious).Should().Be("keep me");
diff --git a/Shared/Build/Stellar.Core.Build.targets b/Shared/Build/Stellar.Core.Build.targets
index e344915..1cc3b3d 100644
--- a/Shared/Build/Stellar.Core.Build.targets
+++ b/Shared/Build/Stellar.Core.Build.targets
@@ -12,5 +12,8 @@
+
+
+
diff --git a/Shared/Build/Stellar.Versions.props b/Shared/Build/Stellar.Versions.props
index 42e8fe2..ec43021 100644
--- a/Shared/Build/Stellar.Versions.props
+++ b/Shared/Build/Stellar.Versions.props
@@ -25,13 +25,25 @@
https://quantumdevteam.github.io/StellarEngine-Core/
$(StellarSiteUri)schemas/
-
+
https://quantumdevteam.github.io/StellarEngine-Mono/
+
+
+
+ https://notagood.org/docs/
+ stellar-core
+ stellar-engine
+
diff --git a/Shared/Docs/Template/public/main.css b/Shared/Docs/Template/public/main.css
deleted file mode 100644
index 3e66746..0000000
--- a/Shared/Docs/Template/public/main.css
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- The theme of the StellarEngine sites, over the "modern" template of DocFX: the sites of the core and of the
- orchestra list this folder last in "template", the template of a module carries a copy.
-*/
-
-:root {
- --stellar-accent: #8a63ff;
- --stellar-accent-strong: #6d3df5;
-}
-
-[data-bs-theme="dark"] {
- --stellar-accent: #a98bff;
- --stellar-accent-strong: #c4b0ff;
-}
-
-/* The brand: the icon and the name side by side, a fixed size, room before the menu */
-.navbar-brand {
- display: inline-flex;
- align-items: center;
- gap: 0.55rem;
- margin-right: 1.75rem;
- font-weight: 600;
- letter-spacing: 0.01em;
- white-space: nowrap;
-}
-
-/* The icon is wide (Shared/Branding/stellar_icon.svg: the emblem without the name): fixed height, its own width */
-.navbar-brand #logo {
- height: 34px;
- width: auto;
- max-width: 84px;
- flex: none;
- object-fit: contain;
-}
-
-/* Entries of the menu stay on one line */
-.navbar-nav .nav-link {
- white-space: nowrap;
-}
-
-/* A thin line under the header instead of a block */
-header .navbar {
- border-bottom: 1px solid var(--bs-border-color-translucent);
-}
-
-/* Links and the active entry in the accent of the logo */
-article a,
-.toc a.active,
-.navbar-nav .nav-link.active {
- color: var(--stellar-accent);
-}
-
-article a:hover {
- color: var(--stellar-accent-strong);
-}
-
-/* Code blocks of one command (the installer) read better a little larger */
-article pre > code {
- font-size: 0.92em;
-}
-
-/* Wide tables of the docs scroll inside the page instead of pushing it */
-article table {
- display: block;
- max-width: 100%;
- overflow-x: auto;
-}
diff --git a/Shared/Templates/Modules/Managed/.github/workflows/docs.yml b/Shared/Templates/Modules/Managed/.github/workflows/docs.yml
index ae87db5..55300e0 100644
--- a/Shared/Templates/Modules/Managed/.github/workflows/docs.yml
+++ b/Shared/Templates/Modules/Managed/.github/workflows/docs.yml
@@ -1,23 +1,27 @@
name: Docs
-# Builds the documentation site of the module from Docs/ with DocFX (docfx.json) and publishes it to GitHub Pages.
-# Pull requests and manual runs on other branches only build; the site is deployed from master only.
-# Repository setting required once: Settings -> Pages -> Source = "GitHub Actions".
+# Publishes the documentation of this repository to GitHub Pages for the Prometheus site (the team site).
+# GitHub Pages is only the storage of the site: static files (the installer, the schemas), the documentation as data
+# (bundle/) and a small embed that redirects to the site when the site is up.
+#
+# This file is a thin wrapper and does not need updates: the steps (ci.py, the bundle builder, the embed) are
+# downloaded from the site on every run (/docs-kit.zip), so they are always the same version as the site.
+# What to build is described by the repository itself in prometheus.json (format prometheus-repo/1, see the DOCS
+# page of the site); without it: Docs/ and the API of the projects in docfx.json.
+# If the site is down, the static files and a page that leads to the site are published; the next run fixes the rest.
+#
+# Repository settings:
+# Settings -> Pages -> Source = "GitHub Actions" (once)
+# Variables (optional): PROMETHEUS_SITE (https://notagood.org by default),
+# PROMETHEUS_PROJECT, PROMETHEUS_TITLE (override prometheus.json)
+# Secrets (optional): PROMETHEUS_SYNC_KEY an API key of the site with the "sync" scope: the site learns about
+# the new build at once instead of on its next check
+# Pull requests and manual runs on other branches only build; Pages is deployed from master only.
on:
push:
branches: [master]
- paths:
- - 'Docs/**'
- - 'README.md'
- - 'docfx.json'
- - '.github/workflows/docs.yml'
pull_request:
- paths:
- - 'Docs/**'
- - 'README.md'
- - 'docfx.json'
- - '.github/workflows/docs.yml'
workflow_dispatch:
permissions:
@@ -31,39 +35,95 @@ env:
DOCFX_VERSION: '2.81.0'
DOTNET_NOLOGO: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
+ PROMETHEUS_SITE: ${{ vars.PROMETHEUS_SITE || 'https://notagood.org' }}
+ PROMETHEUS_PROJECT: ${{ vars.PROMETHEUS_PROJECT }}
+ PROMETHEUS_TITLE: ${{ vars.PROMETHEUS_TITLE }}
+ OUT: artifacts/pages
jobs:
build:
- name: Build site
- runs-on: ubuntu-latest
+ name: Build
+ runs-on: ubuntu-latest # pwsh, python3 and bash are there: "prepare" scripts may use any of them
steps:
- name: Checkout
uses: actions/checkout@v5
- # The global.json of a module pins Stellar.Sdk, not the .NET SDK
- name: Setup .NET
+ if: hashFiles('global.json') != ''
+ uses: actions/setup-dotnet@v5
+ with:
+ global-json-file: global.json
+
+ - name: Setup .NET (no global.json)
+ if: hashFiles('global.json') == ''
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
+ # Installed outside the checkout so a repository NuGet.config (a local feed) is not involved.
- name: Install DocFX
working-directory: ${{ runner.temp }}
run: dotnet tool install docfx --version "$DOCFX_VERSION" --tool-path "$RUNNER_TEMP/docfx"
- - name: Build documentation
- run: '"$RUNNER_TEMP/docfx/docfx" build docfx.json --warningsAsErrors'
+ - name: Prometheus
+ id: prometheus
+ continue-on-error: true
+ run: |
+ set -euo pipefail
+ # NuGet wants the local feed folder of an installation to exist, even empty
+ mkdir -p packages
+ curl -fsSL --retry 2 "$PROMETHEUS_SITE/docs-kit.zip" -o "$RUNNER_TEMP/kit.zip"
+ unzip -q -o "$RUNNER_TEMP/kit.zip" -d "$RUNNER_TEMP/kit"
+ python3 -m pip install --quiet pyyaml
+ python3 "$RUNNER_TEMP/kit/ci.py" --out "$OUT" --docfx "$RUNNER_TEMP/docfx/docfx"
+
+ # The site is down or the build failed: publish the static files and a page that leads to the site.
+ # Self-contained on purpose (no kit): the installer and the schemas keep their addresses whatever happens.
+ - name: Fallback
+ if: steps.prometheus.outcome == 'failure'
+ run: |
+ echo "::warning title=Prometheus::The documentation was not built (is $PROMETHEUS_SITE up?); publishing the static files only"
+ mkdir -p "$OUT" && touch "$OUT/.nojekyll"
+ python3 - <<'PY'
+ import glob, html, json, os, re, shutil
+ out = os.environ["OUT"]
+ cfg = json.load(open("prometheus.json", encoding="utf-8-sig")) if os.path.isfile("prometheus.json") else {}
+ static = cfg.get("static") or next((a.get("docfx") if isinstance(a, dict) else a for a in cfg.get("api") or []), None) \
+ or ("docfx.json" if os.path.isfile("docfx.json") else None)
+ for config in ([static] if isinstance(static, str) else static or []):
+ if not os.path.isfile(config):
+ continue
+ base = os.path.dirname(os.path.abspath(config))
+ for r in json.load(open(config, encoding="utf-8-sig")).get("build", {}).get("resource", []):
+ src, dest = os.path.join(base, r.get("src", "")), os.path.join(out, r.get("dest", ""))
+ for pattern in r.get("files", []):
+ for f in glob.glob(os.path.join(src, pattern), recursive=True):
+ if os.path.isfile(f):
+ t = os.path.join(dest, os.path.relpath(f, src))
+ os.makedirs(os.path.dirname(t), exist_ok=True)
+ shutil.copy2(f, t)
+ repo = os.environ.get("GITHUB_REPOSITORY", "").rsplit("/", 1)[-1]
+ project = os.environ.get("PROMETHEUS_PROJECT") or cfg.get("project") or re.sub(r"[^a-z0-9]+", "-", repo.lower()).strip("-")
+ url = html.escape(f"{os.environ['PROMETHEUS_SITE'].rstrip('/')}/docs/{project}")
+ title = html.escape(os.environ.get("PROMETHEUS_TITLE") or cfg.get("title") or repo)
+ with open(os.path.join(out, "index.html"), "w", encoding="utf-8") as f:
+ f.write(f'{title}'
+ f''
+ f'{title} documentation
')
+ PY
- name: Upload Pages artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v5
with:
- path: artifacts/docs/site
+ path: ${{ env.OUT }}
deploy:
name: Deploy to GitHub Pages
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
+ # Never cancel a deployment that is already running.
concurrency:
group: pages
cancel-in-progress: false
@@ -77,3 +137,13 @@ jobs:
- name: Deploy
id: deployment
uses: actions/deploy-pages@v5
+
+ # The site would notice the new bundle on its next check anyway; this makes it immediate.
+ - name: Nudge the site
+ continue-on-error: true
+ env:
+ KEY: ${{ secrets.PROMETHEUS_SYNC_KEY }}
+ run: |
+ if [ -z "$KEY" ]; then echo "::notice::PROMETHEUS_SYNC_KEY is not set: the site picks the docs up on its next check"; exit 0; fi
+ sleep 30 # Pages needs a moment to serve the new files
+ curl -fsS -X POST -H "Authorization: Bearer $KEY" "$PROMETHEUS_SITE/api/v1/sync"
diff --git a/Shared/Templates/Modules/Managed/Docs/index.md b/Shared/Templates/Modules/Managed/Docs/index.md
index 7295789..2dcfffd 100644
--- a/Shared/Templates/Modules/Managed/Docs/index.md
+++ b/Shared/Templates/Modules/Managed/Docs/index.md
@@ -2,8 +2,7 @@
{{ModuleDescription}}
-A `{{ModuleLevel}}` module of [StellarEngine]({{EngineSiteUri}}). Its site is {{ModuleSiteUri}}, built from the Markdown
-files of `Docs/` with DocFX; the whole engine, with every module, is on the [site of the engine]({{EngineSiteUri}}).
+A `{{ModuleLevel}}` module of [StellarEngine](prometheus:{{EngineDocsProject}}). Its documentation is on the [docs site](prometheus:{{ModuleDocsProject}}), built from the Markdown files of `Docs/`; the whole engine, with every module, is on the [site of the engine](prometheus:{{EngineDocsProject}}).
## Using it
diff --git a/Shared/Templates/Modules/Managed/Docs/toc.yml b/Shared/Templates/Modules/Managed/Docs/toc.yml
index f68fcde..6cbb743 100644
--- a/Shared/Templates/Modules/Managed/Docs/toc.yml
+++ b/Shared/Templates/Modules/Managed/Docs/toc.yml
@@ -1,7 +1,7 @@
-# Navigation of the documentation site of the module (DocFX). Paths are relative to this file.
+# Navigation of the documentation site of the module (the bundle of the site). Paths are relative to this file.
- name: Home
href: index.md
- name: README
href: ../README.md
- name: StellarEngine
- href: {{EngineSiteUri}}
+ href: prometheus:{{EngineDocsProject}}
diff --git a/Shared/Templates/Modules/Managed/Template/public/main.css b/Shared/Templates/Modules/Managed/Template/public/main.css
deleted file mode 100644
index 3e66746..0000000
--- a/Shared/Templates/Modules/Managed/Template/public/main.css
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- The theme of the StellarEngine sites, over the "modern" template of DocFX: the sites of the core and of the
- orchestra list this folder last in "template", the template of a module carries a copy.
-*/
-
-:root {
- --stellar-accent: #8a63ff;
- --stellar-accent-strong: #6d3df5;
-}
-
-[data-bs-theme="dark"] {
- --stellar-accent: #a98bff;
- --stellar-accent-strong: #c4b0ff;
-}
-
-/* The brand: the icon and the name side by side, a fixed size, room before the menu */
-.navbar-brand {
- display: inline-flex;
- align-items: center;
- gap: 0.55rem;
- margin-right: 1.75rem;
- font-weight: 600;
- letter-spacing: 0.01em;
- white-space: nowrap;
-}
-
-/* The icon is wide (Shared/Branding/stellar_icon.svg: the emblem without the name): fixed height, its own width */
-.navbar-brand #logo {
- height: 34px;
- width: auto;
- max-width: 84px;
- flex: none;
- object-fit: contain;
-}
-
-/* Entries of the menu stay on one line */
-.navbar-nav .nav-link {
- white-space: nowrap;
-}
-
-/* A thin line under the header instead of a block */
-header .navbar {
- border-bottom: 1px solid var(--bs-border-color-translucent);
-}
-
-/* Links and the active entry in the accent of the logo */
-article a,
-.toc a.active,
-.navbar-nav .nav-link.active {
- color: var(--stellar-accent);
-}
-
-article a:hover {
- color: var(--stellar-accent-strong);
-}
-
-/* Code blocks of one command (the installer) read better a little larger */
-article pre > code {
- font-size: 0.92em;
-}
-
-/* Wide tables of the docs scroll inside the page instead of pushing it */
-article table {
- display: block;
- max-width: 100%;
- overflow-x: auto;
-}
diff --git a/Shared/Templates/Modules/Managed/docfx.json b/Shared/Templates/Modules/Managed/docfx.json
index a007073..d651cee 100644
--- a/Shared/Templates/Modules/Managed/docfx.json
+++ b/Shared/Templates/Modules/Managed/docfx.json
@@ -1,40 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
"build": {
- "content": [
- {
- "src": "Docs",
- "files": [
- "**/*.md",
- "toc.yml"
- ]
- },
- {
- "files": [
- "README.md"
- ]
- }
- ],
"resource": [
{
"files": [
"Branding/Logo.svg"
]
}
- ],
- "output": "artifacts/docs/site",
- "template": [
- "default",
- "modern",
- "Template"
- ],
- "globalMetadata": {
- "_appName": "{{ModuleId}}",
- "_appTitle": "{{ModuleId}}",
- "_appFooter": "{{ModuleId}}, a module of StellarEngine",
- "_appLogoPath": "Branding/Logo.svg",
- "_appFaviconPath": "Branding/Logo.svg",
- "_enableSearch": true
- }
+ ]
}
}
diff --git a/Shared/Templates/Modules/Managed/prometheus.json b/Shared/Templates/Modules/Managed/prometheus.json
new file mode 100644
index 0000000..e2f66c2
--- /dev/null
+++ b/Shared/Templates/Modules/Managed/prometheus.json
@@ -0,0 +1,15 @@
+{
+ "format": "prometheus-repo/1",
+ "project": "{{ModuleDocsProject}}",
+ "title": "{{ModuleId}}",
+ "version": {
+ "file": "{{ModuleId}}.stellar.module",
+ "regex": "\"Version\"\\s*:\\s*\"([^\"]+)\""
+ },
+ "docs": [
+ {
+ "path": "Docs"
+ }
+ ],
+ "static": "docfx.json"
+}
diff --git a/docfx.json b/docfx.json
index 27dc317..6caa42a 100644
--- a/docfx.json
+++ b/docfx.json
@@ -24,25 +24,6 @@
}
],
"build": {
- "content": [
- {
- "src": "Docs",
- "files": [
- "**/*.md",
- "toc.yml"
- ],
- "exclude": [
- "Engine/**"
- ]
- },
- {
- "src": "artifacts/docs/api",
- "dest": "api",
- "files": [
- "**/*.yml"
- ]
- }
- ],
"resource": [
{
"files": [
@@ -64,24 +45,6 @@
"install.ps1"
]
}
- ],
- "output": "artifacts/docs/site",
- "template": [
- "default",
- "modern",
- "Shared/Docs/Template"
- ],
- "globalMetadata": {
- "_appName": "StellarEngine-Core",
- "_appTitle": "StellarEngine-Core",
- "_appFooter": "StellarEngine-Core, the core of StellarEngine, by QuantumDevTeam",
- "_appLogoPath": "Shared/Branding/stellar_icon.svg",
- "_appFaviconPath": "Shared/Branding/stellar_icon.svg",
- "_enableSearch": true,
- "_gitContribute": {
- "repo": "https://github.com/QuantumDevTeam/StellarEngine-Core",
- "branch": "master"
- }
- }
+ ]
}
}
diff --git a/prometheus.json b/prometheus.json
new file mode 100644
index 0000000..801b9d7
--- /dev/null
+++ b/prometheus.json
@@ -0,0 +1,4 @@
+{
+ "format": "prometheus-repo/1",
+ "prepare": "scripts/prometheus.ps1"
+}
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 7d015b7..c56fabf 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -36,6 +36,10 @@
With -Install: do not register this installation for the current user ($STELLAR_HOME or ~/.stellar), and do
not install the 'stellar' command. For sandboxes.
+.PARAMETER SkipModules
+ With -Install: do not build and pack the modules of modules/. Without it they are built after the core, with
+ their tests unless -SkipTests, so games that take the engine as packages find them.
+
.PARAMETER Uninstall
Undoes -Install and the build instead of building: 'stellar uninstall' here (the registration of the user, the
packages of this installation in the NuGet cache, what the installer created), the 'stellar' command, then
@@ -57,6 +61,7 @@ param(
[switch]$Pack,
[switch]$Install,
[switch]$NoUserRegistration,
+ [switch]$SkipModules,
[switch]$Uninstall,
[switch]$All,
[switch]$KeepArtifacts
@@ -181,6 +186,12 @@ if (-not $SkipNative) {
"-p:Configuration=$Configuration" -p:Platform=x64 -m -nologo -v:minimal
}
+ if (-not $SkipTests) {
+ Invoke-Step 'Native tests' {
+ & (Join-Path $root "artifacts/bin/Stellar.Native.Core.Tests/$Configuration/Stellar.Native.Core.Tests.exe")
+ }
+ }
+
# Built by the MSBuild of Visual Studio: the .NET SDK cannot build C++/CLI
if ($canBuildCli) {
Invoke-Step 'C++/CLI wrapper' {
@@ -188,12 +199,6 @@ if (-not $SkipNative) {
-restore "-p:Configuration=$Configuration" -p:Platform=x64 -m -nologo -v:minimal
}
}
-
- if (-not $SkipTests) {
- Invoke-Step 'Native tests' {
- & (Join-Path $root "artifacts/bin/Stellar.Native.Core.Tests/$Configuration/Stellar.Native.Core.Tests.exe")
- }
- }
}
$managed = Join-Path $root 'StellarEngine-Core.Managed.slnf'
@@ -212,7 +217,12 @@ foreach ($variant in $wrappers) {
}
if ($Pack) {
- $projects = 'Kernel/src/Managed/Stellar.Kernel', 'Core/src/Managed/Stellar.Core', 'Runtime/src/Managed/Stellar.Runtime', 'SDK/src/Stellar.Tools', 'SDK/src/Stellar.Cli', 'SDK/src/MSBuild/Stellar.Sdk'
+ $projects = 'Kernel/src/Managed/Stellar.Kernel',
+ 'Core/src/Managed/Stellar.Core',
+ 'Runtime/src/Managed/Stellar.Runtime',
+ 'SDK/src/Stellar.Tools',
+ 'SDK/src/Stellar.Cli',
+ 'SDK/src/MSBuild/Stellar.Sdk'
foreach ($project in $projects) {
$csproj = Join-Path $root "$project/$(Split-Path $project -Leaf).csproj"
@@ -251,6 +261,21 @@ if ($Install) {
# Registration and the command go together: both belong to the user, not to the checkout
if (-not $NoUserRegistration) { Install-StellarTool }
+
+ $modules = @(Get-ChildItem (Join-Path $root 'modules') -Filter '*.stellar.module' -Recurse -Depth 1 -ErrorAction SilentlyContinue)
+ if (-not $SkipModules -and $modules.Count -gt 0) {
+ $arguments = @('modules', 'build', '--pack', '-c', $Configuration, '--wrapper', $Wrapper)
+ if (-not $SkipTests) { $arguments += '--tests' }
+
+ Invoke-Step "Modules ($($modules.Count))" {
+ Push-Location $root
+ try {
+ dotnet run --project (Join-Path $root 'SDK/src/Stellar.Cli/Stellar.Cli.csproj') -c $Configuration --no-build -- @arguments
+ } finally {
+ Pop-Location
+ }
+ }
+ }
}
-Write-Host "StellarEngine-Core built ($Configuration, wrappers: $($wrappers -join ', '), packed with: $Wrapper) in $root" -ForegroundColor Green
+Write-Host "StellarEngine built ($Configuration, wrappers: $($wrappers -join ', '), packed with: $Wrapper) in $root" -ForegroundColor Green
diff --git a/scripts/orchestra-site.ps1 b/scripts/orchestra-site.ps1
deleted file mode 100644
index 388b524..0000000
--- a/scripts/orchestra-site.ps1
+++ /dev/null
@@ -1,230 +0,0 @@
-<#
-.SYNOPSIS
- Generates the DocFX project of the orchestra site: the core and every module of the tree in one site.
-
-.DESCRIPTION
- The mirror (StellarEngine-Mono) holds the core at its root and every component in modules// and
- tools//. Its site gathers them:
-
- / the home of StellarEngine: getting started, what the orchestra is made of
- /guide/ the guide of the whole engine: Docs/Engine of the core (installing, architecture,
- modules, the orchestra, the project), with README, CONTRIBUTING, LICENSE at /
- /core/ the core as a component: the rest of its Docs/, /core/api/ its API reference
- /modules// the Docs/ of each module (each also has a site of its own)
- /tools// the same for tools
- /install.ps1 the installer, /schemas/ the JSON schemas
-
- The project is written to docfx.orchestra.json at the root, its pages to artifacts/orchestra/ (both generated,
- never edited, ignored by git); build it with 'docfx docfx.orchestra.json'. The docs workflow does that when the tree is a mirror: scripts/mirror.ps1
- puts a .orchestra file at the root of every snapshot, with the commits it was made of.
-
-.PARAMETER Output
- The folder of the generated pages (the hub and its navigation). artifacts/orchestra by default.
-#>
-param(
- [string]$Output = ''
-)
-
-$ErrorActionPreference = 'Stop'
-$root = Split-Path $PSScriptRoot -Parent
-if (-not $Output) { $Output = Join-Path $root 'artifacts/orchestra' }
-$Output = [System.IO.Path]::GetFullPath($Output)
-New-Item -ItemType Directory -Force $Output | Out-Null
-
-# DocFX takes the paths of a project relative to it
-function Get-FromProject([string]$Path) {
- $from = [System.Uri]::new($Output.TrimEnd('\', '/') + '/')
- $to = [System.Uri]::new([System.IO.Path]::GetFullPath($Path).TrimEnd('\', '/') + '/')
- return [System.Uri]::UnescapeDataString($from.MakeRelativeUri($to).ToString()).TrimEnd('/')
-}
-
-# The project itself lies at the root, above every source: DocFX resolves nested tables of contents wrongly for
-# sources above the folder of its project
-$project_ = Join-Path $root 'docfx.orchestra.json'
-function Get-FromRoot([string]$Path) {
- return [System.IO.Path]::GetFullPath($Path).Substring($root.TrimEnd('\', '/').Length).TrimStart('\', '/').Replace('\', '/')
-}
-
-$versions = [System.IO.File]::ReadAllText((Join-Path $root 'Shared/Build/Stellar.Versions.props'))
-$orchestra = [regex]::Match($versions, '([^<]+)<').Groups[1].Value
-$site = [regex]::Match($versions, '([^<]+)<').Groups[1].Value
-$host_ = ([System.Uri]$site).GetLeftPart([System.UriPartial]::Authority)
-
-# What the snapshot was made of, if this is one
-$snapshot = @{}
-$marker = Join-Path $root '.orchestra'
-if (Test-Path $marker) {
- foreach ($component in (Get-Content $marker -Raw | ConvertFrom-Json).Components) { $snapshot[$component.Name] = $component }
-}
-
-$rootPath = Get-FromProject $root
-# Links of the hub name source files, as DocFX resolves them; the site paths follow from the content mapping below
-$engineDocs = Get-FromProject (Join-Path $root 'Docs/Engine')
-$coreDocs = Get-FromProject (Join-Path $root 'Docs')
-$coreApi = Get-FromProject (Join-Path $root 'artifacts/docs/api')
-$content = [System.Collections.Generic.List[object]]::new()
-$navigation = [System.Collections.Generic.List[string]]::new()
-$rows = [System.Collections.Generic.List[string]]::new()
-
-# ---- The guide of the engine ----
-# Docs/Engine of the core: the pages about the engine as a whole live there, published here only
-$content.Add([ordered]@{ src = 'Docs/Engine'; dest = 'guide'; files = @('**/*.md', 'toc.yml') })
-$content.Add([ordered]@{ files = @('README.md', 'CONTRIBUTING.md', 'LICENSE.md') })
-
-# ---- The core, a component ----
-$content.Add([ordered]@{ src = 'Docs'; dest = 'core'; files = @('**/*.md', 'toc.yml'); exclude = @('Engine/**') })
-$content.Add([ordered]@{ src = 'artifacts/docs/api'; dest = 'core/api'; files = @('**/*.yml') })
-$coreCommit = if ($snapshot['StellarEngine-Core']) { "``$($snapshot['StellarEngine-Core'].Commit.Substring(0, 10))``" } else { '' }
-$coreRepository = if ($snapshot['StellarEngine-Core'] -and $snapshot['StellarEngine-Core'].Repository) { ", [repository]($($snapshot['StellarEngine-Core'].Repository -replace '\.git$', ''))" } else { '' }
-$rows.Add("| [StellarEngine-Core]($coreDocs/index.md) | the kernel, the core, the runtime, the SDK and the tools | $coreCommit | [site]($site)$coreRepository |")
-
-# ---- The components ----
-$componentNavigation = [System.Collections.Generic.List[string]]::new()
-foreach ($area in 'modules', 'tools') {
- $directory = Join-Path $root $area
- if (-not (Test-Path $directory)) { continue }
-
- foreach ($component in (Get-ChildItem $directory -Directory | Sort-Object Name)) {
- if ($component.Name.StartsWith('_')) { continue }
- # tools/compilers belongs to the installer, not to a component
- if ($area -eq 'tools' -and $component.Name -eq 'compilers') { continue }
- $docs = Join-Path $component.FullName 'Docs'
-
- $description = ''
- $descriptor = Join-Path $component.FullName "$($component.Name).stellar.module"
- if (Test-Path $descriptor) { $description = (Get-Content $descriptor -Raw | ConvertFrom-Json).Description }
-
- $commit = if ($snapshot[$component.Name]) { "``$($snapshot[$component.Name].Commit.Substring(0, 10))``" } else { '' }
- $componentDocs = Get-FromProject $docs
- $own = "$host_/$($component.Name)/"
- $repository = if ($snapshot[$component.Name] -and $snapshot[$component.Name].Repository) { ", [repository]($($snapshot[$component.Name].Repository -replace '\.git$', ''))" } else { '' }
-
- if (Test-Path (Join-Path $docs 'index.md')) {
- $content.Add([ordered]@{ src = Get-FromRoot $docs; dest = "$area/$($component.Name)"; files = @('**/*.md', 'toc.yml') })
- # The README of the component, which its pages link to as ../README.md: same place in the site
- if (Test-Path (Join-Path $component.FullName 'README.md')) {
- $content.Add([ordered]@{ src = Get-FromRoot $component.FullName; dest = "$area/$($component.Name)"; files = @('README.md') })
- }
- $rows.Add("| [$($component.Name)]($componentDocs/index.md) | $description | $commit | [site]($own)$repository |")
- $componentNavigation.Add(" - name: $($component.Name)`n href: $componentDocs/index.md")
- }
- else {
- $rows.Add("| $($component.Name) | $description | $commit | [site]($own)$repository |")
- }
- }
-}
-
-# ---- The hub ----
-$installUri = "${site}install.ps1"
-$engineLogo = "$rootPath/Shared/Branding/stellar_1x1.svg"
-$brandLogo = "$rootPath/Shared/Branding/logo_clean.svg"
-$index = @"
-
-
-# StellarEngine $orchestra
-
-A hypermodular game engine built from the bottom up: a C++ native core, a managed core over it, and everything else as
-modules, each in a repository of its own. This is the site of the whole engine: the documentation, the API reference,
-and every module and tool of the orchestra, built from StellarEngine-Mono, the mirror of all of them.
-
-## Getting started
-
-1. **Install the engine.** One command checks the toolchain, clones the core, builds and registers it
- ([what it needs and does]($engineDocs/Install.md)):
-
- ``````powershell
- irm $installUri | iex
- ``````
-
-2. **Check it.** Open a new terminal, so the ``stellar`` command is on the ``PATH``:
-
- ``````powershell
- stellar info
- ``````
-
-3. **Make a module** in the installation, and the solution of the whole installation for the IDE:
-
- ``````powershell
- stellar modules new Managed Stellar.MyModule
- powershell -File \scripts\solution.ps1
- ``````
-
-4. **Build and test it:**
-
- ``````powershell
- stellar modules build Stellar.MyModule --tests
- ``````
-
-5. **Read on:** the [architecture]($engineDocs/Architecture.md), the [design philosophy]($engineDocs/DesignPhilosophy.md),
- [modules]($engineDocs/Modules.md), the [installation and the repositories]($engineDocs/Repository.md),
- and [the core]($coreDocs/index.md) with its [API reference](xref:Stellar.Kernel).
-
-## The orchestra
-
-Every component of this snapshot, with the commit it was taken at, its own site and its repository:
-
-| Component | What | Commit | Links |
-|---|---|---|---|
-$($rows -join "`n")
-
----
-
-
StellarEngine is made by QuantumDevTeam.
-"@
-[System.IO.File]::WriteAllText((Join-Path $Output 'index.md'), $index + "`n", [System.Text.UTF8Encoding]::new($false))
-
-$toc = @"
-- name: Home
- href: index.md
-- name: Install
- href: $engineDocs/Install.md
-- name: Guide
- href: $engineDocs/
-- name: Core
- href: $coreDocs/
-- name: API
- href: $coreApi/
-"@
-if ($componentNavigation.Count -gt 0) { $toc += "`n- name: Modules`n items:`n$($componentNavigation -join "`n")" }
-[System.IO.File]::WriteAllText((Join-Path $Output 'toc.yml'), $toc + "`n", [System.Text.UTF8Encoding]::new($false))
-
-$content.Insert(0, [ordered]@{ src = Get-FromRoot $Output; files = @('index.md', 'toc.yml') })
-
-$project = [ordered]@{
- metadata = @(
- [ordered]@{
- src = @([ordered]@{
- src = '.'
- files = @(
- 'Kernel/src/Managed/Stellar.Kernel/Stellar.Kernel.csproj',
- 'Core/src/Managed/Stellar.Core/Stellar.Core.csproj',
- 'Runtime/src/Managed/Stellar.Runtime/Stellar.Runtime.csproj',
- 'SDK/src/Stellar.Tools/Stellar.Tools.csproj')
- })
- dest = 'artifacts/docs/api'
- properties = [ordered]@{ TargetFramework = 'net9.0'; StellarNativeWrapper = 'Managed' }
- memberLayout = 'separatePages'
- namespaceLayout = 'nested'
- enumSortOrder = 'declaringOrder'
- })
- build = [ordered]@{
- content = $content
- resource = @(
- [ordered]@{ files = @('Shared/Branding/stellar_1x1.svg', 'Shared/Branding/stellar_icon.svg', 'Shared/Branding/logo_clean.svg') },
- [ordered]@{ src = 'Shared/Schemas'; dest = 'schemas'; files = @('*.json') },
- [ordered]@{ src = 'scripts/bootstrap'; files = @('install.ps1') })
- output = 'artifacts/docs/orchestra-site'
- template = @('default', 'modern', 'Shared/Docs/Template')
- globalMetadata = [ordered]@{
- _appName = 'StellarEngine'
- _appTitle = "StellarEngine $orchestra"
- _appFooter = 'StellarEngine by QuantumDevTeam'
- _appLogoPath = 'Shared/Branding/stellar_icon.svg'
- _appFaviconPath = 'Shared/Branding/stellar_icon.svg'
- _enableSearch = $true
- }
- }
-}
-[System.IO.File]::WriteAllText($project_, ($project | ConvertTo-Json -Depth 10), [System.Text.UTF8Encoding]::new($false))
-
-Write-Host "Orchestra site project: $project_ (core + $($componentNavigation.Count) component site(s))" -ForegroundColor Green
diff --git a/scripts/prometheus.ps1 b/scripts/prometheus.ps1
new file mode 100644
index 0000000..9dbdc79
--- /dev/null
+++ b/scripts/prometheus.ps1
@@ -0,0 +1,98 @@
+<#
+.SYNOPSIS
+ Writes prometheus.json: what the docs site publishes from this tree.
+
+.DESCRIPTION
+ The docs workflow of every repository builds a bundle of its documentation for the docs site, as prometheus.json
+ at the root says (Docs/Engine/Documentation.md). The core commits a small prometheus.json that names this script
+ as "prepare": the workflow runs it first, and it writes the full description in place.
+
+ It knows the layout of the engine, so that the workflow does not:
+ the core Docs/ without Docs/Engine, the API of docfx.json; links into Docs/Engine go to the guide of the
+ engine
+ the mirror (a .orchestra file at the root) the whole engine: the guide (Docs/Engine), the core (Docs/ and
+ its API), and the Docs/ of every module and tool that has a toc.yml
+
+ The projects and the version come from Shared/Build/Stellar.Versions.props, the only place that names them.
+
+.PARAMETER Print
+ Writes the description to the output instead of prometheus.json, to look at it on a machine.
+
+.PARAMETER Output
+ Writes the description to this file instead of prometheus.json, to build a bundle on a machine without changing
+ the file of the repository. The docs workflow names the file in PROMETHEUS_CONFIG_OUT, which -Output overrides.
+#>
+param(
+ [switch]$Print,
+ [string]$Output = ''
+)
+
+$ErrorActionPreference = 'Stop'
+$root = Split-Path $PSScriptRoot -Parent
+
+$versions = [System.IO.File]::ReadAllText((Join-Path $root 'Shared/Build/Stellar.Versions.props'))
+function Get-Property([string]$Name) {
+ $value = [regex]::Match($versions, "<$Name>([^<]+)$Name>").Groups[1].Value
+ if (-not $value) { throw "$Name is missing from Shared/Build/Stellar.Versions.props" }
+ return $value
+}
+
+$coreProject = Get-Property 'StellarDocsProject'
+$engineProject = Get-Property 'StellarEngineDocsProject'
+$version = [ordered]@{ file = 'Shared/Build/Stellar.Versions.props'; xml = 'StellarOrchesterVersion' }
+$api = @([ordered]@{ docfx = 'docfx.json'; prefix = 'api' })
+
+if (Test-Path (Join-Path $root '.orchestra')) {
+ # The mirror: the whole engine in one bundle
+ $docs = [System.Collections.Generic.List[object]]::new()
+ $docs.Add([ordered]@{ path = 'Docs/Engine'; prefix = 'guide'; title = 'Guide' })
+ $docs.Add([ordered]@{ path = 'Docs'; prefix = 'core'; title = 'Core'; exclude = @('Engine/**') })
+
+ foreach ($area in 'modules', 'tools') {
+ $directory = Join-Path $root $area
+ if (-not (Test-Path $directory)) { continue }
+
+ foreach ($component in (Get-ChildItem $directory -Directory | Sort-Object Name)) {
+ # Hidden components (modules/_legacy) and the compilers of the installer are not components to publish
+ if ($component.Name.StartsWith('_') -or $component.Name.StartsWith('.')) { continue }
+ if (-not (Test-Path (Join-Path $component.FullName 'Docs/toc.yml'))) { continue }
+
+ $docs.Add([ordered]@{ path = "$area/$($component.Name)/Docs"; prefix = "$area/$($component.Name)"; title = $component.Name })
+ }
+ }
+
+ $description = [ordered]@{
+ format = 'prometheus-repo/1'
+ project = $engineProject
+ title = 'StellarEngine'
+ version = $version
+ docs = $docs
+ api = @([ordered]@{ docfx = 'docfx.json'; prefix = 'core/api' })
+ static = 'docfx.json'
+ }
+}
+else {
+ # The core: its own pages; the guide of the whole engine lives here too, but is published with the engine
+ $description = [ordered]@{
+ format = 'prometheus-repo/1'
+ project = $coreProject
+ title = 'StellarEngine-Core'
+ version = $version
+ docs = @([ordered]@{ path = 'Docs'; prefix = ''; exclude = @('Engine/**') })
+ api = $api
+ static = 'docfx.json'
+ links = [ordered]@{ 'Docs/Engine/' = "$engineProject/guide/" }
+ }
+}
+
+$json = $description | ConvertTo-Json -Depth 8
+if ($Print) {
+ $json
+ return
+}
+
+# The docs workflow says where the description goes, so that prometheus.json of the repository stays as it is
+if (-not $Output) { $Output = $env:PROMETHEUS_CONFIG_OUT }
+if (-not $Output) { $Output = Join-Path $root 'prometheus.json' }
+[System.IO.File]::WriteAllText([System.IO.Path]::GetFullPath($Output), $json + "`n", [System.Text.UTF8Encoding]::new($false))
+Write-Host "Wrote $Output for $($description.project)"