@hzab/data-model 2.1.0-alpha.0 → 2.1.0-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/data-model",
3
- "version": "2.1.0-alpha.0",
3
+ "version": "2.1.0-alpha.3",
4
4
  "private": false,
5
5
  "description": "数据模型 2.1:再导出 core + useDataModel;后继 API 与旧写法双轨",
6
6
  "type": "module",
@@ -25,14 +25,26 @@
25
25
  "import": "./dist/index.js",
26
26
  "require": "./dist/index.cjs"
27
27
  },
28
+ "./src/axios": {
29
+ "types": "./dist/axios.d.ts",
30
+ "import": "./dist/axios.js",
31
+ "require": "./dist/axios.cjs"
32
+ },
33
+ "./src/*": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "require": "./dist/index.cjs"
37
+ },
28
38
  "./package.json": "./package.json"
29
39
  },
30
40
  "sideEffects": [
31
- "./dist/index.js",
32
- "./dist/index.cjs"
41
+ "./dist/*.js",
42
+ "./dist/*.cjs"
33
43
  ],
34
44
  "dependencies": {
35
45
  "axios": "^1.18.1",
46
+ "dayjs": "^1.11.11",
47
+ "lodash-es": "^4.18.1",
36
48
  "nanoid": "^3.3.15"
37
49
  },
38
50
  "engines": {
@@ -61,10 +73,10 @@
61
73
  "typescript": "^5.9.3",
62
74
  "vite": "^8.0.0",
63
75
  "vitest": "^4.1.10",
64
- "@hzab/data-model-core": "^2.1.0-alpha.0",
65
76
  "@hzab/eslint-config": "^0.0.0",
66
- "@hzab/vite-config": "^0.0.2-alpha.0",
67
- "@hzab/typescript-config": "^0.0.0"
77
+ "@hzab/data-model-core": "^2.1.0-alpha.0",
78
+ "@hzab/typescript-config": "^0.0.0",
79
+ "@hzab/vite-config": "^0.0.2-alpha.0"
68
80
  },
69
81
  "scripts": {
70
82
  "build": "tsup",
package/src/axios.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 旧深路径兼容 shim:`@hzab/data-model/src/axios`。
3
+ *
4
+ * 2.1 起包根改为 `dist/` 且 `exports` 限制深路径;但旧 list-render / 老页面仍会
5
+ * `import { axios } from "@hzab/data-model/src/axios"`(命名)或
6
+ * `import axios from "@hzab/data-model/src/axios"`(默认)取同一 axios 实例。
7
+ *
8
+ * 本 shim 与包根 barrel 共享同一份被 `noExternal` 打进 dist 的 core,
9
+ * 因此 axios 实例是同一个:拦截器 / token 配置对两者同时生效。
10
+ * 命名导出与包根一致,仅默认导出改为 axios 实例(旧写法语义)。
11
+ *
12
+ * @packageDocumentation
13
+ */
14
+ export * from "./index";
15
+ export { axios as default } from "./index";