Refactor and cleanup to core structure#34
Conversation
…nces for @types/node and typescript, and adjust workspace dependencies.
commit: |
| showWarningOnWindows(); | ||
|
|
||
| const baseDir = process.cwd(); | ||
| const openNextDistDir = url.fileURLToPath(new URL(".", import.meta.url)); |
There was a problem hiding this comment.
🚩 openNextDistDir in AWS build.ts points to the AWS package instead of the core package
In packages/aws/src/build.ts:31, openNextDistDir is computed as url.fileURLToPath(new URL('.', import.meta.url)), which resolves to the @opennextjs/aws dist directory. However, adapter templates, override files, and other build resources now live in @opennextjs/core. By contrast, packages/aws/src/adapter.ts:61 correctly uses path.dirname(require.resolve('@opennextjs/core/debug.js')) to point to the core package. The Cloudflare adapter (packages/cloudflare/src/cli/adapter.ts:62) also uses the correct core resolution.
In practice, this may not cause failures because build.ts only calls buildNextjsApp(options) which simply runs next build via child_process.execSync (packages/core/src/build/buildNextApp.ts:18), and the adapter loaded via NEXT_ADAPTER_PATH creates its own correctly-resolved buildOpts. However, buildHelper.initOutputDir(options) at line 52 is called with the potentially incorrect options before the adapter takes over, and any future code that uses these options in the CLI build path would silently use the wrong base directory.
Was this helpful? React with 👍 or 👎 to provide feedback.
Move core out of aws.
Remove cloudflare examples that were on Next 15
Bump node to 24
Bumpt typescript to 6
Closes #5