Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .claude/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "0.0.1",
"configurations": [
{
"name": "zensical-dev",
"runtimeExecutable": "bash",
"runtimeArgs": [
"-c",
"cd build/v25.2 && uv run zensical serve -a localhost:$PORT"
],
"port": 8000,
"autoPort": true
},
{
"name": "dist-server",
"runtimeExecutable": "bash",
"runtimeArgs": [
"-c",
"uv run python -m http.server $PORT --directory dist"
],
"port": 8003,
"autoPort": true
}
]
}
10 changes: 10 additions & 0 deletions .github/actions/setup-python-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
description: "uv version to use"
required: true
default: "0.9"
node-version:
description: "Node.js version to use"
required: true
default: "20"

runs:
using: "composite"
Expand All @@ -28,3 +32,9 @@ runs:
- name: Install Python dependencies
run: uv sync --frozen
shell: bash

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'
cache-dependency-path: idf-editor/package-lock.json
25 changes: 15 additions & 10 deletions .github/workflows/convert-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,39 @@ jobs:
sudo apt-get update
sudo apt-get install -y pandoc

- name: Build IDF editor bundle
run: |
cd idf-editor && npm ci --silent && npm run build
cp dist/idf-editor.js dist/idf-editor.css ../scripts/assets/

- name: Compute short version
id: short
run: |
SHORT=$(uv run python -c "from scripts.config import version_to_short; print(version_to_short('${{ matrix.version }}'))")
echo "version_short=${SHORT}" >> "$GITHUB_OUTPUT"

- name: Compute cache key
id: cache-key
run: |
SCRIPTS_HASH=$(find scripts/ -type f -name '*.py' -o -name '*.lua' | sort | xargs sha256sum | sha256sum | cut -d' ' -f1)
SCRIPTS_HASH=$(find scripts/ idf-editor/src/ -type f \( -name '*.py' -o -name '*.lua' -o -name '*.ts' -o -name '*.css' \) | sort | xargs sha256sum | sha256sum | cut -d' ' -f1)
echo "key=docs-${{ matrix.version }}-${SCRIPTS_HASH}" >> "$GITHUB_OUTPUT"

- name: Cache built version
id: cache
if: ${{ !inputs.force_rebuild }}
uses: actions/cache@v4
with:
path: build/${{ matrix.version_short }}
path: build/${{ steps.short.outputs.version_short }}
key: ${{ steps.cache-key.outputs.key }}

- name: Compute short version
id: short
run: |
SHORT=$(uv run python -c "from scripts.config import version_to_short; print(version_to_short('${{ matrix.version }}'))")
echo "version_short=${SHORT}" >> "$GITHUB_OUTPUT"

- name: Clone EnergyPlus source (sparse, doc/ only)
- name: Clone EnergyPlus source (sparse, doc/ + idd/)
if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone --filter=blob:none --no-checkout --depth=1 \
--branch ${{ matrix.version }} --single-branch \
https://github.com/NatLabRockies/EnergyPlus.git \
build/sources/${{ matrix.version }}
git -C build/sources/${{ matrix.version }} sparse-checkout set doc
git -C build/sources/${{ matrix.version }} sparse-checkout set doc idd
git -C build/sources/${{ matrix.version }} checkout

- name: Convert docs
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@ __pycache__/
.DS_Store
Thumbs.db

# IDF editor build artifacts
idf-editor/dist/
idf-editor/node_modules/

# Pre-commit cache
.cache
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ serve: ## Serve the full multi-version site from dist/
@echo "Serving full site from dist/ on http://localhost:8003"
@uv run python -m http.server 8003 --directory dist

.PHONY: build-editor
build-editor: ## Build the IDF Monaco editor bundle
@echo "🔧 Building IDF editor bundle..."
@cd idf-editor && npm ci --silent && npm run build
@cp idf-editor/dist/idf-editor.js idf-editor/dist/idf-editor.css scripts/assets/
@echo "✅ IDF editor bundle built and copied to scripts/assets/"

.PHONY: convert
convert: ## Convert a single EnergyPlus version (usage: make convert VERSION=v25.2.0)
convert: build-editor ## Convert a single EnergyPlus version (usage: make convert VERSION=v25.2.0)
@if [ -z "$(VERSION)" ]; then echo "Usage: make convert VERSION=v25.2.0"; exit 1; fi
@echo "Converting EnergyPlus $(VERSION)..."
@mkdir -p build/sources
Expand All @@ -51,7 +58,7 @@ convert: ## Convert a single EnergyPlus version (usage: make convert VERSION=v25
git clone --filter=blob:none --no-checkout --depth=1 \
--branch $(VERSION) --single-branch \
https://github.com/NatLabRockies/EnergyPlus.git build/sources/$(VERSION) && \
git -C build/sources/$(VERSION) sparse-checkout set doc && \
git -C build/sources/$(VERSION) sparse-checkout set doc idd && \
git -C build/sources/$(VERSION) checkout; \
fi
@uv run python -m scripts.convert \
Expand Down
Loading