25 Commits

Author SHA1 Message Date
Alan Agius
c2d2da41b1 feat(@schematics/angular): add support to add service worker to standalone application
This commit adds support to generate a service worker in a standalone application.
2023-04-04 14:26:21 +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
283b564d1d feat(@schematics/angular): remove environment files in new applications
This commit removes the usage of environment files and `fileReplacements` in new application projects. Previously, the environment files was used to distinguish between a prod build to invoke `enableProdMode`. The `enableProdMode` however needed only for the case of JIT mode in production mode, which is a rare case as JIT mode is recommanded to be used in production.

In the CLI, calling `enableProdMode` is not needed as `ngDevMode` it's set using the minifier.
2022-09-27 19:48:34 +02:00
Alan Agius
9ddb220c3d docs: replace app with application 2022-03-14 10:03:06 -04:00
Alan Agius
a7b2e6f512 feat(@schematics/angular): update ngsw-config resources extensions
With this change we update service worker ngsw-config resources extensions.

- Remove `eot`. Old IE font format. Not supported by browsers which support service worker.
- Remove `ani`. Not supported by browsers.
- Add `jpeg` as common alias for `jpg`.
- Add `apng` as modern alternative to `gif`.
- Add `avif` a modern image format.

Closes #21526
2021-08-09 16:50:16 +02:00
Alan Agius
5986befcdc feat(@schematics/angular): remove deprecated options
With this change we removed several deprecated `@schematics/angular` deprecated options.

BREAKING CHANGE:

We removed several deprecated `@schematics/angular` deprecated options.
- `lintFix` have been removed from all schematics. `ng lint --fix` should be used instead.
- `legacyBrowsers` have been removed from the `application` schematics since IE 11 is no longer supported.
- `configuration` has been removed from the `web-worker` as it was unused.
- `target` has been removed from the `service-worker` as it was unused.
2021-07-30 14:26:53 +01: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
George Kalpakas
6fa8856721 fix(@schematics/angular): explicitly specify ServiceWorker registration strategy
This commit updates the `service-worker` schematics to explicitly
specify the ServiceWorker registration strategy in the
[ServiceWorkerModule.register()] call.

We still use the default strategy, so there should be no change in the
behavior of the generated apps. However, it will help people find out
what the default behavior is when debugging potential issues with
delayed ServiceWorker registration.
(See the discussion in angular/angular#41223 for more details.)

[1]: https://angular.io/api/service-worker/ServiceWorkerModule#register
2021-03-30 14:33:19 -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
Artur Androsovych
545847788d fix(@schematics/angular): handle aliased or existing environment import (#16377)
Closes: #16226
2019-12-20 16:33:31 -08:00
Charles Lyding
5a7b823b28 test: remove use of deprecated synchronous test helper runSchematic 2019-08-08 08:27:31 -07:00
Alan Agius
15ef15e94a style: remove redundant max-line-length disables and fix other lint issues 2019-07-24 19:06:21 -07:00
Charles Lyding
8e70f18e0c refactor(@schematics/angular): update service-worker to use new workspace rules 2019-04-16 11:23:48 -07:00
Cyrille Tuzi
d747490fd9 feat(@schematics/angular): JSON schema for service worker config 2019-03-11 13:37:28 -07:00
Alan
64b83e2a55 feat(@schematics/angular): relocate ng g service-worker files
This is a follow up on https://github.com/angular/angular-cli/pull/13811, with this now all application have the same structure and hence `ng g service-worker` should follow suit and have the same folder strucute if generated in a root app, or an app inside the projects.
2019-03-06 11:27:04 -08:00
Alan
4718de4dae feat(@schematics/angular): only support known style extentions
Fixes #13149
2019-01-18 11:56:19 -08:00
Alan Agius
263e8c1333 feat(@schematics/angular): generate ngsw-config.json under the project
Generate `ngsw-config.json` under the project sourceRoot if root is empty similar to the `karma.conf.js`

Now:
```
-- src
---- ngsw-config.json
-- project
---- app
------ ngsw-config.json
```
Current:
```
-- ngsw-config.json
-- src
-- project
---- app
------ ngsw-config.json
```

Fixes #10793
2019-01-08 13:49:40 -08:00
Alan Agius
0692cacd06 feat(@schematics/angular): account for root level assets and resourcesOutputPath (#13074)
* feat(@schematics/angular): account for root level assets and `resourcesOutputPath`

By default we are only account for assets inside the assets folder. Which breaks the offline experience.

Fixes #13067

* test: add test to verify root level assets in service workers
2018-11-30 14:08:03 -08:00
Charles Lyding
57c049e507 test: update to support targets & architect fields 2018-09-13 16:43:31 -07:00
Filipe Silva
9720077a4b build: make resolution logic compatible with Bazel 2018-08-22 16:36:10 -07:00
Filipe Silva
38fda3ea60 fix(@schematics/angular): support updating projects that use the targets property 2018-07-25 20:17:33 +01:00
George Kalpakas
1405f53422 fix(@schematics/angular): allow ServiceWorker to work with baseHref
Fixes angular/angular-cli#8515
2018-06-13 16:55:42 +01:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00