mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Add a note to all generated files
This commit is contained in:
parent
e0992c9470
commit
35454d834d
6 changed files with 29 additions and 7 deletions
|
|
@ -7,6 +7,11 @@ const path = require('path');
|
|||
const fs = require('fs');
|
||||
const child_process = require('child_process');
|
||||
|
||||
const generatedNote = `//
|
||||
// **NOTE**: Do not edit directly! This file is generated using \`npm run import-typescript\`
|
||||
//
|
||||
`;
|
||||
|
||||
const TYPESCRIPT_LIB_SOURCE = path.join(__dirname, '../node_modules/typescript/lib');
|
||||
const TYPESCRIPT_LIB_DESTINATION = path.join(__dirname, '../src/lib');
|
||||
|
||||
|
|
@ -23,7 +28,8 @@ const TYPESCRIPT_LIB_DESTINATION = path.join(__dirname, '../src/lib');
|
|||
|
||||
fs.writeFileSync(
|
||||
path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServicesMetadata.ts'),
|
||||
`export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
|
||||
`${generatedNote}
|
||||
export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
|
||||
);
|
||||
|
||||
var tsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescriptServices.js')).toString();
|
||||
|
|
@ -57,7 +63,7 @@ const TYPESCRIPT_LIB_DESTINATION = path.join(__dirname, '../src/lib');
|
|||
const afterProcess = `// MONACOCHANGE\n ts.perfLogger.logInfoEvent("Starting TypeScript v" + ts.versionMajorMinor + " with command line: " + JSON.stringify([]));\n// END MONACOCHANGE`
|
||||
tsServices = tsServices.replace(beforeProcess, afterProcess);
|
||||
|
||||
var tsServices_amd = tsServices +
|
||||
var tsServices_amd = generatedNote + tsServices +
|
||||
`
|
||||
// MONACOCHANGE
|
||||
// Defining the entire module name because r.js has an issue and cannot bundle this file
|
||||
|
|
@ -67,7 +73,7 @@ define("vs/language/typescript/lib/typescriptServices", [], function() { return
|
|||
`;
|
||||
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices-amd.js'), tsServices_amd);
|
||||
|
||||
var tsServices_esm = tsServices +
|
||||
var tsServices_esm = generatedNote + tsServices +
|
||||
`
|
||||
// MONACOCHANGE
|
||||
export var createClassifier = ts.createClassifier;
|
||||
|
|
@ -90,7 +96,7 @@ export var TokenClass = ts.TokenClass;
|
|||
export = ts;
|
||||
// END MONACOCHANGE
|
||||
`;
|
||||
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices.d.ts'), dtsServices);
|
||||
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices.d.ts'), generatedNote + dtsServices);
|
||||
|
||||
})();
|
||||
|
||||
|
|
@ -164,7 +170,7 @@ function importLibs() {
|
|||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
`;
|
||||
${generatedNote}`;
|
||||
// Do a topological sort
|
||||
while (result.length > 0) {
|
||||
for (let i = result.length - 1; i >= 0; i--) {
|
||||
|
|
@ -193,7 +199,7 @@ function importLibs() {
|
|||
/** This is the DTS which is used when the target is ES6 or below */
|
||||
export const lib_es5_bundled_dts = lib_dts;
|
||||
|
||||
/** This is the DTS which is used by default in monaco-typescript by default, and when the target is 2015 or above */
|
||||
/** This is the DTS which is used by default in monaco-typescript, and when the target is 2015 or above */
|
||||
export const lib_es2015_bundled_dts = lib_es2015_dts + "" + lib_dom_dts + "" + lib_webworker_importscripts_dts + "" + lib_scripthost_dts + "";
|
||||
`
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
//
|
||||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
||||
//
|
||||
|
||||
export const lib_es2015_symbol_dts: string = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// <reference no-default-lib=\"true\"/>\n\n\ninterface SymbolConstructor {\n /**\n * A reference to the prototype.\n */\n readonly prototype: Symbol;\n\n /**\n * Returns a new unique Symbol value.\n * @param description Description of the new Symbol object.\n */\n (description?: string | number): symbol;\n\n /**\n * Returns a Symbol object from the global symbol registry matching the given key if found.\n * Otherwise, returns a new symbol with this key.\n * @param key key to search for.\n */\n for(key: string): symbol;\n\n /**\n * Returns a key from the global symbol registry matching the given Symbol if found.\n * Otherwise, returns a undefined.\n * @param sym Symbol to find the key for.\n */\n keyFor(sym: symbol): string | undefined;\n}\n\ndeclare var Symbol: SymbolConstructor;";
|
||||
|
||||
|
|
@ -36,5 +39,5 @@ export const lib_dts: string = "/*! ********************************************
|
|||
/** This is the DTS which is used when the target is ES6 or below */
|
||||
export const lib_es5_bundled_dts = lib_dts;
|
||||
|
||||
/** This is the DTS which is used by default in monaco-typescript by default, and when the target is 2015 or above */
|
||||
/** This is the DTS which is used by default in monaco-typescript, and when the target is 2015 or above */
|
||||
export const lib_es2015_bundled_dts = lib_es2015_dts + "" + lib_dom_dts + "" + lib_webworker_importscripts_dts + "" + lib_scripthost_dts + "";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//
|
||||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
||||
//
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
|
|
|
|||
3
src/lib/typescriptServices.d.ts
vendored
3
src/lib/typescriptServices.d.ts
vendored
|
|
@ -1,3 +1,6 @@
|
|||
//
|
||||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
||||
//
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
//
|
||||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
||||
//
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
|
|
|
|||
|
|
@ -1 +1,5 @@
|
|||
//
|
||||
// **NOTE**: Do not edit directly! This file is generated using `npm run import-typescript`
|
||||
//
|
||||
|
||||
export const typescriptVersion = "3.8.3";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue