71 Commits

Author SHA1 Message Date
Charles Lyding
8ffb755ef0 refactor(@angular-devkit/architect): remove usage of experimental workspace API 2019-10-25 09:53:34 -07:00
Charles Lyding
c8f8028e80 fix(@angular-devkit/architect): clone workspace objects before builder use 2019-10-25 09:53:34 -07:00
Alan Agius
e31d5d89b7 build: update bazel packages 2019-10-24 12:05:25 -07:00
Filipe Silva
27c3650d80 feat(@angular-devkit/architect): support multiple configs in WorkspaceNodeModulesArchitectHost
Add support for parsing multiple configurations in a single string using comma as a separator.

This support is only at the host level (`WorkspaceNodeModulesArchitectHost` in this case) and does not change the underlying Architect API.

Different hosts are able to compose target options in different ways.
2019-10-14 13:40:48 -07:00
Charles Lyding
0d104c0aba feat(@angular-devkit/architect): support accessing project metadata 2019-09-24 13:18:33 -07:00
Alan Agius
ab5b1909d6 build: update rxjs to 6.5.3 2019-09-24 13:18:09 -07:00
Charles
ef360dd7f8 refactor(@angular-devkit/architect): use standard node resolution methods where possible (#15622)
* refactor(@angular-devkit/architect): use standard node resolution methods where possible

* refactor(@angular-devkit/core): use standard node resolution methods where possible
2019-09-18 14:49:22 +01:00
Alan Agius
a6fbee6865 style: add no-invalid-await and prefer-promise-shorthand lint rules (#15450)
Add these two lint rules for a better code quality and readability
2019-08-27 10:24:58 -07:00
Pavel Březina
51622bdeaf fix(@angular-devkit/architect): add target to ScheduleOptions to allow its use in context.scheduleBuilder
A custom builder can call `context.scheduleBuilder` to call another builder.
However, the following call will fail with `Must either have a target from
the context or a default project.` exception because `scheduleBuilder` does
not pass `target` to the called builder.

```typescript
import { JsonObject } from '@angular-devkit/core'
import { BuilderContext, BuilderOutput, BuilderRun, createBuilder } from '@angular-devkit/architect';
import { Observable, from } from 'rxjs';
import { concatMap, map } from 'rxjs/operators';

export default createBuilder(_customBuilder);

function _customBuilder(options: JsonObject, context: BuilderContext): Observable<BuilderOutput> {
    const builder = '@angular-devkit/build-angular:browser';

    return from(context.scheduleBuilder(builder, options)).pipe(
        concatMap(run => run.result)
    );
}
```

Resolves:
https://github.com/angular/angular-cli/issues/15053
2019-07-31 13:22:11 -07:00
vikerman
77d4dd9733 fix(@angular-devkit/architect): fix for newest version of rxjs 2019-07-01 16:36:43 -07:00
Alan Agius
53d027837e fix(@angular-devkit/architect): error out when invalid configurations are provided
Fixes #14654
2019-06-10 13:43:39 -07:00
Charles Lyding
19ed795cb1 fix(@angular-devkit/architect): support all observable types as build results
Fixes #14579
2019-05-30 13:33:51 -07:00
Alan Agius
c70cf991ac refactor(@angular-devkit/architect): remove index2 from testing folder 2019-05-28 21:00:29 +02:00
Charles Lyding
548fefddbd docs(@angular-devkit/architect): add comment about deprecated workspace usage 2019-05-09 10:04:57 -07:00
Keen Yee Liau
2af2b670f8 fix(build): fix Bazel lint errors 2019-05-07 20:02:34 -07:00
Keen Yee Liau
d629cd6478
Update BUILD 2019-05-07 19:02:45 -07:00
Charles Lyding
cbb493eb81 refactor(@angular-devkit/architect): support stable workspaces API 2019-05-07 16:24:37 -06:00
Filipe Silva
d546b83e04 fix(@angular-devkit/architect): error run on input schema error (#14315)
Fix #14269
2019-05-07 12:37:56 -06:00
Alan Agius
968204fa2a refactor(@angular-devkit/architect): remove _registry from being a private (#14182) 2019-05-07 12:31:45 -06:00
Charles Lyding
5f248204ec fix(@angular-devkit/architect): propagate option validation errors
By using the `SchemaValidationException` object, the underlying JSON schema validation errors will be propagated to the consuming code.  This allows for more detailed error reporting of malformed or incorrectly provided options.

Partially addresses #14269
2019-04-26 10:26:47 -07:00
Alex Eagle
d88175ddf1 Revert "build: update rxjs to version 6.5.1"
This reverts commit c4613ced63a901fe327e062d2be474d72ccc56f1.
2019-04-23 11:23:51 -07:00
Renovate Bot
c4613ced63 build: update rxjs to version 6.5.1 2019-04-23 08:07:56 -07:00
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