Skip to content

Commit 17eb536

Browse files
committed
Get codebase building pre bundling
1 parent d0ac1c4 commit 17eb536

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+612
-1198
lines changed

Gulpfile.mjs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const { src, dest, task, parallel, series, watch } = gulp;
2121
const copyright = "CopyrightNotice.txt";
2222
const cleanTasks = [];
2323

24+
const testRunner = "./built/local/testRunner/runner.js";
25+
2426
const buildScripts = () => buildProject("scripts");
2527
task("scripts", buildScripts);
2628
task("scripts").description = "Builds files in the 'scripts' folder.";
@@ -91,6 +93,14 @@ const localize = async () => {
9193
}
9294
};
9395

96+
const preSrc = parallel(generateLibs, series(buildScripts, generateDiagnostics, localize));
97+
const buildSrc = () => buildProject("src");
98+
99+
task("build-src", series(preSrc, buildSrc));
100+
101+
const cleanSrc = () => cleanProject("src");
102+
task("clean-src", cleanSrc);
103+
94104
const buildDebugTools = () => buildProject("src/debug");
95105
const cleanDebugTools = () => cleanProject("src/debug");
96106
cleanTasks.push(cleanDebugTools);
@@ -405,8 +415,8 @@ task("watch-local").flags = {
405415
const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
406416
preTest.displayName = "preTest";
407417

408-
const runTests = () => runConsoleTests("built/local/run.js", "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ false);
409-
task("runtests", series(preBuild, preTest, runTests));
418+
const runTests = () => runConsoleTests(testRunner, "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ false);
419+
task("runtests", series(/*preBuild, preTest,*/ task("build-src"), runTests)); // TODO(jakebailey): fix this for modules
410420
task("runtests").description = "Runs the tests using the built run.js file.";
411421
task("runtests").flags = {
412422
"-t --tests=<regex>": "Pattern for tests to run.",
@@ -424,8 +434,8 @@ task("runtests").flags = {
424434
" --shardId": "1-based ID of this shard (default: 1)",
425435
};
426436

427-
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ cmdLineOptions.workers > 1, /*watchMode*/ false);
428-
task("runtests-parallel", series(preBuild, preTest, runTestsParallel));
437+
const runTestsParallel = () => runConsoleTests(testRunner, "min", /*runInParallel*/ cmdLineOptions.workers > 1, /*watchMode*/ false);
438+
task("runtests-parallel", series(/*preBuild, preTest,*/ task("build-src"), runTestsParallel)); // TODO(jakebailey): fix this for modules
429439
task("runtests-parallel").description = "Runs all the tests in parallel using the built run.js file.";
430440
task("runtests-parallel").flags = {
431441
" --light": "Run tests in light mode (fewer verifications, but tests run faster).",
@@ -550,10 +560,10 @@ task("publish-nightly").description = "Runs `npm publish --tag next` to create a
550560
// write some kind of trigger file that indicates build completion that we could listen for instead.
551561
const watchRuntests = () => watch(["built/local/*.js", "tests/cases/**/*.ts", "tests/cases/**/tsconfig.json"], { delay: 5000 }, async () => {
552562
if (cmdLineOptions.tests || cmdLineOptions.failed) {
553-
await runConsoleTests("built/local/run.js", "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ true);
563+
await runConsoleTests(testRunner, "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ true);
554564
}
555565
else {
556-
await runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ true);
566+
await runConsoleTests(testRunner, "min", /*runInParallel*/ true, /*watchMode*/ true);
557567
}
558568
});
559569
task("watch", series(preBuild, preTest, parallel(watchLib, watchDiagnostics, watchServices, watchLssl, watchTests, watchRuntests)));

src/cancellationToken/cancellationToken.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference types="node"/>
2-
31
import * as fs from "fs";
42

53
interface ServerCancellationToken {

src/cancellationToken/tsconfig.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
{
2-
"extends": "../tsconfig-noncomposite-base",
2+
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local/",
5-
"rootDir": ".",
6-
"composite": false,
7-
"declaration": false,
8-
"declarationMap": false,
9-
"removeComments": true,
10-
"incremental": false,
4+
"outDir": "../../built/local/cancellationToken",
115
"module": "commonjs",
126
"types": [
137
"node"
@@ -16,7 +10,5 @@
1610
"es6"
1711
]
1812
},
19-
"files": [
20-
"cancellationToken.ts"
21-
]
13+
"include": ["**/*"]
2214
}

src/compiler/sys.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,14 @@ export let sys: System = (() => {
15211521
}
15221522
},
15231523
getExecutingFilePath() {
1524-
return __filename;
1524+
// This function previously returned a path like `built/local/tsc.js`.
1525+
// Now, with a module output, this file is now `built/local/compiler/sys.js`.
1526+
// We want to return a file that looks like the old one, so that callers
1527+
// can locate other assets like the lib.d.ts files.
1528+
//
1529+
// TODO(jakebailey): replace this function with one that returns the path
1530+
// to the lib folder (or package path)?.
1531+
return _path.join(_path.dirname(__dirname), "fake.js");
15251532
},
15261533
getCurrentDirectory,
15271534
getDirectories,

src/compiler/tsconfig.json

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,12 @@
11
{
22
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local",
4+
"outDir": "../../built/local/compiler",
55
"types": ["node"]
66
},
77

88
"references": [
99
],
1010

11-
"files": [
12-
"corePublic.ts",
13-
"core.ts",
14-
"debug.ts",
15-
"semver.ts",
16-
"performanceCore.ts",
17-
"performance.ts",
18-
"perfLogger.ts",
19-
"tracing.ts",
20-
21-
"types.ts",
22-
"sys.ts",
23-
"path.ts",
24-
"diagnosticInformationMap.generated.ts",
25-
"scanner.ts",
26-
"utilitiesPublic.ts",
27-
"utilities.ts",
28-
"factory/baseNodeFactory.ts",
29-
"factory/parenthesizerRules.ts",
30-
"factory/nodeConverters.ts",
31-
"factory/nodeFactory.ts",
32-
"factory/emitNode.ts",
33-
"factory/emitHelpers.ts",
34-
"factory/nodeTests.ts",
35-
"factory/utilities.ts",
36-
"factory/utilitiesPublic.ts",
37-
"parser.ts",
38-
"commandLineParser.ts",
39-
"moduleNameResolver.ts",
40-
41-
"binder.ts",
42-
"symbolWalker.ts",
43-
"checker.ts",
44-
"visitorPublic.ts",
45-
"sourcemap.ts",
46-
"transformers/utilities.ts",
47-
"transformers/destructuring.ts",
48-
"transformers/taggedTemplate.ts",
49-
"transformers/ts.ts",
50-
"transformers/classFields.ts",
51-
"transformers/typeSerializer.ts",
52-
"transformers/legacyDecorators.ts",
53-
"transformers/es2017.ts",
54-
"transformers/es2018.ts",
55-
"transformers/es2019.ts",
56-
"transformers/es2020.ts",
57-
"transformers/es2021.ts",
58-
"transformers/esnext.ts",
59-
"transformers/jsx.ts",
60-
"transformers/es2016.ts",
61-
"transformers/es2015.ts",
62-
"transformers/es5.ts",
63-
"transformers/generators.ts",
64-
"transformers/module/module.ts",
65-
"transformers/module/system.ts",
66-
"transformers/module/esnextAnd2015.ts",
67-
"transformers/module/node.ts",
68-
"transformers/declarations/diagnostics.ts",
69-
"transformers/declarations.ts",
70-
"transformer.ts",
71-
"emitter.ts",
72-
"watchUtilities.ts",
73-
"program.ts",
74-
"builderStatePublic.ts",
75-
"builderState.ts",
76-
"builder.ts",
77-
"builderPublic.ts",
78-
"resolutionCache.ts",
79-
"moduleSpecifiers.ts",
80-
"watch.ts",
81-
"watchPublic.ts",
82-
"tsbuild.ts",
83-
"tsbuildPublic.ts",
84-
"_namespaces/ts.ts",
85-
"_namespaces/ts.moduleSpecifiers.ts",
86-
"_namespaces/ts.performance.ts"
87-
]
11+
"include": ["**/*"]
8812
}

src/compiler/tsconfig.release.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/debug/tsconfig.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
{
2-
"extends": "../tsconfig-library-base",
2+
"extends": "../tsconfig-base",
33
"compilerOptions": {
44
"target": "es2019",
55
"lib": ["es2019"],
6-
"outDir": "../../built/local",
7-
"declaration": false,
8-
"sourceMap": true
6+
"outDir": "../../built/local/debug"
97
},
10-
"files": [
11-
"dbg.ts",
12-
"_namespaces/Debug.ts"
13-
]
8+
"include": ["**/*"]
149
}

src/deprecatedCompat/tsconfig.json

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
{
22
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local",
4+
"outDir": "../../built/local/deprecatedCompat",
55
"experimentalDecorators": true
66
},
77
"references": [
88
{ "path": "../compiler" }
99
],
10-
"files": [
11-
"deprecations.ts",
12-
"4.0/nodeFactoryTopLevelExports.ts",
13-
"4.0/renamedNodeTests.ts",
14-
"4.0/renamedMapInterfaces.ts",
15-
"4.2/renamedNodeTests.ts",
16-
"4.2/abstractConstructorTypes.ts",
17-
"4.6/importTypeAssertions.ts",
18-
"4.7/typeParameterModifiers.ts",
19-
"4.8/mergeDecoratorsAndModifiers.ts",
20-
"_namespaces/ts.ts"
21-
]
22-
}
10+
"include": ["**/*"]
11+
}

src/dynamicImportCompat/tsconfig.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
{
2-
"extends": "../tsconfig-library-base",
2+
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local",
4+
"outDir": "../../built/local/dynamicImportCompat",
55
"rootDir": ".",
66
"target": "esnext",
77
"module": "esnext",
8-
"lib": ["esnext"],
9-
"declaration": false,
10-
"sourceMap": true,
11-
"tsBuildInfoFile": "../../built/local/dynamicImportCompat.tsbuildinfo"
8+
"lib": ["esnext"]
129
},
1310
"files": [
1411
"dynamicImportCompat.ts",

src/executeCommandLine/tsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
{
22
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local"
4+
"outDir": "../../built/local/executeCommandLine"
55
},
66

77
"references": [
88
{ "path": "../compiler" }
99
],
1010

11-
"files": [
12-
"executeCommandLine.ts",
13-
"_namespaces/ts.ts"
14-
]
11+
"include": ["**/*"]
1512
}

src/executeCommandLine/tsconfig.release.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/harness/tsconfig.json

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local",
4+
"outDir": "../../built/local/harness",
55
"types": [
66
"node", "mocha", "chai"
77
],
@@ -19,43 +19,5 @@
1919
{ "path": "../deprecatedCompat" },
2020
],
2121

22-
"files": [
23-
"collectionsImpl.ts",
24-
"util.ts",
25-
"documentsUtil.ts",
26-
"vpathUtil.ts",
27-
"vfsUtil.ts",
28-
"compilerImpl.ts",
29-
"evaluatorImpl.ts",
30-
"fakesHosts.ts",
31-
"client.ts",
32-
"findUpDir.ts",
33-
34-
"runnerbase.ts",
35-
"sourceMapRecorder.ts",
36-
"harnessGlobals.ts",
37-
"harnessUtils.ts",
38-
"harnessIO.ts",
39-
"harnessLanguageService.ts",
40-
"virtualFileSystemWithWatch.ts",
41-
"fourslashImpl.ts",
42-
"fourslashInterfaceImpl.ts",
43-
"typeWriter.ts",
44-
"_namespaces/ts.server.ts",
45-
"_namespaces/ts.ts",
46-
"_namespaces/collections.ts",
47-
"_namespaces/compiler.ts",
48-
"_namespaces/documents.ts",
49-
"_namespaces/evaluator.ts",
50-
"_namespaces/fakes.ts",
51-
"_namespaces/Utils.ts",
52-
"_namespaces/FourSlash.ts",
53-
"_namespaces/FourSlashInterface.ts",
54-
"_namespaces/Harness.ts",
55-
"_namespaces/Harness.LanguageService.ts",
56-
"_namespaces/Harness.SourceMapRecorder.ts",
57-
"_namespaces/vfs.ts",
58-
"_namespaces/ts.TestFSWithWatch.ts",
59-
"_namespaces/vpath.ts"
60-
]
22+
"include": ["**/*"]
6123
}

src/jsTyping/tsconfig.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local",
4+
"outDir": "../../built/local/jsTyping",
55
"types": [
66
"node"
77
],
@@ -13,12 +13,5 @@
1313
"references": [
1414
{ "path": "../compiler" }
1515
],
16-
"files": [
17-
"shared.ts",
18-
"types.ts",
19-
"jsTyping.ts",
20-
"_namespaces/ts.JsTyping.ts",
21-
"_namespaces/ts.ts",
22-
"_namespaces/ts.server.ts"
23-
]
16+
"include": ["**/*"]
2417
}

src/loggedIO/tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../tsconfig-base",
33
"compilerOptions": {
4-
"outDir": "../../built/local",
4+
"outDir": "../../built/local/loggedIO",
55
"types": [
66
],
77
"lib": [
@@ -18,11 +18,5 @@
1818
{ "path": "../harness" },
1919
],
2020

21-
"files": [
22-
"loggedIO.ts",
23-
"_namespaces/Playback.ts",
24-
"_namespaces/ts.server.ts",
25-
"_namespaces/ts.ts",
26-
"_namespaces/Harness.ts"
27-
]
21+
"include": ["**/*"]
2822
}

0 commit comments

Comments
 (0)