Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ignore artifacts:
dist-*
pnpm-lock.yaml

# Ignore generated files:
auto-imports.d.ts
components.d.ts
**/@mf-types
**/http-import.lock.data
**/__snapshots__
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 100,
"singleQuote": true
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["biomejs.biome"]
"recommendations": ["rstack.rslint", "esbenp.prettier-vscode"]
}
10 changes: 4 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
"files.exclude": {
"**/.DS_Store": true
},
"editor.defaultFormatter": "biomejs.biome",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"mdx.validate.validateFileLinks": "ignore",
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.words": [
"rstest"
]
"cSpell.words": ["rstest"]
}
9 changes: 8 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ This file provides guidance for AI coding agents working in this repository.
**The primary goal of each example is to demonstrate "how a specific API achieves a specific effect through specific configuration".**

When creating or modifying examples:

- **Keep it minimal**: Only include code necessary to demonstrate the target feature/API
- **Avoid over-engineering**: Don't add complex business logic that distracts from the core demonstration
- **Focus on the tool, not the ecosystem**: For example, in a test runner example, focus on the test runner's APIs (mocking, assertions, configuration), not on complex DOM manipulation or third-party library integrations
- **One concept per example**: Each example should ideally demonstrate one main feature or configuration pattern
- **Clarity over completeness**: A simple, clear example is better than a comprehensive but confusing one

Example of good vs bad:

