59 Commits

Author SHA1 Message Date
Filipe Silva
1cd0a0811d feat(@angular/cli): improve ng test performance
This PR uses a new Karma plugin to enable vendor bundles in unit tests,
increasing rebuild performance.

On a medium size project rebuilds times were 15x smaller (16.5s to 0.9s).

Fix #5423
2017-05-08 16:51:40 +01:00
Filipe Silva
8bf040b7e3 feat(@angular/cli): add flag to not delete output path
Fix #5925
Fix #6193
2017-05-08 14:27:59 +01:00
Tatsuyuki Ishi
3d9a7ff24d refactor(@angular/cli): use EnvironmentPlugin instead of DefinePlugin 2017-05-08 12:18:29 +01:00
Victor Boissiere
11d0afc98a fix(@angular/cli): add error message when missing config env variable (#5980)
I tried to implement a continuous integration system on my VPS. I have a PHP script that runs ng build. However in my default PHP configuration no environment variable HOME or USERPROFILE was set. I had this error : `Path must be a string. Received undefined`.

I had to take some time to see where the problem came from so I made a pull request to clarify the error.

Now it is : `Error: Missing environment variable HOME` which does not require to look at the code. This message would have saved me some time.
2017-05-04 20:23:43 +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
67646796d9 refactor(@angular/cli): only setup CSS extraction if actually extracting 2017-05-04 19:54:47 +01:00
Charles Lyding
b07f631773 feat(@angular/cli): always use named webpack modules in dev builds 2017-05-04 19:52:48 +01:00
Charles Lyding
806447e611 fix(@angular/cli): use safer stylesheet minification settings 2017-05-03 12:48:32 -07:00
Charles Lyding
f82da18f8b fix(@angular/cli): set sass precision to bootstrap required value 2017-04-11 16:36:10 -07:00
Charles Lyding
4563ec583a refactor(@angular/cli): modernize webpack style config
Close #5672
2017-03-29 11:04:09 +01:00
Charles Lyding
36b8c9bd02 fix(@angular/cli): allow the use of a base-href with scheme 2017-03-23 17:28:44 -07:00
Sumit Arora
1fe921da93 fix(@angular/cli): Fixing global path issue 2017-03-23 08:47:15 -07:00
Filipe Silva
9cda847035 fix(@angular/cli): fix error handling on test
Fix #2778
Fix #3424
2017-03-20 09:10:17 -07:00
Filipe Silva
303b2c035a fix(@angular/cli): fix test typings
Blocked by #5500 (fix is included in this PR so that CI will run).

Our unit test webpack config was erroneously sending in entry points to karma-webpack, who should receive no entry points.

This in turn was hiding errors related to typeRoots lookups.

It was also causing unit tests compilation to behave weirdly: unit test errors would not stop compilation, because other entries would still compile.

This might also have contributed to the overall slowness of unit tests in #5423.

Related to TypeStrong/ts-node#283

Fix #3911
Fix #5332
Fix #5351
2017-03-20 09:10:17 -07:00
Hans Larsen
d94040b2de fix(@angular/cli): sourcemaps should be the main option, sourcemap an alias 2017-03-14 15:32:00 -07:00
Filipe Silva
501e974384 fix(@angular/cli): don't break deployUrl with scheme
Fix #5254
2017-03-13 16:19:37 -07:00
Charles Lyding
1e7d519d04 fix(@angular/cli): only adjust root relative stylesheet urls
Close #5238
2017-03-09 10:46:30 +00:00
Alex Rickabaugh
f3644a939c fix(@angular/cli): pass the base href through to the sw plugin 2017-03-02 13:49:18 -08:00
Alex Rickabaugh
7f03b5a31e fix(@angular/cli): look for existing manifest in src/ as well 2017-03-02 13:49:18 -08:00
Olivier Combe
d52d290c80 feat(@angular/cli): add new xi18n parameters --locale and --outFile (#5154)
Fixes #5145
2017-03-02 11:54:01 -08:00
Mike Brocchi
1609554c4d refactor(@angular/cli): consolidate config reading logic (#5023) 2017-02-27 21:22:19 -08: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
Hans Larsen
00f913c8cd fix(@angular/cli): fix angular-cli logic
The old logic was failing if the global angular-cli config was .angular-cli.json.
2017-02-22 13:23:45 -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
Filipe Silva
1655e51e7e feat(@angular/cli): hash loaded media by default (#4878)
Currently dev builds use `--output-hashing=none` by default.

This can cause image resources to be overwritten in dev if they have the same same.

This wasn't much of a problem before when only images in global CSS would be treated as resources, but now component css also does that.

Production builds are unaffected since they already use `--output-hashing=all`.

BREAKING CHANGE: dev builds will hash relative resources from CSS (images, etc).
2017-02-22 15:52:11 +00:00
Hans Larsen
e4fc2947db feat(@angular/cli): allow to create new projects in existing directory
Unless the directory is already under an Angular CLI project.

Fixes #4762
Close #4901
2017-02-22 12:00:59 +00:00
Filipe Silva
3bba4cb4da feat(@angular/cli): use same webpack config for karma
Close #4851
Fix #3605
Fix #4850
Fix #4876
2017-02-22 11:54:06 +00:00
Charles Lyding
26d1e41eb8 fix(@angular/cli): stabilize webpack module identifiers
This provides increased viability for long-term caching by limiting the
changes to the content of output files due to webpack module identifier
changes.

Close #4733
2017-02-22 11:52:22 +00:00
Hans
198d27a88e fix(@angular/cli): cache config by file path. (#4902)
On some commands we create multiple configs; this will cache them and reuse the ones that exist already.
2017-02-22 11:50:01 +00:00
Hans
2abbce29db fix(@angular/cli): put aliases for local config too (#4886) 2017-02-21 16:16:27 -08:00
Filipe Silva
d1e13ace0b build: use noUnusedParameters, noUnusedLocals (#4882) 2017-02-21 10:53:34 -08:00
Filipe Silva
a2e819a8dd fix(@angular/cli): fix css url processing (#4803)
Fixing component css in #4667 uncovered errors in CSS url processing.

This PR correctly composes absolute urls when using `--base-href` and/or `--deploy-url`.

It also fixes asset output on `--aot` mode.

Fix #4778
Fix #4782
Fix #4806
2017-02-20 13:18:21 +00:00
Filipe Silva
6d5dfa01c0 test: add license test (#4561)
* test: add license test

* only check prod dependencies

* remove findup dep

* also check dev deps

* add map-stream to ignore list

* remove license-checker

* add comment

* use logger

* fix lint errors
2017-02-17 14:49:04 +00:00
Hans Larsen
50170b9c22
fix(@angular/cli): bug fixes on version and global config 2017-02-16 18:27:45 -08:00
Filipe Silva
9d29cbca0f feat(@angular/cli): add watch flag to serve/e2e (#4749)
This is useful when you don't want the server to rebuild in the middle of something.

A good example is when running e2e tests. Especially on larger suites, one would prefer to continue working while the build is tested without compromising tests.

This will break tests on #4744. They should be adjusted to add the `--watch` flag since they depend on the live reload behaviour during `ng e2e`.
2017-02-16 17:17:15 -08:00
Filipe Silva
78313b3148 fix(@angular/cli): use default .map filename (#4742)
Fix #4741

BREAKING CHANGE: sourcemaps now are always [filename].map (e.g `main.bundle.js.map` instead of `main.bundle.map`).
2017-02-16 17:01:43 -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
Hans Larsen
e0edccf3ee
feat(@ngtools/webpack): add an option to redirect files
It takes multiple paths and not the content, which is cleaner in a configuration.
2017-02-16 16:52:02 -08:00
Hans Larsen
f3c3874a47
refactor: removed unused import 2017-02-16 16:52:02 -08:00
Sumit Arora
74573bab3b refactor: rebranding changes (#4602) 2017-02-16 14:58:28 -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
Charles Lyding
57ef508895 feat(build): add --poll option to build/serve/test commands
Close #4268
Close #4715
2017-02-16 09:04:49 +00:00
Mike Brocchi
809340a8f0 refactor(@angular/cli): rename config file from angular-cli.json to .angular-cli.json (#4681)
BREAKING CHANGE: The configuration file angular-cli.json has been renamed to .angular-cli.json
2017-02-15 23:14:18 -05: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
dd5dda64f8 refactor(@angular/cli): remove compression plugin (#4702)
Followup from #4618
2017-02-14 22:58:25 +00:00
Filipe Silva
e55cb8237a feat(@angular/cli): allow component css imports (#4667)
Fix #4285
2017-02-14 11:29:47 -08: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
Filipe Silva
15b6d9c1a7 build(@angular/cli): update sourcemap-istanbul-instrumenter-loader (#4560)
Thanks to @deepsweet for the license update!

Followup from deepsweet/istanbul-instrumenter-loader#39
Partially address #3884
2017-02-09 10:57:12 -08:00
Filipe Silva
b8328dca55 refactor(commands): turn .run commands into tasks (#4251) 2017-02-08 11:49:05 +00:00