179 Commits

Author SHA1 Message Date
Charles Lyding
7992218a9c fix(@schematics/angular): remove declaration and sourceMap from default tsconfig
The `declaration` TypeScript option has been removed from the default generated
`tsconfig` for new projects. This option was explicitly set to `false`. However,
the default value for the option is already `false`.
Also, the `sourceMap` option has been removed. Source map generation is controlled
by the build options and not the TypeScript configuration.
2024-08-20 23:57:15 +02:00
cexbrayat
4da922e4f4 feat(@schematics/angular): use isolatedModules in generated project
As 3acb7768317bb05a9cd73fa64e081b5ca0326189 introduced an optimization for projects that use `isolatedModules`,
this commit makes projects generated with `ng new` use this option by default.
2024-07-08 15:52:04 +02:00
Ash Ramirez
434a3740f0 refactor(@angular/cli): update aio links -> adev links
Updates for all angular.io links to the new angular.dev domain. Additionally, adjustment to new resources where the equivalent does not exist on the new site (e.g. Tour of Heroes tutorial)
2024-06-06 11:12:06 +02:00
David LJ
0fa7e91231 docs: update tsconfig template link aio->adev 2024-06-05 09:31:34 -07:00
Charles Lyding
22e05dcb4a fix(@schematics/angular): generate new projects with ECMAScript standard class field behavior
Newly generated projects will now use ECMAScript standard class field behavior by default.
If the legacy TypeScript behavior is required for a new project the `useDefineForClassFields`
TypeScript option can be set to `false` within the application's `tsconfig`. This should
be uncommon, and if needed, it is recommended to adjust code to match standard behavior where
possible.
2024-05-31 15:24:59 -04:00
cexbrayat
d6af99601b fix(@schematics/angular): use angular.dev in readme 2024-05-23 09:24:11 -04:00
Naji
f9dc761817 refactor(@schematics/angular): link for ignoring files
updates the broken link for `.gitignore` file
2024-05-06 10:29:35 +02:00
Alan Agius
865592e4a2 refactor: remove forceConsistentCasingInFileNames from tsconfig files
This option is enabled by default and hence it does not need to be specified.

See: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames
2024-03-14 15:11:30 +01:00
Charles Lyding
f452589e2c feat(@schematics/angular): use TypeScript bundler module resolution for new projects
The `bundler` TypeScript resolution mode is now the default for all newly created
Angular CLI projects. This mode allows TypeScript to read and use any package.json
`exports` and `imports` fields found within packages including the Angular workspace.
Unlike the `node16` option value, this value does not require the use of file extensions
for each import and does not require modification of all existing application code to
use. The TypeScript language service also benefits from this option by allowing import
auto-discovery to leverage any `exports` defined for a package. This is particularly
useful for packages such as `@angular/material` which makes extensive use of secondary
package exports.

Additional information regarding this resolution mode can be found here:
https://www.typescriptlang.org/tsconfig#moduleResolution
2024-03-13 14:53:32 -04:00
Alan Agius
03e1aa7904 feat(@schematics/angular): add support to bun package manager
This commit adds support to use `bun` as a package manager.

Closes #26837
2024-01-25 18:02:35 +01:00
Alan Agius
e2f92ab957 fix(@schematics/angular): enable TypeScript skipLibCheck in new workspace
This commit enables `skipLibCheck` in new workspaces which is now recommanded by TypeScript.  When enabled, type checking of declaration files is skipped as rather than doing a full check of all `d.ts` files, TypeScript will type check the code you specifically refer to in your app’s source code.

