-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from timocov/fix_detect_ts_lib_files
Fix detecting TypeScript default lib files
- Loading branch information
Showing
10 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Developer's dependencies | ||
|
||
This folder is needed to have some developer's dependencies here, which are used to compile/lint the code. | ||
|
||
## Why | ||
|
||
The tool is written in TypeScript, and it uses TypeScript to do stuff also. | ||
So, we should have TypeScript in both dev and prod dependency list: | ||
|
||
- in dev for the compiler (`tsc`) and TSLint (because TSLint should use the same version of TypeScript as we compile the code) | ||
- in prod TypeScript only for its API (with declaration files) | ||
|
||
The possible solutions of this issue might be: | ||
|
||
1. If TypeScript's team will provide 2 separate packages `typescript` and `typescript-cli`. | ||
|
||
In this case we can use `typescript` as prod dependency and `typescript-cli` as dev one. | ||
|
||
1. `npm` will allows to have the same dependency both in `devDependencies` and `dependencies` and will install it in separate folders. | ||
|
||
In this case we can just put 2 `typescript`'s in separate dependencies list and control which we need in each case. | ||
|
||
But neither TypeScript or npm does not have a solution (and will not have). | ||
|
||
That is why we have `.dev-deps` with developer's dependencies. | ||
|
||
This mechanism allows us use the latest compiler to compile source code | ||
(and use new features like mapped or conditional types in source code) | ||
and check that source code is compatible with specific TypeScript version and its API. | ||
|
||
For example, we can use 2.9.2 to compile (and use conditional types in the code), | ||
and check that source code is compatible with API of 2.6.2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"lint": "tslint --config ../tslint.json --project ../tsconfig.json", | ||
"compile": "tsc --version && tsc --project ../tsconfig.json", | ||
"compile-tests": "tsc --project ../tsconfig.tests.json" | ||
}, | ||
"devDependencies": { | ||
"tslint": "~5.10.0", | ||
"typescript": "~2.9.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters