From 7139a61daba3f8336e0242761daa7832242b387e Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:48:19 +0100 Subject: [PATCH 1/2] =?UTF-8?q?fix(sinople-theme):=20finish=20the=20ReScri?= =?UTF-8?q?pt=20purge=20=E2=80=94=20including=20two=20`rm=20-rf=20/`=20at?= =?UTF-8?q?=20root?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ⚠ SEVERITY FIRST: `just clean` in this repo ran rm -rf /lib rm -rf /node_modules Those are ABSOLUTE paths at the filesystem root. Run in a container or CI job executing as root — which is precisely where `just clean` runs — `rm -rf /lib` destroys the system. This is live on main today. CAUSE Commit 2966736 "chore: complete RSR language purge" substituted the token `rescript` with an EMPTY STRING rather than removing the code that used it. Every path built from it collapsed: rm -rf rescript/lib -> rm -rf /lib ⚠ root path rm -rf rescript/node_modules -> rm -rf /node_modules ⚠ root path cd rescript && npx rescript build -w -> cd && npx build -w if [ -d "rescript" ] -> if [ -d "" ] watch_rescript() -> watch_() rescript) -> ) empty case pattern build:rescript: -> build:: blank-named CI job find rescript/src … -> find /src … scans from root Identified as `rescript` from `npx clean|build|build -w` (ReScript's own CLI verbs) and `node src/examples/example.res.js` — `.res.js` is ReScript compiler output. FIX Removing the dead ReScript paths rather than restoring the token, since ReScript is deliberately banned estate-wide. The purge is finished, not undone. dev.sh watch_rescript(), its empty case arm, the "all" branch starter and the usage entry build.sh the ReScript compile step and the /src copy block Justfile 36 lines across 9 sites: the build-, watch-, test-, lint- and example recipes, the aggregate caller, both `rm -rf /` lines, the *.res.js assemble/clean steps and the loc counter .gitlab-ci.yml the blank-named `build::` job, its dependency reference, the /src find and the /node_modules cache path VERIFIED rm -rf / lines 2 -> 0 blanked scars repo-wide 16 -> 0 dev.sh / build.sh shellcheck -S error: 0 findings each .gitlab-ci.yml parses as YAML, 20 jobs Justfile `just --list` parses, 41 recipes intact Found while fixing shellcheck parse errors in an estate-wide sweep of 5,111 scripts across 375 repos. --- sinople-theme/.gitlab-ci.yml | 19 ------------------ sinople-theme/Justfile | 38 +----------------------------------- sinople-theme/build.sh | 25 ------------------------ sinople-theme/dev.sh | 26 +----------------------- 4 files changed, 2 insertions(+), 106 deletions(-) diff --git a/sinople-theme/.gitlab-ci.yml b/sinople-theme/.gitlab-ci.yml index 3612825..0a6a6e6 100644 --- a/sinople-theme/.gitlab-ci.yml +++ b/sinople-theme/.gitlab-ci.yml @@ -64,33 +64,15 @@ build:wasm: key: rust-wasm-${CI_COMMIT_REF_SLUG} paths: - wasm/semantic_processor/target/ -build:: - stage: build - image: node:${NODE_VERSION} - script: - - cd - - npm install - - npx clean - - npx build - artifacts: - paths: - - /src/**/*.res.js - expire_in: 1 day - cache: - key: node--${CI_COMMIT_REF_SLUG} - paths: - - /node_modules/ build:theme: stage: build dependencies: - build:wasm - - build: script: - mkdir -p wordpress/assets/wasm - mkdir -p wordpress/assets/js - cp wasm/semantic_processor/pkg/*.js wordpress/assets/wasm/ || true - cp wasm/semantic_processor/pkg/*.wasm wordpress/assets/wasm/ || true - - find /src -name "*.res.js" -exec cp {} wordpress/assets/js/ \; || true - echo "✅ Theme assembled" artifacts: paths: @@ -216,7 +198,6 @@ cache: paths: - .cargo/ - wasm/semantic_processor/target/ - - /node_modules/ # ============================================================================ # WORKFLOW RULES # ============================================================================ diff --git a/sinople-theme/Justfile b/sinople-theme/Justfile index 9ade0df..e5fadcf 100644 --- a/sinople-theme/Justfile +++ b/sinople-theme/Justfile @@ -13,11 +13,10 @@ default: # BUILD RECIPES # ============================================================================ -# Build all components (WASM + + Deno) +# Build all components (WASM + Deno) build: @echo "🏗️ Building all components..." just build-wasm - just build- just build-deno just assemble @echo "✅ Build complete!" @@ -29,14 +28,6 @@ build-wasm: wasm-pack build --target web --out-dir pkg @echo "✅ WASM build complete" -# Build only -build-: - @echo "🔧 Compiling ..." - cd && \ - npm install && \ - npx clean && \ - npx build - @echo "✅ compilation complete" # Build Deno application build-deno: @@ -52,7 +43,6 @@ assemble: mkdir -p wordpress/assets/js cp wasm/semantic_processor/pkg/*.js wordpress/assets/wasm/ || true cp wasm/semantic_processor/pkg/*.wasm wordpress/assets/wasm/ || true - find /src -name "*.res.js" -exec cp {} wordpress/assets/js/ \; || true @echo "✅ Assets assembled" # Clean all build artifacts @@ -60,11 +50,8 @@ clean: @echo "🧹 Cleaning build artifacts..." rm -rf wasm/semantic_processor/target rm -rf wasm/semantic_processor/pkg - rm -rf /lib - rm -rf /node_modules rm -rf build rm -rf wordpress/assets/wasm/* - find wordpress/assets/js -name "*.res.js" -delete || true @echo "✅ Clean complete" # ============================================================================ @@ -74,16 +61,11 @@ clean: # Start development mode (watch files) dev: @echo "🔥 Starting development mode..." - @echo "Starting watch..." - cd && npx build -w & @echo "Starting Deno watch..." cd deno && deno task dev & @echo "Press Ctrl+C to stop" wait -# Watch files only -watch-: - cd && npx build -w # Watch Deno files only watch-deno: @@ -111,10 +93,6 @@ test-rust: @echo "Testing Rust code..." cd wasm/semantic_processor && cargo test --lib -# Test code -test-: - @echo "Testing code..." - cd && npm test || echo "No tests configured" # Test Deno code test-deno: @@ -147,10 +125,6 @@ fmt-rust: @echo "Formatting Rust code..." cd wasm/semantic_processor && cargo fmt -# Lint code -lint-: - @echo "Linting code..." - cd && npx build || echo " type-checks on build" # Lint PHP code (requires phpcs) lint-php: @@ -180,7 +154,6 @@ audit-rust: # Audit NPM dependencies audit-npm: @echo "Auditing NPM dependencies..." - cd && npm audit || echo "Run 'npm audit fix' if needed" # Check for known vulnerabilities check-vulns: @@ -265,8 +238,6 @@ stats: @echo "=====================" @echo "Rust:" @find wasm -name "*.rs" | xargs wc -l | tail -1 - @echo ":" - @find /src -name "*.res" | xargs wc -l | tail -1 || echo " 0 lines" @echo "PHP:" @find wordpress -name "*.php" | xargs wc -l | tail -1 @echo "JavaScript:" @@ -289,7 +260,6 @@ check-deps: install-deps: @echo "Installing dependencies..." cargo install wasm-pack - cd && npm install @echo "✅ Dependencies installed" # Show help (alias for default) @@ -317,10 +287,6 @@ ci-build-test: build test # EXAMPLE RECIPES # ============================================================================ -# Run example (loads sample ontology) -example: - @echo "Running example..." - cd && node src/examples/example.res.js || echo "Build first: just build-" # Serve WordPress locally (requires local WordPress) serve: @@ -336,14 +302,12 @@ serve: update: @echo "Updating dependencies..." cd wasm/semantic_processor && cargo update - cd && npm update @echo "✅ Dependencies updated" # Check for outdated dependencies outdated: @echo "Checking for outdated dependencies..." cd wasm/semantic_processor && cargo outdated || cargo install cargo-outdated && cargo outdated - cd && npm outdated || true # ============================================================================ # ADVANCED RECIPES diff --git a/sinople-theme/build.sh b/sinople-theme/build.sh index 6abfa1d..1684b21 100755 --- a/sinople-theme/build.sh +++ b/sinople-theme/build.sh @@ -36,26 +36,6 @@ else echo -e "${RED}⚠️ WASM directory not found, skipping${NC}" fi -# Step 2: Compile -echo -e "${BLUE}🔧 Step 2: Compiling ...${NC}" -if [ -d "" ]; then - cd - - # Install dependencies if needed - if [ ! -d "node_modules" ]; then - echo "Installing dependencies..." - npm install - fi - - # Compile - npx clean - npx build - - echo -e "${GREEN}✅ compilation complete${NC}" - cd .. -else - echo -e "${RED}⚠️ directory not found, skipping${NC}" -fi # Step 3: Bundle Deno application (if applicable) echo -e "${BLUE}🦕 Step 3: Bundling Deno application...${NC}" @@ -91,11 +71,6 @@ if [ -d "wasm/semantic_processor/pkg" ]; then cp wasm/semantic_processor/pkg/*.{js,wasm} wordpress/assets/wasm/ 2>/dev/null || true fi -# Copy compiled files -if [ -d "/src" ]; then - echo "Copying compiled files..." - find /src -name "*.res.js" -exec cp {} wordpress/assets/js/ \; 2>/dev/null || true -fi # Copy build outputs if [ -d "build/" ]; then diff --git a/sinople-theme/dev.sh b/sinople-theme/dev.sh index 698bc4a..704dff9 100755 --- a/sinople-theme/dev.sh +++ b/sinople-theme/dev.sh @@ -32,20 +32,6 @@ cleanup() { trap cleanup SIGINT SIGTERM -# Function: Watch -watch_() { - echo -e "${BLUE}🔧 Starting watch mode...${NC}" - if [ -d "${ROOT_DIR}/" ]; then - cd "${ROOT_DIR}/" - if [ ! -d "node_modules" ]; then - echo "Installing dependencies..." - npm install --silent - fi - npx build -w - else - echo -e "${YELLOW}⚠️ directory not found${NC}" - fi -} # Function: Watch Deno/Fresh watch_deno() { @@ -98,9 +84,6 @@ echo "======================================" echo "" case "${1:-all}" in - ) - watch_ - ;; deno) watch_deno ;; @@ -117,12 +100,6 @@ case "${1:-all}" in echo " Run: ./dev.sh wasm" echo "" - # Start watcher in background - watch_ & - _PID=$! - - # Give a moment to start - sleep 2 # Start Deno if available if command -v deno &> /dev/null && [ -d "${ROOT_DIR}/deno" ]; then @@ -134,7 +111,6 @@ case "${1:-all}" in echo -e "${GREEN}✨ Development mode active${NC}" echo "" echo "Processes running:" - echo " - watcher (PID: ${_PID:-N/A})" [ -n "${DENO_PID}" ] && echo " - Deno Fresh (PID: ${DENO_PID})" echo "" echo "Press Ctrl+C to stop all processes" @@ -144,7 +120,7 @@ case "${1:-all}" in wait ;; *) - echo "Usage: ./dev.sh [|deno|wasm|sync|all]" + echo "Usage: ./dev.sh [deno|wasm|sync|all]" echo "" echo "Commands:" echo " - Watch files only" From 6240be3b502ecb22d6a3fa106ed5192fc51bfe0a Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Wed, 26 Aug 2026 21:25:26 +0100 Subject: [PATCH 2/2] Update sinople-theme/dev.sh Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> --- sinople-theme/dev.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sinople-theme/dev.sh b/sinople-theme/dev.sh index 704dff9..3d9a7a1 100755 --- a/sinople-theme/dev.sh +++ b/sinople-theme/dev.sh @@ -120,10 +120,9 @@ case "${1:-all}" in wait ;; *) - echo "Usage: ./dev.sh [deno|wasm|sync|all]" + echo "Usage: ./dev.sh [deno|wasm|all]" echo "" echo "Commands:" - echo " - Watch files only" echo " deno - Start Deno Fresh dev server only" echo " wasm - Rebuild WASM module once" echo " sync - Sync compiled assets to WordPress"