Skip to content

Commit

Permalink
Merge branch 'main' into preset-mini-aria
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed May 24, 2024
2 parents 4362a1e + 32ceb86 commit d8d74a8
Show file tree
Hide file tree
Showing 232 changed files with 4,212 additions and 3,412 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: autofix.ci

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
autofix:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

- name: Use Node.js lts/*
uses: actions/setup-node@v4
with:
node-version: lts/*

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

- name: Install
run: nci
env:
CYPRESS_INSTALL_BINARY: 0

- name: Lint
run: nr lint --fix

- uses: autofix-ci/action@v1
23 changes: 0 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,6 @@ on:
merge_group: {}

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

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

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 18.18.2
cache: pnpm

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

- name: Install
run: nci

- name: Lint
run: nr lint

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

Expand Down
6 changes: 3 additions & 3 deletions bench/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.59.4",
"version": "0.60.3",
"scripts": {
"bench": "node run.mjs"
},
Expand All @@ -12,9 +12,9 @@
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"unocss": "workspace:*",
"vite": "^5.2.9",
"vite": "^5.2.11",
"vite-plugin-windicss": "^1.9.3",
"vue": "^3.4.21",
"vue": "^3.4.27",
"windicss": "^3.5.6"
}
}
2 changes: 1 addition & 1 deletion docs/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}

/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
ContentExample: typeof import('./.vitepress/theme/components/ContentExample.vue')['default']
Expand Down
2 changes: 1 addition & 1 deletion docs/config/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ outputToCssLayers: (layer) => {
if (layer === 'shortcuts')
return 'utilities.shortcuts'

// All other layer will just use their name as the CSS layer name.
// All other layers will just use their name as the CSS layer name.
}
```
4 changes: 2 additions & 2 deletions docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ import { Preset } from 'unocss'
export const myPreset: Preset = {
name: 'my-preset',
rules: [
[/^m-([\.\d]+)$/, ([_, num]) => ({ margin: `${num}px` })],
[/^p-([\.\d]+)$/, ([_, num]) => ({ padding: `${num}px` })],
[/^m-([.\d]+)$/, ([_, num]) => ({ margin: `${num}px` })],
[/^p-([.\d]+)$/, ([_, num]) => ({ padding: `${num}px` })],
],
variants: [/* ... */],
shortcuts: [/* ... */],
Expand Down
6 changes: 3 additions & 3 deletions docs/integrations/postcss.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ This package is in an experimental state right now. It doesn't follow semver, an

::: code-group
```bash [pnpm]
pnpm add -D @unocss/postcss
pnpm add -D unocss @unocss/postcss
```
```bash [yarn]
yarn add -D @unocss/postcss
yarn add -D unocss @unocss/postcss
```
```bash [npm]
npm install -D @unocss/postcss
npm install -D unocss @unocss/postcss
```
:::

Expand Down
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "docs",
"type": "module",
"version": "0.59.4",
"version": "0.60.3",
"private": true,
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
},
"devDependencies": {
"@iconify-json/carbon": "^1.1.31",
"@iconify-json/carbon": "^1.1.33",
"@iconify-json/logos": "^1.1.42",
"@iconify-json/mdi": "^1.1.66",
"@iconify-json/ph": "^1.1.12",
"@iconify-json/ph": "^1.1.13",
"@iconify-json/twemoji": "^1.1.15",
"@iconify-json/vscode-icons": "^1.1.33",
"@iconify-json/vscode-icons": "^1.1.34",
"ofetch": "^1.3.4",
"unocss": "workspace:*",
"vitepress": "^1.1.1"
"vitepress": "^1.1.4"
}
}
25 changes: 24 additions & 1 deletion docs/presets/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,30 @@ Recommends:
- `https://esm.sh/`
- `https://cdn.skypack.dev/`

### Advanced Custom Icon Set Cleanup
### customFetch

- Type: `(url: string) => Promise<any>`
- Default: `undefined`

