517 Commits

Author SHA1 Message Date
Alan Agius
8f77d6711a fix(@angular-devkit/build-angular): update speed-measure-webpack-plugin to 1.3.1
This fixes the issue of it generating an empty speed-measure-plugin.json.

Fixes #12763
2019-03-19 09:28:20 -07:00
Alan Agius
f71896874e feat(@angular-devkit/build-angular): enable webpack profile when using stats-json flag
More information about what `profile` does can be found here: https://webpack.js.org/api/stats

Closes #13907
2019-03-19 09:25:28 -07:00
Alan Agius
20a644ec4b fix(@angular-devkit/build-angular): passing port 0 when using serve will not find a suitable port
At the moment, when passing port `0` it will default to `4200` which is incorrect. `4200` should be used a baseport.
2019-03-19 09:23:08 -07:00
Charles Lyding
a49d278baa feat(@angular-devkit/build-angular): implement stable architect API for protractor 2019-03-19 09:17:15 -07:00
Charles Lyding
fc48101a90 feat(@angular-devkit/build-ng-packagr): implement stable architect API 2019-03-19 09:05:01 -07:00
Hans Larsen
deeea03650 test: fix invalid architect tests
See fe229faf78
2019-03-15 16:07:06 -07:00
Renovate Bot
c85e4048d7 build: update autoprefixer to version 9.5.0 2019-03-15 16:06:53 -07:00
Alan Agius
330e56ed6d feat(@angular-devkit/build-angular): deprecate profile option in build
This flag has been deprecated in favor of the `NG_BUILD_PROFILING`  environment variable. This is mainly due not to expose debugging flag in our API.
2019-03-15 16:06:15 -07:00
Hans Larsen
ef3dd70001 test: remove build-angular browser tests for old API
Move the new API tests in its place.
2019-03-15 16:05:42 -07:00
Hans Larsen
c28fb10f40 test: use toContain instead of simply true/false
It will show up better in the logs if it doesnt match.
2019-03-15 12:23:43 -07:00
Alex Eagle
fe229faf78 test: comment out broken assertion 2019-03-13 14:28:25 -07:00
Charles Lyding
ebf90b3d6a refactor(@angular-devkit/build-angular): remove unused host parameter from typescript webpack methods 2019-03-13 13:55:26 -07:00
Charles Lyding
8644608987 refactor(@angular-devkit/build-angular): remove redundant getNonAotTestConfig function
The `getNonAotConfig` and `getNonAotTestConfig` functions are equivalent in regards to behavior.  The `extract` optional parameter for `_createAotPlugin` is false by default.
2019-03-13 13:55:26 -07:00
Olivier Combe
3d8064bb64 feat(@angular-devkit/build-angular): remove Closure compiler i18n code for ivy
For runtime i18n with ivy we generate code for both Closure compiler (used at Google) and for external people that don't use Closure compiler.
We added a new global flag named `ngI18nClosureMode` that allows uglify (and Closure compiler) to effectively tree-shake all of the code that isn't used in the current setup.
By default we remove all of the Closure compiler code because we assume that it won't be used.
2019-03-13 13:55:07 -07:00
Alan Agius
f70b9060d0 fix(@angular-devkit/build-angular): don't show warning when font shorthand is used
At the moment when `font` shorthand property is used a warning is emitted when using this syntax
```
font: 10px "Font Awesome";
```

This should be addressed by clean-css

Fixes #9648
2019-03-13 13:54:09 -07:00
Alan Agius
8d09594874 fix(@angular-devkit/build-angular): resolve fonts with space in filename
At the moment the uri of the font instead of spaced it will be `%20`, hence we need to decode it first before trying to resolve it.

Fixes #9648
2019-03-13 13:54:09 -07:00
Alex Eagle
eb5643e370 feat(@angular-devkit/core): Remove dep on chokidar
It is unused within our code, as webpack will do the file watching.
This removes 1.4 MB from the download size of the package.
See https://codepen.io/alexeagle/full/zbZWRM

