@@ -105,24 +105,6 @@ var serverSources = [
105105 return path . join ( serverDirectory , f ) ;
106106} ) ;
107107
108- var definitionsRoots = [
109- "compiler/types.d.ts" ,
110- "compiler/scanner.d.ts" ,
111- "compiler/parser.d.ts" ,
112- "compiler/checker.d.ts" ,
113- "compiler/program.d.ts" ,
114- "compiler/commandLineParser.d.ts" ,
115- "services/services.d.ts" ,
116- ] ;
117-
118- var internalDefinitionsRoots = [
119- "compiler/core.d.ts" ,
120- "compiler/sys.d.ts" ,
121- "compiler/utilities.d.ts" ,
122- "compiler/commandLineParser.d.ts" ,
123- "services/utilities.d.ts" ,
124- ] ;
125-
126108var harnessSources = [
127109 "harness.ts" ,
128110 "sourceMapRecorder.ts" ,
@@ -354,60 +336,32 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
354336compileFile ( tscFile , compilerSources , [ builtLocalDirectory , copyright ] . concat ( compilerSources ) , [ copyright ] , /*useBuiltCompiler:*/ false ) ;
355337
356338var servicesFile = path . join ( builtLocalDirectory , "typescriptServices.js" ) ;
339+ var standaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
357340var nodePackageFile = path . join ( builtLocalDirectory , "typescript.js" ) ;
341+ var nodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript.d.ts" ) ;
342+
358343compileFile ( servicesFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) ,
359344 /*prefixes*/ [ copyright ] ,
360345 /*useBuiltCompiler*/ true ,
361346 /*noOutFile*/ false ,
362- /*generateDeclarations*/ false ,
347+ /*generateDeclarations*/ true ,
363348 /*outDir*/ undefined ,
364349 /*preserveConstEnums*/ true ,
365- /*keepComments*/ false ,
350+ /*keepComments*/ true ,
366351 /*noResolve*/ false ,
367- /*stripInternal*/ false ,
352+ /*stripInternal*/ true ,
368353 /*callback*/ function ( ) {
369354 jake . cpR ( servicesFile , nodePackageFile , { silent : true } ) ;
370- } ) ;
371355
372- var nodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript.d.ts" ) ;
373- var standaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
374- var internalNodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript_internal.d.ts" ) ;
375- var internalStandaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices_internal.d.ts" ) ;
376- var tempDirPath = path . join ( builtLocalDirectory , "temptempdir" ) ;
377- compileFile ( nodeDefinitionsFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) ,
378- /*prefixes*/ undefined ,
379- /*useBuiltCompiler*/ true ,
380- /*noOutFile*/ true ,
381- /*generateDeclarations*/ true ,
382- /*outDir*/ tempDirPath ,
383- /*preserveConstEnums*/ true ,
384- /*keepComments*/ true ,
385- /*noResolve*/ true ,
386- /*stripInternal*/ true ,
387- /*callback*/ function ( ) {
388- function makeDefinitionFiles ( definitionsRoots , standaloneDefinitionsFile , nodeDefinitionsFile ) {
389- // Create the standalone definition file
390- concatenateFiles ( standaloneDefinitionsFile , definitionsRoots . map ( function ( f ) {
391- return path . join ( tempDirPath , f ) ;
392- } ) ) ;
393- prependFile ( copyright , standaloneDefinitionsFile ) ;
394-
395- // Create the node definition file by replacing 'ts' module with '"typescript"' as a module.
396- jake . cpR ( standaloneDefinitionsFile , nodeDefinitionsFile , { silent : true } ) ;
397- var definitionFileContents = fs . readFileSync ( nodeDefinitionsFile ) . toString ( ) ;
398- definitionFileContents = definitionFileContents . replace ( / d e c l a r e m o d u l e t s / g, 'declare module "typescript"' ) ;
399- fs . writeFileSync ( nodeDefinitionsFile , definitionFileContents ) ;
400- }
356+ prependFile ( copyright , standaloneDefinitionsFile ) ;
401357
402- // Create the public definition files
403- makeDefinitionFiles ( definitionsRoots , standaloneDefinitionsFile , nodeDefinitionsFile ) ;
404-
405- // Create the internal definition files
406- makeDefinitionFiles ( internalDefinitionsRoots , internalStandaloneDefinitionsFile , internalNodeDefinitionsFile ) ;
358+ // Create the node definition file by replacing 'ts' module with '"typescript"' as a module.
359+ jake . cpR ( standaloneDefinitionsFile , nodeDefinitionsFile , { silent : true } ) ;
360+ var definitionFileContents = fs . readFileSync ( nodeDefinitionsFile ) . toString ( ) ;
361+ definitionFileContents = definitionFileContents . replace ( / d e c l a r e m o d u l e t s / g, 'declare module "typescript"' ) ;
362+ fs . writeFileSync ( nodeDefinitionsFile , definitionFileContents ) ;
363+ } ) ;
407364
408- // Delete the temp dir
409- jake . rmRf ( tempDirPath , { silent : true } ) ;
410- } ) ;
411365
412366var serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
413367compileFile ( serverFile , serverSources , [ builtLocalDirectory , copyright ] . concat ( serverSources ) , /*prefixes*/ [ copyright ] , /*useBuiltCompiler*/ true ) ;
0 commit comments