Skip to content

Commit eb0352a

Browse files
Copilothardfistchenjiahan
authored
chore: set up Copilot instructions for Rspack repository (#11336)
* Initial plan * feat: Add comprehensive GitHub Copilot instructions for Rspack repository Co-authored-by: hardfist <[email protected]> * Update copilot-instructions.md Cleanup * Update copilot-instructions.md --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: hardfist <[email protected]> Co-authored-by: neverland <[email protected]>
1 parent 5cd6aaa commit eb0352a

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

β€Žcopilot-instructions.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Rspack - GitHub Copilot Instructions
2+
3+
## Project Overview
4+
5+
Rspack is a high-performance JavaScript bundler written in Rust that offers strong compatibility with the webpack ecosystem. It provides lightning-fast build speeds while allowing seamless replacement of webpack in existing projects.
6+
7+
## Project Architecture
8+
9+
This is a **monorepo** containing both Rust crates and JavaScript packages:
10+
11+
### Rust crates (`crates/`)
12+
13+
- **Core Engine**: Written in Rust for performance
14+
- **Plugins**: Extensive plugin system (css, javascript, html, etc.)
15+
- **Bindings**: Node.js bindings through NAPI
16+
- **Utilities**: Support crates for paths, collections, macros, etc.
17+
18+
### NPM packages (`packages/`)
19+
20+
- **CLI Tools**: Command-line interface and tooling
21+
- **API Wrappers**: JavaScript APIs wrapping Rust core
22+
- **Test Tools**: Testing utilities and frameworks
23+
- **Create Tools**: Project scaffolding tools
24+
25+
## Development Environment
26+
27+
### Prerequisites
28+
29+
- **Rust**: Uses nightly toolchain (see `rust-toolchain.toml`)
30+
- **Node.js**: 22+
31+
- **pnpm**: enforced in `package.json
32+
33+
### Key Commands
34+
35+
```bash
36+
# Build Rust bindings (development)
37+
pnpm run build:binding:dev
38+
39+
# Build JavaScript packages
40+
pnpm run build:js
41+
42+
# Full development build
43+
pnpm run build:cli:dev
44+
45+
# Run tests
46+
pnpm run test:unit # JavaScript unit tests
47+
pnpm run test:e2e # E2E tests
48+
pnpm run test:webpack # webpack compatibility tests
49+
50+
# Linting
51+
pnpm run lint:js # Linting with Biome
52+
pnpm run lint:type # Type checking with Rslint
53+
```
54+
55+
### File Organization
56+
57+
```
58+
rspack/
59+
β”œβ”€β”€ crates/ # Rust source code
60+
β”œβ”€β”€ packages/ # JavaScript packages
61+
β”œβ”€β”€ tests/ # Integration tests
62+
β”‚ β”œβ”€β”€ webpack-test/ # Webpack compatibility tests
63+
β”‚ β”œβ”€β”€ e2e/ # E2E tests
64+
β”‚ └── bench/ # Benchmarking
65+
└── website/ # Documentation site
66+
```
67+
68+
## Contributing Guidelines
69+
70+
- Follow existing code patterns and conventions
71+
- Add tests for new features
72+
- Update documentation when changing APIs
73+
- Run all linters and tests before submitting
74+
- Use conventional commit messages
75+
- Keep PRs focused and atomic

0 commit comments

Comments
Β (0)