BREAKING CHANGE:
Users who rely on angular-devkit/core to do the file watching must add chokidar to their devDependencies.
2019-03-13 13:53:53 -07:00
Renovate Bot
937dc635e6 build: update source-map-support to version 0.5.11 2019-03-13 13:52:53 -07:00
Renovate Bot
3bb368030f build: update copy-webpack-plugin to version 5.0.1 2019-03-13 13:51:42 -07:00
Hans Larsen
cf5e3b19b6 feat(@angular-devkit/build-angular): move dev-server to new API
Includes moving all the tests.
2019-03-13 13:51:22 -07:00
Hans Larsen
481a5aa142 feat(@angular-devkit/architect-cli): clear console and show logs
This gives better support for watching builders (such as serve). It clears the
console, and everytime an output happens from the builder it shows the logs
so far. This allows people to see the logs.

Also shows the result object (without builder info) so people can see custom
builder output.
2019-03-13 13:51:22 -07:00
Hans Larsen
31e1ae9d17 feat(@angular-devkit/architect): add new context methods
getBuilderNameForTarget() allows someone to get the builder name string for a specific
target (or return a rejected promise if it fails).

validateOptions() allows a builder to validate options against the same mechanics that
are used when scheduling builders.

These two methods allow builders to get options from a workspace (or build some option
object), change it, validate it, and execute scheduleBuilder() if they want to schedule
directly (or want a parallel run).
2019-03-13 13:51:22 -07:00
Hans Larsen
128af102a3 feat(@angular-devkit/architect): getOptionsForTarget should return null
If the target does not exist in the workspace.
2019-03-13 13:51:22 -07:00
Hans Larsen
e2163a0bde refactor(@angular-devkit/architect): clarify some error messages
They will be redone in classes before RC, but for now this helps diagnose
obscure messages.
2019-03-13 13:51:22 -07:00
Hans Larsen
4bfb29704f refactor(@angular-devkit/build-webpack): rename BuildResult to BuildOutput
Stays consistent across builders. This is the interface of the output provided by the
webpack dev server.
2019-03-13 13:51:22 -07:00
Hans Larsen
ffee8938bb test: add tests for error propagation in jobs
It seems some testing was missing.
2019-03-13 13:51:22 -07:00
Hans Larsen
08e91a94ab build: refactor QoL on monorepo.json
This should make it easier to manage and diff. This takes 2 things into account:
1. we have either stable or experimental versions and each are kept in monorepo.
2. we dont keep hash and update only changed packages.

This commit also removed the hash to make sure this does not happen.
2019-03-13 13:51:01 -07:00
Alan Agius
a24c46182f test: fix chunk in entry test 2019-03-13 13:49:49 -07:00
Hans Larsen
3ac1cc30a7 feat(@angular-devkit/architect): add scheduleTargetAndForget function
It came up with Nrwl that this is a common pattern; someone wants to schedule a
target but does not want to manage the run himself. This function cancels the
run when the Observable is unsubscribed from (which is not the case for a
traditional run).

Because stop logic can be asynchronous, we need to add a teardown logic
handler to the context, which turns out to be useful for other cases as
well.
2019-03-11 13:48:01 -07:00
Hans Larsen
6a0b3fe6b2 feat(@angular-devkit/build-angular): re-export schemas
When we moved to using QuickType to generate those we removed those
exports. That was an unfortunate breaking change.
2019-03-11 13:48:01 -07:00
Hans Larsen
78a4149384 feat(@angular-devkit/build-angular): browserTarget should match target pattern 2019-03-11 13:48:01 -07:00
Hans Larsen
890cfbe7c7 fix(@angular-devkit/build-angular): fail the build if service worker fails
Its the sensible thing to do.
2019-03-11 13:48:01 -07:00
Hans Larsen
15312e8ef0 feat(@angular-devkit/architect): add targetFromTargetString() function
Useful for reading options. This uses the reverse logic from
targetStringFromTarget().

