149 Commits

Author SHA1 Message Date
Alex Eagle
ee619c9a34 build: run Bazel format/lint fix 2019-04-22 08:38:00 -07:00
Minko Gechev
d4a1c4fca8 fix(@angular-devkit/architect): consume the default export in TestingArchitectHost
Using the TestingArchitectHost architect is unable to execute the
handler of the builder since it needs to access its `default` property.
2019-04-16 12:58:38 -07:00
Minko Gechev
db3af22140 fix(@angular-devkit/architect): set proper name in TestingArchitectHost
The TestingArchitectHost registers the builders only using their name,
ignoring the package name. Later, when Architect looks up the builder
using the host, it's unable to find it.

You can find a reproduction
[here](https://github.com/mgechev/cli-builders-demo).
2019-04-16 09:42:18 -07:00
Alan Agius
da628bdda7 style: remove extra breakline from build file 2019-04-15 11:08:46 -07:00
Alan Agius
260dacfb41 test: add new architect api to golden files 2019-04-15 11:08:46 -07:00
Charles Lyding
0a59307c19 fix(@angular-devkit/architect): fix incorrect relative core import 2019-04-12 15:40:51 -07:00
Charles Lyding
588d61e608 refactor(@angular-devkit/architect): remove temporary index2 entrypoint 2019-04-04 19:49:56 -07:00
Charles Lyding
db14292b52 fix(@angular-devkit/architect): remove experimental API 2019-04-02 10:31:24 -07:00
Hans Larsen
d25fb89078 feat(@angular-devkit/architect): add analytics to builder context
It should be NoopAnalytics if no analytics are supported.
2019-03-28 13:28:41 -07:00
Charles Lyding
4a8022ea00 fix(@angular-devkit/architect): ensure workspaceRoot is actually set to workspaceRoot 2019-03-27 16:33:39 -07:00
Hans Larsen
deeea03650 test: fix invalid architect tests
See fe229faf78
2019-03-15 16:07:06 -07:00
Alex Eagle
fe229faf78 test: comment out broken assertion 2019-03-13 14:28:25 -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
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
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
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
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
Hans Larsen
0003adf757 refactor: builders can return non-observable output 2019-03-06 10:05:31 -08:00
Hans Larsen
02943eaf49 fix(@angular-devkit/architect): properly subscribe to error handlers
If an error is reported but ANY subscription have an undefined error handler, RxJS
reports the error to the "host platform" (it setTimeout(() => throw error)). Since
we properly handle errors in some places, but should ignore them in others (e.g.
we handle errors on the outboundBus, so the output subscription should ignore it),
we still need to subscribe to error, just ignore it.
2019-03-05 11:14:59 -08:00
Hans Larsen
f0adbc41fd fix(@angular-devkit/architect): properly report errors thrown by builder
When they are thrown by the builder itself.
2019-03-05 11:14:59 -08:00
Hans Larsen
2ffaf0c11c feat(@angular-devkit/architect): allow for a different output type
There is no schema validation of output and we are not planning any
for now, but the attributes should be retained.
2019-02-27 10:11:22 -08:00
Alan Agius
ae13974f1d build: update to rxjs 6.4 2019-02-26 08:33:48 -08:00
Hans Larsen
1aa1b47f90 feat(@angular-devkit/core): remove Log messages from Job API
If a system wants to have logging it should multiplex it itself on a channel.

Also changed the previous Architect commits to remove usage of Logs and move
to a "log" channel.
2019-02-19 13:51:29 -08:00
Hans Larsen
685d4d0c6c feat(@angular-devkit/architect): add generic architect builders
Four builders were added;
- true, always succeed
- false, always fails
- concat, runs all targets or builders in succession
- allOf, runs all targets or builders in parallel
2019-02-19 13:51:29 -08:00
Hans Larsen
79a6988275 feat(@angular-devkit/architect): add node architect host
This host resolves using the package resolution and reading the targets
from the workspace API.
2019-02-19 13:51:29 -08:00
Hans Larsen
68220f13e4 feat(@angular-devkit/architect): New Architect API first draft
The new API has been described in this design doc:
https://docs.google.com/document/d/1SpN_2XEooI9_CPjqspAcNEBjVY874OWPZqOenjuF0qo/view

This first drafts add support for the API (given some deep imports). It is
still in draft mode but is committed to make it available to people to
start testing and moving their own builders.

This API rebuilds (not backward compatible) the Architect API package. To
use it people will need to import "@angular-devkit/architect/src/index2"
to start using it. A reference builder will be added in the next commit.

There are 2 pieces missing from this commit that will be added in the
same PR; 1) the architect-host and CLI to test, and 2) a reference
builder moved from the old API to the new one. These will be part of
the same PR.

