19 Commits

Author SHA1 Message Date
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
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
Artur Androsovych
545847788d fix(@schematics/angular): handle aliased or existing environment import (#16377)
Closes: #16226
2019-12-20 16:33:31 -08:00
Keen Yee Liau
0662a8d774 build: g3 sync for packages/schematics and packages/angular
Fix all build errors in g3
2019-10-03 14:29:07 -07:00
Alan
f03ff807b4 refactor(@schematics/angular): create relativePathToWorkspaceRoot helper and replace usages 2019-04-19 10:55:02 -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
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
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 Agius
36eba0c9fc refactor: use .template suffix for all schematic files
Currently when using `ivy-ngcc` it will print out a warning

```
Failed to read entry point info from //node_modules/@schematics/angular/workspace/files/package.json with error SyntaxError: Unexpected token < in JSON at position 1121.
```

Fixes #13378
2019-01-16 10:29:56 -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
Alan Agius
82f2bda2f5 refactor(@schematics/angular): make interaction with architect targets type safe 2018-09-12 12:37:24 -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
George Kalpakas
a307f5ebf2 refactor(@schematics/angular): minor refactorings 2018-06-13 16:55:42 +01:00
Mike Brocchi
d3b49a5590 refactor: Consolidate adding dependencies 2018-06-08 19:59:53 +01:00
Hans Larsen
44086c60ff build: move devkit repo back to angular-cli 2018-06-05 18:50:06 -07:00