Skip to content

Upgrading @nuxtjs/robots 4 to 5

Breaking4.1.11 → 5.7.1Breaking5Deprecated1New8Changed1Fixed41Other2

BreakingUpgrade verdict

4 breaking changes.

  • The old way of writing robots rules in the config no longer works. Use the newer groups setting or a robots.txt file.
  • A component that only wrapped the removed helper is gone. Use the useRobotsRule function instead.
  • The old index and indexable shortcuts in route rules no longer work. Use the robots key instead.
  • An internal helper library got a major update. Your site probably works the same, but it is worth checking that library's breaking changes.
Top 4 of 5 that need code or config changes

Adds @fingerprintjs/botd ^2.0.0, h3 ^1.15.5.

Drops nuxt-site-config-kit.

Installs 58 packages in all (was 83).

Breaking4
Removes the deprecated rules config; use groups or a robots.txt file instead.
rulesgroups
Removes the RobotMeta component; use useRobotsRule() to control the robots rule.
RobotMetadefineRobotMetauseRobotsRule()
Removes the index and indexable config options; use the robots key instead.
indexindexablerobots
Upgrades the internal Nuxt Site Config module to v3.0.0, which may carry its own breaking changes.
Deprecated1
Deprecates the disallowNonIndexableRoutes config and sets it to false by default, previously true.
disallowNonIndexableRoutes

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • added: const schema: z.ZodObject<{ robots: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>> }, z.core.$strip>
  • added: function asRobotsCollection<T>(collection: Collection<T>): Collection<T>
  • removed: property ModuleOptions.rules?: Robots3Rules | Robots3Rules[]
  • added: const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>
  • added: export = _default
  • added: export { HookRobotsConfigContext } from '../dist/runtime/types'
  • added: export { HookRobotsTxtContext } from '../dist/runtime/types'
  • added: export { PatternMapValue } from '../dist/runtime/types'
  • added: export { RobotsContext } from '../dist/runtime/types'
  • added: export { RobotsValue } from '../dist/runtime/types'
  • added: property ModuleOptions.blockAiBots: boolean
  • added: property ModuleOptions.botDetection?: boolean
  • added: function useBotDetection(_options?: UseBotDetectionOptions): UseBotDetectionReturn
  • added: function useRobotsRule(rule?: MaybeRef<boolean | string>): import('vue').Ref<string, string>
  • added: function useBotDetection(options?: UseBotDetectionOptions): UseBotDetectionReturn
  • added: function useRobotsRule(rule?: ReactiveRobotsValue): import('vue').Ref<string | boolean | { enabled?: boolean | undefined; disabled?: boolean | undefined; index?: boolean | undefined; noindex?: boolean | undefined; follow?: boolean | undefined; nofollow?: boolean | undefined; none?: boolean | undefined; all?: boolean | undefined; noai?: boolean | undefined; noimageai?: boolean | undefined; 'max-im…
  • added: type ReactiveRobotsValue = MaybeRef<RobotsValue>
  • added: const _default: import('nuxt/app').Plugin<Record<string, unknown>> & import('nuxt/app').ObjectPlugin<Record<string, unknown>>
  • added: default _default
  • added: const _default: import('nuxt/app').Plugin<Record<string, unknown>> & import('nuxt/app').ObjectPlugin<Record<string, unknown>>
  • added: default _default
  • added: function runFingerprinting(): Promise<[BotDetectionContext | false, Error | null]>
  • added: export { ROBOT_DIRECTIVE_VALUES } from '@nuxtjs/robots/util'
  • added: export { formatMaxImagePreview } from '@nuxtjs/robots/util'
  • added: export { formatMaxSnippet } from '@nuxtjs/robots/util'
  • added: export { formatMaxVideoPreview } from '@nuxtjs/robots/util'
  • removed: function getPathRobotConfig(e: H3Event, options?: { userAgent?: string; skipSiteIndexable?: boolean; path?: string }): { rule: string; indexable: boolean; debug?: { source: string; line: string } }
  • removed: function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] }
  • removed: function createNitroRouteRuleMatcher(): (path: string) => NitroRouteConfig
  • removed: function withoutQuery(path: string): string
  • removed: const logger: import('consola').ConsolaInstance
  • removed: function getPathRobotConfig(e: H3Event, options?: { skipSiteIndexable?: boolean; path?: string }): { indexable: boolean; rule: string }
  • removed: function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] }
  • removed: const _default: any
  • removed: default _default
  • removed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ robotsTxt: unknown; indexable: boolean; hints: string[]; runtimeConfig: unknown; siteConf…
  • removed: default _default
  • removed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ rule: string; indexable: boolean; debug?: { source: string; line: string } }>>
  • removed: default _default
  • removed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<any[]>>
  • removed: default _default
  • removed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<void>>
  • removed: default _default
  • removed: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<string>>
  • removed: default _default
  • removed: function resolveRobotsTxtContext(e: H3Event | undefined, nitro?: NitroApp): Promise<HookRobotsConfigContext>
  • removed: const _default: import('vue').DefineComponent<{}, () => null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').P…
  • removed: default _default
  • removed: function defineRobotMeta(component?: boolean): void
  • removed: function defineRobotMeta(component?: boolean): void
  • removed: function useRobotsRule(rule?: MaybeRef<boolean | string>): import('vue').Ref<string, string>
  • removed: function useRobotsRule(rule?: MaybeRef<boolean | string>): import('vue').Ref<string, string> | import('vue').WritableComputedRef<string | boolean | undefined, string | boolean | undefined>
  • removed: const _default: import('nuxt/app').Plugin<Record<string, unknown>> & import('nuxt/app').ObjectPlugin<Record<string, unknown>>
  • removed: default _default
  • added: export { BotDetectionContext } from '@nuxtjs/robots/util'
  • added: function getBotDetection(event: H3Event): any
  • added: function getBotInfo(event: H3Event): any
  • added: function isBot(event: H3Event): boolean
  • added: function getPathRobotConfig(e: H3Event, options?: { userAgent?: string; skipSiteIndexable?: boolean; path?: string }): RobotsContext
  • added: function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] }
  • added: function useRuntimeConfigNuxtRobots(event?: H3Event): NuxtRobotsRuntimeConfig
  • added: function createNitroRouteRuleMatcher(e?: H3Event): (path: string) => NitroRouteConfig
  • added: function withoutQuery(path: string): string | undefined
  • added: const logger: import('consola').ConsolaInstance
  • added: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<void>>
  • added: default _default
  • added: function getBotDetection(e: H3Event): BotDetectionContext
  • added: function getBotInfo(e: H3Event): null
  • added: function getPathRobotConfig(e: H3Event, options?: { skipSiteIndexable?: boolean; path?: string }): { indexable: boolean; rule: string }
  • added: function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] }
  • added: function isBot(e: H3Event): boolean
  • added: export { getBotDetection } from '../mock-composables'
  • added: export { getPathRobotConfig } from '../mock-composables'
  • added: export { getSiteRobotConfig } from '../mock-composables'
  • added: export { normaliseRobotsRouteRule } from '@nuxtjs/robots/util'
  • added: const _default: import('nitropack/types').NitroAppPlugin
  • added: default _default
  • added: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ robotsTxt: unknown; indexable: boolean; hints: string[]; runtimeConfig: import('../../../…
  • added: default _default
  • added: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ rule: string; indexable: boolean; crawlable: boolean; path: string; debug: { source: stri…
  • added: default _default
  • added: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<any[]>>
  • added: default _default
  • added: const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<string>>
  • added: default _default
  • added: function resolveRobotsTxtContext(e: H3Event | undefined, nitro?: NitroApp): Promise<HookRobotsConfigContext>
  • removed: interface Robots3Rules
  • removed: property Robots3Rules.Allow?: string
  • removed: property Robots3Rules.BlankLine?: true
  • removed: property Robots3Rules.CleanParam?: string
  • removed: property Robots3Rules.Comment?: string
  • removed: property Robots3Rules.CrawlDelay?: string
  • removed: property Robots3Rules.Disallow?: string
  • removed: property Robots3Rules.Host?: string
  • removed: property Robots3Rules.Sitemap?: string
  • removed: property Robots3Rules.UserAgent?: string
  • added: interface BotDetectionContext
  • added: interface BotDetectionData
  • added: interface BotInfo
  • added: interface ContentSignalPreferences
  • added: interface ContentUsagePreferences
  • added: interface FingerprintingBotDetectedPayload
  • added: interface FingerprintingErrorPayload
  • added: interface NuxtRobotsRuntimeConfig
  • added: interface PatternMapValue
  • added: interface RobotDirectives
  • added: interface RobotsContext
  • added: interface UseBotDetectionOptions
  • added: interface UseBotDetectionReturn
  • added: property AutoI18nConfig.pages?: Record<string, Record<string, string | false>>
  • added: property BotDetectionContext.botCategory?: BotCategory
  • added: property BotDetectionContext.botName?: BotName
  • added: property BotDetectionContext.detectionMethod?: 'headers' | 'fingerprint'
  • added: property BotDetectionContext.isBot: boolean
  • added: property BotDetectionContext.trusted?: boolean
  • added: property BotDetectionContext.userAgent?: string
  • added: property BotDetectionData.data?: { botName: BotName; botCategory: BotCategory; trusted: boolean }
  • added: property BotDetectionData.isBot: boolean
  • added: property BotInfo.category?: BotCategory
  • added: property BotInfo.method?: 'server' | 'fingerprint'
  • added: property BotInfo.name?: BotName
  • added: property BotInfo.trusted?: boolean
  • added: property ContentSignalPreferences.'ai-input'?: ContentSignalValue
  • added: property ContentSignalPreferences.'ai-train'?: ContentSignalValue
  • added: property ContentSignalPreferences.'search'?: ContentSignalValue
  • added: property ContentUsagePreferences.'ai-output'?: ContentUsageValue
  • added: property ContentUsagePreferences.'bots'?: ContentUsageValue
  • added: property ContentUsagePreferences.'search'?: ContentUsageValue
  • added: property ContentUsagePreferences.'train-ai'?: ContentUsageValue
  • added: property FingerprintingBotDetectedPayload.fingerprint: BotDetectionData
  • added: property FingerprintingBotDetectedPayload.method: 'fingerprint'
  • added: property FingerprintingBotDetectedPayload.result: BotDetectionContext
  • added: property FingerprintingErrorPayload.error: any
  • added: property GoogleInput.contentSignal?: Arrayable<string> | Partial<ContentSignalPreferences>
  • added: property GoogleInput.contentUsage?: Arrayable<string> | Partial<ContentUsagePreferences>
  • added: property NuxtRobotsRuntimeConfig.botDetection: boolean
  • added: property NuxtRobotsRuntimeConfig.cacheControl: string | false
  • added: property NuxtRobotsRuntimeConfig.credits: boolean
  • added: property NuxtRobotsRuntimeConfig.debug: boolean
  • added: property NuxtRobotsRuntimeConfig.groups: RobotsGroupResolved[]
  • added: property NuxtRobotsRuntimeConfig.header: boolean
  • added: property NuxtRobotsRuntimeConfig.isNuxtContentV2: boolean
  • added: property NuxtRobotsRuntimeConfig.pageMetaRobots: Record<string, RobotsValue>
  • added: property NuxtRobotsRuntimeConfig.robotsDisabledValue: string
  • added: property NuxtRobotsRuntimeConfig.robotsEnabledValue: string
  • added: property NuxtRobotsRuntimeConfig.sitemap: string[]
  • added: property NuxtRobotsRuntimeConfig.version: string
  • added: property PatternMapValue.botCategory: BotCategory
  • added: property PatternMapValue.botName: BotName
  • added: property PatternMapValue.trusted: boolean
  • added: property RobotDirectives.'all': boolean
  • added: property RobotDirectives.'disabled': boolean
  • added: property RobotDirectives.'enabled': boolean
  • added: property RobotDirectives.'follow': boolean
  • added: property RobotDirectives.'index': boolean
  • added: property RobotDirectives.'max-image-preview': 'none' | 'standard' | 'large'
  • added: property RobotDirectives.'max-snippet': number
  • added: property RobotDirectives.'max-video-preview': number
  • added: property RobotDirectives.'noai': boolean
  • added: property RobotDirectives.'nofollow': boolean
  • added: property RobotDirectives.'noimageai': boolean
  • added: property RobotDirectives.'noindex': boolean
  • added: property RobotDirectives.'none': boolean
  • added: property RobotsContext.debug?: { source: string; line?: string }
  • added: property RobotsContext.indexable: boolean
  • added: property RobotsContext.rule: string
  • added: property RobotsGroupResolved._normalized?: boolean
  • added: property RobotsGroupResolved.contentSignal?: string[]
  • added: property RobotsGroupResolved.contentUsage?: string[]
  • added: property UseBotDetectionOptions.fingerprint?: boolean
  • added: property UseBotDetectionOptions.onFingerprintError?: (error: Error) => void
  • added: property UseBotDetectionOptions.onFingerprintResult?: (result: BotDetectionContext | null) => void
  • added: property UseBotDetectionReturn.botCategory: ComputedRef<BotCategory | undefined>
  • added: property UseBotDetectionReturn.botName: ComputedRef<BotName | undefined>
  • added: property UseBotDetectionReturn.isBot: ComputedRef<boolean>
  • added: property UseBotDetectionReturn.reset: () => void
  • added: property UseBotDetectionReturn.trusted: ComputedRef<boolean | undefined>
  • added: type ContentSignalValue = 'yes' | 'no'
  • added: type ContentUsageValue = 'y' | 'n'
  • added: type RobotsValue = boolean | string | Partial<RobotDirectives>
  • removed: function asArray(v: any): any[]
  • removed: function generateRobotsTxt({ groups, sitemaps }: { groups: RobotsGroupResolved[]; sitemaps: string[] }): string
  • removed: function isInternalRoute(_path: string): boolean
  • removed: function matchPathToRule(path: string, _rules: RobotsGroupResolved['_rules']): RobotsGroupResolved['_rules'][number] | null
  • removed: function mergeOnKey<T, K extends keyof T>(arr: T[], key: K): T[]
  • removed: function normaliseRobotsRouteRule(config: NitroRouteConfig): { allow: boolean | undefined; rule: string | undefined } | undefined
  • removed: function normalizeGroup(group: RobotsGroupInput): RobotsGroupResolved
  • removed: function parseRobotsTxt(s: string): ParsedRobotsTxt
  • removed: function validateRobots(robotsTxt: ParsedRobotsTxt): ParsedRobotsTxt
  • added: export * from '@nuxtjs/robots/util'
  • added: export { RobotDirectives } from './types'
  • added: export { RobotsValue } from './types'
  • added: export { HookRobotsConfigContext } from '../dist/runtime/types'
  • added: export { HookRobotsTxtContext } from '../dist/runtime/types'
  • added: export { PatternMapValue } from '../dist/runtime/types'
  • added: export { RobotsContext } from '../dist/runtime/types'
  • added: export { RobotsValue } from '../dist/runtime/types'
  • added: const AI_BOTS: BotPattern[]
  • added: const AUTOMATION_BOTS: BotPattern[]
  • added: const AiBots: string[]
  • added: const BOT_MAP: BotCategoryDefinition[]
  • added: const GENERIC_BOTS: BotPattern[]
  • added: const HTTP_TOOL_BOTS: BotPattern[]
  • added: const KNOWN_SEARCH_BOTS: BotPattern[]
  • added: const NonHelpfulBots: string[]
  • added: const ROBOT_DIRECTIVE_VALUES: { readonly enabled: 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1'; readonly disabled: 'noindex, nofollow'; readonly index: 'in…
  • added: const SCRAPING_BOTS: BotPattern[]
  • added: const SECURITY_SCANNING_BOTS: BotPattern[]
  • added: const SEO_BOTS: BotPattern[]
  • added: const SOCIAL_BOTS: BotPattern[]
  • added: export * from '../dist/runtime/types'
  • added: function asArray(v: any): any[]
  • added: function createPatternMap(): Map<string, PatternMapValue>
  • added: function formatMaxImagePreview(value: 'none' | 'standard' | 'large'): string
  • added: function formatMaxSnippet(value: number): string
  • added: function formatMaxVideoPreview(value: number): string
  • added: function generateRobotsTxt({ groups, sitemaps }: { groups: RobotsGroupResolved[]; sitemaps: string[] }): string
  • added: function getBotDetection(headers: Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): BotDetectionContext
  • added: function getBotInfo(headers: Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): { name: any; category: any; trusted: boolean | undefined; method: 'headers' | 'fingerprint' | undefined } | null
  • added: function isBot(headers: Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): boolean
  • added: function isBotFromHeaders(headers: Record<string, string | string[] | undefined>, patternMap?: Map<string, PatternMapValue>): { isBot: boolean; data?: { botName: BotName; botCategory: BotCategory; trusted: boolean } }
  • added: function isInternalRoute(_path: string): boolean
  • added: function mapBotKindToCategory(botKind: BotKind): BotCategory
  • added: function matchPathToRule(path: string, _rules: Required<RobotsGroupResolved>['_rules']): Required<RobotsGroupResolved>['_rules'][number] | null
  • added: function mergeOnKey<T extends Record<string, any>, K extends keyof T>(arr: T[], key: K): T[]
  • added: function normaliseRobotsRouteRule(config: NitroRouteConfig): { allow: boolean | undefined; rule: string | undefined } | undefined
  • added: function normalizeGroup(group: RobotsGroupInput | RobotsGroupResolved): RobotsGroupResolved
  • added: function parseRobotsTxt(s: string): ParsedRobotsTxt
  • added: function validateRobots(robotsTxt: ParsedRobotsTxt): ParsedRobotsTxt
  • added: interface BotCategoryDefinition
  • added: interface BotPattern
  • added: property BotCategoryDefinition.bots: BotPattern[]
  • added: property BotCategoryDefinition.trusted: boolean
  • added: property BotCategoryDefinition.type: BotCategory
  • added: property BotPattern.name: string
  • added: property BotPattern.pattern: string
  • added: property BotPattern.secondaryPatterns?: string[]
  • added: type BotCategory = 'search-engine' | 'social' | 'seo' | 'ai' | 'generic' | 'automation' | 'http-tool' | 'security-scanner' | 'scraping'
  • added: type BotKind = 'awesomium' | 'cef' | 'cefsharp' | 'coachjs' | 'electron' | 'fminer' | 'geb' | 'nightmarejs' | 'phantomas' | 'phantomjs' | 'rhino' | 'selenium' | 'sequentum' |…
  • added: type BotName = 'googlebot' | 'bingbot' | 'yandexbot' | 'baiduspider' | 'duckduckbot' | 'yahoo' | 'applebot' | 'twitter' | 'facebook' | 'linkedin' | 'pinterest' | 'discord' |…