Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of trace for traceResolution in #691 #721

Merged
merged 1 commit into from
Feb 7, 2018
Merged

Initial implementation of trace for traceResolution in #691 #721

merged 1 commit into from
Feb 7, 2018

Conversation

onigoetz
Copy link
Contributor

@onigoetz onigoetz commented Feb 7, 2018

Hi,

sorry for the long time between the initial discussion and the pull request. I tried to do the first implementation for issue #691

I tried to write a test but could not. When running them it gets stuck at the first test:

Uncaught AssertionError [ERR_ASSERTION]: patch0/output.txt is different between actual and expected
      + expected - actual

           Asset     Size  Chunks             Chunk Names
       bundle.js   A-NUMBER-OF kB       0  [emitted]  main
      -   [0] ./.test/aliasResolution/app.ts A-NUMBER-OF bytes {0} [built]
      +   [0] ./.test/aliasResolution/app.ts A-NUMBER-OF bytes {0}
          [1] ./.test/aliasResolution/common/components/myComponent.ts A-NUMBER-OF bytes {0} [built]

@johnnyreilly
Copy link
Member

That's fine - talk to me how this would be used / what output you expect to see when you are using it.

Let's see if I can help you.

@johnnyreilly
Copy link
Member

My guess is we can clone an existing test (aliasResolution perhaps), call it traceResolution perhaps.

Then:

@onigoetz
Copy link
Contributor Author

onigoetz commented Feb 7, 2018

Sooo, I did it .. good news is your instructions worked like a charm. Bad news, the stdout isn't stored in the expected output.

Also, the full path to the files is in the logs, which makes them un-reproducible.

What can I do to make it write the output to output.txt and automatically replace absolute paths ?

The Full output I get is the following :

Expected output redirected to stdout
======== Resolving type reference directive 'braces', containing file '/Users/onigoetz/Sites/Library/ts-loader/__inferred type names__.ts', root directory '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types'. ========
Resolving with primary search path '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field '' that references '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces'.
Found 'package.json' at '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/package.json'. Package ID is '@types/braces/.d.ts@2.3.0'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts' exist - use it as a name resolution result.
Resolving real path for '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts', result '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts'.
======== Type reference directive 'braces' was successfully resolved to '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts', primary: true. ========
======== Resolving type reference directive 'micromatch', containing file '/Users/onigoetz/Sites/Library/ts-loader/__inferred type names__.ts', root directory '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types'.========
Resolving with primary search path '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field '' that references '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch'.
Found 'package.json' at '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch/package.json'. Package ID is '@types/micromatch/.d.ts@3.1.0'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch/index.d.ts' exist - use it as a name resolution result.
Resolving real path for '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch/index.d.ts', result '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch/index.d.ts'.
======== Type reference directive 'micromatch' was successfully resolved to '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch/index.d.ts', primary: true. ========
======== Resolving type reference directive 'semver', containing file '/Users/onigoetz/Sites/Library/ts-loader/__inferred type names__.ts', root directory '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types'. ========
Resolving with primary search path '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field '' that references '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/semver'.
Found 'package.json' at '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/semver/package.json'. Package ID is '@types/semver/.d.ts@5.4.0'.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/semver/index.d.ts' exist - use it as a name resolution result.
Resolving real path for '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/semver/index.d.ts', result '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/semver/index.d.ts'.
======== Type reference directive 'semver' was successfully resolved to '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/semver/index.d.ts', primary: true. ========
======== Resolving module 'braces' from '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch/index.d.ts'. ========
Module resolution kind is not specified, using 'NodeJs'.
Loading module 'braces' from 'node_modules' folder, target file type 'TypeScript'.
Directory '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/micromatch/node_modules' does not exist, skipping all lookups in it.
Directory '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/node_modules' does not exist, skipping all lookups in it.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field 'index.js' that references '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces/index.js'.
Found 'package.json' at '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces/package.json'. Package ID is 'braces/i.d.ts@2.3.0'.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces.ts' does not exist.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces.tsx' does not exist.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces.d.ts' does not exist.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces/index.ts' does not exist.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces/index.tsx' does not exist.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/braces/index.d.ts' does not exist.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
'package.json' has 'main' field '' that references '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces'.
Found 'package.json' at '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/package.json'. Package ID is '@types/braces/.d.ts@2.3.0'.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces.d.ts' does not exist.
'package.json' does not have a 'typings' field.
'package.json' does not have a 'types' field.
File '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts' exist - use it as a name resolution result.
Resolving real path for '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts', result '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts'.
======== Module name 'braces' was successfully resolved to '/Users/onigoetz/Sites/Library/ts-loader/node_modules/@types/braces/index.d.ts'. ========

@johnnyreilly johnnyreilly merged commit af75ecb into TypeStrong:master Feb 7, 2018
@johnnyreilly
Copy link
Member

Oh wow. Yeah - that makes sense. Bottom line, this is a 1 line change - it doesn't break existing tests and it adds functionality. Merged.

@onigoetz
Copy link
Contributor Author

onigoetz commented Feb 7, 2018

Oh, thanks :) That was fast

@johnnyreilly
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants