1
1
import { dirname } from 'node:path' ;
2
2
import { resolveMenu } from '../markdown/menu' ;
3
3
import type {
4
- BuildEntry ,
5
- BuildLayout ,
6
- BuildRoute ,
7
- BuildServerPlugin ,
4
+ BuiltEntry ,
5
+ BuiltLayout ,
6
+ BuiltRoute ,
7
+ BuiltServerPlugin ,
8
8
NormalizedPluginOptions ,
9
9
RouteSourceFile ,
10
10
} from '../types' ;
@@ -93,7 +93,7 @@ export function resolveLayout(opts: NormalizedPluginOptions, layoutSourceFile: R
93
93
layoutName = '' ;
94
94
}
95
95
96
- const layout : BuildLayout = {
96
+ const layout : BuiltLayout = {
97
97
id : createFileId ( opts . routesDir , filePath ) ,
98
98
filePath,
99
99
dirPath,
@@ -110,11 +110,11 @@ const LAYOUT_TOP_SUFFIX = '!';
110
110
111
111
export function resolveRoute (
112
112
opts : NormalizedPluginOptions ,
113
- appLayouts : BuildLayout [ ] ,
113
+ appLayouts : BuiltLayout [ ] ,
114
114
sourceFile : RouteSourceFile
115
115
) {
116
116
const filePath = sourceFile . filePath ;
117
- const layouts : BuildLayout [ ] = [ ] ;
117
+ const layouts : BuiltLayout [ ] = [ ] ;
118
118
const routesDir = opts . routesDir ;
119
119
const { layoutName, layoutStop } = parseRouteIndexName ( sourceFile . extlessName ) ;
120
120
let pathname = getPathnameFromDirPath ( opts , sourceFile . dirPath ) ;
@@ -129,7 +129,7 @@ export function resolveRoute(
129
129
const hasNamedLayout = layoutName !== '' ;
130
130
131
131
for ( let i = 0 ; i < 20 ; i ++ ) {
132
- let layout : BuildLayout | undefined = undefined ;
132
+ let layout : BuiltLayout | undefined = undefined ;
133
133
134
134
if ( hasNamedLayout && ! hasFoundNamedLayout ) {
135
135
layout = appLayouts . find ( ( l ) => l . dirPath === currentDir && l . layoutName === layoutName ) ;
@@ -155,7 +155,7 @@ export function resolveRoute(
155
155
}
156
156
}
157
157
158
- const buildRoute : BuildRoute = {
158
+ const buildRoute : BuiltRoute = {
159
159
id : createFileId ( opts . routesDir , filePath , 'Route' ) ,
160
160
filePath,
161
161
pathname,
@@ -169,7 +169,7 @@ export function resolveRoute(
169
169
170
170
export function resolveServerPlugin ( opts : NormalizedPluginOptions , sourceFile : RouteSourceFile ) {
171
171
const filePath = sourceFile . filePath ;
172
- const buildRoute : BuildServerPlugin = {
172
+ const buildRoute : BuiltServerPlugin = {
173
173
id : createFileId ( opts . serverPluginsDir , filePath , 'Plugin' ) ,
174
174
filePath,
175
175
ext : sourceFile . ext ,
@@ -181,7 +181,7 @@ function resolveEntry(opts: NormalizedPluginOptions, sourceFile: RouteSourceFile
181
181
const pathname = getPathnameFromDirPath ( opts , sourceFile . dirPath ) ;
182
182
const chunkFileName = pathname . slice ( opts . basePathname . length ) ;
183
183
184
- const buildEntry : BuildEntry = {
184
+ const buildEntry : BuiltEntry = {
185
185
id : createFileId ( opts . routesDir , sourceFile . filePath , 'Route' ) ,
186
186
filePath : sourceFile . filePath ,
187
187
chunkFileName,
@@ -196,7 +196,7 @@ function resolveServiceWorkerEntry(opts: NormalizedPluginOptions, sourceFile: Ro
196
196
const pathname = dirPathname + sourceFile . extlessName + '.js' ;
197
197
const chunkFileName = pathname . slice ( opts . basePathname . length ) ;
198
198
199
- const buildEntry : BuildEntry = {
199
+ const buildEntry : BuiltEntry = {
200
200
id : createFileId ( opts . routesDir , sourceFile . filePath , 'ServiceWorker' ) ,
201
201
filePath : sourceFile . filePath ,
202
202
chunkFileName,
0 commit comments