Skip to content

Commit 14a4530

Browse files
committed
Get entrypoints working
1 parent ce5df67 commit 14a4530

File tree

10 files changed

+63
-12
lines changed

10 files changed

+63
-12
lines changed

Gulpfile.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -163,20 +163,20 @@ const buildServices = (() => {
163163
.pipe(rename("typescript.d.ts"))
164164
.pipe(dest("built/local"));
165165

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

173173
return series(
174174
buildTypescriptServicesOut,
175175
createTypescriptServicesJs,
176176
createTypescriptServicesDts,
177177
createTypescriptJs,
178178
createTypescriptDts,
179-
createTypescriptStandaloneDts,
179+
// createTypescriptStandaloneDts,
180180
);
181181
})();
182182
task("services", series(preBuild, buildServices));

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";

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
}

src/tsserver/nodeServer.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ function startNodeSession(options: StartSessionOptions, logger: Logger, cancella
539539
}
540540
}
541541

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

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

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";
+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;

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";

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+
}

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;

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)