21 Commits

Author SHA1 Message Date
vakrilov
311723d369 refactor(@ngtools/webpack): expose TS TypeChecker from NG compiler plugin
Expose the TypeScript Program created by the plugin, so that it can be used in custom platform transformers.
2018-08-13 17:01:43 -07:00
Charles Lyding
c729b0e7d9 build: use yarn workspaces 2018-08-10 18:25:32 -07:00
Charles Lyding
64cf05b88f fix(@ngtools/webpack): resolve relative host replacement paths
Fixes: #11801
2018-08-08 11:09:09 +01:00
Matt Lewis
928d05a878 fix(@ngtools/webpack): support typescript 2.8 + 2.9 2018-07-25 21:27:18 -07:00
Hans
18de4f4db8 revert: "fix(@ngtools/webpack): improve fallbacking for path mapping"
This reverts commit 47f937e28f0a9d82997bd29630a8b3b92f44c0f5.

This commit had a few issues detected by the NativeScript project. It is
likely that they would have affected more users (and libraries) and so
it is safer to revert now and investigate later. Will likely be fixed in
6.2 by refactoring this whole plugin properly.
2018-07-18 18:12:59 -05:00
Hans
0a329d644d revert: "fix(@ngtools/webpack): fix resolution fallback of paths-plugin"
This reverts commit 0bef5aa4be0a793ad096208efbb925ab98b39251.
2018-07-18 18:12:59 -05:00
Filipe Silva
6165cdfc3f fix(@ngtools/webpack): don't add resource sourcemap to parent compilation
Fix #9980
2018-07-14 22:03:47 -07:00
Charles Lyding
56cd6f75ae refactor(@ngtools/webpack): use webpack input filesystem as default host 2018-07-12 15:53:29 -07:00
Charles Lyding
d8840d59c2 refactor(@ngtools/webpack): support function-based host file replacement 2018-07-12 15:53:29 -07:00
Charles Lyding
d09d739b60 fix(@ngtools/webpack): support watching file replacements 2018-07-12 15:53:29 -07:00
Charles Lyding
0a8a797268 refactor(@ngtools/webpack): support file replacement without copying 2018-07-12 15:53:29 -07:00
Hans
0bef5aa4be fix(@ngtools/webpack): fix resolution fallback of paths-plugin
If there is a package.json we should also verify that it has a main or fesm field
to see if webpack would actually resolve it properly. Otherwise use the JavaScript
resolution.

This is a temporary fix and still has obvious limitations and issues. Namely, this
code is never run if there is only one path mapping, but that falls outside the
scope of this fix. Also, some people might have valid packages but want to resolve
to the JS file itself (which is what TypeScript does by default). These should be
fixed with a refactoring of the path plugin.

Fixes https://github.com/nativescript/nativescript-dev-webpack/issues/607
2018-07-12 09:26:36 -07:00
Hans Larsen
483cbe2665 refactor: add tslint-sonarts and a lot of tslint rules
This should clean up the code a bit.

Note: at first I added the no-useless-cast rule, but after getting frustrated
with it (as it has many false positive), I decided to remove the rule but some
useless casts were removed so I let those in the PR.
2018-07-10 15:07:36 -07:00
Hans Larsen
c1702d3579 refactor: add no-floating-promises lint rule to project
With fixes; new now handles the parent initialize, visitor_spec now errors on
rejection, and nothing in the writeI18nOutFile() function was async so removed
the promise there entirely.
2018-07-10 15:07:36 -07:00
Charles Lyding
eec5262bbe refactor(@ngtools/webpack): remove unneeded tsconfig 2018-07-06 09:13:20 -04:00
Charles Lyding
28e8f06602 refactor(@ngtools/webpack): cleanup webpack types and use tapPromise 2018-07-06 09:13:20 -04:00
Alan Agius
47f937e28f fix(@ngtools/webpack): improve fallbacking for path mapping
TypeScript resolution works as follows;

```
    // /node_modules/moduleB.ts
    // /node_modules/moduleB.tsx
    // /node_modules/moduleB.d.ts
    // /node_modules/moduleB/package.json (if it specifies a "types" property)
    // /node_modules/moduleB/index.ts
    // /node_modules/moduleB/index.tsx
    // /node_modules/moduleB/index.d.ts
```
2018-07-02 21:30:56 -04:00
Charles Lyding
4c6d3b185a fix(@ngtools/webpack): improve support for multi-option path mapping 2018-07-02 08:22:48 -04:00
Alan Agius
3108ce30ab refactor: remove redundant error in catch 2018-07-02 08:20:59 -04:00
Filipe Silva
fb6b3ad0ca feat(@ngtools/webpack): allow passing in the right ContextElementDependency class
This should allow multiple webpack versions in the workspace dependencies with no weird errors.

Fix https://github.com/angular/angular-cli/issues/6417 for good.
2018-06-08 12:54:22 +01:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00