@schematics/angular 20.0.0-next.5 → 20.0.0-next.6

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.
@@ -3,13 +3,14 @@
3
3
  {
4
4
  "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
5
5
  "compilerOptions": {
6
+ "composite": true,
6
7
  "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/app",
7
8
  "types": []
8
9
  },
9
- "files": [
10
- "src/main.ts"
11
- ],
12
10
  "include": [
13
- "src/**/*.d.ts"
11
+ "src/**/*.ts"
12
+ ],
13
+ "exclude": [
14
+ "src/**/*.spec.ts"
14
15
  ]
15
16
  }
@@ -3,13 +3,13 @@
3
3
  {
4
4
  "extends": "<%= relativePathToWorkspaceRoot %>/tsconfig.json",
5
5
  "compilerOptions": {
6
+ "composite": true,
6
7
  "outDir": "<%= relativePathToWorkspaceRoot %>/out-tsc/spec",
7
8
  "types": [
8
9
  "jasmine"
9
10
  ]
10
11
  },
11
12
  "include": [
12
- "src/**/*.spec.ts",
13
- "src/**/*.d.ts"
13
+ "src/**/*.ts"
14
14
  ]
15
15
  }
@@ -12,16 +12,33 @@ const core_1 = require("@angular-devkit/core");
12
12
  const schematics_1 = require("@angular-devkit/schematics");
13
13
  const tasks_1 = require("@angular-devkit/schematics/tasks");
14
14
  const dependencies_1 = require("../utility/dependencies");
15
+ const json_file_1 = require("../utility/json-file");
15
16
  const latest_versions_1 = require("../utility/latest-versions");
16
17
  const paths_1 = require("../utility/paths");
17
18
  const workspace_1 = require("../utility/workspace");
18
19
  const workspace_models_1 = require("../utility/workspace-models");
19
20
  const schema_1 = require("./schema");
21
+ function addTsProjectReference(...paths) {
22
+ return (host) => {
23
+ if (!host.exists('tsconfig.json')) {
24
+ return host;
25
+ }
26
+ const newReferences = paths.map((path) => ({ path }));
27
+ const file = new json_file_1.JSONFile(host, 'tsconfig.json');
28
+ const jsonPath = ['references'];
29
+ const value = file.get(jsonPath);
30
+ file.modify(jsonPath, Array.isArray(value) ? [...value, ...newReferences] : newReferences);
31
+ };
32
+ }
20
33
  function default_1(options) {
21
34
  return async (host, context) => {
22
35
  const { appDir, appRootSelector, componentOptions, folderName, sourceDir } = await getAppOptions(host, options);
23
36
  return (0, schematics_1.chain)([
24
37
  addAppToWorkspaceFile(options, appDir, folderName),
38
+ addTsProjectReference((0, core_1.join)((0, core_1.normalize)(appDir), 'tsconfig.app.json')),
39
+ options.skipTests
40
+ ? (0, schematics_1.noop)()
41
+ : addTsProjectReference((0, core_1.join)((0, core_1.normalize)(appDir), 'tsconfig.spec.json')),
25
42
  options.standalone
26
43
  ? (0, schematics_1.noop)()
27
44
  : (0, schematics_1.schematic)('module', {
@@ -150,6 +150,7 @@ function updateProjects(tree, context) {
150
150
  case workspace_models_1.Builders.Application:
151
151
  case workspace_models_1.Builders.DevServer:
152
152
  case workspace_models_1.Builders.ExtractI18n:
153
+ case workspace_models_1.Builders.Karma:
153
154
  case workspace_models_1.Builders.NgPackagr:
154
155
  // Ignore application, dev server, and i18n extraction for devkit usage check.
155
156
  // Both will be replaced if no other usage is found.
@@ -173,6 +174,13 @@ function updateProjects(tree, context) {
173
174
  case workspace_models_1.Builders.ExtractI18n:
174
175
  target.builder = '@angular/build:extract-i18n';
175
176
  break;
177
+ case workspace_models_1.Builders.Karma:
178
+ target.builder = '@angular/build:karma';
179
+ // Remove "builderMode" option since the builder will always use "application"
180
+ for (const [, karmaOptions] of (0, workspace_1.allTargetOptions)(target)) {
181
+ delete karmaOptions['builderMode'];
182
+ }
183
+ break;
176
184
  case workspace_models_1.Builders.NgPackagr:
177
185
  target.builder = '@angular/build:ng-packagr';
178
186
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematics/angular",
3
- "version": "20.0.0-next.5",
3
+ "version": "20.0.0-next.6",
4
4
  "description": "Schematics specific to Angular",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "keywords": [
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "schematics": "./collection.json",
24
24
  "dependencies": {
25
- "@angular-devkit/core": "20.0.0-next.5",
26
- "@angular-devkit/schematics": "20.0.0-next.5",
25
+ "@angular-devkit/core": "20.0.0-next.6",
26
+ "@angular-devkit/schematics": "20.0.0-next.6",
27
27
  "jsonc-parser": "3.3.1"
28
28
  },
29
29
  "repository": {
package/server/index.js CHANGED
@@ -95,10 +95,6 @@ function updateConfigFileApplicationBuilder(options) {
95
95
  function updateTsConfigFile(tsConfigPath) {
96
96
  return (host) => {
97
97
  const json = new json_file_1.JSONFile(host, tsConfigPath);
98
- const filesPath = ['files'];
99
- const files = new Set(json.get(filesPath) ?? []);
100
- files.add('src/' + serverMainEntryName);
101
- json.modify(filesPath, [...files]);
102
98
  const typePath = ['compilerOptions', 'types'];
103
99
  const types = new Set(json.get(typePath) ?? []);
104
100
  types.add('node');
package/ssr/index.js CHANGED
@@ -107,6 +107,11 @@ function updateApplicationBuilderTsConfigRule(options) {
107
107
  return;
108
108
  }
109
109
  const json = new json_file_1.JSONFile(host, tsConfigPath);
110
+ // Skip adding the files entry if the server entry would already be included
111
+ const include = json.get(['include']);
112
+ if (Array.isArray(include) && include.includes('src/**/*.ts')) {
113
+ return;
114
+ }
110
115
  const filesPath = ['files'];
111
116
  const files = new Set(json.get(filesPath) ?? []);
112
117
  files.add('src/server.ts');
@@ -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.5',
20
- AngularBuild: '^20.0.0-next.5',
21
- AngularSSR: '^20.0.0-next.5',
19
+ DevkitBuildAngular: '^20.0.0-next.6',
20
+ AngularBuild: '^20.0.0-next.6',
21
+ AngularSSR: '^20.0.0-next.6',
22
22
  };
@@ -2,8 +2,7 @@
2
2
  /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
3
  {
4
4
  "compileOnSave": false,
5
- "compilerOptions": {
6
- "outDir": "./dist/out-tsc",<% if (strict) { %>
5
+ "compilerOptions": {<% if (strict) { %>
7
6
  "strict": true,
8
7
  "noImplicitOverride": true,
9
8
  "noPropertyAccessFromIndexSignature": true,
@@ -22,5 +21,6 @@
22
21
  "strictInputAccessModifiers": true,
23
22
  "typeCheckHostBindings": true,
24
23
  "strictTemplates": true<% } %>
25
- }
24
+ },
25
+ "files": []
26
26
  }