@wangcheng051/plugin-kit 0.2.0 → 0.2.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.
package/CHANGELOG.md CHANGED
@@ -28,6 +28,17 @@
28
28
  - `dist/style.css` 内含 ag-grid 结构样式与 alpine 主题(288 KB / gzip 37.6 KB),
29
29
  宿主只需 `import '@wangcheng051/plugin-kit/style.css'`。
30
30
 
31
+ ### 修复
32
+
33
+ - **表格行高与表头高退化为 25px**。ag-grid 31 的行高并不由 CSS 变量驱动:
34
+ `Environment.getTheme()` 用 `/\bag-(material|theme-[\w-]*)\b/` 扫描容器 className,
35
+ 匹配不到 `ag-theme-*` 时 `getSassVariable()` 直接返回 `undefined`,最终回退到硬编码的
36
+ `DEFAULT_ROW_HEIGHT = 25`,并以内联样式写到 `.ag-row` / `.ag-header-cell` 上,CSS 覆盖无效。
37
+ 容器类名改为 `pk-ag-grid` 后正好落在这个盲区里。
38
+ 修复方式:`TableList` 增加 `rowHeight` / `headerHeight` 两个 props,默认 `42` / `48`
39
+ (与 alpine 的 `--ag-row-height: 6px * 7`、`--ag-header-height: 6px * 8` 一致),
40
+ 直接透传给 `AgGridReact`,不再依赖主题类名识别;`reset` 中的同名配置仍可覆盖。
41
+
31
42
  ### 校验
32
43
 
33
44
  - `scripts/verify-dist.mjs` 增加断言:ag-grid 已内联且不在 peer 中、JS 产物无 ag-grid
package/README.md CHANGED
@@ -181,7 +181,7 @@ npm run publish:public:confirm
181
181
  npm 账号启用 2FA 后,`npm publish` 会直接报:
182
182
 
183
183
  ```
184
- npm error 403 Forbidden - PUT https://registry.npmjs.org/@crm%2fplugin-kit
184
+ npm error 403 Forbidden - PUT https://registry.npmjs.org/@wangcheng051%2fplugin-kit
185
185
  npm error Two-factor authentication or granular access token with bypass 2fa enabled is required
186
186
  ```
187
187
 
@@ -196,6 +196,22 @@ NPM_TOKEN=npm_xxxxxxxx npm run publish:public:confirm
196
196
  NPM_OTP=123456 npm run publish:public:confirm
197
197
  ```
198
198
 
199
+ #### 确认 token 没问题但发布仍报 403
200
+
201
+ 报错仍是 `Two-factor authentication or granular access token with bypass 2fa enabled is required`
202
+ 时,多半是 token 没有真正落进 npm 配置(改了环境变量、或在别处生成后没写入)。
203
+ 用这条命令写入本机 `~/.npmrc` 后重新发布:
204
+
205
+ ```bash
206
+ npm config set //registry.npmjs.org/:_authToken npm_你的token
207
+ ```
208
+
209
+ 排查要点:
210
+
211
+ - 写完后 `~/.npmrc` 的修改时间会变化,可据此确认是否生效;
212
+ - bypass 2FA 只能在**创建 token 时**勾选,已创建的 token 改不生效,需删掉重建;
213
+ - token 只写本机 `~/.npmrc` 或 CI 环境变量,**不要写进仓库文件**(README 会随包公开发布)。
214
+
199
215
  脚本已把「校验」和「上传」拆开:先用约 1~2 分钟跑完 `prepublishOnly`,再以 `--ignore-scripts` 上传,
200
216
  这样 OTP 不会在构建期间过期。凭据均通过环境变量传入,不落命令行、不打印到日志。
201
217
 
@@ -248,7 +264,8 @@ npm version major # 0.1.0 -> 1.0.0
248
264
  npm i @wangcheng051/plugin-kit
249
265
  ```
250
266
 
251
- `react` / `react-dom` / `antd` / `ag-grid-*` / `@ant-design/icons` 均为 peerDependencies,需由宿主项目自行安装(`react-redux` 为可选 peer)。
267
+ 宿主只需 `react` / `react-dom` / `antd`(`react-redux` 为可选 peer);ag-grid 31 与
268
+ `@ant-design/icons` 已打包内置,无需安装。
252
269
 
253
270
  ### 私有源的消费方配置
254
271