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..3d9a7a1 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,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"