@angular/cli 14.0.3 → 14.1.0-next.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/lib/cli/index.js CHANGED
@@ -81,7 +81,7 @@ async function default_1(options) {
81
81
  }
82
82
  catch (e) {
83
83
  logger.fatal(`An unhandled exception occurred: ${err.message}\n` +
84
- `Fatal error writing debug log file: ${e.message}`);
84
+ `Fatal error writing debug log file: ${e}`);
85
85
  if (err.stack) {
86
86
  logger.fatal(err.stack);
87
87
  }
@@ -95,7 +95,7 @@ async function default_1(options) {
95
95
  // Log nothing.
96
96
  }
97
97
  else {
98
- logger.fatal(`An unexpected error occurred: ${'toString' in err ? err.toString() : JSON.stringify(err)}`);
98
+ logger.fatal(`An unexpected error occurred: ${err}`);
99
99
  }
100
100
  return 1;
101
101
  }
@@ -372,6 +372,7 @@
372
372
  "enum": [
373
373
  "@angular-devkit/build-angular:app-shell",
374
374
  "@angular-devkit/build-angular:browser",
375
+ "@angular-devkit/build-angular:browser-esbuild",
375
376
  "@angular-devkit/build-angular:dev-server",
376
377
  "@angular-devkit/build-angular:extract-i18n",
377
378
  "@angular-devkit/build-angular:karma",
@@ -445,6 +446,28 @@
445
446
  }
446
447
  }
447
448
  },
449
+ {
450
+ "type": "object",
451
+ "additionalProperties": false,
452
+ "properties": {
453
+ "builder": {
454
+ "const": "@angular-devkit/build-angular:browser-esbuild"
455
+ },
456
+ "defaultConfiguration": {
457
+ "type": "string",
458
+ "description": "A default named configuration to use when a target configuration is not provided."
459
+ },
460
+ "options": {
461
+ "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserEsbuildSchema"
462
+ },
463
+ "configurations": {
464
+ "type": "object",
465
+ "additionalProperties": {
466
+ "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserEsbuildSchema"
467
+ }
468
+ }
469
+ }
470
+ },
448
471
  {
449
472
  "type": "object",
450
473
  "additionalProperties": false,
@@ -2176,6 +2199,569 @@
2176
2199
  }
2177
2200
  }
2178
2201
  },
2202
+ "AngularDevkitBuildAngularBuildersBrowserEsbuildSchema": {
2203
+ "title": "Esbuild browser schema for Build Facade.",
2204
+ "description": "Browser target options",
2205
+ "type": "object",
2206
+ "properties": {
2207
+ "assets": {
2208
+ "type": "array",
2209
+ "description": "List of static application assets.",
2210
+ "default": [],
2211
+ "items": {
2212
+ "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserEsbuildSchema/definitions/assetPattern"
2213
+ }
2214
+ },
2215
+ "main": {
2216
+ "type": "string",
2217
+ "description": "The full path for the main entry point to the app, relative to the current workspace."
2218
+ },
2219
+ "polyfills": {
2220
+ "type": "string",
2221
+ "description": "The full path for the polyfills file, relative to the current workspace."
2222
+ },
2223
+ "tsConfig": {
2224
+ "type": "string",
2225
+ "description": "The full path for the TypeScript configuration file, relative to the current workspace."
2226
+ },
2227
+ "scripts": {
2228
+ "description": "Global scripts to be included in the build.",
2229
+ "type": "array",
2230
+ "default": [],
2231
+ "items": {
2232
+ "oneOf": [
2233
+ {
2234
+ "type": "object",
2235
+ "properties": {
2236
+ "input": {
2237
+ "type": "string",
2238
+ "description": "The file to include.",
2239
+ "pattern": "\\.[cm]?jsx?$"
2240
+ },
2241
+ "bundleName": {
2242
+ "type": "string",
2243
+ "pattern": "^[\\w\\-.]*$",
2244
+ "description": "The bundle name for this extra entry point."
2245
+ },
2246
+ "inject": {
2247
+ "type": "boolean",
2248
+ "description": "If the bundle will be referenced in the HTML file.",
2249
+ "default": true
2250
+ }
2251
+ },
2252
+ "additionalProperties": false
2253
+ },
2254
+ {
2255
+ "type": "string",
2256
+ "description": "The file to include.",
2257
+ "pattern": "\\.[cm]?jsx?$"
2258
+ }
2259
+ ]
2260
+ }
2261
+ },
2262
+ "styles": {
2263
+ "description": "Global styles to be included in the build.",
2264
+ "type": "array",
2265
+ "default": [],
2266
+ "items": {
2267
+ "oneOf": [
2268
+ {
2269
+ "type": "object",
2270
+ "properties": {
2271
+ "input": {
2272
+ "type": "string",
2273
+ "description": "The file to include.",
2274
+ "pattern": "\\.(?:css|scss|sass|less|styl)$"
2275
+ },
2276
+ "bundleName": {
2277
+ "type": "string",
2278
+ "pattern": "^[\\w\\-.]*$",
2279
+ "description": "The bundle name for this extra entry point."
2280
+ },
2281
+ "inject": {
2282
+ "type": "boolean",
2283
+ "description": "If the bundle will be referenced in the HTML file.",
2284
+ "default": true
2285
+ }
2286
+ },
2287
+ "additionalProperties": false
2288
+ },
2289
+ {
2290
+ "type": "string",
2291
+ "description": "The file to include.",
2292
+ "pattern": "\\.(?:css|scss|sass|less|styl)$"
2293
+ }
2294
+ ]
2295
+ }
2296
+ },
2297
+ "inlineStyleLanguage": {
2298
+ "description": "The stylesheet language to use for the application's inline component styles.",
2299
+ "type": "string",
2300
+ "default": "css",
2301
+ "enum": [
2302
+ "css",
2303
+ "less",
2304
+ "sass",
2305
+ "scss"
2306
+ ]
2307
+ },
2308
+ "stylePreprocessorOptions": {
2309
+ "description": "Options to pass to style preprocessors.",
2310
+ "type": "object",
2311
+ "properties": {
2312
+ "includePaths": {
2313
+ "description": "Paths to include. Paths will be resolved to workspace root.",
2314
+ "type": "array",
2315
+ "items": {
2316
+ "type": "string"
2317
+ },
2318
+ "default": []
2319
+ }
2320
+ },
2321
+ "additionalProperties": false
2322
+ },
2323
+ "externalDependencies": {
2324
+ "description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
2325
+ "type": "array",
2326
+ "items": {
2327
+ "type": "string"
2328
+ },
2329
+ "default": []
2330
+ },
2331
+ "optimization": {
2332
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
2333
+ "x-user-analytics": 16,
2334
+ "default": true,
2335
+ "oneOf": [
2336
+ {
2337
+ "type": "object",
2338
+ "properties": {
2339
+ "scripts": {
2340
+ "type": "boolean",
2341
+ "description": "Enables optimization of the scripts output.",
2342
+ "default": true
2343
+ },
2344
+ "styles": {
2345
+ "description": "Enables optimization of the styles output.",
2346
+ "default": true,
2347
+ "oneOf": [
2348
+ {
2349
+ "type": "object",
2350
+ "properties": {
2351
+ "minify": {
2352
+ "type": "boolean",
2353
+ "description": "Minify CSS definitions by removing extraneous whitespace and comments, merging identifiers and minimizing values.",
2354
+ "default": true
2355
+ },
2356
+ "inlineCritical": {
2357
+ "type": "boolean",
2358
+ "description": "Extract and inline critical CSS definitions to improve first paint time.",
2359
+ "default": true
2360
+ }
2361
+ },
2362
+ "additionalProperties": false
2363
+ },
2364
+ {
2365
+ "type": "boolean"
2366
+ }
2367
+ ]
2368
+ },
2369
+ "fonts": {
2370
+ "description": "Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
2371
+ "default": true,
2372
+ "oneOf": [
2373
+ {
2374
+ "type": "object",
2375
+ "properties": {
2376
+ "inline": {
2377
+ "type": "boolean",
2378
+ "description": "Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS definitions in the application's HTML index file. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
2379
+ "default": true
2380
+ }
2381
+ },
2382
+ "additionalProperties": false
2383
+ },
2384
+ {
2385
+ "type": "boolean"
2386
+ }
2387
+ ]
2388
+ }
2389
+ },
2390
+ "additionalProperties": false
2391
+ },
2392
+ {
2393
+ "type": "boolean"
2394
+ }
2395
+ ]
2396
+ },
2397
+ "fileReplacements": {
2398
+ "description": "Replace compilation source files with other compilation source files in the build.",
2399
+ "type": "array",
2400
+ "items": {
2401
+ "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserEsbuildSchema/definitions/fileReplacement"
2402
+ },
2403
+ "default": []
2404
+ },
2405
+ "outputPath": {
2406
+ "type": "string",
2407
+ "description": "The full path for the new output directory, relative to the current workspace.\nBy default, writes output to a folder named dist/ in the current project."
2408
+ },
2409
+ "resourcesOutputPath": {
2410
+ "type": "string",
2411
+ "description": "The path where style resources will be placed, relative to outputPath."
2412
+ },
2413
+ "aot": {
2414
+ "type": "boolean",
2415
+ "description": "Build using Ahead of Time compilation.",
2416
+ "x-user-analytics": 13,
2417
+ "default": true
2418
+ },
2419
+ "sourceMap": {
2420
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
2421
+ "default": false,
2422
+ "oneOf": [
2423
+ {
2424
+ "type": "object",
2425
+ "properties": {
2426
+ "scripts": {
2427
+ "type": "boolean",
2428
+ "description": "Output source maps for all scripts.",
2429
+ "default": true
2430
+ },
2431
+ "styles": {
2432
+ "type": "boolean",
2433
+ "description": "Output source maps for all styles.",
2434
+ "default": true
2435
+ },
2436
+ "hidden": {
2437
+ "type": "boolean",
2438
+ "description": "Output source maps used for error reporting tools.",
2439
+ "default": false
2440
+ },
2441
+ "vendor": {
2442
+ "type": "boolean",
2443
+ "description": "Resolve vendor packages source maps.",
2444
+ "default": false
2445
+ }
2446
+ },
2447
+ "additionalProperties": false
2448
+ },
2449
+ {
2450
+ "type": "boolean"
2451
+ }
2452
+ ]
2453
+ },
2454
+ "vendorChunk": {
2455
+ "type": "boolean",
2456
+ "description": "Generate a seperate bundle containing only vendor libraries. This option should only used for development.",
2457
+ "default": false
2458
+ },
2459
+ "commonChunk": {
2460
+ "type": "boolean",
2461
+ "description": "Generate a seperate bundle containing code used across multiple bundles.",
2462
+ "default": true
2463
+ },
2464
+ "baseHref": {
2465
+ "type": "string",
2466
+ "description": "Base url for the application being built."
2467
+ },
2468
+ "deployUrl": {
2469
+ "type": "string",
2470
+ "description": "URL where files will be deployed.",
2471
+ "x-deprecated": "Use \"baseHref\" option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
2472
+ },
2473
+ "verbose": {
2474
+ "type": "boolean",
2475
+ "description": "Adds more details to output logging.",
2476
+ "default": false
2477
+ },
2478
+ "progress": {
2479
+ "type": "boolean",
2480
+ "description": "Log progress to the console while building.",
2481
+ "default": true
2482
+ },
2483
+ "i18nMissingTranslation": {
2484
+ "type": "string",
2485
+ "description": "How to handle missing translations for i18n.",
2486
+ "enum": [
2487
+ "warning",
2488
+ "error",
2489
+ "ignore"
2490
+ ],
2491
+ "default": "warning"
2492
+ },
2493
+ "i18nDuplicateTranslation": {
2494
+ "type": "string",
2495
+ "description": "How to handle duplicate translations for i18n.",
2496
+ "enum": [
2497
+ "warning",
2498
+ "error",
2499
+ "ignore"
2500
+ ],
2501
+ "default": "warning"
2502
+ },
2503
+ "localize": {
2504
+ "description": "Translate the bundles in one or more locales.",
2505
+ "oneOf": [
2506
+ {
2507
+ "type": "boolean",
2508
+ "description": "Translate all locales."
2509
+ },
2510
+ {
2511
+ "type": "array",
2512
+ "description": "List of locales ID's to translate.",
2513
+ "minItems": 1,
2514
+ "items": {
2515
+ "type": "string",
2516
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
2517
+ }
2518
+ }
2519
+ ]
2520
+ },
2521
+ "watch": {
2522
+ "type": "boolean",
2523
+ "description": "Run build when files change.",
2524
+ "default": false
2525
+ },
2526
+ "outputHashing": {
2527
+ "type": "string",
2528
+ "description": "Define the output filename cache-busting hashing mode.",
2529
+ "default": "none",
2530
+ "enum": [
2531
+ "none",
2532
+ "all",
2533
+ "media",
2534
+ "bundles"
2535
+ ]
2536
+ },
2537
+ "poll": {
2538
+ "type": "number",
2539
+ "description": "Enable and define the file watching poll time period in milliseconds."
2540
+ },
2541
+ "deleteOutputPath": {
2542
+ "type": "boolean",
2543
+ "description": "Delete the output path before building.",
2544
+ "default": true
2545
+ },
2546
+ "preserveSymlinks": {
2547
+ "type": "boolean",
2548
+ "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
2549
+ },
2550
+ "extractLicenses": {
2551
+ "type": "boolean",
2552
+ "description": "Extract all licenses in a separate file.",
2553
+ "default": true
2554
+ },
2555
+ "buildOptimizer": {
2556
+ "type": "boolean",
2557
+ "description": "Enables advanced build optimizations when using the 'aot' option.",
2558
+ "default": true
2559
+ },
2560
+ "namedChunks": {
2561
+ "type": "boolean",
2562
+ "description": "Use file name for lazy loaded chunks.",
2563
+ "default": false
2564
+ },
2565
+ "subresourceIntegrity": {
2566
+ "type": "boolean",
2567
+ "description": "Enables the use of subresource integrity validation.",
2568
+ "default": false
2569
+ },
2570
+ "serviceWorker": {
2571
+ "type": "boolean",
2572
+ "description": "Generates a service worker config for production builds.",
2573
+ "default": false
2574
+ },
2575
+ "ngswConfigPath": {
2576
+ "type": "string",
2577
+ "description": "Path to ngsw-config.json."
2578
+ },
2579
+ "index": {
2580
+ "description": "Configures the generation of the application's HTML index.",
2581
+ "oneOf": [
2582
+ {
2583
+ "type": "string",
2584
+ "description": "The path of a file to use for the application's HTML index. The filename of the specified path will be used for the generated file and will be created in the root of the application's configured output path."
2585
+ },
2586
+ {
2587
+ "type": "object",
2588
+ "description": "",
2589
+ "properties": {
2590
+ "input": {
2591
+ "type": "string",
2592
+ "minLength": 1,
2593
+ "description": "The path of a file to use for the application's generated HTML index."
2594
+ },
2595
+ "output": {
2596
+ "type": "string",
2597
+ "minLength": 1,
2598
+ "default": "index.html",
2599
+ "description": "The output path of the application's generated HTML index file. The full provided path will be used and will be considered relative to the application's configured output path."
2600
+ }
2601
+ }
2602
+ }
2603
+ ]
2604
+ },
2605
+ "statsJson": {
2606
+ "type": "boolean",
2607
+ "description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.",
2608
+ "default": false
2609
+ },
2610
+ "budgets": {
2611
+ "description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.",
2612
+ "type": "array",
2613
+ "items": {
2614
+ "$ref": "#/definitions/AngularDevkitBuildAngularBuildersBrowserEsbuildSchema/definitions/budget"
2615
+ },
2616
+ "default": []
2617
+ },
2618
+ "webWorkerTsConfig": {
2619
+ "type": "string",
2620
+ "description": "TypeScript configuration for Web Worker modules."
2621
+ },
2622
+ "crossOrigin": {
2623
+ "type": "string",
2624
+ "description": "Define the crossorigin attribute setting of elements that provide CORS support.",
2625
+ "default": "none",
2626
+ "enum": [
2627
+ "none",
2628
+ "anonymous",
2629
+ "use-credentials"
2630
+ ]
2631
+ },
2632
+ "allowedCommonJsDependencies": {
2633
+ "description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
2634
+ "type": "array",
2635
+ "items": {
2636
+ "type": "string"
2637
+ },
2638
+ "default": []
2639
+ }
2640
+ },
2641
+ "additionalProperties": false,
2642
+ "definitions": {
2643
+ "assetPattern": {
2644
+ "oneOf": [
2645
+ {
2646
+ "type": "object",
2647
+ "properties": {
2648
+ "followSymlinks": {
2649
+ "type": "boolean",
2650
+ "default": false,
2651
+ "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
2652
+ },
2653
+ "glob": {
2654
+ "type": "string",
2655
+ "description": "The pattern to match."
2656
+ },
2657
+ "input": {
2658
+ "type": "string",
2659
+ "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
2660
+ },
2661
+ "ignore": {
2662
+ "description": "An array of globs to ignore.",
2663
+ "type": "array",
2664
+ "items": {
2665
+ "type": "string"
2666
+ }
2667
+ },
2668
+ "output": {
2669
+ "type": "string",
2670
+ "description": "Absolute path within the output."
2671
+ }
2672
+ },
2673
+ "additionalProperties": false
2674
+ },
2675
+ {
2676
+ "type": "string"
2677
+ }
2678
+ ]
2679
+ },
2680
+ "fileReplacement": {
2681
+ "oneOf": [
2682
+ {
2683
+ "type": "object",
2684
+ "properties": {
2685
+ "src": {
2686
+ "type": "string",
2687
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
2688
+ },
2689
+ "replaceWith": {
2690
+ "type": "string",
2691
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
2692
+ }
2693
+ },
2694
+ "additionalProperties": false
2695
+ },
2696
+ {
2697
+ "type": "object",
2698
+ "properties": {
2699
+ "replace": {
2700
+ "type": "string",
2701
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
2702
+ },
2703
+ "with": {
2704
+ "type": "string",
2705
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
2706
+ }
2707
+ },
2708
+ "additionalProperties": false
2709
+ }
2710
+ ]
2711
+ },
2712
+ "budget": {
2713
+ "type": "object",
2714
+ "properties": {
2715
+ "type": {
2716
+ "type": "string",
2717
+ "description": "The type of budget.",
2718
+ "enum": [
2719
+ "all",
2720
+ "allScript",
2721
+ "any",
2722
+ "anyScript",
2723
+ "anyComponentStyle",
2724
+ "bundle",
2725
+ "initial"
2726
+ ]
2727
+ },
2728
+ "name": {
2729
+ "type": "string",
2730
+ "description": "The name of the bundle."
2731
+ },
2732
+ "baseline": {
2733
+ "type": "string",
2734
+ "description": "The baseline size for comparison."
2735
+ },
2736
+ "maximumWarning": {
2737
+ "type": "string",
2738
+ "description": "The maximum threshold for warning relative to the baseline."
2739
+ },
2740
+ "maximumError": {
2741
+ "type": "string",
2742
+ "description": "The maximum threshold for error relative to the baseline."
2743
+ },
2744
+ "minimumWarning": {
2745
+ "type": "string",
2746
+ "description": "The minimum threshold for warning relative to the baseline."
2747
+ },
2748
+ "minimumError": {
2749
+ "type": "string",
2750
+ "description": "The minimum threshold for error relative to the baseline."
2751
+ },
2752
+ "warning": {
2753
+ "type": "string",
2754
+ "description": "The threshold for warning relative to the baseline (min & max)."
2755
+ },
2756
+ "error": {
2757
+ "type": "string",
2758
+ "description": "The threshold for error relative to the baseline (min & max)."
2759
+ }
2760
+ },
2761
+ "additionalProperties": false
2762
+ }
2763
+ }
2764
+ },
2179
2765
  "AngularDevkitBuildAngularBuildersDevServerSchema": {
2180
2766
  "title": "Dev Server Target",
2181
2767
  "description": "Dev Server target options for Build Facade.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "14.0.3",
3
+ "version": "14.1.0-next.2",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,12 +25,12 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.1400.3",
29
- "@angular-devkit/core": "14.0.3",
30
- "@angular-devkit/schematics": "14.0.3",
31
- "@schematics/angular": "14.0.3",
28
+ "@angular-devkit/architect": "0.1401.0-next.2",
29
+ "@angular-devkit/core": "14.1.0-next.2",
30
+ "@angular-devkit/schematics": "14.1.0-next.2",
31
+ "@schematics/angular": "14.1.0-next.2",
32
32
  "@yarnpkg/lockfile": "1.1.0",
33
- "ansi-colors": "4.1.1",
33
+ "ansi-colors": "4.1.3",
34
34
  "debug": "4.3.4",
35
35
  "ini": "3.0.0",
36
36
  "inquirer": "8.2.4",
@@ -39,22 +39,22 @@
39
39
  "npm-pick-manifest": "7.0.1",
40
40
  "open": "8.4.0",
41
41
  "ora": "5.4.1",
42
- "pacote": "13.3.0",
42
+ "pacote": "13.6.0",
43
43
  "resolve": "1.22.0",
44
44
  "semver": "7.3.7",
45
45
  "symbol-observable": "4.0.0",
46
46
  "uuid": "8.3.2",
47
- "yargs": "17.4.1"
47
+ "yargs": "17.5.1"
48
48
  },
