diff --git a/electron/README.md b/electron/README.md index 1b224c7d19..b03e3a919d 100644 --- a/electron/README.md +++ b/electron/README.md @@ -229,7 +229,7 @@ Place your icons in `assets/`: 1. Check if port 20128 is available: `lsof -i :20128` 2. Check console logs for `[Electron]` prefix -3. Verify the build output exists in `.next/standalone` +3. Verify the build output exists in `.build/next/standalone` ### White Screen diff --git a/scripts/build/paths.mjs b/scripts/build/paths.mjs deleted file mode 100644 index 02f87a936f..0000000000 --- a/scripts/build/paths.mjs +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env node - -/** - * Shared build-path constants for OmniRoute build scripts. - * - * All build scripts that need to locate the Next.js distDir or the assembled - * standalone output dir should import from here so that the single source of - * truth (NEXT_DIST_DIR env + the ".build/next" default) is never scattered - * across multiple files. - * - * Layer 1 change: default distDir moved from ".next" to ".build/next". - * Consumers may still override via NEXT_DIST_DIR env var. - */ - -import path from "node:path"; -import { dirname } from "node:path"; -import { fileURLToPath } from "node:url"; - -const __dirname = dirname(fileURLToPath(import.meta.url)); - -/** - * Absolute path to the repository root. - * Derived from this file's location: scripts/build/paths.mjs → ../../ - */ -export const ROOT = path.resolve(__dirname, "..", ".."); - -/** - * Next.js distDir (where `next build` writes its output). - * Defaults to ".build/next"; overridable via NEXT_DIST_DIR env var. - * - * @type {string} - absolute path - */ -export const DIST_DIR = path.resolve(ROOT, process.env.NEXT_DIST_DIR || ".build/next"); - -/** - * Absolute path to the Next.js standalone output directory inside distDir. - * This is the raw output of `next build --output=standalone` before assembly. - * - * @type {string} - absolute path - */ -export const STANDALONE_DIR = path.join(DIST_DIR, "standalone"); diff --git a/scripts/build/prepublish.ts b/scripts/build/prepublish.ts index 7b81c0417a..b999c5c6f5 100644 --- a/scripts/build/prepublish.ts +++ b/scripts/build/prepublish.ts @@ -296,7 +296,7 @@ if (existsSync(docsMarkdownSrc)) { cpSync(join(docsMarkdownSrc, mdFile), join(docsDest, mdFile)); } if (mdFiles.length > 0) { - console.log(`[prepublish] Copied ${mdFiles.length} docs markdown files to app/docs/`); + console.log(`[prepublish] Copied ${mdFiles.length} docs markdown files to dist/docs/`); } } diff --git a/scripts/dev/run-next-playwright.mjs b/scripts/dev/run-next-playwright.mjs index ddaf5a04f4..e4e800f26f 100644 --- a/scripts/dev/run-next-playwright.mjs +++ b/scripts/dev/run-next-playwright.mjs @@ -34,7 +34,9 @@ const standalonePublicDir = join(cwd, testDistDir(), "standalone", "public"); let appDirMoved = false; function testDistDir() { - return process.env.NEXT_DIST_DIR || ".next"; + // Layer 1 moved the Next distDir default to .build/next; the Playwright + // `start` runner must resolve the standalone server under the same dir. + return process.env.NEXT_DIST_DIR || ".build/next"; } function resolvePlaywrightDataDir({ cwd, env, pid = process.pid }) { diff --git a/tests/unit/build-next-isolated.test.ts b/tests/unit/build-next-isolated.test.ts index 89e67156e7..a235f42996 100644 --- a/tests/unit/build-next-isolated.test.ts +++ b/tests/unit/build-next-isolated.test.ts @@ -110,9 +110,11 @@ test("resolveNextBuildEnv forces stable build worker mode unless already provide test("getTransientBuildPaths leaves _tasks in place by default", () => { const paths = getTransientBuildPaths("/repo", {}); + // Layer 1 deleted the root-level `app/` move-out hack, so the only default + // transient path left is the Wine prefix. ("legacy app snapshot" is gone.) assert.deepEqual( paths.map((entry) => entry.label), - ["legacy app snapshot", "local Wine prefix"] + ["local Wine prefix"] ); assert.equal( paths.some((entry) => path.basename(entry.sourcePath) === "_tasks"), @@ -131,13 +133,17 @@ test("getTransientBuildPaths only moves _tasks when explicitly enabled", () => { test("pruneStandaloneArtifacts removes traced _tasks from standalone output", async () => { await withTempDir(async (tempDir) => { - const tracedTaskFile = path.join(tempDir, ".next", "standalone", "_tasks", "plan.md"); + // Layer 1 moved the Next distDir default to .build/next. + const tracedTaskFile = path.join(tempDir, ".build", "next", "standalone", "_tasks", "plan.md"); await fs.mkdir(path.dirname(tracedTaskFile), { recursive: true }); await fs.writeFile(tracedTaskFile, "transient planning artifact"); await pruneStandaloneArtifacts(tempDir); - assert.equal(fsSync.existsSync(path.join(tempDir, ".next", "standalone", "_tasks")), false); + assert.equal( + fsSync.existsSync(path.join(tempDir, ".build", "next", "standalone", "_tasks")), + false + ); }); }); @@ -152,7 +158,8 @@ test("syncStandaloneNativeAssets copies wreq-js native runtime into standalone o ); const destinationNativeFile = path.join( tempDir, - ".next", + ".build", + "next", "standalone", "node_modules", "wreq-js",