@ubean/scan 0.4.5 → 0.4.6

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.ts CHANGED
@@ -2,7 +2,7 @@ import { AppEntry, DefineMetaResult, HttpMethod, PageHead, PageMeta, RouteMeta,
2
2
  import { extractDefinePage, extractDefinePageFromCode, extractSlotAndIntercept, filePathToRoute, generateLayoutName, generateRouteName, parseMatchers, stripRouteGroups } from "@ubean/vue/vite";
3
3
  import { MatcherFunction, MatcherGuardOptions, clearMatchers, createMatcherGuard, defineMatcher, getMatcher, hasMatcher, listMatcherNames, validateParams } from "@ubean/vue";
4
4
  //#region src/scan.d.ts
5
- declare function scanProject(options: ScanOptions): Promise<ScanResult>;
5
+ export declare function scanProject(options: ScanOptions): Promise<ScanResult>;
6
6
  //#endregion
7
7
  //#region src/detect-exports.d.ts
8
8
  interface DetectExportsResult {
@@ -11,18 +11,18 @@ interface DetectExportsResult {
11
11
  hasMeta: boolean;
12
12
  fileMeta?: RouteMeta;
13
13
  }
14
- declare function detectHttpExports(filePath: string): Promise<DetectExportsResult>;
15
- declare function detectHttpExportsFromCode(code: string): DetectExportsResult;
14
+ export declare function detectHttpExports(filePath: string): Promise<DetectExportsResult>;
15
+ export declare function detectHttpExportsFromCode(code: string): DetectExportsResult;
16
16
  //#endregion
17
17
  //#region src/api-route-id.d.ts
18
18
  /**
19
19
  * 服务端专用:生成 API 路由的唯一 ID(`${method}${RouteName}`)。
20
20
  * (页面路由名生成器 `generateRouteName` 所有权在 `@ubean/vue`。)
21
21
  */
22
- declare function generateApiRouteId(method: string, routePath: string): string;
22
+ export declare function generateApiRouteId(method: string, routePath: string): string;
23
23
  //#endregion
24
24
  //#region src/define-page.d.ts
25
- declare function extractDefineMetaFromCode(code: string): DefineMetaResult | null;
26
- declare function extractDefineMeta(filePath: string): Promise<DefineMetaResult | null>;
25
+ export declare function extractDefineMetaFromCode(code: string): DefineMetaResult | null;
26
+ export declare function extractDefineMeta(filePath: string): Promise<DefineMetaResult | null>;
27
27
  //#endregion
28
- export { type AppEntry, type DefineMetaResult, type HttpMethod, type MatcherFunction, type MatcherGuardOptions, type PageHead, type PageMeta, type ScanOptions, type ScanPagesOptions, type ScanPagesResult, type ScanResult, type ScannedApiRoute, type ScannedAppEntry, type ScannedCronTask, type ScannedFile, type ScannedLayout, type ScannedLocale, type ScannedMiddleware, type ScannedPage, type ScannedPageRoute, type ScannedPlugin, type ScannedQueue, type ScannedServerEntry, clearMatchers, createMatcherGuard, defineMatcher, detectHttpExports, detectHttpExportsFromCode, extractDefineMeta, extractDefineMetaFromCode, extractDefinePage, extractDefinePageFromCode, extractSlotAndIntercept, filePathToRoute, generateApiRouteId, generateLayoutName, generateRouteName, getMatcher, hasMatcher, listMatcherNames, parseMatchers, scanProject, stripRouteGroups, validateParams };
28
+ export { type AppEntry, type DefineMetaResult, type HttpMethod, type MatcherFunction, type MatcherGuardOptions, type PageHead, type PageMeta, type ScanOptions, type ScanPagesOptions, type ScanPagesResult, type ScanResult, type ScannedApiRoute, type ScannedAppEntry, type ScannedCronTask, type ScannedFile, type ScannedLayout, type ScannedLocale, type ScannedMiddleware, type ScannedPage, type ScannedPageRoute, type ScannedPlugin, type ScannedQueue, type ScannedServerEntry, clearMatchers, createMatcherGuard, defineMatcher, extractDefinePage, extractDefinePageFromCode, extractSlotAndIntercept, filePathToRoute, generateLayoutName, generateRouteName, getMatcher, hasMatcher, listMatcherNames, parseMatchers, stripRouteGroups, validateParams };
package/dist/types.d.ts CHANGED
@@ -5,15 +5,15 @@ import { RouteMeta, RouteMeta as RouteMeta$1 } from "@ubean/shared";
5
5
  * HTTP methods supported by ubean API routes.
6
6
  * Aligned with Hono's built-in methods (excludes TRACE).
7
7
  */
8
- declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
9
- type HttpMethod = (typeof HTTP_METHODS)[number];
10
- interface ScannedFile {
8
+ export declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
9
+ export type HttpMethod = (typeof HTTP_METHODS)[number];
10
+ export interface ScannedFile {
11
11
  fullPath: string;
12
12
  relativePath: string;
13
13
  dirname: string;
14
14
  basename: string;
15
15
  }
16
- interface ScannedApiRoute extends ScannedFile {
16
+ export interface ScannedApiRoute extends ScannedFile {
17
17
  route: string;
18
18
  method?: HttpMethod | Lowercase<HttpMethod>;
19
19
  env?: 'dev' | 'prod' | 'prerender';
@@ -31,32 +31,32 @@ interface ScannedApiRoute extends ScannedFile {
31
31
  */
32
32
  matchers?: Record<string, string>;
33
33
  }
34
- interface ScannedMiddleware extends ScannedFile {
34
+ export interface ScannedMiddleware extends ScannedFile {
35
35
  order: number;
36
36
  global: boolean;
37
37
  }
38
- interface ScannedPlugin extends ScannedFile {
38
+ export interface ScannedPlugin extends ScannedFile {
39
39
  order: number;
40
40
  }
41
- interface ScannedCronTask extends ScannedFile {
41
+ export interface ScannedCronTask extends ScannedFile {
42
42
  name: string;
43
43
  }
44
- interface ScannedQueue extends ScannedFile {
44
+ export interface ScannedQueue extends ScannedFile {
45
45
  name: string;
46
46
  }
47
- interface ScannedLocale extends ScannedFile {
47
+ export interface ScannedLocale extends ScannedFile {
48
48
  code: string;
49
49
  namespace?: string;
50
50
  isDefault?: boolean;
51
51
  name?: string;
52
52
  dir?: 'ltr' | 'rtl';
53
53
  }
54
- interface AppEntry {
54
+ export interface AppEntry {
55
55
  exists: boolean;
56
56
  fullPath?: string;
57
57
  relativePath?: string;
58
58
  }
59
- interface ScannedAppEntry {
59
+ export interface ScannedAppEntry {
60
60
  shared: AppEntry;
61
61
  server: AppEntry;
62
62
  client: AppEntry;
@@ -75,12 +75,12 @@ interface ScannedAppEntry {
75
75
  */
76
76
  root?: AppEntry;
77
77
  }
78
- interface ScannedServerEntry {
78
+ export interface ScannedServerEntry {
79
79
  shared: AppEntry;
80
80
  dev: AppEntry;
81
81
  prod: AppEntry;
82
82
  }
83
- interface ScanOptions {
83
+ export interface ScanOptions {
84
84
  cwd: string;
85
85
  srcDir: string;
86
86
  dirs?: {
@@ -105,7 +105,7 @@ interface ScanOptions {
105
105
  */
106
106
  head?: boolean;
107
107
  }
108
- interface ScanResult {
108
+ export interface ScanResult {
109
109
  apiRoutes: ScannedApiRoute[];
110
110
  middlewares: ScannedMiddleware[];
111
111
  pages: import('@ubean/vue').ScannedPage[];
@@ -139,12 +139,12 @@ interface ScanResult {
139
139
  */
140
140
  errorPage?: import('@ubean/vue').ScannedPage;
141
141
  }
142
- declare const GLOB_SCAN_PATTERN = "**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}";
143
- declare const GLOB_VUE_PATTERN = "**/*.{vue,ts,md,mdx}";
144
- declare const GLOB_LAYOUT_PATTERN = "**/*.{vue,ts}";
145
- interface DefineMetaResult {
142
+ export declare const GLOB_SCAN_PATTERN = "**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}";
143
+ export declare const GLOB_VUE_PATTERN = "**/*.{vue,ts,md,mdx}";
144
+ export declare const GLOB_LAYOUT_PATTERN = "**/*.{vue,ts}";
145
+ export interface DefineMetaResult {
146
146
  meta?: Record<string, unknown>;
147
147
  requiresAuth?: boolean;
148
148
  }
149
149
  //#endregion
150
- export { AppEntry, DefineMetaResult, GLOB_LAYOUT_PATTERN, GLOB_SCAN_PATTERN, GLOB_VUE_PATTERN, HTTP_METHODS, HttpMethod, type PageHead, type PageMeta, type RouteMeta, ScanOptions, type ScanPagesOptions, type ScanPagesResult, ScanResult, ScannedApiRoute, ScannedAppEntry, ScannedCronTask, ScannedFile, type ScannedLayout, ScannedLocale, ScannedMiddleware, type ScannedPage, type ScannedPageRoute, ScannedPlugin, ScannedQueue, ScannedServerEntry };
150
+ export type { PageHead, PageMeta, RouteMeta, ScanPagesOptions, ScanPagesResult, ScannedLayout, ScannedPage, ScannedPageRoute };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubean/scan",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Project scanner & route metadata for ubean — server-side directory scanning (API routes, middleware, plugins, crons, queues, locales, entries) plus page scanning delegated to @ubean/vue",
5
5
  "files": [
6
6
  "dist"
@@ -24,16 +24,16 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@ubean/shared": "0.4.5",
28
- "@ubean/vue": "0.4.5",
27
+ "@ubean/shared": "0.4.6",
28
+ "@ubean/vue": "0.4.6",
29
29
  "pathe": "^2.0.3",
30
30
  "tinyglobby": "^0.2.17"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^26.5.0",
34
- "@ubean/markdown": "0.4.5",
35
- "typescript": "7.0.2",
36
- "vite-plus": "0.3.0",
34
+ "@ubean/markdown": "0.4.6",
35
+ "typescript": "npm:typescript-native-bridge@latest",
36
+ "vite-plus": "0.3.1",
37
37
  "vue": "^3.5.42",
38
38
  "vue-router": "^5.3.1"
39
39
  },