@ionic-hotfix/cordova-builders 13.0.1-testing.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,365 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## 13.0.1-testing.2 (2026-02-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cordova-builders:** release bump ([#515](https://github.com/ionic-team/angular-toolkit/issues/515)) ([047a563](https://github.com/ionic-team/angular-toolkit/commit/047a563db305a07e1a18ac08935d2809dc3a9a04))
12
+ * Remove extra line from README ([#517](https://github.com/ionic-team/angular-toolkit/issues/517)) ([a6d925f](https://github.com/ionic-team/angular-toolkit/commit/a6d925fca2a477e54d9157529cb25b4f48b04176))
13
+
14
+
15
+ ### Features
16
+
17
+ * add cordova-builders ng-add ([#467](https://github.com/ionic-team/angular-toolkit/issues/467)) ([1b9a0bd](https://github.com/ionic-team/angular-toolkit/commit/1b9a0bdabdbdcd1f6226a8ddc771abd1f54afd42))
18
+ * **builders:** add support for angular 16.0 ([379d8d4](https://github.com/ionic-team/angular-toolkit/commit/379d8d43d066b1cd556b083ccb506703a166ce1d)), closes [#493](https://github.com/ionic-team/angular-toolkit/issues/493) [#494](https://github.com/ionic-team/angular-toolkit/issues/494)
19
+ * bump deps to angular 14 ([767598e](https://github.com/ionic-team/angular-toolkit/commit/767598eace5bc91767008fd86670729c8079a1d9)), closes [#474](https://github.com/ionic-team/angular-toolkit/issues/474)
20
+ * bump deps to angular 15 ([009079a](https://github.com/ionic-team/angular-toolkit/commit/009079a5cf13804d55a7b1d15c79824cac9db179))
21
+ * bump deps to support angular v15 ([e7fdfd8](https://github.com/ionic-team/angular-toolkit/commit/e7fdfd8581819430b549cfae4a87e9edbadf57c9)), closes [#481](https://github.com/ionic-team/angular-toolkit/issues/481) [#477](https://github.com/ionic-team/angular-toolkit/issues/477) [#482](https://github.com/ionic-team/angular-toolkit/issues/482)
22
+ * split tooling ([#465](https://github.com/ionic-team/angular-toolkit/issues/465)) ([a8303ec](https://github.com/ionic-team/angular-toolkit/commit/a8303ec5df92c9f463ded30fbcb97a908578adf5))
23
+ * support angular 17 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))
24
+ * support angular 18 ([#513](https://github.com/ionic-team/angular-toolkit/issues/513)) ([70d5066](https://github.com/ionic-team/angular-toolkit/commit/70d50665a000c10b1cf5701aad664c2e620541c1))
25
+ * support angular 19 ([#520](https://github.com/ionic-team/angular-toolkit/issues/520)) ([2823580](https://github.com/ionic-team/angular-toolkit/commit/282358057bac80e3f3a3f96cec6b7d8c1380cea0))
26
+ * support angular 20 ([#524](https://github.com/ionic-team/angular-toolkit/issues/524)) ([3525b21](https://github.com/ionic-team/angular-toolkit/commit/3525b2151cca563015618eb0745639133d273842))
27
+
28
+
29
+ ### BREAKING CHANGES
30
+
31
+ * The minimum version of Angular required is now 17. Please updates your apps to use
32
+ the latest release of Angular.
33
+ * **builders:** The minimum version of Angular required is now 16. Please updates your apps to use
34
+ the lates release of Angular
35
+ * Apps will need to update to Angular 15 in order to suppor this verion.
36
+ * Apps will need to update to Angular 15 in order to support this version
37
+ * Apps will need to update to Angular 14 in order to suppor this verion.
38
+ * ionic/angular + cordova users will now need to install @ionic/cordova-builders and
39
+ update their angular.json to reflect the new package name
40
+
41
+ * chore(): fix package description
42
+
43
+
44
+
45
+
46
+
47
+ ## 13.0.1-testing.1 (2026-02-26)
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * **cordova-builders:** release bump ([#515](https://github.com/ionic-team/angular-toolkit/issues/515)) ([047a563](https://github.com/ionic-team/angular-toolkit/commit/047a563db305a07e1a18ac08935d2809dc3a9a04))
53
+ * Remove extra line from README ([#517](https://github.com/ionic-team/angular-toolkit/issues/517)) ([a6d925f](https://github.com/ionic-team/angular-toolkit/commit/a6d925fca2a477e54d9157529cb25b4f48b04176))
54
+
55
+
56
+ ### Features
57
+
58
+ * add cordova-builders ng-add ([#467](https://github.com/ionic-team/angular-toolkit/issues/467)) ([1b9a0bd](https://github.com/ionic-team/angular-toolkit/commit/1b9a0bdabdbdcd1f6226a8ddc771abd1f54afd42))
59
+ * **builders:** add support for angular 16.0 ([379d8d4](https://github.com/ionic-team/angular-toolkit/commit/379d8d43d066b1cd556b083ccb506703a166ce1d)), closes [#493](https://github.com/ionic-team/angular-toolkit/issues/493) [#494](https://github.com/ionic-team/angular-toolkit/issues/494)
60
+ * bump deps to angular 14 ([767598e](https://github.com/ionic-team/angular-toolkit/commit/767598eace5bc91767008fd86670729c8079a1d9)), closes [#474](https://github.com/ionic-team/angular-toolkit/issues/474)
61
+ * bump deps to angular 15 ([009079a](https://github.com/ionic-team/angular-toolkit/commit/009079a5cf13804d55a7b1d15c79824cac9db179))
62
+ * bump deps to support angular v15 ([e7fdfd8](https://github.com/ionic-team/angular-toolkit/commit/e7fdfd8581819430b549cfae4a87e9edbadf57c9)), closes [#481](https://github.com/ionic-team/angular-toolkit/issues/481) [#477](https://github.com/ionic-team/angular-toolkit/issues/477) [#482](https://github.com/ionic-team/angular-toolkit/issues/482)
63
+ * split tooling ([#465](https://github.com/ionic-team/angular-toolkit/issues/465)) ([a8303ec](https://github.com/ionic-team/angular-toolkit/commit/a8303ec5df92c9f463ded30fbcb97a908578adf5))
64
+ * support angular 17 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))
65
+ * support angular 18 ([#513](https://github.com/ionic-team/angular-toolkit/issues/513)) ([70d5066](https://github.com/ionic-team/angular-toolkit/commit/70d50665a000c10b1cf5701aad664c2e620541c1))
66
+ * support angular 19 ([#520](https://github.com/ionic-team/angular-toolkit/issues/520)) ([2823580](https://github.com/ionic-team/angular-toolkit/commit/282358057bac80e3f3a3f96cec6b7d8c1380cea0))
67
+ * support angular 20 ([#524](https://github.com/ionic-team/angular-toolkit/issues/524)) ([3525b21](https://github.com/ionic-team/angular-toolkit/commit/3525b2151cca563015618eb0745639133d273842))
68
+
69
+
70
+ ### BREAKING CHANGES
71
+
72
+ * The minimum version of Angular required is now 17. Please updates your apps to use
73
+ the latest release of Angular.
74
+ * **builders:** The minimum version of Angular required is now 16. Please updates your apps to use
75
+ the lates release of Angular
76
+ * Apps will need to update to Angular 15 in order to suppor this verion.
77
+ * Apps will need to update to Angular 15 in order to support this version
78
+ * Apps will need to update to Angular 14 in order to suppor this verion.
79
+ * ionic/angular + cordova users will now need to install @ionic/cordova-builders and
80
+ update their angular.json to reflect the new package name
81
+
82
+ * chore(): fix package description
83
+
84
+
85
+
86
+
87
+
88
+ ## 13.0.1-testing.0 (2026-02-26)
89
+
90
+
91
+ ### Bug Fixes
92
+
93
+ * **cordova-builders:** release bump ([#515](https://github.com/ionic-team/angular-toolkit/issues/515)) ([047a563](https://github.com/ionic-team/angular-toolkit/commit/047a563db305a07e1a18ac08935d2809dc3a9a04))
94
+ * Remove extra line from README ([#517](https://github.com/ionic-team/angular-toolkit/issues/517)) ([a6d925f](https://github.com/ionic-team/angular-toolkit/commit/a6d925fca2a477e54d9157529cb25b4f48b04176))
95
+
96
+
97
+ ### Features
98
+
99
+ * add cordova-builders ng-add ([#467](https://github.com/ionic-team/angular-toolkit/issues/467)) ([1b9a0bd](https://github.com/ionic-team/angular-toolkit/commit/1b9a0bdabdbdcd1f6226a8ddc771abd1f54afd42))
100
+ * **builders:** add support for angular 16.0 ([379d8d4](https://github.com/ionic-team/angular-toolkit/commit/379d8d43d066b1cd556b083ccb506703a166ce1d)), closes [#493](https://github.com/ionic-team/angular-toolkit/issues/493) [#494](https://github.com/ionic-team/angular-toolkit/issues/494)
101
+ * bump deps to angular 14 ([767598e](https://github.com/ionic-team/angular-toolkit/commit/767598eace5bc91767008fd86670729c8079a1d9)), closes [#474](https://github.com/ionic-team/angular-toolkit/issues/474)
102
+ * bump deps to angular 15 ([009079a](https://github.com/ionic-team/angular-toolkit/commit/009079a5cf13804d55a7b1d15c79824cac9db179))
103
+ * bump deps to support angular v15 ([e7fdfd8](https://github.com/ionic-team/angular-toolkit/commit/e7fdfd8581819430b549cfae4a87e9edbadf57c9)), closes [#481](https://github.com/ionic-team/angular-toolkit/issues/481) [#477](https://github.com/ionic-team/angular-toolkit/issues/477) [#482](https://github.com/ionic-team/angular-toolkit/issues/482)
104
+ * split tooling ([#465](https://github.com/ionic-team/angular-toolkit/issues/465)) ([a8303ec](https://github.com/ionic-team/angular-toolkit/commit/a8303ec5df92c9f463ded30fbcb97a908578adf5))
105
+ * support angular 17 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))
106
+ * support angular 18 ([#513](https://github.com/ionic-team/angular-toolkit/issues/513)) ([70d5066](https://github.com/ionic-team/angular-toolkit/commit/70d50665a000c10b1cf5701aad664c2e620541c1))
107
+ * support angular 19 ([#520](https://github.com/ionic-team/angular-toolkit/issues/520)) ([2823580](https://github.com/ionic-team/angular-toolkit/commit/282358057bac80e3f3a3f96cec6b7d8c1380cea0))
108
+ * support angular 20 ([#524](https://github.com/ionic-team/angular-toolkit/issues/524)) ([3525b21](https://github.com/ionic-team/angular-toolkit/commit/3525b2151cca563015618eb0745639133d273842))
109
+
110
+
111
+ ### BREAKING CHANGES
112
+
113
+ * The minimum version of Angular required is now 17. Please updates your apps to use
114
+ the latest release of Angular.
115
+ * **builders:** The minimum version of Angular required is now 16. Please updates your apps to use
116
+ the lates release of Angular
117
+ * Apps will need to update to Angular 15 in order to suppor this verion.
118
+ * Apps will need to update to Angular 15 in order to support this version
119
+ * Apps will need to update to Angular 14 in order to suppor this verion.
120
+ * ionic/angular + cordova users will now need to install @ionic/cordova-builders and
121
+ update their angular.json to reflect the new package name
122
+
123
+ * chore(): fix package description
124
+
125
+
126
+
127
+
128
+
129
+ # [12.3.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@12.2.0...@ionic/cordova-builders@12.3.0) (2025-08-11)
130
+
131
+
132
+ ### Features
133
+
134
+ * support angular 20 ([#524](https://github.com/ionic-team/angular-toolkit/issues/524)) ([3525b21](https://github.com/ionic-team/angular-toolkit/commit/3525b2151cca563015618eb0745639133d273842))
135
+
136
+
137
+
138
+
139
+
140
+ # [12.2.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@12.1.2...@ionic/cordova-builders@12.2.0) (2025-04-10)
141
+
142
+
143
+ ### Features
144
+
145
+ * support angular 19 ([#520](https://github.com/ionic-team/angular-toolkit/issues/520)) ([2823580](https://github.com/ionic-team/angular-toolkit/commit/282358057bac80e3f3a3f96cec6b7d8c1380cea0))
146
+
147
+
148
+
149
+
150
+
151
+ ## [12.1.2](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@12.1.1...@ionic/cordova-builders@12.1.2) (2024-09-20)
152
+
153
+
154
+ ### Bug Fixes
155
+
156
+ * Remove extra line from README ([#517](https://github.com/ionic-team/angular-toolkit/issues/517)) ([a6d925f](https://github.com/ionic-team/angular-toolkit/commit/a6d925fca2a477e54d9157529cb25b4f48b04176))
157
+
158
+
159
+
160
+
161
+
162
+ ## [12.1.1](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@12.1.0...@ionic/cordova-builders@12.1.1) (2024-09-05)
163
+
164
+
165
+ ### Bug Fixes
166
+
167
+ * **cordova-builders:** release bump ([#515](https://github.com/ionic-team/angular-toolkit/issues/515)) ([047a563](https://github.com/ionic-team/angular-toolkit/commit/047a563db305a07e1a18ac08935d2809dc3a9a04))
168
+
169
+
170
+
171
+
172
+
173
+ # [12.1.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@11.0.0...@ionic/cordova-builders@12.1.0) (2024-09-03)
174
+
175
+
176
+ ### Features
177
+
178
+ * support angular 18 ([#513](https://github.com/ionic-team/angular-toolkit/issues/513)) ([70d5066](https://github.com/ionic-team/angular-toolkit/commit/70d50665a000c10b1cf5701aad664c2e620541c1))
179
+
180
+
181
+
182
+
183
+
184
+ # [12.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@10.1.1...@ionic/cordova-builders@11.0.0) (2024-09-01)
185
+
186
+
187
+ ### Features
188
+
189
+ * support angular 18 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))
190
+
191
+
192
+ ### BREAKING CHANGES
193
+
194
+ * The minimum version of Angular required is now 18. Please updates your apps to use
195
+ the latest release of Angular.
196
+
197
+ # [11.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@10.1.1...@ionic/cordova-builders@11.0.0) (2024-01-09)
198
+
199
+
200
+ ### Features
201
+
202
+ * support angular 17 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))
203
+
204
+
205
+ ### BREAKING CHANGES
206
+
207
+ * The minimum version of Angular required is now 17. Please updates your apps to use
208
+ the latest release of Angular.
209
+
210
+
211
+
212
+
213
+
214
+ ## [10.1.1](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@10.1.0...@ionic/cordova-builders@10.1.1) (2024-01-09)
215
+
216
+
217
+ ### Reverts
218
+
219
+ * Revert "feat: support angular 17 (#503)" ([feb6361](https://github.com/ionic-team/angular-toolkit/commit/feb6361f1452e5ccbe242b0e00c0ded05beacec4)), closes [#503](https://github.com/ionic-team/angular-toolkit/issues/503)
220
+
221
+
222
+
223
+
224
+
225
+ # [10.1.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@10.0.0...@ionic/cordova-builders@10.1.0) (2024-01-09)
226
+
227
+
228
+ ### Features
229
+
230
+ * support angular 17 ([#503](https://github.com/ionic-team/angular-toolkit/issues/503)) ([26f0cd9](https://github.com/ionic-team/angular-toolkit/commit/26f0cd9a17b1489a1e864bb468f4e51315d4a004)), closes [#502](https://github.com/ionic-team/angular-toolkit/issues/502)
231
+
232
+
233
+
234
+
235
+
236
+ # [10.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@9.0.0...@ionic/cordova-builders@10.0.0) (2023-07-06)
237
+
238
+
239
+ ### Features
240
+
241
+ * **builders:** add support for angular 16.0 ([379d8d4](https://github.com/ionic-team/angular-toolkit/commit/379d8d43d066b1cd556b083ccb506703a166ce1d)), closes [#493](https://github.com/ionic-team/angular-toolkit/issues/493) [#494](https://github.com/ionic-team/angular-toolkit/issues/494)
242
+
243
+
244
+ ### BREAKING CHANGES
245
+
246
+ * **builders:** The minimum version of Angular required is now 16. Please updates your apps to use
247
+ the lates release of Angular
248
+
249
+
250
+
251
+
252
+
253
+ # [9.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@8.0.0...@ionic/cordova-builders@9.0.0) (2023-03-28)
254
+
255
+
256
+ ### Features
257
+
258
+ * bump deps to angular 15 ([009079a](https://github.com/ionic-team/angular-toolkit/commit/009079a5cf13804d55a7b1d15c79824cac9db179))
259
+
260
+
261
+ ### BREAKING CHANGES
262
+
263
+ * Apps will need to update to Angular 15 in order to suppor this verion.
264
+
265
+
266
+
267
+
268
+
269
+ # [8.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@7.0.0...@ionic/cordova-builders@8.0.0) (2023-02-15)
270
+
271
+
272
+ ### Features
273
+
274
+ * bump deps to support angular v15 ([e7fdfd8](https://github.com/ionic-team/angular-toolkit/commit/e7fdfd8581819430b549cfae4a87e9edbadf57c9)), closes [#481](https://github.com/ionic-team/angular-toolkit/issues/481) [#477](https://github.com/ionic-team/angular-toolkit/issues/477) [#482](https://github.com/ionic-team/angular-toolkit/issues/482)
275
+
276
+
277
+ ### BREAKING CHANGES
278
+
279
+ * Apps will need to update to Angular 15 in order to support this version
280
+
281
+
282
+
283
+
284
+
285
+ # [7.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@6.1.0...@ionic/cordova-builders@7.0.0) (2022-07-18)
286
+
287
+
288
+ ### Features
289
+
290
+ * bump deps to angular 14 ([767598e](https://github.com/ionic-team/angular-toolkit/commit/767598eace5bc91767008fd86670729c8079a1d9)), closes [#474](https://github.com/ionic-team/angular-toolkit/issues/474)
291
+
292
+
293
+ ### BREAKING CHANGES
294
+
295
+ * Apps will need to update to Angular 14 in order to suppor this verion.
296
+
297
+
298
+
299
+
300
+
301
+ # [6.1.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/cordova-builders@6.0.0...@ionic/cordova-builders@6.1.0) (2022-03-08)
302
+
303
+
304
+ ### Features
305
+
306
+ * add cordova-builders ng-add ([#467](https://github.com/ionic-team/angular-toolkit/issues/467)) ([1b9a0bd](https://github.com/ionic-team/angular-toolkit/commit/1b9a0bdabdbdcd1f6226a8ddc771abd1f54afd42))
307
+
308
+
309
+
310
+
311
+
312
+ # 6.0.0 (2022-01-18)
313
+
314
+
315
+ ### Features
316
+
317
+ * split tooling ([#465](https://github.com/ionic-team/angular-toolkit/issues/465)) ([a8303ec](https://github.com/ionic-team/angular-toolkit/commit/a8303ec5df92c9f463ded30fbcb97a908578adf5))
318
+
319
+
320
+ ### BREAKING CHANGES
321
+
322
+ * ionic/angular + cordova users will now need to install @ionic/cordova-builders and
323
+ update their angular.json to reflect the new package name
324
+
325
+ * chore(): fix package description
326
+
327
+
328
+
329
+
330
+
331
+ ## 5.0.4-testing.4 (2021-11-17)
332
+
333
+ **Note:** Version bump only for package @ionic/cordova-builders
334
+
335
+
336
+
337
+
338
+
339
+ ## 5.0.4-testing.3 (2021-11-16)
340
+
341
+ **Note:** Version bump only for package @ionic/cordova-builders
342
+
343
+
344
+
345
+
346
+
347
+ ## 5.0.4-testing.2 (2021-11-16)
348
+
349
+ **Note:** Version bump only for package @ionic/cordova-builders
350
+
351
+
352
+
353
+
354
+
355
+ ## 5.0.4-testing.1 (2021-11-16)
356
+
357
+ **Note:** Version bump only for package @ionic/cordova-builders
358
+
359
+
360
+
361
+
362
+
363
+ ## 5.0.4-testing.0 (2021-11-16)
364
+
365
+ **Note:** Version bump only for package @ionic/cordova-builders
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Ionic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # `@ionic/cordova-builders`
2
+
3
+ A collection of builders for `@ionic/angular` projects using Cordova.
4
+
5
+ To add these builders to your project, run
6
+
7
+ ```shell
8
+ ng add @ionic/cordova-builders
9
+ ```
package/add/index.js ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = ngAdd;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const workspace_1 = require("@schematics/angular/utility/workspace");
6
+ const config_1 = require("./../utils/config");
7
+ function addCordovaBuilder(projectName) {
8
+ return (host) => {
9
+ (0, config_1.addArchitectBuilder)(host, projectName, 'ionic-cordova-serve', {
10
+ builder: '@ionic/cordova-builders:cordova-serve',
11
+ options: {
12
+ cordovaBuildTarget: `${projectName}:ionic-cordova-build`,
13
+ devServerTarget: `${projectName}:serve`,
14
+ },
15
+ configurations: {
16
+ production: {
17
+ cordovaBuildTarget: `${projectName}:ionic-cordova-build:production`,
18
+ devServerTarget: `${projectName}:serve:production`,
19
+ },
20
+ },
21
+ });
22
+ (0, config_1.addArchitectBuilder)(host, projectName, 'ionic-cordova-build', {
23
+ builder: '@ionic/cordova-builders:cordova-build',
24
+ options: {
25
+ browserTarget: `${projectName}:build`,
26
+ },
27
+ configurations: {
28
+ production: {
29
+ browserTarget: `${projectName}:build:production`,
30
+ },
31
+ },
32
+ });
33
+ return host;
34
+ };
35
+ }
36
+ function ngAdd(options) {
37
+ return async (host) => {
38
+ const workspace = await (0, workspace_1.getWorkspace)(host);
39
+ if (!options.project) {
40
+ options.project = (0, config_1.getDefaultAngularAppName)(workspace);
41
+ }
42
+ const project = workspace.projects.get(options.project);
43
+ if (!project || project.extensions.projectType !== 'application') {
44
+ throw new schematics_1.SchematicsException(`Ionic Add requires a project type of "application".`);
45
+ }
46
+ return (0, schematics_1.chain)([addCordovaBuilder(options.project)]);
47
+ };
48
+ }
@@ -0,0 +1,3 @@
1
+ export interface Schema {
2
+ project?: string;
3
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "ionicNgAdd",
4
+ "title": "Ionic Add options",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "The name of the project.",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ }
14
+ },
15
+ "required": []
16
+ }
File without changes
@@ -0,0 +1,89 @@
1
+ // Script injected by @ionic/angular-toolkit to send console logs back
2
+ // to a websocket server so they can be printed to the terminal
3
+ window.Ionic = window.Ionic || {};
4
+ window.Ionic.ConsoleLogServer = {
5
+ start: function (config) {
6
+ var self = this;
7
+
8
+ this.socket = new WebSocket(
9
+ 'ws://' + window.location.hostname + ':' + String(config.wsPort)
10
+ );
11
+ this.msgQueue = [];
12
+
13
+ this.socket.onopen = function () {
14
+ self.socketReady = true;
15
+
16
+ self.socket.onclose = function () {
17
+ self.socketReady = false;
18
+ console.warn('Console log server closed');
19
+ };
20
+ };
21
+
22
+ this.patchConsole();
23
+ },
24
+
25
+ queueMessageSend: function (msg) {
26
+ this.msgQueue.push(msg);
27
+ this.drainMessageQueue();
28
+ },
29
+
30
+ drainMessageQueue: function () {
31
+ var msg;
32
+ while ((msg = this.msgQueue.shift())) {
33
+ if (this.socketReady) {
34
+ try {
35
+ this.socket.send(JSON.stringify(msg));
36
+ } catch (e) {
37
+ if (!(e instanceof TypeError)) {
38
+ console.error('ws error: ' + e);
39
+ }
40
+ }
41
+ }
42
+ }
43
+ },
44
+
45
+ patchConsole: function () {
46
+ var self = this;
47
+
48
+ function _patchConsole(consoleType) {
49
+ console[consoleType] = (function () {
50
+ var orgConsole = console[consoleType];
51
+ return function () {
52
+ orgConsole.apply(console, arguments);
53
+ var msg = {
54
+ category: 'console',
55
+ type: consoleType,
56
+ data: [],
57
+ };
58
+ for (var i = 0; i < arguments.length; i++) {
59
+ msg.data.push(arguments[i]);
60
+ }
61
+ if (msg.data.length) {
62
+ self.queueMessageSend(msg);
63
+ }
64
+ };
65
+ })();
66
+ }
67
+
68
+ // https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-console/#supported-methods
69
+ var consoleFns = [
70
+ 'log',
71
+ 'error',
72
+ 'exception',
73
+ 'warn',
74
+ 'info',
75
+ 'debug',
76
+ 'assert',
77
+ 'dir',
78
+ 'dirxml',
79
+ 'time',
80
+ 'timeEnd',
81
+ 'table',
82
+ ];
83
+ for (var i in consoleFns) {
84
+ _patchConsole(consoleFns[i]);
85
+ }
86
+ },
87
+ };
88
+
89
+ Ionic.ConsoleLogServer.start(Ionic.ConsoleLogServerConfig || {});
@@ -0,0 +1 @@
1
+ // mock cordova.js
package/builders.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "builders": {
3
+ "cordova-build": {
4
+ "implementation": "./cordova-build/index",
5
+ "schema": "./cordova-build/schema.json",
6
+ "description": "Perform a browser build with Cordova assets."
7
+ },
8
+
9
+
10
+ "cordova-serve": {
11
+ "implementation": "./cordova-serve/index",
12
+ "schema": "./cordova-serve/schema.json",
13
+ "description": "Run the dev-server with Cordova assets."
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
+ "schematics": {
4
+ "ng-add": {
5
+ "description": "Add Cordova builders to your project",
6
+ "factory": "./add",
7
+ "schema": "./add/schema.json"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCordova = buildCordova;
4
+ const architect_1 = require("@angular-devkit/architect");
5
+ const utils_1 = require("../utils");
6
+ async function buildCordova(options, context) {
7
+ context.reportStatus(`running cordova build...`);
8
+ // Get angular browser build target
9
+ const browserTargetSpec = (0, architect_1.targetFromTargetString)(options.browserTarget);
10
+ // Get browser build options
11
+ const browserBuildTargetOptions = await context.getTargetOptions(browserTargetSpec);
12
+ const formattedOptions = (0, utils_1.validateBuilderConfig)(options);
13
+ const newOptions = (0, utils_1.prepareBrowserConfig)(formattedOptions, browserBuildTargetOptions);
14
+ const browserBuild = await context.scheduleTarget(browserTargetSpec, newOptions);
15
+ return browserBuild.result;
16
+ }
17
+ exports.default = (0, architect_1.createBuilder)(buildCordova);
@@ -0,0 +1,10 @@
1
+ export interface CordovaBuildBuilderSchema {
2
+ browserTarget: string;
3
+ platform?: string;
4
+ cordovaBasePath?: string;
5
+ sourceMap?: boolean;
6
+ cordovaAssets?: boolean;
7
+ cordovaMock?: boolean;
8
+ consolelogs?: boolean;
9
+ consolelogsPort?: number;
10
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "title": "Cordova build for Ionic",
3
+ "description": "Options for Cordova build for Ionic.",
4
+ "type": "object",
5
+ "properties": {
6
+ "browserTarget": {
7
+ "type": "string",
8
+ "description": "Target to build."
9
+ },
10
+ "consolelogs": {
11
+ "type": "boolean",
12
+ "description": "Inject script to print console logs to the terminal."
13
+ },
14
+ "consolelogsPort": {
15
+ "type": "number",
16
+ "description": "Port for console log server.",
17
+ "default": 53703
18
+ },
19
+ "platform": {
20
+ "type": "string",
21
+ "description": "Cordova platform to use during build."
22
+ },
23
+ "cordovaBasePath": {
24
+ "type": "string",
25
+ "description": "Path to cordova directory"
26
+ },
27
+ "sourceMap": {
28
+ "type": "boolean",
29
+ "description": "Create source-map file"
30
+ },
31
+ "cordovaAssets": {
32
+ "type": "boolean",
33
+ "description": "Bundle Cordova assets with build",
34
+ "default": true
35
+ },
36
+ "cordovaMock": {
37
+ "type": "boolean",
38
+ "description": "Bundle empty cordova.js with build",
39
+ "default": false
40
+ }
41
+ },
42
+ "additionalProperties": false,
43
+ "required": ["browserTarget"]
44
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.indexHtmlTransformFactory = void 0;
4
+ exports.serveCordova = serveCordova;
5
+ const architect_1 = require("@angular-devkit/architect");
6
+ const build_angular_1 = require("@angular-devkit/build-angular");
7
+ const promises_1 = require("fs/promises");
8
+ const fs_1 = require("fs");
9
+ const glob_1 = require("glob");
10
+ const path_1 = require("path");
11
+ const rxjs_1 = require("rxjs");
12
+ const operators_1 = require("rxjs/operators");
13
+ const utils_1 = require("../utils");
14
+ const append_scripts_1 = require("../utils/append-scripts");
15
+ const log_server_1 = require("./log-server");
16
+ function serveCordova(options, context) {
17
+ const { devServerTarget, port, host, ssl } = options;
18
+ const root = context.workspaceRoot;
19
+ const devServerTargetSpec = (0, architect_1.targetFromTargetString)(devServerTarget);
20
+ async function setup() {
21
+ const devServerTargetOptions = await context.getTargetOptions(devServerTargetSpec);
22
+ const devServerName = await context.getBuilderNameForTarget(devServerTargetSpec);
23
+ devServerTargetOptions.port = port;
24
+ devServerTargetOptions.host = host;
25
+ devServerTargetOptions.ssl = ssl;
26
+ const formattedOptions = await context.validateOptions(devServerTargetOptions, devServerName);
27
+ const formattedAssets = (0, utils_1.prepareServerConfig)(options, root);
28
+ if (options.consolelogs && options.consolelogsPort) {
29
+ await (0, log_server_1.createConsoleLogServer)(host, options.consolelogsPort);
30
+ }
31
+ return { formattedOptions, formattedAssets };
32
+ }
33
+ return (0, rxjs_1.from)(setup()).pipe((0, operators_1.switchMap)(({ formattedOptions, formattedAssets }) => (0, build_angular_1.executeDevServerBuilder)(formattedOptions, context, getTransforms(formattedAssets, context))));
34
+ }
35
+ exports.default = (0, architect_1.createBuilder)(serveCordova);
36
+ // ---------------------------------------------------------------------------
37
+ // esbuild transforms (replaces former webpack-based transforms)
38
+ // ---------------------------------------------------------------------------
39
+ function getTransforms(formattedAssets, context) {
40
+ return {
41
+ /** esbuild plugin that injects Cordova global scripts as entry-point side-effects. */
42
+ buildPlugins: [cordovaScriptsEsbuildPlugin(formattedAssets, context)],
43
+ indexHtml: (0, exports.indexHtmlTransformFactory)(formattedAssets, context),
44
+ };
45
+ }
46
+ /**
47
+ * esbuild plugin that:
48
+ * 1. Copies Cordova platform assets (cordova.js, plugins, etc.) to the output dir.
49
+ * 2. Concatenates global script bundles and writes them as standalone JS files
50
+ * so they can be referenced via <script> tags injected by indexHtmlTransformFactory.
51
+ */
52
+ const cordovaScriptsEsbuildPlugin = (formattedAssets, { workspaceRoot, getProjectMetadata, target }) => ({
53
+ name: 'cordova-assets',
54
+ setup(build) {
55
+ var _a;
56
+ const outdir = (_a = build.initialOptions.outdir) !== null && _a !== void 0 ? _a : (0, path_1.resolve)(workspaceRoot, 'www');
57
+ build.onEnd(async () => {
58
+ // 1. Copy asset patterns (replaces CopyWebpackPlugin)
59
+ await Promise.all(formattedAssets.assetPatterns.map((pattern) => copyAssets(pattern, outdir)));
60
+ // 2. Concatenate global scripts into named bundles (replaces ScriptsWebpackPlugin)
61
+ await Promise.all(formattedAssets.globalScriptsByBundleName.map(({ bundleName, paths }) => concatScripts(paths, (0, path_1.join)(outdir, `${bundleName}.js`))));
62
+ });
63
+ },
64
+ });
65
+ /** Recursively copies files matching `pattern.glob` from `pattern.from` to `outdir/pattern.to`. */
66
+ async function copyAssets(pattern, outdir) {
67
+ const files = await (0, glob_1.glob)(pattern.glob, {
68
+ cwd: pattern.from,
69
+ dot: true,
70
+ nodir: true,
71
+ ignore: pattern.ignore,
72
+ });
73
+ await Promise.all(files.map(async (file) => {
74
+ const src = (0, path_1.join)(pattern.from, file);
75
+ const dest = (0, path_1.join)(outdir, pattern.to, file);
76
+ await (0, promises_1.mkdir)((0, path_1.join)(outdir, pattern.to, file, '..'), { recursive: true });
77
+ await (0, promises_1.copyFile)(src, dest);
78
+ }));
79
+ }
80
+ /** Concatenates multiple JS files into a single output file. */
81
+ async function concatScripts(paths, destPath) {
82
+ await (0, promises_1.mkdir)((0, path_1.join)(destPath, '..'), { recursive: true });
83
+ const out = (0, fs_1.createWriteStream)(destPath, { flags: 'w' });
84
+ for (const src of paths) {
85
+ await new Promise((res, rej) => {
86
+ const rs = (0, fs_1.createReadStream)(src);
87
+ rs.on('error', rej);
88
+ rs.on('end', res);
89
+ rs.pipe(out, { end: false });
90
+ });
91
+ out.write('\n');
92
+ }
93
+ await new Promise((res, rej) => out.end(res));
94
+ }
95
+ // ---------------------------------------------------------------------------
96
+ // Index HTML transform (unchanged in behaviour, no webpack dependency)
97
+ // ---------------------------------------------------------------------------
98
+ const indexHtmlTransformFactory = ({ globalScriptsByBundleName }) => (indexTransform) => {
99
+ const augmentedHtml = (0, append_scripts_1.augmentIndexHtml)(indexTransform, globalScriptsByBundleName);
100
+ return Promise.resolve(augmentedHtml);
101
+ };
102
+ exports.indexHtmlTransformFactory = indexHtmlTransformFactory;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isConsoleLogServerMessage = isConsoleLogServerMessage;
4
+ exports.createConsoleLogServer = createConsoleLogServer;
5
+ const colorette_1 = require("colorette");
6
+ const util = require("util");
7
+ const WebSocket = require("ws");
8
+ function isConsoleLogServerMessage(m) {
9
+ return (m && typeof m.category === 'string' && typeof m.type === 'string' && m.data && typeof m.data.length === 'number');
10
+ }
11
+ async function createConsoleLogServer(host, port) {
12
+ const wss = new WebSocket.Server({ host, port });
13
+ wss.on('connection', (ws) => {
14
+ ws.on('message', (data) => {
15
+ let msg;
16
+ try {
17
+ msg = JSON.parse(data.toString());
18
+ }
19
+ catch (e) {
20
+ process.stderr.write(`Error parsing JSON message from client: "${data}" ${(0, colorette_1.red)(e.stack ? e.stack : e)}\n`);
21
+ return;
22
+ }
23
+ if (!isConsoleLogServerMessage(msg)) {
24
+ const m = util.inspect(msg, { colors: true });
25
+ process.stderr.write(`Bad format in client message: ${m}\n`);
26
+ return;
27
+ }
28
+ if (msg.category === 'console') {
29
+ let status;
30
+ if (msg.type === 'info' || msg.type === 'log') {
31
+ status = colorette_1.reset;
32
+ }
33
+ else if (msg.type === 'error') {
34
+ status = colorette_1.red;
35
+ }
36
+ else if (msg.type === 'warn') {
37
+ status = colorette_1.yellow;
38
+ }
39
+ // pretty print objects and arrays (no newlines for arrays)
40
+ msg.data = msg.data.map((d) => JSON.stringify(d, undefined, (d === null || d === void 0 ? void 0 : d.length) ? '' : ' '));
41
+ if (status) {
42
+ process.stdout.write(`[${status('console.' + msg.type)}]: ${msg.data.join(' ')}\n`);
43
+ }
44
+ else {
45
+ process.stdout.write(`[console]: ${msg.data.join(' ')}\n`);
46
+ }
47
+ }
48
+ });
49
+ ws.on('error', (err) => {
50
+ if (err && err.code !== 'ECONNRESET') {
51
+ process.stderr.write(`There was an error with the logging stream: ${JSON.stringify(err)}\n`);
52
+ }
53
+ });
54
+ });
55
+ wss.on('error', (err) => {
56
+ process.stderr.write(`There was an error with the logging websocket: ${JSON.stringify(err)}\n`);
57
+ });
58
+ return wss;
59
+ }
@@ -0,0 +1,14 @@
1
+ export interface CordovaServeBuilderSchema {
2
+ cordovaBuildTarget: string;
3
+ devServerTarget: string;
4
+ platform?: string;
5
+ port: number;
6
+ host: string;
7
+ ssl: boolean;
8
+ cordovaBasePath?: string;
9
+ sourceMap?: boolean;
10
+ cordovaAssets?: boolean;
11
+ cordovaMock?: boolean;
12
+ consolelogs?: boolean;
13
+ consolelogsPort?: number;
14
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "title": "Cordova serve for Ionic",
3
+ "description": "Options for Cordova serve for Ionic.",
4
+ "type": "object",
5
+ "properties": {
6
+ "cordovaBuildTarget": {
7
+ "type": "string",
8
+ "description": "Target to use for build."
9
+ },
10
+ "consolelogs": {
11
+ "type": "boolean",
12
+ "description": "Print console logs to the terminal."
13
+ },
14
+ "consolelogsPort": {
15
+ "type": "number",
16
+ "description": "Port for console log server.",
17
+ "default": 53703
18
+ },
19
+ "devServerTarget": {
20
+ "type": "string",
21
+ "description": "Target to use for serve."
22
+ },
23
+ "platform": {
24
+ "type": "string",
25
+ "description": "Cordova platform to use during serve."
26
+ },
27
+ "ssl": {
28
+ "type": "boolean",
29
+ "description": "Serve using HTTPS.",
30
+ "default": false
31
+ },
32
+ "port": {
33
+ "type": "number",
34
+ "description": "Port to listen on.",
35
+ "default": 4200
36
+ },
37
+ "host": {
38
+ "type": "string",
39
+ "description": "Host to listen on.",
40
+ "default": "localhost"
41
+ },
42
+ "cordovaBasePath": {
43
+ "type": "string",
44
+ "description": "Path to cordova directory"
45
+ },
46
+ "sourceMap": {
47
+ "type": "boolean",
48
+ "description": "Create source-map file"
49
+ },
50
+ "cordovaAssets": {
51
+ "type": "boolean",
52
+ "description": "Bundle Cordova assets with build",
53
+ "default": true
54
+ },
55
+ "cordovaMock": {
56
+ "type": "boolean",
57
+ "description": "Bundle empty cordova.js with build",
58
+ "default": false
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "required": ["cordovaBuildTarget", "devServerTarget"]
63
+ }
File without changes
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@ionic-hotfix/cordova-builders",
3
+ "version": "13.0.1-testing.2",
4
+ "license": "MIT",
5
+ "description": "Cordova builders for @ionic/angular apps",
6
+ "homepage": "https://ionicframework.com/",
7
+ "author": "Ionic Team <hi@ionicframework.com> (https://ionicframework.com)",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "lint": "true",
11
+ "watch": "tsc -w",
12
+ "prepublishOnly": "npm run build"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/ionic-team/angular-toolkit.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/ionic-team/angular-toolkit/issues"
20
+ },
21
+ "eslintConfig": {
22
+ "extends": [
23
+ "../../package.json"
24
+ ]
25
+ },
26
+ "keywords": [
27
+ "angular",
28
+ "Angular CLI",
29
+ "blueprints",
30
+ "code generation",
31
+ "devkit",
32
+ "schematics",
33
+ "ionic",
34
+ "ionic framework",
35
+ "ionicframework"
36
+ ],
37
+ "dependencies": {
38
+ "@angular-devkit/architect": "^0.2000.0",
39
+ "@angular-devkit/build-angular": "^20.0.0",
40
+ "@angular-devkit/core": "^20.0.0",
41
+ "@angular-devkit/schematics": "^20.0.0",
42
+ "@schematics/angular": "^20.0.0",
43
+ "cheerio": "^1.0.0-rc.10",
44
+ "colorette": "^2.0.16",
45
+ "glob": "^11.0.0",
46
+ "ws": "^8.2.3"
47
+ },
48
+ "devDependencies": {
49
+ "@angular-eslint/builder": "^20.0.0",
50
+ "@angular-eslint/eslint-plugin": "^20.0.0",
51
+ "@types/node": "^18.19 || ^20.11 || ^22.0.0",
52
+ "@types/ws": "^8.5.12",
53
+ "lint-staged": "^15.2.9",
54
+ "typescript": ">=5.5.0 <5.9.0"
55
+ },
56
+ "builders": "./builders.json",
57
+ "schematics": "./collection.json",
58
+ "gitHead": "8da8939534e632afe029eebfeb9970b46e7df9aa"
59
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.augmentIndexHtml = augmentIndexHtml;
4
+ const cheerio_1 = require("cheerio");
5
+ function augmentIndexHtml(indexString, scripts) {
6
+ const $ = (0, cheerio_1.load)(indexString);
7
+ for (const script of scripts) {
8
+ $('html').append(`<script src="${script.bundleName}.js"></script>`);
9
+ }
10
+ const final = $.html();
11
+ return final;
12
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultAngularAppName = getDefaultAngularAppName;
4
+ exports.addArchitectBuilder = addArchitectBuilder;
5
+ exports.readConfig = readConfig;
6
+ exports.writeConfig = writeConfig;
7
+ exports.getAngularAppConfig = getAngularAppConfig;
8
+ const schematics_1 = require("@angular-devkit/schematics");
9
+ const CONFIG_PATH = 'angular.json';
10
+ function getDefaultAngularAppName(config) {
11
+ const projects = config.projects;
12
+ const projectNames = Object.keys(projects);
13
+ for (const projectName of projectNames) {
14
+ const projectConfig = projects[projectName];
15
+ if (isAngularBrowserProject(projectConfig)) {
16
+ return projectName;
17
+ }
18
+ }
19
+ return projectNames[0];
20
+ }
21
+ function addArchitectBuilder(host, projectName, builderName, builderOpts) {
22
+ const config = readConfig(host);
23
+ const appConfig = getAngularAppConfig(config, projectName);
24
+ appConfig.architect[builderName] = builderOpts;
25
+ writeConfig(host, config);
26
+ }
27
+ function readConfig(host) {
28
+ var _a;
29
+ const sourceText = (_a = host.read(CONFIG_PATH)) === null || _a === void 0 ? void 0 : _a.toString('utf-8');
30
+ if (!sourceText) {
31
+ return;
32
+ }
33
+ return JSON.parse(sourceText);
34
+ }
35
+ function writeConfig(host, config) {
36
+ host.overwrite(CONFIG_PATH, JSON.stringify(config, null, 2));
37
+ }
38
+ function isAngularBrowserProject(projectConfig) {
39
+ if (projectConfig.projectType === 'application') {
40
+ const buildConfig = projectConfig.architect.build;
41
+ return buildConfig.builder === '@angular-devkit/build-angular:browser';
42
+ }
43
+ return false;
44
+ }
45
+ function getAngularAppConfig(config, projectName) {
46
+ // eslint-disable-next-line no-prototype-builtins
47
+ if (!config.projects.hasOwnProperty(projectName)) {
48
+ throw new schematics_1.SchematicsException(`Could not find project: ${projectName}`);
49
+ }
50
+ const projectConfig = config.projects[projectName];
51
+ if (isAngularBrowserProject(projectConfig)) {
52
+ return projectConfig;
53
+ }
54
+ if (config.projectType !== 'application') {
55
+ throw new schematics_1.SchematicsException(`Invalid projectType for ${projectName}: ${config.projectType}`);
56
+ }
57
+ else {
58
+ const buildConfig = projectConfig.architect.build;
59
+ throw new schematics_1.SchematicsException(`Invalid builder for ${projectName}: ${buildConfig.builder}`);
60
+ }
61
+ }
package/utils/index.js ADDED
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateBuilderConfig = validateBuilderConfig;
4
+ exports.prepareBrowserConfig = prepareBrowserConfig;
5
+ exports.prepareServerConfig = prepareServerConfig;
6
+ const core_1 = require("@angular-devkit/core");
7
+ const fs_1 = require("fs");
8
+ const path_1 = require("path");
9
+ function validateBuilderConfig(builderOptions) {
10
+ // if we're mocking cordova.js, don't build cordova bundle
11
+ const newOptions = { ...builderOptions };
12
+ if (newOptions.cordovaMock) {
13
+ newOptions.cordovaAssets = true;
14
+ }
15
+ if (builderOptions.cordovaAssets && !builderOptions.platform) {
16
+ throw new Error('The `--platform` option is required with `--cordova-assets`');
17
+ }
18
+ return newOptions;
19
+ }
20
+ function prepareBrowserConfig(options, browserOptions) {
21
+ const optionsStarter = { ...browserOptions };
22
+ const cordovaBasePath = (0, core_1.normalize)(options.cordovaBasePath ? options.cordovaBasePath : '.');
23
+ if (typeof options.sourceMap !== 'undefined') {
24
+ optionsStarter.sourceMap = options.sourceMap;
25
+ }
26
+ if ('outputPath' in options) {
27
+ optionsStarter.outputPath = (0, core_1.join)(cordovaBasePath, (0, core_1.normalize)('www'));
28
+ }
29
+ if ('deleteOutputPath' in options) {
30
+ optionsStarter.deleteOutputPath = false;
31
+ }
32
+ if (!optionsStarter.scripts) {
33
+ optionsStarter.scripts = [];
34
+ }
35
+ if (options.consolelogs) {
36
+ const configPath = (0, core_1.getSystemPath)((0, core_1.join)((0, core_1.normalize)(__dirname), '../assets', (0, core_1.normalize)('consolelog-config.js')));
37
+ (0, fs_1.writeFileSync)(configPath, `window.Ionic = window.Ionic || {}; Ionic.ConsoleLogServerConfig = { wsPort: ${options.consolelogsPort} }`);
38
+ optionsStarter.scripts.push({ input: configPath, bundleName: 'consolelogs' });
39
+ optionsStarter.scripts.push({
40
+ input: (0, core_1.getSystemPath)((0, core_1.join)((0, core_1.normalize)(__dirname), '../assets', (0, core_1.normalize)('consolelogs.js'))),
41
+ bundleName: 'consolelogs',
42
+ });
43
+ }
44
+ if (options.cordovaMock) {
45
+ if (browserOptions.scripts) {
46
+ browserOptions.scripts.push({
47
+ input: (0, core_1.getSystemPath)((0, core_1.join)((0, core_1.normalize)(__dirname), '../assets', (0, core_1.normalize)('cordova.js'))),
48
+ bundleName: 'cordova',
49
+ });
50
+ }
51
+ }
52
+ else if (options.cordovaAssets) {
53
+ const platformWWWPath = (0, core_1.join)(cordovaBasePath, (0, core_1.normalize)(`platforms/${options.platform}/platform_www`));
54
+ if (optionsStarter.assets) {
55
+ optionsStarter.assets.push({
56
+ glob: '**/*',
57
+ input: (0, core_1.getSystemPath)(platformWWWPath),
58
+ output: './',
59
+ });
60
+ }
61
+ if (optionsStarter.scripts) {
62
+ optionsStarter.scripts.push({
63
+ input: (0, core_1.getSystemPath)((0, core_1.join)(platformWWWPath, (0, core_1.normalize)('cordova.js'))),
64
+ bundleName: 'cordova',
65
+ });
66
+ }
67
+ }
68
+ return optionsStarter;
69
+ }
70
+ function normalizeScripts(scripts) {
71
+ return scripts.reduce((prev, curr) => {
72
+ const { bundleName, input } = curr;
73
+ const existing = prev.find((el) => el.bundleName === bundleName);
74
+ if (existing) {
75
+ existing.paths.push(input);
76
+ }
77
+ else {
78
+ prev.push({ bundleName, inject: true, paths: [input] });
79
+ }
80
+ return prev;
81
+ }, []);
82
+ }
83
+ function prepareServerConfig(options, root) {
84
+ const scripts = [];
85
+ const assets = [];
86
+ const cordovaBasePath = (0, core_1.normalize)(options.cordovaBasePath ? options.cordovaBasePath : '.');
87
+ if (options.consolelogs) {
88
+ const configPath = (0, core_1.getSystemPath)((0, core_1.join)((0, core_1.normalize)(__dirname), '../assets', (0, core_1.normalize)('consolelog-config.js')));
89
+ (0, fs_1.writeFileSync)(configPath, `window.Ionic = window.Ionic || {}; Ionic.ConsoleLogServerConfig = { wsPort: ${options.consolelogsPort} }`);
90
+ scripts.push({ input: configPath, bundleName: 'consolelogs' });
91
+ scripts.push({
92
+ input: (0, core_1.getSystemPath)((0, core_1.join)((0, core_1.normalize)(__dirname), '../assets', (0, core_1.normalize)('consolelogs.js'))),
93
+ bundleName: 'consolelogs',
94
+ });
95
+ }
96
+ if (options.cordovaMock) {
97
+ scripts.push({
98
+ input: (0, core_1.getSystemPath)((0, core_1.join)((0, core_1.normalize)(__dirname), '../assets', (0, core_1.normalize)('cordova.js'))),
99
+ bundleName: 'cordova',
100
+ });
101
+ }
102
+ else if (options.cordovaAssets) {
103
+ const platformWWWPath = (0, core_1.join)(cordovaBasePath, (0, core_1.normalize)(`platforms/${options.platform}/platform_www`));
104
+ assets.push({ glob: '**/*', input: (0, core_1.getSystemPath)(platformWWWPath), output: './' });
105
+ scripts.push({
106
+ input: (0, core_1.getSystemPath)((0, core_1.join)(platformWWWPath, (0, core_1.normalize)('cordova.js'))),
107
+ bundleName: 'cordova',
108
+ });
109
+ }
110
+ // Resolve script paths relative to workspace root
111
+ const resolvedScripts = scripts.map(({ input, bundleName }) => ({
112
+ input: (0, path_1.resolve)(root, input),
113
+ bundleName,
114
+ }));
115
+ const globalScriptsByBundleName = normalizeScripts(resolvedScripts);
116
+ // Build esbuild-compatible asset patterns (no CopyWebpackPlugin dependency)
117
+ const assetPatterns = assets.map((asset) => {
118
+ var _a, _b;
119
+ let input = (0, path_1.resolve)(root, asset.input).replace(/\\/g, '/');
120
+ input = input.endsWith('/') ? input : input + '/';
121
+ let output = ((_a = asset.output) !== null && _a !== void 0 ? _a : '').replace(/\\/g, '/');
122
+ output = output.endsWith('/') ? output : output + '/';
123
+ const extraIgnore = ((_b = asset.ignore) !== null && _b !== void 0 ? _b : []).map((i) => path_1.posix.join(input, i));
124
+ return {
125
+ from: input,
126
+ to: output.replace(/^\//, ''),
127
+ glob: asset.glob,
128
+ ignore: ['.gitkeep', '**/.DS_Store', '**/Thumbs.db', ...extraIgnore],
129
+ };
130
+ });
131
+ return { globalScriptsByBundleName, assetPatterns };
132
+ }