Skip to content

Commit 3a41061

Browse files
authored
Merge branch 'master' into fix-3699-help-generate-print-blueprints
2 parents 2bf9b57 + 3e03c97 commit 3a41061

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6462
-422
lines changed

.appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ matrix:
77

88
install:
99
- ps: Install-Product node $env:nodejs_version
10-
- npm install -g npm
11-
- npm install
10+
- npm install -g yarn
11+
- yarn install
1212

1313
test_script:
1414
- node --version
15-
- npm --version
16-
- npm test
15+
- yarn --version
16+
- yarn test
1717
- node tests\run_e2e.js
1818

1919
build: off

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
dist/
22
node_modules/
33
npm-debug.log*
4-
yarn.lock
54

65
# IDEs
76
.idea/

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ before_install:
5454
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CHROME_BIN=chromium-browser; fi
5555
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo "--no-sandbox" > ~/.config/chromium-flags.conf; fi
5656
- npm install -g npm
57-
- npm config set spin false
58-
- npm config set progress false
57+
- npm install -g yarn
58+
- yarn config set spin false
59+
- yarn config set progress false
5960

6061
install:
61-
- npm install --no-optional
62+
- yarn install --no-optional
6263

6364
script:
6465
- if [[ "$SCRIPT" ]]; then npm run-script $SCRIPT; fi

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ The CLI supports routing in several ways:
125125

126126
The `--routing` option also generates a default component with the same name as the module.
127127

128-
- You can use the `--routing` option with `ng new` or `ng init` to create a `app-routing.module.ts` file when you create or initialize a project.
128+
- You can use the `--routing` option with `ng new` to create a `app-routing.module.ts` file when you create or initialize a project.
129129

130130
<!-- DeleteSection1 Start here to remove upon next release -->
131131
### Creating a build
@@ -440,12 +440,12 @@ Local project package:
440440
rm -rf node_modules dist # use rmdir on Windows
441441
npm install --save-dev angular-cli@latest
442442
npm install
443-
ng init
443+
ng update
444444
```
445445

446-
Running `ng init` will check for changes in all the auto-generated files created by `ng new` and allow you to update yours. You are offered four choices for each changed file: `y` (overwrite), `n` (don't overwrite), `d` (show diff between your file and the updated file) and `h` (help).
446+
Running `ng update` will check for changes in all the auto-generated files created by `ng new` and allow you to update yours. You are offered four choices for each changed file: `y` (overwrite), `n` (don't overwrite), `d` (show diff between your file and the updated file) and `h` (help).
447447

448-
Carefully read the diffs for each code file, and either accept the changes or incorporate them manually after `ng init` finishes.
448+
Carefully read the diffs for each code file, and either accept the changes or incorporate them manually after `ng update` finishes.
449449

450450
**The main cause of errors after an update is failing to incorporate these updates into your code**.
451451

docs/design/docker-deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Provide tasks for common Docker workflows:
1515

1616
1. Requires user to have Docker CLI tools installed.
1717
(See also: ["Implementation Approaches"](#implementation-approaches))
18-
1. User is free to use the Angular CLI without Docker (and vice versa). By default, do not generate Docker files upon creation of a new project (`ng new`, `ng init`).
18+
1. User is free to use the Angular CLI without Docker (and vice versa). By default, do not generate Docker files upon creation of a new project (`ng new`).
1919
1. Don't recreate the wheel. Docker CLI tools are very full featured on their own. Implement the common Docker use cases that make it convenient for Angular applications.
2020
1. Don't inhibit users from using the standalone Docker CLI tools for other use cases.
2121
1. Assumes 1:1 Dockerfile with the Angular project. Support for multiple services under the same project is outside the scope of this initial design.

docs/documentation/lint.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
<!-- Links in /docs/documentation should NOT have `.md` at the end, because they end up in our wiki at release. -->
2+
13
# ng lint
24

35
## Overview
4-
`ng lint` will lint your app code.
6+
`ng lint` will lint you app code using tslint.
7+
8+
## Options
9+
10+
`--fix` will attempt to fix lint errors
511

6-
This will use the `lint` npm script that in generated projects uses `tslint`.
12+
`--force` will always return error code 0 even with lint errors
713

8-
You can modify the these scripts in `package.json` to run whatever tool you prefer.
14+
`--format` (`-t`) the output formatter to use

docs/documentation/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ your app.
109109

110110
### Additional Commands
111111
* [ng new](new)
112-
* [ng init](init)
112+
* [ng update](update)
113113
* [ng serve](serve)
114114
* [ng generate](generate)
115115
* [ng test](test)

docs/documentation/test.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ Tests will execute after a build is executed via [Karma](http://karma-runner.git
1515

1616
You can run tests with coverage via `--code-coverage`. The coverage report will be in the `coverage/` directory.
1717

18-
Linting during tests is also available via the `--lint` flag. See [Linting and formatting code](#linting-and-formatting-code) chapter for more informations.
19-
2018
## Options
2119
`--watch` (`-w`) flag to run builds when files change
2220

docs/documentation/init.md renamed to docs/documentation/update.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- Links in /docs/documentation should NOT have `.md` at the end, because they end up in our wiki at release. -->
22

3-
# ng init
3+
# ng update
44

55
## Overview
6-
`ng init [name]` initializes, or re-initializes, an angular application.
6+
`ng update [name]` updates, initializes, or re-initializes, an angular application.
77

88
Initialization is done in-place, meaning that the generated application is initialized in the current directory.
99

package.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@
4848
"chalk": "^1.1.3",
4949
"common-tags": "^1.3.1",
5050
"css-loader": "^0.26.1",
51+
"cssnano": "^3.10.0",
5152
"debug": "^2.1.3",
5253
"denodeify": "^1.2.1",
5354
"diff": "^2.2.2",
5455
"ember-cli-normalize-entity-name": "^1.0.0",
5556
"ember-cli-string-utils": "^1.0.0",
5657
"enhanced-resolve": "^2.3.0",
5758
"exists-sync": "0.0.3",
58-
"extract-text-webpack-plugin": "^2.0.0-beta.5",
59+
"extract-text-webpack-plugin": "^2.0.0-rc.1",
5960
"file-loader": "^0.8.5",
6061
"findup": "0.1.5",
6162
"fs-extra": "^0.30.0",
@@ -64,7 +65,6 @@
6465
"html-webpack-plugin": "^2.19.0",
6566
"inflection": "^1.7.0",
6667
"inquirer": "^0.12.0",
67-
"is-git-url": "^0.2.0",
6868
"isbinaryfile": "^2.0.3",
6969
"json-loader": "^0.5.4",
7070
"karma-sourcemap-loader": "^0.3.7",
@@ -74,18 +74,14 @@
7474
"loader-utils": "^0.2.16",
7575
"lodash": "^4.11.1",
7676
"magic-string": "^0.16.0",
77-
"markdown-it": "4.3.0",
78-
"markdown-it-terminal": "0.0.3",
7977
"minimatch": "^3.0.3",
8078
"node-modules-path": "^1.0.0",
8179
"node-sass": "^4.3.0",
8280
"nopt": "^3.0.1",
8381
"opn": "4.0.1",
8482
"ora": "^0.2.0",
8583
"portfinder": "1.0.9",
86-
"postcss-discard-comments": "^2.0.4",
8784
"postcss-loader": "^0.9.1",
88-
"quick-temp": "0.1.5",
8985
"raw-loader": "^0.5.1",
9086
"reflect-metadata": "^0.1.8",
9187
"remap-istanbul": "^0.6.4",
@@ -105,8 +101,6 @@
105101
"stylus-loader": "^2.4.0",
106102
"temp": "0.8.3",
107103
"through": "^2.3.6",
108-
"tslint": "^4.0.2",
109-
"tslint-loader": "^3.3.0",
110104
"typescript": "~2.0.3",
111105
"url-loader": "^0.5.7",
112106
"walk-sync": "^0.2.6",
@@ -137,7 +131,7 @@
137131
"@types/rimraf": "0.0.25-alpha",
138132
"@types/semver": "^5.3.30",
139133
"@types/source-map": "^0.5.0",
140-
"@types/webpack": "^2.2.1",
134+
"@types/webpack": "^2.2.4",
141135
"chai": "^3.5.0",
142136
"conventional-changelog": "^1.1.0",
143137
"dtsgenerator": "^0.7.1",
@@ -146,7 +140,7 @@
146140
"jasmine": "^2.4.1",
147141
"jasmine-spec-reporter": "^2.7.0",
148142
"minimist": "^1.2.0",
149-
"mocha": "^2.4.5",
143+
"mocha": "^3.2.0",
150144
"mock-fs": "^3.12.1",
151145
"npm-run": "^4.1.0",
152146
"npm-run-all": "^3.0.0",
@@ -156,6 +150,7 @@
156150
"rewire": "^2.5.1",
157151
"sinon": "^1.17.3",
158152
"tree-kill": "^1.0.0",
159-
"ts-node": "^1.3.0"
153+
"ts-node": "^1.3.0",
154+
"tslint": "^4.0.2"
160155
}
161156
}

packages/@ngtools/json-schema/src/schema-tree.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ describe('@ngtools/json-schema', () => {
2727
proto.oneOfKey2 = 'hello';
2828
expect(proto.oneOfKey2 instanceof Array).toBe(false);
2929
});
30+
31+
it('returns undefined for values that are non-existent', () => {
32+
const proto: any = Object.create(null);
33+
const root = new RootSchemaTreeNode(proto, { value: valueJson, schema: schemaJson });
34+
35+
const value = root.children['objectKey1'].children['objectKey'].children['stringKey'].get();
36+
expect(value).toBe(undefined);
37+
});
3038
});
3139

3240

packages/@ngtools/json-schema/src/schema-tree.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,12 @@ export abstract class LeafSchemaTreeNode<T> extends SchemaTreeNode<T> {
409409
if (!this.defined && this._forward) {
410410
return this._forward.get();
411411
}
412-
if (!this.defined && this._default !== undefined) {
413-
return this._default;
412+
if (!this.defined) {
413+
return this._default !== undefined ? this._default : undefined;
414414
}
415-
return this._value === undefined ? undefined : this.convert(this._value);
415+
return this._value === undefined
416+
? undefined
417+
: (this._value === null ? null : this.convert(this._value));
416418
}
417419
set(v: T, force = false) {
418420
if (this.readOnly && !force) {

0 commit comments

Comments
 (0)