Skip to content

Commit f7a95b0

Browse files
committed
rename function
1 parent ca791c3 commit f7a95b0

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

packages/open-next/src/overrides/incrementalCache/fs-dev.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import fs from "node:fs/promises";
22
import path from "node:path";
33

44
import type { IncrementalCache } from "types/overrides.js";
5-
import { getOutputDir } from "utils/normalize-path";
5+
import { getMonorepoRelativePath } from "utils/normalize-path";
66

77
const buildId = process.env.NEXT_BUILD_ID;
8-
const basePath = path.join(getOutputDir(), `cache/${buildId}`);
8+
const basePath = path.join(getMonorepoRelativePath(), `cache/${buildId}`);
99

1010
const getCacheKey = (key: string) => {
1111
return path.join(basePath, `${key}.cache`);

packages/open-next/src/overrides/tagCache/fs-dev.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import fs from "node:fs";
22
import path from "node:path";
33

44
import type { TagCache } from "types/overrides";
5-
import { getOutputDir } from "utils/normalize-path";
5+
import { getMonorepoRelativePath } from "utils/normalize-path";
66

77
const tagFile = path.join(
8-
getOutputDir(),
8+
getMonorepoRelativePath(),
99
"dynamodb-provider/dynamodb-cache.json",
1010
);
1111
const tagContent = fs.readFileSync(tagFile, "utf-8");

packages/open-next/src/overrides/wrappers/express-dev.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import express from "express";
33

44
import type { StreamCreator } from "types/open-next.js";
55
import type { WrapperHandler } from "types/overrides.js";
6-
import { getOutputDir } from "utils/normalize-path";
6+
import { getMonorepoRelativePath } from "utils/normalize-path";
77

88
const wrapper: WrapperHandler = async (handler, converter) => {
99
const app = express();
1010
// To serve static assets
11-
app.use(express.static(path.join(getOutputDir(), "assets")));
11+
app.use(express.static(path.join(getMonorepoRelativePath(), "assets")));
1212

1313
const imageHandlerPath = path.join(
14-
getOutputDir(),
14+
getMonorepoRelativePath(),
1515
"image-optimization-function/index.mjs",
1616
);
1717

packages/open-next/src/utils/normalize-path.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export function normalizePath(path: string) {
44
return path.replace(/\\/g, "/");
55
}
66

7-
export function getOutputDir() {
7+
export function getMonorepoRelativePath(relativePath = "../../"): string {
88
return path.join(
99
globalThis.monorepoPackagePath
1010
.split("/")
1111
.filter(Boolean)
1212
.map(() => "..")
1313
.join("/"),
14-
"../../",
14+
relativePath,
1515
);
1616
}

0 commit comments

Comments
 (0)