Skip to content

Add tsconfig for harness and tsserverlibrary, remove external dtses#9628

Merged
weswigham merged 2 commits into
masterfrom
tsconfig-for-harness
Jul 12, 2016
Merged

Add tsconfig for harness and tsserverlibrary, remove external dtses#9628
weswigham merged 2 commits into
masterfrom
tsconfig-for-harness

Conversation

@weswigham
Copy link
Copy Markdown
Member

Adds a tsconfig for the harness and removes the ancient node.d.ts (and chai and mocha) we kept in our repo (instead, we now use the @types/node (and chai and mocha) package(s)). Also, the lint task is a bit more gulpy now - it uses globs to find files to lint, rather than a static list.

We've been planning on adding a config file for the harness and tsserverlibrary for awhile (since they were the last major targets without one). The external dtses needed to be removed since once I started pulling files from the configs, as I was made aware that some tests included a second node.d.ts, separate from the one the server included (and having nearly the same file in two different places is probably a mistake) - so rather than just collapsing them into one file, I just updated our build to use the node types from @types, and added in our other "external" types dependencies while I was there. (Since this is an exercise in modernizing our build).

I'd also like to update our tsconfig files to use include, but that will have to wait until gulp-typescript supports the option.

Comment thread src/harness/harness.ts
/// <reference path="sourceMapRecorder.ts"/>
/// <reference path="runnerbase.ts"/>
/// <reference path="virtualFileSystem.ts" />
/// <reference types="node" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not think you need all these /// <reference tags any more now that you have the tsconfig.json.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking you should not, since it's in the config file. Not for the compilation, anyway. However for the editor experience, if the editor starts from the unittests folder and walks back to the harness (via the /// ref in the unittest), it doesn't always see the tsconfig in the harness folder and associate the unittest with that project (so adding the references into the harness file which gets included in all unittests covers it, making the editor experience without it finding the right tsconfig acceptable).

Only did this because it happened to me when reopening the editor while working on this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should move the unit tests to the harness folder. I just got lazy when we moved the code to github and did not move them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that. It would make the structure look more sane, too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup. back then there were only two of them, and we were planning to remove them.. but now we have much more :)

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jul 12, 2016

👍

@weswigham
Copy link
Copy Markdown
Member Author

@mhegazy I've moved the unittests into the harness directory. 😄

@weswigham weswigham merged commit 5960877 into master Jul 12, 2016
@weswigham weswigham deleted the tsconfig-for-harness branch August 11, 2016 01:43
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants