@vercel/next
Advanced tools
Comparing version 2.6.9-canary.0 to 2.6.9-canary.1
@@ -163,3 +163,3 @@ "use strict"; | ||
if (!pagesDir && | ||
fileKeys.some(file => file.startsWith(path_1.default.join(entryDirectory, 'src/pages')))) { | ||
fileKeys.some((file) => file.startsWith(path_1.default.join(entryDirectory, 'src/pages')))) { | ||
pagesDir = 'src/pages'; | ||
@@ -207,3 +207,3 @@ } | ||
} | ||
routes.push(...(await getDynamicRoutes(entryPath, entryDirectory, dynamicPages, true).then(arr => arr.map((route) => { | ||
routes.push(...(await getDynamicRoutes(entryPath, entryDirectory, dynamicPages, true).then((arr) => arr.map((route) => { | ||
// convert to make entire RegExp match as one group | ||
@@ -229,3 +229,3 @@ route.src = route.src | ||
// Only add the route if a page is not already using it | ||
if (!routes.some(r => r.src === route.src)) { | ||
if (!routes.some((r) => r.src === route.src)) { | ||
routes.push(route); | ||
@@ -259,15 +259,16 @@ } | ||
const routesManifest = require(pathRoutesManifest); | ||
// massage temporary array based routeKeys from v1/v2 of routes | ||
// manifest into new object based | ||
for (const route of [ | ||
...(routesManifest.dataRoutes || []), | ||
...(routesManifest.dynamicRoutes || []), | ||
]) { | ||
// remove temporary array based routeKeys from v1/v2 of routes | ||
// manifest since it can result in invalid routes | ||
for (const route of routesManifest.dataRoutes || []) { | ||
if (Array.isArray(route.routeKeys)) { | ||
route.routeKeys = route.routeKeys.reduce((prev, cur) => { | ||
prev[cur] = cur; | ||
return prev; | ||
}, {}); | ||
delete route.routeKeys; | ||
delete route.namedDataRouteRegex; | ||
} | ||
} | ||
for (const route of routesManifest.dynamicRoutes || []) { | ||
if (Array.isArray(route.routeKeys)) { | ||
delete route.routeKeys; | ||
delete route.namedRegex; | ||
} | ||
} | ||
return routesManifest; | ||
@@ -302,3 +303,3 @@ } | ||
? `?${Object.keys(routeKeys) | ||
.map(key => `${routeKeys[key]}=$${key}`) | ||
.map((key) => `${routeKeys[key]}=$${key}`) | ||
.join('&')}` | ||
@@ -347,3 +348,3 @@ : ''}`, | ||
} | ||
const pageMatchers = getSortedRoutes(dynamicPages).map(pageName => ({ | ||
const pageMatchers = getSortedRoutes(dynamicPages).map((pageName) => ({ | ||
pageName, | ||
@@ -353,3 +354,3 @@ matcher: getRouteRegex && getRouteRegex(pageName).re, | ||
const routes = []; | ||
pageMatchers.forEach(pageMatcher => { | ||
pageMatchers.forEach((pageMatcher) => { | ||
// in `vercel dev` we don't need to prefix the destination | ||
@@ -561,3 +562,3 @@ const dest = !isDev | ||
}; | ||
routes.forEach(route => { | ||
routes.forEach((route) => { | ||
const { initialRevalidateSeconds, dataRoute, srcRoute, } = manifest.routes[route]; | ||
@@ -572,3 +573,3 @@ ret.staticRoutes[route] = { | ||
}); | ||
lazyRoutes.forEach(lazyRoute => { | ||
lazyRoutes.forEach((lazyRoute) => { | ||
const { routeRegex, fallback, dataRoute, dataRouteRegex, } = manifest.dynamicRoutes[lazyRoute]; | ||
@@ -603,3 +604,3 @@ if (fallback) { | ||
}; | ||
routes.forEach(route => { | ||
routes.forEach((route) => { | ||
const { initialRevalidateSeconds, dataRoute, srcRoute, } = manifest.routes[route]; | ||
@@ -614,3 +615,3 @@ ret.staticRoutes[route] = { | ||
}); | ||
lazyRoutes.forEach(lazyRoute => { | ||
lazyRoutes.forEach((lazyRoute) => { | ||
const { routeRegex, fallback, dataRoute, dataRouteRegex, } = manifest.dynamicRoutes[lazyRoute]; | ||
@@ -617,0 +618,0 @@ if (!fallback) { |
{ | ||
"name": "@vercel/next", | ||
"version": "2.6.9-canary.0", | ||
"version": "2.6.9-canary.1", | ||
"license": "MIT", | ||
@@ -42,3 +42,3 @@ "main": "./dist/index", | ||
}, | ||
"gitHead": "5380c12569579ff1aba0d2aee54e10016cb12a5d" | ||
"gitHead": "86b730c1cd814b35e7e286fbf9690c3c76e9b9ac" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1410659
39426