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

"processFilesForTarget" function gets to process .ts files from node_modules #1902

Open
iperevozchikov opened this issue Mar 30, 2018 · 2 comments

Comments

@iperevozchikov
Copy link
Contributor

Hi, "angular-compilers" when compiling project processing .ts files from node_modules. It seems that not correct.

Steps to reproduce it:

  1. Get bare project from examples directory
  2. Add new package, which contains .ts file, for example @types/meteor-collection-hooks
  3. Start project via meteor npm start
  4. See errors
> @ start /home/iperevozchikov/Sources/test-pro
> meteor run

[[[[[ ~/Sources/test-pro ]]]]]                

=> Started proxy.                             
[client]: ES2015 modules Compilation: 1038.347ms
node_modules/meteor-typings/1.4/test/test.ts (467, 8): Property '_localStorage' does not exist on type 'typeof Meteor'.
node_modules/meteor-typings/1.4/test/test.ts (468, 8): Property '_localStorage' does not exist on type 'typeof Meteor'.
node_modules/meteor-typings/1.4/test/test.ts (469, 8): Property '_localStorage' does not exist on type 'typeof Meteor'.
node_modules/meteor-typings/1.4/test/test.ts (737, 24): Type '(userId: string) => boolean' has no properties in common with type 'Matcher'.
[client]: TypeScript Files Compilation: 3153.892ms
[client]: HTML Files Compilation: 12.694ms   \
[client]: SCSS Files Compilation: 3.157ms    \
[server]: ES2015 modules Compilation: 555.509ms
node_modules/meteor-typings/1.4/test/test.ts (467, 8): Property '_localStorage' does not exist on type 'typeof Meteor'.
node_modules/meteor-typings/1.4/test/test.ts (468, 8): Property '_localStorage' does not exist on type 'typeof Meteor'.
node_modules/meteor-typings/1.4/test/test.ts (469, 8): Property '_localStorage' does not exist on type 'typeof Meteor'.
node_modules/meteor-typings/1.4/test/test.ts (737, 24): Type '(userId: string) => boolean' has no properties in common with type 'Matcher'.
[server]: TypeScript Files Compilation: 1101.867ms
[server]: HTML Files Compilation: 0.017ms    -
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/

My environment:

  1. meteor 1.6.1
  2. [email protected]

I found that "processFilesForTarget" function exclude only angular based dependencies like rxjs, angular, tsickle, etc.
Also was ignored section "exclude" from tsconfig and it's strange undocumented behavior.
Because package would need to integrate into the typescript way of compilation, but don't ignore.

@ardatan
Copy link
Collaborator

ardatan commented Apr 1, 2018

Yes, this is expected behavior which is not well-documented as you said. We added this feature to solve some problems with ES2015 modules which is not bundled for CommonJS, but it causes an ignorance for field exclude in tsconfig.json. This is about external dependency meteor-typescript that we will investigate a solution for this. This post will be updated. Stay tuned!

Thank you for your collaboration!

@iperevozchikov
Copy link
Contributor Author

Hi @ardatan . I composed the list of errors in my app and it was be next:

  1. node_modules/ng2-material-dropdown/demo/home/components/dropdown-container.ts;
  2. node_modules/meteor-typings/1.4/test/test.ts;
  3. node_modules/ng-lazyload-image/src/lazyload-image.module.ngfactory.ts;
  4. node_modules/sift/test.ts.

Errors above were perfect be grouped into 3 categories:

  1. test
  2. demo
  3. src

If the src category does not look unambiguous, because it may have really important information for your app.
But others categories may be excluded without any problem for your app by rules based on detecting demo and tests contents.
Also, would be great to enable some custom section in tsconfig.json for the user-based excluding rules, for example

angularTypescript: { 
    exclude: [ 
        "node_modules/**/*/test.ts" 
    ] 
}

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

No branches or pull requests

2 participants