From e5e7af93f8c2daad6708ef9b071dd2e2fccc9142 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Mon, 20 Nov 2023 12:57:36 +0800 Subject: [PATCH] chore: add hints --- packages/core/src/page/createPage.ts | 2 +- packages/core/src/page/resolvePageMeta.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/src/page/createPage.ts b/packages/core/src/page/createPage.ts index 5371be9cac..42f8ea20de 100644 --- a/packages/core/src/page/createPage.ts +++ b/packages/core/src/page/createPage.ts @@ -148,7 +148,7 @@ export const createPage = async ( // @ts-expect-error use meta instead routeMeta: new Proxy(meta, { set: (obj, prop, value) => { - console.error('RouteMeta is deprecated, use meta instead.') + console.warn('routeMeta is deprecated, please use meta instead') obj[prop as string] = value return true diff --git a/packages/core/src/page/resolvePageMeta.ts b/packages/core/src/page/resolvePageMeta.ts index 8bd6dc114a..e532cabb09 100644 --- a/packages/core/src/page/resolvePageMeta.ts +++ b/packages/core/src/page/resolvePageMeta.ts @@ -9,8 +9,10 @@ export const resolvePageMeta = ({ frontmatter: PageFrontmatter }): Record => { // TODO: Added for backwards compatibility, should be removed in stable - if (frontmatter.routeMeta) + if (frontmatter.routeMeta) { + console.warn('routeMeta is deprecated, please use meta instead') frontmatter.meta = { ...frontmatter.routeMeta, ...frontmatter.meta } + } return frontmatter.meta ?? {} }