@ionic/angular 7.5.6-dev.11700520218.1c07312e → 7.5.6-dev.11701102039.134ebc28

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 (31) hide show
  1. package/common/index.d.ts +1 -0
  2. package/{standalone → common}/providers/loading-controller.d.ts +1 -1
  3. package/esm2020/common/index.mjs +2 -1
  4. package/esm2020/common/providers/loading-controller.mjs +18 -0
  5. package/esm2020/index.mjs +2 -3
  6. package/esm2020/standalone/index.mjs +2 -3
  7. package/fesm2015/ionic-angular-common.mjs +41 -27
  8. package/fesm2015/ionic-angular-common.mjs.map +1 -1
  9. package/fesm2015/ionic-angular-standalone.mjs +3 -19
  10. package/fesm2015/ionic-angular-standalone.mjs.map +1 -1
  11. package/fesm2015/ionic-angular.mjs +3 -17
  12. package/fesm2015/ionic-angular.mjs.map +1 -1
  13. package/fesm2020/ionic-angular-common.mjs +41 -27
  14. package/fesm2020/ionic-angular-common.mjs.map +1 -1
  15. package/fesm2020/ionic-angular-standalone.mjs +3 -19
  16. package/fesm2020/ionic-angular-standalone.mjs.map +1 -1
  17. package/fesm2020/ionic-angular.mjs +3 -17
  18. package/fesm2020/ionic-angular.mjs.map +1 -1
  19. package/index.d.ts +1 -2
  20. package/package.json +3 -3
  21. package/schematics/add/files/root/theme/variables.css +0 -241
  22. package/schematics/add/index.js +11 -77
  23. package/schematics/utils/ast.js +25 -10
  24. package/schematics/utils/config.js +16 -42
  25. package/schematics/utils/devkit-utils/ast-utils.js +488 -0
  26. package/schematics/utils/devkit-utils/change.js +96 -0
  27. package/schematics/utils/devkit-utils/route-utils.js +72 -0
  28. package/standalone/index.d.ts +1 -2
  29. package/esm2020/providers/loading-controller.mjs +0 -18
  30. package/esm2020/standalone/providers/loading-controller.mjs +0 -21
  31. package/providers/loading-controller.d.ts +0 -8
package/index.d.ts CHANGED
@@ -12,12 +12,11 @@ export { IonModal } from './directives/overlays/modal';
12
12
  export { IonPopover } from './directives/overlays/popover';
13
13
  export * from './directives/proxies';
14
14
  export * from './directives/validators';
15
- export { DomController, NavController, Config, Platform, AngularDelegate, NavParams, IonicRouteStrategy, ViewWillEnter, ViewWillLeave, ViewDidEnter, ViewDidLeave, } from '@ionic/angular/common';
15
+ export { LoadingController, DomController, NavController, Config, Platform, AngularDelegate, NavParams, IonicRouteStrategy, ViewWillEnter, ViewWillLeave, ViewDidEnter, ViewDidLeave, } from '@ionic/angular/common';
16
16
  export { AlertController } from './providers/alert-controller';
17
17
  export { AnimationController } from './providers/animation-controller';
18
18
  export { ActionSheetController } from './providers/action-sheet-controller';
19
19
  export { GestureController } from './providers/gesture-controller';
20
- export { LoadingController } from './providers/loading-controller';
21
20
  export { MenuController } from './providers/menu-controller';
22
21
  export { ModalController } from './providers/modal-controller';
23
22
  export { PickerController } from './providers/picker-controller';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/angular",
3
- "version": "7.5.6-dev.11700520218.1c07312e",
3
+ "version": "7.5.6-dev.11701102039.134ebc28",
4
4
  "description": "Angular specific wrappers for @ionic/core",
5
5
  "keywords": [
6
6
  "ionic",
@@ -56,8 +56,8 @@
56
56
  }
57
57
  },
58
58
  "dependencies": {
59
- "@ionic/core": "7.5.6-dev.11700520218.1c07312e",
60
- "ionicons": "^7.0.0",
59
+ "@ionic/core": "7.5.6-dev.11701102039.134ebc28",
60
+ "ionicons": "^7.1.3-dev.11699459714.11b7e8aa",
61
61
  "jsonc-parser": "^3.0.0",
62
62
  "tslib": "^2.3.0"
63
63
  },
@@ -4,244 +4,3 @@
4
4
 
5
5
  /* To quickly generate your own theme, check out the color generator */
6
6
  /* https://ionicframework.com/docs/theming/color-generator */
7
-
8
- /** Ionic CSS Variables **/
9
- :root {
10
- /** primary **/
11
- --ion-color-primary: #3880ff;
12
- --ion-color-primary-rgb: 56, 128, 255;
13
- --ion-color-primary-contrast: #ffffff;
14
- --ion-color-primary-contrast-rgb: 255, 255, 255;
15
- --ion-color-primary-shade: #3171e0;
16
- --ion-color-primary-tint: #4c8dff;
17
-
18
- /** secondary **/
19
- --ion-color-secondary: #3dc2ff;
20
- --ion-color-secondary-rgb: 61, 194, 255;
21
- --ion-color-secondary-contrast: #ffffff;
22
- --ion-color-secondary-contrast-rgb: 255, 255, 255;
23
- --ion-color-secondary-shade: #36abe0;
24
- --ion-color-secondary-tint: #50c8ff;
25
-
26
- /** tertiary **/
27
- --ion-color-tertiary: #5260ff;
28
- --ion-color-tertiary-rgb: 82, 96, 255;
29
- --ion-color-tertiary-contrast: #ffffff;
30
- --ion-color-tertiary-contrast-rgb: 255, 255, 255;
31
- --ion-color-tertiary-shade: #4854e0;
32
- --ion-color-tertiary-tint: #6370ff;
33
-
34
- /** success **/
35
- --ion-color-success: #2dd36f;
36
- --ion-color-success-rgb: 45, 211, 111;
37
- --ion-color-success-contrast: #ffffff;
38
- --ion-color-success-contrast-rgb: 255, 255, 255;
39
- --ion-color-success-shade: #28ba62;
40
- --ion-color-success-tint: #42d77d;
41
-
42
- /** warning **/
43
- --ion-color-warning: #ffc409;
44
- --ion-color-warning-rgb: 255, 196, 9;
45
- --ion-color-warning-contrast: #000000;
46
- --ion-color-warning-contrast-rgb: 0, 0, 0;
47
- --ion-color-warning-shade: #e0ac08;
48
- --ion-color-warning-tint: #ffca22;
49
-
50
- /** danger **/
51
- --ion-color-danger: #eb445a;
52
- --ion-color-danger-rgb: 235, 68, 90;
53
- --ion-color-danger-contrast: #ffffff;
54
- --ion-color-danger-contrast-rgb: 255, 255, 255;
55
- --ion-color-danger-shade: #cf3c4f;
56
- --ion-color-danger-tint: #ed576b;
57
-
58
- /** dark **/
59
- --ion-color-dark: #222428;
60
- --ion-color-dark-rgb: 34, 36, 40;
61
- --ion-color-dark-contrast: #ffffff;
62
- --ion-color-dark-contrast-rgb: 255, 255, 255;
63
- --ion-color-dark-shade: #1e2023;
64
- --ion-color-dark-tint: #383a3e;
65
-
66
- /** medium **/
67
- --ion-color-medium: #92949c;
68
- --ion-color-medium-rgb: 146, 148, 156;
69
- --ion-color-medium-contrast: #ffffff;
70
- --ion-color-medium-contrast-rgb: 255, 255, 255;
71
- --ion-color-medium-shade: #808289;
72
- --ion-color-medium-tint: #9d9fa6;
73
-
74
- /** light **/
75
- --ion-color-light: #f4f5f8;
76
- --ion-color-light-rgb: 244, 245, 248;
77
- --ion-color-light-contrast: #000000;
78
- --ion-color-light-contrast-rgb: 0, 0, 0;
79
- --ion-color-light-shade: #d7d8da;
80
- --ion-color-light-tint: #f5f6f9;
81
- }
82
-
83
- @media (prefers-color-scheme: dark) {
84
- /*
85
- * Dark Colors
86
- * -------------------------------------------
87
- */
88
-
89
- body {
90
- --ion-color-primary: #428cff;
91
- --ion-color-primary-rgb: 66, 140, 255;
92
- --ion-color-primary-contrast: #ffffff;
93
- --ion-color-primary-contrast-rgb: 255, 255, 255;
94
- --ion-color-primary-shade: #3a7be0;
95
- --ion-color-primary-tint: #5598ff;
96
-
97
- --ion-color-secondary: #50c8ff;
98
- --ion-color-secondary-rgb: 80, 200, 255;
99
- --ion-color-secondary-contrast: #ffffff;
100
- --ion-color-secondary-contrast-rgb: 255, 255, 255;
101
- --ion-color-secondary-shade: #46b0e0;
102
- --ion-color-secondary-tint: #62ceff;
103
-
104
- --ion-color-tertiary: #6a64ff;
105
- --ion-color-tertiary-rgb: 106, 100, 255;
106
- --ion-color-tertiary-contrast: #ffffff;
107
- --ion-color-tertiary-contrast-rgb: 255, 255, 255;
108
- --ion-color-tertiary-shade: #5d58e0;
109
- --ion-color-tertiary-tint: #7974ff;
110
-
111
- --ion-color-success: #2fdf75;
112
- --ion-color-success-rgb: 47, 223, 117;
113
- --ion-color-success-contrast: #000000;
114
- --ion-color-success-contrast-rgb: 0, 0, 0;
115
- --ion-color-success-shade: #29c467;
116
- --ion-color-success-tint: #44e283;
117
-
118
- --ion-color-warning: #ffd534;
119
- --ion-color-warning-rgb: 255, 213, 52;
120
- --ion-color-warning-contrast: #000000;
121
- --ion-color-warning-contrast-rgb: 0, 0, 0;
122
- --ion-color-warning-shade: #e0bb2e;
123
- --ion-color-warning-tint: #ffd948;
124
-
125
- --ion-color-danger: #ff4961;
126
- --ion-color-danger-rgb: 255, 73, 97;
127
- --ion-color-danger-contrast: #ffffff;
128
- --ion-color-danger-contrast-rgb: 255, 255, 255;
129
- --ion-color-danger-shade: #e04055;
130
- --ion-color-danger-tint: #ff5b71;
131
-
132
- --ion-color-dark: #f4f5f8;
133
- --ion-color-dark-rgb: 244, 245, 248;
134
- --ion-color-dark-contrast: #000000;
135
- --ion-color-dark-contrast-rgb: 0, 0, 0;
136
- --ion-color-dark-shade: #d7d8da;
137
- --ion-color-dark-tint: #f5f6f9;
138
-
139
- --ion-color-medium: #989aa2;
140
- --ion-color-medium-rgb: 152, 154, 162;
141
- --ion-color-medium-contrast: #000000;
142
- --ion-color-medium-contrast-rgb: 0, 0, 0;
143
- --ion-color-medium-shade: #86888f;
144
- --ion-color-medium-tint: #a2a4ab;
145
-
146
- --ion-color-light: #222428;
147
- --ion-color-light-rgb: 34, 36, 40;
148
- --ion-color-light-contrast: #ffffff;
149
- --ion-color-light-contrast-rgb: 255, 255, 255;
150
- --ion-color-light-shade: #1e2023;
151
- --ion-color-light-tint: #383a3e;
152
- }
153
-
154
- /*
155
- * iOS Dark Theme
156
- * -------------------------------------------
157
- */
158
-
159
- .ios body {
160
- --ion-background-color: #000000;
161
- --ion-background-color-rgb: 0, 0, 0;
162
-
163
- --ion-text-color: #ffffff;
164
- --ion-text-color-rgb: 255, 255, 255;
165
-
166
- --ion-color-step-50: #0d0d0d;
167
- --ion-color-step-100: #1a1a1a;
168
- --ion-color-step-150: #262626;
169
- --ion-color-step-200: #333333;
170
- --ion-color-step-250: #404040;
171
- --ion-color-step-300: #4d4d4d;
172
- --ion-color-step-350: #595959;
173
- --ion-color-step-400: #666666;
174
- --ion-color-step-450: #737373;
175
- --ion-color-step-500: #808080;
176
- --ion-color-step-550: #8c8c8c;
177
- --ion-color-step-600: #999999;
178
- --ion-color-step-650: #a6a6a6;
179
- --ion-color-step-700: #b3b3b3;
180
- --ion-color-step-750: #bfbfbf;
181
- --ion-color-step-800: #cccccc;
182
- --ion-color-step-850: #d9d9d9;
183
- --ion-color-step-900: #e6e6e6;
184
- --ion-color-step-950: #f2f2f2;
185
-
186
- --ion-item-background: #000000;
187
-
188
- --ion-card-background: #1c1c1d;
189
- }
190
-
191
- .ios ion-modal {
192
- --ion-background-color: var(--ion-color-step-100);
193
- --ion-toolbar-background: var(--ion-color-step-150);
194
- --ion-toolbar-border-color: var(--ion-color-step-250);
195
- }
196
-
197
- /*
198
- * Material Design Dark Theme
199
- * -------------------------------------------
200
- */
201
-
202
- .md body {
203
- --ion-background-color: #121212;
204
- --ion-background-color-rgb: 18, 18, 18;
205
-
206
- --ion-text-color: #ffffff;
207
- --ion-text-color-rgb: 255, 255, 255;
208
-
209
- --ion-border-color: #222222;
210
-
211
- --ion-color-step-50: #1e1e1e;
212
- --ion-color-step-100: #2a2a2a;
213
- --ion-color-step-150: #363636;
214
- --ion-color-step-200: #414141;
215
- --ion-color-step-250: #4d4d4d;
216
- --ion-color-step-300: #595959;
217
- --ion-color-step-350: #656565;
218
- --ion-color-step-400: #717171;
219
- --ion-color-step-450: #7d7d7d;
220
- --ion-color-step-500: #898989;
221
- --ion-color-step-550: #949494;
222
- --ion-color-step-600: #a0a0a0;
223
- --ion-color-step-650: #acacac;
224
- --ion-color-step-700: #b8b8b8;
225
- --ion-color-step-750: #c4c4c4;
226
- --ion-color-step-800: #d0d0d0;
227
- --ion-color-step-850: #dbdbdb;
228
- --ion-color-step-900: #e7e7e7;
229
- --ion-color-step-950: #f3f3f3;
230
-
231
- --ion-item-background: #1e1e1e;
232
-
233
- --ion-toolbar-background: #1f1f1f;
234
-
235
- --ion-tab-bar-background: #1f1f1f;
236
-
237
- --ion-card-background: #1e1e1e;
238
- }
239
- }
240
-
241
- html {
242
- /*
243
- * For more information on dynamic font scaling, visit the documentation:
244
- * https://ionicframework.com/docs/layout/dynamic-font-scaling
245
- */
246
- --ion-dynamic-font: var(--ion-default-dynamic-font);
247
- }
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@angular-devkit/core");
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const tasks_1 = require("@angular-devkit/schematics/tasks");
6
- const utility_1 = require("@schematics/angular/utility");
7
6
  const workspace_1 = require("@schematics/angular/utility/workspace");
8
- const ast_1 = require("../utils/ast");
7
+ const ast_1 = require("./../utils/ast");
9
8
  const config_1 = require("./../utils/config");
10
9
  const package_1 = require("./../utils/package");
11
10
  function addIonicAngularToPackageJson() {
@@ -20,48 +19,9 @@ function addIonicAngularToolkitToPackageJson() {
20
19
  return host;
21
20
  };
22
21
  }
23
- /**
24
- * Adds the @ionic/angular-toolkit schematics and cli configuration to the project's `angular.json` file.
25
- * @param projectName The name of the project.
26
- */
27
- function addIonicAngularToolkitToAngularJson() {
28
- return (host) => {
29
- (0, config_1.addCli)(host, '@ionic/angular-toolkit');
30
- (0, config_1.addSchematics)(host, '@ionic/angular-toolkit:component', {
31
- styleext: 'scss',
32
- });
33
- (0, config_1.addSchematics)(host, '@ionic/angular-toolkit:page', {
34
- styleext: 'scss',
35
- });
36
- return host;
37
- };
38
- }
39
- /**
40
- * Adds the `IonicModule.forRoot()` usage to the project's `AppModule`.
41
- * If the project does not use modules this will operate as a noop.
42
- * @param projectSourceRoot The source root path of the project.
43
- */
44
22
  function addIonicAngularModuleToAppModule(projectSourceRoot) {
45
23
  return (host) => {
46
- const appModulePath = `${projectSourceRoot}/app/app.module.ts`;
47
- if (host.exists(appModulePath)) {
48
- (0, ast_1.addIonicModuleImportToNgModule)(host, appModulePath);
49
- }
50
- return host;
51
- };
52
- }
53
- /**
54
- * Adds the `provideIonicAngular` usage to the project's app config.
55
- * If the project does not use an app config this will operate as a noop.
56
- * @param projectName The name of the project.
57
- * @param projectSourceRoot The source root path of the project.
58
- */
59
- function addProvideIonicAngular(projectName, projectSourceRoot) {
60
- return (host) => {
61
- const appConfig = `${projectSourceRoot}/app/app.config.ts`;
62
- if (host.exists(appConfig)) {
63
- return (0, utility_1.addRootProvider)(projectName, ({ code, external }) => code `${external('provideIonicAngular', '@ionic/angular/standalone')}({})`);
64
- }
24
+ (0, ast_1.addModuleImportToRootModule)(host, projectSourceRoot, 'IonicModule.forRoot()', '@ionic/angular');
65
25
  return host;
66
26
  };
67
27
  }
