mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Expose TypeScript version via monaco.languages.typescript.typeScriptVersion
This commit is contained in:
parent
7625391590
commit
d199064a4b
4 changed files with 13 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const child_process = require('child_process');
|
||||
|
||||
const TYPESCRIPT_LIB_SOURCE = path.join(__dirname, '../node_modules/typescript/lib');
|
||||
const TYPESCRIPT_LIB_DESTINATION = path.join(__dirname, '../src/lib');
|
||||
|
|
@ -17,6 +18,13 @@ const TYPESCRIPT_LIB_DESTINATION = path.join(__dirname, '../src/lib');
|
|||
}
|
||||
importLibs();
|
||||
|
||||
const npmLsOutput = JSON.parse(child_process.execSync("npm ls typescript --depth=0 --json=true").toString());
|
||||
const typeScriptDependencyVersion = npmLsOutput.dependencies.typescript.version;
|
||||
|
||||
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServicesMetadata.ts'),
|
||||
`export const typeScriptVersion = "${typeScriptDependencyVersion}";
|
||||
`);
|
||||
|
||||
var tsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescriptServices.js')).toString();
|
||||
|
||||
// Ensure we never run into the node system...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue