@pubinfo/config 2.1.10-beta.1 → 2.1.10

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.
@@ -1,2 +1,2 @@
1
- import { t as pubinfo } from "../index2.mjs";
1
+ import { t as pubinfo } from "../factory.mjs";
2
2
  export { pubinfo as default };
@@ -1,3 +1,7 @@
1
- import { t as eslint_default } from "../eslint.mjs";
1
+ import { t as pubinfo } from "../factory.mjs";
2
2
 
3
+ //#region src/eslint/index.ts
4
+ var eslint_default = pubinfo;
5
+
6
+ //#endregion
3
7
  export { eslint_default as default };
@@ -109,12 +109,11 @@ async function vue() {
109
109
  //#endregion
110
110
  //#region src/eslint/factory.ts
111
111
  async function pubinfo(...userConfigs) {
112
- return antfu({ unocss: false }, vue(), stylistic(), ignores(), ...userConfigs);
112
+ return antfu({
113
+ unocss: false,
114
+ pnpm: false
115
+ }, vue(), stylistic(), ignores(), ...userConfigs);
113
116
  }
114
117
 
115
118
  //#endregion
116
- //#region src/eslint/index.ts
117
- var eslint_default = pubinfo;
118
-
119
- //#endregion
120
- export { eslint_default as t };
119
+ export { pubinfo as t };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { t as pubinfo } from "./index2.mjs";
1
+ import { t as pubinfo } from "./factory.mjs";
2
+ import "./eslint/index.mjs";
2
3
  import _default$1 from "./stylelint.mjs";
3
4
  import { colorScheme, cssVarKey, customColorKey, defineTheme, getThemes, globalTheme, themeOptions } from "./themes/index.mjs";
4
5
  import _default from "./unocss/index.mjs";
package/dist/index.mjs CHANGED
@@ -1,6 +1,9 @@
1
- import { t as eslint_default } from "./eslint.mjs";
1
+ import "./factory.mjs";
2
+ import eslint_default from "./eslint/index.mjs";
2
3
  import stylelint_default from "./stylelint.mjs";
3
- import { n as defineTheme, r as getThemes, t as customColorKey } from "./themes.mjs";
4
- import { t as unocss_default } from "./unocss.mjs";
4
+ import { n as defineTheme, r as getThemes, t as customColorKey } from "./theme.mjs";
5
+ import "./themes/index.mjs";
6
+ import "./presetThemes.mjs";
7
+ import unocss_default from "./unocss/index.mjs";
5
8
 
6
9
  export { customColorKey, defineTheme, eslint_default as eslint, getThemes, unocss_default as presetPubinfo, stylelint_default as stylelint };
@@ -0,0 +1,49 @@
1
+ import { r as getThemes } from "./theme.mjs";
2
+ import { definePreset, entriesToCss, toArray } from "unocss";
3
+
4
+ //#region src/unocss/presetThemes.ts
5
+ const suffix = [[
6
+ "",
7
+ " *",
8
+ "::before",
9
+ "::after"
10
+ ], ["::backdrop"]];
11
+ function createCssVar(key, themeName) {
12
+ function createSuffixScheme(preSuffix, suffixMap = suffix) {
13
+ return suffixMap.reduce((acc, suffix) => acc.concat(suffix.map((s) => `${preSuffix}${s}`).join(",")), []);
14
+ }
15
+ return {
16
+ light(key) {
17
+ return createSuffixScheme(`[data-theme="${key}"]`);
18
+ },
19
+ dark(key) {
20
+ return createSuffixScheme(`html.dark [data-theme="${key}"]`);
21
+ }
22
+ }[key](themeName);
23
+ }
24
+ function mergeTheme(themes) {
25
+ return Object.assign({}, ...themes);
26
+ }
27
+ function normalizePreflights(_themes = []) {
28
+ return { getCSS: () => {
29
+ const injectionCss = [];
30
+ const themes = Object.assign(getThemes(), mergeTheme(_themes));
31
+ Object.keys(themes).forEach((key) => {
32
+ delete themes[key].label;
33
+ const css = entriesToCss(Object.entries(themes[key]));
34
+ const themeColorScheme = themes[key]["color-scheme"];
35
+ const roots = toArray(createCssVar(themeColorScheme, key));
36
+ injectionCss.push(roots.map((root) => `${root}{${css}}`).join(""));
37
+ });
38
+ return injectionCss.join("");
39
+ } };
40
+ }
41
+ const presetThemes = definePreset((options) => {
42
+ return {
43
+ name: "@wsys/preset-themes",
44
+ preflights: [normalizePreflights(options?.themes)]
45
+ };
46
+ });
47
+
48
+ //#endregion
49
+ export { presetThemes as t };
@@ -1,3 +1,3 @@
1
- import { n as defineTheme, r as getThemes, t as customColorKey } from "../themes.mjs";
1
+ import { n as defineTheme, r as getThemes, t as customColorKey } from "../theme.mjs";
2
2
 
3
3
  export { customColorKey, defineTheme, getThemes };
@@ -1,8 +1,8 @@
1
1
  import { globalTheme } from "../themes/index.mjs";
2
- import * as unocss0 from "unocss";
2
+ import * as unocss from "unocss";
3
3
 
4
4
  //#region src/unocss/index.d.ts
5
- declare const _default: unocss0.PresetFactory<object, {
5
+ declare const _default: unocss.PresetFactory<object, {
6
6
  themes?: globalTheme[];
7
7
  type?: "app" | "module";
8
8
  }>;
@@ -1,4 +1,42 @@
1
- import "../themes.mjs";
2
- import { t as unocss_default } from "../unocss.mjs";
1
+ import "../theme.mjs";
2
+ import { t as presetThemes } from "../presetThemes.mjs";
3
+ import { definePreset, presetAttributify, presetIcons, presetTypography, presetUno, transformerDirectives } from "unocss";
3
4
 
5
+ //#region src/unocss/index.ts
6
+ var unocss_default = definePreset((options) => {
7
+ const { themes, type = "app" } = options ?? {};
8
+ return {
9
+ name: "preset-pubinfo",
10
+ presets: [
11
+ type === "app" ? [presetThemes({ themes }), presetUno({ preflight: true })] : [presetUno({ preflight: false })],
12
+ presetAttributify(),
13
+ presetTypography(),
14
+ presetIcons({ extraProperties: {
15
+ "display": "inline-block",
16
+ "vertical-align": "middle"
17
+ } })
18
+ ],
19
+ transformers: [transformerDirectives()],
20
+ shortcuts: [{
21
+ "flex-center": "flex justify-center items-center",
22
+ "flex-col-center": "flex flex-col justify-center items-center"
23
+ }],
24
+ theme: {
25
+ colors: {
26
+ "ui-primary": "rgb(var(--ui-primary))",
27
+ "ui-text": "rgb(var(--ui-text))"
28
+ },
29
+ breakpoints: {
30
+ "sm": "768px",
31
+ "smd": "1024px",
32
+ "md": "1366px",
33
+ "lg": "1440px",
34
+ "xl": "1600px",
35
+ "2xl": "1920px"
36
+ }
37
+ }
38
+ };
39
+ });
40
+
41
+ //#endregion
4
42
  export { unocss_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo/config",
3
3
  "type": "module",
4
- "version": "2.1.10-beta.1",
4
+ "version": "2.1.10",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.mts",
@@ -35,25 +35,24 @@
35
35
  "node": "^20.19.0 || >=22.12.0"
36
36
  },
37
37
  "peerDependencies": {
38
- "eslint": "^9.30.1",
39
- "stylelint": "^16.21.0",
38
+ "eslint": "^10.0.0",
39
+ "stylelint": "^17.1.1",
40
40
  "unocss": ">=65.5.0"
41
41
  },
42
42
  "dependencies": {
43
- "@antfu/eslint-config": "^4.16.2",
44
- "@stylistic/stylelint-plugin": "^3.1.3",
45
- "@unocss/core": "65.5.0",
46
- "postcss-html": "^1.8.0",
47
- "postcss-preset-env": "^10.5.0",
48
- "stylelint-config-recess-order": "^7.1.0",
49
- "stylelint-config-standard-less": "^3.0.1",
50
- "stylelint-config-standard-scss": "^15.0.1",
43
+ "@antfu/eslint-config": "^7.4.2",
44
+ "@stylistic/stylelint-plugin": "^5.0.1",
45
+ "postcss-html": "^1.8.1",
46
+ "postcss-preset-env": "^11.1.3",
47
+ "stylelint-config-recess-order": "^7.6.1",
48
+ "stylelint-config-standard-less": "^4.0.1",
49
+ "stylelint-config-standard-scss": "^17.0.0",
51
50
  "stylelint-config-standard-vue": "^1.0.0",
52
- "stylelint-scss": "^6.12.1"
51
+ "stylelint-scss": "^7.0.0"
53
52
  },
54
53
  "devDependencies": {
55
- "eslint": "^9.30.1",
56
- "stylelint": "^16.21.0",
54
+ "eslint": "^10.0.0",
55
+ "stylelint": "^17.1.1",
57
56
  "unocss": "65.5.0"
58
57
  },
59
58
  "scripts": {
@@ -11,6 +11,7 @@ export async function pubinfo(
11
11
  return antfu(
12
12
  {
13
13
  unocss: false,
14
+ pnpm: false,
14
15
  },
15
16
  vue(),
16
17
  stylistic(),
@@ -1,5 +1,5 @@
1
1
  import type { globalTheme } from '../themes';
2
- import { definePreset, entriesToCss, toArray } from '@unocss/core';
2
+ import { definePreset, entriesToCss, toArray } from 'unocss';
3
3
  import { getThemes } from '../themes';
4
4
 
5
5
  type colorScheme = 'light' | 'dark';
package/dist/unocss.mjs DELETED
@@ -1,87 +0,0 @@
1
- import { r as getThemes } from "./themes.mjs";
2
- import { definePreset, presetAttributify, presetIcons, presetTypography, presetUno, transformerDirectives } from "unocss";
3
- import { definePreset as definePreset$1, entriesToCss, toArray } from "@unocss/core";
4
-
5
- //#region src/unocss/presetThemes.ts
6
- const suffix = [[
7
- "",
8
- " *",
9
- "::before",
10
- "::after"
11
- ], ["::backdrop"]];
12
- function createCssVar(key, themeName) {
13
- function createSuffixScheme(preSuffix, suffixMap = suffix) {
14
- return suffixMap.reduce((acc, suffix$1) => acc.concat(suffix$1.map((s) => `${preSuffix}${s}`).join(",")), []);
15
- }
16
- return {
17
- light(key$1) {
18
- return createSuffixScheme(`[data-theme="${key$1}"]`);
19
- },
20
- dark(key$1) {
21
- return createSuffixScheme(`html.dark [data-theme="${key$1}"]`);
22
- }
23
- }[key](themeName);
24
- }
25
- function mergeTheme(themes) {
26
- return Object.assign({}, ...themes);
27
- }
28
- function normalizePreflights(_themes = []) {
29
- return { getCSS: () => {
30
- const injectionCss = [];
31
- const themes = Object.assign(getThemes(), mergeTheme(_themes));
32
- Object.keys(themes).forEach((key) => {
33
- delete themes[key].label;
34
- const css = entriesToCss(Object.entries(themes[key]));
35
- const themeColorScheme = themes[key]["color-scheme"];
36
- const roots = toArray(createCssVar(themeColorScheme, key));
37
- injectionCss.push(roots.map((root) => `${root}{${css}}`).join(""));
38
- });
39
- return injectionCss.join("");
40
- } };
41
- }
42
- const presetThemes = definePreset$1((options) => {
43
- return {
44
- name: "@wsys/preset-themes",
45
- preflights: [normalizePreflights(options?.themes)]
46
- };
47
- });
48
-
49
- //#endregion
50
- //#region src/unocss/index.ts
51
- var unocss_default = definePreset((options) => {
52
- const { themes, type = "app" } = options ?? {};
53
- return {
54
- name: "preset-pubinfo",
55
- presets: [
56
- type === "app" ? [presetThemes({ themes }), presetUno({ preflight: true })] : [presetUno({ preflight: false })],
57
- presetAttributify(),
58
- presetTypography(),
59
- presetIcons({ extraProperties: {
60
- "display": "inline-block",
61
- "vertical-align": "middle"
62
- } })
63
- ],
64
- transformers: [transformerDirectives()],
65
- shortcuts: [{
66
- "flex-center": "flex justify-center items-center",
67
- "flex-col-center": "flex flex-col justify-center items-center"
68
- }],
69
- theme: {
70
- colors: {
71
- "ui-primary": "rgb(var(--ui-primary))",
72
- "ui-text": "rgb(var(--ui-text))"
73
- },
74
- breakpoints: {
75
- "sm": "768px",
76
- "smd": "1024px",
77
- "md": "1366px",
78
- "lg": "1440px",
79
- "xl": "1600px",
80
- "2xl": "1920px"
81
- }
82
- }
83
- };
84
- });
85
-
86
- //#endregion
87
- export { unocss_default as t };
File without changes
File without changes