Skip to content

Commit

Permalink
rename files to kebab-case
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Sep 16, 2024
1 parent 61db398 commit 3749441
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 16 deletions.
20 changes: 11 additions & 9 deletions builder/src/build/build-worker/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { NextjsAppPaths } from "../../nextjsPaths";
import { NextjsAppPaths } from "../../nextjs-paths";
import { build, Plugin } from "esbuild";
import { readdirSync, readFileSync, writeFileSync } from "node:fs";
import { cp, readFile, writeFile } from "node:fs/promises";

import { patchRequire } from "./patches/investigated/patchRequire";
import { patchUrl } from "./patches/investigated/patchUrl";
import { copyTemplates } from "./patches/investigated/copyTemplates";
import { patchRequire } from "./patches/investigated/patch-require";
import { patchUrl } from "./patches/investigated/patch-url";
import { copyTemplates } from "./patches/investigated/copy-templates";

import { patchReadFile } from "./patches/to-investigate/patchReadFile";
import { patchFindDir } from "./patches/to-investigate/patchFindDir";
import { inlineNextRequire } from "./patches/to-investigate/inlineNextRequire";
import { inlineEvalManifest } from "./patches/to-investigate/inlineEvalManifest";
import { patchWranglerDeps } from "./patches/to-investigate/wranglerDeps";
import { patchReadFile } from "./patches/to-investigate/patch-read-file";
import { patchFindDir } from "./patches/to-investigate/patch-find-dir";
import { inlineNextRequire } from "./patches/to-investigate/inline-next-require";
import { inlineEvalManifest } from "./patches/to-investigate/inline-eval-manifest";
import { patchWranglerDeps } from "./patches/to-investigate/wrangler-deps";

/**
* Using the Next.js build output in the `.next` directory builds a workerd compatible output
Expand Down Expand Up @@ -92,6 +92,8 @@ export async function buildWorker(
globalThis.__dirname ??= "";
// Do not crash on cache not supported
// https://github.com/cloudflare/workerd/pull/2434
// compatibility flag "cache_option_enabled" -> does not support "force-cache"
let isPatchedAlready = globalThis.fetch.__nextPatched;
const curFetch = globalThis.fetch;
globalThis.fetch = (input, init) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "node:path";
import { NextjsAppPaths } from "../../../../nextjsPaths";
import { NextjsAppPaths } from "../../../../nextjs-paths";
import { cpSync } from "node:fs";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { globSync } from "glob";
import { NextjsAppPaths } from "../../../../nextjsPaths";
import { NextjsAppPaths } from "../../../../nextjs-paths";

/**
* `evalManifest` relies on readFileSync so we need to patch the function so that it instead returns the content of the manifest files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { readFileSync, existsSync } from "node:fs";
import { NextjsAppPaths } from "../../../../nextjsPaths";
import { NextjsAppPaths } from "../../../../nextjs-paths";

/**
* The following avoid various Next.js specific files `require`d at runtime since we can just read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NextjsAppPaths } from "../../../../nextjsPaths";
import { NextjsAppPaths } from "../../../../nextjs-paths";
import { existsSync } from "node:fs";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { readFileSync } from "node:fs";
import { globSync } from "glob";
import { NextjsAppPaths } from "../../../../nextjsPaths";
import { NextjsAppPaths } from "../../../../nextjs-paths";

export function patchReadFile(
code: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "node:path";
import fs, { writeFileSync } from "node:fs";
import { NextjsAppPaths } from "../../../../nextjsPaths";
import { NextjsAppPaths } from "../../../../nextjs-paths";

export function patchWranglerDeps(paths: NextjsAppPaths) {
console.log("# patchWranglerDeps");
Expand Down
2 changes: 1 addition & 1 deletion builder/src/build/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { rm } from "node:fs/promises";
import { buildNextjsApp } from "./build-next-app";
import { buildWorker } from "./build-worker";
import { getNextjsAppPaths } from "../nextjsPaths";
import { getNextjsAppPaths } from "../nextjs-paths";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { cpSync, rmSync } from "node:fs";
Expand Down
File renamed without changes.

0 comments on commit 3749441

Please sign in to comment.