Compare commits
501 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f7997256fc | ||
![]() |
dc9da17f37 | ||
![]() |
99c41d6db0 | ||
![]() |
1aae94a421 | ||
![]() |
f0f319b1d6 | ||
![]() |
454e073918 | ||
![]() |
76d64331bd | ||
![]() |
6855396449 | ||
![]() |
0b96908225 | ||
![]() |
65f52f3761 | ||
![]() |
9ce55d08f8 | ||
![]() |
765c1c5b17 | ||
![]() |
ccfa3426f7 | ||
![]() |
83379fa0bb | ||
![]() |
2ffd44ad96 | ||
![]() |
4a84842bbb | ||
![]() |
daa715a1ca | ||
![]() |
31bce80771 | ||
![]() |
711e4d4cc2 | ||
![]() |
fdc5941fe7 | ||
![]() |
ae10a541bf | ||
![]() |
b797913d10 | ||
![]() |
1465372a0e | ||
![]() |
a33cb2d39b | ||
![]() |
1202d17b4c | ||
![]() |
d837828317 | ||
![]() |
dc210bc75b | ||
![]() |
75ead94ed5 | ||
![]() |
6ac0042aef | ||
![]() |
3eee53603c | ||
![]() |
5c94fa97c1 | ||
![]() |
468f4a3f9e | ||
![]() |
a2393bef02 | ||
![]() |
5bd1c7bbf7 | ||
![]() |
19313f7dad | ||
![]() |
4e2500278c | ||
![]() |
2c4cfa6f2c | ||
![]() |
c8f0c3b637 | ||
![]() |
cf4883240b | ||
![]() |
6f3157fe6d | ||
![]() |
12d8af50dd | ||
![]() |
94fc8463cc | ||
![]() |
87b9f08d3b | ||
![]() |
1c8f1799d4 | ||
![]() |
d98d0dbf17 | ||
![]() |
7e56222afb | ||
![]() |
2ed66acdd9 | ||
![]() |
fa073bafbd | ||
![]() |
363f14c893 | ||
![]() |
a9edbc3a4e | ||
![]() |
e62fa67440 | ||
![]() |
57236f1e11 | ||
![]() |
14ffecdf09 | ||
![]() |
9ae3e1199d | ||
![]() |
947f542185 | ||
![]() |
353195c9c5 | ||
![]() |
72505dfd6f | ||
![]() |
a63f634592 | ||
![]() |
18d08a3857 | ||
![]() |
c4234577db | ||
![]() |
4830d664da | ||
![]() |
e26879ad1d | ||
![]() |
c5c3113f00 | ||
![]() |
178a78f9ed | ||
![]() |
7de7871dd9 | ||
![]() |
784cf46a93 | ||
![]() |
ba9e63a278 | ||
![]() |
83231f2174 | ||
![]() |
62e3196849 | ||
![]() |
127a06c031 | ||
![]() |
d4e00ee5a1 | ||
![]() |
6db8e7eb8f | ||
![]() |
ee1ef8512f | ||
![]() |
efef04487c | ||
![]() |
74d8b2308b | ||
![]() |
7543e5925e | ||
![]() |
5ca8ba3be9 | ||
![]() |
3f70e3df3b | ||
![]() |
0b68189051 | ||
![]() |
b811212013 | ||
![]() |
4d0b831d09 | ||
![]() |
2cf6b809ae | ||
![]() |
639fab2c14 | ||
![]() |
0912be47ff | ||
![]() |
9548c7cb94 | ||
![]() |
de5449380f | ||
![]() |
5ffa4f12e5 | ||
![]() |
9022091dc6 | ||
![]() |
74878984b2 | ||
![]() |
6a6fbc3890 | ||
![]() |
cb888afd0c | ||
![]() |
48cf61cf45 | ||
![]() |
d808333047 | ||
![]() |
f872b69d3b | ||
![]() |
9cca82ed70 | ||
![]() |
e3d33958d2 | ||
![]() |
4de546eef5 | ||
![]() |
719ca5283b | ||
![]() |
3813f54bec | ||
![]() |
92590693e6 | ||
![]() |
ef9da2f619 | ||
![]() |
23f380d6b9 | ||
![]() |
92b97f7d60 | ||
![]() |
d12ef0c0a7 | ||
![]() |
4827dbe308 | ||
![]() |
04cd4187ce | ||
![]() |
bb5e455ab2 | ||
![]() |
96787f2e40 | ||
![]() |
4f1b7a4a6a | ||
![]() |
d113bfa14f | ||
![]() |
a8aa2caeb6 | ||
![]() |
f20c725406 | ||
![]() |
caafd7e0a3 | ||
![]() |
f59f5a2ab3 | ||
![]() |
b91b3d7462 | ||
![]() |
a235daee71 | ||
![]() |
77218d6974 | ||
![]() |
928dc8f263 | ||
![]() |
468aeb454a | ||
![]() |
b9dd2b45af | ||
![]() |
2ab32c870f | ||
![]() |
53897d4a84 | ||
![]() |
efe1713371 | ||
![]() |
24b9e12383 | ||
![]() |
ad3fbe1ea0 | ||
![]() |
f0ce3c2ce5 | ||
![]() |
ae989b8cb7 | ||
![]() |
edcc8b8acf | ||
![]() |
790af88288 | ||
![]() |
6eef7dbdbe | ||
![]() |
ba1dfd0cf3 | ||
![]() |
b37071c22f | ||
![]() |
b6cba54821 | ||
![]() |
451e7e2364 | ||
![]() |
99b63b677e | ||
![]() |
00b9de56f5 | ||
![]() |
4423ab5109 | ||
![]() |
0fc0d9bb3d | ||
![]() |
00cc02fb0c | ||
![]() |
0783d482a7 | ||
![]() |
6cce05e2c5 | ||
![]() |
bf446cb2d5 | ||
![]() |
04fd90e32a | ||
![]() |
be06a44861 | ||
![]() |
d4a14697ec | ||
![]() |
35e0d8311b | ||
![]() |
964d8679b3 | ||
![]() |
6cbde69e8f | ||
![]() |
6da2a28dc0 | ||
![]() |
fbdd282e7c | ||
![]() |
d1b3af697c | ||
![]() |
dcf1dcb757 | ||
![]() |
c6e5225ec3 | ||
![]() |
3361f59a4f | ||
![]() |
7e9d5f5e82 | ||
![]() |
654868f584 | ||
![]() |
b6c042d0a3 | ||
![]() |
4becc1bc95 | ||
![]() |
5bddeea559 | ||
![]() |
65337fb8b8 | ||
![]() |
4abd60361a | ||
![]() |
9d13ee0052 | ||
![]() |
be1a83337e | ||
![]() |
0be3792b5c | ||
![]() |
4edd5fc694 | ||
![]() |
c88ba02d83 | ||
![]() |
8719ccdcfb | ||
![]() |
36083c7c3c | ||
![]() |
44c350236c | ||
![]() |
8a85c31667 | ||
![]() |
293557c80b | ||
![]() |
e61f094a19 | ||
![]() |
244f736e47 | ||
![]() |
9307bc063f | ||
![]() |
64453e42ff | ||
![]() |
9e755f30f0 | ||
![]() |
d0e024ec2d | ||
![]() |
a576852ad9 | ||
![]() |
4573a9997b | ||
![]() |
4af10c6bb0 | ||
![]() |
eabeb574cf | ||
![]() |
a297fa9ecd | ||
![]() |
ea51b62786 | ||
![]() |
701016d6c4 | ||
![]() |
e5317d5eaf | ||
![]() |
389ff894ee | ||
![]() |
d6417f02af | ||
![]() |
a239decc91 | ||
![]() |
a11542ab6f | ||
![]() |
723fb492ce | ||
![]() |
971c6f8d3b | ||
![]() |
e8efd67e71 | ||
![]() |
75370107c2 | ||
![]() |
48ae3a0639 | ||
![]() |
b6d0e215f9 | ||
![]() |
5ea51b21fd | ||
![]() |
ebb473368c | ||
![]() |
7ff9050c25 | ||
![]() |
ec0c6b3dcc | ||
![]() |
e92d53f157 | ||
![]() |
2dbed5e8f5 | ||
![]() |
a0342763b8 | ||
![]() |
0d747337a3 | ||
![]() |
decacd5f74 | ||
![]() |
c8c2272a9f | ||
![]() |
e5f459d32b | ||
![]() |
901b980b8e | ||
![]() |
186373300a | ||
![]() |
f30307a2de | ||
![]() |
166a4553dc | ||
![]() |
465215b11c | ||
![]() |
a0eed742b4 | ||
![]() |
4775f63847 | ||
![]() |
304816e573 | ||
![]() |
d70cf76962 | ||
![]() |
3800455c6f | ||
![]() |
c635123fc8 | ||
![]() |
15e1bfc026 | ||
![]() |
9b961a410a | ||
![]() |
420c73c722 | ||
![]() |
62930aac7b | ||
![]() |
d7433316b0 | ||
![]() |
c440165384 | ||
![]() |
0ce96f1d78 | ||
![]() |
d3deaf9a99 | ||
![]() |
5c88a9fcfe | ||
![]() |
0bd7517c73 | ||
![]() |
d669429bd2 | ||
![]() |
6a9b2c9a67 | ||
![]() |
0f389fa5ae | ||
![]() |
2a27f69522 | ||
![]() |
180a32894e | ||
![]() |
00724dcdbb | ||
![]() |
cc71116ba6 | ||
![]() |
ddfcf082ca | ||
![]() |
c7e4f5eb4d | ||
![]() |
b3fe9017f7 | ||
![]() |
d3a77ea91a | ||
![]() |
1b5a931d63 | ||
![]() |
d840503d35 | ||
![]() |
b49a734f0d | ||
![]() |
695f83529d | ||
![]() |
f898c9ab57 | ||
![]() |
5337e138e3 | ||
![]() |
e33047454f | ||
![]() |
858fa45556 | ||
![]() |
b97211ee2b | ||
![]() |
25d4238371 | ||
![]() |
7743c43529 | ||
![]() |
54883cb477 | ||
![]() |
91cef8cfc7 | ||
![]() |
d40bcce84e | ||
![]() |
7a18fb2448 | ||
![]() |
ec39bdcc15 | ||
![]() |
b7070b0ad6 | ||
![]() |
aa94cd505c | ||
![]() |
cc6ccf28a6 | ||
![]() |
e1071615c6 | ||
![]() |
8bd5374cfd | ||
![]() |
b9b9cc2ba8 | ||
![]() |
a6e10ef869 | ||
![]() |
9724169bf4 | ||
![]() |
c0ed57db76 | ||
![]() |
0bd50e2e50 | ||
![]() |
0ceb27041f | ||
![]() |
ec2affe104 | ||
![]() |
c590e8ca7a | ||
![]() |
254b9ea44c | ||
![]() |
2a53f47159 | ||
![]() |
722d9397b0 | ||
![]() |
03de31a78e | ||
![]() |
b22c5a953d | ||
![]() |
24222e0c1f | ||
![]() |
95f45e8070 | ||
![]() |
18be33a9d1 | ||
![]() |
a22d4f6c98 | ||
![]() |
5ae8473c6b | ||
![]() |
fd7c39e3cf | ||
![]() |
d85d91df66 | ||
![]() |
15930d21c7 | ||
![]() |
61a7f98b98 | ||
![]() |
c3c7bf6509 | ||
![]() |
b2e7ce47ec | ||
![]() |
94e518e3c7 | ||
![]() |
0fa5ac8d0d | ||
![]() |
f2fca3e243 | ||
![]() |
5bab49828d | ||
![]() |
db4e93d0ca | ||
![]() |
479a59be43 | ||
![]() |
52aab63dd9 | ||
![]() |
506beeddc1 | ||
![]() |
0075078179 | ||
![]() |
bb7edc52aa | ||
![]() |
ed2b0e945e | ||
![]() |
da159bde83 | ||
![]() |
06a9809e32 | ||
![]() |
1e4fb74ec8 | ||
![]() |
797c306306 | ||
![]() |
972fc06135 | ||
![]() |
a9117061d0 | ||
![]() |
fe1d9bacc3 | ||
![]() |
08b8b51486 | ||
![]() |
1d4af3f734 | ||
![]() |
609d81c65e | ||
![]() |
af30efddc5 | ||
![]() |
15115f6179 | ||
![]() |
eec9b6bbb5 | ||
![]() |
45fd77ead1 | ||
![]() |
f16587e9b7 | ||
![]() |
4f9991534e | ||
![]() |
51a0ed2222 | ||
![]() |
a5ea100e7c | ||
![]() |
0429c7f5e9 | ||
![]() |
1756cced4a | ||
![]() |
793a001d7c | ||
![]() |
5c3774cfe6 | ||
![]() |
12266b2042 | ||
![]() |
e385abc83c | ||
![]() |
933cbfb828 | ||
![]() |
c5e725111d | ||
![]() |
93993864b1 | ||
![]() |
26f49151e7 | ||
![]() |
4b3f9ac739 | ||
![]() |
80604d3a76 | ||
![]() |
e615a10371 | ||
![]() |
c8f2ca2349 | ||
![]() |
a67afcc932 | ||
![]() |
fd7698253e | ||
![]() |
32de025dce | ||
![]() |
a4e1768a74 | ||
![]() |
b336871303 | ||
![]() |
92fa6399f7 | ||
![]() |
3992341d34 | ||
![]() |
8c559ef104 | ||
![]() |
0bac2b062c | ||
![]() |
58d028178f | ||
![]() |
e06512b22f | ||
![]() |
603b0944d5 | ||
![]() |
918e628f9b | ||
![]() |
468cf69c55 | ||
![]() |
c8f3fa9f3e | ||
![]() |
78136cc3a7 | ||
![]() |
66724fd159 | ||
![]() |
8e7f9033a3 | ||
![]() |
c8f9092364 | ||
![]() |
bc995835b9 | ||
![]() |
1bfa908ab3 | ||
![]() |
2479f7d7ef | ||
![]() |
333b8679ad | ||
![]() |
5da621d3dd | ||
![]() |
cbed582a1a | ||
![]() |
d5aa6b5bd6 | ||
![]() |
33eee43263 | ||
![]() |
72053b0f27 | ||
![]() |
d20ef47b16 | ||
![]() |
bdc05aef64 | ||
![]() |
798d959bee | ||
![]() |
3570aaa363 | ||
![]() |
421b6a97d6 | ||
![]() |
b28a5f6eef | ||
![]() |
52ab9397a0 | ||
![]() |
b99e539b0e | ||
![]() |
fd2ef74a31 | ||
![]() |
cbc25bbf31 | ||
![]() |
7385b2cf25 | ||
![]() |
0daa48800e | ||
![]() |
ffa4e11db1 | ||
![]() |
41a41e741d | ||
![]() |
c5384aee58 | ||
![]() |
b02c950aac | ||
![]() |
2eaa304aba | ||
![]() |
9faf2e4a96 | ||
![]() |
0e7a89a391 | ||
![]() |
af4269471d | ||
![]() |
915a6c17b9 | ||
![]() |
93b32d3023 | ||
![]() |
bd82b34f79 | ||
![]() |
c626e90ab0 | ||
![]() |
c6bbb0d8e5 | ||
![]() |
f48a065db0 | ||
![]() |
aeb6d0d0f7 | ||
![]() |
655c9e386b | ||
![]() |
2ad20b953f | ||
![]() |
7059eaf2d2 | ||
![]() |
939fda410f | ||
![]() |
35ab6acab3 | ||
![]() |
f4ee067cb8 | ||
![]() |
068e28381d | ||
![]() |
dff52ecb11 | ||
![]() |
56af303dc3 | ||
![]() |
136596ddb4 | ||
![]() |
e515c913d9 | ||
![]() |
31eaf78035 | ||
![]() |
b0d680daa0 | ||
![]() |
93cbef26c7 | ||
![]() |
e2b221b8fa | ||
![]() |
7a33c456d3 | ||
![]() |
61db817eed | ||
![]() |
4894220acf | ||
![]() |
74b7a8eaf5 | ||
![]() |
bfa55162de | ||
![]() |
776f991c1a | ||
![]() |
d9d1a1e682 | ||
![]() |
867ff14a4a | ||
![]() |
879457ca05 | ||
![]() |
efbe4ad28a | ||
![]() |
64f72c0600 | ||
![]() |
81c05bfa01 | ||
![]() |
56abcf088d | ||
![]() |
6818432cd0 | ||
![]() |
79bfb037df | ||
![]() |
0fce20d79d | ||
![]() |
9f486c31d2 | ||
![]() |
d36066dd6c | ||
![]() |
a631b99c69 | ||
![]() |
78211c42ea | ||
![]() |
5ff5a11509 | ||
![]() |
e80047e897 | ||
![]() |
eee5eeae76 | ||
![]() |
c3ce1903b6 | ||
![]() |
21da0346c7 | ||
![]() |
af2d74fde9 | ||
![]() |
8de62a9811 | ||
![]() |
26e28453d6 | ||
![]() |
8ea30b662f | ||
![]() |
cb0a2a055d | ||
![]() |
14ae3c0a21 | ||
![]() |
90cae34c05 | ||
![]() |
7bb35889fa | ||
![]() |
03a3c753bb | ||
![]() |
74b1464dff | ||
![]() |
ff523c9ec9 | ||
![]() |
392ef93c2b | ||
![]() |
29dcb5bf68 | ||
![]() |
de594ca221 | ||
![]() |
3545a49a79 | ||
![]() |
f4681b6e40 | ||
![]() |
fb16557381 | ||
![]() |
61c9da5542 | ||
![]() |
dbb1eb0ffe | ||
![]() |
002b81c0b0 | ||
![]() |
beb3f19dc0 | ||
![]() |
e8f3c47b03 | ||
![]() |
c58e6ba13a | ||
![]() |
61e5ab4703 | ||
![]() |
10385c27da | ||
![]() |
0ab244f39e | ||
![]() |
eafa5260db | ||
![]() |
15cffa210c | ||
![]() |
df8e45a193 | ||
![]() |
bb8744db94 | ||
![]() |
43bad87ae1 | ||
![]() |
c3b297a318 | ||
![]() |
6ea232eb3c | ||
![]() |
0baab0f3db | ||
![]() |
e53b686375 | ||
![]() |
5c28af0e74 | ||
![]() |
60adc35d30 | ||
![]() |
024cc3b84a | ||
![]() |
ac17142001 | ||
![]() |
8d7066223f | ||
![]() |
0cb3c04128 | ||
![]() |
2649794e65 | ||
![]() |
bf426c5f0d | ||
![]() |
aa6b9f0382 | ||
![]() |
822b420a11 | ||
![]() |
294c6297d7 | ||
![]() |
58fc65d198 | ||
![]() |
b6bd8d7572 | ||
![]() |
b08168bb90 | ||
![]() |
407fa42679 | ||
![]() |
aef432384a | ||
![]() |
fb70083339 | ||
![]() |
c9c2408176 | ||
![]() |
e066bddfe9 | ||
![]() |
447a600477 | ||
![]() |
70f9bfff43 | ||
![]() |
57c02b044c | ||
![]() |
6defe962c8 | ||
![]() |
267bcb3e9c | ||
![]() |
b0b66881b4 | ||
![]() |
9ff8d78bcd | ||
![]() |
563b707497 | ||
![]() |
5357e643b3 | ||
![]() |
f71d132f7c | ||
![]() |
ba3edda230 | ||
![]() |
0767d37c07 | ||
![]() |
8ba24578bc | ||
![]() |
133a97ad67 | ||
![]() |
4e67a3ab3f | ||
![]() |
377f0010fc | ||
![]() |
6e09129e4c | ||
![]() |
d80e51a6b1 | ||
![]() |
feb66b00da | ||
![]() |
cb19eac105 | ||
![]() |
6e0564ade6 | ||
![]() |
05eeb7d279 | ||
![]() |
2ce5fa3cce | ||
![]() |
e140cdcb34 | ||
![]() |
14b2db1d43 | ||
![]() |
2afc7e982e |
9
.bazelrc
9
.bazelrc
@ -136,6 +136,15 @@ build:remote --remote_executor=remotebuildexecution.googleapis.com
|
|||||||
# retry mechanism and we do not want to retry unnecessarily if Karma already tried multiple times.
|
# retry mechanism and we do not want to retry unnecessarily if Karma already tried multiple times.
|
||||||
test:saucelabs --flaky_test_attempts=1
|
test:saucelabs --flaky_test_attempts=1
|
||||||
|
|
||||||
|
###############################
|
||||||
|
# NodeJS rules settings
|
||||||
|
# These settings are required for rules_nodejs
|
||||||
|
###############################
|
||||||
|
|
||||||
|
# Turn on managed directories feature in Bazel
|
||||||
|
# This allows us to avoid installing a second copy of node_modules
|
||||||
|
common --experimental_allow_incremental_repository_updates
|
||||||
|
|
||||||
####################################################
|
####################################################
|
||||||
# User bazel configuration
|
# User bazel configuration
|
||||||
# NOTE: This needs to be the *last* entry in the config.
|
# NOTE: This needs to be the *last* entry in the config.
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
3.2.0
|
2.1.1
|
||||||
# [NB: this comment has to be after the first line, see https://github.com/bazelbuild/bazelisk/issues/117]
|
# [NB: this comment has to be after the first line, see https://github.com/bazelbuild/bazelisk/issues/117]
|
||||||
# When updating the Bazel version you also need to update the RBE toolchains version in package.bzl
|
# When updating the Bazel version you also need to update the RBE toolchains version in package.bzl
|
||||||
|
@ -19,12 +19,4 @@ build --local_ram_resources=14336
|
|||||||
|
|
||||||
# All build executed remotely should be done using our RBE configuration.
|
# All build executed remotely should be done using our RBE configuration.
|
||||||
build:remote --google_default_credentials
|
build:remote --google_default_credentials
|
||||||
|
|
||||||
# Upload to GCP's Build Status viewer to allow for us to have better viewing of execution/build
|
|
||||||
# logs. This is only done on CI as the BES (GCP's Build Status viewer) API requires credentials
|
|
||||||
# from service accounts, rather than end user accounts.
|
|
||||||
build:remote --bes_backend=buildeventservice.googleapis.com
|
|
||||||
build:remote --bes_timeout=30s
|
|
||||||
build:remote --bes_results_url="https://source.cloud.google.com/results/invocations/"
|
|
||||||
|
|
||||||
build --config=remote
|
build --config=remote
|
||||||
|
@ -22,13 +22,18 @@ version: 2.1
|
|||||||
# **NOTE 1 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
|
# **NOTE 1 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
|
||||||
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
|
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
|
||||||
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
|
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
|
||||||
var_3: &cache_key v7-angular-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
var_3: &cache_key v6-angular-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
||||||
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
|
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
|
||||||
# folder will contain all previously used versions and ultimately cause the cache restoring to
|
# folder will contain all previously used versions and ultimately cause the cache restoring to
|
||||||
# be slower due to its growing size.
|
# be slower due to its growing size.
|
||||||
var_4: &cache_key_fallback v7-angular-node-12-{{ checksum ".bazelversion" }}
|
var_4: &cache_key_fallback v6-angular-node-12-{{ checksum ".bazelversion" }}
|
||||||
var_3_win: &cache_key_win v7-angular-win-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
var_3_win: &cache_key_win v6-angular-win-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
|
||||||
var_4_win: &cache_key_win_fallback v7-angular-win-node-12-{{ checksum ".bazelversion" }}
|
var_4_win: &cache_key_win_fallback v6-angular-win-node-12-{{ checksum ".bazelversion" }}
|
||||||
|
|
||||||
|
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
|
||||||
|
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
|
||||||
|
var_5: &components_repo_unit_tests_cache_key v7-angular-components-caad0b54ed41949f0ee529c152508749875bc9af
|
||||||
|
var_6: &components_repo_unit_tests_cache_key_fallback v7-angular-components-
|
||||||
|
|
||||||
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
|
# Workspace initially persisted by the `setup` job, and then enhanced by `build-npm-packages` and
|
||||||
# `build-ivy-npm-packages`.
|
# `build-ivy-npm-packages`.
|
||||||
@ -62,6 +67,9 @@ var_10: &only_on_master
|
|||||||
# **NOTE 1**: Pin to exact images using an ID (SHA). See https://circleci.com/docs/2.0/circleci-images/#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version.
|
# **NOTE 1**: Pin to exact images using an ID (SHA). See https://circleci.com/docs/2.0/circleci-images/#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version.
|
||||||
# (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.)
|
# (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.)
|
||||||
# **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix.
|
# **NOTE 2**: If you change the version of the docker images, also change the `cache_key` suffix.
|
||||||
|
# **NOTE 3**: If you change the version of the `*-browsers` docker image, make sure the
|
||||||
|
# `--versions.chrome` arg in `integration/bazel-schematics/test.sh` specifies a
|
||||||
|
# ChromeDriver version that is compatible with the Chrome version in the image.
|
||||||
executors:
|
executors:
|
||||||
default-executor:
|
default-executor:
|
||||||
parameters:
|
parameters:
|
||||||
@ -112,7 +120,7 @@ commands:
|
|||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
# Install GTK+ graphical user interface (libgtk-3-0), advanced linux sound architecture (libasound2)
|
# Install GTK+ graphical user interface (libgtk-3-0), advanced linux sound architecture (libasound2)
|
||||||
# and network security service libraries (libnss3) & X11 Screen Saver extension library (libssx1)
|
# and network security service libraries (libnss3) & X11 Screen Saver extension library (libssx1)
|
||||||
# which are dependencies of chrome & needed for karma & protractor headless chrome tests.
|
# which are dependendies of chrome & needed for karma & protractor headless chrome tests.
|
||||||
# This is a very small install which takes around 7s in comparing to using the full
|
# This is a very small install which takes around 7s in comparing to using the full
|
||||||
# circleci/node:x.x.x-browsers image.
|
# circleci/node:x.x.x-browsers image.
|
||||||
sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1
|
sudo apt-get -y install libgtk-3-0 libasound2 libnss3 libxss1
|
||||||
@ -151,8 +159,29 @@ commands:
|
|||||||
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
|
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
|
||||||
git config --global gc.auto 0 || true
|
git config --global gc.auto 0 || true
|
||||||
|
|
||||||
|
init_saucelabs_environment:
|
||||||
|
description: Sets up a domain that resolves to the local host.
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Preparing environment for running tests on Saucelabs.
|
||||||
|
command: |
|
||||||
|
# For SauceLabs jobs, we set up a domain which resolves to the machine which launched
|
||||||
|
# the tunnel. We do this because devices are sometimes not able to properly resolve
|
||||||
|
# `localhost` or `127.0.0.1` through the SauceLabs tunnel. Using a domain that does not
|
||||||
|
# resolve to anything on SauceLabs VMs ensures that such requests are always resolved
|
||||||
|
# through the tunnel, and resolve to the actual tunnel host machine (i.e. the CircleCI VM).
|
||||||
|
# More context can be found in: https://github.com/angular/angular/pull/35171.
|
||||||
|
setPublicVar SAUCE_LOCALHOST_ALIAS_DOMAIN "angular-ci.local"
|
||||||
|
setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev)
|
||||||
|
- run:
|
||||||
|
# Sets up a local domain in the machine's host file that resolves to the local
|
||||||
|
# host. This domain is helpful in Saucelabs tests where devices are not able to
|
||||||
|
# properly resolve `localhost` or `127.0.0.1` through the sauce-connect tunnel.
|
||||||
|
name: Setting up alias domain for local host.
|
||||||
|
command: echo "127.0.0.1 $SAUCE_LOCALHOST_ALIAS_DOMAIN" | sudo tee -a /etc/hosts
|
||||||
|
|
||||||
# Normally this would be an individual job instead of a command.
|
# Normally this would be an individual job instead of a command.
|
||||||
# But startup and setup time for each individual windows job are high enough to discourage
|
# But startup and setup time for each invidual windows job are high enough to discourage
|
||||||
# many small jobs, so instead we use a command for setup unless the gain becomes significant.
|
# many small jobs, so instead we use a command for setup unless the gain becomes significant.
|
||||||
setup_win:
|
setup_win:
|
||||||
description: Setup windows node environment
|
description: Setup windows node environment
|
||||||
@ -246,8 +275,109 @@ jobs:
|
|||||||
- run: yarn -s tslint
|
- run: yarn -s tslint
|
||||||
- run: yarn -s ng-dev format changed $CI_GIT_BASE_REVISION --check
|
- run: yarn -s ng-dev format changed $CI_GIT_BASE_REVISION --check
|
||||||
- run: yarn -s ts-circular-deps:check
|
- run: yarn -s ts-circular-deps:check
|
||||||
|
- run: yarn -s ng-dev pullapprove verify
|
||||||
- run: yarn -s ng-dev commit-message validate-range --range $CI_COMMIT_RANGE
|
- run: yarn -s ng-dev commit-message validate-range --range $CI_COMMIT_RANGE
|
||||||
|
|
||||||
|
test:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
# Now that large integration tests are running locally in parallel (they can't run on RBE yet
|
||||||
|
# as they require network access for yarn install), this test is running out of memory
|
||||||
|
# consistently with the xlarge machine.
|
||||||
|
# TODO: switch back to xlarge once integration tests are running on remote-exec
|
||||||
|
resource_class: 2xlarge+
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- install_chrome_libs
|
||||||
|
- install_java
|
||||||
|
- run:
|
||||||
|
command: yarn bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-ivy-only
|
||||||
|
no_output_timeout: 20m
|
||||||
|
|
||||||
|
# Temporary job to test what will happen when we flip the Ivy flag to true
|
||||||
|
test_ivy_aot:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
resource_class: xlarge
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- install_chrome_libs
|
||||||
|
# We need to explicitly specify the --symlink_prefix option because otherwise we would
|
||||||
|
# not be able to easily find the output bin directory when uploading artifacts for size
|
||||||
|
# measurements.
|
||||||
|
- run:
|
||||||
|
command: yarn test-ivy-aot //... --symlink_prefix=dist/
|
||||||
|
no_output_timeout: 20m
|
||||||
|
|
||||||
|
# Publish bundle artifacts which will be used to calculate the size change. **Note**: Make
|
||||||
|
# sure that the size plugin from the Angular robot fetches the artifacts from this CircleCI
|
||||||
|
# job (see .github/angular-robot.yml). Additionally any artifacts need to be stored with the
|
||||||
|
# following path format: "{projectName}/{context}/{fileName}". This format is necessary
|
||||||
|
# because otherwise the bot is not able to pick up the artifacts from CircleCI. See:
|
||||||
|
# https://github.com/angular/github-robot/blob/master/functions/src/plugins/size.ts#L392-L394
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js
|
||||||
|
destination: core/hello_world/bundle
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist/bin/packages/core/test/bundling/todo/bundle.min.js
|
||||||
|
destination: core/todo/bundle
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist/bin/packages/core/test/bundling/hello_world/bundle.min.js.br
|
||||||
|
destination: core/hello_world/bundle.br
|
||||||
|
- store_artifacts:
|
||||||
|
path: dist/bin/packages/core/test/bundling/todo/bundle.min.js.br
|
||||||
|
destination: core/todo/bundle.br
|
||||||
|
|
||||||
|
# NOTE: This is currently limited to master builds only. See the `monitoring` configuration.
|
||||||
|
saucelabs_view_engine:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
# In order to avoid the bottleneck of having a slow host machine, we acquire a better
|
||||||
|
# container for this job. This is necessary because we launch a lot of browsers concurrently
|
||||||
|
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
|
||||||
|
resource_class: xlarge
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- init_saucelabs_environment
|
||||||
|
- run:
|
||||||
|
name: Run Bazel tests on Saucelabs with ViewEngine
|
||||||
|
# See /tools/saucelabs/README.md for more info
|
||||||
|
command: |
|
||||||
|
yarn bazel run //tools/saucelabs:sauce_service_setup
|
||||||
|
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "ivy-only", ...) except attr("tags", "fixme-saucelabs-ve", ...)')
|
||||||
|
yarn bazel test --config=saucelabs ${TESTS}
|
||||||
|
yarn bazel run //tools/saucelabs:sauce_service_stop
|
||||||
|
no_output_timeout: 40m
|
||||||
|
- notify_webhook_on_fail:
|
||||||
|
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
|
||||||
|
|
||||||
|
# NOTE: This is currently limited to master builds only. See the `monitoring` configuration.
|
||||||
|
saucelabs_ivy:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
# In order to avoid the bottleneck of having a slow host machine, we acquire a better
|
||||||
|
# container for this job. This is necessary because we launch a lot of browsers concurrently
|
||||||
|
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
|
||||||
|
resource_class: xlarge
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- init_saucelabs_environment
|
||||||
|
- run:
|
||||||
|
name: Run Bazel tests on Saucelabs with Ivy
|
||||||
|
# See /tools/saucelabs/README.md for more info
|
||||||
|
command: |
|
||||||
|
yarn bazel run //tools/saucelabs:sauce_service_setup
|
||||||
|
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "no-ivy-aot", ...) except attr("tags", "fixme-saucelabs-ivy", ...)')
|
||||||
|
yarn bazel test --config=saucelabs --config=ivy ${TESTS}
|
||||||
|
yarn bazel run //tools/saucelabs:sauce_service_stop
|
||||||
|
no_output_timeout: 40m
|
||||||
|
- notify_webhook_on_fail:
|
||||||
|
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
|
||||||
|
|
||||||
test_aio:
|
test_aio:
|
||||||
executor: default-executor
|
executor: default-executor
|
||||||
steps:
|
steps:
|
||||||
@ -266,6 +396,10 @@ jobs:
|
|||||||
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
||||||
# Run accessibility tests
|
# Run accessibility tests
|
||||||
- run: yarn --cwd aio test-a11y-score-localhost
|
- run: yarn --cwd aio test-a11y-score-localhost
|
||||||
|
# Check the bundle sizes.
|
||||||
|
- run: yarn --cwd aio payload-size
|
||||||
|
# Run unit tests for Firebase redirects
|
||||||
|
- run: yarn --cwd aio redirects-test
|
||||||
|
|
||||||
deploy_aio:
|
deploy_aio:
|
||||||
executor: default-executor
|
executor: default-executor
|
||||||
@ -295,6 +429,8 @@ jobs:
|
|||||||
- run: yarn --cwd aio e2e --configuration=ci
|
- run: yarn --cwd aio e2e --configuration=ci
|
||||||
# Run PWA-score tests
|
# Run PWA-score tests
|
||||||
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
- run: yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
||||||
|
# Check the bundle sizes.
|
||||||
|
- run: yarn --cwd aio payload-size aio-local<<# parameters.viewengine >>-viewengine<</ parameters.viewengine >>
|
||||||
|
|
||||||
test_aio_tools:
|
test_aio_tools:
|
||||||
executor: default-executor
|
executor: default-executor
|
||||||
@ -308,6 +444,26 @@ jobs:
|
|||||||
- run: yarn --cwd aio tools-test
|
- run: yarn --cwd aio tools-test
|
||||||
- run: ./aio/aio-builds-setup/scripts/test.sh
|
- run: ./aio/aio-builds-setup/scripts/test.sh
|
||||||
|
|
||||||
|
test_docs_examples:
|
||||||
|
parameters:
|
||||||
|
viewengine:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
resource_class: xlarge
|
||||||
|
parallelism: 5
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- install_chrome_libs
|
||||||
|
# Install aio
|
||||||
|
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||||
|
# Run examples tests. The "CIRCLE_NODE_INDEX" will be set if "parallelism" is enabled.
|
||||||
|
# Since the parallelism is set to "5", there will be five parallel CircleCI containers.
|
||||||
|
# with either "0", "1", etc as node index. This can be passed to the "--shard" argument.
|
||||||
|
- run: yarn --cwd aio example-e2e --setup --local <<# parameters.viewengine >>--viewengine<</ parameters.viewengine >> --cliSpecsConcurrency=5 --shard=${CIRCLE_NODE_INDEX}/${CIRCLE_NODE_TOTAL} --retry 2
|
||||||
|
|
||||||
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
|
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
|
||||||
aio_preview:
|
aio_preview:
|
||||||
executor: default-executor
|
executor: default-executor
|
||||||
@ -336,6 +492,7 @@ jobs:
|
|||||||
name: Wait for preview and run tests
|
name: Wait for preview and run tests
|
||||||
command: node aio/scripts/test-preview.js $CI_PULL_REQUEST $CI_COMMIT $CI_AIO_MIN_PWA_SCORE
|
command: node aio/scripts/test-preview.js $CI_PULL_REQUEST $CI_COMMIT $CI_AIO_MIN_PWA_SCORE
|
||||||
|
|
||||||
|
|
||||||
# The `build-npm-packages` tasks exist for backwards-compatibility with old scripts and
|
# The `build-npm-packages` tasks exist for backwards-compatibility with old scripts and
|
||||||
# tests that rely on the pre-Bazel `dist/packages-dist` output structure (build.sh).
|
# tests that rely on the pre-Bazel `dist/packages-dist` output structure (build.sh).
|
||||||
# Having multiple jobs that independently build in this manner duplicates some work; we build
|
# Having multiple jobs that independently build in this manner duplicates some work; we build
|
||||||
@ -347,7 +504,7 @@ jobs:
|
|||||||
build-npm-packages:
|
build-npm-packages:
|
||||||
executor:
|
executor:
|
||||||
name: default-executor
|
name: default-executor
|
||||||
resource_class: medium
|
resource_class: xlarge
|
||||||
steps:
|
steps:
|
||||||
- custom_attach_workspace
|
- custom_attach_workspace
|
||||||
- init_environment
|
- init_environment
|
||||||
@ -369,6 +526,246 @@ jobs:
|
|||||||
- "~/bazel_repository_cache"
|
- "~/bazel_repository_cache"
|
||||||
- "~/.cache/bazelisk"
|
- "~/.cache/bazelisk"
|
||||||
|
|
||||||
|
# Build the ivy npm packages.
|
||||||
|
build-ivy-npm-packages:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
resource_class: xlarge
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- run: node scripts/build/build-ivy-npm-packages.js
|
||||||
|
|
||||||
|
# Save the npm packages from //packages/... for other workflow jobs to read
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: *workspace_location
|
||||||
|
paths:
|
||||||
|
- ng/dist/packages-dist-ivy-aot
|
||||||
|
- ng/dist/zone.js-dist-ivy-aot
|
||||||
|
|
||||||
|
# This job creates compressed tarballs (`.tgz` files) for all Angular packages and stores them as
|
||||||
|
# build artifacts. This makes it easy to try out changes from a PR build for testing purposes.
|
||||||
|
# More info CircleCI build artifacts: https://circleci.com/docs/2.0/artifacts
|
||||||
|
#
|
||||||
|
# NOTE: Currently, this job only runs for PR builds. See `publish_snapshot` for non-PR builds.
|
||||||
|
publish_packages_as_artifacts:
|
||||||
|
executor: default-executor
|
||||||
|
environment:
|
||||||
|
NG_PACKAGES_DIR: &ng_packages_dir 'dist/packages-dist'
|
||||||
|
NG_PACKAGES_ARCHIVES_DIR: &ng_packages_archives_dir 'dist/packages-dist-archives'
|
||||||
|
ZONEJS_PACKAGES_DIR: &zonejs_packages_dir 'dist/zone.js-dist'
|
||||||
|
ZONEJS_PACKAGES_ARCHIVES_DIR: &zonejs_packages_archives_dir 'dist/zone.js-dist-archives'
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
# Publish `@angular/*` packages.
|
||||||
|
- run:
|
||||||
|
name: Create artifacts for @angular/* packages
|
||||||
|
command: ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $NG_PACKAGES_DIR $NG_PACKAGES_ARCHIVES_DIR
|
||||||
|
- store_artifacts:
|
||||||
|
path: *ng_packages_archives_dir
|
||||||
|
destination: angular
|
||||||
|
# Publish `zone.js` package.
|
||||||
|
- run:
|
||||||
|
name: Create artifacts for zone.js package
|
||||||
|
command: ./scripts/ci/create-package-archives.sh $CI_BRANCH $CI_COMMIT $ZONEJS_PACKAGES_DIR $ZONEJS_PACKAGES_ARCHIVES_DIR
|
||||||
|
- store_artifacts:
|
||||||
|
path: *zonejs_packages_archives_dir
|
||||||
|
destination: zone.js
|
||||||
|
|
||||||
|
# This job updates the content of repos like github.com/angular/core-builds
|
||||||
|
# for every green build on angular/angular.
|
||||||
|
publish_snapshot:
|
||||||
|
executor: default-executor
|
||||||
|
steps:
|
||||||
|
# See below - ideally this job should not trigger for non-upstream builds.
|
||||||
|
# But since it does, we have to check this condition.
|
||||||
|
- run:
|
||||||
|
name: Skip this job for Pull Requests and Fork builds
|
||||||
|
# Note: Using `CIRCLE_*` env variables (instead of those defined in `env.sh` so that this
|
||||||
|
# step can be run before `init_environment`.
|
||||||
|
command: >
|
||||||
|
if [[ -n "${CIRCLE_PR_NUMBER}" ]] ||
|
||||||
|
[[ "$CIRCLE_PROJECT_USERNAME" != "angular" ]] ||
|
||||||
|
[[ "$CIRCLE_PROJECT_REPONAME" != "angular" ]]; then
|
||||||
|
circleci step halt
|
||||||
|
fi
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
# CircleCI has a config setting to force SSH for all github connections
|
||||||
|
# This is not compatible with our mechanism of using a Personal Access Token
|
||||||
|
# Clear the global setting
|
||||||
|
- run: git config --global --unset "url.ssh://git@github.com.insteadof"
|
||||||
|
- run:
|
||||||
|
name: Decrypt github credentials
|
||||||
|
# We need ensure that the same default digest is used for encoding and decoding with
|
||||||
|
# openssl. Openssl versions might have different default digests which can cause
|
||||||
|
# decryption failures based on the installed openssl version. https://stackoverflow.com/a/39641378/4317734
|
||||||
|
command: 'openssl aes-256-cbc -d -in .circleci/github_token -md md5 -k "${KEY}" -out ~/.git_credentials'
|
||||||
|
- run: ./scripts/ci/publish-build-artifacts.sh
|
||||||
|
|
||||||
|
aio_monitoring_stable:
|
||||||
|
executor: default-executor
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- install_chrome_libs
|
||||||
|
- run: setPublicVar_CI_STABLE_BRANCH
|
||||||
|
- run:
|
||||||
|
name: Check out `aio/` and yarn from the stable branch
|
||||||
|
command: |
|
||||||
|
git fetch origin $CI_STABLE_BRANCH
|
||||||
|
git checkout --force origin/$CI_STABLE_BRANCH -- aio/ .yarn/ .yarnrc
|
||||||
|
# Ignore yarn's engines check, because we checked out `aio/package.json` from the stable
|
||||||
|
# branch and there could be a node version skew, which is acceptable in this monitoring job.
|
||||||
|
- run: yarn config set ignore-engines true
|
||||||
|
- run:
|
||||||
|
name: Run tests against https://angular.io/
|
||||||
|
command: ./aio/scripts/test-production.sh https://angular.io/ $CI_AIO_MIN_PWA_SCORE
|
||||||
|
- notify_webhook_on_fail:
|
||||||
|
webhook_url_env_var: SLACK_CARETAKER_WEBHOOK_URL
|
||||||
|
- notify_webhook_on_fail:
|
||||||
|
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
|
||||||
|
|
||||||
|
aio_monitoring_next:
|
||||||
|
executor: default-executor
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- install_chrome_libs
|
||||||
|
- run:
|
||||||
|
name: Run tests against https://next.angular.io/
|
||||||
|
command: ./aio/scripts/test-production.sh https://next.angular.io/ $CI_AIO_MIN_PWA_SCORE
|
||||||
|
- notify_webhook_on_fail:
|
||||||
|
webhook_url_env_var: SLACK_CARETAKER_WEBHOOK_URL
|
||||||
|
- notify_webhook_on_fail:
|
||||||
|
webhook_url_env_var: SLACK_DEV_INFRA_CI_FAILURES_WEBHOOK_URL
|
||||||
|
|
||||||
|
legacy-unit-tests-saucelabs:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
# In order to avoid the bottleneck of having a slow host machine, we acquire a better
|
||||||
|
# container for this job. This is necessary because we launch a lot of browsers concurrently
|
||||||
|
# and therefore the tunnel and Karma need to process a lot of file requests and tests.
|
||||||
|
resource_class: xlarge
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
- init_saucelabs_environment
|
||||||
|
- run:
|
||||||
|
name: Starting Saucelabs tunnel service
|
||||||
|
command: ./tools/saucelabs/sauce-service.sh run
|
||||||
|
background: true
|
||||||
|
- run: yarn tsc -p packages
|
||||||
|
- run: yarn tsc -p modules
|
||||||
|
- run: yarn bazel build //packages/zone.js:npm_package
|
||||||
|
- run:
|
||||||
|
# Waiting on ready ensures that we don't run tests too early without Saucelabs not being ready.
|
||||||
|
name: Waiting for Saucelabs tunnel to connect
|
||||||
|
command: ./tools/saucelabs/sauce-service.sh ready-wait
|
||||||
|
- run:
|
||||||
|
name: Running tests on Saucelabs.
|
||||||
|
command: |
|
||||||
|
browsers=$(node -e 'console.log(require("./browser-providers.conf").sauceAliases.CI_REQUIRED.join(","))')
|
||||||
|
yarn karma start ./karma-js.conf.js --single-run --browsers=${browsers}
|
||||||
|
- run:
|
||||||
|
name: Stop Saucelabs tunnel service
|
||||||
|
command: ./tools/saucelabs/sauce-service.sh stop
|
||||||
|
|
||||||
|
# Job that runs all unit tests of the `angular/components` repository.
|
||||||
|
components-repo-unit-tests:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
resource_class: xlarge
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
# Restore the cache before cloning the repository because the clone script re-uses
|
||||||
|
# the restored repository if present. This reduces the amount of times the components
|
||||||
|
# repository needs to be cloned (this is slow and increases based on commits in the repo).
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- *components_repo_unit_tests_cache_key
|
||||||
|
# Whenever the `angular/components` SHA is updated, the cache key will no longer
|
||||||
|
# match. The fallback cache will still match, and CircleCI will restore the most
|
||||||
|
# recently cached repository folder. Without the fallback cache, we'd need to download
|
||||||
|
# the repository from scratch and it would slow down the job. This is because we can't
|
||||||
|
# clone the repository with reduced `--depth`, but rather need to clone the whole
|
||||||
|
# repository to be able to support arbitrary SHAs.
|
||||||
|
- *components_repo_unit_tests_cache_key_fallback
|
||||||
|
- run:
|
||||||
|
name: "Fetching angular/components repository"
|
||||||
|
command: ./scripts/ci/clone_angular_components_repo.sh
|
||||||
|
- run:
|
||||||
|
# Run yarn install to fetch the Bazel binaries as used in the components repo.
|
||||||
|
name: Installing dependencies.
|
||||||
|
# TODO: remove this once the repo has been updated to use NodeJS v12 and Yarn 1.19.1.
|
||||||
|
# We temporarily ignore the "engines" because the Angular components repository has
|
||||||
|
# minimum dependency on NodeJS v12 and Yarn 1.19.1, but the framework repository uses
|
||||||
|
# older versions.
|
||||||
|
command: yarn --ignore-engines --cwd ${COMPONENTS_REPO_TMP_DIR} install --frozen-lockfile --non-interactive
|
||||||
|
- save_cache:
|
||||||
|
key: *components_repo_unit_tests_cache_key
|
||||||
|
paths:
|
||||||
|
# Temporary directory must be kept in sync with the `$COMPONENTS_REPO_TMP_DIR` env
|
||||||
|
# variable. It needs to be hardcoded here, because env variables interpolation is
|
||||||
|
# not supported.
|
||||||
|
- "/tmp/angular-components-repo"
|
||||||
|
- run:
|
||||||
|
# Updates the `angular/components` `package.json` file to refer to the release output
|
||||||
|
# inside the `packages-dist` directory. Note that it's not necessary to perform a yarn
|
||||||
|
# install as Bazel runs Yarn automatically when needed.
|
||||||
|
name: Setting up release packages.
|
||||||
|
command: node scripts/ci/update-deps-to-dist-packages.js ${COMPONENTS_REPO_TMP_DIR}/package.json dist/packages-dist/
|
||||||
|
- run:
|
||||||
|
name: "Running `angular/components` unit tests"
|
||||||
|
command: ./scripts/ci/run_angular_components_unit_tests.sh
|
||||||
|
|
||||||
|
test_zonejs:
|
||||||
|
executor:
|
||||||
|
name: default-executor
|
||||||
|
resource_class: xlarge
|
||||||
|
steps:
|
||||||
|
- custom_attach_workspace
|
||||||
|
- init_environment
|
||||||
|
# Install
|
||||||
|
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
|
||||||
|
# Run zone.js tools tests
|
||||||
|
- run: yarn --cwd packages/zone.js promisetest
|
||||||
|
- run: yarn --cwd packages/zone.js promisefinallytest
|
||||||
|
- run: yarn bazel build //packages/zone.js:npm_package &&
|
||||||
|
cp dist/bin/packages/zone.js/npm_package/dist/zone-mix.js ./packages/zone.js/test/extra/ &&
|
||||||
|
cp dist/bin/packages/zone.js/npm_package/dist/zone-patch-electron.js ./packages/zone.js/test/extra/ &&
|
||||||
|
yarn --cwd packages/zone.js electrontest
|
||||||
|
- run: yarn --cwd packages/zone.js jesttest
|
||||||
|
|
||||||
|
# Windows jobs
|
||||||
|
# Docs: https://circleci.com/docs/2.0/hello-world-windows/
|
||||||
|
test_win:
|
||||||
|
executor: windows-executor
|
||||||
|
steps:
|
||||||
|
- setup_win
|
||||||
|
- run:
|
||||||
|
# Ran into a command parsing problem where `-browser:chromium-local` was converted to
|
||||||
|
# `-browser: chromium-local` (a space was added) in https://circleci.com/gh/angular/angular/357511.
|
||||||
|
# Probably a powershell command parsing thing. There's no problem using a yarn script though.
|
||||||
|
command: yarn circleci-win-ve
|
||||||
|
no_output_timeout: 45m
|
||||||
|
# Save bazel repository cache to use on subsequent runs.
|
||||||
|
# We don't save node_modules because it's faster to use the linux workspace and reinstall.
|
||||||
|
- save_cache:
|
||||||
|
key: *cache_key_win
|
||||||
|
paths:
|
||||||
|
- "C:/Users/circleci/bazel_repository_cache"
|
||||||
|
|
||||||
|
test_ivy_aot_win:
|
||||||
|
executor: windows-executor
|
||||||
|
steps:
|
||||||
|
- setup_win
|
||||||
|
- run:
|
||||||
|
command: yarn circleci-win-ivy
|
||||||
|
no_output_timeout: 45m
|
||||||
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
@ -381,9 +778,21 @@ workflows:
|
|||||||
- lint:
|
- lint:
|
||||||
requires:
|
requires:
|
||||||
- setup
|
- setup
|
||||||
|
- test:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
|
- test_ivy_aot:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
- build-npm-packages:
|
- build-npm-packages:
|
||||||
requires:
|
requires:
|
||||||
- setup
|
- setup
|
||||||
|
- build-ivy-npm-packages:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
|
- legacy-unit-tests-saucelabs:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
- test_aio:
|
- test_aio:
|
||||||
requires:
|
requires:
|
||||||
- setup
|
- setup
|
||||||
@ -393,9 +802,22 @@ workflows:
|
|||||||
- test_aio_local:
|
- test_aio_local:
|
||||||
requires:
|
requires:
|
||||||
- build-npm-packages
|
- build-npm-packages
|
||||||
|
- test_aio_local:
|
||||||
|
name: test_aio_local_viewengine
|
||||||
|
viewengine: true
|
||||||
|
requires:
|
||||||
|
- build-npm-packages
|
||||||
- test_aio_tools:
|
- test_aio_tools:
|
||||||
requires:
|
requires:
|
||||||
- build-npm-packages
|
- build-npm-packages
|
||||||
|
- test_docs_examples:
|
||||||
|
requires:
|
||||||
|
- build-npm-packages
|
||||||
|
- test_docs_examples:
|
||||||
|
name: test_docs_examples_viewengine
|
||||||
|
viewengine: true
|
||||||
|
requires:
|
||||||
|
- build-npm-packages
|
||||||
- aio_preview:
|
- aio_preview:
|
||||||
# Only run on PR builds. (There can be no previews for non-PR builds.)
|
# Only run on PR builds. (There can be no previews for non-PR builds.)
|
||||||
<<: *only_on_pull_requests
|
<<: *only_on_pull_requests
|
||||||
@ -404,3 +826,78 @@ workflows:
|
|||||||
- test_aio_preview:
|
- test_aio_preview:
|
||||||
requires:
|
requires:
|
||||||
- aio_preview
|
- aio_preview
|
||||||
|
- publish_packages_as_artifacts:
|
||||||
|
requires:
|
||||||
|
- build-npm-packages
|
||||||
|
- publish_snapshot:
|
||||||
|
# Note: no filters on this job because we want it to run for all upstream branches
|
||||||
|
# We'd really like to filter out pull requests here, but not yet available:
|
||||||
|
# https://discuss.circleci.com/t/workflows-pull-request-filter/14396/4
|
||||||
|
# Instead, the job just exits immediately at the first step.
|
||||||
|
requires:
|
||||||
|
# Only publish if tests and integration tests pass
|
||||||
|
- test
|
||||||
|
- test_ivy_aot
|
||||||
|
# Only publish if `aio`/`docs` tests using the locally built Angular packages pass
|
||||||
|
- test_aio_local
|
||||||
|
- test_aio_local_viewengine
|
||||||
|
- test_docs_examples
|
||||||
|
- test_docs_examples_viewengine
|
||||||
|
# Get the artifacts to publish from the build-packages-dist job
|
||||||
|
# since the publishing script expects the legacy outputs layout.
|
||||||
|
- build-npm-packages
|
||||||
|
- build-ivy-npm-packages
|
||||||
|
- legacy-unit-tests-saucelabs
|
||||||
|
- components-repo-unit-tests:
|
||||||
|
requires:
|
||||||
|
- build-npm-packages
|
||||||
|
- test_zonejs:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
|
# Windows Jobs
|
||||||
|
# These are very slow so we run them on non-PRs only for now.
|
||||||
|
# TODO: remove the filter when CircleCI makes Windows FS faster.
|
||||||
|
# The Windows jobs are only run after their non-windows counterparts finish successfully.
|
||||||
|
# This isn't strictly necessary as there is no artifact dependency, but helps economize
|
||||||
|
# CI resources by not attempting to build when we know should fail.
|
||||||
|
- test_win:
|
||||||
|
<<: *skip_on_pull_requests
|
||||||
|
requires:
|
||||||
|
- test
|
||||||
|
- test_ivy_aot_win:
|
||||||
|
<<: *skip_on_pull_requests
|
||||||
|
requires:
|
||||||
|
- test_ivy_aot
|
||||||
|
|
||||||
|
monitoring:
|
||||||
|
jobs:
|
||||||
|
- setup
|
||||||
|
- aio_monitoring_stable:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
|
- aio_monitoring_next:
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
|
- saucelabs_ivy:
|
||||||
|
# Testing saucelabs via Bazel currently taking longer than the legacy saucelabs job as it
|
||||||
|
# each karma_web_test target is provisioning and tearing down browsers which is adding
|
||||||
|
# a lot of overhead. Running once daily on master only to avoid wasting resources and
|
||||||
|
# slowing down CI for PRs.
|
||||||
|
# TODO: Run this job on all branches (including PRs) once karma_web_test targets can
|
||||||
|
# share provisioned browsers and we can remove the legacy saucelabs job.
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
|
- saucelabs_view_engine:
|
||||||
|
# Testing saucelabs via Bazel currently taking longer than the legacy saucelabs job as it
|
||||||
|
# each karma_web_test target is provisioning and tearing down browsers which is adding
|
||||||
|
# a lot of overhead. Running once daily on master only to avoid wasting resources and
|
||||||
|
# slowing down CI for PRs.
|
||||||
|
# TODO: Run this job on all branches (including PRs) once karma_web_test targets can
|
||||||
|
# share provisioned browsers and we can remove the legacy saucelabs job.
|
||||||
|
requires:
|
||||||
|
- setup
|
||||||
|
triggers:
|
||||||
|
- schedule:
|
||||||
|
<<: *only_on_master
|
||||||
|
# Runs monitoring jobs at 10:00AM every day.
|
||||||
|
cron: "0 10 * * *"
|
||||||
|
@ -17,7 +17,7 @@ echo "source $envHelpersPath;" >> $BASH_ENV;
|
|||||||
####################################################################################################
|
####################################################################################################
|
||||||
setPublicVar CI "$CI"
|
setPublicVar CI "$CI"
|
||||||
setPublicVar PROJECT_ROOT "$projectDir";
|
setPublicVar PROJECT_ROOT "$projectDir";
|
||||||
setPublicVar CI_AIO_MIN_PWA_SCORE "62";
|
setPublicVar CI_AIO_MIN_PWA_SCORE "95";
|
||||||
# This is the branch being built; e.g. `pull/12345` for PR builds.
|
# This is the branch being built; e.g. `pull/12345` for PR builds.
|
||||||
setPublicVar CI_BRANCH "$CIRCLE_BRANCH";
|
setPublicVar CI_BRANCH "$CIRCLE_BRANCH";
|
||||||
setPublicVar CI_BUILD_URL "$CIRCLE_BUILD_URL";
|
setPublicVar CI_BUILD_URL "$CIRCLE_BUILD_URL";
|
||||||
@ -74,7 +74,7 @@ setPublicVar COMPONENTS_REPO_TMP_DIR "/tmp/angular-components-repo"
|
|||||||
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
|
setPublicVar COMPONENTS_REPO_URL "https://github.com/angular/components.git"
|
||||||
setPublicVar COMPONENTS_REPO_BRANCH "master"
|
setPublicVar COMPONENTS_REPO_BRANCH "master"
|
||||||
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
|
# **NOTE**: When updating the commit SHA, also update the cache key in the CircleCI `config.yml`.
|
||||||
setPublicVar COMPONENTS_REPO_COMMIT "09e68db8ed5b1253f2fe38ff954ef0df019fc25a"
|
setPublicVar COMPONENTS_REPO_COMMIT "caad0b54ed41949f0ee529c152508749875bc9af"
|
||||||
|
|
||||||
|
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
|
@ -60,12 +60,11 @@ if (require.resolve === module) {
|
|||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
function _main(args) {
|
function _main(args) {
|
||||||
triggerWebhook(...args)
|
triggerWebhook(...args).
|
||||||
.then(
|
then(({statusCode, responseText}) => (200 <= statusCode && statusCode < 400) ?
|
||||||
({statusCode, responseText}) => (200 <= statusCode && statusCode < 400) ?
|
|
||||||
console.log(`Status: ${statusCode}\n${responseText}`) :
|
console.log(`Status: ${statusCode}\n${responseText}`) :
|
||||||
Promise.reject(new Error(`Request failed (status: ${statusCode}): ${responseText}`)))
|
Promise.reject(new Error(`Request failed (status: ${statusCode}): ${responseText}`))).
|
||||||
.catch(err => {
|
catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
@ -78,12 +77,15 @@ function postJson(url, data) {
|
|||||||
const statusCode = res.statusCode || -1;
|
const statusCode = res.statusCode || -1;
|
||||||
let responseText = '';
|
let responseText = '';
|
||||||
|
|
||||||
res.on('error', reject)
|
res.
|
||||||
.on('data', d => responseText += d)
|
on('error', reject).
|
||||||
.on('end', () => resolve({statusCode, responseText}));
|
on('data', d => responseText += d).
|
||||||
|
on('end', () => resolve({statusCode, responseText}));
|
||||||
};
|
};
|
||||||
|
|
||||||
request(url, opts, onResponse).on('error', reject).end(JSON.stringify(data));
|
request(url, opts, onResponse).
|
||||||
|
on('error', reject).
|
||||||
|
end(JSON.stringify(data));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
69
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
Normal file
69
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F41EBug report"
|
||||||
|
about: Report a bug in the Angular Framework
|
||||||
|
---
|
||||||
|
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
||||||
|
|
||||||
|
Oh hi there! 😄
|
||||||
|
|
||||||
|
To expedite issue processing please search open and closed issues before submitting a new one.
|
||||||
|
Existing issues often contain information about workarounds, resolution, or progress updates.
|
||||||
|
|
||||||
|
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
||||||
|
|
||||||
|
|
||||||
|
# 🐞 bug report
|
||||||
|
|
||||||
|
### Affected Package
|
||||||
|
<!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->
|
||||||
|
<!-- ✍️edit: --> The issue is caused by package @angular/....
|
||||||
|
|
||||||
|
|
||||||
|
### Is this a regression?
|
||||||
|
|
||||||
|
<!-- Did this behavior use to work in the previous version? -->
|
||||||
|
<!-- ✍️--> Yes, the previous version in which this bug was not present was: ....
|
||||||
|
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
<!-- ✍️--> A clear and concise description of the problem...
|
||||||
|
|
||||||
|
|
||||||
|
## 🔬 Minimal Reproduction
|
||||||
|
<!--
|
||||||
|
Please create and share minimal reproduction of the issue starting with this template: https://stackblitz.com/fork/angular-issue-repro2
|
||||||
|
-->
|
||||||
|
<!-- ✍️--> https://stackblitz.com/...
|
||||||
|
|
||||||
|
<!--
|
||||||
|
If StackBlitz is not suitable for reproduction of your issue, please create a minimal GitHub repository with the reproduction of the issue.
|
||||||
|
A good way to make a minimal reproduction is to create a new app via `ng new repro-app` and add the minimum possible code to show the problem.
|
||||||
|
Share the link to the repo below along with step-by-step instructions to reproduce the problem, as well as expected and actual behavior.
|
||||||
|
|
||||||
|
Issues that don't have enough info and can't be reproduced will be closed.
|
||||||
|
|
||||||
|
You can read more about issue submission guidelines here: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-an-issue
|
||||||
|
-->
|
||||||
|
|
||||||
|
## 🔥 Exception or Error
|
||||||
|
<pre><code>
|
||||||
|
<!-- If the issue is accompanied by an exception or an error, please share it below: -->
|
||||||
|
<!-- ✍️-->
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
## 🌍 Your Environment
|
||||||
|
|
||||||
|
**Angular Version:**
|
||||||
|
<pre><code>
|
||||||
|
<!-- run `ng version` and paste output below -->
|
||||||
|
<!-- ✍️-->
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
**Anything else relevant?**
|
||||||
|
<!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->
|
||||||
|
|
||||||
|
<!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->
|
32
.github/ISSUE_TEMPLATE/2-feature-request.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/2-feature-request.md
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F680Feature request"
|
||||||
|
about: Suggest a feature for Angular Framework
|
||||||
|
|
||||||
|
---
|
||||||
|
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
||||||
|
|
||||||
|
Oh hi there! 😄
|
||||||
|
|
||||||
|
To expedite issue processing please search open and closed issues before submitting a new one.
|
||||||
|
Existing issues often contain information about workarounds, resolution, or progress updates.
|
||||||
|
|
||||||
|
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
||||||
|
|
||||||
|
|
||||||
|
# 🚀 feature request
|
||||||
|
|
||||||
|
### Relevant Package
|
||||||
|
<!-- Can you pin-point one or more @angular/* packages the are relevant for this feature request? -->
|
||||||
|
<!-- ✍️edit: --> This feature request is for @angular/....
|
||||||
|
|
||||||
|
|
||||||
|
### Description
|
||||||
|
<!-- ✍️--> A clear and concise description of the problem or missing capability...
|
||||||
|
|
||||||
|
|
||||||
|
### Describe the solution you'd like
|
||||||
|
<!-- ✍️--> If you have a solution in mind, please describe it.
|
||||||
|
|
||||||
|
|
||||||
|
### Describe alternatives you've considered
|
||||||
|
<!-- ✍️--> Have you considered any alternative solutions or workarounds?
|
55
.github/ISSUE_TEMPLATE/3-docs-bug.md
vendored
Normal file
55
.github/ISSUE_TEMPLATE/3-docs-bug.md
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
name: "📚 Docs or angular.io issue report"
|
||||||
|
about: Report an issue in Angular's documentation or angular.io application
|
||||||
|
|
||||||
|
---
|
||||||
|
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
||||||
|
|
||||||
|
Oh hi there! 😄
|
||||||
|
|
||||||
|
To expedite issue processing please search open and closed issues before submitting a new one.
|
||||||
|
Existing issues often contain information about workarounds, resolution, or progress updates.
|
||||||
|
|
||||||
|
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
||||||
|
|
||||||
|
# 📚 Docs or angular.io bug report
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
<!-- ✍️edit:--> A clear and concise description of the problem...
|
||||||
|
|
||||||
|
|
||||||
|
## 🔬 Minimal Reproduction
|
||||||
|
|
||||||
|
### What's the affected URL?**
|
||||||
|
<!-- ✍️edit:--> https://angular.io/...
|
||||||
|
|
||||||
|
### Reproduction Steps**
|
||||||
|
<!-- If applicable please list the steps to take to reproduce the issue -->
|
||||||
|
<!-- ✍️edit:-->
|
||||||
|
|
||||||
|
### Expected vs Actual Behavior**
|
||||||
|
<!-- If applicable please describe the difference between the expected and actual behavior after following the repro steps. -->
|
||||||
|
<!-- ✍️edit:-->
|
||||||
|
|
||||||
|
|
||||||
|
## 📷Screenshot
|
||||||
|
<!-- Often a screenshot can help to capture the issue better than a long description. -->
|
||||||
|
<!-- ✍️upload a screenshot:-->
|
||||||
|
|
||||||
|
|
||||||
|
## 🔥 Exception or Error
|
||||||
|
<pre><code>
|
||||||
|
<!-- If the issue is accompanied by an exception or an error, please share it below: -->
|
||||||
|
<!-- ✍️-->
|
||||||
|
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
|
## 🌍 Your Environment
|
||||||
|
|
||||||
|
### Browser info
|
||||||
|
<!-- ✍️Is this a browser specific issue? If so, please specify the device, browser, and version. -->
|
||||||
|
|
||||||
|
### Anything else relevant?
|
||||||
|
<!-- ✍️Please provide additional info if necessary. -->
|
11
.github/ISSUE_TEMPLATE/4-security-issue-disclosure.md
vendored
Normal file
11
.github/ISSUE_TEMPLATE/4-security-issue-disclosure.md
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
name: ⚠️ Security issue disclosure
|
||||||
|
about: Report a security issue in Angular Framework, Material, or CLI
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please read https://angular.io/guide/security#report-issues on how to disclose security related issues.
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
16
.github/ISSUE_TEMPLATE/5-support-request.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/5-support-request.md
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: "❓Support request"
|
||||||
|
about: Questions and requests for support
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please do not file questions or support requests on the GitHub issues tracker.
|
||||||
|
|
||||||
|
You can get your questions answered using other communication channels. Please see:
|
||||||
|
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
|
||||||
|
|
||||||
|
Thank you!
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
13
.github/ISSUE_TEMPLATE/6-angular-cli.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/6-angular-cli.md
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F6E0️Angular CLI"
|
||||||
|
about: Issues and feature requests for Angular CLI
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please file any Angular CLI issues at: https://github.com/angular/angular-cli/issues/new
|
||||||
|
|
||||||
|
For the time being, we keep Angular CLI issues in a separate repository.
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
13
.github/ISSUE_TEMPLATE/7-angular-components.md
vendored
Normal file
13
.github/ISSUE_TEMPLATE/7-angular-components.md
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F48EAngular Components"
|
||||||
|
about: Issues and feature requests for Angular Components
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
||||||
|
|
||||||
|
Please file any Angular Components issues at: https://github.com/angular/components/issues/new
|
||||||
|
|
||||||
|
For the time being, we keep Angular Components issues in a separate repository.
|
||||||
|
|
||||||
|
🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑🛑
|
22
.github/ISSUE_TEMPLATE/8-translate-docs.md
vendored
22
.github/ISSUE_TEMPLATE/8-translate-docs.md
vendored
@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
name: "📚Traducir doc al español"
|
|
||||||
about: Solicitud para traducir ciertos docs al español
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
📚Traducir: <!-- ✍️ editar: --> creating-libraries.md
|
|
||||||
|
|
||||||
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
|
|
||||||
|
|
||||||
Traducción de la documentación oficial de Angular a español
|
|
||||||
|
|
||||||
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
|
|
||||||
|
|
||||||
|
|
||||||
## Nombre del archivo:
|
|
||||||
<!-- ✍️ editar: --> creating-libraries.md
|
|
||||||
|
|
||||||
|
|
||||||
## Ruta donde se encuentra el archivo dentro del proyecto de Angular
|
|
||||||
|
|
||||||
<!-- ✍️ editar: --> https://github.com/angular-hispano/angular/blob/master/aio/content/guide/creating-libraries.md
|
|
62
.github/PULL_REQUEST_TEMPLATE.md
vendored
62
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,35 +1,43 @@
|
|||||||
## Lista de Verificación del PR
|
## PR Checklist
|
||||||
Comprueba si tu PR cumple los siguientes requisitos:
|
Please check if your PR fulfills the following requirements:
|
||||||
|
|
||||||
- [ ] El mensaje de commit esta conforme con [nuestras reglas](https://github.com/angular-hispano/angular/blob/master/CONTRIBUTING.md#-formato-para-el-mensaje-de-los-commits)
|
- [ ] The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
|
||||||
- [ ] Probe los cambios que agregué (arreglo de bugs / funcionalidades)
|
- [ ] Tests for the changes have been added (for bug fixes / features)
|
||||||
- [ ] Revisé previamente las traducciones o cambios de contenido
|
- [ ] Docs have been added / updated (for bug fixes / features)
|
||||||
- [ ] Consulté el [diccionario de términos](https://github.com/angular-hispano/angular/blob/master/aio/diccionario-de-términos.md) en español
|
|
||||||
- [ ] He creado dos archivos con la extensión correspondiente(.en.md para el archivo en inglés y .md para el Archivo en español)
|
|
||||||
- [ ] He enlazado el commit con el issue correspondiente <!-- ejemplo Fixes #X -->
|
|
||||||
|
|
||||||
|
|
||||||
## Tipo de PR
|
## PR Type
|
||||||
¿Qué tipo de cambio introduce este PR?
|
What kind of change does this PR introduce?
|
||||||
|
|
||||||
<!-- Marca con una "x" las opciones que aplican. -->
|
<!-- Please check the one that applies to this PR using "x". -->
|
||||||
|
|
||||||
- [ ] Bugfix
|
- [ ] Bugfix
|
||||||
- [ ] Funcionalidad
|
- [ ] Feature
|
||||||
- [ ] Actualización de el estilo del código (formato, variables locales)
|
- [ ] Code style update (formatting, local variables)
|
||||||
- [ ] Refactorización (no cambios en la funcionalidad, no cambios en el api)
|
- [ ] Refactoring (no functional changes, no api changes)
|
||||||
- [ ] Cambios relacionados al build
|
- [ ] Build related changes
|
||||||
- [ ] Cambios relacionados al CI (Integración continua)
|
- [ ] CI related changes
|
||||||
- [ ] Cambios en el contenido de la documentación
|
- [ ] Documentation content changes
|
||||||
- [ ] Cambios en la aplicación / infraestructura de angular.io
|
- [ ] angular.io application / infrastructure changes
|
||||||
- [ ] Otro... Por favor describe la:
|
- [ ] Other... Please describe:
|
||||||
|
|
||||||
## ¿Cuál es el comportamiento actual?
|
|
||||||
<!-- Describe el comportamiento actual que está modificando o vincule a un problema relevante.
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
## ¿Cuál es el nuevo comportamiento?
|
## What is the current behavior?
|
||||||
<!--
|
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
|
||||||
Ejemplo: Archivo en inglés traducido al español
|
|
||||||
-->
|
Issue Number: N/A
|
||||||
|
|
||||||
|
|
||||||
|
## What is the new behavior?
|
||||||
|
|
||||||
|
|
||||||
|
## Does this PR introduce a breaking change?
|
||||||
|
|
||||||
|
- [ ] Yes
|
||||||
|
- [ ] No
|
||||||
|
|
||||||
|
|
||||||
|
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
|
||||||
|
|
||||||
|
|
||||||
|
## Other information
|
||||||
|
6
.github/angular-robot.yml
vendored
6
.github/angular-robot.yml
vendored
@ -154,12 +154,6 @@ triage:
|
|||||||
-
|
-
|
||||||
- "type: RFC / Discussion / question"
|
- "type: RFC / Discussion / question"
|
||||||
- "comp: *"
|
- "comp: *"
|
||||||
-
|
|
||||||
- "type: confusing"
|
|
||||||
- "comp: *"
|
|
||||||
-
|
|
||||||
- "type: use-case"
|
|
||||||
- "comp: *"
|
|
||||||
|
|
||||||
# options for the triage PR plugin
|
# options for the triage PR plugin
|
||||||
triagePR:
|
triagePR:
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -42,6 +42,3 @@ yarn-error.log
|
|||||||
|
|
||||||
.notes.md
|
.notes.md
|
||||||
baseline.json
|
baseline.json
|
||||||
|
|
||||||
# Ignore .history for the xyz.local-history VSCode extension
|
|
||||||
.history
|
|
||||||
|
145
.gitmessage
145
.gitmessage
@ -1,145 +0,0 @@
|
|||||||
<type>(<scope>): <summary>
|
|
||||||
|
|
||||||
<Describe the motivation behind this change - explain WHY you are making this change. Wrap all lines
|
|
||||||
at 100 characters.>
|
|
||||||
|
|
||||||
Fixes #<issue number>
|
|
||||||
|
|
||||||
# ────────────────────────────────────────── 100 chars ────────────────────────────────────────────┤
|
|
||||||
|
|
||||||
|
|
||||||
# Example Commit Messages
|
|
||||||
# =======================
|
|
||||||
|
|
||||||
|
|
||||||
# ─── Example: Simple refactor ────────────────────────────────────────────────────────────────────┤
|
|
||||||
# refactor(core): rename refreshDynamicEmbeddedViews to refreshEmbeddedViews
|
|
||||||
#
|
|
||||||
# Improve code readability. The original name no longer matches how the function is used.
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
||||||
|
|
||||||
|
|
||||||
# ─── Example: Simple docs change ─────────────────────────────────────────────────────────────────┤
|
|
||||||
# docs: clarify the service limitation in providers.md guide
|
|
||||||
#
|
|
||||||
# Fixes #36332
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
||||||
|
|
||||||
|
|
||||||
# ─── Example: A bug fix ──────────────────────────────────────────────────────────────────────────┤
|
|
||||||
# fix(ngcc): ensure lockfile is removed when `analyzeFn` fails
|
|
||||||
#
|
|
||||||
# Previously an error thrown in the `analyzeFn` would cause the ngcc process to exit immediately
|
|
||||||
# without removing the lockfile, and potentially before the unlocker process had been successfully
|
|
||||||
# spawned resulting in the lockfile being orphaned and left behind.
|
|
||||||
#
|
|
||||||
# Now we catch these errors and remove the lockfile as needed.
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
||||||
|
|
||||||
|
|
||||||
# ─── Example: Breaking change ────────────────────────────────────────────────────────────────────┤
|
|
||||||
# feat(bazel): simplify ng_package by dropping esm5 and fesm5
|
|
||||||
#
|
|
||||||
# esm5 and fesm5 distributions are no longer needed and have been deprecated in the past.
|
|
||||||
#
|
|
||||||
# https://v9.angular.io/guide/deprecations#esm5-and-fesm5-code-formats-in-angular-npm-packages
|
|
||||||
#
|
|
||||||
# This commit modifies ng_package to no longer distribute these two formats in npm packages built by
|
|
||||||
# ng_package (e.g. @angular/core).
|
|
||||||
#
|
|
||||||
# This commit intentionally doesn't fully clean up the ng_package rule to remove all traces of esm5
|
|
||||||
# and fems5 build artifacts as that is a bigger cleanup and currently we are narrowing down the
|
|
||||||
# scope of this change to the MVP needed for v10, which in this case is 'do not put esm5 and fesm5'
|
|
||||||
# into the npm packages.
|
|
||||||
#
|
|
||||||
# More cleanup to follow: https://angular-team.atlassian.net/browse/FW-2143
|
|
||||||
#
|
|
||||||
# BREAKING CHANGE: esm5 and fesm5 format is no longer distributed in Angular's npm packages e.g.
|
|
||||||
# @angular/core
|
|
||||||
#
|
|
||||||
# Angular CLI will automatically downlevel the code to es5 if differential loading is enabled in the
|
|
||||||
# Angular project, so no action is required from Angular CLI users.
|
|
||||||
#
|
|
||||||
# If you are not using Angular CLI to build your application or library, and you need to be able to
|
|
||||||
# build es5 artifacts, then you will need to downlevel the distributed Angular code to es5 on your
|
|
||||||
# own.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Fixes #1234
|
|
||||||
# ─────────────────────────────────────────────────────────────────────────────────────────────────┤
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Angular Commit Message Format
|
|
||||||
# =============================
|
|
||||||
#
|
|
||||||
# The full specification of the Angular Commit Message Format can be found at
|
|
||||||
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
|
|
||||||
#
|
|
||||||
# The following is an excerpt of the specification with the most commonly needed info.
|
|
||||||
#
|
|
||||||
# Each commit message consists of a *header*, a *body*, and a *footer*.
|
|
||||||
#
|
|
||||||
# <header>
|
|
||||||
# <BLANK LINE>
|
|
||||||
# <body>
|
|
||||||
# <BLANK LINE>
|
|
||||||
# <footer>
|
|
||||||
#
|
|
||||||
# The header is mandatory.
|
|
||||||
#
|
|
||||||
# The body is mandatory for all commits except for those of scope "docs". When the body is required
|
|
||||||
# it must be at least 20 characters long.
|
|
||||||
#
|
|
||||||
# The footer is optional.
|
|
||||||
#
|
|
||||||
# Any line of the commit message cannot be longer than 100 characters.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Commit Message Header
|
|
||||||
# ---------------------
|
|
||||||
#
|
|
||||||
# <type>(<scope>): <short summary>
|
|
||||||
# │ │ │
|
|
||||||
# │ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
|
|
||||||
# │ │
|
|
||||||
# │ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core|
|
|
||||||
# │ elements|forms|http|language-service|localize|platform-browser|
|
|
||||||
# │ platform-browser-dynamic|platform-server|platform-webworker|
|
|
||||||
# │ platform-webworker-dynamic|router|service-worker|upgrade|zone.js|
|
|
||||||
# │ packaging|changelog|dev-infra|docs-infra|migrations|ngcc|ve
|
|
||||||
# │ https://github.com/angular/angular/blob/master/CONTRIBUTING.md#scope
|
|
||||||
# │
|
|
||||||
# └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|style|test
|
|
||||||
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Commit Message Body
|
|
||||||
# ---------------------
|
|
||||||
#
|
|
||||||
# Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
|
|
||||||
#
|
|
||||||
# Explain the motivation for the change in the commit message body. This commit message should
|
|
||||||
# explain WHY you are making the change. You can include a comparison of the previous behavior with
|
|
||||||
# the new behavior in order to illustrate the impact of the change.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Commit Message Footer
|
|
||||||
# ---------------------
|
|
||||||
#
|
|
||||||
# The footer can contain information about breaking changes and is also the place to reference
|
|
||||||
# GitHub issues, Jira tickets, and other PRs that this commit closes or is related to.
|
|
||||||
#
|
|
||||||
# ```
|
|
||||||
# BREAKING CHANGE: <breaking change summary>
|
|
||||||
# <BLANK LINE>
|
|
||||||
# <breaking change description + migration instructions>
|
|
||||||
# <BLANK LINE>
|
|
||||||
# <BLANK LINE>
|
|
||||||
# Fixes #<issue number>
|
|
||||||
# ```
|
|
||||||
#
|
|
||||||
# Breaking Change section should start with the phrase "BREAKING CHANGE: " followed by a summary of
|
|
||||||
# the breaking change, a blank line, and a detailed description of the breaking change that also
|
|
||||||
# includes migration instructions.
|
|
||||||
#
|
|
123
.ng-dev-config.ts
Normal file
123
.ng-dev-config.ts
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
import {MergeConfig} from './dev-infra/pr/merge/config';
|
||||||
|
|
||||||
|
// The configuration for `ng-dev commit-message` commands.
|
||||||
|
const commitMessage = {
|
||||||
|
'maxLength': 120,
|
||||||
|
'minBodyLength': 100,
|
||||||
|
'types': [
|
||||||
|
'build',
|
||||||
|
'ci',
|
||||||
|
'docs',
|
||||||
|
'feat',
|
||||||
|
'fix',
|
||||||
|
'perf',
|
||||||
|
'refactor',
|
||||||
|
'release',
|
||||||
|
'style',
|
||||||
|
'test',
|
||||||
|
],
|
||||||
|
'scopes': [
|
||||||
|
'animations',
|
||||||
|
'bazel',
|
||||||
|
'benchpress',
|
||||||
|
'changelog',
|
||||||
|
'common',
|
||||||
|
'compiler',
|
||||||
|
'compiler-cli',
|
||||||
|
'core',
|
||||||
|
'dev-infra',
|
||||||
|
'docs-infra',
|
||||||
|
'elements',
|
||||||
|
'forms',
|
||||||
|
'http',
|
||||||
|
'language-service',
|
||||||
|
'localize',
|
||||||
|
'ngcc',
|
||||||
|
'packaging',
|
||||||
|
'platform-browser',
|
||||||
|
'platform-browser-dynamic',
|
||||||
|
'platform-server',
|
||||||
|
'platform-webworker',
|
||||||
|
'platform-webworker-dynamic',
|
||||||
|
'router',
|
||||||
|
'service-worker',
|
||||||
|
'upgrade',
|
||||||
|
've',
|
||||||
|
'zone.js',
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
// The configuration for `ng-dev format` commands.
|
||||||
|
const format = {
|
||||||
|
'clang-format': {
|
||||||
|
'matchers': [
|
||||||
|
'dev-infra/**/*.{js,ts}',
|
||||||
|
'packages/**/*.{js,ts}',
|
||||||
|
'!packages/zone.js',
|
||||||
|
'!packages/common/locales/**/*.{js,ts}',
|
||||||
|
'!packages/common/src/i18n/available_locales.ts',
|
||||||
|
'!packages/common/src/i18n/currencies.ts',
|
||||||
|
'!packages/common/src/i18n/locale_en.ts',
|
||||||
|
'modules/benchmarks/**/*.{js,ts}',
|
||||||
|
'modules/playground/**/*.{js,ts}',
|
||||||
|
'tools/**/*.{js,ts}',
|
||||||
|
'!tools/gulp-tasks/cldr/extract.js',
|
||||||
|
'!tools/public_api_guard/**/*.d.ts',
|
||||||
|
'!tools/ts-api-guardian/test/fixtures/**',
|
||||||
|
'*.{js,ts}',
|
||||||
|
'!**/node_modules/**',
|
||||||
|
'!**/dist/**',
|
||||||
|
'!**/built/**',
|
||||||
|
'!shims_for_IE.js',
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'buildifier': true
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Github metadata information for `ng-dev` commands. */
|
||||||
|
const github = {
|
||||||
|
owner: 'angular',
|
||||||
|
name: 'angular',
|
||||||
|
};
|
||||||
|
|
||||||
|
// Configuration for the `ng-dev pr merge` command. The command can be used
|
||||||
|
// for merging upstream pull requests into branches based on a PR target label.
|
||||||
|
const merge = () => {
|
||||||
|
// TODO: resume dynamically determining patch branch
|
||||||
|
const patch = '10.0.x';
|
||||||
|
const config: MergeConfig = {
|
||||||
|
githubApiMerge: false,
|
||||||
|
claSignedLabel: 'cla: yes',
|
||||||
|
mergeReadyLabel: /^PR action: merge(-assistance)?/,
|
||||||
|
commitMessageFixupLabel: 'commit message fixup',
|
||||||
|
labels: [
|
||||||
|
{
|
||||||
|
pattern: 'PR target: master-only',
|
||||||
|
branches: ['master'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: 'PR target: patch-only',
|
||||||
|
branches: [patch],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: 'PR target: master & patch',
|
||||||
|
branches: ['master', patch],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
requiredBaseCommits: {
|
||||||
|
// PRs that target either `master` or the patch branch, need to be rebased
|
||||||
|
// on top of the latest commit message validation fix.
|
||||||
|
'master': '4341743b4a6d7e23c6f944aa9e34166b701369a1',
|
||||||
|
[patch]: '2a53f471592f424538802907aca1f60f1177a86d'
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Export function to build ng-dev configuration object.
|
||||||
|
module.exports = {
|
||||||
|
commitMessage,
|
||||||
|
format,
|
||||||
|
github,
|
||||||
|
merge,
|
||||||
|
};
|
@ -1,53 +0,0 @@
|
|||||||
import {CommitMessageConfig} from '../dev-infra/commit-message/config';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The configuration for `ng-dev commit-message` commands.
|
|
||||||
*/
|
|
||||||
export const commitMessage: CommitMessageConfig = {
|
|
||||||
maxLineLength: 120,
|
|
||||||
minBodyLength: 20,
|
|
||||||
minBodyLengthTypeExcludes: ['docs', 'upstream'],
|
|
||||||
types: [
|
|
||||||
'build',
|
|
||||||
'ci',
|
|
||||||
'docs',
|
|
||||||
'feat',
|
|
||||||
'fix',
|
|
||||||
'perf',
|
|
||||||
'refactor',
|
|
||||||
'release',
|
|
||||||
'style',
|
|
||||||
'test',
|
|
||||||
'upstream',
|
|
||||||
],
|
|
||||||
scopes: [
|
|
||||||
'animations',
|
|
||||||
'bazel',
|
|
||||||
'benchpress',
|
|
||||||
'changelog',
|
|
||||||
'common',
|
|
||||||
'compiler',
|
|
||||||
'compiler-cli',
|
|
||||||
'core',
|
|
||||||
'dev-infra',
|
|
||||||
'docs-infra',
|
|
||||||
'elements',
|
|
||||||
'forms',
|
|
||||||
'http',
|
|
||||||
'language-service',
|
|
||||||
'localize',
|
|
||||||
'migrations',
|
|
||||||
'ngcc',
|
|
||||||
'packaging',
|
|
||||||
'platform-browser',
|
|
||||||
'platform-browser-dynamic',
|
|
||||||
'platform-server',
|
|
||||||
'platform-webworker',
|
|
||||||
'platform-webworker-dynamic',
|
|
||||||
'router',
|
|
||||||
'service-worker',
|
|
||||||
'upgrade',
|
|
||||||
've',
|
|
||||||
'zone.js',
|
|
||||||
]
|
|
||||||
};
|
|
@ -1,11 +0,0 @@
|
|||||||
import {commitMessage} from './commit-message';
|
|
||||||
import {format} from './format';
|
|
||||||
import {github} from './github';
|
|
||||||
import {merge} from './merge';
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
commitMessage,
|
|
||||||
format,
|
|
||||||
github,
|
|
||||||
merge,
|
|
||||||
};
|
|
@ -1,22 +0,0 @@
|
|||||||
import {FormatConfig} from '../dev-infra/format/config';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration for the `ng-dev format` command.
|
|
||||||
*/
|
|
||||||
export const format: FormatConfig = {
|
|
||||||
'clang-format': {
|
|
||||||
'matchers': [
|
|
||||||
'**/*.{js,ts}',
|
|
||||||
// TODO: burn down format failures and remove aio and integration exceptions.
|
|
||||||
'!aio/**',
|
|
||||||
'!integration/**',
|
|
||||||
// Both third_party and .yarn are directories containing copied code which should
|
|
||||||
// not be modified.
|
|
||||||
'!third_party/**',
|
|
||||||
'!.yarn/**',
|
|
||||||
// Do not format d.ts files as they are generated
|
|
||||||
'!**/*.d.ts',
|
|
||||||
]
|
|
||||||
},
|
|
||||||
'buildifier': true
|
|
||||||
};
|
|
@ -1,15 +0,0 @@
|
|||||||
# The file is inert unless it's explicitly included into the local git config via:
|
|
||||||
#
|
|
||||||
# ```
|
|
||||||
# git config --add include.path '../.ng-dev/gitconfig'
|
|
||||||
# ```
|
|
||||||
#
|
|
||||||
# Calling that command will append the following into `.git/config` of the current git workspace
|
|
||||||
# (i.e. $GIT_DIR, typically `angular/.git/config`):
|
|
||||||
#
|
|
||||||
# ```
|
|
||||||
# [include]
|
|
||||||
# path = ../.ng-dev/gitconfig
|
|
||||||
# ```
|
|
||||||
[commit]
|
|
||||||
template = .gitmessage
|
|
@ -1,11 +0,0 @@
|
|||||||
import {GithubConfig} from '../dev-infra/utils/config';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Github configuration for the `ng-dev` command. This repository is used as
|
|
||||||
* remote for the merge script and other utilities like `ng-dev pr rebase`.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const github: GithubConfig = {
|
|
||||||
owner: 'angular',
|
|
||||||
name: 'angular'
|
|
||||||
};
|
|
@ -1,38 +0,0 @@
|
|||||||
import {MergeConfig} from '../dev-infra/pr/merge/config';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
|
|
||||||
* are respected by the merge script (e.g. the target labels).
|
|
||||||
*/
|
|
||||||
export const merge = (): MergeConfig => {
|
|
||||||
// TODO: resume dynamically determining patch branch
|
|
||||||
const patch = '10.0.x';
|
|
||||||
return {
|
|
||||||
githubApiMerge: false,
|
|
||||||
claSignedLabel: 'cla: yes',
|
|
||||||
mergeReadyLabel: /^PR action: merge(-assistance)?/,
|
|
||||||
caretakerNoteLabel: 'PR action: merge-assistance',
|
|
||||||
commitMessageFixupLabel: 'commit message fixup',
|
|
||||||
labels: [
|
|
||||||
{
|
|
||||||
pattern: 'PR target: master-only',
|
|
||||||
branches: ['master'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: 'PR target: patch-only',
|
|
||||||
branches: [patch],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: 'PR target: master & patch',
|
|
||||||
branches: ['master', patch],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
requiredBaseCommits: {
|
|
||||||
// PRs that target either `master` or the patch branch, need to be rebased
|
|
||||||
// on top of the latest commit message validation fix.
|
|
||||||
// These SHAs are the commits that update the required license text in the header.
|
|
||||||
'master': '5aeb9a4124922d8ac08eb73b8f322905a32b0b3a',
|
|
||||||
[patch]: '27b95ba64a5d99757f4042073fd1860e20e3ed24'
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
341
.pullapprove.yml
341
.pullapprove.yml
@ -34,8 +34,41 @@
|
|||||||
####################################################################################
|
####################################################################################
|
||||||
# GitHub usernames
|
# GitHub usernames
|
||||||
####################################################################################
|
####################################################################################
|
||||||
# See reviewer list under `required-minimum-review` group. Team member names and
|
# aikidave - Dave Shevitz
|
||||||
# usernames are managed there.
|
# alan-agius4 - Alan Agius
|
||||||
|
# alxhub - Alex Rickabaugh
|
||||||
|
# AndrewKushnir - Andrew Kushnir
|
||||||
|
# andrewseguin - Andrew Seguin
|
||||||
|
# atscott - Andrew Scott
|
||||||
|
# ayazhafiz - Ayaz Hafiz
|
||||||
|
# clydin - Charles Lyding
|
||||||
|
# crisbeto - Kristiyan Kostadinov
|
||||||
|
# dennispbrown - Denny Brown
|
||||||
|
# devversion - Paul Gschwendtner
|
||||||
|
# dgp1130 - Doug Parker
|
||||||
|
# filipesilva - Filipe Silva
|
||||||
|
# gkalpak - Georgios Kalpakas
|
||||||
|
# gregmagolan - Greg Magolan
|
||||||
|
# IgorMinar - Igor Minar
|
||||||
|
# jbogarthyde - Judy Bogart
|
||||||
|
# jelbourn - Jeremy Elbourn
|
||||||
|
# JiaLiPassion - Jia Li
|
||||||
|
# JoostK - Joost Koehoorn
|
||||||
|
# josephperrott - Joey Perrott
|
||||||
|
# juleskremer - Jules Kremer
|
||||||
|
# kapunahelewong - Kapunahele Wong
|
||||||
|
# kara - Kara Erickson
|
||||||
|
# kyliau - Keen Yee Liau
|
||||||
|
# manughub - Manu Murthy
|
||||||
|
# matsko - Matias Niemela
|
||||||
|
# mgechev - Minko Gechev
|
||||||
|
# mhevery - Miško Hevery
|
||||||
|
# michaelprentice - Michael Prentice
|
||||||
|
# mmalerba - Miles Malerba
|
||||||
|
# petebacondarwin - Pete Bacon Darwin
|
||||||
|
# pkozlowski-opensource - Pawel Kozlowski
|
||||||
|
# robwormald - Rob Wormald
|
||||||
|
# StephenFluin - Stephen Fluin
|
||||||
|
|
||||||
|
|
||||||
####################################################################################
|
####################################################################################
|
||||||
@ -47,8 +80,8 @@
|
|||||||
# Used for approving minor changes, large-scale refactorings, and in emergency situations.
|
# Used for approving minor changes, large-scale refactorings, and in emergency situations.
|
||||||
#
|
#
|
||||||
# IgorMinar
|
# IgorMinar
|
||||||
# jelbourn
|
|
||||||
# josephperrott
|
# josephperrott
|
||||||
|
# kara
|
||||||
# mhevery
|
# mhevery
|
||||||
#
|
#
|
||||||
# =========================================================
|
# =========================================================
|
||||||
@ -67,35 +100,8 @@ version: 3
|
|||||||
# Meta field that goes unused by PullApprove to allow for defining aliases to be
|
# Meta field that goes unused by PullApprove to allow for defining aliases to be
|
||||||
# used throughout the config.
|
# used throughout the config.
|
||||||
meta:
|
meta:
|
||||||
# The following groups have no file based conditions and will be initially `active` on all PRs
|
1: &can-be-global-approved "\"global-approvers\" not in groups.approved"
|
||||||
# - `global-approvers`
|
2: &can-be-global-docs-approved "\"global-docs-approvers\" not in groups.approved"
|
||||||
# - `global-docs-approvers`
|
|
||||||
# - `required-minimum-review`
|
|
||||||
#
|
|
||||||
# By checking the number of active/pending/rejected groups when these are excluded, we can determine
|
|
||||||
# if any other groups are matched.
|
|
||||||
#
|
|
||||||
# Note: Because all inactive groups start as pending, we are only checking pending and rejected active groups.
|
|
||||||
#
|
|
||||||
# Also note that the ordering of groups matters in this file. The only groups visible to the current
|
|
||||||
# one are those that appear above it.
|
|
||||||
no-groups-above-this-pending: &no-groups-above-this-pending
|
|
||||||
len(groups.active.pending.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0
|
|
||||||
no-groups-above-this-rejected: &no-groups-above-this-rejected
|
|
||||||
len(groups.active.rejected.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0
|
|
||||||
no-groups-above-this-active: &no-groups-above-this-active
|
|
||||||
len(groups.active.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0
|
|
||||||
|
|
||||||
can-be-global-approved: &can-be-global-approved "\"global-approvers\" not in groups.approved"
|
|
||||||
can-be-global-docs-approved: &can-be-global-docs-approved "\"global-docs-approvers\" not in groups.approved"
|
|
||||||
defaults: &defaults
|
|
||||||
reviews:
|
|
||||||
# Authors provide their approval implicitly, this approval allows for a reviewer
|
|
||||||
# from a group not to need a review specifically for an area of the repository
|
|
||||||
# they own. This is coupled with the `required-minimum-review` group which requires
|
|
||||||
# that all PRs are reviewed by at least one team member who is not the author of
|
|
||||||
# the PR.
|
|
||||||
author_value: 1
|
|
||||||
|
|
||||||
# turn on 'draft' support
|
# turn on 'draft' support
|
||||||
# https://docs.pullapprove.com/config/github-api-version/
|
# https://docs.pullapprove.com/config/github-api-version/
|
||||||
@ -151,62 +157,10 @@ groups:
|
|||||||
required: 1
|
required: 1
|
||||||
reviewed_for: required
|
reviewed_for: required
|
||||||
|
|
||||||
# =========================================================
|
|
||||||
# Require review on all PRs
|
|
||||||
#
|
|
||||||
# All PRs require at least one review. This rule will not
|
|
||||||
# request any reviewers, however will require that at least
|
|
||||||
# one review is provided before the group is satisfied.
|
|
||||||
# =========================================================
|
|
||||||
required-minimum-review:
|
|
||||||
conditions:
|
|
||||||
- *can-be-global-approved
|
|
||||||
- *can-be-global-docs-approved
|
|
||||||
reviews:
|
|
||||||
request: 0 # Do not request any reviews from the reviewer group
|
|
||||||
required: 1 # Require that all PRs have approval from at least one of the users in the group
|
|
||||||
author_value: 0 # The author of the PR cannot provide an approval for themself
|
|
||||||
reviewers:
|
|
||||||
users:
|
|
||||||
- aikidave # Dave Shevitz
|
|
||||||
- alan-agius4 # Alan Agius
|
|
||||||
- alxhub # Alex Rickabaugh
|
|
||||||
- AndrewKushnir # Andrew Kushnir
|
|
||||||
- andrewseguin # Andrew Seguin
|
|
||||||
- atscott # Andrew Scott
|
|
||||||
- ayazhafiz # Ayaz Hafiz
|
|
||||||
- clydin # Charles Lyding
|
|
||||||
- crisbeto # Kristiyan Kostadinov
|
|
||||||
- dennispbrown # Denny Brown
|
|
||||||
- devversion # Paul Gschwendtner
|
|
||||||
- dgp1130 # Doug Parker
|
|
||||||
- filipesilva # Filipe Silva
|
|
||||||
- gkalpak # Georgios Kalpakas
|
|
||||||
- gregmagolan # Greg Magolan
|
|
||||||
- IgorMinar # Igor Minar
|
|
||||||
- jbogarthyde # Judy Bogart
|
|
||||||
- jelbourn # Jeremy Elbourn
|
|
||||||
- JiaLiPassion # Jia Li
|
|
||||||
- JoostK # Joost Koehoorn
|
|
||||||
- josephperrott # Joey Perrott
|
|
||||||
- juleskremer # Jules Kremer
|
|
||||||
- kapunahelewong # Kapunahele Wong
|
|
||||||
- kara # Kara Erickson
|
|
||||||
- kyliau # Keen Yee Liau
|
|
||||||
- manughub # Manu Murthy
|
|
||||||
- mgechev # Minko Gechev
|
|
||||||
- mhevery # Miško Hevery
|
|
||||||
- mmalerba # Miles Malerba
|
|
||||||
- petebacondarwin # Pete Bacon Darwin
|
|
||||||
- pkozlowski-opensource # Pawel Kozlowski
|
|
||||||
- Splaktar # Michael Prentice
|
|
||||||
- StephenFluin # Stephen Fluin
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Framework: Animations
|
# Framework: Animations
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-animations:
|
fw-animations:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -224,16 +178,13 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- crisbeto
|
- matsko
|
||||||
- IgorMinar
|
|
||||||
- jelbourn
|
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Framework: Compiler
|
# Framework: Compiler
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-compiler:
|
fw-compiler:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -252,13 +203,13 @@ groups:
|
|||||||
- alxhub
|
- alxhub
|
||||||
- AndrewKushnir
|
- AndrewKushnir
|
||||||
- JoostK
|
- JoostK
|
||||||
|
- kara
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Framework: Compiler / ngcc
|
# Framework: Compiler / ngcc
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-ngcc:
|
fw-ngcc:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -275,7 +226,6 @@ groups:
|
|||||||
# Framework: Migrations
|
# Framework: Migrations
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-migrations:
|
fw-migrations:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -285,13 +235,13 @@ groups:
|
|||||||
- alxhub
|
- alxhub
|
||||||
- crisbeto
|
- crisbeto
|
||||||
- devversion
|
- devversion
|
||||||
|
- kara
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Framework: Core
|
# Framework: Core
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-core:
|
fw-core:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -335,7 +285,6 @@ groups:
|
|||||||
'aio/content/images/guide/dependency-injection-in-action/**',
|
'aio/content/images/guide/dependency-injection-in-action/**',
|
||||||
'aio/content/guide/dependency-injection-navtree.md',
|
'aio/content/guide/dependency-injection-navtree.md',
|
||||||
'aio/content/guide/dependency-injection-providers.md',
|
'aio/content/guide/dependency-injection-providers.md',
|
||||||
'aio/content/guide/lightweight-injection-tokens.md',
|
|
||||||
'aio/content/guide/displaying-data.md',
|
'aio/content/guide/displaying-data.md',
|
||||||
'aio/content/examples/displaying-data/**',
|
'aio/content/examples/displaying-data/**',
|
||||||
'aio/content/images/guide/displaying-data/**',
|
'aio/content/images/guide/displaying-data/**',
|
||||||
@ -366,38 +315,26 @@ groups:
|
|||||||
'aio/content/guide/ngmodule-vs-jsmodule.md',
|
'aio/content/guide/ngmodule-vs-jsmodule.md',
|
||||||
'aio/content/guide/module-types.md',
|
'aio/content/guide/module-types.md',
|
||||||
'aio/content/guide/template-syntax.md',
|
'aio/content/guide/template-syntax.md',
|
||||||
'aio/content/guide/built-in-template-functions.md',
|
|
||||||
'aio/content/examples/built-in-template-functions/**',
|
'aio/content/examples/built-in-template-functions/**',
|
||||||
'aio/content/guide/event-binding.md',
|
|
||||||
'aio/content/examples/event-binding/**',
|
'aio/content/examples/event-binding/**',
|
||||||
'aio/content/guide/interpolation.md',
|
|
||||||
'aio/content/examples/interpolation/**',
|
'aio/content/examples/interpolation/**',
|
||||||
'aio/content/examples/template-syntax/**',
|
'aio/content/examples/template-syntax/**',
|
||||||
'aio/content/images/guide/template-syntax/**',
|
'aio/content/images/guide/template-syntax/**',
|
||||||
'aio/content/guide/binding-syntax.md',
|
|
||||||
'aio/content/examples/binding-syntax/**',
|
'aio/content/examples/binding-syntax/**',
|
||||||
'aio/content/guide/property-binding.md',
|
|
||||||
'aio/content/examples/property-binding/**',
|
'aio/content/examples/property-binding/**',
|
||||||
'aio/content/guide/attribute-binding.md',
|
|
||||||
'aio/content/examples/attribute-binding/**',
|
'aio/content/examples/attribute-binding/**',
|
||||||
'aio/content/guide/two-way-binding.md',
|
|
||||||
'aio/content/examples/two-way-binding/**',
|
'aio/content/examples/two-way-binding/**',
|
||||||
'aio/content/guide/built-in-directives.md',
|
|
||||||
'aio/content/examples/built-in-directives/**',
|
'aio/content/examples/built-in-directives/**',
|
||||||
'aio/content/images/guide/built-in-directives/**',
|
'aio/content/images/guide/built-in-directives/**',
|
||||||
'aio/content/guide/template-reference-variables.md',
|
|
||||||
'aio/content/examples/template-reference-variables/**',
|
'aio/content/examples/template-reference-variables/**',
|
||||||
'aio/content/guide/inputs-outputs.md',
|
|
||||||
'aio/content/examples/inputs-outputs/**',
|
'aio/content/examples/inputs-outputs/**',
|
||||||
'aio/content/images/guide/inputs-outputs/**',
|
'aio/content/images/guide/inputs-outputs/**',
|
||||||
'aio/content/guide/template-expression-operators.md',
|
|
||||||
'aio/content/examples/template-expression-operators/**',
|
'aio/content/examples/template-expression-operators/**',
|
||||||
'aio/content/guide/pipes.md',
|
'aio/content/guide/pipes.md',
|
||||||
'aio/content/examples/pipes/**',
|
'aio/content/examples/pipes/**',
|
||||||
'aio/content/images/guide/pipes/**',
|
'aio/content/images/guide/pipes/**',
|
||||||
'aio/content/guide/providers.md',
|
'aio/content/guide/providers.md',
|
||||||
'aio/content/examples/providers/**',
|
'aio/content/examples/providers/**',
|
||||||
'aio/content/images/guide/providers/**',
|
|
||||||
'aio/content/guide/singleton-services.md',
|
'aio/content/guide/singleton-services.md',
|
||||||
'aio/content/guide/set-document-title.md',
|
'aio/content/guide/set-document-title.md',
|
||||||
'aio/content/examples/set-document-title/**',
|
'aio/content/examples/set-document-title/**',
|
||||||
@ -405,9 +342,7 @@ groups:
|
|||||||
'aio/content/guide/sharing-ngmodules.md',
|
'aio/content/guide/sharing-ngmodules.md',
|
||||||
'aio/content/guide/structural-directives.md',
|
'aio/content/guide/structural-directives.md',
|
||||||
'aio/content/examples/structural-directives/**',
|
'aio/content/examples/structural-directives/**',
|
||||||
'aio/content/guide/svg-in-templates.md',
|
|
||||||
'aio/content/images/guide/structural-directives/**',
|
'aio/content/images/guide/structural-directives/**',
|
||||||
'aio/content/guide/template-statements.md',
|
|
||||||
'aio/content/guide/user-input.md',
|
'aio/content/guide/user-input.md',
|
||||||
'aio/content/examples/user-input/**',
|
'aio/content/examples/user-input/**',
|
||||||
'aio/content/images/guide/user-input/**'
|
'aio/content/images/guide/user-input/**'
|
||||||
@ -417,7 +352,7 @@ groups:
|
|||||||
- alxhub
|
- alxhub
|
||||||
- AndrewKushnir
|
- AndrewKushnir
|
||||||
- atscott
|
- atscott
|
||||||
- ~kara # do not request reviews from Kara, but allow her to approve PRs
|
- kara
|
||||||
- mhevery
|
- mhevery
|
||||||
- pkozlowski-opensource
|
- pkozlowski-opensource
|
||||||
|
|
||||||
@ -426,13 +361,13 @@ groups:
|
|||||||
# Framework: Http
|
# Framework: Http
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-http:
|
fw-http:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
'packages/common/http/**',
|
'packages/common/http/**',
|
||||||
|
'packages/http/**',
|
||||||
'packages/examples/http/**',
|
'packages/examples/http/**',
|
||||||
'aio/content/guide/http.md',
|
'aio/content/guide/http.md',
|
||||||
'aio/content/examples/http/**',
|
'aio/content/examples/http/**',
|
||||||
@ -448,7 +383,6 @@ groups:
|
|||||||
# Framework: Elements
|
# Framework: Elements
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-elements:
|
fw-elements:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -469,7 +403,6 @@ groups:
|
|||||||
# Framework: Forms
|
# Framework: Forms
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-forms:
|
fw-forms:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -502,7 +435,6 @@ groups:
|
|||||||
# Framework: i18n
|
# Framework: i18n
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-i18n:
|
fw-i18n:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -536,7 +468,6 @@ groups:
|
|||||||
# Framework: Platform Server
|
# Framework: Platform Server
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-platform-server:
|
fw-platform-server:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -556,7 +487,6 @@ groups:
|
|||||||
# Framework: Router
|
# Framework: Router
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-router:
|
fw-router:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -565,9 +495,6 @@ groups:
|
|||||||
'packages/router/**',
|
'packages/router/**',
|
||||||
'packages/examples/router/**',
|
'packages/examples/router/**',
|
||||||
'aio/content/guide/router.md',
|
'aio/content/guide/router.md',
|
||||||
'aio/content/guide/router-tutorial.md',
|
|
||||||
'aio/content/guide/router-tutorial-toh.md',
|
|
||||||
'aio/content/examples/router-tutorial/**',
|
|
||||||
'aio/content/examples/router/**',
|
'aio/content/examples/router/**',
|
||||||
'aio/content/images/guide/router/**'
|
'aio/content/images/guide/router/**'
|
||||||
])
|
])
|
||||||
@ -580,7 +507,6 @@ groups:
|
|||||||
# Framework: Service Worker
|
# Framework: Service Worker
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-service-worker:
|
fw-service-worker:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -608,7 +534,6 @@ groups:
|
|||||||
# Framework: Upgrade
|
# Framework: Upgrade
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-upgrade:
|
fw-upgrade:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -639,7 +564,6 @@ groups:
|
|||||||
# Framework: Testing
|
# Framework: Testing
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-testing:
|
fw-testing:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -647,14 +571,6 @@ groups:
|
|||||||
contains_any_globs(files.exclude('packages/compiler-cli/**'), [
|
contains_any_globs(files.exclude('packages/compiler-cli/**'), [
|
||||||
'**/testing/**',
|
'**/testing/**',
|
||||||
'aio/content/guide/testing.md',
|
'aio/content/guide/testing.md',
|
||||||
'aio/content/guide/test-debugging.md',
|
|
||||||
'aio/content/guide/testing-attribute-directives.md',
|
|
||||||
'aio/content/guide/testing-code-coverage.md',
|
|
||||||
'aio/content/guide/testing-components-basics.md',
|
|
||||||
'aio/content/guide/testing-components-scenarios.md',
|
|
||||||
'aio/content/guide/testing-pipes.md',
|
|
||||||
'aio/content/guide/testing-services.md',
|
|
||||||
'aio/content/guide/testing-utility-apis.md',
|
|
||||||
'aio/content/examples/testing/**',
|
'aio/content/examples/testing/**',
|
||||||
'aio/content/images/guide/testing/**'
|
'aio/content/images/guide/testing/**'
|
||||||
])
|
])
|
||||||
@ -662,6 +578,7 @@ groups:
|
|||||||
users:
|
users:
|
||||||
- AndrewKushnir
|
- AndrewKushnir
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
|
- kara
|
||||||
- pkozlowski-opensource
|
- pkozlowski-opensource
|
||||||
|
|
||||||
|
|
||||||
@ -669,7 +586,6 @@ groups:
|
|||||||
# Framework: Benchmarks
|
# Framework: Benchmarks
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-benchmarks:
|
fw-benchmarks:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
@ -679,6 +595,7 @@ groups:
|
|||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
|
- kara
|
||||||
- pkozlowski-opensource
|
- pkozlowski-opensource
|
||||||
|
|
||||||
|
|
||||||
@ -686,7 +603,6 @@ groups:
|
|||||||
# Framework: Playground
|
# Framework: Playground
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-playground:
|
fw-playground:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
@ -696,15 +612,13 @@ groups:
|
|||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- jelbourn
|
- kara
|
||||||
- pkozlowski-opensource
|
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Framework: Security
|
# Framework: Security
|
||||||
# =========================================================
|
# =========================================================
|
||||||
fw-security:
|
fw-security:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -722,25 +636,18 @@ groups:
|
|||||||
users:
|
users:
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- mhevery
|
- mhevery
|
||||||
- jelbourn
|
|
||||||
- pkozlowski-opensource
|
|
||||||
reviews:
|
|
||||||
request: -1 # request reviews from everyone
|
|
||||||
required: 2 # require at least 2 approvals
|
|
||||||
reviewed_for: required
|
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Bazel
|
# Bazel
|
||||||
# =========================================================
|
# =========================================================
|
||||||
bazel:
|
bazel:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
'packages/bazel/**',
|
'packages/bazel/**',
|
||||||
|
'aio/content/guide/bazel.md'
|
||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
@ -753,7 +660,6 @@ groups:
|
|||||||
# Language Service
|
# Language Service
|
||||||
# =========================================================
|
# =========================================================
|
||||||
language-service:
|
language-service:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -773,7 +679,6 @@ groups:
|
|||||||
# zone.js
|
# zone.js
|
||||||
# =========================================================
|
# =========================================================
|
||||||
zone-js:
|
zone-js:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -787,27 +692,11 @@ groups:
|
|||||||
- JiaLiPassion
|
- JiaLiPassion
|
||||||
- mhevery
|
- mhevery
|
||||||
|
|
||||||
# =========================================================
|
|
||||||
# in-memory-web-api
|
|
||||||
# =========================================================
|
|
||||||
in-memory-web-api:
|
|
||||||
conditions:
|
|
||||||
- *can-be-global-approved
|
|
||||||
- *can-be-global-docs-approved
|
|
||||||
- >
|
|
||||||
contains_any_globs(files, [
|
|
||||||
'packages/misc/angular-in-memory-web-api/**',
|
|
||||||
])
|
|
||||||
reviewers:
|
|
||||||
users:
|
|
||||||
- IgorMinar
|
|
||||||
- crisbeto
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Benchpress
|
# Benchpress
|
||||||
# =========================================================
|
# =========================================================
|
||||||
benchpress:
|
benchpress:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -818,14 +707,12 @@ groups:
|
|||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- alxhub
|
- alxhub
|
||||||
- josephperrott
|
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Integration Tests
|
# Integration Tests
|
||||||
# =========================================================
|
# =========================================================
|
||||||
integration-tests:
|
integration-tests:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
@ -836,6 +723,7 @@ groups:
|
|||||||
users:
|
users:
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- josephperrott
|
- josephperrott
|
||||||
|
- kara
|
||||||
- mhevery
|
- mhevery
|
||||||
|
|
||||||
|
|
||||||
@ -843,7 +731,6 @@ groups:
|
|||||||
# Docs: Gettings Started & Tutorial
|
# Docs: Gettings Started & Tutorial
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-getting-started-and-tutorial:
|
docs-getting-started-and-tutorial:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -876,13 +763,11 @@ groups:
|
|||||||
# Docs: Marketing
|
# Docs: Marketing
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-marketing:
|
docs-marketing:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
'aio/content/guide/roadmap.md',
|
|
||||||
'aio/content/marketing/**',
|
'aio/content/marketing/**',
|
||||||
'aio/content/images/bios/**',
|
'aio/content/images/bios/**',
|
||||||
'aio/content/images/marketing/**',
|
'aio/content/images/marketing/**',
|
||||||
@ -900,7 +785,6 @@ groups:
|
|||||||
# Docs: Observables
|
# Docs: Observables
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-observables:
|
docs-observables:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -926,7 +810,6 @@ groups:
|
|||||||
# Docs: Packaging, Tooling, Releasing
|
# Docs: Packaging, Tooling, Releasing
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-packaging-and-releasing:
|
docs-packaging-and-releasing:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -946,47 +829,20 @@ groups:
|
|||||||
'aio/content/guide/migration-localize.md',
|
'aio/content/guide/migration-localize.md',
|
||||||
'aio/content/guide/migration-module-with-providers.md',
|
'aio/content/guide/migration-module-with-providers.md',
|
||||||
'aio/content/guide/static-query-migration.md',
|
'aio/content/guide/static-query-migration.md',
|
||||||
'aio/content/guide/updating-to-version-10.md',
|
'aio/content/guide/updating-to-version-9.md',
|
||||||
'aio/content/guide/ivy-compatibility.md',
|
'aio/content/guide/ivy-compatibility.md',
|
||||||
'aio/content/guide/ivy-compatibility-examples.md'
|
'aio/content/guide/ivy-compatibility-examples.md'
|
||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- jelbourn
|
- kara
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
|
||||||
# Tooling: Compiler API shared with Angular CLI
|
|
||||||
#
|
|
||||||
# Changing this API might break Angular CLI, so we require
|
|
||||||
# the CLI team to approve changes here.
|
|
||||||
# =========================================================
|
|
||||||
tooling-cli-shared-api:
|
|
||||||
conditions:
|
|
||||||
- *can-be-global-approved
|
|
||||||
- *can-be-global-docs-approved
|
|
||||||
- >
|
|
||||||
contains_any_globs(files, [
|
|
||||||
'packages/compiler-cli/src/tooling.ts'
|
|
||||||
])
|
|
||||||
reviewers:
|
|
||||||
users:
|
|
||||||
- alan-agius4
|
|
||||||
- clydin
|
|
||||||
- kyliau
|
|
||||||
- IgorMinar
|
|
||||||
reviews:
|
|
||||||
request: -1 # request reviews from everyone
|
|
||||||
required: 2 # require at least 2 approvals
|
|
||||||
reviewed_for: required
|
|
||||||
|
|
||||||
|
|
||||||
# =========================================================
|
# =========================================================
|
||||||
# Docs: CLI
|
# Docs: CLI
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-cli:
|
docs-cli:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -1003,12 +859,8 @@ groups:
|
|||||||
'aio/content/images/guide/deployment/**',
|
'aio/content/images/guide/deployment/**',
|
||||||
'aio/content/guide/file-structure.md',
|
'aio/content/guide/file-structure.md',
|
||||||
'aio/content/guide/ivy.md',
|
'aio/content/guide/ivy.md',
|
||||||
'aio/content/guide/strict-mode.md',
|
|
||||||
'aio/content/guide/web-worker.md',
|
'aio/content/guide/web-worker.md',
|
||||||
'aio/content/guide/workspace-config.md',
|
'aio/content/guide/workspace-config.md',
|
||||||
'aio/content/guide/migration-solution-style-tsconfig.md',
|
|
||||||
'aio/content/guide/migration-update-module-and-target-compiler-options.md',
|
|
||||||
'aio/content/guide/migration-update-libraries-tslib.md',
|
|
||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
@ -1021,7 +873,6 @@ groups:
|
|||||||
# Docs: CLI Libraries
|
# Docs: CLI Libraries
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-libraries:
|
docs-libraries:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -1042,7 +893,6 @@ groups:
|
|||||||
# Docs: Schematics
|
# Docs: Schematics
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-schematics:
|
docs-schematics:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -1065,7 +915,6 @@ groups:
|
|||||||
# Docs-infra
|
# Docs-infra
|
||||||
# =========================================================
|
# =========================================================
|
||||||
docs-infra:
|
docs-infra:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
- *can-be-global-docs-approved
|
||||||
@ -1095,22 +944,19 @@ groups:
|
|||||||
# Dev-infra
|
# Dev-infra
|
||||||
# =========================================================
|
# =========================================================
|
||||||
dev-infra:
|
dev-infra:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files.exclude("CHANGELOG.md").exclude("packages/compiler-cli/**/BUILD.bazel"), [
|
contains_any_globs(files.exclude("CHANGELOG.md"), [
|
||||||
'*',
|
'*',
|
||||||
'.circleci/**',
|
'.circleci/**',
|
||||||
'.devcontainer/**',
|
'.devcontainer/**',
|
||||||
'.github/**',
|
'.github/**',
|
||||||
'.ng-dev/**',
|
|
||||||
'.vscode/**',
|
'.vscode/**',
|
||||||
'.yarn/**',
|
'.yarn/**',
|
||||||
'dev-infra/**',
|
'dev-infra/**',
|
||||||
'docs/BAZEL.md',
|
'docs/BAZEL.md',
|
||||||
'docs/CARETAKER.md',
|
'docs/CARETAKER.md',
|
||||||
'docs/CODING_STANDARDS.md',
|
|
||||||
'docs/COMMITTER.md',
|
'docs/COMMITTER.md',
|
||||||
'docs/DEBUG.md',
|
'docs/DEBUG.md',
|
||||||
'docs/DEBUG_COMPONENTS_REPO_IVY.md',
|
'docs/DEBUG_COMPONENTS_REPO_IVY.md',
|
||||||
@ -1121,6 +967,8 @@ groups:
|
|||||||
'docs/TOOLS.md',
|
'docs/TOOLS.md',
|
||||||
'docs/TRIAGE_AND_LABELS.md',
|
'docs/TRIAGE_AND_LABELS.md',
|
||||||
'goldens/*',
|
'goldens/*',
|
||||||
|
'modules/e2e_util/e2e_util.ts',
|
||||||
|
'modules/e2e_util/perf_util.ts',
|
||||||
'modules/*',
|
'modules/*',
|
||||||
'packages/*',
|
'packages/*',
|
||||||
'packages/examples/test-utils/**',
|
'packages/examples/test-utils/**',
|
||||||
@ -1128,10 +976,15 @@ groups:
|
|||||||
'packages/examples/*',
|
'packages/examples/*',
|
||||||
'scripts/**',
|
'scripts/**',
|
||||||
'third_party/**',
|
'third_party/**',
|
||||||
|
'tools/brotli-cli/**',
|
||||||
|
'tools/browsers/**',
|
||||||
'tools/build/**',
|
'tools/build/**',
|
||||||
'tools/circular_dependency_test/**',
|
'tools/circular_dependency_test/**',
|
||||||
'tools/contributing-stats/**',
|
'tools/contributing-stats/**',
|
||||||
|
'tools/components/**',
|
||||||
'tools/gulp-tasks/**',
|
'tools/gulp-tasks/**',
|
||||||
|
'tools/ng_rollup_bundle/**',
|
||||||
|
'tools/ngcontainer/**',
|
||||||
'tools/npm/**',
|
'tools/npm/**',
|
||||||
'tools/npm_integration_test/**',
|
'tools/npm_integration_test/**',
|
||||||
'tools/rxjs/**',
|
'tools/rxjs/**',
|
||||||
@ -1161,10 +1014,7 @@ groups:
|
|||||||
# Public API
|
# Public API
|
||||||
# =========================================================
|
# =========================================================
|
||||||
public-api:
|
public-api:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *no-groups-above-this-pending
|
|
||||||
- *no-groups-above-this-rejected
|
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
@ -1178,27 +1028,15 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- AndrewKushnir
|
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- alxhub
|
- kara
|
||||||
- atscott
|
|
||||||
- jelbourn
|
|
||||||
- petebacondarwin
|
|
||||||
- pkozlowski-opensource
|
|
||||||
reviews:
|
|
||||||
request: 4 # Request reviews from four people
|
|
||||||
required: 3 # Require that three people approve
|
|
||||||
reviewed_for: required
|
|
||||||
|
|
||||||
|
|
||||||
# ================================================
|
# ================================================
|
||||||
# Size tracking
|
# Size tracking
|
||||||
# ================================================
|
# ================================================
|
||||||
size-tracking:
|
size-tracking:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *no-groups-above-this-pending
|
|
||||||
- *no-groups-above-this-rejected
|
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
@ -1206,27 +1044,15 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- AndrewKushnir
|
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- alxhub
|
- kara
|
||||||
- atscott
|
|
||||||
- jelbourn
|
|
||||||
- petebacondarwin
|
|
||||||
- pkozlowski-opensource
|
|
||||||
reviews:
|
|
||||||
request: 4 # Request reviews from four people
|
|
||||||
required: 2 # Require that two people approve
|
|
||||||
reviewed_for: required
|
|
||||||
|
|
||||||
|
|
||||||
# ================================================
|
# ================================================
|
||||||
# Circular dependencies
|
# Circular dependencies
|
||||||
# ================================================
|
# ================================================
|
||||||
circular-dependencies:
|
circular-dependencies:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *no-groups-above-this-pending
|
|
||||||
- *no-groups-above-this-rejected
|
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
contains_any_globs(files, [
|
contains_any_globs(files, [
|
||||||
@ -1234,13 +1060,9 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- AndrewKushnir
|
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- alxhub
|
- josephperrott
|
||||||
- atscott
|
- kara
|
||||||
- jelbourn
|
|
||||||
- petebacondarwin
|
|
||||||
- pkozlowski-opensource
|
|
||||||
|
|
||||||
|
|
||||||
####################################################################################
|
####################################################################################
|
||||||
@ -1251,7 +1073,6 @@ groups:
|
|||||||
# Code Ownership
|
# Code Ownership
|
||||||
# =========================================================
|
# =========================================================
|
||||||
code-ownership:
|
code-ownership:
|
||||||
<<: *defaults
|
|
||||||
conditions:
|
conditions:
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- >
|
- >
|
||||||
@ -1260,43 +1081,19 @@ groups:
|
|||||||
])
|
])
|
||||||
reviewers:
|
reviewers:
|
||||||
users:
|
users:
|
||||||
- AndrewKushnir
|
|
||||||
- IgorMinar
|
- IgorMinar
|
||||||
- alxhub
|
|
||||||
- atscott
|
|
||||||
- jelbourn
|
|
||||||
- josephperrott
|
|
||||||
- mhevery
|
|
||||||
|
|
||||||
|
|
||||||
# ====================================================
|
# ====================================================
|
||||||
# Catch all for if no groups match the code change
|
# Catch all for if no groups match the code change
|
||||||
# ====================================================
|
# ====================================================
|
||||||
fallback:
|
fallback:
|
||||||
<<: *defaults
|
|
||||||
# A group is considered to be `active` for a PR if at least one of group's
|
|
||||||
# conditions matches the PR.
|
|
||||||
#
|
|
||||||
# The PullApprove CI check should fail if a PR has no `active` groups, as
|
|
||||||
# this indicates the PR is modifying a file that has no owner.
|
|
||||||
#
|
|
||||||
# This is enforced through the pullapprove verification check done
|
|
||||||
# as part of the CircleCI lint job. Failures in this lint job should be
|
|
||||||
# fixed as part of the PR. This can be done by updating the
|
|
||||||
# `.pullapprove.yml` file cover the unmatched path.
|
|
||||||
# The pullapprove verification script is part of the ng-dev tool and can be
|
|
||||||
# run locally with the command: `yarn -s ng-dev pullapprove verify`
|
|
||||||
#
|
|
||||||
# For cases in which the verification check fails to ensure coverage, this
|
|
||||||
# group will be active. The expectation is that this should be remedied
|
|
||||||
# before merging the PR as described above. In an emergency situation
|
|
||||||
# `global-approvers` can still approve PRs that match this `fallback` rule,
|
|
||||||
# but that should be an exception and not an expectation.
|
|
||||||
conditions:
|
conditions:
|
||||||
- *no-groups-above-this-active
|
|
||||||
# When any of the `global-*` groups is approved, they cause other groups to deactivate.
|
|
||||||
# In those cases, the condition above would evaluate to `true` while in reality, only a global
|
|
||||||
# approval has been provided. To ensure we don't activate the fallback group in such cases,
|
|
||||||
# ensure that no explicit global approval has been provided.
|
|
||||||
- *can-be-global-approved
|
- *can-be-global-approved
|
||||||
- *can-be-global-docs-approved
|
# Groups which are found to have matching conditions are `active`
|
||||||
|
# according to PullApprove. If no groups are matched and considered
|
||||||
|
# active, we still want to have a review occur.
|
||||||
|
- len(groups.active) == 0
|
||||||
|
reviewers:
|
||||||
|
users:
|
||||||
|
- IgorMinar
|
||||||
|
1
.vscode/recommended-settings.json
vendored
1
.vscode/recommended-settings.json
vendored
@ -26,7 +26,6 @@
|
|||||||
"**/bazel-out": true,
|
"**/bazel-out": true,
|
||||||
"**/dist": true,
|
"**/dist": true,
|
||||||
"**/aio/src/generated": true,
|
"**/aio/src/generated": true,
|
||||||
".history": true,
|
|
||||||
},
|
},
|
||||||
"git.ignoreLimitWarning": true,
|
"git.ignoreLimitWarning": true,
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package(default_visibility = ["//visibility:public"])
|
|||||||
|
|
||||||
exports_files([
|
exports_files([
|
||||||
"LICENSE",
|
"LICENSE",
|
||||||
|
"protractor-perf.conf.js",
|
||||||
"karma-js.conf.js",
|
"karma-js.conf.js",
|
||||||
"browser-providers.conf.js",
|
"browser-providers.conf.js",
|
||||||
"scripts/ci/track-payload-size.sh",
|
"scripts/ci/track-payload-size.sh",
|
||||||
@ -20,11 +21,11 @@ filegroup(
|
|||||||
# do not sort
|
# do not sort
|
||||||
srcs = [
|
srcs = [
|
||||||
"@npm//:node_modules/core-js/client/core.js",
|
"@npm//:node_modules/core-js/client/core.js",
|
||||||
"//packages/zone.js/bundles:zone.umd.js",
|
"//packages/zone.js/dist:zone.js",
|
||||||
"//packages/zone.js/bundles:zone-testing.umd.js",
|
"//packages/zone.js/dist:zone-testing.js",
|
||||||
"//packages/zone.js/bundles:task-tracking.umd.js",
|
"//packages/zone.js/dist:task-tracking.js",
|
||||||
"//:test-events.js",
|
"//:test-events.js",
|
||||||
"//:third_party/shims_for_IE.js",
|
"//:shims_for_IE.js",
|
||||||
# Including systemjs because it defines `__eval`, which produces correct stack traces.
|
# Including systemjs because it defines `__eval`, which produces correct stack traces.
|
||||||
"@npm//:node_modules/systemjs/dist/system.src.js",
|
"@npm//:node_modules/systemjs/dist/system.src.js",
|
||||||
"@npm//:node_modules/reflect-metadata/Reflect.js",
|
"@npm//:node_modules/reflect-metadata/Reflect.js",
|
||||||
|
749
CHANGELOG.md
749
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -1,72 +1,12 @@
|
|||||||
# Código de Conducta
|
# Contributor Code of Conduct
|
||||||
|
## Version 0.3b-angular
|
||||||
|
|
||||||
## 1. Propósito
|
As contributors and maintainers of the Angular project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
|
||||||
|
|
||||||
“Prometemos brindar cortesía y respeto a cualquier persona involucrada en esta comunidad, sin importar el género con el que se identifique, su orientación sexual, limitación física, edad, raza, etnia, religión o nivel de conocimiento. Esperamos que cualquiera que desee contribuir en este proyecto brinde el mismo comportamiento”
|
Communication through any of Angular's channels (GitHub, Gitter, IRC, mailing lists, Google+, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
||||||
|
|
||||||
Bajo ese principio queremos enfocar esta comunidad, una comunidad de respeto por el otro, donde cualquiera que sienta pasión por Angular y desee involucrarse con cualquier tipo de actividad deberá ayudar a mantener una atmósfera de cortesía por el otro, respetando los pensamientos, acciones, ideales y propuestas del otro.
|
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Angular project to do the same.
|
||||||
|
|
||||||
## 2. Comportamiento esperado
|
If any member of the community violates this code of conduct, the maintainers of the Angular project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
|
||||||
|
|
||||||
- Evitar usar expresiones o gestos insultantes, humillantes o intimidatorios para referirnos a otros.
|
If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [conduct@angular.io](mailto:conduct@angular.io).
|
||||||
- Ejercita la consideración y el respeto en tus comunicaciones y acciones.
|
|
||||||
- Absténte de adoptar una conducta y un lenguaje degradantes, discriminatorios, abusivos o acosadores.
|
|
||||||
- Evitar comportamientos que agredan las expresiones de identidad, género, creencias religiosas, acciones que lastimen o los aíslen a otros.
|
|
||||||
- Evitar comentarios sobre ideas políticas.
|
|
||||||
- No se toleran conductas físicas y actitudes dirigidas al descrédito personal, físico o emocional de cualquier persona.
|
|
||||||
- No se toleran chistes y comentarios excluyentes, sexistas y racistas.
|
|
||||||
- Se rechaza actitudes de hostigamiento.
|
|
||||||
- Se rechaza el acoso: este se entiende como cualquier tipo de comentario verbal que refuerce discriminación por género, identidad y expresión de género, orientación sexual, discapacidad, apariencia física, tamaño corporal, raza, edad o religión en contextos laborales o sociales.
|
|
||||||
- No se tolera el contacto físico y/o la atención sexual no deseada.
|
|
||||||
- Promover la igualdad de oportunidades de formación, educación, intercambio y retroalimentación antes, durante y después de los eventos.
|
|
||||||
- Intenta colaborar en lugar de generar conflicto.
|
|
||||||
- Sé consciente de tu entorno y de tus compañeros participantes. Alerta a líderes de la comunidad si notas una situación peligrosa, alguien en apuros, o violaciones de este Código de Conducta, incluso si parecen intrascendentes.
|
|
||||||
|
|
||||||
## 3. Comportamiento inaceptable
|
|
||||||
Comportamientos inaceptables incluyen: intimidación, acoso, abuso, discriminación, comunicación despectiva o degradante o acciones por cualquier participante en nuestra comunidad ya sea virtual, o en las comunicaciones uno-a-uno que se realizan en el contexto de la comunidad. Por favor ser respetuoso con todos.
|
|
||||||
|
|
||||||
El acoso incluye: comentarios nocivos o perjudiciales, verbales o escritos relacionados con el género, la orientación sexual, raza, religión, discapacidad; uso inadecuado de desnudos y / o imágenes sexuales en espacios públicos (incluyendo la presentación diapositivas); intimidación deliberada, acecho o seguimiento; fotografías o grabaciones acosadoras; interrupción sostenida de charlas y otros eventos; contacto físico inapropiado, y atención sexual no deseada.
|
|
||||||
|
|
||||||
## 4. Consecuencias de comportamiento inaceptable
|
|
||||||
Se espera que personas a quienes se les solicite que detengan su comportamiento inaceptable lo hagan de manera inmediata esto será válido para cualquier miembro de la comunidad.
|
|
||||||
|
|
||||||
En caso de presentarse una violación al código de conducta de manera repetida se tendrá cero tolerancia a este comportamiento por parte de los organizadores.
|
|
||||||
|
|
||||||
Si un miembro de la comunidad participa en una conducta inaceptable, los organizadores pueden tomar cualquier acción que consideren apropiada, hasta e incluyendo una prohibición temporal o expulsión permanente de la comunidad, sin previo aviso.
|
|
||||||
|
|
||||||
Priorizamos la seguridad de las personas marginadas sobre la comodidad de las personas privilegiadas. Nos reservamos el derecho de no actuar sobre las quejas relacionadas con:
|
|
||||||
|
|
||||||
- El "racismo inverso", "sexismo inverso" y "cisfobia".
|
|
||||||
- Comunicación razonable de límites, como "déjame en paz", "vete" o "no estoy discutiendo esto contigo".
|
|
||||||
- Al comunicarse en un "tono", no se encuentra agradable.
|
|
||||||
- Identificando comportamientos o suposiciones racistas, sexistas, cissexistas u opresivas.
|
|
||||||
|
|
||||||
## 5. ¿Qué hacer si se incumple el código de conducta?
|
|
||||||
Si eres víctima o testigo de una conducta inaceptable, o tienes cualquier inquietud, por favor comunícate con el equipo organizador lo antes posible:
|
|
||||||
|
|
||||||
- Mensaje directo: Michael Prentice (@splaktar)
|
|
||||||
- Mensaje directo: Jorge Cano (@jorgeucano)
|
|
||||||
- Mensaje directo: Andrés Villanueva (@villanuevand)
|
|
||||||
- Email: [soporte@angular.lat](mailto:soporte@angular.lat)
|
|
||||||
|
|
||||||
### ¿Qué pasa después?
|
|
||||||
- Una vez haya sido notificada el no cumplimiento de la norma, el equipo de liderazgo se reunirán y analizarán el caso.
|
|
||||||
- Los incidentes presentados se manejarán con discreción.
|
|
||||||
- Los organizadores se comunicarán con la persona que incumplió la norma y tomarán las medidas respectivas.
|
|
||||||
- Se realizará un acompañamiento a la persona agredida y se apoyará.
|
|
||||||
- Si el incidente se hace público, Angular Hispano no se hace responsable de los perjuicios que esto pueda ocasionar en el agresor o el agredido.
|
|
||||||
|
|
||||||
## 6. Alcance
|
|
||||||
Esperamos que todos los participantes de la comunidad (organizadores, voluntarios, contribuyentes pagados o de otro modo; patrocinadores; y otros invitados) se atengan a este Código de Conducta en todos los espacios virtuales y presenciales, así como en todas las comunicaciones de uno-a-uno pertinentes la comunidad.
|
|
||||||
|
|
||||||
### Colaboradores
|
|
||||||
|
|
||||||
- Alejandra Giraldo
|
|
||||||
- Vanessa Marely
|
|
||||||
- Mariano Alvarez
|
|
||||||
- Andrés Villanueva
|
|
||||||
- Michael Prentice
|
|
||||||
- javascript&friends
|
|
||||||
- Angular
|
|
||||||
- She Codes Angular
|
|
||||||
- Colombia dev
|
|
||||||
|
@ -1,359 +0,0 @@
|
|||||||
# Contributing to Angular
|
|
||||||
|
|
||||||
We would love for you to contribute to Angular and help make it even better than it is today!
|
|
||||||
As a contributor, here are the guidelines we would like you to follow:
|
|
||||||
|
|
||||||
- [Code of Conduct](#coc)
|
|
||||||
- [Question or Problem?](#question)
|
|
||||||
- [Issues and Bugs](#issue)
|
|
||||||
- [Feature Requests](#feature)
|
|
||||||
- [Submission Guidelines](#submit)
|
|
||||||
- [Coding Rules](#rules)
|
|
||||||
- [Commit Message Guidelines](#commit)
|
|
||||||
- [Signing the CLA](#cla)
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="coc"></a> Code of Conduct
|
|
||||||
|
|
||||||
Help us keep Angular open and inclusive.
|
|
||||||
Please read and follow our [Code of Conduct][coc].
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="question"></a> Got a Question or Problem?
|
|
||||||
|
|
||||||
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests.
|
|
||||||
Instead, we recommend using [Stack Overflow](https://stackoverflow.com/questions/tagged/angular) to ask support-related questions. When creating a new question on Stack Overflow, make sure to add the `angular` tag.
|
|
||||||
|
|
||||||
Stack Overflow is a much better place to ask questions since:
|
|
||||||
|
|
||||||
- there are thousands of people willing to help on Stack Overflow
|
|
||||||
- questions and answers stay available for public viewing so your question/answer might help someone else
|
|
||||||
- Stack Overflow's voting system assures that the best answers are prominently visible.
|
|
||||||
|
|
||||||
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
|
|
||||||
|
|
||||||
If you would like to chat about the question in real-time, you can reach out via [our gitter channel][gitter].
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="issue"></a> Found a Bug?
|
|
||||||
|
|
||||||
If you find a bug in the source code, you can help us by [submitting an issue](#submit-issue) to our [GitHub Repository][github].
|
|
||||||
Even better, you can [submit a Pull Request](#submit-pr) with a fix.
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="feature"></a> Missing a Feature?
|
|
||||||
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub Repository.
|
|
||||||
If you would like to *implement* a new feature, please consider the size of the change in order to determine the right steps to proceed:
|
|
||||||
|
|
||||||
* For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed.
|
|
||||||
This process allows us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project.
|
|
||||||
|
|
||||||
**Note**: Adding a new topic to the documentation, or significantly re-writing a topic, counts as a major feature.
|
|
||||||
|
|
||||||
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="submit"></a> Submission Guidelines
|
|
||||||
|
|
||||||
|
|
||||||
### <a name="submit-issue"></a> Submitting an Issue
|
|
||||||
|
|
||||||
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
|
|
||||||
|
|
||||||
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.
|
|
||||||
In order to reproduce bugs, we require that you provide a minimal reproduction.
|
|
||||||
Having a minimal reproducible scenario gives us a wealth of important information without going back and forth to you with additional questions.
|
|
||||||
|
|
||||||
A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem.
|
|
||||||
|
|
||||||
We require a minimal reproduction to save maintainers' time and ultimately be able to fix more bugs.
|
|
||||||
Often, developers find coding problems themselves while preparing a minimal reproduction.
|
|
||||||
We understand that sometimes it might be hard to extract essential bits of code from a larger codebase but we really need to isolate the problem before we can fix it.
|
|
||||||
|
|
||||||
Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, we are going to close an issue that doesn't have enough info to be reproduced.
|
|
||||||
|
|
||||||
You can file new issues by selecting from our [new issue templates](https://github.com/angular/angular/issues/new/choose) and filling out the issue template.
|
|
||||||
|
|
||||||
|
|
||||||
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
|
|
||||||
|
|
||||||
Before you submit your Pull Request (PR) consider the following guidelines:
|
|
||||||
|
|
||||||
1. Search [GitHub](https://github.com/angular/angular/pulls) for an open or closed PR that relates to your submission.
|
|
||||||
You don't want to duplicate existing efforts.
|
|
||||||
|
|
||||||
2. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add.
|
|
||||||
Discussing the design upfront helps to ensure that we're ready to accept your work.
|
|
||||||
|
|
||||||
3. Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
|
|
||||||
We cannot accept code without a signed CLA.
|
|
||||||
Make sure you author all contributed Git commits with email address associated with your CLA signature.
|
|
||||||
|
|
||||||
4. Fork the angular/angular repo.
|
|
||||||
|
|
||||||
5. Make your changes in a new git branch:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git checkout -b my-fix-branch master
|
|
||||||
```
|
|
||||||
|
|
||||||
6. Create your patch, **including appropriate test cases**.
|
|
||||||
|
|
||||||
7. Follow our [Coding Rules](#rules).
|
|
||||||
|
|
||||||
8. Run the full Angular test suite, as described in the [developer documentation][dev-doc], and ensure that all tests pass.
|
|
||||||
|
|
||||||
9. Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit).
|
|
||||||
Adherence to these conventions is necessary because release notes are automatically generated from these messages.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git commit -a
|
|
||||||
```
|
|
||||||
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
|
|
||||||
|
|
||||||
10. Push your branch to GitHub:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git push origin my-fix-branch
|
|
||||||
```
|
|
||||||
|
|
||||||
11. In GitHub, send a pull request to `angular:master`.
|
|
||||||
|
|
||||||
If we ask for changes via code reviews then:
|
|
||||||
|
|
||||||
* Make the required updates.
|
|
||||||
* Re-run the Angular test suites to ensure tests are still passing.
|
|
||||||
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git rebase master -i
|
|
||||||
git push -f
|
|
||||||
```
|
|
||||||
|
|
||||||
That's it! Thank you for your contribution!
|
|
||||||
|
|
||||||
|
|
||||||
#### After your pull request is merged
|
|
||||||
|
|
||||||
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
|
|
||||||
|
|
||||||
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git push origin --delete my-fix-branch
|
|
||||||
```
|
|
||||||
|
|
||||||
* Check out the master branch:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git checkout master -f
|
|
||||||
```
|
|
||||||
|
|
||||||
* Delete the local branch:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git branch -D my-fix-branch
|
|
||||||
```
|
|
||||||
|
|
||||||
* Update your master with the latest upstream version:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git pull --ff upstream master
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="rules"></a> Coding Rules
|
|
||||||
To ensure consistency throughout the source code, keep these rules in mind as you are working:
|
|
||||||
|
|
||||||
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
|
|
||||||
* All public API methods **must be documented**.
|
|
||||||
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at **100 characters**.
|
|
||||||
|
|
||||||
An automated formatter is available, see [DEVELOPER.md](docs/DEVELOPER.md#clang-format).
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="commit"></a> Commit Message Format
|
|
||||||
|
|
||||||
*This specification is inspired and supersedes the [AngularJS commit message format][commit-message-format].*
|
|
||||||
|
|
||||||
We have very precise rules over how our Git commit messages must be formatted.
|
|
||||||
This format leads to **easier to read commit history**.
|
|
||||||
|
|
||||||
Each commit message consists of a **header**, a **body**, and a **footer**.
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
<header>
|
|
||||||
<BLANK LINE>
|
|
||||||
<body>
|
|
||||||
<BLANK LINE>
|
|
||||||
<footer>
|
|
||||||
```
|
|
||||||
|
|
||||||
The `header` is mandatory and must conform to the [Commit Message Header](#commit-header) format.
|
|
||||||
|
|
||||||
The `body` is mandatory for all commits except for those of scope "docs".
|
|
||||||
When the body is required it must be at least 20 characters long.
|
|
||||||
|
|
||||||
The `footer` is optional.
|
|
||||||
|
|
||||||
Any line of the commit message cannot be longer than 100 characters.
|
|
||||||
|
|
||||||
|
|
||||||
#### <a href="commit-header"></a>Commit Message Header
|
|
||||||
|
|
||||||
```
|
|
||||||
<type>(<scope>): <short summary>
|
|
||||||
│ │ │
|
|
||||||
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
|
|
||||||
│ │
|
|
||||||
│ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core|
|
|
||||||
│ elements|forms|http|language-service|localize|platform-browser|
|
|
||||||
│ platform-browser-dynamic|platform-server|platform-webworker|
|
|
||||||
│ platform-webworker-dynamic|router|service-worker|upgrade|zone.js|
|
|
||||||
│ packaging|changelog|dev-infra|docs-infra|migrations|ngcc|ve
|
|
||||||
│
|
|
||||||
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|style|test
|
|
||||||
```
|
|
||||||
|
|
||||||
The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is optional.
|
|
||||||
|
|
||||||
|
|
||||||
##### Type
|
|
||||||
|
|
||||||
Must be one of the following:
|
|
||||||
|
|
||||||
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
|
||||||
* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
|
|
||||||
* **docs**: Documentation only changes
|
|
||||||
* **feat**: A new feature
|
|
||||||
* **fix**: A bug fix
|
|
||||||
* **perf**: A code change that improves performance
|
|
||||||
* **refactor**: A code change that neither fixes a bug nor adds a feature
|
|
||||||
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
|
||||||
* **test**: Adding missing tests or correcting existing tests
|
|
||||||
|
|
||||||
|
|
||||||
##### Scope
|
|
||||||
The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages).
|
|
||||||
|
|
||||||
The following is the list of supported scopes:
|
|
||||||
|
|
||||||
* `animations`
|
|
||||||
* `bazel`
|
|
||||||
* `benchpress`
|
|
||||||
* `common`
|
|
||||||
* `compiler`
|
|
||||||
* `compiler-cli`
|
|
||||||
* `core`
|
|
||||||
* `elements`
|
|
||||||
* `forms`
|
|
||||||
* `http`
|
|
||||||
* `language-service`
|
|
||||||
* `localize`
|
|
||||||
* `platform-browser`
|
|
||||||
* `platform-browser-dynamic`
|
|
||||||
* `platform-server`
|
|
||||||
* `platform-webworker`
|
|
||||||
* `platform-webworker-dynamic`
|
|
||||||
* `router`
|
|
||||||
* `service-worker`
|
|
||||||
* `upgrade`
|
|
||||||
* `zone.js`
|
|
||||||
|
|
||||||
There are currently a few exceptions to the "use package name" rule:
|
|
||||||
|
|
||||||
* `packaging`: used for changes that change the npm package layout in all of our packages, e.g. public path changes, package.json changes done to all packages, d.ts file/format changes, changes to bundles, etc.
|
|
||||||
|
|
||||||
* `changelog`: used for updating the release notes in CHANGELOG.md
|
|
||||||
|
|
||||||
* `dev-infra`: used for dev-infra related changes within the directories /scripts, /tools and /dev-infra
|
|
||||||
|
|
||||||
* `docs-infra`: used for docs-app (angular.io) related changes within the /aio directory of the repo
|
|
||||||
|
|
||||||
* `migrations`: used for changes to the `ng update` migrations.
|
|
||||||
|
|
||||||
* `ngcc`: used for changes to the [Angular Compatibility Compiler](./packages/compiler-cli/ngcc/README.md)
|
|
||||||
|
|
||||||
* `ve`: used for changes specific to ViewEngine (legacy compiler/renderer).
|
|
||||||
|
|
||||||
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a specific package (e.g. `docs: fix typo in tutorial`).
|
|
||||||
|
|
||||||
|
|
||||||
##### Summary
|
|
||||||
|
|
||||||
Use the summary field to provide a succinct description of the change:
|
|
||||||
|
|
||||||
* use the imperative, present tense: "change" not "changed" nor "changes"
|
|
||||||
* don't capitalize the first letter
|
|
||||||
* no dot (.) at the end
|
|
||||||
|
|
||||||
|
|
||||||
#### Commit Message Body
|
|
||||||
|
|
||||||
Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
|
|
||||||
|
|
||||||
Explain the motivation for the change in the commit message body. This commit message should explain _why_ you are making the change.
|
|
||||||
You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change.
|
|
||||||
|
|
||||||
|
|
||||||
#### Commit Message Footer
|
|
||||||
|
|
||||||
The footer can contain information about breaking changes and is also the place to reference GitHub issues, Jira tickets, and other PRs that this commit closes or is related to.
|
|
||||||
|
|
||||||
```
|
|
||||||
BREAKING CHANGE: <breaking change summary>
|
|
||||||
<BLANK LINE>
|
|
||||||
<breaking change description + migration instructions>
|
|
||||||
<BLANK LINE>
|
|
||||||
<BLANK LINE>
|
|
||||||
Fixes #<issue number>
|
|
||||||
```
|
|
||||||
|
|
||||||
Breaking Change section should start with the phrase "BREAKING CHANGE: " followed by a summary of the breaking change, a blank line, and a detailed description of the breaking change that also includes migration instructions.
|
|
||||||
|
|
||||||
|
|
||||||
### Revert commits
|
|
||||||
|
|
||||||
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit.
|
|
||||||
|
|
||||||
The content of the commit message body should contain:
|
|
||||||
|
|
||||||
- information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>`,
|
|
||||||
- a clear description of the reason for reverting the commit message.
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="cla"></a> Signing the CLA
|
|
||||||
|
|
||||||
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
|
|
||||||
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
|
|
||||||
|
|
||||||
* For individuals, we have a [simple click-through form][individual-cla].
|
|
||||||
* For corporations, we'll need you to
|
|
||||||
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
|
|
||||||
|
|
||||||
If you have more than one GitHub accounts, or multiple email addresses associated with a single GitHub account, you must sign the CLA using the primary email address of the GitHub account used to author Git commits and send pull requests.
|
|
||||||
|
|
||||||
The following documents can help you sort out issues with GitHub accounts and multiple email addresses:
|
|
||||||
|
|
||||||
* https://help.github.com/articles/setting-your-commit-email-address-in-git/
|
|
||||||
* https://stackoverflow.com/questions/37245303/what-does-usera-committed-with-userb-13-days-ago-on-github-mean
|
|
||||||
* https://help.github.com/articles/about-commit-email-addresses/
|
|
||||||
* https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[angular-group]: https://groups.google.com/forum/#!forum/angular
|
|
||||||
[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
|
|
||||||
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
|
|
||||||
[corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html
|
|
||||||
[dev-doc]: https://github.com/angular/angular/blob/master/docs/DEVELOPER.md
|
|
||||||
[github]: https://github.com/angular/angular
|
|
||||||
[gitter]: https://gitter.im/angular/angular
|
|
||||||
[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
|
|
||||||
[js-style-guide]: https://google.github.io/styleguide/jsguide.html
|
|
||||||
[jsfiddle]: http://jsfiddle.net
|
|
||||||
[plunker]: http://plnkr.co/edit
|
|
||||||
[runnable]: http://runnable.com
|
|
||||||
[stackoverflow]: http://stackoverflow.com/questions/tagged/angular
|
|
440
CONTRIBUTING.md
440
CONTRIBUTING.md
@ -1,341 +1,287 @@
|
|||||||
# Contribuye a Angular
|
# Contributing to Angular
|
||||||
|
|
||||||
¡Nos encantaría que contribuyeras a Angular y que ayudaras a hacerlo aún mejor de lo que es hoy!
|
We would love for you to contribute to Angular and help make it even better than it is
|
||||||
Como colaborador, estos son los lineamientos que nos gustaría que siguieras:
|
today! As a contributor, here are the guidelines we would like you to follow:
|
||||||
|
|
||||||
- [Código de conducta](#coc)
|
- [Code of Conduct](#coc)
|
||||||
- [¿Preguntas o problemas?](#question)
|
- [Question or Problem?](#question)
|
||||||
- [_Issues_ y _bugs_](#issue)
|
- [Issues and Bugs](#issue)
|
||||||
- [Solicitud de funcionalidades](#feature)
|
- [Feature Requests](#feature)
|
||||||
- [Guía para la creación de issues y PRs](#submit)
|
- [Submission Guidelines](#submit)
|
||||||
- [Reglas del código](#rules)
|
- [Coding Rules](#rules)
|
||||||
- [Convención para el mensaje de los _commits_](#commit)
|
- [Commit Message Guidelines](#commit)
|
||||||
- [Firma del Acuerdo de Licencia de Colaborador (CLA)](#cla)
|
- [Signing the CLA](#cla)
|
||||||
|
|
||||||
|
## <a name="coc"></a> Code of Conduct
|
||||||
|
Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][coc].
|
||||||
|
|
||||||
|
## <a name="question"></a> Got a Question or Problem?
|
||||||
|
|
||||||
|
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on [Stack Overflow](https://stackoverflow.com/questions/tagged/angular) where the questions should be tagged with tag `angular`.
|
||||||
|
|
||||||
|
Stack Overflow is a much better place to ask questions since:
|
||||||
|
|
||||||
|
- there are thousands of people willing to help on Stack Overflow
|
||||||
|
- questions and answers stay available for public viewing so your question / answer might help someone else
|
||||||
|
- Stack Overflow's voting system assures that the best answers are prominently visible.
|
||||||
|
|
||||||
|
To save your and our time, we will systematically close all issues that are requests for general support and redirect people to Stack Overflow.
|
||||||
|
|
||||||
|
If you would like to chat about the question in real-time, you can reach out via [our gitter channel][gitter].
|
||||||
|
|
||||||
|
## <a name="issue"></a> Found a Bug?
|
||||||
|
If you find a bug in the source code, you can help us by
|
||||||
|
[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Even better, you can
|
||||||
|
[submit a Pull Request](#submit-pr) with a fix.
|
||||||
|
|
||||||
|
## <a name="feature"></a> Missing a Feature?
|
||||||
|
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
|
||||||
|
Repository. If you would like to *implement* a new feature, please submit an issue with
|
||||||
|
a proposal for your work first, to be sure that we can use it.
|
||||||
|
Please consider what kind of change it is:
|
||||||
|
|
||||||
|
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
|
||||||
|
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
|
||||||
|
and help you to craft the change so that it is successfully accepted into the project.
|
||||||
|
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
|
||||||
|
|
||||||
|
## <a name="submit"></a> Submission Guidelines
|
||||||
|
|
||||||
|
### <a name="submit-issue"></a> Submitting an Issue
|
||||||
|
|
||||||
|
Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available.
|
||||||
|
|
||||||
|
We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it. In order to reproduce bugs, we will systematically ask you to provide a minimal reproduction. Having a minimal reproducible scenario gives us a wealth of important information without going back & forth to you with additional questions.
|
||||||
|
|
||||||
|
A minimal reproduction allows us to quickly confirm a bug (or point out a coding problem) as well as confirm that we are fixing the right problem.
|
||||||
|
|
||||||
|
We will be insisting on a minimal reproduction scenario in order to save maintainers time and ultimately be able to fix more bugs. Interestingly, from our experience, users often find coding problems themselves while preparing a minimal reproduction. We understand that sometimes it might be hard to extract essential bits of code from a larger codebase but we really need to isolate the problem before we can fix it.
|
||||||
|
|
||||||
|
Unfortunately, we are not able to investigate / fix bugs without a minimal reproduction, so if we don't hear back from you, we are going to close an issue that doesn't have enough info to be reproduced.
|
||||||
|
|
||||||
|
You can file new issues by selecting from our [new issue templates](https://github.com/angular/angular/issues/new/choose) and filling out the issue template.
|
||||||
|
|
||||||
|
|
||||||
## <a name="coc"></a> Código de conducta
|
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
|
||||||
|
Before you submit your Pull Request (PR) consider the following guidelines:
|
||||||
|
|
||||||
Ayúdanos a mantener Angular abierto e inclusivo.
|
1. Search [GitHub](https://github.com/angular/angular/pulls) for an open or closed PR
|
||||||
Por favor lee y sigue nuestro [Código de conducta][coc].
|
that relates to your submission. You don't want to duplicate effort.
|
||||||
|
1. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add.
|
||||||
|
Discussing the design up front helps to ensure that we're ready to accept your work.
|
||||||
## <a name="question"></a> ¿Tienes alguna pregunta o problema?
|
1. Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
|
||||||
|
We cannot accept code without this. Make sure you sign with the primary email address of the Git identity that has been granted access to the Angular repository.
|
||||||
No abras *issues* para preguntas de soporte general ya que queremos mantener los *issues* de GitHub para reporte de *bugs* y solicitud de funcionalidades.
|
1. Fork the angular/angular repo.
|
||||||
En su lugar, recomendamos utilizar [Stack Overflow](https://stackoverflow.com/questions/tagged/angular) para hacer preguntas relacionadas con soporte. Al crear una nueva pregunta en Stack Overflow, asegúrate de agregar el etiqueta (tag) de `angular`.
|
1. Make your changes in a new git branch:
|
||||||
|
|
||||||
Stack Overflow es mucho mejor para hacer preguntas ya que:
|
|
||||||
|
|
||||||
- Hay miles de personas dispuestas a ayudar en preguntas y respuestas de Stack Overflow
|
|
||||||
que permanecen disponibles para el público, por lo que tu pregunta o respuesta podría ayudar a otra persona.
|
|
||||||
- El sistema de votación de Stack Overflow asegura que las mejores respuestas sobresalgan y sean visibles.
|
|
||||||
|
|
||||||
Para ahorrar tu tiempo y el nuestro, cerraremos sistemáticamente todos los *issues* que sean solicitudes de soporte general y redirigiremos a las personas a Stack Overflow.
|
|
||||||
|
|
||||||
Si deseas chatear sobre alguna pregunta en tiempo real, puedes hacerlo a través de nuestro [canal de Gitter][gitter].
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="issue"></a> ¿Encontraste un Bug?
|
|
||||||
|
|
||||||
Si encontraste un error en el código fuente, puedes ayudarnos [creando un *issue*](#submit-issue) en nuestro [repositorio de GitHub][github].
|
|
||||||
O incluso mejor, puedes [crear un *Pull Request*](#submit-pr) con la solución.
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="feature"></a> ¿Falta alguna funcionalidad?
|
|
||||||
Puedes solicitar una nueva funcionalidad [creando un *issue*](#submit-issue) en nuestro repositorio de GitHub.
|
|
||||||
Si deseas implementar una nueva funcionalidad, por favor considera el tamaño del cambio para determinar los pasos correctos para continuar:
|
|
||||||
|
|
||||||
* Para un **cambio significativo**, primero abre un *issue* y describe tu propuesta para que pueda ser discutida.
|
|
||||||
Este proceso nos permite coordinar mejor nuestros esfuerzos, evitar trabajo duplicado y ayudarte a diseñar el cambio para que sea aceptado con éxito en el proyecto.
|
|
||||||
|
|
||||||
**Nota**: Agregar un nuevo tema a la documentación o reescribir significativamente un tema, también cuenta como *cambio significativo*.
|
|
||||||
|
|
||||||
* **Cambios pequeños** pueden ser elaborados y directamente [creados como un _pull request_](#submit-pr).
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="submit"></a> Guía para la creación de issues y PRs
|
|
||||||
|
|
||||||
|
|
||||||
### <a name="submit-issue"></a> Creación de _issues_
|
|
||||||
|
|
||||||
Antes de crear un *issue*, por favor busca en el el *issue tracker*, quizá un *issue* para tu problema ya existe y la discusión puede informarte sobre soluciones alternativas disponibles.
|
|
||||||
|
|
||||||
Queremos solucionar todos los problemas lo antes posible, pero antes de corregir un bug necesitamos reproducirlo y confirmarlo.
|
|
||||||
Para reproducir errores, requerimos que proporciones una reproducción mínima.
|
|
||||||
Tener un escenario reproducible mínimo nos brinda una gran cantidad de información importante sin tener que ir y venir con preguntas adicionales.
|
|
||||||
|
|
||||||
Una reproducción mínima nos permite confirmar rápidamente un bug (o señalar un problema de código), así también confirmar que estamos solucionando el problema correcto.
|
|
||||||
|
|
||||||
Requerimos una reproducción mínima para ahorrar tiempo a los encargados del mantenimiento y en última instancia, poder corregir más bugs.
|
|
||||||
A menudo los desarrolladores encuentran problemas de código mientras preparan una reproducción mínima.
|
|
||||||
Entendemos que a veces puede ser difícil extraer porciones esenciales de código de un código más grande, pero realmente necesitamos aislar el problema antes de poder solucionarlo.
|
|
||||||
|
|
||||||
Desafortunadamente no podemos investigar/corregir errores sin una reproducción mínima, por lo que si no tenemos tu retroalimentación del bug, vamos a cerrar el *issue* ya que no tiene suficiente información para reproducirse.
|
|
||||||
|
|
||||||
Puedes presentar nuevos *issues* seleccionando nuestra [plantilla de _issues_](https://github.com/angular/angular/issues/new/choose) y complentando la plantilla.
|
|
||||||
|
|
||||||
|
|
||||||
### <a name="submit-pr"></a> Creación de un Pull Requests (PR)
|
|
||||||
|
|
||||||
Antes de crear tu Pull Request (PR) considera los siguientes lineamientos:
|
|
||||||
|
|
||||||
1. Busca en [GitHub](https://github.com/angular/angular/pulls) PRs que estén abiertos o cerrados y que estén relacionados con el que vas a crear.
|
|
||||||
No deseas duplicar los esfuerzos existentes.
|
|
||||||
|
|
||||||
2. Asegúrate de que el PR describa el problema que estás solucionando o que documente el diseño de la funcionalidad que deseas agregar.
|
|
||||||
Discutir el diseño por adelantado ayuda a garantizar que estemos listos para aceptar tu trabajo.
|
|
||||||
|
|
||||||
3. Por favor firma nuestro [Acuerdo de Licencia de Colaborador (CLA)](#cla) antes de crear PRs.
|
|
||||||
No podemos aceptar el código sin el Acuerdo de Licencia de Colaborador (CLA) firmado.
|
|
||||||
Asegúrate de crear todas las contribuciones de Git con la dirección de correo electrónico asociada con tu firma del Acuerdo de Licencia de Colaborador (CLA).
|
|
||||||
|
|
||||||
4. Haz *fork* del repositorio angular/angular.
|
|
||||||
|
|
||||||
5. Haz tus cambios en una nueva rama de Git:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git checkout -b my-fix-branch master
|
git checkout -b my-fix-branch master
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Crea tu correción, **incluyendo casos de prueba apropiados**.
|
1. Create your patch, **including appropriate test cases**.
|
||||||
|
1. Follow our [Coding Rules](#rules).
|
||||||
7. Sigue nuestras [Reglas de código](#rules).
|
1. Run the full Angular test suite, as described in the [developer documentation][dev-doc],
|
||||||
|
and ensure that all tests pass.
|
||||||
8. Ejecuta todo el conjunto de pruebas de Angular, tal como está descrito en la [documentación del desarrollador][dev-doc], y asegúrate de que todas las pruebas pasen.
|
1. Commit your changes using a descriptive commit message that follows our
|
||||||
|
[commit message conventions](#commit). Adherence to these conventions
|
||||||
9. Crea un commit de tus cambios utilizando un mensaje de commit descriptivo que siga nuestra [convención para el mensaje de los commits](#commit).
|
is necessary because release notes are automatically generated from these messages.
|
||||||
Es necesario cumplir con estas convenciones porque las notas de las versiones se generan automáticamente a partir de estos mensajes.
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git commit -a
|
git commit -a
|
||||||
```
|
```
|
||||||
Nota: la opción de la línea de comandos de Git `-a` automaticamente hará "add" y "rm" a los archivos editados.
|
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
|
||||||
|
|
||||||
10. Haz push de tu rama a GitHub:
|
1. Push your branch to GitHub:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git push origin my-fix-branch
|
git push origin my-fix-branch
|
||||||
```
|
```
|
||||||
|
|
||||||
11. En GitHub, crea un pull request a `angular:master`.
|
1. In GitHub, send a pull request to `angular:master`.
|
||||||
|
* If we suggest changes then:
|
||||||
Si solicitamos cambios a través de revisiones de código, sigue las siguientes indicaciones:
|
* Make the required updates.
|
||||||
|
* Re-run the Angular test suites to ensure tests are still passing.
|
||||||
* Haz los cambios requeridos.
|
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
|
||||||
* Ejecuta nuevamente el conjunto de pruebas de Angular para asegurar que todas las pruebas aún están pasando.
|
|
||||||
* Haz rebase de tu rama a la rama master y haz push con la opción `-f` a tu repositorio de Github (esto actualizará tu Pull Request):
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git rebase master -i
|
git rebase master -i
|
||||||
git push -f
|
git push -f
|
||||||
```
|
```
|
||||||
|
|
||||||
¡Es todo! ¡Muchas gracias por tu contribución!
|
That's it! Thank you for your contribution!
|
||||||
|
|
||||||
|
#### After your pull request is merged
|
||||||
|
|
||||||
#### Después del merge de tu pull request
|
After your pull request is merged, you can safely delete your branch and pull the changes
|
||||||
|
from the main (upstream) repository:
|
||||||
|
|
||||||
Después de que se hizo merge de tu pull request, puedes eliminar de forma segura tu rama y hacer pull de los cambios del repositorio principal (upstream):
|
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||||
|
|
||||||
* Elimina la rama remota en GitHub a través de la interfaz de usuario web de GitHub o en tu línea de comandos de la siguiente manera:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git push origin --delete my-fix-branch
|
git push origin --delete my-fix-branch
|
||||||
```
|
```
|
||||||
|
|
||||||
* Muévete a la rama master:
|
* Check out the master branch:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git checkout master -f
|
git checkout master -f
|
||||||
```
|
```
|
||||||
|
|
||||||
* Elimina tu rama local:
|
* Delete the local branch:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git branch -D my-fix-branch
|
git branch -D my-fix-branch
|
||||||
```
|
```
|
||||||
|
|
||||||
* Actualiza tu rama master con la última versión del fork (upstream):
|
* Update your master with the latest upstream version:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git pull --ff upstream master
|
git pull --ff upstream master
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## <a name="rules"></a> Coding Rules
|
||||||
|
To ensure consistency throughout the source code, keep these rules in mind as you are working:
|
||||||
|
|
||||||
## <a name="rules"></a> Reglas del código
|
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
|
||||||
Para garantizar la coherencia en todo el código fuente, ten en cuenta estas reglas mientras trabajas:
|
* All public API methods **must be documented**. (Details TBC).
|
||||||
|
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at
|
||||||
|
**100 characters**. An automated formatter is available, see
|
||||||
|
[DEVELOPER.md](docs/DEVELOPER.md#clang-format).
|
||||||
|
|
||||||
* Todas las funcionalidades o solución de bugs **deben ser probadas** por una o más pruebas (pruebas unitarias).
|
## <a name="commit"></a> Commit Message Guidelines
|
||||||
* Todos los métodos públicos del API **deben ser documentados**.
|
|
||||||
* Seguimos la [guía de estilo JavaScript de Google][js-style-guide], pero cada línea no debe exceder **100 caracteres**.
|
|
||||||
|
|
||||||
Un formateador automatizado está disponible, revisar [DEVELOPER.md](docs/DEVELOPER.md#clang-format).
|
We have very precise rules over how our git commit messages can be formatted. This leads to **more
|
||||||
|
readable messages** that are easy to follow when looking through the **project history**. But also,
|
||||||
|
we use the git commit messages to **generate the Angular change log**.
|
||||||
## <a name="commit"></a> Formato para el mensaje de los commits
|
|
||||||
|
|
||||||
*Esta especificación está inspirada y reemplaza el [Formato de mensaje de commits de AngularJS][commit-message-format].*
|
|
||||||
|
|
||||||
Tenemos reglas muy precisas sobre cómo deben formatearse nuestros mensajes de los commits de Git.
|
|
||||||
Este formato permite tener **un historial de commits más facil de leer**.
|
|
||||||
|
|
||||||
Cada mensaje de un commit consta del **header**, el **body**, y el **footer**.
|
|
||||||
|
|
||||||
|
### Commit Message Format
|
||||||
|
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
|
||||||
|
format that includes a **type**, a **scope** and a **subject**:
|
||||||
|
|
||||||
```
|
```
|
||||||
<header>
|
<type>(<scope>): <subject>
|
||||||
<LINEA VACIA>
|
<BLANK LINE>
|
||||||
<body>
|
<body>
|
||||||
<LINEA VACIA>
|
<BLANK LINE>
|
||||||
<footer>
|
<footer>
|
||||||
```
|
```
|
||||||
|
|
||||||
El `header` es obligatorio y debe ajustarse al formato del [mensaje del header del commit](#commit-header).
|
The **header** is mandatory and the **scope** of the header is optional.
|
||||||
|
|
||||||
El `body` es obligatorio para todos los commits excepto los que tenga scope "docs".
|
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier
|
||||||
Cuando el body es requerido debe tener al menos 20 caracteres.
|
to read on GitHub as well as in various git tools.
|
||||||
|
|
||||||
El `footer` es opcional.
|
The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
|
||||||
|
|
||||||
Cualquier línea del mensaje del commit no puede tener más de 100 caracteres.
|
Samples: (even more [samples](https://github.com/angular/angular/commits/master))
|
||||||
|
|
||||||
|
|
||||||
#### <a href="commit-header"></a>Mensaje del header del commit
|
|
||||||
|
|
||||||
```
|
```
|
||||||
<tipo>(<alcance>): <resumen>
|
docs(changelog): update changelog to beta.5
|
||||||
│ │ │
|
```
|
||||||
│ │ └─⫸ Resumen corto escrito en modo imperativo, tiempo presente. Sin mayúsculas. Sin punto final.
|
```
|
||||||
│ │
|
fix(release): need to depend on latest rxjs and zone.js
|
||||||
│ └─⫸ Alcance del commit: animations|bazel|benchpress|common|compiler|compiler-cli|core|
|
|
||||||
│ elements|forms|http|language-service|localize|platform-browser|
|
The version in our package.json gets copied to the one we publish, and users need the latest of these.
|
||||||
│ platform-browser-dynamic|platform-server|platform-webworker|
|
|
||||||
│ platform-webworker-dynamic|router|service-worker|upgrade|zone.js|
|
|
||||||
│ packaging|changelog|dev-infra|docs-infra|migrations|ngcc|ve
|
|
||||||
│
|
|
||||||
└─⫸ Tipo de commit: build|ci|docs|feat|fix|perf|refactor|style|test
|
|
||||||
```
|
```
|
||||||
|
|
||||||
El `<tipo>` y `<resumen>` son obligatorios, el `(<alcance>)` es opcional.
|
### Revert
|
||||||
|
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
||||||
|
|
||||||
|
### Type
|
||||||
|
Must be one of the following:
|
||||||
|
|
||||||
##### Tipo
|
* **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||||
|
* **ci**: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
|
||||||
|
* **docs**: Documentation only changes
|
||||||
|
* **feat**: A new feature
|
||||||
|
* **fix**: A bug fix
|
||||||
|
* **perf**: A code change that improves performance
|
||||||
|
* **refactor**: A code change that neither fixes a bug nor adds a feature
|
||||||
|
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||||
|
* **test**: Adding missing tests or correcting existing tests
|
||||||
|
|
||||||
El tipo debe ser uno de los siguientes:
|
### Scope
|
||||||
|
The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages).
|
||||||
|
|
||||||
* **build**: cambios que afectan el sistema de compilación o dependencias externas (ejemplos de scopes: gulp, broccoli, npm)
|
The following is the list of supported scopes:
|
||||||
* **ci**: cambios en nuestros archivos y scripts de configuración de CI (ejemplos de scopes: Circle, BrowserStack, SauceLabs)
|
|
||||||
* **docs**: cambios en la documentación
|
|
||||||
* **feat**: una nueva funcionalidad
|
|
||||||
* **fix**: una solución de un bug
|
|
||||||
* **perf**: un cambio de código que mejora el rendimiento.
|
|
||||||
* **refactor**: un cambio de código que no corrige ningún error ni agrega ninguna funcionalidad
|
|
||||||
* **style**: cambios que no afectan el significado del código (espacios en blanco, formato, falta de punto y coma, etc.)
|
|
||||||
* **test**: se agregan pruebas faltantes o se corrigen pruebas existentes
|
|
||||||
|
|
||||||
|
* **animations**
|
||||||
|
* **bazel**
|
||||||
|
* **benchpress**
|
||||||
|
* **common**
|
||||||
|
* **compiler**
|
||||||
|
* **compiler-cli**
|
||||||
|
* **core**
|
||||||
|
* **elements**
|
||||||
|
* **forms**
|
||||||
|
* **http**
|
||||||
|
* **language-service**
|
||||||
|
* **localize**
|
||||||
|
* **platform-browser**
|
||||||
|
* **platform-browser-dynamic**
|
||||||
|
* **platform-server**
|
||||||
|
* **platform-webworker**
|
||||||
|
* **platform-webworker-dynamic**
|
||||||
|
* **router**
|
||||||
|
* **service-worker**
|
||||||
|
* **upgrade**
|
||||||
|
* **zone.js**
|
||||||
|
|
||||||
##### Alcance
|
There are currently a few exceptions to the "use package name" rule:
|
||||||
El alcance debe ser el nombre del paquete npm afectado (tal como lo percibe la persona que lee el registro de cambios generado a partir de los mensajes de commit).
|
|
||||||
|
|
||||||
La siguiente es la lista de alcances permitidos:
|
* **packaging**: used for changes that change the npm package layout in all of our packages, e.g.
|
||||||
|
public path changes, package.json changes done to all packages, d.ts file/format changes, changes
|
||||||
|
to bundles, etc.
|
||||||
|
* **changelog**: used for updating the release notes in CHANGELOG.md
|
||||||
|
* **docs-infra**: used for docs-app (angular.io) related changes within the /aio directory of the
|
||||||
|
repo
|
||||||
|
* **dev-infra**: used for dev-infra related changes within the directories /scripts, /tools and /dev-infra
|
||||||
|
* **ngcc**: used for changes to the [Angular Compatibility Compiler](./packages/compiler-cli/ngcc/README.md)
|
||||||
|
* **ve**: used for changes specific to ViewEngine (legacy compiler/renderer).
|
||||||
|
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all
|
||||||
|
packages (e.g. `style: add missing semicolons`) and for docs changes that are not related to a
|
||||||
|
specific package (e.g. `docs: fix typo in tutorial`).
|
||||||
|
|
||||||
* `animations`
|
### Subject
|
||||||
* `bazel`
|
The subject contains a succinct description of the change:
|
||||||
* `benchpress`
|
|
||||||
* `common`
|
|
||||||
* `compiler`
|
|
||||||
* `compiler-cli`
|
|
||||||
* `core`
|
|
||||||
* `elements`
|
|
||||||
* `forms`
|
|
||||||
* `http`
|
|
||||||
* `language-service`
|
|
||||||
* `localize`
|
|
||||||
* `platform-browser`
|
|
||||||
* `platform-browser-dynamic`
|
|
||||||
* `platform-server`
|
|
||||||
* `platform-webworker`
|
|
||||||
* `platform-webworker-dynamic`
|
|
||||||
* `router`
|
|
||||||
* `service-worker`
|
|
||||||
* `upgrade`
|
|
||||||
* `zone.js`
|
|
||||||
|
|
||||||
Actualmente hay algunas excepciones a la regla "usar el nombre de paquete":
|
* use the imperative, present tense: "change" not "changed" nor "changes"
|
||||||
|
* don't capitalize the first letter
|
||||||
|
* no dot (.) at the end
|
||||||
|
|
||||||
* `packaging`: usado para cambios que cambian el diseño de los paquetes de npm en todos nuestros paquetes. Ejemplos: cambios de la ruta públic, package.json cambios hechos a todos los paquetes, cambios a archivos o formatos d.ts, cambios a bundles, etc.
|
### Body
|
||||||
|
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
||||||
|
The body should include the motivation for the change and contrast this with previous behavior.
|
||||||
|
|
||||||
* `changelog`: utilizado para actualizar las notas de la versión en CHANGELOG.md
|
### Footer
|
||||||
|
The footer should contain any information about **Breaking Changes** and is also the place to
|
||||||
|
reference GitHub issues that this commit **Closes**.
|
||||||
|
|
||||||
* `dev-infra`: utilizado para cambios relacionados con dev-infra dentro de los directorios /scripts, /tools y /dev-infra
|
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
|
||||||
|
|
||||||
* `docs-infra`: utilizado para cambios relacionados con la documentación (angular.io) dentro del directorio /aio del repositorio
|
A detailed explanation can be found in this [document][commit-message-format].
|
||||||
|
|
||||||
* `migrations`: utilizado para los cambios en las migraciones `ng update`.
|
## <a name="cla"></a> Signing the CLA
|
||||||
|
|
||||||
* `ngcc`: usado para los cambios del [Compilador de compatibilidad de Angular](./packages/compiler-cli/ngcc/README.md)
|
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
|
||||||
|
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
|
||||||
|
|
||||||
* `ve`: utilizado para cambios específicos de ViewEngine (legacy compiler/renderer).
|
* For individuals, we have a [simple click-through form][individual-cla].
|
||||||
|
* For corporations, we'll need you to
|
||||||
|
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
|
||||||
|
|
||||||
* alcance vacío: útil para cambios de `style`, `test` y `refactor` que se realizan en todos los paquetes (ejemplo: `style: add missing semicolons`) y para cambios de la documentación que no están relacionados a un paquete en específico(ejemplo: `docs: corrige error gramatical en el tutorial`).
|
<hr>
|
||||||
|
|
||||||
|
If you have more than one Git identity, you must make sure that you sign the CLA using the primary email address associated with the ID that has been granted access to the Angular repository. Git identities can be associated with more than one email address, and only one is primary. Here are some links to help you sort out multiple Git identities and email addresses:
|
||||||
##### Resumen
|
|
||||||
|
|
||||||
Usa el campo resumen para proporcionar una descripción breve del cambio:
|
|
||||||
|
|
||||||
* usa el modo imperativo, tiempo presente: "cambia" no "cambió" o "cambios"
|
|
||||||
* no debe de contener ninguna letra mayúscula
|
|
||||||
* no debe de conter punto (.) al final
|
|
||||||
|
|
||||||
|
|
||||||
#### Mensaje del cuerpo del commit
|
|
||||||
|
|
||||||
Tal como en el resumen, usa el modo imperativo, tiempo presente: "cambia" no "cambió" o "cambios".
|
|
||||||
|
|
||||||
Explica la razón del cambio en el el mensaje del cuerpo del commit. Este mensaje de confirmación debe explicar _por qué_ está realizando el cambio.
|
|
||||||
Puedes incluir una comparación del comportamiento anterior con el nuevo comportamiento para ilustrar el impacto del cambio.
|
|
||||||
|
|
||||||
|
|
||||||
#### Mensaje del footer del commit
|
|
||||||
|
|
||||||
El footer puede contener información sobre cambios significativos y también es el lugar para hacer referencia a issues de GitHub, tickets de Jira y otros PRs que están relacionados con el commit.
|
|
||||||
|
|
||||||
```
|
|
||||||
CAMBIO SIGNIFICATIVO: <resumen del cambio significativo>
|
|
||||||
<LINEA VACIA>
|
|
||||||
<descripción del cambio significativo + instrucciones para la migración>
|
|
||||||
<LINEA VACIA>
|
|
||||||
<LINEA VACIA>
|
|
||||||
Fix #<issue número>
|
|
||||||
```
|
|
||||||
|
|
||||||
La sección de cambios significativos debería comenzar con la frase "CAMBIO SIGNIFICATIVO: " seguido de un resumen del cambio significativo, una línea en blanco y una descripción detallada del cambio significativo que también incluya instrucciones de migración.
|
|
||||||
|
|
||||||
|
|
||||||
### Revirtiendo commits
|
|
||||||
|
|
||||||
Si el commit revierte un commit previo, el commit debería comenzar con `revert: `, seguido por el header del commit revertido.
|
|
||||||
|
|
||||||
El contenido del mensaje del commit debería contener:
|
|
||||||
|
|
||||||
- Información sobre el SHA del commit que se revierte en el siguiente formato: `Esto revierte el commit <SHA>`,
|
|
||||||
- Una descripción clara de la razón para revertir el mensaje del _commit_.
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="cla"></a> Firma del Acuerdo de Licencia de Colaborador (CLA)
|
|
||||||
|
|
||||||
Por favor firma nuestro Acuerdo de Licencia de Colaborador (CLA) cuando creas tu primer pull request. Para que cualquier cambio de código sea aceptado, el Acuerdo de Licencia de Colaborador (CLA) debe ser firmado. Es un proceso rápido con nuestro CLA assistant que está integrado con nuestro CI.
|
|
||||||
|
|
||||||
Los siguientes documentos pueden ayudarte a resolver problemas con cuentas de GitHub y múltiples direcciones de correo electrónico:
|
|
||||||
|
|
||||||
* https://help.github.com/articles/setting-your-commit-email-address-in-git/
|
* https://help.github.com/articles/setting-your-commit-email-address-in-git/
|
||||||
* https://stackoverflow.com/questions/37245303/what-does-usera-committed-with-userb-13-days-ago-on-github-mean
|
* https://stackoverflow.com/questions/37245303/what-does-usera-committed-with-userb-13-days-ago-on-github-mean
|
||||||
* https://help.github.com/articles/about-commit-email-addresses/
|
* https://help.github.com/articles/about-commit-email-addresses/
|
||||||
* https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/
|
* https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/
|
||||||
|
|
||||||
|
Note that if you have more than one Git identity, it is important to verify that you are logged in with the same ID with which you signed the CLA, before you commit changes. If not, your PR will fail the CLA check.
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
[angular-group]: https://groups.google.com/forum/#!forum/angular
|
[angular-group]: https://groups.google.com/forum/#!forum/angular
|
||||||
[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
|
[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md
|
||||||
|
26
README.en.md
26
README.en.md
@ -1,26 +0,0 @@
|
|||||||
[](https://circleci.com/gh/angular/workflows/angular/tree/master)
|
|
||||||
[](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
||||||
[](https://www.npmjs.com/@angular/core)
|
|
||||||
|
|
||||||
|
|
||||||
# Angular
|
|
||||||
|
|
||||||
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
|
|
||||||
|
|
||||||
## Quickstart
|
|
||||||
|
|
||||||
[Get started in 5 minutes][quickstart].
|
|
||||||
|
|
||||||
## Changelog
|
|
||||||
|
|
||||||
[Learn about the latest improvements][changelog].
|
|
||||||
|
|
||||||
## Want to help?
|
|
||||||
|
|
||||||
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
|
||||||
guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
|
|
||||||
|
|
||||||
[contributing]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md
|
|
||||||
[quickstart]: https://angular.io/start
|
|
||||||
[changelog]: https://github.com/angular/angular/blob/master/CHANGELOG.md
|
|
||||||
[ng]: https://angular.io
|
|
31
README.md
31
README.md
@ -1,25 +1,26 @@
|
|||||||
# Angular en español
|
[](https://circleci.com/gh/angular/workflows/angular/tree/master)
|
||||||
|
[](https://gitter.im/angular/angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
[](https://www.npmjs.com/@angular/core)
|
||||||
|
|
||||||
Angular es una plataforma de desarrollo para construir aplicaciones web y móviles que usa
|
|
||||||
TypeScript/JavaScript y otros lenguajes de programación.
|
|
||||||
|
|
||||||
## ¿Quieres ayudar?
|
# Angular
|
||||||
|
|
||||||
### Documentación en español
|
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
|
||||||
|
|
||||||
¿Quieres mejorar la documentación? ¡Excelente! Lee nuestras pautas para
|
## Quickstart
|
||||||
[colaborar](CONTRIBUTING.md) y luego revisa algunos de nuestras
|
|
||||||
[issues](https://github.com/angular-hispano/angular/issues).
|
|
||||||
|
|
||||||
### El framework
|
[Get started in 5 minutes][quickstart].
|
||||||
|
|
||||||
La colaboración para corregir errores y agregar funciones en el framework debe realizarse en inglés a través
|
## Changelog
|
||||||
del repositorio [angular/angular](https://github.com/angular/angular) upstream.
|
|
||||||
|
|
||||||
## Guía rápida
|
[Learn about the latest improvements][changelog].
|
||||||
|
|
||||||
[Comienza a usarlo en 5 minutos](https://docs.angular.lat/start).
|
## Want to help?
|
||||||
|
|
||||||
## Registro de cambios (Changelog)
|
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
||||||
|
guidelines for [contributing][contributing] and then check out one of our issues in the [hotlist: community-help](https://github.com/angular/angular/labels/hotlist%3A%20community-help).
|
||||||
|
|
||||||
[Últimas mejoras realizadas](CHANGELOG.md).
|
[contributing]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md
|
||||||
|
[quickstart]: https://angular.io/start
|
||||||
|
[changelog]: https://github.com/angular/angular/blob/master/CHANGELOG.md
|
||||||
|
[ng]: https://angular.io
|
||||||
|
15
WORKSPACE
15
WORKSPACE
@ -8,8 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|||||||
# Fetch rules_nodejs so we can install our npm dependencies
|
# Fetch rules_nodejs so we can install our npm dependencies
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "build_bazel_rules_nodejs",
|
name = "build_bazel_rules_nodejs",
|
||||||
sha256 = "84abf7ac4234a70924628baa9a73a5a5cbad944c4358cf9abdb4aab29c9a5b77",
|
sha256 = "f9e7b9f42ae202cc2d2ce6d698ccb49a9f7f7ea572a78fd451696d03ef2ee116",
|
||||||
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.7.0/rules_nodejs-1.7.0.tar.gz"],
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.6.0/rules_nodejs-1.6.0.tar.gz"],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check the rules_nodejs version and download npm dependencies
|
# Check the rules_nodejs version and download npm dependencies
|
||||||
@ -17,7 +17,7 @@ http_archive(
|
|||||||
# assert on that.
|
# assert on that.
|
||||||
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")
|
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")
|
||||||
|
|
||||||
check_rules_nodejs_version(minimum_version_string = "1.7.0")
|
check_rules_nodejs_version(minimum_version_string = "1.6.0")
|
||||||
|
|
||||||
# Setup the Node.js toolchain
|
# Setup the Node.js toolchain
|
||||||
node_repositories(
|
node_repositories(
|
||||||
@ -64,7 +64,7 @@ load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories"
|
|||||||
|
|
||||||
web_test_repositories()
|
web_test_repositories()
|
||||||
|
|
||||||
load("//dev-infra/browsers:browser_repositories.bzl", "browser_repositories")
|
load("//tools/browsers:browser_repositories.bzl", "browser_repositories")
|
||||||
|
|
||||||
browser_repositories()
|
browser_repositories()
|
||||||
|
|
||||||
@ -91,18 +91,17 @@ rbe_autoconfig(
|
|||||||
# Need to specify a base container digest in order to ensure that we can use the checked-in
|
# Need to specify a base container digest in order to ensure that we can use the checked-in
|
||||||
# platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would
|
# platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would
|
||||||
# need to pull the image and run it in order determine the toolchain configuration. See:
|
# need to pull the image and run it in order determine the toolchain configuration. See:
|
||||||
# https://github.com/bazelbuild/bazel-toolchains/blob/3.2.0/configs/ubuntu16_04_clang/versions.bzl
|
# https://github.com/bazelbuild/bazel-toolchains/blob/1.1.2/configs/ubuntu16_04_clang/versions.bzl
|
||||||
base_container_digest = "sha256:5e750dd878df9fcf4e185c6f52b9826090f6e532b097f286913a428290622332",
|
base_container_digest = "sha256:1ab40405810effefa0b2f45824d6d608634ccddbf06366760c341ef6fbead011",
|
||||||
# Note that if you change the `digest`, you might also need to update the
|
# Note that if you change the `digest`, you might also need to update the
|
||||||
# `base_container_digest` to make sure marketplace.gcr.io/google/rbe-ubuntu16-04-webtest:<digest>
|
# `base_container_digest` to make sure marketplace.gcr.io/google/rbe-ubuntu16-04-webtest:<digest>
|
||||||
# and marketplace.gcr.io/google/rbe-ubuntu16-04:<base_container_digest> have
|
# and marketplace.gcr.io/google/rbe-ubuntu16-04:<base_container_digest> have
|
||||||
# the same Clang and JDK installed. Clang is needed because of the dependency on
|
# the same Clang and JDK installed. Clang is needed because of the dependency on
|
||||||
# @com_google_protobuf. Java is needed for the Bazel's test executor Java tool.
|
# @com_google_protobuf. Java is needed for the Bazel's test executor Java tool.
|
||||||
digest = "sha256:f743114235a43355bf8324e2ba0fa6a597236fe06f7bc99aaa9ac703631c306b",
|
digest = "sha256:0b8fa87db4b8e5366717a7164342a029d1348d2feea7ecc4b18c780bc2507059",
|
||||||
env = clang_env(),
|
env = clang_env(),
|
||||||
registry = "marketplace.gcr.io",
|
registry = "marketplace.gcr.io",
|
||||||
# We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need
|
# We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need
|
||||||
# a specific Linux kernel that comes with "libx11" in order to run headless browser tests.
|
# a specific Linux kernel that comes with "libx11" in order to run headless browser tests.
|
||||||
repository = "google/rbe-ubuntu16-04-webtest",
|
repository = "google/rbe-ubuntu16-04-webtest",
|
||||||
use_checked_in_confs = "Force",
|
|
||||||
)
|
)
|
||||||
|
167
aio/README.md
167
aio/README.md
@ -1,131 +1,140 @@
|
|||||||
# Proyecto de documentación Angular (https://docs.angular.lat)
|
# Angular documentation project (https://angular.io)
|
||||||
|
|
||||||
Todo en esta carpeta es parte del proyecto de documentación. Esto incluye:
|
Everything in this folder is part of the documentation project. This includes
|
||||||
|
|
||||||
* El sitio web para mostrar la documentación
|
* the web site for displaying the documentation
|
||||||
* La configuración de dgeni para convertir los archivos de origen a archivos renderizados que se pueden vizualizar en el sitio web.
|
* the dgeni configuration for converting source files to rendered files that can be viewed in the web site.
|
||||||
* Las herramientas para establecer ejemplos para el desarrollo; y generar archivos en tiempo real y archivos zip desde los ejemplos.
|
* the tooling for setting up examples for development; and generating live-example and zip files from the examples.
|
||||||
|
|
||||||
## Tareas de desarrollador
|
## Developer tasks
|
||||||
|
|
||||||
Nosotros usamos [Yarn](https://yarnpkg.com) para gestionar las dependencias y crear tareas de compilación.
|
We use [Yarn](https://yarnpkg.com) to manage the dependencies and to run build tasks.
|
||||||
Debes ejecutar todas estas tareas desde la carpeta `angular/aio`.
|
You should run all these tasks from the `angular/aio` folder.
|
||||||
Aquí están las tareas más importantes que podrías necesitar usar:
|
Here are the most important tasks you might need to use:
|
||||||
|
|
||||||
* `yarn` - instalar todas las dependencias.
|
* `yarn` - install all the dependencies.
|
||||||
* `yarn setup` - instalar todas las dependencias, boilerplate, stackblitz, zips y ejecuta dgeni en los documentos.
|
* `yarn setup` - install all the dependencies, boilerplate, stackblitz, zips and run dgeni on the docs.
|
||||||
* `yarn setup-local` - igual que `setup`, pero crea los paquetes de Angular a partir del código y usa estas versiones construidas localmente (en lugar de las recuperadas desde npm) para aio y ejemplos de documentos boilerplate.
|
* `yarn setup-local` - same as `setup`, but build the Angular packages from the source code and use these locally built versions (instead of the ones fetched from npm) for aio and docs examples boilerplate.
|
||||||
|
|
||||||
* `yarn build` - crear una compilación de producción de la aplicación (después de instalar dependencias, boilerplate, etc).
|
* `yarn build` - create a production build of the application (after installing dependencies, boilerplate, etc).
|
||||||
* `yarn build-local` - igual que `build`, pero usa `setup-local` en lugar de `setup`.
|
* `yarn build-local` - same as `build`, but use `setup-local` instead of `setup`.
|
||||||
* `yarn build-local-with-viewengine` - igual que `build-local`, pero además también enciende el modo `ViewEngine` (pre-Ivy) en aio.
|
* `yarn build-local-with-viewengine` - same as `build-local`, but in addition also turns on `ViewEngine` (pre-Ivy) mode in aio.
|
||||||
(Nota: Encender el modo `ViewEngine` en ejemplos de documentos, ver `yarn boilerplate:add:viewengine` abajo.)
|
(Note: To turn on `ViewEngine` mode in docs examples, see `yarn boilerplate:add:viewengine` below.)
|
||||||
|
|
||||||
* `yarn start` - ejecutar un servidor web de desarrollo que observa los archivos; luego crea el doc-viewer y vuelve a cargar la página, según sea necesario.
|
* `yarn start` - run a development web server that watches the files; then builds the doc-viewer and reloads the page, as necessary.
|
||||||
* `yarn serve-and-sync` - ejecutar ambos, el `docs-watch` y `start` en la misma consola.
|
* `yarn serve-and-sync` - run both the `docs-watch` and `start` in the same console.
|
||||||
* `yarn lint` - comprobar que el código del doc-viewer sigue nuestras reglas de estilo.
|
* `yarn lint` - check that the doc-viewer code follows our style rules.
|
||||||
* `yarn test` - observar todos los archivos de origen, para el doc-viewer, y ejecuta todas las pruebas unitarias cuando haya algún cambio.
|
* `yarn test` - watch all the source files, for the doc-viewer, and run all the unit tests when any change.
|
||||||
* `yarn test --watch=false` -ejecutar todas las pruebas unitarias una sola vez.
|
* `yarn test --watch=false` - run all the unit tests once.
|
||||||
* `yarn e2e` - ejecutar todas las pruebas de e2e para el doc-viewer.
|
* `yarn e2e` - run all the e2e tests for the doc-viewer.
|
||||||
|
|
||||||
* `yarn docs` - generar toda la documentación desde los archivos fuente.
|
* `yarn docs` - generate all the docs from the source files.
|
||||||
* `yarn docs-watch` - observar el código Angular, los archivos de documentación y ejecutar un 'doc-gen' en corto circuito para los documentos que fueron cambiados.
|
* `yarn docs-watch` - watch the Angular source and the docs files and run a short-circuited doc-gen for the docs that changed.
|
||||||
* `yarn docs-lint` - comprobar que el código del documento generado sigue nuestras reglas de estilo.
|
* `yarn docs-lint` - check that the doc gen code follows our style rules.
|
||||||
* `yarn docs-test` - ejecutar las pruebas unitarias para el código de generación de doc.
|
* `yarn docs-test` - run the unit tests for the doc generation code.
|
||||||
|
|
||||||
* `yarn boilerplate:add` - generar todo el código boilerplate para los ejemplos, para que puedan ejecutarse localmente.
|
* `yarn boilerplate:add` - generate all the boilerplate code for the examples, so that they can be run locally.
|
||||||
* `yarn boilerplate:add:viewengine` - igual que `boilerplate:add` pero también enciende el modo `ViewEngine` (pre-Ivy).
|
* `yarn boilerplate:add:viewengine` - same as `boilerplate:add` but also turns on `ViewEngine` (pre-Ivy) mode.
|
||||||
|
|
||||||
* `yarn boilerplate:remove` - eliminar todo el código boilerplate que fue añadido a través`yarn boilerplate:add`.
|
* `yarn boilerplate:remove` - remove all the boilerplate code that was added via `yarn boilerplate:add`.
|
||||||
* `yarn generate-stackblitz` - generar los archivos stackblitz que están usados por la etiqueta `live-example` en documentos.
|
* `yarn generate-stackblitz` - generate the stackblitz files that are used by the `live-example` tags in the docs.
|
||||||
* `yarn generate-zips` - generar los archivos zip desde los ejemplos. Zip está disponible a través de la etiqueta `live-example` en los documentos.
|
* `yarn generate-zips` - generate the zip files from the examples. Zip available via the `live-example` tags in the docs.
|
||||||
|
|
||||||
* `yarn example-e2e` - ejecutar todas las pruebas e2e para ejemplos. Opciones disponibles:
|
* `yarn example-e2e` - run all e2e tests for examples. Available options:
|
||||||
- `--setup`: generar boilerplate, forzar la actualización del controlador web y otras configuraciones, luego ejecutar las pruebas.
|
- `--setup`: generate boilerplate, force webdriver update & other setup, then run tests.
|
||||||
- `--local`: ejecutar pruebas e2e con la versión local de Angular contenida en la carpeta "dist".
|
- `--local`: run e2e tests with the local version of Angular contained in the "dist" folder.
|
||||||
_Requiere `--setup` para que surta efecto._
|
_Requires `--setup` in order to take effect._
|
||||||
- `--viewengine`: ejecutar pruebas e2e en modo `ViewEngine` (pre-Ivy).
|
- `--viewengine`: run e2e tests in `ViewEngine` (pre-Ivy) mode.
|
||||||
- `--filter=foo`: limitar pruebas e2e a las que contienen la palabra "foo".
|
- `--filter=foo`: limit e2e tests to those containing the word "foo".
|
||||||
|
|
||||||
> **Nota para usuarios Windows**
|
> **Note for Windows users**
|
||||||
>
|
>
|
||||||
> Configurar los ejemplos implica crear algunos [enlaces simbólicos](https://es.wikipedia.org/wiki/Enlace_simb%C3%B3lico) (ver [Aquí](./tools/examples/README.md#symlinked-node_modules) para más detalles). En Windows, esto requiere tener [Habilitado el Modo de desarrollador ](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10) (compatible con Windows 10 o más reciente) o ejecutar los comandos de configuración cómo administrador.
|
> Setting up the examples involves creating some [symbolic links](https://en.wikipedia.org/wiki/Symbolic_link) (see [here](./tools/examples/README.md#symlinked-node_modules) for details). On Windows, this requires to either have [Developer Mode enabled](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10) (supported on Windows 10 or newer) or run the setup commands as administrator.
|
||||||
>
|
>
|
||||||
> Los comandos afectados son:
|
> The affected commands are:
|
||||||
> - `yarn setup` / `yarn setup-*`
|
> - `yarn setup` / `yarn setup-*`
|
||||||
> - `yarn build` / `yarn build-*`
|
> - `yarn build` / `yarn build-*`
|
||||||
> - `yarn boilerplate:add`
|
> - `yarn boilerplate:add`
|
||||||
> - `yarn example-e2e --setup`
|
> - `yarn example-e2e --setup`
|
||||||
|
|
||||||
## Usando ServiceWorker localmente
|
## Using ServiceWorker locally
|
||||||
|
|
||||||
Ejecutando `yarn start` (incluso cuando se apunta explícitamente al modo de producción) no configura el
|
Running `yarn start` (even when explicitly targeting production mode) does not set up the
|
||||||
ServiceWorker. Si quieres probar el ServiceWorker localmente, puedes usar `yarn build` y luego
|
ServiceWorker. If you want to test the ServiceWorker locally, you can use `yarn build` and then
|
||||||
ejecutar los archivos en `dist/` con `yarn http-server dist -p 4200`.
|
serve the files in `dist/` with `yarn http-server dist -p 4200`.
|
||||||
|
|
||||||
|
|
||||||
## Guía de autoría
|
## Guide to authoring
|
||||||
Existen dos tipos de contenido en la documentación:
|
|
||||||
|
|
||||||
* **Documentación de API**: descripciones de los módulos, clases, interfaces, decoradores, etc que son parte de la plataforma Angular.
|
There are two types of content in the documentation:
|
||||||
La documentacion de API está generada directamente desde el código fuente.
|
|
||||||
El código fuente está contenido en archivos TypeScript , almacenados en la carpeta `angular/packages`.
|
|
||||||
Cada elemento de la API puede tener un comentario anterior, el cual contiene etiquetas y contenido de estilos JSDoc.
|
|
||||||
El contenido está escrito en markdown.
|
|
||||||
|
|
||||||
* **Otro contenido**: guias, tutoriales, y otro material de marketing.
|
* **API docs**: descriptions of the modules, classes, interfaces, decorators, etc that make up the Angular platform.
|
||||||
Todos los demás contenidos se escriben utilizando markdown en archivos de texto, ubicados en la carpeta `angular/aio/content`.
|
API docs are generated directly from the source code.
|
||||||
Más específicamente, hay subcarpetas que contienen tipos particulares de contenido: guías, tutoriales y marketing.
|
The source code is contained in TypeScript files, located in the `angular/packages` folder.
|
||||||
|
Each API item may have a preceding comment, which contains JSDoc style tags and content.
|
||||||
|
The content is written in markdown.
|
||||||
|
|
||||||
* **Ejempos de código**: los ejemplos de código deben ser comprobables para garantizar su precisión.
|
* **Other content**: guides, tutorials, and other marketing material.
|
||||||
Además, nuestros ejemplos tienen un aspecto específico y permiten al usuario copiar el código fuente. Para mayor
|
All other content is written using markdown in text files, located in the `angular/aio/content` folder.
|
||||||
ejemplos se representan en una interfaz con pestañas (e.g. template, HTML, y TypeScript en pestañas separadas). Adicionalmente, algunos son ejemplos en acción, que proporcionan enlaces donde se puede editar el código, ejecutar, y/o descargar. Para obtener más detalles sobre cómo trabajar con ejemplos de código, lea los [fragmentos de código](https://docs.angular.lat/guide/docs-style-guide#code-snippets), [código fuente de marcado ](https://docs.angular.lat/guide/docs-style-guide#source-code-markup), y [ ejemplos en acción ](https://docs.angular.lat/guide/docs-style-guide#live-examples) paginas de los [ autores de guías de estilo ](https://docs.angular.lat/guide/docs-style-guide).
|
More specifically, there are sub-folders that contain particular types of content: guides, tutorial and marketing.
|
||||||
|
|
||||||
Usamos la herramienta [dgeni](https://github.com/angular/dgeni) para convertir estos archivos en docs que se pueden ver en el doc-viewer.
|
* **Code examples**: code examples need to be testable to ensure their accuracy.
|
||||||
Las [guías de estilo para Autores](https://docs.angular.lat/guide/docs-style-guide) prescriben pautas para
|
Also, our examples have a specific look and feel and allow the user to copy the source code. For larger
|
||||||
escribir páginas de guía, explica cómo usar la documentación de clases y componentes, y cómo marcar el código fuente para producir fragmentos de código.
|
examples they are rendered in a tabbed interface (e.g. template, HTML, and TypeScript on separate
|
||||||
|
tabs). Additionally, some are live examples, which provide links where the code can be edited, executed, and/or downloaded. For details on working with code examples, please read the [Code snippets](https://angular.io/guide/docs-style-guide#code-snippets), [Source code markup](https://angular.io/guide/docs-style-guide#source-code-markup), and [Live examples](https://angular.io/guide/docs-style-guide#live-examples) pages of the [Authors Style Guide](https://angular.io/guide/docs-style-guide).
|
||||||
|
|
||||||
### Generando documentos completos
|
We use the [dgeni](https://github.com/angular/dgeni) tool to convert these files into docs that can be viewed in the doc-viewer.
|
||||||
|
|
||||||
La principal tarea para generar los documentos es `yarn docs`. Esto procesará todos los archivos fuente (API y otros), extrayendo la documentación y generando archivos JSON que pueden ser consumidos por el doc-viewer.
|
The [Authors Style Guide](https://angular.io/guide/docs-style-guide) prescribes guidelines for
|
||||||
|
writing guide pages, explains how to use the documentation classes and components, and how to markup sample source code to produce code snippets.
|
||||||
|
|
||||||
### Generación parcial de doc para editores
|
### Generating the complete docs
|
||||||
|
|
||||||
La generación completa de documentos puede llevar hasta un minuto. Eso es demasiado lento para la creación y edición eficiente de documentos.
|
The main task for generating the docs is `yarn docs`. This will process all the source files (API and other),
|
||||||
|
extracting the documentation and generating JSON files that can be consumed by the doc-viewer.
|
||||||
|
|
||||||
Puedes ealizar pequeños cambios en un editor inteligente que muestre un markdown con formato:
|
### Partial doc generation for editors
|
||||||
>En VS Code, _Cmd-K, V_ abre la vista previa de markdown en el panel lateral; _Cmd-B_ alterna la barra izquierda
|
|
||||||
|
|
||||||
Puedes también mirar los cambios que se muestran correctamente en el doc-viewer
|
Full doc generation can take up to one minute. That's too slow for efficient document creation and editing.
|
||||||
con un tiempo de ciclo rápido de edición / visualización.
|
|
||||||
|
|
||||||
Para este propósito, usa la tarea `yarn docs-watch`, que observa los cambios en los archivos de origen y solo vuelve a procesar los archivos necesarios para generar los documentos relacionados con el archivo que ha cambiado.
|
You can make small changes in a smart editor that displays formatted markdown:
|
||||||
Dado que esta tarea tiene accesos directos, es mucho más rápido (a menudo menos de 1 segundo) pero no producirá contenido de fidelidad completa. Por ejemplo, los enlaces a otros documentoss y ejemplos de código pueden no mostrarse correctamente. Esto se nota especialmente en los enlaces a otros documentos y en los ejemplos incrustados, que no siempre se representan correctamente.
|
>In VS Code, _Cmd-K, V_ opens markdown preview in side pane; _Cmd-B_ toggles left sidebar
|
||||||
|
|
||||||
La configuración general es la siguiente:
|
You also want to see those changes displayed properly in the doc viewer
|
||||||
|
with a quick, edit/view cycle time.
|
||||||
|
|
||||||
* Abrir una terminal, estar seguro que las dependencias están instaladas; ejecutar una generación inicial del doc; luego iniciar el doc-viewer:
|
For this purpose, use the `yarn docs-watch` task, which watches for changes to source files and only
|
||||||
|
re-processes the files necessary to generate the docs that are related to the file that has changed.
|
||||||
|
Since this task takes shortcuts, it is much faster (often less than 1 second) but it won't produce full
|
||||||
|
fidelity content. For example, links to other docs and code examples may not render correctly. This is
|
||||||
|
most particularly noticed in links to other docs and in the embedded examples, which may not always render
|
||||||
|
correctly.
|
||||||
|
|
||||||
|
The general setup is as follows:
|
||||||
|
|
||||||
|
* Open a terminal, ensure the dependencies are installed; run an initial doc generation; then start the doc-viewer:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn setup
|
yarn setup
|
||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
* Abrir una segunda terminal e iniciar el observador de documentos.
|
* Open a second terminal and start watching the docs
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn docs-watch
|
yarn docs-watch
|
||||||
```
|
```
|
||||||
|
|
||||||
>Alternativamente, prueba el comando fusionado `serve-and-sync` que crea, observa y ejecuta en la misma ventana de la terminal
|
>Alternatively, try the consolidated `serve-and-sync` command that builds, watches and serves in the same terminal window
|
||||||
```bash
|
```bash
|
||||||
yarn serve-and-sync
|
yarn serve-and-sync
|
||||||
```
|
```
|
||||||
|
|
||||||
* Abre un navegador con la siguiente dirección https://localhost:4200/ y navega hasta el documento en el que quieras trabajar.
|
* Open a browser at https://localhost:4200/ and navigate to the document on which you want to work.
|
||||||
Puedes automáticamente abrir el navegador utilizando `yarn start -o` en la primera terminal.
|
You can automatically open the browser by using `yarn start -o` in the first terminal.
|
||||||
|
|
||||||
* Realiza cambios en la página de documentación asociada o en los archivos de ejemplo. Cada vez que un archivo es guardado, la documentación se regenerará, la aplicación se reconstruirá y la página se volverá a cargar.
|
* Make changes to the page's associated doc or example files. Every time a file is saved, the doc will
|
||||||
|
be regenerated, the app will rebuild and the page will reload.
|
||||||
|
|
||||||
*Si recibes un error de compilación acerca de los ejemplos o cualquier otro error, asegúrate de consultar las
|
* If you get a build error complaining about examples or any other odd behavior, be sure to consult
|
||||||
[guías de estilo para Autores](https://angular.io/guide/docs-style-guide) para más información.
|
the [Authors Style Guide](https://angular.io/guide/docs-style-guide).
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/styles/main.scss"
|
"src/styles.scss"
|
||||||
],
|
],
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"budgets": [
|
"budgets": [
|
||||||
@ -158,7 +158,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/styles/main.scss"
|
"src/styles.scss"
|
||||||
],
|
],
|
||||||
"scripts": []
|
"scripts": []
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# CLI Overview and Command Reference
|
# CLI Overview and Command Reference
|
||||||
|
|
||||||
The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications directly from a command shell.
|
The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications. You can use the tool directly in a command shell, or indirectly through an interactive UI such as [Angular Console](https://angularconsole.com).
|
||||||
|
|
||||||
## Installing Angular CLI
|
## Installing Angular CLI
|
||||||
|
|
||||||
@ -109,3 +109,9 @@ Options that specify files can be given as absolute paths, or as paths relative
|
|||||||
The [ng generate](cli/generate) and [ng add](cli/add) commands take as an argument the artifact or library to be generated or added to the current project.
|
The [ng generate](cli/generate) and [ng add](cli/add) commands take as an argument the artifact or library to be generated or added to the current project.
|
||||||
In addition to any general options, each artifact or library defines its own options in a *schematic*.
|
In addition to any general options, each artifact or library defines its own options in a *schematic*.
|
||||||
Schematic options are supplied to the command in the same format as immediate command options.
|
Schematic options are supplied to the command in the same format as immediate command options.
|
||||||
|
|
||||||
|
|
||||||
|
### Building with Bazel
|
||||||
|
|
||||||
|
Optionally, you can configure the Angular CLI to use [Bazel](https://docs.bazel.build) as the build tool. For more information, see [Building with Bazel](guide/bazel).
|
||||||
|
|
||||||
|
1
aio/content/examples/.gitignore
vendored
1
aio/content/examples/.gitignore
vendored
@ -18,7 +18,6 @@
|
|||||||
**/src/karma.conf.js
|
**/src/karma.conf.js
|
||||||
**/.angular-cli.json
|
**/.angular-cli.json
|
||||||
**/.editorconfig
|
**/.editorconfig
|
||||||
**/.gitignore
|
|
||||||
**/angular.json
|
**/angular.json
|
||||||
**/tsconfig.json
|
**/tsconfig.json
|
||||||
**/bs-config.e2e.json
|
**/bs-config.e2e.json
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Accessibility example e2e tests', () => {
|
describe('Accessibility example e2e tests', () => {
|
||||||
@ -6,11 +8,11 @@ describe('Accessibility example e2e tests', () => {
|
|||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display Accessibility Example', () => {
|
it('should display Accessibility Example', function () {
|
||||||
expect(element(by.css('h1')).getText()).toEqual('Accessibility Example');
|
expect(element(by.css('h1')).getText()).toEqual('Accessibility Example');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should take a number and change progressbar width', () => {
|
it('should take a number and change progressbar width', function () {
|
||||||
element(by.css('input')).sendKeys('16');
|
element(by.css('input')).sendKeys('16');
|
||||||
expect(element(by.css('input')).getAttribute('value')).toEqual('016');
|
expect(element(by.css('input')).getAttribute('value')).toEqual('016');
|
||||||
expect(element(by.css('app-example-progressbar div')).getCssValue('width')).toBe('48px');
|
expect(element(by.css('app-example-progressbar div')).getCssValue('width')).toBe('48px');
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// tslint:disable: no-host-metadata-property
|
|
||||||
// #docregion progressbar-component
|
// #docregion progressbar-component
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('AngularJS to Angular Quick Reference Tests', () => {
|
describe('AngularJS to Angular Quick Reference Tests', function () {
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display no poster images after bootstrap', () => {
|
it('should display no poster images after bootstrap', function () {
|
||||||
testImagesAreDisplayed(false);
|
testImagesAreDisplayed(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display proper movie data', () => {
|
it('should display proper movie data', function () {
|
||||||
// We check only a few samples
|
// We check only a few samples
|
||||||
const expectedSamples: any[] = [
|
let expectedSamples: any[] = [
|
||||||
{row: 0, column: 0, element: 'img', attr: 'src', value: 'images/hero.png', contains: true},
|
{row: 0, column: 0, element: 'img', attr: 'src', value: 'images/hero.png', contains: true},
|
||||||
{row: 0, column: 2, value: 'Celeritas'},
|
{row: 0, column: 2, value: 'Celeritas'},
|
||||||
{row: 1, column: 3, matches: /Dec 1[678], 2015/}, // absorb timezone dif; we care about date format
|
{row: 1, column: 3, matches: /Dec 1[678], 2015/}, // absorb timezone dif; we care about date format
|
||||||
@ -23,17 +25,18 @@ describe('AngularJS to Angular Quick Reference Tests', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Go through the samples
|
// Go through the samples
|
||||||
const movieRows = getMovieRows();
|
let movieRows = getMovieRows();
|
||||||
for (const sample of expectedSamples) {
|
for (let i = 0; i < expectedSamples.length; i++) {
|
||||||
const tableCell = movieRows.get(sample.row)
|
let sample = expectedSamples[i];
|
||||||
|
let tableCell = movieRows.get(sample.row)
|
||||||
.all(by.tagName('td')).get(sample.column);
|
.all(by.tagName('td')).get(sample.column);
|
||||||
// Check the cell or its nested element
|
// Check the cell or its nested element
|
||||||
const elementToCheck = sample.element
|
let elementToCheck = sample.element
|
||||||
? tableCell.element(by.tagName(sample.element))
|
? tableCell.element(by.tagName(sample.element))
|
||||||
: tableCell;
|
: tableCell;
|
||||||
|
|
||||||
// Check element attribute or text
|
// Check element attribute or text
|
||||||
const valueToCheck = sample.attr
|
let valueToCheck = sample.attr
|
||||||
? elementToCheck.getAttribute(sample.attr)
|
? elementToCheck.getAttribute(sample.attr)
|
||||||
: elementToCheck.getText();
|
: elementToCheck.getText();
|
||||||
|
|
||||||
@ -48,42 +51,42 @@ describe('AngularJS to Angular Quick Reference Tests', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display images after Show Poster', () => {
|
it('should display images after Show Poster', function () {
|
||||||
testPosterButtonClick('Show Poster', true);
|
testPosterButtonClick('Show Poster', true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should hide images after Hide Poster', () => {
|
it('should hide images after Hide Poster', function () {
|
||||||
testPosterButtonClick('Hide Poster', false);
|
testPosterButtonClick('Hide Poster', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display no movie when no favorite hero is specified', () => {
|
it('should display no movie when no favorite hero is specified', function () {
|
||||||
testFavoriteHero(null, 'Please enter your favorite hero.');
|
testFavoriteHero(null, 'Please enter your favorite hero.');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display no movie for Magneta', () => {
|
it('should display no movie for Magneta', function () {
|
||||||
testFavoriteHero('Magneta', 'No movie, sorry!');
|
testFavoriteHero('Magneta', 'No movie, sorry!');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display a movie for Dr Nice', () => {
|
it('should display a movie for Dr Nice', function () {
|
||||||
testFavoriteHero('Dr Nice', 'Excellent choice!');
|
testFavoriteHero('Dr Nice', 'Excellent choice!');
|
||||||
});
|
});
|
||||||
|
|
||||||
function testImagesAreDisplayed(isDisplayed: boolean) {
|
function testImagesAreDisplayed(isDisplayed: boolean) {
|
||||||
const expectedMovieCount = 3;
|
let expectedMovieCount = 3;
|
||||||
|
|
||||||
const movieRows = getMovieRows();
|
let movieRows = getMovieRows();
|
||||||
expect(movieRows.count()).toBe(expectedMovieCount);
|
expect(movieRows.count()).toBe(expectedMovieCount);
|
||||||
for (let i = 0; i < expectedMovieCount; i++) {
|
for (let i = 0; i < expectedMovieCount; i++) {
|
||||||
const movieImage = movieRows.get(i).element(by.css('td > img'));
|
let movieImage = movieRows.get(i).element(by.css('td > img'));
|
||||||
expect(movieImage.isDisplayed()).toBe(isDisplayed);
|
expect(movieImage.isDisplayed()).toBe(isDisplayed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function testPosterButtonClick(expectedButtonText: string, isDisplayed: boolean) {
|
function testPosterButtonClick(expectedButtonText: string, isDisplayed: boolean) {
|
||||||
const posterButton = element(by.css('app-movie-list tr > th > button'));
|
let posterButton = element(by.css('app-movie-list tr > th > button'));
|
||||||
expect(posterButton.getText()).toBe(expectedButtonText);
|
expect(posterButton.getText()).toBe(expectedButtonText);
|
||||||
|
|
||||||
posterButton.click().then(() => {
|
posterButton.click().then(function () {
|
||||||
testImagesAreDisplayed(isDisplayed);
|
testImagesAreDisplayed(isDisplayed);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -93,12 +96,12 @@ describe('AngularJS to Angular Quick Reference Tests', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testFavoriteHero(heroName: string, expectedLabel: string) {
|
function testFavoriteHero(heroName: string, expectedLabel: string) {
|
||||||
const movieListComp = element(by.tagName('app-movie-list'));
|
let movieListComp = element(by.tagName('app-movie-list'));
|
||||||
const heroInput = movieListComp.element(by.tagName('input'));
|
let heroInput = movieListComp.element(by.tagName('input'));
|
||||||
const favoriteHeroLabel = movieListComp.element(by.tagName('h3'));
|
let favoriteHeroLabel = movieListComp.element(by.tagName('h3'));
|
||||||
const resultLabel = movieListComp.element(by.css('span > p'));
|
let resultLabel = movieListComp.element(by.css('span > p'));
|
||||||
|
|
||||||
heroInput.clear().then(() => {
|
heroInput.clear().then(function () {
|
||||||
heroInput.sendKeys(heroName || '');
|
heroInput.sendKeys(heroName || '');
|
||||||
expect(resultLabel.getText()).toBe(expectedLabel);
|
expect(resultLabel.getText()).toBe(expectedLabel);
|
||||||
if (heroName) {
|
if (heroName) {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, ExpectedConditions as EC } from 'protractor';
|
import { browser, ExpectedConditions as EC } from 'protractor';
|
||||||
import { logging } from 'selenium-webdriver';
|
import { logging } from 'selenium-webdriver';
|
||||||
import * as openClose from './open-close.po';
|
import * as openClose from './open-close.po';
|
||||||
|
@ -32,15 +32,15 @@ export const slideInAnimation =
|
|||||||
// #enddocregion style-view
|
// #enddocregion style-view
|
||||||
// #docregion query
|
// #docregion query
|
||||||
query(':enter', [
|
query(':enter', [
|
||||||
style({ left: '-100%' })
|
style({ left: '-100%'})
|
||||||
]),
|
]),
|
||||||
query(':leave', animateChild()),
|
query(':leave', animateChild()),
|
||||||
group([
|
group([
|
||||||
query(':leave', [
|
query(':leave', [
|
||||||
animate('300ms ease-out', style({ left: '100%' }))
|
animate('300ms ease-out', style({ left: '100%'}))
|
||||||
]),
|
]),
|
||||||
query(':enter', [
|
query(':enter', [
|
||||||
animate('300ms ease-out', style({ left: '0%' }))
|
animate('300ms ease-out', style({ left: '0%'}))
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
query(':enter', animateChild()),
|
query(':enter', animateChild()),
|
||||||
@ -56,15 +56,15 @@ export const slideInAnimation =
|
|||||||
})
|
})
|
||||||
]),
|
]),
|
||||||
query(':enter', [
|
query(':enter', [
|
||||||
style({ left: '-100%' })
|
style({ left: '-100%'})
|
||||||
]),
|
]),
|
||||||
query(':leave', animateChild()),
|
query(':leave', animateChild()),
|
||||||
group([
|
group([
|
||||||
query(':leave', [
|
query(':leave', [
|
||||||
animate('200ms ease-out', style({ left: '100%' }))
|
animate('200ms ease-out', style({ left: '100%'}))
|
||||||
]),
|
]),
|
||||||
query(':enter', [
|
query(':enter', [
|
||||||
animate('300ms ease-out', style({ left: '0%' }))
|
animate('300ms ease-out', style({ left: '0%'}))
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
query(':enter', animateChild()),
|
query(':enter', animateChild()),
|
||||||
|
@ -17,7 +17,7 @@ Toggle All Animations <input type="checkbox" [checked]="!animationsDisabled" (cl
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- #docregion route-animations-outlet -->
|
<!-- #docregion route-animations-outlet -->
|
||||||
<div [@routeAnimations]="prepareRoute(outlet)">
|
<div [@routeAnimations]="prepareRoute(outlet)" >
|
||||||
<router-outlet #outlet="outlet"></router-outlet>
|
<router-outlet #outlet="outlet"></router-outlet>
|
||||||
</div>
|
</div>
|
||||||
<!-- #enddocregion route-animations-outlet -->
|
<!-- #enddocregion route-animations-outlet -->
|
||||||
|
@ -34,7 +34,7 @@ export class AppComponent {
|
|||||||
|
|
||||||
// #docregion prepare-router-outlet
|
// #docregion prepare-router-outlet
|
||||||
prepareRoute(outlet: RouterOutlet) {
|
prepareRoute(outlet: RouterOutlet) {
|
||||||
return outlet && outlet.activatedRouteData && outlet.activatedRouteData.animation;
|
return outlet && outlet.activatedRouteData && outlet.activatedRouteData['animation'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// #enddocregion prepare-router-outlet
|
// #enddocregion prepare-router-outlet
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
// tslint:disable: variable-name
|
|
||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion
|
|
||||||
import { Component, HostBinding, OnInit } from '@angular/core';
|
import { Component, HostBinding, OnInit } from '@angular/core';
|
||||||
import { trigger, transition, animate, style, query, stagger } from '@angular/animations';
|
import { trigger, transition, animate, style, query, stagger } from '@angular/animations';
|
||||||
import { HEROES } from './mock-heroes';
|
import { HEROES } from './mock-heroes';
|
||||||
@ -54,11 +52,13 @@ export class HeroListPageComponent implements OnInit {
|
|||||||
@HostBinding('@pageAnimations')
|
@HostBinding('@pageAnimations')
|
||||||
public animatePage = true;
|
public animatePage = true;
|
||||||
|
|
||||||
|
_heroes = [];
|
||||||
// #docregion filter-animations
|
// #docregion filter-animations
|
||||||
heroTotal = -1;
|
heroTotal = -1;
|
||||||
// #enddocregion filter-animations
|
// #enddocregion filter-animations
|
||||||
get heroes() { return this._heroes; }
|
get heroes() {
|
||||||
private _heroes = [];
|
return this._heroes;
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this._heroes = HEROES;
|
this._heroes = HEROES;
|
||||||
|
@ -8,7 +8,8 @@ import { trigger, transition, state, animate, style, AnimationEvent } from '@ang
|
|||||||
// #docregion trigger, trigger-wildcard1, trigger-transition
|
// #docregion trigger, trigger-wildcard1, trigger-transition
|
||||||
animations: [
|
animations: [
|
||||||
trigger('openClose', [
|
trigger('openClose', [
|
||||||
// #docregion state1
|
// #enddocregion events1
|
||||||
|
// #docregion state1, events1
|
||||||
// ...
|
// ...
|
||||||
// #enddocregion events1
|
// #enddocregion events1
|
||||||
state('open', style({
|
state('open', style({
|
||||||
@ -33,7 +34,8 @@ import { trigger, transition, state, animate, style, AnimationEvent } from '@ang
|
|||||||
transition('closed => open', [
|
transition('closed => open', [
|
||||||
animate('0.5s')
|
animate('0.5s')
|
||||||
]),
|
]),
|
||||||
// #enddocregion transition2, trigger, component
|
// #enddocregion trigger, component
|
||||||
|
// #enddocregion transition2
|
||||||
// #docregion trigger-wildcard1
|
// #docregion trigger-wildcard1
|
||||||
transition('* => closed', [
|
transition('* => closed', [
|
||||||
animate('1s')
|
animate('1s')
|
||||||
@ -68,9 +70,7 @@ import { trigger, transition, state, animate, style, AnimationEvent } from '@ang
|
|||||||
})
|
})
|
||||||
// #docregion events
|
// #docregion events
|
||||||
export class OpenCloseComponent {
|
export class OpenCloseComponent {
|
||||||
// #enddocregion events1, events, component
|
// #enddocregion events1, events
|
||||||
@Input() logging = false;
|
|
||||||
// #docregion component
|
|
||||||
isOpen = true;
|
isOpen = true;
|
||||||
|
|
||||||
toggle() {
|
toggle() {
|
||||||
@ -78,8 +78,9 @@ export class OpenCloseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// #enddocregion component
|
// #enddocregion component
|
||||||
|
@Input() logging = false;
|
||||||
// #docregion events1, events
|
// #docregion events1, events
|
||||||
onAnimationEvent( event: AnimationEvent ) {
|
onAnimationEvent ( event: AnimationEvent ) {
|
||||||
// #enddocregion events1, events
|
// #enddocregion events1, events
|
||||||
if (!this.logging) {
|
if (!this.logging) {
|
||||||
return;
|
return;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { protractor, browser, element, by, ElementFinder } from 'protractor';
|
import { protractor, browser, element, by, ElementFinder } from 'protractor';
|
||||||
|
|
||||||
const nameSuffix = 'X';
|
const nameSuffix = 'X';
|
||||||
@ -19,7 +21,7 @@ describe('Architecture', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it(`has h2 '${expectedH2}'`, () => {
|
it(`has h2 '${expectedH2}'`, () => {
|
||||||
const h2 = element.all(by.css('h2')).map((elt: any) => elt.getText());
|
let h2 = element.all(by.css('h2')).map((elt: any) => elt.getText());
|
||||||
expect(h2).toEqual(expectedH2);
|
expect(h2).toEqual(expectedH2);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -32,42 +34,42 @@ function heroTests() {
|
|||||||
const targetHero: Hero = { id: 2, name: 'Dr Nice' };
|
const targetHero: Hero = { id: 2, name: 'Dr Nice' };
|
||||||
|
|
||||||
it('has the right number of heroes', () => {
|
it('has the right number of heroes', () => {
|
||||||
const page = getPageElts();
|
let page = getPageElts();
|
||||||
expect(page.heroes.count()).toEqual(3);
|
expect(page.heroes.count()).toEqual(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has no hero details initially', () => {
|
it('has no hero details initially', function () {
|
||||||
const page = getPageElts();
|
let page = getPageElts();
|
||||||
expect(page.heroDetail.isPresent()).toBeFalsy('no hero detail');
|
expect(page.heroDetail.isPresent()).toBeFalsy('no hero detail');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows selected hero details', async () => {
|
it('shows selected hero details', async () => {
|
||||||
await element(by.cssContainingText('li', targetHero.name)).click();
|
await element(by.cssContainingText('li', targetHero.name)).click();
|
||||||
const page = getPageElts();
|
let page = getPageElts();
|
||||||
const hero = await heroFromDetail(page.heroDetail);
|
let hero = await heroFromDetail(page.heroDetail);
|
||||||
expect(hero.id).toEqual(targetHero.id);
|
expect(hero.id).toEqual(targetHero.id);
|
||||||
expect(hero.name).toEqual(targetHero.name);
|
expect(hero.name).toEqual(targetHero.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`shows updated hero name in details`, async () => {
|
it(`shows updated hero name in details`, async () => {
|
||||||
const input = element.all(by.css('input')).first();
|
let input = element.all(by.css('input')).first();
|
||||||
input.sendKeys(nameSuffix);
|
input.sendKeys(nameSuffix);
|
||||||
const page = getPageElts();
|
let page = getPageElts();
|
||||||
const hero = await heroFromDetail(page.heroDetail);
|
let hero = await heroFromDetail(page.heroDetail);
|
||||||
const newName = targetHero.name + nameSuffix;
|
let newName = targetHero.name + nameSuffix;
|
||||||
expect(hero.id).toEqual(targetHero.id);
|
expect(hero.id).toEqual(targetHero.id);
|
||||||
expect(hero.name).toEqual(newName);
|
expect(hero.name).toEqual(newName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function salesTaxTests() {
|
function salesTaxTests() {
|
||||||
it('has no sales tax initially', () => {
|
it('has no sales tax initially', function () {
|
||||||
const page = getPageElts();
|
let page = getPageElts();
|
||||||
expect(page.salesTaxDetail.isPresent()).toBeFalsy('no sales tax info');
|
expect(page.salesTaxDetail.isPresent()).toBeFalsy('no sales tax info');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows sales tax', async () => {
|
it('shows sales tax', async function () {
|
||||||
const page = getPageElts();
|
let page = getPageElts();
|
||||||
page.salesTaxAmountInput.sendKeys('10', protractor.Key.ENTER);
|
page.salesTaxAmountInput.sendKeys('10', protractor.Key.ENTER);
|
||||||
expect(page.salesTaxDetail.getText()).toEqual('The sales tax is $1.00');
|
expect(page.salesTaxDetail.getText()).toEqual('The sales tax is $1.00');
|
||||||
});
|
});
|
||||||
@ -86,11 +88,13 @@ function getPageElts() {
|
|||||||
|
|
||||||
async function heroFromDetail(detail: ElementFinder): Promise<Hero> {
|
async function heroFromDetail(detail: ElementFinder): Promise<Hero> {
|
||||||
// Get hero id from the first <div>
|
// Get hero id from the first <div>
|
||||||
const id = await detail.all(by.css('div')).first().getText();
|
// let _id = await detail.all(by.css('div')).first().getText();
|
||||||
|
let _id = await detail.all(by.css('div')).first().getText();
|
||||||
// Get name from the h2
|
// Get name from the h2
|
||||||
const name = await detail.element(by.css('h4')).getText();
|
// let _name = await detail.element(by.css('h4')).getText();
|
||||||
|
let _name = await detail.element(by.css('h4')).getText();
|
||||||
return {
|
return {
|
||||||
id: +id.substr(id.indexOf(' ') + 1),
|
id: +_id.substr(_id.indexOf(' ') + 1),
|
||||||
name: name.substr(0, name.lastIndexOf(' ')),
|
name: _name.substr(0, _name.lastIndexOf(' '))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ export class BackendService {
|
|||||||
// TODO: get from the database
|
// TODO: get from the database
|
||||||
return Promise.resolve<Hero[]>(HEROES);
|
return Promise.resolve<Hero[]>(HEROES);
|
||||||
}
|
}
|
||||||
const err = new Error('Cannot get object of this type');
|
let err = new Error('Cannot get object of this type');
|
||||||
this.logger.error(err);
|
this.logger.error(err);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ export class SalesTaxService {
|
|||||||
constructor(private rateService: TaxRateService) { }
|
constructor(private rateService: TaxRateService) { }
|
||||||
|
|
||||||
getVAT(value: string | number) {
|
getVAT(value: string | number) {
|
||||||
const amount = (typeof value === 'string') ?
|
let amount = (typeof value === 'string') ?
|
||||||
parseFloat(value) : value;
|
parseFloat(value) : value;
|
||||||
return (amount || 0) * this.rateService.getRate('VAT');
|
return (amount || 0) * this.rateService.getRate('VAT');
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,34 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Attribute binding example', () => {
|
describe('Attribute binding example', function () {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display Property Binding with Angular', () => {
|
it('should display Property Binding with Angular', function () {
|
||||||
expect(element(by.css('h1')).getText()).toEqual('Attribute, class, and style bindings');
|
expect(element(by.css('h1')).getText()).toEqual('Attribute, class, and style bindings');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display a table', () => {
|
it('should display a table', function() {
|
||||||
expect(element.all(by.css('table')).isPresent()).toBe(true);
|
expect(element.all(by.css('table')).isPresent()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display an Aria button', () => {
|
it('should display an Aria button', function () {
|
||||||
expect(element.all(by.css('button')).get(0).getText()).toBe('Go for it with Aria');
|
expect(element.all(by.css('button')).get(0).getText()).toBe('Go for it with Aria');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display a blue background on div', () => {
|
it('should display a blue background on div', function () {
|
||||||
expect(element.all(by.css('div')).get(1).getCssValue('background-color')).toEqual('rgba(25, 118, 210, 1)');
|
expect(element.all(by.css('div')).get(1).getCssValue('background-color')).toEqual('rgba(25, 118, 210, 1)');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display a blue div with a red border', () => {
|
it('should display a blue div with a red border', function () {
|
||||||
expect(element.all(by.css('div')).get(1).getCssValue('border')).toEqual('2px solid rgb(212, 30, 46)');
|
expect(element.all(by.css('div')).get(1).getCssValue('border')).toEqual('2px solid rgb(212, 30, 46)');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display a div with many classes', () => {
|
it('should display a div with many classes', function () {
|
||||||
expect(element.all(by.css('div')).get(1).getAttribute('class')).toContain('special');
|
expect(element.all(by.css('div')).get(1).getAttribute('class')).toContain('special');
|
||||||
expect(element.all(by.css('div')).get(1).getAttribute('class')).toContain('clearance');
|
expect(element.all(by.css('div')).get(1).getAttribute('class')).toContain('clearance');
|
||||||
});
|
});
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { Component, HostBinding } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'comp-with-host-binding',
|
selector: 'comp-with-host-binding',
|
||||||
template: 'I am a component!',
|
template: 'I am a component!',
|
||||||
|
host: {
|
||||||
|
'[class.special]': 'isSpecial',
|
||||||
|
'[style.color]': 'color',
|
||||||
|
'[style.width]': 'width'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
export class CompWithHostBindingComponent {
|
export class CompWithHostBindingComponent {
|
||||||
@HostBinding('class.special')
|
|
||||||
isSpecial = false;
|
isSpecial = false;
|
||||||
|
|
||||||
@HostBinding('style.color')
|
|
||||||
color = 'green';
|
color = 'green';
|
||||||
|
|
||||||
@HostBinding('style.width')
|
|
||||||
width = '200px';
|
width = '200px';
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Attribute directives', () => {
|
describe('Attribute directives', () => {
|
||||||
|
|
||||||
const title = 'My First Attribute Directive';
|
let _title = 'My First Attribute Directive';
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should display correct title: ${title}`, () => {
|
it(`should display correct title: ${_title}`, () => {
|
||||||
expect(element(by.css('h1')).getText()).toEqual(title);
|
expect(element(by.css('h1')).getText()).toEqual(_title);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to select green highlight', () => {
|
it('should be able to select green highlight', () => {
|
||||||
|
@ -3,55 +3,57 @@ import { logging } from 'selenium-webdriver';
|
|||||||
|
|
||||||
describe('Binding syntax e2e tests', () => {
|
describe('Binding syntax e2e tests', () => {
|
||||||
|
|
||||||
beforeEach(() => browser.get(''));
|
beforeEach(function () {
|
||||||
|
browser.get('');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// helper function used to test what's logged to the console
|
// helper function used to test what's logged to the console
|
||||||
async function logChecker(button, contents) {
|
async function logChecker(button, contents) {
|
||||||
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
||||||
const messages = logs.filter(({ message }) => message.indexOf(contents) !== -1 ? true : false);
|
const message = logs.filter(({ message }) => message.indexOf(contents) !== -1 ? true : false);
|
||||||
expect(messages.length).toBeGreaterThan(0);
|
expect(message.length).toBeGreaterThan(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
it('should display Binding syntax', () => {
|
it('should display Binding syntax', function () {
|
||||||
expect(element(by.css('h1')).getText()).toEqual('Binding syntax');
|
expect(element(by.css('h1')).getText()).toEqual('Binding syntax');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display Save button', () => {
|
it('should display Save button', function () {
|
||||||
expect(element.all(by.css('button')).get(0).getText()).toBe('Save');
|
expect(element.all(by.css('button')).get(0).getText()).toBe('Save');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display HTML attributes and DOM properties', () => {
|
it('should display HTML attributes and DOM properties', function () {
|
||||||
expect(element.all(by.css('h2')).get(1).getText()).toBe('HTML attributes and DOM properties');
|
expect(element.all(by.css('h2')).get(1).getText()).toBe('HTML attributes and DOM properties');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display 1. Use the inspector...', () => {
|
it('should display 1. Use the inspector...', function () {
|
||||||
expect(element.all(by.css('p')).get(0).getText()).toContain('1. Use the inspector');
|
expect(element.all(by.css('p')).get(0).getText()).toContain('1. Use the inspector');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display Disabled property vs. attribute', () => {
|
it('should display Disabled property vs. attribute', function () {
|
||||||
expect(element.all(by.css('h3')).get(0).getText()).toBe('Disabled property vs. attribute');
|
expect(element.all(by.css('h3')).get(0).getText()).toBe('Disabled property vs. attribute');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should log a message including Sarah', async () => {
|
it('should log a message including Sarah', async () => {
|
||||||
const attributeButton = element.all(by.css('button')).get(1);
|
let attributeButton = element.all(by.css('button')).get(1);
|
||||||
await attributeButton.click();
|
await attributeButton.click();
|
||||||
const contents = 'Sarah';
|
const contents = 'Sarah';
|
||||||
logChecker(attributeButton, contents);
|
logChecker(attributeButton, contents);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should log a message including Sarah for DOM property', async () => {
|
it('should log a message including Sarah for DOM property', async () => {
|
||||||
const DOMPropertyButton = element.all(by.css('button')).get(2);
|
let DOMPropertyButton = element.all(by.css('button')).get(2);
|
||||||
await DOMPropertyButton.click();
|
await DOMPropertyButton.click();
|
||||||
const contents = 'Sarah';
|
const contents = 'Sarah';
|
||||||
logChecker(DOMPropertyButton, contents);
|
logChecker(DOMPropertyButton, contents);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should log a message including Sally for DOM property', async () => {
|
it('should log a message including Sally for DOM property', async () => {
|
||||||
const DOMPropertyButton = element.all(by.css('button')).get(2);
|
let DOMPropertyButton = element.all(by.css('button')).get(2);
|
||||||
const input = element(by.css('input'));
|
let input = element(by.css('input'));
|
||||||
input.sendKeys('Sally');
|
input.sendKeys('Sally');
|
||||||
await DOMPropertyButton.click();
|
await DOMPropertyButton.click();
|
||||||
const contents = 'Sally';
|
const contents = 'Sally';
|
||||||
@ -59,14 +61,14 @@ describe('Binding syntax e2e tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should log a message that Test Button works', async () => {
|
it('should log a message that Test Button works', async () => {
|
||||||
const testButton = element.all(by.css('button')).get(3);
|
let testButton = element.all(by.css('button')).get(3);
|
||||||
await testButton.click();
|
await testButton.click();
|
||||||
const contents = 'Test';
|
const contents = 'Test';
|
||||||
logChecker(testButton, contents);
|
logChecker(testButton, contents);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should toggle Test Button disabled', async () => {
|
it('should toggle Test Button disabled', async () => {
|
||||||
const toggleButton = element.all(by.css('button')).get(4);
|
let toggleButton = element.all(by.css('button')).get(4);
|
||||||
await toggleButton.click();
|
await toggleButton.click();
|
||||||
const contents = 'true';
|
const contents = 'true';
|
||||||
logChecker(toggleButton, contents);
|
logChecker(toggleButton, contents);
|
||||||
|
@ -26,7 +26,7 @@ export class AppComponent {
|
|||||||
|
|
||||||
toggleDisabled(): any {
|
toggleDisabled(): any {
|
||||||
|
|
||||||
const testButton = document.getElementById('testButton') as HTMLInputElement;
|
let testButton = <HTMLInputElement> document.getElementById('testButton');
|
||||||
testButton.disabled = !testButton.disabled;
|
testButton.disabled = !testButton.disabled;
|
||||||
console.warn(testButton.disabled);
|
console.warn(testButton.disabled);
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Built-in Directives', () => {
|
describe('Built-in Directives', function () {
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have title Built-in Directives', () => {
|
it('should have title Built-in Directives', function () {
|
||||||
const title = element.all(by.css('h1')).get(0);
|
let title = element.all(by.css('h1')).get(0);
|
||||||
expect(title.getText()).toEqual('Built-in Directives');
|
expect(title.getText()).toEqual('Built-in Directives');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should change first Teapot header', async () => {
|
it('should change first Teapot header', async () => {
|
||||||
const firstLabel = element.all(by.css('p')).get(0);
|
let firstLabel = element.all(by.css('p')).get(0);
|
||||||
const firstInput = element.all(by.css('input')).get(0);
|
let firstInput = element.all(by.css('input')).get(0);
|
||||||
|
|
||||||
expect(firstLabel.getText()).toEqual('Current item name: Teapot');
|
expect(firstLabel.getText()).toEqual('Current item name: Teapot');
|
||||||
firstInput.sendKeys('abc');
|
firstInput.sendKeys('abc');
|
||||||
@ -21,49 +23,49 @@ describe('Built-in Directives', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should modify sentence when modified checkbox checked', () => {
|
it('should modify sentence when modified checkbox checked', function () {
|
||||||
const modifiedChkbxLabel = element.all(by.css('input[type="checkbox"]')).get(1);
|
let modifiedChkbxLabel = element.all(by.css('input[type="checkbox"]')).get(1);
|
||||||
const modifiedSentence = element.all(by.css('div')).get(1);
|
let modifiedSentence = element.all(by.css('div')).get(1);
|
||||||
|
|
||||||
modifiedChkbxLabel.click();
|
modifiedChkbxLabel.click();
|
||||||
expect(modifiedSentence.getText()).toContain('modified');
|
expect(modifiedSentence.getText()).toContain('modified');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should modify sentence when normal checkbox checked', () => {
|
it('should modify sentence when normal checkbox checked', function () {
|
||||||
const normalChkbxLabel = element.all(by.css('input[type="checkbox"]')).get(4);
|
let normalChkbxLabel = element.all(by.css('input[type="checkbox"]')).get(4);
|
||||||
const normalSentence = element.all(by.css('div')).get(7);
|
let normalSentence = element.all(by.css('div')).get(7);
|
||||||
|
|
||||||
normalChkbxLabel.click();
|
normalChkbxLabel.click();
|
||||||
expect(normalSentence.getText()).toContain('normal weight and, extra large');
|
expect(normalSentence.getText()).toContain('normal weight and, extra large');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should toggle app-item-detail', () => {
|
it('should toggle app-item-detail', function () {
|
||||||
const toggleButton = element.all(by.css('button')).get(3);
|
let toggleButton = element.all(by.css('button')).get(3);
|
||||||
const toggledDiv = element.all(by.css('app-item-detail')).get(0);
|
let toggledDiv = element.all(by.css('app-item-detail')).get(0);
|
||||||
|
|
||||||
toggleButton.click();
|
toggleButton.click();
|
||||||
expect(toggledDiv.isDisplayed()).toBe(true);
|
expect(toggledDiv.isDisplayed()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should hide app-item-detail', () => {
|
it('should hide app-item-detail', function () {
|
||||||
const hiddenMessage = element.all(by.css('p')).get(11);
|
let hiddenMessage = element.all(by.css('p')).get(11);
|
||||||
const hiddenDiv = element.all(by.css('app-item-detail')).get(2);
|
let hiddenDiv = element.all(by.css('app-item-detail')).get(2);
|
||||||
|
|
||||||
expect(hiddenMessage.getText()).toContain('in the DOM');
|
expect(hiddenMessage.getText()).toContain('in the DOM');
|
||||||
expect(hiddenDiv.isDisplayed()).toBe(true);
|
expect(hiddenDiv.isDisplayed()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have 10 lists each containing the string Teapot', () => {
|
it('should have 10 lists each containing the string Teapot', function () {
|
||||||
const listDiv = element.all(by.cssContainingText('.box', 'Teapot'));
|
let listDiv = element.all(by.cssContainingText('.box', 'Teapot'));
|
||||||
expect(listDiv.count()).toBe(10);
|
expect(listDiv.count()).toBe(10);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should switch case', () => {
|
it('should switch case', function () {
|
||||||
const tvRadioButton = element.all(by.css('input[type="radio"]')).get(3);
|
let tvRadioButton = element.all(by.css('input[type="radio"]')).get(3);
|
||||||
const tvDiv = element(by.css('app-lost-item'));
|
let tvDiv = element(by.css('app-lost-item'));
|
||||||
|
|
||||||
const fishbowlRadioButton = element.all(by.css('input[type="radio"]')).get(4);
|
let fishbowlRadioButton = element.all(by.css('input[type="radio"]')).get(4);
|
||||||
const fishbowlDiv = element(by.css('app-unknown-item'));
|
let fishbowlDiv = element(by.css('app-unknown-item'));
|
||||||
|
|
||||||
tvRadioButton.click();
|
tvRadioButton.click();
|
||||||
expect(tvDiv.getText()).toContain('Television');
|
expect(tvDiv.getText()).toContain('Television');
|
||||||
|
@ -30,14 +30,6 @@ export class AppComponent implements OnInit {
|
|||||||
itemsWithTrackByCountReset = 0;
|
itemsWithTrackByCountReset = 0;
|
||||||
itemIdIncrement = 1;
|
itemIdIncrement = 1;
|
||||||
|
|
||||||
// #docregion setClasses
|
|
||||||
currentClasses: {};
|
|
||||||
// #enddocregion setClasses
|
|
||||||
|
|
||||||
// #docregion setStyles
|
|
||||||
currentStyles: {};
|
|
||||||
// #enddocregion setStyles
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.resetItems();
|
this.resetItems();
|
||||||
this.setCurrentClasses();
|
this.setCurrentClasses();
|
||||||
@ -49,18 +41,20 @@ export class AppComponent implements OnInit {
|
|||||||
this.currentItem.name = name.toUpperCase();
|
this.currentItem.name = name.toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
// #docregion setClasses
|
// #docregion setClasses
|
||||||
|
currentClasses: {};
|
||||||
setCurrentClasses() {
|
setCurrentClasses() {
|
||||||
// CSS classes: added/removed per current state of component properties
|
// CSS classes: added/removed per current state of component properties
|
||||||
this.currentClasses = {
|
this.currentClasses = {
|
||||||
saveable: this.canSave,
|
'saveable': this.canSave,
|
||||||
modified: !this.isUnchanged,
|
'modified': !this.isUnchanged,
|
||||||
special: this.isSpecial
|
'special': this.isSpecial
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// #enddocregion setClasses
|
// #enddocregion setClasses
|
||||||
|
|
||||||
// #docregion setStyles
|
// #docregion setStyles
|
||||||
|
currentStyles: {};
|
||||||
setCurrentStyles() {
|
setCurrentStyles() {
|
||||||
// CSS styles: set per current state of component properties
|
// CSS styles: set per current state of component properties
|
||||||
this.currentStyles = {
|
this.currentStyles = {
|
||||||
@ -76,7 +70,11 @@ export class AppComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
giveNullCustomerValue() {
|
giveNullCustomerValue() {
|
||||||
this.nullCustomer = 'Kelly';
|
!(this.nullCustomer = null) ? (this.nullCustomer = 'Kelly') : (this.nullCustomer = null);
|
||||||
|
}
|
||||||
|
|
||||||
|
resetNullItem() {
|
||||||
|
this.nullCustomer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetItems() {
|
resetItems() {
|
||||||
@ -86,7 +84,7 @@ export class AppComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resetList() {
|
resetList() {
|
||||||
this.resetItems();
|
this.resetItems()
|
||||||
this.itemsWithTrackByCountReset = 0;
|
this.itemsWithTrackByCountReset = 0;
|
||||||
this.itemsNoTrackByCount = ++this.itemsNoTrackByCount;
|
this.itemsNoTrackByCount = ++this.itemsNoTrackByCount;
|
||||||
}
|
}
|
||||||
@ -109,7 +107,7 @@ export class AppComponent implements OnInit {
|
|||||||
trackByItems(index: number, item: Item): number { return item.id; }
|
trackByItems(index: number, item: Item): number { return item.id; }
|
||||||
// #enddocregion trackByItems
|
// #enddocregion trackByItems
|
||||||
|
|
||||||
trackById(index: number, item: any): number { return item.id; }
|
trackById(index: number, item: any): number { return item['id']; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Built Template Functions Example', () => {
|
describe('Built Template Functions Example', function () {
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have title Built-in Template Functions', () => {
|
it('should have title Built-in Template Functions', function () {
|
||||||
const title = element.all(by.css('h1')).get(0);
|
let title = element.all(by.css('h1')).get(0);
|
||||||
expect(title.getText()).toEqual('Built-in Template Functions');
|
expect(title.getText()).toEqual('Built-in Template Functions');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display $any( ) in h2', () => {
|
it('should display $any( ) in h2', function () {
|
||||||
const header = element(by.css('h2'));
|
let header = element(by.css('h2'));
|
||||||
expect(header.getText()).toContain('$any( )');
|
expect(header.getText()).toContain('$any( )');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,85 +1,87 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Component Communication Cookbook Tests', () => {
|
describe('Component Communication Cookbook Tests', function () {
|
||||||
|
|
||||||
// Note: '?e2e' which app can read to know it is running in protractor
|
// Note: '?e2e' which app can read to know it is running in protractor
|
||||||
// e.g. `if (!/e2e/.test(location.search)) { ...`
|
// e.g. `if (!/e2e/.test(location.search)) { ...`
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('?e2e');
|
browser.get('?e2e');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Parent-to-child communication', () => {
|
describe('Parent-to-child communication', function() {
|
||||||
// #docregion parent-to-child
|
// #docregion parent-to-child
|
||||||
// ...
|
// ...
|
||||||
const heroNames = ['Dr IQ', 'Magneta', 'Bombasto'];
|
let _heroNames = ['Dr IQ', 'Magneta', 'Bombasto'];
|
||||||
const masterName = 'Master';
|
let _masterName = 'Master';
|
||||||
|
|
||||||
it('should pass properties to children properly', () => {
|
it('should pass properties to children properly', function () {
|
||||||
const parent = element.all(by.tagName('app-hero-parent')).get(0);
|
let parent = element.all(by.tagName('app-hero-parent')).get(0);
|
||||||
const heroes = parent.all(by.tagName('app-hero-child'));
|
let heroes = parent.all(by.tagName('app-hero-child'));
|
||||||
|
|
||||||
for (let i = 0; i < heroNames.length; i++) {
|
for (let i = 0; i < _heroNames.length; i++) {
|
||||||
const childTitle = heroes.get(i).element(by.tagName('h3')).getText();
|
let childTitle = heroes.get(i).element(by.tagName('h3')).getText();
|
||||||
const childDetail = heroes.get(i).element(by.tagName('p')).getText();
|
let childDetail = heroes.get(i).element(by.tagName('p')).getText();
|
||||||
expect(childTitle).toEqual(heroNames[i] + ' says:');
|
expect(childTitle).toEqual(_heroNames[i] + ' says:');
|
||||||
expect(childDetail).toContain(masterName);
|
expect(childDetail).toContain(_masterName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// ...
|
// ...
|
||||||
// #enddocregion parent-to-child
|
// #enddocregion parent-to-child
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Parent-to-child communication with setter', () => {
|
describe('Parent-to-child communication with setter', function() {
|
||||||
// #docregion parent-to-child-setter
|
// #docregion parent-to-child-setter
|
||||||
// ...
|
// ...
|
||||||
it('should display trimmed, non-empty names', () => {
|
it('should display trimmed, non-empty names', function () {
|
||||||
const nonEmptyNameIndex = 0;
|
let _nonEmptyNameIndex = 0;
|
||||||
const nonEmptyName = '"Dr IQ"';
|
let _nonEmptyName = '"Dr IQ"';
|
||||||
const parent = element.all(by.tagName('app-name-parent')).get(0);
|
let parent = element.all(by.tagName('app-name-parent')).get(0);
|
||||||
const hero = parent.all(by.tagName('app-name-child')).get(nonEmptyNameIndex);
|
let hero = parent.all(by.tagName('app-name-child')).get(_nonEmptyNameIndex);
|
||||||
|
|
||||||
const displayName = hero.element(by.tagName('h3')).getText();
|
let displayName = hero.element(by.tagName('h3')).getText();
|
||||||
expect(displayName).toEqual(nonEmptyName);
|
expect(displayName).toEqual(_nonEmptyName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should replace empty name with default name', () => {
|
it('should replace empty name with default name', function () {
|
||||||
const emptyNameIndex = 1;
|
let _emptyNameIndex = 1;
|
||||||
const defaultName = '"<no name set>"';
|
let _defaultName = '"<no name set>"';
|
||||||
const parent = element.all(by.tagName('app-name-parent')).get(0);
|
let parent = element.all(by.tagName('app-name-parent')).get(0);
|
||||||
const hero = parent.all(by.tagName('app-name-child')).get(emptyNameIndex);
|
let hero = parent.all(by.tagName('app-name-child')).get(_emptyNameIndex);
|
||||||
|
|
||||||
const displayName = hero.element(by.tagName('h3')).getText();
|
let displayName = hero.element(by.tagName('h3')).getText();
|
||||||
expect(displayName).toEqual(defaultName);
|
expect(displayName).toEqual(_defaultName);
|
||||||
});
|
});
|
||||||
// ...
|
// ...
|
||||||
// #enddocregion parent-to-child-setter
|
// #enddocregion parent-to-child-setter
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Parent-to-child communication with ngOnChanges', () => {
|
describe('Parent-to-child communication with ngOnChanges', function() {
|
||||||
// #docregion parent-to-child-onchanges
|
// #docregion parent-to-child-onchanges
|
||||||
// ...
|
// ...
|
||||||
// Test must all execute in this exact order
|
// Test must all execute in this exact order
|
||||||
it('should set expected initial values', () => {
|
it('should set expected initial values', function () {
|
||||||
const actual = getActual();
|
let actual = getActual();
|
||||||
|
|
||||||
const initialLabel = 'Version 1.23';
|
let initialLabel = 'Version 1.23';
|
||||||
const initialLog = 'Initial value of major set to 1, Initial value of minor set to 23';
|
let initialLog = 'Initial value of major set to 1, Initial value of minor set to 23';
|
||||||
|
|
||||||
expect(actual.label).toBe(initialLabel);
|
expect(actual.label).toBe(initialLabel);
|
||||||
expect(actual.count).toBe(1);
|
expect(actual.count).toBe(1);
|
||||||
expect(actual.logs.get(0).getText()).toBe(initialLog);
|
expect(actual.logs.get(0).getText()).toBe(initialLog);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set expected values after clicking \'Minor\' twice', () => {
|
it('should set expected values after clicking \'Minor\' twice', function () {
|
||||||
const repoTag = element(by.tagName('app-version-parent'));
|
let repoTag = element(by.tagName('app-version-parent'));
|
||||||
const newMinorButton = repoTag.all(by.tagName('button')).get(0);
|
let newMinorButton = repoTag.all(by.tagName('button')).get(0);
|
||||||
|
|
||||||
newMinorButton.click().then(() => {
|
newMinorButton.click().then(function() {
|
||||||
newMinorButton.click().then(() => {
|
newMinorButton.click().then(function() {
|
||||||
const actual = getActual();
|
let actual = getActual();
|
||||||
|
|
||||||
const labelAfter2Minor = 'Version 1.25';
|
let labelAfter2Minor = 'Version 1.25';
|
||||||
const logAfter2Minor = 'minor changed from 24 to 25';
|
let logAfter2Minor = 'minor changed from 24 to 25';
|
||||||
|
|
||||||
expect(actual.label).toBe(labelAfter2Minor);
|
expect(actual.label).toBe(labelAfter2Minor);
|
||||||
expect(actual.count).toBe(3);
|
expect(actual.count).toBe(3);
|
||||||
@ -88,15 +90,15 @@ describe('Component Communication Cookbook Tests', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set expected values after clicking \'Major\' once', () => {
|
it('should set expected values after clicking \'Major\' once', function () {
|
||||||
const repoTag = element(by.tagName('app-version-parent'));
|
let repoTag = element(by.tagName('app-version-parent'));
|
||||||
const newMajorButton = repoTag.all(by.tagName('button')).get(1);
|
let newMajorButton = repoTag.all(by.tagName('button')).get(1);
|
||||||
|
|
||||||
newMajorButton.click().then(() => {
|
newMajorButton.click().then(function() {
|
||||||
const actual = getActual();
|
let actual = getActual();
|
||||||
|
|
||||||
const labelAfterMajor = 'Version 2.0';
|
let labelAfterMajor = 'Version 2.0';
|
||||||
const logAfterMajor = 'major changed from 1 to 2, minor changed from 25 to 0';
|
let logAfterMajor = 'major changed from 1 to 2, minor changed from 25 to 0';
|
||||||
|
|
||||||
expect(actual.label).toBe(labelAfterMajor);
|
expect(actual.label).toBe(labelAfterMajor);
|
||||||
expect(actual.count).toBe(4);
|
expect(actual.count).toBe(4);
|
||||||
@ -105,14 +107,14 @@ describe('Component Communication Cookbook Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function getActual() {
|
function getActual() {
|
||||||
const versionTag = element(by.tagName('app-version-child'));
|
let versionTag = element(by.tagName('app-version-child'));
|
||||||
const label = versionTag.element(by.tagName('h3')).getText();
|
let label = versionTag.element(by.tagName('h3')).getText();
|
||||||
const ul = versionTag.element((by.tagName('ul')));
|
let ul = versionTag.element((by.tagName('ul')));
|
||||||
const logs = ul.all(by.tagName('li'));
|
let logs = ul.all(by.tagName('li'));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
label,
|
label: label,
|
||||||
logs,
|
logs: logs,
|
||||||
count: logs.count()
|
count: logs.count()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -121,30 +123,30 @@ describe('Component Communication Cookbook Tests', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Child-to-parent communication', () => {
|
describe('Child-to-parent communication', function() {
|
||||||
// #docregion child-to-parent
|
// #docregion child-to-parent
|
||||||
// ...
|
// ...
|
||||||
it('should not emit the event initially', () => {
|
it('should not emit the event initially', function () {
|
||||||
const voteLabel = element(by.tagName('app-vote-taker'))
|
let voteLabel = element(by.tagName('app-vote-taker'))
|
||||||
.element(by.tagName('h3')).getText();
|
.element(by.tagName('h3')).getText();
|
||||||
expect(voteLabel).toBe('Agree: 0, Disagree: 0');
|
expect(voteLabel).toBe('Agree: 0, Disagree: 0');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should process Agree vote', () => {
|
it('should process Agree vote', function () {
|
||||||
const agreeButton1 = element.all(by.tagName('app-voter')).get(0)
|
let agreeButton1 = element.all(by.tagName('app-voter')).get(0)
|
||||||
.all(by.tagName('button')).get(0);
|
.all(by.tagName('button')).get(0);
|
||||||
agreeButton1.click().then(() => {
|
agreeButton1.click().then(function() {
|
||||||
const voteLabel = element(by.tagName('app-vote-taker'))
|
let voteLabel = element(by.tagName('app-vote-taker'))
|
||||||
.element(by.tagName('h3')).getText();
|
.element(by.tagName('h3')).getText();
|
||||||
expect(voteLabel).toBe('Agree: 1, Disagree: 0');
|
expect(voteLabel).toBe('Agree: 1, Disagree: 0');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should process Disagree vote', () => {
|
it('should process Disagree vote', function () {
|
||||||
const agreeButton1 = element.all(by.tagName('app-voter')).get(1)
|
let agreeButton1 = element.all(by.tagName('app-voter')).get(1)
|
||||||
.all(by.tagName('button')).get(1);
|
.all(by.tagName('button')).get(1);
|
||||||
agreeButton1.click().then(() => {
|
agreeButton1.click().then(function() {
|
||||||
const voteLabel = element(by.tagName('app-vote-taker'))
|
let voteLabel = element(by.tagName('app-vote-taker'))
|
||||||
.element(by.tagName('h3')).getText();
|
.element(by.tagName('h3')).getText();
|
||||||
expect(voteLabel).toBe('Agree: 1, Disagree: 1');
|
expect(voteLabel).toBe('Agree: 1, Disagree: 1');
|
||||||
});
|
});
|
||||||
@ -155,31 +157,31 @@ describe('Component Communication Cookbook Tests', () => {
|
|||||||
|
|
||||||
// Can't run timer tests in protractor because
|
// Can't run timer tests in protractor because
|
||||||
// interaction w/ zones causes all tests to freeze & timeout.
|
// interaction w/ zones causes all tests to freeze & timeout.
|
||||||
xdescribe('Parent calls child via local var', () => {
|
xdescribe('Parent calls child via local var', function() {
|
||||||
countDownTimerTests('countdown-parent-lv');
|
countDownTimerTests('countdown-parent-lv');
|
||||||
});
|
});
|
||||||
|
|
||||||
xdescribe('Parent calls ViewChild', () => {
|
xdescribe('Parent calls ViewChild', function() {
|
||||||
countDownTimerTests('countdown-parent-vc');
|
countDownTimerTests('countdown-parent-vc');
|
||||||
});
|
});
|
||||||
|
|
||||||
function countDownTimerTests(parentTag: string) {
|
function countDownTimerTests(parentTag: string) {
|
||||||
// #docregion countdown-timer-tests
|
// #docregion countdown-timer-tests
|
||||||
// ...
|
// ...
|
||||||
it('timer and parent seconds should match', () => {
|
it('timer and parent seconds should match', function () {
|
||||||
const parent = element(by.tagName(parentTag));
|
let parent = element(by.tagName(parentTag));
|
||||||
const message = parent.element(by.tagName('app-countdown-timer')).getText();
|
let message = parent.element(by.tagName('app-countdown-timer')).getText();
|
||||||
browser.sleep(10); // give `seconds` a chance to catchup with `message`
|
browser.sleep(10); // give `seconds` a chance to catchup with `message`
|
||||||
const seconds = parent.element(by.className('seconds')).getText();
|
let seconds = parent.element(by.className('seconds')).getText();
|
||||||
expect(message).toContain(seconds);
|
expect(message).toContain(seconds);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should stop the countdown', () => {
|
it('should stop the countdown', function () {
|
||||||
const parent = element(by.tagName(parentTag));
|
let parent = element(by.tagName(parentTag));
|
||||||
const stopButton = parent.all(by.tagName('button')).get(1);
|
let stopButton = parent.all(by.tagName('button')).get(1);
|
||||||
|
|
||||||
stopButton.click().then(() => {
|
stopButton.click().then(function() {
|
||||||
const message = parent.element(by.tagName('app-countdown-timer')).getText();
|
let message = parent.element(by.tagName('app-countdown-timer')).getText();
|
||||||
expect(message).toContain('Holding');
|
expect(message).toContain('Holding');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -188,39 +190,39 @@ describe('Component Communication Cookbook Tests', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
describe('Parent and children communicate via a service', () => {
|
describe('Parent and children communicate via a service', function() {
|
||||||
// #docregion bidirectional-service
|
// #docregion bidirectional-service
|
||||||
// ...
|
// ...
|
||||||
it('should announce a mission', () => {
|
it('should announce a mission', function () {
|
||||||
const missionControl = element(by.tagName('app-mission-control'));
|
let missionControl = element(by.tagName('app-mission-control'));
|
||||||
const announceButton = missionControl.all(by.tagName('button')).get(0);
|
let announceButton = missionControl.all(by.tagName('button')).get(0);
|
||||||
announceButton.click().then(() => {
|
announceButton.click().then(function () {
|
||||||
const history = missionControl.all(by.tagName('li'));
|
let history = missionControl.all(by.tagName('li'));
|
||||||
expect(history.count()).toBe(1);
|
expect(history.count()).toBe(1);
|
||||||
expect(history.get(0).getText()).toMatch(/Mission.* announced/);
|
expect(history.get(0).getText()).toMatch(/Mission.* announced/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the mission by Lovell', () => {
|
it('should confirm the mission by Lovell', function () {
|
||||||
testConfirmMission(1, 2, 'Lovell');
|
testConfirmMission(1, 2, 'Lovell');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the mission by Haise', () => {
|
it('should confirm the mission by Haise', function () {
|
||||||
testConfirmMission(3, 3, 'Haise');
|
testConfirmMission(3, 3, 'Haise');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should confirm the mission by Swigert', () => {
|
it('should confirm the mission by Swigert', function () {
|
||||||
testConfirmMission(2, 4, 'Swigert');
|
testConfirmMission(2, 4, 'Swigert');
|
||||||
});
|
});
|
||||||
|
|
||||||
function testConfirmMission(buttonIndex: number, expectedLogCount: number, astronaut: string) {
|
function testConfirmMission(buttonIndex: number, expectedLogCount: number, astronaut: string) {
|
||||||
const confirmedLog = ' confirmed the mission';
|
let _confirmedLog = ' confirmed the mission';
|
||||||
const missionControl = element(by.tagName('app-mission-control'));
|
let missionControl = element(by.tagName('app-mission-control'));
|
||||||
const confirmButton = missionControl.all(by.tagName('button')).get(buttonIndex);
|
let confirmButton = missionControl.all(by.tagName('button')).get(buttonIndex);
|
||||||
confirmButton.click().then(() => {
|
confirmButton.click().then(function () {
|
||||||
const history = missionControl.all(by.tagName('li'));
|
let history = missionControl.all(by.tagName('li'));
|
||||||
expect(history.count()).toBe(expectedLogCount);
|
expect(history.count()).toBe(expectedLogCount);
|
||||||
expect(history.get(expectedLogCount - 1).getText()).toBe(astronaut + confirmedLog);
|
expect(history.get(expectedLogCount - 1).getText()).toBe(astronaut + _confirmedLog);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// ...
|
// ...
|
||||||
|
@ -15,7 +15,7 @@ import { VersionParentComponent } from './version-parent.component';
|
|||||||
import { VoterComponent } from './voter.component';
|
import { VoterComponent } from './voter.component';
|
||||||
import { VoteTakerComponent } from './votetaker.component';
|
import { VoteTakerComponent } from './votetaker.component';
|
||||||
|
|
||||||
const directives: any[] = [
|
let directives: any[] = [
|
||||||
AppComponent,
|
AppComponent,
|
||||||
AstronautComponent,
|
AstronautComponent,
|
||||||
CountdownTimerComponent,
|
CountdownTimerComponent,
|
||||||
@ -30,7 +30,7 @@ const directives: any[] = [
|
|||||||
VoteTakerComponent
|
VoteTakerComponent
|
||||||
];
|
];
|
||||||
|
|
||||||
const schemas: any[] = [];
|
let schemas: any[] = [];
|
||||||
|
|
||||||
// Include Countdown examples
|
// Include Countdown examples
|
||||||
// unless in e2e tests which they break.
|
// unless in e2e tests which they break.
|
||||||
@ -49,6 +49,6 @@ if (!/e2e/.test(location.search)) {
|
|||||||
],
|
],
|
||||||
declarations: directives,
|
declarations: directives,
|
||||||
bootstrap: [ AppComponent ],
|
bootstrap: [ AppComponent ],
|
||||||
schemas
|
schemas: schemas
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
@ -12,6 +12,6 @@ import { Hero } from './hero';
|
|||||||
})
|
})
|
||||||
export class HeroChildComponent {
|
export class HeroChildComponent {
|
||||||
@Input() hero: Hero;
|
@Input() hero: Hero;
|
||||||
@Input('master') masterName: string; // tslint:disable-line: no-input-rename
|
@Input('master') masterName: string;
|
||||||
}
|
}
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
@ -34,7 +34,7 @@ export class MissionControlComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
announce() {
|
announce() {
|
||||||
const mission = this.missions[this.nextMission++];
|
let mission = this.missions[this.nextMission++];
|
||||||
this.missionService.announceMission(mission);
|
this.missionService.announceMission(mission);
|
||||||
this.history.push(`Mission "${mission}" announced`);
|
this.history.push(`Mission "${mission}" announced`);
|
||||||
if (this.nextMission >= this.missions.length) { this.nextMission = 0; }
|
if (this.nextMission >= this.missions.length) { this.nextMission = 0; }
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// tslint:disable: variable-name
|
|
||||||
// #docregion
|
// #docregion
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
@ -7,11 +6,13 @@ import { Component, Input } from '@angular/core';
|
|||||||
template: '<h3>"{{name}}"</h3>'
|
template: '<h3>"{{name}}"</h3>'
|
||||||
})
|
})
|
||||||
export class NameChildComponent {
|
export class NameChildComponent {
|
||||||
|
private _name = '';
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
get name(): string { return this._name; }
|
|
||||||
set name(name: string) {
|
set name(name: string) {
|
||||||
this._name = (name && name.trim()) || '<no name set>';
|
this._name = (name && name.trim()) || '<no name set>';
|
||||||
}
|
}
|
||||||
private _name = '';
|
|
||||||
|
get name(): string { return this._name; }
|
||||||
}
|
}
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
@ -18,14 +18,14 @@ export class VersionChildComponent implements OnChanges {
|
|||||||
changeLog: string[] = [];
|
changeLog: string[] = [];
|
||||||
|
|
||||||
ngOnChanges(changes: {[propKey: string]: SimpleChange}) {
|
ngOnChanges(changes: {[propKey: string]: SimpleChange}) {
|
||||||
const log: string[] = [];
|
let log: string[] = [];
|
||||||
for (const propName in changes) {
|
for (let propName in changes) {
|
||||||
const changedProp = changes[propName];
|
let changedProp = changes[propName];
|
||||||
const to = JSON.stringify(changedProp.currentValue);
|
let to = JSON.stringify(changedProp.currentValue);
|
||||||
if (changedProp.isFirstChange()) {
|
if (changedProp.isFirstChange()) {
|
||||||
log.push(`Initial value of ${propName} set to ${to}`);
|
log.push(`Initial value of ${propName} set to ${to}`);
|
||||||
} else {
|
} else {
|
||||||
const from = JSON.stringify(changedProp.previousValue);
|
let from = JSON.stringify(changedProp.previousValue);
|
||||||
log.push(`${propName} changed from ${from} to ${to}`);
|
log.push(`${propName} changed from ${from} to ${to}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Component Style Tests', () => {
|
describe('Component Style Tests', function () {
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('scopes component styles to component view', () => {
|
it('scopes component styles to component view', function() {
|
||||||
const componentH1 = element(by.css('app-root > h1'));
|
let componentH1 = element(by.css('app-root > h1'));
|
||||||
const externalH1 = element(by.css('body > h1'));
|
let externalH1 = element(by.css('body > h1'));
|
||||||
|
|
||||||
// Note: sometimes webdriver returns the fontWeight as "normal",
|
// Note: sometimes webdriver returns the fontWeight as "normal",
|
||||||
// other times as "400", both of which are equal in CSS terms.
|
// other times as "400", both of which are equal in CSS terms.
|
||||||
@ -17,49 +19,49 @@ describe('Component Style Tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
it('allows styling :host element', () => {
|
it('allows styling :host element', function() {
|
||||||
const host = element(by.css('app-hero-details'));
|
let host = element(by.css('app-hero-details'));
|
||||||
|
|
||||||
expect(host.getCssValue('borderWidth')).toEqual('1px');
|
expect(host.getCssValue('borderWidth')).toEqual('1px');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('supports :host() in function form', () => {
|
it('supports :host() in function form', function() {
|
||||||
const host = element(by.css('app-hero-details'));
|
let host = element(by.css('app-hero-details'));
|
||||||
|
|
||||||
host.element(by.buttonText('Activate')).click();
|
host.element(by.buttonText('Activate')).click();
|
||||||
expect(host.getCssValue('borderWidth')).toEqual('3px');
|
expect(host.getCssValue('borderWidth')).toEqual('3px');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('allows conditional :host-context() styling', () => {
|
it('allows conditional :host-context() styling', function() {
|
||||||
const h2 = element(by.css('app-hero-details h2'));
|
let h2 = element(by.css('app-hero-details h2'));
|
||||||
|
|
||||||
expect(h2.getCssValue('backgroundColor')).toEqual('rgba(238, 238, 255, 1)'); // #eeeeff
|
expect(h2.getCssValue('backgroundColor')).toEqual('rgba(238, 238, 255, 1)'); // #eeeeff
|
||||||
});
|
});
|
||||||
|
|
||||||
it('styles both view and content children with /deep/', () => {
|
it('styles both view and content children with /deep/', function() {
|
||||||
const viewH3 = element(by.css('app-hero-team h3'));
|
let viewH3 = element(by.css('app-hero-team h3'));
|
||||||
const contentH3 = element(by.css('app-hero-controls h3'));
|
let contentH3 = element(by.css('app-hero-controls h3'));
|
||||||
|
|
||||||
expect(viewH3.getCssValue('fontStyle')).toEqual('italic');
|
expect(viewH3.getCssValue('fontStyle')).toEqual('italic');
|
||||||
expect(contentH3.getCssValue('fontStyle')).toEqual('italic');
|
expect(contentH3.getCssValue('fontStyle')).toEqual('italic');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('includes styles loaded with CSS @import', () => {
|
it('includes styles loaded with CSS @import', function() {
|
||||||
const host = element(by.css('app-hero-details'));
|
let host = element(by.css('app-hero-details'));
|
||||||
|
|
||||||
expect(host.getCssValue('padding')).toEqual('10px');
|
expect(host.getCssValue('padding')).toEqual('10px');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('processes template inline styles', () => {
|
it('processes template inline styles', function() {
|
||||||
const button = element(by.css('app-hero-controls button'));
|
let button = element(by.css('app-hero-controls button'));
|
||||||
const externalButton = element(by.css('body > button'));
|
let externalButton = element(by.css('body > button'));
|
||||||
expect(button.getCssValue('backgroundColor')).toEqual('rgba(255, 255, 255, 1)'); // #ffffff
|
expect(button.getCssValue('backgroundColor')).toEqual('rgba(255, 255, 255, 1)'); // #ffffff
|
||||||
expect(externalButton.getCssValue('backgroundColor')).not.toEqual('rgba(255, 255, 255, 1)');
|
expect(externalButton.getCssValue('backgroundColor')).not.toEqual('rgba(255, 255, 255, 1)');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('processes template <link>s', () => {
|
it('processes template <link>s', function() {
|
||||||
const li = element(by.css('app-hero-team li:first-child'));
|
let li = element(by.css('app-hero-team li:first-child'));
|
||||||
const externalLi = element(by.css('body > ul li'));
|
let externalLi = element(by.css('body > ul li'));
|
||||||
|
|
||||||
expect(li.getCssValue('listStyleType')).toEqual('square');
|
expect(li.getCssValue('listStyleType')).toEqual('square');
|
||||||
expect(externalLi.getCssValue('listStyleType')).not.toEqual('square');
|
expect(externalLi.getCssValue('listStyleType')).not.toEqual('square');
|
||||||
|
@ -1,74 +1,76 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Dependency Injection Cookbook', () => {
|
describe('Dependency Injection Cookbook', function () {
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render Logged in User example', () => {
|
it('should render Logged in User example', function () {
|
||||||
const loggedInUser = element.all(by.xpath('//h3[text()="Logged in user"]')).get(0);
|
let loggedInUser = element.all(by.xpath('//h3[text()="Logged in user"]')).get(0);
|
||||||
expect(loggedInUser).toBeDefined();
|
expect(loggedInUser).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('"Bombasto" should be the logged in user', () => {
|
it('"Bombasto" should be the logged in user', function () {
|
||||||
const loggedInUser = element.all(by.xpath('//div[text()="Name: Bombasto"]')).get(0);
|
let loggedInUser = element.all(by.xpath('//div[text()="Name: Bombasto"]')).get(0);
|
||||||
expect(loggedInUser).toBeDefined();
|
expect(loggedInUser).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render sorted heroes', () => {
|
it('should render sorted heroes', function () {
|
||||||
const sortedHeroes = element.all(by.xpath('//h3[text()="Sorted Heroes" and position()=1]')).get(0);
|
let sortedHeroes = element.all(by.xpath('//h3[text()="Sorted Heroes" and position()=1]')).get(0);
|
||||||
expect(sortedHeroes).toBeDefined();
|
expect(sortedHeroes).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Dr Nice should be in sorted heroes', () => {
|
it('Dr Nice should be in sorted heroes', function () {
|
||||||
const sortedHero = element.all(by.xpath('//sorted-heroes/[text()="Dr Nice" and position()=2]')).get(0);
|
let sortedHero = element.all(by.xpath('//sorted-heroes/[text()="Dr Nice" and position()=2]')).get(0);
|
||||||
expect(sortedHero).toBeDefined();
|
expect(sortedHero).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('RubberMan should be in sorted heroes', () => {
|
it('RubberMan should be in sorted heroes', function () {
|
||||||
const sortedHero = element.all(by.xpath('//sorted-heroes/[text()="RubberMan" and position()=3]')).get(0);
|
let sortedHero = element.all(by.xpath('//sorted-heroes/[text()="RubberMan" and position()=3]')).get(0);
|
||||||
expect(sortedHero).toBeDefined();
|
expect(sortedHero).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Magma should be in sorted heroes', () => {
|
it('Magma should be in sorted heroes', function () {
|
||||||
const sortedHero = element.all(by.xpath('//sorted-heroes/[text()="Magma"]')).get(0);
|
let sortedHero = element.all(by.xpath('//sorted-heroes/[text()="Magma"]')).get(0);
|
||||||
expect(sortedHero).toBeDefined();
|
expect(sortedHero).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render Hero of the Month', () => {
|
it('should render Hero of the Month', function () {
|
||||||
const heroOfTheMonth = element.all(by.xpath('//h3[text()="Hero of the month"]')).get(0);
|
let heroOfTheMonth = element.all(by.xpath('//h3[text()="Hero of the month"]')).get(0);
|
||||||
expect(heroOfTheMonth).toBeDefined();
|
expect(heroOfTheMonth).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render Hero Bios', () => {
|
it('should render Hero Bios', function () {
|
||||||
const heroBios = element.all(by.xpath('//h3[text()="Hero Bios"]')).get(0);
|
let heroBios = element.all(by.xpath('//h3[text()="Hero Bios"]')).get(0);
|
||||||
expect(heroBios).toBeDefined();
|
expect(heroBios).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render Magma\'s description in Hero Bios', () => {
|
it('should render Magma\'s description in Hero Bios', function () {
|
||||||
const magmaText = element.all(by.xpath('//textarea[text()="Hero of all trades"]')).get(0);
|
let magmaText = element.all(by.xpath('//textarea[text()="Hero of all trades"]')).get(0);
|
||||||
expect(magmaText).toBeDefined();
|
expect(magmaText).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render Magma\'s phone in Hero Bios and Contacts', () => {
|
it('should render Magma\'s phone in Hero Bios and Contacts', function () {
|
||||||
const magmaPhone = element.all(by.xpath('//div[text()="Phone #: 555-555-5555"]')).get(0);
|
let magmaPhone = element.all(by.xpath('//div[text()="Phone #: 555-555-5555"]')).get(0);
|
||||||
expect(magmaPhone).toBeDefined();
|
expect(magmaPhone).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render Hero-of-the-Month runner-ups', () => {
|
it('should render Hero-of-the-Month runner-ups', function () {
|
||||||
const runnersUp = element(by.id('rups1')).getText();
|
let runnersUp = element(by.id('rups1')).getText();
|
||||||
expect(runnersUp).toContain('RubberMan, Dr Nice');
|
expect(runnersUp).toContain('RubberMan, Dr Nice');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render DateLogger log entry in Hero-of-the-Month', () => {
|
it('should render DateLogger log entry in Hero-of-the-Month', function () {
|
||||||
const logs = element.all(by.id('logs')).get(0).getText();
|
let logs = element.all(by.id('logs')).get(0).getText();
|
||||||
expect(logs).toContain('INFO: starting up at');
|
expect(logs).toContain('INFO: starting up at');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should highlight Hero Bios and Contacts container when mouseover', () => {
|
it('should highlight Hero Bios and Contacts container when mouseover', function () {
|
||||||
const target = element(by.css('div[appHighlight="yellow"]'));
|
let target = element(by.css('div[appHighlight="yellow"]'));
|
||||||
const yellow = 'rgba(255, 255, 0, 1)';
|
let yellow = 'rgba(255, 255, 0, 1)';
|
||||||
|
|
||||||
expect(target.getCssValue('background-color')).not.toEqual(yellow);
|
expect(target.getCssValue('background-color')).not.toEqual(yellow);
|
||||||
|
|
||||||
@ -79,25 +81,25 @@ describe('Dependency Injection Cookbook', () => {
|
|||||||
browser.wait(() => target.getCssValue('background-color').then(c => c === yellow), 2000);
|
browser.wait(() => target.getCssValue('background-color').then(c => c === yellow), 2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('in Parent Finder', () => {
|
describe('in Parent Finder', function () {
|
||||||
const cathy1 = element(by.css('alex cathy'));
|
let cathy1 = element(by.css('alex cathy'));
|
||||||
const craig1 = element(by.css('alex craig'));
|
let craig1 = element(by.css('alex craig'));
|
||||||
const carol1 = element(by.css('alex carol p'));
|
let carol1 = element(by.css('alex carol p'));
|
||||||
const carol2 = element(by.css('barry carol p'));
|
let carol2 = element(by.css('barry carol p'));
|
||||||
|
|
||||||
it('"Cathy" should find "Alex" via the component class', () => {
|
it('"Cathy" should find "Alex" via the component class', function () {
|
||||||
expect(cathy1.getText()).toContain('Found Alex via the component');
|
expect(cathy1.getText()).toContain('Found Alex via the component');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('"Craig" should not find "Alex" via the base class', () => {
|
it('"Craig" should not find "Alex" via the base class', function () {
|
||||||
expect(craig1.getText()).toContain('Did not find Alex via the base');
|
expect(craig1.getText()).toContain('Did not find Alex via the base');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('"Carol" within "Alex" should have "Alex" parent', () => {
|
it('"Carol" within "Alex" should have "Alex" parent', function () {
|
||||||
expect(carol1.getText()).toContain('Alex');
|
expect(carol1.getText()).toContain('Alex');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('"Carol" within "Barry" should have "Barry" parent', () => {
|
it('"Carol" within "Barry" should have "Barry" parent', function () {
|
||||||
expect(carol2.getText()).toContain('Barry');
|
expect(carol2.getText()).toContain('Barry');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -42,11 +42,11 @@ const declarations = [
|
|||||||
ParentFinderComponent,
|
ParentFinderComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
const componentListA = [ AliceComponent, AlexComponent ];
|
const a_components = [AliceComponent, AlexComponent ];
|
||||||
|
|
||||||
const componentListB = [ BarryComponent, BethComponent, BobComponent ];
|
const b_components = [ BarryComponent, BethComponent, BobComponent ];
|
||||||
|
|
||||||
const componentListC = [
|
const c_components = [
|
||||||
CarolComponent, ChrisComponent, CraigComponent,
|
CarolComponent, ChrisComponent, CraigComponent,
|
||||||
CathyComponent
|
CathyComponent
|
||||||
];
|
];
|
||||||
@ -61,9 +61,9 @@ const componentListC = [
|
|||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
declarations,
|
declarations,
|
||||||
componentListA,
|
a_components,
|
||||||
componentListB,
|
b_components,
|
||||||
componentListC,
|
c_components,
|
||||||
StorageComponent,
|
StorageComponent,
|
||||||
],
|
],
|
||||||
bootstrap: [ AppComponent ],
|
bootstrap: [ AppComponent ],
|
||||||
|
@ -3,7 +3,7 @@ import { Hero } from './hero';
|
|||||||
|
|
||||||
export class HeroData {
|
export class HeroData {
|
||||||
createDb() {
|
createDb() {
|
||||||
const heroes = [
|
let heroes = [
|
||||||
new Hero(1, 'Windstorm'),
|
new Hero(1, 'Windstorm'),
|
||||||
new Hero(2, 'Bombasto'),
|
new Hero(2, 'Bombasto'),
|
||||||
new Hero(3, 'Magneta'),
|
new Hero(3, 'Magneta'),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// tslint:disable: component-selector space-before-function-paren
|
/* tslint:disable:no-unused-variable component-selector-name one-line check-open-brace */
|
||||||
|
/* tslint:disable:*/
|
||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion
|
// #docregion
|
||||||
import { Component, forwardRef, Optional, SkipSelf } from '@angular/core';
|
import { Component, forwardRef, Optional, SkipSelf } from '@angular/core';
|
||||||
@ -19,7 +20,8 @@ const DifferentParent = Parent;
|
|||||||
// The `parentType` defaults to `Parent` when omitting the second parameter.
|
// The `parentType` defaults to `Parent` when omitting the second parameter.
|
||||||
// #docregion provide-the-parent
|
// #docregion provide-the-parent
|
||||||
export function provideParent
|
export function provideParent
|
||||||
// #enddocregion provide-the-parent
|
// #enddocregion provide-parent, provide-the-parent
|
||||||
|
// #docregion provide-parent
|
||||||
(component: any, parentType?: any) {
|
(component: any, parentType?: any) {
|
||||||
return { provide: parentType || Parent, useExisting: forwardRef(() => component) };
|
return { provide: parentType || Parent, useExisting: forwardRef(() => component) };
|
||||||
}
|
}
|
||||||
|
@ -22,5 +22,5 @@ export function runnersUpFactory(take: number) {
|
|||||||
.join(', ');
|
.join(', ');
|
||||||
// #docregion factory-synopsis
|
// #docregion factory-synopsis
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
// #enddocregion factory-synopsis
|
// #enddocregion factory-synopsis
|
||||||
|
@ -24,7 +24,7 @@ export class UserContextService {
|
|||||||
// #enddocregion ctor, injectables
|
// #enddocregion ctor, injectables
|
||||||
|
|
||||||
loadUser(userId: number) {
|
loadUser(userId: number) {
|
||||||
const user = this.userService.getUserById(userId);
|
let user = this.userService.getUserById(userId);
|
||||||
this.name = user.name;
|
this.name = user.name;
|
||||||
this.role = user.role;
|
this.role = user.role;
|
||||||
|
|
||||||
|
@ -1,196 +1,202 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by, ElementFinder } from 'protractor';
|
import { browser, element, by, ElementFinder } from 'protractor';
|
||||||
|
|
||||||
describe('Dependency Injection Tests', () => {
|
describe('Dependency Injection Tests', function () {
|
||||||
|
|
||||||
let expectedMsg: string;
|
let expectedMsg: string;
|
||||||
let expectedMsgRx: RegExp;
|
let expectedMsgRx: RegExp;
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Cars:', () => {
|
describe('Cars:', function() {
|
||||||
|
|
||||||
it('DI car displays as expected', () => {
|
it('DI car displays as expected', function () {
|
||||||
expectedMsg = 'DI car with 4 cylinders and Flintstone tires.';
|
expectedMsg = 'DI car with 4 cylinders and Flintstone tires.';
|
||||||
expect(element(by.css('#di')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#di')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('No DI car displays as expected', () => {
|
it('No DI car displays as expected', function () {
|
||||||
expectedMsg = 'No DI car with 4 cylinders and Flintstone tires.';
|
expectedMsg = 'No DI car with 4 cylinders and Flintstone tires.';
|
||||||
expect(element(by.css('#nodi')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#nodi')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Injector car displays as expected', () => {
|
it('Injector car displays as expected', function () {
|
||||||
expectedMsg = 'Injector car with 4 cylinders and Flintstone tires.';
|
expectedMsg = 'Injector car with 4 cylinders and Flintstone tires.';
|
||||||
expect(element(by.css('#injector')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#injector')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Factory car displays as expected', () => {
|
it('Factory car displays as expected', function () {
|
||||||
expectedMsg = 'Factory car with 4 cylinders and Flintstone tires.';
|
expectedMsg = 'Factory car with 4 cylinders and Flintstone tires.';
|
||||||
expect(element(by.css('#factory')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#factory')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Simple car displays as expected', () => {
|
it('Simple car displays as expected', function () {
|
||||||
expectedMsg = 'Simple car with 4 cylinders and Flintstone tires.';
|
expectedMsg = 'Simple car with 4 cylinders and Flintstone tires.';
|
||||||
expect(element(by.css('#simple')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#simple')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Super car displays as expected', () => {
|
it('Super car displays as expected', function () {
|
||||||
expectedMsg = 'Super car with 12 cylinders and Flintstone tires.';
|
expectedMsg = 'Super car with 12 cylinders and Flintstone tires.';
|
||||||
expect(element(by.css('#super')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#super')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test car displays as expected', () => {
|
it('Test car displays as expected', function () {
|
||||||
expectedMsg = 'Test car with 8 cylinders and YokoGoodStone tires.';
|
expectedMsg = 'Test car with 8 cylinders and YokoGoodStone tires.';
|
||||||
expect(element(by.css('#test')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#test')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Other Injections:', () => {
|
describe('Other Injections:', function() {
|
||||||
it('DI car displays as expected', () => {
|
it('DI car displays as expected', function () {
|
||||||
expectedMsg = 'DI car with 4 cylinders and Flintstone tires.';
|
expectedMsg = 'DI car with 4 cylinders and Flintstone tires.';
|
||||||
expect(element(by.css('#car')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#car')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Hero displays as expected', () => {
|
it('Hero displays as expected', function () {
|
||||||
expectedMsg = 'Dr Nice';
|
expectedMsg = 'Dr Nice';
|
||||||
expect(element(by.css('#hero')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#hero')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Optional injection displays as expected', () => {
|
it('Optional injection displays as expected', function () {
|
||||||
expectedMsg = 'R.O.U.S.\'s? I don\'t think they exist!';
|
expectedMsg = 'R.O.U.S.\'s? I don\'t think they exist!';
|
||||||
expect(element(by.css('#rodent')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#rodent')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Tests:', () => {
|
describe('Tests:', function() {
|
||||||
|
|
||||||
it('Tests display as expected', () => {
|
it('Tests display as expected', function () {
|
||||||
expectedMsgRx = /Tests passed/;
|
expectedMsgRx = /Tests passed/;
|
||||||
expect(element(by.css('#tests')).getText()).toMatch(expectedMsgRx);
|
expect(element(by.css('#tests')).getText()).toMatch(expectedMsgRx);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Provider variations:', () => {
|
describe('Provider variations:', function() {
|
||||||
|
|
||||||
it('P1 (class) displays as expected', () => {
|
it('P1 (class) displays as expected', function () {
|
||||||
expectedMsg = 'Hello from logger provided with Logger class';
|
expectedMsg = 'Hello from logger provided with Logger class';
|
||||||
expect(element(by.css('#p1')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p1')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P3 (provide) displays as expected', () => {
|
it('P3 (provide) displays as expected', function () {
|
||||||
expectedMsg = 'Hello from logger provided with useClass:Logger';
|
expectedMsg = 'Hello from logger provided with useClass:Logger';
|
||||||
expect(element(by.css('#p3')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p3')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P4 (useClass:BetterLogger) displays as expected', () => {
|
it('P4 (useClass:BetterLogger) displays as expected', function () {
|
||||||
expectedMsg = 'Hello from logger provided with useClass:BetterLogger';
|
expectedMsg = 'Hello from logger provided with useClass:BetterLogger';
|
||||||
expect(element(by.css('#p4')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p4')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P5 (useClass:EvenBetterLogger - dependency) displays as expected', () => {
|
it('P5 (useClass:EvenBetterLogger - dependency) displays as expected', function () {
|
||||||
expectedMsg = 'Message to Bob: Hello from EvenBetterlogger';
|
expectedMsg = 'Message to Bob: Hello from EvenBetterlogger';
|
||||||
expect(element(by.css('#p5')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p5')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P6a (no alias) displays as expected', () => {
|
it('P6a (no alias) displays as expected', function () {
|
||||||
expectedMsg = 'Hello OldLogger (but we want NewLogger)';
|
expectedMsg = 'Hello OldLogger (but we want NewLogger)';
|
||||||
expect(element(by.css('#p6a')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p6a')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P6b (alias) displays as expected', () => {
|
it('P6b (alias) displays as expected', function () {
|
||||||
expectedMsg = 'Hello from NewLogger (via aliased OldLogger)';
|
expectedMsg = 'Hello from NewLogger (via aliased OldLogger)';
|
||||||
expect(element(by.css('#p6b')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p6b')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P7 (useValue) displays as expected', () => {
|
it('P7 (useValue) displays as expected', function () {
|
||||||
expectedMsg = 'Silent logger says "Shhhhh!". Provided via "useValue"';
|
expectedMsg = 'Silent logger says "Shhhhh!". Provided via "useValue"';
|
||||||
expect(element(by.css('#p7')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p7')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P8 (useFactory) displays as expected', () => {
|
it('P8 (useFactory) displays as expected', function () {
|
||||||
expectedMsg = 'Hero service injected successfully via heroServiceProvider';
|
expectedMsg = 'Hero service injected successfully via heroServiceProvider';
|
||||||
expect(element(by.css('#p8')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p8')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P9 (InjectionToken) displays as expected', () => {
|
it('P9 (InjectionToken) displays as expected', function () {
|
||||||
expectedMsg = 'APP_CONFIG Application title is Dependency Injection';
|
expectedMsg = 'APP_CONFIG Application title is Dependency Injection';
|
||||||
expect(element(by.css('#p9')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p9')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('P10 (optional dependency) displays as expected', () => {
|
it('P10 (optional dependency) displays as expected', function () {
|
||||||
expectedMsg = 'Optional logger was not available';
|
expectedMsg = 'Optional logger was not available';
|
||||||
expect(element(by.css('#p10')).getText()).toEqual(expectedMsg);
|
expect(element(by.css('#p10')).getText()).toEqual(expectedMsg);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('User/Heroes:', () => {
|
describe('User/Heroes:', function() {
|
||||||
it('User is Bob - unauthorized', () => {
|
it('User is Bob - unauthorized', function () {
|
||||||
expectedMsgRx = /Bob, is not authorized/;
|
expectedMsgRx = /Bob, is not authorized/;
|
||||||
expect(element(by.css('#user')).getText()).toMatch(expectedMsgRx);
|
expect(element(by.css('#user')).getText()).toMatch(expectedMsgRx);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have button', () => {
|
it('should have button', function () {
|
||||||
expect(element.all(by.cssContainingText('button', 'Next User'))
|
expect(element.all(by.cssContainingText('button', 'Next User'))
|
||||||
.get(0).isDisplayed()).toBe(true, '\'Next User\' button should be displayed');
|
.get(0).isDisplayed()).toBe(true, '\'Next User\' button should be displayed');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('unauthorized user should have multiple unauthorized heroes', () => {
|
it('unauthorized user should have multiple unauthorized heroes', function () {
|
||||||
const heroes = element.all(by.css('#unauthorized app-hero-list div'));
|
let heroes = element.all(by.css('#unauthorized app-hero-list div'));
|
||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('unauthorized user should have no secret heroes', () => {
|
it('unauthorized user should have no secret heroes', function () {
|
||||||
const heroes = element.all(by.css('#unauthorized app-hero-list div'));
|
let heroes = element.all(by.css('#unauthorized app-hero-list div'));
|
||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
|
|
||||||
const filteredHeroes = heroes.filter((elem: ElementFinder, index: number) => {
|
let filteredHeroes = heroes.filter((elem: ElementFinder, index: number) => {
|
||||||
return elem.getText().then((text: string) => /secret/.test(text));
|
return elem.getText().then((text: string) => {
|
||||||
|
return /secret/.test(text);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(filteredHeroes.count()).toEqual(0);
|
expect(filteredHeroes.count()).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('unauthorized user should have no authorized heroes listed', () => {
|
it('unauthorized user should have no authorized heroes listed', function () {
|
||||||
expect(element.all(by.css('#authorized app-hero-list div')).count()).toEqual(0);
|
expect(element.all(by.css('#authorized app-hero-list div')).count()).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('after button click', () => {
|
describe('after button click', function() {
|
||||||
|
|
||||||
beforeAll((done: any) => {
|
beforeAll(function (done: any) {
|
||||||
const buttonEle = element.all(by.cssContainingText('button', 'Next User')).get(0);
|
let buttonEle = element.all(by.cssContainingText('button', 'Next User')).get(0);
|
||||||
buttonEle.click().then(done, done);
|
buttonEle.click().then(done, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('User is Alice - authorized', () => {
|
it('User is Alice - authorized', function () {
|
||||||
expectedMsgRx = /Alice, is authorized/;
|
expectedMsgRx = /Alice, is authorized/;
|
||||||
expect(element(by.css('#user')).getText()).toMatch(expectedMsgRx);
|
expect(element(by.css('#user')).getText()).toMatch(expectedMsgRx);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('authorized user should have multiple authorized heroes ', () => {
|
it('authorized user should have multiple authorized heroes ', function () {
|
||||||
const heroes = element.all(by.css('#authorized app-hero-list div'));
|
let heroes = element.all(by.css('#authorized app-hero-list div'));
|
||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('authorized user should have multiple authorized heroes with tree-shakeable HeroesService', () => {
|
it('authorized user should have multiple authorized heroes with tree-shakeable HeroesService', function () {
|
||||||
const heroes = element.all(by.css('#tspAuthorized app-hero-list div'));
|
let heroes = element.all(by.css('#tspAuthorized app-hero-list div'));
|
||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('authorized user should have secret heroes', () => {
|
it('authorized user should have secret heroes', function () {
|
||||||
const heroes = element.all(by.css('#authorized app-hero-list div'));
|
let heroes = element.all(by.css('#authorized app-hero-list div'));
|
||||||
expect(heroes.count()).toBeGreaterThan(0);
|
expect(heroes.count()).toBeGreaterThan(0);
|
||||||
|
|
||||||
const filteredHeroes = heroes.filter((elem: ElementFinder, index: number) => {
|
let filteredHeroes = heroes.filter(function(elem: ElementFinder, index: number) {
|
||||||
return elem.getText().then((text: string) => /secret/.test(text));
|
return elem.getText().then(function(text: string) {
|
||||||
|
return /secret/.test(text);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(filteredHeroes.count()).toBeGreaterThan(0);
|
expect(filteredHeroes.count()).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('authorized user should have no unauthorized heroes listed', () => {
|
it('authorized user should have no unauthorized heroes listed', function () {
|
||||||
expect(element.all(by.css('#unauthorized app-hero-list div')).count()).toEqual(0);
|
expect(element.all(by.css('#unauthorized app-hero-list div')).count()).toEqual(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,7 @@ import { Car, Engine, Tires } from './car';
|
|||||||
export function simpleCar() {
|
export function simpleCar() {
|
||||||
// #docregion car-ctor-instantiation
|
// #docregion car-ctor-instantiation
|
||||||
// Simple car with 4 cylinders and Flintstone tires.
|
// Simple car with 4 cylinders and Flintstone tires.
|
||||||
const car = new Car(new Engine(), new Tires());
|
let car = new Car(new Engine(), new Tires());
|
||||||
// #enddocregion car-ctor-instantiation
|
// #enddocregion car-ctor-instantiation
|
||||||
car.description = 'Simple';
|
car.description = 'Simple';
|
||||||
return car;
|
return car;
|
||||||
@ -16,31 +16,30 @@ export function simpleCar() {
|
|||||||
|
|
||||||
///////// example 2 ////////////
|
///////// example 2 ////////////
|
||||||
// #docregion car-ctor-instantiation-with-param
|
// #docregion car-ctor-instantiation-with-param
|
||||||
class Engine2 {
|
class Engine2 {
|
||||||
constructor(public cylinders: number) { }
|
constructor(public cylinders: number) { }
|
||||||
}
|
}
|
||||||
// #enddocregion car-ctor-instantiation-with-param
|
// #enddocregion car-ctor-instantiation-with-param
|
||||||
|
|
||||||
export function superCar() {
|
export function superCar() {
|
||||||
// #docregion car-ctor-instantiation-with-param
|
// #docregion car-ctor-instantiation-with-param
|
||||||
// Super car with 12 cylinders and Flintstone tires.
|
// Super car with 12 cylinders and Flintstone tires.
|
||||||
const bigCylinders = 12;
|
let bigCylinders = 12;
|
||||||
const car = new Car(new Engine2(bigCylinders), new Tires());
|
let car = new Car(new Engine2(bigCylinders), new Tires());
|
||||||
// #enddocregion car-ctor-instantiation-with-param
|
// #enddocregion car-ctor-instantiation-with-param
|
||||||
car.description = 'Super';
|
car.description = 'Super';
|
||||||
return car;
|
return car;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////// example 3 //////////
|
/////////// example 3 //////////
|
||||||
// #docregion car-ctor-instantiation-with-mocks
|
// #docregion car-ctor-instantiation-with-mocks
|
||||||
class MockEngine extends Engine { cylinders = 8; }
|
class MockEngine extends Engine { cylinders = 8; }
|
||||||
class MockTires extends Tires { make = 'YokoGoodStone'; }
|
class MockTires extends Tires { make = 'YokoGoodStone'; }
|
||||||
|
|
||||||
// #enddocregion car-ctor-instantiation-with-mocks
|
// #enddocregion car-ctor-instantiation-with-mocks
|
||||||
export function testCar() {
|
export function testCar() {
|
||||||
// #docregion car-ctor-instantiation-with-mocks
|
// #docregion car-ctor-instantiation-with-mocks
|
||||||
// Test car with 8 cylinders and YokoGoodStone tires.
|
// Test car with 8 cylinders and YokoGoodStone tires.
|
||||||
const car = new Car(new MockEngine(), new MockTires());
|
let car = new Car(new MockEngine(), new MockTires());
|
||||||
// #enddocregion car-ctor-instantiation-with-mocks
|
// #enddocregion car-ctor-instantiation-with-mocks
|
||||||
car.description = 'Test';
|
car.description = 'Test';
|
||||||
return car;
|
return car;
|
||||||
|
@ -4,7 +4,7 @@ import { Engine, Tires, Car } from './car';
|
|||||||
// BAD pattern!
|
// BAD pattern!
|
||||||
export class CarFactory {
|
export class CarFactory {
|
||||||
createCar() {
|
createCar() {
|
||||||
const car = new Car(this.createEngine(), this.createTires());
|
let car = new Car(this.createEngine(), this.createTires());
|
||||||
car.description = 'Factory';
|
car.description = 'Factory';
|
||||||
return car;
|
return car;
|
||||||
}
|
}
|
||||||
|
@ -26,14 +26,14 @@ export function useInjector() {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
// #docregion injector-call
|
// #docregion injector-call
|
||||||
const car = injector.get(Car);
|
let car = injector.get(Car);
|
||||||
// #enddocregion injector-call, injector-create-and-call
|
// #enddocregion injector-call, injector-create-and-call
|
||||||
car.description = 'Injector';
|
car.description = 'Injector';
|
||||||
|
|
||||||
injector = Injector.create({
|
injector = Injector.create({
|
||||||
providers: [{ provide: Logger, deps: [] }]
|
providers: [{ provide: Logger, deps: [] }]
|
||||||
});
|
});
|
||||||
const logger = injector.get(Logger);
|
let logger = injector.get(Logger);
|
||||||
logger.log('Injector car.drive() said: ' + car.drive());
|
logger.log('Injector car.drive() said: ' + car.drive());
|
||||||
return car;
|
return car;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,9 @@ import { useInjector } from './car-injector';
|
|||||||
providers: [Car, Engine, Tires]
|
providers: [Car, Engine, Tires]
|
||||||
})
|
})
|
||||||
export class CarComponent {
|
export class CarComponent {
|
||||||
factoryCar = (new CarFactory()).createCar();
|
factoryCar = (new CarFactory).createCar();
|
||||||
injectorCar = useInjector();
|
injectorCar = useInjector();
|
||||||
noDiCar = new CarNoDi();
|
noDiCar = new CarNoDi;
|
||||||
simpleCar = simpleCar();
|
simpleCar = simpleCar();
|
||||||
superCar = superCar();
|
superCar = superCar();
|
||||||
testCar = testCar();
|
testCar = testCar();
|
||||||
|
@ -5,7 +5,7 @@ import { Logger } from '../logger.service';
|
|||||||
import { UserService } from '../user.service';
|
import { UserService } from '../user.service';
|
||||||
|
|
||||||
// #docregion factory
|
// #docregion factory
|
||||||
const heroServiceFactory = (logger: Logger, userService: UserService) => {
|
let heroServiceFactory = (logger: Logger, userService: UserService) => {
|
||||||
return new HeroService(logger, userService.user.isAuthorized);
|
return new HeroService(logger, userService.user.isAuthorized);
|
||||||
};
|
};
|
||||||
// #enddocregion factory
|
// #enddocregion factory
|
||||||
|
@ -17,7 +17,7 @@ export class HeroService {
|
|||||||
private isAuthorized: boolean) { }
|
private isAuthorized: boolean) { }
|
||||||
|
|
||||||
getHeroes() {
|
getHeroes() {
|
||||||
const auth = this.isAuthorized ? 'authorized ' : 'unauthorized';
|
let auth = this.isAuthorized ? 'authorized ' : 'unauthorized';
|
||||||
this.logger.log(`Getting heroes for ${auth} user.`);
|
this.logger.log(`Getting heroes for ${auth} user.`);
|
||||||
return HEROES.filter(hero => this.isAuthorized || !hero.isSecret);
|
return HEROES.filter(hero => this.isAuthorized || !hero.isSecret);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ export class InjectorComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get rodent() {
|
get rodent() {
|
||||||
const rousDontExist = `R.O.U.S.'s? I don't think they exist!`;
|
let rousDontExist = `R.O.U.S.'s? I don't think they exist!`;
|
||||||
return this.injector.get(ROUS, rousDontExist);
|
return this.injector.get(ROUS, rousDontExist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ const template = '{{log}}';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-1',
|
selector: 'provider-1',
|
||||||
template,
|
template: template,
|
||||||
// #docregion providers-1, providers-logger
|
// #docregion providers-1, providers-logger
|
||||||
providers: [Logger]
|
providers: [Logger]
|
||||||
// #enddocregion providers-1, providers-logger
|
// #enddocregion providers-1, providers-logger
|
||||||
@ -35,7 +35,7 @@ export class Provider1Component {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-3',
|
selector: 'provider-3',
|
||||||
template,
|
template: template,
|
||||||
providers:
|
providers:
|
||||||
// #docregion providers-3
|
// #docregion providers-3
|
||||||
[{ provide: Logger, useClass: Logger }]
|
[{ provide: Logger, useClass: Logger }]
|
||||||
@ -54,7 +54,7 @@ export class BetterLogger extends Logger {}
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-4',
|
selector: 'provider-4',
|
||||||
template,
|
template: template,
|
||||||
providers:
|
providers:
|
||||||
// #docregion providers-4
|
// #docregion providers-4
|
||||||
[{ provide: Logger, useClass: BetterLogger }]
|
[{ provide: Logger, useClass: BetterLogger }]
|
||||||
@ -76,7 +76,7 @@ export class EvenBetterLogger extends Logger {
|
|||||||
constructor(private userService: UserService) { super(); }
|
constructor(private userService: UserService) { super(); }
|
||||||
|
|
||||||
log(message: string) {
|
log(message: string) {
|
||||||
const name = this.userService.user.name;
|
let name = this.userService.user.name;
|
||||||
super.log(`Message to ${name}: ${message}`);
|
super.log(`Message to ${name}: ${message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ export class EvenBetterLogger extends Logger {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-5',
|
selector: 'provider-5',
|
||||||
template,
|
template: template,
|
||||||
providers:
|
providers:
|
||||||
// #docregion providers-5
|
// #docregion providers-5
|
||||||
[ UserService,
|
[ UserService,
|
||||||
@ -107,12 +107,12 @@ export class OldLogger {
|
|||||||
logs: string[] = [];
|
logs: string[] = [];
|
||||||
log(message: string) {
|
log(message: string) {
|
||||||
throw new Error('Should not call the old logger!');
|
throw new Error('Should not call the old logger!');
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-6a',
|
selector: 'provider-6a',
|
||||||
template,
|
template: template,
|
||||||
providers:
|
providers:
|
||||||
// #docregion providers-6a
|
// #docregion providers-6a
|
||||||
[ NewLogger,
|
[ NewLogger,
|
||||||
@ -135,7 +135,7 @@ export class Provider6aComponent {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-6b',
|
selector: 'provider-6b',
|
||||||
template,
|
template: template,
|
||||||
providers:
|
providers:
|
||||||
// #docregion providers-6b
|
// #docregion providers-6b
|
||||||
[ NewLogger,
|
[ NewLogger,
|
||||||
@ -168,7 +168,7 @@ export const SilentLogger = {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-7',
|
selector: 'provider-7',
|
||||||
template,
|
template: template,
|
||||||
providers:
|
providers:
|
||||||
// #docregion providers-7
|
// #docregion providers-7
|
||||||
[{ provide: Logger, useValue: SilentLogger }]
|
[{ provide: Logger, useValue: SilentLogger }]
|
||||||
@ -186,7 +186,7 @@ export class Provider7Component {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-8',
|
selector: 'provider-8',
|
||||||
template,
|
template: template,
|
||||||
providers: [heroServiceProvider, Logger, UserService]
|
providers: [heroServiceProvider, Logger, UserService]
|
||||||
})
|
})
|
||||||
export class Provider8Component {
|
export class Provider8Component {
|
||||||
@ -202,7 +202,7 @@ export class Provider8Component {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-9',
|
selector: 'provider-9',
|
||||||
template,
|
template: template,
|
||||||
/*
|
/*
|
||||||
// #docregion providers-9-interface
|
// #docregion providers-9-interface
|
||||||
// FAIL! Can't use interface as provider token
|
// FAIL! Can't use interface as provider token
|
||||||
@ -237,11 +237,11 @@ export class Provider9Component implements OnInit {
|
|||||||
import { Optional } from '@angular/core';
|
import { Optional } from '@angular/core';
|
||||||
// #enddocregion import-optional
|
// #enddocregion import-optional
|
||||||
|
|
||||||
const someMessage = 'Hello from the injected logger';
|
let some_message = 'Hello from the injected logger';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'provider-10',
|
selector: 'provider-10',
|
||||||
template,
|
template: template,
|
||||||
providers: [{ provide: Logger, useValue: null }]
|
providers: [{ provide: Logger, useValue: null }]
|
||||||
})
|
})
|
||||||
export class Provider10Component implements OnInit {
|
export class Provider10Component implements OnInit {
|
||||||
@ -249,7 +249,7 @@ export class Provider10Component implements OnInit {
|
|||||||
// #docregion provider-10-ctor
|
// #docregion provider-10-ctor
|
||||||
constructor(@Optional() private logger?: Logger) {
|
constructor(@Optional() private logger?: Logger) {
|
||||||
if (this.logger) {
|
if (this.logger) {
|
||||||
this.logger.log(someMessage);
|
this.logger.log(some_message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #enddocregion provider-10-ctor
|
// #enddocregion provider-10-ctor
|
||||||
|
@ -43,7 +43,7 @@ var testResults: {pass: string; message: string};
|
|||||||
|
|
||||||
function expect(actual: any) {
|
function expect(actual: any) {
|
||||||
return {
|
return {
|
||||||
toEqual: (expected: any) => {
|
toEqual: function(expected: any){
|
||||||
testResults = actual === expected ?
|
testResults = actual === expected ?
|
||||||
{pass: 'passed', message: testName} :
|
{pass: 'passed', message: testName} :
|
||||||
{pass: 'failed', message: `${testName}; expected ${actual} to equal ${expected}.`};
|
{pass: 'failed', message: `${testName}; expected ${actual} to equal ${expected}.`};
|
||||||
|
@ -8,8 +8,8 @@ export class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: get the user; don't 'new' it.
|
// TODO: get the user; don't 'new' it.
|
||||||
const alice = new User('Alice', true);
|
let alice = new User('Alice', true);
|
||||||
const bob = new User('Bob', false);
|
let bob = new User('Bob', false);
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -1,27 +1,29 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Displaying Data Tests', () => {
|
describe('Displaying Data Tests', function () {
|
||||||
const title = 'Tour of Heroes';
|
let _title = 'Tour of Heroes';
|
||||||
const defaultHero = 'Windstorm';
|
let _defaultHero = 'Windstorm';
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display correct title: ' + title, () => {
|
it('should display correct title: ' + _title, function () {
|
||||||
expect(element(by.css('h1')).getText()).toEqual(title);
|
expect(element(by.css('h1')).getText()).toEqual(_title);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have correct default hero: ' + defaultHero, () => {
|
it('should have correct default hero: ' + _defaultHero, function () {
|
||||||
expect(element(by.css('h2')).getText()).toContain(defaultHero);
|
expect(element(by.css('h2')).getText()).toContain(_defaultHero);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have heroes', () => {
|
it('should have heroes', function () {
|
||||||
const heroEls = element.all(by.css('li'));
|
let heroEls = element.all(by.css('li'));
|
||||||
expect(heroEls.count()).not.toBe(0, 'should have heroes');
|
expect(heroEls.count()).not.toBe(0, 'should have heroes');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display "there are many heroes!"', () => {
|
it('should display "there are many heroes!"', function () {
|
||||||
expect(element(by.css('ul ~ p')).getText()).toContain('There are many heroes!');
|
expect(element(by.css('ul ~ p')).getText()).toContain('There are many heroes!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
describe('Docs Style Guide', () => {
|
describe('Docs Style Guide', function () {
|
||||||
const title = 'Authors Style Guide Sample';
|
let _title = 'Authors Style Guide Sample';
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display correct title: ' + title, () => {
|
it('should display correct title: ' + _title, function () {
|
||||||
expect(element(by.css('h1')).getText()).toEqual(title);
|
expect(element(by.css('h1')).getText()).toEqual(_title);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
/* tslint:disable:quotemark */
|
/* tslint:disable:quotemark */
|
||||||
describe('Dynamic Component Loader', () => {
|
describe('Dynamic Component Loader', function () {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load ad banner', () => {
|
it('should load ad banner', function () {
|
||||||
const headline = element(by.xpath("//h4[text()='Featured Hero Profile']"));
|
let headline = element(by.xpath("//h4[text()='Featured Hero Profile']"));
|
||||||
const name = element(by.xpath("//h3[text()='Bombasto']"));
|
let name = element(by.xpath("//h3[text()='Bombasto']"));
|
||||||
const bio = element(by.xpath("//p[text()='Brave as they come']"));
|
let bio = element(by.xpath("//p[text()='Brave as they come']"));
|
||||||
|
|
||||||
expect(name).toBeDefined();
|
expect(name).toBeDefined();
|
||||||
expect(headline).toBeDefined();
|
expect(headline).toBeDefined();
|
||||||
|
@ -11,7 +11,7 @@ import { AdComponent } from './ad.component';
|
|||||||
template: `
|
template: `
|
||||||
<div class="ad-banner-example">
|
<div class="ad-banner-example">
|
||||||
<h3>Advertisements</h3>
|
<h3>Advertisements</h3>
|
||||||
<ng-template adHost></ng-template>
|
<ng-template ad-host></ng-template>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
// #enddocregion ad-host
|
// #enddocregion ad-host
|
||||||
@ -43,8 +43,8 @@ export class AdBannerComponent implements OnInit, OnDestroy {
|
|||||||
const viewContainerRef = this.adHost.viewContainerRef;
|
const viewContainerRef = this.adHost.viewContainerRef;
|
||||||
viewContainerRef.clear();
|
viewContainerRef.clear();
|
||||||
|
|
||||||
const componentRef = viewContainerRef.createComponent<AdComponent>(componentFactory);
|
const componentRef = viewContainerRef.createComponent(componentFactory);
|
||||||
componentRef.instance.data = adItem.data;
|
(<AdComponent>componentRef.instance).data = adItem.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
getAds() {
|
getAds() {
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
// tslint:disable: directive-selector
|
|
||||||
// #docregion
|
// #docregion
|
||||||
import { Directive, ViewContainerRef } from '@angular/core';
|
import { Directive, ViewContainerRef } from '@angular/core';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[adHost]',
|
selector: '[ad-host]',
|
||||||
})
|
})
|
||||||
export class AdDirective {
|
export class AdDirective {
|
||||||
constructor(public viewContainerRef: ViewContainerRef) { }
|
constructor(public viewContainerRef: ViewContainerRef) { }
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, element, by } from 'protractor';
|
import { browser, element, by } from 'protractor';
|
||||||
|
|
||||||
/* tslint:disable:quotemark */
|
/* tslint:disable:quotemark */
|
||||||
describe('Dynamic Form', () => {
|
describe('Dynamic Form', function () {
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should submit form', () => {
|
it('should submit form', function () {
|
||||||
const firstNameElement = element.all(by.css('input[id=firstName]')).get(0);
|
let firstNameElement = element.all(by.css('input[id=firstName]')).get(0);
|
||||||
expect(firstNameElement.getAttribute('value')).toEqual('Bombasto');
|
expect(firstNameElement.getAttribute('value')).toEqual('Bombasto');
|
||||||
|
|
||||||
const emailElement = element.all(by.css('input[id=emailAddress]')).get(0);
|
let emailElement = element.all(by.css('input[id=emailAddress]')).get(0);
|
||||||
const email = 'test@test.com';
|
let email = 'test@test.com';
|
||||||
emailElement.sendKeys(email);
|
emailElement.sendKeys(email);
|
||||||
expect(emailElement.getAttribute('value')).toEqual(email);
|
expect(emailElement.getAttribute('value')).toEqual(email);
|
||||||
|
|
||||||
element(by.css('select option[value="solid"]')).click();
|
element(by.css('select option[value="solid"]')).click();
|
||||||
|
|
||||||
const saveButton = element.all(by.css('button')).get(0);
|
let saveButton = element.all(by.css('button')).get(0);
|
||||||
saveButton.click().then(() => {
|
saveButton.click().then(function() {
|
||||||
expect(element(by.xpath("//strong[contains(text(),'Saved the following values')]")).isPresent()).toBe(true);
|
expect(element(by.xpath("//strong[contains(text(),'Saved the following values')]")).isPresent()).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -10,14 +10,13 @@ export class QuestionBase<T> {
|
|||||||
options: {key: string, value: string}[];
|
options: {key: string, value: string}[];
|
||||||
|
|
||||||
constructor(options: {
|
constructor(options: {
|
||||||
value?: T;
|
value?: T,
|
||||||
key?: string;
|
key?: string,
|
||||||
label?: string;
|
label?: string,
|
||||||
required?: boolean;
|
required?: boolean,
|
||||||
order?: number;
|
order?: number,
|
||||||
controlType?: string;
|
controlType?: string,
|
||||||
type?: string;
|
type?: string
|
||||||
options?: {key: string, value: string}[];
|
|
||||||
} = {}) {
|
} = {}) {
|
||||||
this.value = options.value;
|
this.value = options.value;
|
||||||
this.key = options.key || '';
|
this.key = options.key || '';
|
||||||
@ -26,6 +25,5 @@ export class QuestionBase<T> {
|
|||||||
this.order = options.order === undefined ? 1 : options.order;
|
this.order = options.order === undefined ? 1 : options.order;
|
||||||
this.controlType = options.controlType || '';
|
this.controlType = options.controlType || '';
|
||||||
this.type = options.type || '';
|
this.type = options.type || '';
|
||||||
this.options = options.options || [];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ export class QuestionControlService {
|
|||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
toFormGroup(questions: QuestionBase<string>[] ) {
|
toFormGroup(questions: QuestionBase<string>[] ) {
|
||||||
const group: any = {};
|
let group: any = {};
|
||||||
|
|
||||||
questions.forEach(question => {
|
questions.forEach(question => {
|
||||||
group[question.key] = question.required ? new FormControl(question.value || '', Validators.required)
|
group[question.key] = question.required ? new FormControl(question.value || '', Validators.required)
|
||||||
|
@ -3,4 +3,10 @@ import { QuestionBase } from './question-base';
|
|||||||
|
|
||||||
export class DropdownQuestion extends QuestionBase<string> {
|
export class DropdownQuestion extends QuestionBase<string> {
|
||||||
controlType = 'dropdown';
|
controlType = 'dropdown';
|
||||||
|
options: {key: string, value: string}[] = [];
|
||||||
|
|
||||||
|
constructor(options: {} = {}) {
|
||||||
|
super(options);
|
||||||
|
this.options = options['options'] || [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,4 +3,10 @@ import { QuestionBase } from './question-base';
|
|||||||
|
|
||||||
export class TextboxQuestion extends QuestionBase<string> {
|
export class TextboxQuestion extends QuestionBase<string> {
|
||||||
controlType = 'textbox';
|
controlType = 'textbox';
|
||||||
|
type: string;
|
||||||
|
|
||||||
|
constructor(options: {} = {}) {
|
||||||
|
super(options);
|
||||||
|
this.type = options['type'] || '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ export class QuestionService {
|
|||||||
// TODO: get from a remote source of question metadata
|
// TODO: get from a remote source of question metadata
|
||||||
getQuestions() {
|
getQuestions() {
|
||||||
|
|
||||||
const questions: QuestionBase<string>[] = [
|
let questions: QuestionBase<string>[] = [
|
||||||
|
|
||||||
new DropdownQuestion({
|
new DropdownQuestion({
|
||||||
key: 'brave',
|
key: 'brave',
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
import { browser, by, element, ElementFinder, ExpectedConditions as EC } from 'protractor';
|
import { browser, by, element, ElementFinder, ExpectedConditions as EC } from 'protractor';
|
||||||
|
|
||||||
/* tslint:disable:quotemark */
|
/* tslint:disable:quotemark */
|
||||||
@ -14,7 +16,7 @@ describe('Elements', () => {
|
|||||||
const waitForText = (elem: ElementFinder) => {
|
const waitForText = (elem: ElementFinder) => {
|
||||||
// Waiting for the element to have some text, makes the tests less flaky.
|
// Waiting for the element to have some text, makes the tests less flaky.
|
||||||
browser.wait(async () => /\S/.test(await elem.getText()), 5000);
|
browser.wait(async () => /\S/.test(await elem.getText()), 5000);
|
||||||
};
|
}
|
||||||
|
|
||||||
beforeEach(() => browser.get(''));
|
beforeEach(() => browser.get(''));
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
// tslint:disable: variable-name
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
// #docregion
|
|
||||||
import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
|
|
||||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -9,6 +7,9 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
|||||||
<span>Popup: {{message}}</span>
|
<span>Popup: {{message}}</span>
|
||||||
<button (click)="closed.next()">✖</button>
|
<button (click)="closed.next()">✖</button>
|
||||||
`,
|
`,
|
||||||
|
host: {
|
||||||
|
'[@state]': 'state',
|
||||||
|
},
|
||||||
animations: [
|
animations: [
|
||||||
trigger('state', [
|
trigger('state', [
|
||||||
state('opened', style({transform: 'translateY(0%)'})),
|
state('opened', style({transform: 'translateY(0%)'})),
|
||||||
@ -38,16 +39,15 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
|||||||
`]
|
`]
|
||||||
})
|
})
|
||||||
export class PopupComponent {
|
export class PopupComponent {
|
||||||
@HostBinding('@state')
|
|
||||||
state: 'opened' | 'closed' = 'closed';
|
state: 'opened' | 'closed' = 'closed';
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
get message(): string { return this._message; }
|
|
||||||
set message(message: string) {
|
set message(message: string) {
|
||||||
this._message = message;
|
this._message = message;
|
||||||
this.state = 'opened';
|
this.state = 'opened';
|
||||||
}
|
}
|
||||||
private _message: string;
|
get message(): string { return this._message; }
|
||||||
|
_message: string;
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
closed = new EventEmitter();
|
closed = new EventEmitter();
|
||||||
|
@ -1,24 +1,26 @@
|
|||||||
import { browser, element, by } from 'protractor';
|
'use strict'; // necessary for es6 output in node
|
||||||
|
|
||||||
describe('Event binding example', () => {
|
import { browser, element, by, protractor } from 'protractor';
|
||||||
|
|
||||||
beforeEach(() => {
|
describe('Event binding example', function () {
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
const saveButton = element.all(by.css('button')).get(0);
|
let saveButton = element.all(by.css('button')).get(0);
|
||||||
const onSaveButton = element.all(by.css('button')).get(1);
|
let onSaveButton = element.all(by.css('button')).get(1);
|
||||||
const myClick = element.all(by.css('button')).get(2);
|
let myClick = element.all(by.css('button')).get(2);
|
||||||
const deleteButton = element.all(by.css('button')).get(3);
|
let deleteButton = element.all(by.css('button')).get(3);
|
||||||
const saveNoProp = element.all(by.css('button')).get(4);
|
let saveNoProp = element.all(by.css('button')).get(4);
|
||||||
const saveProp = element.all(by.css('button')).get(5);
|
let saveProp = element.all(by.css('button')).get(5);
|
||||||
|
|
||||||
|
|
||||||
it('should display Event Binding with Angular', () => {
|
it('should display Event Binding with Angular', function () {
|
||||||
expect(element(by.css('h1')).getText()).toEqual('Event Binding');
|
expect(element(by.css('h1')).getText()).toEqual('Event Binding');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should display 6 buttons', () => {
|
it('should display 6 buttons', function() {
|
||||||
expect(saveButton.getText()).toBe('Save');
|
expect(saveButton.getText()).toBe('Save');
|
||||||
expect(onSaveButton.getText()).toBe('on-click Save');
|
expect(onSaveButton.getText()).toBe('on-click Save');
|
||||||
expect(myClick.getText()).toBe('click with myClick');
|
expect(myClick.getText()).toBe('click with myClick');
|
||||||
@ -27,23 +29,24 @@ describe('Event binding example', () => {
|
|||||||
expect(saveProp.getText()).toBe('Save with propagation');
|
expect(saveProp.getText()).toBe('Save with propagation');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support user input', () => {
|
it('should support user input', function () {
|
||||||
const input = element(by.css('input'));
|
let input = element(by.css('input'));
|
||||||
const bindingResult = element.all(by.css('h4')).get(1);
|
let bindingResult = element.all(by.css('h4')).get(1);
|
||||||
expect(bindingResult.getText()).toEqual('Result: teapot');
|
expect(bindingResult.getText()).toEqual('Result: teapot');
|
||||||
input.sendKeys('abc');
|
input.sendKeys('abc');
|
||||||
expect(bindingResult.getText()).toEqual('Result: teapotabc');
|
expect(bindingResult.getText()).toEqual('Result: teapotabc');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should hide the item img', async () => {
|
it('should hide the item img', async () => {
|
||||||
|
let deleteButton = element.all(by.css('button')).get(3);
|
||||||
await deleteButton.click();
|
await deleteButton.click();
|
||||||
browser.switchTo().alert().accept();
|
browser.switchTo().alert().accept();
|
||||||
expect(element.all(by.css('img')).get(0).getCssValue('display')).toEqual('none');
|
expect(element.all(by.css('img')).get(0).getCssValue('display')).toEqual('none');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show two alerts', async () => {
|
it('should show two alerts', async () => {
|
||||||
const parentDiv = element.all(by.css('.parent-div'));
|
let parentDiv = element.all(by.css('.parent-div'));
|
||||||
const childDiv = element.all(by.css('div > div')).get(1);
|
let childDiv = element.all(by.css('div > div')).get(1);
|
||||||
await parentDiv.click();
|
await parentDiv.click();
|
||||||
browser.switchTo().alert().accept();
|
browser.switchTo().alert().accept();
|
||||||
expect(childDiv.getText()).toEqual('Click me too! (child)');
|
expect(childDiv.getText()).toEqual('Click me too! (child)');
|
||||||
|
@ -12,7 +12,7 @@ export class AppComponent {
|
|||||||
clickMessage = '';
|
clickMessage = '';
|
||||||
|
|
||||||
onSave(event?: KeyboardEvent) {
|
onSave(event?: KeyboardEvent) {
|
||||||
const evtMsg = event ? ' Event target is ' + (event.target as HTMLElement).textContent : '';
|
const evtMsg = event ? ' Event target is ' + (<HTMLElement>event.target).textContent : '';
|
||||||
alert('Saved.' + evtMsg);
|
alert('Saved.' + evtMsg);
|
||||||
if (event) { event.stopPropagation(); }
|
if (event) { event.stopPropagation(); }
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ export class AppComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClickMe(event?: KeyboardEvent) {
|
onClickMe(event?: KeyboardEvent) {
|
||||||
const evtMsg = event ? ' Event target class is ' + (event.target as HTMLElement).className : '';
|
const evtMsg = event ? ' Event target class is ' + (<HTMLElement>event.target).className : '';
|
||||||
alert('Click me.' + evtMsg);
|
alert('Click me.' + evtMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// tslint:disable: directive-selector
|
/* tslint:disable use-output-property-decorator directive-class-suffix */
|
||||||
import { Directive, ElementRef, EventEmitter, Output } from '@angular/core';
|
import { Directive, ElementRef, EventEmitter, Output } from '@angular/core';
|
||||||
|
|
||||||
@Directive({selector: '[myClick]'})
|
@Directive({selector: '[myClick]'})
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
'use strict'; // necessary for node!
|
||||||
|
|
||||||
import { browser, element, by, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
|
import { browser, element, by, protractor, ElementFinder, ElementArrayFinder } from 'protractor';
|
||||||
|
|
||||||
// THESE TESTS ARE INCOMPLETE
|
// THESE TESTS ARE INCOMPLETE
|
||||||
describe('Form Validation Tests', () => {
|
describe('Form Validation Tests', function () {
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(function () {
|
||||||
browser.get('');
|
browser.get('');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -50,11 +52,11 @@ let page: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function getPage(sectionTag: string) {
|
function getPage(sectionTag: string) {
|
||||||
const section = element(by.css(sectionTag));
|
let section = element(by.css(sectionTag));
|
||||||
const buttons = section.all(by.css('button'));
|
let buttons = section.all(by.css('button'));
|
||||||
|
|
||||||
page = {
|
page = {
|
||||||
section,
|
section: section,
|
||||||
form: section.element(by.css('form')),
|
form: section.element(by.css('form')),
|
||||||
title: section.element(by.css('h1')),
|
title: section.element(by.css('h1')),
|
||||||
nameInput: section.element(by.css('#name')),
|
nameInput: section.element(by.css('#name')),
|
||||||
@ -71,31 +73,31 @@ function getPage(sectionTag: string) {
|
|||||||
|
|
||||||
function tests(title: string) {
|
function tests(title: string) {
|
||||||
|
|
||||||
it('should display correct title', () => {
|
it('should display correct title', function () {
|
||||||
expect(page.title.getText()).toContain(title);
|
expect(page.title.getText()).toContain(title);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not display submitted message before submit', () => {
|
it('should not display submitted message before submit', function () {
|
||||||
expect(page.heroSubmitted.isElementPresent(by.css('p'))).toBe(false);
|
expect(page.heroSubmitted.isElementPresent(by.css('p'))).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have form buttons', () => {
|
it('should have form buttons', function () {
|
||||||
expect(page.heroFormButtons.count()).toEqual(2);
|
expect(page.heroFormButtons.count()).toEqual(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have error at start', () => {
|
it('should have error at start', function () {
|
||||||
expectFormIsInvalid();
|
expectFormIsInvalid();
|
||||||
});
|
});
|
||||||
|
|
||||||
// it('showForm', () => {
|
// it('showForm', function () {
|
||||||
// page.form.getInnerHtml().then(html => console.log(html));
|
// page.form.getInnerHtml().then(html => console.log(html));
|
||||||
// });
|
// });
|
||||||
|
|
||||||
it('should have disabled submit button', () => {
|
it('should have disabled submit button', function () {
|
||||||
expect(page.heroFormButtons.get(0).isEnabled()).toBe(false);
|
expect(page.heroFormButtons.get(0).isEnabled()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('resetting name to valid name should clear errors', () => {
|
it('resetting name to valid name should clear errors', function () {
|
||||||
const ele = page.nameInput;
|
const ele = page.nameInput;
|
||||||
expect(ele.isPresent()).toBe(true, 'nameInput should exist');
|
expect(ele.isPresent()).toBe(true, 'nameInput should exist');
|
||||||
ele.clear();
|
ele.clear();
|
||||||
@ -103,7 +105,7 @@ function tests(title: string) {
|
|||||||
expectFormIsValid();
|
expectFormIsValid();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should produce "required" error after clearing name', () => {
|
it('should produce "required" error after clearing name', function () {
|
||||||
page.nameInput.clear();
|
page.nameInput.clear();
|
||||||
// page.alterEgoInput.click(); // to blur ... didn't work
|
// page.alterEgoInput.click(); // to blur ... didn't work
|
||||||
page.nameInput.sendKeys('x', protractor.Key.BACK_SPACE); // ugh!
|
page.nameInput.sendKeys('x', protractor.Key.BACK_SPACE); // ugh!
|
||||||
@ -111,37 +113,37 @@ function tests(title: string) {
|
|||||||
expect(page.errorMessages.get(0).getText()).toContain('required');
|
expect(page.errorMessages.get(0).getText()).toContain('required');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should produce "at least 4 characters" error when name="x"', () => {
|
it('should produce "at least 4 characters" error when name="x"', function () {
|
||||||
page.nameInput.clear();
|
page.nameInput.clear();
|
||||||
page.nameInput.sendKeys('x'); // too short
|
page.nameInput.sendKeys('x'); // too short
|
||||||
expectFormIsInvalid();
|
expectFormIsInvalid();
|
||||||
expect(page.errorMessages.get(0).getText()).toContain('at least 4 characters');
|
expect(page.errorMessages.get(0).getText()).toContain('at least 4 characters');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('resetting name to valid name again should clear errors', () => {
|
it('resetting name to valid name again should clear errors', function () {
|
||||||
page.nameInput.sendKeys(testName);
|
page.nameInput.sendKeys(testName);
|
||||||
expectFormIsValid();
|
expectFormIsValid();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have enabled submit button', () => {
|
it('should have enabled submit button', function () {
|
||||||
const submitBtn = page.heroFormButtons.get(0);
|
const submitBtn = page.heroFormButtons.get(0);
|
||||||
expect(submitBtn.isEnabled()).toBe(true);
|
expect(submitBtn.isEnabled()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should hide form after submit', () => {
|
it('should hide form after submit', function () {
|
||||||
page.heroFormButtons.get(0).click();
|
page.heroFormButtons.get(0).click();
|
||||||
expect(page.heroFormButtons.get(0).isDisplayed()).toBe(false);
|
expect(page.heroFormButtons.get(0).isDisplayed()).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('submitted form should be displayed', () => {
|
it('submitted form should be displayed', function () {
|
||||||
expect(page.heroSubmitted.isElementPresent(by.css('p'))).toBe(true);
|
expect(page.heroSubmitted.isElementPresent(by.css('p'))).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('submitted form should have new hero name', () => {
|
it('submitted form should have new hero name', function () {
|
||||||
expect(page.heroSubmitted.getText()).toContain(testName);
|
expect(page.heroSubmitted.getText()).toContain(testName);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('clicking edit button should reveal form again', () => {
|
it('clicking edit button should reveal form again', function () {
|
||||||
const newFormBtn = page.heroSubmitted.element(by.css('button'));
|
const newFormBtn = page.heroSubmitted.element(by.css('button'));
|
||||||
newFormBtn.click();
|
newFormBtn.click();
|
||||||
expect(page.heroSubmitted.isElementPresent(by.css('p')))
|
expect(page.heroSubmitted.isElementPresent(by.css('p')))
|
||||||
@ -160,7 +162,7 @@ function expectFormIsInvalid() {
|
|||||||
|
|
||||||
function triggerAlterEgoValidation() {
|
function triggerAlterEgoValidation() {
|
||||||
// alterEgo has updateOn set to 'blur', click outside of the input to trigger the blur event
|
// alterEgo has updateOn set to 'blur', click outside of the input to trigger the blur event
|
||||||
element(by.css('app-root')).click();
|
element(by.css('app-root')).click()
|
||||||
}
|
}
|
||||||
|
|
||||||
function waitForAlterEgoValidation() {
|
function waitForAlterEgoValidation() {
|
||||||
@ -171,7 +173,7 @@ function waitForAlterEgoValidation() {
|
|||||||
function bobTests() {
|
function bobTests() {
|
||||||
const emsg = 'Name cannot be Bob.';
|
const emsg = 'Name cannot be Bob.';
|
||||||
|
|
||||||
it('should produce "no bob" error after setting name to "Bobby"', () => {
|
it('should produce "no bob" error after setting name to "Bobby"', function () {
|
||||||
// Re-populate select element
|
// Re-populate select element
|
||||||
page.powerSelect.click();
|
page.powerSelect.click();
|
||||||
page.powerOption.click();
|
page.powerOption.click();
|
||||||
@ -182,7 +184,7 @@ function bobTests() {
|
|||||||
expect(page.errorMessages.get(0).getText()).toBe(emsg);
|
expect(page.errorMessages.get(0).getText()).toBe(emsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be ok again with valid name', () => {
|
it('should be ok again with valid name', function () {
|
||||||
page.nameInput.clear();
|
page.nameInput.clear();
|
||||||
page.nameInput.sendKeys(testName);
|
page.nameInput.sendKeys(testName);
|
||||||
expectFormIsValid();
|
expectFormIsValid();
|
||||||
@ -192,7 +194,7 @@ function bobTests() {
|
|||||||
function asyncValidationTests() {
|
function asyncValidationTests() {
|
||||||
const emsg = 'Alter ego is already taken.';
|
const emsg = 'Alter ego is already taken.';
|
||||||
|
|
||||||
it(`should produce "${emsg}" error after setting alterEgo to Eric`, () => {
|
it(`should produce "${emsg}" error after setting alterEgo to Eric`, function () {
|
||||||
page.alterEgoInput.clear();
|
page.alterEgoInput.clear();
|
||||||
page.alterEgoInput.sendKeys('Eric');
|
page.alterEgoInput.sendKeys('Eric');
|
||||||
|
|
||||||
@ -203,7 +205,7 @@ function asyncValidationTests() {
|
|||||||
expect(page.alterEgoErrors.getText()).toBe(emsg);
|
expect(page.alterEgoErrors.getText()).toBe(emsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be ok again with different values', () => {
|
it('should be ok again with different values', function () {
|
||||||
page.alterEgoInput.clear();
|
page.alterEgoInput.clear();
|
||||||
page.alterEgoInput.sendKeys('John');
|
page.alterEgoInput.sendKeys('John');
|
||||||
|
|
||||||
@ -218,7 +220,7 @@ function asyncValidationTests() {
|
|||||||
function crossValidationTests() {
|
function crossValidationTests() {
|
||||||
const emsg = 'Name cannot match alter ego.';
|
const emsg = 'Name cannot match alter ego.';
|
||||||
|
|
||||||
it(`should produce "${emsg}" error after setting name and alter ego to the same value`, () => {
|
it(`should produce "${emsg}" error after setting name and alter ego to the same value`, function () {
|
||||||
page.nameInput.clear();
|
page.nameInput.clear();
|
||||||
page.nameInput.sendKeys('Batman');
|
page.nameInput.sendKeys('Batman');
|
||||||
|
|
||||||
@ -232,7 +234,7 @@ function crossValidationTests() {
|
|||||||
expect(page.crossValidationErrorMessage.getText()).toBe(emsg);
|
expect(page.crossValidationErrorMessage.getText()).toBe(emsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be ok again with different values', () => {
|
it('should be ok again with different values', function () {
|
||||||
page.nameInput.clear();
|
page.nameInput.clear();
|
||||||
page.nameInput.sendKeys('Batman');
|
page.nameInput.sendKeys('Batman');
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user