Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
24db1ed938 | |||
82798e9d04 | |||
da8bb1b45b | |||
f5cbc2ee25 | |||
cbc1986c6f | |||
0982f993cb | |||
a5a29b0591 | |||
a8f3197f24 | |||
e6f37120fe | |||
6840b7bda9 | |||
68f458909a | |||
12acecf756 | |||
cfbed40ab6 | |||
fe1a6b8e42 | |||
13e29c4e89 | |||
fd52b178ed | |||
ca1f071b2e | |||
296adbbb72 | |||
c795ee1176 | |||
b550618afd | |||
d08d6eebff | |||
e9789abd05 | |||
f2ec2cbb99 |
@ -55,7 +55,8 @@ env:
|
|||||||
- CI_MODE=browserstack_optional
|
- CI_MODE=browserstack_optional
|
||||||
- CI_MODE=docs_test
|
- CI_MODE=docs_test
|
||||||
- CI_MODE=aio
|
- CI_MODE=aio
|
||||||
- CI_MODE=aio_e2e
|
- CI_MODE=aio_e2e AIO_SHARD=0
|
||||||
|
- CI_MODE=aio_e2e AIO_SHARD=1
|
||||||
- CI_MODE=bazel
|
- CI_MODE=bazel
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
@ -63,7 +64,6 @@ matrix:
|
|||||||
allow_failures:
|
allow_failures:
|
||||||
- env: "CI_MODE=saucelabs_optional"
|
- env: "CI_MODE=saucelabs_optional"
|
||||||
- env: "CI_MODE=browserstack_optional"
|
- env: "CI_MODE=browserstack_optional"
|
||||||
- env: "CI_MODE=aio_e2e"
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# source the env.sh script so that the exported variables are available to other scripts later on
|
# source the env.sh script so that the exported variables are available to other scripts later on
|
||||||
|
10
CHANGELOG.md
@ -1,3 +1,13 @@
|
|||||||
|
<a name="4.3.3"></a>
|
||||||
|
## [4.3.3](https://github.com/angular/angular/compare/4.3.2...4.3.3) (2017-08-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **compiler:** fix for element needing implicit parent placed in top-level ng-container ([f5cbc2e](https://github.com/angular/angular/commit/f5cbc2e)), closes [#18314](https://github.com/angular/angular/issues/18314)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.3.2"></a>
|
<a name="4.3.2"></a>
|
||||||
## [4.3.2](https://github.com/angular/angular/compare/4.3.1...4.3.2) (2017-07-26)
|
## [4.3.2](https://github.com/angular/angular/compare/4.3.1...4.3.2) (2017-07-26)
|
||||||
|
|
||||||
|
10
aio/content/examples/.gitignore
vendored
@ -43,13 +43,9 @@ dist/
|
|||||||
**/app/**/*.ajs.js
|
**/app/**/*.ajs.js
|
||||||
|
|
||||||
# aot
|
# aot
|
||||||
**/*.ngfactory.ts
|
*/aot/**/*
|
||||||
**/*.ngsummary.json
|
!*/aot/bs-config.json
|
||||||
**/*.ngsummary.ts
|
!*/aot/index.html
|
||||||
**/*.shim.ngstyle.ts
|
|
||||||
**/*.metadata.json
|
|
||||||
!aot/bs-config.json
|
|
||||||
!aot/index.html
|
|
||||||
!rollup-config.js
|
!rollup-config.js
|
||||||
|
|
||||||
# i18n
|
# i18n
|
||||||
|
@ -9,7 +9,7 @@ export class AppComponent {
|
|||||||
wolves = 0;
|
wolves = 0;
|
||||||
gender = 'f';
|
gender = 'f';
|
||||||
fly = true;
|
fly = true;
|
||||||
logo = 'https://angular.io/resources/images/logos/angular/angular.png';
|
logo = 'https://angular.io/assets/images/logos/angular/angular.png';
|
||||||
count = 3;
|
count = 3;
|
||||||
heroes: string[] = ['Magneta', 'Celeritas', 'Dynama'];
|
heroes: string[] = ['Magneta', 'Celeritas', 'Dynama'];
|
||||||
inc(i: number) {
|
inc(i: number) {
|
||||||
|
@ -1,116 +0,0 @@
|
|||||||
/* #docregion , quickstart, toh */
|
|
||||||
/* Master Styles */
|
|
||||||
h1 {
|
|
||||||
color: #369;
|
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
|
||||||
font-size: 250%;
|
|
||||||
}
|
|
||||||
h2, h3 {
|
|
||||||
color: #444;
|
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
|
||||||
font-weight: lighter;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 2em;
|
|
||||||
}
|
|
||||||
/* #enddocregion quickstart */
|
|
||||||
body, input[text], button {
|
|
||||||
color: #888;
|
|
||||||
font-family: Cambria, Georgia;
|
|
||||||
}
|
|
||||||
/* #enddocregion toh */
|
|
||||||
a {
|
|
||||||
cursor: pointer;
|
|
||||||
cursor: hand;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
font-family: Arial;
|
|
||||||
background-color: #eee;
|
|
||||||
border: none;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
cursor: hand;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
background-color: #cfd8dc;
|
|
||||||
}
|
|
||||||
button:disabled {
|
|
||||||
background-color: #eee;
|
|
||||||
color: #aaa;
|
|
||||||
cursor: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Navigation link styles */
|
|
||||||
nav a {
|
|
||||||
padding: 5px 10px;
|
|
||||||
text-decoration: none;
|
|
||||||
margin-right: 10px;
|
|
||||||
margin-top: 10px;
|
|
||||||
display: inline-block;
|
|
||||||
background-color: #eee;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
nav a:visited, a:link {
|
|
||||||
color: #607D8B;
|
|
||||||
}
|
|
||||||
nav a:hover {
|
|
||||||
color: #039be5;
|
|
||||||
background-color: #CFD8DC;
|
|
||||||
}
|
|
||||||
nav a.active {
|
|
||||||
color: #039be5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* items class */
|
|
||||||
.items {
|
|
||||||
margin: 0 0 2em 0;
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
width: 24em;
|
|
||||||
}
|
|
||||||
.items li {
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
left: 0;
|
|
||||||
background-color: #EEE;
|
|
||||||
margin: .5em;
|
|
||||||
padding: .3em 0;
|
|
||||||
height: 1.6em;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.items li:hover {
|
|
||||||
color: #607D8B;
|
|
||||||
background-color: #DDD;
|
|
||||||
left: .1em;
|
|
||||||
}
|
|
||||||
.items li.selected {
|
|
||||||
background-color: #CFD8DC;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.items li.selected:hover {
|
|
||||||
background-color: #BBD8DC;
|
|
||||||
}
|
|
||||||
.items .text {
|
|
||||||
position: relative;
|
|
||||||
top: -3px;
|
|
||||||
}
|
|
||||||
.items .badge {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: small;
|
|
||||||
color: white;
|
|
||||||
padding: 0.8em 0.7em 0 0.7em;
|
|
||||||
background-color: #607D8B;
|
|
||||||
line-height: 1em;
|
|
||||||
position: relative;
|
|
||||||
left: -1px;
|
|
||||||
top: -4px;
|
|
||||||
height: 1.8em;
|
|
||||||
margin-right: .8em;
|
|
||||||
border-radius: 4px 0 0 4px;
|
|
||||||
}
|
|
||||||
/* #docregion toh */
|
|
||||||
/* everywhere else */
|
|
||||||
* {
|
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
|
||||||
}
|
|
@ -9,7 +9,8 @@ describe('PhoneCat Application', function() {
|
|||||||
|
|
||||||
it('should redirect `index.html` to `index.html#!/phones', function() {
|
it('should redirect `index.html` to `index.html#!/phones', function() {
|
||||||
browser.get('index.html');
|
browser.get('index.html');
|
||||||
expect(browser.getLocationAbsUrl()).toBe('/phones');
|
browser.sleep(1000); // Not sure why this is needed but it is. The route change works fine.
|
||||||
|
expect(browser.getCurrentUrl()).toMatch(/\/phones$/);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('View: Phone list', function() {
|
describe('View: Phone list', function() {
|
||||||
@ -65,7 +66,7 @@ describe('PhoneCat Application', function() {
|
|||||||
|
|
||||||
element.all(by.css('.phones li a')).first().click();
|
element.all(by.css('.phones li a')).first().click();
|
||||||
browser.sleep(1000); // Not sure why this is needed but it is. The route change works fine.
|
browser.sleep(1000); // Not sure why this is needed but it is. The route change works fine.
|
||||||
expect(browser.getLocationAbsUrl()).toBe('/phones/nexus-s');
|
expect(browser.getCurrentUrl()).toMatch(/\/phones\/nexus-s$/);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1080,8 +1080,11 @@ To get access to the `FormArray` class, import it into `hero-detail.component.ts
|
|||||||
|
|
||||||
|
|
||||||
To _work_ with a `FormArray` you do the following:
|
To _work_ with a `FormArray` you do the following:
|
||||||
|
|
||||||
1. Define the items (`FormControls` or `FormGroups`) in the array.
|
1. Define the items (`FormControls` or `FormGroups`) in the array.
|
||||||
|
|
||||||
1. Initialize the array with items created from data in the _data model_.
|
1. Initialize the array with items created from data in the _data model_.
|
||||||
|
|
||||||
1. Add and remove items as the user requires.
|
1. Add and remove items as the user requires.
|
||||||
|
|
||||||
In this guide, you define a `FormArray` for `Hero.addresses` and
|
In this guide, you define a `FormArray` for `Hero.addresses` and
|
||||||
|
@ -1830,7 +1830,7 @@ Finally, you activate the observable with `subscribe` method and (re)set the com
|
|||||||
|
|
||||||
#### _ParamMap_ API
|
#### _ParamMap_ API
|
||||||
|
|
||||||
The `ParamMap` API is inspired by the [URLSearchParams interface](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParamsOPut). It provides methods
|
The `ParamMap` API is inspired by the [URLSearchParams interface](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams). It provides methods
|
||||||
to handle parameter access for both route parameters (`paramMap`) and query parameters (`queryParamMap`).
|
to handle parameter access for both route parameters (`paramMap`) and query parameters (`queryParamMap`).
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@ -8,7 +8,7 @@
|
|||||||
<div class="feature-section">
|
<div class="feature-section">
|
||||||
<div class="feature-header">
|
<div class="feature-header">
|
||||||
<div class="text-headline">Cross Platform</div>
|
<div class="text-headline">Cross Platform</div>
|
||||||
<img src="assets/images/icons/feature-icon.svg" height="70px">
|
<img src="generated/images/marketing/features/feature-icon.svg" height="70px">
|
||||||
</div>
|
</div>
|
||||||
<div class="feature-row">
|
<div class="feature-row">
|
||||||
|
|
||||||
@ -34,7 +34,7 @@
|
|||||||
<div class="feature-section">
|
<div class="feature-section">
|
||||||
<div class="feature-header">
|
<div class="feature-header">
|
||||||
<div class="text-headline">Speed and Performance</div>
|
<div class="text-headline">Speed and Performance</div>
|
||||||
<img src="assets/images/icons/feature-icon.svg" height="70px">
|
<img src="generated/images/marketing/features/feature-icon.svg" height="70px">
|
||||||
</div>
|
</div>
|
||||||
<div class="feature-row">
|
<div class="feature-row">
|
||||||
|
|
||||||
@ -59,7 +59,7 @@
|
|||||||
<div class="feature-section">
|
<div class="feature-section">
|
||||||
<div class="feature-header">
|
<div class="feature-header">
|
||||||
<div class="text-headline">Productivity</div>
|
<div class="text-headline">Productivity</div>
|
||||||
<img src="assets/images/icons/feature-icon.svg" height="70px">
|
<img src="generated/images/marketing/features/feature-icon.svg" height="70px">
|
||||||
</div>
|
</div>
|
||||||
<div class="feature-row">
|
<div class="feature-row">
|
||||||
|
|
||||||
@ -84,7 +84,7 @@
|
|||||||
<div class="feature-section">
|
<div class="feature-section">
|
||||||
<div class="feature-header">
|
<div class="feature-header">
|
||||||
<div class="text-headline">Full Development Story</div>
|
<div class="text-headline">Full Development Story</div>
|
||||||
<img src="assets/images/icons/feature-icon.svg" height="70px">
|
<img src="generated/images/marketing/features/feature-icon.svg" height="70px">
|
||||||
</div>
|
</div>
|
||||||
<div class="feature-row">
|
<div class="feature-row">
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<!--Announcement Bar-->
|
<!--Announcement Bar-->
|
||||||
<div class="homepage-container">
|
<div class="homepage-container">
|
||||||
<div class="announcement-bar">
|
<div class="announcement-bar">
|
||||||
<img src="generated/images/marketing/angular-mix.png" height="40" width="151">
|
<img src="generated/images/marketing/home/angular-mix.png" height="40" width="151">
|
||||||
<p>Join us at our newest event, October 2017</p>
|
<p>Join us at our newest event, October 2017</p>
|
||||||
<a class="button" href="https://angularmix.com/">Learn More</a>
|
<a class="button" href="https://angularmix.com/">Learn More</a>
|
||||||
</div>
|
</div>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<div layout="row" layout-xs="column" class="home-row homepage-container">
|
<div layout="row" layout-xs="column" class="home-row homepage-container">
|
||||||
<div class="promo-img-container promo-1">
|
<div class="promo-img-container promo-1">
|
||||||
<div>
|
<div>
|
||||||
<img height="222" width="340" src="assets/images/home/responsive-framework.svg" alt="responsive framework">
|
<img height="222" width="340" src="generated/images/marketing/home/responsive-framework.svg" alt="responsive framework">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
<div class="promo-img-container promo-2">
|
<div class="promo-img-container promo-2">
|
||||||
<div>
|
<div>
|
||||||
<img height="222" width="323" src="assets/images/home/speed-performance.svg" alt="speed and performance">
|
<img height="222" width="323" src="generated/images/marketing/home/speed-performance.svg" alt="speed and performance">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<!-- Group 3-->
|
<!-- Group 3-->
|
||||||
<div layout="row" layout-xs="column" class="home-row">
|
<div layout="row" layout-xs="column" class="home-row">
|
||||||
<div class="promo-img-container promo-3">
|
<div class="promo-img-container promo-3">
|
||||||
<div><img src="assets/images/home/joyful-development.png" alt="IDE example"></div>
|
<div><img src="generated/images/marketing/home/joyful-development.svg" alt="IDE example"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-container">
|
<div class="text-container">
|
||||||
@ -100,7 +100,7 @@
|
|||||||
|
|
||||||
<div class="promo-img-container promo-4">
|
<div class="promo-img-container promo-4">
|
||||||
<div>
|
<div>
|
||||||
<img src="assets/images/home/loved-by-millions.png" alt="angular on the map" width="455" height="228">
|
<img src="generated/images/marketing/home/loved-by-millions.svg" alt="angular on the map" width="455" height="228">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -110,7 +110,7 @@
|
|||||||
|
|
||||||
<a href="guide/quickstart">
|
<a href="guide/quickstart">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<img src="assets/images/icons/code-icon.svg" height="70px">
|
<img src="generated/images/marketing/home/code-icon.svg" height="70px">
|
||||||
<div class="card-text-container">
|
<div class="card-text-container">
|
||||||
<div class="text-headline">Get Started</div>
|
<div class="text-headline">Get Started</div>
|
||||||
<p>Start building your Angular application.</p>
|
<p>Start building your Angular application.</p>
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
},
|
},
|
||||||
"static.ignore": [
|
"static.ignore": [
|
||||||
"\\.js\\.map$",
|
"\\.js\\.map$",
|
||||||
"^/assets/images/.*/unused/",
|
"^(?:/|\\\\)assets(?:/|\\\\)images(?:/|\\\\).*(?:/|\\\\)_unused(?:/|\\\\)",
|
||||||
"^/generated/(?:docs/(?!api/api-list\\.json).*|images|live-examples|zips)/"
|
"^(?:/|\\\\)generated(?:/|\\\\)(?:docs(?:/|\\\\)(?!api(?:/|\\\\)api-list\\.json).*|images(?:/|\\\\)(?!marketing(?:/|\\\\)).*|live-examples|zips)(?:/|\\\\)"
|
||||||
],
|
],
|
||||||
"static.versioned": [
|
"static.versioned": [
|
||||||
"\\.[0-9a-z]{20}\\."
|
"\\.[0-9a-z]{20}\\."
|
||||||
|
@ -33,8 +33,9 @@
|
|||||||
"docs-test": "node tools/transforms/test.js",
|
"docs-test": "node tools/transforms/test.js",
|
||||||
"serve-and-sync": "concurrently --kill-others \"yarn docs-watch\" \"yarn start\"",
|
"serve-and-sync": "concurrently --kill-others \"yarn docs-watch\" \"yarn start\"",
|
||||||
"~~update-webdriver": "webdriver-manager update --standalone false --gecko false",
|
"~~update-webdriver": "webdriver-manager update --standalone false --gecko false",
|
||||||
"boilerplate:add": "node ./tools/examples/add-example-boilerplate add",
|
"boilerplate:add": "node ./tools/examples/example-boilerplate add",
|
||||||
"boilerplate:remove": "node ./tools/examples/add-example-boilerplate remove",
|
"boilerplate:remove": "node ./tools/examples/example-boilerplate remove",
|
||||||
|
"boilerplate:test": "node tools/examples/test.js",
|
||||||
"generate-plunkers": "node ./tools/plunker-builder/generatePlunkers",
|
"generate-plunkers": "node ./tools/plunker-builder/generatePlunkers",
|
||||||
"generate-zips": "node ./tools/example-zipper/generateZips",
|
"generate-zips": "node ./tools/example-zipper/generateZips",
|
||||||
"sw-manifest": "ngu-sw-manifest --dist dist --in ngsw-manifest.json --out dist/ngsw-manifest.json",
|
"sw-manifest": "ngu-sw-manifest --dist dist --in ngsw-manifest.json --out dist/ngsw-manifest.json",
|
||||||
@ -48,17 +49,18 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^4.2.4",
|
"@angular/animations": "^4.3.1",
|
||||||
"@angular/common": "^4.2.4",
|
"@angular/cdk": "^2.0.0-beta.8",
|
||||||
"@angular/compiler": "^4.2.4",
|
"@angular/common": "^4.3.1",
|
||||||
"@angular/core": "^4.2.4",
|
"@angular/compiler": "^4.3.1",
|
||||||
"@angular/forms": "^4.2.4",
|
"@angular/core": "^4.3.1",
|
||||||
"@angular/http": "^4.2.4",
|
"@angular/forms": "^4.3.1",
|
||||||
"@angular/material": "^2.0.0-beta.7",
|
"@angular/http": "^4.3.1",
|
||||||
"@angular/platform-browser": "^4.2.4",
|
"@angular/material": "^2.0.0-beta.8",
|
||||||
"@angular/platform-browser-dynamic": "^4.2.4",
|
"@angular/platform-browser": "^4.3.1",
|
||||||
"@angular/platform-server": "^4.2.4",
|
"@angular/platform-browser-dynamic": "^4.3.1",
|
||||||
"@angular/router": "^4.2.4",
|
"@angular/platform-server": "^4.3.1",
|
||||||
|
"@angular/router": "^4.3.1",
|
||||||
"@angular/service-worker": "^1.0.0-beta.16",
|
"@angular/service-worker": "^1.0.0-beta.16",
|
||||||
"classlist.js": "^1.1.20150312",
|
"classlist.js": "^1.1.20150312",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
@ -72,7 +74,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "angular/cli-builds#webpack-next",
|
"@angular/cli": "angular/cli-builds#webpack-next",
|
||||||
"@angular/compiler-cli": "^4.2.4",
|
"@angular/compiler-cli": "^4.3.1",
|
||||||
"@types/jasmine": "^2.5.52",
|
"@types/jasmine": "^2.5.52",
|
||||||
"@types/node": "~6.0.60",
|
"@types/node": "~6.0.60",
|
||||||
"archiver": "^1.3.0",
|
"archiver": "^1.3.0",
|
||||||
@ -81,7 +83,7 @@
|
|||||||
"concurrently": "^3.4.0",
|
"concurrently": "^3.4.0",
|
||||||
"cross-spawn": "^5.1.0",
|
"cross-spawn": "^5.1.0",
|
||||||
"dgeni": "^0.4.7",
|
"dgeni": "^0.4.7",
|
||||||
"dgeni-packages": "^0.20.0-rc.6",
|
"dgeni-packages": "^0.20.0",
|
||||||
"entities": "^1.1.1",
|
"entities": "^1.1.1",
|
||||||
"eslint": "^3.19.0",
|
"eslint": "^3.19.0",
|
||||||
"eslint-plugin-jasmine": "^2.2.0",
|
"eslint-plugin-jasmine": "^2.2.0",
|
||||||
|
@ -76,8 +76,8 @@ export class AppComponent implements OnInit {
|
|||||||
|
|
||||||
get homeImageUrl() {
|
get homeImageUrl() {
|
||||||
return this.isSideBySide ?
|
return this.isSideBySide ?
|
||||||
'assets/images/logos/standard/logo-nav@2x.png' :
|
'assets/images/logos/angular/logo-nav@2x.png' :
|
||||||
'assets/images/logos/standard/shield-large.svg';
|
'assets/images/logos/angular/shield-large.svg';
|
||||||
}
|
}
|
||||||
get isOpened() { return this.isSideBySide && this.isSideNavDoc; }
|
get isOpened() { return this.isSideBySide && this.isSideNavDoc; }
|
||||||
get mode() { return this.isSideBySide ? 'side' : 'over'; }
|
get mode() { return this.isSideBySide ? 'side' : 'over'; }
|
||||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 519 B After Width: | Height: | Size: 519 B |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 481 B After Width: | Height: | Size: 481 B |
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 422 B After Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
Before Width: | Height: | Size: 864 B After Width: | Height: | Size: 864 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 782 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@ -1,148 +0,0 @@
|
|||||||
const fs = fsExtra = require('fs-extra');
|
|
||||||
const globby = require('globby');
|
|
||||||
const path = require('path');
|
|
||||||
const Q = require("q");
|
|
||||||
const shelljs = require('shelljs');
|
|
||||||
|
|
||||||
const EXAMPLES_PATH = path.join(__dirname, '/../../content/examples');
|
|
||||||
const SHARED_PATH = path.join(__dirname, '/shared');
|
|
||||||
const BOILERPLATE_PATH = path.join(SHARED_PATH, 'boilerplate');
|
|
||||||
const EXAMPLES_TESTING_PATH = path.join(EXAMPLES_PATH, 'testing');
|
|
||||||
|
|
||||||
const files = {
|
|
||||||
exampleBoilerplate: [
|
|
||||||
'src/styles.css',
|
|
||||||
'src/systemjs-angular-loader.js',
|
|
||||||
'src/systemjs.config.js',
|
|
||||||
'src/tsconfig.json',
|
|
||||||
'bs-config.json',
|
|
||||||
'bs-config.e2e.json',
|
|
||||||
'package.json',
|
|
||||||
'tslint.json'
|
|
||||||
],
|
|
||||||
exampleUnitTestingBoilerplate: [
|
|
||||||
'src/browser-test-shim.js',
|
|
||||||
'karma-test-shim.js',
|
|
||||||
'karma.conf.js'
|
|
||||||
],
|
|
||||||
exampleConfigFilename: 'example-config.json'
|
|
||||||
};
|
|
||||||
|
|
||||||
// requires admin access because it adds symlinks
|
|
||||||
function add() {
|
|
||||||
const realPath = path.join(SHARED_PATH, '/node_modules');
|
|
||||||
const nodeModulesPaths = getNodeModulesPaths(EXAMPLES_PATH);
|
|
||||||
|
|
||||||
// we install the examples modules first
|
|
||||||
installNodeModules();
|
|
||||||
|
|
||||||
nodeModulesPaths.map((linkPath) => {
|
|
||||||
fs.ensureSymlinkSync(realPath, linkPath);
|
|
||||||
});
|
|
||||||
|
|
||||||
return copyExampleBoilerplate();
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyExampleBoilerplate() {
|
|
||||||
console.log('Copying example boilerplate files');
|
|
||||||
const examplePaths = getExamplePaths(EXAMPLES_PATH);
|
|
||||||
// Make boilerplate files read-only to avoid that they be edited by mistake.
|
|
||||||
const destFileMode = '444';
|
|
||||||
let foo = copyFiles(files.exampleBoilerplate, BOILERPLATE_PATH, examplePaths, destFileMode)
|
|
||||||
// copy the unit test boilerplate
|
|
||||||
.then(() => {
|
|
||||||
const unittestPaths = getUnitTestingPaths(EXAMPLES_PATH);
|
|
||||||
return copyFiles(files.exampleUnitTestingBoilerplate, EXAMPLES_TESTING_PATH, unittestPaths, destFileMode);
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err);
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copies fileNames into destPaths, setting the mode of the
|
|
||||||
// files at the destination as optional_destFileMode if given.
|
|
||||||
// returns a promise
|
|
||||||
function copyFiles(fileNames, originPath, destPaths, optional_destFileMode) {
|
|
||||||
const copy = Q.denodeify(fsExtra.copy);
|
|
||||||
const chmod = Q.denodeify(fsExtra.chmod);
|
|
||||||
let copyPromises = [];
|
|
||||||
destPaths.map((destPath) => {
|
|
||||||
fileNames.forEach((fileName) => {
|
|
||||||
const originName = path.join(originPath, fileName);
|
|
||||||
const destName = path.join(destPath, fileName);
|
|
||||||
let p = copy(originName, destName, { clobber: true});
|
|
||||||
if(optional_destFileMode !== undefined) {
|
|
||||||
p = p.then(() => {
|
|
||||||
return chmod(destName, optional_destFileMode);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
copyPromises.push(p);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return Q.all(copyPromises);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getExamplePaths(basePath, includeBase) {
|
|
||||||
// includeBase defaults to false
|
|
||||||
return getPaths(basePath, files.exampleConfigFilename, includeBase);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getFilenames(basePath, filename, includeBase) {
|
|
||||||
let includePatterns = [path.join(basePath, "**/" + filename)];
|
|
||||||
if (!includeBase) {
|
|
||||||
// ignore (skip) the top level version.
|
|
||||||
includePatterns.push("!" + path.join(basePath, "/" + filename));
|
|
||||||
}
|
|
||||||
// ignore (skip) the files in BOILERPLATE_PATH.
|
|
||||||
includePatterns.push("!" + path.join(BOILERPLATE_PATH, "/" + filename));
|
|
||||||
const nmPattern = path.join(basePath, "**/node_modules/**");
|
|
||||||
return globby.sync(includePatterns, {ignore: [nmPattern]});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getNodeModulesPaths(basePath) {
|
|
||||||
return getExamplePaths(basePath).map((examplePath) => {
|
|
||||||
return path.join(examplePath, "/node_modules");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPaths(basePath, filename, includeBase) {
|
|
||||||
const filenames = getFilenames(basePath, filename, includeBase);
|
|
||||||
return filenames.map((fileName) => {
|
|
||||||
return path.dirname(fileName);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getUnitTestingPaths(basePath) {
|
|
||||||
const examples = getPaths(basePath, files.exampleConfigFilename, true);
|
|
||||||
return examples.filter((example) => {
|
|
||||||
const exampleConfig = fs.readJsonSync(`${example}/${files.exampleConfigFilename}`, {throws: false});
|
|
||||||
return exampleConfig && !!exampleConfig.unittesting;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function installNodeModules() {
|
|
||||||
shelljs.exec('yarn', {cwd: SHARED_PATH});
|
|
||||||
}
|
|
||||||
|
|
||||||
function remove() {
|
|
||||||
shelljs.exec('git clean -xdf', {cwd: EXAMPLES_PATH});
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
add: add,
|
|
||||||
remove: remove
|
|
||||||
};
|
|
||||||
|
|
||||||
// being executed from shell script
|
|
||||||
switch (process.argv[2]) {
|
|
||||||
case 'add':
|
|
||||||
add();
|
|
||||||
break;
|
|
||||||
case 'remove':
|
|
||||||
remove();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.error(`There is no function with the name: ${process.argv}`);
|
|
||||||
}
|
|
140
aio/tools/examples/example-boilerplate.js
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
const fs = require('fs-extra');
|
||||||
|
const glob = require('glob');
|
||||||
|
const path = require('canonical-path');
|
||||||
|
const shelljs = require('shelljs');
|
||||||
|
const yargs = require('yargs');
|
||||||
|
|
||||||
|
const SHARED_PATH = path.resolve(__dirname, 'shared');
|
||||||
|
const SHARED_NODE_MODULES_PATH = path.resolve(SHARED_PATH, 'node_modules');
|
||||||
|
const BOILERPLATE_BASE_PATH = path.resolve(SHARED_PATH, 'boilerplate');
|
||||||
|
const EXAMPLES_BASE_PATH = path.resolve(__dirname, '../../content/examples');
|
||||||
|
const TESTING_BASE_PATH = path.resolve(EXAMPLES_BASE_PATH, 'testing');
|
||||||
|
|
||||||
|
const BOILERPLATE_SRC_PATHS = [
|
||||||
|
'src/styles.css',
|
||||||
|
'src/systemjs-angular-loader.js',
|
||||||
|
'src/systemjs.config.js',
|
||||||
|
'src/tsconfig.json',
|
||||||
|
'bs-config.json',
|
||||||
|
'bs-config.e2e.json',
|
||||||
|
'package.json',
|
||||||
|
'tslint.json'
|
||||||
|
];
|
||||||
|
|
||||||
|
const BOILERPLATE_TEST_PATHS = [
|
||||||
|
'src/browser-test-shim.js',
|
||||||
|
'karma-test-shim.js',
|
||||||
|
'karma.conf.js'
|
||||||
|
];
|
||||||
|
|
||||||
|
const ANGULAR_DIST_PATH = path.resolve(__dirname, '../../../dist');
|
||||||
|
const ANGULAR_PACKAGES_PATH = path.resolve(ANGULAR_DIST_PATH, 'packages-dist');
|
||||||
|
const ANGULAR_PACKAGES = [
|
||||||
|
'animations',
|
||||||
|
'common',
|
||||||
|
'compiler',
|
||||||
|
'compiler-cli',
|
||||||
|
'core',
|
||||||
|
'forms',
|
||||||
|
'http',
|
||||||
|
'platform-browser',
|
||||||
|
'platform-browser-dynamic',
|
||||||
|
'platform-server',
|
||||||
|
'router',
|
||||||
|
'upgrade',
|
||||||
|
];
|
||||||
|
const ANGULAR_TOOLS_PACKAGES_PATH = path.resolve(ANGULAR_DIST_PATH, 'tools', '@angular');
|
||||||
|
const ANGULAR_TOOLS_PACKAGES = [
|
||||||
|
'tsc-wrapped'
|
||||||
|
];
|
||||||
|
|
||||||
|
const EXAMPLE_CONFIG_FILENAME = 'example-config.json';
|
||||||
|
|
||||||
|
class ExampleBoilerPlate {
|
||||||
|
/**
|
||||||
|
* Add boilerplate files to all the examples
|
||||||
|
*
|
||||||
|
* @param useLocal if true then overwrite the Angular library files with locally built ones
|
||||||
|
*/
|
||||||
|
add(useLocal) {
|
||||||
|
// first install the shared node_modules
|
||||||
|
this.installNodeModules(SHARED_PATH);
|
||||||
|
|
||||||
|
// Replace the Angular packages with those from the dist folder, if necessary
|
||||||
|
if (useLocal) {
|
||||||
|
ANGULAR_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_PACKAGES_PATH, packageName));
|
||||||
|
ANGULAR_TOOLS_PACKAGES.forEach(packageName => this.overridePackage(ANGULAR_TOOLS_PACKAGES_PATH, packageName));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get all the examples folders, indicated by those that contain a `example-config.json` file
|
||||||
|
const exampleFolders = this.getFoldersContaining(EXAMPLES_BASE_PATH, EXAMPLE_CONFIG_FILENAME, 'node_modules');
|
||||||
|
exampleFolders.forEach(exampleFolder => {
|
||||||
|
|
||||||
|
// Link the node modules - requires admin access (on Windows) because it adds symlinks
|
||||||
|
const destinationNodeModules = path.resolve(exampleFolder, 'node_modules');
|
||||||
|
fs.ensureSymlinkSync(SHARED_NODE_MODULES_PATH, destinationNodeModules);
|
||||||
|
|
||||||
|
// Copy the boilerplate source files
|
||||||
|
BOILERPLATE_SRC_PATHS.forEach(filePath => this.copyFile(BOILERPLATE_BASE_PATH, exampleFolder, filePath));
|
||||||
|
|
||||||
|
// Copy the boilerplate test files (if the example is configured to do unit testing)
|
||||||
|
const exampleConfig = this.loadJsonFile(path.resolve(exampleFolder, EXAMPLE_CONFIG_FILENAME));
|
||||||
|
if (exampleConfig.unittesting) {
|
||||||
|
BOILERPLATE_TEST_PATHS.forEach(filePath => this.copyFile(TESTING_BASE_PATH, exampleFolder, filePath));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove all the boilerplate files from all the examples
|
||||||
|
*/
|
||||||
|
remove() {
|
||||||
|
shelljs.exec('git clean -xdfq', {cwd: EXAMPLES_BASE_PATH});
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
yargs
|
||||||
|
.usage('$0 <cmd> [args]')
|
||||||
|
.command('add [--local]', 'add the boilerplate to each example',
|
||||||
|
{ local: { describe: 'Use the locally built Angular libraries, rather than ones from npm.' } },
|
||||||
|
argv => this.add(argv.local))
|
||||||
|
.command('remove', 'remove the boilerplate from each example', () => this.remove())
|
||||||
|
.demandCommand(1, 'Please supply a command from the list above')
|
||||||
|
.argv;
|
||||||
|
}
|
||||||
|
|
||||||
|
installNodeModules(basePath) {
|
||||||
|
shelljs.exec('yarn', {cwd: basePath});
|
||||||
|
}
|
||||||
|
|
||||||
|
overridePackage(basePath, packageName) {
|
||||||
|
const sourceFolder = path.resolve(basePath, packageName);
|
||||||
|
const destinationFolder = path.resolve(SHARED_NODE_MODULES_PATH, '@angular', packageName);
|
||||||
|
shelljs.rm('-rf', destinationFolder);
|
||||||
|
fs.ensureSymlinkSync(sourceFolder, destinationFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFoldersContaining(basePath, filename, ignore) {
|
||||||
|
const pattern = path.resolve(basePath, '**', filename);
|
||||||
|
const ignorePattern = path.resolve(basePath, '**', ignore, '**');
|
||||||
|
return glob.sync(pattern, { ignore: [ignorePattern] }).map(file => path.dirname(file));
|
||||||
|
}
|
||||||
|
|
||||||
|
copyFile(sourceFolder, destinationFolder, filePath) {
|
||||||
|
const sourcePath = path.resolve(sourceFolder, filePath);
|
||||||
|
const destinationPath = path.resolve(destinationFolder, filePath);
|
||||||
|
fs.copySync(sourcePath, destinationPath, { overwrite: true });
|
||||||
|
fs.chmodSync(destinationPath, 444);
|
||||||
|
}
|
||||||
|
|
||||||
|
loadJsonFile(filePath) {
|
||||||
|
return fs.readJsonSync(filePath, {throws: false}) || {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = new ExampleBoilerPlate();
|
||||||
|
|
||||||
|
// If this file was run directly then run the main function,
|
||||||
|
if (require.main === module) {
|
||||||
|
module.exports.main();
|
||||||
|
}
|
143
aio/tools/examples/example-boilerplate.spec.js
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
const exampleBoilerPlate = require('./example-boilerplate');
|
||||||
|
const shelljs = require('shelljs');
|
||||||
|
const fs = require('fs-extra');
|
||||||
|
const glob = require('glob');
|
||||||
|
const path = require('canonical-path');
|
||||||
|
|
||||||
|
describe('example-boilerplate tool', () => {
|
||||||
|
describe('add', () => {
|
||||||
|
const numberOfBoilerPlateFiles = 8;
|
||||||
|
const numberOfBoilerPlateTestFiles = 3;
|
||||||
|
const exampleFolders = ['a/b', 'c/d'];
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
spyOn(exampleBoilerPlate, 'installNodeModules');
|
||||||
|
spyOn(exampleBoilerPlate, 'overridePackage');
|
||||||
|
spyOn(exampleBoilerPlate, 'getFoldersContaining').and.returnValue(exampleFolders);
|
||||||
|
spyOn(fs, 'ensureSymlinkSync');
|
||||||
|
spyOn(exampleBoilerPlate, 'copyFile');
|
||||||
|
spyOn(exampleBoilerPlate, 'loadJsonFile').and.returnValue({});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should install the node modules', () => {
|
||||||
|
exampleBoilerPlate.add();
|
||||||
|
expect(exampleBoilerPlate.installNodeModules).toHaveBeenCalledWith(path.resolve(__dirname, 'shared'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should override the Angular node_modules with the locally built Angular packages if `useLocal` is true', () => {
|
||||||
|
const numberOfAngularPackages = 12;
|
||||||
|
const numberOfAngularToolsPackages = 1;
|
||||||
|
exampleBoilerPlate.add(true);
|
||||||
|
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledTimes(numberOfAngularPackages + numberOfAngularToolsPackages);
|
||||||
|
// for example
|
||||||
|
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/packages-dist'), 'core');
|
||||||
|
expect(exampleBoilerPlate.overridePackage).toHaveBeenCalledWith(path.resolve(__dirname, '../../../dist/tools/@angular'), 'tsc-wrapped');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should process all the example folders', () => {
|
||||||
|
exampleBoilerPlate.add();
|
||||||
|
expect(exampleBoilerPlate.getFoldersContaining).toHaveBeenCalledWith(path.resolve(__dirname, '../../content/examples'), 'example-config.json', 'node_modules');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should symlink the node_modules', () => {
|
||||||
|
exampleBoilerPlate.add();
|
||||||
|
expect(fs.ensureSymlinkSync).toHaveBeenCalledTimes(exampleFolders.length);
|
||||||
|
expect(fs.ensureSymlinkSync).toHaveBeenCalledWith(path.resolve(__dirname, 'shared/node_modules'), path.resolve('a/b/node_modules'));
|
||||||
|
expect(fs.ensureSymlinkSync).toHaveBeenCalledWith(path.resolve(__dirname, 'shared/node_modules'), path.resolve('c/d/node_modules'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should copy all the source boilerplate files', () => {
|
||||||
|
exampleBoilerPlate.add();
|
||||||
|
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes(numberOfBoilerPlateFiles * exampleFolders.length);
|
||||||
|
// for example
|
||||||
|
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(path.resolve(__dirname, 'shared/boilerplate'), 'a/b', 'package.json');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should try to load the example config file', () => {
|
||||||
|
exampleBoilerPlate.add();
|
||||||
|
expect(exampleBoilerPlate.loadJsonFile).toHaveBeenCalledTimes(exampleFolders.length);
|
||||||
|
expect(exampleBoilerPlate.loadJsonFile).toHaveBeenCalledWith(path.resolve('a/b/example-config.json'));
|
||||||
|
expect(exampleBoilerPlate.loadJsonFile).toHaveBeenCalledWith(path.resolve('c/d/example-config.json'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should copy all the test boilerplate files if unit testing is configured', () => {
|
||||||
|
// configure unit testing for example a/b and not c/d
|
||||||
|
exampleBoilerPlate.loadJsonFile.and.callFake(filePath => filePath.indexOf('a/b') !== -1 ? { unittesting: true } : {});
|
||||||
|
exampleBoilerPlate.add();
|
||||||
|
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledTimes((numberOfBoilerPlateFiles * 2) + numberOfBoilerPlateTestFiles);
|
||||||
|
// for example
|
||||||
|
expect(exampleBoilerPlate.copyFile).toHaveBeenCalledWith(path.resolve(__dirname, '../../content/examples/testing'), 'a/b', 'karma.conf.js');
|
||||||
|
expect(exampleBoilerPlate.copyFile).not.toHaveBeenCalledWith(path.resolve(__dirname, '../../content/examples/testing'), 'c/d', 'karma.conf.js');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('remove', () => {
|
||||||
|
it('should run `git clean`', () => {
|
||||||
|
spyOn(shelljs, 'exec');
|
||||||
|
exampleBoilerPlate.remove();
|
||||||
|
expect(shelljs.exec).toHaveBeenCalledWith('git clean -xdfq', {cwd: path.resolve(__dirname, '../../content/examples') });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('installNodeModules', () => {
|
||||||
|
it('should run `yarn` in the base path', () => {
|
||||||
|
spyOn(shelljs, 'exec');
|
||||||
|
exampleBoilerPlate.installNodeModules('some/base/path');
|
||||||
|
expect(shelljs.exec).toHaveBeenCalledWith('yarn', { cwd: 'some/base/path' });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('overridePackage', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
spyOn(shelljs, 'rm');
|
||||||
|
spyOn(fs, 'ensureSymlinkSync');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should remove the original package from the shared node_modules folder', () => {
|
||||||
|
exampleBoilerPlate.overridePackage('base/path', 'somePackage');
|
||||||
|
expect(shelljs.rm).toHaveBeenCalledWith('-rf', path.resolve(__dirname, 'shared/node_modules/@angular/somePackage'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should symlink the source folder to the shared node_modules folder', () => {
|
||||||
|
exampleBoilerPlate.overridePackage('base/path', 'somePackage');
|
||||||
|
expect(fs.ensureSymlinkSync).toHaveBeenCalledWith(path.resolve('base/path/somePackage'), path.resolve(__dirname, 'shared/node_modules/@angular/somePackage'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getFoldersContaining', () => {
|
||||||
|
it('should use glob.sync', () => {
|
||||||
|
spyOn(glob, 'sync').and.returnValue(['a/b/config.json', 'c/d/config.json']);
|
||||||
|
const result = exampleBoilerPlate.getFoldersContaining('base/path', 'config.json', 'node_modules');
|
||||||
|
expect(glob.sync).toHaveBeenCalledWith(path.resolve('base/path/**/config.json'), { ignore: [path.resolve('base/path/**/node_modules/**')] });
|
||||||
|
expect(result).toEqual(['a/b', 'c/d']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('copyFile', () => {
|
||||||
|
it('should use copySync and chmodSync', () => {
|
||||||
|
spyOn(fs, 'copySync');
|
||||||
|
spyOn(fs, 'chmodSync');
|
||||||
|
exampleBoilerPlate.copyFile('source/folder', 'destination/folder', 'some/file/path');
|
||||||
|
expect(fs.copySync).toHaveBeenCalledWith(
|
||||||
|
path.resolve('source/folder/some/file/path'),
|
||||||
|
path.resolve('destination/folder/some/file/path'),
|
||||||
|
{ overwrite: true });
|
||||||
|
expect(fs.chmodSync).toHaveBeenCalledWith(path.resolve('destination/folder/some/file/path'), 444);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('loadJsonFile', () => {
|
||||||
|
it('should use fs.readJsonSync', () => {
|
||||||
|
spyOn(fs, 'readJsonSync').and.returnValue({ some: 'value' });
|
||||||
|
const result = exampleBoilerPlate.loadJsonFile('some/file');
|
||||||
|
expect(fs.readJsonSync).toHaveBeenCalledWith('some/file', {throws: false});
|
||||||
|
expect(result).toEqual({ some: 'value' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return an empty object if readJsonSync fails', () => {
|
||||||
|
spyOn(fs, 'readJsonSync').and.returnValue(null);
|
||||||
|
const result = exampleBoilerPlate.loadJsonFile('some/file');
|
||||||
|
expect(result).toEqual({});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -24,13 +24,22 @@ const IGNORED_EXAMPLES = [
|
|||||||
*
|
*
|
||||||
* --setup run yarn install, copy boilerplate and update webdriver
|
* --setup run yarn install, copy boilerplate and update webdriver
|
||||||
* e.g. --setup
|
* e.g. --setup
|
||||||
|
*
|
||||||
|
* --local to use the locally built Angular packages, rather than versions from npm
|
||||||
|
* Must be used in conjunction with --setup as this is when the packages are copied.
|
||||||
|
* e.g. --setup --local
|
||||||
|
*
|
||||||
|
* --shard to shard the specs into groups to allow you to run them in parallel
|
||||||
|
* e.g. --shard=0/2 // the even specs: 0, 2, 4, etc
|
||||||
|
* e.g. --shard=1/2 // the odd specs: 1, 3, 5, etc
|
||||||
|
* e.g. --shard=1/3 // the second of every three specs: 1, 4, 7, etc
|
||||||
*/
|
*/
|
||||||
function runE2e() {
|
function runE2e() {
|
||||||
let promise = Promise.resolve();
|
let promise = Promise.resolve();
|
||||||
if (argv.setup) {
|
if (argv.setup) {
|
||||||
// Run setup.
|
// Run setup.
|
||||||
console.log('runE2e: copy boilerplate');
|
console.log('runE2e: copy boilerplate');
|
||||||
const spawnInfo = spawnExt('yarn', ['boilerplate:add'], { cwd: AIO_PATH });
|
const spawnInfo = spawnExt('yarn', ['boilerplate:add', argv.local ? '-- --local': ''], { cwd: AIO_PATH });
|
||||||
promise = spawnInfo.promise
|
promise = spawnInfo.promise
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('runE2e: update webdriver');
|
console.log('runE2e: update webdriver');
|
||||||
@ -41,7 +50,7 @@ function runE2e() {
|
|||||||
const outputFile = path.join(AIO_PATH, './protractor-results.txt');
|
const outputFile = path.join(AIO_PATH, './protractor-results.txt');
|
||||||
|
|
||||||
return promise
|
return promise
|
||||||
.then(() => findAndRunE2eTests(argv.filter, outputFile))
|
.then(() => findAndRunE2eTests(argv.filter, outputFile, argv.shard))
|
||||||
.then((status) => {
|
.then((status) => {
|
||||||
reportStatus(status, outputFile);
|
reportStatus(status, outputFile);
|
||||||
if (status.failed.length > 0) {
|
if (status.failed.length > 0) {
|
||||||
@ -55,7 +64,12 @@ function runE2e() {
|
|||||||
|
|
||||||
// Finds all of the *e2e-spec.tests under the examples folder along with the corresponding apps
|
// Finds all of the *e2e-spec.tests under the examples folder along with the corresponding apps
|
||||||
// that they should run under. Then run each app/spec collection sequentially.
|
// that they should run under. Then run each app/spec collection sequentially.
|
||||||
function findAndRunE2eTests(filter, outputFile) {
|
function findAndRunE2eTests(filter, outputFile, shard) {
|
||||||
|
|
||||||
|
const shardParts = shard ? shard.split('/') : [0,1];
|
||||||
|
const shardModulo = parseInt(shardParts[0], 10);
|
||||||
|
const shardDivider = parseInt(shardParts[1], 10);
|
||||||
|
|
||||||
// create an output file with header.
|
// create an output file with header.
|
||||||
const startTime = new Date().getTime();
|
const startTime = new Date().getTime();
|
||||||
let header = `Doc Sample Protractor Results on ${new Date().toLocaleString()}\n`;
|
let header = `Doc Sample Protractor Results on ${new Date().toLocaleString()}\n`;
|
||||||
@ -65,7 +79,9 @@ function findAndRunE2eTests(filter, outputFile) {
|
|||||||
// Run the tests sequentially.
|
// Run the tests sequentially.
|
||||||
const status = { passed: [], failed: [] };
|
const status = { passed: [], failed: [] };
|
||||||
return getE2eSpecPaths(EXAMPLES_PATH, filter)
|
return getE2eSpecPaths(EXAMPLES_PATH, filter)
|
||||||
.then(e2eSpecPaths => e2eSpecPaths.reduce((promise, specPath) => {
|
.then(e2eSpecPaths => e2eSpecPaths
|
||||||
|
.filter((paths, index) => index % shardDivider === shardModulo)
|
||||||
|
.reduce((promise, specPath) => {
|
||||||
return promise.then(() => {
|
return promise.then(() => {
|
||||||
const examplePath = path.dirname(specPath);
|
const examplePath = path.dirname(specPath);
|
||||||
return runE2eTests(examplePath, outputFile).then((ok) => {
|
return runE2eTests(examplePath, outputFile).then((ok) => {
|
||||||
|
17
aio/tools/examples/test.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* Use this script to run the tests for the doc generation
|
||||||
|
* We cannot use the Jasmine CLI directly because it doesn't seem to
|
||||||
|
* understand the glob and only runs one spec file.
|
||||||
|
*
|
||||||
|
* Equally we cannot use a jasmine.json config file because it doesn't
|
||||||
|
* allow us to set the projectBaseDir, which means that you have to run
|
||||||
|
* jasmine CLI from this directory.
|
||||||
|
*
|
||||||
|
* Using a file like this gives us full control and keeps the package.json
|
||||||
|
* file clean and simple.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const Jasmine = require('jasmine');
|
||||||
|
const jasmine = new Jasmine({ projectBaseDir: __dirname });
|
||||||
|
jasmine.loadConfig({ spec_files: ['*.spec.js'] });
|
||||||
|
jasmine.execute();
|
@ -1,7 +1,7 @@
|
|||||||
{% macro githubHref(doc, versionInfo) -%}
|
{% macro githubHref(doc, versionInfo) -%}
|
||||||
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/packages/{$ doc.fileInfo.projectRelativePath $}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}
|
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/packages/{$ doc.fileInfo.realProjectRelativePath $}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro githubViewLink(doc, versionInfo) -%}
|
{% macro githubViewLink(doc, versionInfo) -%}
|
||||||
<a href="{$ githubHref(doc, versionInfo) $}">{$ doc.fileInfo.projectRelativePath $}</a>
|
<a href="{$ githubHref(doc, versionInfo) $}">{$ doc.fileInfo.realProjectRelativePath $}</a>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
@ -2,9 +2,15 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@angular/animations@^4.2.4":
|
"@angular/animations@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-4.2.4.tgz#552d361fff163c56d0dfda4f963a16bfe4e44e98"
|
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-4.3.1.tgz#1f7e0bb803efc21c608246e6765a1c647f3d1a5f"
|
||||||
|
dependencies:
|
||||||
|
tslib "^1.7.1"
|
||||||
|
|
||||||
|
"@angular/cdk@^2.0.0-beta.8":
|
||||||
|
version "2.0.0-beta.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-2.0.0-beta.8.tgz#71961c851dfbeb19e085e898bf5e4461408f8b57"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
@ -73,73 +79,73 @@
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
node-sass "^4.3.0"
|
node-sass "^4.3.0"
|
||||||
|
|
||||||
"@angular/common@^4.2.4":
|
"@angular/common@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/common/-/common-4.2.4.tgz#9b7ee0e692ab03191a7cd9af331d0f492d3cefeb"
|
resolved "https://registry.yarnpkg.com/@angular/common/-/common-4.3.1.tgz#260f487a7cdca326c436bd3ea9515c797de2ff72"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/compiler-cli@^4.2.4":
|
"@angular/compiler-cli@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-4.2.4.tgz#cce941a28362fc1c042ab85890fcaab1e233dd57"
|
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-4.3.1.tgz#00b41afb6faeb4aef561b8427804ac8880aff63c"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@angular/tsc-wrapped" "4.2.4"
|
"@angular/tsc-wrapped" "4.3.1"
|
||||||
minimist "^1.2.0"
|
minimist "^1.2.0"
|
||||||
reflect-metadata "^0.1.2"
|
reflect-metadata "^0.1.2"
|
||||||
|
|
||||||
"@angular/compiler@^4.2.4":
|
"@angular/compiler@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-4.2.4.tgz#7936a87b2d483abcef840b868c1fcf67221c4914"
|
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-4.3.1.tgz#3a24d49ecf01ac2b6e07f63e378b8ff8e257fe09"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/core@^4.2.4":
|
"@angular/core@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/core/-/core-4.2.4.tgz#e8df7a8dd5de5a327784dfc35b5da6344281cf1b"
|
resolved "https://registry.yarnpkg.com/@angular/core/-/core-4.3.1.tgz#a9d0a7d644b96260674269b689a04feea632a8d3"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/forms@^4.2.4":
|
"@angular/forms@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-4.2.4.tgz#ae09755332ea463f561df01aac2bd369e5d35dc9"
|
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-4.3.1.tgz#33914da2cb146430ff901471e682c76654622dfe"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/http@^4.2.4":
|
"@angular/http@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/http/-/http-4.2.4.tgz#ed039c0d53a587d24575f4cabfd1db8e7f1e3f8b"
|
resolved "https://registry.yarnpkg.com/@angular/http/-/http-4.3.1.tgz#e4f661f746711e88ecbea76a3c905babf97d315a"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/material@^2.0.0-beta.7":
|
"@angular/material@^2.0.0-beta.8":
|
||||||
version "2.0.0-beta.7"
|
version "2.0.0-beta.8"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/material/-/material-2.0.0-beta.7.tgz#2584aaf1ffbe24779916345f1ac82921ccbc2577"
|
resolved "https://registry.yarnpkg.com/@angular/material/-/material-2.0.0-beta.8.tgz#a92852abc9261aea26c2401f576645470be2cf38"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/platform-browser-dynamic@^4.2.4":
|
"@angular/platform-browser-dynamic@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-4.2.4.tgz#5190fda79425ae49a49224985614c9780a370761"
|
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-4.3.1.tgz#84034da60a82ef36e7effda7b3ade6e645b330b3"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/platform-browser@^4.2.4":
|
"@angular/platform-browser@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-4.2.4.tgz#00a44dcb2fd777b54bc17c1ce734aa18fe9fd039"
|
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-4.3.1.tgz#db727b06eed64bda5defec71815db26a4da2f690"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
"@angular/platform-server@^4.2.4":
|
"@angular/platform-server@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-4.2.4.tgz#acfd9c620b1d64c3da9f0c6192d6ccd59620d0d6"
|
resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-4.3.1.tgz#3b915fc4013c6a947a8c147b4db0279b025936eb"
|
||||||
dependencies:
|
dependencies:
|
||||||
parse5 "^3.0.1"
|
parse5 "^3.0.1"
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
xhr2 "^0.1.4"
|
xhr2 "^0.1.4"
|
||||||
|
|
||||||
"@angular/router@^4.2.4":
|
"@angular/router@^4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/router/-/router-4.2.4.tgz#2f193f3a36da19b11a08c9b40e391bd8fde59c56"
|
resolved "https://registry.yarnpkg.com/@angular/router/-/router-4.3.1.tgz#5219d44526156d816065841127610165a015b450"
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib "^1.7.1"
|
tslib "^1.7.1"
|
||||||
|
|
||||||
@ -150,9 +156,9 @@
|
|||||||
base64-js "^1.1.2"
|
base64-js "^1.1.2"
|
||||||
jshashes "^1.0.5"
|
jshashes "^1.0.5"
|
||||||
|
|
||||||
"@angular/tsc-wrapped@4.2.4":
|
"@angular/tsc-wrapped@4.3.1":
|
||||||
version "4.2.4"
|
version "4.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/@angular/tsc-wrapped/-/tsc-wrapped-4.2.4.tgz#956ff14ccf2043243b0cc82336b221dbe6315aef"
|
resolved "https://registry.yarnpkg.com/@angular/tsc-wrapped/-/tsc-wrapped-4.3.1.tgz#f6616a4d2a3bbec1cded664fd1f526edce99ef41"
|
||||||
dependencies:
|
dependencies:
|
||||||
tsickle "^0.21.0"
|
tsickle "^0.21.0"
|
||||||
|
|
||||||
@ -1904,9 +1910,9 @@ devtools-timeline-model@1.1.6:
|
|||||||
chrome-devtools-frontend "1.0.401423"
|
chrome-devtools-frontend "1.0.401423"
|
||||||
resolve "1.1.7"
|
resolve "1.1.7"
|
||||||
|
|
||||||
dgeni-packages@^0.20.0-rc.6:
|
dgeni-packages@^0.20.0:
|
||||||
version "0.20.0-rc.6"
|
version "0.20.0"
|
||||||
resolved "https://registry.yarnpkg.com/dgeni-packages/-/dgeni-packages-0.20.0-rc.6.tgz#d615e0631305dcf091386c802d0e424ef86206d2"
|
resolved "https://registry.yarnpkg.com/dgeni-packages/-/dgeni-packages-0.20.0.tgz#e7da99b0a119ee2eb584202d054a5aa01f23e208"
|
||||||
dependencies:
|
dependencies:
|
||||||
canonical-path "0.0.2"
|
canonical-path "0.0.2"
|
||||||
catharsis "^0.8.1"
|
catharsis "^0.8.1"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "angular-srcs",
|
"name": "angular-srcs",
|
||||||
"version": "4.3.2",
|
"version": "4.3.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"branchPattern": "2.0.*",
|
"branchPattern": "2.0.*",
|
||||||
"description": "Angular - a web framework for modern web apps",
|
"description": "Angular - a web framework for modern web apps",
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"ng-xi18n": "./src/extract_i18n.js"
|
"ng-xi18n": "./src/extract_i18n.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/tsc-wrapped": "4.3.2",
|
"@angular/tsc-wrapped": "4.3.3",
|
||||||
"reflect-metadata": "^0.1.2",
|
"reflect-metadata": "^0.1.2",
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
},
|
},
|
||||||
|
@ -230,14 +230,11 @@ class _TreeBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _closeVoidElement(): void {
|
private _closeVoidElement(): void {
|
||||||
if (this._elementStack.length > 0) {
|
const el = this._getParentElement();
|
||||||
const el = this._elementStack[this._elementStack.length - 1];
|
if (el && this.getTagDefinition(el.name).isVoid) {
|
||||||
|
|
||||||
if (this.getTagDefinition(el.name).isVoid) {
|
|
||||||
this._elementStack.pop();
|
this._elementStack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private _consumeStartTag(startTagToken: lex.Token) {
|
private _consumeStartTag(startTagToken: lex.Token) {
|
||||||
const prefix = startTagToken.parts[0];
|
const prefix = startTagToken.parts[0];
|
||||||
@ -274,12 +271,11 @@ class _TreeBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _pushElement(el: html.Element) {
|
private _pushElement(el: html.Element) {
|
||||||
if (this._elementStack.length > 0) {
|
const parentEl = this._getParentElement();
|
||||||
const parentEl = this._elementStack[this._elementStack.length - 1];
|
|
||||||
if (this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {
|
if (parentEl && this.getTagDefinition(parentEl.name).isClosedByChild(el.name)) {
|
||||||
this._elementStack.pop();
|
this._elementStack.pop();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const tagDef = this.getTagDefinition(el.name);
|
const tagDef = this.getTagDefinition(el.name);
|
||||||
const {parent, container} = this._getParentElementSkippingContainers();
|
const {parent, container} = this._getParentElementSkippingContainers();
|
||||||
@ -353,7 +349,7 @@ class _TreeBuilder {
|
|||||||
* `<ng-container>` elements are skipped as they are not rendered as DOM element.
|
* `<ng-container>` elements are skipped as they are not rendered as DOM element.
|
||||||
*/
|
*/
|
||||||
private _getParentElementSkippingContainers():
|
private _getParentElementSkippingContainers():
|
||||||
{parent: html.Element, container: html.Element|null} {
|
{parent: html.Element | null, container: html.Element|null} {
|
||||||
let container: html.Element|null = null;
|
let container: html.Element|null = null;
|
||||||
|
|
||||||
for (let i = this._elementStack.length - 1; i >= 0; i--) {
|
for (let i = this._elementStack.length - 1; i >= 0; i--) {
|
||||||
@ -363,7 +359,7 @@ class _TreeBuilder {
|
|||||||
container = this._elementStack[i];
|
container = this._elementStack[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return {parent: this._elementStack[this._elementStack.length - 1], container};
|
return {parent: null, container};
|
||||||
}
|
}
|
||||||
|
|
||||||
private _addToParent(node: html.Node) {
|
private _addToParent(node: html.Node) {
|
||||||
|
@ -56,15 +56,13 @@ export function isNgTemplate(tagName: string): boolean {
|
|||||||
return splitNsName(tagName)[1] === 'ng-template';
|
return splitNsName(tagName)[1] === 'ng-template';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getNsPrefix(fullName: string): string
|
export function getNsPrefix(fullName: string): string;
|
||||||
export function getNsPrefix(fullName: null): null;
|
export function getNsPrefix(fullName: null): null;
|
||||||
export function getNsPrefix(fullName: string | null): string |
|
export function getNsPrefix(fullName: string | null): string|null {
|
||||||
null {
|
|
||||||
return fullName === null ? null : splitNsName(fullName)[0];
|
return fullName === null ? null : splitNsName(fullName)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function mergeNsAndName(prefix: string, localName: string):
|
export function mergeNsAndName(prefix: string, localName: string): string {
|
||||||
string {
|
|
||||||
return prefix ? `:${prefix}:${localName}` : localName;
|
return prefix ? `:${prefix}:${localName}` : localName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,6 +152,16 @@ export function main() {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should append the required parent considering top level ng-container', () => {
|
||||||
|
expect(humanizeDom(
|
||||||
|
parser.parse('<ng-container><tr></tr></ng-container><p></p>', 'TestComp')))
|
||||||
|
.toEqual([
|
||||||
|
[html.Element, 'ng-container', 0],
|
||||||
|
[html.Element, 'tr', 1],
|
||||||
|
[html.Element, 'p', 0],
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
it('should special case ng-container when adding a required parent', () => {
|
it('should special case ng-container when adding a required parent', () => {
|
||||||
expect(humanizeDom(parser.parse(
|
expect(humanizeDom(parser.parse(
|
||||||
'<table><thead><ng-container><tr></tr></ng-container></thead></table>',
|
'<table><thead><ng-container><tr></tr></ng-container></thead></table>',
|
||||||
|
@ -14,7 +14,29 @@ if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
|||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${CI_MODE:-} == "bazel" ]]; then
|
# No build needed for bazel or aio docs tests
|
||||||
|
if [[ ${CI_MODE:-} == "bazel" || ${CI_MODE:-} == "docs_test" ]]; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build angular.io, then exit (no Angular build required)
|
||||||
|
if [[ ${CI_MODE:-} == "aio" ]]; then
|
||||||
|
travisFoldStart "build.aio"
|
||||||
|
(
|
||||||
|
cd "`dirname $0`/../../aio"
|
||||||
|
yarn build
|
||||||
|
|
||||||
|
# If this is a PR for angular/angular@master or angular/angular@<stable-branch>, deploy a
|
||||||
|
# snapshot for previewing early (if preconditions are met) regardless of the test outcome.
|
||||||
|
if [[ ${TRAVIS_REPO_SLUG} == "angular/angular" ]] &&
|
||||||
|
([[ $TRAVIS_BRANCH == "master" ]] || [[ $TRAVIS_BRANCH == $STABLE_BRANCH ]]) &&
|
||||||
|
[[ $TRAVIS_PULL_REQUEST != "false" ]]; then
|
||||||
|
travisFoldStart "deploy.aio.pr-preview"
|
||||||
|
yarn deploy-preview -- --skip-build
|
||||||
|
travisFoldEnd "deploy.aio.pr-preview"
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
travisFoldEnd "build.aio"
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -38,24 +60,3 @@ travisFoldStart "tsc a bunch of useless stuff"
|
|||||||
node dist/tools/@angular/tsc-wrapped/src/main -p packages/router/tsconfig-build.json
|
node dist/tools/@angular/tsc-wrapped/src/main -p packages/router/tsconfig-build.json
|
||||||
node dist/tools/@angular/tsc-wrapped/src/main -p packages/forms/tsconfig-build.json
|
node dist/tools/@angular/tsc-wrapped/src/main -p packages/forms/tsconfig-build.json
|
||||||
travisFoldEnd "tsc a bunch of useless stuff"
|
travisFoldEnd "tsc a bunch of useless stuff"
|
||||||
|
|
||||||
|
|
||||||
# Build angular.io
|
|
||||||
if [[ ${CI_MODE:-} == "aio" ]]; then
|
|
||||||
travisFoldStart "build.aio"
|
|
||||||
(
|
|
||||||
cd "`dirname $0`/../../aio"
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
# If this is a PR for angular/angular@master or angular/angular@<stable-branch>, deploy a
|
|
||||||
# snapshot for previewing early (if preconditions are met) regardless of the test outcome.
|
|
||||||
if [[ ${TRAVIS_REPO_SLUG} == "angular/angular" ]] &&
|
|
||||||
([[ $TRAVIS_BRANCH == "master" ]] || [[ $TRAVIS_BRANCH == $STABLE_BRANCH ]]) &&
|
|
||||||
[[ $TRAVIS_PULL_REQUEST != "false" ]]; then
|
|
||||||
travisFoldStart "deploy.aio.pr-preview"
|
|
||||||
yarn deploy-preview -- --skip-build
|
|
||||||
travisFoldEnd "deploy.aio.pr-preview"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
travisFoldEnd "build.aio"
|
|
||||||
fi
|
|
||||||
|
@ -28,7 +28,7 @@ mkdir -p ${LOGS_DIR}
|
|||||||
# Install node
|
# Install node
|
||||||
#nvm install ${NODE_VERSION}
|
#nvm install ${NODE_VERSION}
|
||||||
|
|
||||||
|
if [[ ${CI_MODE} != "aio" && ${CI_MODE} != 'docs_test' ]]; then
|
||||||
# Install version of npm that we are locked against
|
# Install version of npm that we are locked against
|
||||||
travisFoldStart "install-npm"
|
travisFoldStart "install-npm"
|
||||||
npm install -g npm@${NPM_VERSION}
|
npm install -g npm@${NPM_VERSION}
|
||||||
@ -39,6 +39,7 @@ travisFoldEnd "install-npm"
|
|||||||
travisFoldStart "npm-install"
|
travisFoldStart "npm-install"
|
||||||
node tools/npm/check-node-modules --purge || npm install
|
node tools/npm/check-node-modules --purge || npm install
|
||||||
travisFoldEnd "npm-install"
|
travisFoldEnd "npm-install"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ ${TRAVIS} && (${CI_MODE} == "e2e" || ${CI_MODE} == "e2e_2" || ${CI_MODE} == "aio" || ${CI_MODE} == "aio_e2e" || ${CI_MODE} == "docs_test") ]]; then
|
if [[ ${TRAVIS} && (${CI_MODE} == "e2e" || ${CI_MODE} == "e2e_2" || ${CI_MODE} == "aio" || ${CI_MODE} == "aio_e2e" || ${CI_MODE} == "docs_test") ]]; then
|
||||||
|