From 3e7deffb1c2b1e583a6c6917bd52b5443c17e388 Mon Sep 17 00:00:00 2001 From: Rob Stanford Date: Wed, 23 Oct 2024 13:27:21 +0100 Subject: [PATCH 1/2] feat: rename next.js adapter package --- src/utils/init/utils.ts | 2 +- tests/integration/commands/init/init.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/init/utils.ts b/src/utils/init/utils.ts index ecbe67a5671..6f519f61d22 100644 --- a/src/utils/init/utils.ts +++ b/src/utils/init/utils.ts @@ -34,7 +34,7 @@ export const getPluginsToAutoInstall = ( pluginsInstalled: string[] = [], pluginsRecommended: string[] = [], ) => { - const nextRuntime = '@netlify/plugin-nextjs' + const nextRuntime = '@opennextjs/netlify' const pluginsToAlwaysInstall = new Set([nextRuntime]) return pluginsRecommended.reduce( (acc, plugin) => diff --git a/tests/integration/commands/init/init.test.js b/tests/integration/commands/init/init.test.js index 4e7f76b9d23..0eb50c5a213 100644 --- a/tests/integration/commands/init/init.test.js +++ b/tests/integration/commands/init/init.test.js @@ -274,7 +274,7 @@ describe.concurrent('commands/init', () => { method: 'patch', response: { deploy_hook: 'deploy_hook' }, requestBody: { - plugins: [{ package: '@netlify/plugin-nextjs' }], + plugins: [{ package: '@opennextjs/netlify' }], repo: { allowed_branches: ['main'], cmd: command, @@ -377,7 +377,7 @@ describe.concurrent('commands/init', () => { method: 'patch', response: { deploy_hook: 'deploy_hook' }, requestBody: { - plugins: [{ package: '@netlify/plugin-nextjs' }], + plugins: [{ package: '@opennextjs/netlify' }], repo: { allowed_branches: ['main'], cmd: command, @@ -466,7 +466,7 @@ describe.concurrent('commands/init', () => { method: 'patch', response: { deploy_hook: 'deploy_hook' }, requestBody: { - plugins: [{ package: '@netlify/plugin-lighthouse' }, { package: '@netlify/plugin-nextjs' }], + plugins: [{ package: '@netlify/plugin-lighthouse' }, { package: '@opennextjs/netlify' }], repo: { allowed_branches: ['main'], cmd: command, From 00893cfc96292dd0f1abab5a971773f29e12d0e4 Mon Sep 17 00:00:00 2001 From: Philippe Serhal Date: Wed, 23 Oct 2024 10:34:01 -0400 Subject: [PATCH 2/2] fix: remove "runtime" wording in log message We're not calling it a "runtime" anymore. Plus this was super leaky anyway, assuming that any auto-installed build plugin is a "runtime". --- src/utils/init/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/init/utils.ts b/src/utils/init/utils.ts index 6f519f61d22..53fee9941e5 100644 --- a/src/utils/init/utils.ts +++ b/src/utils/init/utils.ts @@ -30,7 +30,7 @@ const formatTitle = (title: string) => chalk.cyan(title) * @returns */ export const getPluginsToAutoInstall = ( - command: BaseCommand, + _command: BaseCommand, pluginsInstalled: string[] = [], pluginsRecommended: string[] = [], ) => { @@ -100,10 +100,10 @@ export const getBuildSettings = async ({ command, config }: { command: BaseComma // eslint-disable-next-line unicorn/explicit-length-check const setting: Partial = settings.length > 0 ? settings[0] : {} const { defaultBaseDir, defaultBuildCmd, defaultBuildDir, defaultFunctionsDir, recommendedPlugins } = - await normalizeSettings(setting, config, command) + normalizeSettings(setting, config, command) if (recommendedPlugins.length !== 0 && setting.framework?.name) { - log(`Configuring ${formatTitle(setting.framework.name)} runtime...`) + log(`Configuring ${formatTitle(setting.framework.name)}...`) log() }