@@ -14,7 +14,7 @@ const { src, dest, task, parallel, series, watch } = require("gulp");
14
14
const { append, transform } = require ( "gulp-insert" ) ;
15
15
const { browserify } = require ( "./scripts/build/browserify" ) ;
16
16
const { 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" ) ;
18
18
const { runConsoleTests, cleanTestDirs, writeTestConfigFile, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require ( "./scripts/build/tests" ) ;
19
19
const { buildProject, cleanProject, watchProject } = require ( "./scripts/build/projects" ) ;
20
20
const cmdLineOptions = require ( "./scripts/build/options" ) ;
@@ -114,21 +114,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno
114
114
const preBuild = cmdLineOptions . lkg ? lkgPreBuild : localPreBuild ;
115
115
116
116
const 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
-
127
117
// 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 ) ;
132
119
133
120
// create typescriptServices.js
134
121
const createTypescriptServicesJs = ( ) => src ( "built/local/typescriptServices.out.js" )
@@ -139,15 +126,6 @@ const buildServices = (() => {
139
126
. pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
140
127
. pipe ( dest ( "built/local" ) ) ;
141
128
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
-
151
129
// create typescriptServices.d.ts
152
130
const createTypescriptServicesDts = ( ) => src ( "built/local/typescriptServices.out.d.ts" )
153
131
. pipe ( newer ( "built/local/typescriptServices.d.ts" ) )
@@ -156,14 +134,6 @@ const buildServices = (() => {
156
134
. pipe ( rename ( "typescriptServices.d.ts" ) )
157
135
. pipe ( dest ( "built/local" ) ) ;
158
136
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
-
167
137
// create typescript.js
168
138
const createTypescriptJs = ( ) => src ( "built/local/typescriptServices.js" )
169
139
. pipe ( newer ( "built/local/typescript.js" ) )
@@ -172,57 +142,27 @@ const buildServices = (() => {
172
142
. pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
173
143
. pipe ( dest ( "built/local" ) ) ;
174
144
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
-
183
145
// create typescript.d.ts
184
146
const createTypescriptDts = ( ) => src ( "built/local/typescriptServices.d.ts" )
185
147
. pipe ( newer ( "built/local/typescript.d.ts" ) )
186
148
. pipe ( append ( "\nexport = ts;" ) )
187
149
. pipe ( rename ( "typescript.d.ts" ) )
188
150
. pipe ( dest ( "built/local" ) ) ;
189
151
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
-
197
152
// create typescript_standalone.d.ts
198
153
const createTypescriptStandaloneDts = ( ) => src ( "built/local/typescriptServices.d.ts" )
199
154
. pipe ( newer ( "built/local/typescript_standalone.d.ts" ) )
200
155
. 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"' ) ) )
201
156
. pipe ( rename ( "typescript_standalone.d.ts" ) )
202
157
. pipe ( dest ( "built/local" ) ) ;
203
158
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
-
211
159
return series (
212
- flattenServicesConfig ,
213
160
buildTypescriptServicesOut ,
214
161
createTypescriptServicesJs ,
215
162
createTypescriptServicesDts ,
216
163
createTypescriptJs ,
217
164
createTypescriptDts ,
218
165
createTypescriptStandaloneDts ,
219
- //localPreBuild,
220
- //buildTypescriptServicesOut1,
221
- //createTypescriptServicesJs1,
222
- //createTypescriptServicesDts1,
223
- //createTypescriptJs1,
224
- //createTypescriptDts1,
225
- //createTypescriptStandaloneDts1,
226
166
) ;
227
167
} ) ( ) ;
228
168
task ( "services" , series ( preBuild , buildServices ) ) ;
@@ -236,20 +176,13 @@ const cleanServices = async () => {
236
176
await cleanProject ( "built/local/typescriptServices.tsconfig.json" ) ;
237
177
}
238
178
await del ( [
239
- "built/local/typescriptServices.tsconfig.json" ,
240
179
"built/local/typescriptServices.out.js" ,
241
180
"built/local/typescriptServices.out.d.ts" ,
181
+ "built/local/typescriptServices.out.tsbuildinfo" ,
242
182
"built/local/typescriptServices.js" ,
243
183
"built/local/typescript.js" ,
244
184
"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"
253
186
] ) ;
254
187
} ;
255
188
cleanTasks . push ( cleanServices ) ;
@@ -305,23 +238,8 @@ task("watch-min").flags = {
305
238
}
306
239
307
240
const 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
-
320
241
// 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 ) ;
325
243
326
244
// create tsserverlibrary.js
327
245
const createServerLibraryJs = ( ) => src ( "built/local/tsserverlibrary.out.js" )
@@ -332,15 +250,6 @@ const buildLssl = (() => {
332
250
. pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
333
251
. pipe ( dest ( "built/local" ) ) ;
334
252
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
-
344
253
// create tsserverlibrary.d.ts
345
254
const createServerLibraryDts = ( ) => src ( "built/local/tsserverlibrary.out.d.ts" )
346
255
. pipe ( newer ( "built/local/tsserverlibrary.d.ts" ) )
@@ -350,24 +259,10 @@ const buildLssl = (() => {
350
259
. pipe ( rename ( "tsserverlibrary.d.ts" ) )
351
260
. pipe ( dest ( "built/local" ) ) ;
352
261
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
-
362
262
return series (
363
- flattenTsServerProject ,
364
263
buildServerLibraryOut ,
365
264
createServerLibraryJs ,
366
265
createServerLibraryDts ,
367
- //localPreBuild,
368
- //buildServerLibraryOut1,
369
- //createServerLibraryJs1,
370
- //createServerLibraryDts1
371
266
) ;
372
267
} ) ( ) ;
373
268
task ( "lssl" , series ( preBuild , buildLssl ) ) ;
@@ -381,9 +276,9 @@ const cleanLssl = async () => {
381
276
await cleanProject ( "built/local/tsserverlibrary.tsconfig.json" ) ;
382
277
}
383
278
await del ( [
384
- "built/local/tsserverlibrary.tsconfig.json" ,
385
279
"built/local/tsserverlibrary.out.js" ,
386
280
"built/local/tsserverlibrary.out.d.ts" ,
281
+ "built/local/tsserverlibrary.out.tsbuildinfo" ,
387
282
"built/local/tsserverlibrary.js" ,
388
283
"built/local/tsserverlibrary.d.ts" ,
389
284
"built/local/tsserverlibrary/tsserverlibrary.js" ,
0 commit comments