Finally, there are missing tests in this package, but everything tested
manually and automatically works so far. Test coverage will be added
before the package is considered finished.

Due to a desire to keep architect, our tests and the scope of this PR
limited and keep the two APIs separated, every clashing files will
have a "2" suffix added to it. Once all builders have been moved and
we are sure everything works, all those files will be moved to their
final destination and the old API will be removed, in one PR.
2019-02-19 13:51:29 -08:00
Hans Larsen
3dafcf416f feat(@angular-devkit/core): deprecate @angular-devkit/architect/testing 2019-01-10 10:43:27 -08:00
Hans Larsen
32e230d252 feat(@angular-devkit/architect): deprecate the current architect API
This is done in short notice since it was always considered
experimental. Most developers already know that the API is going to
change.
2019-01-10 10:43:27 -08:00
Alan Agius
73a35071a0 feat(@angular-devkit/architect): add result property to BuildEvent 2019-01-08 13:42:45 -08:00
Alan Agius
45b6df511f fix(@angular-devkit/build-angular): lint non human readable formatters produces invalid output
fixes #12674
2018-12-06 11:24:27 -08:00
Alan Agius
717b02f533 ci: add ts api guardian (#12010)
* refactor: fix `import` and `export` paths to work with classic resolution

`ts-api-guardian` only support classic module resolution which means that we need to specify `index` so that the resolution works.

* build: add `npm_package` to packages

* build: add ts-api-guardian to repo

* test: add api golden files

* refactor: use proper namespace instead of alias export

* refactor: use proper namspace einstead of alias export

* build: add `_golden_api` files

At the moment ts api guardian doesn't support aliased symbols as namespaces, this is a workaround to still have namespaced symbols in the final golden file.

* build: update angular archive for workspace

* test: fix reference to `TestHost` to use namespace

* refactor: create `fs` namespace instead of aliased export

* test: update api golden file for `@angular-devkit/core/node`
2018-11-30 11:53:54 -08:00
Keen Yee Liau
d3e1149bdf build: add missing transitive deps for typescript (#12881)
add `strict_checks = False` for building inside Google.
2018-11-06 20:40:03 -08:00
Keen Yee Liau
a3b05a0283 build: Use fine-grained node_module deps
This commit updates the BUILD files to specify fine-grained node_module deps
by replacing "@typings" comments with actual @npm node module.

Moved tools/bazel.rc -> .bazelrc

Removed "jasmine" typings from base tsconfig.json

Added @bazel/karma to devDependencies, needed for `ts_web_test`
2018-10-31 20:56:27 -07:00
Charles Lyding
9a793494dc build: update rxjs to 6.3 2018-09-26 12:57:56 -04:00
Alan Agius
b8b36ba339 refactor: pin down all direct dependencies
This is so that CLI users get the same direct dependency versions that were tested on the CI.
2018-09-07 11:01:50 -07:00
clydin
7e63dd791b build: limit rxjs to 6.2.x due to a defect in 6.3.0 (#12048) 2018-08-30 15:33:31 -07:00
Hans
62e72fea38 fix(@angular-devkit/architect): explicitly type functions
Closes: #11992
2018-08-27 18:11:07 -07:00
Filipe Silva
2393ab9aba build: simplify bazel dependencies 2018-08-22 16:36:10 -07:00
Filipe Silva
b1ad957a15 build: update bazel workspace 2018-08-22 16:36:10 -07:00
Charles Lyding
c729b0e7d9 build: use yarn workspaces 2018-08-10 18:25:32 -07:00
Yi Qi
b834014bb1 build: Fix all the BUILD files for google3 2018-08-03 23:32:10 +01:00
Filipe Silva
97f53b36d5 refactor(@angular-devkit/architect): use updated workspace api 2018-07-25 20:17:33 +01: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
Filipe Silva
3e3dffba8e fix(@angular-devkit/architect): unsubscribe on timeout in runTargetSpec
This way cleanup logic runs on timeout.

It also simplifies timeout definition for runTargetSpec and Jasmine.
2018-07-05 11:43:11 -04:00
Filipe Silva
aa3901964d fix(@angular-devkit/architect): always clear TestProjectHost on restore 2018-07-05 11:43:11 -04:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00