60 Commits

Author SHA1 Message Date
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
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
af1d49d18a fix(@schematics/angular): allow inlineTemplate/inlineStyle with minimal application
This change allows `inlineTemplate=false` and/or `inlineStyle=false` to be used with the `minimal` option when creating an application either by `ng new` or `ng generate application`.

Closes #17528
2020-10-17 15:59:52 +02:00
Jefiozie
432fcb0d9b fix(@angular/cli): replace regex with correct project name validation
Closes #17579
2020-09-24 00:04:58 +03:00
Alan Agius
dd260185a1 refactor(@angular-devkit/build-angular): deprecate extractCss browser builder option
BREAKING CHANGE:

Browser builder `extractCss` option default value has been changed from `false` to `true`. This is to reflect the default behaviour when this deprecated option is removed.
2020-08-31 11:54:23 +01: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
05588fcee1 refactor: clean up unused code and imports 2020-07-24 08:01:52 +02:00
Amit Bublil
f4f5e0bf8c fix(@schematics/angular): remove reference to tsconfig.spec.json in tsconfig.json when minimal=true 2020-07-20 11:49:25 +01:00
cexbrayat
ef3bee6e7d fix(@schematics/angular): keep tslint rules ordered
The schematics recently siwtcher to `jsonc-parser` as the JSOn parser, and that introduced a small regression in the tslint.json file where the rules order is not the same as previously.

See https://github.com/cexbrayat/angular-cli-diff/compare/10.0.2...10.1.0-next.0

This commit should fix the issue by providing the insertion index when merging the tslint files.
A test has also been added to avoid further regressions.
2020-07-13 15:54:08 -04:00
Alan Agius
d1623c6b0c refactor(@schematics/angular): refactor some schematics to use the new JSON parser 2020-07-07 08:45:17 +02:00
Alan Agius
1559ad6ffb fix(@schematics/angular): only generate package.json under app in strict applications 2020-06-16 21:08:25 +02:00
Alan Agius
3efda814f7 fix(@schematics/angular): add strict setting to angular.json
With this change we add the `strict` setting to the schematics settings in the angular.json, so that when creating a strict application and/or workspace all future applications will be strict by default
2020-06-10 19:47:11 +01:00
Alan Agius
93e253bc93 refactor: rename tsconfig.json to tsconfig.base.json 2020-05-20 12:12:33 -07:00
Alan Agius
a7cf22cabd feat(@schematics/angular): add stricter bundle budgets when using the --strict option
When using the strict option `anyComponentStyle` and `initial` budgets are more strict.
2020-05-05 11:44:19 -07:00
Christoph Guttandin
cd4822393b fix(@schematics/angular): set inlineTemplate and inlineStyle for minimal projects 2020-02-18 12:47:09 -08:00
FG-33
9de282ca32 feat(@schematics/angular): add generator for interceptor
Rework.
2019-09-26 09:58:00 -07:00
Elvis Begovic
b2e74d119c feat(@schematics/angular): minimal=true should not create tests files when using ng generate command
Before this commit:
`--minimal=true` create project without any testing frameworks and disable e2e, lint, test targets.
But, if in this minimal project we try command `ng generate class|component|directive|guard|module|pipe|service`, it will always create `*_spec.ts` files.

After this commit:
`--minimal=true` override `@schematics/angular` in `angular.json` to not create `*_spec.ts` files when using `ng generate *` commands.
2019-09-09 14:10:50 -07:00
Alan Agius
8866f1d964 refactor(@schematics/angular): remove redundant aot option for production 2019-08-30 00:08:52 +05:30
Alan
ba8a6ea599 feat(@schematics/angular): remove enableIvy option
With this change we remove the enableIvy option as now we only support generating Ivy application. Users who want to create a VE applications should follow the opt-out guide
2019-08-16 09:31:02 -07:00
Alan Agius
d7b9650b5f refactor(@schematics/angular): remove hardcoded default values
Defaults in code are no longer required as the root issue was solved by https://github.com/angular/angular-cli/pull/15222
2019-08-08 08:25:50 -07:00
Amadou Sall
c4a3262ee2 fix(@schematics/angular): the ng-new schematic should not prompt for style
closes #13383
2019-08-02 13:34:26 -07:00
vikerman
07780b9272 style: clean up existing lint errors 2019-07-24 23:28:49 -07:00
Alan Agius
2a0dc39de3 feat(@schematics/angular): add anyComponentStyle to the applications bundle budget 2019-07-24 19:05:00 -07:00
Alan Agius
fce849c7d6 fix(@schematics/angular): remove lint target from minimal projects
Minimal projects are considered as throw-away projects and only a small subset of features are supported.

More context #13408 and #13354

Closes #14727
2019-06-11 09:56:42 -07:00
Filipe Silva
24f37a602c feat(@schematics/angular): default Ivy apps to AOT true
Testing on AIO with Angular master as of 28/05/2019 I got these results:
JIT ~414ms (369, 378, 408, 323, 593)
AOT using VE ~1383ms (1365, 1185, 1767, 1135, 1467)
AOT using Ivy ~517ms (600, 391, 444, 756, 394)

This is largely due to https://github.com/angular/angular/pull/29380 and https://github.com/angular/angular/pull/30238.

The second PR above was not merged to master, and thus will not be in 8.0.0. This PR should be merged to match it.
2019-06-06 14:03:00 -07:00
Alan Agius
a464c001c3 fix(@schematics/angular): fix paths when newProjectRoot is an empty string
When `newProjectRoot` the paths are prefixed with an `/` example `/project-name/tsconfig.lib.json` which results in these being marked as absolute paths, which causes build failures.

