this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Vicb (#2)

worker assets

authored by

Pete Bacon Darwin and committed by
GitHub
7d8ce35b b439dfe1

+19 -15
+4 -4
TODO.txt
··· 4 4 5 5 - wrangler alias 6 6 - move the wrangler.toml to the templates 7 - - figure out the assets 8 7 - dependency graph 9 8 10 9 DONE: 11 10 11 + - figure out the assets 12 12 - copy the template folders 13 13 14 14 ## Install: ··· 32 32 33 33 - add "node-url": "npm:url@^0.11.4" to the package.json 34 34 35 - - add a wrangler.tom int the generated app 35 + - add a wrangler.toml int the generated app 36 36 37 37 ``` 38 38 #:schema node_modules/wrangler/config-schema.json ··· 66 66 Build the next app once: 67 67 68 68 ``` 69 - node /path/to/poc-next/builder/dist/index.mjs && wrangler dev 69 + node /path/to/poc-next/builder/dist/index.mjs && npx wrangler dev 70 70 ``` 71 71 72 72 Then you can skip building the next app 73 73 74 74 ``` 75 - SKIP_NEXT_APP_BUILD=1 node /path/to/poc-next/builder/dist/index.mjs && wrangler dev 75 + SKIP_NEXT_APP_BUILD=1 node /path/to/poc-next/builder/dist/index.mjs && npx wrangler dev 76 76 ```
+1 -1
builder/package.json
··· 16 16 "tsup": "^8.2.4", 17 17 "typescript": "^5.5.4" 18 18 } 19 - } 19 + }
+8 -4
builder/src/build/build-worker/index.ts
··· 101 101 updateWebpackChunksFile(nextjsAppPaths); 102 102 103 103 console.log(`\x1b[35m⚙️ Copying asset files...\n\x1b[0m`); 104 - await cp(`${nextjsAppPaths.dotNextDir}/static`, `${outputDir}/assets/_next`, { 105 - recursive: true, 106 - }); 104 + await cp( 105 + `${nextjsAppPaths.dotNextDir}/static`, 106 + `${outputDir}/assets/_next/static`, 107 + { 108 + recursive: true, 109 + } 110 + ); 107 111 108 112 console.log(`\x1b[35mWorker saved in \`${workerOutputFile}\` 🚀\n\x1b[0m`); 109 113 } ··· 187 191 })); 188 192 }, 189 193 }; 190 - }; 194 + }
+1 -1
builder/src/build/build-worker/patches/investigated/patchUrl.ts
··· 5 5 * Hopefully this should not be necessary after this unenv PR lands: https://github.com/unjs/unenv/pull/292 6 6 */ 7 7 export function patchUrl(code: string): string { 8 - console.log("# patchUrl"); 8 + console.log("# patchUrl"); 9 9 return code.replace( 10 10 / ([a-zA-Z0-9_]+) = require\("url"\);/g, 11 11 ` $1 = require("url");
+4 -4
builder/src/build/index.ts
··· 24 24 if (!opts.skipBuild) { 25 25 // Build the next app and save a copy in .save.next 26 26 buildNextjsApp(inputNextAppDir); 27 - rmSync(`${inputNextAppDir}/${SAVE_DIR}`, { 28 - recursive: true, 29 - force: true, 30 - }); 27 + rmSync(`${inputNextAppDir}/${SAVE_DIR}`, { 28 + recursive: true, 29 + force: true, 30 + }); 31 31 cpSync(`${inputNextAppDir}/.next`, `${inputNextAppDir}/${SAVE_DIR}`, { 32 32 recursive: true, 33 33 });
+1 -1
next/api/package.json
··· 24 24 "node-url": "npm:url@^0.11.4", 25 25 "wrangler": "3.76.0" 26 26 } 27 - } 27 + }