Commit Graph

164 Commits

Author SHA1 Message Date
Ron Buckton dfd28d2751 Fix handling of empty 'types', 'typings', etc. fields in package.json (#31539) 2019-05-23 17:19:32 -07:00
Sheetal Nandi 5d188a8c68 Always use resolved file to figure out subModule name in package id
Fixes #30429
2019-05-22 14:30:56 -07:00
Sheetal Nandi 85d3c5d7a1 Trace Package id at the module resolution site 2019-05-22 12:35:20 -07:00
Sheetal Nandi 94ee0dc769 Merge pull request #31100 from Microsoft/tsBuildCacheModuleResolution
Cache module resolutions across tsbuild to be able to resolve the modules faster
2019-04-26 07:33:59 -07:00
Andy Hanson aafba363e4 Avoid recalculating versionPaths in loadNodeModuleFromDirectory (#27537)
* Avoid recalculating versionPaths in loadNodeModuleFromDirectory

* Update baselines
2019-04-25 11:06:31 -07:00
Sheetal Nandi 93b958e0ea Share module resolution cache among different program 2019-04-24 12:47:01 -07:00
Sheetal Nandi 3264b64f08 Reuse map if module resolution is same for redirected and own files 2019-04-24 11:57:59 -07:00
EECOLOR 1a9c20949e path mappings now supports rooted disk paths and urls - fixes #13730 2018-11-07 22:19:04 +01:00
Wesley Wigham 05716a74a5 Add support for configuration inheritance via packages (#27348)
* Add support for configuration inheritance via packages

* Fix lint

* Propagate trace into config parse hosts
2018-10-25 10:19:57 -07:00
Andy 72244c5b03 Support 'isSourceFileFromExternalLibrary' for source files from '/// <reference types="" />'' (#28004)
* Support 'isSourceFileFromExternalLibrary' for source files from '/// <reference types="" />''

* Calculate `isExternalLibraryImport` at the end

* Calculate isExternalLibraryImport with symlink path
2018-10-19 18:00:45 -07:00
Sheetal Nandi 6923f2cdb0 Handle caching of module resolution depending on project references 2018-10-04 15:04:11 -07:00
Sheetal Nandi 0e4b10d726 Use resolution options of project reference if the file is from the project reference 2018-10-04 15:04:10 -07:00
Andy 9bdd6a3b55 Support loading "index.d.ts" using "typesVersions" without "types", "typings", or "main" (#27514)
* Support loading "index.d.ts" using "typesVersions" without "types", "typings", or "main"

* Update baseline
2018-10-03 11:44:16 -07:00
Sheetal Nandi ee04b8c7f3 Handle the case of failed lookup location being not normalized.
Also fixed issue where type defs with relative name didnt resolve when directoryExists is present on the host
Fixes #27405
2018-09-28 14:40:34 -07:00
Valera Rozuvan 8bd7f4e3f8 Fix 27086. Ignore directories starting with a dot. 2018-09-23 14:48:48 +03:00
Andy c57ff087d6 Add codefix to generate types for untyped module (#26588) 2018-09-18 11:47:29 -07:00
Nathan Shively-Sanders 64d0e0d448 Shorten more internal names to JS or TS (#27080) 2018-09-13 15:05:57 -07:00
Nathan Shively-Sanders 6bd1da20c9 Rename JS-specific concepts (#26795)
* Rename JS concepts

1. Assignment declaration -- an assignment that is treated like a
declaration. Previously called [JS] special (assignment|declaration),
among other things.
2. Expando -- a value that can be used as a target in assignment
declarations. Currently, a class, function or empty object literal.
Functions are allowed in Typescript, too. Previously called a JS
container, JS initializer or expando object.
3. JavaScript -> Javascript. This is annoying to type, and looks like
'Java Script' in a camelCase world.

Everything is a pure rename as far as I know. The only test change is
the API baselines, which reflect the rename from SymbolFlags.JSContainer
to SymbolFlags.Assignment.

* Remove TODO

* Rename Javascript->JS

Note that this introduces a variable name collision in a couple of
places, which I resolved like this:

```ts
const isInJavascript = isInJSFile(node);
```
2018-09-12 10:44:46 -07:00
Ron Buckton e726e4cfec PR Feedback 2018-09-05 11:23:39 -07:00
Ron Buckton 37c33f4369 Use semver ranges 2018-08-28 17:24:02 -07:00
Ron Buckton dc5cd9676b Switch to paths-like pattern matching 2018-08-28 09:33:03 -07:00
Ron Buckton b9afdadf71 Remove jsTypings/semver.ts, add unit tests and logging 2018-08-22 12:38:16 -07:00
Ron Buckton aa04ef5ce7 Adjust subModuleName 2018-08-20 20:49:52 -07:00
Ron Buckton 8398a87da7 Base version test on 'versionMajorMinor' 2018-08-20 17:50:28 -07:00
Ron Buckton 6f7a37c99a Added fourslash test 2018-08-20 17:44:34 -07:00
Ron Buckton 015babb6f7 Initial support for 'typesVersions' 2018-08-20 16:57:18 -07:00
Sheetal Nandi fea1667002 Use string contains and nodeModulesPathPart const for "/node_modules/" 2018-08-15 11:47:16 -07:00
Sheetal Nandi 1dd3cd288e Make file as externalLibrary import if path contains node_modules 2018-08-14 16:27:18 -07:00
Sheetal Nandi fe387cc7f0 Merge pull request #26377 from Microsoft/moduleResolutionWithSymLinks
Use original path from resolved module cache when available.
2018-08-10 22:27:38 -07:00
Sheetal Nandi 8e05f4ec64 Add documentation for originalPath 2018-08-10 17:08:53 -07:00
Sheetal Nandi 82d4cccf53 Use original path from resolved module cache when available.
Fixes #26273
Thanks to @ajafff, for partial fix  and test (#26310)
2018-08-10 16:11:38 -07:00
Klaus Meinhardt ad4403e43a moduleNameResolver: fix invalid assertion and avoid unnecessary work (#26319)
* moduleNameResolver: fix invalid assertion and avoid unnecessary work

Part of #18217

* assert nonRelativeModuleName
2018-08-10 15:59:08 -07:00
Sheetal Nandi c8e10a9a66 Merge pull request #26296 from ajafff/modulenameresolver-cache
fix moduleNameResolver cache
2018-08-10 14:36:54 -07:00
Klaus Meinhardt 4db7c869e5 restore old algorithm 2018-08-10 22:11:16 +02:00
Klaus Meinhardt d2dc17d765 fix handling if there is no commonPrefix 2018-08-09 11:50:00 +02:00
Klaus Meinhardt 20442fe363 handle failed lookups 2018-08-08 20:45:31 +02:00
Klaus Meinhardt 95082e4743 make it work for root directory 2018-08-08 20:29:59 +02:00
Klaus Meinhardt 95494efe50 fix commonPrefix handling 2018-08-08 16:58:35 +02:00
Klaus Meinhardt bed93b48f5 fix moduleNameResolver cache
Fixes: #26271
2018-08-08 11:12:48 +02:00
Ryan Cavanaugh 066b191982 Collapse core/compiler/parser into parser 2018-06-11 17:07:58 -07:00
Ryan Cavanaugh ab10b86205 Almost working? 2018-06-10 19:28:38 -07:00
Wesley Wigham d9b93903c0 Use more nodelike paths for import types when possible (#24610)
* Use more nodelike paths for import types when possible

* move functionality from services into compiler, fix with propert file/directory conflict handling

* mark suspect cast
2018-06-05 12:54:36 -07:00
Andy e53e56cf82 Enable '--strictNullChecks' (#22088)
* Enable '--strictNullChecks'

* Fix API baselines

* Make sys.getEnvironmentVariable non-nullable

* make properties optional instead of using `| undefined` in thier type

* reportDiagnostics should be required

* Declare firstAccessor as non-nullable

* Make `some` a type guard

* Fix `getEnvironmentVariable` definition in tests

* Pretend transformFlags are always defined

* Fix one more use of sys.getEnvironmentVariable

* `requiredResponse` accepts undefined, remove assertions

* Mark optional properties as optional instead of using `| undefined`

* Mark optional properties as optional instead of using ` | undefined`

* Remove unnecessary null assertions

* Put the bang on the declaration instead of every use

* Make `createMapFromTemplate` require a parameter

* Mark `EmitResult.emittedFiles` and `EmitResult.sourceMaps` as optional

* Plumb through undefined in emitLsit and EmitExpressionList

* `ElementAccessExpression.argumentExpression` can not be `undefined`

* Add overloads for `writeTokenText`

* Make `shouldWriteSeparatingLineTerminator` argument non-nullable

* Make `synthesizedNodeStartsOnNewLine` argument required

* `PropertyAssignment.initializer` cannot be undefined

* Use one `!` at declaration site instead of on every use site

* Capture host in a constant and avoid null assertions

* Remove few more unused assertions

* Update baselines

* Use parameter defaults

* Update baselines

* Fix lint

* Make Symbol#valueDeclaration and Symbol#declarations non-optional to reduce assertions

* Make Node#symbol and Type#symbol non-optional to reduce assertions

* Make `flags` non-nullable to reduce assertions

* Convert some asserts to type guards

* Make `isNonLocalAlias` a type guard

* Add overload for `getSymbolOfNode` for `Declaration`

* Some more `getSymbolOfNode` changes

* Push undefined suppression into `typeToTypeNodeHelper`

* `NodeBuilderContext.tracker` is never `undefined`

* use `Debug.assertDefined`

* Remove unnecessary tag

* Mark `LiteralType.freshType` and `LiteralTupe.regularType` as required
2018-05-22 14:46:57 -07:00
Sheetal Nandi dc50fe5e40 Apart from typing, use main field in package json to resolve typescript files
Fixes #23502
2018-05-14 14:52:11 -07:00
Sheetal Nandi 22d5b0e19f Do not remove extension js or jsx from the subModuleName if the subModule doesnt have js or jsx extension 2018-05-14 14:21:08 -07:00
Wesley Wigham 556c316fed Make new harness fake host more performant in large complications (#23951)
* Make new harness fake host more performant in large complications

* Use sortedmap
2018-05-08 12:46:33 -07:00
Sheetal Nandi 15f9ea3d14 Merge branch 'master' into requireJson 2018-05-03 15:35:54 -07:00
Sheetal Nandi 579748bc2b Merge branch 'master' into requireJson 2018-04-30 11:44:09 -07:00
Ron Buckton 8424c4d1ab Partial migration of some shared vpath functionality to core 2018-04-27 13:58:45 -07:00
Andy 5c94bef0e1 Add 'renameFile' command to services (#23573)
* Add 'renameFile' command to services

* renameFile -> getEditsForFileRename

* Support `<reference path>` directives
2018-04-20 13:43:09 -07:00