Skip to content

Commit f8ecfb6

Browse files
committed
feat: enforce strict linting/typechecking, refactor theme controller, and sync cdd-web-ui
- Add strict TypeScript configuration (tsconfig.json), Flat ESLint with 100% JSDoc coverage (eslint.config.js), Stylelint (.stylelintrc.json), html-validate (.htmlvalidate.json), and Husky pre-commit hook (.husky/pre-commit) blocking staged WASM binaries. - Add multi-page Vite build config (vite.config.js) and cross-platform build automation (Makefile, make.bat) for building and syncing cdd-web-ui without WASM assets. - Refactor script.js into modular, JSDoc-typed theme controller functions with live prefers-color-scheme synchronization, ARIA state management, and safe storage fallbacks. - Expand script.test.js with unit and real-DOM integration tests for index.html and ecosystem.html at 100% coverage. - Refactor styles.css to use CSS custom properties for light/dark themes, remove !important overrides and inline styles, and improve accessibility and responsive layouts. - Deduplicate inline Mermaid SVG IDs in index.html, ecosystem.html, and mmd_gen.sh, and add semantic ARIA attributes. - Harden .github/workflows/deploy-cdd-web-ui.yml with main-site validation, retry/size checks for WASM artifacts, and updated GitHub Actions versions. - Update cdd-web-ui production bundle and cdd-docs-ui Arazzo/OpenAPI 3.2.0 artifacts and type definitions.
1 parent 7d9cec0 commit f8ecfb6

189 files changed

Lines changed: 101933 additions & 20036 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/deploy-cdd-web-ui.yml‎

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Web UI to GitHub Pages
22

33
on:
44
push:
5-
branches: [main, master]
5+
branches: [master]
66
workflow_dispatch:
77

88
permissions:
@@ -18,40 +18,48 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout main site (offscale.github.io)
21-
uses: actions/checkout@v6
21+
uses: actions/checkout@v7
2222
with:
2323
path: main-site
2424

2525
- name: Checkout cdd-web-ui
26-
uses: actions/checkout@v6
26+
uses: actions/checkout@v7
2727
with:
2828
repository: SamuelMarks/cdd-web-ui
2929
path: cdd-web-ui
3030

3131
- name: Checkout cdd-docs-ui
32-
uses: actions/checkout@v6
32+
uses: actions/checkout@v7
3333
with:
3434
repository: SamuelMarks/cdd-docs-ui
3535
path: cdd-docs-ui
3636

3737
- name: Checkout cdd-ctl
38-
uses: actions/checkout@v6
38+
uses: actions/checkout@v7
3939
with:
4040
repository: SamuelMarks/cdd-ctl
4141
path: cdd-ctl
4242

4343
- name: Checkout cdd-openapi-test-harness
44-
uses: actions/checkout@v6
44+
uses: actions/checkout@v7
4545
with:
4646
repository: SamuelMarks/cdd-openapi-test-harness
4747
path: cdd-openapi-test-harness
4848
submodules: recursive
4949

5050
- name: Setup Node.js
51-
uses: actions/setup-node@v6
51+
uses: actions/setup-node@v7
5252
with:
5353
node-version: 20
5454

55+
- name: Validate and Test Main Site (offscale.github.io)
56+
working-directory: ./main-site
57+
run: |
58+
npm ci --ignore-scripts
59+
npm run typecheck
60+
npm run lint
61+
npm test
62+
5563
- name: Install Binaryen
5664
run: sudo apt-get update && sudo apt-get install -y binaryen
5765

@@ -83,17 +91,21 @@ jobs:
8391
wasm-opt -O3 "$wasm_file" -o "./optimized-wasm/$filename" || cp "$wasm_file" "./optimized-wasm/$filename"
8492
done
8593
86-
# Download JS Wrappers and C# Zip manually since fetch_wasm.sh skips them
87-
curl -sL -o ./optimized-wasm/cdd-ts.js "https://github.com/offscale/cdd-ts/releases/latest/download/cdd-ts.js" || true
88-
curl -sL -o ./optimized-wasm/cdd-ts-javy.wasm "https://github.com/offscale/cdd-ts/releases/latest/download/cdd-ts-javy.wasm" || true
89-
curl -sL -o ./optimized-wasm/cdd-java.js "https://github.com/SamuelMarks/cdd-java/releases/latest/download/cdd-java.js" || true
90-
curl -sL -o ./cdd-csharp-wasm.zip "https://github.com/SamuelMarks/cdd-csharp/releases/latest/download/cdd-csharp-wasm.zip" || true
91-
curl -sL -o ./optimized-wasm/openapi_python_client-0.0.1-py3-none-any.whl "https://github.com/offscale/cdd-python-all/releases/latest/download/openapi_python_client-0.0.1-py3-none-any.whl" || true
92-
93-
# Force python-all, java, and ts to true in the generated JSON since they are now present
94-
sed -i 's/"python-all": false/"python-all": true/g' cdd-ctl-wasm-sdk/assets/wasm-support.json || true
95-
sed -i 's/"java": false/"java": true/g' cdd-ctl-wasm-sdk/assets/wasm-support.json || true
96-
sed -i 's/"ts": false/"ts": true/g' cdd-ctl-wasm-sdk/assets/wasm-support.json || true
94+
# Download JS Wrappers and C# Zip with explicit failure reporting and retries
95+
curl -fsSL --retry 3 -o ./optimized-wasm/cdd-ts.js "https://github.com/offscale/cdd-ts/releases/latest/download/cdd-ts.js"
96+
curl -fsSL --retry 3 -o ./optimized-wasm/cdd-ts-javy.wasm "https://github.com/offscale/cdd-ts/releases/latest/download/cdd-ts-javy.wasm"
97+
curl -fsSL --retry 3 -o ./optimized-wasm/cdd-java.js "https://github.com/SamuelMarks/cdd-java/releases/latest/download/cdd-java.js"
98+
curl -fsSL --retry 3 -o ./cdd-csharp-wasm.zip "https://github.com/SamuelMarks/cdd-csharp/releases/latest/download/cdd-csharp-wasm.zip"
99+
curl -fsSL --retry 3 -o ./optimized-wasm/openapi_python_client-0.0.1-py3-none-any.whl "https://github.com/offscale/cdd-python-all/releases/latest/download/openapi_python_client-0.0.1-py3-none-any.whl"
100+
101+
# Enable python-all, java, and ts in wasm-support.json only after verifying downloads succeeded
102+
test -s ./optimized-wasm/openapi_python_client-0.0.1-py3-none-any.whl
103+
test -s ./optimized-wasm/cdd-java.js
104+
test -s ./optimized-wasm/cdd-ts.js
105+
test -s ./optimized-wasm/cdd-ts-javy.wasm
106+
sed -i 's/"python-all": false/"python-all": true/g' cdd-ctl-wasm-sdk/assets/wasm-support.json
107+
sed -i 's/"java": false/"java": true/g' cdd-ctl-wasm-sdk/assets/wasm-support.json
108+
sed -i 's/"ts": false/"ts": true/g' cdd-ctl-wasm-sdk/assets/wasm-support.json
97109
98110
- name: Build cdd-docs-ui
99111
working-directory: ./cdd-docs-ui
@@ -108,11 +120,11 @@ jobs:
108120
- name: Copy WASM Binaries to Web UI
109121
run: |
110122
mkdir -p cdd-web-ui/public/assets/wasm/
111-
cp cdd-ctl/optimized-wasm/*.wasm cdd-web-ui/public/assets/wasm/ || true
112-
cp cdd-ctl/optimized-wasm/*.js cdd-web-ui/public/assets/wasm/ || true
113-
cp cdd-ctl/optimized-wasm/*.whl cdd-web-ui/public/assets/wasm/ || true
114-
unzip -q cdd-ctl/cdd-csharp-wasm.zip -d cdd-web-ui/public/assets/wasm/ || true
115-
cp cdd-ctl/cdd-ctl-wasm-sdk/assets/wasm-support.json cdd-web-ui/public/assets/wasm-support.json || true
123+
cp cdd-ctl/optimized-wasm/*.wasm cdd-web-ui/public/assets/wasm/
124+
cp cdd-ctl/optimized-wasm/*.js cdd-web-ui/public/assets/wasm/
125+
cp cdd-ctl/optimized-wasm/*.whl cdd-web-ui/public/assets/wasm/
126+
unzip -q -o cdd-ctl/cdd-csharp-wasm.zip -d cdd-web-ui/public/assets/wasm/
127+
cp cdd-ctl/cdd-ctl-wasm-sdk/assets/wasm-support.json cdd-web-ui/public/assets/wasm-support.json
116128
117129
- name: Compute base-href and Build Angular App
118130
working-directory: ./cdd-web-ui

‎.gitignore‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ml.svg
1111
c_multiplatform.svg
1212
sdk_cli_docs.svg
1313
interactive_docs.svg
14+
openapi.svg
1415

1516
# Temporary files
1617
1.html
@@ -22,9 +23,8 @@ __pycache__/
2223
*.py[cod]
2324
*.class
2425

25-
openapi.svg
26+
# Build & Coverage Artifacts
2627
cdd-web-ui/assets/wasm/
2728
cdd-web-ui/browser/
28-
node_modules/
2929
dist/
3030
coverage/

‎.htmlvalidate.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": ["html-validate:recommended"],
3+
"rules": {
4+
"no-dup-id": "error",
5+
"no-inline-style": "error",
6+
"no-deprecated-attr": "error",
7+
"wcag/h32": "off",
8+
"no-trailing-whitespace": "off",
9+
"void-style": "off",
10+
"attr-quotes": "error"
11+
}
12+
}

‎.husky/pre-commit‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env sh
2+
# Pre-commit hook enforcing 100% doc coverage, strong typing, lint checks, 100% test coverage, and zero staged WASM binaries.
3+
set -e
4+
5+
if git diff --cached --name-only | grep -q '^cdd-web-ui/assets/wasm/'; then
6+
echo "ERROR: Attempted to commit compiled WASM assets in cdd-web-ui/assets/wasm/. See GEMINI.md." >&2
7+
exit 1
8+
fi
9+
10+
npm run typecheck
11+
npm run lint
12+
npm test

‎.stylelintrc.json‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"extends": ["stylelint-config-standard"],
3+
"rules": {
4+
"declaration-no-important": true,
5+
"no-duplicate-selectors": true,
6+
"declaration-block-no-duplicate-properties": true,
7+
"color-hex-length": null,
8+
"alpha-value-notation": null,
9+
"color-function-notation": null,
10+
"color-function-alias-notation": null,
11+
"value-keyword-case": null,
12+
"custom-property-empty-line-before": null,
13+
"rule-empty-line-before": null,
14+
"comment-empty-line-before": null,
15+
"declaration-empty-line-before": null,
16+
"declaration-block-single-line-max-declarations": null,
17+
"selector-class-pattern": null,
18+
"selector-id-pattern": null,
19+
"keyframes-name-pattern": null,
20+
"media-feature-range-notation": null,
21+
"shorthand-property-no-redundant-values": null,
22+
"font-family-name-quotes": null,
23+
"no-descending-specificity": null,
24+
"property-no-vendor-prefix": null
25+
}
26+
}

‎Makefile‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.PHONY: all build build_cdd_web_ui test lint typecheck clean
2+
3+
all: build
4+
5+
build_cdd_web_ui:
6+
@echo "Building ../cdd-web-ui (production)..."
7+
cd ../cdd-web-ui && ([ -d node_modules/@angular/build ] || npm install) && npm run build:prod -- --base-href /cdd-web-ui/
8+
@echo "Syncing ../cdd-web-ui/dist/cdd-web-ui/browser into ./cdd-web-ui..."
9+
rm -rf cdd-web-ui
10+
mkdir -p cdd-web-ui
11+
cp -r ../cdd-web-ui/dist/cdd-web-ui/browser/* cdd-web-ui/
12+
rm -rf cdd-web-ui/assets/wasm
13+
14+
build: build_cdd_web_ui
15+
npm run build
16+
17+
test:
18+
npm test
19+
20+
lint:
21+
npm run lint
22+
23+
typecheck:
24+
npm run typecheck
25+
26+
clean:
27+
rm -rf dist coverage

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Offscale.github.io
22

3+
[![Deploy Web UI to GitHub Pages](https://github.com/offscale/offscale.github.io/actions/workflows/deploy-cdd-web-ui.yml/badge.svg)](https://github.com/offscale/offscale.github.io/actions/workflows/deploy-cdd-web-ui.yml)
4+
35
This repository hosts the source code for the **Offscale** landing page: [offscale.github.io](https://offscale.github.io).
46

57
Offscale provides modern, rapid application tools, bringing "new compilers to 'solve' software."

‎cdd-web-ui/assets/vs/_commonjsHelpers-CT9FvmAN.js‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)