Skip to content

Commit 6e3b185

Browse files
authored
Initial commit
0 parents  commit 6e3b185

20 files changed

+2065
-0
lines changed

.github/renovate.json5

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:base", "schedule:monthly", "group:allNonMajor"],
4+
"rangeStrategy": "bump",
5+
"packageRules": [{ "depTypeList": ["peerDependencies"], "enabled": false }]
6+
}

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
# Controls when the action will run.
4+
on:
5+
# Triggers the workflow on pull request events but only for the main branch
6+
pull_request:
7+
branches: [main]
8+
push:
9+
branches: [main]
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install Pnpm
24+
run: corepack enable
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: "pnpm"
31+
32+
- name: Install Dependencies
33+
run: pnpm install && npx playwright install
34+
35+
- name: Run Test
36+
run: pnpm run test

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Local
2+
.DS_Store
3+
*.local
4+
*.log*
5+
6+
# Dist
7+
node_modules
8+
dist/
9+
test-results
10+
11+
# IDE
12+
.vscode/*
13+
!.vscode/settings.json
14+
!.vscode/extensions.json
15+
.idea

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["biomejs.biome"]
3+
}

.vscode/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"search.useIgnoreFiles": true,
3+
"[json]": {
4+
"editor.defaultFormatter": "biomejs.biome"
5+
},
6+
"[typescript]": {
7+
"editor.defaultFormatter": "biomejs.biome"
8+
},
9+
"[javascript]": {
10+
"editor.defaultFormatter": "biomejs.biome"
11+
},
12+
"[javascriptreact]": {
13+
"editor.defaultFormatter": "biomejs.biome"
14+
},
15+
"[css]": {
16+
"editor.defaultFormatter": "biomejs.biome"
17+
}
18+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Rspack Contrib
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# rsbuild-plugin-example
2+
3+
rsbuild-plugin-example is a Rsbuild plugin to do something.
4+
5+
<p>
6+
<a href="https://npmjs.com/package/rsbuild-plugin-example">
7+
<img src="https://img.shields.io/npm/v/rsbuild-plugin-example?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
8+
</a>
9+
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
10+
</p>
11+
12+
## Usage
13+
14+
Install:
15+
16+
```bash
17+
npm add rsbuild-plugin-example -D
18+
```
19+
20+
Add plugin to your `rsbuild.config.ts`:
21+
22+
```ts
23+
// rsbuild.config.ts
24+
import { pluginExample } from "rsbuild-plugin-example";
25+
26+
export default {
27+
plugins: [pluginExample()],
28+
};
29+
```
30+
31+
## Options
32+
33+
### foo
34+
35+
Some description.
36+
37+
- Type: `string`
38+
- Default: `undefined`
39+
- Example:
40+
41+
```js
42+
pluginExample({
43+
foo: "bar",
44+
});
45+
```
46+
47+
## License
48+
49+
[MIT](./LICENSE).

biome.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"vcs": {
7+
"enabled": true,
8+
"defaultBranch": "main",
9+
"clientKind": "git",
10+
"useIgnoreFile": true
11+
},
12+
"formatter": {
13+
"indentStyle": "space"
14+
},
15+
"javascript": {
16+
"formatter": {
17+
"quoteStyle": "single"
18+
}
19+
},
20+
"css": {
21+
"formatter": {
22+
"enabled": true
23+
}
24+
},
25+
"linter": {
26+
"enabled": true,
27+
"rules": {
28+
"recommended": true
29+
}
30+
}
31+
}

package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "rsbuild-plugin-example",
3+
"version": "0.0.0",
4+
"repository": "https://github.com/rspack-contrib/rsbuild-plugin-template",
5+
"license": "MIT",
6+
"type": "module",
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"import": "./dist/index.js",
11+
"require": "./dist/index.cjs"
12+
}
13+
},
14+
"main": "./dist/index.js",
15+
"module": "./dist/index.mjs",
16+
"types": "./dist/index.d.ts",
17+
"files": ["dist"],
18+
"scripts": {
19+
"build": "tsup",
20+
"dev": "tsup --watch",
21+
"lint": "biome check .",
22+
"lint:write": "biome check . --write",
23+
"prepare": "simple-git-hooks && npm run build",
24+
"test": "playwright test"
25+
},
26+
"simple-git-hooks": {
27+
"pre-commit": "npx nano-staged"
28+
},
29+
"nano-staged": {
30+
"*.{js,jsx,ts,tsx,mjs,cjs}": [
31+
"biome check --write --no-errors-on-unmatched"
32+
]
33+
},
34+
"devDependencies": {
35+
"@biomejs/biome": "^1.8.3",
36+
"@playwright/test": "^1.45.3",
37+
"@rsbuild/core": "^1.0.1-beta.11",
38+
"@types/node": "^20.14.13",
39+
"nano-staged": "^0.8.0",
40+
"playwright": "^1.45.3",
41+
"simple-git-hooks": "^2.11.1",
42+
"tsup": "^8.2.3",
43+
"typescript": "^5.5.4"
44+
},
45+
"peerDependencies": {
46+
"@rsbuild/core": "1.x || ^1.0.1-beta.0"
47+
},
48+
"peerDependenciesMeta": {
49+
"@rsbuild/core": {
50+
"optional": true
51+
}
52+
},
53+
"packageManager": "pnpm@9.6.0",
54+
"publishConfig": {
55+
"access": "public",
56+
"registry": "https://registry.npmjs.org/"
57+
}
58+
}

playground/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "playground",
3+
"private": true,
4+
"version": "0.0.0",
5+
"scripts": {
6+
"dev": "npx rsbuild dev",
7+
"build": "npx rsbuild build"
8+
}
9+
}

0 commit comments

Comments
 (0)