Upgrading @nuxtjs/robots 3 to 4
Breaking3.0.0 → 4.1.11Breaking3New1Changed5Fixed20Other1
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- The configPath config is no longer supported.
- The rules config is deprecated but will continue to work.
- Merge with nuxt-simple-robots - (13856).
Must act 3 items need code or config changes
Adds @nuxt/devtools-kit ^1.6.0, consola ^3.2.3, defu ^6.1.4, nuxt-site-config ^2.2.21, nuxt-site-config-kit ^2.2.21, pathe ^1.1.2, pkg-types ^1.2.1, sirv ^3.0.0, std-env ^3.7.0, ufo ^1.5.4.
Drops h3.
Installs 83 packages in all (was 52).
What you must change
Breaking3
The configPath config is no longer supported.
configPathThe rules config is deprecated but will continue to work.
rulesBlankLineCommentMerge with nuxt-simple-robots - (13856).
API changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- removed:
interface NuxtConfig - removed:
interface NuxtOptions - removed:
property NuxtConfig['robots']?: Partial<ModuleOptions> - removed:
property NuxtOptions['robots']?: ModuleOptions - added:
interface NuxtHooks extends ModuleHooks - added:
interface PublicRuntimeConfig extends ModulePublicRuntimeConfig
- removed:
type ModuleOptions = { configPath: string; rules: Rule | Rule[] } - changed:
const default: _nuxt_schema.NuxtModule<ModuleOptions> → const default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false> - added:
interface ModuleHooks - added:
interface ModuleOptions - added:
interface ModulePublicRuntimeConfig - added:
interface ResolvedModuleOptions extends ModuleOptions - added:
property ModuleHooks.'robots:config': (config: ResolvedModuleOptions) => Promise<void> | void - added:
property ModuleOptions.allow: Arrayable<string> - added:
property ModuleOptions.autoI18n?: false | AutoI18nConfig - added:
property ModuleOptions.blockNonSeoBots: boolean - added:
property ModuleOptions.cacheControl?: string | false - added:
property ModuleOptions.credits: boolean - added:
property ModuleOptions.debug: boolean - added:
property ModuleOptions.disableNuxtContentIntegration?: boolean - added:
property ModuleOptions.disallow: Arrayable<string> - added:
property ModuleOptions.disallowNonIndexableRoutes: boolean - added:
property ModuleOptions.enabled: boolean - added:
property ModuleOptions.groups: RobotsGroupInput[] - added:
property ModuleOptions.header: boolean - added:
property ModuleOptions.mergeWithRobotsTxtPath: boolean | string - added:
property ModuleOptions.metaTag: boolean - added:
property ModuleOptions.robotsDisabledValue: string - added:
property ModuleOptions.robotsEnabledValue: string - added:
property ModuleOptions.robotsTxt?: boolean - added:
property ModuleOptions.rules?: Robots3Rules | Robots3Rules[] - added:
property ModuleOptions.sitemap: Arrayable<string> - added:
property ModulePublicRuntimeConfig['nuxt-robots']: ResolvedModuleOptions - added:
property ResolvedModuleOptions.disallow: string[] - added:
property ResolvedModuleOptions.sitemap: string[]
- added:
function getPathRobotConfig(e: H3Event, options?: { userAgent?: string; skipSiteIndexable?: boolean; path?: string }): { rule: string; indexable: boolean; debug?: { source: string; line: string } }
- added:
function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] }
- added:
function createNitroRouteRuleMatcher(): (path: string) => NitroRouteConfig - added:
function withoutQuery(path: string): string
- added:
const logger: import('consola').ConsolaInstance
- added:
function getPathRobotConfig(e: H3Event, options?: { skipSiteIndexable?: boolean; path?: string }): { indexable: boolean; rule: string } - added:
function getSiteRobotConfig(e: H3Event): { indexable: boolean; hints: string[] }
- added:
const _default: any - added:
default _default
- added:
const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ robotsTxt: unknown; indexable: boolean; hints: string[]; runtimeConfig: unknown; siteConf… - added:
default _default
- added:
const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ rule: string; indexable: boolean; debug?: { source: string; line: string } }>> - 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<void>> - 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>
- added:
const _default: import('vue').DefineComponent<{}, () => null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').P… - added:
default _default
- added:
function defineRobotMeta(component?: boolean): void
- added:
function defineRobotMeta(component?: boolean): void - added:
function useRobotsRule(rule?: MaybeRef<boolean | string>): import('vue').Ref<string, string>
- added:
function useRobotsRule(rule?: MaybeRef<boolean | string>): import('vue').Ref<string, string> | import('vue').WritableComputedRef<string | boolean | undefined, string | boolean | undefined>
- added:
const _default: import('nuxt/app').Plugin<Record<string, unknown>> & import('nuxt/app').ObjectPlugin<Record<string, unknown>> - added:
default _default
- removed:
const _default: import('h3').EventHandler<string> - removed:
default _default
- added:
interface AutoI18nConfig - added:
interface GoogleInput - added:
interface HookRobotsConfigContext extends ParsedRobotsTxt - added:
interface HookRobotsTxtContext - added:
interface ParsedRobotsTxt - added:
interface Robots3Rules - added:
interface RobotsGroupResolved - added:
interface YandexInput extends GoogleInput - added:
property AutoI18nConfig.defaultLocale: string - added:
property AutoI18nConfig.differentDomains?: boolean - added:
property AutoI18nConfig.locales: NormalisedLocales - added:
property AutoI18nConfig.strategy: 'prefix' | 'prefix_except_default' | 'prefix_and_default' | 'no_prefix' - added:
property GoogleInput._skipI18n?: boolean - added:
property GoogleInput.allow?: Arrayable<string> - added:
property GoogleInput.comment?: Arrayable<string> - added:
property GoogleInput.disallow?: Arrayable<string> - added:
property GoogleInput.userAgent?: Arrayable<string> - added:
property HookRobotsConfigContext.context: 'robots.txt' | 'init' - added:
property HookRobotsConfigContext.event?: H3Event - added:
property HookRobotsTxtContext.e: H3Event - added:
property HookRobotsTxtContext.robotsTxt: string - added:
property ParsedRobotsTxt.errors: string[] - added:
property ParsedRobotsTxt.groups: RobotsGroupResolved[] - added:
property ParsedRobotsTxt.sitemaps: string[] - added:
property Robots3Rules.Allow?: string - added:
property Robots3Rules.BlankLine?: true - added:
property Robots3Rules.CleanParam?: string - added:
property Robots3Rules.Comment?: string - added:
property Robots3Rules.CrawlDelay?: string - added:
property Robots3Rules.Disallow?: string - added:
property Robots3Rules.Host?: string - added:
property Robots3Rules.Sitemap?: string - added:
property Robots3Rules.UserAgent?: string - added:
property RobotsGroupResolved._indexable?: boolean - added:
property RobotsGroupResolved._rules?: { pattern: string; allow: boolean }[] - added:
property RobotsGroupResolved._skipI18n?: boolean - added:
property RobotsGroupResolved.allow: string[] - added:
property RobotsGroupResolved.cleanParam?: string[] - added:
property RobotsGroupResolved.comment: string[] - added:
property RobotsGroupResolved.disallow: string[] - added:
property RobotsGroupResolved.host?: string - added:
property RobotsGroupResolved.userAgent: string[] - added:
property YandexInput.cleanParam?: Arrayable<string> - added:
type Arrayable<T> = T | T[] - added:
type NormalisedLocales = { code: string; iso?: string; domain?: string }[] - added:
type RobotsGroupInput = GoogleInput | YandexInput
- added:
function asArray(v: any): any[] - added:
function generateRobotsTxt({ groups, sitemaps }: { groups: RobotsGroupResolved[]; sitemaps: string[] }): string - added:
function isInternalRoute(_path: string): boolean - added:
function matchPathToRule(path: string, _rules: RobotsGroupResolved['_rules']): RobotsGroupResolved['_rules'][number] | null - added:
function mergeOnKey<T, 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 - added:
function parseRobotsTxt(s: string): ParsedRobotsTxt - added:
function validateRobots(robotsTxt: ParsedRobotsTxt): ParsedRobotsTxt
- added:
export { ModuleHooks } from './module' - added:
export { ModulePublicRuntimeConfig } from './module' - added:
export { ResolvedModuleOptions } from './module'