@angular-devkit/architect 0.1201.0-next.5 → 0.1201.2

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.
@@ -6,9 +6,28 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.WorkspaceNodeModulesArchitectHost = void 0;
11
- const path = require("path");
30
+ const path = __importStar(require("path"));
12
31
  const v8_1 = require("v8");
13
32
  const internal_1 = require("../src/internal");
14
33
  function clone(obj) {
@@ -146,10 +165,14 @@ class WorkspaceNodeModulesArchitectHost {
146
165
  return metadata;
147
166
  }
148
167
  async loadBuilder(info) {
149
- const builder = (await Promise.resolve().then(() => require(info.import))).default;
168
+ const builder = (await Promise.resolve().then(() => __importStar(require(info.import)))).default;
150
169
  if (builder[internal_1.BuilderSymbol]) {
151
170
  return builder;
152
171
  }
172
+ // Default handling code is for old builders that incorrectly export `default` with non-ESM module
173
+ if (builder === null || builder === void 0 ? void 0 : builder.default[internal_1.BuilderSymbol]) {
174
+ return builder.default;
175
+ }
153
176
  throw new Error('Builder is not a builder');
154
177
  }
155
178
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@angular-devkit/architect",
3
- "version": "0.1201.0-next.5",
3
+ "version": "0.1201.2",
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": "12.1.0-next.5",
9
+ "@angular-devkit/core": "12.1.2",
10
10
  "rxjs": "6.6.7"
11
11
  },
12
12
  "builders": "./builders/builders.json",
@@ -6,6 +6,25 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.TestingArchitectHost = void 0;
11
30
  const src_1 = require("../src");
@@ -29,7 +48,7 @@ class TestingArchitectHost {
29
48
  this._builderMap.set(builderName, { builderName, description, optionSchema });
30
49
  }
31
50
  async addBuilderFromPackage(packageName) {
32
- const packageJson = await Promise.resolve().then(() => require(packageName + '/package.json'));
51
+ const packageJson = await Promise.resolve().then(() => __importStar(require(packageName + '/package.json')));
33
52
  if (!('builders' in packageJson)) {
34
53
  throw new Error('Invalid package.json, builders key not found.');
35
54
  }
@@ -37,7 +56,7 @@ class TestingArchitectHost {
37
56
  throw new Error('Invalid package name');
38
57
  }
39
58
  const builderJsonPath = packageName + '/' + packageJson['builders'];
40
- const builderJson = await Promise.resolve().then(() => require(builderJsonPath));
59
+ const builderJson = await Promise.resolve().then(() => __importStar(require(builderJsonPath)));
41
60
  const builders = builderJson['builders'];
42
61
  if (!builders) {
43
62
  throw new Error('Invalid builders.json, builders key not found.');
@@ -48,8 +67,8 @@ class TestingArchitectHost {
48
67
  if (!b.implementation) {
49
68
  continue;
50
69
  }
51
- const handler = (await Promise.resolve().then(() => require(builderJsonPath + '/../' + b.implementation))).default;
52
- const optionsSchema = await Promise.resolve().then(() => require(builderJsonPath + '/../' + b.schema));
70
+ const handler = (await Promise.resolve().then(() => __importStar(require(builderJsonPath + '/../' + b.implementation)))).default;
71
+ const optionsSchema = await Promise.resolve().then(() => __importStar(require(builderJsonPath + '/../' + b.schema)));
53
72
  this.addBuilder(`${packageJson.name}:${builderName}`, handler, b.description, optionsSchema);
54
73
  }
55
74
  }