Skip to content

Commit 7c31ec0

Browse files
committed
feat: init
0 parents  commit 7c31ec0

26 files changed

+5224
-0
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
end_of_line = lf
6+
insert_final_newline = true

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: sxzz

.github/renovate.json5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
extends: ['github>sxzz/renovate-config'],
3+
}

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: lts/*
23+
24+
- run: npx changelogithub
25+
env:
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/unit-test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Unit Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: lts/*
19+
20+
- name: Setup
21+
run: npm i -g @antfu/ni
22+
23+
- name: Install
24+
run: nci
25+
26+
- name: Lint
27+
run: nr lint
28+
29+
- name: Typecheck
30+
run: nr typecheck
31+
32+
test:
33+
runs-on: ${{ matrix.os }}
34+
35+
strategy:
36+
matrix:
37+
os: [ubuntu-latest, windows-latest]
38+
node: [16, 18, 20]
39+
fail-fast: false
40+
41+
steps:
42+
- uses: actions/checkout@v3
43+
44+
- name: Set node ${{ matrix.node }}
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: ${{ matrix.node }}
48+
49+
- name: Setup
50+
run: npm i -g @antfu/ni
51+
52+
- name: Install
53+
run: nci
54+
55+
- name: Build
56+
run: nr build
57+
58+
- name: Test
59+
run: nr test

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
*.log
5+
.vercel
6+
.eslintcache

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"eslint.experimental.useFlatConfig": true
4+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright © 2023-PRESENT 三咲智子 (https://github.com/sxzz)
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: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# unplugin-lightningcss [![npm](https://img.shields.io/npm/v/unplugin-lightningcss.svg)](https://npmjs.com/package/unplugin-lightningcss)
2+
3+
[![Unit Test](https://github.com/sxzz/unplugin-lightningcss/actions/workflows/unit-test.yml/badge.svg)](https://github.com/sxzz/unplugin-lightningcss/actions/workflows/unit-test.yml)
4+
5+
Starter template for [unplugin](https://github.com/unjs/unplugin).
6+
7+
## Installation
8+
9+
```bash
10+
npm i -D unplugin-lightningcss
11+
```
12+
13+
<details>
14+
<summary>Vite</summary><br>
15+
16+
```ts
17+
// vite.config.ts
18+
import LightningCSS from 'unplugin-lightningcss/vite'
19+
20+
export default defineConfig({
21+
plugins: [LightningCSS()],
22+
})
23+
```
24+
25+
<br></details>
26+
27+
<details>
28+
<summary>Rollup</summary><br>
29+
30+
```ts
31+
// rollup.config.js
32+
import LightningCSS from 'unplugin-lightningcss/rollup'
33+
34+
export default {
35+
plugins: [LightningCSS()],
36+
}
37+
```
38+
39+
<br></details>
40+
41+
<details>
42+
<summary>esbuild</summary><br>
43+
44+
```ts
45+
// esbuild.config.js
46+
import { build } from 'esbuild'
47+
48+
build({
49+
plugins: [require('unplugin-lightningcss/esbuild')()],
50+
})
51+
```
52+
53+
<br></details>
54+
55+
<details>
56+
<summary>Webpack</summary><br>
57+
58+
```ts
59+
// webpack.config.js
60+
module.exports = {
61+
/* ... */
62+
plugins: [require('unplugin-lightningcss/webpack')()],
63+
}
64+
```
65+
66+
<br></details>
67+
68+
<details>
69+
<summary>Vue CLI</summary><br>
70+
71+
```ts
72+
// vue.config.js
73+
module.exports = {
74+
configureWebpack: {
75+
plugins: [require('unplugin-lightningcss/webpack')()],
76+
},
77+
}
78+
```
79+
80+
<br></details>
81+
82+
## Sponsors
83+
84+
<p align="center">
85+
<a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
86+
<img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
87+
</a>
88+
</p>
89+
90+
## License
91+
92+
[MIT](./LICENSE) License © 2023-PRESENT [三咲智子](https://github.com/sxzz)

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const { sxzz } = require('@sxzz/eslint-config')
2+
module.exports = sxzz()

package.json

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"name": "unplugin-lightningcss",
3+
"version": "0.0.0",
4+
"packageManager": "[email protected]",
5+
"description": "Unplugin for Lightning CSS.",
6+
"keywords": [
7+
"unplugin",
8+
"rollup",
9+
"vite",
10+
"esbuild",
11+
"webpack"
12+
],
13+
"license": "MIT",
14+
"homepage": "https://github.com/sxzz/unplugin-lightningcss#readme",
15+
"bugs": {
16+
"url": "https://github.com/sxzz/unplugin-lightningcss/issues"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/sxzz/unplugin-lightningcss.git"
21+
},
22+
"author": "三咲智子 <[email protected]>",
23+
"files": [
24+
"dist"
25+
],
26+
"main": "./dist/index.js",
27+
"module": "./dist/index.mjs",
28+
"types": "./dist/index.d.ts",
29+
"exports": {
30+
".": {
31+
"types": {
32+
"require": "./dist/index.d.ts",
33+
"import": "./dist/index.d.mts"
34+
},
35+
"require": "./dist/index.js",
36+
"import": "./dist/index.mjs"
37+
},
38+
"./vite": {
39+
"types": {
40+
"require": "./dist/vite.d.ts",
41+
"import": "./dist/vite.d.mts"
42+
},
43+
"require": "./dist/vite.js",
44+
"import": "./dist/vite.mjs"
45+
},
46+
"./webpack": {
47+
"types": {
48+
"require": "./dist/webpack.d.ts",
49+
"import": "./dist/webpack.d.mts"
50+
},
51+
"require": "./dist/webpack.js",
52+
"import": "./dist/webpack.mjs"
53+
},
54+
"./rollup": {
55+
"types": {
56+
"require": "./dist/rollup.d.ts",
57+
"import": "./dist/rollup.d.mts"
58+
},
59+
"require": "./dist/rollup.js",
60+
"import": "./dist/rollup.mjs"
61+
},
62+
"./esbuild": {
63+
"types": {
64+
"require": "./dist/esbuild.d.ts",
65+
"import": "./dist/esbuild.d.mts"
66+
},
67+
"require": "./dist/esbuild.js",
68+
"import": "./dist/esbuild.mjs"
69+
},
70+
"./*": [
71+
"./*",
72+
"./*.d.ts"
73+
]
74+
},
75+
"typesVersions": {
76+
"*": {
77+
"*": [
78+
"./dist/*",
79+
"./*"
80+
]
81+
}
82+
},
83+
"publishConfig": {
84+
"access": "public"
85+
},
86+
"scripts": {
87+
"lint": "eslint --cache .",
88+
"lint:fix": "pnpm run lint --fix",
89+
"build": "tsup",
90+
"dev": "tsup --watch",
91+
"test": "vitest",
92+
"typecheck": "tsc --noEmit",
93+
"release": "bumpp && pnpm publish",
94+
"prepublishOnly": "pnpm run build"
95+
},
96+
"dependencies": {
97+
"@rollup/pluginutils": "^5.0.2",
98+
"lightningcss": "^1.21.5",
99+
"magic-string": "^0.30.2",
100+
"unplugin": "^1.4.0"
101+
},
102+
"devDependencies": {
103+
"@sxzz/eslint-config": "^3.3.2",
104+
"@sxzz/prettier-config": "^1.0.4",
105+
"@types/node": "^20.4.8",
106+
"@types/rollup-plugin-css-only": "^3.1.0",
107+
"@vue-macros/test-utils": "^1.1.1",
108+
"bumpp": "^9.1.1",
109+
"eslint": "^8.46.0",
110+
"eslint-define-config": "^1.23.0",
111+
"fast-glob": "^3.3.1",
112+
"prettier": "^3.0.1",
113+
"rollup": "^3.28.0",
114+
"rollup-plugin-css-only": "^4.3.0",
115+
"tsup": "^7.2.0",
116+
"tsx": "^3.12.7",
117+
"typescript": "^5.1.6",
118+
"vite": "^4.4.9",
119+
"vitest": "^0.34.1"
120+
},
121+
"engines": {
122+
"node": ">=16.14.0"
123+
},
124+
"prettier": "@sxzz/prettier-config",
125+
"resolutions": {
126+
"@types/rollup-plugin-css-only>rollup": "latest"
127+
}
128+
}

0 commit comments

Comments
 (0)