Skip to content

Warning Property defaultPreviewTitleText is not allowed in VSCode extension #337

Closed
@ycs77

Description

@ycs77

Describe the bug

Before adding a new i18n property defaultPreviewTitleText in #255, but now the warning Property defaultPreviewTitleText is not allowed remains in the VSCode.

Link to a StackBlitz project which shows the error

No response

Steps to reproduce

  1. create a new Tutorialkit project
  2. open VSCode and install Tutorialkit VSCode extension
  3. open src/content/tutorial/meta.md
  4. add below i18n content:
i18n:
  defaultPreviewTitleText: '預覽'
  1. see the warning Property defaultPreviewTitleText is not allowed when the mouse hovering defaultPreviewTitleText

Expected behavior

No show the Property defaultPreviewTitleText is not allowed warning.

Screenshots

螢幕擷取畫面 (214)

Platform

  • TutorialKit version: 0.2.3
  • OS: Windows
  • Browser: not applicable
  • Version: [e.g. 91.1]

Additional context

The i18n contentSchema is in the @tutorialkit/types package:

/**
* Text shown on top of the preview section when `previews[_].title` is not configured.
*
* @default 'Preview'
*/
defaultPreviewTitleText: z.string().optional().describe('Text shown on top of the preview section.'),

And this is code of load the contentSchema in the vscode extension:

import { contentSchema } from '@tutorialkit/types';
import { zodToJsonSchema } from 'zod-to-json-schema';
parentPort.postMessage(zodToJsonSchema(contentSchema));

async function buildMetadataSchema() {
const schema = await new Promise((resolve) => {
const worker = new Worker(join(__dirname, './load-schema-worker.mjs'));
worker.on('message', (value) => resolve(value));
});
fs.mkdirSync('./dist', { recursive: true });
fs.writeFileSync('./dist/schema.json', JSON.stringify(schema, undefined, 2), 'utf-8');
console.log('Updated schema.json');
}

So if rebuilding the vscode extension can this warning be resolved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionIssus related to TutorialKit VS Code extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions