@angular/cli 19.2.0-next.2 → 19.2.0

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.
@@ -468,6 +468,7 @@
468
468
  "@angular/build:application",
469
469
  "@angular/build:dev-server",
470
470
  "@angular/build:extract-i18n",
471
+ "@angular/build:karma",
471
472
  "@angular/build:ng-packagr",
472
473
  "@angular-devkit/build-angular:application",
473
474
  "@angular-devkit/build-angular:app-shell",
@@ -703,6 +704,28 @@
703
704
  }
704
705
  }
705
706
  },
707
+ {
708
+ "type": "object",
709
+ "additionalProperties": false,
710
+ "properties": {
711
+ "builder": {
712
+ "const": "@angular/build:karma"
713
+ },
714
+ "defaultConfiguration": {
715
+ "type": "string",
716
+ "description": "A default named configuration to use when a target configuration is not provided."
717
+ },
718
+ "options": {
719
+ "$ref": "#/definitions/AngularBuildBuildersKarmaSchema"
720
+ },
721
+ "configurations": {
722
+ "type": "object",
723
+ "additionalProperties": {
724
+ "$ref": "#/definitions/AngularBuildBuildersKarmaSchema"
725
+ }
726
+ }
727
+ }
728
+ },
706
729
  {
707
730
  "type": "object",
708
731
  "additionalProperties": false,
@@ -4132,6 +4155,361 @@
4132
4155
  },
4133
4156
  "additionalProperties": false
4134
4157
  },
4158
+ "AngularBuildBuildersKarmaSchema": {
4159
+ "title": "Karma Target",
4160
+ "description": "Karma target options for Build Facade.",
4161
+ "type": "object",
4162
+ "properties": {
4163
+ "main": {
4164
+ "type": "string",
4165
+ "description": "The name of the main entry-point file."
4166
+ },
4167
+ "tsConfig": {
4168
+ "type": "string",
4169
+ "description": "The name of the TypeScript configuration file."
4170
+ },
4171
+ "karmaConfig": {
4172
+ "type": "string",
4173
+ "description": "The name of the Karma configuration file."
4174
+ },
4175
+ "polyfills": {
4176
+ "description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
4177
+ "type": "array",
4178
+ "items": {
4179
+ "type": "string",
4180
+ "uniqueItems": true
4181
+ },
4182
+ "default": []
4183
+ },
4184
+ "assets": {
4185
+ "type": "array",
4186
+ "description": "List of static application assets.",
4187
+ "default": [],
4188
+ "items": {
4189
+ "$ref": "#/definitions/AngularBuildBuildersKarmaSchema/definitions/assetPattern"
4190
+ }
4191
+ },
4192
+ "scripts": {
4193
+ "description": "Global scripts to be included in the build.",
4194
+ "type": "array",
4195
+ "default": [],
4196
+ "items": {
4197
+ "oneOf": [
4198
+ {
4199
+ "type": "object",
4200
+ "properties": {
4201
+ "input": {
4202
+ "type": "string",
4203
+ "description": "The file to include.",
4204
+ "pattern": "\\.[cm]?jsx?$"
4205
+ },
4206
+ "bundleName": {
4207
+ "type": "string",
4208
+ "pattern": "^[\\w\\-.]*$",
4209
+ "description": "The bundle name for this extra entry point."
4210
+ },
4211
+ "inject": {
4212
+ "type": "boolean",
4213
+ "description": "If the bundle will be referenced in the HTML file.",
4214
+ "default": true
4215
+ }
4216
+ },
4217
+ "additionalProperties": false
4218
+ },
4219
+ {
4220
+ "type": "string",
4221
+ "description": "The file to include.",
4222
+ "pattern": "\\.[cm]?jsx?$"
4223
+ }
4224
+ ]
4225
+ }
4226
+ },
4227
+ "styles": {
4228
+ "description": "Global styles to be included in the build.",
4229
+ "type": "array",
4230
+ "default": [],
4231
+ "items": {
4232
+ "oneOf": [
4233
+ {
4234
+ "type": "object",
4235
+ "properties": {
4236
+ "input": {
4237
+ "type": "string",
4238
+ "description": "The file to include.",
4239
+ "pattern": "\\.(?:css|scss|sass|less)$"
4240
+ },
4241
+ "bundleName": {
4242
+ "type": "string",
4243
+ "pattern": "^[\\w\\-.]*$",
4244
+ "description": "The bundle name for this extra entry point."
4245
+ },
4246
+ "inject": {
4247
+ "type": "boolean",
4248
+ "description": "If the bundle will be referenced in the HTML file.",
4249
+ "default": true
4250
+ }
4251
+ },
4252
+ "additionalProperties": false
4253
+ },
4254
+ {
4255
+ "type": "string",
4256
+ "description": "The file to include.",
4257
+ "pattern": "\\.(?:css|scss|sass|less)$"
4258
+ }
4259
+ ]
4260
+ }
4261
+ },
4262
+ "inlineStyleLanguage": {
4263
+ "description": "The stylesheet language to use for the application's inline component styles.",
4264
+ "type": "string",
4265
+ "default": "css",
4266
+ "enum": [
4267
+ "css",
4268
+ "less",
4269
+ "sass",
4270
+ "scss"
4271
+ ]
4272
+ },
4273
+ "stylePreprocessorOptions": {
4274
+ "description": "Options to pass to style preprocessors.",
4275
+ "type": "object",
4276
+ "properties": {
4277
+ "includePaths": {
4278
+ "description": "Paths to include. Paths will be resolved to workspace root.",
4279
+ "type": "array",
4280
+ "items": {
4281
+ "type": "string"
4282
+ },
4283
+ "default": []
4284
+ },
4285
+ "sass": {
4286
+ "description": "Options to pass to the sass preprocessor.",
4287
+ "type": "object",
4288
+ "properties": {
4289
+ "fatalDeprecations": {
4290
+ "description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.",
4291
+ "type": "array",
4292
+ "items": {
4293
+ "type": "string"
4294
+ }
4295
+ },
4296
+ "silenceDeprecations": {
4297
+ "description": " A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.",
4298
+ "type": "array",
4299
+ "items": {
4300
+ "type": "string"
4301
+ }
4302
+ },
4303
+ "futureDeprecations": {
4304
+ "description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.",
4305
+ "type": "array",
4306
+ "items": {
4307
+ "type": "string"
4308
+ }
4309
+ }
4310
+ },
4311
+ "additionalProperties": false
4312
+ }
4313
+ },
4314
+ "additionalProperties": false
4315
+ },
4316
+ "externalDependencies": {
4317
+ "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.",
4318
+ "type": "array",
4319
+ "items": {
4320
+ "type": "string"
4321
+ },
4322
+ "default": []
4323
+ },
4324
+ "loader": {
4325
+ "description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.",
4326
+ "type": "object",
4327
+ "patternProperties": {
4328
+ "^\\.\\S+$": {
4329
+ "enum": [
4330
+ "text",
4331
+ "binary",
4332
+ "file",
4333
+ "empty"
4334
+ ]
4335
+ }
4336
+ }
4337
+ },
4338
+ "define": {
4339
+ "description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced.",
4340
+ "type": "object",
4341
+ "additionalProperties": {
4342
+ "type": "string"
4343
+ }
4344
+ },
4345
+ "include": {
4346
+ "type": "array",
4347
+ "items": {
4348
+ "type": "string"
4349
+ },
4350
+ "default": [
4351
+ "**/*.spec.ts"
4352
+ ],
4353
+ "description": "Globs of files to include, relative to project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead."
4354
+ },
4355
+ "exclude": {
4356
+ "type": "array",
4357
+ "items": {
4358
+ "type": "string"
4359
+ },
4360
+ "default": [],
4361
+ "description": "Globs of files to exclude, relative to the project root."
4362
+ },
4363
+ "sourceMap": {
4364
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
4365
+ "default": true,
4366
+ "oneOf": [
4367
+ {
4368
+ "type": "object",
4369
+ "properties": {
4370
+ "scripts": {
4371
+ "type": "boolean",
4372
+ "description": "Output source maps for all scripts.",
4373
+ "default": true
4374
+ },
4375
+ "styles": {
4376
+ "type": "boolean",
4377
+ "description": "Output source maps for all styles.",
4378
+ "default": true
4379
+ },
4380
+ "vendor": {
4381
+ "type": "boolean",
4382
+ "description": "Resolve vendor packages source maps.",
4383
+ "default": false
4384
+ }
4385
+ },
4386
+ "additionalProperties": false
4387
+ },
4388
+ {
4389
+ "type": "boolean"
4390
+ }
4391
+ ]
4392
+ },
4393
+ "progress": {
4394
+ "type": "boolean",
4395
+ "description": "Log progress to the console while building.",
4396
+ "default": true
4397
+ },
4398
+ "watch": {
4399
+ "type": "boolean",
4400
+ "description": "Run build when files change."
4401
+ },
4402
+ "poll": {
4403
+ "type": "number",
4404
+ "description": "Enable and define the file watching poll time period in milliseconds."
4405
+ },
4406
+ "preserveSymlinks": {
4407
+ "type": "boolean",
4408
+ "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
4409
+ },
4410
+ "browsers": {
4411
+ "description": "Override which browsers tests are run against. Set to `false` to not use any browser.",
4412
+ "oneOf": [
4413
+ {
4414
+ "type": "string",
4415
+ "description": "A comma seperate list of browsers to run tests against."
4416
+ },
4417
+ {
4418
+ "const": false,
4419
+ "type": "boolean",
4420
+ "description": "Does use run tests against a browser."
4421
+ }
4422
+ ]
4423
+ },
4424
+ "codeCoverage": {
4425
+ "type": "boolean",
4426
+ "description": "Output a code coverage report.",
4427
+ "default": false
4428
+ },
4429
+ "codeCoverageExclude": {
4430
+ "type": "array",
4431
+ "description": "Globs to exclude from code coverage.",
4432
+ "items": {
4433
+ "type": "string"
4434
+ },
4435
+ "default": []
4436
+ },
4437
+ "fileReplacements": {
4438
+ "description": "Replace compilation source files with other compilation source files in the build.",
4439
+ "type": "array",
4440
+ "items": {
4441
+ "$ref": "#/definitions/AngularBuildBuildersKarmaSchema/definitions/fileReplacement"
4442
+ },
4443
+ "default": []
4444
+ },
4445
+ "reporters": {
4446
+ "type": "array",
4447
+ "description": "Karma reporters to use. Directly passed to the karma runner.",
4448
+ "items": {
4449
+ "type": "string"
4450
+ }
4451
+ },
4452
+ "webWorkerTsConfig": {
4453
+ "type": "string",
4454
+ "description": "TypeScript configuration for Web Worker modules."
4455
+ },
4456
+ "aot": {
4457
+ "type": "boolean",
4458
+ "description": "Run tests using Ahead of Time compilation.",
4459
+ "default": false
4460
+ }
4461
+ },
4462
+ "additionalProperties": false,
4463
+ "definitions": {
4464
+ "assetPattern": {
4465
+ "oneOf": [
4466
+ {
4467
+ "type": "object",
4468
+ "properties": {
4469
+ "glob": {
4470
+ "type": "string",
4471
+ "description": "The pattern to match."
4472
+ },
4473
+ "input": {
4474
+ "type": "string",
4475
+ "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
4476
+ },
4477
+ "output": {
4478
+ "type": "string",
4479
+ "default": "",
4480
+ "description": "Absolute path within the output."
4481
+ },
4482
+ "ignore": {
4483
+ "description": "An array of globs to ignore.",
4484
+ "type": "array",
4485
+ "items": {
4486
+ "type": "string"
4487
+ }
4488
+ }
4489
+ },
4490
+ "additionalProperties": false
4491
+ },
4492
+ {
4493
+ "type": "string"
4494
+ }
4495
+ ]
4496
+ },
4497
+ "fileReplacement": {
4498
+ "type": "object",
4499
+ "properties": {
4500
+ "replace": {
4501
+ "type": "string",
4502
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
4503
+ },
4504
+ "with": {
4505
+ "type": "string",
4506
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
4507
+ }
4508
+ },
4509
+ "additionalProperties": false
4510
+ }
4511
+ }
4512
+ },
4135
4513
  "AngularDevkitBuildAngularBuildersKarmaSchema": {
4136
4514
  "title": "Karma Target",
4137
4515
  "description": "Karma target options for Build Facade.",
@@ -4757,6 +5135,11 @@
4757
5135
  "webWorkerTsConfig": {
4758
5136
  "type": "string",
4759
5137
  "description": "TypeScript configuration for Web Worker modules."
5138
+ },
5139
+ "aot": {
5140
+ "type": "boolean",
5141
+ "description": "Run tests using Ahead of Time compilation.",
5142
+ "default": false
4760
5143
  }
4761
5144
  },
4762
5145
  "additionalProperties": false,
package/lib/init.js CHANGED
@@ -42,9 +42,9 @@ var __importStar = (this && this.__importStar) || (function () {
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  require("symbol-observable");
44
44
  // symbol polyfill must go first
45
- const fs_1 = require("fs");
46
- const module_1 = require("module");
47
- const path = __importStar(require("path"));
45
+ const node_fs_1 = require("node:fs");
46
+ const node_module_1 = require("node:module");
47
+ const path = __importStar(require("node:path"));
48
48
  const semver_1 = require("semver");
49
49
  const color_1 = require("../src/utilities/color");
50
50
  const config_1 = require("../src/utilities/config");
@@ -81,7 +81,7 @@ let forceExit = false;
81
81
  try {
82
82
  // No error implies a projectLocalCli, which will load whatever
83
83
  // version of ng-cli you have installed in a local package.json
84
- const cwdRequire = (0, module_1.createRequire)(process.cwd() + '/');
84
+ const cwdRequire = (0, node_module_1.createRequire)(process.cwd() + '/');
85
85
  const projectLocalCli = cwdRequire.resolve('@angular/cli');
86
86
  cli = await Promise.resolve(`${projectLocalCli}`).then(s => __importStar(require(s)));
87
87
  const globalVersion = new semver_1.SemVer(version_1.VERSION.full);
@@ -89,7 +89,7 @@ let forceExit = false;
89
89
  let localVersion = cli.VERSION?.full;
90
90
  if (!localVersion) {
91
91
  try {
92
- const localPackageJson = await fs_1.promises.readFile(path.join(path.dirname(projectLocalCli), '../../package.json'), 'utf-8');
92
+ const localPackageJson = await node_fs_1.promises.readFile(path.join(path.dirname(projectLocalCli), '../../package.json'), 'utf-8');
93
93
  localVersion = JSON.parse(localPackageJson).version;
94
94
  }
95
95
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "19.2.0-next.2",
3
+ "version": "19.2.0",
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.1902.0-next.2",
29
- "@angular-devkit/core": "19.2.0-next.2",
30
- "@angular-devkit/schematics": "19.2.0-next.2",
31
- "@inquirer/prompts": "7.3.1",
28
+ "@angular-devkit/architect": "0.1902.0",
29
+ "@angular-devkit/core": "19.2.0",
30
+ "@angular-devkit/schematics": "19.2.0",
31
+ "@inquirer/prompts": "7.3.2",
32
32
  "@listr2/prompt-adapter-inquirer": "2.0.18",
33
- "@schematics/angular": "19.2.0-next.2",
33
+ "@schematics/angular": "19.2.0",
34
34
  "@yarnpkg/lockfile": "1.1.0",
35
35
  "ini": "5.0.0",
36
36
  "jsonc-parser": "3.3.1",
@@ -46,14 +46,14 @@
46
46
  "ng-update": {
47
47
  "migrations": "@schematics/angular/migrations/migration-collection.json",
48
48
  "packageGroup": {
49
- "@angular/cli": "19.2.0-next.2",
50
- "@angular/build": "19.2.0-next.2",
51
- "@angular/ssr": "19.2.0-next.2",
52
- "@angular-devkit/architect": "0.1902.0-next.2",
53
- "@angular-devkit/build-angular": "19.2.0-next.2",
54
- "@angular-devkit/build-webpack": "0.1902.0-next.2",
55
- "@angular-devkit/core": "19.2.0-next.2",
56
- "@angular-devkit/schematics": "19.2.0-next.2"
49
+ "@angular/cli": "19.2.0",
50
+ "@angular/build": "19.2.0",
51
+ "@angular/ssr": "19.2.0",
52
+ "@angular-devkit/architect": "0.1902.0",
53
+ "@angular-devkit/build-angular": "19.2.0",
54
+ "@angular-devkit/build-webpack": "0.1902.0",
55
+ "@angular-devkit/core": "19.2.0",
56
+ "@angular-devkit/schematics": "19.2.0"
57
57
  }
58
58
  },
59
59
  "engines": {
@@ -41,10 +41,10 @@ var __importStar = (this && this.__importStar) || (function () {
41
41
  })();
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.AnalyticsCollector = void 0;
44
- const crypto_1 = require("crypto");
45
- const https = __importStar(require("https"));
46
- const os = __importStar(require("os"));
47
- const querystring = __importStar(require("querystring"));
44
+ const node_crypto_1 = require("node:crypto");
45
+ const https = __importStar(require("node:https"));
46
+ const os = __importStar(require("node:os"));
47
+ const querystring = __importStar(require("node:querystring"));
48
48
  const semver = __importStar(require("semver"));
49
49
  const environment_options_1 = require("../utilities/environment-options");
50
50
  const error_1 = require("../utilities/error");
@@ -67,7 +67,7 @@ class AnalyticsCollector {
67
67
  ? TRACKING_ID_PROD
68
68
  : TRACKING_ID_STAGING,
69
69
  // Built-in user properties
70
- [analytics_parameters_1.RequestParameter.SessionId]: (0, crypto_1.randomUUID)(),
70
+ [analytics_parameters_1.RequestParameter.SessionId]: (0, node_crypto_1.randomUUID)(),
71
71
  [analytics_parameters_1.RequestParameter.UserAgentArchitecture]: os.arch(),
72
72
  [analytics_parameters_1.RequestParameter.UserAgentPlatform]: os.platform(),
73
73
  [analytics_parameters_1.RequestParameter.UserAgentPlatformVersion]: os.release(),
@@ -14,7 +14,7 @@ exports.promptAnalytics = promptAnalytics;
14
14
  exports.getAnalyticsUserId = getAnalyticsUserId;
15
15
  exports.getAnalyticsInfoString = getAnalyticsInfoString;
16
16
  const core_1 = require("@angular-devkit/core");
17
- const crypto_1 = require("crypto");
17
+ const node_crypto_1 = require("node:crypto");
18
18
  const color_1 = require("../utilities/color");
19
19
  const config_1 = require("../utilities/config");
20
20
  const environment_options_1 = require("../utilities/environment-options");
@@ -55,7 +55,7 @@ async function setAnalyticsConfig(global, value) {
55
55
  if (!workspace || !core_1.json.isJsonObject(cli)) {
56
56
  throw new Error(`Invalid config found at ${workspace.filePath}. CLI should be an object.`);
57
57
  }
58
- cli.analytics = value === true ? (0, crypto_1.randomUUID)() : value;
58
+ cli.analytics = value === true ? (0, node_crypto_1.randomUUID)() : value;
59
59
  await workspace.save();
60
60
  }
61
61
  /**
@@ -79,8 +79,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
79
79
  Object.defineProperty(exports, "__esModule", { value: true });
80
80
  exports.CommandModuleError = exports.CommandModule = exports.CommandScope = void 0;
81
81
  const core_1 = require("@angular-devkit/core");
82
- const fs_1 = require("fs");
83
- const path = __importStar(require("path"));
82
+ const node_fs_1 = require("node:fs");
83
+ const path = __importStar(require("node:path"));
84
84
  const yargs_1 = __importDefault(require("yargs"));
85
85
  const helpers_1 = require("yargs/helpers");
86
86
  const analytics_1 = require("../analytics/analytics");
@@ -131,7 +131,7 @@ let CommandModule = (() => {
131
131
  longDescriptionRelativePath: path
132
132
  .relative(path.join(__dirname, '../../../../'), this.longDescriptionPath)
133
133
  .replace(/\\/g, path.posix.sep),
134
- longDescription: (0, fs_1.readFileSync)(this.longDescriptionPath, 'utf8').replace(/\r\n/g, '\n'),
134
+ longDescription: (0, node_fs_1.readFileSync)(this.longDescriptionPath, 'utf8').replace(/\r\n/g, '\n'),
135
135
  }
136
136
  : {}),
137
137
  };
@@ -78,7 +78,7 @@ exports.SchematicsCommandModule = exports.DEFAULT_SCHEMATICS_COLLECTION = void 0
78
78
  const core_1 = require("@angular-devkit/core");
79
79
  const schematics_1 = require("@angular-devkit/schematics");
80
80
  const tools_1 = require("@angular-devkit/schematics/tools");
81
- const path_1 = require("path");
81
+ const node_path_1 = require("node:path");
82
82
  const analytics_1 = require("../analytics/analytics");
83
83
  const analytics_parameters_1 = require("../analytics/analytics-parameters");
84
84
  const config_1 = require("../utilities/config");
@@ -176,7 +176,7 @@ let SchematicsCommandModule = (() => {
176
176
  workflow.registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
177
177
  workflow.registry.useXDeprecatedProvider((msg) => logger.warn(msg));
178
178
  workflow.registry.addSmartDefaultProvider('projectName', () => this.getProjectName());
179
- const workingDir = (0, core_1.normalize)((0, path_1.relative)(this.context.root, process.cwd()));
179
+ const workingDir = (0, core_1.normalize)((0, node_path_1.relative)(this.context.root, process.cwd()));
180
180
  workflow.registry.addSmartDefaultProvider('workingDirectory', () => workingDir === '' ? undefined : workingDir);
181
181
  let shouldReportAnalytics = true;
182
182
  workflow.engineHost.registerOptionsTransform(async (schematic, options) => {
@@ -286,17 +286,13 @@ let SchematicsCommandModule = (() => {
286
286
  return workflow;
287
287
  }
288
288
  async getSchematicCollections() {
289
- // Resolve relative collections from the location of `angular.json`
290
- const resolveRelativeCollection = (collectionName) => collectionName.charAt(0) === '.'
291
- ? (0, path_1.resolve)(this.context.root, collectionName)
292
- : collectionName;
293
289
  const getSchematicCollections = (configSection) => {
294
290
  if (!configSection) {
295
291
  return undefined;
296
292
  }
297
293
  const { schematicCollections } = configSection;
298
294
  if (Array.isArray(schematicCollections)) {
299
- return new Set(schematicCollections.map((c) => resolveRelativeCollection(c)));
295
+ return new Set(schematicCollections);
300
296
  }
301
297
  return undefined;
302
298
  };
@@ -379,6 +375,10 @@ let SchematicsCommandModule = (() => {
379
375
  }
380
376
  getResolvePaths(collectionName) {
381
377
  const { workspace, root } = this.context;
378
+ if (collectionName[0] === '.') {
379
+ // Resolve relative collections from the location of `angular.json`
380
+ return [root];
381
+ }
382
382
  return workspace
383
383
  ? // Workspace
384
384
  collectionName === exports.DEFAULT_SCHEMATICS_COLLECTION
@@ -10,11 +10,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.SchematicEngineHost = void 0;
11
11
  const schematics_1 = require("@angular-devkit/schematics");
12
12
  const tools_1 = require("@angular-devkit/schematics/tools");
13
- const fs_1 = require("fs");
14
13
  const jsonc_parser_1 = require("jsonc-parser");
15
- const module_1 = require("module");
16
- const path_1 = require("path");
17
- const vm_1 = require("vm");
14
+ const node_fs_1 = require("node:fs");
15
+ const node_module_1 = require("node:module");
16
+ const node_path_1 = require("node:path");
17
+ const node_vm_1 = require("node:vm");
18
18
  const error_1 = require("../../utilities/error");
19
19
  /**
20
20
  * Environment variable to control schematic package redirection
@@ -57,11 +57,11 @@ class SchematicEngineHost extends tools_1.NodeModulesEngineHost {
57
57
  _resolveReferenceString(refString, parentPath, collectionDescription) {
58
58
  const [path, name] = refString.split('#', 2);
59
59
  // Mimic behavior of ExportStringRef class used in default behavior
60
- const fullPath = path[0] === '.' ? (0, path_1.resolve)(parentPath ?? process.cwd(), path) : path;
61
- const referenceRequire = (0, module_1.createRequire)(__filename);
60
+ const fullPath = path[0] === '.' ? (0, node_path_1.resolve)(parentPath ?? process.cwd(), path) : path;
61
+ const referenceRequire = (0, node_module_1.createRequire)(__filename);
62
62
  const schematicFile = referenceRequire.resolve(fullPath, { paths: [parentPath] });
63
63
  if (shouldWrapSchematic(schematicFile, !!collectionDescription?.encapsulation)) {
64
- const schematicPath = (0, path_1.dirname)(schematicFile);
64
+ const schematicPath = (0, node_path_1.dirname)(schematicFile);
65
65
  const moduleCache = new Map();
66
66
  const factoryInitializer = wrap(schematicFile, schematicPath, moduleCache, name || 'default');
67
67
  const factory = factoryInitializer();
@@ -106,8 +106,8 @@ const legacyModules = {
106
106
  * @param exportName An optional name of a specific export to return. Otherwise, return all exports.
107
107
  */
108
108
  function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
109
- const hostRequire = (0, module_1.createRequire)(__filename);
110
- const schematicRequire = (0, module_1.createRequire)(schematicFile);
109
+ const hostRequire = (0, node_module_1.createRequire)(__filename);
110
+ const schematicRequire = (0, node_module_1.createRequire)(schematicFile);
111
111
  const customRequire = function (id) {
112
112
  if (legacyModules[id]) {
113
113
  // Provide compatibility modules for older versions of @angular/cdk
@@ -154,7 +154,7 @@ function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
154
154
  if (!/[/\\]node_modules[/\\]@schematics[/\\]angular[/\\]third_party[/\\]/.test(modulePath) &&
155
155
  !modulePath.endsWith('.json')) {
156
156
  // Wrap module and save in cache
157
- const wrappedModule = wrap(modulePath, (0, path_1.dirname)(modulePath), moduleCache)();
157
+ const wrappedModule = wrap(modulePath, (0, node_path_1.dirname)(modulePath), moduleCache)();
158
158
  moduleCache.set(modulePath, wrappedModule);
159
159
  return wrappedModule;
160
160
  }
@@ -163,12 +163,12 @@ function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
163
163
  return schematicRequire(id);
164
164
  };
165
165
  // Setup a wrapper function to capture the module's exports
166
- const schematicCode = (0, fs_1.readFileSync)(schematicFile, 'utf8');
167
- const script = new vm_1.Script(module_1.Module.wrap(schematicCode), {
166
+ const schematicCode = (0, node_fs_1.readFileSync)(schematicFile, 'utf8');
167
+ const script = new node_vm_1.Script(node_module_1.Module.wrap(schematicCode), {
168
168
  filename: schematicFile,
169
169
  lineOffset: 1,
170
170
  });
171
- const schematicModule = new module_1.Module(schematicFile);
171
+ const schematicModule = new node_module_1.Module(schematicFile);
172
172
  const moduleFactory = script.runInThisContext();
173
173
  return () => {
174
174
  moduleFactory(schematicModule.exports, customRequire, schematicModule, schematicFile, schematicDirectory);