Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename next.js adapter package #5896

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/build-info/src/build-systems/nx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('nx-integrated project.json based', () => {
frameworkPort: 4200,
name: `Nx + Next.js ${join('packages/website')}`,
packagePath: join('packages/website'),
plugins_recommended: ['@netlify/plugin-nextjs'],
plugins_recommended: ['@opennextjs/netlify'],
}),
]),
)
Expand Down
8 changes: 4 additions & 4 deletions packages/build-info/src/frameworks/next.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Next.js Plugin', () => {
const project = new Project(fs, cwd).setNodeVersion('v10.13.0')
const frameworks = await project.detectFrameworks()
expect(frameworks?.[0].id).toBe('next')
expect(frameworks?.[0].plugins).toEqual(['@netlify/plugin-nextjs'])
expect(frameworks?.[0].plugins).toEqual(['@opennextjs/netlify'])
})

test('Should not detect Next.js plugin for Next.js if when Node version < 10.13.0', async ({ fs, cwd }) => {
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('simple Next.js project', async () => {
test('Should detect Next.js plugin for Next.js if when Node version >= 10.13.0', async ({ fs, cwd }) => {
const detected = await new Project(fs, cwd).setEnvironment({ NODE_VERSION: '18.x' }).detectFrameworks()
expect(detected?.[0].id).toBe('next')
expect(detected?.[0].plugins).toMatchObject(['@netlify/plugin-nextjs'])
expect(detected?.[0].plugins).toMatchObject(['@opennextjs/netlify'])
})
})

Expand Down Expand Up @@ -134,7 +134,7 @@ describe('Nx monorepo', () => {
devCommand: 'nx run website:serve',
dist: join('dist/packages/website/.next'),
frameworkPort: 4200,
plugins_recommended: ['@netlify/plugin-nextjs'],
plugins_recommended: ['@opennextjs/netlify'],
})
})
})
Expand All @@ -152,7 +152,7 @@ describe('Nx turborepo', () => {
devCommand: 'turbo run dev --filter web',
dist: join('apps/web/.next'),
frameworkPort: 3000,
plugins_recommended: ['@netlify/plugin-nextjs'],
plugins_recommended: ['@opennextjs/netlify'],
})
})
})
2 changes: 1 addition & 1 deletion packages/build-info/src/frameworks/next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Next extends BaseFramework implements Framework {
if (this.detected) {
const nodeVersion = await this.project.getCurrentNodeVersion()
if (nodeVersion && gte(nodeVersion, '10.13.0')) {
this.plugins.push('@netlify/plugin-nextjs')
this.plugins.push('@opennextjs/netlify')
}
return this as DetectedFramework
}
Expand Down
2 changes: 1 addition & 1 deletion packages/build/src/utils/runtime.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const isRuntime = function (pluginOption) {
const { packageName } = pluginOption
// Make this a bit more robust in the future
return ['@netlify/next-runtime', '@netlify/plugin-nextjs'].includes(packageName)
return ['@netlify/next-runtime', '@netlify/plugin-nextjs', '@opennextjs/netlify'].includes(packageName)
}
Loading