@ionic/angular 8.8.11-dev.11781639886.140139f2 → 8.8.11-dev.11782911278.11f0315e

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.
Files changed (200) hide show
  1. package/README.md +6 -6
  2. package/fesm2022/ionic-angular-common.mjs +107 -93
  3. package/fesm2022/ionic-angular-common.mjs.map +1 -1
  4. package/fesm2022/{ionic-angular-standalone.mjs → ionic-angular-lazy.mjs} +1700 -1723
  5. package/fesm2022/ionic-angular-lazy.mjs.map +1 -0
  6. package/fesm2022/ionic-angular.mjs +1799 -1294
  7. package/fesm2022/ionic-angular.mjs.map +1 -1
  8. package/package.json +18 -18
  9. package/schematics/add/index.js +5 -5
  10. package/schematics/utils/ast.js +36 -4
  11. package/schematics/utils/config.js +10 -11
  12. package/schematics/utils/package.js +5 -2
  13. package/types/ionic-angular-common.d.ts +1021 -0
  14. package/{directives/proxies.d.ts → types/ionic-angular-lazy.d.ts} +651 -398
  15. package/types/ionic-angular.d.ts +1560 -0
  16. package/app-initialize.d.ts +0 -3
  17. package/common/directives/control-value-accessors/index.d.ts +0 -1
  18. package/common/directives/control-value-accessors/value-accessor.d.ts +0 -36
  19. package/common/directives/navigation/back-button.d.ts +0 -23
  20. package/common/directives/navigation/nav-params.d.ts +0 -45
  21. package/common/directives/navigation/nav.d.ts +0 -21
  22. package/common/directives/navigation/router-link-delegate.d.ts +0 -60
  23. package/common/directives/navigation/router-outlet.d.ts +0 -104
  24. package/common/directives/navigation/stack-controller.d.ts +0 -42
  25. package/common/directives/navigation/stack-utils.d.ts +0 -38
  26. package/common/directives/navigation/tabs.d.ts +0 -83
  27. package/common/index.d.ts +0 -22
  28. package/common/overlays/modal.d.ts +0 -62
  29. package/common/overlays/popover.d.ts +0 -46
  30. package/common/providers/angular-delegate.d.ts +0 -28
  31. package/common/providers/config.d.ts +0 -11
  32. package/common/providers/dom-controller.d.ts +0 -16
  33. package/common/providers/menu-controller.d.ts +0 -78
  34. package/common/providers/nav-controller.d.ts +0 -116
  35. package/common/providers/platform.d.ts +0 -174
  36. package/common/types/interfaces.d.ts +0 -8
  37. package/common/types/ionic-lifecycle-hooks.d.ts +0 -27
  38. package/common/types/overlay-options.d.ts +0 -16
  39. package/common/utils/overlay.d.ts +0 -21
  40. package/common/utils/proxy.d.ts +0 -8
  41. package/common/utils/routing.d.ts +0 -28
  42. package/common/utils/util.d.ts +0 -1
  43. package/directives/angular-component-lib/utils.d.ts +0 -9
  44. package/directives/control-value-accessors/boolean-value-accessor.d.ts +0 -10
  45. package/directives/control-value-accessors/index.d.ts +0 -4
  46. package/directives/control-value-accessors/numeric-value-accessor.d.ts +0 -11
  47. package/directives/control-value-accessors/select-value-accessor.d.ts +0 -9
  48. package/directives/control-value-accessors/text-value-accessor.d.ts +0 -9
  49. package/directives/navigation/ion-back-button.d.ts +0 -9
  50. package/directives/navigation/ion-nav.d.ts +0 -8
  51. package/directives/navigation/ion-router-outlet.d.ts +0 -25
  52. package/directives/navigation/ion-tabs.d.ts +0 -13
  53. package/directives/navigation/router-link-delegate.d.ts +0 -16
  54. package/directives/overlays/modal.d.ts +0 -6
  55. package/directives/overlays/popover.d.ts +0 -6
  56. package/directives/proxies-list.d.ts +0 -2
  57. package/directives/validators/index.d.ts +0 -2
  58. package/directives/validators/max-validator.d.ts +0 -12
  59. package/directives/validators/min-validator.d.ts +0 -12
  60. package/esm2022/app-initialize.mjs +0 -29
  61. package/esm2022/common/directives/control-value-accessors/index.mjs +0 -2
  62. package/esm2022/common/directives/control-value-accessors/value-accessor.mjs +0 -153
  63. package/esm2022/common/directives/navigation/back-button.mjs +0 -61
  64. package/esm2022/common/directives/navigation/nav-params.mjs +0 -47
  65. package/esm2022/common/directives/navigation/nav.mjs +0 -49
  66. package/esm2022/common/directives/navigation/router-link-delegate.mjs +0 -156
  67. package/esm2022/common/directives/navigation/router-outlet.mjs +0 -480
  68. package/esm2022/common/directives/navigation/stack-controller.mjs +0 -280
  69. package/esm2022/common/directives/navigation/stack-utils.mjs +0 -73
  70. package/esm2022/common/directives/navigation/tabs.mjs +0 -279
  71. package/esm2022/common/index.mjs +0 -20
  72. package/esm2022/common/ionic-angular-common.mjs +0 -5
  73. package/esm2022/common/overlays/modal.mjs +0 -103
  74. package/esm2022/common/overlays/popover.mjs +0 -91
  75. package/esm2022/common/providers/angular-delegate.mjs +0 -203
  76. package/esm2022/common/providers/config.mjs +0 -45
  77. package/esm2022/common/providers/dom-controller.mjs +0 -45
  78. package/esm2022/common/providers/menu-controller.mjs +0 -114
  79. package/esm2022/common/providers/nav-controller.mjs +0 -235
  80. package/esm2022/common/providers/platform.mjs +0 -258
  81. package/esm2022/common/types/interfaces.mjs +0 -2
  82. package/esm2022/common/types/ionic-lifecycle-hooks.mjs +0 -5
  83. package/esm2022/common/types/overlay-options.mjs +0 -2
  84. package/esm2022/common/utils/overlay.mjs +0 -26
  85. package/esm2022/common/utils/proxy.mjs +0 -47
  86. package/esm2022/common/utils/routing.mjs +0 -55
  87. package/esm2022/common/utils/util.mjs +0 -10
  88. package/esm2022/directives/angular-component-lib/utils.mjs +0 -59
  89. package/esm2022/directives/control-value-accessors/boolean-value-accessor.mjs +0 -42
  90. package/esm2022/directives/control-value-accessors/index.mjs +0 -5
  91. package/esm2022/directives/control-value-accessors/numeric-value-accessor.mjs +0 -50
  92. package/esm2022/directives/control-value-accessors/select-value-accessor.mjs +0 -39
  93. package/esm2022/directives/control-value-accessors/text-value-accessor.mjs +0 -38
  94. package/esm2022/directives/navigation/ion-back-button.mjs +0 -24
  95. package/esm2022/directives/navigation/ion-nav.mjs +0 -21
  96. package/esm2022/directives/navigation/ion-router-outlet.mjs +0 -52
  97. package/esm2022/directives/navigation/ion-tabs.mjs +0 -59
  98. package/esm2022/directives/navigation/router-link-delegate.mjs +0 -32
  99. package/esm2022/directives/overlays/modal.mjs +0 -22
  100. package/esm2022/directives/overlays/popover.mjs +0 -18
  101. package/esm2022/directives/proxies-list.mjs +0 -90
  102. package/esm2022/directives/proxies.mjs +0 -2373
  103. package/esm2022/directives/validators/index.mjs +0 -3
  104. package/esm2022/directives/validators/max-validator.mjs +0 -27
  105. package/esm2022/directives/validators/min-validator.mjs +0 -27
  106. package/esm2022/index.mjs +0 -32
  107. package/esm2022/ionic-angular.mjs +0 -5
  108. package/esm2022/ionic-module.mjs +0 -111
  109. package/esm2022/providers/action-sheet-controller.mjs +0 -19
  110. package/esm2022/providers/alert-controller.mjs +0 -19
  111. package/esm2022/providers/animation-controller.mjs +0 -38
  112. package/esm2022/providers/gesture-controller.mjs +0 -33
  113. package/esm2022/providers/loading-controller.mjs +0 -19
  114. package/esm2022/providers/menu-controller.mjs +0 -19
  115. package/esm2022/providers/modal-controller.mjs +0 -26
  116. package/esm2022/providers/picker-controller.mjs +0 -22
  117. package/esm2022/providers/popover-controller.mjs +0 -19
  118. package/esm2022/providers/toast-controller.mjs +0 -19
  119. package/esm2022/standalone/directives/angular-component-lib/utils.mjs +0 -59
  120. package/esm2022/standalone/directives/checkbox.mjs +0 -76
  121. package/esm2022/standalone/directives/datetime.mjs +0 -95
  122. package/esm2022/standalone/directives/icon.mjs +0 -35
  123. package/esm2022/standalone/directives/index.mjs +0 -13
  124. package/esm2022/standalone/directives/input-otp.mjs +0 -90
  125. package/esm2022/standalone/directives/input.mjs +0 -113
  126. package/esm2022/standalone/directives/proxies.mjs +0 -2260
  127. package/esm2022/standalone/directives/radio-group.mjs +0 -60
  128. package/esm2022/standalone/directives/range.mjs +0 -78
  129. package/esm2022/standalone/directives/searchbar.mjs +0 -82
  130. package/esm2022/standalone/directives/segment.mjs +0 -60
  131. package/esm2022/standalone/directives/select.mjs +0 -84
  132. package/esm2022/standalone/directives/textarea.mjs +0 -91
  133. package/esm2022/standalone/directives/toggle.mjs +0 -76
  134. package/esm2022/standalone/index.mjs +0 -25
  135. package/esm2022/standalone/ionic-angular-standalone.mjs +0 -5
  136. package/esm2022/standalone/navigation/back-button.mjs +0 -32
  137. package/esm2022/standalone/navigation/nav.mjs +0 -28
  138. package/esm2022/standalone/navigation/router-link-delegate.mjs +0 -28
  139. package/esm2022/standalone/navigation/router-outlet.mjs +0 -60
  140. package/esm2022/standalone/navigation/tabs.mjs +0 -58
  141. package/esm2022/standalone/overlays/modal.mjs +0 -32
  142. package/esm2022/standalone/overlays/popover.mjs +0 -28
  143. package/esm2022/standalone/providers/action-sheet-controller.mjs +0 -21
  144. package/esm2022/standalone/providers/alert-controller.mjs +0 -21
  145. package/esm2022/standalone/providers/animation-controller.mjs +0 -38
  146. package/esm2022/standalone/providers/gesture-controller.mjs +0 -33
  147. package/esm2022/standalone/providers/ionic-angular.mjs +0 -38
  148. package/esm2022/standalone/providers/loading-controller.mjs +0 -21
  149. package/esm2022/standalone/providers/menu-controller.mjs +0 -19
  150. package/esm2022/standalone/providers/modal-controller.mjs +0 -28
  151. package/esm2022/standalone/providers/picker-controller.mjs +0 -24
  152. package/esm2022/standalone/providers/popover-controller.mjs +0 -21
  153. package/esm2022/standalone/providers/toast-controller.mjs +0 -21
  154. package/fesm2022/ionic-angular-standalone.mjs.map +0 -1
  155. package/index.d.ts +0 -27
  156. package/ionic-module.d.ts +0 -28
  157. package/providers/action-sheet-controller.d.ts +0 -8
  158. package/providers/alert-controller.d.ts +0 -8
  159. package/providers/animation-controller.d.ts +0 -25
  160. package/providers/gesture-controller.d.ts +0 -13
  161. package/providers/loading-controller.d.ts +0 -8
  162. package/providers/menu-controller.d.ts +0 -7
  163. package/providers/modal-controller.d.ts +0 -12
  164. package/providers/picker-controller.d.ts +0 -11
  165. package/providers/popover-controller.d.ts +0 -9
  166. package/providers/toast-controller.d.ts +0 -8
  167. package/standalone/directives/angular-component-lib/utils.d.ts +0 -9
  168. package/standalone/directives/checkbox.d.ts +0 -30
  169. package/standalone/directives/datetime.d.ts +0 -30
  170. package/standalone/directives/icon.d.ts +0 -9
  171. package/standalone/directives/index.d.ts +0 -12
  172. package/standalone/directives/input-otp.d.ts +0 -49
  173. package/standalone/directives/input.d.ts +0 -47
  174. package/standalone/directives/proxies.d.ts +0 -1035
  175. package/standalone/directives/radio-group.d.ts +0 -18
  176. package/standalone/directives/range.d.ts +0 -47
  177. package/standalone/directives/searchbar.d.ts +0 -45
  178. package/standalone/directives/segment.d.ts +0 -19
  179. package/standalone/directives/select.d.ts +0 -34
  180. package/standalone/directives/textarea.d.ts +0 -37
  181. package/standalone/directives/toggle.d.ts +0 -28
  182. package/standalone/index.d.ts +0 -23
  183. package/standalone/navigation/back-button.d.ts +0 -9
  184. package/standalone/navigation/nav.d.ts +0 -8
  185. package/standalone/navigation/router-link-delegate.d.ts +0 -10
  186. package/standalone/navigation/router-outlet.d.ts +0 -25
  187. package/standalone/navigation/tabs.d.ts +0 -13
  188. package/standalone/overlays/modal.d.ts +0 -6
  189. package/standalone/overlays/popover.d.ts +0 -6
  190. package/standalone/providers/action-sheet-controller.d.ts +0 -8
  191. package/standalone/providers/alert-controller.d.ts +0 -8
  192. package/standalone/providers/animation-controller.d.ts +0 -25
  193. package/standalone/providers/gesture-controller.d.ts +0 -13
  194. package/standalone/providers/ionic-angular.d.ts +0 -7
  195. package/standalone/providers/loading-controller.d.ts +0 -8
  196. package/standalone/providers/menu-controller.d.ts +0 -7
  197. package/standalone/providers/modal-controller.d.ts +0 -12
  198. package/standalone/providers/picker-controller.d.ts +0 -11
  199. package/standalone/providers/popover-controller.d.ts +0 -9
  200. package/standalone/providers/toast-controller.d.ts +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/angular",
3
- "version": "8.8.11-dev.11781639886.140139f2",
3
+ "version": "8.8.11-dev.11782911278.11f0315e",
4
4
  "description": "Angular specific wrappers for @ionic/core",
5
5
  "keywords": [
6
6
  "ionic",
@@ -31,39 +31,39 @@
31
31
  "default": "./package.json"
32
32
  },
33
33
  ".": {
34
- "types": "./index.d.ts",
35
- "esm2022": "./esm2022/ionic-angular.mjs",
36
- "esm": "./esm2022/ionic-angular.mjs",
34
+ "types": "./types/ionic-angular.d.ts",
37
35
  "default": "./fesm2022/ionic-angular.mjs"
38
36
  },
39
37
  "./common": {
40
- "types": "./common/index.d.ts",
41
- "esm2022": "./esm2022/common/ionic-angular-common.mjs",
42
- "esm": "./esm2022/common/ionic-angular-common.mjs",
38
+ "types": "./types/ionic-angular-common.d.ts",
43
39
  "default": "./fesm2022/ionic-angular-common.mjs"
44
40
  },
45
- "./standalone": {
46
- "types": "./standalone/index.d.ts",
47
- "esm2022": "./esm2022/standalone/ionic-angular-standalone.mjs",
48
- "esm": "./esm2022/standalone/ionic-angular-standalone.mjs",
49
- "default": "./fesm2022/ionic-angular-standalone.mjs"
41
+ "./lazy": {
42
+ "types": "./types/ionic-angular-lazy.d.ts",
43
+ "default": "./fesm2022/ionic-angular-lazy.mjs"
50
44
  }
51
45
  },
