Skip to content

Commit

Permalink
fix: correct plugin name in verification output
Browse files Browse the repository at this point in the history
  • Loading branch information
orinokai committed Jul 4, 2024
1 parent 7b13326 commit ed256d4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/build/verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function verifyPublishDir(ctx: PluginContext) {
!satisfies(ctx.nextVersion, SUPPORTED_NEXT_VERSIONS, { includePrerelease: true })
) {
ctx.failBuild(
`@netlify/plugin-next@5 requires Next.js version ${SUPPORTED_NEXT_VERSIONS}, but found ${ctx.nextVersion}. Please upgrade your project's Next.js version.`,
`@netlify/plugin-nextjs@5 requires Next.js version ${SUPPORTED_NEXT_VERSIONS}, but found ${ctx.nextVersion}. Please upgrade your project's Next.js version.`,
)
}
}
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function verifyAdvancedAPIRoutes(ctx: PluginContext) {

if (unsupportedAPIRoutes.length !== 0) {
ctx.failBuild(
`@netlify/plugin-next@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:\n${unsupportedAPIRoutes.map((apiRouteConfig) => ` - ${apiRouteConfig.apiRoute} (type: "${apiRouteConfig.config.type}")`).join('\n')}\n\nRefer to https://ntl.fyi/next-scheduled-bg-function-migration as migration example.`,
`@netlify/plugin-nextjs@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:\n${unsupportedAPIRoutes.map((apiRouteConfig) => ` - ${apiRouteConfig.apiRoute} (type: "${apiRouteConfig.config.type}")`).join('\n')}\n\nRefer to https://ntl.fyi/next-scheduled-bg-function-migration as migration example.`,
)
}
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export function verifyNetlifyForms(ctx: PluginContext, html: string) {
formDetectionRegex.test(html)
) {
console.warn(
'@netlify/plugin-next@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
'@netlify/plugin-nextjs@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
)
verifications.add('netlifyForms')
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/advanced-api-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ it<FixtureTestContext>('test', async (ctx) => {
const runPluginPromise = runPlugin(ctx)

await expect(runPluginPromise).rejects.toThrow(
'@netlify/plugin-next@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:',
'@netlify/plugin-nextjs@5 does not support advanced API routes. The following API routes should be migrated to Netlify background or scheduled functions:',
)

// list API routes to migrate
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/netlify-forms.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ it<FixtureTestContext>('should warn when netlify forms are used', async (ctx) =>
const runPluginPromise = await runPlugin(ctx)

expect(warn).toBeCalledWith(
'@netlify/plugin-next@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
'@netlify/plugin-nextjs@5 requires migration steps to support Netlify Forms. Refer to https://ntl.fyi/next-runtime-forms-migration for migration example.',
)
})

Expand Down
8 changes: 4 additions & 4 deletions tests/smoke/deploy.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test, describe, afterEach } from 'vitest'
import { afterEach, describe, expect, test } from 'vitest'
import { Fixture, fixtureFactories } from '../utils/create-e2e-fixture'

const usedFixtures = new Set<Fixture>()
Expand Down Expand Up @@ -66,7 +66,7 @@ describe('version check', () => {
async () => {
await expect(selfCleaningFixtureFactories.next12_1_0()).rejects.toThrow(
new RegExp(
`@netlify/plugin-next@5 requires Next.js version >=13.5.0, but found 12.1.0. Please upgrade your project's Next.js version.`,
`@netlify/plugin-nextjs@5 requires Next.js version >=13.5.0, but found 12.1.0. Please upgrade your project's Next.js version.`,
),
)
},
Expand All @@ -83,7 +83,7 @@ describe('version check', () => {
selfCleaningFixtureFactories.yarnMonorepoMultipleNextVersionsSiteIncompatible(),
).rejects.toThrow(
new RegExp(
`@netlify/plugin-next@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
`@netlify/plugin-nextjs@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
),
)
},
Expand All @@ -101,7 +101,7 @@ describe('version check', () => {
fixtureFactories.npmNestedSiteMultipleNextVersionsIncompatible(),
).rejects.toThrow(
new RegExp(
`@netlify/plugin-next@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
`@netlify/plugin-nextjs@5 requires Next.js version >=13.5.0, but found 13.4.1. Please upgrade your project's Next.js version.`,
),
)
},
Expand Down

0 comments on commit ed256d4

Please sign in to comment.