See: https://www.typescriptlang.org/tsconfig#skipLibCheck
2023-12-01 17:57:57 -08:00
Alan Agius
c7b7e593db fix(@schematics/angular): remove downlevelIteration from tsconfig.json for new workspaces
We no longer need `downlevelIteration` as ES5 is output is no longer supported by the CLI.
2023-11-13 08:28:43 +01:00
Charles Lyding
00872eaa0a fix(@schematics/angular): enable TypeScript esModuleInterop by default for ESM compliance
The `esModuleInterop` TypeScript option is a TypeScript recommended option that ensures that TypeScript
emits compliant ESM code when transforming namespace and default imports. This is important for new projects
because they now use the `application` builder which emits full ESM code. Not using this option with certain
third-party packages (e.g., `moment`) can result in build warnings and the potential for runtime failure. For existing
applications that are considering migrating, information pertaining to this situation will be available within
the documentation.

Since the `allowSyntheticDefaultImports` is implied and automatically enabled when `esModuleInterop` is enabled,
the previous option has been replaced with this one.

Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
2023-10-27 09:29:13 -07:00
Alan Agius
419b5c1917 fix(@schematics/angular): remove baseUrl from tsconfig.json
The `baseUrl` is no longer needed since NGCC has been removed. This also enables better auto-import suggestions.

Closes #18834
2023-10-02 15:30:29 +02:00
Alan Agius
a23a1acabe fix(@schematics/angular): update @angular/cli version specifier to use ^
This is to match all other Angular framework and Angular devkit dependencies
2023-09-22 19:56:18 +02:00
Alan Agius
3f8aa9d8c7 feat(@schematics/angular): update ng new to use the esbuild application builder based builder
This commit updates the `ng generate application` to use the esbuild `application` builder. This also updates the schematics to support both `browser` and `application` builders.

BREAKING CHANGE: `rootModuleClassName`, `rootModuleFileName` and `main` options have been removed from the public `pwa` and `app-shell` schematics.
2023-09-13 17:40:50 +02:00
Alan Agius
f50dc01a53 fix(@schematics/angular): replace vscode launch type from pwa-chrome to chrome
The former is deprecated.
2023-04-25 15:20:00 +00:00
Alan Agius
207358afb8 feat(@angular-devkit/schematics): add runSchematic and runExternalSchematic methods
These async methods are a replacement for the Observable based `runSchematicAsync` and `runExternalSchematicAsync` methods.

DEPRECATED:
The Observable based `SchematicTestRunner.runSchematicAsync` and `SchematicTestRunner.runExternalSchematicAsync` method have been deprecated in favor of the Promise based `SchematicTestRunner.runSchematic` and `SchematicTestRunner.runExternalSchematic`.
2022-12-08 14:49:43 -08:00
Alan Agius
639a3071c3 refactor: migrate analytics collector to use GA4
This change updates the analytics collector collector to use GA4 instead of UA. The motivation behind this change is that UA will stop collecting data in 2023.

BREAKING CHANGE:

`analyticsSharing` option in the global angular configuration has been
removed without replacement. This option was used to configure the Angular CLI to  access to your own users' CLI usage data.

If this option is used, it can be removed using `ng config --global cli.analyticsSharing undefined`.
2022-10-11 18:52:30 +02:00
Alan Agius
1e5d4a7508 feat(@angular-devkit/build-angular): use Browserslist to determine ECMA output
With this change we reduce the reliance on the TypeScript target compiler option to output a certain ECMA version. Instead we now use the browsers that are configured in the Browserslist configuration to determine which ECMA features and version are needed. This is done by passing the transpiled TypeScript to Babel preset-env.

**Note about useDefineForClassFields**: while setting this to `false` will output JavaScript which is not spec compliant, this is needed because TypeScript introduced class fields many years before it was ratified in TC39. The latest version of the spec have a different runtime behavior to TypeScript’s implementation but the same syntax. Therefore, we opt-out from using upcoming ECMA runtime behavior to better support the ECO system and libraries that depend on the non spec compliant output. One of biggest case is usages of the deprecated `@Effect` decorator by NGRX and potentially other existing code as well which otherwise would cause runtime failures. Dropping `useDefineForClassFields` will be considered in a future major releases. For more information see: https://github.com/microsoft/TypeScript/issues/45995.