49
49
  "ng-update": {
50
50
  "migrations": "@schematics/angular/migrations/migration-collection.json",
51
51
  "packageGroup": {
52
- "@angular/cli": "14.0.3",
53
- "@angular-devkit/architect": "0.1400.3",
54
- "@angular-devkit/build-angular": "14.0.3",
55
- "@angular-devkit/build-webpack": "0.1400.3",
56
- "@angular-devkit/core": "14.0.3",
57
- "@angular-devkit/schematics": "14.0.3"
52
+ "@angular/cli": "14.1.0-next.2",
53
+ "@angular-devkit/architect": "0.1401.0-next.2",
54
+ "@angular-devkit/build-angular": "14.1.0-next.2",
55
+ "@angular-devkit/build-webpack": "0.1401.0-next.2",
56
+ "@angular-devkit/core": "14.1.0-next.2",
57
+ "@angular-devkit/schematics": "14.1.0-next.2"
58
58
  }
59
59
  },
60
60
  "engines": {
@@ -40,6 +40,7 @@ const uuid_1 = require("uuid");
40
40
  const color_1 = require("../utilities/color");
41
41
  const config_1 = require("../utilities/config");
42
42
  const environment_options_1 = require("../utilities/environment-options");
43
+ const error_1 = require("../utilities/error");
43
44
  const tty_1 = require("../utilities/tty");
44
45
  const version_1 = require("../utilities/version");
45
46
  const analytics_collector_1 = require("./analytics-collector");
@@ -200,6 +201,7 @@ async function getAnalytics(level) {
200
201
  }
201
202
  }
202
203
  catch (err) {
204
+ (0, error_1.assertIsError)(err);
203
205
  analyticsDebug('Error happened during reading of analytics config: %s', err.message);
204
206
  return undefined;
205
207
  }
@@ -229,6 +231,7 @@ async function getSharedAnalytics() {
229
231
  }
230
232
  }
231
233
  catch (err) {
234
+ (0, error_1.assertIsError)(err);
232
235
  analyticsDebug('Error happened during reading of analytics sharing config: %s', err.message);
233
236
  return undefined;
234
237
  }
@@ -15,6 +15,7 @@ const child_process_1 = require("child_process");
15
15
  const fs_1 = require("fs");
16
16
  const path_1 = require("path");
17
17
  const analytics_1 = require("../analytics/analytics");
18
+ const error_1 = require("../utilities/error");
18
19
  const prompt_1 = require("../utilities/prompt");
19
20
  const tty_1 = require("../utilities/tty");
20
21
  const command_module_1 = require("./command-module");
@@ -32,6 +33,7 @@ class ArchitectBaseCommandModule extends command_module_1.CommandModule {
32
33
  builderName = await architectHost.getBuilderNameForTarget(target);
33
34
  }
34
35
  catch (e) {
36
+ (0, error_1.assertIsError)(e);
35
37
  return this.onMissingTarget(e.message);
36
38
  }
37
39
  await this.reportAnalytics({
@@ -81,6 +83,7 @@ class ArchitectBaseCommandModule extends command_module_1.CommandModule {
81
83
  builderDesc = await architectHost.resolveBuilder(builderConf);
82
84
  }
83
85
  catch (e) {
86
+ (0, error_1.assertIsError)(e);
84
87
  if (e.code === 'MODULE_NOT_FOUND') {
85
88
  this.warnOnMissingNodeModules();
86
89
  throw new command_module_1.CommandModuleError(`Could not find the '${builderConf}' builder's node package.`);
@@ -34,6 +34,7 @@ const cli_18 = require("../commands/update/cli");
34
34
  const cli_19 = require("../commands/version/cli");
35
35
  const color_1 = require("../utilities/color");
36
36
  const config_1 = require("../utilities/config");
37
+ const error_1 = require("../utilities/error");
37
38
  const package_manager_1 = require("../utilities/package-manager");
38
39
  const command_module_1 = require("./command-module");
39
40
  const command_1 = require("./utilities/command");
@@ -78,6 +79,7 @@ async function runCommand(args, logger) {
78
79
  ]);
79
80
  }
80
81
  catch (e) {
82
+ (0, error_1.assertIsError)(e);
81
83
  logger.fatal(e.message);
82
84
  return 1;
83
85
  }
@@ -42,6 +42,7 @@ const schematics_1 = require("@angular-devkit/schematics");
42
42
  const tools_1 = require("@angular-devkit/schematics/tools");
43
43
  const path_1 = require("path");
44
44
  const config_1 = require("../utilities/config");
45
+ const error_1 = require("../utilities/error");
45
46
  const memoize_1 = require("../utilities/memoize");
46
47
  const tty_1 = require("../utilities/tty");
47
48
  const command_module_1 = require("./command-module");
@@ -307,6 +308,7 @@ class SchematicsCommandModule extends command_module_1.CommandModule {
307
308
  logger.fatal('The Schematic workflow failed. See above.');
308
309
  }
309
310
  else {
311
+ (0, error_1.assertIsError)(err);
310
312
  logger.fatal(err.message);
311
313
  }
312
314
  return 1;
@@ -19,6 +19,7 @@ const jsonc_parser_1 = require("jsonc-parser");
19
19
  const module_1 = __importDefault(require("module"));
20
20
  const path_1 = require("path");
21
21
  const vm_1 = require("vm");
22
+ const error_1 = require("../../utilities/error");
22
23
  /**
23
24
  * Environment variable to control schematic package redirection
24
25
  */
@@ -127,6 +128,7 @@ function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
127
128
  return schematicRequire(id);
128
129
  }
129
130
  catch (e) {
131
+ (0, error_1.assertIsError)(e);
130
132
  if (e.code !== 'MODULE_NOT_FOUND') {
131
133
  throw e;
132
134
  }
@@ -20,6 +20,7 @@ const workspace_schema_1 = require("../../../lib/config/workspace-schema");
20
20
  const analytics_1 = require("../../analytics/analytics");
21
21
  const schematics_command_module_1 = require("../../command-builder/schematics-command-module");
22
22
  const color_1 = require("../../utilities/color");
23
+ const error_1 = require("../../utilities/error");
23
24
  const package_metadata_1 = require("../../utilities/package-metadata");
24
25
  const prompt_1 = require("../../utilities/prompt");
25
26
  const spinner_1 = require("../../utilities/spinner");
@@ -90,6 +91,7 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
90
91
  packageIdentifier = (0, npm_package_arg_1.default)(collection);
91
92
  }
92
93
  catch (e) {
94
+ (0, error_1.assertIsError)(e);
93
95
  logger.error(e.message);
94
96
  return 1;
95
97
  }
@@ -120,6 +122,7 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
120
122
  });
121
123
  }
122
124
  catch (e) {
125
+ (0, error_1.assertIsError)(e);
123
126
  spinner.fail(`Unable to load package information from registry: ${e.message}`);
124
127
  return 1;
125
128
  }
@@ -190,6 +193,7 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
190
193
  }
191
194
  }
192
195
  catch (e) {
196
+ (0, error_1.assertIsError)(e);
193
197
  spinner.fail(`Unable to fetch package information for '${packageIdentifier}': ${e.message}`);
194
198
  return 1;
195
199
  }
@@ -266,6 +270,7 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
266
270
  return true;
267
271
  }
268
272
  catch (e) {
273
+ (0, error_1.assertIsError)(e);
269
274
  if (e.code !== 'MODULE_NOT_FOUND') {
270
275
  throw e;
271
276
  }
@@ -17,6 +17,7 @@ const command_module_1 = require("../../command-builder/command-module");
17
17
  const command_1 = require("../../command-builder/utilities/command");
18
18
  const color_1 = require("../../utilities/color");
19
19
  const completion_1 = require("../../utilities/completion");
20
+ const error_1 = require("../../utilities/error");
20
21
  class CompletionCommandModule extends command_module_1.CommandModule {
21
22
  constructor() {
22
23
  super(...arguments);
@@ -33,6 +34,7 @@ class CompletionCommandModule extends command_module_1.CommandModule {
33
34
  rcFile = await (0, completion_1.initializeAutocomplete)();
34
35
  }
35
36
  catch (err) {
37
+ (0, error_1.assertIsError)(err);
36
38
  this.context.logger.error(err.message);
37
39
  return 1;
38
40
  }
@@ -49,6 +49,7 @@ const schematic_engine_host_1 = require("../../command-builder/utilities/schemat
49
49
  const schematic_workflow_1 = require("../../command-builder/utilities/schematic-workflow");
50
50
  const color_1 = require("../../utilities/color");
51
51
  const environment_options_1 = require("../../utilities/environment-options");
52
+ const error_1 = require("../../utilities/error");
52
53
  const log_file_1 = require("../../utilities/log-file");
53
54
  const package_metadata_1 = require("../../utilities/package-metadata");
54
55
  const package_tree_1 = require("../../utilities/package-tree");
@@ -179,6 +180,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
179
180
  packages.push(packageIdentifier);
180
181
  }
181
182
  catch (e) {
183
+ (0, error_1.assertIsError)(e);
182
184
  logger.error(e.message);
183
185
  return 1;
184
186
  }
@@ -231,6 +233,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
231
233
  logger.error(`${color_1.colors.symbols.cross} Migration failed. See above for further details.\n`);
232
234
  }
233
235
  else {
236
+ (0, error_1.assertIsError)(e);
234
237
  const logPath = (0, log_file_1.writeErrorToLogFile)(e);
235
238
  logger.fatal(`${color_1.colors.symbols.cross} Migration failed: ${e.message}\n` +
236
239
  ` See "${logPath}" for further details.\n`);
@@ -367,6 +370,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
367
370
  migrations = require.resolve(migrations, { paths: [packagePath] });
368
371
  }
369
372
  catch (e) {
373
+ (0, error_1.assertIsError)(e);
370
374
  if (e.code === 'MODULE_NOT_FOUND') {
371
375
  logger.error('Migrations for package were not found.');
372
376
  }
@@ -426,6 +430,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
426
430
  });
427
431
  }
428
432
  catch (e) {
433
+ (0, error_1.assertIsError)(e);
429
434
  logger.error(`Error fetching metadata for '${packageName}': ` + e.message);
430
435
  return 1;
431
436
  }
@@ -439,6 +444,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
439
444
  manifest = (0, npm_pick_manifest_1.default)(metadata, requestIdentifier.fetchSpec);
440
445
  }
441
446
  catch (e) {
447
+ (0, error_1.assertIsError)(e);
442
448
  if (e.code === 'ETARGET') {
443
449
  // If not found and next was used and user did not provide a specifier, try latest.
444
450
  // Package may not have a next tag.
@@ -449,6 +455,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
449
455
  manifest = (0, npm_pick_manifest_1.default)(metadata, 'latest');
450
456
  }
451
457
  catch (e) {
458
+ (0, error_1.assertIsError)(e);
452
459
  if (e.code !== 'ETARGET' && e.code !== 'ENOVERSIONS') {
453
460
  throw e;
454
461
  }
@@ -555,6 +562,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
555
562
  }));
556
563
  }
557
564
  catch (e) {
565
+ (0, error_1.assertIsError)(e);
558
566
  if (e.code === 'MODULE_NOT_FOUND') {
559
567
  // Fallback to trying to resolve the package's main entry point
560
568
  packagePath = require.resolve(migration.package, { paths: [this.context.root] });
@@ -565,6 +573,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
565
573
  }
566
574
  }
