Compare commits
391 Commits
7.0.0-rc.1
...
6.1.x
Author | SHA1 | Date | |
---|---|---|---|
79fb9d449c | |||
73a93d3ab6 | |||
8eda5a152b | |||
7b82ce0c67 | |||
2eb5fe699f | |||
f99febcdf9 | |||
36cbfb1771 | |||
1f5315f6f7 | |||
eeebe621fe | |||
05f279df49 | |||
485d67bfed | |||
a1592f5a20 | |||
a251374ecd | |||
2b00c17091 | |||
81724f5790 | |||
1f06b6c99b | |||
6790709b93 | |||
9f7f67121c | |||
db49beae15 | |||
97609daea9 | |||
abcb03cb82 | |||
4f09f7db73 | |||
f1e14a3224 | |||
50de03a83a | |||
65555fe35d | |||
6da3867d63 | |||
c9488b5432 | |||
b22c376123 | |||
8a6f3723ca | |||
ccb0ec9c35 | |||
0c9a087809 | |||
2515ff660b | |||
70c79cb969 | |||
ed04e99c95 | |||
623adbbdf7 | |||
3660ff80b7 | |||
3b4d9dc576 | |||
8c6c2fc80d | |||
3886bfadb0 | |||
b35ab4f0e6 | |||
39d979c5fa | |||
ff980032e7 | |||
2fe401dfbb | |||
b4421bb96b | |||
ecb28bf5aa | |||
5c5164b6e7 | |||
b8a081a8a5 | |||
59d80c471a | |||
9e5b0794c5 | |||
1c1fd98591 | |||
d815e4137f | |||
fe0c5bfdb3 | |||
1975c0a4d2 | |||
efde073ab9 | |||
a68c29da4b | |||
becb775d08 | |||
a273491be0 | |||
7d45386262 | |||
82fcb325a1 | |||
115c874779 | |||
8cbebc673d | |||
94b2673c1f | |||
bc73dcb448 | |||
fefa171d83 | |||
5c84b91543 | |||
00b37310e1 | |||
bc27b95771 | |||
31f352c043 | |||
ad62eaa612 | |||
66c2d089f0 | |||
c1bf82adb9 | |||
c05d24e0fe | |||
adbb920ae8 | |||
f871fecf66 | |||
9f919f762a | |||
6df45a6d47 | |||
71128e2392 | |||
38980f1813 | |||
76f30524be | |||
721343349b | |||
4c19a2dba9 | |||
4aacbbe04b | |||
19c2d5b3d4 | |||
2f79aab084 | |||
63b178ec3d | |||
a48bf0bdb6 | |||
22dc8adae5 | |||
04a023c31a | |||
c12e553ff1 | |||
c8eb6182bc | |||
0a7a542edd | |||
9d7ad34873 | |||
63c2a2a74a | |||
2e0de01372 | |||
88e080003d | |||
8a62f0a36c | |||
6c8863aa09 | |||
fe92614c91 | |||
166bb8e048 | |||
c7da5d8cfd | |||
153738dce9 | |||
ce4aa5cb93 | |||
0647582292 | |||
c5620d1c7a | |||
e3a73dff45 | |||
5881f34787 | |||
acffa22a35 | |||
159e8b4fda | |||
d52dd0a8d1 | |||
05252769bf | |||
9c36a3520d | |||
1b282c278f | |||
c9fece997c | |||
c8817f39a9 | |||
2f1aec4744 | |||
e55127906a | |||
789ff49bcf | |||
df02d6dd86 | |||
fb8028a130 | |||
29647bb815 | |||
2911e99baf | |||
3952367bf3 | |||
ea6aade4ce | |||
26baf15b12 | |||
25c5cba7b3 | |||
fb06037392 | |||
90f8a1622e | |||
8c9edb8484 | |||
52cd20d4fe | |||
c7567b65f2 | |||
0fdd1bb929 | |||
559c647db7 | |||
42e2e7cf57 | |||
adad1706e0 | |||
a169743324 | |||
cea7fbe93f | |||
b907e5a2bc | |||
77d2cbda4a | |||
a730fc703f | |||
af26914ba9 | |||
7f7bc64186 | |||
33af76929f | |||
edbf3d2fe3 | |||
a39445fe09 | |||
0b05448a7d | |||
852a73ef82 | |||
b8bfc03875 | |||
c4887ab10a | |||
1abd3977be | |||
98961e3d44 | |||
3f89d3094b | |||
484d3d9a64 | |||
37f3b92ff5 | |||
50cd655c6c | |||
05d1b84f52 | |||
69452231df | |||
4f6bef5b32 | |||
ec96332559 | |||
ee9f0b5d9a | |||
a135f48b6d | |||
61b4c26893 | |||
f1cb46081c | |||
0ec925bd2f | |||
5f1b861525 | |||
f0d70545e8 | |||
26341c7fd4 | |||
e9f4f1b416 | |||
9cd534bd63 | |||
2f8e1fbab8 | |||
c7a6adc771 | |||
8fb2b473ca | |||
5886090d50 | |||
3988ebf432 | |||
5099b79545 | |||
038d06d2e9 | |||
9e1aff9fe6 | |||
a41f331cb4 | |||
71628f1837 | |||
df878a6b60 | |||
48d7f4e8b5 | |||
66f5d27e50 | |||
91dd160b21 | |||
1c44b71fd2 | |||
a5e0ae501d | |||
2d0e642dbe | |||
9ea656f20e | |||
97ae7aed41 | |||
678b4209c8 | |||
b7be4f55be | |||
e7c72ab556 | |||
af785f9e91 | |||
1ac5d68827 | |||
2c987625ae | |||
a77f567403 | |||
110c81f359 | |||
ef4b5c7e59 | |||
c69362442d | |||
6c8791ee32 | |||
274dc1e972 | |||
d9bd86050b | |||
076374ba4f | |||
e117b1ffd2 | |||
8d7fbb614b | |||
a31cfc521c | |||
55a1ce7adf | |||
9f3da659aa | |||
8f9aeaaa67 | |||
b9a5ce1c06 | |||
f67229efa3 | |||
f707f545aa | |||
62f4ea5f0f | |||
ecc3406ca6 | |||
e244b5180e | |||
f85d3d7857 | |||
b404d47b16 | |||
815d1ffa19 | |||
d1063c62b3 | |||
3a0b7355e5 | |||
3bdd4e249f | |||
2c1f55069f | |||
e72f741e78 | |||
f0bcfd0e78 | |||
82e06766b8 | |||
eea1600a38 | |||
8f8c390c75 | |||
23a96dca2d | |||
6f7df8a1fa | |||
92298e5271 | |||
27f0817000 | |||
4596fc0217 | |||
46de203f85 | |||
d752a8907b | |||
4fe369e188 | |||
d8930bbdc2 | |||
ad7be5087c | |||
a4405d7c6f | |||
88f7ddb27d | |||
98f5acebdb | |||
ff78149ec2 | |||
66b7870da7 | |||
82088a8489 | |||
ebcf762132 | |||
ed6b68babf | |||
2e09115c0c | |||
4a8d56a820 | |||
0a3dd872e3 | |||
3e690e0062 | |||
7f8d6c1066 | |||
c6d502f7f8 | |||
7aff3641a1 | |||
2194b5a5c3 | |||
8a35290686 | |||
e40519c32a | |||
b560189c0e | |||
59cfc8a729 | |||
72ed2e90d0 | |||
4e82a76998 | |||
51d5b433d0 | |||
cc0d0a9d1e | |||
82f26fe5f5 | |||
8de57c9887 | |||
ace4e4ffa5 | |||
1fa97903a3 | |||
7e61645b82 | |||
46b0ce9fc6 | |||
78750a7fec | |||
77d9975eb2 | |||
7eed4ee837 | |||
292b435495 | |||
5939c420ce | |||
a5cc9dbb53 | |||
2b810a4e57 | |||
2acf369664 | |||
860b79289f | |||
b519d41f42 | |||
faf184ad63 | |||
1e0f455855 | |||
ced30982df | |||
fed429b0cc | |||
9cb3107dda | |||
548a972c2a | |||
20dcc25eed | |||
620d1402fe | |||
36fb4f4fdb | |||
ea83445149 | |||
1319ff4376 | |||
9c1311c801 | |||
2ce93482b9 | |||
ed2a47f822 | |||
cdee9add01 | |||
2f85b1691a | |||
bf441e8b9e | |||
1c86e9b3b2 | |||
9d6e869899 | |||
e906bf4f31 | |||
5f08bdf8b9 | |||
f1ed022a4d | |||
151e4b9fcc | |||
d0f089a55d | |||
cb05f9bbe9 | |||
fda30cb3e3 | |||
2951e721df | |||
3449f1e256 | |||
6480d1b288 | |||
e76211aa32 | |||
a16de8f842 | |||
24f1dd3b81 | |||
f39551ce7e | |||
3beb7116af | |||
4b1a825efc | |||
01e62551f5 | |||
2f23533a25 | |||
054fbbe8b8 | |||
155d938e04 | |||
94a2ac7884 | |||
b75a98522a | |||
d7dc1b5e44 | |||
e075ea7ae7 | |||
415519acd3 | |||
8cbb836985 | |||
8d0f8bd657 | |||
66547d8fd0 | |||
6e7d5f0925 | |||
29dfa5570a | |||
0c028a03ec | |||
a54c049051 | |||
40904ce0c4 | |||
88f01f5653 | |||
c66794c265 | |||
e4acd83541 | |||
a57f8a1301 | |||
ae9b4e6fa7 | |||
478eca31c7 | |||
2e1603938c | |||
0c9c2accc2 | |||
0fb41e5ced | |||
3f43dbb642 | |||
5069c06906 | |||
58698d7806 | |||
e26c25a062 | |||
0a6434b066 | |||
ff3550c304 | |||
6d4a14082c | |||
9ddf269c2c | |||
25a76a1492 | |||
8439a6ec2a | |||
1ef2eae3aa | |||
d5d034a0ff | |||
5ca35b3cd2 | |||
0a6a3f3163 | |||
3a601382e6 | |||
7a1fdde69e | |||
cbc2ea1b1a | |||
bdf801b0e8 | |||
fe5e8b7177 | |||
11f0f98ad8 | |||
801b534421 | |||
0fc83215e2 | |||
3d3a1a4642 | |||
32a40ba5de | |||
045271230d | |||
ec31f6bf9a | |||
4798d77088 | |||
08c6762039 | |||
26516045e7 | |||
a83b9f7911 | |||
1b7c77e49f | |||
3ab31a4be6 | |||
43dcf77123 | |||
d4bf2da3bd | |||
fa3882845a | |||
fa59748e00 | |||
c38ecb3b5b | |||
875efa8492 | |||
74964bde99 | |||
785fb5cc5a | |||
26d9f0278b | |||
22ebd53c17 | |||
a972c039c3 | |||
f5e18029fa | |||
317c7087c5 | |||
39abe7b7c1 | |||
36a7705a44 | |||
50a21885cf | |||
e86f3d9a49 | |||
738f2961ba | |||
f2bf8287ba | |||
9d5b34e1e7 | |||
d237f4014a | |||
8743a9bfd6 | |||
514d03f2d0 |
@ -20,6 +20,18 @@ build --announce_rc
|
||||
# We use this when uploading artifacts after the build finishes
|
||||
build --symlink_prefix=dist/
|
||||
|
||||
# Enable experimental CircleCI bazel remote cache proxy
|
||||
# See remote cache documentation in /docs/BAZEL.md
|
||||
build --experimental_remote_spawn_cache --remote_rest_cache=http://localhost:7643
|
||||
|
||||
# Prevent unstable environment variables from tainting cache keys
|
||||
build --experimental_strict_action_env
|
||||
|
||||
# Save downloaded repositories such as the go toolchain
|
||||
# This directory can then be included in the CircleCI cache
|
||||
# It should save time running the first build
|
||||
build --experimental_repository_cache=/home/circleci/bazel_repository_cache
|
||||
|
||||
# Workaround https://github.com/bazelbuild/bazel/issues/3645
|
||||
# Bazel doesn't calculate the memory ceiling correctly when running under Docker.
|
||||
# Limit Bazel to consuming resources that fit in CircleCI "xlarge" class
|
||||
@ -28,6 +40,3 @@ build --local_resources=14336,8.0,1.0
|
||||
|
||||
# Retry in the event of flakes, eg. https://circleci.com/gh/angular/angular/31309
|
||||
test --flaky_test_attempts=2
|
||||
|
||||
# More details on failures
|
||||
build --verbose_failures=true
|
||||
|
@ -26,11 +26,6 @@ var_4: &setup-bazel-remote-cache
|
||||
command: ~/bazel-remote-proxy -backend circleci://
|
||||
background: true
|
||||
|
||||
var_5: &setup_bazel_remote_execution
|
||||
run:
|
||||
name: "Setup bazel RBE remote execution"
|
||||
command: openssl aes-256-cbc -d -in .circleci/gcp_token -k "${CIRCLE_PROJECT_REPONAME}" -out /home/circleci/.gcp_credentials && echo "export GOOGLE_APPLICATION_CREDENTIALS=/home/circleci/.gcp_credentials" >> $BASH_ENV && sudo bash -c "cat .circleci/rbe-bazel.rc >> /etc/bazel.bazelrc"
|
||||
|
||||
# Settings common to each job
|
||||
anchor_1: &job_defaults
|
||||
working_directory: ~/ng
|
||||
@ -47,18 +42,19 @@ version: 2
|
||||
jobs:
|
||||
lint:
|
||||
<<: *job_defaults
|
||||
resource_class: xlarge
|
||||
steps:
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||
|
||||
# Check BUILD.bazel formatting before we have a node_modules directory
|
||||
# Then we don't need any exclude pattern to avoid checking those files
|
||||
- run: 'yarn buildifier -mode=check ||
|
||||
- run: 'buildifier -mode=check $(find . -type f \( -name "*.bzl" -or -name BUILD.bazel -or -name BUILD \)) ||
|
||||
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
|
||||
# Run the skylark linter to check our Bazel rules
|
||||
- run: 'yarn skylint ||
|
||||
# deprecated-api is disabled because we use actions.new_file(genfiles_dir)
|
||||
# which has no replacement, see https://github.com/bazelbuild/bazel/issues/4858
|
||||
- run: 'find . -type f -name "*.bzl" |
|
||||
xargs java -jar /usr/local/bin/Skylint_deploy.jar --disable-checks=deprecated-api ||
|
||||
(echo -e "\n.bzl files have lint errors. Please run ''yarn skylint''"; exit 1)'
|
||||
|
||||
- restore_cache:
|
||||
@ -74,20 +70,22 @@ jobs:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
# See remote cache documentation in /docs/BAZEL.md
|
||||
- run: .circleci/setup_cache.sh
|
||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||
- *setup-bazel-remote-cache
|
||||
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
|
||||
- run: ls /home/circleci/bazel_repository_cache || true
|
||||
- run: bazel info release
|
||||
- run: bazel run @nodejs//:yarn
|
||||
# Use bazel query so that we explicitly ask for all buildable targets to be built as well
|
||||
# This avoids waiting for the slowest build target to finish before running the first test
|
||||
# See https://github.com/bazelbuild/bazel/issues/4257
|
||||
# NOTE: Angular developers should typically just bazel build //packages/... or bazel test //packages/...
|
||||
# Setup remote execution and run RBE-compatible tests.
|
||||
- *setup_bazel_remote_execution
|
||||
- run: bazel query --output=label //... | xargs bazel test --build_tag_filters=-ivy-only --test_tag_filters=-manual,-ivy-only,-local
|
||||
# Now run RBE incompatible tests locally.
|
||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||
- run: bazel query --output=label //... | xargs bazel test --build_tag_filters=-ivy-only,local --test_tag_filters=-manual,-ivy-only,local
|
||||
- run: bazel query --output=label //... | xargs bazel test --build_tag_filters=-ivy-only --test_tag_filters=-manual,-ivy-only
|
||||
|
||||
# CircleCI will allow us to go back and view/download these artifacts from past builds.
|
||||
# Also we can use a service like https://buildsize.org/ to automatically track binary size of these artifacts.
|
||||
@ -121,10 +119,15 @@ jobs:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
# See remote cache documentation in /docs/BAZEL.md
|
||||
- run: .circleci/setup_cache.sh
|
||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||
- *setup-bazel-remote-cache
|
||||
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
|
||||
- run: bazel run @yarn//:yarn
|
||||
- *setup_bazel_remote_execution
|
||||
- run: bazel query --output=label //... | xargs bazel test --define=compile=jit --build_tag_filters=ivy-jit --test_tag_filters=-manual,ivy-jit
|
||||
|
||||
test_ivy_aot:
|
||||
@ -134,10 +137,15 @@ jobs:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
# See remote cache documentation in /docs/BAZEL.md
|
||||
- run: .circleci/setup_cache.sh
|
||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||
- *setup-bazel-remote-cache
|
||||
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
|
||||
- run: bazel run @yarn//:yarn
|
||||
- *setup_bazel_remote_execution
|
||||
- run: bazel query --output=label //... | xargs bazel test --define=compile=local --build_tag_filters=ivy-local --test_tag_filters=-manual,ivy-local
|
||||
|
||||
# This job should only be run on PR builds, where `CIRCLE_PR_NUMBER` is defined.
|
||||
@ -187,9 +195,12 @@ jobs:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
# See remote cache documentation in /docs/BAZEL.md
|
||||
- run: .circleci/setup_cache.sh
|
||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||
- *setup-bazel-remote-cache
|
||||
|
||||
- run: bazel run @nodejs//:yarn
|
||||
- *setup_bazel_remote_execution
|
||||
- run: scripts/build-packages-dist.sh
|
||||
|
||||
# Save the npm packages from //packages/... for other workflow jobs to read
|
||||
@ -310,4 +321,4 @@ workflows:
|
||||
|
||||
notify:
|
||||
webhooks:
|
||||
- url: https://ngbuilds.io/circle-build
|
||||
- url: https://ngbuilds.io/circle-build
|
Binary file not shown.
@ -1,77 +0,0 @@
|
||||
# These options are enabled when running on CI with Remote Build Execution.
|
||||
|
||||
################################################################
|
||||
# Toolchain related flags for remote build execution. #
|
||||
################################################################
|
||||
# Remote Build Execution requires a strong hash function, such as SHA256.
|
||||
startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
|
||||
|
||||
# Depending on how many machines are in the remote execution instance, setting
|
||||
# this higher can make builds faster by allowing more jobs to run in parallel.
|
||||
# Setting it too high can result in jobs that timeout, however, while waiting
|
||||
# for a remote machine to execute them.
|
||||
build --jobs=150
|
||||
|
||||
# Set several flags related to specifying the platform, toolchain and java
|
||||
# properties.
|
||||
# These flags are duplicated rather than imported from (for example)
|
||||
# %workspace%/configs/ubuntu16_04_clang/1.0/toolchain.bazelrc to make this
|
||||
# bazelrc a standalone file that can be copied more easily.
|
||||
# These flags should only be used as is for the rbe-ubuntu16-04 container
|
||||
# and need to be adapted to work with other toolchain containers.
|
||||
build --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.0:jdk8
|
||||
build --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.0:jdk8
|
||||
build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
|
||||
build --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
|
||||
build --crosstool_top=@bazel_toolchains//configs/ubuntu16_04_clang/1.0/bazel_0.15.0/default:toolchain
|
||||
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
|
||||
# Platform flags:
|
||||
# The toolchain container used for execution is defined in the target indicated
|
||||
# by "extra_execution_platforms", "host_platform" and "platforms".
|
||||
# If you are using your own toolchain container, you need to create a platform
|
||||
# target with "constraint_values" that allow for the toolchain specified with
|
||||
# "extra_toolchains" to be selected (given constraints defined in
|
||||
# "exec_compatible_with").
|
||||
# More about platforms: https://docs.bazel.build/versions/master/platforms.html
|
||||
build --extra_toolchains=@bazel_toolchains//configs/ubuntu16_04_clang/1.0/bazel_0.15.0/cpp:cc-toolchain-clang-x86_64-default
|
||||
build --extra_execution_platforms=//tools:rbe_ubuntu1604-angular
|
||||
build --host_platform=//tools:rbe_ubuntu1604-angular
|
||||
build --platforms=//tools:rbe_ubuntu1604-angular
|
||||
|
||||
# Set various strategies so that all actions execute remotely. Mixing remote
|
||||
# and local execution will lead to errors unless the toolchain and remote
|
||||
# machine exactly match the host machine.
|
||||
build --spawn_strategy=remote
|
||||
build --strategy=Javac=remote
|
||||
build --strategy=Closure=remote
|
||||
build --genrule_strategy=remote
|
||||
build --define=EXECUTOR=remote
|
||||
|
||||
# Enable the remote cache so action results can be shared across machines,
|
||||
# developers, and workspaces.
|
||||
build --remote_cache=remotebuildexecution.googleapis.com
|
||||
|
||||
# Enable remote execution so actions are performed on the remote systems.
|
||||
build --remote_executor=remotebuildexecution.googleapis.com
|
||||
|
||||
# Remote instance.
|
||||
build --remote_instance_name=projects/internal-200822/instances/default_instance
|
||||
|
||||
# Enable encryption.
|
||||
build --tls_enabled=true
|
||||
|
||||
# Enforce stricter environment rules, which eliminates some non-hermetic
|
||||
# behavior and therefore improves both the remote cache hit rate and the
|
||||
# correctness and repeatability of the build.
|
||||
build --experimental_strict_action_env=true
|
||||
|
||||
# Set a higher timeout value, just in case.
|
||||
build --remote_timeout=3600
|
||||
|
||||
# Enable authentication. This will pick up application default credentials by
|
||||
# default. You can use --auth_credentials=some_file.json to use a service
|
||||
# account credential instead.
|
||||
build --auth_enabled=true
|
||||
|
||||
# Do not accept remote cache.
|
||||
build --remote_accept_cached=false
|
@ -56,6 +56,7 @@ env:
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- env: "CI_MODE=aio_local"
|
||||
- env: "CI_MODE=saucelabs_optional"
|
||||
- env: "CI_MODE=browserstack_optional"
|
||||
|
||||
|
156
CHANGELOG.md
156
CHANGELOG.md
@ -1,11 +1,3 @@
|
||||
<a name="7.0.0-rc.1"></a>
|
||||
# [7.0.0-rc.1](https://github.com/angular/angular/compare/7.0.0-rc.0...7.0.0-rc.1) (2018-10-10)
|
||||
|
||||
|
||||
This version includes Ivy features and internal refactorings. There are no user-facing changes.
|
||||
|
||||
|
||||
|
||||
<a name="6.1.10"></a>
|
||||
## [6.1.10](https://github.com/angular/angular/compare/6.1.9...6.1.10) (2018-10-10)
|
||||
|
||||
@ -17,33 +9,6 @@ This version includes Ivy features and internal refactorings. There are no user-
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0-rc.0"></a>
|
||||
# [7.0.0-rc.0](https://github.com/angular/angular/compare/7.0.0-beta.7...7.0.0-rc.0) (2018-09-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for TypeScript 3.1 ([#26151](https://github.com/angular/angular/issues/26151)) ([9993c72](https://github.com/angular/angular/commit/9993c72))
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0-beta.7"></a>
|
||||
# [7.0.0-beta.7](https://github.com/angular/angular/compare/7.0.0-beta.6...7.0.0-beta.7) (2018-09-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** add missing `peerDependency ` to `[@angular](https://github.com/angular)/compiler` ([#26033](https://github.com/angular/angular/issues/26033)) ([549de1e](https://github.com/angular/angular/commit/549de1e)), closes [/github.com/angular/angular/commit/919f42fea1df4b9e38b7d688aef5f2de668e9d3e#diff-58563046c4439699f2e6a89187099a54](https://github.com//github.com/angular/angular/commit/919f42fea1df4b9e38b7d688aef5f2de668e9d3e/issues/diff-58563046c4439699f2e6a89187099a54)
|
||||
* **service-worker:** do not blow up when caches are unwritable ([#26042](https://github.com/angular/angular/issues/26042)) ([2bd767c](https://github.com/angular/angular/commit/2bd767c))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **compiler-cli:** add support to extend `angularCompilerOptions` ([#22717](https://github.com/angular/angular/issues/22717)) ([d7e5bbf](https://github.com/angular/angular/commit/d7e5bbf)), closes [#22684](https://github.com/angular/angular/issues/22684)
|
||||
* **platform-server:** update domino to v2.1.0 ([#25564](https://github.com/angular/angular/issues/25564)) ([3fb0da2](https://github.com/angular/angular/commit/3fb0da2))
|
||||
|
||||
|
||||
|
||||
<a name="6.1.9"></a>
|
||||
## [6.1.9](https://github.com/angular/angular/compare/6.1.8...6.1.9) (2018-09-26)
|
||||
|
||||
@ -54,57 +19,24 @@ This version includes Ivy features and internal refactorings. There are no user-
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0-beta.6"></a>
|
||||
# [7.0.0-beta.6](https://github.com/angular/angular/compare/7.0.0-beta.5...7.0.0-beta.6) (2018-09-19)
|
||||
<a name="6.1.8"></a>
|
||||
## [6.1.8](https://github.com/angular/angular/compare/6.1.7...6.1.8) (2018-09-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** specify the package and lock files using the workspace ([#25694](https://github.com/angular/angular/issues/25694)) ([ddc1335](https://github.com/angular/angular/commit/ddc1335))
|
||||
* **common:** register locale data for all equivalent closure locales ([#25867](https://github.com/angular/angular/issues/25867)) ([d83f9d4](https://github.com/angular/angular/commit/d83f9d4))
|
||||
* **compiler:** Fix look up of entryComponents in AOT Summaries ([#24892](https://github.com/angular/angular/issues/24892)) ([00d3666](https://github.com/angular/angular/commit/00d3666))
|
||||
* **ivy:** add [@nocollapse](https://github.com/nocollapse) when writing closure-annotated code ([#25775](https://github.com/angular/angular/issues/25775)) ([a0c4b2d](https://github.com/angular/angular/commit/a0c4b2d))
|
||||
* **ivy:** don't accidently read the inherited definition ([#25736](https://github.com/angular/angular/issues/25736)) ([d5bd86a](https://github.com/angular/angular/commit/d5bd86a)), closes [#24011](https://github.com/angular/angular/issues/24011) [#25026](https://github.com/angular/angular/issues/25026)
|
||||
* **ivy:** ensure Ivy *Ref classes derive from view engine equivalents ([#25775](https://github.com/angular/angular/issues/25775)) ([a9099e8](https://github.com/angular/angular/commit/a9099e8))
|
||||
* **ivy:** events should not mark views dirty by default ([#25969](https://github.com/angular/angular/issues/25969)) ([5653874](https://github.com/angular/angular/commit/5653874))
|
||||
* **ivy:** ngcc should compile entry-points in the correct order ([#25862](https://github.com/angular/angular/issues/25862)) ([9b1bb37](https://github.com/angular/angular/commit/9b1bb37))
|
||||
* **ivy:** use proper sanitizer names ([#25817](https://github.com/angular/angular/issues/25817)) ([21009b0](https://github.com/angular/angular/commit/21009b0)), closes [#25816](https://github.com/angular/angular/issues/25816)
|
||||
* **router:** mount correct component if router outlet was not instantiated and if using a route reuse strategy ([#25313](https://github.com/angular/angular/issues/25313)) ([#25314](https://github.com/angular/angular/issues/25314)) ([8dc2b11](https://github.com/angular/angular/commit/8dc2b11))
|
||||
* **bazel:** allow compile_strategy to be (privately) imported ([#25080](https://github.com/angular/angular/issues/25080)) ([2d0e642](https://github.com/angular/angular/commit/2d0e642))
|
||||
* **bazel:** correct type concatenated to devmode_js ([#25467](https://github.com/angular/angular/issues/25467)) ([91dd160](https://github.com/angular/angular/commit/91dd160))
|
||||
* **bazel:** move bazel managed runtime deps for downstream usage ([#25690](https://github.com/angular/angular/issues/25690)) ([48d7f4e](https://github.com/angular/angular/commit/48d7f4e))
|
||||
* **bazel:** specify the package and lock files using the workspace ([#25694](https://github.com/angular/angular/issues/25694)) ([678b420](https://github.com/angular/angular/commit/678b420))
|
||||
* **compiler:** Fix look up of entryComponents in AOT Summaries ([#24892](https://github.com/angular/angular/issues/24892)) ([a31cfc5](https://github.com/angular/angular/commit/a31cfc5))
|
||||
* **router:** mount correct component if router outlet was not instantiated and if using a route reuse strategy ([#25313](https://github.com/angular/angular/issues/25313)) ([#25314](https://github.com/angular/angular/issues/25314)) ([e117b1f](https://github.com/angular/angular/commit/e117b1f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **bazel:** add additional parameters to `ts_api_guardian_test` def ([#25694](https://github.com/angular/angular/issues/25694)) ([2a21ca0](https://github.com/angular/angular/commit/2a21ca0))
|
||||
* **ivy:** allow combined context discovery for components, directives and elements ([#25754](https://github.com/angular/angular/issues/25754)) ([62be8c2](https://github.com/angular/angular/commit/62be8c2))
|
||||
* **ivy:** patch animations into metadata ([#25828](https://github.com/angular/angular/issues/25828)) ([d2dfd48](https://github.com/angular/angular/commit/d2dfd48))
|
||||
* **ivy:** resolve references to vars in .d.ts files ([#25775](https://github.com/angular/angular/issues/25775)) ([96d6b79](https://github.com/angular/angular/commit/96d6b79))
|
||||
* **ivy:** support animation [@triggers](https://github.com/triggers) in templates ([#25849](https://github.com/angular/angular/issues/25849)) ([e363388](https://github.com/angular/angular/commit/e363388))
|
||||
* **ivy:** support bootstrap in ngModuleDef ([#25775](https://github.com/angular/angular/issues/25775)) ([13ccdfd](https://github.com/angular/angular/commit/13ccdfd))
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0-beta.5"></a>
|
||||
# [7.0.0-beta.5](https://github.com/angular/angular/compare/7.0.0-beta.4...7.0.0-beta.5) (2018-09-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** protractor rule should include *.e2e-spec.js ([#25701](https://github.com/angular/angular/issues/25701)) ([3809e0f](https://github.com/angular/angular/commit/3809e0f))
|
||||
* **benchpress:** Use performance.mark() instead of console.time() ([#24114](https://github.com/angular/angular/issues/24114)) ([06d0400](https://github.com/angular/angular/commit/06d0400))
|
||||
* **compiler:** add hostVars and support pure functions in host bindings ([#25626](https://github.com/angular/angular/issues/25626)) ([b424b31](https://github.com/angular/angular/commit/b424b31))
|
||||
* **core:** do not clear element content when using shadow dom ([#24861](https://github.com/angular/angular/issues/24861)) ([6e828bb](https://github.com/angular/angular/commit/6e828bb))
|
||||
* **core:** size regression with closure compiler ([#25531](https://github.com/angular/angular/issues/25531)) ([1f59f2f](https://github.com/angular/angular/commit/1f59f2f))
|
||||
* **elements:** add compiler dependency ([#24861](https://github.com/angular/angular/issues/24861)) ([6143da6](https://github.com/angular/angular/commit/6143da6))
|
||||
* **elements:** add compiler to integration ([#24861](https://github.com/angular/angular/issues/24861)) ([a080ffc](https://github.com/angular/angular/commit/a080ffc))
|
||||
* **elements:** strict null checks ([#24861](https://github.com/angular/angular/issues/24861)) ([a8210d0](https://github.com/angular/angular/commit/a8210d0))
|
||||
* **upgrade:** trigger `$destroy` event on upgraded component element ([#25357](https://github.com/angular/angular/issues/25357)) ([2a672a9](https://github.com/angular/angular/commit/2a672a9)), closes [#25334](https://github.com/angular/angular/issues/25334)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **elements:** enable Shadow DOM v1 and slots ([#24861](https://github.com/angular/angular/issues/24861)) ([c9844a2](https://github.com/angular/angular/commit/c9844a2))
|
||||
* **router:** warn if navigation triggered outside Angular zone ([#24959](https://github.com/angular/angular/issues/24959)) ([010e35d](https://github.com/angular/angular/commit/010e35d)), closes [#15770](https://github.com/angular/angular/issues/15770) [#15946](https://github.com/angular/angular/issues/15946) [#24728](https://github.com/angular/angular/issues/24728)
|
||||
|
||||
* **bazel:** add additional parameters to `ts_api_guardian_test` def ([#25694](https://github.com/angular/angular/issues/25694)) ([97ae7ae](https://github.com/angular/angular/commit/97ae7ae))
|
||||
* **ivy:** enable .ngfactory.js generation in g3 only ([#25392](https://github.com/angular/angular/issues/25392)) ([1c44b71](https://github.com/angular/angular/commit/1c44b71))
|
||||
|
||||
|
||||
|
||||
@ -121,18 +53,6 @@ This version includes Ivy features and internal refactorings. There are no user-
|
||||
* **router:** warn if navigation triggered outside Angular zone ([#24959](https://github.com/angular/angular/issues/24959)) ([23a96dc](https://github.com/angular/angular/commit/23a96dc)), closes [#15770](https://github.com/angular/angular/issues/15770) [#15946](https://github.com/angular/angular/issues/15946) [#24728](https://github.com/angular/angular/issues/24728)
|
||||
|
||||
|
||||
<a name="7.0.0-beta.4"></a>
|
||||
# [7.0.0-beta.4](https://github.com/angular/angular/compare/7.0.0-beta.3...7.0.0-beta.4) (2018-08-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** Cache fileNameToModuleName lookups ([#25731](https://github.com/angular/angular/issues/25731)) ([f394ba0](https://github.com/angular/angular/commit/f394ba0))
|
||||
* **bazel:** move bazel managed runtime deps for downstream usage ([#25690](https://github.com/angular/angular/issues/25690)) ([6ed7993](https://github.com/angular/angular/commit/6ed7993))
|
||||
* **bazel:** only lookup amd module-name tags in .d.ts files ([#25710](https://github.com/angular/angular/issues/25710)) ([42072c4](https://github.com/angular/angular/commit/42072c4))
|
||||
* **compiler:** update compiler to generate new slot allocations ([#25607](https://github.com/angular/angular/issues/25607)) ([27e2039](https://github.com/angular/angular/commit/27e2039))
|
||||
|
||||
|
||||
|
||||
<a name="6.1.6"></a>
|
||||
## [6.1.6](https://github.com/angular/angular/compare/6.1.5...6.1.6) (2018-08-29)
|
||||
@ -146,16 +66,6 @@ This version includes Ivy features and internal refactorings. There are no user-
|
||||
|
||||
Note: the 6.1.5 release on npm accidentally glitched-out midway, so we cut 6.1.6 instead. sorry! :-)
|
||||
|
||||
<a name="7.0.0-beta.3"></a>
|
||||
# [7.0.0-beta.3](https://github.com/angular/angular/compare/7.0.0-beta.2...7.0.0-beta.3) (2018-08-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **router:** add UrlSegment[] to CanLoad interface ([#13127](https://github.com/angular/angular/issues/13127)) ([07d8d39](https://github.com/angular/angular/commit/07d8d39)), closes [#12411](https://github.com/angular/angular/issues/12411)
|
||||
|
||||
|
||||
|
||||
<a name="6.1.4"></a>
|
||||
## [6.1.4](https://github.com/angular/angular/compare/6.1.3...6.1.4) (2018-08-22)
|
||||
|
||||
@ -166,15 +76,6 @@ Note: the 6.1.5 release on npm accidentally glitched-out midway, so we cut 6.1.6
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0-beta.2"></a>
|
||||
# [7.0.0-beta.2](https://github.com/angular/angular/compare/7.0.0-beta.1...7.0.0-beta.2) (2018-08-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** correct type concatenated to devmode_js ([#25467](https://github.com/angular/angular/issues/25467)) ([fb2c524](https://github.com/angular/angular/commit/fb2c524))
|
||||
|
||||
|
||||
<a name="6.1.3"></a>
|
||||
## [6.1.3](https://github.com/angular/angular/compare/6.1.2...6.1.3) (2018-08-15)
|
||||
|
||||
@ -185,24 +86,6 @@ Note: the 6.1.5 release on npm accidentally glitched-out midway, so we cut 6.1.6
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0-beta.1"></a>
|
||||
# [7.0.0-beta.1](https://github.com/angular/angular/compare/7.0.0-beta.0...7.0.0-beta.1) (2018-08-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler-cli:** use the oldProgram option in watch mode ([#21364](https://github.com/angular/angular/issues/21364)) ([c6e5b97](https://github.com/angular/angular/commit/c6e5b97)), closes [#21361](https://github.com/angular/angular/issues/21361)
|
||||
* **core:** In Testability.whenStable update callback, pass more complete ([#25010](https://github.com/angular/angular/issues/25010)) ([16c03c0](https://github.com/angular/angular/commit/16c03c0))
|
||||
* add mappings for ngfactory & ngsummary files to their module names in aot summary resolver ([#25335](https://github.com/angular/angular/issues/25335)) ([02e201a](https://github.com/angular/angular/commit/02e201a))
|
||||
* **router:** take base uri into account in `setUpLocationSync()` ([#20244](https://github.com/angular/angular/issues/20244)) ([ba1e25f](https://github.com/angular/angular/commit/ba1e25f)), closes [#20061](https://github.com/angular/angular/issues/20061)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **core:** add DoBootstrap interface. ([#24558](https://github.com/angular/angular/issues/24558)) ([732026c](https://github.com/angular/angular/commit/732026c)), closes [#24557](https://github.com/angular/angular/issues/24557)
|
||||
|
||||
|
||||
|
||||
<a name="6.1.2"></a>
|
||||
## [6.1.2](https://github.com/angular/angular/compare/6.1.1...6.1.2) (2018-08-08)
|
||||
|
||||
@ -213,26 +96,13 @@ Note: the 6.1.5 release on npm accidentally glitched-out midway, so we cut 6.1.6
|
||||
* add mappings for ngfactory & ngsummary files to their module names in aot summary resolver ([#25335](https://github.com/angular/angular/issues/25335)) ([054fbbe](https://github.com/angular/angular/commit/054fbbe))
|
||||
|
||||
|
||||
<a name="7.0.0-beta.0"></a>
|
||||
# [7.0.0-beta.0](https://github.com/angular/angular/compare/6.1.0...7.0.0-beta.0) (2018-08-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bazel:** allow compile_strategy to be (privately) imported ([#25080](https://github.com/angular/angular/issues/25080)) ([0d1d589](https://github.com/angular/angular/commit/0d1d589))
|
||||
* **compiler:** update compiler to flatten nested template fns ([#24943](https://github.com/angular/angular/issues/24943)) ([fe14f18](https://github.com/angular/angular/commit/fe14f18))
|
||||
* **compiler-cli:** correct realPath to realpath. ([#25023](https://github.com/angular/angular/issues/25023)) ([01e6dab](https://github.com/angular/angular/commit/01e6dab))
|
||||
* **core:** throw error message when @Output not initialized ([#19116](https://github.com/angular/angular/issues/19116)) ([adf510f](https://github.com/angular/angular/commit/adf510f)), closes [#3664](https://github.com/angular/angular/issues/3664)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **compiler:** add "original" placeholder value on extracted XMB ([#25079](https://github.com/angular/angular/issues/25079)) ([e99d860](https://github.com/angular/angular/commit/e99d860))
|
||||
|
||||
|
||||
|
||||
<a name="6.1.1"></a>
|
||||
## [6.1.1](https://github.com/angular/angular/compare/6.1.0...6.1.1) (2018-08-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compiler-cli:** correct tsickle dependency version to fix typescript 2.9 compatibility ([fec29fa](https://github.com/angular/angular/commit/317c7087c56b72aa74cd6d6a8f719e6e7fec29fa))
|
||||
|
||||
|
||||
|
@ -71,6 +71,8 @@ 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 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.
|
||||
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.
|
||||
1. Fork the angular/angular repo.
|
||||
|
62
WORKSPACE
62
WORKSPACE
@ -5,30 +5,28 @@ workspace(name = "angular")
|
||||
#
|
||||
http_archive(
|
||||
name = "build_bazel_rules_typescript",
|
||||
sha256 = "1626ee2cc9770af6950bfc77dffa027f9aedf330fe2ea2ee7e504428927bd95d",
|
||||
strip_prefix = "rules_typescript-0.17.0",
|
||||
url = "https://github.com/bazelbuild/rules_typescript/archive/0.17.0.zip",
|
||||
strip_prefix = "rules_typescript-0.17.0",
|
||||
sha256 = "1626ee2cc9770af6950bfc77dffa027f9aedf330fe2ea2ee7e504428927bd95d",
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
|
||||
|
||||
rules_typescript_dependencies()
|
||||
|
||||
http_archive(
|
||||
name = "bazel_toolchains",
|
||||
sha256 = "c3b08805602cd1d2b67ebe96407c1e8c6ed3d4ce55236ae2efe2f1948f38168d",
|
||||
strip_prefix = "bazel-toolchains-5124557861ebf4c0b67f98180bff1f8551e0b421",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/5124557861ebf4c0b67f98180bff1f8551e0b421.tar.gz",
|
||||
"https://github.com/bazelbuild/bazel-toolchains/archive/5124557861ebf4c0b67f98180bff1f8551e0b421.tar.gz",
|
||||
],
|
||||
name = "bazel_toolchains",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/5124557861ebf4c0b67f98180bff1f8551e0b421.tar.gz",
|
||||
"https://github.com/bazelbuild/bazel-toolchains/archive/5124557861ebf4c0b67f98180bff1f8551e0b421.tar.gz",
|
||||
],
|
||||
strip_prefix = "bazel-toolchains-5124557861ebf4c0b67f98180bff1f8551e0b421",
|
||||
sha256 = "c3b08805602cd1d2b67ebe96407c1e8c6ed3d4ce55236ae2efe2f1948f38168d",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "io_bazel_rules_sass",
|
||||
sha256 = "dbe9fb97d5a7833b2a733eebc78c9c1e3880f676ac8af16e58ccf2139cbcad03",
|
||||
strip_prefix = "rules_sass-1.11.0",
|
||||
url = "https://github.com/bazelbuild/rules_sass/archive/1.11.0.zip",
|
||||
strip_prefix = "rules_sass-1.11.0",
|
||||
sha256 = "dbe9fb97d5a7833b2a733eebc78c9c1e3880f676ac8af16e58ccf2139cbcad03",
|
||||
)
|
||||
|
||||
# This commit matches the version of buildifier in angular/ngcontainer
|
||||
@ -38,25 +36,25 @@ BAZEL_BUILDTOOLS_VERSION = "49a6c199e3fbf5d94534b2771868677d3f9c6de9"
|
||||
|
||||
http_archive(
|
||||
name = "com_github_bazelbuild_buildtools",
|
||||
sha256 = "edf39af5fc257521e4af4c40829fffe8fba6d0ebff9f4dd69a6f8f1223ae047b",
|
||||
strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION,
|
||||
url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BAZEL_BUILDTOOLS_VERSION,
|
||||
strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION,
|
||||
sha256 = "edf39af5fc257521e4af4c40829fffe8fba6d0ebff9f4dd69a6f8f1223ae047b",
|
||||
)
|
||||
|
||||
# Fetching the Bazel source code allows us to compile the Skylark linter
|
||||
http_archive(
|
||||
name = "io_bazel",
|
||||
sha256 = "ace8cced3b21e64a8fdad68508e9b0644201ec848ad583651719841d567fc66d",
|
||||
strip_prefix = "bazel-0.17.1",
|
||||
url = "https://github.com/bazelbuild/bazel/archive/0.17.1.zip",
|
||||
strip_prefix = "bazel-0.17.1",
|
||||
sha256 = "ace8cced3b21e64a8fdad68508e9b0644201ec848ad583651719841d567fc66d",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "io_bazel_skydoc",
|
||||
sha256 = "7bfb5545f59792a2745f2523b9eef363f9c3e7274791c030885e7069f8116016",
|
||||
strip_prefix = "skydoc-fe2e9f888d28e567fef62ec9d4a93c425526d701",
|
||||
# TODO: switch to upstream when https://github.com/bazelbuild/skydoc/pull/103 is merged
|
||||
url = "https://github.com/alexeagle/skydoc/archive/fe2e9f888d28e567fef62ec9d4a93c425526d701.zip",
|
||||
strip_prefix = "skydoc-fe2e9f888d28e567fef62ec9d4a93c425526d701",
|
||||
sha256 = "7bfb5545f59792a2745f2523b9eef363f9c3e7274791c030885e7069f8116016",
|
||||
)
|
||||
|
||||
# We have a source dependency on the Devkit repository, because it's built with
|
||||
@ -67,16 +65,16 @@ http_archive(
|
||||
# ts_library rules in the devkit repository.
|
||||
http_archive(
|
||||
name = "angular_cli",
|
||||
sha256 = "8cf320ea58c321e103f39087376feea502f20eaf79c61a4fdb05c7286c8684fd",
|
||||
strip_prefix = "angular-cli-6.1.0-rc.0",
|
||||
url = "https://github.com/angular/angular-cli/archive/v6.1.0-rc.0.zip",
|
||||
strip_prefix = "angular-cli-6.1.0-rc.0",
|
||||
sha256 = "8cf320ea58c321e103f39087376feea502f20eaf79c61a4fdb05c7286c8684fd",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "org_brotli",
|
||||
sha256 = "774b893a0700b0692a76e2e5b7e7610dbbe330ffbe3fe864b4b52ca718061d5a",
|
||||
strip_prefix = "brotli-1.0.5",
|
||||
url = "https://github.com/google/brotli/archive/v1.0.5.zip",
|
||||
strip_prefix = "brotli-1.0.5",
|
||||
sha256 = "774b893a0700b0692a76e2e5b7e7610dbbe330ffbe3fe864b4b52ca718061d5a",
|
||||
)
|
||||
|
||||
#
|
||||
@ -106,24 +104,21 @@ If you are on a Mac and using Homebrew, there is a breaking change to the instal
|
||||
See https://blog.bazel.build/2018/08/22/bazel-homebrew.html
|
||||
|
||||
""")
|
||||
|
||||
node_repositories(
|
||||
node_version = "10.9.0",
|
||||
package_json = ["//:package.json"],
|
||||
preserve_symlinks = True,
|
||||
node_version = "10.9.0",
|
||||
yarn_version = "1.9.2",
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
|
||||
|
||||
go_rules_dependencies()
|
||||
|
||||
go_register_toolchains()
|
||||
|
||||
load("@io_bazel_rules_webtesting//web:repositories.bzl", "browser_repositories", "web_test_repositories")
|
||||
|
||||
web_test_repositories()
|
||||
|
||||
browser_repositories(
|
||||
chromium = True,
|
||||
firefox = True,
|
||||
@ -141,20 +136,7 @@ ng_setup_workspace()
|
||||
# Skylark documentation generation
|
||||
|
||||
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
|
||||
|
||||
sass_repositories()
|
||||
|
||||
load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
|
||||
|
||||
skydoc_repositories()
|
||||
|
||||
##################################
|
||||
# Prevent Bazel from trying to build rxjs under angular devkit
|
||||
local_repository(
|
||||
name = "rxjs_ignore_nested_1",
|
||||
path = "node_modules/@angular-devkit/core/node_modules/rxjs/src",
|
||||
)
|
||||
local_repository(
|
||||
name = "rxjs_ignore_nested_2",
|
||||
path = "node_modules/@angular-devkit/schematics/node_modules/rxjs/src",
|
||||
)
|
||||
|
@ -46,7 +46,7 @@
|
||||
"@types/shelljs": "^0.8.0",
|
||||
"@types/supertest": "^2.0.5",
|
||||
"nodemon": "^1.18.3",
|
||||
"npm-run-all": "^4.1.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"supertest": "^3.1.0",
|
||||
"tslint": "^5.11.0",
|
||||
"tslint-jasmine-noSkipOrFocus": "^1.0.9",
|
||||
|
@ -129,7 +129,7 @@ ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
ansi-styles@^3.2.0, ansi-styles@^3.2.1:
|
||||
ansi-styles@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
|
||||
dependencies:
|
||||
@ -384,7 +384,7 @@ chalk@^1.1.3:
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0:
|
||||
chalk@^2.0.1, chalk@^2.3.0:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
|
||||
dependencies:
|
||||
@ -392,6 +392,15 @@ chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0:
|
||||
escape-string-regexp "^1.0.5"
|
||||
supports-color "^5.3.0"
|
||||
|
||||
chalk@^2.4.1:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
||||
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
||||
dependencies:
|
||||
ansi-styles "^3.2.1"
|
||||
escape-string-regexp "^1.0.5"
|
||||
supports-color "^5.3.0"
|
||||
|
||||
check-error@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
|
||||
@ -532,9 +541,10 @@ cross-spawn@^5.0.1:
|
||||
shebang-command "^1.2.0"
|
||||
which "^1.2.9"
|
||||
|
||||
cross-spawn@^6.0.4:
|
||||
cross-spawn@^6.0.5:
|
||||
version "6.0.5"
|
||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
|
||||
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
|
||||
dependencies:
|
||||
nice-try "^1.0.4"
|
||||
path-key "^2.0.1"
|
||||
@ -1630,16 +1640,17 @@ npm-packlist@^1.1.6:
|
||||
ignore-walk "^3.0.1"
|
||||
npm-bundled "^1.0.1"
|
||||
|
||||
npm-run-all@^4.1.3:
|
||||
version "4.1.3"
|
||||
resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.3.tgz#49f15b55a66bb4101664ce270cb18e7103f8f185"
|
||||
npm-run-all@^4.1.5:
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/npm-run-all/-/npm-run-all-4.1.5.tgz#04476202a15ee0e2e214080861bff12a51d98fba"
|
||||
integrity sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==
|
||||
dependencies:
|
||||
ansi-styles "^3.2.0"
|
||||
chalk "^2.1.0"
|
||||
cross-spawn "^6.0.4"
|
||||
ansi-styles "^3.2.1"
|
||||
chalk "^2.4.1"
|
||||
cross-spawn "^6.0.5"
|
||||
memorystream "^0.3.1"
|
||||
minimatch "^3.0.4"
|
||||
ps-tree "^1.1.0"
|
||||
pidtree "^0.3.0"
|
||||
read-pkg "^3.0.0"
|
||||
shell-quote "^1.6.1"
|
||||
string.prototype.padend "^3.0.0"
|
||||
@ -1786,6 +1797,11 @@ pause-stream@0.0.11:
|
||||
dependencies:
|
||||
through "~2.3"
|
||||
|
||||
pidtree@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.3.0.tgz#f6fada10fccc9f99bf50e90d0b23d72c9ebc2e6b"
|
||||
integrity sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==
|
||||
|
||||
pify@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||
|
1
aio/content/cli-src/.gitignore
vendored
1
aio/content/cli-src/.gitignore
vendored
@ -1 +0,0 @@
|
||||
yarn.lock
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@angular/cli": "https://github.com/angular/cli-builds#master"
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
<h1 class="no-toc">CLI Command Reference</h1>
|
||||
|
||||
The Angular CLI is a command-line tool that you use to initialize, develop, scaffold, and maintain Angular applications.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Installing Angular CLI
|
||||
|
||||
The current version of Angular CLI is 6.x.
|
||||
|
||||
* Both the CLI and the projects that you generate with the tool have dependencies that require Node 8.9 or higher, together with NPM 5.5.1 or higher.
|
||||
* Install the CLI using npm:
|
||||
`npm install -g @angular/cli`
|
||||
* The CLI is an open-source tool:
|
||||
https://github.com/angular/angular-cli/tree/master/packages/angular/cli
|
||||
|
||||
For details about changes between versions, and information about updating from previous releases, see the Releases tab on GitHub.
|
||||
|
||||
### Basic workflow
|
||||
|
||||
Invoke the tool on the command line through the ng executable. Online help is available on the command line:
|
||||
|
||||
```
|
||||
> ng help Lists commands with short descriptions
|
||||
> ng <command> --help Lists options for a command.
|
||||
```
|
||||
|
||||
To create, build, and serve a new, basic Angular project on a development server, use the following commands:
|
||||
|
||||
```
|
||||
cd <parent of new workspace>
|
||||
ng new my-project
|
||||
cd my-project
|
||||
ng serve
|
||||
```
|
||||
|
||||
In your browser, open http://localhost:4200/ to see the new app run.
|
||||
|
||||
### Workspaces and project files
|
||||
|
||||
Angular 6 introduced the workspace directory structure for Angular apps. A workspace defines a project. A project can contain multiple apps, as well as libraries that can be used in any of the apps.
|
||||
|
||||
Some commands (such as build) must be executed from within a workspace folder, and others (such as new) must be executed from outside any workspace. This requirement is called out in the description of each command where it applies.The `new` command creates a [workspace](guide/glossary#workspace) to contain [projects](guide/glossary#project). A project can be an app or a library, and a workspace can contain multiple apps and libraries.
|
||||
|
||||
A newly generated app project contains the source files for a root module, with a root component and template, which you can edit directly, or add to and modify using CLI commands. Use the generate command to add new files for additional components and services, and code for new pipes, directives, and so on.
|
||||
|
||||
* Commands such as `add` and `generate`, that create or operate on apps and libraries, must be executed from within a workspace folder.
|
||||
* Apps in a workspace can use libraries in the same workspace.
|
||||
* Each project has a `src` folder that contains the logic, data, and assets.
|
||||
See an example of the [file structure](guide/quickstart#project-file-review) in [Getting Started](guide/quickstart).
|
||||
|
||||
When you use the `serve` command to build an app, the server automatically rebuilds the app and reloads the page when you change any of the source files.
|
||||
|
||||
### Configuring the CLI
|
||||
|
||||
Configuration files let you customize your project. The CLI configuration file, angular.json, is created at the top level of the project folder. This is where you can set CLI defaults for your project, and specify which files to include when the CLI builds the project.
|
||||
|
||||
The CLI config command lets you set and retrieve configuration values from the command line, or you can edit the angular.json file directly.
|
||||
|
||||
* See the complete schema for angular.json.
|
||||
* Learn more about configuration options for Angular (link to new guide?)
|
||||
|
||||
### Command options and arguments
|
||||
|
||||
All commands and some options have aliases, as listed in the descriptions. Option names are prefixed with a double dash (--), but arguments and option aliases are not.
|
||||
|
||||
Typically, the name of a generated artifact can be given as an argument to the command or specified with the --name option. Most commands have additional options.
|
||||
|
||||
Command syntax is shown as follows:
|
||||
|
||||
```
|
||||
ng commandNameOrAlias <arg> [options]
|
||||
```
|
||||
|
||||
Options take either string or Boolean arguments. Defaults are shown in bold for Boolean or enumerated values, and are given with the description. For example:
|
||||
|
||||
```
|
||||
--optionNameOrAlias=<filename>
|
||||
--optionNameOrAlias=true|false
|
||||
--optionNameOrAlias=allowedValue1|allowedValue2|allowedValue3
|
||||
```
|
||||
|
||||
Boolean options can also be expressed with a prefix `no-` to indicate a value of false. For example, `--no-prod` is equivalent to `--prod=false`.
|
@ -8,11 +8,11 @@ import { Routes, RouterModule } from '@angular/router';
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: 'customers',
|
||||
loadChildren: './customers/customers.module#CustomersModule'
|
||||
loadChildren: 'app/customers/customers.module#CustomersModule'
|
||||
},
|
||||
{
|
||||
path: 'orders',
|
||||
loadChildren: './orders/orders.module#OrdersModule'
|
||||
loadChildren: 'app/orders/orders.module#OrdersModule'
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
|
@ -5,8 +5,8 @@ import { ContactModule } from './contact/contact.module.3';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'contact', pathMatch: 'full'},
|
||||
{ path: 'crisis', loadChildren: './crisis/crisis.module#CrisisModule' },
|
||||
{ path: 'heroes', loadChildren: './hero/hero.module.3#HeroModule' }
|
||||
{ path: 'crisis', loadChildren: 'app/crisis/crisis.module#CrisisModule' },
|
||||
{ path: 'heroes', loadChildren: 'app/hero/hero.module.3#HeroModule' }
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@ -8,8 +8,8 @@ import { ContactModule } from './contact/contact.module';
|
||||
const routes: Routes = [
|
||||
{ path: '', redirectTo: 'contact', pathMatch: 'full'},
|
||||
// #docregion lazy-routes
|
||||
{ path: 'crisis', loadChildren: './crisis/crisis.module#CrisisModule' },
|
||||
{ path: 'heroes', loadChildren: './hero/hero.module#HeroModule' }
|
||||
{ path: 'crisis', loadChildren: 'app/crisis/crisis.module#CrisisModule' },
|
||||
{ path: 'heroes', loadChildren: 'app/hero/hero.module#HeroModule' }
|
||||
// #enddocregion lazy-routes
|
||||
];
|
||||
// #enddocregion routes
|
||||
|
@ -3,8 +3,8 @@ import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
export const routes: Routes = [
|
||||
{ path: '', redirectTo: 'contact', pathMatch: 'full'},
|
||||
{ path: 'items', loadChildren: './items/items.module#ItemsModule' },
|
||||
{ path: 'customers', loadChildren: './customers/customers.module#CustomersModule' }
|
||||
{ path: 'items', loadChildren: 'app/items/items.module#ItemsModule' },
|
||||
{ path: 'customers', loadChildren: 'app/customers/customers.module#CustomersModule' }
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@ -35,14 +35,14 @@ describe('Reactive forms', function () {
|
||||
|
||||
it('should update the name control when the Update Name button is clicked', async () => {
|
||||
await nameInput.sendKeys(nameText);
|
||||
const value1 = await nameInput.getAttribute('value');
|
||||
const value = await nameInput.getAttribute('value');
|
||||
|
||||
expect(value1).toBe(nameText);
|
||||
expect(value).toBe(nameText);
|
||||
await updateButton.click();
|
||||
|
||||
const value2 = await nameInput.getAttribute('value');
|
||||
const value = await nameInput.getAttribute('value');
|
||||
|
||||
expect(value2).toBe('Nancy');
|
||||
expect(value).toBe('Nancy');
|
||||
});
|
||||
|
||||
it('should update the displayed control value when the name control updated', async () => {
|
||||
|
@ -8,7 +8,7 @@ import { AboutComponent } from './about/about.component';
|
||||
RouterModule.forRoot([
|
||||
{ path: '', redirectTo: 'dashboard', pathMatch: 'full'},
|
||||
{ path: 'about', component: AboutComponent },
|
||||
{ path: 'heroes', loadChildren: './hero/hero.module#HeroModule'}
|
||||
{ path: 'heroes', loadChildren: 'app/hero/hero.module#HeroModule'}
|
||||
])
|
||||
],
|
||||
exports: [ RouterModule ] // re-export the module declarations
|
||||
|
@ -1308,28 +1308,6 @@ Chuck: After reviewing your PR comment I'm still at a loss. See [comment there](
|
||||
}
|
||||
```
|
||||
|
||||
{@a tsconfig-extends}
|
||||
## Configuration inheritance with extends
|
||||
Similar to TypeScript Compiler, Angular Compiler also supports `extends` in the `tsconfig.json` on `angularCompilerOptions`. A tsconfig file can inherit configurations from another file using the `extends` property.
|
||||
The `extends` is a top level property parallel to `compilerOptions` and `angularCompilerOptions`.
|
||||
The configuration from the base file are loaded first, then overridden by those in the inheriting config file.
|
||||
Example:
|
||||
```json
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
...
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"fullTemplateTypeCheck": true,
|
||||
"preserveWhitespaces": true,
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
More information about tsconfig extends can be found in the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
|
||||
|
||||
{@a compiler-options}
|
||||
## Angular template compiler options
|
||||
|
||||
|
@ -17,7 +17,7 @@ Here are some key features.
|
||||
* [Server-side Rendering](guide/universal): Angular Universal generates static application pages on the server through server-side rendering (SSR). This allows you to run your Angular app on the server in order to improve performance and show the first page quickly on mobile and low-powered devices, and also facilitate web crawlers.
|
||||
|
||||
* [Service Workers](guide/service-worker-intro): Use a service worker to reduce dependency on the network
|
||||
significantly improving the use experience.
|
||||
significantly improving the user experience.
|
||||
|
||||
## Domain-specific libraries
|
||||
|
||||
|
@ -61,7 +61,7 @@ The generated `src/app/highlight.directive.ts` is as follows:
|
||||
|
||||
<code-example path="attribute-directives/src/app/highlight.directive.0.ts" title="src/app/highlight.directive.ts"></code-example>
|
||||
|
||||
The imported `Directive` symbol provides Angular the `@Directive` decorator.
|
||||
The imported `Directive` symbol provides the Angular the `@Directive` decorator.
|
||||
|
||||
The `@Directive` decorator's lone configuration property specifies the directive's
|
||||
[CSS attribute selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors), `[appHighlight]`.
|
||||
|
@ -1,536 +0,0 @@
|
||||
# Building and serving Angular apps
|
||||
|
||||
*intro - here are some topics of interest in the app development cycle*
|
||||
|
||||
{@a app-environments}
|
||||
|
||||
## Configuring application environments
|
||||
|
||||
You can define different named build configurations for your project, such as *stage* and *production*, with different defaults.
|
||||
|
||||
Each named build configuration can have defaults for any of the options that apply to the various build targets, such as `build`, `serve`, and `test`. The CLI `build`, `serve`, and `test` commands can then replace files with appropriate versions for your intended target environment.
|
||||
|
||||
The following figure shows how a project has multiple build targets, which can be executed using the named configurations that you define.
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/build/build-config-targets.gif" alt="build configurations and targets">
|
||||
</figure>
|
||||
|
||||
### Configure environment-specific defaults
|
||||
|
||||
A project's `src/environments/` folder contains the base configuration file, `environment.ts`, which provides a default environment.
|
||||
You can add override defaults for additional environments, such as production and staging, in target-specific configuration files.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
└──myProject/src/environments/
|
||||
└──environment.ts
|
||||
└──environment.prod.ts
|
||||
└──environment.stage.ts
|
||||
```
|
||||
|
||||
The base file `environment.ts`, contains the default environment settings. For example:
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
export const environment = {
|
||||
production: false
|
||||
};
|
||||
</code-example>
|
||||
|
||||
The `build` command uses this as the build target when no environment is specified.
|
||||
You can add further variables, either as additional properties on the environment object, or as separate objects.
|
||||
For example, the following adds a default for a variable to the default environment:
|
||||
|
||||
```
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://my-api-url'
|
||||
};
|
||||
```
|
||||
|
||||
You can add target-specific configuration files, such as `environment.prod.ts`.
|
||||
The following sets content sets default values for the production build target:
|
||||
|
||||
```
|
||||
export const environment = {
|
||||
production: true
|
||||
apiUrl: 'http://my-prod-url'
|
||||
};
|
||||
```
|
||||
|
||||
### Using environment-specific variables in your app
|
||||
|
||||
The following application structure configures build targets for production and staging environments:
|
||||
|
||||
```
|
||||
└── src
|
||||
└── app
|
||||
├── app.component.html
|
||||
└── app.component.ts
|
||||
└── environments
|
||||
├── environment.prod.ts
|
||||
├── environment.staging.ts
|
||||
└── environment.ts
|
||||
```
|
||||
|
||||
To use the environment configurations you have defined, your components must import the original environments file:
|
||||
|
||||
```
|
||||
import { environment } from './../environments/environment';
|
||||
```
|
||||
|
||||
This ensures that the build and serve commands can find the configurations for specific build targets.
|
||||
|
||||
The following code in the component file (`app.component.ts`) uses an environment variable defined in the configuration files.
|
||||
|
||||
```
|
||||
import { Component } from '@angular/core';
|
||||
import { environment } from './../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor() {
|
||||
console.log(environment.production); // Logs false for default environment
|
||||
}
|
||||
title = 'app works!';
|
||||
}
|
||||
```
|
||||
{@a file-replacement}
|
||||
|
||||
## Configure target-specific file replacements
|
||||
|
||||
The main CLI configuration file, `angular.json`, contains a `fileReplacements` section in the configuration for each build target, which allows you to replace any file with a target-specific version of that file.
|
||||
This is useful for including target-specific code or variables in a build that targets a specific environment, such as production or staging.
|
||||
|
||||
By default no files are replaced.
|
||||
You can add file replacements for specific build targets.
|
||||
For example:
|
||||
|
||||
```
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
...
|
||||
```
|
||||
|
||||
This means that when you build your production configuration (using `ng build --prod` or `ng build --configuration=production`), the `src/environments/environment.ts` file is replaced with the target-specific version of the file, `src/environments/environment.prod.ts`.
|
||||
|
||||
You can add additional configurations as required. To add a staging environment, create a copy of `src/environments/environment.ts` called `src/environments/environment.staging.ts`, then add a `staging` configuration to `angular.json`:
|
||||
|
||||
```
|
||||
"configurations": {
|
||||
"production": { ... },
|
||||
"staging": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.staging.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can add more configuration options to this target environment as well.
|
||||
Any option that your build supports can be overridden in a build target configuration.
|
||||
|
||||
To build using the staging configuration, run `ng build --configuration=staging`.
|
||||
|
||||
You can also configure the `serve` command to use the targeted build configuration if you add it to the "serve:configurations" section of `angular.json`:
|
||||
|
||||
```
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "your-project-name:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "your-project-name:build:production"
|
||||
},
|
||||
"staging": {
|
||||
"browserTarget": "your-project-name:build:staging"
|
||||
}
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
{@a size-budgets}
|
||||
|
||||
## Configure size budgets
|
||||
|
||||
As applications grow in functionality, they also grow in size.
|
||||
The CLI allows you to set size thresholds in your configuration to ensure that parts of your application stay within size boundaries that you define.
|
||||
|
||||
Define your size boundaries in the CLI configuration file, `angular.json`, in a `budgets` section for each [configured environment](#app-environments).
|
||||
|
||||
```
|
||||
{
|
||||
...
|
||||
"configurations": {
|
||||
"production": {
|
||||
...
|
||||
budgets: []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can specify size budgets for the entire app, and for particular parts.
|
||||
Each budget entry configures a budget of a given type.
|
||||
Specify size values in the following formats:
|
||||
|
||||
* 123 or 123b: Size in bytes
|
||||
|
||||
* 123kb: Size in kilobytes
|
||||
|
||||
* 123mb: Size in megabytes
|
||||
|
||||
* 12%: Percentage of size relative to baseline. (Not valid for baseline values.)
|
||||
|
||||
When you configure a budget, the build system warns or reports and error when a given part of the app reaches or exceeds a boundary size that you set.
|
||||
|
||||
Each budget entry is a JSON object with the following properties:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>type</td>
|
||||
<td>The type of budget. One of:
|
||||
|
||||
* bundle - The size of a specific bundle.
|
||||
* initial - The initial size of the app.
|
||||
* allScript - The size of all scripts.
|
||||
* all - The size of the entire app.
|
||||
* anyScript - The size of any one script.
|
||||
* any - The size of any file.
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>
|
||||
|
||||
The name of the bundle (for `type=bundle`).
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>baseline</td>
|
||||
<td>An absolute baseline size for percentage values. </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maximumWarning</td>
|
||||
<td>Warns when a size exceeds this threshold percentage of the baseline.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maximumError</td>
|
||||
<td>Reports an error when the size exceeds this threshold percentage of the baseline.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>minimumWarning</td>
|
||||
<td>Warns when the size reaches this threshold percentage of the baseline.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>minimumError</td>
|
||||
<td>Reports an error when the size reaches this threshold percentage of the baseline.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>warning</td>
|
||||
<td>Warns when the size ??reaches or exceeds?? this threshold percentage of the baseline.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>error</td>
|
||||
<td>Reports an error when the size ??reaches or exceeds?? this threshold percentage of the baseline.</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
{@a assets}
|
||||
|
||||
## Adding project assets
|
||||
|
||||
You can configure your project with a set of assets, such as images, to copy directly into the build for a particular build target.
|
||||
|
||||
Each build target section of the CLI configuration file, `angular.json`, has an `assets` section that lists files or folders you want to copy into the build for that target.
|
||||
By default, the `src/assets/` folder and `src/favicon.ico` are copied into a build.
|
||||
|
||||
```
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/favicon.ico"
|
||||
]
|
||||
```
|
||||
|
||||
You can edit the assets configuration to extend it for assets outside your project.
|
||||
For example, the following invokes the [node-glob pattern matcher](https://github.com/isaacs/node-glob) using input from a given base folder.
|
||||
It sends output to a folder that is relative to `outDir`, a configuration value that defaults to `dist/`*project-name*).
|
||||
The result in this cased is the same as for the default assets configuration.
|
||||
|
||||
```
|
||||
"assets": [
|
||||
{ "glob": "**/*", "input": "src/assets/", "output": "/assets/" },
|
||||
{ "glob": "favicon.ico", "input": "/src", "output": "/" },
|
||||
]
|
||||
```
|
||||
|
||||
You can use this extended configuration to copy assets from outside your project.
|
||||
For instance, you can copy assets from a node package with the following value:
|
||||
|
||||
```
|
||||
"assets": [
|
||||
{ "glob": "**/*", "input": "./node_modules/some-package/images", "output": "/some-package/" },
|
||||
]
|
||||
```
|
||||
|
||||
This makes the contents of `node_modules/some-package/images/` available in the output folder `dist/some-package/`.
|
||||
|
||||
<div class="alert is-critical">
|
||||
|
||||
For reasons of security, the CLI never writes files outside of the project output path.
|
||||
|
||||
</div>
|
||||
|
||||
{@a browser-compat}
|
||||
|
||||
## Configuring browser compatibility
|
||||
|
||||
The CLI uses [Autoprefixer](https://github.com/postcss/autoprefixer) to ensure compatibility with different browser and browser versions.
|
||||
You may find it necessary to target specific browsers or exclude certain browser versions from your build.
|
||||
|
||||
Internally, Autoprefixer relies on a library called [Browserslist(https://github.com/ai/browserslist)] to figure out which browsers to support with prefixing.
|
||||
Browserlist looks for configuration options in a `browserlist` property of the package configuration file, or in a configuration file named `.browserslistrc`.
|
||||
Autoprefixer looks for the Browserlist configuration when it prefixes your CSS.
|
||||
|
||||
* You can tell Autoprefixer what browsers to target by adding a browserslist property to the package configuration file, `package.json`:
|
||||
```
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
]
|
||||
```
|
||||
|
||||
* Alternatively, you can add a new file, `.browserslistrc`, to the project directory, that specifies browsers you want to support:
|
||||
```
|
||||
### Supported Browsers
|
||||
> 1%
|
||||
last 2 versions
|
||||
```
|
||||
|
||||
See the [browserslist repo](https://github.com/ai/browserslist) for more examples of how to target specific browsers and versions.
|
||||
|
||||
<div class="alert is-helpful">>
|
||||
Backward compatibility
|
||||
|
||||
If you want to produce a progressive web app and are using [Lighthouse](https://developers.google.com/web/tools/lighthouse/) to grade the project, add the following browserslist entry to your `package.json` file, in order to eliminate the [old flexbox](https://developers.google.com/web/tools/lighthouse/audits/old-flexbox) prefixes:
|
||||
|
||||
```
|
||||
"browserslist": [
|
||||
"last 2 versions",
|
||||
"not ie <= 10",
|
||||
"not ie_mob <= 10"
|
||||
]
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
{@a proxy}
|
||||
|
||||
## Proxying to a backend server
|
||||
|
||||
You can use the [proxying support](https://webpack.js.org/configuration/dev-server/#devserver-proxy) in the `webpack` dev server to divert certain URLs to a backend server, by passing a file to the `--proxy-config` build option.
|
||||
For example, to divert all calls for http://localhost:4200/api to a server running on http://localhost:3000/api, take the following steps.
|
||||
|
||||
1. Create a file `proxy.conf.json` in the projects `src/` folder, next to `package.json`.
|
||||
|
||||
1. Add the following content to the new proxy file:
|
||||
```
|
||||
{
|
||||
"/api": {
|
||||
"target": "http://localhost:3000",
|
||||
"secure": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
1. In the CLI configuration file, `angular.json`, add the `proxyConfig` option to the `serve` target:
|
||||
```
|
||||
...
|
||||
"architect": {
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "your-application-name:build",
|
||||
"proxyConfig": "src/proxy.conf.json"
|
||||
},
|
||||
...
|
||||
```
|
||||
|
||||
1. To run the dev server with this proxy configuration, call `ng serve`.
|
||||
|
||||
You can edit the proxy configuration file to add configuration options; some examples are given below.
|
||||
For a description of all options, see [webpack DevServer documentation](https://webpack.js.org/configuration/dev-server/#devserver-proxy).
|
||||
|
||||
Note that if you edit the proxy configuration file, you must relaunch the `ng serve` process to make your changes effective.
|
||||
|
||||
### Rewrite the URL path
|
||||
|
||||
The `pathRewrite` proxy configuration option lets you rewrite the URL path at run time.
|
||||
For example, you can specify the following `pathRewrite` value to the proxy configuration to remove "api" from the end of a path.
|
||||
|
||||
```
|
||||
{
|
||||
"/api": {
|
||||
"target": "http://localhost:3000",
|
||||
"secure": false,
|
||||
"pathRewrite": {
|
||||
"^/api": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you need to access a backend that is not on `localhost`, set the `changeOrigin` option as well. For example:
|
||||
|
||||
```
|
||||
{
|
||||
"/api": {
|
||||
"target": "http://npmjs.org",
|
||||
"secure": false,
|
||||
"pathRewrite": {
|
||||
"^/api": ""
|
||||
},
|
||||
"changeOrigin": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To help determine whether your proxy is working as intended, set the `logLevel` option. For example:
|
||||
|
||||
```
|
||||
{
|
||||
"/api": {
|
||||
"target": "http://localhost:3000",
|
||||
"secure": false,
|
||||
"pathRewrite": {
|
||||
"^/api": ""
|
||||
},
|
||||
"logLevel": "debug"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Proxy log levels are `info` (the default), `debug`, `warn`, `error`, and `silent`.
|
||||
|
||||
### Proxy multiple entries
|
||||
|
||||
You can proxy multiple entries to the same target by defining the configuration in JavaScript.
|
||||
|
||||
Set the proxy configuration file to `proxy.conf.js` (instead of `proxy.conf.json`), and specify configuration files as in the following example.
|
||||
|
||||
```
|
||||
const PROXY_CONFIG = [
|
||||
{
|
||||
context: [
|
||||
"/my",
|
||||
"/many",
|
||||
"/endpoints",
|
||||
"/i",
|
||||
"/need",
|
||||
"/to",
|
||||
"/proxy"
|
||||
],
|
||||
target: "http://localhost:3000",
|
||||
secure: false
|
||||
}
|
||||
]
|
||||
|
||||
module.exports = PROXY_CONFIG;
|
||||
```
|
||||
|
||||
In the CLI configuration file, `angular.json`, point to the JavaScript proxy configuration file:
|
||||
|
||||
```
|
||||
...
|
||||
"architect": {
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "your-application-name:build",
|
||||
"proxyConfig": "src/proxy.conf.js"
|
||||
},
|
||||
...
|
||||
```
|
||||
|
||||
### Bypass the proxy
|
||||
|
||||
If you need to optionally bypass the proxy, or dynamically change the request before it's sent, add the bypass option, as shown in this JavaScript example.
|
||||
|
||||
```
|
||||
const PROXY_CONFIG = {
|
||||
"/api/proxy": {
|
||||
"target": "http://localhost:3000",
|
||||
"secure": false,
|
||||
"bypass": function (req, res, proxyOptions) {
|
||||
if (req.headers.accept.indexOf("html") !== -1) {
|
||||
console.log("Skipping proxy for browser request.");
|
||||
return "/index.html";
|
||||
}
|
||||
req.headers["X-Custom-Header"] = "yes";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PROXY_CONFIG;
|
||||
```
|
||||
|
||||
### Using corporate proxy
|
||||
|
||||
If you work behind a corporate proxy, the cannot directly proxy calls to any URL outside your local network.
|
||||
In this case, you can configure the backend proxy to redirect calls through your corporate proxy using an agent:
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
npm install --save-dev https-proxy-agent
|
||||
</code-example>
|
||||
|
||||
When you define an environment variable `http_proxy` or `HTTP_PROXY`, an agent is automatically added to pass calls through your corporate proxy when running `npm start`.
|
||||
|
||||
Use the following content in the JavaScript configuration file.
|
||||
|
||||
```
|
||||
var HttpsProxyAgent = require('https-proxy-agent');
|
||||
var proxyConfig = [{
|
||||
context: '/api',
|
||||
target: 'http://your-remote-server.com:3000',
|
||||
secure: false
|
||||
}];
|
||||
|
||||
function setupForCorporateProxy(proxyConfig) {
|
||||
var proxyServer = process.env.http_proxy || process.env.HTTP_PROXY;
|
||||
if (proxyServer) {
|
||||
var agent = new HttpsProxyAgent(proxyServer);
|
||||
console.log('Using corporate proxy server: ' + proxyServer);
|
||||
proxyConfig.forEach(function(entry) {
|
||||
entry.agent = agent;
|
||||
});
|
||||
}
|
||||
return proxyConfig;
|
||||
}
|
||||
|
||||
module.exports = setupForCorporateProxy(proxyConfig);
|
||||
```
|
||||
|
@ -240,7 +240,7 @@ The `@Injectable()` decorator is the standard decorator for service classes.
|
||||
|
||||
<div class="alert-is-helpful">
|
||||
|
||||
The decorator requirement is imposed by TypeScript. TypeScript normally discards parameter type information when it [transpiles]((guide/glossary#transpile) the code to JavaScript. TypeScript preserves this information if the class has a decorator and the `emitDecoratorMetadata` compiler option is set `true` in TypeScript's `tsconfig.json` configuration file. The CLI configures `tsconfig.json` with `emitDecoratorMetadata: true`.
|
||||
The decorator requirement is imposed by TypeScript. TypeScript normally discards parameter type information when it [transpiles](guide/glossary#transpile) the code to JavaScript. TypeScript preserves this information if the class has a decorator and the `emitDecoratorMetadata` compiler option is set `true` in TypeScript's `tsconfig.json` configuration file. The CLI configures `tsconfig.json` with `emitDecoratorMetadata: true`.
|
||||
|
||||
This means you're responsible for putting `@Injectable()` on your service classes.
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
# Deployment
|
||||
|
||||
When you are ready to deploy your Angular application to a remote server, you have various options for
|
||||
deployment. You may need to configure
|
||||
This page describes techniques for deploying your Angular application to a remote server.
|
||||
|
||||
{@a dev-deploy}
|
||||
{@a copy-files}
|
||||
@ -19,214 +18,27 @@ For the simplest deployment, build for development and copy the output directory
|
||||
|
||||
2. Copy _everything_ within the output folder (`dist/` by default) to a folder on the server.
|
||||
|
||||
3. Configure the server to redirect requests for missing files to `index.html`.
|
||||
|
||||
3. If you copy the files into a server _sub-folder_, append the build flag, `--base-href` and set the `<base href>` appropriately.<br><br>
|
||||
|
||||
For example, if the `index.html` is on the server at `/my/app/index.html`, set the _base href_ to
|
||||
`<base href="/my/app/">` like this.
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
ng build --base-href=/my/app/
|
||||
</code-example>
|
||||
|
||||
You'll see that the `<base href>` is set properly in the generated `dist/index.html`.<br><br>
|
||||
If you copy to the server's root directory, omit this step and leave the `<base href>` alone.<br><br>
|
||||
Learn more about the role of `<base href>` [below](guide/deployment#base-tag).
|
||||
|
||||
|
||||
4. Configure the server to redirect requests for missing files to `index.html`.
|
||||
Learn more about server-side redirects [below](guide/deployment#fallback).
|
||||
|
||||
|
||||
This is _not_ a production deployment. It's not optimized and it won't be fast for users.
|
||||
It might be good enough for sharing your progress and ideas internally with managers, teammates, and other stakeholders. For the next steps in deployment, see [Optimize for production](#optimize).
|
||||
|
||||
{@a deploy-to-github}
|
||||
|
||||
## Deploy to GitHub pages
|
||||
|
||||
Another simple way to deploy your Angular app is to use [GitHub Pages](https://help.github.com/articles/what-is-github-pages/).
|
||||
|
||||
1. You will need to [create a GitHub account](https://github.com/join) if you don't have one, then [create a repository](https://help.github.com/articles/create-a-repo/) for your project.
|
||||
Make a note of the user name and project name in GitHub.
|
||||
|
||||
1. Build your project using Github project name, with the following CLI command:
|
||||
<code-example language="none" class="code-shell">
|
||||
ng build --prod --output-path docs --base-href <project_name>
|
||||
</code-example>
|
||||
|
||||
1. When the build is complete, make a copy of `docs/index.html` and name it `docs/404.html`.
|
||||
|
||||
1. Commit your changes and push.
|
||||
|
||||
1. On the GitHub project page, configure it to [publish from the docs folder](https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/#publishing-your-github-pages-site-from-a-docs-folder-on-your-master-branch).
|
||||
|
||||
You can see your deployed page at `https://<user_name>.github.io/<project_name>/`.
|
||||
|
||||
<div class="alert-is-helpful>
|
||||
|
||||
Check out [angular-cli-ghpages](https://github.com/angular-buch/angular-cli-ghpages), a full featured package that does all this for you and has extra functionality.
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
{@a server-configuration}
|
||||
|
||||
## Server configuration
|
||||
|
||||
This section covers changes you may have make to the server or to files deployed to the server.
|
||||
|
||||
{@a fallback}
|
||||
|
||||
### Routed apps must fallback to `index.html`
|
||||
|
||||
Angular apps are perfect candidates for serving with a simple static HTML server.
|
||||
You don't need a server-side engine to dynamically compose application pages because
|
||||
Angular does that on the client-side.
|
||||
|
||||
If the app uses the Angular router, you must configure the server
|
||||
to return the application's host page (`index.html`) when asked for a file that it does not have.
|
||||
|
||||
{@a deep-link}
|
||||
|
||||
A routed application should support "deep links".
|
||||
A _deep link_ is a URL that specifies a path to a component inside the app.
|
||||
For example, `http://www.mysite.com/heroes/42` is a _deep link_ to the hero detail page
|
||||
that displays the hero with `id: 42`.
|
||||
|
||||
There is no issue when the user navigates to that URL from within a running client.
|
||||
The Angular router interprets the URL and routes to that page and hero.
|
||||
|
||||
But clicking a link in an email, entering it in the browser address bar,
|
||||
or merely refreshing the browser while on the hero detail page —
|
||||
all of these actions are handled by the browser itself, _outside_ the running application.
|
||||
The browser makes a direct request to the server for that URL, bypassing the router.
|
||||
|
||||
A static server routinely returns `index.html` when it receives a request for `http://www.mysite.com/`.
|
||||
But it rejects `http://www.mysite.com/heroes/42` and returns a `404 - Not Found` error *unless* it is
|
||||
configured to return `index.html` instead.
|
||||
|
||||
#### Fallback configuration examples
|
||||
|
||||
There is no single configuration that works for every server.
|
||||
The following sections describe configurations for some of the most popular servers.
|
||||
The list is by no means exhaustive, but should provide you with a good starting point.
|
||||
|
||||
#### Development servers
|
||||
|
||||
During development, the `ng serve` command lets you run your app in a local browser.
|
||||
The CLI recompiles the application each time you save a file,
|
||||
and reloads the browser with the newly compiled application.
|
||||
|
||||
The app is hosted in local memory and served on `http://localhost:4200/`, using [webpack-dev-server](https://webpack.js.org/guides/development/#webpack-dev-server).
|
||||
|
||||
{@a serve-from-disk}
|
||||
|
||||
Later in development, you might want a closer approximation of how your app will behave when deployed.
|
||||
You can output your distribution folder (`dist`) to disk, but you need to install a different web server.
|
||||
Try installing [lite-server](https://github.com/johnpapa/lite-server); like `webpack-dev-server`, it can automatically reload your browser when you write new files.
|
||||
|
||||
To get the live-reload experience, you will need to run two terminals.
|
||||
The first runs the build in a watch mode and compiles the application to the `dist` folder.
|
||||
The second runs the web server against the `dist` folder.
|
||||
The combination of these two processes provides the same behavior as `ng serve`.
|
||||
|
||||
1. Start the build in terminal A:
|
||||
<code-example language="none" class="code-shell">
|
||||
ng build --watch
|
||||
</code-example>
|
||||
|
||||
1. Start the web server in terminal B:
|
||||
<code-example language="none" class="code-shell">
|
||||
lite-server --baseDir="dist"
|
||||
</code-example>
|
||||
The default browser opens to the appropriate URL.
|
||||
|
||||
* [Lite-Server](https://github.com/johnpapa/lite-server): the default dev server installed with the
|
||||
[Quickstart repo](https://github.com/angular/quickstart) is pre-configured to fallback to `index.html`.
|
||||
|
||||
* [Webpack-Dev-Server](https://github.com/webpack/webpack-dev-server): setup the
|
||||
`historyApiFallback` entry in the dev server options as follows:
|
||||
|
||||
<code-example>
|
||||
historyApiFallback: {
|
||||
disableDotRule: true,
|
||||
htmlAcceptHeaders: ['text/html', 'application/xhtml+xml']
|
||||
}
|
||||
</code-example>
|
||||
|
||||
#### Production servers
|
||||
|
||||
* [Apache](https://httpd.apache.org/): add a
|
||||
[rewrite rule](http://httpd.apache.org/docs/current/mod/mod_rewrite.html) to the `.htaccess` file as shown
|
||||
(https://ngmilk.rocks/2015/03/09/angularjs-html5-mode-or-pretty-urls-on-apache-using-htaccess/):
|
||||
|
||||
<code-example format=".">
|
||||
RewriteEngine On
|
||||
# If an existing asset or directory is requested go to it as it is
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# If the requested resource doesn't exist, use index.html
|
||||
RewriteRule ^ /index.html
|
||||
</code-example>
|
||||
|
||||
|
||||
* [Nginx](http://nginx.org/): use `try_files`, as described in
|
||||
[Front Controller Pattern Web Apps](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#front-controller-pattern-web-apps),
|
||||
modified to serve `index.html`:
|
||||
|
||||
<code-example format=".">
|
||||
try_files $uri $uri/ /index.html;
|
||||
</code-example>
|
||||
|
||||
|
||||
* [IIS](https://www.iis.net/): add a rewrite rule to `web.config`, similar to the one shown
|
||||
[here](http://stackoverflow.com/a/26152011/2116927):
|
||||
|
||||
<code-example format='.'>
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="Angular Routes" stopProcessing="true">
|
||||
<match url=".*" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="/index.html" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
</system.webServer>
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
* [GitHub Pages](https://pages.github.com/): you can't
|
||||
[directly configure](https://github.com/isaacs/github/issues/408)
|
||||
the GitHub Pages server, but you can add a 404 page.
|
||||
Copy `index.html` into `404.html`.
|
||||
It will still be served as the 404 response, but the browser will process that page and load the app properly.
|
||||
It's also a good idea to
|
||||
[serve from `docs/` on master](https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/#publishing-your-github-pages-site-from-a-docs-folder-on-your-master-branch)
|
||||
and to
|
||||
[create a `.nojekyll` file](https://www.bennadel.com/blog/3181-including-node-modules-and-vendors-folders-in-your-github-pages-site.htm)
|
||||
|
||||
|
||||
* [Firebase hosting](https://firebase.google.com/docs/hosting/): add a
|
||||
[rewrite rule](https://firebase.google.com/docs/hosting/url-redirects-rewrites#section-rewrites).
|
||||
|
||||
<code-example format=".">
|
||||
"rewrites": [ {
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
} ]
|
||||
|
||||
</code-example>
|
||||
|
||||
{@a cors}
|
||||
|
||||
### Requesting services from a different server (CORS)
|
||||
|
||||
Angular developers may encounter a
|
||||
<a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing" title="Cross-origin resource sharing">
|
||||
<i>cross-origin resource sharing</i></a> error when making a service request (typically a data service request)
|
||||
to a server other than the application's own host server.
|
||||
Browsers forbid such requests unless the server permits them explicitly.
|
||||
|
||||
There isn't anything the client application can do about these errors.
|
||||
The server must be configured to accept the application's requests.
|
||||
Read about how to enable CORS for specific servers at
|
||||
<a href="http://enable-cors.org/server.html" title="Enabling CORS server">enable-cors.org</a>.
|
||||
|
||||
<hr>
|
||||
It might be good enough for sharing your progress and ideas internally with managers, teammates, and other stakeholders.
|
||||
|
||||
{@a optimize}
|
||||
|
||||
@ -253,8 +65,14 @@ The `--prod` _meta-flag_ engages the following optimization features.
|
||||
|
||||
The remaining [copy deployment steps](#copy-files) are the same as before.
|
||||
|
||||
See [Building and serving Angular apps](guide/build)
|
||||
for more about CLI build options and what they do.
|
||||
You may further reduce bundle sizes by adding the `build-optimizer` flag.
|
||||
|
||||
<code-example language="none" class="code-shell">
|
||||
ng build --prod --build-optimizer
|
||||
</code-example>
|
||||
|
||||
See the [CLI Documentation](https://github.com/angular/angular-cli/wiki/build)
|
||||
for details about available build options and what they do.
|
||||
|
||||
{@a enable-prod-mode}
|
||||
|
||||
@ -284,24 +102,22 @@ Configure the Angular Router to defer loading of all other modules (and their as
|
||||
or by [_lazy loading_](guide/router#asynchronous-routing "Lazy loading")
|
||||
them on demand.
|
||||
|
||||
<div class="alert-is-helpful>
|
||||
#### Don't eagerly import something from a lazy loaded module
|
||||
|
||||
#### Don't eagerly import something from a lazy-loaded module
|
||||
|
||||
If you mean to lazy-load a module, be careful not import it
|
||||
in a file that's eagerly loaded when the app starts (such as the root `AppModule`).
|
||||
It's a common mistake.
|
||||
You've arranged to lazy load a module.
|
||||
But you unintentionally import it, with a JavaScript `import` statement,
|
||||
in a file that's eagerly loaded when the app starts, a file such as the root `AppModule`.
|
||||
If you do that, the module will be loaded immediately.
|
||||
|
||||
The bundling configuration must take lazy loading into consideration.
|
||||
Because lazy-loaded modules aren't imported in JavaScript, bundlers exclude them by default.
|
||||
Bundlers don't know about the router configuration and can't create separate bundles for lazy-loaded modules.
|
||||
You would have to create these bundles manually.
|
||||
Because lazy loaded modules aren't imported in JavaScript (as just noted), bundlers exclude them by default.
|
||||
Bundlers don't know about the router configuration and won't create separate bundles for lazy loaded modules.
|
||||
You have to create these bundles manually.
|
||||
|
||||
The CLI runs the
|
||||
[Angular Ahead-of-Time Webpack Plugin](https://github.com/angular/angular-cli/tree/master/packages/%40ngtools/webpack)
|
||||
which automatically recognizes lazy-loaded `NgModules` and creates separate bundles for them.
|
||||
|
||||
</div>
|
||||
which automatically recognizes lazy loaded `NgModules` and creates separate bundles for them.
|
||||
|
||||
{@a measure}
|
||||
|
||||
@ -387,12 +203,17 @@ the subfolder is `my/app/` and you should add `<base href="/my/app/">` to the se
|
||||
When the `base` tag is mis-configured, the app fails to load and the browser console displays `404 - Not Found` errors
|
||||
for the missing files. Look at where it _tried_ to find those files and adjust the base tag appropriately.
|
||||
|
||||
## Building and serving for deployment
|
||||
## _build_ vs. _serve_
|
||||
|
||||
When you are designing and developing applications, you typically use `ng serve` to build your app for fast, local, iterative development.
|
||||
When you are ready to deploy, however, you must use the `ng build` command to build the app and deploy the build artifacts elsewhere.
|
||||
You'll probably prefer `ng build` for deployments.
|
||||
|
||||
Both `ng build` and `ng serve` clear the output folder before they build the project, but only the `build` command writes the generated build artifacts to the output folder.
|
||||
The **ng build** command is intended for building the app and deploying the build artifacts elsewhere.
|
||||
The **ng serve** command is intended for fast, local, iterative development.
|
||||
|
||||
Both `ng build` and `ng serve` **clear the output folder** before they build the project.
|
||||
The `ng build` command writes generated build artifacts to the output folder.
|
||||
The `ng serve` command does not.
|
||||
It serves build artifacts from memory instead for a faster development experience.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
@ -401,13 +222,160 @@ To output to a different folder, change the `outputPath` in `angular.json`.
|
||||
|
||||
</div>
|
||||
|
||||
The`serve` command builds, watches, and serves the application from local memory, using a local development server.
|
||||
When you have deployed your app to another server, however, you might still want to serve the app so that you can continue to see changes that you make in it.
|
||||
You can do this by adding the `--watch` option to the `build` command.
|
||||
The `ng serve` command builds, watches, and serves the application from a local CLI development server.
|
||||
|
||||
```
|
||||
ng build --watch
|
||||
```
|
||||
Like the `serve` command, this regenerates output files when source files change.
|
||||
The `ng build` command generates output files just once and does not serve them.
|
||||
The `ng build --watch` command will regenerate output files when source files change.
|
||||
This `--watch` flag is useful if you're building during development and
|
||||
are automatically re-deploying changes to another server.
|
||||
|
||||
For complete details of the CLI commands and configuration options, see the *CLI Reference (link TBD)*.
|
||||
|
||||
See the [CLI `build` topic](https://github.com/angular/angular-cli/wiki/build) for more details and options.
|
||||
|
||||
<hr>
|
||||
|
||||
{@a server-configuration}
|
||||
|
||||
## Server configuration
|
||||
|
||||
This section covers changes you may have make to the server or to files deployed to the server.
|
||||
|
||||
{@a fallback}
|
||||
|
||||
### Routed apps must fallback to `index.html`
|
||||
|
||||
Angular apps are perfect candidates for serving with a simple static HTML server.
|
||||
You don't need a server-side engine to dynamically compose application pages because
|
||||
Angular does that on the client-side.
|
||||
|
||||
If the app uses the Angular router, you must configure the server
|
||||
to return the application's host page (`index.html`) when asked for a file that it does not have.
|
||||
|
||||
{@a deep-link}
|
||||
|
||||
|
||||
A routed application should support "deep links".
|
||||
A _deep link_ is a URL that specifies a path to a component inside the app.
|
||||
For example, `http://www.mysite.com/heroes/42` is a _deep link_ to the hero detail page
|
||||
that displays the hero with `id: 42`.
|
||||
|
||||
There is no issue when the user navigates to that URL from within a running client.
|
||||
The Angular router interprets the URL and routes to that page and hero.
|
||||
|
||||
But clicking a link in an email, entering it in the browser address bar,
|
||||
or merely refreshing the browser while on the hero detail page —
|
||||
all of these actions are handled by the browser itself, _outside_ the running application.
|
||||
The browser makes a direct request to the server for that URL, bypassing the router.
|
||||
|
||||
A static server routinely returns `index.html` when it receives a request for `http://www.mysite.com/`.
|
||||
But it rejects `http://www.mysite.com/heroes/42` and returns a `404 - Not Found` error *unless* it is
|
||||
configured to return `index.html` instead.
|
||||
|
||||
#### Fallback configuration examples
|
||||
|
||||
There is no single configuration that works for every server.
|
||||
The following sections describe configurations for some of the most popular servers.
|
||||
The list is by no means exhaustive, but should provide you with a good starting point.
|
||||
|
||||
#### Development servers
|
||||
|
||||
* [Lite-Server](https://github.com/johnpapa/lite-server): the default dev server installed with the
|
||||
[Quickstart repo](https://github.com/angular/quickstart) is pre-configured to fallback to `index.html`.
|
||||
|
||||
|
||||
* [Webpack-Dev-Server](https://github.com/webpack/webpack-dev-server): setup the
|
||||
`historyApiFallback` entry in the dev server options as follows:
|
||||
|
||||
<code-example>
|
||||
historyApiFallback: {
|
||||
disableDotRule: true,
|
||||
htmlAcceptHeaders: ['text/html', 'application/xhtml+xml']
|
||||
}
|
||||
</code-example>
|
||||
|
||||
|
||||
#### Production servers
|
||||
|
||||
* [Apache](https://httpd.apache.org/): add a
|
||||
[rewrite rule](http://httpd.apache.org/docs/current/mod/mod_rewrite.html) to the `.htaccess` file as shown
|
||||
(https://ngmilk.rocks/2015/03/09/angularjs-html5-mode-or-pretty-urls-on-apache-using-htaccess/):
|
||||
|
||||
<code-example format=".">
|
||||
RewriteEngine On
|
||||
# If an existing asset or directory is requested go to it as it is
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
|
||||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# If the requested resource doesn't exist, use index.html
|
||||
RewriteRule ^ /index.html
|
||||
</code-example>
|
||||
|
||||
|
||||
* [NGinx](http://nginx.org/): use `try_files`, as described in
|
||||
[Front Controller Pattern Web Apps](https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#front-controller-pattern-web-apps),
|
||||
modified to serve `index.html`:
|
||||
|
||||
<code-example format=".">
|
||||
try_files $uri $uri/ /index.html;
|
||||
</code-example>
|
||||
|
||||
|
||||
* [IIS](https://www.iis.net/): add a rewrite rule to `web.config`, similar to the one shown
|
||||
[here](http://stackoverflow.com/a/26152011/2116927):
|
||||
|
||||
<code-example format='.'>
|
||||
<system.webServer>
|
||||
<rewrite>
|
||||
<rules>
|
||||
<rule name="Angular Routes" stopProcessing="true">
|
||||
<match url=".*" />
|
||||
<conditions logicalGrouping="MatchAll">
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
|
||||
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
|
||||
</conditions>
|
||||
<action type="Rewrite" url="/index.html" />
|
||||
</rule>
|
||||
</rules>
|
||||
</rewrite>
|
||||
</system.webServer>
|
||||
|
||||
</code-example>
|
||||
|
||||
|
||||
* [GitHub Pages](https://pages.github.com/): you can't
|
||||
[directly configure](https://github.com/isaacs/github/issues/408)
|
||||
the GitHub Pages server, but you can add a 404 page.
|
||||
Copy `index.html` into `404.html`.
|
||||
It will still be served as the 404 response, but the browser will process that page and load the app properly.
|
||||
It's also a good idea to
|
||||
[serve from `docs/` on master](https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/#publishing-your-github-pages-site-from-a-docs-folder-on-your-master-branch)
|
||||
and to
|
||||
[create a `.nojekyll` file](https://www.bennadel.com/blog/3181-including-node-modules-and-vendors-folders-in-your-github-pages-site.htm)
|
||||
|
||||
|
||||
* [Firebase hosting](https://firebase.google.com/docs/hosting/): add a
|
||||
[rewrite rule](https://firebase.google.com/docs/hosting/url-redirects-rewrites#section-rewrites).
|
||||
|
||||
<code-example format=".">
|
||||
"rewrites": [ {
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
} ]
|
||||
|
||||
</code-example>
|
||||
|
||||
{@a cors}
|
||||
|
||||
### Requesting services from a different server (CORS)
|
||||
|
||||
Angular developers may encounter a
|
||||
<a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing" title="Cross-origin resource sharing">
|
||||
<i>cross-origin resource sharing</i></a> error when making a service request (typically a data service request)
|
||||
to a server other than the application's own host server.
|
||||
Browsers forbid such requests unless the server permits them explicitly.
|
||||
|
||||
There isn't anything the client application can do about these errors.
|
||||
The server must be configured to accept the application's requests.
|
||||
Read about how to enable CORS for specific servers at
|
||||
<a href="http://enable-cors.org/server.html" title="Enabling CORS server">enable-cors.org</a>.
|
||||
|
@ -1,382 +0,0 @@
|
||||
# Workspace and project file structure
|
||||
|
||||
An Angular CLI project is the foundation for both quick experiments and enterprise solutions. The CLI command `ng new` creates an Angular workspace in your file system that is the root for new projects, which can be apps and libraries.
|
||||
|
||||
## Workspaces and project files
|
||||
|
||||
Angular 6 introduced the [workspace](guide/glossary#workspace) directory structure for Angular [projects](guide/glossary#project). A project can be a standalone *application* or a *library*, and a workspace can contain multiple applications, as well as libraries that can be used in any of the apps.
|
||||
|
||||
The CLI command `ng new my-workspace` creates a workspace folder and generates a new app skeleton in an `app` folder within that workspace.
|
||||
Within the `app/` folder, a `src/` subfolder contains the logic, data, and assets.
|
||||
A newly generated `app/` folder contains the source files for a root module, with a root component and template.
|
||||
|
||||
The `app/` folder also contains project-specific configuration files, end-to-end tests, and the Angular system modules.
|
||||
|
||||
```
|
||||
my-workspace/
|
||||
app/
|
||||
e2e/
|
||||
src/
|
||||
node_modules/
|
||||
src/
|
||||
```
|
||||
|
||||
When this workspace file structure is in place, you can use the `ng generate` command on the command line to add functionality and data to the initial app.
|
||||
|
||||
<div class="alert-is-helpful>
|
||||
|
||||
Besides using the CLI on the command line, You can also use an interactive development environment like [Angular Console](https://angular.console.com), or manipulate files directly in the app's source folder and configuration files.
|
||||
|
||||
</div>
|
||||
|
||||
{@a global-config}
|
||||
|
||||
## Global workspace configuration
|
||||
|
||||
A workspace can contain additional apps and libraries, each with its own root folder under `projects/`.
|
||||
|
||||
```
|
||||
my-workspace/
|
||||
app/
|
||||
projects/
|
||||
my-app/
|
||||
helpful-library/
|
||||
my-other-app/
|
||||
angular.json
|
||||
|
||||
```
|
||||
At the top level of the workspace, the CLI configuration file, `angular.json`, let you set defaults for all projects in the workspace. You can configure a workspace, for example, such that all projects in it have global access to libraries, scripts, and CSS styles. (For more in this, see [Configuring global access](#global-access).)
|
||||
|
||||
You can also use `ng generate app` to create new Angular apps in the workspace, and use the `ng add` command to add libraries.
|
||||
If you add libraries or generate more apps within a workspace, a `projects/` folder is created to contain the new libraries or apps.
|
||||
Additional apps and library subfolders have the same file structure as the initial app.
|
||||
|
||||
All of the projects within a workspace share a CLI configuration context, controlled by the `angular.json` configuration file at the root level of the workspace.
|
||||
|
||||
| GLOBAL CONFIG FILES | PURPOSE |
|
||||
| :------------- | :------------------------------------------|
|
||||
| `angular.json` | Sets defaults for the CLI and configuration options for build, serve, and test tools that the CLI uses, such as [Karma](https://karma-runner.github.io/) and [Protractor](http://www.protractortest.org/). For complete details, see *CLI Reference (link TBD)*. |
|
||||
|
||||
## App source folder
|
||||
|
||||
The app-root source folder contains your app's logic and data. Angular components, templates, styles, images, and anything else your app needs go here. Files outside of the source folder support testing and building your app.
|
||||
|
||||
```
|
||||
src/
|
||||
app/
|
||||
app.component.css
|
||||
app.component.html
|
||||
app.component.spec.ts
|
||||
app.component.ts
|
||||
app.module.ts
|
||||
assets/...
|
||||
favicon.ico
|
||||
index.html
|
||||
main.ts
|
||||
test.ts
|
||||
```
|
||||
|
||||
| APP SOURCE FILES | PURPOSE |
|
||||
| :----------------------------- | :------------------------------------------|
|
||||
| `app/app.component.ts` | Defines the logic for the app's root component, named AppComponent. The view associated with this root component becomes the root of the [view hierarchy](guide/glossary#view-hierarchy) as you add components and services to your app. |
|
||||
| `app/app.component.html` | Defines the HTML template associated with the root AppComponent. |
|
||||
| `app/app.component.css` | Defines the base CSS stylesheet for the root AppComponent. |
|
||||
| `app/app.component.spec.ts` | Defines a unit test for the root AppComponent. |
|
||||
| `app/app.module.ts` | Defines the root module, named AppModule, that tells Angular how to assemble the application. Initially declares only the AppComponent. As you add more components to the app, they must be declared here. |
|
||||
| `assets/*` | Contains image files and other asset files to be copied as-is when you build your application. |
|
||||
|
||||
| PROJECT-LEVEL FILES | PURPOSE |
|
||||
| :------------------------ | :------------------------------------------|
|
||||
| `favicon.ico` | An icon to use for this app in the bookmark bar. |
|
||||
| `index.html` | The main HTML page that is served when someone visits your site. The CLI automatically adds all JavaScript and CSS files when building your app, so you typically don't need to add any `<script>` or` <link>` tags here manually. |
|
||||
| `main.ts` | The main entry point for your app. Compiles the application with the [JIT compiler](https://angular.io/guide/glossary#jit) and bootstraps the application's root module (AppModule) to run in the browser. You can also use the [AOT compiler](https://angular.io/guide/aot-compiler) without changing any code by appending the `--aot` flag to the CLI `build` and `serve` commands. |
|
||||
| `test.ts` | The main entry point for your unit tests, with some Angular-specific configuration. You don't typically need to edit this file. |
|
||||
|
||||
## App support file structure
|
||||
|
||||
Additional files in a project's root folder help you build, test, maintain, document, and deploy the app. These files go in the app root folder next to `src/`.
|
||||
|
||||
```
|
||||
workspace_root/
|
||||
my-app/
|
||||
e2e/
|
||||
src/
|
||||
app.e2e-spec.ts
|
||||
app.po.ts
|
||||
tsconfig.e2e.json
|
||||
protractor.conf.js
|
||||
node_modules/...
|
||||
src/...
|
||||
```
|
||||
|
||||
| FOLDERS | PURPOSE |
|
||||
| :---------------- | :-------------------------------------------- |
|
||||
| `e2e/` | This folder contains end-to-end tests for the app. This is a separate app that tests your main app. The folder and its contents are generated automatically when you create a new app with the CLI `new` or `generate` command. |
|
||||
| `node_modules/` | Node.js creates this folder and puts all third party modules listed in `package.json` in it. *when? doesn't ng new create it?* |
|
||||
|
||||
### Project-level configuration
|
||||
|
||||
Each project uses the CLI configuration at the workspace root-level `angular.json` file.
|
||||
Additional project-specific configuration files are found at the project root level of each app or library.
|
||||
|
||||
```
|
||||
my-workspace/
|
||||
app/
|
||||
.editorconfig
|
||||
.gitignore
|
||||
package.json
|
||||
README.md
|
||||
tsconfig.json
|
||||
tsconfig.test.json
|
||||
tslint.json
|
||||
projects/
|
||||
helpful-library/
|
||||
my-other-app/
|
||||
.editorconfig
|
||||
.gitignore
|
||||
package.json
|
||||
README.md
|
||||
tsconfig.json
|
||||
tsconfig.test.json
|
||||
tslint.json
|
||||
angular.json
|
||||
```
|
||||
|
||||
| CONFIGURATION FILES | PURPOSE |
|
||||
| :------------------ | :-------------------------------------------- |
|
||||
| `.editorconfig` | Simple configuration for your editor to make sure everyone who uses your project has the same basic configuration. Supported by most editors. See http://editorconfig.org for more information. |
|
||||
| `.gitignore` | Git configuration to make sure autogenerated files are not committed to source control. |
|
||||
| `package.json` | Configures the `npm` package manager, listing the third party packages your project uses. You can also add your own custom scripts here. |
|
||||
| `README.md` | Basic documentation for your project, pre-filled with CLI command information. We recommend that you keep this updated so that anyone checking out the repo can build your app. |
|
||||
| `tsconfig.json` | TypeScript compiler configuration, that an IDE such as [Visual Studio Code](https://code.visualstudio.com/) uses to give you helpful tooling. |
|
||||
| `tslint.json` | Linting configuration for [TSLint](https://palantir.github.io/tslint/) together with [Codelyzer](http://codelyzer.com/), used when running the CLI `lint` command. Linting helps keep your code style consistent. |
|
||||
|
||||
{@a global-access}
|
||||
|
||||
## Configuring global access
|
||||
|
||||
The CLI configuration scope is global for a workspace.
|
||||
You can make scripts, libraries, and styles available to all projects in the workspace by setting options in the `angular.json` file in the root workspace folder.
|
||||
|
||||
|
||||
### Adding global scripts
|
||||
|
||||
You can configure your project to add JavaScript files to the global scope.
|
||||
This is especially useful for legacy libraries or analytic snippets.
|
||||
|
||||
In the CLI configuration file, `angular.json`, add the associated script files to the `scripts` array.
|
||||
The scripts are loaded exactly as if you had added them in a `<script>` tag inside `index.html`.
|
||||
For example:
|
||||
|
||||
```
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"scripts": [
|
||||
"src/global-script.js",
|
||||
],
|
||||
```
|
||||
|
||||
You can also rename the output from a script and lazy load it by using the object format in the "scripts" entry.
|
||||
For example:
|
||||
|
||||
```
|
||||
"scripts": [
|
||||
"src/global-script.js",
|
||||
{ "input": "src/lazy-script.js", "lazy": true },
|
||||
{ "input": "src/pre-rename-script.js", "bundleName": "renamed-script" },
|
||||
],
|
||||
```
|
||||
|
||||
If you need to add scripts for unit tests, specify them the same way in the "test" target.
|
||||
|
||||
{@a add-lib}
|
||||
### Adding a global library
|
||||
|
||||
Some JavaScript libraries need to be added to the global scope and loaded as if they were in a script tag.
|
||||
Configure the CLI to do this using the "scripts" and "styles" options of the build target in the CLI configuration file, `angular.json`.
|
||||
|
||||
For example, to use the [Bootstrap 4](https://getbootstrap.com/docs/4.0/getting-started/introduction/)
|
||||
library, first install the library and its dependencies using the `npm` package manager:
|
||||
|
||||
```
|
||||
npm install jquery --save
|
||||
npm install popper.js --save
|
||||
npm install bootstrap --save
|
||||
```
|
||||
|
||||
In the `angular.json` configuration file, add the associated script files to the "scripts" array:
|
||||
|
||||
```
|
||||
"scripts": [
|
||||
"node_modules/jquery/dist/jquery.slim.js",
|
||||
"node_modules/popper.js/dist/umd/popper.js",
|
||||
"node_modules/bootstrap/dist/js/bootstrap.js"
|
||||
],
|
||||
```
|
||||
|
||||
Add the Bootstrap CSS file to the "styles" array:
|
||||
|
||||
```
|
||||
"styles": [
|
||||
"node_modules/bootstrap/dist/css/bootstrap.css",
|
||||
"src/styles.css"
|
||||
],
|
||||
```
|
||||
|
||||
Run or restart `ng serve` to see Bootstrap 4 working in your app.
|
||||
|
||||
#### Using global libraries inside your app
|
||||
|
||||
Once you import a library using the "scripts" array in the configuration file,
|
||||
you should *not* import it using an `import` statement in your TypeScript code
|
||||
(such as `import * as $ from 'jquery';`).
|
||||
If you do, you'll end up with two different copies of the library:
|
||||
one imported as a global library, and one imported as a module.
|
||||
This is especially bad for libraries with plugins, like JQuery,
|
||||
because each copy will have different plugins.
|
||||
|
||||
Instead, download typings for your library (`npm install @types/jquery`) and follow the installation steps
|
||||
given above in [Adding a global library](#add-lib).
|
||||
This gives you access to the global variables exposed by that library.
|
||||
|
||||
{@a define-types}
|
||||
#### Defining typings for global libraries
|
||||
|
||||
If the global library you need to use does not have global typings,
|
||||
you can declare them manually as `any` in `src/typings.d.ts`. For example:
|
||||
|
||||
```
|
||||
declare var libraryName: any;
|
||||
```
|
||||
|
||||
Some scripts extend other libraries; for instance with JQuery plugins:
|
||||
|
||||
```
|
||||
$('.test').myPlugin();
|
||||
```
|
||||
|
||||
In this case, the installed `@types/jquery` doesn't include `myPlugin`,
|
||||
so you need to add an *interface* in `src/typings.d.ts`.
|
||||
For example:
|
||||
|
||||
```
|
||||
interface JQuery {
|
||||
myPlugin(options?: any): any;
|
||||
}
|
||||
```
|
||||
|
||||
If you fail to add the interface for the script-defined extension, your IDE shows an error:
|
||||
|
||||
```
|
||||
[TS][Error] Property 'myPlugin' does not exist on type 'JQuery'
|
||||
```
|
||||
|
||||
### Adding global styles and style preprocessors
|
||||
|
||||
Angular CLI supports CSS imports and all major CSS preprocessors:
|
||||
|
||||
* [Sass/Scss](http://sass-lang.com/)
|
||||
* [Less](http://lesscss.org/)
|
||||
* [Stylus](http://stylus-lang.com/)
|
||||
|
||||
Angular assumes CSS styles by default, but when you create a project with the
|
||||
CLI `new` command, you can specify the `--style` option to use SASS or STYL styles.
|
||||
|
||||
```
|
||||
> ng new sassyproject --style=sass
|
||||
> ng new scss-project --style=scss
|
||||
> ng new less-project --style=less
|
||||
> ng new styl-project --style=styl
|
||||
```
|
||||
|
||||
You can also set the default style for an existing project by configuring `@schematics/angular`,
|
||||
the default schematic for the Angular CLI:
|
||||
|
||||
```
|
||||
> ng config schematics.@schematics/angular:component.styleext scss
|
||||
```
|
||||
|
||||
#### Style configuration
|
||||
|
||||
By default, the `styles.css` configuration file lists CSS files that supply global styles for a project.
|
||||
If you are using another style type, there is a similar configuration file for global style files of that type,
|
||||
with the extension for that style type, such as `styles.sass`.
|
||||
|
||||
You can add more global styles by configuring the build options in the `angular.json` configuration file.
|
||||
List the style files in the "styles" section in your project's "build" target
|
||||
The files are loaded exactly as if you had added them in a `<link>` tag inside `index.html`.
|
||||
|
||||
```
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"styles": [
|
||||
"src/styles.css",
|
||||
"src/more-styles.css",
|
||||
],
|
||||
...
|
||||
```
|
||||
|
||||
If you need the styles in your unit tests, add them to the "styles" option in the "test" target configuration as well.
|
||||
|
||||
You can specify styles in an object format to rename the output and lazy load it:
|
||||
|
||||
```
|
||||
"styles": [
|
||||
"src/styles.css",
|
||||
"src/more-styles.css",
|
||||
{ "input": "src/lazy-style.scss", "lazy": true },
|
||||
{ "input": "src/pre-rename-style.scss", "bundleName": "renamed-style" },
|
||||
],
|
||||
```
|
||||
|
||||
In Sass and Stylus you can make use of the `includePaths` functionality for both component and global styles,
|
||||
which allows you to add extra base paths to be checked for imports.
|
||||
To add paths, use the `stylePreprocessorOptions` build-target option:
|
||||
|
||||
```
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": [
|
||||
"src/style-paths"
|
||||
]
|
||||
},
|
||||
```
|
||||
|
||||
You can then import files in the given folder (such as `src/style-paths/_variables.scss`)
|
||||
anywhere in your project without the need for a relative path:
|
||||
|
||||
```
|
||||
// src/app/app.component.scss
|
||||
// A relative path works
|
||||
@import '../style-paths/variables';
|
||||
// But now this works as well
|
||||
@import 'variables';
|
||||
```
|
||||
|
||||
#### CSS preprocessor integration
|
||||
|
||||
To use a supported CSS preprocessor, add the URL for the preprocessor
|
||||
to your component's `styleUrls` in the `@Component()` metadata.
|
||||
For example:
|
||||
|
||||
```
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.scss']
|
||||
})
|
||||
export class AppComponent {
|
||||
title = 'app works!';
|
||||
}
|
||||
```
|
||||
|
||||
<div class="alert-is-helpful>
|
||||
|
||||
Style strings added directly to the `@Component() styles array must be written in CSS.
|
||||
The CLI cannot apply a pre-processor to inline styles.
|
||||
|
||||
</div>
|
||||
|
@ -89,189 +89,6 @@ The root file names (`app.component`) are the same for both files.
|
||||
|
||||
Adopt these two conventions in your own projects for _every kind_ of test file.
|
||||
|
||||
{@a ci}
|
||||
|
||||
## Set up continuous integration
|
||||
|
||||
One of the best ways to keep your project bug free is through a test suite, but it's easy to forget to run tests all the time.
|
||||
Continuous integration (CI) servers let you set up your project repository so that your tests run on every commit and pull request.
|
||||
|
||||
There are paid CI services like Circle CI and Travis CI, and you can also host your own for free using Jenkins and others.
|
||||
Although Circle CI and Travis CI are paid services, they are provided free for open source projects.
|
||||
You can create a public project on GitHub and add these services without paying.
|
||||
Contributions to the Angular repo are automatically run through a whole suite of Circle CI and Travis CI tests.
|
||||
|
||||
This article explains how to configure your project to run Circle CI and Travis CI, and also update your test configuration to be able to run tests in the Chrome browser in either environment.
|
||||
|
||||
|
||||
### Configure project for Circle CI
|
||||
|
||||
Step 1: Create a folder called `.circleci` at the project root.
|
||||
|
||||
Step 2: In the new folder, create a file called `config.yml` with the following content:
|
||||
|
||||
```
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
working_directory: ~/my-project
|
||||
docker:
|
||||
- image: circleci/node:8-browsers
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: my-project-{{ .Branch }}-{{ checksum "package.json" }}
|
||||
- run: npm install
|
||||
- save_cache:
|
||||
key: my-project-{{ .Branch }}-{{ checksum "package.json" }}
|
||||
paths:
|
||||
- "node_modules"
|
||||
- run: xvfb-run -a npm run test -- --single-run --no-progress --browser=ChromeNoSandbox
|
||||
- run: xvfb-run -a npm run e2e -- --no-progress --config=protractor-ci.conf.js
|
||||
```
|
||||
|
||||
This configuration caches `node_modules/` and uses [`npm run`](https://docs.npmjs.com/cli/run-script) to run CLI commands, because `@angular/cli` is not installed globally.
|
||||
The double dash (`--`) is needed to pass arguments into the `npm` script.
|
||||
|
||||
For Chrome, it uses `xvfb-run` to run the `npm run` command using a virtual screen.
|
||||
|
||||
Step 3: Commit your changes and push them to your repository.
|
||||
|
||||
Step 4: [Sign up for Circle CI](https://circleci.com/docs/2.0/first-steps/) and [add your project](https://circleci.com/add-projects).
|
||||
Your project should start building.
|
||||
|
||||
* Learn more about Circle CI from [Circle CI documentation](https://circleci.com/docs/2.0/).
|
||||
|
||||
### Configure project for Travis CI
|
||||
|
||||
Step 1: Create a file called `.travis.yml` at the project root, with the following content:
|
||||
|
||||
```
|
||||
dist: trusty
|
||||
sudo: false
|
||||
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- ./node_modules
|
||||
|
||||
install:
|
||||
- npm install
|
||||
|
||||
script:
|
||||
# Use Chromium instead of Chrome.
|
||||
- export CHROME_BIN=chromium-browser
|
||||
- xvfb-run -a npm run test -- --single-run --no-progress --browser=ChromeNoSandbox
|
||||
- xvfb-run -a npm run e2e -- --no-progress --config=protractor-ci.conf.js
|
||||
```
|
||||
|
||||
This does the same things as the Circle CI configuration, except that Travis doesn't come with Chrome, so we use Chromium instead.
|
||||
|
||||
Step 2: Commit your changes and push them to your repository.
|
||||
|
||||
Step 3: [Sign up for Travis CI](https://travis-ci.org/auth) and [add your project](https://travis-ci.org/profile).
|
||||
You'll need to push a new commit to trigger a build.
|
||||
|
||||
* Learn more about Travis CI testing from [Travis CI documentation](https://docs.travis-ci.com/).
|
||||
|
||||
### Configure CLI for CI testing in Chrome
|
||||
|
||||
When the CLI commands `ng test` and `ng e2e` are generally running the CI tests in your environment, you might still need to adjust your configuration to run the Chrome browser tests.
|
||||
|
||||
There are configuration files for both the [Karma JavaScript test runner](http://karma-runner.github.io/2.0/config/configuration-file.html)
|
||||
and [Protractor](https://www.protractortest.org/#/api-overview) end-to-end testing tool,
|
||||
which you must adjust to start Chrome without sandboxing.
|
||||
|
||||
* In the Karma configuration file, `karma.conf.js`, add a custom launcher called ChromeNoSandbox below browsers:
|
||||
```
|
||||
browsers: ['Chrome'],
|
||||
customLaunchers: {
|
||||
ChromeNoSandbox: {
|
||||
base: 'Chrome',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
* Create a new file, `protractor-ci.conf.js`, in the root folder of your project, which extends the original `protractor.conf.js`:
|
||||
```
|
||||
const config = require('./protractor.conf').config;
|
||||
|
||||
config.capabilities = {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: ['--no-sandbox']
|
||||
}
|
||||
};
|
||||
|
||||
exports.config = config;
|
||||
```
|
||||
|
||||
Now you can run the following commands to use the `--no-sandbox` flag:
|
||||
|
||||
```
|
||||
ng test --single-run --no-progress --browser=ChromeNoSandbox
|
||||
ng e2e --no-progress --config=protractor-ci.conf.js
|
||||
```
|
||||
|
||||
{@a code-coverage}
|
||||
|
||||
## Enable code coverage reports
|
||||
|
||||
The CLI can run unit tests and create code coverage reports.
|
||||
Code coverage reports show you any parts of our code base that may not be properly tested by your unit tests.
|
||||
|
||||
To generate a coverage report run the following command in the root of your project.
|
||||
|
||||
```
|
||||
ng test --watch=false --code-coverage
|
||||
```
|
||||
|
||||
When the tests are complete, the command creates a new `/coverage` folder in the project. Open the `index.html` file to see a report with your source code and code coverage values.
|
||||
|
||||
If you want to create code-coverage reports every time you test, you can set the following option in the CLI configuration file, `angular.json`:
|
||||
|
||||
```
|
||||
"test": {
|
||||
"options": {
|
||||
"codeCoverage": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Code coverage enforcement
|
||||
|
||||
The code coverage percentages let you estimate how much of your code is tested.
|
||||
If your team decides on a set minimum amount to be unit tested, you can enforce this minimum with the Angular CLI.
|
||||
|
||||
For example, suppose you want the code base to have a minimum of 80% code coverage.
|
||||
To enable this, open the [Karma](http://karma-runner.github.io/0.13/index.html) test platform configuration file, `karma.conf.js`, and add the following in the `coverageIstanbulReporter:` key.
|
||||
|
||||
```
|
||||
coverageIstanbulReporter: {
|
||||
reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: true,
|
||||
thresholds: {
|
||||
statements: 80,
|
||||
lines: 80,
|
||||
branches: 80,
|
||||
functions: 80
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The `thresholds` property causes the tool to enforce a minimum of 80% code coverage when the unit tests are run in the project.
|
||||
|
||||
## Service Tests
|
||||
|
||||
Services are often the easiest files to unit test.
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
@ -13,6 +13,12 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- AngularMix -->
|
||||
<tr>
|
||||
<th><a href="https://angularmix.com/" title="AngularMix">AngularMix</a></th>
|
||||
<td>Orlando, Florida</td>
|
||||
<td>October 10-12, 2018</td>
|
||||
</tr>
|
||||
<!-- ReactiveConf -->
|
||||
<tr>
|
||||
<th><a href="https://reactiveconf.com/" title="ReactiveConf">ReactiveConf</a></th>
|
||||
@ -59,13 +65,13 @@
|
||||
<!-- ngconf 2018-->
|
||||
<tr>
|
||||
<th><a href="https://www.ng-conf.org/" title="ng-conf">ng-conf</a></th>
|
||||
<td>Salt Lake City, UT</td>
|
||||
<td>Salt Lake City, Utah</td>
|
||||
<td>April 18-20, 2018</td>
|
||||
</tr>
|
||||
<!-- WeRDevs-->
|
||||
<tr>
|
||||
<th><a href="https://www.wearedevelopers.com/" title="WeAreDevs">WeAreDevelopers</a></th>
|
||||
<td>Vienna</td>
|
||||
<td>Vienna, Austria</td>
|
||||
<td>May 16-18, 2018</td>
|
||||
</tr>
|
||||
<!-- ngJapan-->
|
||||
|
@ -57,14 +57,14 @@
|
||||
{
|
||||
"url": "guide/docs-style-guide",
|
||||
"title": "Doc authors style guide",
|
||||
"tooltip": "Style guide for documentation authors.",
|
||||
"tooltip": "Style guide for documentation authors",
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"url": "guide/quickstart",
|
||||
"title": "Getting Started",
|
||||
"tooltip": "A brief introduction to Angular and Angular CLI essentials."
|
||||
"tooltip": "A gentle introduction to Angular."
|
||||
},
|
||||
|
||||
{
|
||||
@ -73,43 +73,43 @@
|
||||
"children": [
|
||||
{
|
||||
"url": "tutorial",
|
||||
"title": "Introduction",
|
||||
"tooltip": "Introduction to the Tour of Heroes tutorial"
|
||||
"title": "1. Introduction",
|
||||
"tooltip": "Part 1: Introduction to the Tour of Heroes tutorial"
|
||||
},
|
||||
{
|
||||
"url": "tutorial/toh-pt0",
|
||||
"title": "The Application Shell",
|
||||
"tooltip": "Creating the application shell"
|
||||
"title": "2. The Application Shell",
|
||||
"tooltip": "Part 2: Creating the application shell"
|
||||
},
|
||||
{
|
||||
"url": "tutorial/toh-pt1",
|
||||
"title": "1. The Hero Editor",
|
||||
"tooltip": "Part 1: Build a simple hero editor"
|
||||
"title": "3. The Hero Editor",
|
||||
"tooltip": "Part 3: Build a simple hero editor"
|
||||
},
|
||||
{
|
||||
"url": "tutorial/toh-pt2",
|
||||
"title": "2. Displaying a List",
|
||||
"tooltip": "Part 2: Build a master/detail page with a list of heroes."
|
||||
"title": "4. Displaying a List",
|
||||
"tooltip": "Part 4: Build a master/detail page with a list of heroes."
|
||||
},
|
||||
{
|
||||
"url": "tutorial/toh-pt3",
|
||||
"title": "3. Master/Detail Components",
|
||||
"tooltip": "Part 3: Refactor the master/detail view into separate components."
|
||||
"title": "5. Master/Detail Components",
|
||||
"tooltip": "Part 5: Refactor the master/detail view into separate components."
|
||||
},
|
||||
{
|
||||
"url": "tutorial/toh-pt4",
|
||||
"title": "4. Services",
|
||||
"tooltip": "Part 4: Create a reusable service to manage hero data."
|
||||
"title": "6. Services",
|
||||
"tooltip": "Part 6: Create a reusable service to manage hero data."
|
||||
},
|
||||
{
|
||||
"url": "tutorial/toh-pt5",
|
||||
"title": "5. Routing",
|
||||
"tooltip": "Part 5: Add the Angular router and navigate among the views."
|
||||
"title": "7. Routing",
|
||||
"tooltip": "Part 7: Add the Angular router and navigate among the views."
|
||||
},
|
||||
{
|
||||
"url": "tutorial/toh-pt6",
|
||||
"title": "6. HTTP",
|
||||
"tooltip": "Part 6: Use HTTP to retrieve and save hero data."
|
||||
"title": "8. HTTP",
|
||||
"tooltip": "Part 8: Use HTTP to retrieve and save hero data."
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -210,13 +210,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Forms",
|
||||
"tooltip": "Angular Forms",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/forms-overview",
|
||||
"title": "Introduction",
|
||||
"title": "Forms Overview",
|
||||
"tooltip": "A form creates a cohesive, effective, and compelling data entry experience. An Angular form coordinates a set of data-bound user controls, tracks changes, validates input, and presents errors."
|
||||
},
|
||||
{
|
||||
@ -240,8 +241,8 @@
|
||||
"tooltip": "Render dynamic forms with FormGroup."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
},
|
||||
{
|
||||
"title": "Observables & RxJS",
|
||||
"tooltip": "Observables & RxJS",
|
||||
"children": [
|
||||
@ -417,29 +418,84 @@
|
||||
"tooltip": "Animate route transitions."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"url": "guide/testing",
|
||||
"title": "Testing",
|
||||
"tooltip": "Techniques and practices for testing an Angular app."
|
||||
},
|
||||
{
|
||||
"url": "guide/cheatsheet",
|
||||
"title": "Cheat Sheet",
|
||||
"tooltip": "A quick guide to common Angular coding techniques."
|
||||
}
|
||||
]},
|
||||
|
||||
{
|
||||
"title": "Techniques",
|
||||
"tooltip": "Techniques for putting Angular to work in your environment",
|
||||
"children": [
|
||||
|
||||
{
|
||||
"url": "guide/i18n",
|
||||
"title": "Internationalization (i18n)",
|
||||
"tooltip": "Translate the app's template text into multiple languages."
|
||||
},
|
||||
{
|
||||
"url": "guide/language-service",
|
||||
"title": "Language Service",
|
||||
"tooltip": "Use Angular Language Service to speed up dev time."
|
||||
},
|
||||
{
|
||||
"url": "guide/security",
|
||||
"title": "Security",
|
||||
"tooltip": "Developing for content security in Angular applications."
|
||||
},
|
||||
{
|
||||
"url": "guide/i18n",
|
||||
"title": "Internationalization (i18n)",
|
||||
"tooltip": "Translate the app's template text into multiple languages."
|
||||
},
|
||||
"title": "Setup & Deployment",
|
||||
"tooltip": "Setup and Deployment",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/setup",
|
||||
"title": "Setup for local development",
|
||||
"tooltip": "Install the Angular QuickStart seed for faster, more efficient development on your machine."
|
||||
},
|
||||
{
|
||||
"url": "guide/setup-systemjs-anatomy",
|
||||
"title": "Anatomy of the Setup",
|
||||
"tooltip": "Inside the local development environment for SystemJS."
|
||||
},
|
||||
{
|
||||
"url": "guide/browser-support",
|
||||
"title": "Browser Support",
|
||||
"tooltip": "Browser support and polyfills guide."
|
||||
},
|
||||
{
|
||||
"url": "guide/npm-packages",
|
||||
"title": "Npm Packages",
|
||||
"tooltip": "Recommended npm packages, and how to specify package dependencies."
|
||||
},
|
||||
|
||||
{
|
||||
"url": "guide/typescript-configuration",
|
||||
"title": "TypeScript Configuration",
|
||||
"tooltip": "TypeScript configuration for Angular developers."
|
||||
},
|
||||
{
|
||||
"url": "guide/aot-compiler",
|
||||
"title": "Ahead-of-Time Compilation",
|
||||
"tooltip": "Learn why and how to use the Ahead-of-Time (AOT) compiler."
|
||||
},
|
||||
{
|
||||
"url": "guide/deployment",
|
||||
"title": "Deployment",
|
||||
"tooltip": "Learn how to deploy your Angular app."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Service Workers & PWA",
|
||||
"title": "Service Workers",
|
||||
"tooltip": "Angular service workers: Controlling caching of application resources.",
|
||||
"children": [
|
||||
{
|
||||
@ -469,108 +525,24 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"url": "guide/universal",
|
||||
"title": "Server-side Rendering",
|
||||
"tooltip": "Render HTML server-side with Angular Universal."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Setup & Deployment",
|
||||
"tooltip": "Setup, build, testing, and deployment environment and tool information.",
|
||||
"children": [
|
||||
|
||||
{
|
||||
"url": "guide/setup",
|
||||
"title": "Setup for local development",
|
||||
"tooltip": "Install the Angular QuickStart seed for faster, more efficient development on your machine.",
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"url": "guide/file-structure",
|
||||
"title": "Project File Structure",
|
||||
"tooltip": "Inside the local development environment for SystemJS."
|
||||
},
|
||||
{
|
||||
"url": "guide/npm-packages",
|
||||
"title": "Packages",
|
||||
"tooltip": "Explanation of npm packages installed into a project by default."
|
||||
},
|
||||
{
|
||||
"url": "guide/typescript-configuration",
|
||||
"title": "TypeScript Configuration",
|
||||
"tooltip": "TypeScript configuration for Angular developers."
|
||||
},
|
||||
{
|
||||
"url": "guide/aot-compiler",
|
||||
"title": "Ahead-of-Time Compilation",
|
||||
"tooltip": "Learn why and how to use the Ahead-of-Time (AOT) compiler."
|
||||
},
|
||||
{
|
||||
"url": "guide/build",
|
||||
"title": "Building & Serving",
|
||||
"tooltip": "Building and serving Angular apps."
|
||||
},
|
||||
{
|
||||
"url": "guide/testing",
|
||||
"title": "Testing",
|
||||
"tooltip": "Techniques and practices for testing an Angular app."
|
||||
},
|
||||
{
|
||||
"url": "guide/deployment",
|
||||
"title": "Deployment",
|
||||
"tooltip": "Learn how to deploy your Angular app."
|
||||
},
|
||||
{
|
||||
"url": "guide/browser-support",
|
||||
"title": "Browser Support",
|
||||
"tooltip": "Browser support and polyfills guide."
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Dev Tool Integration",
|
||||
"tooltip": "Integration with your development environment and tool information.",
|
||||
"title": "Keeping Up-to-Date",
|
||||
"tooltip": "Angular release practices, planning for updates, and update resources.",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/language-service",
|
||||
"title": "Language Service",
|
||||
"tooltip": "Use Angular Language Service to speed up dev time."
|
||||
},
|
||||
{
|
||||
"url": "guide/visual-studio-2015",
|
||||
"title": "Visual Studio 2015 QuickStart",
|
||||
"tooltip": "Use Visual Studio 2015 with the QuickStart files."
|
||||
}
|
||||
{
|
||||
"url": "guide/updating",
|
||||
"title": "Updating Your Projects",
|
||||
"tooltip": "Information about updating Angular applications and libraries to the latest version."
|
||||
},
|
||||
{
|
||||
"url": "guide/releases",
|
||||
"title": "Angular Releases",
|
||||
"tooltip": "Angular versioning, release, support, and deprecation policies and practices."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"url": "guide/setup-systemjs-anatomy",
|
||||
"title": "Anatomy of the Setup",
|
||||
"tooltip": "Inside the local development environment for SystemJS.",
|
||||
"hidden": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"title": "Release Information",
|
||||
"tooltip": "Angular release practices, updating, and upgrading.",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/releases",
|
||||
"title": "Angular Releases",
|
||||
"tooltip": "Angular versioning, release, support, and deprecation policies and practices."
|
||||
},
|
||||
{
|
||||
"url": "guide/updating",
|
||||
"title": "Keeping Up-to-Date",
|
||||
"tooltip": "Information about updating Angular applications and libraries to the latest version."
|
||||
},
|
||||
{
|
||||
"title": "Upgrading from AngularJS",
|
||||
"tooltip": "Incrementally upgrade an AngularJS application to Angular.",
|
||||
@ -580,25 +552,27 @@
|
||||
"title": "Upgrading Instructions",
|
||||
"tooltip": "Incrementally upgrade an AngularJS application to Angular."
|
||||
},
|
||||
{
|
||||
"url": "guide/upgrade-performance",
|
||||
"title": "Upgrading for Performance",
|
||||
"tooltip": "Upgrade from AngularJS to Angular in a more flexible way."
|
||||
},
|
||||
{
|
||||
"url": "guide/ajs-quick-reference",
|
||||
"title": "AngularJS-Angular Concepts",
|
||||
"tooltip": "Learn how AngularJS concepts and techniques map to Angular."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"title": "Quick Reference",
|
||||
"tooltip": "Summaries of Angular syntax, coding, and terminology.",
|
||||
"children": [
|
||||
|
||||
},
|
||||
{
|
||||
"url": "guide/cheatsheet",
|
||||
"title": "Cheat Sheet",
|
||||
"tooltip": "A quick guide to common Angular coding techniques."
|
||||
"url": "guide/universal",
|
||||
"title": "Server-side Rendering",
|
||||
"tooltip": "Render HTML server-side with Angular Universal."
|
||||
},
|
||||
{
|
||||
"url": "guide/visual-studio-2015",
|
||||
"title": "Visual Studio 2015 QuickStart",
|
||||
"tooltip": "Use Visual Studio 2015 with the QuickStart files."
|
||||
},
|
||||
{
|
||||
"url": "guide/styleguide",
|
||||
@ -615,20 +589,9 @@
|
||||
|
||||
{
|
||||
"title": "API",
|
||||
"tooltip": "Details of the Angular packages, classes, interfaces, and other types.",
|
||||
"tooltip": "Details of the Angular classes and values.",
|
||||
"url": "api"
|
||||
},
|
||||
{
|
||||
"title": "CLI Commands",
|
||||
"tooltip": "Angular CLI command reference.",
|
||||
"children": [
|
||||
{
|
||||
"title": "Using the CLI",
|
||||
"tooltip": "An overview of how to use the CLI tool",
|
||||
"url": "cli"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"url": "guide/change-log",
|
||||
"title": "Change Log",
|
||||
|
@ -208,7 +208,7 @@ innocuous result so that the application keeps working.
|
||||
|
||||
#### _handleError_
|
||||
|
||||
The following `handleError()` will be shared by many `HeroService` methods
|
||||
The following `errorHandler()` will be shared by many `HeroService` methods
|
||||
so it's generalized to meet their different needs.
|
||||
|
||||
Instead of handling the error directly, it returns an _error handler_ function to `catchError` that it
|
||||
@ -223,7 +223,7 @@ After reporting the error to console, the handler constructs
|
||||
a user friendly message and returns a safe value to the app so it can keep working.
|
||||
|
||||
Because each service method returns a different kind of `Observable` result,
|
||||
`handleError()` takes a type parameter so it can return the safe value as the type that the app expects.
|
||||
`errorHandler()` takes a type parameter so it can return the safe value as the type that the app expects.
|
||||
|
||||
### Tap into the _Observable_
|
||||
|
||||
|
@ -18,20 +18,19 @@
|
||||
"build-for": "yarn ~~build --configuration",
|
||||
"prebuild-local": "yarn setup-local",
|
||||
"build-local": "yarn ~~build --configuration=stable",
|
||||
"extract-cli-command-docs": "node tools/transforms/cli-docs-package/extract-cli-commands.js",
|
||||
"lint": "yarn check-env && yarn docs-lint && ng lint && yarn example-lint && yarn tools-lint",
|
||||
"test": "yarn check-env && ng test",
|
||||
"pree2e": "yarn check-env && yarn update-webdriver",
|
||||
"e2e": "ng e2e --no-webdriver-update",
|
||||
"presetup": "yarn --cwd .. install && yarn install --frozen-lockfile && yarn ~~check-env && yarn ~~clean-generated && yarn boilerplate:remove",
|
||||
"setup": "yarn aio-use-npm && yarn example-use-npm",
|
||||
"postsetup": "yarn boilerplate:add && yarn build-ie-polyfills && yarn extract-cli-command-docs && yarn docs",
|
||||
"postsetup": "yarn boilerplate:add && yarn build-ie-polyfills && yarn docs",
|
||||
"presetup-local": "yarn presetup",
|
||||
"setup-local": "yarn aio-use-local && yarn example-use-local",
|
||||
"postsetup-local": "yarn postsetup",
|
||||
"set-opensearch-url": "node --eval \"const sh = require('shelljs'); sh.set('-e'); sh.sed('-i', /PLACEHOLDER_URL/g, process.argv[1], 'dist/assets/opensearch.xml');\"",
|
||||
"test-pwa-score": "node scripts/test-pwa-score",
|
||||
"test-pwa-score-localhost": "run-p --race \"~~http-server dist -p 4200 --silent\" \"test-pwa-score http://localhost:4200 {1}\" --",
|
||||
"test-pwa-score-localhost": "run-p --race \"~~http-server dist -p 4200 --silent\" \"test-pwa-score http://localhost:4200 {1} {2}\" --",
|
||||
"example-e2e": "yarn example-check-local && node ./tools/examples/run-example-e2e",
|
||||
"example-lint": "tslint -c \"content/examples/tslint.json\" \"content/examples/**/*.ts\" -e \"content/examples/styleguide/**/*.avoid.ts\"",
|
||||
"example-use-local": "node tools/ng-packages-installer overwrite ./tools/examples/shared --debug",
|
||||
@ -42,8 +41,7 @@
|
||||
"postcheck-env": "yarn aio-check-local",
|
||||
"payload-size": "scripts/payload.sh",
|
||||
"predocs": "yarn generate-stackblitz && yarn generate-zips",
|
||||
"docs": "yarn docs-only",
|
||||
"docs-only": "dgeni ./tools/transforms/angular.io-package",
|
||||
"docs": "dgeni ./tools/transforms/angular.io-package",
|
||||
"docs-watch": "node tools/transforms/authors-package/watchr.js",
|
||||
"docs-lint": "eslint --ignore-path=\"tools/transforms/.eslintignore\" tools/transforms",
|
||||
"docs-test": "node tools/transforms/test.js",
|
||||
@ -73,34 +71,35 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^7.0.0-rc.0",
|
||||
"@angular/cdk": "6.0.2",
|
||||
"@angular/common": "^7.0.0-rc.0",
|
||||
"@angular/core": "^7.0.0-rc.0",
|
||||
"@angular/elements": "^7.0.0-rc.0",
|
||||
"@angular/forms": "^7.0.0-rc.0",
|
||||
"@angular/material": "6.0.2",
|
||||
"@angular/platform-browser": "^7.0.0-rc.0",
|
||||
"@angular/platform-browser-dynamic": "^7.0.0-rc.0",
|
||||
"@angular/router": "^7.0.0-rc.0",
|
||||
"@angular/service-worker": "^7.0.0-rc.0",
|
||||
"@angular/animations": "^7.0.0-rc.1",
|
||||
"@angular/cdk": "7.0.0-rc.1",
|
||||
"@angular/common": "^7.0.0-rc.1",
|
||||
"@angular/core": "^7.0.0-rc.1",
|
||||
"@angular/elements": "^7.0.0-rc.1",
|
||||
"@angular/forms": "^7.0.0-rc.1",
|
||||
"@angular/material": "7.0.0-rc.1",
|
||||
"@angular/platform-browser": "^7.0.0-rc.1",
|
||||
"@angular/platform-browser-dynamic": "^7.0.0-rc.1",
|
||||
"@angular/router": "^7.0.0-rc.1",
|
||||
"@angular/service-worker": "^7.0.0-rc.1",
|
||||
"@webcomponents/custom-elements": "^1.2.0",
|
||||
"classlist.js": "^1.1.20150312",
|
||||
"core-js": "^2.4.1",
|
||||
"rxjs": "^6.3.0",
|
||||
"rxjs": "6.2.2",
|
||||
"tslib": "^1.9.0",
|
||||
"web-animations-js": "^2.2.5",
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^0.8.3",
|
||||
"@angular/cli": "^6.2.3",
|
||||
"@angular/compiler": "^7.0.0-rc.0",
|
||||
"@angular/compiler-cli": "^7.0.0-rc.0",
|
||||
"@angular/language-service": "^7.0.0-rc.0",
|
||||
"@angular-devkit/build-angular": "~0.9.0-rc.1",
|
||||
"@angular/cli": "^7.0.0-rc.2",
|
||||
"@angular/compiler": "^7.0.0-rc.1",
|
||||
"@angular/compiler-cli": "^7.0.0-rc.1",
|
||||
"@angular/language-service": "^7.0.0-rc.1",
|
||||
"@types/jasmine": "^2.5.52",
|
||||
"@types/jasminewd2": "^2.0.3",
|
||||
"@types/jasminewd2": "^2.0.4",
|
||||
"@types/node": "~6.0.60",
|
||||
"@yarnpkg/lockfile": "^1.1.0",
|
||||
"archiver": "^1.3.0",
|
||||
"canonical-path": "^0.0.2",
|
||||
"chalk": "^2.1.0",
|
||||
@ -113,7 +112,7 @@
|
||||
"entities": "^1.1.1",
|
||||
"eslint": "^3.19.0",
|
||||
"eslint-plugin-jasmine": "^2.2.0",
|
||||
"firebase-tools": "^3.2.1",
|
||||
"firebase-tools": "^5.1.1",
|
||||
"fs-extra": "^2.1.2",
|
||||
"globby": "^6.1.0",
|
||||
"hast-util-is-element": "^1.0.0",
|
||||
@ -128,18 +127,16 @@
|
||||
"jasmine-spec-reporter": "^4.1.0",
|
||||
"jasmine-ts": "^0.2.1",
|
||||
"jsdom": "^9.12.0",
|
||||
"json-schema-traverse": "^0.4.1",
|
||||
"json5": "^1.0.1",
|
||||
"karma": "^1.7.0",
|
||||
"karma-chrome-launcher": "^2.1.1",
|
||||
"karma-cli": "^1.0.1",
|
||||
"karma-coverage-istanbul-reporter": "^1.3.0",
|
||||
"karma-jasmine": "^1.1.0",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"lighthouse": "^2.5.0",
|
||||
"lighthouse": "^3.2.1",
|
||||
"lodash": "^4.17.4",
|
||||
"lunr": "^2.1.0",
|
||||
"npm-run-all": "^4.1.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"protractor": "^5.2.0",
|
||||
"rehype": "^4.0.0",
|
||||
"rehype-slug": "^2.0.0",
|
||||
@ -151,7 +148,7 @@
|
||||
"tree-kill": "^1.1.0",
|
||||
"ts-node": "^3.3.0",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "^3.1.1",
|
||||
"typescript": "^3.1.2",
|
||||
"uglify-js": "^3.0.15",
|
||||
"unist-util-filter": "^0.2.1",
|
||||
"unist-util-source": "^1.0.1",
|
||||
@ -163,4 +160,4 @@
|
||||
"xregexp": "^4.0.0",
|
||||
"yargs": "^7.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime": 3173,
|
||||
"main": 483844,
|
||||
"polyfills": 53920,
|
||||
"prettify": 14913
|
||||
"main": 494475,
|
||||
"polyfills": 53926,
|
||||
"prettify": 14917
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -100,8 +100,8 @@ fi
|
||||
yarn payload-size
|
||||
|
||||
# Deploy to Firebase
|
||||
firebase use "$projectId" --token "$firebaseToken"
|
||||
firebase deploy --message "Commit: $TRAVIS_COMMIT" --non-interactive --token "$firebaseToken"
|
||||
yarn firebase use "$projectId" --token "$firebaseToken"
|
||||
yarn firebase deploy --message "Commit: $TRAVIS_COMMIT" --non-interactive --token "$firebaseToken"
|
||||
|
||||
# Run PWA-score tests
|
||||
yarn test-pwa-score "$deployedUrl" "$AIO_MIN_PWA_SCORE"
|
||||
|
@ -11,13 +11,15 @@
|
||||
*/
|
||||
|
||||
// Imports
|
||||
const chromeLauncher = require('chrome-launcher');
|
||||
const lighthouse = require('lighthouse');
|
||||
const chromeLauncher = require('lighthouse/chrome-launcher');
|
||||
const printer = require('lighthouse/lighthouse-cli/printer');
|
||||
const config = require('lighthouse/lighthouse-core/config/default.js');
|
||||
const config = require('lighthouse/lighthouse-core/config/default-config.js');
|
||||
const logger = require('lighthouse-logger');
|
||||
|
||||
// Constants
|
||||
const CHROME_LAUNCH_OPTS = {};
|
||||
const LIGHTHOUSE_FLAGS = {logLevel: 'info'};
|
||||
const SKIPPED_HTTPS_AUDITS = ['redirects-http'];
|
||||
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/';
|
||||
|
||||
@ -26,6 +28,7 @@ const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/';
|
||||
if (process.env.TRAVIS) {
|
||||
process.env.LIGHTHOUSE_CHROMIUM_PATH = process.env.CHROME_BIN;
|
||||
CHROME_LAUNCH_OPTS.chromeFlags = ['--no-sandbox'];
|
||||
LIGHTHOUSE_FLAGS.logLevel = 'error';
|
||||
}
|
||||
|
||||
// Run
|
||||
@ -42,18 +45,20 @@ function _main(args) {
|
||||
skipHttpsAudits(config);
|
||||
}
|
||||
|
||||
launchChromeAndRunLighthouse(url, {}, config).
|
||||
logger.setLevel(LIGHTHOUSE_FLAGS.logLevel);
|
||||
|
||||
launchChromeAndRunLighthouse(url, LIGHTHOUSE_FLAGS, config).
|
||||
then(results => processResults(results, logFile)).
|
||||
then(score => evaluateScore(minScore, score)).
|
||||
catch(onError);
|
||||
}
|
||||
|
||||
function evaluateScore(expectedScore, actualScore) {
|
||||
console.log('Lighthouse PWA score:');
|
||||
console.log(` - Expected: ${expectedScore} / 100 (or higher)`);
|
||||
console.log(` - Actual: ${actualScore} / 100`);
|
||||
console.log('\nLighthouse PWA score:');
|
||||
console.log(` - Expected: ${expectedScore.toFixed(0).padStart(3)} / 100 (or higher)`);
|
||||
console.log(` - Actual: ${actualScore.toFixed(0).padStart(3)} / 100\n`);
|
||||
|
||||
if (actualScore < expectedScore) {
|
||||
if (isNaN(actualScore) || (actualScore < expectedScore)) {
|
||||
throw new Error(`PWA score is too low. (${actualScore} < ${expectedScore})`);
|
||||
}
|
||||
}
|
||||
@ -87,20 +92,30 @@ function parseInput(args) {
|
||||
}
|
||||
|
||||
function processResults(results, logFile) {
|
||||
let promise = Promise.resolve();
|
||||
const categories = results.lhr.categories;
|
||||
const report = results.report;
|
||||
|
||||
if (logFile) {
|
||||
console.log(`Saving results in '${logFile}'...`);
|
||||
console.log(`(LightHouse viewer: ${VIEWER_URL})`);
|
||||
return Promise.resolve().
|
||||
then(() => {
|
||||
if (logFile) {
|
||||
console.log(`Saving results in '${logFile}'...`);
|
||||
console.log(`(LightHouse viewer: ${VIEWER_URL})`);
|
||||
|
||||
// Remove the artifacts, which are not necessary for the report.
|
||||
// (Saves ~1,500,000 lines of formatted JSON output \o/)
|
||||
results.artifacts = undefined;
|
||||
return printer.write(report, printer.OutputMode.json, logFile);
|
||||
}
|
||||
}).
|
||||
then(() => {
|
||||
const categoryData = Object.keys(categories).map(name => categories[name]);
|
||||
const maxTitleLen = Math.max(...categoryData.map(({title}) => title.length));
|
||||
|
||||
promise = printer.write(results, 'json', logFile);
|
||||
}
|
||||
|
||||
return promise.then(() => Math.round(results.score));
|
||||
console.log('\nAudit scores:');
|
||||
categoryData.forEach(({title, score}) => {
|
||||
const paddedTitle = `${title}:`.padEnd(maxTitleLen + 1);
|
||||
const paddedScore = (score * 100).toFixed(0).padStart(3);
|
||||
console.log(` - ${paddedTitle} ${paddedScore} / 100`);
|
||||
});
|
||||
}).
|
||||
then(() => categories.pwa.score * 100);
|
||||
}
|
||||
|
||||
function skipHttpsAudits(config) {
|
||||
|
@ -164,10 +164,10 @@ describe('AppComponent', () => {
|
||||
|
||||
describe('onScroll', () => {
|
||||
it('should update `tocMaxHeight` accordingly', () => {
|
||||
expect(component.tocMaxHeight).toBeUndefined();
|
||||
|
||||
component.tocMaxHeight = '';
|
||||
component.onScroll();
|
||||
expect(component.tocMaxHeight).toBeGreaterThan(0);
|
||||
|
||||
expect(component.tocMaxHeight).toMatch(/^\d+\.\d{2}$/);
|
||||
});
|
||||
});
|
||||
|
||||
@ -654,12 +654,13 @@ describe('AppComponent', () => {
|
||||
it('should update the TOC container\'s `maxHeight` based on `tocMaxHeight`', () => {
|
||||
setHasFloatingToc(true);
|
||||
|
||||
expect(tocContainer!.style['max-height']).toBe('');
|
||||
|
||||
component.tocMaxHeight = '100';
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(tocContainer!.style['max-height']).toBe('100px');
|
||||
|
||||
component.tocMaxHeight = '200';
|
||||
fixture.detectChanges();
|
||||
expect(tocContainer!.style['max-height']).toBe('200px');
|
||||
});
|
||||
|
||||
it('should restrain scrolling inside the ToC container', () => {
|
||||
|
@ -349,12 +349,17 @@ export class AppComponent implements OnInit {
|
||||
@HostListener('window:scroll')
|
||||
onScroll() {
|
||||
if (!this.tocMaxHeightOffset) {
|
||||
// Must wait until now for mat-toolbar to be measurable.
|
||||
// Must wait until `mat-toolbar` is measurable.
|
||||
const el = this.hostElement.nativeElement as Element;
|
||||
this.tocMaxHeightOffset =
|
||||
el.querySelector('footer')!.clientHeight +
|
||||
el.querySelector('.app-toolbar')!.clientHeight +
|
||||
24; // fudge margin
|
||||
const headerEl = el.querySelector('.app-toolbar');
|
||||
const footerEl = el.querySelector('footer');
|
||||
|
||||
if (headerEl && footerEl) {
|
||||
this.tocMaxHeightOffset =
|
||||
headerEl.clientHeight +
|
||||
footerEl.clientHeight +
|
||||
24; // fudge margin
|
||||
}
|
||||
}
|
||||
|
||||
this.tocMaxHeight = (document.body.scrollHeight - window.pageYOffset - this.tocMaxHeightOffset).toFixed(2);
|
||||
|
@ -95,11 +95,8 @@ export class NavigationService {
|
||||
this.location.currentPath,
|
||||
|
||||
(navMap, url) => {
|
||||
const matchSpecialUrls = /^api|^cli/.exec(url);
|
||||
if (matchSpecialUrls) {
|
||||
url = matchSpecialUrls[0];
|
||||
}
|
||||
return navMap.get(url) || { '' : { view: '', url: url, nodes: [] }};
|
||||
const urlKey = url.startsWith('api/') ? 'api' : url;
|
||||
return navMap.get(urlKey) || { '' : { view: '', url: urlKey, nodes: [] }};
|
||||
})
|
||||
.pipe(publishReplay(1));
|
||||
(currentNodes as ConnectableObservable<CurrentNodes>).connect();
|
||||
|
@ -135,6 +135,17 @@ th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
p > code, li > code, td > code, th > code {
|
||||
font-family: $code-font;
|
||||
font-size: 85%;
|
||||
color: $darkgray;
|
||||
letter-spacing: 0;
|
||||
line-height: 1;
|
||||
padding: 2px 0;
|
||||
background-color: $backgroundgray;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: $code-font;
|
||||
font-size: 90%;
|
||||
|
@ -115,6 +115,7 @@ button.vertical-menu-item {
|
||||
}
|
||||
|
||||
.heading-children.collapsed {
|
||||
overflow: hidden; // Needed to prevent unnecessary sidenav scrollbar.
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
max-height: 1px; // Must have measurement to transition height.
|
||||
|
@ -1,7 +0,0 @@
|
||||
.cli-name, .cli-default {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cli-option-syntax {
|
||||
white-space: pre;
|
||||
}
|
@ -8,7 +8,6 @@
|
||||
@import 'buttons';
|
||||
@import 'callout';
|
||||
@import 'card';
|
||||
@import 'cli-pages';
|
||||
@import 'code';
|
||||
@import 'contribute';
|
||||
@import 'contributor';
|
||||
|
@ -30,9 +30,13 @@
|
||||
/coverage
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
testem.log
|
||||
/typings
|
||||
yarn-error.log
|
||||
|
||||
# e2e
|
||||
/e2e/*.js
|
||||
/e2e/*.map
|
||||
|
||||
# System Files
|
||||
.DS_Store
|
||||
|
@ -1,14 +1,12 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"angular.io-example": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
@ -19,11 +17,21 @@
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
{
|
||||
"input": "src/styles.css"
|
||||
}
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
@ -43,14 +51,7 @@
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "2mb",
|
||||
"maximumError": "5mb"
|
||||
}
|
||||
]
|
||||
"buildOptimizer": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -79,12 +80,22 @@
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"karmaConfig": "src/karma.conf.js",
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
{
|
||||
"input": "styles.css"
|
||||
}
|
||||
],
|
||||
"scripts": [],
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src/",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -105,18 +116,12 @@
|
||||
"angular.io-example-e2e": {
|
||||
"root": "e2e/",
|
||||
"projectType": "application",
|
||||
"prefix": "",
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"devServerTarget": "angular.io-example:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "angular.io-example:serve:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
@ -130,6 +135,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "angular.io-example"
|
||||
}
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@ const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./src/**/*.e2e-spec.ts'
|
||||
'./**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome',
|
||||
@ -26,8 +26,8 @@ exports.config = {
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: require('path').join(__dirname, './tsconfig.e2e.json')
|
||||
project: 'e2e/tsconfig.e2e.json'
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
}
|
||||
};
|
||||
};
|
@ -1,7 +1,8 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/app",
|
||||
"outDir": "../out-tsc/e2e",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
|
@ -5,48 +5,48 @@
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"build": "ng build --prod",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "~7.0.0-rc.0",
|
||||
"@angular/common": "~7.0.0-rc.0",
|
||||
"@angular/compiler": "~7.0.0-rc.0",
|
||||
"@angular/core": "~7.0.0-rc.0",
|
||||
"@angular/forms": "~7.0.0-rc.0",
|
||||
"@angular/http": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser-dynamic": "~7.0.0-rc.0",
|
||||
"@angular/router": "~7.0.0-rc.0",
|
||||
"@angular/animations": "^6.0.0",
|
||||
"@angular/common": "^6.0.0",
|
||||
"@angular/compiler": "^6.0.0",
|
||||
"@angular/core": "^6.0.0",
|
||||
"@angular/forms": "^6.0.0",
|
||||
"@angular/http": "^6.0.0",
|
||||
"@angular/platform-browser": "^6.0.0",
|
||||
"@angular/platform-browser-dynamic": "^6.0.0",
|
||||
"@angular/router": "^6.0.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"core-js": "^2.5.4",
|
||||
"rxjs": "^6.3.0",
|
||||
"rxjs": "^6.0.0",
|
||||
"web-animations-js": "^2.3.1",
|
||||
"zone.js": "~0.8.26"
|
||||
"zone.js": "^0.8.24"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.9.0-rc.2",
|
||||
"@angular/cli": "~7.0.0-rc.2",
|
||||
"@angular/compiler-cli": "~7.0.0-rc.0",
|
||||
"@angular/language-service": "~7.0.0-rc.0",
|
||||
"@types/jasmine": "~2.8.8",
|
||||
"@angular/compiler-cli": "^6.0.0",
|
||||
"@angular-devkit/build-angular": "~0.6.0",
|
||||
"typescript": "~2.7.2",
|
||||
"@angular/cli": "^6.0.0",
|
||||
"@angular/language-service": "^6.0.0",
|
||||
"@types/jasmine": "~2.8.6",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/node": "~8.9.4",
|
||||
"codelyzer": "~4.3.0",
|
||||
"codelyzer": "~4.2.1",
|
||||
"jasmine-core": "~2.99.1",
|
||||
"jasmine-marbles": "^0.4.0",
|
||||
"jasmine-marbles": "^0.3.1",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~3.0.0",
|
||||
"karma": "~2.0.0",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-coverage-istanbul-reporter": "~2.0.1",
|
||||
"karma-jasmine": "~1.1.2",
|
||||
"karma-coverage-istanbul-reporter": "~1.4.2",
|
||||
"karma-jasmine": "~1.1.1",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"protractor": "~5.4.0",
|
||||
"ts-node": "~7.0.0",
|
||||
"tslint": "~5.11.0",
|
||||
"typescript": "~3.1.1"
|
||||
"protractor": "~5.3.0",
|
||||
"ts-node": "~5.0.1",
|
||||
"tslint": "~5.9.1"
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,5 @@
|
||||
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
#
|
||||
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
|
||||
|
||||
> 0.5%
|
||||
last 2 versions
|
||||
Firefox ESR
|
||||
not dead
|
||||
not IE 9-11
|
||||
IE 9-11
|
@ -7,10 +7,9 @@ export const environment = {
|
||||
};
|
||||
|
||||
/*
|
||||
* For easier debugging in development mode, you can import the following file
|
||||
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
||||
*
|
||||
* This import should be commented out in production mode because it will have a negative impact
|
||||
* on performance if an error is thrown.
|
||||
* In development mode, to ignore zone related error stack frames such as
|
||||
* `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
|
||||
* import the following file, but please comment it out in production mode
|
||||
* because it will have performance impact when throw error
|
||||
*/
|
||||
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
||||
|
@ -16,10 +16,13 @@ module.exports = function (config) {
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, '../coverage'),
|
||||
dir: require('path').join(__dirname, 'coverage'),
|
||||
reports: ['html', 'lcovonly'],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
angularCli: {
|
||||
environment: 'dev'
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
@ -28,4 +31,4 @@ module.exports = function (config) {
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false
|
||||
});
|
||||
};
|
||||
};
|
@ -11,7 +11,7 @@
|
||||
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
||||
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
||||
*
|
||||
* Learn more in https://angular.io/guide/browser-support
|
||||
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
|
||||
*/
|
||||
|
||||
/***************************************************************************************************
|
||||
@ -34,32 +34,23 @@
|
||||
// import 'core-js/es6/weak-map';
|
||||
// import 'core-js/es6/set';
|
||||
|
||||
/**
|
||||
* If the application will be indexed by Google Search, the following is required.
|
||||
* Googlebot uses a renderer based on Chrome 41.
|
||||
* https://developers.google.com/search/docs/guides/rendering
|
||||
**/
|
||||
// import 'core-js/es6/array';
|
||||
|
||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||
|
||||
/** IE10 and IE11 requires the following for the Reflect API. */
|
||||
/**
|
||||
* DO NOT REMOVE
|
||||
* By default, Reflect polyfills are auto-included by the CLI and
|
||||
* are required for JIT compilation. StackBlitz examples are
|
||||
* compiled using JIT.
|
||||
*/
|
||||
import 'core-js/es6/reflect';
|
||||
// import 'core-js/es6/reflect';
|
||||
|
||||
|
||||
/** Evergreen browsers require these. **/
|
||||
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
|
||||
import 'core-js/es7/reflect';
|
||||
|
||||
|
||||
/**
|
||||
* Web Animations `@angular/platform-browser/animations`
|
||||
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
||||
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
||||
* Required to support Web Animations `@angular/platform-browser/animations`.
|
||||
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
|
||||
**/
|
||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||
// import 'web-animations-js';
|
||||
|
||||
/**
|
||||
* By default, zone.js will patch all possible macroTask and DomEvents
|
||||
|
@ -2,10 +2,13 @@
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/app",
|
||||
"baseUrl": "./",
|
||||
"module": "es2015",
|
||||
"types": []
|
||||
},
|
||||
"exclude": [
|
||||
"test.ts",
|
||||
"**/*.spec.ts"
|
||||
"**/*.spec.ts",
|
||||
"**/testing/*"
|
||||
]
|
||||
}
|
||||
|
@ -2,6 +2,9 @@
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/spec",
|
||||
"baseUrl": "./",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"node"
|
||||
|
@ -1,20 +1,19 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"outDir": "./dist/out-tsc",
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"target": "es5",
|
||||
"skipLibCheck": true,
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
],
|
||||
"lib": [
|
||||
"es2018",
|
||||
"es2017",
|
||||
"dom"
|
||||
]
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
"forin": true,
|
||||
"import-blacklist": [
|
||||
true,
|
||||
"rxjs",
|
||||
"rxjs/Rx"
|
||||
],
|
||||
"import-spacing": true,
|
||||
@ -65,7 +66,6 @@
|
||||
],
|
||||
"no-misused-new": true,
|
||||
"no-non-null-assertion": true,
|
||||
"no-redundant-jsdoc": true,
|
||||
"no-shadowed-variable": true,
|
||||
"no-string-literal": false,
|
||||
"no-string-throw": true,
|
||||
@ -107,6 +107,7 @@
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"typeof-compare": true,
|
||||
"unified-signatures": true,
|
||||
"variable-name": false,
|
||||
"whitespace": [
|
||||
@ -117,6 +118,18 @@
|
||||
"check-separator",
|
||||
"check-type"
|
||||
],
|
||||
"directive-selector": [
|
||||
true,
|
||||
"attribute",
|
||||
"app",
|
||||
"camelCase"
|
||||
],
|
||||
"component-selector": [
|
||||
true,
|
||||
"element",
|
||||
"app",
|
||||
"kebab-case"
|
||||
],
|
||||
"no-output-on-prefix": true,
|
||||
"use-input-property-decorator": true,
|
||||
"use-output-property-decorator": true,
|
||||
|
@ -1,14 +1,12 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"angular.io-example": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
@ -19,11 +17,21 @@
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
{
|
||||
"input": "src/styles.css"
|
||||
}
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
@ -105,12 +113,22 @@
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"karmaConfig": "src/karma.conf.js",
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
{
|
||||
"input": "styles.css"
|
||||
}
|
||||
],
|
||||
"scripts": [],
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src/",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -131,18 +149,12 @@
|
||||
"angular.io-example-e2e": {
|
||||
"root": "e2e/",
|
||||
"projectType": "application",
|
||||
"prefix": "",
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"devServerTarget": "angular.io-example:serve:fr"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "angular.io-example:serve:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
@ -156,6 +168,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "angular.io-example"
|
||||
}
|
||||
}
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"start:fr": "ng serve --configuration=fr",
|
||||
"build": "ng build",
|
||||
"build": "ng build --prod",
|
||||
"build:fr": "ng build --configuration=production-fr",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
@ -15,41 +15,40 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "~7.0.0-rc.0",
|
||||
"@angular/common": "~7.0.0-rc.0",
|
||||
"@angular/compiler": "~7.0.0-rc.0",
|
||||
"@angular/core": "~7.0.0-rc.0",
|
||||
"@angular/forms": "~7.0.0-rc.0",
|
||||
"@angular/http": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser-dynamic": "~7.0.0-rc.0",
|
||||
"@angular/router": "~7.0.0-rc.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"@angular/animations": "^6.0.0",
|
||||
"@angular/common": "^6.0.0",
|
||||
"@angular/compiler": "^6.0.0",
|
||||
"@angular/core": "^6.0.0",
|
||||
"@angular/forms": "^6.0.0",
|
||||
"@angular/http": "^6.0.0",
|
||||
"@angular/platform-browser": "^6.0.0",
|
||||
"@angular/platform-browser-dynamic": "^6.0.0",
|
||||
"@angular/router": "^6.0.0",
|
||||
"core-js": "^2.5.4",
|
||||
"rxjs": "^6.3.0",
|
||||
"web-animations-js": "^2.3.1",
|
||||
"zone.js": "~0.8.26"
|
||||
"rxjs": "^6.0.0",
|
||||
"zone.js": "^0.8.24"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.9.0-rc.2",
|
||||
"@angular/cli": "~7.0.0-rc.2",
|
||||
"@angular/compiler-cli": "~7.0.0-rc.0",
|
||||
"@angular/language-service": "~7.0.0-rc.0",
|
||||
"@types/jasmine": "~2.8.8",
|
||||
"@angular/compiler-cli": "^6.0.0",
|
||||
"@angular-devkit/build-angular": "~0.6.0",
|
||||
"@angular/cli": "^6.0.0",
|
||||
"@angular/language-service": "^6.0.0",
|
||||
"@angular/platform-server": "^6.0.0",
|
||||
"@types/jasmine": "~2.8.6",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/node": "~8.9.4",
|
||||
"codelyzer": "~4.3.0",
|
||||
"codelyzer": "~4.2.1",
|
||||
"jasmine-core": "~2.99.1",
|
||||
"jasmine-marbles": "^0.4.0",
|
||||
"jasmine-marbles": "^0.3.1",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~3.0.0",
|
||||
"karma": "~2.0.0",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-coverage-istanbul-reporter": "~2.0.1",
|
||||
"karma-jasmine": "~1.1.2",
|
||||
"karma-coverage-istanbul-reporter": "~1.4.2",
|
||||
"karma-jasmine": "~1.1.1",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"protractor": "~5.4.0",
|
||||
"ts-node": "~7.0.0",
|
||||
"tslint": "~5.11.0",
|
||||
"typescript": "~3.1.1"
|
||||
"protractor": "~5.3.0",
|
||||
"ts-node": "~5.0.1",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "~2.7.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,12 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"angular.io-example": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
@ -19,12 +17,24 @@
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.css",
|
||||
"src/test.css"
|
||||
{
|
||||
"input": "src/styles.css"
|
||||
},
|
||||
{
|
||||
"input": "src/test.css"
|
||||
}
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
@ -73,12 +83,22 @@
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"karmaConfig": "src/karma.conf.js",
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
{
|
||||
"input": "styles.css"
|
||||
}
|
||||
],
|
||||
"scripts": [],
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src/",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -99,18 +119,12 @@
|
||||
"angular.io-example-e2e": {
|
||||
"root": "e2e/",
|
||||
"projectType": "application",
|
||||
"prefix": "",
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"devServerTarget": "angular.io-example:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "angular.io-example:serve:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
@ -124,6 +138,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "angular.io-example"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +1,11 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"angular.io-example": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
@ -16,11 +13,19 @@
|
||||
"outputPath": "dist/browser",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
},
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src",
|
||||
"output": "/"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
@ -29,12 +34,6 @@
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
@ -43,7 +42,13 @@
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true
|
||||
"buildOptimizer": true,
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -68,16 +73,24 @@
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"karmaConfig": "./karma.conf.js",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"karmaConfig": "src/karma.conf.js",
|
||||
"scripts": [],
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
],
|
||||
"scripts": [],
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
},
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src",
|
||||
"output": "/"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -104,26 +117,24 @@
|
||||
}
|
||||
},
|
||||
"angular.io-example-e2e": {
|
||||
"root": "e2e/",
|
||||
"root": "",
|
||||
"projectType": "application",
|
||||
"prefix": "",
|
||||
"cli": {},
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"protractorConfig": "./protractor.conf.js",
|
||||
"devServerTarget": "angular.io-example:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "angular.io-example:serve:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": "e2e/tsconfig.e2e.json",
|
||||
"tsConfig": [
|
||||
"e2e/tsconfig.e2e.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
@ -132,5 +143,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "angular.io-example"
|
||||
}
|
||||
"cli": {},
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"prefix": "app",
|
||||
"styleext": "css"
|
||||
},
|
||||
"@schematics/angular:directive": {
|
||||
"prefix": "app"
|
||||
}
|
||||
}
|
||||
}
|
@ -16,47 +16,47 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "~7.0.0-rc.0",
|
||||
"@angular/common": "~7.0.0-rc.0",
|
||||
"@angular/compiler": "~7.0.0-rc.0",
|
||||
"@angular/core": "~7.0.0-rc.0",
|
||||
"@angular/forms": "~7.0.0-rc.0",
|
||||
"@angular/http": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser-dynamic": "~7.0.0-rc.0",
|
||||
"@angular/router": "~7.0.0-rc.0",
|
||||
"@nguniversal/common": "^6.1.0",
|
||||
"@nguniversal/express-engine": "^6.1.0",
|
||||
"@nguniversal/module-map-ngfactory-loader": "^6.1.0",
|
||||
"@angular/animations": "^6.0.0",
|
||||
"@angular/common": "^6.0.0",
|
||||
"@angular/compiler": "^6.0.0",
|
||||
"@angular/core": "^6.0.0",
|
||||
"@angular/forms": "^6.0.0",
|
||||
"@angular/http": "^6.0.0",
|
||||
"@angular/platform-browser": "^6.0.0",
|
||||
"@angular/platform-browser-dynamic": "^6.0.0",
|
||||
"@angular/router": "^6.0.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"@nguniversal/common": "^6.0.0",
|
||||
"@nguniversal/express-engine": "^6.0.0",
|
||||
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
|
||||
"core-js": "^2.5.4",
|
||||
"rxjs": "^6.3.0",
|
||||
"rxjs": "^6.0.0",
|
||||
"web-animations-js": "^2.3.1",
|
||||
"zone.js": "~0.8.26"
|
||||
"zone.js": "^0.8.24"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.9.0-rc.2",
|
||||
"@angular/cli": "~7.0.0-rc.2",
|
||||
"@angular/compiler-cli": "~7.0.0-rc.0",
|
||||
"@angular/language-service": "~7.0.0-rc.0",
|
||||
"@angular/platform-server": "~7.0.0-rc.0",
|
||||
"@types/jasmine": "~2.8.8",
|
||||
"@angular/cli": "^6.0.0",
|
||||
"@angular/compiler-cli": "^6.0.0",
|
||||
"@angular/language-service": "^6.0.0",
|
||||
"@angular/platform-server": "^6.0.0",
|
||||
"@angular-devkit/build-angular": "~0.6.0",
|
||||
"@types/jasmine": "~2.8.6",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/node": "~8.9.4",
|
||||
"codelyzer": "~4.3.0",
|
||||
"codelyzer": "~4.2.1",
|
||||
"jasmine-core": "~2.99.1",
|
||||
"jasmine-marbles": "^0.4.0",
|
||||
"jasmine-marbles": "^0.3.1",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~3.0.0",
|
||||
"karma": "~2.0.0",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-coverage-istanbul-reporter": "~2.0.1",
|
||||
"karma-jasmine": "~1.1.2",
|
||||
"karma-coverage-istanbul-reporter": "~1.4.2",
|
||||
"karma-jasmine": "~1.1.1",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"protractor": "~5.4.0",
|
||||
"protractor": "~5.3.0",
|
||||
"ts-loader": "^4.2.0",
|
||||
"ts-node": "~7.0.0",
|
||||
"tslint": "~5.11.0",
|
||||
"typescript": "~3.1.1",
|
||||
"webpack-cli": "^3.1.0"
|
||||
"ts-node": "~5.0.1",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "~2.7.2",
|
||||
"webpack-cli": "^2.1.2"
|
||||
}
|
||||
}
|
||||
|
@ -18,61 +18,60 @@
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@angular/animations": "~7.0.0-rc.0",
|
||||
"@angular/common": "~7.0.0-rc.0",
|
||||
"@angular/compiler": "~7.0.0-rc.0",
|
||||
"@angular/core": "~7.0.0-rc.0",
|
||||
"@angular/elements": "~7.0.0-rc.0",
|
||||
"@angular/forms": "~7.0.0-rc.0",
|
||||
"@angular/http": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser": "~7.0.0-rc.0",
|
||||
"@angular/platform-browser-dynamic": "~7.0.0-rc.0",
|
||||
"@angular/router": "~7.0.0-rc.0",
|
||||
"@angular/service-worker": "~7.0.0-rc.0",
|
||||
"@angular/upgrade": "~7.0.0-rc.0",
|
||||
"@nguniversal/common": "^6.1.0",
|
||||
"@nguniversal/express-engine": "^6.1.0",
|
||||
"@nguniversal/module-map-ngfactory-loader": "^6.1.0",
|
||||
"@angular/animations": "^6.0.0",
|
||||
"@angular/common": "^6.0.0",
|
||||
"@angular/compiler": "^6.0.0",
|
||||
"@angular/core": "^6.0.0",
|
||||
"@angular/elements": "^6.0.0",
|
||||
"@angular/forms": "^6.0.0",
|
||||
"@angular/http": "^6.0.0",
|
||||
"@angular/platform-browser": "^6.0.0",
|
||||
"@angular/platform-browser-dynamic": "^6.0.0",
|
||||
"@angular/router": "^6.0.0",
|
||||
"@angular/service-worker": "^6.0.0",
|
||||
"@angular/upgrade": "^6.0.0",
|
||||
"@nguniversal/express-engine": "^6.0.0",
|
||||
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"core-js": "^2.5.4",
|
||||
"express": "^4.14.1",
|
||||
"rxjs": "^6.3.0",
|
||||
"rxjs": "^6.0.0",
|
||||
"systemjs": "0.19.39",
|
||||
"web-animations-js": "^2.3.1",
|
||||
"zone.js": "~0.8.26"
|
||||
"zone.js": "^0.8.24"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.9.0-rc.2",
|
||||
"@angular/cli": "^7.0.0-rc.2",
|
||||
"@angular/compiler-cli": "~7.0.0-rc.0",
|
||||
"@angular/language-service": "~7.0.0-rc.0",
|
||||
"@angular/platform-server": "~7.0.0-rc.0",
|
||||
"@angular-devkit/build-angular": "~0.6.0",
|
||||
"@angular/cli": "^6.0.0",
|
||||
"@angular/compiler-cli": "^6.0.0",
|
||||
"@angular/language-service": "^6.0.0",
|
||||
"@angular/platform-server": "^6.0.0",
|
||||
"@types/angular": "^1.6.47",
|
||||
"@types/angular-animate": "^1.5.10",
|
||||
"@types/angular-mocks": "^1.6.0",
|
||||
"@types/angular-resource": "^1.5.14",
|
||||
"@types/angular-route": "^1.3.5",
|
||||
"@types/express": "^4.0.35",
|
||||
"@types/jasmine": "~2.8.8",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/jasmine": "~2.8.0",
|
||||
"@types/jasminewd2": "^2.0.4",
|
||||
"@types/jquery": "^3.3.4",
|
||||
"@types/node": "~8.9.4",
|
||||
"@types/node": "^6.0.45",
|
||||
"canonical-path": "0.0.2",
|
||||
"concurrently": "^3.0.0",
|
||||
"http-server": "^0.9.0",
|
||||
"jasmine-core": "~2.99.1",
|
||||
"jasmine-marbles": "^0.4.0",
|
||||
"jasmine-marbles": "^0.3.1",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~3.0.0",
|
||||
"karma": "~1.7.1",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-coverage-istanbul-reporter": "~2.0.1",
|
||||
"karma-jasmine": "~1.1.2",
|
||||
"karma-coverage-istanbul-reporter": "~1.4.2",
|
||||
"karma-jasmine": "~1.1.1",
|
||||
"karma-jasmine-html-reporter": "^0.2.2",
|
||||
"karma-phantomjs-launcher": "^1.0.2",
|
||||
"lite-server": "^2.2.2",
|
||||
"lodash": "^4.16.2",
|
||||
"phantomjs-prebuilt": "^2.1.7",
|
||||
"protractor": "~5.4.0",
|
||||
"protractor": "~5.3.0",
|
||||
"rimraf": "^2.5.4",
|
||||
"rollup": "^0.41.6",
|
||||
"rollup-plugin-commonjs": "^8.0.2",
|
||||
@ -80,10 +79,10 @@
|
||||
"rollup-plugin-uglify": "^1.0.1",
|
||||
"source-map-explorer": "^1.3.2",
|
||||
"ts-loader": "^4.2.0",
|
||||
"ts-node": "~7.0.0",
|
||||
"tslint": "~5.11.0",
|
||||
"typescript": "~3.1.1",
|
||||
"webpack-cli": "^3.1.0"
|
||||
"ts-node": "^5.0.1",
|
||||
"tslint": "^5.9.1",
|
||||
"typescript": "2.7.2",
|
||||
"webpack-cli": "^2.0.14"
|
||||
},
|
||||
"repository": {}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,11 +2,14 @@
|
||||
|
||||
const chalk = require('chalk');
|
||||
const fs = require('fs-extra');
|
||||
const lockfile = require('@yarnpkg/lockfile');
|
||||
const path = require('canonical-path');
|
||||
const semver = require('semver');
|
||||
const shelljs = require('shelljs');
|
||||
const yargs = require('yargs');
|
||||
|
||||
const PACKAGE_JSON = 'package.json';
|
||||
const YARN_LOCK = 'yarn.lock';
|
||||
const LOCAL_MARKER_PATH = 'node_modules/_local_.json';
|
||||
const PACKAGE_JSON_REGEX = /^[^/]+\/package\.json$/;
|
||||
|
||||
@ -62,8 +65,10 @@ class NgPackagesInstaller {
|
||||
* contents and acts as an indicator that dependencies have been overridden.
|
||||
*/
|
||||
installLocalDependencies() {
|
||||
if (this._checkLocalMarker() !== true || this.force) {
|
||||
if (this.force || !this._checkLocalMarker()) {
|
||||
const pathToPackageConfig = path.resolve(this.projectDir, PACKAGE_JSON);
|
||||
const pathToLockfile = path.resolve(this.projectDir, YARN_LOCK);
|
||||
const parsedLockfile = this._parseLockfile(pathToLockfile);
|
||||
const packages = this._getDistPackages();
|
||||
|
||||
try {
|
||||
@ -88,17 +93,17 @@ class NgPackagesInstaller {
|
||||
});
|
||||
});
|
||||
|
||||
fs.writeFileSync(pkg.packageJsonPath, JSON.stringify(tmpConfig));
|
||||
fs.writeFileSync(pkg.packageJsonPath, JSON.stringify(tmpConfig, null, 2));
|
||||
});
|
||||
|
||||
const packageConfigFile = fs.readFileSync(pathToPackageConfig);
|
||||
const packageConfigFile = fs.readFileSync(pathToPackageConfig, 'utf8');
|
||||
const packageConfig = JSON.parse(packageConfigFile);
|
||||
|
||||
const [dependencies, peers] = this._collectDependencies(packageConfig.dependencies || {}, packages);
|
||||
const [devDependencies, devPeers] = this._collectDependencies(packageConfig.devDependencies || {}, packages);
|
||||
|
||||
this._assignPeerDependencies(peers, dependencies, devDependencies);
|
||||
this._assignPeerDependencies(devPeers, dependencies, devDependencies);
|
||||
this._assignPeerDependencies(peers, dependencies, devDependencies, parsedLockfile);
|
||||
this._assignPeerDependencies(devPeers, dependencies, devDependencies, parsedLockfile);
|
||||
|
||||
const localPackageConfig = Object.assign(Object.create(null), packageConfig, { dependencies, devDependencies });
|
||||
localPackageConfig.__angular = { local: true };
|
||||
@ -107,7 +112,7 @@ class NgPackagesInstaller {
|
||||
try {
|
||||
this._log(`Writing temporary local ${PACKAGE_JSON} to ${pathToPackageConfig}`);
|
||||
fs.writeFileSync(pathToPackageConfig, localPackageConfigJson);
|
||||
this._installDeps('--no-lockfile', '--check-files');
|
||||
this._installDeps('--pure-lockfile', '--check-files');
|
||||
this._setLocalMarker(localPackageConfigJson);
|
||||
} finally {
|
||||
this._log(`Restoring original ${PACKAGE_JSON} to ${pathToPackageConfig}`);
|
||||
@ -118,7 +123,7 @@ class NgPackagesInstaller {
|
||||
this._log(`Restoring original ${PACKAGE_JSON} for local Angular packages.`);
|
||||
Object.keys(packages).forEach(key => {
|
||||
const pkg = packages[key];
|
||||
fs.writeFileSync(pkg.packageJsonPath, JSON.stringify(pkg.config));
|
||||
fs.writeFileSync(pkg.packageJsonPath, JSON.stringify(pkg.config, null, 2));
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -134,15 +139,23 @@ class NgPackagesInstaller {
|
||||
|
||||
// Protected helpers
|
||||
|
||||
_assignPeerDependencies(peerDependencies, dependencies, devDependencies) {
|
||||
_assignPeerDependencies(peerDependencies, dependencies, devDependencies, parsedLockfile) {
|
||||
Object.keys(peerDependencies).forEach(key => {
|
||||
const peerDepRange = peerDependencies[key];
|
||||
|
||||
// Ignore peerDependencies whose range is already satisfied by current version in lockfile.
|
||||
const originalRange = dependencies[key] || devDependencies[key];
|
||||
const lockfileVersion = originalRange && parsedLockfile[`${key}@${originalRange}`].version;
|
||||
|
||||
if (lockfileVersion && semver.satisfies(lockfileVersion, peerDepRange)) return;
|
||||
|
||||
// If there is already an equivalent dependency then override it - otherwise assign/override the devDependency
|
||||
if (dependencies[key]) {
|
||||
this._log(`Overriding dependency with peerDependency: ${key}: ${peerDependencies[key]}`);
|
||||
dependencies[key] = peerDependencies[key];
|
||||
this._log(`Overriding dependency with peerDependency: ${key}: ${peerDepRange}`);
|
||||
dependencies[key] = peerDepRange;
|
||||
} else {
|
||||
this._log(`${devDependencies[key] ? 'Overriding' : 'Assigning'} devDependency with peerDependency: ${key}: ${peerDependencies[key]}`);
|
||||
devDependencies[key] = peerDependencies[key];
|
||||
this._log(`${devDependencies[key] ? 'Overriding' : 'Assigning'} devDependency with peerDependency: ${key}: ${peerDepRange}`);
|
||||
devDependencies[key] = peerDepRange;
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -166,11 +179,6 @@ class NgPackagesInstaller {
|
||||
}
|
||||
});
|
||||
|
||||
// FIXME: Temporarily use RxJS from root `node_modules/`.
|
||||
if (peerDependencies.rxjs) {
|
||||
peerDependencies.rxjs = `file:${ANGULAR_ROOT_DIR}/node_modules/rxjs`;
|
||||
}
|
||||
|
||||
return [mergedDependencies, peerDependencies];
|
||||
}
|
||||
|
||||
@ -226,6 +234,20 @@ class NgPackagesInstaller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and return a `yarn.lock` file.
|
||||
*/
|
||||
_parseLockfile(lockfilePath) {
|
||||
const lockfileContent = fs.readFileSync(lockfilePath, 'utf8');
|
||||
const parsed = lockfile.parse(lockfileContent);
|
||||
|
||||
if (parsed.type !== 'success') {
|
||||
throw new Error(`[${NgPackagesInstaller.name}]: Error parsing lockfile '${lockfilePath}' (result type: ${parsed.type}).`);
|
||||
}
|
||||
|
||||
return parsed.object;
|
||||
}
|
||||
|
||||
_printWarning() {
|
||||
const relativeScriptPath = path.relative('.', __filename.replace(/\.js$/, ''));
|
||||
const absoluteProjectDir = path.resolve(this.projectDir);
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const lockfile = require('@yarnpkg/lockfile');
|
||||
const path = require('canonical-path');
|
||||
const shelljs = require('shelljs');
|
||||
|
||||
@ -11,6 +12,7 @@ describe('NgPackagesInstaller', () => {
|
||||
const absoluteRootDir = path.resolve(rootDir);
|
||||
const nodeModulesDir = path.resolve(absoluteRootDir, 'node_modules');
|
||||
const packageJsonPath = path.resolve(absoluteRootDir, 'package.json');
|
||||
const yarnLockPath = path.resolve(absoluteRootDir, 'yarn.lock');
|
||||
const packagesDir = path.resolve(path.resolve(__dirname, '../../../dist/packages-dist'));
|
||||
const toolsDir = path.resolve(path.resolve(__dirname, '../../../dist/tools/@angular'));
|
||||
let installer;
|
||||
@ -52,13 +54,26 @@ describe('NgPackagesInstaller', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(installer, '_checkLocalMarker');
|
||||
spyOn(installer, '_installDeps');
|
||||
spyOn(installer, '_setLocalMarker');
|
||||
|
||||
spyOn(installer, '_parseLockfile').and.returnValue({
|
||||
'rxjs@^6.3.0': {version: '6.3.3'},
|
||||
'zone.js@^0.8.26': {version: '0.8.27'}
|
||||
});
|
||||
|
||||
// These are the packages that are "found" in the dist directory
|
||||
dummyNgPackages = {
|
||||
'@angular/core': {
|
||||
parentDir: packagesDir,
|
||||
packageJsonPath: `${packagesDir}/core/package.json`,
|
||||
config: { peerDependencies: { 'some-package': '5.0.1' } }
|
||||
config: {
|
||||
peerDependencies: {
|
||||
'rxjs': '^6.4.0',
|
||||
'some-package': '5.0.1',
|
||||
'zone.js': '~0.8.26'
|
||||
}
|
||||
}
|
||||
},
|
||||
'@angular/common': {
|
||||
parentDir: packagesDir,
|
||||
@ -93,10 +108,12 @@ describe('NgPackagesInstaller', () => {
|
||||
dummyPackage = {
|
||||
dependencies: {
|
||||
'@angular/core': '4.4.1',
|
||||
'@angular/common': '4.4.1'
|
||||
'@angular/common': '4.4.1',
|
||||
rxjs: '^6.3.0'
|
||||
},
|
||||
devDependencies: {
|
||||
'@angular/compiler-cli': '4.4.1'
|
||||
'@angular/compiler-cli': '4.4.1',
|
||||
'zone.js': '^0.8.26'
|
||||
}
|
||||
};
|
||||
dummyPackageJson = JSON.stringify(dummyPackage);
|
||||
@ -104,14 +121,23 @@ describe('NgPackagesInstaller', () => {
|
||||
|
||||
// This is the package.json that is temporarily written to the "test" folder
|
||||
// Note that the Angular (dev)dependencies have been modified to use a "file:" path
|
||||
// And that the peerDependencies from `dummyNgPackages` have been added as (dev)dependencies.
|
||||
// And that the peerDependencies from `dummyNgPackages` have been updated or added as
|
||||
// (dev)dependencies (unless the current version in lockfile satisfies semver).
|
||||
//
|
||||
// For example, `zone.js@0.8.27` (from lockfile) satisfies `zone.js@~0.8.26` (from
|
||||
// `@angular/core`), thus `zone.js: ^0.8.26` (from original `package.json`) is retained.
|
||||
// In contrast, `rxjs@6.3.3` (from lockfile) does not satisfy `rxjs@^6.4.0 (from
|
||||
// `@angular/core`), thus `rxjs: ^6.3.0` (from original `package.json`) is replaced with
|
||||
// `rxjs: ^6.4.0` (from `@angular/core`).
|
||||
expectedModifiedPackage = {
|
||||
dependencies: {
|
||||
'@angular/core': `file:${packagesDir}/core`,
|
||||
'@angular/common': `file:${packagesDir}/common`
|
||||
'@angular/common': `file:${packagesDir}/common`,
|
||||
'rxjs': '^6.4.0'
|
||||
},
|
||||
devDependencies: {
|
||||
'@angular/compiler-cli': `file:${toolsDir}/compiler-cli`,
|
||||
'zone.js': '^0.8.26',
|
||||
'some-package': '5.0.1',
|
||||
typescript: '^2.4.2'
|
||||
},
|
||||
@ -121,12 +147,20 @@ describe('NgPackagesInstaller', () => {
|
||||
});
|
||||
|
||||
describe('when there is a local package marker', () => {
|
||||
beforeEach(() => installer._checkLocalMarker.and.returnValue(true));
|
||||
|
||||
it('should not continue processing', () => {
|
||||
installer._checkLocalMarker.and.returnValue(true);
|
||||
installer.installLocalDependencies();
|
||||
expect(installer._checkLocalMarker).toHaveBeenCalled();
|
||||
expect(installer._getDistPackages).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should continue processing (without checking for local marker) if `force` is true', () => {
|
||||
installer.force = true;
|
||||
installer.installLocalDependencies();
|
||||
expect(installer._checkLocalMarker).not.toHaveBeenCalled();
|
||||
expect(installer._getDistPackages).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when there is no local package marker', () => {
|
||||
@ -135,14 +169,14 @@ describe('NgPackagesInstaller', () => {
|
||||
beforeEach(() => {
|
||||
log = [];
|
||||
fs.writeFileSync.and.callFake((filePath, contents) => filePath === packageJsonPath && log.push(`writeFile: ${contents}`));
|
||||
spyOn(installer, '_installDeps').and.callFake(() => log.push('installDeps:'));
|
||||
spyOn(installer, '_setLocalMarker');
|
||||
installer._installDeps.and.callFake((...args) => log.push(`installDeps: ${args.join(' ')}`));
|
||||
installer._checkLocalMarker.and.returnValue(false);
|
||||
installer.installLocalDependencies();
|
||||
});
|
||||
|
||||
it('should get the dist packages', () => {
|
||||
it('should parse the lockfile and get the dist packages', () => {
|
||||
expect(installer._checkLocalMarker).toHaveBeenCalled();
|
||||
expect(installer._parseLockfile).toHaveBeenCalledWith(yarnLockPath);
|
||||
expect(installer._getDistPackages).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@ -150,31 +184,32 @@ describe('NgPackagesInstaller', () => {
|
||||
const pkgJsonFor = pkgName => dummyNgPackages[`@angular/${pkgName}`].packageJsonPath;
|
||||
const pkgConfigFor = pkgName => copyJsonObj(dummyNgPackages[`@angular/${pkgName}`].config);
|
||||
const overwriteConfigFor = (pkgName, newProps) => Object.assign(pkgConfigFor(pkgName), newProps);
|
||||
const stringifyConfig = config => JSON.stringify(config, null, 2);
|
||||
|
||||
const allArgs = fs.writeFileSync.calls.allArgs();
|
||||
const firstFiveArgs = allArgs.slice(0, 5);
|
||||
const lastFiveArgs = allArgs.slice(-5);
|
||||
|
||||
expect(firstFiveArgs).toEqual([
|
||||
[pkgJsonFor('core'), JSON.stringify(overwriteConfigFor('core', {private: true}))],
|
||||
[pkgJsonFor('common'), JSON.stringify(overwriteConfigFor('common', {private: true}))],
|
||||
[pkgJsonFor('compiler'), JSON.stringify(overwriteConfigFor('compiler', {private: true}))],
|
||||
[pkgJsonFor('compiler-cli'), JSON.stringify(overwriteConfigFor('compiler-cli', {
|
||||
[pkgJsonFor('core'), stringifyConfig(overwriteConfigFor('core', {private: true}))],
|
||||
[pkgJsonFor('common'), stringifyConfig(overwriteConfigFor('common', {private: true}))],
|
||||
[pkgJsonFor('compiler'), stringifyConfig(overwriteConfigFor('compiler', {private: true}))],
|
||||
[pkgJsonFor('compiler-cli'), stringifyConfig(overwriteConfigFor('compiler-cli', {
|
||||
private: true,
|
||||
dependencies: { '@angular/tsc-wrapped': `file:${toolsDir}/tsc-wrapped` }
|
||||
}))],
|
||||
[pkgJsonFor('tsc-wrapped'), JSON.stringify(overwriteConfigFor('tsc-wrapped', {
|
||||
[pkgJsonFor('tsc-wrapped'), stringifyConfig(overwriteConfigFor('tsc-wrapped', {
|
||||
private: true,
|
||||
devDependencies: { '@angular/common': `file:${packagesDir}/common` }
|
||||
}))],
|
||||
]);
|
||||
|
||||
expect(lastFiveArgs).toEqual(['core', 'common', 'compiler', 'compiler-cli', 'tsc-wrapped']
|
||||
.map(pkgName => [pkgJsonFor(pkgName), JSON.stringify(pkgConfigFor(pkgName))]));
|
||||
.map(pkgName => [pkgJsonFor(pkgName), stringifyConfig(pkgConfigFor(pkgName))]));
|
||||
});
|
||||
|
||||
it('should load the package.json', () => {
|
||||
expect(fs.readFileSync).toHaveBeenCalledWith(packageJsonPath);
|
||||
expect(fs.readFileSync).toHaveBeenCalledWith(packageJsonPath, 'utf8');
|
||||
});
|
||||
|
||||
it('should overwrite package.json with modified config', () => {
|
||||
@ -188,7 +223,7 @@ describe('NgPackagesInstaller', () => {
|
||||
it('should overwrite package.json, then install deps, then restore original package.json', () => {
|
||||
expect(log).toEqual([
|
||||
`writeFile: ${expectedModifiedPackageJson}`,
|
||||
`installDeps:`,
|
||||
`installDeps: --pure-lockfile --check-files`,
|
||||
`writeFile: ${dummyPackageJson}`
|
||||
]);
|
||||
});
|
||||
@ -264,6 +299,42 @@ describe('NgPackagesInstaller', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('_parseLockfile()', () => {
|
||||
let originalLockfileParseDescriptor;
|
||||
|
||||
beforeEach(() => {
|
||||
// Workaround for `lockfile.parse()` being non-writable.
|
||||
let parse = lockfile.parse;
|
||||
originalLockfileParseDescriptor = Object.getOwnPropertyDescriptor(lockfile, 'parse');
|
||||
Object.defineProperty(lockfile, 'parse', {
|
||||
get() { return parse; },
|
||||
set(newParse) { parse = newParse; },
|
||||
});
|
||||
|
||||
fs.readFileSync.and.returnValue('mock content');
|
||||
spyOn(lockfile, 'parse').and.returnValue({type: 'success', object: {foo: {version: 'bar'}}});
|
||||
});
|
||||
|
||||
afterEach(() => Object.defineProperty(lockfile, 'parse', originalLockfileParseDescriptor));
|
||||
|
||||
it('should parse the specified lockfile', () => {
|
||||
installer._parseLockfile('/foo/bar/yarn.lock');
|
||||
expect(fs.readFileSync).toHaveBeenCalledWith('/foo/bar/yarn.lock', 'utf8');
|
||||
expect(lockfile.parse).toHaveBeenCalledWith('mock content');
|
||||
});
|
||||
|
||||
it('should throw if parsing the lockfile fails', () => {
|
||||
lockfile.parse.and.returnValue({type: 'not success'});
|
||||
expect(() => installer._parseLockfile('/foo/bar/yarn.lock')).toThrowError(
|
||||
'[NgPackagesInstaller]: Error parsing lockfile \'/foo/bar/yarn.lock\' (result type: not success).');
|
||||
});
|
||||
|
||||
it('should return the parsed lockfile content as an object', () => {
|
||||
const parsed = installer._parseLockfile('/foo/bar/yarn.lock');
|
||||
expect(parsed).toEqual({foo: {version: 'bar'}});
|
||||
});
|
||||
});
|
||||
|
||||
describe('_printWarning()', () => {
|
||||
it('should mention the message passed in the warning', () => {
|
||||
installer._printWarning();
|
||||
|
@ -9,12 +9,11 @@ const Package = require('dgeni').Package;
|
||||
const gitPackage = require('dgeni-packages/git');
|
||||
const apiPackage = require('../angular-api-package');
|
||||
const contentPackage = require('../angular-content-package');
|
||||
const cliDocsPackage = require('../cli-docs-package');
|
||||
const { extname, resolve } = require('canonical-path');
|
||||
const { existsSync } = require('fs');
|
||||
const { SRC_PATH } = require('../config');
|
||||
|
||||
module.exports = new Package('angular.io', [gitPackage, apiPackage, contentPackage, cliDocsPackage])
|
||||
module.exports = new Package('angular.io', [gitPackage, apiPackage, contentPackage])
|
||||
|
||||
// This processor relies upon the versionInfo. See below...
|
||||
.processor(require('./processors/processNavigationMap'))
|
||||
|
@ -1,7 +0,0 @@
|
||||
const shelljs = require('shelljs');
|
||||
const {resolve} = require('canonical-path');
|
||||
const {CONTENTS_PATH} = require('../config');
|
||||
|
||||
shelljs.cd(resolve(CONTENTS_PATH, 'cli-src'));
|
||||
shelljs.exec('git clean -Xfd');
|
||||
shelljs.exec('yarn install');
|
@ -1,48 +0,0 @@
|
||||
const {resolve} = require('canonical-path');
|
||||
const Package = require('dgeni').Package;
|
||||
const basePackage = require('../angular-base-package');
|
||||
const contentPackage = require('../content-package');
|
||||
const {CONTENTS_PATH, TEMPLATES_PATH, requireFolder} = require('../config');
|
||||
|
||||
|
||||
// Define the dgeni package for generating the docs
|
||||
module.exports = new Package('cli-docs', [basePackage, contentPackage])
|
||||
|
||||
// Register the services and file readers
|
||||
.factory(require('./readers/cli-command'))
|
||||
|
||||
// Register the processors
|
||||
.processor(require('./processors/processCliContainerDoc'))
|
||||
.processor(require('./processors/processCliCommands'))
|
||||
.processor(require('./processors/filterHiddenCommands'))
|
||||
|
||||
// Configure file reading
|
||||
.config(function(readFilesProcessor, cliCommandFileReader) {
|
||||
const CLI_SOURCE_PATH = resolve(CONTENTS_PATH, 'cli-src/node_modules/@angular/cli/help');
|
||||
readFilesProcessor.fileReaders.push(cliCommandFileReader);
|
||||
readFilesProcessor.sourceFiles = readFilesProcessor.sourceFiles.concat([
|
||||
{
|
||||
basePath: CLI_SOURCE_PATH,
|
||||
include: resolve(CLI_SOURCE_PATH, '*.json'),
|
||||
fileReader: 'cliCommandFileReader'
|
||||
},
|
||||
{
|
||||
basePath: CONTENTS_PATH,
|
||||
include: resolve(CONTENTS_PATH, 'cli/**'),
|
||||
fileReader: 'contentFileReader'
|
||||
},
|
||||
]);
|
||||
})
|
||||
|
||||
.config(function(templateFinder, templateEngine, getInjectables) {
|
||||
// Where to find the templates for the CLI doc rendering
|
||||
templateFinder.templateFolders.unshift(resolve(TEMPLATES_PATH, 'cli'));
|
||||
// Add in templating filters and tags
|
||||
templateEngine.filters = templateEngine.filters.concat(getInjectables(requireFolder(__dirname, './rendering')));
|
||||
})
|
||||
|
||||
|
||||
.config(function(convertToJsonProcessor, postProcessHtml) {
|
||||
convertToJsonProcessor.docTypes = convertToJsonProcessor.docTypes.concat(['cli-command', 'cli-overview']);
|
||||
postProcessHtml.docTypes = postProcessHtml.docTypes.concat(['cli-command', 'cli-overview']);
|
||||
});
|
@ -1,9 +0,0 @@
|
||||
module.exports = function filterHiddenCommands() {
|
||||
return {
|
||||
$runAfter: ['files-read'],
|
||||
$runBefore: ['processCliContainerDoc'],
|
||||
$process(docs) {
|
||||
return docs.filter(doc => doc.docType !== 'cli-command' || doc.hidden !== true);
|
||||
}
|
||||
};
|
||||
};
|
@ -1,40 +0,0 @@
|
||||
const testPackage = require('../../helpers/test-package');
|
||||
const processorFactory = require('./filterHiddenCommands');
|
||||
const Dgeni = require('dgeni');
|
||||
|
||||
describe('filterHiddenCommands processor', () => {
|
||||
|
||||
it('should be available on the injector', () => {
|
||||
const dgeni = new Dgeni([testPackage('cli-docs-package')]);
|
||||
const injector = dgeni.configureInjector();
|
||||
const processor = injector.get('filterHiddenCommands');
|
||||
expect(processor.$process).toBeDefined();
|
||||
});
|
||||
|
||||
it('should run after the correct processor', () => {
|
||||
const processor = processorFactory();
|
||||
expect(processor.$runAfter).toEqual(['files-read']);
|
||||
});
|
||||
|
||||
it('should run before the correct processor', () => {
|
||||
const processor = processorFactory();
|
||||
expect(processor.$runBefore).toEqual(['processCliContainerDoc']);
|
||||
});
|
||||
|
||||
it('should remove CLI command docs that are hidden', () => {
|
||||
const processor = processorFactory();
|
||||
const filtered = processor.$process([
|
||||
{ docType: 'cli-command', id: 'one' },
|
||||
{ docType: 'cli-command', id: 'two', hidden: true },
|
||||
{ docType: 'cli-command', id: 'three', hidden: false },
|
||||
{ docType: 'other-doc', id: 'four', hidden: true },
|
||||
{ docType: 'other-doc', id: 'five', hidden: false },
|
||||
]);
|
||||
expect(filtered).toEqual([
|
||||
{ docType: 'cli-command', id: 'one' },
|
||||
{ docType: 'cli-command', id: 'three', hidden: false },
|
||||
{ docType: 'other-doc', id: 'four', hidden: true },
|
||||
{ docType: 'other-doc', id: 'five', hidden: false },
|
||||
]);
|
||||
});
|
||||
});
|
@ -1,68 +0,0 @@
|
||||
module.exports = function processCliCommands() {
|
||||
return {
|
||||
$runAfter: ['extra-docs-added'],
|
||||
$runBefore: ['rendering-docs'],
|
||||
$process(docs) {
|
||||
const navigationDoc = docs.find(doc => doc.docType === 'navigation-json');
|
||||
const navigationNode = navigationDoc && navigationDoc.data['SideNav'].find(node => node.title === 'CLI Commands');
|
||||
|
||||
docs.forEach(doc => {
|
||||
if (doc.docType === 'cli-command') {
|
||||
doc.names = collectNames(doc.name, doc.commandAliases);
|
||||
|
||||
// Recursively process the options
|
||||
processOptions(doc, doc.options);
|
||||
|
||||
// Add to navigation doc
|
||||
if (navigationNode) {
|
||||
navigationNode.children.push({ url: doc.path, title: `ng ${doc.name}` });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
function processOptions(container, options) {
|
||||
container.positionalOptions = [];
|
||||
container.namedOptions = [];
|
||||
|
||||
options.forEach(option => {
|
||||
|
||||
if (option.type === 'boolean' && option.default === undefined) {
|
||||
option.default = false;
|
||||
}
|
||||
|
||||
// Ignore any hidden options
|
||||
if (option.hidden) { return; }
|
||||
|
||||
option.types = option.types || [option.type];
|
||||
option.names = collectNames(option.name, option.aliases);
|
||||
|
||||
// Now work out what kind of option it is: positional/named
|
||||
if (option.positional !== undefined) {
|
||||
container.positionalOptions[option.positional] = option;
|
||||
} else {
|
||||
container.namedOptions.push(option);
|
||||
}
|
||||
|
||||
// Recurse if there are subcommands
|
||||
if (option.subcommands) {
|
||||
option.subcommands = getValues(option.subcommands);
|
||||
option.subcommands.forEach(subcommand => {
|
||||
subcommand.names = collectNames(subcommand.name, subcommand.aliases);
|
||||
processOptions(subcommand, subcommand.options);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
container.namedOptions.sort((a, b) => a.name > b.name ? 1 : -1);
|
||||
}
|
||||
|
||||
function collectNames(name, aliases) {
|
||||
return [name].concat(aliases);
|
||||
}
|
||||
|
||||
function getValues(obj) {
|
||||
return Object.keys(obj).map(key => obj[key]);
|
||||
}
|
@ -1,264 +0,0 @@
|
||||
const testPackage = require('../../helpers/test-package');
|
||||
const processorFactory = require('./processCliCommands');
|
||||
const Dgeni = require('dgeni');
|
||||
|
||||
describe('processCliCommands processor', () => {
|
||||
|
||||
it('should be available on the injector', () => {
|
||||
const dgeni = new Dgeni([testPackage('cli-docs-package')]);
|
||||
const injector = dgeni.configureInjector();
|
||||
const processor = injector.get('processCliCommands');
|
||||
expect(processor.$process).toBeDefined();
|
||||
});
|
||||
|
||||
it('should run after the correct processor', () => {
|
||||
const processor = processorFactory();
|
||||
expect(processor.$runAfter).toEqual(['extra-docs-added']);
|
||||
});
|
||||
|
||||
it('should run before the correct processor', () => {
|
||||
const processor = processorFactory();
|
||||
expect(processor.$runBefore).toEqual(['rendering-docs']);
|
||||
});
|
||||
|
||||
it('should collect the names (name + aliases)', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: ['alias1', 'alias2'],
|
||||
options: [],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.names).toEqual(['name', 'alias1', 'alias2']);
|
||||
});
|
||||
|
||||
describe('options', () => {
|
||||
it('should remove the hidden options', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: [],
|
||||
options: [
|
||||
{ name: 'option1' },
|
||||
{ name: 'option2', hidden: true },
|
||||
{ name: 'option3' },
|
||||
{ name: 'option4', hidden: true },
|
||||
],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.namedOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'option1' }),
|
||||
jasmine.objectContaining({ name: 'option3' }),
|
||||
]);
|
||||
});
|
||||
|
||||
it('should collect the non-hidden positional and named options', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: [],
|
||||
options: [
|
||||
{ name: 'named1' },
|
||||
{ name: 'positional1', positional: 0},
|
||||
{ name: 'named2', hidden: true },
|
||||
{ name: 'positional2', hidden: true, positional: 1},
|
||||
],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.positionalOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'positional1', positional: 0}),
|
||||
]);
|
||||
expect(doc.namedOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'named1' }),
|
||||
]);
|
||||
});
|
||||
|
||||
it('should sort the named options into order by name', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: [],
|
||||
options: [
|
||||
{ name: 'c' },
|
||||
{ name: 'a' },
|
||||
{ name: 'b' },
|
||||
],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.namedOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'a' }),
|
||||
jasmine.objectContaining({ name: 'b' }),
|
||||
jasmine.objectContaining({ name: 'c' }),
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('subcommands', () => {
|
||||
it('should convert subcommands hash into a collection', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: [],
|
||||
options: [{
|
||||
name: 'supercommand',
|
||||
subcommands: {
|
||||
subcommand1: {
|
||||
name: 'subcommand1',
|
||||
options: [
|
||||
{ name: 'subcommand1-option1' },
|
||||
{ name: 'subcommand1-option2' },
|
||||
],
|
||||
},
|
||||
subcommand2: {
|
||||
name: 'subcommand2',
|
||||
options: [
|
||||
{ name: 'subcommand2-option1' },
|
||||
{ name: 'subcommand2-option2' },
|
||||
],
|
||||
}
|
||||
},
|
||||
}],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.options[0].subcommands).toEqual([
|
||||
jasmine.objectContaining({ name: 'subcommand1' }),
|
||||
jasmine.objectContaining({ name: 'subcommand2' }),
|
||||
]);
|
||||
});
|
||||
|
||||
it('should remove the hidden subcommand options', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: [],
|
||||
options: [{
|
||||
name: 'supercommand',
|
||||
subcommands: {
|
||||
subcommand1: {
|
||||
name: 'subcommand1',
|
||||
options: [
|
||||
{ name: 'subcommand1-option1' },
|
||||
{ name: 'subcommand1-option2', hidden: true },
|
||||
],
|
||||
},
|
||||
subcommand2: {
|
||||
name: 'subcommand2',
|
||||
options: [
|
||||
{ name: 'subcommand2-option1', hidden: true },
|
||||
{ name: 'subcommand2-option2' },
|
||||
],
|
||||
}
|
||||
},
|
||||
}],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.options[0].subcommands[0].namedOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'subcommand1-option1' }),
|
||||
]);
|
||||
expect(doc.options[0].subcommands[1].namedOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'subcommand2-option2' }),
|
||||
]);
|
||||
});
|
||||
|
||||
it('should collect the non-hidden positional arguments and named options', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: [],
|
||||
options: [{
|
||||
name: 'supercommand',
|
||||
subcommands: {
|
||||
subcommand1: {
|
||||
name: 'subcommand1',
|
||||
options: [
|
||||
{ name: 'subcommand1-option1' },
|
||||
{ name: 'subcommand1-option2', positional: 0 },
|
||||
],
|
||||
},
|
||||
subcommand2: {
|
||||
name: 'subcommand2',
|
||||
options: [
|
||||
{ name: 'subcommand2-option1', hidden: true },
|
||||
{ name: 'subcommand2-option2', hidden: true, positional: 1 },
|
||||
],
|
||||
}
|
||||
},
|
||||
}],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.options[0].subcommands[0].positionalOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'subcommand1-option2', positional: 0}),
|
||||
]);
|
||||
expect(doc.options[0].subcommands[0].namedOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'subcommand1-option1' }),
|
||||
]);
|
||||
|
||||
expect(doc.options[0].subcommands[1].positionalOptions).toEqual([]);
|
||||
expect(doc.options[0].subcommands[1].namedOptions).toEqual([]);
|
||||
});
|
||||
|
||||
it('should sort the named subcommand options into order by name', () => {
|
||||
const processor = processorFactory();
|
||||
const doc = {
|
||||
docType: 'cli-command',
|
||||
name: 'name',
|
||||
commandAliases: [],
|
||||
options: [{
|
||||
name: 'supercommand',
|
||||
subcommands: {
|
||||
subcommand1: {
|
||||
name: 'subcommand1',
|
||||
options: [
|
||||
{ name: 'c' },
|
||||
{ name: 'a' },
|
||||
{ name: 'b' },
|
||||
]
|
||||
}
|
||||
}
|
||||
}],
|
||||
};
|
||||
processor.$process([doc]);
|
||||
expect(doc.options[0].subcommands[0].namedOptions).toEqual([
|
||||
jasmine.objectContaining({ name: 'a' }),
|
||||
jasmine.objectContaining({ name: 'b' }),
|
||||
jasmine.objectContaining({ name: 'c' }),
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
it('should add the command to the CLI node in the navigation doc', () => {
|
||||
const processor = processorFactory();
|
||||
const command = {
|
||||
docType: 'cli-command',
|
||||
name: 'command1',
|
||||
commandAliases: ['alias1', 'alias2'],
|
||||
options: [],
|
||||
path: 'cli/command1',
|
||||
};
|
||||
const navigation = {
|
||||
docType: 'navigation-json',
|
||||
data: {
|
||||
SideNav: [
|
||||
{ url: 'some/page', title: 'Some Page' },
|
||||
{ url: 'cli', title: 'CLI Commands', children: [
|
||||
{ url: 'cli', title: 'Using the CLI' },
|
||||
]},
|
||||
{ url: 'other/page', title: 'Other Page' },
|
||||
]
|
||||
}
|
||||
};
|
||||
processor.$process([command, navigation]);
|
||||
expect(navigation.data.SideNav[1].title).toEqual('CLI Commands');
|
||||
expect(navigation.data.SideNav[1].children).toEqual([
|
||||
{ url: 'cli', title: 'Using the CLI' },
|
||||
{ url: 'cli/command1', title: 'ng command1' },
|
||||
]);
|
||||
});
|
||||
});
|
@ -1,11 +0,0 @@
|
||||
module.exports = function processCliContainerDoc() {
|
||||
return {
|
||||
$runAfter: ['extra-docs-added'],
|
||||
$runBefore: ['rendering-docs'],
|
||||
$process(docs) {
|
||||
const cliDoc = docs.find(doc => doc.id === 'cli/index');
|
||||
cliDoc.id = 'cli-container';
|
||||
cliDoc.commands = docs.filter(doc => doc.docType === 'cli-command');
|
||||
}
|
||||
};
|
||||
};
|
@ -1,23 +0,0 @@
|
||||
const testPackage = require('../../helpers/test-package');
|
||||
const processorFactory = require('./processCliContainerDoc');
|
||||
const Dgeni = require('dgeni');
|
||||
|
||||
describe('processCliContainerDoc processor', () => {
|
||||
|
||||
it('should be available on the injector', () => {
|
||||
const dgeni = new Dgeni([testPackage('cli-docs-package')]);
|
||||
const injector = dgeni.configureInjector();
|
||||
const processor = injector.get('processCliContainerDoc');
|
||||
expect(processor.$process).toBeDefined();
|
||||
});
|
||||
|
||||
it('should run after the correct processor', () => {
|
||||
const processor = processorFactory();
|
||||
expect(processor.$runAfter).toEqual(['extra-docs-added']);
|
||||
});
|
||||
|
||||
it('should run before the correct processor', () => {
|
||||
const processor = processorFactory();
|
||||
expect(processor.$runBefore).toEqual(['rendering-docs']);
|
||||
});
|
||||
});
|
@ -1,47 +0,0 @@
|
||||
/**
|
||||
* This file reader will pull the contents from a cli command json file
|
||||
*
|
||||
* The doc will initially have the form:
|
||||
* ```
|
||||
* {
|
||||
* startingLine: 1,
|
||||
* ...
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
module.exports = function cliCommandFileReader(log) {
|
||||
const json5 = require('json5');
|
||||
return {
|
||||
name: 'cliCommandFileReader',
|
||||
defaultPattern: /\.json$/,
|
||||
getDocs(fileInfo) {
|
||||
try {
|
||||
const doc = json5.parse(fileInfo.content);
|
||||
const name = fileInfo.baseName;
|
||||
const path = `cli/${name}`;
|
||||
// We return a single element array because content files only contain one document
|
||||
const result = Object.assign(doc, {
|
||||
content: doc.description,
|
||||
docType: 'cli-command',
|
||||
startingLine: 1,
|
||||
id: `cli-${doc.name}`,
|
||||
commandAliases: doc.aliases || [],
|
||||
aliases: computeAliases(doc),
|
||||
path,
|
||||
outputPath: `${path}.json`,
|
||||
breadCrumbs: [
|
||||
{ text: 'CLI', path: 'cli' },
|
||||
{ text: name, path },
|
||||
]
|
||||
});
|
||||
return [result];
|
||||
} catch (e) {
|
||||
log.warn(`Failed to read cli command file: "${fileInfo.relativePath}" - ${e.message}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
function computeAliases(doc) {
|
||||
return [doc.name].concat(doc.aliases || []).map(alias => `cli-${alias}`);
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
const cliCommandReaderFactory = require('./cli-command');
|
||||
const reader = cliCommandReaderFactory();
|
||||
|
||||
const content = `
|
||||
{
|
||||
"name": "add",
|
||||
"description": "Add support for a library to your project.",
|
||||
"longDescription": "Add support for a library in your project, for example adding \`@angular/pwa\` which would configure\\nyour project for PWA support.\\n",
|
||||
"hidden": false,
|
||||
"type": "custom",
|
||||
"options": [
|
||||
{
|
||||
"name": "collection",
|
||||
"description": "The package to be added.",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"positional": 0
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"description": "Shows a help message.",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"aliases": [],
|
||||
"hidden": false
|
||||
},
|
||||
{
|
||||
"name": "helpJson",
|
||||
"description": "Shows the metadata associated with each flags, in JSON format.",
|
||||
"type": "boolean",
|
||||
"required": false,
|
||||
"aliases": [],
|
||||
"hidden": false
|
||||
}
|
||||
],
|
||||
"aliases": ['a'],
|
||||
"scope": "in"
|
||||
}
|
||||
`;
|
||||
|
||||
const fileInfo = {content, baseName: 'add'};
|
||||
|
||||
describe('cli-command reader', () => {
|
||||
describe('getDocs', () => {
|
||||
it('should return an array containing a single doc', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs.length).toEqual(1);
|
||||
});
|
||||
|
||||
it('should return a cli-command doc', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0]).toEqual(jasmine.objectContaining({
|
||||
id: 'cli-add',
|
||||
docType: 'cli-command',
|
||||
}));
|
||||
});
|
||||
|
||||
it('should extract the name from the fileInfo', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].name).toEqual('add');
|
||||
});
|
||||
|
||||
it('should compute the id and aliases', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].id).toEqual('cli-add');
|
||||
expect(docs[0].aliases).toEqual(['cli-add', 'cli-a']);
|
||||
});
|
||||
|
||||
it('should compute the path and outputPath', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].path).toEqual('cli/add');
|
||||
expect(docs[0].outputPath).toEqual('cli/add.json');
|
||||
});
|
||||
|
||||
it('should compute the bread crumbs', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].breadCrumbs).toEqual([
|
||||
{ text: 'CLI', path: 'cli' },
|
||||
{ text: 'add', path: 'cli/add' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('should start at line 1', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].startingLine).toEqual(1);
|
||||
});
|
||||
|
||||
it('should extract the short description into the content', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].content).toEqual('Add support for a library to your project.');
|
||||
});
|
||||
|
||||
it('should extract the long description', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].longDescription).toEqual('Add support for a library in your project, for example adding `@angular/pwa` which would configure\nyour project for PWA support.\n');
|
||||
});
|
||||
|
||||
it('should extract the command type', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].type).toEqual('custom');
|
||||
});
|
||||
|
||||
it('should extract the command scope', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].scope).toEqual('in');
|
||||
});
|
||||
|
||||
it('should extract the command aliases', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].commandAliases).toEqual(['a']);
|
||||
});
|
||||
|
||||
it('should extract the options', () => {
|
||||
const docs = reader.getDocs(fileInfo);
|
||||
expect(docs[0].options).toEqual([
|
||||
jasmine.objectContaining({ name: 'collection' }),
|
||||
jasmine.objectContaining({ name: 'help' }),
|
||||
jasmine.objectContaining({ name: 'helpJson' }),
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
@ -1,6 +0,0 @@
|
||||
module.exports = function cliNegate() {
|
||||
return {
|
||||
name: 'cliNegate',
|
||||
process: function(str) { return 'no' + str.charAt(0).toUpperCase() + str.slice(1); }
|
||||
};
|
||||
};
|
@ -1,17 +0,0 @@
|
||||
var factory = require('./cliNegate');
|
||||
|
||||
describe('cliNegate filter', function() {
|
||||
var filter;
|
||||
|
||||
beforeEach(function() { filter = factory(); });
|
||||
|
||||
it('should be called "cliNegate"', function() { expect(filter.name).toEqual('cliNegate'); });
|
||||
|
||||
it('should make the first char uppercase and add `no` to the front', function() {
|
||||
expect(filter.process('abc')).toEqual('noAbc');
|
||||
});
|
||||
|
||||
it('should make leave the rest of the chars alone', function() {
|
||||
expect(filter.process('abCdE')).toEqual('noAbCdE');
|
||||
});
|
||||
});
|
@ -208,7 +208,7 @@
|
||||
{% set nonInternalMembers = ancestor.doc[collectionName] | filterByPropertyValue('internal', undefined) %}
|
||||
{% if nonInternalMembers.length -%}
|
||||
<section class="inherited-members-list">
|
||||
<h3>Inherited from <code>{$ ancestor.doc.id $}</code></h3>
|
||||
<h3>Inherited from <code><a class="code-anchor" href="{$ ancestor.doc.path $}">{$ ancestor.doc.name $}</a></code></h3>
|
||||
<ul>
|
||||
{% for member in nonInternalMembers %}
|
||||
<li>
|
||||
|
@ -1,18 +0,0 @@
|
||||
{% import 'lib/cli.html' as cli %}
|
||||
|
||||
<article>
|
||||
{% include 'include/cli-breadcrumb.html' %}
|
||||
{% include 'include/cli-header.html' %}
|
||||
|
||||
<aio-toc class="embedded"></aio-toc>
|
||||
|
||||
<div class="cli-body">
|
||||
{$ doc.shortDescription | marked $}
|
||||
{$ doc.description | marked $}
|
||||
{$ cli.renderSyntax(doc) $}
|
||||
{$ cli.renderArguments(doc.positionalOptions, 2) $}
|
||||
{$ cli.renderNamedOptions(doc.namedOptions, 2) $}
|
||||
{$ cli.renderSubcommands(doc) $}
|
||||
{$ doc.longDescription | marked $}
|
||||
</div>
|
||||
</article>
|
@ -1,23 +0,0 @@
|
||||
<div class="content">
|
||||
{$ doc.description | marked $}
|
||||
</div>
|
||||
|
||||
<h2>Command Overview</h2>
|
||||
<table class="is-full-width list-table property-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Command</th>
|
||||
<th>Alias</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for command in doc.commands %}
|
||||
<tr>
|
||||
<td><a class="code-anchor" href="{$ command.path $}"><code>{$ command.name $}</code></a></td>
|
||||
<td>{% for alias in command.commandAliases %}<code>{$ alias $} </code>{% endfor %}</td>
|
||||
<td>{$ command.description | marked $}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
@ -1,16 +0,0 @@
|
||||
{% set comma = joiner(',') %}
|
||||
{% set slash = joiner('/') %}
|
||||
|
||||
<div class="breadcrumb">
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [
|
||||
{%- for crumb in doc.breadCrumbs %}{$ comma() $}
|
||||
{ "@type": "ListItem", "position": {$ loop.index $}, "item": { "@id": "https://angular.io/{$ crumb.path $}", "name": "{$ crumb.text $}" } }{% endfor %}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
{% for crumb in doc.breadCrumbs %}{% if not loop.last %} {$ slash() $} {% if crumb.path %}<a href="{$ crumb.path $}">{$ crumb.text $}</a>{% else %}{$ crumb.text $}{% endif %}{% endif %}{% endfor %}
|
||||
</div>
|
@ -1,4 +0,0 @@
|
||||
|
||||
<header class="cli-header">
|
||||
<h1>ng {$ doc.name $}</h1>
|
||||
</header>
|
@ -1,111 +0,0 @@
|
||||
{% macro renderSyntax(container, prefix) -%}
|
||||
{% for name in container.names %}
|
||||
<code-example hideCopy="true" class="no-box api-heading">ng {%if prefix %}{$ prefix $} {% endif %}<span class="cli-name">{$ name $}</span>
|
||||
{%- for arg in container.positionalOptions %} <<var>{$ arg.name $}</var>>{% endfor %}
|
||||
{%- if container.namedOptions.length %} [<var>options</var>]{% endif -%}
|
||||
</code-example>
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro renderArguments(arguments, level = 2) %}
|
||||
{% if arguments.length %}
|
||||
<h{$ level $} class="no-anchor">Arguments</h{$ level $}>
|
||||
<table class="is-full-width list-table property-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Argument</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for option in arguments %}
|
||||
<tr class="cli-option">
|
||||
<td><code>{$ option.name $}</code></td>
|
||||
<td>
|
||||
{$ option.description | marked $}
|
||||
{% if option.subcommands.length -%}
|
||||
<p>This option can take one of the following <a href="#{$ option.name $}-commands">sub-commands</a>:<p>
|
||||
<ul>
|
||||
{% for subcommand in option.subcommands %}
|
||||
<li><code><a class="code-anchor" href="#{$ subcommand.name $}-command">{$ subcommand.name $}</a></code></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{%- endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro renderNamedOptions(options, level = 2) %}
|
||||
{% if options.length %}
|
||||
<h{$ level $} class="no-anchor">Options</h{$ level $}>
|
||||
<table class="is-full-width list-table property-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for option in options %}
|
||||
<tr class="cli-option">
|
||||
<td>
|
||||
{% for type in option.types -%}
|
||||
{% for alias in option.names -%}
|
||||
<code class="cli-option-syntax">{$ renderOption(option.name, alias, type, option.default, option.enum) $}</code>
|
||||
{% if not loop.last %}<br>{% endif %}
|
||||
{% endfor -%}
|
||||
{% if not loop.last %}<br>{% endif %}
|
||||
{% endfor -%}
|
||||
</td>
|
||||
<td>
|
||||
{$ option.description | marked $}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro bold(isBold, contents) -%}
|
||||
<span {% if isBold %}class="cli-default"{% endif %}>{$ contents $}</span>
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro renderValues(values, default) -%}
|
||||
{% for value in values %}{$ bold(value==default, value) $}{% if not loop.last %}|{% endif %}{% endfor %}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro renderOption(name, alias, type, default, values) -%}
|
||||
{% set prefix = '--' if (name === alias and name.length > 1) else '-' %}
|
||||
{%- if type === 'boolean' -%}
|
||||
{%- if not values.length %}{$ prefix $}{$ alias $}={$ renderValues([true, false], default) $}
|
||||
{% endif -%}
|
||||
{$ prefix $}{$ bold(default, alias) $}|{$ prefix $}{$ bold(not default, alias | cliNegate) $}
|
||||
{%- elif values.length -%}
|
||||
{$ prefix $}{$ alias $}={$ renderValues(values, default) $}
|
||||
{%- elif type === 'string' -%}
|
||||
{$ prefix $}{$ alias $}=<var>{$ name $}</var>
|
||||
{%- else -%}
|
||||
{$ prefix $}{$ alias $}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro renderSubcommands(container) -%}
|
||||
{% for command in container.positionalOptions %}{% if command.subcommands.length %}
|
||||
<h2><a id="{$ command.name $}-commands"></a>{$ command.name | title $} commands</h2>
|
||||
{% for subcommand in command.subcommands %}
|
||||
<h3><code><a id="{$ subcommand.name $}-command"></a>{$ subcommand.name $}</code></h3>
|
||||
{% for name in container.names %}
|
||||
{$ renderSyntax(subcommand, name) $}
|
||||
{% endfor %}
|
||||
{$ subcommand.description | marked $}
|
||||
{# for now we assume that commands do not have further sub-commands #}
|
||||
{$ renderArguments(subcommand.positionalOptions, 4) $}
|
||||
{$ renderNamedOptions(subcommand.namedOptions, 4) $}
|
||||
{% endfor %}
|
||||
{% endif %}{% endfor %}
|
||||
{%- endmacro -%}
|
4019
aio/yarn.lock
4019
aio/yarn.lock
File diff suppressed because it is too large
Load Diff
@ -43,10 +43,10 @@ var customLaunchers = {
|
||||
'DartiumWithWebPlatform':
|
||||
{base: 'Dartium', flags: ['--enable-experimental-web-platform-features']},
|
||||
'ChromeNoSandbox': {base: 'Chrome', flags: ['--no-sandbox']},
|
||||
'SL_CHROME': {base: 'SauceLabs', browserName: 'chrome', version: '67'},
|
||||
'SL_CHROME': {base: 'SauceLabs', browserName: 'chrome', version: '60'},
|
||||
'SL_CHROMEBETA': {base: 'SauceLabs', browserName: 'chrome', version: 'beta'},
|
||||
'SL_CHROMEDEV': {base: 'SauceLabs', browserName: 'chrome', version: 'dev'},
|
||||
'SL_FIREFOX': {base: 'SauceLabs', browserName: 'firefox', version: '60'},
|
||||
'SL_FIREFOX': {base: 'SauceLabs', browserName: 'firefox', version: '54'},
|
||||
'SL_FIREFOXBETA':
|
||||
{base: 'SauceLabs', platform: 'Windows 10', browserName: 'firefox', version: 'beta'},
|
||||
'SL_FIREFOXDEV':
|
||||
|
13
build.sh
13
build.sh
@ -8,8 +8,8 @@ source ${currentDir}/scripts/ci/_travis-fold.sh
|
||||
# TODO(i): wrap into subshell, so that we don't pollute CWD, but not yet to minimize diff collision with Jason
|
||||
cd ${currentDir}
|
||||
|
||||
PACKAGES=(compiler
|
||||
core
|
||||
PACKAGES=(core
|
||||
compiler
|
||||
common
|
||||
animations
|
||||
platform-browser
|
||||
@ -27,8 +27,7 @@ PACKAGES=(compiler
|
||||
service-worker
|
||||
elements)
|
||||
|
||||
TSC_PACKAGES=(compiler
|
||||
compiler-cli
|
||||
TSC_PACKAGES=(compiler-cli
|
||||
language-service
|
||||
benchpress)
|
||||
|
||||
@ -240,13 +239,7 @@ compilePackage() {
|
||||
# For TSC_PACKAGES items
|
||||
if containsElement "${3}" "${TSC_PACKAGES[@]}"; then
|
||||
echo "====== [${3}]: COMPILING: ${TSC} -p ${1}/tsconfig-build.json"
|
||||
local package_name=$(basename "${2}")
|
||||
$TSC -p ${1}/tsconfig-build.json
|
||||
if [[ "${3}" = "compiler" ]]; then
|
||||
if [[ "${package_name}" = "testing" ]]; then
|
||||
echo "$(cat ${LICENSE_BANNER}) ${N} export * from './${package_name}/${package_name}'" > ${2}/../${package_name}.d.ts
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "====== [${3}]: COMPILING: ${NGC} -p ${1}/tsconfig-build.json"
|
||||
local package_name=$(basename "${2}")
|
||||
|
@ -68,33 +68,13 @@ new as of May 2017 and not very stable yet.
|
||||
You can use [ibazel] to get a "watch mode" that continuously
|
||||
keeps the outputs up-to-date as you save sources.
|
||||
|
||||
### Various Flags Used For Tests
|
||||
|
||||
If you're experiencing problems with seemingly unrelated tests failing, it may be because you're not using the proper flags with your Bazel test runs in Angular.
|
||||
|
||||
See also: [`//tools/bazel.rc`](https://github.com/angular/angular/blob/master/tools/bazel.rc) where `--define=ivy=false` is defined as default.
|
||||
|
||||
- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
|
||||
- `--test_arg=--node_options=--inspect=9228`: change the inspector port.
|
||||
- `--define=compile=<option>` Controls if ivy or legacy mode is enabled. This is done by generating the [`src/ivy_switch.ts`](https://github.com/angular/angular/blob/master/packages/core/src/ivy_switch.ts) file from [`ivy_switch_legacy.ts`](https://github.com/angular/angular/blob/master/packages/core/src/ivy_switch_legacy.ts) (default), [`ivy_switch_jit.ts`](https://github.com/angular/angular/blob/master/packages/core/src/ivy_switch_jit.ts), or [`ivy_switch_local.ts`](https://github.com/angular/angular/blob/master/packages/core/src/ivy_switch_local.ts).
|
||||
- `legacy`: (default behavior) compile against View Engine, e.g. `--define=compile=legacy`
|
||||
- `jit`: Compile in ivy JIT mode, e.g. `--define=compile=jit`
|
||||
- `local`: Compile in ivy AOT move, e.g. `--define=compile=local`
|
||||
- `--test_tag_filters=<tag>`: filter tests down to tags defined in the `tag` config
|
||||
of your rules in any given `BUILD.bazel`.
|
||||
- `ivy-jit`: This flag should be set for tests that should be excuted with ivy JIT, e.g. `--test_tag_filters=ivy-jit`. For this, you may have to include `--define=compile=jit`.
|
||||
- `ivy-local`: Only run tests that have to do with ivy AOT. For this, you may have to include `--define=compile=local`, e.g. `--test_tag_filters=ivy-local`..
|
||||
- `ivy-only`: Only run ivy related tests, e.g. `--test_tag_filters=ivy-only`.
|
||||
|
||||
|
||||
### Debugging a Node Test
|
||||
<a id="debugging"></a>
|
||||
|
||||
- Open chrome at: [chrome://inspect](chrome://inspect)
|
||||
- Click on `Open dedicated DevTools for Node` to launch a debugger.
|
||||
- Run test: `bazel test packages/core/test:test --config=debug`
|
||||
|
||||
The process should automatically connect to the debugger. For additional info and testing options, see the [nodejs_test documentation](https://bazelbuild.github.io/rules_nodejs/node/node.html#nodejs_test).
|
||||
The process should automatically connect to the debugger.
|
||||
|
||||
### Debugging a Node Test in VSCode
|
||||
|
||||
@ -102,7 +82,7 @@ First time setup:
|
||||
- Go to Debug > Add configuration (in the menu bar) to open `launch.json`
|
||||
- Add the following to the `configurations` array:
|
||||
|
||||
```json
|
||||
```
|
||||
{
|
||||
"name": "Attach (inspect)",
|
||||
"type": "node",
|
||||
@ -127,7 +107,6 @@ First time setup:
|
||||
},
|
||||
```
|
||||
|
||||
**Setting breakpoints directly in your code files may not work in VSCode**. This is because the files you're actually debugging are built files that exist in a `./private/...` folder.
|
||||
The easiest way to debug a test for now is to add a `debugger` statement in the code
|
||||
and launch the bazel corresponding test (`bazel test <target> --config=debug`).
|
||||
|
||||
|
@ -48,7 +48,7 @@ Follow these steps to get patch branch up to date.
|
||||
|
||||
1. Check out the most recent patch branch: `git checkout 4.3.x`
|
||||
2. Get a list of PRs merged into master: `git log master --oneline -n10`
|
||||
3. For each PR number in the commit message run: `./scripts/github/merge-pr 1234`
|
||||
3. For each PR number in the commit message run: `././scripts/github/merge-pr 1234`
|
||||
- The PR will only merge if the `PR target:` matches the branch.
|
||||
|
||||
Once all of the PRs are in patch branch, push the all branches and tags to github using `push-upstream` script.
|
||||
|
@ -29,9 +29,6 @@ function loadTask(fileName, taskName) {
|
||||
|
||||
gulp.task('format:enforce', loadTask('format', 'enforce'));
|
||||
gulp.task('format', loadTask('format', 'format'));
|
||||
gulp.task('format:untracked', loadTask('format', 'format-untracked'));
|
||||
gulp.task('format:diff', loadTask('format', 'format-diff'));
|
||||
gulp.task('format:changed', ['format:untracked', 'format:diff']);
|
||||
gulp.task('build.sh', loadTask('build', 'all'));
|
||||
gulp.task('build.sh:no-bundle', loadTask('build', 'no-bundle'));
|
||||
gulp.task('lint', ['format:enforce', 'validate-commit-messages', 'tslint']);
|
||||
|
@ -3,13 +3,13 @@
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "ng build --prod --progress=false",
|
||||
"build": "ng build --prod --progress false",
|
||||
"e2e": "ng e2e",
|
||||
"lint": "ng lint",
|
||||
"ng": "ng",
|
||||
"postinstall": "webdriver-manager update --gecko=false --standalone=false $CHROMEDRIVER_VERSION_ARG",
|
||||
"postinstall": "webdriver-manager update --gecko false --standalone false $CHROMEDRIVER_VERSION_ARG",
|
||||
"start": "ng serve",
|
||||
"test": "ng test --progress=false && ng e2e --webdriver-update=false && ng e2e --prod --webdriver-update=false"
|
||||
"test": "ng test && ng e2e --webdriver-update=false && ng e2e --prod --webdriver-update=false"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
@ -28,11 +28,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.5.0",
|
||||
"@angular/cli": "7.0.0-beta.4",
|
||||
"@angular/cli": "^6.0.0-rc.5",
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"@angular/language-service": "file:../../dist/packages-dist/language-service",
|
||||
"@types/jasmine": "~2.8.3",
|
||||
"@types/jasminewd2": "~2.0.2",
|
||||
"@types/jasminewd2": "~2.0.4",
|
||||
"@types/node": "~6.0.60",
|
||||
"codelyzer": "^4.3.0",
|
||||
"jasmine-core": "~2.8.0",
|
||||
@ -47,4 +47,4 @@
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "file:../../node_modules/typescript"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -19,9 +19,6 @@ node_modules/zone.js/dist/zone_externs.js
|
||||
--js node_modules/rxjs/operators/package.json
|
||||
--js node_modules/rxjs/_esm2015/operators/index.js
|
||||
|
||||
--js node_modules/@angular/compiler/package.json
|
||||
--js node_modules/@angular/compiler/fesm2015/compiler.js
|
||||
|
||||
--js node_modules/@angular/core/package.json
|
||||
--js node_modules/@angular/core/fesm2015/core.js
|
||||
--js node_modules/@angular/core/src/testability/testability.externs.js
|
||||
|
@ -17,9 +17,6 @@ node_modules/zone.js/dist/zone_externs.js
|
||||
--module_resolution=node
|
||||
--package_json_entry_names es2015
|
||||
|
||||
--js node_modules/@angular/compiler/package.json
|
||||
--js node_modules/@angular/compiler/fesm2015/compiler.js
|
||||
|
||||
--js node_modules/@angular/core/package.json
|
||||
--js node_modules/@angular/core/fesm2015/core.js
|
||||
--js node_modules/@angular/core/src/testability/testability.externs.js
|
||||
|
@ -9,7 +9,6 @@
|
||||
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
|
||||
"@angular/core": "file:../../dist/packages-dist/core",
|
||||
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
|
||||
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
|
||||
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
|
||||
"google-closure-compiler": "git+https://github.com/alexeagle/closure-compiler.git#packagejson.dist",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
@ -31,4 +30,4 @@
|
||||
"preprotractor": "tsc -p e2e",
|
||||
"protractor": "protractor e2e/protractor.config.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,48 +3,40 @@
|
||||
|
||||
|
||||
"@angular/animations@file:../../dist/packages-dist/animations":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
version "6.0.0-beta.7-8203e0365a"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/common@file:../../dist/packages-dist/common":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
version "6.0.0-beta.7-8203e0365a"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/compiler-cli@file:../../dist/packages-dist/compiler-cli":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
version "6.0.0-beta.7-8203e0365a"
|
||||
dependencies:
|
||||
chokidar "^1.4.2"
|
||||
convert-source-map "^1.5.1"
|
||||
magic-string "^0.25.0"
|
||||
minimist "^1.2.0"
|
||||
reflect-metadata "^0.1.2"
|
||||
source-map "^0.6.1"
|
||||
tsickle "^0.32.1"
|
||||
tsickle "^0.27.2"
|
||||
|
||||
"@angular/compiler@file:../../dist/packages-dist/compiler":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
version "6.0.0-beta.7-8203e0365a"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/core@file:../../dist/packages-dist/core":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/platform-browser-dynamic@file:../../dist/packages-dist/platform-browser-dynamic":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
version "6.0.0-beta.7-8203e0365a"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/platform-browser@file:../../dist/packages-dist/platform-browser":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
version "6.0.0-beta.7-8203e0365a"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/platform-server@file:../../dist/packages-dist/platform-server":
|
||||
version "7.0.0-beta.1-d2d510089c"
|
||||
version "6.0.0-beta.7-8203e0365a"
|
||||
dependencies:
|
||||
domino "^2.0.1"
|
||||
tslib "^1.9.0"
|
||||
@ -518,10 +510,6 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
|
||||
|
||||
convert-source-map@^1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5"
|
||||
|
||||
cookie@0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
|
||||
@ -624,10 +612,6 @@ dev-ip@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/dev-ip/-/dev-ip-1.0.1.tgz#a76a3ed1855be7a012bb8ac16cb80f3c00dc28f0"
|
||||
|
||||
diff@^3.2.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
|
||||
|
||||
domino@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/domino/-/domino-2.0.1.tgz#9e1d63215d0fe8dcb8202bff07effa1a216db504"
|
||||
@ -1219,12 +1203,6 @@ jasmine-core@~2.8.0:
|
||||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e"
|
||||
|
||||
jasmine-diff@^0.1.3:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/jasmine-diff/-/jasmine-diff-0.1.3.tgz#93ccc2dcc41028c5ddd4606558074839f2deeaa8"
|
||||
dependencies:
|
||||
diff "^3.2.0"
|
||||
|
||||
jasmine@^2.5.3:
|
||||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e"
|
||||
@ -1341,12 +1319,6 @@ lodash@^4.11.1, lodash@^4.5.1:
|
||||
version "4.17.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||
|
||||
magic-string@^0.25.0:
|
||||
version "0.25.0"
|
||||
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.0.tgz#1f3696f9931ff0a1ed4c132250529e19cad6759b"
|
||||
dependencies:
|
||||
sourcemap-codec "^1.4.1"
|
||||
|
||||
micromatch@2.3.11, micromatch@^2.1.5:
|
||||
version "2.3.11"
|
||||
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
|
||||
@ -1863,7 +1835,7 @@ rx@4.1.0:
|
||||
resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"
|
||||
|
||||
"rxjs@file:../../node_modules/rxjs":
|
||||
version "6.0.0"
|
||||
version "6.0.0-alpha.4"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
@ -2044,14 +2016,10 @@ source-map@^0.5.1, source-map@^0.5.6:
|
||||
version "0.5.7"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
|
||||
|
||||
source-map@^0.6.0, source-map@^0.6.1:
|
||||
source-map@^0.6.0:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||
|
||||
sourcemap-codec@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2"
|
||||
|
||||
spawn-command@^0.0.2-1:
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e"
|
||||
@ -2212,11 +2180,10 @@ tree-kill@^1.1.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.0.tgz#5846786237b4239014f05db156b643212d4c6f36"
|
||||
|
||||
tsickle@^0.32.1:
|
||||
version "0.32.1"
|
||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5"
|
||||
tsickle@^0.27.2:
|
||||
version "0.27.2"
|
||||
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.27.2.tgz#f33d46d046f73dd5c155a37922e422816e878736"
|
||||
dependencies:
|
||||
jasmine-diff "^0.1.3"
|
||||
minimist "^1.2.0"
|
||||
mkdirp "^0.5.1"
|
||||
source-map "^0.6.0"
|
||||
@ -2237,7 +2204,7 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
|
||||
"typescript@file:../../node_modules/typescript":
|
||||
version "2.9.2"
|
||||
version "2.7.2"
|
||||
|
||||
ua-parser-js@0.7.12:
|
||||
version "0.7.12"
|
||||
@ -2457,4 +2424,4 @@ yeast@0.1.2:
|
||||
resolved "https://registry.yarnpkg.com/yeast/-/yeast-0.1.2.tgz#008e06d8094320c372dbc2f8ed76a0ca6c8ac419"
|
||||
|
||||
"zone.js@file:../../node_modules/zone.js":
|
||||
version "0.8.26"
|
||||
version "0.8.20"
|
||||
|
@ -1,44 +0,0 @@
|
||||
--compilation_level=ADVANCED_OPTIMIZATIONS
|
||||
--language_out=ES6
|
||||
--language_in=ES6
|
||||
--js_output_file=dist/bundle.js
|
||||
--output_manifest=dist/manifest.MF
|
||||
--variable_renaming_report=dist/variable_renaming_report
|
||||
--property_renaming_report=dist/property_renaming_report
|
||||
--create_source_map=%outname%.map
|
||||
|
||||
--warning_level=QUIET
|
||||
--dependency_mode=STRICT
|
||||
--rewrite_polyfills=false
|
||||
--jscomp_off=checkVars
|
||||
|
||||
node_modules/zone.js/dist/zone_externs.js
|
||||
|
||||
--js node_modules/rxjs/package.json
|
||||
--js node_modules/rxjs/_esm2015/index.js
|
||||
--js node_modules/rxjs/_esm2015/internal/**.js
|
||||
--js node_modules/rxjs/operators/package.json
|
||||
--js node_modules/rxjs/_esm2015/operators/index.js
|
||||
|
||||
--js node_modules/@angular/core/package.json
|
||||
--js node_modules/@angular/core/fesm2015/core.js
|
||||
--js node_modules/@angular/core/src/testability/testability.externs.js
|
||||
|
||||
--js node_modules/@angular/compiler/package.json
|
||||
--js node_modules/@angular/compiler/fesm2015/compiler.js
|
||||
|
||||
--js node_modules/@angular/common/package.json
|
||||
--js node_modules/@angular/common/fesm2015/common.js
|
||||
|
||||
--js node_modules/@angular/platform-browser/package.json
|
||||
--js node_modules/@angular/platform-browser/fesm2015/platform-browser.js
|
||||
|
||||
--js node_modules/@angular/elements/package.json
|
||||
--js node_modules/@angular/elements/fesm2015/elements.js
|
||||
|
||||
--module_resolution=node
|
||||
--package_json_entry_names es2015
|
||||
--process_common_js_modules
|
||||
|
||||
--js built/**.js
|
||||
--entry_point=built/src/main
|
@ -1,20 +0,0 @@
|
||||
import { browser, element, by } from 'protractor';
|
||||
|
||||
browser.waitForAngularEnabled(false);
|
||||
describe('Element E2E Tests', function () {
|
||||
describe('Hello World Elements', () => {
|
||||
it('should display: Hello world!', function () {
|
||||
browser.get('hello-world.html');
|
||||
const helloWorldEl = element(by.css('hello-world-el'));
|
||||
expect(helloWorldEl.getText()).toEqual('Hello World!');
|
||||
});
|
||||
|
||||
it('should display: Hello Foo! via name attribute', function () {
|
||||
browser.get('hello-world.html');
|
||||
const helloWorldEl = element(by.css('hello-world-el'));
|
||||
const input = element(by.css('input[type=text]'));
|
||||
input.sendKeys('F', 'o', 'o');
|
||||
expect(helloWorldEl.getText()).toEqual('Hello Foo!');
|
||||
});
|
||||
});
|
||||
});
|
@ -1,15 +0,0 @@
|
||||
{
|
||||
"open": false,
|
||||
"logLevel": "silent",
|
||||
"port": 8080,
|
||||
"server": {
|
||||
"baseDir": "src",
|
||||
"routes": {
|
||||
"/dist": "dist",
|
||||
"/node_modules": "node_modules"
|
||||
},
|
||||
"middleware": {
|
||||
"0": null
|
||||
}
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
exports.config = {
|
||||
specs: [
|
||||
'../built/e2e/*.e2e-spec.js'
|
||||
],
|
||||
capabilities: {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
args: ['--no-sandbox'],
|
||||
binary: process.env.CHROME_BIN,
|
||||
}
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:8080/',
|
||||
framework: 'jasmine',
|
||||
useAllAngular2AppRoots: true
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user