Skip to content

Commit 49aa860

Browse files
committed
address comments
1 parent 9643aba commit 49aa860

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

packages/@apphosting/adapter-nextjs/src/bin/build.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("build commands", () => {
2020
});
2121

2222
it("expects all output bundle files to be generated", async () => {
23-
const { generateOutputBundle } = await importUtils;
23+
const { generateOutputDirectory } = await importUtils;
2424
const files = {
2525
".next/standalone/standalonefile": "",
2626
".next/static/staticfile": "",
@@ -31,7 +31,7 @@ describe("build commands", () => {
3131
}`,
3232
};
3333
generateTestFiles(tmpDir, files);
34-
await generateOutputBundle(tmpDir, outputBundleOptions, path.join(tmpDir, ".next"));
34+
await generateOutputDirectory(tmpDir, outputBundleOptions, path.join(tmpDir, ".next"));
3535

3636
const expectedFiles = {
3737
".apphosting/.next/static/staticfile": "",
@@ -50,7 +50,7 @@ staticAssets:
5050
});
5151

5252
it("expects public directory to be copied over", async () => {
53-
const { generateOutputBundle } = await importUtils;
53+
const { generateOutputDirectory } = await importUtils;
5454
const files = {
5555
".next/standalone/standalonefile": "",
5656
".next/static/staticfile": "",
@@ -62,7 +62,7 @@ staticAssets:
6262
}`,
6363
};
6464
generateTestFiles(tmpDir, files);
65-
await generateOutputBundle(tmpDir, outputBundleOptions, path.join(tmpDir, ".next"));
65+
await generateOutputDirectory(tmpDir, outputBundleOptions, path.join(tmpDir, ".next"));
6666

6767
const expectedFiles = {
6868
".apphosting/.next/static/staticfile": "",
@@ -82,7 +82,7 @@ staticAssets:
8282
});
8383

8484
it("expects bundle.yaml headers/rewrites/redirects to be generated", async () => {
85-
const { generateOutputBundle } = await importUtils;
85+
const { generateOutputDirectory } = await importUtils;
8686
const files = {
8787
".next/standalone/standalonefile": "",
8888
".next/static/staticfile": "",
@@ -93,7 +93,7 @@ staticAssets:
9393
}`,
9494
};
9595
generateTestFiles(tmpDir, files);
96-
await generateOutputBundle(tmpDir, outputBundleOptions, path.join(tmpDir, ".next"));
96+
await generateOutputDirectory(tmpDir, outputBundleOptions, path.join(tmpDir, ".next"));
9797

9898
const expectedFiles = {
9999
".apphosting/.next/static/staticfile": "",

packages/@apphosting/adapter-nextjs/src/bin/build.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#! /usr/bin/env node
2-
import { loadConfig, build, populateOutputBundleOptions, generateOutputBundle } from "../utils.js";
2+
import {
3+
loadConfig,
4+
build,
5+
populateOutputBundleOptions,
6+
generateOutputDirectory,
7+
} from "../utils.js";
38

49
import { join } from "path";
510

@@ -11,4 +16,4 @@ const outputBundleOptions = populateOutputBundleOptions(cwd);
1116
const { distDir } = await loadConfig(cwd);
1217
const nextBuildDirectory = join(cwd, distDir);
1318

14-
await generateOutputBundle(cwd, outputBundleOptions, nextBuildDirectory);
19+
await generateOutputDirectory(cwd, outputBundleOptions, nextBuildDirectory);

packages/@apphosting/adapter-nextjs/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function build(cwd: string): void {
5252

5353
// move the standalone directory, the static directory and the public directory to apphosting output directory
5454
// as well as generating bundle.yaml
55-
export async function generateOutputBundle(
55+
export async function generateOutputDirectory(
5656
cwd: string,
5757
outputBundleOptions: OutputBundleOptions,
5858
nextBuildDirectory: string,

0 commit comments

Comments
 (0)