Skip to content

Commit

Permalink
Some logging for debugging further
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalkamat committed May 23, 2022
1 parent 88e62d2 commit dd2164a
Show file tree
Hide file tree
Showing 208 changed files with 3,422 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1120,10 +1120,15 @@ namespace ts {
recursive,
inodeWatching ?
callbackChangingToMissingFileSystemEntry :
callback
(eventName, relativeFileName) => {

sysLog(`sysLog:: watchPresentFileSystemEntry:: ${fileOrDirectory} ${entryKind} ${eventName}:: ${relativeFileName}`);
callback(eventName, relativeFileName);
}
);
// Watch the missing file or directory or error
presentWatcher.on("error", () => {
sysLog(`sysLog:: watchPresentFileSystemEntry:: on Error ${fileOrDirectory} ${entryKind} rename, ""`);
callback("rename", "");
updateWatcher(watchMissingFileSystemEntry);
});
Expand All @@ -1140,6 +1145,7 @@ namespace ts {
}

function callbackChangingToMissingFileSystemEntry(event: "rename" | "change", relativeName: string | undefined) {
sysLog(`sysLog:: callbackChangingToMissingFileSystemEntry:: ${fileOrDirectory} ${entryKind} ${event}:: ${relativeName} ${inodeWatching} ${lastDirectoryPart} ${lastDirectoryPartWithDirectorySeparator}`);
callback(event, relativeName);
// because relativeName is not guaranteed to be correct we need to check on each rename with few combinations
// Eg on ubuntu while watching app/node_modules the relativeName is "node_modules" which is neither relative nor full path
Expand All @@ -1163,7 +1169,10 @@ namespace ts {
function watchPresentFileSystemEntryWithFsWatchFile(): FileWatcher {
return watchFile(
fileOrDirectory,
createFileWatcherCallback(callback),
createFileWatcherCallback((eventName, relativeFileName) => {
sysLog(`sysLog:: watchPresentFileSystemEntryWithFsWatchFile:: ${fileOrDirectory} ${entryKind} ${eventName}:: ${relativeFileName}`);
callback(eventName, relativeFileName);
}),
fallbackPollingInterval,
fallbackOptions
);
Expand All @@ -1177,7 +1186,9 @@ namespace ts {
return watchFile(
fileOrDirectory,
(_fileName, eventKind) => {
sysLog(`sysLog:: watchMissingFileSystemEntry:: ${fileOrDirectory} ${entryKind} ${_fileName}:: ${eventKind}`);
if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) {
sysLog(`sysLog:: watchMissingFileSystemEntry:: Callback :: rename, "" and will update the watcher`);
callback("rename", "");
// Call the callback for current file or directory
// For now it could be callback for the inner directory creation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ export function lastElementOf<T>(arr: T[]): T | undefined {


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/demo/core 1 change:: utilities.ts

>> Screen clear
[12:01:07 AM] File change detected. Starting incremental compilation...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ Input::


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/demo/core 1 change:: tsconfig.json

>> Screen clear
[12:00:52 AM] File change detected. Starting incremental compilation...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ Input::


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: package.json

>> Screen clear
[12:01:17 AM] File change detected. Starting incremental compilation...

Expand Down Expand Up @@ -370,6 +372,8 @@ Input::


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: package.json

>> Screen clear
[12:01:24 AM] File change detected. Starting incremental compilation...

Expand Down Expand Up @@ -414,6 +418,7 @@ File '/user/username/projects/myproject/packages/pkg2/build/const.ts' does not e
File '/user/username/projects/myproject/packages/pkg2/build/const.tsx' does not exist.
File '/user/username/projects/myproject/packages/pkg2/build/const.d.ts' exist - use it as a name resolution result.
======== Module name './const.js' was successfully resolved to '/user/username/projects/myproject/packages/pkg2/build/const.d.ts'. ========
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: build/index.js
[12:01:30 AM] Found 0 errors. Watching for file changes.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ Input::


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: package.json

>> Screen clear
[12:01:11 AM] File change detected. Starting incremental compilation...

Expand Down Expand Up @@ -389,6 +391,8 @@ Input::


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: package.json

>> Screen clear
[12:01:18 AM] File change detected. Starting incremental compilation...

Expand Down Expand Up @@ -432,6 +436,7 @@ File '/user/username/projects/myproject/packages/pkg2/build/const.d.cts' exist -
File '/a/lib/package.json' does not exist.
File '/a/package.json' does not exist.
File '/package.json' does not exist.
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: build/index.js
[12:01:24 AM] Found 0 errors. Watching for file changes.


Expand Down Expand Up @@ -499,6 +504,8 @@ Input::


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg1 1 change:: package.json

>> Screen clear
[12:01:28 AM] File change detected. Starting incremental compilation...

Expand Down Expand Up @@ -623,6 +630,12 @@ export type { TheNum } from './const.cjs';
//// [/user/username/projects/myproject/packages/pkg2/index.ts] deleted

Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: package.json
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: index.ts
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: index.cts
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change::

>> Screen clear
[12:01:39 AM] File change detected. Starting incremental compilation...

Expand All @@ -642,8 +655,16 @@ File '/user/username/projects/myproject/packages/pkg2/const.cts' exist - use it
File '/a/lib/package.json' does not exist.
File '/a/package.json' does not exist.
File '/package.json' does not exist.
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: build/index.cjs
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 rename:: build/index.d.cts
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/tsconfig.tsbuildinfo
[12:01:50 AM] Updating unchanged output timestamps of project '/user/username/projects/myproject/packages/pkg2/tsconfig.json'...

sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/const.cjs
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/const.d.cts
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject/packages/pkg2 1 change:: build/tsconfig.tsbuildinfo.readable.baseline.txt


Program root files: ["/user/username/projects/myproject/packages/pkg2/const.cts","/user/username/projects/myproject/packages/pkg2/index.cts"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ Input::
//// [/user/username/projects/myproject/a.js] file written with same contents

Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js

>> Screen clear
[12:00:35 AM] File change detected. Starting incremental compilation...

Expand Down Expand Up @@ -177,13 +179,17 @@ const x = 10;


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js

>> Screen clear
[12:00:42 AM] File change detected. Starting incremental compilation...

[12:00:43 AM] Project 'tsconfig.json' is out of date because output file 'b.js' does not exist

[12:00:44 AM] Building project '/user/username/projects/myproject/tsconfig.json'...

sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: tsconfig.tsbuildinfo
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: tsconfig.tsbuildinfo.readable.baseline.txt
[12:00:51 AM] Found 0 errors. Watching for file changes.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Input::
//// [/user/username/projects/myproject/a.js] file written with same contents

Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js

>> Screen clear
[12:00:31 AM] File change detected. Starting incremental compilation...

Expand Down Expand Up @@ -129,6 +131,8 @@ const x = 10;


Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/myproject 1 change:: a.js

>> Screen clear
[12:00:38 AM] File change detected. Starting incremental compilation...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Input::
//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents
Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
>> Screen clear
[12:00:39 AM] File change detected. Starting incremental compilation...
Expand Down Expand Up @@ -157,13 +159,33 @@ const a = {
Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
>> Screen clear
[12:00:46 AM] File change detected. Starting incremental compilation...
[12:00:47 AM] Project 'tsconfig.json' is out of date because output file 'dev-build/shared/types/db.js' does not exist
[12:00:48 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'...
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/shared
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/shared/types
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/shared/types/db.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared/types
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/src
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/src/main.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/src/other.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/tsconfig.tsbuildinfo
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 rename:: dev-build/tsconfig.tsbuildinfo.readable.baseline.txt
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build
[12:01:09 AM] Found 0 errors. Watching for file changes.
Expand Down Expand Up @@ -293,6 +315,8 @@ const a: string = 10;
Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
>> Screen clear
[12:01:13 AM] File change detected. Starting incremental compilation...
Expand All @@ -305,6 +329,8 @@ Output::
2 const a: string = 10;
   ~
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo.readable.baseline.txt
[12:01:22 AM] Found 1 error. Watching for file changes.
Expand Down Expand Up @@ -424,6 +450,8 @@ Input::
//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents
Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
>> Screen clear
[12:01:27 AM] File change detected. Starting incremental compilation...
Expand Down Expand Up @@ -481,15 +509,22 @@ const a: string = "hello";
Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
>> Screen clear
[12:01:34 AM] File change detected. Starting incremental compilation...
[12:01:35 AM] Project 'tsconfig.json' is out of date because oldest output 'dev-build/shared/types/db.js' is older than newest input 'src/main.ts'
[12:01:36 AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'...
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/main.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo
[12:01:44 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'...
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared/types/db.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/other.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo.readable.baseline.txt
[12:01:48 AM] Found 0 errors. Watching for file changes.
Expand Down Expand Up @@ -599,6 +634,8 @@ Input::
//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents
Output::
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: src/main.ts
>> Screen clear
[12:01:52 AM] File change detected. Starting incremental compilation...
Expand All @@ -608,6 +645,10 @@ Output::
[12:01:56 AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'...

sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/shared/types/db.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/main.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/src/other.js
sysLog:: watchPresentFileSystemEntry:: /user/username/projects/noemitonerror 1 change:: dev-build/tsconfig.tsbuildinfo
[12:01:57 AM] Found 0 errors. Watching for file changes.


Expand Down
Loading

0 comments on commit dd2164a

Please sign in to comment.