Also add tests for both functions.
2019-03-11 13:48:01 -07:00
Charles Lyding
9bd93579c7 test(@angular-devkit/build-angular): ensure server address type before use 2019-03-11 13:46:48 -07:00
Charles Lyding
54ad086493 fix(@angular-devkit/build-webpack): check server address type before use 2019-03-11 13:46:48 -07:00
Charles Lyding
1357ea2183 build: update minimum required Node.js version to 10.9 2019-03-11 13:46:48 -07:00
Alan
b32ad328cf fix(@angular-devkit/build-optimizer): don't add pure comments inside arrow functions
Fixes #13768
2019-03-11 13:45:00 -07:00
Alan Agius
1e3c6e3ca5 fix(@angular-devkit/build-angular): fix base href insertion when HTML is in a single line
When HTML is in a single line using offset + 1 will cause the insertion of the base href tag in the wrong possition.

Fixes #13851
2019-03-11 13:43:54 -07:00
Alan
901042d95b fix(@angular-devkit/build-angular): fix check for absolute paths in windows in server config
This changes fixes `Error: You must pass in a NgModule or NgModuleFactory to be bootstrapped`.

At the moment the check for absolute path is not correct for windows.

Fixes #13865 and fixes https://github.com/angular/universal/issues/1139
2019-03-11 13:40:38 -07:00
Hans Larsen
15d7aea2b7 feat(@angular-devkit/core): analytics interfaces and basic implementations
This is a preliminary analytics interface. It is meant to be used by every
other subsystem where useful, but can be replaced by implementations.
2019-03-11 13:38:00 -07:00
Renovate Bot
29b1533fa9 build: update webpack-dev-middleware to version 3.6.1 (#13843) 2019-03-07 16:02:08 -08:00
clydin
b1477425d9 feat(@angular-devkit/schematics): support unicode character HTML element names (#13837)
The HTML specification allows for a wide variety of characters to be present within a custom element name.  The previous behavior limited the names to mostly alphanumeric characters.  This change opens up the names to include the characters specified within the specification for custom element names.
2019-03-07 16:01:41 -08:00
clydin
324d9f2d4f feat(@angular-devkit/schematics): support basic promise/async based rules (#13660)
Currently, all third-party schematic developers are forced to use and directly depend on `rxjs` if any logic is asynchronous.   Doing so can can also add overhead and unneeded complexity for organizations that have chosen to standardize on async/await usage. This change allows such parties to rely on native promise support if desired.
2019-03-07 15:51:03 -08:00
Charles Lyding
a1aa8d56c4 feat(@angular-devkit/core): add workspace reader/writer core API
NOTE: No changes have yet been made to the public API of the package.
This introduces the core and eventual public API for the stable workspace API.  This is not intended to be feature complete but rather represents the initial base infrastucture necessary for pending future feature additions.
2019-03-06 11:34:05 -08:00
Charles Lyding
263231ea56 refactor(@angular-devkit/core): move existing workspace API under experimental
This API is already experimental.  The move allows for the new stable API to use the "workspace" directory structure and to also better signify that the existing API is in fact experimental and subject to change or removal.
2019-03-06 11:34:05 -08:00
Alan
309b4838c3 fix(@angular-devkit/build-angular): don't bundle linked modules when bundleDependencies in none in server builder
Fixes #13817
2019-03-06 11:29:51 -08:00
Filipe Silva
643e83d054 feat(@schematics/angular): use esnext as the default TS module format 2019-03-06 11:29:34 -08:00
Alan Agius
320273af5a feat(@angular-devkit/build-angular): add support for tslint 5.13+
Tslint 5.13+ introduced an addition parameter for the format method, mainly used for check-style formatter.

During runtime users using an older version of tslint that doesn't expose this it is not a problem as this parameter will be ignored.

See: 9000479b69
2019-03-06 11:28:37 -08:00
Alex Eagle
4e262f966f build: Update to latest bazel rules 2019-03-06 11:27:48 -08:00
Hans Larsen
f06493cb8a feat(@angular-devkit/architect): QoL changes for builders
Add a scheduling options to scheduleTarget and Builder on the context so
builders can schedule sub-builds and override the logger.

Add a getTargetOptions() for builders to get access to options from the
host for a specific target. This allows builders to get options, override
some, then scheduleBuilder with those new options, for example.
2019-03-06 10:05:31 -08:00