134 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Alan Agius
7711e12b8e build: update karma to version 6.2.0 2021-03-11 08:37:42 +01:00
Charles Lyding
d0c3cb1fdc refactor(@schematics/angular): remove unneeded speed-measure-plugin output from gitignore
With the removal of the `speed-measure-plugin` from the build system, the file no longer needs to be ignored by git in new projects.
2021-03-10 08:19:56 -06:00
Alan Agius
1de6d71edd feat(@schematics/angular): production builds by default
With this change we do several changes to the `angular.json` configuration for `build` , `server` and `app-shell` targets so that these are `production` by default.

- build, server and app-shell targets are configured to run production by default.
- We add a new configuration named `development` to run the mentioned builder targets in development. Ex: `ng build --configuration development`.
- When adding `universal` or `app-shell`, we generate the full set of configurations as per the `buiid` target. Previously, we only generated the `production` configuration.
- We added a helper script in `package.json` to run build in watch mode. `npm run watch` which is a shortcut for `ng build --watch --configuration development`
2021-03-10 08:16:38 -06:00
Alan Agius
d19d2ccae5 feat(@schematics/angular): update new project dependencies version
Closes #20106
2021-02-22 15:55:49 +01:00
Alan Agius
d3a36355fb build: update karma to version ~6.1.0 2021-02-03 09:57:21 +01:00
Charles Lyding
eba0973e10 feat(@schematics/angular): create new projects with karma 6.0
Newly generated projects will now use karma 6.0 by default.
2021-01-13 23:12:55 +01:00
Oleksii Potiekhin
99756614aa fix(@schematics/angular): remove unnecessary scripts and dependencies
When new application is generated with --minimal flag it will be
created without any testing frameworks, linters, etc. But package.json
still contains broken scripts and dependencies.

So "test": "ng test", "lint": "ng lint" and "tslint": "~6.1.0",
"ts-node": "~8.3.0" should be removed. By analogy with "e2e": "ng e2e".
2020-12-18 08:31:34 +01:00
Pete Bacon Darwin
0491717704 feat(@schematics/angular): add enableI18nLegacyMessageIdFormat default to new projects
The ViewEngine message extraction generates a variety of legacy formats
for extracted message ids. These formats have a number of issues related
to whitespace handling and reliance upon information inside the original
HTML of a template. The new message format is more resilient to things
like whitespace changes, and can be generated directly from calls to
`$localize`, which allows messages in application code to have the same
id as identical messages in templates.

As a first step in migrating projects away from the legacy id format
for i18n messages, this commit updates newly generated projects to turn
off the legacy ids.

In the future the default will be flipped and this can be removed.
Eventually the legacy message id support will be removed altogether,
probably in sync with removal of ViewEngine.
2020-10-27 15:58:09 -04:00
Alan Agius
b8bc02d14a fix(@schematics/angular): update @types/jasmine to ~3.6.0 2020-10-26 13:29:18 -04:00
Alan Agius
9768230b4d docs: update further help section in readme 2020-10-21 14:15:24 +02:00
Charles Lyding
0bdea8ddea feat(@schematics/angular): generate E2E tests with native promise support
This change adjusts the E2E schematic to generate a protractor configuration with the selenium promise manager disabled.  It also adjusts the generated test files to use native promises and async/await to control test execution.
2020-10-05 19:06:14 -04:00
Alan Agius
ae73e44b2a feat(@schematics/angular): don't generate special package.json and no-any when using --strict
Following feedback from the community, which showed a high number of users found it hard to work with the `no-any` lint rule and also the `sideEffects` package.json file. With DevRel we decided to remove both features when generating a strict workspace and/or application.
2020-09-30 20:56:04 +02:00
Aristeidis Bampakos
a98c71dbf2 refactor(@schematics/angular): Formatting in angular.json
Apply consistent formatting in closing brackets at the end of the `angular.json` file
2020-09-06 16:08:35 +02:00
Keen Yee Liau
8995e49f0b feat(@angular-devkit/build-angular): Switch to karma-coverage
This commit switches coverage tooling from karma-coverage-istanbul-reporter
to karma-coverage since it's better supported.

Closes #17757
2020-09-06 12:22:25 +02:00
Alan Agius
ccfd58b0c2 fix(@schematics/angular): update karma for new workspaces to 5.2.0 2020-09-01 20:22:33 +03:00
Aristeidis Bampakos
c2294182e9 refactor(@schematics/angular): change the order of node types in package.json template
Re-arrange the node types npm package so that devDependencies are sorted in  alphabetical order
2020-08-31 11:57:26 +01:00
Alan Agius
533250112a feat(@schematics/angular): add strictInputAccessModifiers option when using strict mode
Related to https://github.com/angular/angular/issues/38400
2020-08-17 21:20:32 +02:00
timdeschryver
a0e2f28d26 fix(@schematics/angular): don't create e2e script when createApplication is false
Bugfix for the ng new --createApplication=false command.
Currently, it creates an e2e script in package.json. This change will only add the script when the application is created.

Closes #13412
2020-08-14 15:08:34 +02:00
Alan Agius
3730b3cb5c build: update karma-jasmine to version ~4.0.0 2020-08-13 10:13:47 +02:00
Alan Agius
8b96e52d83 fix(@schematics/angular): remove solution style tsconfig from new projects
Following the issues highlighted in https://docs.google.com/document/d/1eB6cGCG_2ircfS5GzpDC9dBgikeYYcMxghVH5sDESHw/edit?usp=sharing and discussions held with the TypeScript team. The best course of action is to rollback this feature.

In future, it is not excluded that solution style tsconfigs are re-introduced..

Closes #18040 and closes #18170
2020-08-12 19:26:12 +01:00
Alan Agius
702c7cbf31 fix(@schematics/angular): update codelyzer to stable version 2020-07-27 20:16:21 +02:00
Alan Agius
d65235d391 feat(@schematics/angular): generate projects using jasmine-core 3.6.x 2020-07-27 20:16:21 +02:00
Alan Agius
76f525cec2 fix(@schematics/angular): add links to generated tsconfig files
We now add a link to generated tsconfig.json to make is easier for users to find relevant information.
2020-06-15 08:48:14 +02:00
Alan Agius
9ebca6b8d6 build: update karma-jasmine-html-reporter to 1.5.0 2020-06-01 15:02:15 -04:00