@angular-devkit/architect 0.1900.0-next.4 → 0.1900.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@angular-devkit/architect",
3
- "version": "0.1900.0-next.4",
3
+ "version": "0.1900.0-next.6",
4
4
  "description": "Angular Build Facade",
5
5
  "experimental": true,
6
6
  "main": "src/index.js",
7
7
  "typings": "src/index.d.ts",
8
8
  "dependencies": {
9
- "@angular-devkit/core": "19.0.0-next.4",
9
+ "@angular-devkit/core": "19.0.0-next.6",
10
10
  "rxjs": "7.8.1"
11
11
  },
12
12
  "builders": "./builders/builders.json",
package/src/architect.js CHANGED
@@ -12,6 +12,7 @@ const core_1 = require("@angular-devkit/core");
12
12
  const rxjs_1 = require("rxjs");
13
13
  const api_1 = require("./api");
14
14
  const jobs_1 = require("./jobs");
15
+ const options_1 = require("./options");
15
16
  const schedule_by_name_1 = require("./schedule-by-name");
16
17
  const inputSchema = require('./input-schema.json');
17
18
  const outputSchema = require('./output-schema.json');
@@ -28,10 +29,7 @@ function _createJobHandlerFromBuilderInfo(info, target, host, registry, baseOpti
28
29
  const inboundBusWithInputValidation = context.inboundBus.pipe((0, rxjs_1.concatMap)(async (message) => {
29
30
  if (message.kind === jobs_1.JobInboundMessageKind.Input) {
30
31
  const v = message.value;
31
- const options = {
32
- ...baseOptions,
33
- ...v.options,
34
- };
32
+ const options = (0, options_1.mergeOptions)(baseOptions, v.options);
35
33
  // Validate v against the options schema.
36
34
  const validation = await registry.compile(info.optionSchema);
37
35
  const validationResult = await validation(options);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { json } from '@angular-devkit/core';
9
+ import { BuilderInput } from './api';
10
+ type OverrideOptions = BuilderInput['options'];
11
+ export declare function mergeOptions(baseOptions: json.JsonObject, overrideOptions: OverrideOptions): json.JsonObject;
12
+ export {};
package/src/options.js ADDED
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.mergeOptions = mergeOptions;
11
+ const core_1 = require("@angular-devkit/core");
12
+ function mergeOptions(baseOptions, overrideOptions) {
13
+ if (!overrideOptions) {
14
+ return { ...baseOptions };
15
+ }
16
+ const options = {
17
+ ...baseOptions,
18
+ ...overrideOptions,
19
+ };
20
+ // For object-object overrides, we merge one layer deep.
21
+ for (const key of Object.keys(overrideOptions)) {
22
+ const override = overrideOptions[key];
23
+ const base = baseOptions[key];
24
+ if (core_1.json.isJsonObject(base) && core_1.json.isJsonObject(override)) {
25
+ options[key] = { ...base, ...override };
26
+ }
27
+ }
28
+ return options;
29
+ }