@ubean/shared 0.6.0 → 0.6.1-beta.2

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/dist/index.d.ts +17 -0
  2. package/package.json +4 -5
package/dist/index.d.ts CHANGED
@@ -148,6 +148,15 @@ export interface PageHead {
148
148
  htmlAttrs?: Record<string, string>;
149
149
  bodyAttrs?: Record<string, string>;
150
150
  }
151
+ /**
152
+ * 请求级「基础中间件/步骤」顺序记录的步骤名(TS-07)。
153
+ *
154
+ * 顺序即 `createUbeanApp()` 在 `_setupBaseMiddleware()` 中的注册顺序,13 步全序由
155
+ * `packages/app/test/middleware-order.test.ts` 锁定。该顺序是结构性事实 ——
156
+ * 只断言「某中间件存在」无法发现「注册顺序被调换」这类回归,因此框架把
157
+ * 实际经过的步骤按序记录,供黑盒断言(见 `GET /_health` 的 `middlewareOrder`)。
158
+ */
159
+ export type UbeanMiddlewareStep = 'handle' | 'requestId' | 'actionContext' | 'securityHeaders' | 'csrf' | 'dataCache' | 'cacheStore' | 'i18n' | 'routeRules' | 'routeCache' | 'websocket' | 'lifecycle' | 'healthEndpoint';
151
160
  export interface UbeanVariables extends RequestIdVariables {
152
161
  route: {
153
162
  meta: RouteMeta;
@@ -163,6 +172,14 @@ export interface UbeanVariables extends RequestIdVariables {
163
172
  * 未启用 routeRules 中间件时为 `undefined`。
164
173
  */
165
174
  routeRule?: RouteRule;
175
+ /**
176
+ * 本次请求实际经过的基础中间件步骤名,按注册(执行)顺序记录(TS-07)。
177
+ *
178
+ * 由 `_setupBaseMiddleware()` 中各中间件在进入时 push 自身名称;被配置关闭的
179
+ * 步骤(如 `security: false`)不会出现在数组里,因此「缺席」也是可断言的。
180
+ * 供 `GET /_health` 的 `mwOrder` 字段与 `packages/app/test` 的顺序断言消费。
181
+ */
182
+ __ubean_mw_order__?: UbeanMiddlewareStep[];
166
183
  }
167
184
  export interface UbeanBindings {}
168
185
  export interface UbeanEnv extends Env {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubean/shared",
3
- "version": "0.6.0",
3
+ "version": "0.6.1-beta.2",
4
4
  "description": "Shared protocol types, errors, env and universal utilities for ubean",
5
5
  "files": [
6
6
  "dist"
@@ -29,16 +29,15 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@standard-schema/spec": "1.1.0",
32
- "hono": "4.13.12",
32
+ "hono": "4.13.13",
33
33
  "pathe": "^2.0.3",
34
34
  "scule": "^1.3.0",
35
- "tslog": "^5.2.0",
36
- "ufo": "1.6.4"
35
+ "tslog": "^5.2.0"
37
36
  },
38
37
  "devDependencies": {
39
38
  "@types/node": "^26.6.4",
40
39
  "typescript": "npm:typescript-native-bridge@latest",
41
- "vite-plus": "1.0.0"
40
+ "vite-plus": "1.1.0"
42
41
  },
43
42
  "scripts": {
44
43
  "build": "vp pack",