dlzn-ui 1.22.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint-config.mjs +15 -1
- package/package.json +2 -6
- package/prettier-config.mjs +15 -2
- package/stylelint-config.mjs +3 -3
- package/vite-config.mjs +52 -12
- package/build/utils.mjs +0 -11
- package/vite-config.d.ts +0 -6
package/eslint-config.mjs
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { dirname, resolve } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
1
4
|
import antfu, { perfectionist as perfectionistConfigFn } from '@antfu/eslint-config'
|
|
2
5
|
import perfectionist from 'eslint-plugin-perfectionist'
|
|
3
6
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
|
|
4
|
-
|
|
7
|
+
|
|
8
|
+
function resolveOne(metaUrl, paths) {
|
|
9
|
+
const here = dirname(fileURLToPath(metaUrl))
|
|
10
|
+
const arr = paths.map((path) => resolve(here, path))
|
|
11
|
+
const result = arr.findIndex((file) => existsSync(file))
|
|
12
|
+
|
|
13
|
+
if (result === -1) {
|
|
14
|
+
throw new Error(`resolveOne: path not found: ${paths.join(', ')}`)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return paths[result]
|
|
18
|
+
}
|
|
5
19
|
|
|
6
20
|
const prettierOptions = await import(
|
|
7
21
|
resolveOne(import.meta.url, ['./prettier.config.mjs', './prettier-config.mjs'])
|
package/package.json
CHANGED
|
@@ -22,10 +22,7 @@
|
|
|
22
22
|
"import": "./utils/index.mjs",
|
|
23
23
|
"types": "./utils/index.d.ts"
|
|
24
24
|
},
|
|
25
|
-
"./vite-config":
|
|
26
|
-
"import": "./vite-config.mjs",
|
|
27
|
-
"types": "./vite-config.d.ts"
|
|
28
|
-
}
|
|
25
|
+
"./vite-config": "./vite-config.mjs"
|
|
29
26
|
},
|
|
30
27
|
"keywords": [],
|
|
31
28
|
"license": "MIT",
|
|
@@ -52,7 +49,6 @@
|
|
|
52
49
|
"stylelint-config-recess-order": "^7.7.0",
|
|
53
50
|
"stylelint-config-recommended-vue": "^2.0.0",
|
|
54
51
|
"stylelint-config-standard": "^40.0.0",
|
|
55
|
-
"stylelint-define-config": "^17.14.0",
|
|
56
52
|
"stylelint-order": "^8.1.1",
|
|
57
53
|
"stylelint-use-nesting": "^6.0.2",
|
|
58
54
|
"tailwindcss": "^4.3.3",
|
|
@@ -67,6 +63,6 @@
|
|
|
67
63
|
"**/*.css"
|
|
68
64
|
],
|
|
69
65
|
"type": "module",
|
|
70
|
-
"version": "1.
|
|
66
|
+
"version": "1.24.0",
|
|
71
67
|
"scripts": {}
|
|
72
68
|
}
|
package/prettier-config.mjs
CHANGED
|
@@ -2,9 +2,22 @@
|
|
|
2
2
|
* @description: https://prettier.io/docs/en/options
|
|
3
3
|
* @description: 还有些是 prettier-plugin-tailwindcss 的配置 https://github.com/tailwindlabs/prettier-plugin-tailwindcss
|
|
4
4
|
*/
|
|
5
|
-
// @ts-check
|
|
6
5
|
|
|
7
|
-
import {
|
|
6
|
+
import { existsSync } from 'node:fs'
|
|
7
|
+
import { dirname, resolve } from 'node:path'
|
|
8
|
+
import { fileURLToPath } from 'node:url'
|
|
9
|
+
|
|
10
|
+
function resolveOne(metaUrl, paths) {
|
|
11
|
+
const here = dirname(fileURLToPath(metaUrl))
|
|
12
|
+
const arr = paths.map((path) => resolve(here, path))
|
|
13
|
+
const result = arr.findIndex((file) => existsSync(file))
|
|
14
|
+
|
|
15
|
+
if (result === -1) {
|
|
16
|
+
throw new Error(`resolveOne: path not found: ${paths.join(', ')}`)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return paths[result]
|
|
20
|
+
}
|
|
8
21
|
|
|
9
22
|
/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
|
|
10
23
|
export default {
|
package/stylelint-config.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// [插件集合](https://stylelint.io/awesome-stylelint/)
|
|
2
2
|
// [stylelint 内置规则集](https://stylelint.io/user-guide/rules)
|
|
3
3
|
// 最新的版本去除了很多配置,比如缩进, 抛弃的规则 可在 @stylistic/stylelint-config(https://github.com/stylelint-stylistic/stylelint-config/blob/main/stylelint.config.js) 中找回
|
|
4
|
-
|
|
4
|
+
/** @type {import('stylelint').Config} */
|
|
5
5
|
|
|
6
|
-
export default
|
|
6
|
+
export default {
|
|
7
7
|
cache: true,
|
|
8
8
|
extends: [
|
|
9
9
|
'@stylistic/stylelint-config',
|
|
@@ -70,4 +70,4 @@ export default defineConfig({
|
|
|
70
70
|
],
|
|
71
71
|
'value-keyword-case': ['lower', { ignoreFunctions: ['v-bind'] }],
|
|
72
72
|
},
|
|
73
|
-
}
|
|
73
|
+
}
|
package/vite-config.mjs
CHANGED
|
@@ -1,12 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { existsSync } from 'node:fs'
|
|
2
|
+
import { dirname, resolve } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
5
|
+
import vue from '@vitejs/plugin-vue'
|
|
6
|
+
import tailwindAutoReference from 'vite-plugin-vue-tailwind-auto-reference'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {import('vite').ConfigEnv} ConfigEnv
|
|
10
|
+
* @typedef {typeof import('vite-plugin-vue-tailwind-auto-reference').default} TailwindAutoReference
|
|
11
|
+
* @typedef {Parameters<TailwindAutoReference>} TailwindAutoReferenceParameters
|
|
12
|
+
* @typedef {{ tailwindAutoReferenceParameters?: TailwindAutoReferenceParameters }} DlznViteOptions
|
|
13
|
+
* @typedef {import('vite').UserConfig} UserConfig
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function resolveOne(metaUrl, paths) {
|
|
17
|
+
const here = dirname(fileURLToPath(metaUrl))
|
|
18
|
+
const arr = paths.map((path) => resolve(here, path))
|
|
19
|
+
const result = arr.findIndex((file) => existsSync(file))
|
|
20
|
+
|
|
21
|
+
if (result === -1) {
|
|
22
|
+
throw new Error(`resolveOne: path not found: ${paths.join(', ')}`)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return paths[result]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {ConfigEnv} _env
|
|
30
|
+
* @param {DlznViteOptions} options
|
|
31
|
+
* @returns {UserConfig} Vite config
|
|
32
|
+
*/
|
|
33
|
+
export default (_env, options) => {
|
|
34
|
+
return {
|
|
35
|
+
plugins: [
|
|
36
|
+
vue({
|
|
37
|
+
// features: {
|
|
38
|
+
// optionsAPI: false, // 不能删掉,tdesign 内部使用到了
|
|
39
|
+
// },
|
|
40
|
+
}),
|
|
41
|
+
tailwindAutoReference(
|
|
42
|
+
options.tailwindAutoReferenceParameters?.[0] ??
|
|
43
|
+
resolveOne(import.meta.url, [
|
|
44
|
+
'./assets/css/tailwindcss-entry.css',
|
|
45
|
+
'./src/assets/css/tailwindcss-entry.css',
|
|
46
|
+
]),
|
|
47
|
+
options.tailwindAutoReferenceParameters?.[1],
|
|
48
|
+
),
|
|
49
|
+
tailwindcss(),
|
|
50
|
+
],
|
|
51
|
+
}
|
|
52
|
+
}
|
package/build/utils.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { existsSync as e } from "node:fs";
|
|
2
|
-
import { dirname as t, resolve as n } from "node:path";
|
|
3
|
-
import { fileURLToPath as r } from "node:url";
|
|
4
|
-
//#region build/utils.ts
|
|
5
|
-
function i(i, a) {
|
|
6
|
-
let o = t(r(i)), s = a.map((e) => n(o, e)).findIndex((t) => e(t));
|
|
7
|
-
if (s === -1) throw Error(`resolveOne: path not found: ${a.join(", ")}`);
|
|
8
|
-
return a[s];
|
|
9
|
-
}
|
|
10
|
-
//#endregion
|
|
11
|
-
export { i as resolveOne };
|
package/vite-config.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ConfigEnv, UserConfig } from 'vite';
|
|
2
|
-
import { default as tailwindAutoReference } from 'vite-plugin-vue-tailwind-auto-reference';
|
|
3
|
-
declare const _default: (_env: ConfigEnv, options: {
|
|
4
|
-
tailwindAutoReferenceParameters?: Parameters<typeof tailwindAutoReference>;
|
|
5
|
-
}) => UserConfig;
|
|
6
|
-
export default _default;
|