29 Commits

Author SHA1 Message Date
Wesley Wigham
bb4080c175
Collect _all_ symlinks a file may have witnessed when attempting to generate specifiers (#31571) 2019-05-23 17:17:24 -07:00
Sheetal Nandi
d53efdf380 Changes to generation of .tsbuildinfo:
- If composite or incremental then only the .tsbuildinfo will be generated
- if --out or --outFile the file is outputFile.tsbuildinfo
- if rootDir and outDir then outdir/relativePathOfConfigFromRootDir/configname.tsbuildinfo
- if just outDir then outDir/configname.tsbuild
- otherwise config.tsbuildinfo next to configFile
2019-02-28 13:46:26 -08:00
Jordi Oliveras Rovira
f41b4e088d Change usage of Array.prototype.find to ts.find. 2018-12-09 20:23:56 +01:00
Wesley Wigham
7a71887c23
Build better import paths for declaration emit/typeToString from reexports if possible (#27340)
* Build better import paths from reexports if possible, issue error on node_modules import generation

* Small refactorings

* Add file-by-file cacheing

* Minor cleanups

* Adjust error message
2018-11-13 14:07:54 -08:00
Wesley Wigham
b85e9e1cc1
Use relative module specifiers in error messages if possible (#27441)
* Use relative module specifiers in error messages if possible

* Dont share number
2018-10-08 14:36:37 -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
a255d9a163 Merge branch 'master' into typesVersions 2018-09-07 13:52:12 -07:00
Andy
f78dc2ad11
importFixes: Only provide a fix using the best module specifier for a given module (#26738) 2018-08-29 16:18:56 -07:00
Andy
7b4f864b49
moduleSpecifiers: Simpler criteria for preferring relative path vs baseUrl (#25803)
* moduleSpecifiers: Simpler criteria for preferring relative path vs baseUrl

* Don't unconditonally use a path mapping
2018-08-29 15:06:26 -07:00
Ron Buckton
5f6a2cbf69 Merge branch 'master' into typesVersions 2018-08-28 17:37:23 -07:00
Andy
cff04e6050
Ensure JsonSourceFile has all the non-optional properties of SourceFile (#26162)
* Ensure JsonSourceFile has all the non-optional properties of SourceFile

* Set properties in parseSourceFile
2018-08-28 16:43:14 -07:00
Andy
b94061c587
getEditsForFileRename: Avoid changing import specifier ending (#26177)
* getEditsForFileRename: Avoid changing import specifier ending

* Support .json and .jsx extensions

* Restore typeRoots tests

* Fix json test

* When --jsx preserve is set, import ".tsx" file with ".jsx" extension

* Support ending preference in UserPreferences
2018-08-28 13:03:24 -07:00
Ron Buckton
dc5cd9676b Switch to paths-like pattern matching 2018-08-28 09:33:03 -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
Wesley Wigham
19e04b2cdb
Dont use baseURL relative absolute paths in declaration emit, use absolute paths in bundle emit (#26341) 2018-08-10 12:54:45 -07:00
Wesley Wigham
fce3d9f34d
Check the ambientness of a symbol name before attempting to trim it (#26312)
* Check the ambientness of a symbol name before attempting to trim it

* Use find instead of forEach, remember to also exclude global augmentations
2018-08-09 13:20:37 -07:00
Andy
9c9f3e3cf9
importFixes: When one file redirects to another, consider both for global import specifiers (#25834)
* importFixes: When one file redirects to another, consider both for global import specifiers

* Add test for #26044

* Avoid a symlinked package globally importing itself (fixes another case of #26044)

* Compare to node_modules with getCanonicalFileName
2018-07-31 17:28:56 -07:00
Wesley Wigham
59854bbd55
Inspect all possible module paths when looking for the best one to create a specifier with (#25850)
* Inspect all possible specifier paths when looking for the best one

* Add missing secondary option from test
2018-07-24 13:56:21 -07:00
Andy
30c41492d9
moduleSpecifiers: Allow "*" as a path mapping (#25881) 2018-07-23 17:11:30 -07:00
Andy
304d45d833
Canonicalize path before calling startsWith (#25364)
* Canonicalize path before calling `startsWith`

* More specific type for sourceDirectory, and add fourslash test

* Update API (#24966)
2018-07-03 11:23:19 -07:00
Andy
7dc66e916a
moduleSpecifiers: specifier from "rootDirs" should be treated as relative (#25369) 2018-07-02 11:14:49 -07:00
Wesley Wigham
30db30055f
Fix module specifier case handling for declaration emit (#25110) 2018-06-29 11:02:43 -07:00
Andy
ab9e913af3
getEditsForFileRename: Test both before and after the rename (#25074) 2018-06-26 16:55:51 -07:00
Wesley Wigham
a77068827d
Handle combinations of rootdir and outdir when calculating paths (#24941) 2018-06-14 11:07:46 -07:00
Wesley Wigham
61fb222cd2
Use symlinks when looking for module names for declaration emit (#24874)
* fix symlink tag, support arbitrary (ie, directory) links via @link

Introduce indirect symlink lookup to specifier deriver

Use fileset, move exec

vfs path resolution :shakes fist:

Apply files symlink relative to dirname

Use directory function

* Accept really bad baseline updates
2018-06-12 12:52:44 -07:00
Andy
3822e3e4ed
tryGetModuleNameAsNodeModule: Ignore file extension (#24774) 2018-06-07 15:45:03 -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