Commit Graph
100 Commits
Author SHA1 Message Date
Sheetal Nandi b179c7c959 Dont store originalPath as separate, instead store originalPath || resolvedFileName and resolve the symlinks on read 2022-12-09 20:18:55 -08:00
Sheetal Nandi 2bb56dafe7 Always respect preserveSymlinks 2022-12-09 19:42:06 -08:00
Sheetal Nandi 3115572878 Store resolvedFileName as fileId instead of structure if thats the only info in resolution 2022-12-09 19:34:55 -08:00
Sheetal Nandi 81a1af93fc Dont store isExternalLibraryImport in the buildInfo 2022-12-09 14:49:33 -08:00
Sheetal Nandi 1e123ec1a6 Cache packagejson scopes per directory 2022-12-09 14:49:32 -08:00
Sheetal Nandi 78e215f815 Dont store package json path if its found in same directory 2022-12-09 14:49:31 -08:00
Sheetal Nandi be5ecb2ef8 During cacheResolutions dont watch failed lookups and dont look at those package.json if one exists per buildInfo 2022-12-09 14:49:31 -08:00
Sheetal Nandi e21738c351 Store package.json for the directories in buildinfo 2022-12-09 14:49:30 -08:00
Sheetal Nandi 5c11252b71 Add tests for package json edits 2022-12-09 14:49:30 -08:00
Sheetal Nandi 7de47805fe Use the hashes to verify the affecting location before using the resolution 2022-12-09 14:49:29 -08:00
Sheetal Nandi e1ed9ea312 Store package json hash in buildinfo 2022-12-09 14:49:29 -08:00
Sheetal Nandi 6261b6cf67 Add tests where cache resoluition is incorrectly used because of not checking affected locations 2022-12-09 14:49:28 -08:00
Sheetal Nandi 2219b5dc95 Start using cache as perDirectory lookup 2022-12-09 14:49:27 -08:00
Sheetal Nandi 84cda33850 More tests for cache reuse directory structure 2022-12-09 14:49:27 -08:00
Sheetal Nandi feb3220299 Tests for unresolved imports from multiple places 2022-12-09 14:49:26 -08:00
Sheetal Nandi 4d127faa25 Remove files that are not in program from cache of unresolved imports 2022-12-09 14:49:26 -08:00
Sheetal Nandi 71ebed9c00 Modify resolution cache to update on program creation completion 2022-12-09 14:49:26 -08:00
Sheetal Nandi 591960edb0 Set old program build info as a location to look for from module resolution caches 2022-12-09 14:49:25 -08:00
Sheetal Nandi 207226a9c8 Reusing resolutions in tsserver scenario 2022-12-09 14:49:24 -08:00
Sheetal Nandi 0446430aaa Add tests where module resolution caches should reuse the resolutions from buildInfo 2022-12-09 14:49:24 -08:00
Sheetal Nandi 959206d3e9 Do not store failed lookups with cacheResolution option if it is resolved to a file since they do not matter 2022-12-09 14:49:23 -08:00
Sheetal Nandi ce07d0e961 Handle resolutions that would be same in ancestor directory and can be derived through ancestor map 2022-12-09 14:49:22 -08:00
Sheetal Nandi d55ab98d59 Test for module resolutions from different directories 2022-12-09 14:49:22 -08:00
Sheetal Nandi 0132dc0b1d Handle project reference redirects for the module and type reference resolutions 2022-12-09 14:49:21 -08:00
Sheetal Nandi 23cfc79fdc Buildinfo resolutions actually reused 2022-12-09 14:49:21 -08:00
Sheetal Nandi 4bc74b98c2 Add reusing cache stub 2022-12-09 14:49:20 -08:00
Sheetal Nandi 76100d729f Read reusable module cache information from the buildinfo 2022-12-09 14:49:20 -08:00
Sheetal Nandi 1eeea260d6 Store resolved module and type reference resolution cache in buildinfo 2022-12-09 14:49:19 -08:00
Sheetal Nandi 666eece8cc Add tests 2022-12-09 14:49:19 -08:00
Sheetal Nandi e1600ab800 Add baselining of modules and type refs 2022-12-09 14:49:18 -08:00
Sheetal Nandi 3172629f21 Add new option to cacheResolution (No actual functionality yet) 2022-12-09 14:49:18 -08:00
Sheetal Nandi 9d7df99414 Fix isExternalLibraryImport for classic resolution (#51840) 2022-12-09 14:44:35 -08:00
Sheetal Nandi 86e0fc92af Fix the test (#51839) 2022-12-09 10:22:49 -08:00
Sheetal Nandi 3716ffe748 Make getSupportedCodeFixes on LS so it can be proxied by plugins (#51769)
Fixes #28966
2022-12-08 09:52:25 -08:00
Sheetal Nandi a77a79fe4b Remove some unnecessary createGetCanonicalFileName by exposing one from program (#51796) 2022-12-07 09:17:52 -08:00
Sheetal Nandi 832a6e45a7 Unify verifyTsc and verifyTscWithEdits and make them look like verifyTscWatch for easy copy paste (#51798)
* Make edits optional in verifyTscWatch

* Unify verifyTsc and verifyTscWithEdits and make them look like verifyTscWatch
2022-12-06 17:18:31 -08:00
Sheetal Nandi e0293b5877 Instead of computing signatures during building, compute them afterwards for verification (#51718)
This helps with finding issues with d.ts emit because of caching.
2022-12-06 16:55:08 -08:00
Sheetal Nandi 84e475c105 Make resolution cache use sets instead of arrays for easier checking (#51735) 2022-12-06 14:25:19 -08:00
Sheetal Nandi 38f33ade06 Use non relative name cache for type reference resolutions and API updates (#51732)
* Make the non relative name resolution cache generic

* Add cache for non relative type reference resolution

* Add getter only methods so we can use these in future for sharing resolutions across the projects

* Mark existing non relative module name cache getOrCreate as deprecated

* Prefer getters for getting directory results
2022-12-06 14:22:03 -08:00
Sheetal Nandi 9e845d2248 Api cleanup for Module and Type Reference directive resolution (#51546)
* Refactoring so CacheWithRedirects has Key and Value type parameters

* ModuleResolutionCache or TypeRefDirectiveCache will look in directory before solving, so ResolutionCache doesnt need this check

* Test showing module resolution is not shared because resolution cache doesnt update own options

* Enable traceResolution on some of the project reference tests

* Simplify CacheWithRedirects and ensure the options are set in all common scenarios so cache can be shared between redirects

* Make failedlookup etc optional in ResolvedModule/TypeRefefWithFailedLookupLocations
Also make accidental public failed lookup internal

* Add new API for module and type ref resolution

* Store auto type reference resolutions

* Modify test to show how using program partially doesnt report resolution diagnostics

* Ensure that resolution diagnostics are reported in filePreocessingDiagnostics so they can be reused when program is reused

* Some cleanup

* Remove the newly added ReoslutionInfo in favor of new APIs

* update
2022-12-05 11:56:33 -08:00
Sheetal Nandi 7b7f6a75ea Code refactoring for module resolution api (#51675)
* Refactoring so CacheWithRedirects has Key and Value type parameters

* ModuleResolutionCache or TypeRefDirectiveCache will look in directory before solving, so ResolutionCache doesnt need this check

* Test showing module resolution is not shared because resolution cache doesnt update own options

* Enable traceResolution on some of the project reference tests

* Simplify CacheWithRedirects and ensure the options are set in all common scenarios so cache can be shared between redirects
2022-12-01 10:17:58 -08:00
Sheetal Nandi f636fc1846 Fix the name of the file to be deleted when doing baseline accept (#51705) 2022-11-30 14:01:03 -08:00
Sheetal Nandi 16edc29bc9 Handle empty string when getting file version (#51689)
* Test for empty string change

* Fix empty string for file versioning
2022-11-30 10:30:32 -08:00
Sheetal Nandi c2519bb301 When there is no change in file text for program, no need to update program (#51626)
* When fsEvent for change is repeated

* When trying to check if program is uptodate, read the files from disk to determine the version instead of delaying so that new program is not created if file contents have not changed
2022-11-29 12:20:41 -08:00
Sheetal Nandi af36a859b9 Fix the crash when affected file pending emit is not in program is being serialized into buildInfo (#51674)
Fixes #51641
2022-11-29 12:20:09 -08:00
Sheetal Nandi 9f93c6717d Dont calculate version paths proactively as they may not be needed (#51593) 2022-11-29 12:19:44 -08:00
Sheetal Nandi 59e659ac4a More test cleanup/baselining for future changes (#51635)
* More test cleanup/baselining for future changes

* More cleanup

* More cleanup

* Make the reuse program structure stable for each test
2022-11-28 15:49:08 -08:00
Sheetal Nandi c1427c90b6 Convert reuse program structure and tracing of module resolution to baseline for easier updates (#51628)
* Modify all usages of file name lower casing to use custom lower casing method

* Baseline reuse program structure tests for easy update when making changes to module resolution
2022-11-22 20:58:21 -08:00
Sheetal Nandi 2f2a17ad0b Removing some unnecessary methods from host and function parameters (#51499) 2022-11-15 17:34:58 -08:00
Sheetal Nandi 9ede7ce006 Fix incorrect spelling of packageId (#51483) 2022-11-10 16:55:49 -08:00
Sheetal Nandi c5aea89230 Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined (#51482)
* Add alias ResolutionMode for ModuleKind.ESNext | ModuleKind.CommonJs | undefined

* ResolutionMode | undefined = ResolutionMode

* More
2022-11-10 16:47:46 -08:00
Sheetal Nandi 3eafb64faf Handle reusing type reference resolution in resolution cache correctly (#51475)
* Add tests where typeRef resolution is not in the cache

* Ensure that type ref reuse is actually handled since type ref resolution only sends containingSourceFileMode and not containingSourceFile
2022-11-10 16:03:25 -08:00
Sheetal Nandi 57a916c455 Emit buildinfo if file deleted isnt global (#51472)
* Add test for when file is deleted

* Emit buildinfo if file deleted isnt global
2022-11-09 18:07:17 -08:00
Sheetal Nandi 6e0a62e8dd Detangle unittests to reference helpers directly (#51450)
* Remove unnecessary redirection now that we are not in namespaces

* Move the tsc helpers in one place

* Move virtual file system with watch in unittests folder instead of harness since harness doesnt use it anyways

* Replace protocol and commandNames

* Revert incorrect pick
2022-11-09 10:02:40 -08:00
Sheetal Nandi 48aebcdcdb TypeReference directive reuse (#49750) 2022-11-07 15:15:11 -08:00
Sheetal Nandi 7b0df1ff99 Pass in information for the module name resolution when resolutions from file are partially used (#49738)
* Test showing wrong resolution is returned because of incorrect mode calculation
Test for #48229

* Pass in information for the module name resolution when resolutions from file are partially used
Fixes #48229

* Make the resolution info complete
2022-11-07 11:51:04 -08:00
Sheetal Nandi eac566b8c3 Enables passing --declaration, --emitDeclarationOnly, --declarationMap, --soureMap and --inlineSourceMap to tsc --build (#51241)
* Add different tests for baselining before behavior

* Fix assert for first project output

* Add ability to pass declaration, declarationMap, emitDeclarationOnly, sourceMap and inlineSourceMap on commandline of --build

* Store these options in --out scenario

* Store buildInfo program for --out even if not composite

* Changes to make these commanline options work

* Do not include sourceMapUrl text in the sourceFile version

* Emit complete program in --out scenario as well since we need to determine uptodate ness

* Copy js or dts bundle from old build if emitting only js or dts files

* Dont emit dts if we want to emit only js files even though options suggest emitting d.ts files as well

* Adding comments and refactoring some of the code
2022-11-07 10:53:22 -08:00
Sheetal Nandi 354891cf43 Avoid unnecessary buildInfo read if host supports caching it (avoids in --build scenario) and some reporting cleanup (#51403)
* Emit diagnostics when just manipuating bundle at that time itself
[4:04:42 PM] Updating output of project '/TypeScript/src/tsserver/tsconfig.json'...

Memory used:        581215K
transformTime time:   0.01s
Source Map time:      0.35s
commentTime time:     0.00s
printTime time:       0.58s
Emit time:            0.90s
I/O Write time:       0.01s
Total time:           0.90s

* Pull out getSourceFile and writeFile in a function

* Fix incorrect solutionPerformance reporting in watch mode

* Remove unnecessary build info read when host can give cached buildInfo

* Simplify overloads

* Accept API change
2022-11-04 19:19:57 -07:00
Sheetal Nandi 5e3fa9b87b There is no use of creating reference map with --out since its not used anyways (#51379)
* Convert some of the tests to baselines

* There is no use of creating reference map with --out since its not used anyways.
The changes to affectedFileList returned should be intended since --out needs saving just one file for correct output and not both
2022-11-03 15:30:32 -07:00
Sheetal Nandi 610ae68ecf Serialize and use files that can be emitted as affectedFilesPendingEmit (#51364) 2022-11-02 14:55:37 -07:00
Sheetal Nandi 8ed84e1c85 Write original fileInfo when its not just string = version = signature in readable baseline (#51391) 2022-11-02 13:55:20 -07:00
Sheetal Nandi 7c580111df Set impliedNodeFormat on sourceFile we get from host to ensure the field is set correctly (#50977)
* Add test that fails

* Handle impliedNodeFormat when handling sourceFileCache
Fixes #50872

* Revert the fix

* Make sure impliedNodeFormat is set for the sourceFile

* Revert "Make sure impliedNodeFormat is set for the sourceFile"

This reverts commit 651a47fdd6.

* Revert "Revert the fix"

This reverts commit 5c98b9cfc1.

* Swap the keys for map
2022-10-31 11:26:36 -07:00
Sheetal Nandi cfa55f1c2d Fixes the tests that got disabled when generating config set es2016 expecting to find libFile and remove incorrect affects flag from listFilesOnly (#51243)
* Fix the existing test

* Remove affectsEmit from listFilesOnly
2022-10-31 10:15:19 -07:00
Sheetal Nandi 18f559faf9 Store array only if dtsOnly emit is pending to compress buildinfo (#51246) 2022-10-31 10:14:22 -07:00
Sheetal Nandi 2625c1feae Make the init config category order predictable (#51247) 2022-10-20 13:23:18 -07:00
Sheetal Nandi 5f3e6cc498 Plugin probe location is higher priority than peer node_modules (#51079)
Fixes #34616
2022-10-06 13:45:22 -07:00
Sheetal Nandi 2648f6ab09 Plugins in project were adding up after every config file reload (#51087)
* Add test where current plugins dont get reset when reloading config file

* Reset loaded plugins when reloading configured project and closing project
2022-10-06 13:40:21 -07:00
Sheetal Nandi c18791ccf1 Fix incorrect options type to WatchOptions (#51064) 2022-10-05 11:54:59 -07:00
Sheetal Nandi 43c6fd4c09 Covert some of the config testing to baselines for easy validation (#51063)
* Baseline config tests for easy validation

* Refactor

* Fix incorrect pick

* Dont print unnecessary plugin host not implemented msg in logs
2022-10-04 18:14:14 -07:00
Sheetal Nandi fc5e72b92c Remove unused defaultWatchFileKind method since useFsEvents is default for tsserver and tsc (#51044) 2022-10-04 15:06:41 -07:00
Sheetal Nandi 8192d55049 Pick correct compilerOptions when checking if we can share emitSignatures (#50910)
* Pick correct compilerOptions when checking if we can share emitSignatures
Fixes #50902

* Add a note

* Rewording
2022-09-27 21:34:39 -07:00
Sheetal Nandi 16faef1d8d During uptodate ness check with buildInfo, check if there are errors explicitly with noEmit (#50974)
* Add test

* During uptodate ness check, with buildInfo, check if there are errors in the program to determine uptodateness
Fixes #50959

* Comment update
2022-09-27 15:57:29 -07:00
Sheetal Nandi 09368bcbae Handle if project for open file will get recollected because of pending cleanup from closed script info (#50908)
* Handle if project for open file will get recollected because of pending cleanup from closed script info
Fixes #50868

* Rename
2022-09-26 12:40:23 -07:00
Sheetal Nandi a455955aac Make hasInvalidatedResolution non internal for program and add it watchApi (#50776)
* Make stub for hasInvalidatedResolution

* Wire through hasInvalidatedResolutions
Fixes #48057

* Update comment

* Feedback
2022-09-22 16:51:53 -07:00
Sheetal Nandi a88c36655b Fix test baselining for tsserver host timeouts (#50748) 2022-09-12 20:36:24 -07:00
Sheetal Nandi 6b890f93c4 Handle more places where package direcroy is converted to canonical file path (#50740)
* Add test for node16 resolution with package json lookup making casing incorrect

* Handle more places where package direcroy is converted to canonical file path
2022-09-12 15:11:35 -07:00
Sheetal NandiandTypeScript Bot 7c918fb766 Baseline host state when baselining tsserver tests (#50678)
* Some more formatting to have baselines similar to what we have in tsserver.log

* Some refactor

* Baselines

* Baseline host details on each request

* More formatting per tsserver log

* More baselining of host state

* Update Baselines and/or Applied Lint Fixes

* Use utc time in logger for baselines

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2022-09-08 12:31:14 -07:00
Sheetal Nandi fd05c0cc6d Make useFsEvents as default strategy for the watching (#50366)
* Remove unnecessary parameter

* Dont store name unnecessarily in the watchers

* Polled watches and not files

* Use fs events as default watching

* Some refactoring

* Make single per directory native watchers now that we are using it as default

* Rename

* Comment
2022-09-06 13:14:50 -07:00
Sheetal Nandi 62f980aff8 Check if its same buildinfo only for directly referenced projects and not recursively (#50617)
Fixes #50545
2022-09-02 13:38:00 -07:00
Sheetal Nandi 298309271b Do not canonicalize the file names when getting absolute paths during nodenext resolution (#50557)
* Add test to show how scope messes with casing

* Do not canonicalize the file names when getting absolute paths
Fixes #50544

* Unnecessary exports

* Add test for self referencing package

* Fix self reference package with casing
2022-09-01 06:48:41 -07:00
Sheetal Nandi d293e723a2 Rename API to importPlugin (#50554)
* Rename API to importPlugin

* Make it internal too
2022-08-31 14:21:56 -07:00
Sheetal Nandi b9a5bbc9af Syntax operations also need to ensure project is present for the open script infos since update could be pending to make sure open script info has project (#50418)
Also convert one relevant test case to baseline
Fixes #50131
2022-08-24 10:28:23 -07:00
Sheetal Nandi 1f0f7c8246 If resolvedFileName differs with realPath only in casing use the resolvedFileName before realpath so that errors can be reported with forceConsistentCasingInFileNames (#50364)
* Add tests when realpath supresses the casing error

* Fix when real path results in value that differs only in case
Fixes #49470

* Comment
2022-08-18 14:51:46 -07:00
Sheetal Nandi 9c1baeede6 On windows handle the long paths in realpathSync.native (#50306)
Fixes #49470
2022-08-15 16:57:47 -07:00
Sheetal NandiandRon Buckton b19741c65d Report aggregate statistics for solution as well as some solution perf numbers (#50267)
* Report aggregate statistics for solution as well as some solution perf numbers
This change under --extendedDiagnostics aggregates the diagnostics from all projects built and reports it at the end. Apart from that it also outputs some measurements for work that happens in tsc --build like finding if projects are uptodate etc.
Also removes unnecessary node count per suggestion

* Apply suggestions from code review

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>

* Fix condition

* Remove extra time

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2022-08-11 13:20:48 -07:00
Sheetal Nandi 924c68ca95 use cache for program creation on watch mode. (#49958) 2022-08-10 16:56:54 -07:00
Sheetal Nandi 90cfbaee37 Make build info tolerant to json errors (#50265)
* Make build info tolerant to json errors
Fixes #49754

* Fix incorrect code
2022-08-10 16:44:35 -07:00
Sheetal Nandi bc7786b24e Ensure that file watcher is closed only once for affected file locations that share watcher because of different names but same real path (#50150)
* Add test where clearing affected files watcher that also is shared by real path causes Debug failure

* Ensure that file watcher is closed only once for affected file locations that share watcher because of different names but same real path

* Lift up package json map
2022-08-03 15:39:07 -07:00
Sheetal Nandi 394f51aeed Fix implied formats, file watching, new source file creating during edits (#50098)
* Add test where module resolution cache is not local and hence doesnt report errors in watch mode

* Ensure module resolution cache is passed through in watch mode

* Remove unnecessary setting of impliedFormat which should anyways be done as part of create source file

* Add test for packge.json changing and modifying implied format

* Distinguish between package.json watch and affecting file location watch

* Pass in failed lookup and affected file locations for source file's implied format
Also stop creating options if we already have them

* Add diagnostic for explaining file's implied format if based on package.json

* Watch implied format dependencies for modules and schedule update on change

* For program if implied node format doesnt match create new source file. Handle implied node format in document registry
Fixes #50086

* Modify tests to show package.json being watched irrespective of folder its in

* Check file path if it can be watched before watching package.json file

* Because we are watching package.json files and failed lookups its safe to invalidate package json entries instead of clearing them out everytime program is created

* Remove todos

* Fix the incorrect merge

* Pickup PackageJsonInfo renames from #50088

* Rename
2022-08-01 12:41:37 -07:00
Sheetal Nandi 5d790526a1 Pass correct module resolution state when reading package.json info so that they are correctly tracked in the resolution (#50085) 2022-07-28 17:19:10 -07:00
Sheetal Nandi 5b0eea48e9 Report error only on local declaration with additional related information (#49746)
* Add test where the errors are reported in different file
Test for #49739

* Report error only on local declaration with additional related information
Fixes #49739

* Handle existing tests
2022-07-27 15:31:45 -07:00
Sheetal Nandi c251d60095 Instead of storing timestamp of when last d.ts file was modified, store its name so buildinfo becomes portable again (#49717)
* Store dts change file path in buildinfo

* With composite, do not write d.ts files if they changed

* Determine dts change based on outputs

* Instead of storing time in buildinfo store filename which was last updated to get modified time stamp from

* Get declaration time change lazily

* Rename per feedback
2022-06-30 09:49:27 -07:00
Sheetal Nandi 7e91485bec Use value meaning for computed property name for visibility check (#49678)
* Test

* Use value meaning for computed property name
Fixes #49562
2022-06-27 15:16:33 -07:00
Sheetal Nandi df21926976 To handle d.ts emit errors that could affect other files, in incremental mode use d.ts emit text + diagnostics as signature of the file (#49543)
* Add test when declaration emit has errors and d.ts emit doesnt change which results in incorrect incremental behaviour

* Refactor

* Use declaration diagnostics in the d.ts signature for the file so it can be more accurate for detecting changes to file that could affect other files
Fixes #49527

* Renames and clarifications

* Simplify serialize declaration diagnostics for signature purpose
Do not serialize file name if error is in same file we are emitting. this should avoid having to do file path computation in most cases.
Locations are start and length instead of line and character.
Do not use any indents

* Fix baselines
2022-06-27 15:02:11 -07:00
Sheetal Nandi 4c1e8f2281 Fix incorrectly added resolution to resolutionsWithOnlyAffectingLocations (#49523) 2022-06-13 22:46:41 -07:00
Sheetal Nandi f5ad78720f Always recreate the file watcher when rename event occurs (#48997)
* Convert some of the watchEnvironment tests to baselines for updating later

* Add tests for inode watching by making fsWatch part of system function that tests presence before creating fs watch

* Refactor for simpler tests

* Accept map of file content or file or symlink or folder

* Add test when rename event occurs when file has already reappeared

* On rename event for the file, replace file watcher irrespective of file presence

* Fix regex

* Ensure that when doing inode watching watchers is replaces only on disappearance or appearance

* Some logging for debugging further

* Revert "Some logging for debugging further"

This reverts commit dd2164ac83.

* Add test when rename event occurs on mac with ~ appended to file name

* If the relativeFileName ends with tilde, remove it from the event

* Some logging for debugging further

* Revert "Some logging for debugging further"

This reverts commit e1ba8a8d5f.

* Add documentation and fail safe the event firing
2022-06-08 17:54:57 -07:00
Sheetal Nandi 5cedf3e680 Handle package.json watch in tsc and tsserver. (#49328)
* refactoring

* Maintain packagejson paths per resolution so we dont have invalidate everything on package json change

* Fix todo
2022-06-08 10:22:29 -07:00
Sheetal Nandi b8f6488323 Build improvements (#48784)
* Use fixed time for vfs so baselining is consistent

* Baseline buildinfos

* Write new file text in baseline even if the file wasnt read on the shadow

* Remove unnecessary debugger statement

* Make sure that incremental correctness is checked with correct writeFile so we know buildInfo was written
Also baseline these so its easy to verify the changes

* More baselines for the tsbuildinfo

* If we are writing dts file and have used file text as version, we can update the signature when doing actual emit

* Make WriteFileCallback Api ready for future

* Assert that there is only single source file when emitting d.ts file

* Add test

* Renames

* More refactoring

* If we are updating dts of any of the file and it affects global scope, everything needs update in signature and dts emit
Fixes #42769

* Stacktrace optimization for getModified time in anticipation of using it more than fileExists wherever possible

* Baseline getModifiedTime, setModifiedTime, fileExits and directoryExits for experiment

* Remove unnecessary write file finger print code since its not used at all

* Use modified time instead of file existence check

* Remove unnecessary getModifiedTime

* No need to check for file existence before reading the d.ts file

* Do project reference errors before doing input/output file checks

* Dont call getModifiedTimes if dts change

* Passdown modified time if queried

* Use modified time passed through the file watching in tsbuild

* Handle force build as separate upto date status

* uptodate status worker to read buildinfo and use it to determine upto date ness

* No need to update output timestamps if buildinfo will determine uptodateness

* Store change file set instead of hasPendingChange to be able to reuse the information

* Add test that shows input file is not present

* No need to check input time stamp before buildinfo

* Keep buildinfos for lifetime of the solution builder and project

* Store modified time along with text of buildinfo

* Non composite projects dont need to track declaration change time

* Pass through buildInfo so we dont have to parse it back

* Save dts change time in buildinfo itself

* Store dts time for --out in the buildInfo

* Store hash of text in the bundle info so it can be verified before manipulating text for fast updates during prepend
This helps when text changes during incremental build toggling and we determine we can just manipulate text

* Since buildinfo is cached no need to maintain version check state

* Store output time stamps for non incremental builds

* Revert "Baseline getModifiedTime, setModifiedTime, fileExits and directoryExits for experiment"

This reverts commit 7e65cd3315.

* Change verbose messages for upto date status

* Reconcile reusable builder state and builder state so there are not two different types that are almost similar looking

* Cleanup impliedFormat

* Cleanup

* Cleanup noEmit option

* BuildInfo options emit as a flag

* Factor out types for program written in buildinfo with and without bundle emit

* No need to store output file stamps if not in watch mode

* Cleanup

* Test for single watch per file

* Fix emit and error update baselines that were duplicate

* More refactoring

* Only copy emit state fields when backing up to restore if emit fails

* Instead of maintaining delta of changes, maintain old state for those changes

* Add test to verify build when input file does not change

* If version of the input file does not change, dont mark as out of date

* Disable lint warning as build fails without the assert

* Report aggregate statistics for solution as well as some solution perf numbers

* Options solutionDiagnostics instead so that its not too verbose when printing diagnostics

* When tsc --build --clean, only remove tsbuildinfo if its incremental build

* Revert "Options solutionDiagnostics instead so that its not too verbose when printing diagnostics"

This reverts commit 0cf9e30103.

* Revert "Report aggregate statistics for solution as well as some solution perf numbers"

This reverts commit 405d8e9197.

* Revert "When tsc --build --clean, only remove tsbuildinfo if its incremental build"

This reverts commit e4e6672609.

* Comments in the code

* Feedback
2022-06-08 09:48:34 -07:00
Sheetal Nandi 0ad5f82d62 Fix the implicit glob key so that recursive keys are not differing just directory separator for wildcard directory (#49246)
* Add failing test

* Fix the implicit glob key so that recursive keys are not differing just by directory seperator
Fixes #49078

* Reset the reload level once program is loaded
2022-05-25 12:30:40 -07:00
Sheetal Nandi 7c6521e8fb When building projects in watch mode, only schedule projects that need build or need update to bundle (#48865)
* Handle timesouts to reflect the time it was set with

* Remove unused internal calls from solution builder

* If the project doesnt need building or updating bundle, dont schedule it but do it right away

* Reduce the time between project builds to 100ms

* Some tests for projects building

* Schedule builds such that when change is not detected 5 projects are built at a time

* Fix tests in main
2022-05-23 11:40:57 -07:00