@modern-js/types
Advanced tools
Comparing version 0.0.0-canary-20221024062649 to 0.0.0-canary-20221024105341
# @modern-js/types | ||
## 0.0.0-canary-20221024062649 | ||
## 0.0.0-canary-20221024105341 | ||
### Patch Changes | ||
- cc971eabf: refactor: move server plugin load logic in `@modern-js/core` | ||
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑 | ||
- 8b8e1bb57: feat: support nested routes | ||
feat: 支持嵌套路由 | ||
- 3bbea92b2: feat: support Hook、Middleware new API | ||
@@ -8,0 +12,0 @@ feat: 支持 Hook、Middleware 的新 API |
@@ -0,1 +1,2 @@ | ||
import type { Merge } from 'type-fest'; | ||
import { InternalPlugins } from '../common'; | ||
@@ -10,2 +11,3 @@ import { ServerRoute } from '../server'; | ||
entry: string; | ||
nestedRoutesEntry?: string; | ||
isAutoMount?: boolean; | ||
@@ -22,3 +24,3 @@ customBootstrap?: string | false; | ||
*/ | ||
export interface Route { | ||
export type RouteLegacy = { | ||
path: string; | ||
@@ -28,6 +30,49 @@ exact: boolean; | ||
_component: string; | ||
routes?: Route[]; | ||
parent?: Route; | ||
} | ||
routes?: RouteLegacy[]; | ||
parent?: RouteLegacy; | ||
}; | ||
export type Route = Partial<{ | ||
caseSensitive: boolean; | ||
path: string; | ||
id: string; | ||
loader: any; | ||
action: any; | ||
hasErrorBoundary: boolean; | ||
shouldRevalidate: any; | ||
handle: any; | ||
index: boolean; | ||
children: Route[] | undefined; | ||
element: React.ReactNode | null; | ||
errorElement: React.ReactNode | null; | ||
}> & { | ||
type: string; | ||
}; | ||
export type NestedRoute = Merge< | ||
Route, | ||
{ | ||
type: 'nested'; | ||
parentId?: string; | ||
children?: NestedRoute[]; | ||
childIds?: string[]; | ||
filename?: string; | ||
_component?: string; | ||
component?: string; | ||
loading?: string; | ||
error?: string; | ||
} | ||
>; | ||
export type PageRoute = Merge< | ||
Route, | ||
{ | ||
type: 'page'; | ||
parent?: PageRoute; | ||
_component: string; | ||
component: string; | ||
children?: PageRoute[]; | ||
} | ||
>; | ||
/** | ||
@@ -69,1 +114,3 @@ * custom html partials. | ||
} | ||
export type { Merge } from 'type-fest'; |
@@ -14,3 +14,3 @@ { | ||
], | ||
"version": "0.0.0-canary-20221024062649", | ||
"version": "0.0.0-canary-20221024105341", | ||
"types": "./index.d.ts", | ||
@@ -35,8 +35,9 @@ "exports": { | ||
"devDependencies": { | ||
"@scripts/build": "0.0.0-canary-20221024062649", | ||
"@scripts/jest-config": "0.0.0-canary-20221024062649", | ||
"@scripts/build": "0.0.0-canary-20221024105341", | ||
"@scripts/jest-config": "0.0.0-canary-20221024105341", | ||
"@types/jest": "^27", | ||
"@types/node": "^14", | ||
"http-proxy-middleware": "^2.0.4", | ||
"jest": "^27" | ||
"jest": "^27", | ||
"type-fest": "2.15.0" | ||
}, | ||
@@ -43,0 +44,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26109
443
7