Skip to content

Commit

Permalink
chore: rename modules for better meaning and searching
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Nov 21, 2024
1 parent 9ab8434 commit 791e0e1
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"files": ["packages/**"],
"excludedFiles": [
"packages/next/taskfile*.js",
"packages/next/webpack.config.js"
"packages/next/next-runtime.webpack-config.js"
],
"rules": {
"no-shadow": ["error", { "builtinGlobals": false }],
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SimpleWebpackError } from './simpleWebpackError'
import {
createOriginalStackFrame,
getIgnoredSources,
} from '../../../../client/components/react-dev-overlay/server/middleware'
} from '../../../../client/components/react-dev-overlay/server/middleware-webpack'
import type { webpack } from 'next/dist/compiled/webpack/webpack'

// Based on https://github.com/webpack/webpack/blob/fcdd04a833943394bbb0a9eeb54a962a24cc7e41/lib/stats/DefaultStatsFactoryPlugin.js#L422-L431
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/dev/hot-reloader-webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { webpack, StringXor } from 'next/dist/compiled/webpack/webpack'
import {
getOverlayMiddleware,
getSourceMapMiddleware,
} from '../../client/components/react-dev-overlay/server/middleware'
} from '../../client/components/react-dev-overlay/server/middleware-webpack'
import { WebpackHotMiddleware } from './hot-middleware'
import { join, relative, isAbsolute, posix } from 'path'
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import {
getSourceMapFromFile,
parseStack,
getIgnoredSources,
} from '../../../client/components/react-dev-overlay/server/middleware'
} from '../../../client/components/react-dev-overlay/server/middleware-webpack'
import {
batchedTraceSource,
createOriginalStackFrame as createOriginalTurboStackFrame,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/patch-error-inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as url from 'url'
import type * as util from 'util'
import { SourceMapConsumer as SyncSourceMapConsumer } from 'next/dist/compiled/source-map'
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import { parseStack } from '../client/components/react-dev-overlay/server/middleware'
import { parseStack } from '../client/components/react-dev-overlay/server/middleware-webpack'
import { getOriginalCodeFrame } from '../client/components/react-dev-overlay/server/shared'
import { workUnitAsyncStorage } from './app-render/work-unit-async-storage.external'
import { dim } from '../lib/picocolors'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/web/sandbox/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface ModuleContext {
warnedEvals: Set<string>
}

let getServerError: typeof import('../../../client/components/react-dev-overlay/server/middleware').getServerError
let getServerError: typeof import('../../../client/components/react-dev-overlay/server/middleware-webpack').getServerError
let decorateServerError: typeof import('../../../shared/lib/error-source').decorateServerError

if (process.env.NODE_ENV === 'development') {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/web/sandbox/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type RunnerFn = (params: RunnerFnParams) => Promise<FetchEventResult>
function withTaggedErrors(fn: RunnerFn): RunnerFn {
if (process.env.NODE_ENV === 'development') {
const { getServerError } =
require('../../../client/components/react-dev-overlay/server/middleware') as typeof import('../../../client/components/react-dev-overlay/server/middleware')
require('../../../client/components/react-dev-overlay/server/middleware') as typeof import('../../../client/components/react-dev-overlay/server/middleware-webpack')

return (params) =>
fn(params)
Expand Down
20 changes: 10 additions & 10 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2823,7 +2823,7 @@ export async function release(task) {
export async function next_bundle_app_turbo(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
turbo: true,
bundleType: 'app',
}),
Expand All @@ -2834,7 +2834,7 @@ export async function next_bundle_app_turbo(task, opts) {
export async function next_bundle_app_prod(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
dev: false,
bundleType: 'app',
}),
Expand All @@ -2845,7 +2845,7 @@ export async function next_bundle_app_prod(task, opts) {
export async function next_bundle_app_dev(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
dev: true,
bundleType: 'app',
}),
Expand All @@ -2856,7 +2856,7 @@ export async function next_bundle_app_dev(task, opts) {
export async function next_bundle_app_turbo_experimental(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
turbo: true,
bundleType: 'app',
experimental: true,
Expand All @@ -2868,7 +2868,7 @@ export async function next_bundle_app_turbo_experimental(task, opts) {
export async function next_bundle_app_prod_experimental(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
dev: false,
bundleType: 'app',
experimental: true,
Expand All @@ -2880,7 +2880,7 @@ export async function next_bundle_app_prod_experimental(task, opts) {
export async function next_bundle_app_dev_experimental(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
dev: true,
bundleType: 'app',
experimental: true,
Expand All @@ -2892,7 +2892,7 @@ export async function next_bundle_app_dev_experimental(task, opts) {
export async function next_bundle_pages_prod(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
dev: false,
bundleType: 'pages',
}),
Expand All @@ -2903,7 +2903,7 @@ export async function next_bundle_pages_prod(task, opts) {
export async function next_bundle_pages_dev(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
dev: true,
bundleType: 'pages',
}),
Expand All @@ -2914,7 +2914,7 @@ export async function next_bundle_pages_dev(task, opts) {
export async function next_bundle_pages_turbo(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
turbo: true,
bundleType: 'pages',
}),
Expand All @@ -2925,7 +2925,7 @@ export async function next_bundle_pages_turbo(task, opts) {
export async function next_bundle_server(task, opts) {
await task.source('dist').webpack({
watch: opts.dev,
config: require('./webpack.config')({
config: require('./next-runtime.webpack-config')({
dev: false,
bundleType: 'server',
}),
Expand Down

0 comments on commit 791e0e1

Please sign in to comment.