@oiyo/config 0.4.9 → 0.6.0

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/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/config v0.4.9
2
+ * @oiyo/config v0.6.0
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
@@ -119,11 +119,33 @@ const DEFAULT_RUNTIME_EFFECT_SCOPE_APIS = [
119
119
  "getCurrentScope",
120
120
  "onScopeDispose"
121
121
  ];
122
- const DEFAULT_RUNTIME_OIYO_APIS = [
123
- "http",
122
+ const DEFAULT_RUNTIME_OIYO_HTTP_APIS = [
123
+ "createHttpAborter",
124
124
  "createHttp",
125
- "createHttpAborter"
125
+ "http",
126
+ "HttpError",
127
+ "isHttpError"
128
+ ];
129
+ const DEFAULT_RUNTIME_OIYO_MIDDLEWARE_APIS = [
130
+ "abortNavigation",
131
+ "defineRouteMiddleware",
132
+ "goTo"
133
+ ];
134
+ const DEFAULT_RUNTIME_OIYO_APIS = [...DEFAULT_RUNTIME_OIYO_HTTP_APIS, ...DEFAULT_RUNTIME_OIYO_MIDDLEWARE_APIS];
135
+ const DEFAULT_RUNTIME_OIYO_HTTP_TYPES = [
136
+ "ResponseBodyType",
137
+ "HttpConfig",
138
+ "HttpCommonOptions",
139
+ "HttpDownloadOptions",
140
+ "HttpOptions",
141
+ "HttpRequestOptions",
142
+ "HttpUploadOptions",
143
+ "HttpDownloadResponse",
144
+ "HttpRequestResponse",
145
+ "HttpResponse",
146
+ "HttpUploadResponse"
126
147
  ];
148
+ const DEFAULT_RUNTIME_OIYO_MIDDLEWARE_TYPES = ["RouteMiddleware"];
127
149
  const DEFAULT_RUNTIME_TYPES = [
128
150
  "Component",
129
151
  "ComponentPublicInstance",
@@ -143,17 +165,8 @@ const DEFAULT_RUNTIME_TYPES = [
143
165
  "Slots",
144
166
  "VNode",
145
167
  "WritableComputedRef",
146
- "ResponseBodyType",
147
- "HttpConfig",
148
- "HttpError",
149
- "HttpCommonOptions",
150
- "HttpDownloadOptions",
151
- "HttpOptions",
152
- "HttpRequestOptions",
153
- "HttpUploadOptions",
154
- "HttpDownloadResponse",
155
- "HttpRequestResponse",
156
- "HttpUploadResponse"
168
+ ...DEFAULT_RUNTIME_OIYO_HTTP_TYPES,
169
+ ...DEFAULT_RUNTIME_OIYO_MIDDLEWARE_TYPES
157
170
  ].map((name) => ({
158
171
  name,
159
172
  isType: true
@@ -184,7 +197,8 @@ const defaultConfig = {
184
197
  dir: {
185
198
  mainPackage: "pages",
186
199
  subPackages: [],
187
- layouts: "layouts"
200
+ layouts: "layouts",
201
+ middlewares: "middlewares"
188
202
  },
189
203
  scan: {
190
204
  apis: [
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/config v0.4.9
2
+ * @oiyo/config v0.6.0
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
@@ -61,7 +61,7 @@ interface OiyoConfigDir {
61
61
  mainPackage?: string;
62
62
  /**
63
63
  * 子包目录列表
64
- * @default '<srcDir>/{root}/pages'
64
+ * @default '<srcDir>/packages/{root}/pages'
65
65
  */
66
66
  subPackages?: string[];
67
67
  /**
@@ -69,6 +69,11 @@ interface OiyoConfigDir {
69
69
  * @default '<srcDir>/layouts'
70
70
  */
71
71
  layouts?: string;
72
+ /**
73
+ * 中间件目录
74
+ * @default '<srcDir>/middlewares'
75
+ */
76
+ middlewares?: string;
72
77
  }
73
78
  /**
74
79
  * IDE 配置路径平台
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/config v0.4.9
2
+ * @oiyo/config v0.6.0
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
@@ -61,7 +61,7 @@ interface OiyoConfigDir {
61
61
  mainPackage?: string;
62
62
  /**
63
63
  * 子包目录列表
64
- * @default '<srcDir>/{root}/pages'
64
+ * @default '<srcDir>/packages/{root}/pages'
65
65
  */
66
66
  subPackages?: string[];
67
67
  /**
@@ -69,6 +69,11 @@ interface OiyoConfigDir {
69
69
  * @default '<srcDir>/layouts'
70
70
  */
71
71
  layouts?: string;
72
+ /**
73
+ * 中间件目录
74
+ * @default '<srcDir>/middlewares'
75
+ */
76
+ middlewares?: string;
72
77
  }
73
78
  /**
74
79
  * IDE 配置路径平台
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @oiyo/config v0.4.9
2
+ * @oiyo/config v0.6.0
3
3
  * Copyright (c) 2026 skiyee. All rights reserved.
4
4
  * Commercial software. See LICENSE for terms.
5
5
  * Official site: https://oiyo.js.org
@@ -95,11 +95,33 @@ const DEFAULT_RUNTIME_EFFECT_SCOPE_APIS = [
95
95
  "getCurrentScope",
96
96
  "onScopeDispose"
97
97
  ];
98
- const DEFAULT_RUNTIME_OIYO_APIS = [
99
- "http",
98
+ const DEFAULT_RUNTIME_OIYO_HTTP_APIS = [
99
+ "createHttpAborter",
100
100
  "createHttp",
101
- "createHttpAborter"
101
+ "http",
102
+ "HttpError",
103
+ "isHttpError"
104
+ ];
105
+ const DEFAULT_RUNTIME_OIYO_MIDDLEWARE_APIS = [
106
+ "abortNavigation",
107
+ "defineRouteMiddleware",
108
+ "goTo"
109
+ ];
110
+ const DEFAULT_RUNTIME_OIYO_APIS = [...DEFAULT_RUNTIME_OIYO_HTTP_APIS, ...DEFAULT_RUNTIME_OIYO_MIDDLEWARE_APIS];
111
+ const DEFAULT_RUNTIME_OIYO_HTTP_TYPES = [
112
+ "ResponseBodyType",
113
+ "HttpConfig",
114
+ "HttpCommonOptions",
115
+ "HttpDownloadOptions",
116
+ "HttpOptions",
117
+ "HttpRequestOptions",
118
+ "HttpUploadOptions",
119
+ "HttpDownloadResponse",
120
+ "HttpRequestResponse",
121
+ "HttpResponse",
122
+ "HttpUploadResponse"
102
123
  ];
124
+ const DEFAULT_RUNTIME_OIYO_MIDDLEWARE_TYPES = ["RouteMiddleware"];
103
125
  const DEFAULT_RUNTIME_TYPES = [
104
126
  "Component",
105
127
  "ComponentPublicInstance",
@@ -119,17 +141,8 @@ const DEFAULT_RUNTIME_TYPES = [
119
141
  "Slots",
120
142
  "VNode",
121
143
  "WritableComputedRef",
122
- "ResponseBodyType",
123
- "HttpConfig",
124
- "HttpError",
125
- "HttpCommonOptions",
126
- "HttpDownloadOptions",
127
- "HttpOptions",
128
- "HttpRequestOptions",
129
- "HttpUploadOptions",
130
- "HttpDownloadResponse",
131
- "HttpRequestResponse",
132
- "HttpUploadResponse"
144
+ ...DEFAULT_RUNTIME_OIYO_HTTP_TYPES,
145
+ ...DEFAULT_RUNTIME_OIYO_MIDDLEWARE_TYPES
133
146
  ].map((name) => ({
134
147
  name,
135
148
  isType: true
@@ -160,7 +173,8 @@ const defaultConfig = {
160
173
  dir: {
161
174
  mainPackage: "pages",
162
175
  subPackages: [],
163
- layouts: "layouts"
176
+ layouts: "layouts",
177
+ middlewares: "middlewares"
164
178
  },
165
179
  scan: {
166
180
  apis: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oiyo/config",
3
3
  "type": "module",
4
- "version": "0.4.9",
4
+ "version": "0.6.0",
5
5
  "author": {
6
6
  "name": "skiyee",
7
7
  "email": "319619193@qq.com",