@@ -127,6 +127,9 @@ const buildServices = (() => {
127127 // build typescriptServices.out.js
128128 const buildTypescriptServicesOut = ( ) => buildProject ( "built/local/typescriptServices.tsconfig.json" , cmdLineOptions ) ;
129129
130+ // build typescriptServices/typescriptServices.js
131+ const buildTypescriptServicesOut1 = ( ) => buildProject ( "src/typescriptServices/tsconfig.json" , { ...cmdLineOptions , lkg : false } ) ;
132+
130133 // create typescriptServices.js
131134 const createTypescriptServicesJs = ( ) => src ( "built/local/typescriptServices.out.js" )
132135 . pipe ( newer ( "built/local/typescriptServices.js" ) )
@@ -136,6 +139,15 @@ const buildServices = (() => {
136139 . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
137140 . pipe ( dest ( "built/local" ) ) ;
138141
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+
139151 // create typescriptServices.d.ts
140152 const createTypescriptServicesDts = ( ) => src ( "built/local/typescriptServices.out.d.ts" )
141153 . pipe ( newer ( "built/local/typescriptServices.d.ts" ) )
@@ -144,6 +156,14 @@ const buildServices = (() => {
144156 . pipe ( rename ( "typescriptServices.d.ts" ) )
145157 . pipe ( dest ( "built/local" ) ) ;
146158
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+
147167 // create typescript.js
148168 const createTypescriptJs = ( ) => src ( "built/local/typescriptServices.js" )
149169 . pipe ( newer ( "built/local/typescript.js" ) )
@@ -152,28 +172,58 @@ const buildServices = (() => {
152172 . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
153173 . pipe ( dest ( "built/local" ) ) ;
154174
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+
155183 // create typescript.d.ts
156184 const createTypescriptDts = ( ) => src ( "built/local/typescriptServices.d.ts" )
157185 . pipe ( newer ( "built/local/typescript.d.ts" ) )
158186 . pipe ( append ( "\nexport = ts;" ) )
159187 . pipe ( rename ( "typescript.d.ts" ) )
160188 . pipe ( dest ( "built/local" ) ) ;
161189
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+
162197 // create typescript_standalone.d.ts
163198 const createTypescriptStandaloneDts = ( ) => src ( "built/local/typescriptServices.d.ts" )
164199 . pipe ( newer ( "built/local/typescript_standalone.d.ts" ) )
165200 . 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"' ) ) )
166201 . pipe ( rename ( "typescript_standalone.d.ts" ) )
167202 . pipe ( dest ( "built/local" ) ) ;
168203
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+
169211 return series (
170212 flattenServicesConfig ,
171213 buildTypescriptServicesOut ,
172214 createTypescriptServicesJs ,
173215 createTypescriptServicesDts ,
174216 createTypescriptJs ,
175217 createTypescriptDts ,
176- createTypescriptStandaloneDts ) ;
218+ createTypescriptStandaloneDts ,
219+ localPreBuild ,
220+ buildTypescriptServicesOut1 ,
221+ createTypescriptServicesJs1 ,
222+ createTypescriptServicesDts1 ,
223+ createTypescriptJs1 ,
224+ createTypescriptDts1 ,
225+ createTypescriptStandaloneDts1 ,
226+ ) ;
177227} ) ( ) ;
178228task ( "services" , series ( preBuild , buildServices ) ) ;
179229task ( "services" ) . description = "Builds the language service" ;
@@ -193,6 +243,13 @@ const cleanServices = async () => {
193243 "built/local/typescript.js" ,
194244 "built/local/typescript.d.ts" ,
195245 "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" ,
196253 ] ) ;
197254} ;
198255cleanTasks . push ( cleanServices ) ;
@@ -263,6 +320,9 @@ const buildLssl = (() => {
263320 // build tsserverlibrary.out.js
264321 const buildServerLibraryOut = ( ) => buildProject ( "built/local/tsserverlibrary.tsconfig.json" , cmdLineOptions ) ;
265322
323+ // build tsserverlibrary1.out.js
324+ const buildServerLibraryOut1 = ( ) => buildProject ( "src/tsserverlibrary/tsconfig.json" , { ...cmdLineOptions , lkg : false } ) ;
325+
266326 // create tsserverlibrary.js
267327 const createServerLibraryJs = ( ) => src ( "built/local/tsserverlibrary.out.js" )
268328 . pipe ( newer ( "built/local/tsserverlibrary.js" ) )
@@ -272,6 +332,15 @@ const buildLssl = (() => {
272332 . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
273333 . pipe ( dest ( "built/local" ) ) ;
274334
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+
275344 // create tsserverlibrary.d.ts
276345 const createServerLibraryDts = ( ) => src ( "built/local/tsserverlibrary.out.d.ts" )
277346 . pipe ( newer ( "built/local/tsserverlibrary.d.ts" ) )
@@ -281,11 +350,25 @@ const buildLssl = (() => {
281350 . pipe ( rename ( "tsserverlibrary.d.ts" ) )
282351 . pipe ( dest ( "built/local" ) ) ;
283352
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+
284362 return series (
285363 flattenTsServerProject ,
286364 buildServerLibraryOut ,
287365 createServerLibraryJs ,
288- createServerLibraryDts ) ;
366+ createServerLibraryDts ,
367+ localPreBuild ,
368+ buildServerLibraryOut1 ,
369+ createServerLibraryJs1 ,
370+ createServerLibraryDts1
371+ ) ;
289372} ) ( ) ;
290373task ( "lssl" , series ( preBuild , buildLssl ) ) ;
291374task ( "lssl" ) . description = "Builds language service server library" ;
@@ -303,6 +386,11 @@ const cleanLssl = async () => {
303386 "built/local/tsserverlibrary.out.d.ts" ,
304387 "built/local/tsserverlibrary.js" ,
305388 "built/local/tsserverlibrary.d.ts" ,
389+ "built/local/tsserverlibrary/tsserverlibrary.js" ,
390+ "built/local/tsserverlibrary/tsserverlibrary.js.map" ,
391+ "built/local/tsserverlibrary/tsserverlibrary.d.ts" ,
392+ "built/local/tsserverlibrary1.js" ,
393+ "built/local/tsserverlibrary1.d.ts" ,
306394 ] ) ;
307395} ;
308396cleanTasks . push ( cleanLssl ) ;
0 commit comments