Skip to content

Commit

Permalink
chore: add playground to preview
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Sep 23, 2024
1 parent 3033a6f commit 3faaaf9
Show file tree
Hide file tree
Showing 21 changed files with 4,096 additions and 1,560 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

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@v4
with:
node-version: lts/*

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Install
run: pnpm i

- name: Lint
run: pnpm lint

- name: Build
run: pnpm build

- name: Test
run: pnpm test
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
temp
.npmrc
.yarnrc
*.log
.vscode
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore-workspace-root-check=true
shamefully-hoist=true
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 zouhang <https://github.com/zouhangwithsweet>

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.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# unocss-preset-autoprefixer
> :exclamation: from v0.0.4 this lib use `lightningcss` to generate css prefixer. Before this version, it used `postcss-js`
> :exclamation: from v0.0.4 this lib use `lightningcss` to generate css prefixer. Before this version, it used `postcss-js`
[![npm version](https://badge.fury.io/js/unocss-preset-autoprefixer.svg?v=20230729)](https://badge.fury.io/js/unocss-preset-autoprefixer)

Expand Down
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ export default defineBuildConfig({
rollup: {
emitCJS: true,
},
externals: ['lightningcss', 'browserslist']
externals: ['lightningcss', 'browserslist'],
})
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import antfu from '@antfu/eslint-config'

export default antfu()
66 changes: 43 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,74 @@
{
"name": "unocss-preset-autoprefixer",
"type": "module",
"version": "0.0.7",
"description": "unocss-preset",
"main": "./dist/index.cjs",
"scripts": {
"build": "unbuild",
"stub": "unbuild --stub",
"test": "vitest"
},
"packageManager": "[email protected]",
"description": "unocss preset for autoprefixer",
"author": "zouhang <https://github.com/zouhangwithsweet>",
"license": "MIT",
"homepage": "https://github.com/unpreset/unocss-preset-autoprefixer#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/zouhangwithsweet/unocss-preset-autoprefixer.git"
"url": "git+https://github.com/unpreset/unocss-preset-autoprefixer.git"
},
"keywords": [
"unocss"
],
"author": "zouhang",
"license": "MIT",
"bugs": {
"url": "https://github.com/zouhangwithsweet/unocss-preset-autoprefixer/issues"
"url": "https://github.com/unpreset/unocss-preset-autoprefixer/issues"
},
"homepage": "https://github.com/zouhangwithsweet/unocss-preset-autoprefixer#readme",
"keywords": [
"unocss",
"unpreset",
"unocss-preset",
"unocss-preset-autoprefixer"
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./dist/index.d.ts"
]
}
},
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"dev": "unbuild --stub",
"prepublishOnly": "pnpm run build",
"release": "bumpp --commit --push --tag && pnpm publish",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest",
"test:update": "vitest --update",
"play": "pnpm -C playground run dev"
},
"peerDependencies": {
"browserslist": ">=4.21.3",
"lightningcss": ">=1.16.0",
"unocss": ">=0.45.5"
},
"devDependencies": {
"@types/node": "^22.4.2",
"@antfu/eslint-config": "^3.7.1",
"@types/node": "^22.5.5",
"@types/postcss-js": "^4.0.4",
"@unocss/preset-uno": "^0.62.2",
"@unocss/preset-uno": "^0.62.4",
"browserslist": "^4.23.3",
"lightningcss": "^1.26.0",
"typescript": "^5.5.4",
"lightningcss": "^1.27.0",
"typescript": "5.5.4",
"unbuild": "^2.0.0",
"unocss": "^0.62.2",
"vitest": "^2.0.5"
"unocss": "^0.62.4",
"vitest": "^2.1.1"
},
"browserslist": [
"> 1%",
Expand Down
13 changes: 13 additions & 0 deletions playground/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UnPreset Starter</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "playground",
"type": "module",
"private": true,
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build"
},
"dependencies": {
"vue": "^3.4.37"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.2",
"typescript": "^5.5.3",
"vite": "^5.4.1",
"vue-tsc": "^2.0.29"
}
}
14 changes: 14 additions & 0 deletions playground/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<div>
<div class="flex">
auto prefixer
</div>
</div>
</template>

<style>
:root{
color: #fff;
background: #222;
}
</style>
5 changes: 5 additions & 0 deletions playground/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createApp } from 'vue'
import App from './App.vue'
import 'uno.css'

createApp(App).mount('#app')
9 changes: 9 additions & 0 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"lib": ["esnext", "dom"],
"types": [
"vite/client"
]
}
}
1 change: 1 addition & 0 deletions playground/uno.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '../uno.config'
8 changes: 8 additions & 0 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'
import { defineConfig } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [Vue(), UnoCSS()],
})
Loading

0 comments on commit 3faaaf9

Please sign in to comment.