52
46
  "dependencies": {
53
- "@ionic/core": "8.8.11-dev.11781639886.140139f2",
47
+ "@ionic/core": "8.8.11-dev.11782911278.11f0315e",
54
48
  "ionicons": "^8.0.13",
55
49
  "jsonc-parser": "^3.0.0",
56
50
  "tslib": "^2.3.0"
57
51
  },
58
52
  "peerDependencies": {
59
- "@angular/core": ">=16.0.0",
60
- "@angular/forms": ">=16.0.0",
61
- "@angular/router": ">=16.0.0",
53
+ "@angular/core": ">=18.0.0",
54
+ "@angular/forms": ">=18.0.0",
55
+ "@angular/router": ">=18.0.0",
62
56
  "rxjs": ">=7.5.0",
63
57
  "zone.js": ">=0.13.0"
64
58
  },
59
+ "peerDependenciesMeta": {
60
+ "zone.js": {
61
+ "optional": true
62
+ }
63
+ },
65
64
  "schematics": "./schematics/collection.json",
66
65
  "module": "fesm2022/ionic-angular.mjs",
67
- "typings": "index.d.ts",
68
- "sideEffects": false
66
+ "typings": "types/ionic-angular.d.ts",
67
+ "sideEffects": false,
68
+ "type": "module"
69
69
  }
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = ngAdd;
3
4
  const core_1 = require("@angular-devkit/core");
