@schematics/angular 20.0.0-next.9 → 20.0.0-rc.1

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.
@@ -212,7 +212,6 @@ function addAppToWorkspaceFile(options, appDir, folderName) {
212
212
  builder: workspace_models_1.Builders.BuildApplication,
213
213
  defaultConfiguration: 'production',
214
214
  options: {
215
- index: `${sourceRoot}/index.html`,
216
215
  browser: `${sourceRoot}/main.ts`,
217
216
  polyfills: options.zoneless ? undefined : ['zone.js'],
218
217
  tsConfig: `${projectRoot}tsconfig.app.json`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematics/angular",
3
- "version": "20.0.0-next.9",
3
+ "version": "20.0.0-rc.1",
4
4
  "description": "Schematics specific to Angular",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "keywords": [
@@ -22,17 +22,17 @@
22
22
  },
23
23
  "schematics": "./collection.json",
24
24
  "dependencies": {
25
- "@angular-devkit/core": "20.0.0-next.9",
26
- "@angular-devkit/schematics": "20.0.0-next.9",
25
+ "@angular-devkit/core": "20.0.0-rc.1",
26
+ "@angular-devkit/schematics": "20.0.0-rc.1",
27
27
  "jsonc-parser": "3.3.1"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
31
31
  "url": "https://github.com/angular/angular-cli.git"
32
32
  },
33
- "packageManager": "pnpm@9.15.6",
33
+ "packageManager": "pnpm@9.15.9",
34
34
  "engines": {
35
- "node": "^20.11.1 || >=22.11.0",
35
+ "node": "^20.11.1 || ^22.11.0 || >=24.0.0",
36
36
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
37
37
  "yarn": ">= 1.13.0"
38
38
  },
@@ -120,18 +120,16 @@ function default_1(options) {
120
120
  throw (0, project_targets_1.targetBuildNotFoundError)();
121
121
  }
122
122
  const buildOptions = buildTarget.options;
123
- let browserEntryPoint;
123
+ const browserEntryPoint = await (0, util_1.getMainFilePath)(host, options.project);
124
124
  const ngswConfigPath = (0, core_1.join)((0, core_1.normalize)(project.root), 'ngsw-config.json');
125
125
  if (buildTarget.builder === workspace_models_1.Builders.Application ||
126
126
  buildTarget.builder === workspace_models_1.Builders.BuildApplication) {
127
- browserEntryPoint = buildOptions.browser;
128
127
  const productionConf = buildTarget.configurations?.production;
129
128
  if (productionConf) {
130
129
  productionConf.serviceWorker = ngswConfigPath;
131
130
  }
132
131
  }
133
132
  else {
134
- browserEntryPoint = buildOptions.main;
135
133
  buildOptions.serviceWorker = true;
136
134
  buildOptions.ngswConfigPath = ngswConfigPath;
137
135
  }
@@ -16,7 +16,7 @@ exports.latestVersions = {
16
16
  // As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
17
17
  Angular: '^20.0.0-next.0',
18
18
  NgPackagr: '^20.0.0-next.0',
19
- DevkitBuildAngular: '^20.0.0-next.9',
20
- AngularBuild: '^20.0.0-next.9',
21
- AngularSSR: '^20.0.0-next.9',
19
+ DevkitBuildAngular: '^20.0.0-rc.1',
20
+ AngularBuild: '^20.0.0-rc.1',
21
+ AngularSSR: '^20.0.0-rc.1',
22
22
  };
@@ -17,6 +17,7 @@ exports.applyChangesToFile = applyChangesToFile;
17
17
  exports.isMergeAppConfigCall = isMergeAppConfigCall;
18
18
  exports.findProvidersLiteral = findProvidersLiteral;
19
19
  const schematics_1 = require("@angular-devkit/schematics");
20
+ const posix_1 = require("node:path/posix");
20
21
  const typescript_1 = __importDefault(require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
21
22
  const change_1 = require("../change");
22
23
  const project_targets_1 = require("../project-targets");
@@ -31,14 +32,17 @@ async function getMainFilePath(tree, projectName) {
31
32
  const workspace = await (0, workspace_1.getWorkspace)(tree);
32
33
  const project = workspace.projects.get(projectName);
33
34
  const buildTarget = project?.targets.get('build');
34
- if (!buildTarget) {
35
+ if (!project || !buildTarget) {
35
36
  throw (0, project_targets_1.targetBuildNotFoundError)();
36
37
  }
37
38
  const options = buildTarget.options;
38
- return buildTarget.builder === workspace_models_1.Builders.Application ||
39
- buildTarget.builder === workspace_models_1.Builders.BuildApplication
40
- ? options.browser
41
- : options.main;
39
+ if (buildTarget.builder === workspace_models_1.Builders.Application ||
40
+ buildTarget.builder === workspace_models_1.Builders.BuildApplication) {
41
+ // These builders support a default of `<project_source_root>/main.ts`
42
+ const projectSourceRoot = project.sourceRoot ?? (0, posix_1.join)(project.root, 'src');
43
+ return options.browser ?? (0, posix_1.join)(projectSourceRoot, 'main.ts');
44
+ }
45
+ return options.main;
42
46
  }
43
47
  /**
44
48
  * Gets a TypeScript source file at a specific path.