Skip to content

Commit 31a877e

Browse files
committed
Initial Commit
0 parents  commit 31a877e

23 files changed

+1005
-0
lines changed

.github/renovate.json5

+6
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/release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This action will publish the package to npm and create a GitHub release.
2+
name: Release
3+
4+
on:
5+
# Run `npm run bump` to bump the version and create a git tag.
6+
push:
7+
tags:
8+
- "v*"
9+
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
id-token: write
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
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: 22
30+
cache: "pnpm"
31+
32+
- name: Install Dependencies
33+
run: pnpm install
34+
35+
- name: Publish
36+
uses: JS-DevTools/npm-publish@v3
37+
with:
38+
token: ${{ secrets.NPM_TOKEN }}
39+
40+
- name: Create GitHub Release
41+
uses: ncipollo/release-action@v1
42+
with:
43+
generateReleaseNotes: "true"

.github/workflows/test.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, windows-latest]
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Install Pnpm
27+
run: corepack enable
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 22
33+
cache: "pnpm"
34+
35+
- name: Install Dependencies
36+
run: pnpm install && npx playwright install
37+
38+
- name: Run Test
39+
run: pnpm run test

.gitignore

+15
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

.npmrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Disable the default public-hoist-pattern(*-eslint-*, *-prettier-*)
2+
public-hoist-pattern=
3+
hoist-workspace-packages=true
4+
strict-peer-dependencies=true
5+
engine-strict=true
6+
registry=https://registry.npmjs.org/

.vscode/extensions.json

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

.vscode/settings.json

+18
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

+21
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

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# @rsbuild/plugin-tailwindcss
2+
3+
An Rsbuild plugin to integrate with [Tailwind CSS](https://tailwindcss.com/) V3.
4+
5+
<p>
6+
<a href="https://npmjs.com/package/@rsbuild/plugin-tailwindcss">
7+
<img src="https://img.shields.io/npm/v/@rsbuild/plugin-tailwindcss?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+
<a href="https://npmcharts.com/compare/@rsbuild/plugin-tailwindcss?minimal=true"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-tailwindcss.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
11+
</p>
12+
13+
## Usage
14+
15+
Install:
16+
17+
```bash
18+
npm add @rsbuild/plugin-tailwindcss -D
19+
```
20+
21+
Add plugin to your `rsbuild.config.ts`:
22+
23+
```ts
24+
// rsbuild.config.ts
25+
import { pluginTailwindCSS } from "@rsbuild/plugin-tailwindcss";
26+
27+
export default {
28+
plugins: [pluginTailwindCSS()],
29+
};
30+
```
31+
32+
## License
33+
34+
[MIT](./LICENSE).

biome.json

+31
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

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "@rsbuild/plugin-tailwindcss",
3+
"version": "0.0.0",
4+
"repository": "https://github.com/rspack-contrib/rsbuild-plugin-tailwindcss",
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": "rslib build",
20+
"dev": "rslib build --watch",
21+
"lint": "biome check .",
22+
"lint:write": "biome check . --write",
23+
"prepare": "simple-git-hooks && npm run build",
24+
"test": "playwright test",
25+
"bump": "npx bumpp"
26+
},
27+
"simple-git-hooks": {
28+
"pre-commit": "npm run lint:write"
29+
},
30+
"devDependencies": {
31+
"@biomejs/biome": "^1.9.4",
32+
"@playwright/test": "^1.48.2",
33+
"@rsbuild/core": "^1.1.0",
34+
"@rslib/core": "^0.0.16",
35+
"@types/node": "^22.9.0",
36+
"playwright": "^1.48.2",
37+
"simple-git-hooks": "^2.11.1",
38+
"typescript": "^5.6.3"
39+
},
40+
"peerDependencies": {
41+
"@rsbuild/core": "1.x"
42+
},
43+
"peerDependenciesMeta": {
44+
"@rsbuild/core": {
45+
"optional": true
46+
}
47+
},
48+
"packageManager": "[email protected]",
49+
"publishConfig": {
50+
"access": "public",
51+
"registry": "https://registry.npmjs.org/"
52+
}
53+
}

playground/package.json

+9
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+
}

playground/rsbuild.config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineConfig } from '@rsbuild/core';
2+
import { pluginTailwindCSS } from '../src';
3+
4+
export default defineConfig({
5+
plugins: [pluginTailwindCSS()],
6+
});

playground/src/index.css

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
body {
2+
margin: 0;
3+
color: #fff;
4+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5+
background-image: linear-gradient(to bottom, #020917, #101725);
6+
}
7+
8+
.content {
9+
display: flex;
10+
min-height: 100vh;
11+
line-height: 1.1;
12+
text-align: center;
13+
flex-direction: column;
14+
justify-content: center;
15+
}
16+
17+
.content h1 {
18+
font-size: 3.6rem;
19+
font-weight: 700;
20+
}
21+
22+
.content p {
23+
font-size: 1.2rem;
24+
font-weight: 400;
25+
opacity: 0.5;
26+
}

playground/src/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import './index.css';
2+
3+
document.querySelector('#root').innerHTML = `
4+
<div class="content">
5+
<h1>Vanilla Rsbuild</h1>
6+
<p>Start building amazing things with Rsbuild.</p>
7+
</div>
8+
`;

0 commit comments

Comments
 (0)