Skip to content

Commit d783355

Browse files
committed
Update gulp to build using this branch
1 parent ba1dc9e commit d783355

File tree

5 files changed

+12
-112
lines changed

5 files changed

+12
-112
lines changed

Gulpfile.js

Lines changed: 6 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { src, dest, task, parallel, series, watch } = require("gulp");
1414
const { append, transform } = require("gulp-insert");
1515
const { browserify } = require("./scripts/build/browserify");
1616
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");
1818
const { runConsoleTests, cleanTestDirs, writeTestConfigFile, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests");
1919
const { buildProject, cleanProject, watchProject } = require("./scripts/build/projects");
2020
const cmdLineOptions = require("./scripts/build/options");
@@ -114,21 +114,8 @@ const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagno
114114
const preBuild = cmdLineOptions.lkg ? lkgPreBuild : localPreBuild;
115115

116116
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-
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*)(export )?const enum (\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(/declare (namespace|module) ts/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(/declare (namespace|module) ts/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
})();
228168
task("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
};
255188
cleanTasks.push(cleanServices);
@@ -305,23 +238,8 @@ task("watch-min").flags = {
305238
}
306239

307240
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-
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*)(export )?const enum (\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
})();
373268
task("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",

src/cancellationToken/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"declaration": false,
88
"declarationMap": false,
99
"removeComments": true,
10+
"incremental": false,
1011
"module": "commonjs",
1112
"types": [
1213
"node"

src/tsconfig-library-base.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"extends": "./tsconfig-base",
33
"compilerOptions": {
44
"declarationMap": false,
5+
"sourceMap": false,
56
"composite": false,
7+
"incremental": true,
68
"declaration": true,
79
"stripInternal": true
810
}

src/tsconfig-noncomposite-base.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"declaration": false,
55
"declarationMap": false,
6-
"composite": false
6+
"composite": false,
7+
"incremental": true
78
}
89
}

src/watchGuard/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "../tsconfig-noncomposite-base",
33
"compilerOptions": {
44
"removeComments": true,
5+
"incremental": false,
56
"outFile": "../../built/local/watchGuard.js",
67
"types": [
78
"node"

0 commit comments

Comments
 (0)