BREAKING CHANGE: Internally the Angular CLI now always set the TypeScript `target` to `ES2022` and `useDefineForClassFields` to `false` unless the target is set to `ES2022` or later in the TypeScript configuration. To control ECMA version and features use the Browerslist configuration.
2022-09-21 11:23:35 -04:00
Julien Marcou
7cbbf2f2ba fix(@schematics/angular): remove vscode testing configurations for minimal workspaces
Remove the `ng test` VS Code task and `npm test` VS Code launch configuration from the workspace
when building minimal workspaces.

Fixes #23360
2022-06-15 09:51:36 +02:00
Charles Lyding
291bbffcc9 refactor(@schematics/angular): use string helper re-export from @angular-devkit/schematics
By using the `strings` re-export from `@angular-devkit/schematics` instead of from `@angular-devkit/core`,
the number of imports from `@angular-devkit/core` has been reduced and lowers the direct dependency count
for many of the individual schematics.
2022-04-22 11:31:53 -04:00
Charles Lyding
c927c038ba fix(@schematics/angular): remove @types/node from new projects
The `@types/node` package is now only added if E2E tests (`ng generate e2e`) or universal are added to a project.
2022-03-16 10:09:51 -04:00
Alan Agius
9ddb220c3d docs: replace app with application 2022-03-14 10:03:06 -04:00
Alan Agius
69ecddaa7d feat(@schematics/angular): update new and existing projects compilation target to ES2020
With this change we update the TypeScript compilation target to `ES2020` for both new and existing projects. This is because all browsers that Angular supports (https://angular.io/guide/browser-support) support `ES2020` features without the need for polyfills.
2022-01-28 11:01:09 -08:00
Kasper Christensen
08152f78b2 refactor(@schematics/angular): changed casings and small reorganizing
Removed profiling files

Removed chrome-profiler-events*.json as it's no longer generated.
2022-01-12 10:04:47 -08:00
Alan Agius
d5d9f042f2 feat(@schematics/angular): add VS Code configurations when generating a new workspace
When generating a new workspace we now generate several VS Code configurations.

- extensions: we added config to recommand to use official VS Code extensions.
- launch: added run and debug launch scripts for `ng test` and `ng serve`
- tasks: configured `npm start` and `npm test` to better support the launch scripts

More information about each files can be found
- extensions: https://go.microsoft.com/fwlink/?linkid=827846
- launch: https://go.microsoft.com/fwlink/?linkid=830387
- tasks: https://go.microsoft.com/fwlink/?LinkId=733558

Closes #2672
2021-11-18 06:44:24 +01:00
Alan Agius
21809e14cd feat(@schematics/angular): loosen project name validation
With this change we update the validation of the libraries and application projects names to fully allow characters that make a valid NPM package name. http://json.schemastore.org/package has been used as reference.

We also remove validators that are no longer needed.

Closes #11051
2021-11-16 10:51:10 +00:00
Alan Agius
6cb033e1c7 fix(@angular-devkit/build-angular): update workspace tsconfig lib es2020 2021-10-08 14:40:54 +02:00
Alan Agius
7ff8c5350e feat(@schematics/angular): add /.angular/cache to .gitignore
With this change we add `/.angular/cache` to `.gitignore`. This folder will primary be used to store the build disk cache artifacts.
2021-10-06 08:02:22 -05:00
Alan Agius
3ba13f467c feat(@schematics/angular): add noImplicitOverride and noPropertyAccessFromIndexSignature to workspace tsconfig
With this change, when the workspace is created in strict mode (the default) we add the following  additional tsconfig options;
- [noImplicitOverride](https://www.typescriptlang.org/tsconfig#noImplicitOverride)
- [noPropertyAccessFromIndexSignature](https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature)

Closes #21279
2021-08-09 20:02:19 +02:00
Alan Agius
14df2aaef9 refactor(@schematics/angular): sync schematics dependencies using Renovate
With this change we sync workspace and library schematic dependencies using Renovate. We do this to avoid having to keep these in sync by hand.

We could have used TypeScripts' `resolveJsonModule` to make the `latestVersion` object typesafe. But `ts_library` doesn't support JSON inputs.
2021-07-20 18:58:29 +02:00
Alan Agius
0907b69417 fix(@schematics/angular): use stricter semver for karma-jasmine-html-reporter
This is not the first time, that this package caused a breaking change in a minor version, were it drops support for older `jasmine-core` versions.

Related to #21326
2021-07-12 16:40:12 +01:00
Alan Agius
52034151b2 build: update @types/jasmine and jasmine for new projects 2021-07-09 17:02:52 +01:00
Keen Yee Liau
74be7280ce docs(@schematics/angular): clarify that users need to install ng e2e builder
This commit adds a sentence to clarify that users need to install a `ng e2e`
builder when invoking the command for the first time.
2021-05-14 08:30:04 +02:00
Alan Cohen
ff752951b0 fix(@schematics/angular): remove --prod option from README template
Angular 12 defaults `ng build` to use `--production configuration` (formerly `--prod`)
2021-05-14 07:36:34 +02:00
Charles Lyding
c1512e4274 build: update files to be eslint compliant
All TypeScript files have been updated to pass the new eslint-based linting checks. eslint compatible disabling comments have also been added in place of the previous tslint comments.
2021-05-03 07:31:02 -04:00
Charles Lyding
37a06a7c37 build: format all files
All files are now formatted using the ng-dev tools via prettier.
2021-04-28 16:05:49 -07:00
Joey Perrott
003854257c build: migrate all file header to use Google LLC rather than Google Inc 2021-04-27 08:35:22 +02:00
Santosh Yadav
27bab2a66f fix(@schematics/angular): remove lint command from package.json
Angular 12 does not provide the default linter but CLI adds the ng lint
this PR removes the ng lint from new app created

Fixes #20618
2021-04-25 10:21:16 +02:00
cexbrayat
29cf8125ca fix(@schematics/angular): remove jasmine-spec-reporter and ts-node from default workspace
The dependencies are only needed for protractor tests, so they should only be added by the e2e schematics.
2021-04-22 10:56:36 +02:00
Keen Yee Liau
49ba5e20aa refactor(@schematics/angular): Do not include Protractor test in new project
Do not include Protractor for new projects since we do not have a concrete
plan for Protractor yet.
2021-04-21 12:38:46 -07:00
Keen Yee Liau
5a57fea36b docs(@schematics/angular): add README and update description in schema
Create README for the package, and add missing description in some schema.
2021-04-19 20:34:35 +02:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Alan Agius
84e0231208 feat(@schematics/angular): update jasmine-spec-reporter to version 7 2021-04-12 05:51:39 -04:00
Alan Agius
f22f7e7371 feat(@schematics/angular): update new workspaces to use Karma 6.3 2021-03-24 13:35:25 -04:00
Alan Agius
09daf7a7e0 fix(@schematics/angular): remove leftover workspace tslint config 2021-03-22 09:16:05 -04:00
Alan Agius
617e038a0a build: update jasmine-core to version 3.7.0 2021-03-18 10:43:39 +01:00
Alan Agius
226a8d274d feat(@schematics/angular): remove tslint and codelyzer from new projects
Both of these projects and the tslint builder are deprecated.

Closes #20105 and closes #18465
2021-03-16 15:49:46 +01:00
Alan Agius
81129e12d0 feat(@schematics/angular): update several TypeScript compilation target (Syntax)
With this change we update the TypeScript target of server compilation unit for new projects.

- E2E target has been update from `es2018` to `es2019`
- Browser target has been update from `es2015` to `es2017`
- Server target has been update from `es2016` to `es2019`
2021-03-15 20:31:25 +01:00