@modern-js/types
Advanced tools
Comparing version 0.0.0-next-20221021092811 to 0.0.0-next-20221026060249
# @modern-js/types | ||
## 0.0.0-next-20221021092811 | ||
## 0.0.0-next-20221026060249 | ||
### Patch Changes | ||
- 3ee9d6d5: feat: remove node internal package like fs or path which import by ssr runtime | ||
feat: 删除在 ssr runtime 中引用的 node 内部包 | ||
- cc971eab: refactor: move server plugin load logic in `@modern-js/core` | ||
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑 | ||
- 8b8e1bb5: feat: support nested routes | ||
feat: 支持嵌套路由 | ||
- 3bbea92b: feat: support Hook、Middleware new API | ||
@@ -8,0 +14,0 @@ feat: 支持 Hook、Middleware 的新 API |
@@ -0,1 +1,3 @@ | ||
import type { Merge } from 'type-fest'; | ||
import { InternalPlugins } from '../common'; | ||
import { ServerRoute } from '../server'; | ||
@@ -9,2 +11,3 @@ | ||
entry: string; | ||
nestedRoutesEntry?: string; | ||
isAutoMount?: boolean; | ||
@@ -21,3 +24,3 @@ customBootstrap?: string | false; | ||
*/ | ||
export interface Route { | ||
export type RouteLegacy = { | ||
path: string; | ||
@@ -27,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[]; | ||
} | ||
>; | ||
/** | ||
@@ -50,2 +96,3 @@ * custom html partials. | ||
serverConfigFile: string; | ||
serverInternalPlugins: InternalPlugins; | ||
ip?: string; | ||
@@ -59,7 +106,3 @@ port?: number; | ||
internalDirectory: string; | ||
plugins: { | ||
cli?: any; | ||
server?: any; | ||
serverPkg?: any; | ||
}[]; | ||
plugins: any[]; | ||
entrypoints: Entrypoint[]; | ||
@@ -73,1 +116,3 @@ checkedEntries: string[]; | ||
} | ||
export type { Merge } from 'type-fest'; |
export * from './server'; | ||
export * from './cli'; | ||
export * from './common'; |
@@ -14,3 +14,3 @@ { | ||
], | ||
"version": "0.0.0-next-20221021092811", | ||
"version": "0.0.0-next-20221026060249", | ||
"types": "./index.d.ts", | ||
@@ -35,8 +35,9 @@ "exports": { | ||
"devDependencies": { | ||
"@scripts/build": "0.0.0-next-20221021092811", | ||
"@scripts/jest-config": "0.0.0-next-20221021092811", | ||
"@scripts/build": "0.0.0-next-20221026060249", | ||
"@scripts/jest-config": "0.0.0-next-20221026060249", | ||
"@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, |
@@ -70,3 +70,3 @@ import { IncomingMessage, ServerResponse, IncomingHttpHeaders } from 'http'; | ||
redirection: { url?: string; status?: number }; | ||
distDir: string; | ||
loadableStats: Record<string, any>; | ||
template: string; | ||
@@ -91,3 +91,2 @@ entryName: string; | ||
}; | ||
loadableManifest?: string; | ||
cacheConfig?: any; | ||
@@ -94,0 +93,0 @@ }; |
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
26237
14
442
7