567
575
  catch (e) {
576
+ (0, error_1.assertIsError)(e);
568
577
  if (e.code === 'MODULE_NOT_FOUND') {
569
578
  logVerbose(e.toString());
570
579
  logger.error(`Migrations for package (${migration.package}) were not found.` +
@@ -588,6 +597,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
588
597
  migrations = require.resolve(migration.collection, { paths: [packagePath] });
589
598
  }
590
599
  catch (e) {
600
+ (0, error_1.assertIsError)(e);
591
601
  if (e.code === 'MODULE_NOT_FOUND') {
592
602
  logger.error(`Migrations for package (${migration.package}) were not found.`);
593
603
  }
@@ -35,6 +35,7 @@ const core_1 = require("@angular-devkit/core");
35
35
  const schematics_1 = require("@angular-devkit/schematics");
36
36
  const npa = __importStar(require("npm-package-arg"));
37
37
  const semver = __importStar(require("semver"));
38
+ const error_1 = require("../../../utilities/error");
38
39
  const package_metadata_1 = require("../../../utilities/package-metadata");
39
40
  // Angular guarantees that a major is compatible with its following major (so packages that depend
40
41
  // on Angular 5 are also compatible with Angular 6). This is, in code, represented by verifying
@@ -199,6 +200,7 @@ function _performUpdate(tree, context, infoMap, logger, migrateOnly) {
199
200
  packageJson = JSON.parse(packageJsonContent.toString());
200
201
  }
201
202
  catch (e) {
203
+ (0, error_1.assertIsError)(e);
202
204
  throw new schematics_1.SchematicsException('package.json could not be parsed: ' + e.message);
203
205
  }
204
206
  const updateDependency = (deps, name, newVersion) => {
@@ -588,6 +590,7 @@ function _getAllDependencies(tree) {
588
590
  packageJson = JSON.parse(packageJsonContent.toString());
589
591
  }
590
592
  catch (e) {
593
+ (0, error_1.assertIsError)(e);
591
594
  throw new schematics_1.SchematicsException('package.json could not be parsed: ' + e.message);
592
595
  }
593
596
  return [
@@ -40,6 +40,7 @@ const color_1 = require("../utilities/color");
40
40
  const config_1 = require("../utilities/config");
41
41
  const environment_options_1 = require("../utilities/environment-options");
42
42
  const tty_1 = require("../utilities/tty");
43
+ const error_1 = require("./error");
43
44
  /**
44
45
  * Checks if it is appropriate to prompt the user to setup autocompletion. If not, does nothing. If
45
46
  * so prompts and sets up autocompletion for the user. Returns an exit code if the program should
@@ -71,6 +72,7 @@ Ok, you won't be prompted again. Should you change your mind, the following comm
71
72
  rcFile = await initializeAutocomplete();
72
73
  }
73
74
  catch (err) {
75
+ (0, error_1.assertIsError)(err);
74
76
  // Failed to set up autocompeletion, log the error and abort.
75
77
  logger.error(err.message);
76
78
  return 1;
@@ -213,6 +215,7 @@ async function initializeAutocomplete() {
213
215
  await fs_1.promises.appendFile(rcFile, '\n\n# Load Angular CLI autocompletion.\nsource <(ng completion script)\n');
214
216
  }
215
217
  catch (err) {
218
+ (0, error_1.assertIsError)(err);
216
219
  throw new Error(`Failed to append autocompletion setup to \`${rcFile}\`:\n${err.message}`);
217
220
  }
218
221
  return rcFile;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export declare function assertIsError(value: unknown): asserts value is Error & {
9
+ code?: string;
10
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.assertIsError = void 0;
14
+ const assert_1 = __importDefault(require("assert"));
15
+ function assertIsError(value) {
16
+ (0, assert_1.default)(value instanceof Error, 'catch clause variable is not an Error instance');
17
+ }
18
+ exports.assertIsError = assertIsError;