58 Commits

Author SHA1 Message Date
Keen Yee Liau
5a57fea36b docs(@schematics/angular): add README and update description in schema
Create README for the package, and add missing description in some schema.
2021-04-19 20:34:35 +02:00
Alan Agius
076ab0f11f refactor: add correct schema keys
With this change
- We replace `id` with `$id`,  this no longer valid in draft-07.
- Replace all `$schemas` to `http://json-schema.org/draft-07/schema`, this is needed to "pin" the schema to `draft-07`.

More information about `draft-07` can be found https://json-schema.org/draft-07/json-schema-release-notes.html
2021-04-13 10:51:12 -04:00
Mouad Ennaciri
ee4918db40 fix(@schematics/angular): remove Native value from viewEncapsulation option 2021-03-16 08:57:42 +01:00
Alan Agius
3bf831fac6 fix(@schematics/angular): only show legacy browsers deprecation warning when option is used
This ensures that the deprecate warning is only displayed when the option is used.
2021-03-15 17:07:36 +01:00
Alan Agius
3b7470d483 feat(@schematics/angular): deprecate legacyBrowsers application and ng-new option
Internet Explorer 11 support is deprecated and will be removed in future versions of the Angular CLI.
2021-03-10 08:18:49 -06:00
Alan Agius
ba6f546a02 fix(@schematics/angular): add additionalProperties to all schemas 2021-03-10 08:17:50 -06:00
Alan Agius
b105ed63c7 feat(@schematics/angular): strict mode by default
With this change we workspaces are generated strict by default. To create non-strict workspace the `--no-strict` command line option.
2021-02-11 12:27:50 -05:00
Vladimir Pavlenko
1af01d29f0 docs: replace broken link
Rectifies a broken link into `ng new` section.
2021-02-02 17:36:13 +01:00
Alan Agius
c99cef7ed6 docs: remove when true, when false from argument descriptions
It's confusing and redundant to use `When true` and `when false` in descriptions for a CLI arguments because specifying false/true is redundant in a command line argument flag and in most cases users will not do it.

Example:
`--foo=true` is the same as `--foo`
`--foo=false` is the same as `--no-foo`
2020-12-08 14:39:23 -05: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
Alan Agius
32e24ff76a fix(@schematics/angular): use strict guide short url 2020-10-09 13:12:41 -04:00
Alan Agius
811966a2e2 docs: improve strict option description 2020-10-07 13:18:30 -04:00
Alan Agius
dea7431e54 feat(@schematics/angular): add prompt to strict mode 2020-10-07 13:18:30 -04:00
Alan Agius
2fb0198de2 feat(@schematics/angular): add user-analytics to strict mode option 2020-10-07 13:18:30 -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
Kishan Gajera
a8c63a734e fix(@schematics/angular): validate project name before prompts
When an invalid project name is given, throw an error before going through prompts.

Closes #14994
2020-07-07 15:04:39 +02:00
Alan Agius
4243c9ef96 fix(@schematics/angular): remove strict prompt
From initial feedback from devrel we should remove the prompt
2020-06-09 11:36:58 +01:00
Alan Agius
cbf0feb005 feat(@schematics/angular): enable stricter type checking and optimization effective coding rules
With this change we enable stricter type checking and optimization effective coding rules when using the `--strict` option.

Changes in schematics
- `ng-new`: A prompt for the `--strict` option was added. This option is a proxy and will be passed to the application and workspace schematics.
- `application`: A `package.json` was added in the `app` folder, to tell the bundlers whether the application is free from side-effect code. When `strict` is `true`. the `sideEffects` will be set `false`.
- `workspace` When `strict` is true, we add stricter TypeScript and Angular type-checking options.

Note: AIO is already using these strict TypeScript compiler settings. PR to enable `strictTemplates`  https://github.com/angular/angular/pull/36391

Reference: TOOL-1366
2020-05-05 11:44:19 -07:00
Alan Agius
a723af4271 feat(@schematics/angular): evergreen new applications
By default, we now generate new applications which support only evergreen browsers, as a result differential loading is now opt-in.

A new flag `--legacy-browsers`, was added to generate applications which support non evergreen browsers such as Internet Explorer 11.

