Skip to content

Commit c9912d9

Browse files
authored
Initial commit
0 parents  commit c9912d9

23 files changed

+6809
-0
lines changed

.github/workflows/autofix.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: autofix.ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
autofix:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
17+
steps:
18+
- name: Checkout 🛎️
19+
uses: actions/checkout@v4
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
24+
- name: Set node LTS ✨
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: lts/*
28+
29+
- name: Install Dependencies 📦️
30+
run: pnpm i
31+
32+
- name: Lint
33+
run: pnpm lint:fix
34+
35+
- uses: autofix-ci/action@v1

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
typecheck:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout 🛎️
17+
uses: actions/checkout@v4
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@v4
21+
22+
- name: Set node LTS ✨
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: lts/*
26+
cache: pnpm
27+
28+
- name: Install Dependencies 📦️
29+
run: pnpm i
30+
31+
- name: Build
32+
run: pnpm build
33+
34+
- name: Typecheck
35+
run: pnpm typecheck
36+
37+
test:
38+
runs-on: ${{ matrix.os }}
39+
40+
strategy:
41+
matrix:
42+
node: [lts/*]
43+
os: [ubuntu-latest, windows-latest, macos-latest]
44+
fail-fast: false
45+
46+
steps:
47+
- name: Checkout 🛎️
48+
uses: actions/checkout@v4
49+
50+
- name: Install pnpm
51+
uses: pnpm/action-setup@v4
52+
53+
- name: Set node ${{ matrix.node }}
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: ${{ matrix.node }}
57+
cache: pnpm
58+
59+
- name: Install Dependencies 📦️
60+
run: pnpm i
61+
62+
- name: Build
63+
run: pnpm build
64+
65+
- name: Test
66+
run: pnpm test

.gitignore

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

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore-workspace-root-check=true
2+
shamefully-hoist=true

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": "explicit"
4+
},
5+
"editor.formatOnSave": false
6+
}

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) 2023 zyyv
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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<p align="center">
2+
<img src="logo" alt='logo' style="width:100px;" />
3+
</p>
4+
5+
<h1 align="center">unocss-transformer-starter</h1>
6+
7+
<p align="center">A Unocss transformer starter template.</p>
8+
9+
<p align="center">
10+
<a>
11+
<img src="https://img.shields.io/npm/v/unocss-transformer-starter?style=flat&colorA=080f12&colorB=1fa669" alt="npm version" />
12+
</a>
13+
<a>
14+
<img src="https://img.shields.io/npm/dm/unocss-transformer-starter?style=flat&colorA=080f12&colorB=1fa669" alt="npm downloads" />
15+
</a>
16+
<a>
17+
<img src="https://img.shields.io/github/license/unpreset/unocss-transformer-starter.svg?style=flat&colorA=080f12&colorB=1fa669" alt="License" />
18+
</a>
19+
</p>
20+
21+
## Install
22+
```shell
23+
pnpm i -D unocss-transformer-starter
24+
```
25+
26+
```ts
27+
// uno.config.ts
28+
import { defineConfig } from 'unocss'
29+
import transformerAlias from 'unocss-transformer-starter'
30+
31+
export default defineConfig({
32+
// ...
33+
transformers: [
34+
transformerAlias(),
35+
],
36+
})
37+
```
38+
39+
## License
40+
41+
MIT License &copy; 2023-PRESENT [Chris](https://github.com/zyyv)

build.config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
entries: [
5+
'src/index',
6+
],
7+
declaration: true,
8+
clean: true,
9+
rollup: {
10+
emitCJS: true,
11+
},
12+
externals: [
13+
'magic-string',
14+
'unocss',
15+
],
16+
})

eslint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
export default antfu({
4+
ignores: ['README.md', 'dist', 'node_modules'],
5+
})

package.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"name": "unocss-transformer-starter",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"packageManager": "[email protected]",
6+
"description": "A Unocss transformer starter template.",
7+
"license": "MIT",
8+
"homepage": "https://github.com/unpreset/unocss-transformer-starter#readme",
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/unpreset/unocss-transformer-starter.git"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/unpreset/unocss-transformer-starter/issues"
15+
},
16+
"keywords": [
17+
"unpreset",
18+
"unocss",
19+
"unocss transformer"
20+
],
21+
"sideEffects": false,
22+
"exports": {
23+
".": {
24+
"types": "./dist/index.d.ts",
25+
"import": "./dist/index.mjs",
26+
"require": "./dist/index.cjs"
27+
}
28+
},
29+
"main": "./dist/index.cjs",
30+
"module": "./dist/index.mjs",
31+
"types": "./dist/index.d.ts",
32+
"typesVersions": {
33+
"*": {
34+
"*": [
35+
"./dist/*",
36+
"./dist/index.d.ts"
37+
]
38+
}
39+
},
40+
"files": [
41+
"dist"
42+
],
43+
"scripts": {
44+
"build": "unbuild",
45+
"dev": "unbuild --stub",
46+
"prepublishOnly": "pnpm run build",
47+
"release": "bumpp --commit --push --tag && pnpm publish",
48+
"lint": "eslint .",
49+
"lint:fix": "eslint . --fix",
50+
"test": "vitest",
51+
"test:update": "vitest -u",
52+
"typecheck": "tsc --noEmit",
53+
"play": "npm -C playground run dev"
54+
},
55+
"devDependencies": {
56+
"@antfu/eslint-config": "^4.8.1",
57+
"@babel/types": "^7.26.10",
58+
"@types/node": "^22.13.10",
59+
"bumpp": "^10.0.3",
60+
"eslint": "^9.22.0",
61+
"esno": "^4.8.0",
62+
"magic-string": "^0.30.17",
63+
"typescript": "^5.8.2",
64+
"unbuild": "^3.5.0",
65+
"unocss": "^66.0.0",
66+
"vite": "^6.2.1",
67+
"vitest": "^3.0.8"
68+
}
69+
}

playground/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue + TS</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

playground/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "playground",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"private": true,
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vue-tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"vue": "^3.5.13"
13+
},
14+
"devDependencies": {
15+
"@vitejs/plugin-vue": "^5.2.1",
16+
"typescript": "^5.8.2",
17+
"unocss": "^66.0.0",
18+
"unocss-transformer-starter": "workspace:*",
19+
"vite": "^6.2.1",
20+
"vue-tsc": "^2.2.8"
21+
}
22+
}

playground/src/App.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template>
2+
<div>
3+
<h1>Playground</h1>
4+
<p>hello UnoCSS</p>
5+
</div>
6+
</template>

playground/src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createApp } from 'vue'
2+
// @ts-expect-error anyway
3+
import App from './App.vue'
4+
import 'uno.css'
5+
6+
createApp(App).mount('#app')

playground/tsconfig.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ESNext",
4+
"jsx": "preserve",
5+
"lib": ["ESNext", "DOM"],
6+
"useDefineForClassFields": true,
7+
"module": "ESNext",
8+
"moduleResolution": "Node",
9+
"resolveJsonModule": true,
10+
"strict": true,
11+
"sourceMap": true,
12+
"esModuleInterop": true,
13+
"isolatedModules": true,
14+
"skipLibCheck": true
15+
}
16+
}

playground/uno.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {
2+
defineConfig,
3+
presetUno,
4+
} from 'unocss'
5+
import transformerStarter from 'unocss-transformer-starter'
6+
7+
export default defineConfig({
8+
presets: [
9+
presetUno(),
10+
],
11+
transformers: [
12+
transformerStarter(),
13+
],
14+
})

playground/vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import vue from '@vitejs/plugin-vue'
2+
import UnoCSS from 'unocss/vite'
3+
import { defineConfig } from 'vite'
4+
5+
// https://vitejs.dev/config/
6+
export default defineConfig({
7+
plugins: [vue(), UnoCSS()],
8+
})

0 commit comments

Comments
 (0)