4
5
  const schematics_1 = require("@angular-devkit/schematics");
5
6
  const tasks_1 = require("@angular-devkit/schematics/tasks");
6
7
  const utility_1 = require("@schematics/angular/utility");
7
8
  const workspace_1 = require("@schematics/angular/utility/workspace");
8
9
  const ast_1 = require("../utils/ast");
9
- const config_1 = require("./../utils/config");
10
- const package_1 = require("./../utils/package");
10
+ const config_1 = require("../utils/config");
11
+ const package_1 = require("../utils/package");
11
12
  function addIonicAngularToPackageJson() {
12
13
  return (host) => {
13
14
  (0, package_1.addPackageToPackageJson)(host, 'dependencies', '@ionic/angular', 'latest');
@@ -60,7 +61,7 @@ function addProvideIonicAngular(projectName, projectSourceRoot) {
60
61
  return (host) => {
61
62
  const appConfig = `${projectSourceRoot}/app/app.config.ts`;
62
63
  if (host.exists(appConfig)) {
63
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => code `${external('provideIonicAngular', '@ionic/angular/standalone')}({})`);
64
+ return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => code `${external('provideIonicAngular', '@ionic/angular')}({})`);
64
65
  }
65
66
  return host;
66
67
  };
@@ -162,7 +163,7 @@ function ngAdd(options) {
162
163
  options.project = (0, config_1.getDefaultAngularAppName)(workspace);
163
164
  }
164
165
  const project = workspace.projects.get(options.project);
165
- if (!project || project.extensions.projectType !== 'application') {
166
+ if ((project === null || project === void 0 ? void 0 : project.extensions.projectType) !== 'application') {
166
167
  throw new schematics_1.SchematicsException(`Ionic Add requires a project type of "application".`);
167
168
  }
168
169
  const sourcePath = (0, core_1.join)(project.sourceRoot);
@@ -184,4 +185,3 @@ function ngAdd(options) {
184
185
  ]);
185
186
  };
