Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning Property defaultPreviewTitleText is not allowed in VSCode extension #337

Open
ycs77 opened this issue Sep 19, 2024 · 1 comment · May be fixed by #339
Open

Warning Property defaultPreviewTitleText is not allowed in VSCode extension #337

ycs77 opened this issue Sep 19, 2024 · 1 comment · May be fixed by #339
Labels
extension Issus related to TutorialKit VS Code extension

Comments

@ycs77
Copy link
Contributor

ycs77 commented Sep 19, 2024

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?

@AriPerkkio
Copy link
Member

The extension bundles @tutorialkit/types. This means that we need to re-publish it every time we make changes to @tutorialkit/types.

So this should start working once we publish new version of extension.

@AriPerkkio AriPerkkio added the extension Issus related to TutorialKit VS Code extension label Sep 19, 2024
@AriPerkkio AriPerkkio linked a pull request Sep 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Issus related to TutorialKit VS Code extension
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants