Skip to content

feat: adding rspress example #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

feat: adding rspress example #19

wants to merge 10 commits into from

Conversation

zackarychapple
Copy link
Contributor

No description provided.

@ryok90 ryok90 added the enhancement New feature or request label Nov 28, 2024
ryok90
ryok90 previously approved these changes Nov 28, 2024
@ryok90 ryok90 changed the title feat: adding repress feat: adding rspress example Nov 28, 2024
@VladyslavZinchenko
Copy link

  1. pnpm i
  2. cd examples/rspress
  3. pnpm build
    AR: asserts not found if build the app
    image

Copy link

cla-assistant bot commented Feb 5, 2025

CLA assistant check
All committers have signed the CLA.

@Nsttt Nsttt closed this Jul 28, 2025
@Nsttt Nsttt reopened this Jul 28, 2025
Copy link

claude bot commented Jul 28, 2025

Claude finished @zackarychapple's task —— View job


PR Review Complete ✅

feat: adding rspress example - This PR adds a new rspress (Rspack-based static site generator) example to the zephyr-examples repository with basic documentation, configuration, and Zephyr Cloud integration.

Note: Writing @claude please review in any comment will trigger a full review.

📋 Review Analysis Table
Severity File/Line(s) Issue Recommendation
Critical examples/rspress/rspress.config.ts:9 Assets not found error during build - icon path may be incorrect Change icon: 'docs/public/rspress-icon.png' to icon: '/rspress-icon.png' to match public directory structure
High examples/rspress/rspress.config.ts:6 Potential path traversal vulnerability with __dirname usage Replace path.join(__dirname, 'docs') with hardcoded 'docs' or validate path
High examples/rspress/package.json:11,15 Catalog dependencies may not resolve correctly Verify catalog:rspress and catalog:zephyr are properly defined in root pnpm-lock.yaml
Medium examples/rspress/rspress.config.ts:22 Missing error handling for Zephyr plugin integration Add try-catch around withZephyr()() call and provide fallback
Medium examples/rspress/docs/guide/index.md:210 Documentation appears incomplete (cuts off mid-sentence) Complete the "Rustify MDX compiler" section with proper configuration example
Medium examples/rspress/package.json:5-8 Missing essential scripts for development workflow Add clean, type-check, and lint scripts following other examples
Low examples/rspress/tsconfig.json:3-4 Minimal TypeScript configuration Add strict mode, target, module resolution settings for better type safety
Low examples/rspress/.gitignore:25 Non-standard gitignore entry doc_build should be docs_build or verify if this is the correct build output directory
🔧 Code Fixes

Fix 1: Asset Path Resolution (Critical)

// examples/rspress/rspress.config.ts:9
- icon: 'docs/public/rspress-icon.png',
+ icon: '/rspress-icon.png',

Fix 2: Secure Path Handling (High)

// examples/rspress/rspress.config.ts:1-6
import * as path from 'path';
import {defineConfig} from 'rspress/config';
import {withZephyr} from "zephyr-rspack-plugin";

export default defineConfig({
- root: path.join(__dirname, 'docs'),
+ root: 'docs',

Fix 3: Enhanced Package Scripts (Medium)

// examples/rspress/package.json:5-8
"scripts": {
  "dev": "rspress dev",
  "build": "rspress build",
  "preview": "rspress preview",
+ "clean": "rm -rf doc_build",
+ "type-check": "tsc --noEmit"
}

Fix 4: Robust Plugin Integration (Medium)

// examples/rspress/rspress.config.ts:19-26
builderConfig: {
  tools: {
    rspack(options) {
+     try {
        return withZephyr()(options);
+     } catch (error) {
+       console.warn('Zephyr plugin failed, using default config:', error);
+       return options;
+     }
    },
  },
},
🏗️ Architecture & Design

Strengths:

  • ✅ Follows established project structure conventions
  • ✅ Proper integration with Zephyr Cloud via rspack plugin
  • ✅ Uses pnpm catalog system for dependency management
  • ✅ Includes comprehensive documentation example

Concerns:

  • ❌ Build failure prevents deployment verification
  • ❌ Limited error handling and validation
  • ❌ Basic documentation content needs expansion
  • ❌ Missing development workflow scripts
🔒 Security & Performance
  • Path Traversal Risk: Using __dirname with user-controlled paths
  • Dependency Resolution: Catalog references need validation
  • Asset Loading: Incorrect paths could expose internal files
  • Performance: Static site generation should be fast, but build failure needs resolution

Quality Score: 6/10

Top 3 Next Steps:

  1. 🚨 Fix Critical Build Issue: Resolve the "assets not found" error by correcting asset paths in configuration
  2. 🔐 Address Security Concerns: Remove __dirname usage and validate all file paths
  3. 📚 Complete Documentation: Finish the incomplete guide sections and add more comprehensive examples

Overall Assessment: This is a solid foundation for an rspress example, but the critical build failure must be resolved before merging. The integration approach is correct, but needs refinement for production readiness.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants