35 Commits

Author SHA1 Message Date
Charles Lyding
23fc8e1e17 fix(@schematics/angular): generate components without a .component extension/type
To align with the updated style guide, Angular v20 will generate components
without a `.component` file extension type for all component related
files by default. Projects will automatically use this naming convention.
Projects can however opt-out by setting the `type` option to `Component`
for the component schematic. This can be done as a default in the `angular.json`
or directly on the commandline via `--type=Component` when executing `ng generate`.
As an example, `app.component.css` will now be named `app.css`. Additionally,
the TypeScript class name will be `App` instead of the previous `AppComponent`.
2025-03-14 11:27:43 -07:00
Alan Agius
18e13e2cee feat(@schematics/angular): remove --server-routing option
Server-side rendering (SSR) will always enable server routing when using the application builder.

BREAKING CHANGE: `--server-routing` option has been removed from several schematics. Server routing will be used when using the application builder.
2025-03-13 17:40:26 +01:00
Alan Agius
ec05c814ee fix(@angular/ssr): rename provideServerRoutesConfig to provideServerRouting
This commit renames `provideServerRoutesConfig` to `provideServerRouting` and updates the second parameter to use the `ServerRoutes` features.

This change improves alignment with the framework's API conventions and the way features are integrated.

### Example Usage:
Before:
```typescript
provideServerRoutesConfig(serverRoutes, { appShellRoute: 'shell' })
```

After:
```typescript
provideServerRouting(serverRoutes, withAppShell(AppShellComponent))
```
2025-01-28 09:25:42 +01:00
Alan Agius
b2e2be052f refactor(@angular/ssr): remove RenderMode.AppShell in favor of new configuration option
This commit removes the `RenderMode.AppShell` option. Instead, a new configuration parameter, `{ appShellRoute: 'shell' }`, is introduced to the `provideServerRoutesConfig` method.

```ts
provideServerRoutesConfig(serverRoutes, { appShellRoute: 'shell' })
```
2024-11-08 19:51:35 +01:00
Alan Agius
43cd4584f5 fix(@schematics/angular): enable opt-in for new @angular/ssr feature
This commit updates several schematics to make the new `@angular/ssr` feature opt-in. Users can opt in by using the `--server-routing` option or by responding with `yes` to the prompt.
2024-10-25 19:51:12 +02:00
Alan Agius
292a4b7c2f feat(@schematics/angular): update app-shell and ssr schematics to adopt new Server Rendering API
This commit revises the app-shell and ssr schematics to incorporate the new Server Rendering API, along with the integration of server-side routes.

BREAKING CHANGE: The app-shell schematic is no longer compatible with Webpack-based builders.
2024-10-09 18:07:33 +02:00
Charles Lyding
fa9bce0e9a test: enable @typescript-eslint/no-unnecessary-type-assertion lint rule
The `@typescript-eslint/no-unnecessary-type-assertion` rule is now enabled and all failures
have been addressed within the code.
2024-06-25 16:57:03 -04: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
Charles Lyding
5343c31152 refactor(@schematics/angular): use built-in POSIX path utilities for app-shell schematic
The use of the custom path functions from `@angular-devkit/core` have been
removed in favor of the built-in functions from Node.js. These provide
equivalent functionality with an improvement in performance. The amount
of custom code executed has also been reduced.
2024-03-11 10:05:28 -04:00
Charles Lyding
456f08abb6 refactor(@schematics/angular): remove unused import from app-shell schematic
The import of the `findAppConfig` function was unused within the schematic.
The TypeScript import was also changed to the recommended default import from
a namespace import.
2024-03-11 10:05:28 -04:00
Alan Agius
714bc222d4 refactor(@schematics/angular): remove private /components API
Last usages of this API has been removed in https://github.com/angular/components/pull/28424
2024-03-06 18:15:21 +01:00
Matthieu Riegler
3c66ba78b4 refactor(@angular-devkit/schematics): use self-closing tag for router-outlet
Let's make the component as simple a possible.
2023-11-20 08:06:08 -05: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
50b9e59a50 feat(@schematics/angular): update app-shell schematic to support standalone applications
This commit adds support to run `ng generate app-shell` in standalone applications.
2023-03-29 16:42:49 +00:00
Charles Lyding
a0e3de2b5f refactor(@schematics/angular): use Tree's newly introduced readText and readJSON functionality
Code related to decoding buffers into strings and parsing content into JSON can now be removed by using the
support provided directly from the Tree instance for the executing schematic.
2022-04-26 19:24:55 -04:00
Alan Agius
9ddb220c3d docs: replace app with application 2022-03-14 10:03:06 -04:00
Charles Lyding
51f89d633f test: enable no-useless-escape lint rule
The `no-useless-escape` eslint rule has now been enabled which removes unneeded characters and complexity from string literals and regular expressions. All files that were in violation of this rule have also been corrected.
2021-08-24 10:51:14 +01:00
Alan Agius
4ed1c4f42d fix(@schematics/angular): replace clientProject with project 2021-05-05 11:49:22 -04: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
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
Charles Lyding
dd58aa6210 refactor(@schematics/angular): avoid InsertChange type assumptions
This change introduces a helper function (`applyToUpdateRecorder`) that handles all known `Change` classes.  The use of this helper function removes type assumptions within the schematics.  Many of these assumptions caused compilation errors when strict TypeScript options are enabled.
2020-08-03 15:39:55 -04:00
Charles Lyding
994aab7485 refactor(@schematics/angular): use type guard based narrowing with TS AST
By leveraging TypeScript's AST type guards, function parameter assumptions and casting can be removed.  Many of these cases caused errors when enabling TypeScript's strict option. This is preliminary work to support enabling full TypeScript strict mode within the project.
2020-08-03 15:39:55 -04:00
Alan Agius
ac3aff20c0 refactor(@schematics/angular): remove deprecated options from app-shell and universal schematics
BREAKING CHANGE:  The below options have been removed as they had no effect
- `test` and `testTsconfigFileName` have been removed form the universal schematic
- `universalProject`, `name`, `outDir`, `root` and `index` have been removed from the app-shell schematic
2020-05-06 11:42:49 -07:00
Alan Agius
643ff77d54 fix(@schematics/angular): support adding app-shell after nguniversal schematics (#15606) 2019-09-18 14:50:02 +01:00
Charles Lyding
83f3c6c39e refactor(@schematics/angular): update app-shell to use new workspace rules 2019-04-15 11:02:46 -07:00
Alex Eagle
bf1c069f73 refactor(@schematics/angular): drop dependency on TypeScript package
instead, vendor in the two files we actually need.
This reduces our install footprint by 5MB
2019-03-06 11:27:48 -08:00
puku0x
258df041c3 fix(@schematics/angular): add serverTarget to app shell production configuration 2018-11-01 10:32:26 -07:00
Alan Agius
82f2bda2f5 refactor(@schematics/angular): make interaction with architect targets type safe 2018-09-12 12:37:24 -07:00
Yaroslav Admin
a5bb3ced10 fix(@schematics/angular): fix app shell schematic failure
Fixes #10093
2018-09-10 14:22:14 -07:00
Alan Agius
616ffe70f8 fix(@schematics/angular): app shell schematic does not use production configuration
Closes: #11578
2018-09-06 10:55:39 -07:00
Charles Lyding
d202480a17 build: update/cleanup tslint rules & fix errors 2018-08-23 11:35:34 -07:00
Filipe Silva
38fda3ea60 fix(@schematics/angular): support updating projects that use the targets property 2018-07-25 20:17:33 +01:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00