Skip to content

Commit 9112f63

Browse files
authored
Move phases back to next/constants (#6104)
* Move phases back to next/constants * Fix typescript error
1 parent d6ec10a commit 9112f63

File tree

7 files changed

+11
-12
lines changed

7 files changed

+11
-12
lines changed

packages/next-server/lib/constants.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
export const PHASE_EXPORT = 'phase-export'
2-
export const PHASE_PRODUCTION_BUILD = 'phase-production-build'
3-
export const PHASE_PRODUCTION_SERVER = 'phase-production-server'
4-
export const PHASE_DEVELOPMENT_SERVER = 'phase-development-server'
51
export const PAGES_MANIFEST = 'pages-manifest.json'
62
export const BUILD_MANIFEST = 'build-manifest.json'
73
export const REACT_LOADABLE_MANIFEST = 'react-loadable-manifest.json'

packages/next-server/server/next-server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {serveStatic} from './serve-static'
1010
import Router, {route, Route} from './router'
1111
import { isInternalUrl, isBlockedPage } from './utils'
1212
import loadConfig from 'next-server/next-config'
13-
import {PHASE_PRODUCTION_SERVER, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH, CLIENT_STATIC_FILES_RUNTIME} from 'next-server/constants'
13+
import {BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH, CLIENT_STATIC_FILES_RUNTIME} from 'next-server/constants'
1414
import * as envConfig from '../lib/runtime-config'
1515
import {loadComponents} from './load-components'
1616

@@ -74,7 +74,7 @@ export default class Server {
7474
}
7575

7676
private currentPhase(): string {
77-
return PHASE_PRODUCTION_SERVER
77+
return 'phase-production-server'
7878
}
7979

8080
private logError(...args: any): void {

packages/next/build/babel/plugins/next-to-next-server.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ export default function NextToNextServer (): PluginObj {
1010
if (source === 'next/dynamic') {
1111
path.node.source.value = 'next-server/dynamic'
1212
}
13-
if (source === 'next/constants') {
14-
path.node.source.value = 'next-server/constants'
15-
}
1613
if (source === 'next/config') {
1714
path.node.source.value = 'next-server/config'
1815
}

packages/next/build/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from 'path'
22
import nanoid from 'nanoid'
33
import loadConfig from 'next-server/next-config'
4-
import { PHASE_PRODUCTION_BUILD } from 'next-server/constants'
4+
import { PHASE_PRODUCTION_BUILD } from '../lib/constants'
55
import getBaseWebpackConfig from './webpack-config'
66
import {generateBuildId} from './generate-build-id'
77
import {writeBuildId} from './write-build-id'

packages/next/export/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import mkdirp from 'mkdirp-then'
66
import { resolve, join } from 'path'
77
import { existsSync, readFileSync } from 'fs'
88
import loadConfig from 'next-server/next-config'
9-
import { PHASE_EXPORT, SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH } from 'next-server/constants'
9+
import { PHASE_EXPORT } from '../lib/constants'
10+
import { SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH } from 'next-server/constants'
1011
import * as envConfig from 'next-server/config'
1112
import createProgress from 'tty-aware-progress'
1213

packages/next/lib/constants.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ export const NEXT_PROJECT_ROOT_DIST_SERVER = join(NEXT_PROJECT_ROOT_DIST, 'serve
1010
// we have to use a private alias
1111
export const PAGES_DIR_ALIAS = 'private-next-pages'
1212
export const DOT_NEXT_ALIAS = 'private-dot-next'
13+
14+
export const PHASE_EXPORT = 'phase-export'
15+
export const PHASE_PRODUCTION_BUILD = 'phase-production-build'
16+
export const PHASE_PRODUCTION_SERVER = 'phase-production-server'
17+
export const PHASE_DEVELOPMENT_SERVER = 'phase-development-server'

packages/next/server/next-dev-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Server from 'next-server/dist/server/next-server'
22
import { join } from 'path'
33
import HotReloader from './hot-reloader'
44
import {route} from 'next-server/dist/server/router'
5-
import {PHASE_DEVELOPMENT_SERVER} from 'next-server/constants'
5+
import {PHASE_DEVELOPMENT_SERVER} from '../lib/constants'
66
import ErrorDebug from './error-debug'
77

88
export default class DevServer extends Server {

0 commit comments

Comments
 (0)