diff --git a/.codex/environments/environment.toml b/.codex/environments/environment.toml index df9fe419ab..f7c3c5551e 100644 --- a/.codex/environments/environment.toml +++ b/.codex/environments/environment.toml @@ -46,7 +46,7 @@ npm ci --prefix src/Exceptionless.Web/ClientApp --prefer-offline --no-audit echo "Installing legacy Angular frontend dependencies..." npm ci --prefix src/Exceptionless.Web/ClientApp.angular --prefer-offline --no-audit -echo "Setup complete. Use the Run Aspire action to start the app." +echo "Setup complete. Use the Run Aspire action to start the app, or Run Lume Docs to test the static site." ''' [cleanup] @@ -62,6 +62,8 @@ echo "Removing repo-local temp/test output only..." rm -rf .cache/tmp rm -rf .aspire rm -rf TestResults +rm -rf docs/_site +rm -rf docs/_cache find . -type d \( -name TestResults -o -name .vite -o -name .svelte-kit \) -exec rm -rf {} + @@ -80,14 +82,38 @@ cd "${CODEX_WORKTREE_PATH:?CODEX_WORKTREE_PATH is required}" export AppMode=Development export DOTNET_ENVIRONMENT=Development export ASPNETCORE_ENVIRONMENT=Development +export ASPIRE_HOME="$CODEX_WORKTREE_PATH/.aspire" if command -v aspire >/dev/null 2>&1; then + mkdir -p "$ASPIRE_HOME" aspire run --nologo --non-interactive else dotnet run --project src/Exceptionless.AppHost/Exceptionless.AppHost.csproj fi ''' +[[actions]] +name = "Run Lume Docs" +icon = "run" +command = ''' +set -e + +cd "${CODEX_WORKTREE_PATH:?CODEX_WORKTREE_PATH is required}/docs" + +export PORT="${PORT:-7141}" + +if ! command -v deno >/dev/null 2>&1; then + echo "deno is not installed or not on PATH. The Lume docs site requires Deno." >&2 + exit 1 +fi + +echo "deno:" +deno --version + +echo "Starting Lume docs at http://127.0.0.1:$PORT/" +deno task serve +''' + [[actions]] name = "Stop Aspire Containers, keep data" icon = "tool" diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 00531e089e..cf2a484f7c 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -21,6 +21,10 @@ jobs: defaults: run: working-directory: docs + env: + EXCEPTIONLESS_SITE_API_KEY: ${{ vars.EXCEPTIONLESS_SITE_API_KEY }} + EXCEPTIONLESS_SITE_SERVER_URL: ${{ vars.EXCEPTIONLESS_SITE_SERVER_URL }} + EXCEPTIONLESS_SITE_VERSION: ${{ github.sha }} steps: - name: Checkout diff --git a/.gitignore b/.gitignore index d1f62c2742..36508301c3 100644 --- a/.gitignore +++ b/.gitignore @@ -81,6 +81,7 @@ k8s/ex-*-snapshots.yaml tmpclaude* dogfood-output/ debug-storybook.log +.aspire/ docs/_cache/ .devcontainer/devcontainer-lock.json diff --git a/docs/_config.ts b/docs/_config.ts index d31c755189..e6f7aeda4d 100644 --- a/docs/_config.ts +++ b/docs/_config.ts @@ -63,9 +63,31 @@ site.hooks.markdownIt((markdownIt: any) => { site.data("docsNavHtml", docsNavHtml) site.data("siteDataJson", siteDataJson) site.data("copyrightYear", new Date().getFullYear()) +site.data("exceptionlessClientScriptSrc", exceptionlessClientScriptSrc()) export default site +function exceptionlessClientScriptSrc(): string { + const apiKey = (Deno.env.get("EXCEPTIONLESS_SITE_API_KEY") ?? "").trim() + if (!apiKey) { + return "" + } + + const params = new URLSearchParams({ apiKey }) + const serverUrl = (Deno.env.get("EXCEPTIONLESS_SITE_SERVER_URL") ?? "").trim() + + if (serverUrl) { + params.set("serverUrl", serverUrl) + } + + const version = (Deno.env.get("EXCEPTIONLESS_SITE_VERSION") ?? "").trim() + if (version) { + params.set("version", version) + } + + return `/assets/js/exceptionless-client.js?${params}` +} + function uniqueHeadingSlug(value: string, env: Record): string { const counts = getHeadingSlugCounts(env) const baseSlug = slugifyHeading(value) || "section" diff --git a/docs/_includes/layouts/base.vto b/docs/_includes/layouts/base.vto index 2e8171a9a5..eed5ab33e4 100644 --- a/docs/_includes/layouts/base.vto +++ b/docs/_includes/layouts/base.vto @@ -63,6 +63,15 @@ + @@ -74,7 +83,35 @@ - {{ content }} +
+ {{ content }} +
+ + + {{ if exceptionlessClientScriptSrc }} + + {{ /if }} + {{ for script of extraScripts || [] }} {{ /for }} - + {{ for script of extraModuleScripts || [] }} + + {{ /for }} diff --git a/docs/_includes/layouts/docs.vto b/docs/_includes/layouts/docs.vto index 19cdd14025..d51764a0c5 100644 --- a/docs/_includes/layouts/docs.vto +++ b/docs/_includes/layouts/docs.vto @@ -3,18 +3,18 @@ layout: layouts/base.vto extraStyles: - /assets/css/prism.css --- -