Fixes #14108
2019-04-22 16:17:39 -07:00
Alan
f03ff807b4 refactor(@schematics/angular): create relativePathToWorkspaceRoot helper and replace usages 2019-04-19 10:55:02 -07:00
Alan Agius
b976a3e72b refactor(@schematics/angular): don't add es5BrowserSupport by default 2019-04-18 11:46:25 -07:00
Charles Lyding
58f6282edf refactor(@schematics/angular): update application to use new workspace rules 2019-04-16 11:23:48 -07:00
Alan
3f6c1b5cd6 fix(@schematics/angular): minimal should not add test target
At the moment when using minimal flag, test targets are being created even though they cannot be used as test setup files are not created nor are testing dependencies
2019-04-04 09:28:19 -07:00
Alan Agius
f84abfc572 feat(@schematics/angular): remove ivy-ngcc postinstall script from new application 2019-04-01 02:54:41 -07:00
Alan
a7d095d916 feat(@schematics/angular): change layout for root applications
This change aligns the file layout of applications generated with `ng new` and `ng generate`

Ref: TOOL-686
2019-03-06 11:28:26 -08:00
Alan
08c4cb748f fix(@schematics/angular): reintroduce .sass as a supported file extention
Sass Indented (.sass) is fully supported by the Sass team and we should still offer and support it.

Fixes #13739
2019-03-04 10:26:09 -08:00
Alan
026ae8cefc feat(@schematics/angular): change layout of e2e files
With this change E2E files will be relocated inside an existing application instead of creating a seperate E2E project. This will also remove a lot of extra boilerplating inside the workspace configuration file.

File layout:
```
│   browserslist
│   karma.conf.js
│   tsconfig.app.json
│   tsconfig.spec.json
│   tslint.json
│
├───e2e
│   │   protractor.conf.js
│   │   tsconfig.e2e.json
│   │
│   └───src
│           app.e2e-spec.ts
│           app.po.ts
│
└───src
    │   favicon.ico
    │   index.html
    │   main.po.ts
    │   main.ts
    │   polyfills.ts
    │   styles.css
    │   test.ts
    │
    ├───app
    │       app.component.css
    │       app.component.html
    │       app.component.spec.ts
    │       app.component.ts
    │       app.module.ts
    │
    ├───assets
    │       .gitkeep
    │
    └───environments
            environment.prod.ts
            environment.ts
```

Ref: TOOL-699
2019-03-04 09:33:12 -08:00
Filipe Silva
05966646e7 feat(@schematics/angular): rename experimentalIvy to enableIvy
Followup to https://github.com/angular/angular/pull/28569#discussion_r259558085
2019-02-26 10:49:58 -08:00
Charles Lyding
b96e7bf76f fix(@schematics/angular): default newProjectRoot to current directory 2019-02-26 08:39:57 -08:00
Amadou Sall
79aa8d602d fix(@schematics/angular): undefined is used as newProjectRoot when none is set
Fixes #13703
2019-02-20 17:13:50 -08:00
Alan Agius
89797900db fix(@schematics/angular): fixes issue that ViewEncapsulation is not being configured when provided
Fixes #13689
2019-02-19 13:57:05 -08:00
Alan Agius
86356a747d fix(@schematics/angular): set cortrect file extention in config when using preprocessors (#13552)
Fixes #13550
2019-02-05 21:13:03 -08:00
Alan Agius
f6c80be867 fix(@schematics/angular): add non deprecated style as default
When adding default in the application schematics we should use the non deprecated `style` option.
2019-01-22 09:42:51 -08:00
Alan
4718de4dae feat(@schematics/angular): only support known style extentions
Fixes #13149
2019-01-18 11:56:19 -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
Charles Lyding
66604efaca feat(@schematics/angular): enabled conditional ES2015 polyfills for new apps 2019-01-15 14:17:55 -08:00
Amadou Sall
f01c156d00 fix(@schematics/angular): apps code coverage should resides in their own folder 2019-01-14 10:57:51 -08:00
Alan Agius
f94576b232 feat(@schematics/angular): experimentalIvy should generates backwards compatible solution
Usage:
```
ng new foo --experimentalIvy
```

Users will need to use `ngcc` so to process code coming from NPM and produce the equivalent Ivy version. This needs to be done once after installing the node packages.

```
node_modules/.bin/ivy-ngcc
```

`ngtsc` compilter will then be used when building using the `--aot` or `--prod` flag.

Fixes #13024
2019-01-11 14:04:01 -08:00
Alan Agius
0715beb65c feat(@schematics/angular): add lintFix to several other schematics
At the moment some schematics contain this options for instance the `guard`, `component` etc.. But some others don't such as `module`

Fixes #12894 and Fixes #6272
2018-12-13 15:53:13 -08:00
Alan Agius
a12a4e02a4 feat(@schematics/angular): consistent naming of options and arguments that do the same thing
This aligns options that do the same thing:
1) `skipSpecs` and `spec` has been deprecated in favor of `skipTests`.
2) `styleext` has been deprecated in favor of `style` since the latest is two words.

Fixes #12784
2018-12-11 11:55:54 -08:00
Alan Agius
d3d433624b fix(@schematics/angular): minimal should be honored in workspace creation 2018-11-06 22:47:39 -08:00
Noël Macé
1f3e2768c2 fix(@schematics/angular): --minimal should prevent generating e2e (#12742)
* fix(@schematics/angular): --minimal should prevent generating e2e

Don't run the e2e schematic when using application or ng-new schematics
with option.minimal set to true.

fix #12739

* style: inverse logic according to feedback

* test(@schematics/angular): app and ng-new --minimal shouldn't generate e2e
2018-11-01 10:59:13 -07:00
Alan Agius
90a5a7db96 feat(@schematics/angular): install packages when creating a new application
Fixes #12719
2018-10-31 20:57:09 -07:00