diff --git a/TODO.txt b/TODO.txt index 699937e4..9a5e0428 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,11 +4,11 @@ - wrangler alias - move the wrangler.toml to the templates -- figure out the assets - dependency graph DONE: +- figure out the assets - copy the template folders ## Install: @@ -32,7 +32,7 @@ export default nextConfig; - add "node-url": "npm:url@^0.11.4" to the package.json -- add a wrangler.tom int the generated app +- add a wrangler.toml int the generated app ``` #:schema node_modules/wrangler/config-schema.json @@ -66,11 +66,11 @@ pnpm --filter builder build:watch Build the next app once: ``` -node /path/to/poc-next/builder/dist/index.mjs && wrangler dev +node /path/to/poc-next/builder/dist/index.mjs && npx wrangler dev ``` Then you can skip building the next app ``` -SKIP_NEXT_APP_BUILD=1 node /path/to/poc-next/builder/dist/index.mjs && wrangler dev +SKIP_NEXT_APP_BUILD=1 node /path/to/poc-next/builder/dist/index.mjs && npx wrangler dev ``` \ No newline at end of file diff --git a/builder/package.json b/builder/package.json index f9202eb8..107b2cde 100644 --- a/builder/package.json +++ b/builder/package.json @@ -16,4 +16,4 @@ "tsup": "^8.2.4", "typescript": "^5.5.4" } -} \ No newline at end of file +} diff --git a/builder/src/build/build-worker/index.ts b/builder/src/build/build-worker/index.ts index aee4978e..e7668ef6 100644 --- a/builder/src/build/build-worker/index.ts +++ b/builder/src/build/build-worker/index.ts @@ -101,9 +101,13 @@ export async function buildWorker( updateWebpackChunksFile(nextjsAppPaths); console.log(`\x1b[35m⚙️ Copying asset files...\n\x1b[0m`); - await cp(`${nextjsAppPaths.dotNextDir}/static`, `${outputDir}/assets/_next`, { - recursive: true, - }); + await cp( + `${nextjsAppPaths.dotNextDir}/static`, + `${outputDir}/assets/_next/static`, + { + recursive: true, + } + ); console.log(`\x1b[35mWorker saved in \`${workerOutputFile}\` 🚀\n\x1b[0m`); } @@ -187,4 +191,4 @@ function createFixRequiresESBuildPlugin(templateDir: string): Plugin { })); }, }; -}; +} diff --git a/builder/src/build/build-worker/patches/investigated/patchUrl.ts b/builder/src/build/build-worker/patches/investigated/patchUrl.ts index 20ed3b9c..09d86eab 100644 --- a/builder/src/build/build-worker/patches/investigated/patchUrl.ts +++ b/builder/src/build/build-worker/patches/investigated/patchUrl.ts @@ -5,7 +5,7 @@ * Hopefully this should not be necessary after this unenv PR lands: https://github.com/unjs/unenv/pull/292 */ export function patchUrl(code: string): string { - console.log("# patchUrl"); + console.log("# patchUrl"); return code.replace( / ([a-zA-Z0-9_]+) = require\("url"\);/g, ` $1 = require("url"); diff --git a/builder/src/build/index.ts b/builder/src/build/index.ts index bf94d6e9..0f3f2129 100644 --- a/builder/src/build/index.ts +++ b/builder/src/build/index.ts @@ -24,10 +24,10 @@ export async function build( if (!opts.skipBuild) { // Build the next app and save a copy in .save.next buildNextjsApp(inputNextAppDir); - rmSync(`${inputNextAppDir}/${SAVE_DIR}`, { - recursive: true, - force: true, - }); + rmSync(`${inputNextAppDir}/${SAVE_DIR}`, { + recursive: true, + force: true, + }); cpSync(`${inputNextAppDir}/.next`, `${inputNextAppDir}/${SAVE_DIR}`, { recursive: true, }); diff --git a/next/api/package.json b/next/api/package.json index 4371d660..fb847bfe 100644 --- a/next/api/package.json +++ b/next/api/package.json @@ -24,4 +24,4 @@ "node-url": "npm:url@^0.11.4", "wrangler": "3.76.0" } -} \ No newline at end of file +}