**Note**: After an application is generated opting in and out of differential loading is still possible through the supported browsers configuration in the browserslist configuration file  defaulted to `.browserslistrc`.
2020-05-04 10:53:48 -07:00
Amadou Sall
0e3d8e4a64 feat(@schematics/angular): add packageManager option
closes #15875
2019-10-25 09:53:12 -07:00
Amadou Sall
cc4abddcdd refactor(@schematics/angular): remove hardcoded value of newProjectRoot (#15925)
the default value of `newProjectRoot` is already defined in the schema
2019-10-23 10:00:04 -07:00
Alan
f1b87da67d fix(@schematics/angular): add strict option to ng-new
Closes: #15654
2019-09-24 13:19:51 -07:00
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
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
Amadou Sall
5b3c608682 fix(@schematics/angular): the ng-new schematic should not prompt for routing
refs #13383
2019-08-02 13:34:26 -07:00
istiti
c119a402bd fix(@schematics/angular): update sass documentation links
Closes #14975
2019-07-10 04:13:14 +08:00
Amadou Sall
7dac687767 refactor(@schematics/angular): remove non-useful or operator 2019-06-06 14:21:24 -07:00
Charles Lyding
ca1ecb027d test(@schematics/angular): ensure application schematic is run async 2019-04-16 11:23:48 -07:00
Hans Larsen
55471770db refactor: use dimensions for some values instead of metrics
This is after a discussion with someone internal. Metrics are good
for sums but not for comparisons and search/filtering.
2019-03-28 13:28:41 -07:00
Hans Larsen
2e9dc3d252 docs: add analytics dimensions for schematics flags and internal doc
The analytics.md should be kept up to date with the flags.
2019-03-20 15:08:07 -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 Agius
edfc155f35 feat(@schematics/angular): rename tsconfig.e2e.json to tsconfig.json
This will help IDEs as they only pick up the standard name
2019-03-04 09:33:12 -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
Alan
81acdd7066 fix(@schematics/angular): add file extensions to style prompt
This is causing major confusion as users are not aware that choosing `sass` will generate files with `scss` extension.

Another reason for this confusion is that in other schematics, `style` accepts either a preprocessor or file extension while in this prompt only a preprocessor is provided.
2019-02-19 13:58:32 -08:00
Judy Bogart
3a4396580e docs: description of minimal option consistent across commands 2019-01-18 12:06:59 -08:00
Judy Bogart
be3fa89dc3 docs: highlight creating workspace without initial app 2019-01-18 12:06:59 -08:00
Alan
4718de4dae feat(@schematics/angular): only support known style extentions
Fixes #13149
2019-01-18 11:56:19 -08:00
Alex Eagle
4f358f48f8 fix(@schematics/angular): stop offering SASS option for ng new
The old Sass language referred to as "SASS" here is no longer relevant. This was denoted with the file extension ".sass"
Any new projects should use the modern Sass language which is expressed in ".scss" files.
This change does not remove any support for projects which were already created with ".sass" files, we simply stop offering
this option when creating new projects.

Also correct the capitalization of Less based on how they spell it on their website.
2019-01-15 14:49:58 -08:00
Alan Agius
04a7dca3cf docs: add clause that states the minimal projects are for learning purposes.
Minimal projects contains limited functionality and certain commands might not work at all.

This projects should be considered as a throw away.

Fixes #13054
2019-01-11 14:09:12 -08:00
Alan Agius
e18b912aa7 test: use toContain instead of indexOf 2018-11-14 12:34:49 -08:00
Judy Bogart
9da4bdca81
docs: copy edit
Closes #12837.
Closes #12898.
2018-11-13 13:10:20 -08:00
Judy Bogart
ed6e765471
docs: add generation schematics option docs 2018-11-13 13:09:51 -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
Alan Agius
c24afaf31c fix(@schematics/angular): experimentalIvy creates project using next packages
Close: #12667
2018-10-31 14:57:16 -07:00
Rohit Sarkar
907ce5c94c feat(@schematics/angular): Add --minimal flag to generate a barebones (#12498)
project
2018-10-10 12:08:24 -07:00
Igor Minar
90e69805b2 fix(@schematics/angular): tweak the ng new routing prompt 2018-10-05 15:03:19 -07:00
Mike Brocchi
b16cb27f5b feat(@schematics/angular): Add the option to allow preventing the creation of an application
Fixes #12216
2018-09-26 15:04:19 -07:00