Preset used [`ofetch`](https://github.com/unjs/ofetch) as the default fetcher, you can also custom fetch function to provide the icon data.

### processor

- Type: `(cssObject: CSSObject, meta: Required<IconMeta>) => void`
- Default: `undefined`

```ts
interface IconMeta {
collection: string
icon: string
svg: string
mode?: IconsOptions['mode']
}
```

Processor for the CSS object before stringify. See [example](https://github.com/unocss/unocss/blob/7d83789b0dee8c72c401db24263ea429086de95d/test/preset-icons.test.ts#L66-L82).

## Advanced Custom Icon Set Cleanup

When using this preset with your custom icons, consider using a cleanup process similar to that done by [Iconify](https://iconify.design/) for any icons sets. All the tools you need are available in [Iconify Tools](https://iconify.design/docs/libraries/tools/).

Expand Down
2 changes: 1 addition & 1 deletion docs/presets/typography.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Notice: `not-prose` can only be used as a class, not as an attribute.

Apply any font size for body you like and `prose` will scale the styles for
the respective HTML elements. For instance, `prose text-lg` has body font size
`1.125rem` and `h1` will with scale with that size 2.25 times. See [all the
`1.125rem` and `h1` will scale with that size 2.25 times. See [all the
supported HTML elements](https://github.com/unocss/unocss/blob/main/packages/preset-typography/src/preflights/default.ts).

### Any color
Expand Down
18 changes: 17 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{},
{
regexp: {
overrides: {
'regexp/no-empty-capturing-group': 'off',
'regexp/no-empty-group': 'off',
},
},
},
{
ignores: [
'**/.svelte-kit',
Expand Down Expand Up @@ -64,4 +71,13 @@ export default antfu(
'ts/no-var-requires': 'off',
},
},
{
name: 'tests',
files: [
'**/*.test.ts',
],
rules: {
'antfu/indent-unindent': ['error', { tags: ['$', 'html'] }],
},
},
)
6 changes: 3 additions & 3 deletions examples/astro-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"astro": "astro"
},
"dependencies": {
"vue": "^3.4.21"
"vue": "^3.4.27"
},
"devDependencies": {
"@astrojs/vue": "^4.1.0",
"@astrojs/vue": "^4.2.0",
"@iconify-json/logos": "^1.1.42",
"@unocss/reset": "link:../../packages/reset",
"astro": "^4.6.2",
"astro": "^4.8.4",
"unocss": "link:../../packages/unocss"
},
"stackblitz": {
Expand Down
2 changes: 1 addition & 1 deletion examples/astro-vue/prepare-for-stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion examples/astro/.stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions examples/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"devDependencies": {
"@iconify-json/logos": "^1.1.42",
"@unocss/reset": "link:../../packages/reset",
"astro": "^4.6.2",
"canvas-confetti": "^1.9.2",
"astro": "^4.8.4",
"canvas-confetti": "^1.9.3",
"unocss": "link:../../packages/unocss"
},
"stackblitz": {
Expand Down
2 changes: 1 addition & 1 deletion examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"react-dom": "18.2.0"
},
"devDependencies": {
"@iconify-json/lucide": "^1.1.183",
"@iconify-json/lucide": "^1.1.187",
"@types/node": "20.8.3",
"@types/react": "18.2.25",
"@types/react-dom": "18.2.11",
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt2-webpack/.stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt2-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "nuxt start"
},
"devDependencies": {
"@iconify-json/carbon": "^1.1.31",
"@iconify-json/carbon": "^1.1.33",
"@unocss/core": "link:../../packages/core",
"@unocss/nuxt": "link:../../packages/nuxt",
"@unocss/reset": "link:../../packages/reset",
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt2/.stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "node .output/server/index.mjs"
},
"devDependencies": {
"@iconify-json/carbon": "^1.1.31",
"@iconify-json/carbon": "^1.1.33",
"@nuxt/bridge-edge": "latest",
"@unocss/core": "link:../../packages/core",
"@unocss/nuxt": "link:../../packages/nuxt",
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt3/.stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion examples/nuxt3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"preview": "nuxi preview"
},
"devDependencies": {
"@iconify-json/carbon": "^1.1.31",
"@iconify-json/carbon": "^1.1.33",
"@unocss/core": "link:../../packages/core",
"@unocss/nuxt": "link:../../packages/nuxt",
"@unocss/reset": "link:../../packages/reset",
Expand Down
2 changes: 1 addition & 1 deletion examples/quasar/.stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions examples/quasar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"dependencies": {
"@quasar/extras": "^1.16.11",
"quasar": "^2.6.0",
"vue": "^3.4.21",
"vue": "^3.4.27",
"vue-router": "^4.3.2"
},
"devDependencies": {
"@quasar/app-vite": "^1.8.0",
"@quasar/app-vite": "^1.9.3",
"autoprefixer": "^10.4.19",
"typescript": "^5.4.5",
"unocss": "link:../../packages/unocss"
Expand Down
2 changes: 1 addition & 1 deletion examples/qwik/.stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion examples/qwik/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@unocss/reset": "link:../../packages/reset",
"typescript": "^5.4.5",
"unocss": "link:../../packages/unocss",
"vite": "^5.2.9"
"vite": "^5.2.11"
},
"stackblitz": {
"installDependencies": false,
Expand Down
2 changes: 1 addition & 1 deletion examples/remix/.stackblitz.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updateDependencyLinksToLatest('./package.json')
function updateDependencyLinksToLatest(filename) {
try {
const contents = fs.readFileSync(filename, 'utf-8')
const updatedContent = contents.replace(/"link:...+"/gi, '"latest"')
const updatedContent = contents.replace(/"link:.{3,}"/gi, '"latest"')
fs.writeFileSync(filename, updatedContent)
}
catch (err) {
Expand Down
Loading

0 comments on commit d8d74a8

Please sign in to comment.