Skip to content

fix: default content nav route directory #241

fix: default content nav route directory

fix: default content nav route directory #241

Workflow file for this run

name: Publish to JSR
on:
push:
branches: [main]
paths:
- 'packages/*/deno.json'
- 'packages/*/src/**'
- 'packages/*/README.md'
- 'packages/create/cli.ts'
- '.github/workflows/publish.yml'
workflow_dispatch:
jobs:
# Gate: run tests before publishing
test:
uses: ./.github/workflows/test.yml
publish:
runs-on: ubuntu-latest
needs: [test]
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- name: Install dependencies
run: deno install --node-modules-dir
- name: Publish to JSR (missing versions only)
shell: bash
run: |
set -euo pipefail
publish_if_missing() {
local pkg="$1"
local dir="$2"
local version
version="$(sed -n 's/.*"version": "\([^"]*\)".*/\1/p' "$dir/deno.json" | head -n 1)"
if deno info --no-config "jsr:${pkg}@${version}" >/dev/null 2>&1; then
echo "[JSR] ${pkg}@${version} already exists; skipping."
return 0
fi
echo "[JSR] Publishing ${pkg}@${version}"
(cd "$dir" && deno publish -c deno.json)
}
if [[ -n "$(git status --porcelain)" ]]; then
echo "::error::Refusing to publish from a dirty worktree"
git status --porcelain
exit 1
fi
# Publish in dependency order: no-deps first, then dependents
# rpc, signals have zero LessJS deps → publish first
# core (pure runtime) has zero LessJS deps → publish early
# adapter-vite depends on core only (content dep is dynamic import → runtime only)
# content, i18n need @lessjs/adapter-vite/build-context type → publish after adapter-vite
# adapter-lit depends on core → publish after core
# ui depends on core → publish after core
# app depends on adapter-vite + content + i18n → publish after all three
# create has no LessJS runtime deps → publish anytime
publish_if_missing "@lessjs/rpc" "packages/rpc"
publish_if_missing "@lessjs/signals" "packages/signals"
publish_if_missing "@lessjs/core" "packages/core"
publish_if_missing "@lessjs/adapter-vite" "packages/adapter-vite"
publish_if_missing "@lessjs/content" "packages/content"
publish_if_missing "@lessjs/i18n" "packages/i18n"
publish_if_missing "@lessjs/adapter-lit" "packages/adapter-lit"
publish_if_missing "@lessjs/ui" "packages/ui"
publish_if_missing "@lessjs/app" "packages/app"
publish_if_missing "@lessjs/create" "packages/create"
publish_if_missing "@lessjs/hub" "packages/hub"
# SOP-013: Post-Publish Consumer Smoke Test
# Verifies that freshly published JSR packages form a complete, buildable
# consumer project. This is the final release gate — it catches problems that
# pre-publish testing cannot because the new version does not yet exist on JSR.
consumer-smoke:
runs-on: ubuntu-latest
needs: [publish]
steps:
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- name: Wait for JSR propagation
run: sleep 30
- name: Generate consumer project from JSR
run: |
CONSUMER_DIR="${{ runner.temp }}/lessjs-post-publish-smoke"
rm -rf "$CONSUMER_DIR"
mkdir -p "$CONSUMER_DIR"
cd "$CONSUMER_DIR"
deno run -A jsr:@lessjs/create test-blog
- name: Build consumer project
run: |
CONSUMER_DIR="${{ runner.temp }}/lessjs-post-publish-smoke"
cd "$CONSUMER_DIR/test-blog"
deno task build
- name: Verify output
run: |
CONSUMER_DIR="${{ runner.temp }}/lessjs-post-publish-smoke"
test -f "$CONSUMER_DIR/test-blog/dist/index.html" || {
echo "::error::dist/index.html not found — post-publish consumer build failed"
exit 1
}