@@ -95,6 +95,13 @@ var definitionsRoots = [
9595 "services/services.d.ts" ,
9696] ;
9797
98+ var internalDefinitionsRoots = [
99+ "compiler/core.d.ts" ,
100+ "compiler/sys.d.ts" ,
101+ "compiler/utilities.d.ts" ,
102+ "services/utilities.d.ts" ,
103+ ] ;
104+
98105var harnessSources = [
99106 "harness.ts" ,
100107 "sourceMapRecorder.ts" ,
@@ -322,6 +329,8 @@ compileFile(servicesFile, servicesSources,[builtLocalDirectory, copyright].conca
322329
323330var nodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript.d.ts" ) ;
324331var standaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices.d.ts" ) ;
332+ var internalNodeDefinitionsFile = path . join ( builtLocalDirectory , "typescript_internal.d.ts" ) ;
333+ var internalStandaloneDefinitionsFile = path . join ( builtLocalDirectory , "typescriptServices_internal.d.ts" ) ;
325334var tempDirPath = path . join ( builtLocalDirectory , "temptempdir" ) ;
326335compileFile ( nodeDefinitionsFile , servicesSources , [ builtLocalDirectory , copyright ] . concat ( servicesSources ) ,
327336 /*prefixes*/ undefined ,
@@ -333,16 +342,25 @@ compileFile(nodeDefinitionsFile, servicesSources,[builtLocalDirectory, copyright
333342 /*keepComments*/ true ,
334343 /*noResolve*/ true ,
335344 /*callback*/ function ( ) {
336- concatenateFiles ( standaloneDefinitionsFile , definitionsRoots . map ( function ( f ) {
337- return path . join ( tempDirPath , f ) ;
338- } ) ) ;
339- prependFile ( copyright , standaloneDefinitionsFile ) ;
345+ function makeDefinitionFiles ( definitionsRoots , standaloneDefinitionsFile , nodeDefinitionsFile ) {
346+ // Create the standalone definition file
347+ concatenateFiles ( standaloneDefinitionsFile , definitionsRoots . map ( function ( f ) {
348+ return path . join ( tempDirPath , f ) ;
349+ } ) ) ;
350+ prependFile ( copyright , standaloneDefinitionsFile ) ;
351+
352+ // Create the node definition file by replacing 'ts' module with '"typescript"' as a module.
353+ jake . cpR ( standaloneDefinitionsFile , nodeDefinitionsFile , { silent : true } ) ;
354+ var definitionFileContents = fs . readFileSync ( nodeDefinitionsFile ) . toString ( ) ;
355+ definitionFileContents = definitionFileContents . replace ( / d e c l a r e m o d u l e t s / g, 'declare module "typescript"' ) ;
356+ fs . writeFileSync ( nodeDefinitionsFile , definitionFileContents ) ;
357+ }
340358
341- // Create the node definition file by replacing 'ts' module with '"typescript"' as a module.
342- jake . cpR ( standaloneDefinitionsFile , nodeDefinitionsFile , { silent : true } ) ;
343- var definitionFileContents = fs . readFileSync ( nodeDefinitionsFile ) . toString ( ) ;
344- definitionFileContents = definitionFileContents . replace ( / d e c l a r e m o d u l e t s / g , 'declare module "typescript"' ) ;
345- fs . writeFileSync ( nodeDefinitionsFile , definitionFileContents ) ;
359+ // Create the public definition files
360+ makeDefinitionFiles ( definitionsRoots , standaloneDefinitionsFile , nodeDefinitionsFile ) ;
361+
362+ // Create the internal definition files
363+ makeDefinitionFiles ( internalDefinitionsRoots , internalStandaloneDefinitionsFile , internalNodeDefinitionsFile ) ;
346364
347365 // Delete the temp dir
348366 jake . rmRf ( tempDirPath , { silent : true } ) ;
@@ -401,7 +419,7 @@ task("generate-spec", [specMd])
401419// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
402420desc ( "Makes a new LKG out of the built js files" ) ;
403421task ( "LKG" , [ "clean" , "release" , "local" ] . concat ( libraryTargets ) , function ( ) {
404- var expectedFiles = [ tscFile , servicesFile , nodeDefinitionsFile , standaloneDefinitionsFile ] . concat ( libraryTargets ) ;
422+ var expectedFiles = [ tscFile , servicesFile , nodeDefinitionsFile , standaloneDefinitionsFile , internalNodeDefinitionsFile , internalStandaloneDefinitionsFile ] . concat ( libraryTargets ) ;
405423 var missingFiles = expectedFiles . filter ( function ( f ) {
406424 return ! fs . existsSync ( f ) ;
407425 } ) ;
0 commit comments