@oiyo/core 0.3.5 → 0.3.7

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.d.cts CHANGED
@@ -1,12 +1,10 @@
1
1
  /**
2
- * @oiyo/core v0.3.5
2
+ * @oiyo/core v0.3.7
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
6
6
  */
7
- import * as _$magic_string0 from "magic-string";
8
- import { ComponentScanTarget, GlobalStyle, OiyoConfig, PagesConfig } from "@oiyo/config";
9
- import * as _$vue from "vue";
7
+ import { ComponentScanTarget, GlobalStyle, OiyoConfig, PagesConfig, TabBarItem } from "@oiyo/config";
10
8
  import { Plugin } from "vite";
11
9
 
12
10
  //#region src/logger.d.ts
@@ -94,6 +92,8 @@ declare class OiyoModApi {
94
92
  private readonly oiyoState;
95
93
  private sources;
96
94
  apis: Map<string, ApiFile>;
95
+ marcoNames: string[];
96
+ vmNames: string[];
97
97
  constructor(config: OiyoConfig, deps: {
98
98
  logger: Logger;
99
99
  oiyoState: OiyoState;
@@ -102,6 +102,7 @@ declare class OiyoModApi {
102
102
  private get declarationDir();
103
103
  private get declarationFile();
104
104
  shouldSkipImport(name: string): boolean;
105
+ forwardImport(api: ApiFile): ApiFile;
105
106
  private recordApiSource;
106
107
  private toApiSource;
107
108
  private saveApi;
@@ -116,8 +117,8 @@ declare class OiyoModApi {
116
117
  writeDeclaration(): void;
117
118
  applyApis(source: string, file: string): {
118
119
  code: string;
119
- map: _$magic_string0.SourceMap;
120
- };
120
+ map: import("magic-string").SourceMap;
121
+ } | null;
121
122
  }
122
123
  //#endregion
123
124
  //#region src/module/component/types.d.ts
@@ -142,6 +143,7 @@ declare class OiyoModComponent {
142
143
  private readonly oiyoApi;
143
144
  private sources;
144
145
  components: Map<string, ComponentFile>;
146
+ renderTagNames: string[];
145
147
  constructor(config: OiyoConfig, deps: {
146
148
  logger: Logger;
147
149
  oiyoState: OiyoState;
@@ -168,8 +170,8 @@ declare class OiyoModComponent {
168
170
  withApis: boolean;
169
171
  }): {
170
172
  code: string;
171
- map: _$magic_string0.SourceMap;
172
- };
173
+ map: import("magic-string").SourceMap;
174
+ } | null;
173
175
  }
174
176
  //#endregion
175
177
  //#region src/module/layout/types.d.ts
@@ -204,15 +206,17 @@ declare class OiyoModLayout {
204
206
  }
205
207
  //#endregion
206
208
  //#region src/module/layout/placeholder.d.ts
207
- declare const OiyoLayout: _$vue.DefineComponent<{}, () => _$vue.VNode<_$vue.RendererNode, _$vue.RendererElement, {
209
+ declare const OiyoLayout: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
208
210
  [key: string]: any;
209
- }>[] | undefined, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{}>>, {}, {}>;
211
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
210
212
  //#endregion
211
213
  //#region src/module/shared/extractor/import.d.ts
212
214
  interface ImportInfo {
213
215
  importPath: string;
214
216
  exportName: string;
215
217
  importName: string;
218
+ offsetStart?: number;
219
+ offsetEnd?: number;
216
220
  }
217
221
  //#endregion
218
222
  //#region src/module/root/instance.d.ts
@@ -234,7 +238,7 @@ declare class OiyoModRoot {
234
238
  parseRoot(source: string): boolean;
235
239
  transformRoot(source: string): {
236
240
  code: string;
237
- map: _$magic_string0.SourceMap;
241
+ map: import("magic-string").SourceMap;
238
242
  };
239
243
  private resetRootTemplate;
240
244
  shouldRefreshView(code: string): boolean;
@@ -243,30 +247,40 @@ declare class OiyoModRoot {
243
247
  }
244
248
  //#endregion
245
249
  //#region src/module/root/macro.d.ts
246
- type RootContextFactory<T extends object> = () => T;
247
- declare const defineRootContext: <T extends object>(factory: RootContextFactory<T>) => T;
250
+ type RootContextFactory<T> = () => T;
251
+ declare const defineRootContext: <T>(factory: RootContextFactory<T>) => T;
252
+ declare const useRootContext: <T>() => T;
248
253
  //#endregion
249
254
  //#region src/module/root/virtual-module.d.ts
250
255
  declare const VIRTUAL_ROOT_CONTEXT_ID = "virtual:oiyo-root-context";
251
256
  declare const RESOLVED_VIRTUAL_ROOT_CONTEXT_ID = "\0virtual:oiyo-root-context";
252
257
  //#endregion
258
+ //#region src/module/shared/type.d.ts
259
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
260
+ type RemoveIndexSignature<T> = { [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: T[K] };
261
+ type StrictOmit<T, K extends keyof RemoveIndexSignature<T>> = Prettify<Omit<RemoveIndexSignature<T>, K>>;
262
+ //#endregion
253
263
  //#region src/module/route/types.d.ts
254
- type PageMetaValue = string | number | boolean | null | PageMetaObject | PageMetaValue[];
255
- interface PageMetaObject {
256
- [key: string]: PageMetaValue | undefined;
264
+ interface Route {
265
+ pagePath: string;
266
+ filePath: string;
267
+ pageBelong: string;
268
+ pageMeta: ResolvedPageMeta | null;
269
+ }
270
+ type MetaValue = string | number | boolean | object | null | MetaObject | MetaValue[];
271
+ interface MetaObject {
272
+ [key: string]: MetaValue | undefined;
273
+ }
274
+ interface Tab extends StrictOmit<TabBarItem, 'pagePath'> {
275
+ index: number;
257
276
  }
258
277
  interface BasePageMeta {
259
278
  type?: 'page' | 'home';
260
279
  layout?: string | false;
261
280
  style?: GlobalStyle;
281
+ tab?: Tab;
262
282
  }
263
- interface ResolvedPageMeta extends BasePageMeta, PageMetaObject {}
264
- interface PageFile {
265
- pagePath: string;
266
- filePath: string;
267
- pageMeta: ResolvedPageMeta;
268
- pageBelong: string;
269
- }
283
+ interface ResolvedPageMeta extends BasePageMeta, MetaObject {}
270
284
  //#endregion
271
285
  //#region src/module/route/instance.d.ts
272
286
  declare class OiyoModRoute {
@@ -275,7 +289,7 @@ declare class OiyoModRoute {
275
289
  private readonly oiyoState;
276
290
  private readonly oiyoRoot?;
277
291
  private readonly oiyoLayout?;
278
- pages: Map<string, PageFile>;
292
+ routes: Map<string, Route>;
279
293
  private pagesConfig;
280
294
  private pagesConfigWatcher?;
281
295
  constructor(config: OiyoConfig, deps: {
@@ -289,18 +303,18 @@ declare class OiyoModRoute {
289
303
  oiyoLayout: OiyoModLayout;
290
304
  });
291
305
  private get srcDir();
292
- private get mainPageDir();
293
- private get subPageDirs();
306
+ private get mainPackageDir();
307
+ private get subPackageDirs();
294
308
  private get pagesJsonFile();
295
309
  private get declarationDir();
296
310
  private get declarationFile();
297
- private toPage;
298
- private savePage;
311
+ private toRoute;
312
+ private saveRoute;
299
313
  private loadPagesConfig;
300
- scanPages(): Promise<Map<string, PageFile>>;
301
- isPage(file: string): boolean;
302
- enterPage(file: string): boolean;
303
- exitPage(file: string): boolean;
314
+ scanRoutes(): Promise<Map<string, Route>>;
315
+ isRoute(file: string): boolean;
316
+ enterRoute(file: string): boolean;
317
+ exitRoute(file: string): boolean;
304
318
  private resolvePagesJson;
305
319
  writePagesJson(userPageJson?: PagesConfig): boolean;
306
320
  generateDeclaration(userPageJson?: PagesConfig): string;
@@ -309,7 +323,7 @@ declare class OiyoModRoute {
309
323
  unwatchPagesConfig(): Promise<void>;
310
324
  transformPage(source: string, file: string): Promise<{
311
325
  code: string;
312
- map: _$magic_string0.SourceMap;
326
+ map: import("magic-string").SourceMap;
313
327
  }>;
314
328
  }
315
329
  //#endregion
@@ -320,7 +334,7 @@ interface PageMeta extends BasePageMeta {
320
334
  declare const definePageMeta: (meta: PageMeta) => void;
321
335
  //#endregion
322
336
  //#region src/module/route/placeholder.d.ts
323
- declare const OiyoPage: _$vue.DefineComponent<{}, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{}>>, {}, {}>;
337
+ declare const OiyoPage: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
324
338
  //#endregion
325
339
  //#region src/plugin/context.d.ts
326
340
  interface OiyoContext {
@@ -342,4 +356,4 @@ declare module 'vite' {
342
356
  }
343
357
  declare function OiyoCorePlugin(options?: OiyoConfig): Plugin[];
344
358
  //#endregion
345
- export { LogErrorOptions, LogLevel, LogLevels, LogOptions, LogType, Logger, LoggerOptions, OiyoCorePlugin, OiyoLayout, OiyoMetadata, OiyoModApi, OiyoModComponent, OiyoModLayout, OiyoModRoot, OiyoModRoute, OiyoPage, OiyoState, type PageMeta, RESOLVED_VIRTUAL_ROOT_CONTEXT_ID, VIRTUAL_ROOT_CONTEXT_ID, createLogger, definePageMeta, defineRootContext };
359
+ export { LogErrorOptions, LogLevel, LogLevels, LogOptions, LogType, Logger, LoggerOptions, OiyoCorePlugin, OiyoLayout, OiyoMetadata, OiyoModApi, OiyoModComponent, OiyoModLayout, OiyoModRoot, OiyoModRoute, OiyoPage, OiyoState, type PageMeta, RESOLVED_VIRTUAL_ROOT_CONTEXT_ID, VIRTUAL_ROOT_CONTEXT_ID, createLogger, definePageMeta, defineRootContext, useRootContext };
package/dist/index.d.mts CHANGED
@@ -1,12 +1,10 @@
1
1
  /**
2
- * @oiyo/core v0.3.5
2
+ * @oiyo/core v0.3.7
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
6
6
  */
7
- import * as _$magic_string0 from "magic-string";
8
- import { ComponentScanTarget, GlobalStyle, OiyoConfig, PagesConfig } from "@oiyo/config";
9
- import * as _$vue from "vue";
7
+ import { ComponentScanTarget, GlobalStyle, OiyoConfig, PagesConfig, TabBarItem } from "@oiyo/config";
10
8
  import { Plugin } from "vite";
11
9
 
12
10
  //#region src/logger.d.ts
@@ -94,6 +92,8 @@ declare class OiyoModApi {
94
92
  private readonly oiyoState;
95
93
  private sources;
96
94
  apis: Map<string, ApiFile>;
95
+ marcoNames: string[];
96
+ vmNames: string[];
97
97
  constructor(config: OiyoConfig, deps: {
98
98
  logger: Logger;
99
99
  oiyoState: OiyoState;
@@ -102,6 +102,7 @@ declare class OiyoModApi {
102
102
  private get declarationDir();
103
103
  private get declarationFile();
104
104
  shouldSkipImport(name: string): boolean;
105
+ forwardImport(api: ApiFile): ApiFile;
105
106
  private recordApiSource;
106
107
  private toApiSource;
107
108
  private saveApi;
@@ -116,8 +117,8 @@ declare class OiyoModApi {
116
117
  writeDeclaration(): void;
117
118
  applyApis(source: string, file: string): {
118
119
  code: string;
119
- map: _$magic_string0.SourceMap;
120
- };
120
+ map: import("magic-string").SourceMap;
121
+ } | null;
121
122
  }
122
123
  //#endregion
123
124
  //#region src/module/component/types.d.ts
@@ -142,6 +143,7 @@ declare class OiyoModComponent {
142
143
  private readonly oiyoApi;
143
144
  private sources;
144
145
  components: Map<string, ComponentFile>;
146
+ renderTagNames: string[];
145
147
  constructor(config: OiyoConfig, deps: {
146
148
  logger: Logger;
147
149
  oiyoState: OiyoState;
@@ -168,8 +170,8 @@ declare class OiyoModComponent {
168
170
  withApis: boolean;
169
171
  }): {
170
172
  code: string;
171
- map: _$magic_string0.SourceMap;
172
- };
173
+ map: import("magic-string").SourceMap;
174
+ } | null;
173
175
  }
174
176
  //#endregion
175
177
  //#region src/module/layout/types.d.ts
@@ -204,15 +206,17 @@ declare class OiyoModLayout {
204
206
  }
205
207
  //#endregion
206
208
  //#region src/module/layout/placeholder.d.ts
207
- declare const OiyoLayout: _$vue.DefineComponent<{}, () => _$vue.VNode<_$vue.RendererNode, _$vue.RendererElement, {
209
+ declare const OiyoLayout: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
208
210
  [key: string]: any;
209
- }>[] | undefined, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{}>>, {}, {}>;
211
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
210
212
  //#endregion
211
213
  //#region src/module/shared/extractor/import.d.ts
212
214
  interface ImportInfo {
213
215
  importPath: string;
214
216
  exportName: string;
215
217
  importName: string;
218
+ offsetStart?: number;
219
+ offsetEnd?: number;
216
220
  }
217
221
  //#endregion
218
222
  //#region src/module/root/instance.d.ts
@@ -234,7 +238,7 @@ declare class OiyoModRoot {
234
238
  parseRoot(source: string): boolean;
235
239
  transformRoot(source: string): {
236
240
  code: string;
237
- map: _$magic_string0.SourceMap;
241
+ map: import("magic-string").SourceMap;
238
242
  };
239
243
  private resetRootTemplate;
240
244
  shouldRefreshView(code: string): boolean;
@@ -243,30 +247,40 @@ declare class OiyoModRoot {
243
247
  }
244
248
  //#endregion
245
249
  //#region src/module/root/macro.d.ts
246
- type RootContextFactory<T extends object> = () => T;
247
- declare const defineRootContext: <T extends object>(factory: RootContextFactory<T>) => T;
250
+ type RootContextFactory<T> = () => T;
251
+ declare const defineRootContext: <T>(factory: RootContextFactory<T>) => T;
252
+ declare const useRootContext: <T>() => T;
248
253
  //#endregion
249
254
  //#region src/module/root/virtual-module.d.ts
250
255
  declare const VIRTUAL_ROOT_CONTEXT_ID = "virtual:oiyo-root-context";
251
256
  declare const RESOLVED_VIRTUAL_ROOT_CONTEXT_ID = "\0virtual:oiyo-root-context";
252
257
  //#endregion
258
+ //#region src/module/shared/type.d.ts
259
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
260
+ type RemoveIndexSignature<T> = { [K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: T[K] };
261
+ type StrictOmit<T, K extends keyof RemoveIndexSignature<T>> = Prettify<Omit<RemoveIndexSignature<T>, K>>;
262
+ //#endregion
253
263
  //#region src/module/route/types.d.ts
254
- type PageMetaValue = string | number | boolean | null | PageMetaObject | PageMetaValue[];
255
- interface PageMetaObject {
256
- [key: string]: PageMetaValue | undefined;
264
+ interface Route {
265
+ pagePath: string;
266
+ filePath: string;
267
+ pageBelong: string;
268
+ pageMeta: ResolvedPageMeta | null;
269
+ }
270
+ type MetaValue = string | number | boolean | object | null | MetaObject | MetaValue[];
271
+ interface MetaObject {
272
+ [key: string]: MetaValue | undefined;
273
+ }
274
+ interface Tab extends StrictOmit<TabBarItem, 'pagePath'> {
275
+ index: number;
257
276
  }
258
277
  interface BasePageMeta {
259
278
  type?: 'page' | 'home';
260
279
  layout?: string | false;
261
280
  style?: GlobalStyle;
281
+ tab?: Tab;
262
282
  }
263
- interface ResolvedPageMeta extends BasePageMeta, PageMetaObject {}
264
- interface PageFile {
265
- pagePath: string;
266
- filePath: string;
267
- pageMeta: ResolvedPageMeta;
268
- pageBelong: string;
269
- }
283
+ interface ResolvedPageMeta extends BasePageMeta, MetaObject {}
270
284
  //#endregion
271
285
  //#region src/module/route/instance.d.ts
272
286
  declare class OiyoModRoute {
@@ -275,7 +289,7 @@ declare class OiyoModRoute {
275
289
  private readonly oiyoState;
276
290
  private readonly oiyoRoot?;
277
291
  private readonly oiyoLayout?;
278
- pages: Map<string, PageFile>;
292
+ routes: Map<string, Route>;
279
293
  private pagesConfig;
280
294
  private pagesConfigWatcher?;
281
295
  constructor(config: OiyoConfig, deps: {
@@ -289,18 +303,18 @@ declare class OiyoModRoute {
289
303
  oiyoLayout: OiyoModLayout;
290
304
  });
291
305
  private get srcDir();
292
- private get mainPageDir();
293
- private get subPageDirs();
306
+ private get mainPackageDir();
307
+ private get subPackageDirs();
294
308
  private get pagesJsonFile();
295
309
  private get declarationDir();
296
310
  private get declarationFile();
297
- private toPage;
298
- private savePage;
311
+ private toRoute;
312
+ private saveRoute;
299
313
  private loadPagesConfig;
300
- scanPages(): Promise<Map<string, PageFile>>;
301
- isPage(file: string): boolean;
302
- enterPage(file: string): boolean;
303
- exitPage(file: string): boolean;
314
+ scanRoutes(): Promise<Map<string, Route>>;
315
+ isRoute(file: string): boolean;
316
+ enterRoute(file: string): boolean;
317
+ exitRoute(file: string): boolean;
304
318
  private resolvePagesJson;
305
319
  writePagesJson(userPageJson?: PagesConfig): boolean;
306
320
  generateDeclaration(userPageJson?: PagesConfig): string;
@@ -309,7 +323,7 @@ declare class OiyoModRoute {
309
323
  unwatchPagesConfig(): Promise<void>;
310
324
  transformPage(source: string, file: string): Promise<{
311
325
  code: string;
312
- map: _$magic_string0.SourceMap;
326
+ map: import("magic-string").SourceMap;
313
327
  }>;
314
328
  }
315
329
  //#endregion
@@ -320,7 +334,7 @@ interface PageMeta extends BasePageMeta {
320
334
  declare const definePageMeta: (meta: PageMeta) => void;
321
335
  //#endregion
322
336
  //#region src/module/route/placeholder.d.ts
323
- declare const OiyoPage: _$vue.DefineComponent<{}, {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<_$vue.ExtractPropTypes<{}>>, {}, {}>;
337
+ declare const OiyoPage: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
324
338
  //#endregion
325
339
  //#region src/plugin/context.d.ts
326
340
  interface OiyoContext {
@@ -342,4 +356,4 @@ declare module 'vite' {
342
356
  }
343
357
  declare function OiyoCorePlugin(options?: OiyoConfig): Plugin[];
344
358
  //#endregion
345
- export { LogErrorOptions, LogLevel, LogLevels, LogOptions, LogType, Logger, LoggerOptions, OiyoCorePlugin, OiyoLayout, OiyoMetadata, OiyoModApi, OiyoModComponent, OiyoModLayout, OiyoModRoot, OiyoModRoute, OiyoPage, OiyoState, type PageMeta, RESOLVED_VIRTUAL_ROOT_CONTEXT_ID, VIRTUAL_ROOT_CONTEXT_ID, createLogger, definePageMeta, defineRootContext };
359
+ export { LogErrorOptions, LogLevel, LogLevels, LogOptions, LogType, Logger, LoggerOptions, OiyoCorePlugin, OiyoLayout, OiyoMetadata, OiyoModApi, OiyoModComponent, OiyoModLayout, OiyoModRoot, OiyoModRoute, OiyoPage, OiyoState, type PageMeta, RESOLVED_VIRTUAL_ROOT_CONTEXT_ID, VIRTUAL_ROOT_CONTEXT_ID, createLogger, definePageMeta, defineRootContext, useRootContext };