Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 12, 2023
0 parents commit 7c31ec0
Show file tree
Hide file tree
Showing 26 changed files with 5,224 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
root = true

[*]
indent_size = 2
end_of_line = lf
insert_final_newline = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: sxzz
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
extends: ['github>sxzz/renovate-config'],
}
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
59 changes: 59 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Unit Test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set node
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint

- name: Typecheck
run: nr typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node: [16, 18, 20]
fail-fast: false

steps:
- uses: actions/checkout@v3

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: nr build

- name: Test
run: nr test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.DS_Store
dist
*.log
.vercel
.eslintcache
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.formatOnSave": true,
"eslint.experimental.useFlatConfig": true
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright © 2023-PRESENT 三咲智子 (https://github.com/sxzz)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
92 changes: 92 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# unplugin-lightningcss [![npm](https://img.shields.io/npm/v/unplugin-lightningcss.svg)](https://npmjs.com/package/unplugin-lightningcss)

[![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)

Starter template for [unplugin](https://github.com/unjs/unplugin).

## Installation

```bash
npm i -D unplugin-lightningcss
```

<details>
<summary>Vite</summary><br>

```ts
// vite.config.ts
import LightningCSS from 'unplugin-lightningcss/vite'

export default defineConfig({
plugins: [LightningCSS()],
})
```

<br></details>

<details>
<summary>Rollup</summary><br>

```ts
// rollup.config.js
import LightningCSS from 'unplugin-lightningcss/rollup'

export default {
plugins: [LightningCSS()],
}
```

<br></details>

<details>
<summary>esbuild</summary><br>

```ts
// esbuild.config.js
import { build } from 'esbuild'

build({
plugins: [require('unplugin-lightningcss/esbuild')()],
})
```

<br></details>

<details>
<summary>Webpack</summary><br>

```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [require('unplugin-lightningcss/webpack')()],
}
```

<br></details>

<details>
<summary>Vue CLI</summary><br>

```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [require('unplugin-lightningcss/webpack')()],
},
}
```

<br></details>

## Sponsors

<p align="center">
<a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
<img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
</a>
</p>

## License

[MIT](./LICENSE) License © 2023-PRESENT [三咲智子](https://github.com/sxzz)
2 changes: 2 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const { sxzz } = require('@sxzz/eslint-config')
module.exports = sxzz()
128 changes: 128 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"name": "unplugin-lightningcss",
"version": "0.0.0",
"packageManager": "[email protected]",
"description": "Unplugin for Lightning CSS.",
"keywords": [
"unplugin",
"rollup",
"vite",
"esbuild",
"webpack"
],
"license": "MIT",
"homepage": "https://github.com/sxzz/unplugin-lightningcss#readme",
"bugs": {
"url": "https://github.com/sxzz/unplugin-lightningcss/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sxzz/unplugin-lightningcss.git"
},
"author": "三咲智子 <[email protected]>",
"files": [
"dist"
],
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": {
"require": "./dist/index.d.ts",
"import": "./dist/index.d.mts"
},
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./vite": {
"types": {
"require": "./dist/vite.d.ts",
"import": "./dist/vite.d.mts"
},
"require": "./dist/vite.js",
"import": "./dist/vite.mjs"
},
"./webpack": {
"types": {
"require": "./dist/webpack.d.ts",
"import": "./dist/webpack.d.mts"
},
"require": "./dist/webpack.js",
"import": "./dist/webpack.mjs"
},
"./rollup": {
"types": {
"require": "./dist/rollup.d.ts",
"import": "./dist/rollup.d.mts"
},
"require": "./dist/rollup.js",
"import": "./dist/rollup.mjs"
},
"./esbuild": {
"types": {
"require": "./dist/esbuild.d.ts",
"import": "./dist/esbuild.d.mts"
},
"require": "./dist/esbuild.js",
"import": "./dist/esbuild.mjs"
},
"./*": [
"./*",
"./*.d.ts"
]
},
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./*"
]
}
},
"publishConfig": {
"access": "public"
},
"scripts": {
"lint": "eslint --cache .",
"lint:fix": "pnpm run lint --fix",
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest",
"typecheck": "tsc --noEmit",
"release": "bumpp && pnpm publish",
"prepublishOnly": "pnpm run build"
},
"dependencies": {
"@rollup/pluginutils": "^5.0.2",
"lightningcss": "^1.21.5",
"magic-string": "^0.30.2",
"unplugin": "^1.4.0"
},
"devDependencies": {
"@sxzz/eslint-config": "^3.3.2",
"@sxzz/prettier-config": "^1.0.4",
"@types/node": "^20.4.8",
"@types/rollup-plugin-css-only": "^3.1.0",
"@vue-macros/test-utils": "^1.1.1",
"bumpp": "^9.1.1",
"eslint": "^8.46.0",
"eslint-define-config": "^1.23.0",
"fast-glob": "^3.3.1",
"prettier": "^3.0.1",
"rollup": "^3.28.0",
"rollup-plugin-css-only": "^4.3.0",
"tsup": "^7.2.0",
"tsx": "^3.12.7",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vitest": "^0.34.1"
},
"engines": {
"node": ">=16.14.0"
},
"prettier": "@sxzz/prettier-config",
"resolutions": {
"@types/rollup-plugin-css-only>rollup": "latest"
}
}
Loading

0 comments on commit 7c31ec0

Please sign in to comment.