@pubinfo-pr/config 0.234.1 → 0.237.1

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.
Files changed (2) hide show
  1. package/README.md +46 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @pubinfo/config
2
+
3
+ Pubinfo 的共享前端配置包,集中提供 ESLint、Stylelint、UnoCSS 预设和主题系统。
4
+
5
+ ## 它在做什么
6
+
7
+ - 基于 `@antfu/eslint-config` 组装一套适合 Pubinfo 项目的 Flat ESLint 配置
8
+ - 提供适配 Vue / Less / SCSS 的 Stylelint 配置
9
+ - 提供 `presetPubinfo`,把 UnoCSS、主题变量和常用 shortcuts 组装起来
10
+ - 注册内置主题,并暴露 `defineTheme` / `getThemes` 等主题工具
11
+
12
+ ## 导出结构
13
+
14
+ - `@pubinfo/config`: 聚合导出
15
+ - `@pubinfo/config/eslint`: ESLint 配置工厂
16
+ - `@pubinfo/config/stylelint`: Stylelint 配置对象
17
+ - `@pubinfo/config/unocss`: UnoCSS 预设
18
+ - `@pubinfo/config/themes`: 主题注册与工具函数
19
+
20
+ ## 用法
21
+
22
+ ```ts
23
+ import eslint from '@pubinfo/config/eslint';
24
+ import stylelint from '@pubinfo/config/stylelint';
25
+ import presetPubinfo from '@pubinfo/config/unocss';
26
+ import { defineTheme } from '@pubinfo/config/themes';
27
+ ```
28
+
29
+ ```ts
30
+ // uno.config.ts
31
+ import { defineConfig } from 'unocss';
32
+ import presetPubinfo from '@pubinfo/config/unocss';
33
+
34
+ export default defineConfig({
35
+ presets: [presetPubinfo()],
36
+ });
37
+ ```
38
+
39
+ ## 主题能力
40
+
41
+ 主题系统通过 `defineTheme` 注册 CSS 变量,再由 `presetThemes` 注入到 UnoCSS preflights。应用侧只需要切换 `data-theme` 和深浅色模式即可复用整套变量。
42
+
43
+ ## 仓库关系
44
+
45
+ - `pubinfo` 对外把这里的 ESLint / Stylelint / UnoCSS 能力重新导出。
46
+ - `@pubinfo/core` 的样式体系和 `@pubinfo/vite` 的 UnoCSS 插件都依赖这个包。
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo-pr/config",
3
3
  "type": "module",
4
- "version": "0.234.1",
4
+ "version": "0.237.1",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.mts",