@@ -14,7 +14,7 @@ const { src, dest, task, parallel, series, watch } = require("gulp");
1414const { append, transform } = require ( "gulp-insert" ) ;
1515const { browserify } = require ( "./scripts/build/browserify" ) ;
1616const { prependFile } = require ( "./scripts/build/prepend" ) ;
17- const { exec, readJson, needsUpdate, getDiffTool, getDirSize, flatten , rm } = require ( "./scripts/build/utils" ) ;
17+ const { exec, readJson, needsUpdate, getDiffTool, getDirSize, rm } = require ( "./scripts/build/utils" ) ;
1818const { runConsoleTests, cleanTestDirs, writeTestConfigFile, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require ( "./scripts/build/tests" ) ;
1919const { buildProject, cleanProject, watchProject } = require ( "./scripts/build/projects" ) ;
2020const cmdLineOptions = require ( "./scripts/build/options" ) ;
@@ -114,21 +114,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno
114114const preBuild = cmdLineOptions . lkg ? lkgPreBuild : localPreBuild ;
115115
116116const buildServices = ( ( ) => {
117- // flatten the services project
118- const flattenServicesConfig = async ( ) => flatten ( "src/services/tsconfig.json" , "built/local/typescriptServices.tsconfig.json" , {
119- compilerOptions : {
120- "removeComments" : false ,
121- "stripInternal" : true ,
122- "declarationMap" : false ,
123- "outFile" : "typescriptServices.out.js"
124- }
125- } ) ;
126-
127117 // build typescriptServices.out.js
128- const buildTypescriptServicesOut = ( ) => buildProject ( "built/local/typescriptServices.tsconfig.json" , cmdLineOptions ) ;
129-
130- // build typescriptServices/typescriptServices.js
131- const buildTypescriptServicesOut1 = ( ) => buildProject ( "src/typescriptServices/tsconfig.json" , { ...cmdLineOptions , lkg : false } ) ;
118+ const buildTypescriptServicesOut = ( ) => buildProject ( "src/typescriptServices/tsconfig.json" , cmdLineOptions ) ;
132119
133120 // create typescriptServices.js
134121 const createTypescriptServicesJs = ( ) => src ( "built/local/typescriptServices.out.js" )
@@ -139,15 +126,6 @@ const buildServices = (() => {
139126 . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
140127 . pipe ( dest ( "built/local" ) ) ;
141128
142- // create typescriptServices1.js
143- const createTypescriptServicesJs1 = ( ) => src ( "built/local/typescriptServices/typescriptServices.js" )
144- . pipe ( newer ( "built/local/typescriptServices1.js" ) )
145- . pipe ( sourcemaps . init ( { loadMaps : true } ) )
146- . pipe ( prependFile ( copyright ) )
147- . pipe ( rename ( "typescriptServices1.js" ) )
148- . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
149- . pipe ( dest ( "built/local" ) ) ;
150-
151129 // create typescriptServices.d.ts
152130 const createTypescriptServicesDts = ( ) => src ( "built/local/typescriptServices.out.d.ts" )
153131 . pipe ( newer ( "built/local/typescriptServices.d.ts" ) )
@@ -156,14 +134,6 @@ const buildServices = (() => {
156134 . pipe ( rename ( "typescriptServices.d.ts" ) )
157135 . pipe ( dest ( "built/local" ) ) ;
158136
159- // create typescriptServices1.d.ts
160- const createTypescriptServicesDts1 = ( ) => src ( "built/local/typescriptServices/typescriptServices.d.ts" )
161- . pipe ( newer ( "built/local/typescriptServices1.d.ts" ) )
162- . pipe ( prependFile ( copyright ) )
163- . pipe ( transform ( content => content . replace ( / ^ ( \s * ) ( e x p o r t ) ? c o n s t e n u m ( \S + ) { ( \s * ) $ / gm, "$1$2enum $3 {$4" ) ) )
164- . pipe ( rename ( "typescriptServices1.d.ts" ) )
165- . pipe ( dest ( "built/local" ) ) ;
166-
167137 // create typescript.js
168138 const createTypescriptJs = ( ) => src ( "built/local/typescriptServices.js" )
169139 . pipe ( newer ( "built/local/typescript.js" ) )
@@ -172,57 +142,27 @@ const buildServices = (() => {
172142 . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
173143 . pipe ( dest ( "built/local" ) ) ;
174144
175- // create typescript1.js
176- const createTypescriptJs1 = ( ) => src ( "built/local/typescriptServices1.js" )
177- . pipe ( newer ( "built/local/typescript1.js" ) )
178- . pipe ( sourcemaps . init ( { loadMaps : true } ) )
179- . pipe ( rename ( "typescript1.js" ) )
180- . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
181- . pipe ( dest ( "built/local" ) ) ;
182-
183145 // create typescript.d.ts
184146 const createTypescriptDts = ( ) => src ( "built/local/typescriptServices.d.ts" )
185147 . pipe ( newer ( "built/local/typescript.d.ts" ) )
186148 . pipe ( append ( "\nexport = ts;" ) )
187149 . pipe ( rename ( "typescript.d.ts" ) )
188150 . pipe ( dest ( "built/local" ) ) ;
189151
190- // create typescript1.d.ts
191- const createTypescriptDts1 = ( ) => src ( "built/local/typescriptServices1.d.ts" )
192- . pipe ( newer ( "built/local/typescript1.d.ts" ) )
193- . pipe ( append ( "\nexport = ts;" ) )
194- . pipe ( rename ( "typescript1.d.ts" ) )
195- . pipe ( dest ( "built/local" ) ) ;
196-
197152 // create typescript_standalone.d.ts
198153 const createTypescriptStandaloneDts = ( ) => src ( "built/local/typescriptServices.d.ts" )
199154 . pipe ( newer ( "built/local/typescript_standalone.d.ts" ) )
200155 . pipe ( transform ( content => content . replace ( / d e c l a r e ( n a m e s p a c e | m o d u l e ) t s / g, 'declare module "typescript"' ) ) )
201156 . pipe ( rename ( "typescript_standalone.d.ts" ) )
202157 . pipe ( dest ( "built/local" ) ) ;
203158
204- // create typescript_standalone.d.ts
205- const createTypescriptStandaloneDts1 = ( ) => src ( "built/local/typescriptServices1.d.ts" )
206- . pipe ( newer ( "built/local/typescript_standalone1.d.ts" ) )
207- . pipe ( transform ( content => content . replace ( / d e c l a r e ( n a m e s p a c e | m o d u l e ) t s / g, 'declare module "typescript"' ) ) )
208- . pipe ( rename ( "typescript_standalone1.d.ts" ) )
209- . pipe ( dest ( "built/local" ) ) ;
210-
211159 return series (
212- flattenServicesConfig ,
213160 buildTypescriptServicesOut ,
214161 createTypescriptServicesJs ,
215162 createTypescriptServicesDts ,
216163 createTypescriptJs ,
217164 createTypescriptDts ,
218165 createTypescriptStandaloneDts ,
219- //localPreBuild,
220- //buildTypescriptServicesOut1,
221- //createTypescriptServicesJs1,
222- //createTypescriptServicesDts1,
223- //createTypescriptJs1,
224- //createTypescriptDts1,
225- //createTypescriptStandaloneDts1,
226166 ) ;
227167} ) ( ) ;
228168task ( "services" , series ( preBuild , buildServices ) ) ;
@@ -236,20 +176,13 @@ const cleanServices = async () => {
236176 await cleanProject ( "built/local/typescriptServices.tsconfig.json" ) ;
237177 }
238178 await del ( [
239- "built/local/typescriptServices.tsconfig.json" ,
240179 "built/local/typescriptServices.out.js" ,
241180 "built/local/typescriptServices.out.d.ts" ,
181+ "built/local/typescriptServices.out.tsbuildinfo" ,
242182 "built/local/typescriptServices.js" ,
243183 "built/local/typescript.js" ,
244184 "built/local/typescript.d.ts" ,
245- "built/local/typescript_standalone.d.ts" ,
246- "built/local/typescriptServices/typescriptServices.js" ,
247- "built/local/typescriptServices/typescriptServices.js.map" ,
248- "built/local/typescriptServices/typescriptServices.d.ts" ,
249- "built/local/typescriptServices1.js" ,
250- "built/local/typescript1.js" ,
251- "built/local/typescript1.d.ts" ,
252- "built/local/typescript_standalone1.d.ts" ,
185+ "built/local/typescript_standalone.d.ts"
253186 ] ) ;
254187} ;
255188cleanTasks . push ( cleanServices ) ;
@@ -305,23 +238,8 @@ task("watch-min").flags = {
305238}
306239
307240const buildLssl = ( ( ) => {
308- // flatten the server project
309- const flattenTsServerProject = async ( ) => flatten ( "src/tsserver/tsconfig.json" , "built/local/tsserverlibrary.tsconfig.json" , {
310- exclude : [ "src/tsserver/server.ts" ] ,
311- compilerOptions : {
312- "removeComments" : false ,
313- "stripInternal" : true ,
314- "declaration" : true ,
315- "declarationMap" : false ,
316- "outFile" : "tsserverlibrary.out.js"
317- }
318- } ) ;
319-
320241 // build tsserverlibrary.out.js
321- const buildServerLibraryOut = ( ) => buildProject ( "built/local/tsserverlibrary.tsconfig.json" , cmdLineOptions ) ;
322-
323- // build tsserverlibrary1.out.js
324- const buildServerLibraryOut1 = ( ) => buildProject ( "src/tsserverlibrary/tsconfig.json" , { ...cmdLineOptions , lkg : false } ) ;
242+ const buildServerLibraryOut = ( ) => buildProject ( "src/tsserverlibrary/tsconfig.json" , cmdLineOptions ) ;
325243
326244 // create tsserverlibrary.js
327245 const createServerLibraryJs = ( ) => src ( "built/local/tsserverlibrary.out.js" )
@@ -332,15 +250,6 @@ const buildLssl = (() => {
332250 . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
333251 . pipe ( dest ( "built/local" ) ) ;
334252
335- // create tsserverlibrary1.js
336- const createServerLibraryJs1 = ( ) => src ( "built/local/tsserverlibrary/tsserverlibrary.js" )
337- . pipe ( newer ( "built/local/tsserverlibrary1.js" ) )
338- . pipe ( sourcemaps . init ( { loadMaps : true } ) )
339- . pipe ( prependFile ( copyright ) )
340- . pipe ( rename ( "tsserverlibrary1.js" ) )
341- . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
342- . pipe ( dest ( "built/local" ) ) ;
343-
344253 // create tsserverlibrary.d.ts
345254 const createServerLibraryDts = ( ) => src ( "built/local/tsserverlibrary.out.d.ts" )
346255 . pipe ( newer ( "built/local/tsserverlibrary.d.ts" ) )
@@ -350,24 +259,10 @@ const buildLssl = (() => {
350259 . pipe ( rename ( "tsserverlibrary.d.ts" ) )
351260 . pipe ( dest ( "built/local" ) ) ;
352261
353- // create tsserverlibrary1.d.ts
354- const createServerLibraryDts1 = ( ) => src ( "built/local/tsserverlibrary/tsserverlibrary.d.ts" )
355- . pipe ( newer ( "built/local/tsserverlibrary1.d.ts" ) )
356- . pipe ( prependFile ( copyright ) )
357- . pipe ( transform ( content => content . replace ( / ^ ( \s * ) ( e x p o r t ) ? c o n s t e n u m ( \S + ) { ( \s * ) $ / gm, "$1$2enum $3 {$4" ) ) )
358- . pipe ( append ( "\nexport = ts;\nexport as namespace ts;" ) )
359- . pipe ( rename ( "tsserverlibrary1.d.ts" ) )
360- . pipe ( dest ( "built/local" ) ) ;
361-
362262 return series (
363- flattenTsServerProject ,
364263 buildServerLibraryOut ,
365264 createServerLibraryJs ,
366265 createServerLibraryDts ,
367- //localPreBuild,
368- //buildServerLibraryOut1,
369- //createServerLibraryJs1,
370- //createServerLibraryDts1
371266 ) ;
372267} ) ( ) ;
373268task ( "lssl" , series ( preBuild , buildLssl ) ) ;
@@ -381,9 +276,9 @@ const cleanLssl = async () => {
381276 await cleanProject ( "built/local/tsserverlibrary.tsconfig.json" ) ;
382277 }
383278 await del ( [
384- "built/local/tsserverlibrary.tsconfig.json" ,
385279 "built/local/tsserverlibrary.out.js" ,
386280 "built/local/tsserverlibrary.out.d.ts" ,
281+ "built/local/tsserverlibrary.out.tsbuildinfo" ,
387282 "built/local/tsserverlibrary.js" ,
388283 "built/local/tsserverlibrary.d.ts" ,
389284 "built/local/tsserverlibrary/tsserverlibrary.js" ,
0 commit comments