186
187
  }
187
- exports.default = ngAdd;
@@ -1,10 +1,43 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addIonicModuleImportToNgModule = void 0;
36
+ exports.addIonicModuleImportToNgModule = addIonicModuleImportToNgModule;
4
37
  const schematics_1 = require("@angular-devkit/schematics");
5
38
  const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
6
39
  const change_1 = require("@schematics/angular/utility/change");
7
- const ts = require("typescript");
40
+ const ts = __importStar(require("typescript"));
8
41
  /**
9
42
  * Reads file given path and returns TypeScript source file.
10
43
  */
@@ -23,10 +56,9 @@ function getSourceFile(host, path) {
23
56
  function addIonicModuleImportToNgModule(host, modulePath) {
24
57
  const recorder = host.beginUpdate(modulePath);
25
58
  const moduleSource = getSourceFile(host, modulePath);
26
- const ionicModuleChange = (0, ast_utils_1.insertImport)(moduleSource, modulePath, 'IonicModule', '@ionic/angular');
59
+ const ionicModuleChange = (0, ast_utils_1.insertImport)(moduleSource, modulePath, 'IonicModule', '@ionic/angular/lazy');
27
60
  (0, change_1.applyToUpdateRecorder)(recorder, [ionicModuleChange]);
28
61
  const metadataChange = (0, ast_utils_1.addSymbolToNgModuleMetadata)(moduleSource, modulePath, 'imports', 'IonicModule.forRoot({})');
29
62
  (0, change_1.applyToUpdateRecorder)(recorder, metadataChange);
30
63
  host.commitUpdate(recorder);
31
64
  }
32
- exports.addIonicModuleImportToNgModule = addIonicModuleImportToNgModule;
@@ -1,17 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWorkspace = exports.getWorkspacePath = exports.addSchematics = exports.addCli = exports.addArchitectBuilder = exports.addAsset = exports.addStyle = exports.getDefaultAngularAppName = exports.writeConfig = exports.readConfig = void 0;
3
+ exports.readConfig = readConfig;
4
+ exports.writeConfig = writeConfig;
5
+ exports.getDefaultAngularAppName = getDefaultAngularAppName;
6
+ exports.addStyle = addStyle;
7
+ exports.addAsset = addAsset;
8
+ exports.addArchitectBuilder = addArchitectBuilder;
9
+ exports.addCli = addCli;
10
+ exports.addSchematics = addSchematics;
11
+ exports.getWorkspacePath = getWorkspacePath;
12
+ exports.getWorkspace = getWorkspace;
4
13
  const schematics_1 = require("@angular-devkit/schematics");
5
14
  const jsonc_parser_1 = require("jsonc-parser");
6
15
  const ANGULAR_JSON_PATH = 'angular.json';
7
16
  function readConfig(host) {
8
17
  return host.readJson(ANGULAR_JSON_PATH);
9
18
  }
10
- exports.readConfig = readConfig;
11
19
  function writeConfig(host, config) {
12
20
  host.overwrite(ANGULAR_JSON_PATH, JSON.stringify(config, null, 2));
13
21
  }
14
- exports.writeConfig = writeConfig;
15
22
  function isAngularBrowserProject(projectConfig) {
16
23
  if (projectConfig.projectType === 'application') {
17
24
  const buildConfig = projectConfig.architect.build;
@@ -36,7 +43,6 @@ function getDefaultAngularAppName(config) {
36
43
  }
37
44
  return projectNames[0];
38
45
  }
39
- exports.getDefaultAngularAppName = getDefaultAngularAppName;
40
46
  function getAngularJson(config, projectName) {
41
47
  // eslint-disable-next-line no-prototype-builtins
42
48
  if (!config.projects.hasOwnProperty(projectName)) {
@@ -62,7 +68,6 @@ function addStyle(host, projectName, stylePath) {
62
68
  });
63
69
  writeConfig(host, config);
64
70
  }
65
- exports.addStyle = addStyle;
66
71
  function addAsset(host, projectName, architect, asset) {
67
72
  const config = readConfig(host);
68
73
  const angularJson = getAngularJson(config, projectName);
@@ -72,14 +77,12 @@ function addAsset(host, projectName, architect, asset) {
72
77
  writeConfig(host, config);
73
78
  }
74
79
  }
75
- exports.addAsset = addAsset;
76
80
  function addArchitectBuilder(host, projectName, builderName, builderOpts) {
77
81
  const config = readConfig(host);
78
82
  const angularJson = getAngularJson(config, projectName);
79
83
  angularJson.architect[builderName] = builderOpts;
80
84
  writeConfig(host, config);
81
85
  }
82
- exports.addArchitectBuilder = addArchitectBuilder;
83
86
  /**
84
87
  * Updates the angular.json to add an additional schematic collection
85
88
  * to the CLI configuration.
@@ -95,7 +98,6 @@ function addCli(host, collectionName) {
95
98
  angularJson.cli.schematicCollections.push(collectionName);
96
99
  writeConfig(host, angularJson);
97
100
  }
98
- exports.addCli = addCli;
99
101
  function addSchematics(host, schematicName, schematicOpts) {
100
102
  const angularJson = readConfig(host);
101
103
  if (angularJson.schematics === undefined) {
@@ -104,13 +106,11 @@ function addSchematics(host, schematicName, schematicOpts) {
104
106
  angularJson.schematics[schematicName] = schematicOpts;
105
107
  writeConfig(host, angularJson);
106
108
  }
107
- exports.addSchematics = addSchematics;
108
109
  function getWorkspacePath(host) {
109
110
  const possibleFiles = ['/angular.json', '/.angular.json'];
110
111
  const path = possibleFiles.filter((path) => host.exists(path))[0];
111
112
  return path;
112
113
  }
113
- exports.getWorkspacePath = getWorkspacePath;
114
114
  function getWorkspace(host) {
115
115
  const path = getWorkspacePath(host);
116
116
  const configBuffer = host.read(path);
@@ -120,4 +120,3 @@ function getWorkspace(host) {
120
120
  const content = configBuffer.toString();
121
121
  return (0, jsonc_parser_1.parse)(content);
122
122
  }
123
- exports.getWorkspace = getWorkspace;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addPackageToPackageJson = void 0;
3
+ exports.addPackageToPackageJson = addPackageToPackageJson;
4
+ const schematics_1 = require("@angular-devkit/schematics");
4
5
  /**
5
6
  * Adds a package to the package.json
6
7
  */
@@ -8,6 +9,9 @@ function addPackageToPackageJson(host, type, pkg, version) {
8
9
  var _a;
9
10
  if (host.exists('package.json')) {
10
11
  const sourceText = (_a = host.read('package.json')) === null || _a === void 0 ? void 0 : _a.toString('utf-8');
12
+ if (sourceText === undefined) {
13
+ throw new schematics_1.SchematicsException('Could not read package.json');
14
+ }
11
15
  const json = JSON.parse(sourceText);
12
16
  if (!json[type]) {
13
17
  json[type] = {};
@@ -19,4 +23,3 @@ function addPackageToPackageJson(host, type, pkg, version) {
19
23
  }
20
24
  return host;
21
25
  }
22
- exports.addPackageToPackageJson = addPackageToPackageJson;