```
# Good: Demonstrates rstest's mocking API
- Simple mock function usage
Expand All @@ -35,10 +37,12 @@ Example of good vs bad:
## Quick Start (Local)

Prerequisites:

- Node.js per `.nvmrc`
- `corepack` enabled

Common commands:

- Install deps: `corepack enable && pnpm i`
- Build everything: `pnpm run build`
- Build a group:
Expand All @@ -50,13 +54,15 @@ Common commands:
- Test Rspack examples: `pnpm run test:rspack`

Working in a single example:

- `cd rspack/basic` (or any other example dir)
- `pnpm i` (workspace install is preferred at repo root)
- `pnpm run dev` / `pnpm run build` / `pnpm run test` (depends on the example)

## Where Things Live

Top-level directories:

- `rspack/`: Rspack examples (often package name prefix `example-*`).
- `rsbuild/`: Rsbuild examples (often package name prefix `rsbuild-*`).
- `rspress/`: Rspress examples (often package name prefix `rspress-*`).
Expand All @@ -65,7 +71,7 @@ Top-level directories:

## Coding Conventions

- Formatting and linting: `Biome` is used (see `biome.json`).
- Formatting and linting: `Rslint` and `Prettier` are used (see `rslint.config.ts` and `.prettierrc`).
- Default JS/TS quote style is single quotes.
- Line width is 100.
- Prefer minimal, example-focused changes. This repo is a collection of runnable examples; avoid refactors that reduce clarity.
Expand All @@ -87,6 +93,7 @@ Top-level directories:
## Agent Workflow Expectations

When making changes:

- Identify the single example/package impacted.
- Keep changes scoped to that example unless explicitly requested.
- Update configuration consistently with the conventions in that subtree.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ This repository contains comprehensive examples that demonstrate the Rstack ecos

## List of Examples

| [Rspack](https://github.com/web-infra-dev/rspack) | <a href="https://github.com/web-infra-dev/rspack" target="blank"><img src="https://assets.rspack.rs/rspack/rspack-banner.png" width="400" /></a> | [Examples](./rspack) | [Document](https://rspack.rs/) |
| :---------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------: | :----------------------------------: |
| [Rsbuild](https://github.com/web-infra-dev/rsbuild) | <a href="https://github.com/web-infra-dev/rsbuild" target="blank"><img src="https://assets.rspack.rs/rsbuild/rsbuild-banner.png" width="400" /></a> | [Examples](./rsbuild) | [Document](https://rsbuild.rs/) |
| [Rspress](https://github.com/web-infra-dev/rspress) | <a href="https://github.com/web-infra-dev/rspress" target="blank"><img src="https://assets.rspack.rs/rspress/rspress-banner.png" width="400" /></a> | [Examples](./rspress/) | [Document](https://rspress.rs/) |
| [Rsdoctor](https://github.com/web-infra-dev/rsdoctor) | <a href="https://github.com/web-infra-dev/rsdoctor" target="blank"><img src="https://assets.rspack.rs/rsdoctor/rsdoctor-banner.png" width="400" /></a> | [Examples](./rsdoctor/) | [Document](https://rsdoctor.rs/) |
| [Rslib](https://github.com/web-infra-dev/rslib) | <a href="https://github.com/web-infra-dev/rslib" target="blank"><img src="https://assets.rspack.rs/rslib/rslib-banner.png" width="400" /></a> | [Examples](./rslib) | [Document](https://rslib.rs/) |
| [Rspack](https://github.com/web-infra-dev/rspack) | <a href="https://github.com/web-infra-dev/rspack" target="blank"><img src="https://assets.rspack.rs/rspack/rspack-banner.png" width="400" /></a> | [Examples](./rspack) | [Document](https://rspack.rs/) |
| :---------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------: | :------------------------------: |
| [Rsbuild](https://github.com/web-infra-dev/rsbuild) | <a href="https://github.com/web-infra-dev/rsbuild" target="blank"><img src="https://assets.rspack.rs/rsbuild/rsbuild-banner.png" width="400" /></a> | [Examples](./rsbuild) | [Document](https://rsbuild.rs/) |
| [Rspress](https://github.com/web-infra-dev/rspress) | <a href="https://github.com/web-infra-dev/rspress" target="blank"><img src="https://assets.rspack.rs/rspress/rspress-banner.png" width="400" /></a> | [Examples](./rspress/) | [Document](https://rspress.rs/) |
| [Rsdoctor](https://github.com/web-infra-dev/rsdoctor) | <a href="https://github.com/web-infra-dev/rsdoctor" target="blank"><img src="https://assets.rspack.rs/rsdoctor/rsdoctor-banner.png" width="400" /></a> | [Examples](./rsdoctor/) | [Document](https://rsdoctor.rs/) |
| [Rslib](https://github.com/web-infra-dev/rslib) | <a href="https://github.com/web-infra-dev/rslib" target="blank"><img src="https://assets.rspack.rs/rslib/rslib-banner.png" width="400" /></a> | [Examples](./rslib) | [Document](https://rslib.rs/) |

## How to Use

Expand Down
78 changes: 0 additions & 78 deletions biome.json

This file was deleted.

13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,28 @@
"build:rspack": "pnpm --filter \"@rspack-example/*\" --stream build",
"build:rspress": "pnpm --filter \"@rspress-example/*\" --stream build",
"bump": "taze -l",
"lint": "rslint && prettier -c \"*.{json,jsonc,md,yml,yaml,ts}\" \".vscode/*.json\" \"{rspack,rsbuild,rspress,rsdoctor,rslib,rstest}/**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}\"",
"lint:write": "rslint --fix && prettier -w \"*.{json,jsonc,md,yml,yaml,ts}\" \".vscode/*.json\" \"{rspack,rsbuild,rspress,rsdoctor,rslib,rstest}/**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}\"",
"prepare": "husky",
"sort-package-json": "npx sort-package-json \"rspack/*/package.json\" \"rsbuild/*/package.json\" \"rspress/*/package.json\" \"rsdoctor/*/package.json\" \"rslib/*/package.json\" \"rstest/*/package.json\"",
"test:rspack": "pnpm --filter \"@rspack-example/*\" --stream test",
"test:rstest": "pnpm --filter \"@rstest-example/*\" --stream test"
},
"lint-staged": {
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
"npx @biomejs/biome check --write --no-errors-on-unmatched"
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx}": [
"rslint --fix",
"prettier --write"
],
"*.{json,jsonc,md,mdx,yml,yaml,css,scss,less,html,vue}": [
"prettier --write"
]
},
"devDependencies": {
"@biomejs/biome": "^2.4.13",
"@rslint/core": "^0.5.0",
"cross-env": "10.1.0",
"husky": "9.1.7",
"lint-staged": "16.4.0",
"prettier": "^3.8.3",
"taze": "^19.11.0"
},
"packageManager": "pnpm@10.33.2"
Expand Down
Loading
Loading