From e353080621ecb3784c5b20aa2d17ceb274e772eb Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Tue, 28 Feb 2023 10:28:59 +0100 Subject: [PATCH] Publish feature and language type definitions According to the examples, this is part of the public interface. However, type definitions were missing for these files. Closes #2450 --- build/releaseMetadata.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/releaseMetadata.ts b/build/releaseMetadata.ts index 3fb6f7c6..17a530ff 100644 --- a/build/releaseMetadata.ts +++ b/build/releaseMetadata.ts @@ -185,6 +185,15 @@ exports.languages = ${JSON.stringify(languages, null, ' ')}; const jsDestination = path.join(REPO_ROOT, 'out/monaco-editor/esm/metadata.js'); ensureDir(path.dirname(jsDestination)); fs.writeFileSync(jsDestination, jsContents.replace(/\r\n/g, '\n')); + + for (const feature of [...features, ...languages]) { + const entries = [].concat(feature.entry); + for (const entry of entries) { + const dtsDestination = path.join(REPO_ROOT, 'out/monaco-editor/esm', entry) + '.d.ts'; + ensureDir(path.dirname(dtsDestination)); + fs.writeFileSync(dtsDestination, 'export {}\n'); + } + } } ); }