@openuiai/next 15.6.0-bun.2 → 15.6.0-bun.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 +3 -3
- package/dist/build/swc/index.js.map +1 -1
- package/dist/build/swc/options.js +1 -1
- package/dist/build/swc/options.js.map +1 -1
- package/dist/build/webpack-config.js +3 -3
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/cli/next-info.js +1 -1
- package/dist/cli/next-info.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/@next/font/dist/google/get-fallback-font-override-metrics.js +2 -2
- package/dist/compiled/@next/font/dist/google/get-proxy-agent.js +2 -2
- package/dist/compiled/@next/font/dist/google/loader.js +1 -1
- package/dist/compiled/@next/font/dist/google/retry.js +1 -1
- package/dist/compiled/@next/font/google/index.js +2 -2
- package/dist/compiled/@next/font/local/index.js +2 -2
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/swc/index.js +3 -3
- package/dist/esm/build/swc/index.js.map +1 -1
- package/dist/esm/build/swc/options.js +1 -1
- package/dist/esm/build/swc/options.js.map +1 -1
- package/dist/esm/build/webpack-config.js +3 -3
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/patch-incorrect-lockfile.js +1 -1
- package/dist/esm/lib/patch-incorrect-lockfile.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-shared-utils.js +1 -1
- package/dist/esm/server/dev/hot-reloader-shared-utils.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +2 -2
- package/dist/esm/server/dev/hot-reloader-webpack.js.map +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/shared/lib/canary-only.js +1 -1
- package/dist/lib/patch-incorrect-lockfile.js +1 -1
- package/dist/lib/patch-incorrect-lockfile.js.map +1 -1
- package/dist/server/dev/hot-reloader-shared-utils.js +1 -1
- package/dist/server/dev/hot-reloader-shared-utils.js.map +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +2 -2
- package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/swc-load-failure.js +1 -1
- package/dist/telemetry/events/swc-load-failure.js.map +1 -1
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +2 -2
package/dist/cli/next-info.js
CHANGED
|
@@ -300,7 +300,7 @@ Next.js Config:
|
|
|
300
300
|
const path = require('path');
|
|
301
301
|
let fallbackBindingsDirectory;
|
|
302
302
|
try {
|
|
303
|
-
const nextPath = path.dirname(require.resolve('next/package.json'));
|
|
303
|
+
const nextPath = path.dirname(require.resolve('@openuiai/next/package.json'));
|
|
304
304
|
fallbackBindingsDirectory = path.join(nextPath, 'next-swc-fallback');
|
|
305
305
|
} catch (e) {
|
|
306
306
|
// Not able to locate next package from current running location, skipping fallback bindings check.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/next-info.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport os from 'os'\nimport { execSync } from '../lib/process-adapter'\n\nimport { bold, cyan, yellow } from '../lib/picocolors'\nimport { PHASE_INFO } from '../shared/lib/constants'\nimport loadConfig from '../server/config'\nimport { getRegistry } from '../lib/helpers/get-registry'\nimport { parseVersionInfo } from '../server/dev/parse-version-info'\nimport { getStaleness } from '../next-devtools/shared/version-staleness'\nimport { warn } from '../build/output/log'\n\nexport type NextInfoOptions = {\n verbose?: boolean\n}\n\ntype TaskResult = {\n // Additional messages to notify to the users, i.e certain script cannot be run due to missing xyz.\n messages?: string | undefined\n // Output of the script, either fails or success. This'll be printed to stdout or written into a file.\n output?: string | undefined\n result: 'pass' | 'fail' | 'skipped'\n}\n\ntype TaskScript = () => Promise<TaskResult>\n\ntype PlatformTaskScript =\n | {\n win32: TaskScript\n linux?: TaskScript\n darwin?: TaskScript\n default?: TaskScript\n }\n | {\n linux: TaskScript\n win32?: TaskScript\n darwin?: TaskScript\n default?: TaskScript\n }\n | {\n darwin: TaskScript\n win32?: TaskScript\n linux?: TaskScript\n default?: TaskScript\n }\n | {\n // A common task script if task does not need to be platform specific.\n default: TaskScript\n win32?: TaskScript\n linux?: TaskScript\n darwin?: TaskScript\n }\n\nfunction getPackageVersion(packageName: string) {\n try {\n return require(`${packageName}/package.json`).version\n } catch {\n return 'N/A'\n }\n}\n\nasync function getNextConfig() {\n const config = await loadConfig(PHASE_INFO, process.cwd())\n\n return {\n output: config.output ?? 'N/A',\n experimental: {\n useWasmBinary: config.experimental?.useWasmBinary,\n },\n }\n}\n\n/**\n * Returns the version of the specified binary, by supplying `--version` argument.\n * N/A if it fails to run the binary.\n */\nfunction getBinaryVersion(binaryName: string) {\n try {\n return execSync(`${binaryName} --version`).trim()\n } catch {\n return 'N/A'\n }\n}\n\n/**\n * Collect basic next.js installation information and print it to stdout.\n */\nasync function printInfo() {\n const installedRelease = getPackageVersion('next')\n const nextConfig = await getNextConfig()\n\n let stalenessWithTitle = ''\n let title = ''\n let versionInfo\n\n try {\n const registry = getRegistry()\n const res = await fetch(`${registry}-/package/next/dist-tags`)\n const tags = await res.json()\n\n versionInfo = parseVersionInfo({\n installed: installedRelease,\n latest: tags.latest,\n canary: tags.canary,\n })\n\n title = getStaleness(versionInfo).title\n\n if (title) {\n stalenessWithTitle = ` // ${title}`\n }\n } catch (e) {\n console.warn(\n `${yellow(\n bold('warn')\n )} - Failed to fetch latest canary version. (Reason: ${\n (e as Error).message\n }.)\n Detected \"${installedRelease}\". Visit https://github.com/vercel/next.js/releases.\n Make sure to try the latest canary version (eg.: \\`npm install next@canary\\`) to confirm the issue still exists before creating a new issue.\n \\nLearn more: ${cyan(\n 'https://nextjs.org/docs/messages/opening-an-issue'\n )}`\n )\n }\n\n const cpuCores = os.cpus().length\n let relevantPackages = ` next: ${installedRelease}${stalenessWithTitle}\n eslint-config-next: ${getPackageVersion('eslint-config-next')}\n react: ${getPackageVersion('react')}\n react-dom: ${getPackageVersion('react-dom')}\n typescript: ${getPackageVersion('typescript')}`\n\n console.log(`\nOperating System:\n Platform: ${os.platform()}\n Arch: ${os.arch()}\n Version: ${os.version()}\n Available memory (MB): ${Math.ceil(os.totalmem() / 1024 / 1024)}\n Available CPU cores: ${cpuCores > 0 ? cpuCores : 'N/A'}\nBinaries:\n Node: ${process.versions.node}\n npm: ${getBinaryVersion('npm')}\n Yarn: ${getBinaryVersion('yarn')}\n pnpm: ${getBinaryVersion('pnpm')}\nRelevant Packages:\n${relevantPackages}\nNext.js Config:\n output: ${nextConfig.output}`)\n\n if (versionInfo?.staleness.startsWith('stale')) {\n warn(`${title}\n Please try the latest canary version (\\`npm install next@canary\\`) to confirm the issue still exists before creating a new issue.\n Read more - https://nextjs.org/docs/messages/opening-an-issue`)\n }\n}\n\n/**\n * Using system-installed tools per each platform, trying to read shared dependencies of next-swc.\n * This is mainly for debugging DLOPEN failure.\n *\n * We don't / can't install these tools by ourselves, will skip the check if we can't find them.\n */\nasync function runSharedDependencyCheck(\n tools: Array<{ bin: string; checkArgs: Array<string>; args: Array<string> }>,\n skipMessage: string\n): Promise<TaskResult> {\n const currentPlatform = os.platform()\n const spawn =\n require('@openuiai/next/dist/compiled/cross-spawn') as typeof import('next/dist/compiled/cross-spawn')\n const { getSupportedArchTriples } =\n require('../build/swc') as typeof import('../build/swc')\n const triples = getSupportedArchTriples()[currentPlatform]?.[os.arch()] ?? []\n // First, check if system have a tool installed. We can't install these by our own.\n\n const availableTools = []\n for (const tool of tools) {\n try {\n const check = spawn.sync(tool.bin, tool.checkArgs)\n if (check.status === 0) {\n availableTools.push(tool)\n }\n } catch {\n // ignore if existence check fails\n }\n }\n\n if (availableTools.length === 0) {\n return {\n messages: skipMessage,\n result: 'skipped',\n }\n }\n\n const outputs: Array<string> = []\n let result: 'pass' | 'fail' = 'fail'\n\n for (const triple of triples) {\n const triplePkgName = `@next/swc-${triple.platformArchABI}`\n let resolved\n try {\n resolved = require.resolve(triplePkgName)\n } catch (e) {\n return {\n messages:\n 'Cannot find next-swc installation, skipping dependencies check',\n result: 'skipped',\n }\n }\n\n for (const tool of availableTools) {\n const proc = spawn(tool.bin, [...tool.args, resolved])\n outputs.push(`Running ${tool.bin} ------------- `)\n // Captures output, doesn't matter if it fails or not since we'll forward both to output.\n const procPromise = new Promise((resolve) => {\n proc.stdout!.on('data', function (data: string) {\n outputs.push(data)\n })\n proc.stderr!.on('data', function (data: string) {\n outputs.push(data)\n })\n proc.on('close', (c: any) => resolve(c))\n })\n\n let code = await procPromise\n if (code === 0) {\n result = 'pass'\n }\n }\n }\n\n return {\n output: outputs.join('\\n'),\n result,\n }\n}\n\n/**\n * Collect additional diagnostics information.\n */\nasync function printVerboseInfo() {\n const fs = require('fs') as typeof import('fs')\n const currentPlatform = os.platform()\n\n if (\n currentPlatform !== 'win32' &&\n currentPlatform !== 'linux' &&\n currentPlatform !== 'darwin'\n ) {\n console.log(\n 'Unsupported platform, only win32, linux, darwin are supported.'\n )\n return\n }\n\n // List of tasks to run.\n const tasks: Array<{\n title: string\n // If specified, only run this task on the specified platform.\n targetPlatform?: string | undefined\n scripts: PlatformTaskScript\n }> = [\n {\n title: 'Host system information',\n scripts: {\n default: async () => {\n // Node.js diagnostic report contains basic information, i.e OS version, CPU architecture, etc.\n // Only collect few addtional details here.\n const isWsl =\n require('@openuiai/next/dist/compiled/is-wsl') as typeof import('next/dist/compiled/is-wsl')\n const ciInfo =\n require('@openuiai/next/dist/compiled/ci-info') as typeof import('next/dist/compiled/ci-info')\n const isDocker =\n require('@openuiai/next/dist/compiled/is-docker') as typeof import('next/dist/compiled/is-docker')\n\n const output = `\n WSL: ${isWsl}\n Docker: ${isDocker()}\n CI: ${ciInfo.isCI ? ciInfo.name || 'unknown' : 'false'}\n`\n\n return {\n output,\n result: 'pass',\n }\n },\n },\n },\n {\n title: 'Next.js installation',\n scripts: {\n default: async () => {\n const installedRelease = getPackageVersion('next')\n const nextConfig = await getNextConfig()\n const output = `\n Binaries:\n Node: ${process.versions.node}\n npm: ${getBinaryVersion('npm')}\n Yarn: ${getBinaryVersion('yarn')}\n pnpm: ${getBinaryVersion('pnpm')}\n Relevant Packages:\n next: ${installedRelease}\n eslint-config-next: ${getPackageVersion('eslint-config-next')}\n react: ${getPackageVersion('react')}\n react-dom: ${getPackageVersion('react-dom')}\n typescript: ${getPackageVersion('typescript')}\n Next.js Config:\n output: ${nextConfig.output}\n\n`\n return {\n output,\n result: 'pass',\n }\n },\n },\n },\n {\n title: 'Node.js diagnostic report',\n scripts: {\n default: async () => {\n const report = process.report?.getReport()\n\n if (!report) {\n return {\n messages: 'Node.js diagnostic report is not available.',\n result: 'fail',\n }\n }\n\n const { header, javascriptHeap, sharedObjects } =\n report as any as Record<string, any>\n // Delete some fields potentially containing sensitive information.\n delete header?.cwd\n delete header?.commandLine\n delete header?.host\n delete header?.cpus\n delete header?.networkInterfaces\n\n const reportSummary = {\n header,\n javascriptHeap,\n sharedObjects,\n }\n\n return {\n output: JSON.stringify(reportSummary, null, 2),\n result: 'pass',\n }\n },\n },\n },\n {\n title: 'next-swc installation',\n scripts: {\n default: async () => {\n const output = [] as any\n\n // First, try to load next-swc via loadBindings.\n try {\n let nextConfig = await getNextConfig()\n const { loadBindings } =\n require('../build/swc') as typeof import('../build/swc')\n const bindings = await loadBindings(\n nextConfig.experimental?.useWasmBinary\n )\n // Run arbitrary function to verify the bindings are loaded correctly.\n const target = bindings.getTargetTriple()\n\n // We think next-swc is installed correctly if getTargetTriple returns.\n return {\n output: `next-swc is installed correctly for ${target}`,\n result: 'pass',\n }\n } catch (e) {\n output.push(`loadBindings() failed: ${(e as Error).message}`)\n }\n\n const { platformArchTriples } =\n require('@openuiai/next/dist/compiled/@napi-rs/triples') as typeof import('next/dist/compiled/@napi-rs/triples')\n const triples = platformArchTriples[currentPlatform]?.[os.arch()]\n\n if (!triples || triples.length === 0) {\n return {\n messages: `No target triples found for ${currentPlatform} / ${os.arch()}`,\n result: 'fail',\n }\n }\n\n // Trying to manually resolve corresponding target triples to see if bindings are physically located.\n const path = require('path') as typeof import('path')\n let fallbackBindingsDirectory\n try {\n const nextPath = path.dirname(require.resolve('next/package.json'))\n fallbackBindingsDirectory = path.join(nextPath, 'next-swc-fallback')\n } catch (e) {\n // Not able to locate next package from current running location, skipping fallback bindings check.\n }\n\n const tryResolve = (pkgName: string) => {\n try {\n const resolved = require.resolve(pkgName)\n const fileExists = fs.existsSync(resolved)\n let loadError\n let loadSuccess\n\n try {\n loadSuccess = !!require(resolved).getTargetTriple()\n } catch (e) {\n loadError = (e as Error).message\n }\n\n output.push(\n `${pkgName} exists: ${fileExists} for the triple ${loadSuccess}`\n )\n if (loadError) {\n output.push(`${pkgName} load failed: ${loadError ?? 'unknown'}`)\n }\n\n if (loadSuccess) {\n return true\n }\n } catch (e) {\n output.push(\n `${pkgName} resolve failed: ${\n (e as Error).message ?? 'unknown'\n }`\n )\n }\n return false\n }\n\n for (const triple of triples) {\n const triplePkgName = `@next/swc-${triple.platformArchABI}`\n // Check installed optional dependencies. This is the normal way package being installed.\n // For the targets have multiple triples (gnu / musl), if any of them loads successfully, we consider as installed.\n if (tryResolve(triplePkgName)) {\n break\n }\n\n // Check if fallback binaries are installed.\n if (!fallbackBindingsDirectory) {\n continue\n }\n\n tryResolve(path.join(fallbackBindingsDirectory, triplePkgName))\n }\n\n return {\n output: output.join('\\n'),\n result: 'pass',\n }\n },\n },\n },\n {\n // For the simplicity, we only check the correctly installed optional dependencies -\n // as this is mainly for checking DLOPEN failure. If user hit MODULE_NOT_FOUND,\n // expect above next-swc installation would give some hint instead.\n title: 'next-swc shared object dependencies',\n scripts: {\n linux: async () => {\n const skipMessage =\n 'This diagnostics uses system-installed tools (ldd) to check next-swc dependencies, but it is not found. Skipping dependencies check.'\n\n return await runSharedDependencyCheck(\n [\n {\n bin: 'ldd',\n checkArgs: ['--help'],\n args: ['--verbose'],\n },\n ],\n skipMessage\n )\n },\n win32: async () => {\n const skipMessage = `This diagnostics uses system-installed tools (dumpbin.exe) to check next-swc dependencies, but it was not found in the path. Skipping dependencies check.\n dumpbin (https://learn.microsoft.com/en-us/cpp/build/reference/dumpbin-reference) is a part of Microsoft VC toolset,\n can be installed with Windows SDK, Windows Build tools or Visual Studio.\n\n Please make sure you have one of them installed and dumpbin.exe is in the path.\n `\n\n return await runSharedDependencyCheck(\n [\n {\n bin: 'dumpbin.exe',\n checkArgs: ['/summary'],\n args: ['/imports'],\n },\n ],\n skipMessage\n )\n },\n darwin: async () => {\n const skipMessage =\n 'This diagnostics uses system-installed tools (otools, dyld_info) to check next-swc dependencies, but none of them are found. Skipping dependencies check.'\n\n return await runSharedDependencyCheck(\n [\n {\n bin: 'otool',\n checkArgs: ['--version'],\n args: ['-L'],\n },\n {\n bin: 'dyld_info',\n checkArgs: [],\n args: [],\n },\n ],\n skipMessage\n )\n },\n },\n },\n ]\n\n // Collected output after running all tasks.\n const report: Array<{\n title: string\n result: TaskResult\n }> = []\n\n console.log('\\n')\n for (const task of tasks) {\n if (task.targetPlatform && task.targetPlatform !== currentPlatform) {\n report.push({\n title: task.title,\n result: {\n messages: undefined,\n output: `[SKIPPED (${os.platform()} / ${task.targetPlatform})] ${\n task.title\n }`,\n result: 'skipped',\n },\n })\n continue\n }\n\n const taskScript = task.scripts[currentPlatform] ?? task.scripts.default!\n let taskResult: TaskResult\n try {\n taskResult = await taskScript()\n } catch (e) {\n taskResult = {\n messages: `Unexpected failure while running diagnostics: ${\n (e as Error).message\n }`,\n result: 'fail',\n }\n }\n\n console.log(`- ${task.title}: ${taskResult.result}`)\n if (taskResult.messages) {\n console.log(` ${taskResult.messages}`)\n }\n\n report.push({\n title: task.title,\n result: taskResult,\n })\n }\n\n console.log(`\\n${bold('Generated diagnostics report')}`)\n\n console.log(`\\nPlease copy below report and paste it into your issue.`)\n for (const { title, result } of report) {\n console.log(`\\n### ${title}`)\n\n if (result.messages) {\n console.log(result.messages)\n }\n\n if (result.output) {\n console.log(result.output)\n }\n }\n}\n\n/**\n * Runs few scripts to collect system information to help with debugging next.js installation issues.\n * There are 2 modes, by default it collects basic next.js installation with runtime information. If\n * `--verbose` mode is enabled it'll try to collect, verify more data for next-swc installation and others.\n */\nconst nextInfo = async (options: NextInfoOptions) => {\n if (options.verbose) {\n await printVerboseInfo()\n } else {\n await printInfo()\n }\n}\n\nexport { nextInfo }\n"],"names":["nextInfo","getPackageVersion","packageName","require","version","getNextConfig","config","loadConfig","PHASE_INFO","process","cwd","output","experimental","useWasmBinary","getBinaryVersion","binaryName","execSync","trim","printInfo","installedRelease","nextConfig","stalenessWithTitle","title","versionInfo","registry","getRegistry","res","fetch","tags","json","parseVersionInfo","installed","latest","canary","getStaleness","e","console","warn","yellow","bold","message","cyan","cpuCores","os","cpus","length","relevantPackages","log","platform","arch","Math","ceil","totalmem","versions","node","staleness","startsWith","runSharedDependencyCheck","tools","skipMessage","getSupportedArchTriples","currentPlatform","spawn","triples","availableTools","tool","check","sync","bin","checkArgs","status","push","messages","result","outputs","triple","triplePkgName","platformArchABI","resolved","resolve","proc","args","procPromise","Promise","stdout","on","data","stderr","c","code","join","printVerboseInfo","fs","tasks","scripts","default","isWsl","ciInfo","isDocker","isCI","name","report","getReport","header","javascriptHeap","sharedObjects","commandLine","host","networkInterfaces","reportSummary","JSON","stringify","platformArchTriples","loadBindings","bindings","target","getTargetTriple","path","fallbackBindingsDirectory","nextPath","dirname","tryResolve","pkgName","fileExists","existsSync","loadError","loadSuccess","linux","win32","darwin","task","targetPlatform","undefined","taskScript","taskResult","options","verbose"],"mappings":";;;;;+BAmlBSA;;;eAAAA;;;2DAjlBM;gCACU;4B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
1
|
+
{"version":3,"sources":["../../src/cli/next-info.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport os from 'os'\nimport { execSync } from '../lib/process-adapter'\n\nimport { bold, cyan, yellow } from '../lib/picocolors'\nimport { PHASE_INFO } from '../shared/lib/constants'\nimport loadConfig from '../server/config'\nimport { getRegistry } from '../lib/helpers/get-registry'\nimport { parseVersionInfo } from '../server/dev/parse-version-info'\nimport { getStaleness } from '../next-devtools/shared/version-staleness'\nimport { warn } from '../build/output/log'\n\nexport type NextInfoOptions = {\n verbose?: boolean\n}\n\ntype TaskResult = {\n // Additional messages to notify to the users, i.e certain script cannot be run due to missing xyz.\n messages?: string | undefined\n // Output of the script, either fails or success. This'll be printed to stdout or written into a file.\n output?: string | undefined\n result: 'pass' | 'fail' | 'skipped'\n}\n\ntype TaskScript = () => Promise<TaskResult>\n\ntype PlatformTaskScript =\n | {\n win32: TaskScript\n linux?: TaskScript\n darwin?: TaskScript\n default?: TaskScript\n }\n | {\n linux: TaskScript\n win32?: TaskScript\n darwin?: TaskScript\n default?: TaskScript\n }\n | {\n darwin: TaskScript\n win32?: TaskScript\n linux?: TaskScript\n default?: TaskScript\n }\n | {\n // A common task script if task does not need to be platform specific.\n default: TaskScript\n win32?: TaskScript\n linux?: TaskScript\n darwin?: TaskScript\n }\n\nfunction getPackageVersion(packageName: string) {\n try {\n return require(`${packageName}/package.json`).version\n } catch {\n return 'N/A'\n }\n}\n\nasync function getNextConfig() {\n const config = await loadConfig(PHASE_INFO, process.cwd())\n\n return {\n output: config.output ?? 'N/A',\n experimental: {\n useWasmBinary: config.experimental?.useWasmBinary,\n },\n }\n}\n\n/**\n * Returns the version of the specified binary, by supplying `--version` argument.\n * N/A if it fails to run the binary.\n */\nfunction getBinaryVersion(binaryName: string) {\n try {\n return execSync(`${binaryName} --version`).trim()\n } catch {\n return 'N/A'\n }\n}\n\n/**\n * Collect basic next.js installation information and print it to stdout.\n */\nasync function printInfo() {\n const installedRelease = getPackageVersion('next')\n const nextConfig = await getNextConfig()\n\n let stalenessWithTitle = ''\n let title = ''\n let versionInfo\n\n try {\n const registry = getRegistry()\n const res = await fetch(`${registry}-/package/next/dist-tags`)\n const tags = await res.json()\n\n versionInfo = parseVersionInfo({\n installed: installedRelease,\n latest: tags.latest,\n canary: tags.canary,\n })\n\n title = getStaleness(versionInfo).title\n\n if (title) {\n stalenessWithTitle = ` // ${title}`\n }\n } catch (e) {\n console.warn(\n `${yellow(\n bold('warn')\n )} - Failed to fetch latest canary version. (Reason: ${\n (e as Error).message\n }.)\n Detected \"${installedRelease}\". Visit https://github.com/vercel/next.js/releases.\n Make sure to try the latest canary version (eg.: \\`npm install next@canary\\`) to confirm the issue still exists before creating a new issue.\n \\nLearn more: ${cyan(\n 'https://nextjs.org/docs/messages/opening-an-issue'\n )}`\n )\n }\n\n const cpuCores = os.cpus().length\n let relevantPackages = ` next: ${installedRelease}${stalenessWithTitle}\n eslint-config-next: ${getPackageVersion('eslint-config-next')}\n react: ${getPackageVersion('react')}\n react-dom: ${getPackageVersion('react-dom')}\n typescript: ${getPackageVersion('typescript')}`\n\n console.log(`\nOperating System:\n Platform: ${os.platform()}\n Arch: ${os.arch()}\n Version: ${os.version()}\n Available memory (MB): ${Math.ceil(os.totalmem() / 1024 / 1024)}\n Available CPU cores: ${cpuCores > 0 ? cpuCores : 'N/A'}\nBinaries:\n Node: ${process.versions.node}\n npm: ${getBinaryVersion('npm')}\n Yarn: ${getBinaryVersion('yarn')}\n pnpm: ${getBinaryVersion('pnpm')}\nRelevant Packages:\n${relevantPackages}\nNext.js Config:\n output: ${nextConfig.output}`)\n\n if (versionInfo?.staleness.startsWith('stale')) {\n warn(`${title}\n Please try the latest canary version (\\`npm install next@canary\\`) to confirm the issue still exists before creating a new issue.\n Read more - https://nextjs.org/docs/messages/opening-an-issue`)\n }\n}\n\n/**\n * Using system-installed tools per each platform, trying to read shared dependencies of next-swc.\n * This is mainly for debugging DLOPEN failure.\n *\n * We don't / can't install these tools by ourselves, will skip the check if we can't find them.\n */\nasync function runSharedDependencyCheck(\n tools: Array<{ bin: string; checkArgs: Array<string>; args: Array<string> }>,\n skipMessage: string\n): Promise<TaskResult> {\n const currentPlatform = os.platform()\n const spawn =\n require('@openuiai/next/dist/compiled/cross-spawn') as typeof import('next/dist/compiled/cross-spawn')\n const { getSupportedArchTriples } =\n require('../build/swc') as typeof import('../build/swc')\n const triples = getSupportedArchTriples()[currentPlatform]?.[os.arch()] ?? []\n // First, check if system have a tool installed. We can't install these by our own.\n\n const availableTools = []\n for (const tool of tools) {\n try {\n const check = spawn.sync(tool.bin, tool.checkArgs)\n if (check.status === 0) {\n availableTools.push(tool)\n }\n } catch {\n // ignore if existence check fails\n }\n }\n\n if (availableTools.length === 0) {\n return {\n messages: skipMessage,\n result: 'skipped',\n }\n }\n\n const outputs: Array<string> = []\n let result: 'pass' | 'fail' = 'fail'\n\n for (const triple of triples) {\n const triplePkgName = `@next/swc-${triple.platformArchABI}`\n let resolved\n try {\n resolved = require.resolve(triplePkgName)\n } catch (e) {\n return {\n messages:\n 'Cannot find next-swc installation, skipping dependencies check',\n result: 'skipped',\n }\n }\n\n for (const tool of availableTools) {\n const proc = spawn(tool.bin, [...tool.args, resolved])\n outputs.push(`Running ${tool.bin} ------------- `)\n // Captures output, doesn't matter if it fails or not since we'll forward both to output.\n const procPromise = new Promise((resolve) => {\n proc.stdout!.on('data', function (data: string) {\n outputs.push(data)\n })\n proc.stderr!.on('data', function (data: string) {\n outputs.push(data)\n })\n proc.on('close', (c: any) => resolve(c))\n })\n\n let code = await procPromise\n if (code === 0) {\n result = 'pass'\n }\n }\n }\n\n return {\n output: outputs.join('\\n'),\n result,\n }\n}\n\n/**\n * Collect additional diagnostics information.\n */\nasync function printVerboseInfo() {\n const fs = require('fs') as typeof import('fs')\n const currentPlatform = os.platform()\n\n if (\n currentPlatform !== 'win32' &&\n currentPlatform !== 'linux' &&\n currentPlatform !== 'darwin'\n ) {\n console.log(\n 'Unsupported platform, only win32, linux, darwin are supported.'\n )\n return\n }\n\n // List of tasks to run.\n const tasks: Array<{\n title: string\n // If specified, only run this task on the specified platform.\n targetPlatform?: string | undefined\n scripts: PlatformTaskScript\n }> = [\n {\n title: 'Host system information',\n scripts: {\n default: async () => {\n // Node.js diagnostic report contains basic information, i.e OS version, CPU architecture, etc.\n // Only collect few addtional details here.\n const isWsl =\n require('@openuiai/next/dist/compiled/is-wsl') as typeof import('next/dist/compiled/is-wsl')\n const ciInfo =\n require('@openuiai/next/dist/compiled/ci-info') as typeof import('next/dist/compiled/ci-info')\n const isDocker =\n require('@openuiai/next/dist/compiled/is-docker') as typeof import('next/dist/compiled/is-docker')\n\n const output = `\n WSL: ${isWsl}\n Docker: ${isDocker()}\n CI: ${ciInfo.isCI ? ciInfo.name || 'unknown' : 'false'}\n`\n\n return {\n output,\n result: 'pass',\n }\n },\n },\n },\n {\n title: 'Next.js installation',\n scripts: {\n default: async () => {\n const installedRelease = getPackageVersion('next')\n const nextConfig = await getNextConfig()\n const output = `\n Binaries:\n Node: ${process.versions.node}\n npm: ${getBinaryVersion('npm')}\n Yarn: ${getBinaryVersion('yarn')}\n pnpm: ${getBinaryVersion('pnpm')}\n Relevant Packages:\n next: ${installedRelease}\n eslint-config-next: ${getPackageVersion('eslint-config-next')}\n react: ${getPackageVersion('react')}\n react-dom: ${getPackageVersion('react-dom')}\n typescript: ${getPackageVersion('typescript')}\n Next.js Config:\n output: ${nextConfig.output}\n\n`\n return {\n output,\n result: 'pass',\n }\n },\n },\n },\n {\n title: 'Node.js diagnostic report',\n scripts: {\n default: async () => {\n const report = process.report?.getReport()\n\n if (!report) {\n return {\n messages: 'Node.js diagnostic report is not available.',\n result: 'fail',\n }\n }\n\n const { header, javascriptHeap, sharedObjects } =\n report as any as Record<string, any>\n // Delete some fields potentially containing sensitive information.\n delete header?.cwd\n delete header?.commandLine\n delete header?.host\n delete header?.cpus\n delete header?.networkInterfaces\n\n const reportSummary = {\n header,\n javascriptHeap,\n sharedObjects,\n }\n\n return {\n output: JSON.stringify(reportSummary, null, 2),\n result: 'pass',\n }\n },\n },\n },\n {\n title: 'next-swc installation',\n scripts: {\n default: async () => {\n const output = [] as any\n\n // First, try to load next-swc via loadBindings.\n try {\n let nextConfig = await getNextConfig()\n const { loadBindings } =\n require('../build/swc') as typeof import('../build/swc')\n const bindings = await loadBindings(\n nextConfig.experimental?.useWasmBinary\n )\n // Run arbitrary function to verify the bindings are loaded correctly.\n const target = bindings.getTargetTriple()\n\n // We think next-swc is installed correctly if getTargetTriple returns.\n return {\n output: `next-swc is installed correctly for ${target}`,\n result: 'pass',\n }\n } catch (e) {\n output.push(`loadBindings() failed: ${(e as Error).message}`)\n }\n\n const { platformArchTriples } =\n require('@openuiai/next/dist/compiled/@napi-rs/triples') as typeof import('next/dist/compiled/@napi-rs/triples')\n const triples = platformArchTriples[currentPlatform]?.[os.arch()]\n\n if (!triples || triples.length === 0) {\n return {\n messages: `No target triples found for ${currentPlatform} / ${os.arch()}`,\n result: 'fail',\n }\n }\n\n // Trying to manually resolve corresponding target triples to see if bindings are physically located.\n const path = require('path') as typeof import('path')\n let fallbackBindingsDirectory\n try {\n const nextPath = path.dirname(require.resolve('@openuiai/next/package.json'))\n fallbackBindingsDirectory = path.join(nextPath, 'next-swc-fallback')\n } catch (e) {\n // Not able to locate next package from current running location, skipping fallback bindings check.\n }\n\n const tryResolve = (pkgName: string) => {\n try {\n const resolved = require.resolve(pkgName)\n const fileExists = fs.existsSync(resolved)\n let loadError\n let loadSuccess\n\n try {\n loadSuccess = !!require(resolved).getTargetTriple()\n } catch (e) {\n loadError = (e as Error).message\n }\n\n output.push(\n `${pkgName} exists: ${fileExists} for the triple ${loadSuccess}`\n )\n if (loadError) {\n output.push(`${pkgName} load failed: ${loadError ?? 'unknown'}`)\n }\n\n if (loadSuccess) {\n return true\n }\n } catch (e) {\n output.push(\n `${pkgName} resolve failed: ${\n (e as Error).message ?? 'unknown'\n }`\n )\n }\n return false\n }\n\n for (const triple of triples) {\n const triplePkgName = `@next/swc-${triple.platformArchABI}`\n // Check installed optional dependencies. This is the normal way package being installed.\n // For the targets have multiple triples (gnu / musl), if any of them loads successfully, we consider as installed.\n if (tryResolve(triplePkgName)) {\n break\n }\n\n // Check if fallback binaries are installed.\n if (!fallbackBindingsDirectory) {\n continue\n }\n\n tryResolve(path.join(fallbackBindingsDirectory, triplePkgName))\n }\n\n return {\n output: output.join('\\n'),\n result: 'pass',\n }\n },\n },\n },\n {\n // For the simplicity, we only check the correctly installed optional dependencies -\n // as this is mainly for checking DLOPEN failure. If user hit MODULE_NOT_FOUND,\n // expect above next-swc installation would give some hint instead.\n title: 'next-swc shared object dependencies',\n scripts: {\n linux: async () => {\n const skipMessage =\n 'This diagnostics uses system-installed tools (ldd) to check next-swc dependencies, but it is not found. Skipping dependencies check.'\n\n return await runSharedDependencyCheck(\n [\n {\n bin: 'ldd',\n checkArgs: ['--help'],\n args: ['--verbose'],\n },\n ],\n skipMessage\n )\n },\n win32: async () => {\n const skipMessage = `This diagnostics uses system-installed tools (dumpbin.exe) to check next-swc dependencies, but it was not found in the path. Skipping dependencies check.\n dumpbin (https://learn.microsoft.com/en-us/cpp/build/reference/dumpbin-reference) is a part of Microsoft VC toolset,\n can be installed with Windows SDK, Windows Build tools or Visual Studio.\n\n Please make sure you have one of them installed and dumpbin.exe is in the path.\n `\n\n return await runSharedDependencyCheck(\n [\n {\n bin: 'dumpbin.exe',\n checkArgs: ['/summary'],\n args: ['/imports'],\n },\n ],\n skipMessage\n )\n },\n darwin: async () => {\n const skipMessage =\n 'This diagnostics uses system-installed tools (otools, dyld_info) to check next-swc dependencies, but none of them are found. Skipping dependencies check.'\n\n return await runSharedDependencyCheck(\n [\n {\n bin: 'otool',\n checkArgs: ['--version'],\n args: ['-L'],\n },\n {\n bin: 'dyld_info',\n checkArgs: [],\n args: [],\n },\n ],\n skipMessage\n )\n },\n },\n },\n ]\n\n // Collected output after running all tasks.\n const report: Array<{\n title: string\n result: TaskResult\n }> = []\n\n console.log('\\n')\n for (const task of tasks) {\n if (task.targetPlatform && task.targetPlatform !== currentPlatform) {\n report.push({\n title: task.title,\n result: {\n messages: undefined,\n output: `[SKIPPED (${os.platform()} / ${task.targetPlatform})] ${\n task.title\n }`,\n result: 'skipped',\n },\n })\n continue\n }\n\n const taskScript = task.scripts[currentPlatform] ?? task.scripts.default!\n let taskResult: TaskResult\n try {\n taskResult = await taskScript()\n } catch (e) {\n taskResult = {\n messages: `Unexpected failure while running diagnostics: ${\n (e as Error).message\n }`,\n result: 'fail',\n }\n }\n\n console.log(`- ${task.title}: ${taskResult.result}`)\n if (taskResult.messages) {\n console.log(` ${taskResult.messages}`)\n }\n\n report.push({\n title: task.title,\n result: taskResult,\n })\n }\n\n console.log(`\\n${bold('Generated diagnostics report')}`)\n\n console.log(`\\nPlease copy below report and paste it into your issue.`)\n for (const { title, result } of report) {\n console.log(`\\n### ${title}`)\n\n if (result.messages) {\n console.log(result.messages)\n }\n\n if (result.output) {\n console.log(result.output)\n }\n }\n}\n\n/**\n * Runs few scripts to collect system information to help with debugging next.js installation issues.\n * There are 2 modes, by default it collects basic next.js installation with runtime information. If\n * `--verbose` mode is enabled it'll try to collect, verify more data for next-swc installation and others.\n */\nconst nextInfo = async (options: NextInfoOptions) => {\n if (options.verbose) {\n await printVerboseInfo()\n } else {\n await printInfo()\n }\n}\n\nexport { nextInfo }\n"],"names":["nextInfo","getPackageVersion","packageName","require","version","getNextConfig","config","loadConfig","PHASE_INFO","process","cwd","output","experimental","useWasmBinary","getBinaryVersion","binaryName","execSync","trim","printInfo","installedRelease","nextConfig","stalenessWithTitle","title","versionInfo","registry","getRegistry","res","fetch","tags","json","parseVersionInfo","installed","latest","canary","getStaleness","e","console","warn","yellow","bold","message","cyan","cpuCores","os","cpus","length","relevantPackages","log","platform","arch","Math","ceil","totalmem","versions","node","staleness","startsWith","runSharedDependencyCheck","tools","skipMessage","getSupportedArchTriples","currentPlatform","spawn","triples","availableTools","tool","check","sync","bin","checkArgs","status","push","messages","result","outputs","triple","triplePkgName","platformArchABI","resolved","resolve","proc","args","procPromise","Promise","stdout","on","data","stderr","c","code","join","printVerboseInfo","fs","tasks","scripts","default","isWsl","ciInfo","isDocker","isCI","name","report","getReport","header","javascriptHeap","sharedObjects","commandLine","host","networkInterfaces","reportSummary","JSON","stringify","platformArchTriples","loadBindings","bindings","target","getTargetTriple","path","fallbackBindingsDirectory","nextPath","dirname","tryResolve","pkgName","fileExists","existsSync","loadError","loadSuccess","linux","win32","darwin","task","targetPlatform","undefined","taskScript","taskResult","options","verbose"],"mappings":";;;;;+BAmlBSA;;;eAAAA;;;2DAjlBM;gCACU;4BAEU;2BACR;+DACJ;6BACK;kCACK;kCACJ;qBACR;;;;;;AA2CrB,SAASC,kBAAkBC,WAAmB;IAC5C,IAAI;QACF,OAAOC,QAAQ,GAAGD,YAAY,aAAa,CAAC,EAAEE,OAAO;IACvD,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA,eAAeC;QAMMC;IALnB,MAAMA,SAAS,MAAMC,IAAAA,eAAU,EAACC,qBAAU,EAAEC,QAAQC,GAAG;IAEvD,OAAO;QACLC,QAAQL,OAAOK,MAAM,IAAI;QACzBC,cAAc;YACZC,aAAa,GAAEP,uBAAAA,OAAOM,YAAY,qBAAnBN,qBAAqBO,aAAa;QACnD;IACF;AACF;AAEA;;;CAGC,GACD,SAASC,iBAAiBC,UAAkB;IAC1C,IAAI;QACF,OAAOC,IAAAA,wBAAQ,EAAC,GAAGD,WAAW,UAAU,CAAC,EAAEE,IAAI;IACjD,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA;;CAEC,GACD,eAAeC;IACb,MAAMC,mBAAmBlB,kBAAkB;IAC3C,MAAMmB,aAAa,MAAMf;IAEzB,IAAIgB,qBAAqB;IACzB,IAAIC,QAAQ;IACZ,IAAIC;IAEJ,IAAI;QACF,MAAMC,WAAWC,IAAAA,wBAAW;QAC5B,MAAMC,MAAM,MAAMC,MAAM,GAAGH,SAAS,wBAAwB,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EAAE,IAAI4B,OAAQ;QACtCjE,QAAQW,GAAG,CAAC,CAAC,MAAM,EAAEzB,OAAO;QAE5B,IAAImD,OAAOD,QAAQ,EAAE;YACnBpC,QAAQW,GAAG,CAAC0B,OAAOD,QAAQ;QAC7B;QAEA,IAAIC,OAAO9D,MAAM,EAAE;YACjByB,QAAQW,GAAG,CAAC0B,OAAO9D,MAAM;QAC3B;IACF;AACF;AAEA;;;;CAIC,GACD,MAAMX,WAAW,OAAOuI;IACtB,IAAIA,QAAQC,OAAO,EAAE;QACnB,MAAM7C;IACR,OAAO;QACL,MAAMzE;IACR;AACF","ignoreList":[0]}
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "appBootstrap", {
|
|
|
15
15
|
});
|
|
16
16
|
const _assetprefix = require("./asset-prefix");
|
|
17
17
|
const _setattributesfromprops = require("./set-attributes-from-props");
|
|
18
|
-
const version = "15.6.0-bun.
|
|
18
|
+
const version = "15.6.0-bun.4";
|
|
19
19
|
window.next = {
|
|
20
20
|
version,
|
|
21
21
|
appDir: true
|
package/dist/client/index.js
CHANGED
|
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
|
|
|
61
61
|
const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
|
|
62
62
|
const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
|
|
63
63
|
const _isnextroutererror = require("./components/is-next-router-error");
|
|
64
|
-
const version = "15.6.0-bun.
|
|
64
|
+
const version = "15.6.0-bun.4";
|
|
65
65
|
let router;
|
|
66
66
|
const emitter = (0, _mitt.default)();
|
|
67
67
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -35,9 +35,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.getFallbackFontOverrideMetrics = getFallbackFontOverrideMetrics;
|
|
37
37
|
// @ts-ignore
|
|
38
|
-
const font_utils_1 = require("next/dist/server/font-utils");
|
|
38
|
+
const font_utils_1 = require("@openuiai/next/dist/server/font-utils");
|
|
39
39
|
// @ts-ignore
|
|
40
|
-
const Log = __importStar(require("next/dist/build/output/log"));
|
|
40
|
+
const Log = __importStar(require("@openuiai/next/dist/build/output/log"));
|
|
41
41
|
/**
|
|
42
42
|
* Get precalculated fallback font metrics for the Google Fonts family.
|
|
43
43
|
*
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getProxyAgent = getProxyAgent;
|
|
7
7
|
// @ts-ignore
|
|
8
|
-
const https_proxy_agent_1 = __importDefault(require("next/dist/compiled/https-proxy-agent"));
|
|
8
|
+
const https_proxy_agent_1 = __importDefault(require("@openuiai/next/dist/compiled/https-proxy-agent"));
|
|
9
9
|
// @ts-ignore
|
|
10
|
-
const http_proxy_agent_1 = __importDefault(require("next/dist/compiled/http-proxy-agent"));
|
|
10
|
+
const http_proxy_agent_1 = __importDefault(require("@openuiai/next/dist/compiled/http-proxy-agent"));
|
|
11
11
|
/**
|
|
12
12
|
* If the http(s)_proxy environment variables is set, return a proxy agent.
|
|
13
13
|
*/
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
// @ts-ignore
|
|
37
|
-
const Log = __importStar(require("next/dist/build/output/log"));
|
|
37
|
+
const Log = __importStar(require("@openuiai/next/dist/build/output/log"));
|
|
38
38
|
const validate_google_font_function_call_1 = require("./validate-google-font-function-call");
|
|
39
39
|
const get_font_axes_1 = require("./get-font-axes");
|
|
40
40
|
const get_google_fonts_url_1 = require("./get-google-fonts-url");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.retry = retry;
|
|
7
7
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
8
8
|
// @ts-expect-error File exists
|
|
9
|
-
const async_retry_1 = __importDefault(require("next/dist/compiled/async-retry"));
|
|
9
|
+
const async_retry_1 = __importDefault(require("@openuiai/next/dist/compiled/async-retry"));
|
|
10
10
|
async function retry(fn, retries) {
|
|
11
11
|
return await (0, async_retry_1.default)(fn, {
|
|
12
12
|
retries,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Validate next version
|
|
2
|
-
const semver = require('next/dist/compiled/semver')
|
|
3
|
-
if (semver.lt(require('next/package.json').version, '13.0.0')) {
|
|
2
|
+
const semver = require('@openuiai/next/dist/compiled/semver')
|
|
3
|
+
if (semver.lt(require('@openuiai/next/package.json').version, '13.0.0')) {
|
|
4
4
|
throw new Error('`@next/font` is only available in Next.js 13 and newer.')
|
|
5
5
|
}
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Validate next version
|
|
2
|
-
const semver = require('next/dist/compiled/semver')
|
|
3
|
-
if (semver.lt(require('next/package.json').version, '13.0.0')) {
|
|
2
|
+
const semver = require('@openuiai/next/dist/compiled/semver')
|
|
3
|
+
if (semver.lt(require('@openuiai/next/package.json').version, '13.0.0')) {
|
|
4
4
|
throw new Error('`@next/font` is only available in Next.js 13 and newer.')
|
|
5
5
|
}
|
|
6
6
|
|
package/dist/esm/build/index.js
CHANGED
|
@@ -301,7 +301,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
301
301
|
const nextBuildSpan = trace('next-build', undefined, {
|
|
302
302
|
buildMode: experimentalBuildMode,
|
|
303
303
|
isTurboBuild: String(isTurbopack),
|
|
304
|
-
version: "15.6.0-bun.
|
|
304
|
+
version: "15.6.0-bun.4"
|
|
305
305
|
});
|
|
306
306
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
|
307
307
|
NextBuildContext.dir = dir;
|
|
@@ -780,7 +780,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
780
780
|
// Files outside of the distDir can be "type": "module"
|
|
781
781
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
|
782
782
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
|
783
|
-
await recordFrameworkVersion("15.6.0-bun.
|
|
783
|
+
await recordFrameworkVersion("15.6.0-bun.4");
|
|
784
784
|
await updateBuildDiagnostics({
|
|
785
785
|
buildStage: 'start'
|
|
786
786
|
});
|
|
@@ -2425,7 +2425,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
|
2425
2425
|
distDir,
|
|
2426
2426
|
config,
|
|
2427
2427
|
staticPages,
|
|
2428
|
-
nextVersion: "15.6.0-bun.
|
|
2428
|
+
nextVersion: "15.6.0-bun.4",
|
|
2429
2429
|
tracingRoot: outputFileTracingRoot,
|
|
2430
2430
|
hasNodeMiddleware,
|
|
2431
2431
|
hasInstrumentationHook,
|
|
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
|
|
|
11
11
|
import { getDefineEnv } from '../define-env';
|
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
|
13
13
|
import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
|
|
14
|
-
const nextVersion = "15.6.0-bun.
|
|
14
|
+
const nextVersion = "15.6.0-bun.4";
|
|
15
15
|
const ArchName = arch();
|
|
16
16
|
const PlatformName = platform();
|
|
17
17
|
function infoLog(...args) {
|
|
@@ -191,7 +191,7 @@ export const lockfilePatchPromise = {};
|
|
|
191
191
|
return pendingBindings;
|
|
192
192
|
}
|
|
193
193
|
async function tryLoadNativeWithFallback(attempts) {
|
|
194
|
-
const nativeBindingsDirectory = path.join(path.dirname(require.resolve('next/package.json')), 'next-swc-fallback');
|
|
194
|
+
const nativeBindingsDirectory = path.join(path.dirname(require.resolve('@openuiai/next/package.json')), 'next-swc-fallback');
|
|
195
195
|
if (!downloadNativeBindingsPromise) {
|
|
196
196
|
downloadNativeBindingsPromise = downloadNativeNextSwc(nextVersion, nativeBindingsDirectory, triples.map((triple)=>triple.platformArchABI));
|
|
197
197
|
}
|
|
@@ -221,7 +221,7 @@ async function tryLoadWasmWithFallback(attempts) {
|
|
|
221
221
|
// we download to a custom directory instead of to node_modules
|
|
222
222
|
// as node_module import attempts are cached and can't be re-attempted
|
|
223
223
|
// x-ref: https://github.com/nodejs/modules/issues/307
|
|
224
|
-
const wasmDirectory = path.join(path.dirname(require.resolve('next/package.json')), 'wasm');
|
|
224
|
+
const wasmDirectory = path.join(path.dirname(require.resolve('@openuiai/next/package.json')), 'wasm');
|
|
225
225
|
if (!downloadWasmPromise) {
|
|
226
226
|
downloadWasmPromise = downloadWasmSwc(nextVersion, wasmDirectory);
|
|
227
227
|
}
|