fixes website & adds editor.api.d.ts (#5104)

This commit is contained in:
Henning Dieterichs 2025-11-07 18:47:33 +01:00 committed by GitHub
parent 36efbe07d9
commit e70b6618f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 26 additions and 24 deletions

View file

@ -16,6 +16,7 @@ const root = join(import.meta.dirname, '../../');
export default defineConfig({
input: {
entry: join(root, './src/editor/editor.main.ts'),
editorApi: join(root, './src/editor/editor.api.ts'),
},
output: {
dir: join(root, './out/monaco-editor/esm'),
@ -41,6 +42,6 @@ export default defineConfig({
},
includeExternal: ['monaco-editor-core', '@vscode/monaco-lsp-client']
}),
dtsDeprecationWarning(),
dtsDeprecationWarning(f => f.endsWith('editor.api.d.ts')),
],
});

View file

@ -58,12 +58,18 @@ export function mapModuleId(moduleId, newExt) {
return undefined;
}
/** @return {import('rollup').Plugin} */
export function dtsDeprecationWarning() {
/**
* @param {(moduleId: string) => boolean} [filter]
* @return {import('rollup').Plugin}
*/
export function dtsDeprecationWarning(filter) {
return {
name: 'add-dts-deprecation-warning',
generateBundle(options, bundle) {
for (const fileName in bundle) {
if (filter && !filter(fileName)) {
continue;
}
const file = bundle[fileName];
if (file.type === 'chunk' && fileName.endsWith('.d.ts')) {
let content = file.code.toString();