44 Commits

Author SHA1 Message Date
Filipe Silva
7f280499cd feat(@angular/cli): add build defaults to config
Adds following defaults to `.angular-cli.json` under `defaults`: `sourcemaps`, `baseHref`, `progress`, `poll`, `deleteOutputPath`, `preserveSymlinks`, `showCircularDependencies`.

They can be set via `ng set defaults.build.KEY = VALUE`.

Also removes `apps.0.showCircularDependencies`. This is not a breaking chance since it was only added in 1.3.0-beta.0.

Followup to https://github.com/angular/angular-cli/pull/6884#discussion_r125533830.
2017-07-06 15:03:19 -07:00
James Ayvaz
36e4d7b4bb feat(@angular/cli): read proxyConfig from angular-cli.json
easy proxy config by reading default from angular-cli.json (#6240)
2017-07-05 11:45:52 -07:00
Filipe Silva
28e4114785 feat(@angular/cli): followup changes to circular dependency detection
Flag is now positive instead of negative and shorter, and can now be set on commands as well (`--show-circular-dependencies`).

Dependency was also added to eject as per https://github.com/angular/angular-cli/pull/6813#issuecomment-311567074.
2017-06-29 11:18:39 -07:00
Filipe Silva
1f3738b19f feat(@angular/cli): add circular dependency detection
Circular dependencies, like `app.module.ts` importing `app.component.ts` which in turn imports `app.module.ts`, now display a warning during builds:

```
kamik@T460p MINGW64 /d/sandbox/master-project (master)
$ ng build
Hash: 3516b252f4e32d6c5bb8
Time: 8693ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 5.95 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 1.88 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

WARNING in Circular dependency detected:
src\app\app.module.ts -> src\app\app.component.ts -> src\app\app.module.ts

WARNING in Circular dependency detected:
src\app\app.component.ts -> src\app\app.module.ts -> src\app\app.component.ts
```

It is important to detect and eliminate circular dependencies because leaving them in might lead to `Maximum call stack size exceeded` errors, or imports being `undefined` at runtime.

To remove these warnings from your project you can factor out the circular dependency into a separate module.

For instance, if module A imports `foo` from module B, and module B imports `bar` from module A, it is enough to extract `foo` into module C.

You can turn off these warnings by running ng set apps.0.hideCircularDependencyWarnings=true. This will add the "hideCircularDependencyWarnings": true value to your .angular-cli.json and disable the warnings.

Fix #6309
Fix #6739
2017-06-27 16:30:30 +01:00
Bram Borggreve
b989e80626 feat(@angular/cli): allow disabling warning when --hmr flag is enabled 2017-06-19 15:29:54 -04:00
laco0416
692b378770 feat(@angular/cli): add baseHref property to appConfig 2017-06-12 09:44:44 -04:00
Charles Lyding
f9053bf5b7 refactor(@angular/cli): simplify command registration 2017-06-06 15:05:35 +01:00
Charles Lyding
6c6d50eb0d refactor(@angular/cli): remove unnecessary use of ember-cli promise wrapper 2017-06-06 15:03:11 +01:00
Charles Lyding
a3bf5291e7 feat(@angular/cli): add option to use lint to adjust generated files 2017-05-09 19:04:11 +01:00
Charles Lyding
69d3d2b05b feat(@angular/cli): support TypeScript 2.3 2017-05-04 20:35:45 +01:00
clydin
de8336d90a test: update development tslint version (#5936)
Also fixes any encountered errors.

This only changes the version used for the CLI's development.  The project template version of tslint cannot be updated until codelyzer supports the latest version. ([codelyzer tracking issue](https://github.com/mgechev/codelyzer/issues/281))
2017-05-04 20:13:13 +01:00
Charles Lyding
70243a2064 refactor(@angular/cli): remove additional unneeded ember-cli files 2017-05-04 19:59:54 +01:00
Adrien Crivelli
2ce61f2a67 docs(@angular/cli): Fix typos in config schema 2017-04-06 13:53:14 -06:00
clydin
7377f66563 fix(@angular/cli): allow tslint to find the appropriate config (#5792)
TSLint includes logic to find the most relevant config per linted file. Unfortunately, by defaulting the config filename this behavior was being disabled.

Fixes #5770
2017-04-03 10:21:39 +01:00
Sumit Arora
7298000ac7 fix(@angular/cli): adding deployUrl description 2017-03-23 17:43:19 -07:00
Hans Larsen
fe69b5b110 ci: add option to ignore imports/requires from dependencies
It needs to be in the file itself where the require/import is made.
2017-03-20 09:20:03 -07:00
Sumit Arora
7e2c04f4e6 fix(@angular/cli): Fixing setting enums 2017-03-13 16:22:36 -07:00
Filipe Silva
5c9c653f79 feat(@angular/cli): use standard stackTraceLimit (#5284)
Sometime very long ago we set infinite stack traces and never took them out.

This PR sets infinite stack traces only on dev setups.
2017-03-07 21:59:06 +00:00
Filipe Silva
b6893d0b7f feat(@angular/cli): allow code coverage excludes (#4966)
A new CLI config entry under `test` allows you to list exclude globs for code coverage:

```
  "test": {
    "codeCoverage": {
      "exclude": [
        "src/polyfills.ts",
        "**/test.ts"
      ]
    },
    "karma": {
      "config": "./karma.conf.js"
    }
  },
```
2017-02-23 20:42:52 +00:00
Sumit Arora
ade2236a9b feat(@angular/cli): adding the --app command option (#4754) 2017-02-22 14:19:29 -08:00
Lenny
b4985498c9 feat(@angular/cli): allow setting ssl certificate in angular-cli.json (#4730)
Currently users must use the --ssl, -ssl-cert, -ssl-key flags to run the
server using an ssl certificate. This update allows users to set
those options in default.serve so they can just run `ng serve` without any
flags.
2017-02-22 14:01:29 -08:00
Filipe Silva
69e6c717fd feat(@angular/cli): use separate tsconfigs
This PR adds tsconfigs for each separate application:
- `src/tsconfig.app.json`: configuration for the Angular app.
- `src/tsconfig.spec.json`: configuration for the unit tests. Defaults to the Angular app config.
- `e2e/tsconfig.e2e.json`: configuration for the e2e tests.

There is an additional root-level `tsconfig.json` that is used for editor integration.

For Angular version 4 projects, these tsconfigs will use inheritance since it's available with TypeScript 2.1.

This is not a breaking change. Existing projects should not be affected.
2017-02-22 19:32:00 +00:00
Stephen Cavaliere
2c1e8778d6 feat(generate): add guard generation (#4055) 2017-02-22 18:21:36 +00:00
Filipe Silva
d1e13ace0b build: use noUnusedParameters, noUnusedLocals (#4882) 2017-02-21 10:53:34 -08:00
Filipe Silva
53994ce1bb refactor(@angular/cli): remove version from schema.json (#4796)
Followup from #4795
2017-02-17 11:12:39 -08:00
Mike Brocchi
bac6e75416 docs(@angular/cli): document available options & JSON schema (#4767) 2017-02-17 10:39:21 -05:00
Filipe Silva
ab06196150 fix(@angular/cli): add $schema as a schema prop (#4779)
Fixes "Property $schema is not allowed" error on editors.
2017-02-17 05:52:29 -08:00
Stephen Cavaliere
9c25f746d2 fix(@angular/cli): generate command now ignores duplicate component symbol (#4446)
"ng g c X" will no longer insert the component symbol in the NgModule's declaration array should it already exist.

Closes #4323
2017-02-16 17:20:32 -08:00
Hans Larsen
7ac0d05626
feat(@angular/cli): eject command
The command will generate a webpack.config.js and will add scripts to the package.json.
2017-02-16 16:52:02 -08:00
Filipe Silva
16bfdf0123 feat(@angular/cli): use environmentSource key for environments (#4705)
Heavily based on @jsanchezgarcia work in #4476.

Fix #3857

BREAKING CHANGE:

A new environmentSource entry replaces the previous source entry inside environments.

To migrate the code follow the example below:

Before:
```
"environments": {
  "source": "environments/environment.ts",
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}
```

After:
```
"environmentSource": "environments/environment.ts",
  "environments": {
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}
```
2017-02-16 12:09:28 +00:00
Mike Brocchi
6febf5c091 refactor(@angular/cli): simplify default arguments in angular-cli.json (#4389)
Fixes #4137
2017-02-15 17:06:40 -08:00
Filipe Silva
e0aa9868cd build(@angular/cli): fix @angular dep warnings (#4592)
We still need these dependencies as they are peerDeps of @ngtools/webpack.

Partially revert #4473
Fix #4575
2017-02-15 20:02:53 +00:00
Filipe Silva
9e91d8646b feat(@angular/cli): allow assets from outside of app root.
Fix #3555
Close #4691

BREAKING CHANGE: 'assets' as a string in angular-cli.json is no longer allowed, use an array instead.
2017-02-15 12:23:59 +00:00
Filipe Silva
dd5dda64f8 refactor(@angular/cli): remove compression plugin (#4702)
Followup from #4618
2017-02-14 22:58:25 +00:00
Alex Rickabaugh
cb2e418d58
feat: add support for @angular/service-worker and manifest generation
Adds the flag 'serviceWorker' to angular-cli.json that enables support for @angular/service-worker.

When this flag is true, production builds will be set up with a service worker. A ngsw-manifest.json file
will be generated (or augmented) in the dist/ root, and the service worker script will be copied there.
A short script will be added to index.html to register the service worker.

@angular/service-worker is a dependency of @angular/cli, but not of generated projects. It is desirable
for users to be able to update the version of @angular/service-worker used in their apps independently
of the CLI version. Thus, the CLI will error if serviceWorker=true but @angular/service-worker is not
installed in the application's node_modules, as it pulls all the service worker scripts from there.

If the flag is false the effect on the CLI is minimal - the webpack plugins associated with the SW are
not even require()'d.

Closes #4544
2017-02-09 15:16:48 -08:00
Stephen Cavaliere
6e3186d62c feat(@angular/cli): add ability to exclude files and directories (#4437)
Fixes #4350
2017-02-09 14:11:40 -08:00
Sumit Arora
d2849c713b feat(@angular/cli): Add options for third party package manager (#4321)
BREAKING CHANGE: `--skip-npm` flag is now named `--skip-install`
2017-02-09 10:35:19 -08:00
Hans
d8f36dfc87 fix(@angular/cli): remove unneeded dependencies (#4473) 2017-02-07 10:28:51 -08:00
Hans
6ff0f80271 fix(@ngtools/json-schema): support enums in d.ts (#4426)
And add better tests. Now enums are typed on their values, not just string.

Also add support for undefined if a value is truly undefined. NULL is
valid JSON value.
2017-02-06 19:39:31 -08:00
Hans
39fa206562 fix(@angular/cli): add a dependency to RXJS (#4465)
Projects dont have a problem with it because they have that dependency directly, but
global installs dont have rxjs and will error out.
2017-02-06 12:52:22 -08:00
Hans
c889dd8e94 refactor(@angular-cli): get rid of ast-tools and base-href-webpack (#4411)
Those 2 packages were still using the wrong scope (@angular-cli) and were not used by anyone outside the CLI. Just moving the code in the main package is enough.
2017-02-03 22:57:42 -08:00
Michał Gołębiowski
20484598dd chore: change all Angular-CLI occurrences to Angular CLI (#4402)
* chore: change all Angular-CLI occurrences to Angular CLI

* docs: remove one remaining angular-cli reference
2017-02-03 15:50:24 +00:00
Stephen Cavaliere
9e41fac461 chore(@angular/cli): remove schema.d.ts file (#4356) 2017-02-02 10:41:53 -08:00
Hans
601f9b38f8 feat(@angular/cli): move angular-cli to @angular/cli (#4328)
This release is otherwise identical to beta.28.
2017-02-01 18:19:50 -08:00