Skip to content

Commit

Permalink
lint fix and update turbo resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Jul 10, 2023
1 parent d534db8 commit 00c6352
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import os from 'os'
import { Worker } from '../lib/worker'
import { defaultConfig } from '../server/config-shared'
import devalue from 'next/dist/compiled/devalue'
import { escapeStringRegexp } from '../shared/lib/escape-regexp'
import findUp from 'next/dist/compiled/find-up'
import { nanoid } from 'next/dist/compiled/nanoid/index.cjs'
import { pathToRegexp } from 'next/dist/compiled/path-to-regexp'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/api-utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IncomingMessage } from 'http'
import type { BaseNextRequest } from '../base-http'
import type { CookieSerializeOptions } from 'next/dist/compiled/cookie'
import type { NextApiRequest, NextApiResponse } from '../../shared/lib/utils'
import type { NextApiResponse } from '../../shared/lib/utils'

import { HeadersAdapter } from '../web/spec-extension/adapters/headers'
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/dev/next-dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type { BaseNextRequest, BaseNextResponse } from '../base-http'
import type { MiddlewareRoutingItem } from '../base-server'
import type { FunctionComponent } from 'react'
import type { RouteMatch } from '../future/route-matches/route-match'
import type { default as THotReloader } from './hot-reloader'

import { Worker } from 'next/dist/compiled/jest-worker'
import { join as pathJoin } from 'path'
Expand Down Expand Up @@ -251,6 +250,7 @@ export default class DevServer extends Server {
// So that the user doesn't have to define a custom server reading the exportPathMap
if (this.nextConfig.exportPathMap) {
Log.info('Defining routes from exportPathMap')
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const exportPathMap = await this.nextConfig.exportPathMap(
{},
{
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/server/dev/on-demand-entry-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ export function onDemandEntryHandler({
page: string
clientOnly: boolean
appPaths?: ReadonlyArray<string> | null
match?: RouteMatch,
match?: RouteMatch
isApp?: boolean
}) {
if (curEnsurePage.has(page)) {
Expand All @@ -918,7 +918,7 @@ export function onDemandEntryHandler({
clientOnly,
appPaths,
match,
isApp
isApp,
}).finally(() => {
curEnsurePage.delete(page)
})
Expand Down
7 changes: 5 additions & 2 deletions packages/next/src/server/lib/route-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ type RouteResult =
export async function makeResolver(..._args: any[]) {
return async function resolveRoute(
_req: IncomingMessage,
_res: ServerResponse
res: ServerResponse
): Promise<RouteResult | void> {
res.setHeader('x-nextjs-route-result', '1')
res.end()

return {
type: 'rewrite',
url: _req.url || '/',
statusCode: 200,
headers: _res.getHeaders(),
headers: res.getHeaders(),
}
}
}
2 changes: 1 addition & 1 deletion packages/next/src/server/lib/router-utils/setup-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async function startWatcher(opts: SetupOpts) {
return (
!files.some((file) => file.startsWith(pathname)) &&
!directories.some(
(dir) => pathname.startsWith(dir) || dir.startsWith(pathname)
(d) => pathname.startsWith(d) || d.startsWith(pathname)
)
)
},
Expand Down

0 comments on commit 00c6352

Please sign in to comment.