dlzn-ui 1.21.0 → 1.22.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.
@@ -0,0 +1,11 @@
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/eslint-config.mjs CHANGED
@@ -1,8 +1,11 @@
1
1
  import antfu, { perfectionist as perfectionistConfigFn } from '@antfu/eslint-config'
2
2
  import perfectionist from 'eslint-plugin-perfectionist'
3
3
  import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
4
- import prettierOptions from './prettier.config.mjs'
4
+ import { resolveOne } from './build/utils.ts'
5
5
 
6
+ const prettierOptions = await import(
7
+ resolveOne(import.meta.url, ['./prettier.config.mjs', './prettier-config.mjs'])
8
+ )
6
9
  const perfectionistConfig = await perfectionistConfigFn({})
7
10
  /** @type {import('eslint').Linter.Config[]} */
8
11
  const eslintConfig = await antfu(
package/package.json CHANGED
@@ -67,6 +67,6 @@
67
67
  "**/*.css"
68
68
  ],
69
69
  "type": "module",
70
- "version": "1.21.0",
70
+ "version": "1.22.0",
71
71
  "scripts": {}
72
72
  }
@@ -4,18 +4,7 @@
4
4
  */
5
5
  // @ts-check
6
6
 
7
- import { existsSync } from 'node:fs'
8
- import { dirname, resolve } from 'node:path'
9
- import { fileURLToPath } from 'node:url'
10
-
11
- const here = dirname(fileURLToPath(import.meta.url))
12
-
13
- function resolveDefaultCssEntry() {
14
- const distCss = resolve(here, 'assets/css/tailwindcss-entry.css')
15
- const srcCss = resolve(here, 'src/assets/css/tailwindcss-entry.css')
16
-
17
- return existsSync(distCss) ? distCss : srcCss
18
- }
7
+ import { resolveOne } from './build/utils.ts'
19
8
 
20
9
  /** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
21
10
  export default {
@@ -37,7 +26,10 @@ export default {
37
26
  singleAttributePerLine: false, // 会在 HTML、JSX、Vue 和 Angular 中格式化为每个属性单独占一行。
38
27
  singleQuote: true, // 使用单引号
39
28
  tabWidth: 2, // 缩进长度
40
- tailwindStylesheet: resolveDefaultCssEntry(),
29
+ tailwindStylesheet: resolveOne(import.meta.url, [
30
+ './assets/css/tailwindcss-entry.css',
31
+ './src/assets/css/tailwindcss-entry.css',
32
+ ]),
41
33
  trailingComma: 'all',
42
34
  useTabs: false, // 使用空格代替tab缩进
43
35
  vueIndentScriptAndStyle: false, // 不对vue中的script及style标签缩进
package/vite-config.mjs CHANGED
@@ -1,19 +1,12 @@
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
- import i from "@tailwindcss/vite";
5
- import a from "@vitejs/plugin-vue";
6
- import o from "vite-plugin-vue-tailwind-auto-reference";
1
+ import { resolveOne as e } from "./build/utils.mjs";
2
+ import t from "@tailwindcss/vite";
3
+ import n from "@vitejs/plugin-vue";
4
+ import r from "vite-plugin-vue-tailwind-auto-reference";
7
5
  //#region vite.config.common.ts
8
- var s = t(r(import.meta.url));
9
- function c() {
10
- let t = n(s, "assets/css/tailwindcss-entry.css"), r = n(s, "src/assets/css/tailwindcss-entry.css");
11
- return e(t) ? t : r;
12
- }
13
- var l = (e, t) => ({ plugins: [
14
- a({}),
15
- o(t.tailwindAutoReferenceParameters?.[0] ?? c(), t.tailwindAutoReferenceParameters?.[1]),
16
- i()
6
+ var i = (i, a) => ({ plugins: [
7
+ n({}),
8
+ r(a.tailwindAutoReferenceParameters?.[0] ?? e(import.meta.url, ["./assets/css/tailwindcss-entry.css", "./src/assets/css/tailwindcss-entry.css"]), a.tailwindAutoReferenceParameters?.[1]),
9
+ t()
17
10
  ] });
18
11
  //#endregion
19
- export { l as default };
12
+ export { i as default };