Skip to content

Commit

Permalink
misc: fix linting issue and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xsjcTony committed Mar 23, 2024
1 parent 3777bd6 commit b7a99c7
Show file tree
Hide file tree
Showing 26 changed files with 2,401 additions and 1,521 deletions.
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 🐞 Bug report
description: Report an issue with unocss-preset-animations
labels: [pending triage]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report! If you have a usage question
or are unsure if this is really a bug, make sure to:
- Read the [documentation](https://unocss-preset-animations.aelita.me/) of using the package
- Ask on [GitHub Discussion](https://github.com/xsjcTony/unocss-preset-animations/discussions)
- type: input
id: version
attributes:
label: unocss-preset-animations version
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Please provide a link to [StackBlitz](https://stackblitz.com/edit/vitejs-vite-lbg2ww?file=src%2FApp.tsx) or a github repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. [Why reproduction is required](https://antfu.me/posts/why-reproductions-are-required).
placeholder: Reproduction
validations:
required: true
- type: textarea
id: system-info
attributes:
label: System Info
placeholder: System, Browsers, Framework
validations:
required: false
- type: checkboxes
id: checkboxes
attributes:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Check that there isn't [already an issue](https://github.com/xsjcTony/unocss-preset-animations/issues) that reports the same bug to avoid creating a duplicate
required: true
- label: Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/xsjcTony/unocss-preset-animations/discussions)
required: true
- label: The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 🚀 New feature proposal
description: Propose a new feature to be added to unocss-preset-animations
labels: ['enhancement: pending triage']
body:
- type: markdown
attributes:
value: |
Thanks for your interest in the project and taking the time to fill out this feature report!
- type: textarea
id: feature-description
attributes:
label: Clear and concise description of the problem
description: 'As a developer using unocss-preset-animations I want [goal / wish] so that [benefit]. If you intend to submit a PR for this issue, tell us in the description. Thanks!'
validations:
required: true
- type: textarea
id: suggested-solution
attributes:
label: Suggested solution
description: We could provide following implementation...
validations:
required: true
- type: textarea
id: alternative
attributes:
label: Alternative
description: Clear and concise description of any alternative solutions or features you've considered.
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Any other context or screenshots about the feature request here.
- type: checkboxes
id: checkboxes
attributes:
label: Validations
description: Before submitting the issue, please make sure you do the following
options:
- label: Read the [documentation](https://unocss-preset-animations.aelita.me/) of using the package
required: true
- label: Check that there isn't already an issue that request the same feature to avoid creating a duplicate
required: true
14 changes: 14 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
daysUntilStale: 60
daysUntilClose: 7
exemptLabels:
- pinned
- security
- no-stale
- no stale
- pr welcome
staleLabel: stale
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
closeComment: false
12 changes: 6 additions & 6 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [
'src/index'
'src/index',
],
clean: true,
declaration: true,
externals: [
'@unocss/core',
'@unocss/preset-mini'
'@unocss/preset-mini',
],
alias: {
'@': fileURLToPath(new URL('src', import.meta.url))
'@': fileURLToPath(new URL('src', import.meta.url)),
},
rollup: {
emitCJS: true,
dts: {
respectExternal: false
}
respectExternal: false,
},
},
failOnWarn: false
failOnWarn: false,
})
4 changes: 2 additions & 2 deletions changelogithub.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export default {
examples: { title: '🏀 Examples' },
test: { title: '🧪 Tests' },
style: { title: '🎨 Styles' },
ci: { title: '🤖 CI' }
}
ci: { title: '🤖 CI' },
},
} satisfies ChangelogOptions
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default defineConfig({
{ text: 'Zoom', link: '/animations/zoom' },
{ text: 'Spin', link: '/animations/spin' },
{ text: 'Slide', link: '/animations/slide' },
{ text: 'Animation Properties', link: '/animations/animation-properties' },
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/plugins/externalLinkIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const externalLinkIcon = (md: MarkdownIt): void => {
}

md.renderer.rules.link_close = (
tokens, idx, options, env, self
tokens, idx, options, env, self,
): string => {
if (isExternalLink) {
isExternalLink = false
Expand Down
8 changes: 4 additions & 4 deletions docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
`circle(0px at ${x}px ${y}px)`,
`circle(${Math.hypot(
Math.max(x, innerWidth - x),
Math.max(y, innerHeight - y)
)}px at ${x}px ${y}px)`
Math.max(y, innerHeight - y),
)}px at ${x}px ${y}px)`,
]
await document.startViewTransition(async () => {
Expand All @@ -34,8 +34,8 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
{
duration: 300,
easing: 'ease-in',
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`
}
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`,
},
)
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export default {
}),
enhanceApp({ app, router, siteData }) {
// ...
}
},
} satisfies Theme
92 changes: 92 additions & 0 deletions docs/src/animations/animation-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
outline: [2, 3]
next: Animations
---

# Animation Properties

Animation property modifiers are supported by `@unocss/preset-wind` or `@unocss/preset-uno`.

## `animation-delay`

```html
<button class="animate-in fade-in animate-delay-150">Button A</button>
<button class="animate-in fade-in animate-delay-300">Button B</button>
<button class="animate-in fade-in animate-delay-700">Button C</button>
```

## `animation-direction`

```html
<button class="animate-in fade-in animate-normal">Button A</button>
<button class="animate-in fade-in animate-reverse">Button B</button>
<button class="animate-in fade-in animate-alternate">Button C</button>
<button class="animate-in fade-in animate-alternate-reverse">Button D</button>

<button class="animate-in fade-in animate-direction-normal">Button E</button>
```

## `animation-duration`

```html
<button class="animate-in fade-in animate-duration-150">Button A</button>
<button class="animate-in fade-in animate-duration-300">Button B</button>
<button class="animate-in fade-in animate-duration-700">Button C</button>
```

::: tip
If no `animation-duration` is defined, it will fall back to `theme.duration.DEFAULT`.

The value is `150ms` by default if unchanged, see [unocss/packages/preset-mini/src/_theme/misc.ts at main · unocss/unocss](https://github.com/unocss/unocss/blob/efdc358897a308323e1d943dd0f7c13e344e1495/packages/preset-mini/src/_theme/misc.ts#L37)
:::

## `animation-fill-mode`

```html
<button class="animate-in fade-in animate-none">Button A</button>
<button class="animate-in fade-in animate-forwards">Button B</button>
<button class="animate-in fade-in animate-backwards">Button C</button>
<button class="animate-in fade-in animate-both">Button D</button>

<button class="animate-in fade-in animate-fill-none">Button E</button>
<button class="animate-in fade-in animate-mode-none">Button F</button>
<button class="animate-in fade-in animate-fill-mode-none">Button G</button>
```

## `animation-iteration-count`

```html
<button class="animate-in fade-in animate-iteration-0">Button A</button>
<button class="animate-in fade-in animate-iteration-1">Button B</button>
<button class="animate-in fade-in animate-iteration-infinite">Button C</button>

<button class="animate-in fade-in animate-count-0">Button D</button>
<button class="animate-in fade-in animate-iteration-count-0">Button E</button>
```

## `animation-play-state`

```html
<button class="animate-in fade-in animate-paused">Button A</button>
<button class="animate-in fade-in animate-running">Button B</button>

<button class="animate-in fade-in animate-play-paused">Button C</button>
<button class="animate-in fade-in animate-state-paused">Button D</button>
<button class="animate-in fade-in animate-play-state-paused">Button E</button>
```

## `animation-timing-function`

```html
<button class="animate-in fade-in animate-ease-linear">Button A</button>
<button class="animate-in fade-in animate-ease-in">Button B</button>
<button class="animate-in fade-in animate-ease-out">Button C</button>
<button class="animate-in fade-in animate-ease-in-out">Button D</button>
```

## Prefers reduced motion

```html
<button class="motion-reduce:...">Button A</button>
<button class="motion-safe:...">Button B</button>
```
12 changes: 6 additions & 6 deletions docs/uno.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import type { Theme } from '@unocss/preset-mini'
export default defineConfig<Theme>({
presets: [
presetUno(),
presetIcons()
presetIcons(),
],
transformers: [
transformerVariantGroup(),
transformerDirectives()
transformerDirectives(),
],
theme: {
colors: {
primary: {
DEFAULT: 'var(--vp-c-brand-1)'
}
}
}
DEFAULT: 'var(--vp-c-brand-1)',
},
},
},
})
14 changes: 7 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ export default defineConfig(
{
typescript: {
tsconfigPath: ['./tsconfig.json', './tsconfig.node.js.json'],
projectType: 'lib'
projectType: 'lib',
},
vue: {
ruleOptions: {
multiWordComponentNames: { ignores: ['Layout'] }
}
}
multiWordComponentNames: { ignores: ['Layout'] },
},
},
},
{
files: ['docs/.vitepress/config.ts'],
rules: {
'ts/comma-dangle': ['error', 'always-multiline']
}
}
'ts/comma-dangle': ['error', 'always-multiline'],
},
},
)
36 changes: 19 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,35 @@
"release": "pnpm test:ci && bumpp",
"typecheck": "vue-tsc --noEmit",
"lint": "eslint .",
"test": "vitest",
"test": "vitest run",
"test:watch": "vitest",
"test:update": "vitest run -u",
"test:ci": "pnpm typecheck && pnpm build && pnpm lint && pnpm test run",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
"devDependencies": {
"@aelita-dev/eslint-config": "^1.1.0",
"@iconify/json": "^2.2.150",
"@aelita-dev/eslint-config": "^1.14.4",
"@iconify/json": "^2.2.195",
"@types/dom-view-transitions": "^1.0.4",
"@types/markdown-it": "^13.0.7",
"@unocss/core": "^0.57.7",
"@unocss/preset-mini": "^0.57.7",
"@vue/language-server": "^1.8.24",
"bumpp": "^9.2.0",
"changelogithub": "^0.13.2",
"eslint": "^8.54.0",
"markdown-it": "^13.0.2",
"sass": "^1.69.5",
"typescript": "^5.3.2",
"@types/node": "^20.11.30",
"@unocss/core": "^0.58.6",
"@unocss/preset-mini": "^0.58.6",
"@vue/language-server": "^2.0.7",
"bumpp": "^9.4.0",
"changelogithub": "^0.13.5",
"eslint": "^8.57.0",
"markdown-it": "^14.1.0",
"sass": "^1.72.0",
"typescript": "^5.4.3",
"unbuild": "^2.0.0",
"unocss": "^0.57.7",
"vitepress": "1.0.0-rc.31",
"vitest": "^0.34.6",
"vue": "^3.3.9",
"vue-tsc": "^1.8.24"
"unocss": "^0.58.6",
"vitepress": "1.0.1",
"vitest": "^1.4.0",
"vue": "^3.4.21",
"vue-tsc": "^2.0.7"
},
"peerDependencies": {
"@unocss/preset-wind": ">= 0.56.0 < 1",
Expand Down
Loading

0 comments on commit b7a99c7

Please sign in to comment.