@@ -86,38 +46,15 @@ function addIonicStyles(projectName, projectSourceRoot) {
86
46
  return host;
87
47
  };
88
48
  }
89
- function addIonicons(projectName, projectSourceRoot) {
49
+ function addIonicons(projectName) {
90
50
  return (host) => {
91
- const hasAppModule = host.exists(`${projectSourceRoot}/app/app.module.ts`);
92
- if (hasAppModule) {
93
- /**
94
- * Add Ionicons to the `angular.json` file only if the project
95
- * is using the lazy build of `@ionic/angular` with modules.
96
- */
97
- const ioniconsGlob = {
98
- glob: '**/*.svg',
99
- input: 'node_modules/ionicons/dist/ionicons/svg',
100
- output: './svg',
101
- };
102
- (0, config_1.addAsset)(host, projectName, 'build', ioniconsGlob);
103
- (0, config_1.addAsset)(host, projectName, 'test', ioniconsGlob);
104
- }
105
- return host;
106
- };
107
- }
108
- function addIonicConfig(projectSourceRoot) {
109
- return (host) => {
110
- const ionicConfig = 'ionic.config.json';
111
- if (!host.exists(ionicConfig)) {
112
- const hasAppModule = host.exists(`${projectSourceRoot}/app/app.module.ts`);
113
- const type = hasAppModule ? 'angular' : 'angular-standalone';
114
- host.create(ionicConfig, JSON.stringify({
115
- name: 'ionic-app',
116
- app_id: '',
117
- type,
118
- integrations: {},
119
- }, null, 2));
120
- }
51
+ const ioniconsGlob = {
52
+ glob: '**/*.svg',
53
+ input: 'node_modules/ionicons/dist/ionicons/svg',
54
+ output: './svg',
55
+ };
56
+ (0, config_1.addAsset)(host, projectName, 'build', ioniconsGlob);
57
+ (0, config_1.addAsset)(host, projectName, 'test', ioniconsGlob);
121
58
  return host;
122
59
  };
123
60
  }
@@ -171,13 +108,10 @@ function ngAdd(options) {
171
108
  // @ionic/angular
172
109
  addIonicAngularToPackageJson(),
173
110
  addIonicAngularToolkitToPackageJson(),
174
- addIonicAngularToolkitToAngularJson(),
175
111
  addIonicAngularModuleToAppModule(sourcePath),
176
- addProvideIonicAngular(options.project, sourcePath),
177
112
  addIonicBuilder(options.project),
178
113
  addIonicStyles(options.project, sourcePath),
179
- addIonicons(options.project, sourcePath),
180
- addIonicConfig(sourcePath),
114
+ addIonicons(options.project),
181
115
  (0, schematics_1.mergeWith)(rootTemplateSource),
182
116
  // install freshly added dependencies
183
117
  installNodeDeps(),
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addIonicModuleImportToNgModule = void 0;
3
+ exports.addModuleImportToModule = exports.addModuleImportToRootModule = exports.getSourceFile = void 0;
4
+ const core_1 = require("@angular-devkit/core");
4
5
  const schematics_1 = require("@angular-devkit/schematics");
5
- const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
6
- const change_1 = require("@schematics/angular/utility/change");
7
6
  const ts = require("typescript");
7
+ const ast_utils_1 = require("./devkit-utils/ast-utils");
8
+ const change_1 = require("./devkit-utils/change");
8
9
  /**
9
10
  * Reads file given path and returns TypeScript source file.
10
11
  */
@@ -17,16 +18,30 @@ function getSourceFile(host, path) {
17
18
  const source = ts.createSourceFile(path, content, ts.ScriptTarget.Latest, true);
18
19
  return source;
19
20
  }
21
+ exports.getSourceFile = getSourceFile;
20
22
  /**
21
23
  * Import and add module to root app module.
22
24
  */
23
- function addIonicModuleImportToNgModule(host, modulePath) {
24
- const recorder = host.beginUpdate(modulePath);
25
+ function addModuleImportToRootModule(host, projectSourceRoot, moduleName, importSrc) {
26
+ addModuleImportToModule(host, (0, core_1.normalize)(`${projectSourceRoot}/app/app.module.ts`), moduleName, importSrc);
27
+ }
28
+ exports.addModuleImportToRootModule = addModuleImportToRootModule;
29
+ /**
30
+ * Import and add module to specific module path.
31
+ * @param host the tree we are updating
32
+ * @param modulePath src location of the module to import
33
+ * @param moduleName name of module to import
34
+ * @param src src location to import
35
+ */
36
+ function addModuleImportToModule(host, modulePath, moduleName, src) {
25
37
  const moduleSource = getSourceFile(host, modulePath);
26
- const ionicModuleChange = (0, ast_utils_1.insertImport)(moduleSource, modulePath, 'IonicModule', '@ionic/angular');
27
- (0, change_1.applyToUpdateRecorder)(recorder, [ionicModuleChange]);
28
- const metadataChange = (0, ast_utils_1.addSymbolToNgModuleMetadata)(moduleSource, modulePath, 'imports', 'IonicModule.forRoot({})');
29
- (0, change_1.applyToUpdateRecorder)(recorder, metadataChange);
38
+ const changes = (0, ast_utils_1.addImportToModule)(moduleSource, modulePath, moduleName, src);
39
+ const recorder = host.beginUpdate(modulePath);
40
+ changes.forEach((change) => {
41
+ if (change instanceof change_1.InsertChange) {
42
+ recorder.insertLeft(change.pos, change.toAdd);
43
+ }
44
+ });
30
45
  host.commitUpdate(recorder);
31
46
  }
32
- exports.addIonicModuleImportToNgModule = addIonicModuleImportToNgModule;
47
+ exports.addModuleImportToModule = addModuleImportToModule;
@@ -1,25 +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.getWorkspace = exports.getWorkspacePath = exports.addArchitectBuilder = exports.addAsset = exports.addStyle = exports.getAngularAppConfig = exports.getDefaultAngularAppName = exports.writeConfig = exports.readConfig = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const jsonc_parser_1 = require("jsonc-parser");
6
- const ANGULAR_JSON_PATH = 'angular.json';
6
+ const CONFIG_PATH = 'angular.json';
7
+ // TODO(FW-2827): types
7
8
  function readConfig(host) {
8
- return host.readJson(ANGULAR_JSON_PATH);
9
+ var _a;
10
+ const sourceText = (_a = host.read(CONFIG_PATH)) === null || _a === void 0 ? void 0 : _a.toString('utf-8');
11
+ return JSON.parse(sourceText);
9
12
  }
10
13
  exports.readConfig = readConfig;
11
14
  function writeConfig(host, config) {
12
- host.overwrite(ANGULAR_JSON_PATH, JSON.stringify(config, null, 2));
15
+ host.overwrite(CONFIG_PATH, JSON.stringify(config, null, 2));
13
16
  }
14
17
  exports.writeConfig = writeConfig;
15
18
  function isAngularBrowserProject(projectConfig) {
16
19
  if (projectConfig.projectType === 'application') {
17
20
  const buildConfig = projectConfig.architect.build;
18
- // Angular 16 and lower
19
- const legacyAngularBuilder = buildConfig.builder === '@angular-devkit/build-angular:browser';
20
- // Angular 17+
21
- const modernAngularBuilder = buildConfig.builder === '@angular-devkit/build-angular:application';
22
- return legacyAngularBuilder || modernAngularBuilder;
21
+ return buildConfig.builder === '@angular-devkit/build-angular:browser';
23
22
  }
24
23
  return false;
25
24
  }
@@ -35,7 +34,7 @@ function getDefaultAngularAppName(config) {
35
34
  return projectNames[0];
36
35
  }
37
36
  exports.getDefaultAngularAppName = getDefaultAngularAppName;
38
- function getAngularJson(config, projectName) {
37
+ function getAngularAppConfig(config, projectName) {
39
38
  // eslint-disable-next-line no-prototype-builtins
40
39
  if (!config.projects.hasOwnProperty(projectName)) {
41
40
  throw new schematics_1.SchematicsException(`Could not find project: ${projectName}`);
@@ -52,10 +51,11 @@ function getAngularJson(config, projectName) {
52
51
  throw new schematics_1.SchematicsException(`Invalid builder for ${projectName}: ${buildConfig.builder}`);
53
52
  }
54
53
  }
54
+ exports.getAngularAppConfig = getAngularAppConfig;
55
55
  function addStyle(host, projectName, stylePath) {
56
56
  const config = readConfig(host);
57
- const angularJson = getAngularJson(config, projectName);
58
- angularJson.architect.build.options.styles.push({
57
+ const appConfig = getAngularAppConfig(config, projectName);
58
+ appConfig.architect.build.options.styles.push({
59
59
  input: stylePath,
60
60
  });
61
61
  writeConfig(host, config);
@@ -63,8 +63,8 @@ function addStyle(host, projectName, stylePath) {
63
63
  exports.addStyle = addStyle;
64
64
  function addAsset(host, projectName, architect, asset) {
65
65
  const config = readConfig(host);
66
- const angularJson = getAngularJson(config, projectName);
67
- const target = angularJson.architect[architect];
66
+ const appConfig = getAngularAppConfig(config, projectName);
67
+ const target = appConfig.architect[architect];
68
68
  if (target) {
69
69
  target.options.assets.push(asset);
70
70
  writeConfig(host, config);
@@ -73,37 +73,11 @@ function addAsset(host, projectName, architect, asset) {
73
73
  exports.addAsset = addAsset;
74
74
  function addArchitectBuilder(host, projectName, builderName, builderOpts) {
75
75
  const config = readConfig(host);
76
- const angularJson = getAngularJson(config, projectName);
77
- angularJson.architect[builderName] = builderOpts;
76
+ const appConfig = getAngularAppConfig(config, projectName);
77
+ appConfig.architect[builderName] = builderOpts;
78
78
  writeConfig(host, config);
79
79
  }
80
80
  exports.addArchitectBuilder = addArchitectBuilder;
81
- /**
82
- * Updates the angular.json to add an additional schematic collection
83
- * to the CLI configuration.
84
- */
85
- function addCli(host, collectionName) {
86
- const angularJson = readConfig(host);
87
- if (angularJson.cli === undefined) {
88
- angularJson.cli = {};
89
- }
90
- if (angularJson.cli.schematicCollections === undefined) {
91
- angularJson.cli.schematicCollections = [];
92
- }
93
- angularJson.cli.schematicCollections.push(collectionName);
94
- writeConfig(host, angularJson);
95
- }
96
- exports.addCli = addCli;
97
- // TODO(FW-5639): can remove [property: string]: any; when upgrading @angular/cli dev-dep to v16 or later
98
- function addSchematics(host, schematicName, schematicOpts) {
99
- const angularJson = readConfig(host);
100
- if (angularJson.schematics === undefined) {
101
- angularJson.schematics = {};
102
- }
103
- angularJson.schematics[schematicName] = schematicOpts;
104
- writeConfig(host, angularJson);
105
- }
106
- exports.addSchematics = addSchematics;
107
81
  function getWorkspacePath(host) {
108
82
  const possibleFiles = ['/angular.json', '/.angular.json'];
109
83
  const path = possibleFiles.filter((path) => host.exists(path))[0];