-
Notifications
You must be signed in to change notification settings - Fork 88
Description
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
- create a new Tutorialkit project
- open VSCode and install Tutorialkit VSCode extension
- open
src/content/tutorial/meta.md
- add below i18n content:
i18n:
defaultPreviewTitleText: '預覽'
- see the warning
Property defaultPreviewTitleText is not allowed
when the mouse hoveringdefaultPreviewTitleText
Expected behavior
No show the Property defaultPreviewTitleText is not allowed
warning.
Screenshots
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:
tutorialkit/packages/types/src/schemas/i18n.ts
Lines 109 to 114 in 5c1de69
/** | |
* 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:
tutorialkit/extensions/vscode/scripts/load-schema-worker.mjs
Lines 2 to 5 in 5c1de69
import { contentSchema } from '@tutorialkit/types'; | |
import { zodToJsonSchema } from 'zod-to-json-schema'; | |
parentPort.postMessage(zodToJsonSchema(contentSchema)); |
tutorialkit/extensions/vscode/scripts/build.mjs
Lines 61 to 71 in 5c1de69
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?