Skip to content

Commit d28bbef

Browse files
committed
chore: update
1 parent 5bed37e commit d28bbef

32 files changed

+2882
-2607
lines changed

.eslintrc

-3
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default defineConfig({
4040

4141
```ts
4242
// rollup.config.js
43-
import { resolve } from 'path'
43+
import { resolve } from 'node:path'
4444
import { rollupTransformToUnocss } from 'transform-to-unocss'
4545
export default {
4646
plugins: [rollupTransformToUnocss(/* options */)],

README_zh.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default defineConfig({
4141

4242
```ts
4343
// rollup.config.js
44-
import { resolve } from 'path'
44+
import { resolve } from 'node:path'
4545
import { rollupTransformToUnocss } from 'transform-to-unocss'
4646
export default {
4747
plugins: [rollupTransformToUnocss(/* options */)],

eslint.config.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// @ts-check
2+
const antfu = require('@antfu/eslint-config').default
3+
4+
module.exports = antfu(
5+
{
6+
ignores: [
7+
// eslint ignore globs here
8+
'test/**/*',
9+
'components.d.ts',
10+
],
11+
},
12+
{
13+
rules: {
14+
// overrides
15+
'@typescript-eslint/no-unused-vars': 'off',
16+
'unused-imports/no-unused-vars': 'off',
17+
'regexp/no-super-linear-backtracking': 'off',
18+
'regexp/optimal-quantifier-concatenation': 'off',
19+
'ts/no-empty-object-type': 'off',
20+
'no-console': 'off',
21+
'no-restricted-globals': 'off',
22+
'style/indent-binary-ops': 'off',
23+
},
24+
},
25+
)

functions/server.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { transformVue } = require('transform-to-unocss')
2+
23
exports.handler = async (event) => {
34
const { body } = event
45
const result = await transformVue(body)

netlify.toml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
[build.environment]
2-
NODE_VERSION = "18"
31
[build]
4-
publish = "./playground/dist"
5-
command = "npm run play:build"
6-
functions="./playground/functions/server.zip"
2+
publish = "./playground/dist"
3+
command = "npm run play:build"
4+
functions = "./playground/functions/server.zip"
5+
6+
[build.environment]
7+
NODE_VERSION = "18"

package.json

+29-32
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "transform-to-unocss",
33
"version": "0.0.88",
4-
"packageManager": "pnpm@8.0.0",
4+
"packageManager": "pnpm@8.15.9",
55
"description": "The tool that transform css to unocss",
66
"author": "Simon He",
77
"license": "MIT",
@@ -20,8 +20,8 @@
2020
"exports": {
2121
".": {
2222
"types": "./dist/index.d.ts",
23-
"require": "./dist/index.js",
24-
"import": "./dist/index.mjs"
23+
"import": "./dist/index.mjs",
24+
"require": "./dist/index.js"
2525
}
2626
},
2727
"main": "./dist/index.js",
@@ -45,7 +45,7 @@
4545
"build": "tsup ./src/index.ts ./src/cli.ts",
4646
"dev": "npm run build -- --watch src",
4747
"format": "prettier --write --cache .",
48-
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx,.md,.json --max-warnings 0 --cache",
48+
"lint": "eslint . --cache",
4949
"lint:fix": "pnpm run lint --fix",
5050
"play": "pnpm run -C playground dev",
5151
"play:build": "pnpm run -C playground build",
@@ -57,53 +57,50 @@
5757
"typecheck": "tsc --noEmit"
5858
},
5959
"dependencies": {
60-
"fast-glob": "^3.2.12"
60+
"fast-glob": "^3.3.2"
6161
},
6262
"devDependencies": {
63-
"@antfu/eslint-config": "^0.25.1",
64-
"@babel/core": "^7.21.0",
65-
"@babel/eslint-parser": "^7.19.1",
63+
"@antfu/eslint-config": "^2.25.1",
64+
"@babel/core": "^7.25.2",
65+
"@babel/eslint-parser": "^7.25.1",
6666
"@babel/plugin-syntax-import-meta": "^7.10.4",
67-
"@babel/plugin-transform-typescript": "^7.21.0",
68-
"@rollup/pluginutils": "^5.0.2",
67+
"@babel/plugin-transform-typescript": "^7.25.2",
68+
"@rollup/pluginutils": "^5.1.0",
6969
"@simon_he/colorize": "^0.0.1",
70-
"@types/babel__core": "^7.20.0",
71-
"@types/less": "^3.0.3",
72-
"@types/node": "^18.0.0",
73-
"@types/stylus": "^0.48.38",
74-
"@unocss/preset-uno": "^0.50.4",
75-
"@vue/babel-plugin-jsx": "^1.1.1",
70+
"@types/babel__core": "^7.20.5",
71+
"@types/less": "^3.0.6",
72+
"@types/node": "^18.19.44",
73+
"@types/stylus": "^0.48.42",
74+
"@unocss/preset-uno": "^0.50.8",
75+
"@vue/babel-plugin-jsx": "^1.2.2",
7676
"bumpp": "^8.2.1",
77-
"eslint": "^8.18.0",
77+
"eslint": "^8.57.0",
7878
"esno": "^0.16.3",
7979
"find-up": "^6.3.0",
80-
"less": "^4.1.3",
80+
"less": "^4.2.0",
8181
"less-plugin-module-resolver": "^1.0.3",
82-
"lint-staged": "^13.1.0",
83-
"magic-string": "^0.30.0",
82+
"lint-staged": "^13.3.0",
83+
"magic-string": "^0.30.11",
8484
"monaco-editor": "^0.36.1",
85-
"picocolors": "^1.0.0",
86-
"pnpm": "^8.0.0",
87-
"prettier": "^2.8.1",
85+
"picocolors": "^1.0.1",
86+
"pnpm": "^8.15.9",
87+
"prettier": "^2.8.8",
8888
"rimraf": "^3.0.2",
89-
"sass": "^1.59.2",
90-
"simple-git-hooks": "^2.8.1",
89+
"sass": "^1.77.8",
90+
"simple-git-hooks": "^2.11.1",
9191
"stylus": "^0.59.0",
9292
"transform-to-unocss": "workspace:^",
9393
"transform-to-unocss-core": "^0.0.31",
94-
"tsup": "^6.5.0",
95-
"tsx": "^3.12.1",
96-
"typescript": "^4.7.4",
97-
"unplugin": "^1.3.1",
94+
"tsup": "^6.7.0",
95+
"tsx": "^3.14.0",
96+
"typescript": "^4.9.5",
97+
"unplugin": "^1.12.1",
9898
"vitest": "^1.6.0"
9999
},
100100
"lint-staged": {
101101
"*": [
102102
"prettier --write --cache --ignore-unknown"
103103
],
104104
"*.{vue,js,ts,jsx,tsx,md,json}": "eslint --fix"
105-
},
106-
"eslintConfig": {
107-
"extends": "@antfu"
108105
}
109106
}

playground/functions/server.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { transformVue } = require('transform-to-unocss')
2+
23
exports.handler = async (event) => {
34
const { body } = event
45
const result = await transformVue(body)

playground/netlify.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[build.environment]
2-
NPM_FLAGS = "--version"
3-
NODE_VERSION = "18"
4-
51
[build]
6-
publish = "dist"
7-
command = "npx pnpm run build"
2+
publish = "dist"
3+
command = "npx pnpm run build"
4+
5+
[build.environment]
6+
NPM_FLAGS = "--version"
7+
NODE_VERSION = "18"
88

99
[[redirects]]
10-
from = "/*"
11-
to = "/index.html"
12-
status = 200
10+
from = "/*"
11+
to = "/index.html"
12+
status = 200

playground/package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "playground",
33
"private": true,
4-
"packageManager": "pnpm@9.0.5",
4+
"packageManager": "pnpm@9.7.0",
55
"scripts": {
66
"build": "vite build",
77
"dev": "vite --port 3333 --open",
@@ -12,35 +12,35 @@
1212
"serve": "node ./server/index.js"
1313
},
1414
"dependencies": {
15-
"@vueuse/core": "^9.0.0",
16-
"ant-design-vue": "^4.2.1",
17-
"vue": "^3.2.31",
18-
"vue-router": "^4.0.14"
15+
"@vueuse/core": "^9.13.0",
16+
"ant-design-vue": "^4.2.3",
17+
"vue": "^3.4.37",
18+
"vue-router": "^4.4.3"
1919
},
2020
"devDependencies": {
21-
"@antfu/eslint-config": "^0.34.0",
21+
"@antfu/eslint-config": "^0.34.2",
2222
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
2323
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
24-
"@iconify-json/carbon": "^1.1.2",
25-
"@iconify/json": "^2.2.31",
24+
"@iconify-json/carbon": "^1.1.37",
25+
"@iconify/json": "^2.2.237",
2626
"@simon_he/git-fork-vue": "^0.0.11",
27-
"@types/node": "^18.0.0",
28-
"@unocss/reset": "^0.47.0",
27+
"@types/node": "^18.19.44",
28+
"@unocss/reset": "^0.47.6",
2929
"@vitejs/plugin-vue": "^3.2.0",
3030
"@vue/test-utils": "^2.0.0-rc.18",
31-
"eslint": "^8.11.0",
31+
"eslint": "^8.57.0",
3232
"jsdom": "^19.0.0",
3333
"lazy-js-utils": "^0.0.93",
3434
"rollup-plugin-polyfill-node": "^0.12.0",
35-
"typescript": "^4.6.2",
36-
"unocss": "^0.50.3",
37-
"unplugin-auto-import": "^0.12.0",
38-
"unplugin-vue-components": "^0.18.0",
39-
"vite": "^4.1.4",
35+
"typescript": "^4.9.5",
36+
"unocss": "^0.50.8",
37+
"unplugin-auto-import": "^0.12.2",
38+
"unplugin-vue-components": "^0.18.5",
39+
"vite": "^4.5.3",
4040
"vite-plugin-pages": "^0.28.0",
41-
"vitest": "^0.7.0",
42-
"vivid-typing": "^1.1.33",
43-
"vue-i18n": "^9.2.2",
44-
"vue-tsc": "^1.0.0"
41+
"vitest": "^0.7.13",
42+
"vivid-typing": "^1.1.44",
43+
"vue-i18n": "^9.13.1",
44+
"vue-tsc": "^1.8.27"
4545
}
4646
}

playground/server/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const express = require('express')
2+
23
const app = express()
34
app.all('*', (req, res, next) => {
45
// 设置允许跨域的域名,*代表允许任意域名跨域

playground/shims.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
declare module '*.vue' {
22
import type { DefineComponent } from 'vue'
3+
34
const component: DefineComponent<{}, {}, any>
45
export default component
56
}

playground/src/App.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const editor = ref(null)
2424
const editorResult = ref<HTMLElement>()
2525
const display = ref('')
2626
const styleReg = /<style.*>(.*)<\/style>/s
27-
const classReg = /(.*){/g
27+
const classReg = /(.*)\{/g
2828
const isChecked = ref(false)
2929
const transform = computed(() => {
3030
try {
@@ -200,13 +200,12 @@ function codeToHtml(code: string) {
200200
classReg,
201201
(_: any, match: any) => `[data-v-display]${match} {`,
202202
),
203-
),
204-
)
203+
))
205204
.replace('<template>', '')
206205
.replace('<\/template>', '')
207206
}
208207
const options = ref(cssSuggestions.map(i => ({ value: i })))
209-
const onSearch = (searchText: string) => {
208+
function onSearch(searchText: string) {
210209
options.value = !searchText
211210
? cssSuggestions.map(i => ({ value: i }))
212211
: cssSuggestions
@@ -218,7 +217,7 @@ const onSearch = (searchText: string) => {
218217
}
219218
220219
const isCopy = ref(false)
221-
const copyStyle = () => {
220+
function copyStyle() {
222221
if (copy(transform.value)) {
223222
isCopy.value = true
224223
window.parent.postMessage({ eventType: 'copy', text: transform.value }, '*')
@@ -229,7 +228,7 @@ const copyStyle = () => {
229228
}, 1000)
230229
}
231230
232-
const changelanguage = () => {
231+
function changelanguage() {
233232
if (locale.value === 'en')
234233
locale.value = 'zh'
235234
else locale.value = 'en'

playground/tsconfig.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": ".",
4-
"module": "ESNext",
3+
"incremental": false,
54
"target": "es2016",
65
"lib": ["DOM", "ESNext"],
7-
"strict": true,
8-
"esModuleInterop": true,
9-
"incremental": false,
10-
"skipLibCheck": true,
6+
"baseUrl": ".",
7+
"module": "ESNext",
118
"moduleResolution": "node",
12-
"resolveJsonModule": true,
13-
"noUnusedLocals": true,
14-
"strictNullChecks": true,
15-
"forceConsistentCasingInFileNames": true,
16-
"types": ["vite/client", "vite-plugin-pages/client"],
179
"paths": {
1810
"~/*": ["src/*"],
1911
"@unocss/preset-icons/browser": [
2012
"./node_modules/@unocss/preset-icons/dist/browser"
2113
]
22-
}
14+
},
15+
"resolveJsonModule": true,
16+
"types": ["vite/client", "vite-plugin-pages/client"],
17+
"strict": true,
18+
"strictNullChecks": true,
19+
"noUnusedLocals": true,
20+
"esModuleInterop": true,
21+
"forceConsistentCasingInFileNames": true,
22+
"skipLibCheck": true
2323
},
2424
"exclude": ["dist", "node_modules"]
2525
}

playground/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="vitest" />
22
/// <reference types="vite-plugin-pages/client" />
33

4-
import path from 'path'
4+
import path from 'node:path'
55
import { defineConfig } from 'vite'
66
import Vue from '@vitejs/plugin-vue'
77
import Pages from 'vite-plugin-pages'

0 commit comments

Comments
 (0)