@oiyo/config 0.0.3 → 0.1.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/LICENSE +2 -2
- package/README.md +1 -1
- package/dist/index.cjs +153 -2
- package/dist/index.d.cts +42 -3
- package/dist/index.d.mts +42 -3
- package/dist/index.mjs +152 -3
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -4,8 +4,8 @@ oiyo 商业软件许可协议 / oiyo Commercial Software License Agreement
|
|
|
4
4
|
Last Updated: 2026-04-08
|
|
5
5
|
作者:skiyee
|
|
6
6
|
Author: skiyee
|
|
7
|
-
官网:https://oiyo.
|
|
8
|
-
Website: https://oiyo.
|
|
7
|
+
官网:https://oiyo.js.org
|
|
8
|
+
Website: https://oiyo.js.org
|
|
9
9
|
|
|
10
10
|
请在安装、复制、分发或使用 OIYO 前,请先阅读本协议。
|
|
11
11
|
PLEASE READ THIS AGREEMENT BEFORE INSTALLING, COPYING, DISTRIBUTING, OR USING OIYO.
|
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/config v0.0
|
|
2
|
+
* @oiyo/config v0.1.0
|
|
3
3
|
* Copyright (c) 2026 skiyee. All rights reserved.
|
|
4
4
|
* Commercial software. See LICENSE for terms.
|
|
5
|
-
* Official site: https://oiyo.
|
|
5
|
+
* Official site: https://oiyo.js.org
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
@@ -31,6 +31,125 @@ let node_process = require("node:process");
|
|
|
31
31
|
node_process = __toESM(node_process);
|
|
32
32
|
let defu = require("defu");
|
|
33
33
|
//#region src/oiyo/index.ts
|
|
34
|
+
const DEFAULT_RUNTIME_LIFECYCLE_APIS = [
|
|
35
|
+
"onBeforeMount",
|
|
36
|
+
"onMounted",
|
|
37
|
+
"onBeforeUpdate",
|
|
38
|
+
"onUpdated",
|
|
39
|
+
"onBeforeUnmount",
|
|
40
|
+
"onUnmounted",
|
|
41
|
+
"onActivated",
|
|
42
|
+
"onDeactivated",
|
|
43
|
+
"onErrorCaptured",
|
|
44
|
+
"onRenderTracked",
|
|
45
|
+
"onRenderTriggered",
|
|
46
|
+
"onServerPrefetch",
|
|
47
|
+
"onLaunch",
|
|
48
|
+
"onShow",
|
|
49
|
+
"onHide",
|
|
50
|
+
"onError",
|
|
51
|
+
"onPageNotFound",
|
|
52
|
+
"onUnhandledRejection",
|
|
53
|
+
"onThemeChange",
|
|
54
|
+
"onInit",
|
|
55
|
+
"onLoad",
|
|
56
|
+
"onReady",
|
|
57
|
+
"onPullDownRefresh",
|
|
58
|
+
"onReachBottom",
|
|
59
|
+
"onPageScroll",
|
|
60
|
+
"onResize",
|
|
61
|
+
"onTabItemTap",
|
|
62
|
+
"onBackPress",
|
|
63
|
+
"onUnload",
|
|
64
|
+
"onShareAppMessage",
|
|
65
|
+
"onShareTimeline",
|
|
66
|
+
"onAddToFavorites",
|
|
67
|
+
"onNavigationBarButtonTap",
|
|
68
|
+
"onNavigationBarSearchInputClicked",
|
|
69
|
+
"onNavigationBarSearchInputChanged",
|
|
70
|
+
"onNavigationBarSearchInputConfirmed",
|
|
71
|
+
"onNavigationBarSearchInputFocusChanged"
|
|
72
|
+
];
|
|
73
|
+
const DEFAULT_RUNTIME_SETUP_APIS = [
|
|
74
|
+
"useAttrs",
|
|
75
|
+
"useSlots",
|
|
76
|
+
"useModel"
|
|
77
|
+
];
|
|
78
|
+
const DEFAULT_RUNTIME_REACTIVITY_APIS = [
|
|
79
|
+
"computed",
|
|
80
|
+
"customRef",
|
|
81
|
+
"isProxy",
|
|
82
|
+
"isReactive",
|
|
83
|
+
"isReadonly",
|
|
84
|
+
"isRef",
|
|
85
|
+
"isShallow",
|
|
86
|
+
"markRaw",
|
|
87
|
+
"reactive",
|
|
88
|
+
"readonly",
|
|
89
|
+
"ref",
|
|
90
|
+
"shallowReactive",
|
|
91
|
+
"shallowReadonly",
|
|
92
|
+
"shallowRef",
|
|
93
|
+
"toRaw",
|
|
94
|
+
"toRef",
|
|
95
|
+
"toRefs",
|
|
96
|
+
"toValue",
|
|
97
|
+
"triggerRef",
|
|
98
|
+
"unref",
|
|
99
|
+
"watch",
|
|
100
|
+
"watchEffect",
|
|
101
|
+
"watchPostEffect",
|
|
102
|
+
"watchSyncEffect"
|
|
103
|
+
];
|
|
104
|
+
const DEFAULT_RUNTIME_COMPONENT_APIS = [
|
|
105
|
+
"createSSRApp",
|
|
106
|
+
"defineAsyncComponent",
|
|
107
|
+
"defineComponent",
|
|
108
|
+
"getCurrentInstance",
|
|
109
|
+
"h",
|
|
110
|
+
"inject",
|
|
111
|
+
"nextTick",
|
|
112
|
+
"provide",
|
|
113
|
+
"resolveComponent",
|
|
114
|
+
"useCssModule",
|
|
115
|
+
"useCssVars"
|
|
116
|
+
];
|
|
117
|
+
const DEFAULT_RUNTIME_EFFECT_SCOPE_APIS = [
|
|
118
|
+
"effectScope",
|
|
119
|
+
"getCurrentScope",
|
|
120
|
+
"onScopeDispose"
|
|
121
|
+
];
|
|
122
|
+
const DEFAULT_RUNTIME_TYPES = [
|
|
123
|
+
"Component",
|
|
124
|
+
"ComponentPublicInstance",
|
|
125
|
+
"ComputedRef",
|
|
126
|
+
"DirectiveBinding",
|
|
127
|
+
"EffectScope",
|
|
128
|
+
"ExtractDefaultPropTypes",
|
|
129
|
+
"ExtractPropTypes",
|
|
130
|
+
"ExtractPublicPropTypes",
|
|
131
|
+
"InjectionKey",
|
|
132
|
+
"MaybeRef",
|
|
133
|
+
"MaybeRefOrGetter",
|
|
134
|
+
"PropType",
|
|
135
|
+
"Ref",
|
|
136
|
+
"ShallowRef",
|
|
137
|
+
"Slot",
|
|
138
|
+
"Slots",
|
|
139
|
+
"VNode",
|
|
140
|
+
"WritableComputedRef"
|
|
141
|
+
].map((name) => ({
|
|
142
|
+
name,
|
|
143
|
+
isType: true
|
|
144
|
+
}));
|
|
145
|
+
const DEFAULT_RUNTIME_APIS = [
|
|
146
|
+
...DEFAULT_RUNTIME_LIFECYCLE_APIS,
|
|
147
|
+
...DEFAULT_RUNTIME_SETUP_APIS,
|
|
148
|
+
...DEFAULT_RUNTIME_REACTIVITY_APIS,
|
|
149
|
+
...DEFAULT_RUNTIME_COMPONENT_APIS,
|
|
150
|
+
...DEFAULT_RUNTIME_EFFECT_SCOPE_APIS,
|
|
151
|
+
...DEFAULT_RUNTIME_TYPES
|
|
152
|
+
];
|
|
34
153
|
/**
|
|
35
154
|
* 默认排除规则
|
|
36
155
|
*/
|
|
@@ -51,6 +170,30 @@ const defaultConfig = {
|
|
|
51
170
|
layouts: "layouts",
|
|
52
171
|
middleware: "middlewares"
|
|
53
172
|
},
|
|
173
|
+
scan: {
|
|
174
|
+
apis: [
|
|
175
|
+
"composables",
|
|
176
|
+
{
|
|
177
|
+
from: "@skiyee/oiyo",
|
|
178
|
+
only: [
|
|
179
|
+
"definePageMeta",
|
|
180
|
+
"defineRootContext",
|
|
181
|
+
{
|
|
182
|
+
name: "PageMeta",
|
|
183
|
+
isType: true
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
from: "@skiyee/oiyo/runtime",
|
|
189
|
+
only: DEFAULT_RUNTIME_APIS
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
components: ["components", {
|
|
193
|
+
from: "@skiyee/oiyo",
|
|
194
|
+
only: ["OiyoPage", "OiyoLayout"]
|
|
195
|
+
}]
|
|
196
|
+
},
|
|
54
197
|
exclude: DEFAULT_EXCLUDE,
|
|
55
198
|
ide: {
|
|
56
199
|
open: false,
|
|
@@ -68,6 +211,12 @@ function resolveOiyoConfig(userConfig) {
|
|
|
68
211
|
function defineOiyoConfig(config) {
|
|
69
212
|
return config;
|
|
70
213
|
}
|
|
214
|
+
function defineApiScanner(input) {
|
|
215
|
+
return input;
|
|
216
|
+
}
|
|
217
|
+
function defineComponentScanner(input) {
|
|
218
|
+
return input;
|
|
219
|
+
}
|
|
71
220
|
//#endregion
|
|
72
221
|
//#region src/pages/index.ts
|
|
73
222
|
function definePagesConfig(config) {
|
|
@@ -76,6 +225,8 @@ function definePagesConfig(config) {
|
|
|
76
225
|
//#endregion
|
|
77
226
|
exports.DEFAULT_EXCLUDE = DEFAULT_EXCLUDE;
|
|
78
227
|
exports.defaultConfig = defaultConfig;
|
|
228
|
+
exports.defineApiScanner = defineApiScanner;
|
|
229
|
+
exports.defineComponentScanner = defineComponentScanner;
|
|
79
230
|
exports.defineOiyoConfig = defineOiyoConfig;
|
|
80
231
|
exports.definePagesConfig = definePagesConfig;
|
|
81
232
|
exports.resolveOiyoConfig = resolveOiyoConfig;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/config v0.0
|
|
2
|
+
* @oiyo/config v0.1.0
|
|
3
3
|
* Copyright (c) 2026 skiyee. All rights reserved.
|
|
4
4
|
* Commercial software. See LICENSE for terms.
|
|
5
|
-
* Official site: https://oiyo.
|
|
5
|
+
* Official site: https://oiyo.js.org
|
|
6
6
|
*/
|
|
7
7
|
//#region src/oiyo/index.d.ts
|
|
8
|
+
type ScanName = string | ScanNameItem;
|
|
9
|
+
interface ScanNameItem {
|
|
10
|
+
/** 来源侧名字 */
|
|
11
|
+
name: string;
|
|
12
|
+
/** 暴露到项目中的名字 */
|
|
13
|
+
as?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 是否仅作为类型导入/导出
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
isType?: boolean;
|
|
19
|
+
}
|
|
20
|
+
type GlobRule = string | string[];
|
|
21
|
+
type ApiScanner = string | {
|
|
22
|
+
/** 目录、文件、包或包子路径 */from: string; /** 是否扫描类型导出(仅参与 d.ts 生成) */
|
|
23
|
+
types?: boolean; /** 只匹配这些文件 */
|
|
24
|
+
pattern?: GlobRule; /** 忽略这些文件 */
|
|
25
|
+
ignore?: GlobRule; /** 只保留这些导出,并支持重命名 */
|
|
26
|
+
only?: ScanName[]; /** 排除这些最终暴露名 */
|
|
27
|
+
exclude?: string[];
|
|
28
|
+
};
|
|
29
|
+
type ComponentScanner = string | {
|
|
30
|
+
/** 扫描目录、文件、包或包子路径 */from: string; /** 只匹配这些文件 */
|
|
31
|
+
pattern?: GlobRule; /** 忽略这些文件 */
|
|
32
|
+
ignore?: GlobRule; /** 只保留这些导出,并支持重命名 */
|
|
33
|
+
only?: ScanName[]; /** 为组件添加前缀 */
|
|
34
|
+
prefix?: string; /** 是否目录链参与命名 */
|
|
35
|
+
chain?: boolean;
|
|
36
|
+
};
|
|
37
|
+
interface OiyoConfigScan {
|
|
38
|
+
/** 自动扫描与注册 API */
|
|
39
|
+
apis?: ApiScanner[];
|
|
40
|
+
/** 自动扫描与注册组件 */
|
|
41
|
+
components?: ComponentScanner[];
|
|
42
|
+
}
|
|
8
43
|
/**
|
|
9
44
|
* Oiyo 路径配置
|
|
10
45
|
*/
|
|
@@ -37,6 +72,8 @@ interface OiyoConfig {
|
|
|
37
72
|
srcDir?: string;
|
|
38
73
|
/** 目录配置 */
|
|
39
74
|
dir?: Partial<OiyoConfigDir>;
|
|
75
|
+
/** 自动扫描配置 */
|
|
76
|
+
scan?: Partial<OiyoConfigScan>;
|
|
40
77
|
/** 排除的页面(glob 模式) */
|
|
41
78
|
exclude?: string[];
|
|
42
79
|
/**
|
|
@@ -60,6 +97,8 @@ declare const defaultConfig: OiyoConfig;
|
|
|
60
97
|
*/
|
|
61
98
|
declare function resolveOiyoConfig(userConfig?: Partial<OiyoConfig>): OiyoConfig;
|
|
62
99
|
declare function defineOiyoConfig(config: Partial<OiyoConfig>): Partial<OiyoConfig>;
|
|
100
|
+
declare function defineApiScanner(input: ApiScanner): ApiScanner;
|
|
101
|
+
declare function defineComponentScanner(input: ComponentScanner): ComponentScanner;
|
|
63
102
|
//#endregion
|
|
64
103
|
//#region src/pages/interfaces/condition.d.ts
|
|
65
104
|
interface ConditionItem {
|
|
@@ -3019,4 +3058,4 @@ interface PagesJson {
|
|
|
3019
3058
|
interface PagesConfig extends PagesJson {}
|
|
3020
3059
|
declare function definePagesConfig(config: PagesConfig): PagesConfig;
|
|
3021
3060
|
//#endregion
|
|
3022
|
-
export { AnimationType, Color, Condition, ConditionItem, DEFAULT_EXCLUDE, EasyCom, GlobalStyle, HEXColor, OiyoConfig, OiyoConfigDir, OiyoConfigIDE, Page, PagesConfig, PagesJson, PercentageSize, PxSize, RGBAColor, RGBColor, RpxSize, SubPackage, TabBar, TabBarIconFont, TabBarItem, TabBarMidButton, TheWindow, ThemeVar, TitleNViewButton, UniIdRouter, defaultConfig, defineOiyoConfig, definePagesConfig, resolveOiyoConfig };
|
|
3061
|
+
export { AnimationType, ApiScanner, Color, ComponentScanner, Condition, ConditionItem, DEFAULT_EXCLUDE, EasyCom, GlobRule, GlobalStyle, HEXColor, OiyoConfig, OiyoConfigDir, OiyoConfigIDE, OiyoConfigScan, Page, PagesConfig, PagesJson, PercentageSize, PxSize, RGBAColor, RGBColor, RpxSize, ScanName, ScanNameItem, SubPackage, TabBar, TabBarIconFont, TabBarItem, TabBarMidButton, TheWindow, ThemeVar, TitleNViewButton, UniIdRouter, defaultConfig, defineApiScanner, defineComponentScanner, defineOiyoConfig, definePagesConfig, resolveOiyoConfig };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/config v0.0
|
|
2
|
+
* @oiyo/config v0.1.0
|
|
3
3
|
* Copyright (c) 2026 skiyee. All rights reserved.
|
|
4
4
|
* Commercial software. See LICENSE for terms.
|
|
5
|
-
* Official site: https://oiyo.
|
|
5
|
+
* Official site: https://oiyo.js.org
|
|
6
6
|
*/
|
|
7
7
|
//#region src/oiyo/index.d.ts
|
|
8
|
+
type ScanName = string | ScanNameItem;
|
|
9
|
+
interface ScanNameItem {
|
|
10
|
+
/** 来源侧名字 */
|
|
11
|
+
name: string;
|
|
12
|
+
/** 暴露到项目中的名字 */
|
|
13
|
+
as?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 是否仅作为类型导入/导出
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
isType?: boolean;
|
|
19
|
+
}
|
|
20
|
+
type GlobRule = string | string[];
|
|
21
|
+
type ApiScanner = string | {
|
|
22
|
+
/** 目录、文件、包或包子路径 */from: string; /** 是否扫描类型导出(仅参与 d.ts 生成) */
|
|
23
|
+
types?: boolean; /** 只匹配这些文件 */
|
|
24
|
+
pattern?: GlobRule; /** 忽略这些文件 */
|
|
25
|
+
ignore?: GlobRule; /** 只保留这些导出,并支持重命名 */
|
|
26
|
+
only?: ScanName[]; /** 排除这些最终暴露名 */
|
|
27
|
+
exclude?: string[];
|
|
28
|
+
};
|
|
29
|
+
type ComponentScanner = string | {
|
|
30
|
+
/** 扫描目录、文件、包或包子路径 */from: string; /** 只匹配这些文件 */
|
|
31
|
+
pattern?: GlobRule; /** 忽略这些文件 */
|
|
32
|
+
ignore?: GlobRule; /** 只保留这些导出,并支持重命名 */
|
|
33
|
+
only?: ScanName[]; /** 为组件添加前缀 */
|
|
34
|
+
prefix?: string; /** 是否目录链参与命名 */
|
|
35
|
+
chain?: boolean;
|
|
36
|
+
};
|
|
37
|
+
interface OiyoConfigScan {
|
|
38
|
+
/** 自动扫描与注册 API */
|
|
39
|
+
apis?: ApiScanner[];
|
|
40
|
+
/** 自动扫描与注册组件 */
|
|
41
|
+
components?: ComponentScanner[];
|
|
42
|
+
}
|
|
8
43
|
/**
|
|
9
44
|
* Oiyo 路径配置
|
|
10
45
|
*/
|
|
@@ -37,6 +72,8 @@ interface OiyoConfig {
|
|
|
37
72
|
srcDir?: string;
|
|
38
73
|
/** 目录配置 */
|
|
39
74
|
dir?: Partial<OiyoConfigDir>;
|
|
75
|
+
/** 自动扫描配置 */
|
|
76
|
+
scan?: Partial<OiyoConfigScan>;
|
|
40
77
|
/** 排除的页面(glob 模式) */
|
|
41
78
|
exclude?: string[];
|
|
42
79
|
/**
|
|
@@ -60,6 +97,8 @@ declare const defaultConfig: OiyoConfig;
|
|
|
60
97
|
*/
|
|
61
98
|
declare function resolveOiyoConfig(userConfig?: Partial<OiyoConfig>): OiyoConfig;
|
|
62
99
|
declare function defineOiyoConfig(config: Partial<OiyoConfig>): Partial<OiyoConfig>;
|
|
100
|
+
declare function defineApiScanner(input: ApiScanner): ApiScanner;
|
|
101
|
+
declare function defineComponentScanner(input: ComponentScanner): ComponentScanner;
|
|
63
102
|
//#endregion
|
|
64
103
|
//#region src/pages/interfaces/condition.d.ts
|
|
65
104
|
interface ConditionItem {
|
|
@@ -3019,4 +3058,4 @@ interface PagesJson {
|
|
|
3019
3058
|
interface PagesConfig extends PagesJson {}
|
|
3020
3059
|
declare function definePagesConfig(config: PagesConfig): PagesConfig;
|
|
3021
3060
|
//#endregion
|
|
3022
|
-
export { AnimationType, Color, Condition, ConditionItem, DEFAULT_EXCLUDE, EasyCom, GlobalStyle, HEXColor, OiyoConfig, OiyoConfigDir, OiyoConfigIDE, Page, PagesConfig, PagesJson, PercentageSize, PxSize, RGBAColor, RGBColor, RpxSize, SubPackage, TabBar, TabBarIconFont, TabBarItem, TabBarMidButton, TheWindow, ThemeVar, TitleNViewButton, UniIdRouter, defaultConfig, defineOiyoConfig, definePagesConfig, resolveOiyoConfig };
|
|
3061
|
+
export { AnimationType, ApiScanner, Color, ComponentScanner, Condition, ConditionItem, DEFAULT_EXCLUDE, EasyCom, GlobRule, GlobalStyle, HEXColor, OiyoConfig, OiyoConfigDir, OiyoConfigIDE, OiyoConfigScan, Page, PagesConfig, PagesJson, PercentageSize, PxSize, RGBAColor, RGBColor, RpxSize, ScanName, ScanNameItem, SubPackage, TabBar, TabBarIconFont, TabBarItem, TabBarMidButton, TheWindow, ThemeVar, TitleNViewButton, UniIdRouter, defaultConfig, defineApiScanner, defineComponentScanner, defineOiyoConfig, definePagesConfig, resolveOiyoConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,131 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @oiyo/config v0.0
|
|
2
|
+
* @oiyo/config v0.1.0
|
|
3
3
|
* Copyright (c) 2026 skiyee. All rights reserved.
|
|
4
4
|
* Commercial software. See LICENSE for terms.
|
|
5
|
-
* Official site: https://oiyo.
|
|
5
|
+
* Official site: https://oiyo.js.org
|
|
6
6
|
*/
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
//#region src/oiyo/index.ts
|
|
10
|
+
const DEFAULT_RUNTIME_LIFECYCLE_APIS = [
|
|
11
|
+
"onBeforeMount",
|
|
12
|
+
"onMounted",
|
|
13
|
+
"onBeforeUpdate",
|
|
14
|
+
"onUpdated",
|
|
15
|
+
"onBeforeUnmount",
|
|
16
|
+
"onUnmounted",
|
|
17
|
+
"onActivated",
|
|
18
|
+
"onDeactivated",
|
|
19
|
+
"onErrorCaptured",
|
|
20
|
+
"onRenderTracked",
|
|
21
|
+
"onRenderTriggered",
|
|
22
|
+
"onServerPrefetch",
|
|
23
|
+
"onLaunch",
|
|
24
|
+
"onShow",
|
|
25
|
+
"onHide",
|
|
26
|
+
"onError",
|
|
27
|
+
"onPageNotFound",
|
|
28
|
+
"onUnhandledRejection",
|
|
29
|
+
"onThemeChange",
|
|
30
|
+
"onInit",
|
|
31
|
+
"onLoad",
|
|
32
|
+
"onReady",
|
|
33
|
+
"onPullDownRefresh",
|
|
34
|
+
"onReachBottom",
|
|
35
|
+
"onPageScroll",
|
|
36
|
+
"onResize",
|
|
37
|
+
"onTabItemTap",
|
|
38
|
+
"onBackPress",
|
|
39
|
+
"onUnload",
|
|
40
|
+
"onShareAppMessage",
|
|
41
|
+
"onShareTimeline",
|
|
42
|
+
"onAddToFavorites",
|
|
43
|
+
"onNavigationBarButtonTap",
|
|
44
|
+
"onNavigationBarSearchInputClicked",
|
|
45
|
+
"onNavigationBarSearchInputChanged",
|
|
46
|
+
"onNavigationBarSearchInputConfirmed",
|
|
47
|
+
"onNavigationBarSearchInputFocusChanged"
|
|
48
|
+
];
|
|
49
|
+
const DEFAULT_RUNTIME_SETUP_APIS = [
|
|
50
|
+
"useAttrs",
|
|
51
|
+
"useSlots",
|
|
52
|
+
"useModel"
|
|
53
|
+
];
|
|
54
|
+
const DEFAULT_RUNTIME_REACTIVITY_APIS = [
|
|
55
|
+
"computed",
|
|
56
|
+
"customRef",
|
|
57
|
+
"isProxy",
|
|
58
|
+
"isReactive",
|
|
59
|
+
"isReadonly",
|
|
60
|
+
"isRef",
|
|
61
|
+
"isShallow",
|
|
62
|
+
"markRaw",
|
|
63
|
+
"reactive",
|
|
64
|
+
"readonly",
|
|
65
|
+
"ref",
|
|
66
|
+
"shallowReactive",
|
|
67
|
+
"shallowReadonly",
|
|
68
|
+
"shallowRef",
|
|
69
|
+
"toRaw",
|
|
70
|
+
"toRef",
|
|
71
|
+
"toRefs",
|
|
72
|
+
"toValue",
|
|
73
|
+
"triggerRef",
|
|
74
|
+
"unref",
|
|
75
|
+
"watch",
|
|
76
|
+
"watchEffect",
|
|
77
|
+
"watchPostEffect",
|
|
78
|
+
"watchSyncEffect"
|
|
79
|
+
];
|
|
80
|
+
const DEFAULT_RUNTIME_COMPONENT_APIS = [
|
|
81
|
+
"createSSRApp",
|
|
82
|
+
"defineAsyncComponent",
|
|
83
|
+
"defineComponent",
|
|
84
|
+
"getCurrentInstance",
|
|
85
|
+
"h",
|
|
86
|
+
"inject",
|
|
87
|
+
"nextTick",
|
|
88
|
+
"provide",
|
|
89
|
+
"resolveComponent",
|
|
90
|
+
"useCssModule",
|
|
91
|
+
"useCssVars"
|
|
92
|
+
];
|
|
93
|
+
const DEFAULT_RUNTIME_EFFECT_SCOPE_APIS = [
|
|
94
|
+
"effectScope",
|
|
95
|
+
"getCurrentScope",
|
|
96
|
+
"onScopeDispose"
|
|
97
|
+
];
|
|
98
|
+
const DEFAULT_RUNTIME_TYPES = [
|
|
99
|
+
"Component",
|
|
100
|
+
"ComponentPublicInstance",
|
|
101
|
+
"ComputedRef",
|
|
102
|
+
"DirectiveBinding",
|
|
103
|
+
"EffectScope",
|
|
104
|
+
"ExtractDefaultPropTypes",
|
|
105
|
+
"ExtractPropTypes",
|
|
106
|
+
"ExtractPublicPropTypes",
|
|
107
|
+
"InjectionKey",
|
|
108
|
+
"MaybeRef",
|
|
109
|
+
"MaybeRefOrGetter",
|
|
110
|
+
"PropType",
|
|
111
|
+
"Ref",
|
|
112
|
+
"ShallowRef",
|
|
113
|
+
"Slot",
|
|
114
|
+
"Slots",
|
|
115
|
+
"VNode",
|
|
116
|
+
"WritableComputedRef"
|
|
117
|
+
].map((name) => ({
|
|
118
|
+
name,
|
|
119
|
+
isType: true
|
|
120
|
+
}));
|
|
121
|
+
const DEFAULT_RUNTIME_APIS = [
|
|
122
|
+
...DEFAULT_RUNTIME_LIFECYCLE_APIS,
|
|
123
|
+
...DEFAULT_RUNTIME_SETUP_APIS,
|
|
124
|
+
...DEFAULT_RUNTIME_REACTIVITY_APIS,
|
|
125
|
+
...DEFAULT_RUNTIME_COMPONENT_APIS,
|
|
126
|
+
...DEFAULT_RUNTIME_EFFECT_SCOPE_APIS,
|
|
127
|
+
...DEFAULT_RUNTIME_TYPES
|
|
128
|
+
];
|
|
10
129
|
/**
|
|
11
130
|
* 默认排除规则
|
|
12
131
|
*/
|
|
@@ -27,6 +146,30 @@ const defaultConfig = {
|
|
|
27
146
|
layouts: "layouts",
|
|
28
147
|
middleware: "middlewares"
|
|
29
148
|
},
|
|
149
|
+
scan: {
|
|
150
|
+
apis: [
|
|
151
|
+
"composables",
|
|
152
|
+
{
|
|
153
|
+
from: "@skiyee/oiyo",
|
|
154
|
+
only: [
|
|
155
|
+
"definePageMeta",
|
|
156
|
+
"defineRootContext",
|
|
157
|
+
{
|
|
158
|
+
name: "PageMeta",
|
|
159
|
+
isType: true
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
from: "@skiyee/oiyo/runtime",
|
|
165
|
+
only: DEFAULT_RUNTIME_APIS
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
components: ["components", {
|
|
169
|
+
from: "@skiyee/oiyo",
|
|
170
|
+
only: ["OiyoPage", "OiyoLayout"]
|
|
171
|
+
}]
|
|
172
|
+
},
|
|
30
173
|
exclude: DEFAULT_EXCLUDE,
|
|
31
174
|
ide: {
|
|
32
175
|
open: false,
|
|
@@ -44,10 +187,16 @@ function resolveOiyoConfig(userConfig) {
|
|
|
44
187
|
function defineOiyoConfig(config) {
|
|
45
188
|
return config;
|
|
46
189
|
}
|
|
190
|
+
function defineApiScanner(input) {
|
|
191
|
+
return input;
|
|
192
|
+
}
|
|
193
|
+
function defineComponentScanner(input) {
|
|
194
|
+
return input;
|
|
195
|
+
}
|
|
47
196
|
//#endregion
|
|
48
197
|
//#region src/pages/index.ts
|
|
49
198
|
function definePagesConfig(config) {
|
|
50
199
|
return config;
|
|
51
200
|
}
|
|
52
201
|
//#endregion
|
|
53
|
-
export { DEFAULT_EXCLUDE, defaultConfig, defineOiyoConfig, definePagesConfig, resolveOiyoConfig };
|
|
202
|
+
export { DEFAULT_EXCLUDE, defaultConfig, defineApiScanner, defineComponentScanner, defineOiyoConfig, definePagesConfig, resolveOiyoConfig };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oiyo/config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "skiyee",
|
|
7
7
|
"email": "319619193@qq.com",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"funding": "https://github.com/skiyee/sponsors",
|
|
12
|
-
"homepage": "https://oiyo.
|
|
12
|
+
"homepage": "https://oiyo.js.org",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git+https://github.com/skiyee/oiyo.git"
|