Skip to content

Commit a31b0ef

Browse files
committed
Get entrypoints working
1 parent efaf2d7 commit a31b0ef

File tree

10 files changed

+63
-12
lines changed

10 files changed

+63
-12
lines changed

Diff for: Gulpfile.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,20 @@ const buildServices = (() => {
166166
.pipe(rename("typescript.d.ts"))
167167
.pipe(dest("built/local"));
168168

169-
// create typescript_standalone.d.ts
170-
const createTypescriptStandaloneDts = () => src("built/local/typescriptServices.d.ts")
171-
.pipe(newer("built/local/typescript_standalone.d.ts"))
172-
.pipe(transform(content => content.replace(/declare (namespace|module) ts/g, 'declare module "typescript"')))
173-
.pipe(rename("typescript_standalone.d.ts"))
174-
.pipe(dest("built/local"));
169+
// // create typescript_standalone.d.ts
170+
// const createTypescriptStandaloneDts = () => src("built/local/typescriptServices.d.ts")
171+
// .pipe(newer("built/local/typescript_standalone.d.ts"))
172+
// .pipe(transform(content => content.replace(/declare (namespace|module) ts/g, 'declare module "typescript"')))
173+
// .pipe(rename("typescript_standalone.d.ts"))
174+
// .pipe(dest("built/local"));
175175

176176
return series(
177177
buildTypescriptServicesOut,
178178
createTypescriptServicesJs,
179179
createTypescriptServicesDts,
180180
createTypescriptJs,
181181
createTypescriptDts,
182-
createTypescriptStandaloneDts,
182+
// createTypescriptStandaloneDts,
183183
);
184184
})();
185185
task("services", series(preBuild, buildServices));

Diff for: src/tsc/_namespaces/ts.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
export * from "../../compiler/_namespaces/ts";
44
export * from "../../executeCommandLine/_namespaces/ts";
5-
export * from "../tsc";

Diff for: src/tsconfig.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"references": [
55
{ "path": "./tsc" },
66
{ "path": "./tsserver" },
7+
{ "path": "./tsserverlibrary" },
8+
{ "path": "./typescript" },
9+
{ "path": "./typescriptServices" },
710
{ "path": "./typingsInstaller" },
811
{ "path": "./watchGuard" },
912
{ "path": "./debug" },
1013
{ "path": "./cancellationToken" },
1114
{ "path": "./dynamicImportCompat" },
12-
{ "path": "./testRunner" }
15+
{ "path": "./testRunner" },
1316
]
1417
}

Diff for: src/tsserver/nodeServer.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ function startNodeSession(options: StartSessionOptions, logger: Logger, cancella
525525
}
526526
}
527527

528-
this.installer = childProcess.fork(combinePaths(__dirname, "typingsInstaller.js"), args, { execArgv });
528+
// TODO(jakebailey): fix this for module transform
529+
this.installer = childProcess.fork(combinePaths(__dirname, "..", "typingsInstaller", "nodeTypingsInstaller.js"), args, { execArgv });
529530
this.installer.on("message", m => this.handleMessage(m));
530531

531532
// We have to schedule this event to the next tick

Diff for: src/tsserverlibrary/_namespaces/ts.server.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
export * from "../../jsTyping/_namespaces/ts.server";
44
export * from "../../server/_namespaces/ts.server";
5-
export * from "../tsserverlibrary";

Diff for: src/tsserverlibrary/tsserverlibrary.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
export { };
1+
import * as ts from "./_namespaces/ts";
2+
3+
// TODO(jakebailey): replace const enum with enum in d.ts
4+
5+
export = ts;

Diff for: src/typescript/_namespaces/ts.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* Generated file to emulate the ts namespace. */
2+
3+
export * from "../../compiler/_namespaces/ts";
4+
export * from "../../jsTyping/_namespaces/ts";
5+
export * from "../../services/_namespaces/ts";
6+
export * from "../../deprecatedCompat/_namespaces/ts";

Diff for: src/typescript/tsconfig.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "../tsconfig-library-base",
3+
"compilerOptions": {
4+
"outDir": "../../built/local"
5+
},
6+
"files": [
7+
"typescript.ts",
8+
"_namespaces/ts.ts"
9+
],
10+
"references": [
11+
{ "path": "../compiler" },
12+
{ "path": "../jsTyping" },
13+
{ "path": "../services" },
14+
{ "path": "../deprecatedCompat" }
15+
]
16+
}

Diff for: src/typescript/typescript.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as ts from "./_namespaces/ts";
2+
import { Debug, LogLevel } from "./_namespaces/ts";
3+
4+
// TODO(jakebailey): replace const enum with enum in d.ts
5+
6+
// enable deprecation logging
7+
declare const console: any;
8+
if (typeof console !== "undefined") {
9+
Debug.loggingHost = {
10+
log(level, s) {
11+
switch (level) {
12+
case LogLevel.Error: return console.error(s);
13+
case LogLevel.Warning: return console.warn(s);
14+
case LogLevel.Info: return console.log(s);
15+
case LogLevel.Verbose: return console.log(s);
16+
}
17+
}
18+
};
19+
}
20+
21+
export = ts;

Diff for: src/typescriptServices/typescriptServices.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Debug, LogLevel } from "./_namespaces/ts";
22

3+
// TODO(jakebailey): replace const enum with enum in d.ts
4+
35
// enable deprecation logging
46
declare const console: any;
57
if (typeof console !== "undefined") {

0 commit comments

Comments
 (0)