@openuiai/next 16.0.3 → 16.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +3 -3
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +6 -6
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/server/require-hook.js +23 -21
- package/dist/esm/server/require-hook.js.map +1 -1
- package/dist/esm/shared/lib/errors/canary-only-config-error.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/server/require-hook.js +23 -21
- package/dist/server/require-hook.js.map +1 -1
- package/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +1 -1
package/dist/esm/build/index.js
CHANGED
|
@@ -305,7 +305,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
305
305
|
try {
|
|
306
306
|
const nextBuildSpan = trace('next-build', undefined, {
|
|
307
307
|
buildMode: experimentalBuildMode,
|
|
308
|
-
version: "16.0.
|
|
308
|
+
version: "16.0.4"
|
|
309
309
|
});
|
|
310
310
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
311
311
|
NextBuildContext.dir = dir;
|
|
@@ -818,7 +818,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
818
818
|
// Files outside of the distDir can be "type": "module"
|
|
819
819
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
|
820
820
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
|
821
|
-
await recordFrameworkVersion("16.0.
|
|
821
|
+
await recordFrameworkVersion("16.0.4");
|
|
822
822
|
await updateBuildDiagnostics({
|
|
823
823
|
buildStage: 'start'
|
|
824
824
|
});
|
|
@@ -2467,7 +2467,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
2467
2467
|
configOutDir: path.join(dir, configOutDir),
|
|
2468
2468
|
staticPages,
|
|
2469
2469
|
serverPropsPages,
|
|
2470
|
-
nextVersion: "16.0.
|
|
2470
|
+
nextVersion: "16.0.4",
|
|
2471
2471
|
tracingRoot: outputFileTracingRoot,
|
|
2472
2472
|
hasNodeMiddleware,
|
|
2473
2473
|
hasInstrumentationHook,
|
|
@@ -8,7 +8,7 @@ import { eventSwcLoadFailure } from '../../telemetry/events/swc-load-failure';
|
|
|
8
8
|
import { patchIncorrectLockfile } from '../../lib/patch-incorrect-lockfile';
|
|
9
9
|
import { downloadNativeNextSwc, downloadWasmSwc } from '../../lib/download-swc';
|
|
10
10
|
import { getDefineEnv } from '../define-env';
|
|
11
|
-
const nextVersion = "16.0.
|
|
11
|
+
const nextVersion = "16.0.4";
|
|
12
12
|
const ArchName = arch();
|
|
13
13
|
const PlatformName = platform();
|
|
14
14
|
function infoLog(...args) {
|
|
@@ -1610,7 +1610,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1610
1610
|
isClient && new CopyFilePlugin({
|
|
1611
1611
|
// file path to build output of `@next/polyfill-nomodule`
|
|
1612
1612
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
|
1613
|
-
cacheKey: "16.0.
|
|
1613
|
+
cacheKey: "16.0.4",
|
|
1614
1614
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
|
1615
1615
|
minimize: false,
|
|
1616
1616
|
info: {
|
|
@@ -1801,7 +1801,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
|
1801
1801
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
|
1802
1802
|
// - Next.js version
|
|
1803
1803
|
// - next.config.js keys that affect compilation
|
|
1804
|
-
version: `${__dirname}|${"16.0.
|
|
1804
|
+
version: `${__dirname}|${"16.0.4"}|${configVars}`,
|
|
1805
1805
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
|
1806
1806
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
|
1807
1807
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* - next/script with `beforeInteractive` strategy
|
|
6
6
|
*/ import { getAssetPrefix } from './asset-prefix';
|
|
7
7
|
import { setAttributesFromProps } from './set-attributes-from-props';
|
|
8
|
-
const version = "16.0.
|
|
8
|
+
const version = "16.0.4";
|
|
9
9
|
window.next = {
|
|
10
10
|
version,
|
|
11
11
|
appDir: true
|
package/dist/esm/client/index.js
CHANGED
|
@@ -25,7 +25,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
|
25
25
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
|
26
26
|
import tracer from './tracing/tracer';
|
|
27
27
|
import { isNextRouterError } from './components/is-next-router-error';
|
|
28
|
-
export const version = "16.0.
|
|
28
|
+
export const version = "16.0.4";
|
|
29
29
|
export let router;
|
|
30
30
|
export const emitter = mitt();
|
|
31
31
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -163,7 +163,7 @@ export default class HotReloaderWebpack {
|
|
|
163
163
|
this.previewProps = previewProps;
|
|
164
164
|
this.rewrites = rewrites;
|
|
165
165
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
|
166
|
-
version: "16.0.
|
|
166
|
+
version: "16.0.4"
|
|
167
167
|
});
|
|
168
168
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
169
169
|
// of the current `next dev` invocation.
|
|
@@ -20,7 +20,7 @@ export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures
|
|
|
20
20
|
if (parts.length > 0) {
|
|
21
21
|
versionSuffix = ` (${parts.join(', ')})`;
|
|
22
22
|
}
|
|
23
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.0.
|
|
23
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"16.0.4"}`))}${versionSuffix}`);
|
|
24
24
|
if (appUrl) {
|
|
25
25
|
Log.bootstrap(`- Local: ${appUrl}`);
|
|
26
26
|
}
|
|
@@ -110,7 +110,7 @@ export async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup,
|
|
|
110
110
|
export async function startServer(serverOptions) {
|
|
111
111
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
112
112
|
let { port } = serverOptions;
|
|
113
|
-
process.title = `next-server (v${"16.0.
|
|
113
|
+
process.title = `next-server (v${"16.0.4"})`;
|
|
114
114
|
let handlersReady = ()=>{};
|
|
115
115
|
let handlersError = ()=>{};
|
|
116
116
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// This is needed for userland plugins to attach to the same webpack instance as Next.js'.
|
|
3
3
|
// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.
|
|
4
4
|
// This module will only be loaded once per process.
|
|
5
|
+
// Skip module hooks on Bun - Bun's module system handles things differently
|
|
6
|
+
// and these hooks cause issues with undefined requests
|
|
7
|
+
const isBun = typeof globalThis.Bun !== 'undefined';
|
|
5
8
|
const path = require('path');
|
|
6
9
|
const mod = require('module');
|
|
7
10
|
const originalRequire = mod.prototype.require;
|
|
@@ -28,26 +31,25 @@ export function addHookAliases(aliases = []) {
|
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
addHookAliases(toResolveMap(defaultOverrides));
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
// This
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return originalRequire.call(this,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
};
|
|
34
|
+
// Only apply module hooks on Node.js - Bun's module system handles things differently
|
|
35
|
+
if (!isBun) {
|
|
36
|
+
// @ts-expect-error
|
|
37
|
+
mod._resolveFilename = (function(originalResolveFilename, requestMap, request, parent, isMain, options) {
|
|
38
|
+
const hookResolved = requestMap.get(request);
|
|
39
|
+
if (hookResolved) request = hookResolved;
|
|
40
|
+
return originalResolveFilename.call(mod, request, parent, isMain, options);
|
|
41
|
+
// We use `bind` here to avoid referencing outside variables to create potential memory leaks.
|
|
42
|
+
}).bind(null, resolveFilename, hookPropertyMap);
|
|
43
|
+
// @ts-expect-error
|
|
44
|
+
// This is a hack to make sure that if a user requires a Next.js module that wasn't bundled
|
|
45
|
+
// that needs to point to the rendering runtime version, it will point to the correct one.
|
|
46
|
+
// This can happen on `pages` when a user requires a dependency that uses next/image for example.
|
|
47
|
+
mod.prototype.require = function(request) {
|
|
48
|
+
if (typeof request === 'string' && request.endsWith('.shared-runtime')) {
|
|
49
|
+
return originalRequire.call(this, `next/dist/server/route-modules/pages/vendored/contexts/${path.basename(request, '.shared-runtime')}`);
|
|
50
|
+
}
|
|
51
|
+
return originalRequire.call(this, request);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
52
54
|
|
|
53
55
|
//# sourceMappingURL=require-hook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n // Alias react and react-dom to the compiled versions to ensure consistency\n // across the entire build process. This prevents multiple React instances.\n react: path.dirname(resolve('next/dist/compiled/react/package.json')),\n 'react-dom': path.dirname(\n resolve('next/dist/compiled/react-dom/package.json')\n ),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// @ts-expect-error\
|
|
1
|
+
{"version":3,"sources":["../../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\n\n// Skip module hooks on Bun - Bun's module system handles things differently\n// and these hooks cause issues with undefined requests\nconst isBun = typeof globalThis.Bun !== 'undefined'\n\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n // Alias react and react-dom to the compiled versions to ensure consistency\n // across the entire build process. This prevents multiple React instances.\n react: path.dirname(resolve('next/dist/compiled/react/package.json')),\n 'react-dom': path.dirname(\n resolve('next/dist/compiled/react-dom/package.json')\n ),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// Only apply module hooks on Node.js - Bun's module system handles things differently\nif (!isBun) {\n // @ts-expect-error\n mod._resolveFilename = function (\n originalResolveFilename: (\n request: string,\n parent: string,\n isMain: boolean,\n opts: any\n ) => string,\n requestMap: Map<string, string>,\n request: string,\n parent: string,\n isMain: boolean,\n options: any\n ) {\n const hookResolved = requestMap.get(request)\n if (hookResolved) request = hookResolved\n\n return originalResolveFilename.call(mod, request, parent, isMain, options)\n\n // We use `bind` here to avoid referencing outside variables to create potential memory leaks.\n }.bind(null, resolveFilename, hookPropertyMap)\n\n // @ts-expect-error\n // This is a hack to make sure that if a user requires a Next.js module that wasn't bundled\n // that needs to point to the rendering runtime version, it will point to the correct one.\n // This can happen on `pages` when a user requires a dependency that uses next/image for example.\n mod.prototype.require = function (request: string) {\n if (typeof request === 'string' && request.endsWith('.shared-runtime')) {\n return originalRequire.call(\n this,\n `next/dist/server/route-modules/pages/vendored/contexts/${path.basename(\n request,\n '.shared-runtime'\n )}`\n )\n }\n\n return originalRequire.call(this, request)\n }\n}\n"],"names":["isBun","globalThis","Bun","path","require","mod","originalRequire","prototype","resolveFilename","_resolveFilename","resolve","process","env","NEXT_MINIMAL","__non_webpack_require__","hookPropertyMap","Map","defaultOverrides","dirname","react","toResolveMap","map","Object","entries","key","value","addHookAliases","aliases","set","originalResolveFilename","requestMap","request","parent","isMain","options","hookResolved","get","call","bind","endsWith","basename"],"mappings":"AAAA,uHAAuH;AACvH,0FAA0F;AAC1F,kGAAkG;AAElG,oDAAoD;AAEpD,4EAA4E;AAC5E,uDAAuD;AACvD,MAAMA,QAAQ,OAAOC,WAAWC,GAAG,KAAK;AAExC,MAAMC,OAAOC,QAAQ;AACrB,MAAMC,MAAMD,QAAQ;AACpB,MAAME,kBAAkBD,IAAIE,SAAS,CAACH,OAAO;AAC7C,MAAMI,kBACJ,mBAAmB;AACnBH,IAAII,gBAAgB;AAEtB,IAAIC,UAAkCC,QAAQC,GAAG,CAACC,YAAY,GAE1DC,wBAAwBJ,OAAO,GAC/BN,QAAQM,OAAO;AAEnB,OAAO,MAAMK,kBAAkB,IAAIC,MAAK;AAExC,OAAO,MAAMC,mBAAmB;IAC9B,cAAcd,KAAKe,OAAO,CAACR,QAAQ;IACnC,oBAAoBA,QAAQ;IAC5B,uBAAuBA,QAAQ;IAC/B,2EAA2E;IAC3E,2EAA2E;IAC3ES,OAAOhB,KAAKe,OAAO,CAACR,QAAQ;IAC5B,aAAaP,KAAKe,OAAO,CACvBR,QAAQ;AAEZ,EAAC;AAED,MAAMU,eAAe,CAACC,MACpBC,OAAOC,OAAO,CAACF,KAAKA,GAAG,CAAC,CAAC,CAACG,KAAKC,MAAM,GAAK;YAACD;YAAKd,QAAQe;SAAO;AAEjE,OAAO,SAASC,eAAeC,UAA8B,EAAE;IAC7D,KAAK,MAAM,CAACH,KAAKC,MAAM,IAAIE,QAAS;QAClCZ,gBAAgBa,GAAG,CAACJ,KAAKC;IAC3B;AACF;AAEAC,eAAeN,aAAaH;AAE5B,sFAAsF;AACtF,IAAI,CAACjB,OAAO;IACV,mBAAmB;IACnBK,IAAII,gBAAgB,GAAG,CAAA,SACrBoB,uBAKW,EACXC,UAA+B,EAC/BC,OAAe,EACfC,MAAc,EACdC,MAAe,EACfC,OAAY;QAEZ,MAAMC,eAAeL,WAAWM,GAAG,CAACL;QACpC,IAAII,cAAcJ,UAAUI;QAE5B,OAAON,wBAAwBQ,IAAI,CAAChC,KAAK0B,SAASC,QAAQC,QAAQC;IAElE,8FAA8F;IAChG,CAAA,EAAEI,IAAI,CAAC,MAAM9B,iBAAiBO;IAE9B,mBAAmB;IACnB,2FAA2F;IAC3F,0FAA0F;IAC1F,iGAAiG;IACjGV,IAAIE,SAAS,CAACH,OAAO,GAAG,SAAU2B,OAAe;QAC/C,IAAI,OAAOA,YAAY,YAAYA,QAAQQ,QAAQ,CAAC,oBAAoB;YACtE,OAAOjC,gBAAgB+B,IAAI,CACzB,IAAI,EACJ,CAAC,uDAAuD,EAAElC,KAAKqC,QAAQ,CACrET,SACA,oBACC;QAEP;QAEA,OAAOzB,gBAAgB+B,IAAI,CAAC,IAAI,EAAEN;IACpC;AACF","ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function isStableBuild() {
|
|
2
|
-
return !"16.0.
|
|
2
|
+
return !"16.0.4"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
3
3
|
}
|
|
4
4
|
export class CanaryOnlyConfigError extends Error {
|
|
5
5
|
constructor(arg){
|
|
@@ -231,7 +231,7 @@ class HotReloaderWebpack {
|
|
|
231
231
|
this.previewProps = previewProps;
|
|
232
232
|
this.rewrites = rewrites;
|
|
233
233
|
this.hotReloaderSpan = (0, _trace.trace)('hot-reloader', undefined, {
|
|
234
|
-
version: "16.0.
|
|
234
|
+
version: "16.0.4"
|
|
235
235
|
});
|
|
236
236
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
|
237
237
|
// of the current `next dev` invocation.
|
|
@@ -88,7 +88,7 @@ function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, logBu
|
|
|
88
88
|
if (parts.length > 0) {
|
|
89
89
|
versionSuffix = ` (${parts.join(', ')})`;
|
|
90
90
|
}
|
|
91
|
-
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.0.
|
|
91
|
+
_log.bootstrap(`${(0, _picocolors.bold)((0, _picocolors.purple)(`${_log.prefixes.ready} Next.js ${"16.0.4"}`))}${versionSuffix}`);
|
|
92
92
|
if (appUrl) {
|
|
93
93
|
_log.bootstrap(`- Local: ${appUrl}`);
|
|
94
94
|
}
|
|
@@ -178,7 +178,7 @@ async function getRequestHandlers({ dir, port, isDev, onDevServerCleanup, server
|
|
|
178
178
|
async function startServer(serverOptions) {
|
|
179
179
|
const { dir, isDev, hostname, minimalMode, allowRetry, keepAliveTimeout, selfSignedCertificate } = serverOptions;
|
|
180
180
|
let { port } = serverOptions;
|
|
181
|
-
process.title = `next-server (v${"16.0.
|
|
181
|
+
process.title = `next-server (v${"16.0.4"})`;
|
|
182
182
|
let handlersReady = ()=>{};
|
|
183
183
|
let handlersError = ()=>{};
|
|
184
184
|
let handlersPromise = new Promise((resolve, reject)=>{
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// This is needed for userland plugins to attach to the same webpack instance as Next.js'.
|
|
3
3
|
// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.
|
|
4
4
|
// This module will only be loaded once per process.
|
|
5
|
+
// Skip module hooks on Bun - Bun's module system handles things differently
|
|
6
|
+
// and these hooks cause issues with undefined requests
|
|
5
7
|
"use strict";
|
|
6
8
|
Object.defineProperty(exports, "__esModule", {
|
|
7
9
|
value: true
|
|
@@ -28,6 +30,7 @@ _export(exports, {
|
|
|
28
30
|
return hookPropertyMap;
|
|
29
31
|
}
|
|
30
32
|
});
|
|
33
|
+
const isBun = typeof globalThis.Bun !== 'undefined';
|
|
31
34
|
const path = require('path');
|
|
32
35
|
const mod = require('module');
|
|
33
36
|
const originalRequire = mod.prototype.require;
|
|
@@ -54,26 +57,25 @@ function addHookAliases(aliases = []) {
|
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
addHookAliases(toResolveMap(defaultOverrides));
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
// This
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return originalRequire.call(this,
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
};
|
|
60
|
+
// Only apply module hooks on Node.js - Bun's module system handles things differently
|
|
61
|
+
if (!isBun) {
|
|
62
|
+
// @ts-expect-error
|
|
63
|
+
mod._resolveFilename = (function(originalResolveFilename, requestMap, request, parent, isMain, options) {
|
|
64
|
+
const hookResolved = requestMap.get(request);
|
|
65
|
+
if (hookResolved) request = hookResolved;
|
|
66
|
+
return originalResolveFilename.call(mod, request, parent, isMain, options);
|
|
67
|
+
// We use `bind` here to avoid referencing outside variables to create potential memory leaks.
|
|
68
|
+
}).bind(null, resolveFilename, hookPropertyMap);
|
|
69
|
+
// @ts-expect-error
|
|
70
|
+
// This is a hack to make sure that if a user requires a Next.js module that wasn't bundled
|
|
71
|
+
// that needs to point to the rendering runtime version, it will point to the correct one.
|
|
72
|
+
// This can happen on `pages` when a user requires a dependency that uses next/image for example.
|
|
73
|
+
mod.prototype.require = function(request) {
|
|
74
|
+
if (typeof request === 'string' && request.endsWith('.shared-runtime')) {
|
|
75
|
+
return originalRequire.call(this, `next/dist/server/route-modules/pages/vendored/contexts/${path.basename(request, '.shared-runtime')}`);
|
|
76
|
+
}
|
|
77
|
+
return originalRequire.call(this, request);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
78
80
|
|
|
79
81
|
//# sourceMappingURL=require-hook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n // Alias react and react-dom to the compiled versions to ensure consistency\n // across the entire build process. This prevents multiple React instances.\n react: path.dirname(resolve('next/dist/compiled/react/package.json')),\n 'react-dom': path.dirname(\n resolve('next/dist/compiled/react-dom/package.json')\n ),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// @ts-expect-error\
|
|
1
|
+
{"version":3,"sources":["../../src/server/require-hook.ts"],"sourcesContent":["// Synchronously inject a require hook for webpack and webpack/. It's required to use the internal ncc webpack version.\n// This is needed for userland plugins to attach to the same webpack instance as Next.js'.\n// Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*.\n\n// This module will only be loaded once per process.\n\n// Skip module hooks on Bun - Bun's module system handles things differently\n// and these hooks cause issues with undefined requests\nconst isBun = typeof globalThis.Bun !== 'undefined'\n\nconst path = require('path') as typeof import('path')\nconst mod = require('module') as typeof import('module')\nconst originalRequire = mod.prototype.require\nconst resolveFilename =\n // @ts-expect-error\n mod._resolveFilename\n\nlet resolve: typeof require.resolve = process.env.NEXT_MINIMAL\n ? // @ts-ignore\n __non_webpack_require__.resolve\n : require.resolve\n\nexport const hookPropertyMap = new Map()\n\nexport const defaultOverrides = {\n 'styled-jsx': path.dirname(resolve('styled-jsx/package.json')),\n 'styled-jsx/style': resolve('styled-jsx/style'),\n 'styled-jsx/style.js': resolve('styled-jsx/style'),\n // Alias react and react-dom to the compiled versions to ensure consistency\n // across the entire build process. This prevents multiple React instances.\n react: path.dirname(resolve('next/dist/compiled/react/package.json')),\n 'react-dom': path.dirname(\n resolve('next/dist/compiled/react-dom/package.json')\n ),\n}\n\nconst toResolveMap = (map: Record<string, string>): [string, string][] =>\n Object.entries(map).map(([key, value]) => [key, resolve(value)])\n\nexport function addHookAliases(aliases: [string, string][] = []) {\n for (const [key, value] of aliases) {\n hookPropertyMap.set(key, value)\n }\n}\n\naddHookAliases(toResolveMap(defaultOverrides))\n\n// Only apply module hooks on Node.js - Bun's module system handles things differently\nif (!isBun) {\n // @ts-expect-error\n mod._resolveFilename = function (\n originalResolveFilename: (\n request: string,\n parent: string,\n isMain: boolean,\n opts: any\n ) => string,\n requestMap: Map<string, string>,\n request: string,\n parent: string,\n isMain: boolean,\n options: any\n ) {\n const hookResolved = requestMap.get(request)\n if (hookResolved) request = hookResolved\n\n return originalResolveFilename.call(mod, request, parent, isMain, options)\n\n // We use `bind` here to avoid referencing outside variables to create potential memory leaks.\n }.bind(null, resolveFilename, hookPropertyMap)\n\n // @ts-expect-error\n // This is a hack to make sure that if a user requires a Next.js module that wasn't bundled\n // that needs to point to the rendering runtime version, it will point to the correct one.\n // This can happen on `pages` when a user requires a dependency that uses next/image for example.\n mod.prototype.require = function (request: string) {\n if (typeof request === 'string' && request.endsWith('.shared-runtime')) {\n return originalRequire.call(\n this,\n `next/dist/server/route-modules/pages/vendored/contexts/${path.basename(\n request,\n '.shared-runtime'\n )}`\n )\n }\n\n return originalRequire.call(this, request)\n }\n}\n"],"names":["addHookAliases","defaultOverrides","hookPropertyMap","isBun","globalThis","Bun","path","require","mod","originalRequire","prototype","resolveFilename","_resolveFilename","resolve","process","env","NEXT_MINIMAL","__non_webpack_require__","Map","dirname","react","toResolveMap","map","Object","entries","key","value","aliases","set","originalResolveFilename","requestMap","request","parent","isMain","options","hookResolved","get","call","bind","endsWith","basename"],"mappings":"AAAA,uHAAuH;AACvH,0FAA0F;AAC1F,kGAAkG;AAElG,oDAAoD;AAEpD,4EAA4E;AAC5E,uDAAuD;;;;;;;;;;;;;;;;;IAgCvCA,cAAc;eAAdA;;IAfHC,gBAAgB;eAAhBA;;IAFAC,eAAe;eAAfA;;;AAdb,MAAMC,QAAQ,OAAOC,WAAWC,GAAG,KAAK;AAExC,MAAMC,OAAOC,QAAQ;AACrB,MAAMC,MAAMD,QAAQ;AACpB,MAAME,kBAAkBD,IAAIE,SAAS,CAACH,OAAO;AAC7C,MAAMI,kBACJ,mBAAmB;AACnBH,IAAII,gBAAgB;AAEtB,IAAIC,UAAkCC,QAAQC,GAAG,CAACC,YAAY,GAE1DC,wBAAwBJ,OAAO,GAC/BN,QAAQM,OAAO;AAEZ,MAAMX,kBAAkB,IAAIgB;AAE5B,MAAMjB,mBAAmB;IAC9B,cAAcK,KAAKa,OAAO,CAACN,QAAQ;IACnC,oBAAoBA,QAAQ;IAC5B,uBAAuBA,QAAQ;IAC/B,2EAA2E;IAC3E,2EAA2E;IAC3EO,OAAOd,KAAKa,OAAO,CAACN,QAAQ;IAC5B,aAAaP,KAAKa,OAAO,CACvBN,QAAQ;AAEZ;AAEA,MAAMQ,eAAe,CAACC,MACpBC,OAAOC,OAAO,CAACF,KAAKA,GAAG,CAAC,CAAC,CAACG,KAAKC,MAAM,GAAK;YAACD;YAAKZ,QAAQa;SAAO;AAE1D,SAAS1B,eAAe2B,UAA8B,EAAE;IAC7D,KAAK,MAAM,CAACF,KAAKC,MAAM,IAAIC,QAAS;QAClCzB,gBAAgB0B,GAAG,CAACH,KAAKC;IAC3B;AACF;AAEA1B,eAAeqB,aAAapB;AAE5B,sFAAsF;AACtF,IAAI,CAACE,OAAO;IACV,mBAAmB;IACnBK,IAAII,gBAAgB,GAAG,CAAA,SACrBiB,uBAKW,EACXC,UAA+B,EAC/BC,OAAe,EACfC,MAAc,EACdC,MAAe,EACfC,OAAY;QAEZ,MAAMC,eAAeL,WAAWM,GAAG,CAACL;QACpC,IAAII,cAAcJ,UAAUI;QAE5B,OAAON,wBAAwBQ,IAAI,CAAC7B,KAAKuB,SAASC,QAAQC,QAAQC;IAElE,8FAA8F;IAChG,CAAA,EAAEI,IAAI,CAAC,MAAM3B,iBAAiBT;IAE9B,mBAAmB;IACnB,2FAA2F;IAC3F,0FAA0F;IAC1F,iGAAiG;IACjGM,IAAIE,SAAS,CAACH,OAAO,GAAG,SAAUwB,OAAe;QAC/C,IAAI,OAAOA,YAAY,YAAYA,QAAQQ,QAAQ,CAAC,oBAAoB;YACtE,OAAO9B,gBAAgB4B,IAAI,CACzB,IAAI,EACJ,CAAC,uDAAuD,EAAE/B,KAAKkC,QAAQ,CACrET,SACA,oBACC;QAEP;QAEA,OAAOtB,gBAAgB4B,IAAI,CAAC,IAAI,EAAEN;IACpC;AACF","ignoreList":[0]}
|
|
@@ -21,7 +21,7 @@ _export(exports, {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
function isStableBuild() {
|
|
24
|
-
return !"16.0.
|
|
24
|
+
return !"16.0.4"?.includes('canary') && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV;
|
|
25
25
|
}
|
|
26
26
|
class CanaryOnlyConfigError extends Error {
|
|
27
27
|
constructor(arg){
|
|
@@ -11,11 +11,11 @@ Object.defineProperty(exports, "eventCliSessionStopped", {
|
|
|
11
11
|
const EVENT_VERSION = 'NEXT_CLI_SESSION_STOPPED';
|
|
12
12
|
function eventCliSessionStopped(event) {
|
|
13
13
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
14
|
-
if (typeof "16.0.
|
|
14
|
+
if (typeof "16.0.4" !== 'string') {
|
|
15
15
|
return [];
|
|
16
16
|
}
|
|
17
17
|
const payload = {
|
|
18
|
-
nextVersion: "16.0.
|
|
18
|
+
nextVersion: "16.0.4",
|
|
19
19
|
nodeVersion: process.version,
|
|
20
20
|
cliCommand: event.cliCommand,
|
|
21
21
|
durationMilliseconds: event.durationMilliseconds,
|
|
@@ -12,12 +12,12 @@ const EVENT_VERSION = 'NEXT_CLI_SESSION_STARTED';
|
|
|
12
12
|
function eventCliSession(nextConfig, event) {
|
|
13
13
|
var _nextConfig_experimental_staleTimes, _nextConfig_experimental_staleTimes1, _nextConfig_reactCompiler, _nextConfig_reactCompiler1;
|
|
14
14
|
// This should be an invariant, if it fails our build tooling is broken.
|
|
15
|
-
if (typeof "16.0.
|
|
15
|
+
if (typeof "16.0.4" !== 'string') {
|
|
16
16
|
return [];
|
|
17
17
|
}
|
|
18
18
|
const { images, i18n } = nextConfig || {};
|
|
19
19
|
const payload = {
|
|
20
|
-
nextVersion: "16.0.
|
|
20
|
+
nextVersion: "16.0.4",
|
|
21
21
|
nodeVersion: process.version,
|
|
22
22
|
cliCommand: event.cliCommand,
|
|
23
23
|
isSrcDir: event.isSrcDir,
|