mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-20 19:45:07 -06:00
Emitting tsserverlibrary as an external module.
This commit is contained in:
parent
88c68256e6
commit
8b44ce2fd7
@ -472,6 +472,9 @@ gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
|
||||
.pipe(sourcemaps.write("."))
|
||||
.pipe(gulp.dest(".")),
|
||||
dts.pipe(prependCopyright())
|
||||
.pipe(insert.transform((content) => {
|
||||
return content + "\r\nexport = ts;";
|
||||
}))
|
||||
.pipe(gulp.dest("."))
|
||||
]);
|
||||
});
|
||||
|
||||
38
Jakefile.js
38
Jakefile.js
@ -183,8 +183,8 @@ var servicesSources = [
|
||||
return path.join(servicesDirectory, f);
|
||||
}));
|
||||
|
||||
var serverCoreSources = [
|
||||
"types.d.ts",
|
||||
var baseServerCoreSources = [
|
||||
"types.ts",
|
||||
"shared.ts",
|
||||
"utilities.ts",
|
||||
"scriptVersionCache.ts",
|
||||
@ -195,11 +195,16 @@ var serverCoreSources = [
|
||||
"editorServices.ts",
|
||||
"protocol.ts",
|
||||
"session.ts",
|
||||
"server.ts"
|
||||
].map(function (f) {
|
||||
return path.join(serverDirectory, f);
|
||||
});
|
||||
|
||||
var serverCoreSources = [
|
||||
"server.ts"
|
||||
].map(function (f) {
|
||||
return path.join(serverDirectory, f);
|
||||
}).concat(baseServerCoreSources);
|
||||
|
||||
var cancellationTokenSources = [
|
||||
"cancellationToken.ts"
|
||||
].map(function (f) {
|
||||
@ -207,7 +212,7 @@ var cancellationTokenSources = [
|
||||
});
|
||||
|
||||
var typingsInstallerSources = [
|
||||
"../types.d.ts",
|
||||
"../types.ts",
|
||||
"../shared.ts",
|
||||
"typingsInstaller.ts",
|
||||
"nodeTypingsInstaller.ts"
|
||||
@ -216,20 +221,7 @@ var typingsInstallerSources = [
|
||||
});
|
||||
|
||||
var serverSources = serverCoreSources.concat(servicesSources);
|
||||
|
||||
var languageServiceLibrarySources = [
|
||||
"protocol.ts",
|
||||
"utilities.ts",
|
||||
"scriptVersionCache.ts",
|
||||
"scriptInfo.ts",
|
||||
"lsHost.ts",
|
||||
"project.ts",
|
||||
"editorServices.ts",
|
||||
"session.ts",
|
||||
|
||||
].map(function (f) {
|
||||
return path.join(serverDirectory, f);
|
||||
}).concat(servicesSources);
|
||||
var languageServiceLibrarySources = baseServerCoreSources.concat(servicesSources);
|
||||
|
||||
var harnessCoreSources = [
|
||||
"harness.ts",
|
||||
@ -727,7 +719,15 @@ compileFile(
|
||||
[builtLocalDirectory, copyright, builtLocalCompiler].concat(languageServiceLibrarySources).concat(libraryTargets),
|
||||
/*prefixes*/[copyright],
|
||||
/*useBuiltCompiler*/ true,
|
||||
{ noOutFile: false, generateDeclarations: true });
|
||||
{ noOutFile: false, generateDeclarations: true },
|
||||
/*callback*/ function () {
|
||||
|
||||
prependFile(copyright, tsserverLibraryDefinitionFile);
|
||||
|
||||
// Appending 'export = ts;' at the end of the server library file to turn it into an external module
|
||||
var tsserverLibraryDefinitionFileContents = fs.readFileSync(tsserverLibraryDefinitionFile).toString() + "\r\nexport = ts;";
|
||||
fs.writeFileSync(tsserverLibraryDefinitionFile, tsserverLibraryDefinitionFileContents);
|
||||
});
|
||||
|
||||
// Local target to build the language service server library
|
||||
desc("Builds language service server library");
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/// <reference path="types.d.ts" />
|
||||
/// <reference path="types.ts" />
|
||||
|
||||
namespace ts.server {
|
||||
export const ActionSet: ActionSet = "action::set";
|
||||
|
||||
@ -1,16 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"removeComments": true,
|
||||
"preserveConstEnums": true,
|
||||
"pretty": true,
|
||||
"outFile": "../../built/local/tsserverlibrary.js",
|
||||
"sourceMap": true,
|
||||
"stripInternal": true,
|
||||
"declaration": true,
|
||||
"types": [],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"target": "es5",
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
"noUnusedParameters": true,
|
||||
"declaration": true
|
||||
},
|
||||
"files": [
|
||||
"../services/shims.ts",
|
||||
@ -19,11 +23,11 @@
|
||||
"utilities.ts",
|
||||
"scriptVersionCache.ts",
|
||||
"scriptInfo.ts",
|
||||
"lshost.ts",
|
||||
"lsHost.ts",
|
||||
"typingsCache.ts",
|
||||
"project.ts",
|
||||
"editorServices.ts",
|
||||
"protocol.d.ts",
|
||||
"protocol.ts",
|
||||
"session.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"files": [
|
||||
"../types.d.ts",
|
||||
"../types.ts",
|
||||
"../shared.ts",
|
||||
"typingsInstaller.ts",
|
||||
"nodeTypingsInstaller.ts"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/// <reference path="../../compiler/core.ts" />
|
||||
/// <reference path="../../compiler/moduleNameResolver.ts" />
|
||||
/// <reference path="../../services/jsTyping.ts"/>
|
||||
/// <reference path="../types.d.ts"/>
|
||||
/// <reference path="../types.ts"/>
|
||||
/// <reference path="../shared.ts"/>
|
||||
|
||||
namespace ts.server.typingsInstaller {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/// <reference path="types.d.ts" />
|
||||
/// <reference path="types.ts" />
|
||||
/// <reference path="shared.ts" />
|
||||
|
||||
namespace ts.server {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user