@qq1948037137/adminsmart-ui 0.0.0-stage → 0.1.21
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/README.md +76 -2
- package/dist/icons.cjs +25 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.d.cts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +3 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.cjs +1278 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +420 -0
- package/dist/index.d.ts +420 -0
- package/dist/index.js +1199 -0
- package/dist/index.js.map +1 -0
- package/dist/locale/zh_CN.cjs +40 -0
- package/dist/locale/zh_CN.cjs.map +1 -0
- package/dist/locale/zh_CN.d.cts +5 -0
- package/dist/locale/zh_CN.d.ts +5 -0
- package/dist/locale/zh_CN.js +9 -0
- package/dist/locale/zh_CN.js.map +1 -0
- package/package.json +103 -4
- package/styles/composites.css +143 -0
- package/styles/scrollbars.css +48 -0
package/README.md
CHANGED
|
@@ -1,3 +1,77 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @qq1948037137/adminsmart-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AdminSmart 的 React/Ant Design 组件包。基础控件保留 Ant 的原生属性、ref 与静态 API;跨页面布局由 `SearchPanel`、`DataTable`、`BusinessDrawer` 和 `SchemaForm` 统一。权限和业务数据请求仍由应用负责。
|
|
4
|
+
|
|
5
|
+
## npm 安装与宿主别名
|
|
6
|
+
|
|
7
|
+
公开分发包名为 `@qq1948037137/adminsmart-ui`,许可保持 `UNLICENSED`。源码 GitHub 仓库为私有仓库,npm 包为公开包;该组合没有官方 npm provenance。下面以首次版本 `0.1.20` 演示 Registry 安装;安装前应确认对应版本已经发布,应用升级时固定选择已验证的精确版本。
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-exact @qq1948037137/adminsmart-ui@0.1.20
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
新应用可直接从 `@qq1948037137/adminsmart-ui`、`@qq1948037137/adminsmart-ui/icons`、`@qq1948037137/adminsmart-ui/locale/zh_CN` 导入。已有 AdminSmart 宿主保持原导入路径,使用 npm alias 固定精确版:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-exact @adminsmart/ui@npm:@qq1948037137/adminsmart-ui@0.1.20
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 本地构建与验证
|
|
20
|
+
|
|
21
|
+
要求 React 19、Ant Design 6、`@ant-design/icons` 6 由宿主应用安装,避免重复 React 上下文和 Ant 主题。
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install
|
|
25
|
+
npm run check
|
|
26
|
+
npm pack
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`npm run check` 包含类型、组件契约、文档站与正式包构建。`npm run dev` 启动示例文档站,默认地址为 `http://127.0.0.1:5187/`;文档内的 `@adminsmart/ui` 仍由 Vite alias 直接指向 `src/`,无需先发布 npm。生成的压缩包名为 `qq1948037137-adminsmart-ui-<版本>.tgz`,旧宿主也可通过 `@adminsmart/ui@file:<压缩包路径>` 本地安装该实际分发名。
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
import { Button, Drawer, Form, Input, Table, theme } from '@adminsmart/ui'
|
|
33
|
+
import { SearchOutlined } from '@adminsmart/ui/icons'
|
|
34
|
+
import zhCN from '@adminsmart/ui/locale/zh_CN'
|
|
35
|
+
|
|
36
|
+
function Example() {
|
|
37
|
+
const [form] = Form.useForm()
|
|
38
|
+
const { token } = theme.useToken()
|
|
39
|
+
return (
|
|
40
|
+
<Form form={form}>
|
|
41
|
+
<Form.Item name="name" label="名称">
|
|
42
|
+
<Input prefix={<SearchOutlined />} />
|
|
43
|
+
</Form.Item>
|
|
44
|
+
<Button type="primary" htmlType="submit">保存</Button>
|
|
45
|
+
</Form>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
所有包装组件保留 Ant 原有 props、ref 类型与公开静态 API;包装后的静态子组件也有独立扩展点。`theme`、图标、locale 是**原样透传**,并非包装。`BusinessDrawer` 统一右侧业务抽屉及尺寸档位;原生 `Drawer` 仍允许按 Ant 属性覆盖。`SearchPanel` 使用等宽字段和最多两行的默认折叠;`DataTable` 默认将数据滚动限制在表格内部并把分页放在右下角。`SchemaForm` 根据 JSON 字段配置渲染输入、密码、文本域、数值、选择、单选、布尔值和日期控件,事件处理器通过独立 props 传入,不执行配置中的代码。输入值默认不裁剪空格,避免改变密码和精确搜索语义。
|
|
51
|
+
|
|
52
|
+
主应用的本地 tarball 过渡与 npm Registry 升级都必须锁定精确版本、实际包名和完整性,不能仅改依赖字符串而跳过来源校验。本库通过 `adminsmartUiSource: { sha256, gitCommit }` 提供构建源码标记,消费者使用 Registry 的 `dist.integrity` 与 `dist.tarball` 核对字节。该标记是项目来源契约,不是官方 provenance。
|
|
53
|
+
|
|
54
|
+
## 首次发布与可信自动发布
|
|
55
|
+
|
|
56
|
+
GitHub 工作流通过仓库变量 `NPM_RELEASE_ENABLED` 控制发布;变量未设为 `true` 时,仅显示待设置通知。首次包不存在时,发布状态机只返回 `bootstrap-needed`,不猜版本、不创建版本提交。首次发布前应完成账号 2FA 和 npm CLI 登录,确认源码已提交到私有仓库 `1948037137/adminsmart-ui` 的当前 `main`,然后执行:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm run release:prepare
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
该命令完整检查、在系统临时目录打包并做干净宿主 alias 安装,输出 `prepared`、`artifact` 和完整性。它不会发布、登录、配置 trust 或修改 Git。确认准备结果后,使用输出的真实 `artifact` 路径完成首发:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm publish <prepared-artifact-path> --access public --provenance=false --registry=https://registry.npmjs.org
|
|
66
|
+
npm trust github @qq1948037137/adminsmart-ui --file npm-release.yml --repo 1948037137/adminsmart-ui --allow-publish
|
|
67
|
+
gh variable set NPM_RELEASE_ENABLED --body true --repo 1948037137/adminsmart-ui
|
|
68
|
+
gh workflow run npm-release.yml --ref main --repo 1948037137/adminsmart-ui
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`npm trust` 需要包已存在、账号写权限和账号 2FA;npm 11.17.0 满足 CLI 要求。新 trust 需在两天内完成验证发布。CLI 登录由本人通过现代 npm 登录流程完成,不把密码或长期 npm Token 放进脚本、GitHub secrets 或源码。
|
|
72
|
+
|
|
73
|
+
启用后,`main` 的组件、样式、构建配置、测试或说明更新,在同一次 `npm-release.yml` 运行内完成 check、pack、干净安装、自动 patch、OIDC publish、版本回写与标签。工作流固定 Node 24/npm 11.17.0,串行发布,不靠标签触发另一个发布工作流;版本回写使用 `GITHUB_TOKEN` 和 `[skip ci]`,没有递归发布。源码或远程 `main` 变化时停止,不强推、不 stash/rebase。
|
|
74
|
+
|
|
75
|
+
如果 npm publish 成功而网络回执或 Git 回写失败,且远程 `main` 仍停留在原源码提交,重新运行工作流会核对精确版的 `adminsmartUiSource`、重新构建并校验真实包完整性,随后恢复版本提交,不重复发布。远程 `main` 已前进时会停止,需人工核实已发布版本与当前源码后决定后续处理,不承诺自动恢复。版本已回写而标签失败时只恢复该标签。不同来源已占用版本时停止;不会覆盖版本或跳到猜测的最新版本。重大 API 变化需要另行明确版本计划,自动脚本只增加 patch。
|
|
76
|
+
|
|
77
|
+
尚未创建 Git 仓库时,可执行 `npm run release:prepare -- --verify-only` 做真实打包和干净安装测试;此模式不伪造 `gitCommit`,测试包不能替代有源码声明的首次发布准备。
|
package/dist/icons.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/icons.ts
|
|
18
|
+
var icons_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(icons_exports);
|
|
20
|
+
__reExport(icons_exports, require("@ant-design/icons"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("@ant-design/icons")
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=icons.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/icons.ts"],"sourcesContent":["// 图标库是独立上游 API;从子路径原样透传,不将其宣称为二次封装组件。\nexport * from '@ant-design/icons'\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AACA,0BAAc,8BADd;","names":[]}
|
package/dist/icons.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@ant-design/icons';
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@ant-design/icons';
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/icons.ts"],"sourcesContent":["// 图标库是独立上游 API;从子路径原样透传,不将其宣称为二次封装组件。\nexport * from '@ant-design/icons'\n"],"mappings":";AACA,cAAc;","names":[]}
|