Compare commits
88 Commits
Author | SHA1 | Date | |
---|---|---|---|
d0f2bae62b | |||
062af7a725 | |||
9d1d70a563 | |||
5f908eedbf | |||
a3eac19831 | |||
cace4dea64 | |||
a012ffbd5b | |||
2065149d73 | |||
44e604b131 | |||
4503b28295 | |||
f8fcea333f | |||
a09782b8ac | |||
bfeceb3d3e | |||
1a5735d5c0 | |||
43d4446ec0 | |||
91edfb8be0 | |||
9d0a6554a3 | |||
8fff438767 | |||
b2ae08f272 | |||
c78542f124 | |||
b52c97cf70 | |||
929739c736 | |||
85bde4ff90 | |||
5b5b8254b1 | |||
ac8871fb7f | |||
6b2b1eae9d | |||
b3f096219f | |||
224d9dcd4a | |||
31a0c2a6c2 | |||
c251a5a4d1 | |||
81e571b908 | |||
80a9de0a57 | |||
d1e2ac86fd | |||
9a0d326f4f | |||
ce3024017a | |||
c8adef2dab | |||
778e1c2602 | |||
35bfa1437f | |||
4d83078cd2 | |||
64d005de05 | |||
0c822b75f9 | |||
e0a9cfb5e2 | |||
f8dff83d4b | |||
e411cd124a | |||
df4e85907c | |||
1498dc2dca | |||
abfde44afb | |||
eb9d431487 | |||
9060fb7031 | |||
7fbe547f78 | |||
cda6a215f2 | |||
a8430db45d | |||
5e2bf292e5 | |||
efded24527 | |||
30ac643d1d | |||
d9725016ad | |||
3f94759b14 | |||
9a46420aaf | |||
6a11d7e2a0 | |||
4fd9988251 | |||
a4fcd07792 | |||
078a928fab | |||
5d90aede4e | |||
658a18cdab | |||
6d240cf687 | |||
dca176e232 | |||
6c4845515b | |||
c2ce832f65 | |||
c726d27331 | |||
c4b7862e1b | |||
39472e102b | |||
1fafc5ca18 | |||
07a26647ac | |||
817821e553 | |||
398db3e9f0 | |||
d5fa4dc146 | |||
0ae3518fa9 | |||
e0f9a1b3f3 | |||
2604f429c7 | |||
ecada17ad4 | |||
fa3751ec9e | |||
f85a969219 | |||
d0a1e42e50 | |||
4f14a09895 | |||
8d28fe9df9 | |||
6715f056b0 | |||
32c018cbfe | |||
a403c4f7f5 |
3
.bazelignore
Normal file
3
.bazelignore
Normal file
@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
dist
|
||||
aio/node_modules
|
@ -57,6 +57,6 @@ test --experimental_ui
|
||||
################################
|
||||
# Temporary Settings for Ivy #
|
||||
################################
|
||||
# to determine if the compiler used should be Ivy or ViewEngine one can use `--define=compile=local` on
|
||||
# to determine if the compiler used should be Ivy or ViewEngine one can use `--define=compile=local` on
|
||||
# any bazel target. This is a temporary flag until codebase is permanently switched to Ivy.
|
||||
build --define=compile=legacy
|
||||
build --define=compile=legacy
|
@ -12,12 +12,28 @@
|
||||
## IMPORTANT
|
||||
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
|
||||
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
|
||||
var_1: &docker_image angular/ngcontainer:0.6.0
|
||||
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.6.0
|
||||
var_1: &docker_image angular/ngcontainer:0.7.0
|
||||
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.7.0
|
||||
|
||||
# Define common ENV vars
|
||||
var_3: &define_env_vars
|
||||
run: echo "export PROJECT_ROOT=$(pwd)" >> $BASH_ENV
|
||||
run:
|
||||
name: Define environment variables
|
||||
command: |
|
||||
echo "export PROJECT_ROOT=$(pwd)" | tee -a $BASH_ENV
|
||||
echo "export CI_AIO_MIN_PWA_SCORE=95" | tee -a $BASH_ENV
|
||||
# This is the branch being built; e.g. `pull/12345` for PR builds.
|
||||
echo "export CI_BRANCH=$CIRCLE_BRANCH" | tee -a $BASH_ENV
|
||||
echo "export CI_COMMIT=$CIRCLE_SHA1" | tee -a $BASH_ENV
|
||||
# `CI_COMMIT_RANGE` will only be available when `CIRCLE_COMPARE_URL` is also available,
|
||||
# i.e. on push builds (a.k.a. non-PR builds). That is fine, since we only need it in push builds.
|
||||
echo "export CI_COMMIT_RANGE=$(sed -r 's|^.*/([0-9a-f]+\.\.\.[0-9a-f]+)$|\1|i' <<< ${CIRCLE_COMPARE_URL:-})" | tee -a $BASH_ENV
|
||||
echo "export CI_PULL_REQUEST=${CIRCLE_PR_NUMBER:-false}" | tee -a $BASH_ENV
|
||||
echo "export CI_REPO_NAME=$CIRCLE_PROJECT_REPONAME" | tee -a $BASH_ENV
|
||||
echo "export CI_REPO_OWNER=$CIRCLE_PROJECT_USERNAME" | tee -a $BASH_ENV
|
||||
# WARNING: Secrets (do not print).
|
||||
echo "export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=$AIO_DEPLOY_TOKEN" >> $BASH_ENV
|
||||
echo "export CI_SECRET_PAYLOAD_FIREBASE_TOKEN=$ANGULAR_PAYLOAD_TOKEN" >> $BASH_ENV
|
||||
|
||||
# See remote cache documentation in /docs/BAZEL.md
|
||||
var_4: &setup-bazel-remote-cache
|
||||
@ -29,7 +45,7 @@ var_4: &setup-bazel-remote-cache
|
||||
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"
|
||||
command: openssl aes-256-cbc -d -in .circleci/gcp_token -k "$CI_REPO_NAME" -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
|
||||
@ -41,7 +57,7 @@ anchor_1: &job_defaults
|
||||
# Similar to travis behavior, but not quite the same.
|
||||
# See https://discuss.circleci.com/t/1662
|
||||
anchor_2: &post_checkout
|
||||
post: git pull --ff-only origin "refs/pull/${CIRCLE_PULL_REQUEST//*pull\//}/merge"
|
||||
post: git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge"
|
||||
|
||||
version: 2
|
||||
jobs:
|
||||
@ -49,6 +65,7 @@ jobs:
|
||||
<<: *job_defaults
|
||||
resource_class: xlarge
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
|
||||
@ -78,16 +95,12 @@ jobs:
|
||||
|
||||
- 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
|
||||
- run: bazel test //... --build_tag_filters=-ivy-only --test_tag_filters=-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 test //... --build_tag_filters=-ivy-only,local --test_tag_filters=-ivy-only,local
|
||||
|
||||
# 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.
|
||||
@ -113,11 +126,14 @@ jobs:
|
||||
paths:
|
||||
- "node_modules"
|
||||
- "~/bazel_repository_cache"
|
||||
|
||||
# Temporary job to test what will happen when we flip the Ivy flag to true
|
||||
test_ivy_jit:
|
||||
<<: *job_defaults
|
||||
resource_class: xlarge
|
||||
steps:
|
||||
# don't run this job on the patch branch (to preserve resources)
|
||||
- run: circleci step halt
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
@ -125,12 +141,14 @@ jobs:
|
||||
|
||||
- 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
|
||||
- run: bazel test //... --define=compile=jit --build_tag_filters=ivy-jit --test_tag_filters=ivy-jit
|
||||
|
||||
test_ivy_aot:
|
||||
<<: *job_defaults
|
||||
resource_class: xlarge
|
||||
steps:
|
||||
# don't run this job on the patch branch (to preserve resources)
|
||||
- run: circleci step halt
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
@ -138,30 +156,135 @@ jobs:
|
||||
|
||||
- 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
|
||||
- run: bazel test //... --define=compile=aot --build_tag_filters=ivy-aot --test_tag_filters=ivy-aot
|
||||
|
||||
# This job should only be run on PR builds, where `CIRCLE_PR_NUMBER` is defined.
|
||||
test_and_deploy_aio:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
# Build aio
|
||||
- run: yarn --cwd aio build --progress=false
|
||||
# Lint the code
|
||||
- run: yarn --cwd aio lint
|
||||
# Run PWA-score tests
|
||||
# (Run before unit and e2e tests, which destroy the `dist/` directory.)
|
||||
- run:
|
||||
name: Run PWA-score tests
|
||||
command: xvfb-run --auto-servernum yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
||||
# Check the bundle sizes.
|
||||
# (Run before unit and e2e tests, which destroy the `dist/` directory.)
|
||||
- run: yarn --cwd aio payload-size
|
||||
# Run unit tests
|
||||
- run: xvfb-run --auto-servernum yarn --cwd aio test --watch=false
|
||||
# Run e2e tests
|
||||
- run: xvfb-run --auto-servernum yarn --cwd aio e2e
|
||||
# Run unit tests for Firebase redirects
|
||||
- run: yarn --cwd aio redirects-test
|
||||
# Deploy angular.io to production (if necessary)
|
||||
- run: echo "export CI_STABLE_BRANCH=$(npm info @angular/core dist-tags.latest | sed -r 's/^\s*([0-9]+\.[0-9]+)\.[0-9]+.*$/\1.x/')" | tee -a $BASH_ENV
|
||||
- run: xvfb-run --auto-servernum yarn --cwd aio deploy-production
|
||||
|
||||
test_aio_local:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- attach_workspace:
|
||||
at: dist
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
# Build aio (with local Angular packages)
|
||||
- run: yarn --cwd aio build-local --progress=false
|
||||
# Run PWA-score tests
|
||||
# (Run before unit and e2e tests, which destroy the `dist/` directory.)
|
||||
- run:
|
||||
name: Run PWA-score tests
|
||||
command: xvfb-run --auto-servernum yarn --cwd aio test-pwa-score-localhost $CI_AIO_MIN_PWA_SCORE
|
||||
# Run unit tests
|
||||
- run: xvfb-run --auto-servernum yarn --cwd aio test --watch=false
|
||||
# Run e2e tests
|
||||
- run: xvfb-run --auto-servernum yarn --cwd aio e2e
|
||||
|
||||
test_aio_tools:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- attach_workspace:
|
||||
at: dist
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
# Install
|
||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||
- run: yarn --cwd aio extract-cli-command-docs
|
||||
# Run tools tests
|
||||
- run: yarn --cwd aio tools-test
|
||||
- run: ./aio/aio-builds-setup/scripts/test.sh
|
||||
|
||||
test_docs_examples_0:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- attach_workspace:
|
||||
at: dist
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
# Install root
|
||||
- run: yarn install --frozen-lockfile --non-interactive
|
||||
# Install aio
|
||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||
# Run examples tests
|
||||
- run: xvfb-run --auto-servernum yarn --cwd aio example-e2e --setup --local --shard=0/2
|
||||
|
||||
test_docs_examples_1:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- attach_workspace:
|
||||
at: dist
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
# Install root
|
||||
- run: yarn install --frozen-lockfile --non-interactive
|
||||
# Install aio
|
||||
- run: yarn --cwd aio install --frozen-lockfile --non-interactive
|
||||
# Run examples tests
|
||||
- run: xvfb-run --auto-servernum yarn --cwd aio example-e2e --setup --local --shard=1/2
|
||||
|
||||
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
|
||||
aio_preview:
|
||||
<<: *job_defaults
|
||||
environment:
|
||||
AIO_SNAPSHOT_ARTIFACT_PATH: &aio_preview_artifact_path 'aio/tmp/snapshot.tgz'
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
- run: yarn install --frozen-lockfile --non-interactive
|
||||
- run: ./aio/scripts/build-artifacts.sh $AIO_SNAPSHOT_ARTIFACT_PATH $CIRCLE_PR_NUMBER $CIRCLE_SHA1
|
||||
- run: ./aio/scripts/build-artifacts.sh $AIO_SNAPSHOT_ARTIFACT_PATH $CI_PULL_REQUEST $CI_COMMIT
|
||||
- store_artifacts:
|
||||
path: *aio_preview_artifact_path
|
||||
# The `destination` needs to be kept in synch with the value of
|
||||
# `AIO_ARTIFACT_PATH` in `aio/aio-builds-setup/Dockerfile`
|
||||
destination: aio/dist/aio-snapshot.tgz
|
||||
|
||||
# This job should only be run on PR builds, where `CIRCLE_PR_NUMBER` is defined.
|
||||
# This job should only be run on PR builds, where `CI_PULL_REQUEST` is not `false`.
|
||||
test_aio_preview:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- restore_cache:
|
||||
@ -169,9 +292,7 @@ jobs:
|
||||
- run: yarn install --cwd aio --frozen-lockfile --non-interactive
|
||||
- run:
|
||||
name: Wait for preview and run tests
|
||||
command: |
|
||||
source "./scripts/ci/env.sh" print
|
||||
xvfb-run --auto-servernum node aio/scripts/test-preview.js $CIRCLE_PR_NUMBER $CIRCLE_SHA1 $AIO_MIN_PWA_SCORE
|
||||
command: xvfb-run --auto-servernum node aio/scripts/test-preview.js $CI_PULL_REQUEST $CI_COMMIT $CI_AIO_MIN_PWA_SCORE
|
||||
|
||||
# This job exists only for backwards-compatibility with old scripts and tests
|
||||
# that rely on the pre-Bazel dist/packages-dist layout.
|
||||
@ -199,7 +320,7 @@ jobs:
|
||||
paths:
|
||||
- packages-dist
|
||||
- packages-dist-ivy-jit
|
||||
- packages-dist-ivy-local
|
||||
- packages-dist-ivy-aot
|
||||
|
||||
# We run the integration tests outside of Bazel for now.
|
||||
# They are a separate workflow job so that they can be easily re-run.
|
||||
@ -226,15 +347,16 @@ jobs:
|
||||
publish_snapshot:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
# See below - ideally this job should not trigger for non-upstream builds.
|
||||
# But since it does, we have to check this condition.
|
||||
- run:
|
||||
name: Skip this job for Pull Requests and Fork builds
|
||||
# Note, `|| true` on the end makes this step always exit 0
|
||||
command: '[[
|
||||
-v CIRCLE_PR_NUMBER
|
||||
|| "$CIRCLE_PROJECT_USERNAME" != "angular"
|
||||
|| "$CIRCLE_PROJECT_REPONAME" != "angular"
|
||||
"$CI_PULL_REQUEST" != "false"
|
||||
|| "$CI_REPO_OWNER" != "angular"
|
||||
|| "$CI_REPO_NAME" != "angular"
|
||||
]] && circleci step halt || true'
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
@ -252,15 +374,14 @@ jobs:
|
||||
aio_monitoring:
|
||||
<<: *job_defaults
|
||||
steps:
|
||||
- *define_env_vars
|
||||
- checkout:
|
||||
<<: *post_checkout
|
||||
- restore_cache:
|
||||
key: *cache_key
|
||||
- run:
|
||||
name: Run tests against the deployed apps
|
||||
command: |
|
||||
source "./scripts/ci/env.sh" print
|
||||
xvfb-run --auto-servernum ./aio/scripts/test-production.sh $AIO_MIN_PWA_SCORE
|
||||
command: xvfb-run --auto-servernum ./aio/scripts/test-production.sh $CI_AIO_MIN_PWA_SCORE
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
@ -271,6 +392,19 @@ workflows:
|
||||
- test_ivy_jit
|
||||
- test_ivy_aot
|
||||
- build-packages-dist
|
||||
- test_and_deploy_aio
|
||||
- test_aio_local:
|
||||
requires:
|
||||
- build-packages-dist
|
||||
- test_aio_tools:
|
||||
requires:
|
||||
- build-packages-dist
|
||||
- test_docs_examples_0:
|
||||
requires:
|
||||
- build-packages-dist
|
||||
- test_docs_examples_1:
|
||||
requires:
|
||||
- build-packages-dist
|
||||
- aio_preview:
|
||||
# Only run on PR builds. (There can be no previews for non-PR builds.)
|
||||
filters:
|
||||
|
Binary file not shown.
21
.github/angular-robot.yml
vendored
21
.github/angular-robot.yml
vendored
@ -39,6 +39,7 @@ merge:
|
||||
- "packages/**"
|
||||
# list of patterns to ignore for the files changed by the PR
|
||||
exclude:
|
||||
- "packages/bazel/*.bzl"
|
||||
- "packages/language-service/**"
|
||||
- "**/.gitignore"
|
||||
- "**/.gitkeep"
|
||||
@ -124,3 +125,23 @@ triage:
|
||||
-
|
||||
- "type: RFC / Discussion / question"
|
||||
- "comp: *"
|
||||
|
||||
# options for the triage PR plugin
|
||||
triagePR:
|
||||
# set to true to disable
|
||||
disabled: false
|
||||
# number of the milestone to apply when the PR has not been triaged yet
|
||||
needsTriageMilestone: 83,
|
||||
# number of the milestone to apply when the PR is triaged
|
||||
defaultMilestone: 82,
|
||||
# arrays of labels that determine if a PR has been triaged by the caretaker
|
||||
l1TriageLabels:
|
||||
-
|
||||
- "comp: *"
|
||||
# arrays of labels that determine if a PR has been fully triaged
|
||||
l2TriageLabels:
|
||||
-
|
||||
- "type: *"
|
||||
- "effort*"
|
||||
- "risk*"
|
||||
- "comp: *"
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,7 +14,6 @@ pubspec.lock
|
||||
.settings/
|
||||
*.swo
|
||||
modules/.settings
|
||||
.bazelrc
|
||||
.vscode
|
||||
modules/.vscode
|
||||
|
||||
|
@ -87,10 +87,10 @@ groups:
|
||||
files:
|
||||
include:
|
||||
- "WORKSPACE"
|
||||
- ".bazel*"
|
||||
- "*.bazel"
|
||||
- "*.bzl"
|
||||
- "packages/bazel/*"
|
||||
- "tools/bazel.rc"
|
||||
- "/docs/BAZEL.md"
|
||||
users:
|
||||
- alexeagle #primary
|
||||
@ -108,7 +108,6 @@ groups:
|
||||
- "*.lock"
|
||||
- "tools/*"
|
||||
exclude:
|
||||
- "tools/bazel.rc"
|
||||
- "tools/public_api_guard/*"
|
||||
- "aio/*"
|
||||
users:
|
||||
@ -277,6 +276,9 @@ groups:
|
||||
- "aio/content/guide/forms.md"
|
||||
- "aio/content/examples/forms/*"
|
||||
- "aio/content/images/guide/forms/*"
|
||||
- "aio/content/guide/forms-overview.md"
|
||||
- "aio/content/examples/forms-overview/*"
|
||||
- "aio/content/images/guide/forms-overview/*"
|
||||
- "aio/content/guide/form-validation.md"
|
||||
- "aio/content/examples/form-validation/*"
|
||||
- "aio/content/images/guide/form-validation/*"
|
||||
|
16
.travis.yml
16
.travis.yml
@ -30,14 +30,6 @@ env:
|
||||
# GITHUB_TOKEN_ANGULAR=<github token, a personal access token of the angular-builds account, account access in valentine>
|
||||
# This is needed for the e2e Travis matrix task to publish packages to github for continuous packages delivery.
|
||||
- secure: "aCdHveZuY8AT4Jr1JoJB4LxZsnGWRe/KseZh1YXYe5UtufFCtTVHvUcLn0j2aLBF0KpdyS+hWf0i4np9jthKu2xPKriefoPgCMpisYeC0MFkwbmv+XlgkUbgkgVZMGiVyX7DCYXVahxIoOUjVMEDCbNiHTIrfEuyq24U3ok2tHc="
|
||||
# FIREBASE_TOKEN
|
||||
# This is needed for publishing builds to the "aio-staging" and "angular-io" firebase projects.
|
||||
# This token was generated using the aio-deploy@angular.io account using `firebase login:ci` and password from valentine
|
||||
- secure: "L5CyQmpwWtoR4Qi4xlWQh/cL1M6ZeJL4W4QAr4HdKFMgYt9h+Whqkymyh2NxwmCbPvWa7yUd+OiLQUDCY7L2VIg16hTwoe2CgYDyQA0BEwLzxtRrJXl93TfwMlrUx5JSIzAccD6D4sjtz8kSFMomK2Nls33xOXOukwyhVMjd0Cg="
|
||||
# ANGULAR_PAYLOAD_FIREBASE_TOKEN
|
||||
# This is for payload size data to "angular-payload-size" firebase project
|
||||
# This token was generated using the payload@angular.io account using `firebase login:ci` and password from valentine
|
||||
- secure: "SxotP/ymNy6uWAVbfwM9BlwETPEBpkRvU/F7fCtQDDic99WfQHzzUSQqHTk8eKk3GrGAOSL09vT0WfStQYEIGEoS5UHWNgOnelxhw+d5EnaoB8vQ0dKQBTK092hQg4feFprr+B/tCasyMV6mVwpUzZMbIJNn/Rx7H5g1bp+Gkfg="
|
||||
matrix:
|
||||
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
||||
- CI_MODE=e2e
|
||||
@ -47,16 +39,10 @@ env:
|
||||
# - CI_MODE=browserstack_required
|
||||
- CI_MODE=saucelabs_optional
|
||||
- CI_MODE=browserstack_optional
|
||||
- CI_MODE=aio_tools_test
|
||||
- CI_MODE=aio
|
||||
- CI_MODE=aio_local
|
||||
- CI_MODE=aio_e2e AIO_SHARD=0
|
||||
- CI_MODE=aio_e2e AIO_SHARD=1
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- env: "CI_MODE=aio_local"
|
||||
- env: "CI_MODE=saucelabs_optional"
|
||||
- env: "CI_MODE=browserstack_optional"
|
||||
|
||||
@ -70,8 +56,6 @@ install:
|
||||
script:
|
||||
- ./scripts/ci/build.sh
|
||||
- ./scripts/ci/test.sh
|
||||
# deploy is part of 'script' and not 'after_success' so that we fail the build if the deployment fails
|
||||
- ./scripts/ci/deploy.sh
|
||||
- ./scripts/ci/angular.sh
|
||||
# all the scripts under this line will not quickly abort in case ${TRAVIS_TEST_RESULT} is 1 (job failure)
|
||||
- ./scripts/ci/cleanup.sh
|
||||
|
43
BUILD.bazel
43
BUILD.bazel
@ -15,19 +15,14 @@ alias(
|
||||
actual = "@nodejs//:yarn",
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "node_modules",
|
||||
actual = "@angular_deps//:node_modules",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "web_test_bootstrap_scripts",
|
||||
# do not sort
|
||||
srcs = [
|
||||
"@angular_deps//:node_modules/reflect-metadata/Reflect.js",
|
||||
"@angular_deps//:node_modules/zone.js/dist/zone.js",
|
||||
"@angular_deps//:node_modules/zone.js/dist/zone-testing.js",
|
||||
"@angular_deps//:node_modules/zone.js/dist/task-tracking.js",
|
||||
"@ngdeps//node_modules/reflect-metadata:Reflect.js",
|
||||
"@ngdeps//node_modules/zone.js:dist/zone.js",
|
||||
"@ngdeps//node_modules/zone.js:dist/zone-testing.js",
|
||||
"@ngdeps//node_modules/zone.js:dist/task-tracking.js",
|
||||
"//:test-events.js",
|
||||
],
|
||||
)
|
||||
@ -35,11 +30,29 @@ filegroup(
|
||||
filegroup(
|
||||
name = "angularjs_scripts",
|
||||
srcs = [
|
||||
"@angular_deps//:node_modules/angular-1.5/angular.js",
|
||||
"@angular_deps//:node_modules/angular-1.6/angular.js",
|
||||
"@angular_deps//:node_modules/angular-mocks-1.5/angular-mocks.js",
|
||||
"@angular_deps//:node_modules/angular-mocks-1.6/angular-mocks.js",
|
||||
"@angular_deps//:node_modules/angular-mocks/angular-mocks.js",
|
||||
"@angular_deps//:node_modules/angular/angular.js",
|
||||
"@ngdeps//node_modules/angular:angular.js",
|
||||
"@ngdeps//node_modules/angular-1.5:angular.js",
|
||||
"@ngdeps//node_modules/angular-1.6:angular.js",
|
||||
"@ngdeps//node_modules/angular-mocks:angular-mocks.js",
|
||||
"@ngdeps//node_modules/angular-mocks-1.5:angular-mocks.js",
|
||||
"@ngdeps//node_modules/angular-mocks-1.6:angular-mocks.js",
|
||||
],
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
|
||||
# A nodejs_binary for @angular/bazel/ngc-wrapped to use by default in
|
||||
# ng_module that depends on @npm//@angular/bazel instead of the
|
||||
# output of the //packages/bazel/src/ngc-wrapped ts_library rule. This
|
||||
# default is for downstream users that depend on the @angular/bazel npm
|
||||
# package. The generated @npm//@angular/bazel/ngc-wrapped target
|
||||
# does not work because it does not have the node `--expose-gc` flag
|
||||
# set which is required to support the call to `global.gc()`.
|
||||
nodejs_binary(
|
||||
name = "@angular/bazel/ngc-wrapped",
|
||||
configuration_env_vars = ["compile"],
|
||||
data = ["@npm//@angular/bazel"],
|
||||
entry_point = "@angular/bazel/src/ngc-wrapped/index.js",
|
||||
install_source_map_support = False,
|
||||
templated_args = ["--node_options=--expose-gc"],
|
||||
)
|
||||
|
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,12 +1,16 @@
|
||||
<a name="7.0.1"></a>
|
||||
## [7.0.1](https://github.com/angular/angular/compare/7.0.0...7.0.1) (2018-10-24)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="7.0.0"></a>
|
||||
# [7.0.0](https://github.com/angular/angular/compare/7.0.0-rc.1...7.0.0) (2018-10-18)
|
||||
|
||||
|
||||
### Release Highlights & Update instructions
|
||||
|
||||
Angular v7 is .
|
||||
|
||||
To learn about the release highlights and our new CLI-powered update workflow for your projects please check out the [v7 release announcement](https://blog.angular.io/TODO).
|
||||
To learn about the release highlights and our new CLI-powered update workflow for your projects please check out the [v7 release announcement](https://blog.angular.io/version-7-of-angular-cli-prompts-virtual-scroll-drag-and-drop-and-more-c594e22e7b8c).
|
||||
|
||||
|
||||
### Dependency updates
|
||||
|
@ -13,12 +13,10 @@ Angular is a development platform for building mobile and desktop web applicatio
|
||||
|
||||
[Get started in 5 minutes][quickstart].
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
[Learn about the latest improvements][changelog].
|
||||
|
||||
|
||||
## Want to help?
|
||||
|
||||
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
|
||||
|
113
WORKSPACE
113
WORKSPACE
@ -1,91 +1,24 @@
|
||||
workspace(name = "angular")
|
||||
|
||||
#
|
||||
# Download Bazel toolchain dependencies as needed by build actions
|
||||
#
|
||||
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",
|
||||
load(
|
||||
"//packages/bazel:package.bzl",
|
||||
"rules_angular_dependencies",
|
||||
"rules_angular_dev_dependencies",
|
||||
)
|
||||
|
||||
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",
|
||||
],
|
||||
)
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
# This commit matches the version of buildifier in angular/ngcontainer
|
||||
# If you change this, also check if it matches the version in the angular/ngcontainer
|
||||
# version in /.circleci/config.yml
|
||||
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,
|
||||
)
|
||||
|
||||
# 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",
|
||||
)
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
# We have a source dependency on the Devkit repository, because it's built with
|
||||
# Bazel.
|
||||
# This allows us to edit sources and have the effect appear immediately without
|
||||
# re-packaging or "npm link"ing.
|
||||
# Even better, things like aspects will visit the entire graph including
|
||||
# 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",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "org_brotli",
|
||||
sha256 = "774b893a0700b0692a76e2e5b7e7610dbbe330ffbe3fe864b4b52ca718061d5a",
|
||||
strip_prefix = "brotli-1.0.5",
|
||||
url = "https://github.com/google/brotli/archive/v1.0.5.zip",
|
||||
)
|
||||
# Angular Bazel users will call this function
|
||||
rules_angular_dependencies()
|
||||
# These are the dependencies only for us
|
||||
rules_angular_dev_dependencies()
|
||||
|
||||
#
|
||||
# Point Bazel to WORKSPACEs that live in subdirectories
|
||||
#
|
||||
|
||||
local_repository(
|
||||
http_archive(
|
||||
name = "rxjs",
|
||||
path = "node_modules/rxjs/src",
|
||||
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
|
||||
strip_prefix = "package/src",
|
||||
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
|
||||
)
|
||||
|
||||
# Point to the integration test workspace just so that Bazel doesn't descend into it
|
||||
@ -98,10 +31,9 @@ local_repository(
|
||||
#
|
||||
# Load and install our dependencies downloaded above.
|
||||
#
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
|
||||
|
||||
check_bazel_version("0.17.0", """
|
||||
check_bazel_version("0.18.0", """
|
||||
If you are on a Mac and using Homebrew, there is a breaking change to the installation in Bazel 0.16
|
||||
See https://blog.bazel.build/2018/08/22/bazel-homebrew.html
|
||||
|
||||
@ -114,6 +46,12 @@ node_repositories(
|
||||
yarn_version = "1.9.2",
|
||||
)
|
||||
|
||||
yarn_install(
|
||||
name = "npm",
|
||||
package_json = "//tools:npm/package.json",
|
||||
yarn_lock = "//tools:npm/yarn.lock",
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
|
||||
|
||||
go_rules_dependencies()
|
||||
@ -147,14 +85,3 @@ 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",
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
TODO (gkalpak): Add docs. Mention:
|
||||
- Testing on CI.
|
||||
Relevant files: `scripts/ci/test-aio.sh`, `aio/aio-builds-setup/scripts/test.sh`
|
||||
Relevant files: `aio/aio-builds-setup/scripts/test.sh`
|
||||
- Deploying from CI.
|
||||
Relevant files: `.circleci/config.yml`, `scripts/ci/deploy.sh`, `aio/scripts/build-artifacts.sh`,
|
||||
`aio/scripts/deploy-to-firebase.sh`
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict'; // necessary for es6 output in node
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { browser, ExpectedConditions as EC } from 'protractor';
|
||||
import { logging } from 'selenium-webdriver';
|
||||
import * as openClose from './open-close.po';
|
||||
import * as statusSlider from './status-slider.po';
|
||||
@ -25,6 +25,8 @@ describe('Animation Tests', () => {
|
||||
});
|
||||
|
||||
describe('Open/Close Component', () => {
|
||||
const closedHeight = '100px';
|
||||
const openHeight = '200px';
|
||||
|
||||
beforeAll(async () => {
|
||||
await openCloseHref.click();
|
||||
@ -32,37 +34,37 @@ describe('Animation Tests', () => {
|
||||
});
|
||||
|
||||
it('should be open', async () => {
|
||||
let text = await openClose.getComponentText();
|
||||
const toggleButton = openClose.getToggleButton();
|
||||
const container = openClose.getComponentContainer();
|
||||
let text = await container.getText();
|
||||
|
||||
if (text.includes('Closed')) {
|
||||
await toggleButton.click();
|
||||
sleepFor();
|
||||
await browser.wait(async () => await container.getCssValue('height') === openHeight, 2000);
|
||||
}
|
||||
|
||||
text = await openClose.getComponentText();
|
||||
text = await container.getText();
|
||||
const containerHeight = await container.getCssValue('height');
|
||||
|
||||
expect(text).toContain('The box is now Open!');
|
||||
expect(containerHeight).toBe('200px');
|
||||
expect(containerHeight).toBe(openHeight);
|
||||
});
|
||||
|
||||
it('should be closed', async () => {
|
||||
let text = await openClose.getComponentText();
|
||||
const toggleButton = openClose.getToggleButton();
|
||||
const container = openClose.getComponentContainer();
|
||||
let text = await container.getText();
|
||||
|
||||
if (text.includes('Open')) {
|
||||
await toggleButton.click();
|
||||
sleepFor();
|
||||
await browser.wait(async () => await container.getCssValue('height') === closedHeight, 2000);
|
||||
}
|
||||
|
||||
text = await openClose.getComponentText();
|
||||
text = await container.getText();
|
||||
const containerHeight = await container.getCssValue('height');
|
||||
|
||||
expect(text).toContain('The box is now Closed!');
|
||||
expect(containerHeight).toBe('100px');
|
||||
expect(containerHeight).toBe(closedHeight);
|
||||
});
|
||||
|
||||
it('should log animation events', async () => {
|
||||
@ -72,8 +74,7 @@ describe('Animation Tests', () => {
|
||||
await toggleButton.click();
|
||||
|
||||
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
||||
|
||||
const animationMessages = logs.filter(({ message }) => message.indexOf('Animation') !== -1 ? true : false);
|
||||
const animationMessages = logs.filter(({ message }) => message.includes('Animation'));
|
||||
|
||||
expect(animationMessages.length).toBeGreaterThan(0);
|
||||
});
|
||||
@ -89,16 +90,16 @@ describe('Animation Tests', () => {
|
||||
});
|
||||
|
||||
it('should be inactive with an orange background', async () => {
|
||||
let text = await statusSlider.getComponentText();
|
||||
const toggleButton = statusSlider.getToggleButton();
|
||||
const container = statusSlider.getComponentContainer();
|
||||
let text = await container.getText();
|
||||
|
||||
if (text === 'Active') {
|
||||
await toggleButton.click();
|
||||
sleepFor(2000);
|
||||
await browser.wait(async () => await container.getCssValue('backgroundColor') === inactiveColor, 2000);
|
||||
}
|
||||
|
||||
text = await statusSlider.getComponentText();
|
||||
text = await container.getText();
|
||||
const bgColor = await container.getCssValue('backgroundColor');
|
||||
|
||||
expect(text).toBe('Inactive');
|
||||
@ -106,16 +107,16 @@ describe('Animation Tests', () => {
|
||||
});
|
||||
|
||||
it('should be active with a blue background', async () => {
|
||||
let text = await statusSlider.getComponentText();
|
||||
const toggleButton = statusSlider.getToggleButton();
|
||||
const container = statusSlider.getComponentContainer();
|
||||
let text = await container.getText();
|
||||
|
||||
if (text === 'Inactive') {
|
||||
await toggleButton.click();
|
||||
sleepFor(2000);
|
||||
await browser.wait(async () => await container.getCssValue('backgroundColor') === activeColor, 2000);
|
||||
}
|
||||
|
||||
text = await statusSlider.getComponentText();
|
||||
text = await container.getText();
|
||||
const bgColor = await container.getCssValue('backgroundColor');
|
||||
|
||||
expect(text).toBe('Active');
|
||||
@ -163,10 +164,7 @@ describe('Animation Tests', () => {
|
||||
const hero = heroesList.get(0);
|
||||
|
||||
await hero.click();
|
||||
await sleepFor(100);
|
||||
const newTotal = await heroesList.count();
|
||||
|
||||
expect(newTotal).toBeLessThan(total);
|
||||
await browser.wait(async () => await heroesList.count() < total, 2000);
|
||||
});
|
||||
});
|
||||
|
||||
@ -190,10 +188,7 @@ describe('Animation Tests', () => {
|
||||
const hero = heroesList.get(0);
|
||||
|
||||
await hero.click();
|
||||
await sleepFor(250);
|
||||
const newTotal = await heroesList.count();
|
||||
|
||||
expect(newTotal).toBeLessThan(total);
|
||||
await browser.wait(async () => await heroesList.count() < total, 2000);
|
||||
});
|
||||
});
|
||||
|
||||
@ -213,14 +208,14 @@ describe('Animation Tests', () => {
|
||||
it('should filter down the list when a search is performed', async () => {
|
||||
const heroesList = filterStagger.getHeroesList();
|
||||
const total = await heroesList.count();
|
||||
|
||||
const formInput = filterStagger.getFormInput();
|
||||
|
||||
await formInput.sendKeys('Mag');
|
||||
await sleepFor(500);
|
||||
const newTotal = await heroesList.count();
|
||||
|
||||
await browser.wait(async () => await heroesList.count() === 2, 2000);
|
||||
|
||||
const newTotal = await heroesList.count();
|
||||
expect(newTotal).toBeLessThan(total);
|
||||
expect(newTotal).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
@ -248,10 +243,7 @@ describe('Animation Tests', () => {
|
||||
const hero = heroesList.get(0);
|
||||
|
||||
await hero.click();
|
||||
await sleepFor(300);
|
||||
const newTotal = await heroesList.count();
|
||||
|
||||
expect(newTotal).toBeLessThan(total);
|
||||
await browser.wait(async () => await heroesList.count() < total, 2000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -23,11 +23,3 @@ export function getComponentContainer() {
|
||||
const findContainer = () => by.css('div');
|
||||
return locate(getComponent(), findContainer());
|
||||
}
|
||||
|
||||
export async function getComponentText() {
|
||||
const findContainerText = () => by.css('div');
|
||||
const contents = locate(getComponent(), findContainerText());
|
||||
const componentText = await contents.getText();
|
||||
|
||||
return componentText;
|
||||
}
|
||||
|
@ -18,11 +18,3 @@ export function getComponentContainer() {
|
||||
const findContainer = () => by.css('div');
|
||||
return locate(getComponent(), findContainer());
|
||||
}
|
||||
|
||||
export async function getComponentText() {
|
||||
const findContainerText = () => by.css('div');
|
||||
const contents = locate(getComponent(), findContainerText());
|
||||
const componentText = await contents.getText();
|
||||
|
||||
return componentText;
|
||||
}
|
||||
|
@ -1,12 +1,19 @@
|
||||
'use strict'; // necessary for es6 output in node
|
||||
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { browser, by, element, ElementFinder, ExpectedConditions as EC } from 'protractor';
|
||||
|
||||
/* tslint:disable:quotemark */
|
||||
describe('Elements', () => {
|
||||
const messageInput = element(by.css('input'));
|
||||
const popupButtons = element.all(by.css('button'));
|
||||
|
||||
// Helpers
|
||||
const click = (elem: ElementFinder) => {
|
||||
// Waiting for the element to be clickable, makes the tests less flaky.
|
||||
browser.wait(EC.elementToBeClickable(elem), 5000);
|
||||
elem.click();
|
||||
};
|
||||
|
||||
beforeEach(() => browser.get(''));
|
||||
|
||||
describe('popup component', () => {
|
||||
@ -17,7 +24,7 @@ describe('Elements', () => {
|
||||
it('should be displayed on button click', () => {
|
||||
expect(popupComponent.isPresent()).toBe(false);
|
||||
|
||||
popupComponentButton.click();
|
||||
click(popupComponentButton);
|
||||
expect(popupComponent.isPresent()).toBe(true);
|
||||
});
|
||||
|
||||
@ -25,7 +32,7 @@ describe('Elements', () => {
|
||||
messageInput.clear();
|
||||
messageInput.sendKeys('Angular rocks!');
|
||||
|
||||
popupComponentButton.click();
|
||||
click(popupComponentButton);
|
||||
expect(popupComponent.getText()).toContain('Popup: Angular rocks!');
|
||||
});
|
||||
|
||||
@ -33,7 +40,7 @@ describe('Elements', () => {
|
||||
popupComponentButton.click();
|
||||
expect(popupComponent.isPresent()).toBe(true);
|
||||
|
||||
closeButton.click();
|
||||
click(closeButton);
|
||||
expect(popupComponent.isPresent()).toBe(false);
|
||||
});
|
||||
});
|
||||
@ -46,7 +53,7 @@ describe('Elements', () => {
|
||||
it('should be displayed on button click', () => {
|
||||
expect(popupElement.isPresent()).toBe(false);
|
||||
|
||||
popupElementButton.click();
|
||||
click(popupElementButton);
|
||||
expect(popupElement.isPresent()).toBe(true);
|
||||
});
|
||||
|
||||
@ -54,7 +61,7 @@ describe('Elements', () => {
|
||||
messageInput.clear();
|
||||
messageInput.sendKeys('Angular rocks!');
|
||||
|
||||
popupElementButton.click();
|
||||
click(popupElementButton);
|
||||
expect(popupElement.getText()).toContain('Popup: Angular rocks!');
|
||||
});
|
||||
|
||||
@ -62,7 +69,7 @@ describe('Elements', () => {
|
||||
popupElementButton.click();
|
||||
expect(popupElement.isPresent()).toBe(true);
|
||||
|
||||
closeButton.click();
|
||||
click(closeButton);
|
||||
expect(popupElement.isPresent()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
@ -268,7 +268,7 @@ Each budget entry is a JSON object with the following properties:
|
||||
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.
|
||||
Internally, Autoprefixer relies on a library called [Browserslist](https://github.com/browserslist/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.
|
||||
|
||||
@ -287,7 +287,7 @@ Autoprefixer looks for the Browserlist configuration when it prefixes your CSS.
|
||||
last 2 versions
|
||||
```
|
||||
|
||||
See the [browserslist repo](https://github.com/ai/browserslist) for more examples of how to target specific browsers and versions.
|
||||
See the [browserslist repo](https://github.com/browserslist/browserslist) for more examples of how to target specific browsers and versions.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
Backward compatibility
|
||||
|
@ -357,7 +357,7 @@ big chunks of HTML with many data bindings.
|
||||
|
||||
|
||||
Try it out. Because the array has four items, the message should appear.
|
||||
Go back into <code>app.component.ts"</code> and delete or comment out one of the elements from the hero array.
|
||||
Go back into <code>app.component.ts</code> and delete or comment out one of the elements from the hero array.
|
||||
The browser should refresh automatically and the message should disappear.
|
||||
|
||||
|
||||
|
@ -1,21 +1,21 @@
|
||||
# Introduction to forms in Angular
|
||||
|
||||
Handling user input with forms is the cornerstone of many common applications. Applications use forms to enable users log in, to update a profile, to enter sensitive information, and to perform many other data-entry tasks.
|
||||
Handling user input with forms is the cornerstone of many common applications. Applications use forms to enable users to log in, to update a profile, to enter sensitive information, and to perform many other data-entry tasks.
|
||||
|
||||
Angular provides two different approaches to handling user input through forms: reactive and template-driven. Both capture user input events from the view, validate the user input, create a form model and data model to update, and provide a way to track changes.
|
||||
|
||||
Reactive and template-driven forms differ, however, in how they do the work of processing and managing forms and form data. Each offers different advantages.
|
||||
Reactive and template-driven forms process and manage form data differently. Each offers different advantages.
|
||||
|
||||
**In general:**
|
||||
|
||||
* **Reactive forms** are more robust: they are more scalable, reusable, and testable. If forms are a key part of your application, or you're already using reactive patterns for building your application, use reactive forms.
|
||||
* **Template-driven forms** are useful for adding a simple form to an app, such as an email list signup form. They are easy to add to an app, but they do not scale as well as reactive forms. If you have very basic form requirements and logic that can be managed solely in the template, use template-driven forms.
|
||||
* **Reactive forms** are more robust: they're more scalable, reusable, and testable. If forms are a key part of your application, or you're already using reactive patterns for building your application, use reactive forms.
|
||||
* **Template-driven forms** are useful for adding a simple form to an app, such as an email list signup form. They're easy to add to an app, but they don't scale as well as reactive forms. If you have very basic form requirements and logic that can be managed solely in the template, use template-driven forms.
|
||||
|
||||
This guide provides information to help you decide which approach works best for your situation. It introduces the common building blocks used by both approaches. It also summarizes the key differences between the two approaches, and demonstrates those differences in the context of setup, data flow, and testing.
|
||||
This guide provides information to help you decide which type of form works best for your situation. It introduces the common building blocks used by both approaches. It also summarizes the key differences between the two approaches, and demonstrates those differences in the context of setup, data flow, and testing.
|
||||
|
||||
<div class="alert is-important">
|
||||
<div class="alert is-helpful">
|
||||
|
||||
*Note:* For complete information about each kind of form, see the [Reactive Forms](guide/reactive-forms) and [Template-driven Forms](guide/forms) guides.
|
||||
**Note:** For complete information about each kind of form, see [Reactive Forms](guide/reactive-forms) and [Template-driven Forms](guide/forms).
|
||||
|
||||
</div>
|
||||
|
||||
@ -30,7 +30,7 @@ The table below summarizes the key differences between reactive and template-dri
|
||||
|
||||
||Reactive|Template-driven|
|
||||
|--- |--- |--- |
|
||||
|Setup (form model)|More explicit, created in the component class.|Less explicit, created by the directives.|
|
||||
|Setup (form model)|More explicit, created in component class|Less explicit, created by directives|
|
||||
|Data model|Structured|Unstructured|
|
||||
|Predictability|Synchronous|Asynchronous|
|
||||
|Form validation|Functions|Directives|
|
||||
@ -41,35 +41,41 @@ The table below summarizes the key differences between reactive and template-dri
|
||||
|
||||
Both reactive and template-driven forms share underlying building blocks.
|
||||
|
||||
- A `FormControl` instance that tracks the value and validation status of an individual form control.
|
||||
- A `FormGroup` instance that tracks the same values and status for a collection of form controls.
|
||||
- A `FormArray` instance that tracks the same values and status for an array of form controls.
|
||||
- A `ControlValueAccessor` that creates a bridge between Angular `FormControl` instances and native DOM elements.
|
||||
|
||||
How these control instances are created and managed with reactive and template-driven forms is introduced in the [form model setup](#setup-the-form-model) section below and detailed further in the [data flow section](#data-flow-in-forms) of this guide.
|
||||
* `FormControl` tracks the value and validation status of an individual form control.
|
||||
|
||||
## Setup: The form model
|
||||
* `FormGroup` tracks the same values and status for a collection of form controls.
|
||||
|
||||
Reactive and template-driven forms both use a form model to track value changes between Angular forms and form input elements. The examples below show how the form model is defined and created.
|
||||
* `FormArray` tracks the same values and status for an array of form controls.
|
||||
|
||||
* `ControlValueAccessor` creates a bridge between Angular `FormControl` instances and native DOM elements.
|
||||
|
||||
See the [Form model setup](#setup-the-form-model) section below for an introduction to how these control instances are created and managed with reactive and template-driven forms. Further details are provided in the [data flow section](#data-flow-in-forms) of this guide.
|
||||
|
||||
{@a setup-the-form-model}
|
||||
|
||||
## Form model setup
|
||||
|
||||
Reactive and template-driven forms both use a form model to track value changes between Angular forms and form input elements. The examples below show how the form model is defined and created.
|
||||
|
||||
### Setup in reactive forms
|
||||
|
||||
Here is a component with an input field for a single control implemented using reactive forms.
|
||||
Here's a component with an input field for a single control implemented using reactive forms.
|
||||
|
||||
<code-example path="forms-overview/src/app/reactive/favorite-color/favorite-color.component.ts">
|
||||
</code-example>
|
||||
|
||||
The source of truth provides the value and status of the form element at a given point in time. In reactive forms, the form model is source of truth. The form model in the above example is the `FormControl` instance.
|
||||
The source of truth provides the value and status of the form element at a given point in time. In reactive forms, the form model is the source of truth. In the example above, the form model is the `FormControl` instance.
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/forms-overview/key-diff-reactive-forms.png" alt="Reactive forms key differences">
|
||||
</figure>
|
||||
|
||||
With reactive forms, the form model is explicitly defined in the component class. The reactive form directive (in this case, `FormControlDirective`) then links the existing form control instance to a specific form element in the view using a value accessor (instance of `ControlValueAccessor`).
|
||||
With reactive forms, the form model is explicitly defined in the component class. The reactive form directive (in this case, `FormControlDirective`) then links the existing `FormControl` instance to a specific form element in the view using a value accessor (`ControlValueAccessor` instance).
|
||||
|
||||
### Setup in template-driven forms
|
||||
|
||||
Here is the same component with an input field for a single control implemented using template-driven forms.
|
||||
Here's the same component with an input field for a single control implemented using template-driven forms.
|
||||
|
||||
<code-example path="forms-overview/src/app/template/favorite-color/favorite-color.component.ts">
|
||||
</code-example>
|
||||
@ -80,23 +86,25 @@ In template-driven forms, the source of truth is the template.
|
||||
<img src="generated/images/guide/forms-overview/key-diff-td-forms.png" alt="Template-driven forms key differences">
|
||||
</figure>
|
||||
|
||||
The abstraction of the form model promotes simplicity over structure. The template-driven form directive `NgModel` is responsible for creating and managing the form control instance for a given form element. It is less explicit, but you no longer have direct control over the form model.
|
||||
The abstraction of the form model promotes simplicity over structure. The template-driven form directive `NgModel` is responsible for creating and managing the `FormControl` instance for a given form element. It's less explicit, but you no longer have direct control over the form model.
|
||||
|
||||
{@a data-flow-in-forms}
|
||||
|
||||
## Data flow in forms
|
||||
|
||||
When building forms in Angular, it's important to understand how the framework handles data flowing from the user or from programmatic changes. Reactive and template-driven forms follow two different strategies when handling form input. The data flow examples below begin with the favorite color input field example from above, and they show how changes to favorite color are handled in reactive forms compared to template-driven forms.
|
||||
When building forms in Angular, it's important to understand how the framework handles data flowing from the user or from programmatic changes. Reactive and template-driven forms follow two different strategies when handling form input. The data flow examples below begin with the favorite color input field example from above, and then show how changes to favorite color are handled in reactive forms compared to template-driven forms.
|
||||
|
||||
### Data flow in reactive forms
|
||||
|
||||
As described above, in reactive forms each form element in the view is directly linked to a form model (`FormControl` instance). Updates from the view to model and model to view are synchronous and not dependent on the UI rendered. The diagrams below use the same favorite color example to demonstrate how data flows when an input field's value is changed from the view and then from the model.
|
||||
As described above, in reactive forms each form element in the view is directly linked to a form model (`FormControl` instance). Updates from the view to the model and from the model to the view are synchronous and aren't dependent on the UI rendered. The diagrams below use the same favorite color example to demonstrate how data flows when an input field's value is changed from the view and then from the model.
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/forms-overview/dataflow-reactive-forms-vtm.png" alt="Reactive forms data flow - view to model" width="100%">
|
||||
</figure>
|
||||
|
||||
The steps below outline the view to model data flow.
|
||||
The steps below outline the data flow from view to model.
|
||||
|
||||
1. The end user types a value into the input element, in this case the favorite color "Blue".
|
||||
1. The user types a value into the input element, in this case the favorite color *Blue*.
|
||||
1. The form input element emits an "input" event with the latest value.
|
||||
1. The control value accessor listening for events on the form input element immediately relays the new value to the `FormControl` instance.
|
||||
1. The `FormControl` instance emits the new value through the `valueChanges` observable.
|
||||
@ -106,37 +114,37 @@ The steps below outline the view to model data flow.
|
||||
<img src="generated/images/guide/forms-overview/dataflow-reactive-forms-mtv.png" alt="Reactive forms data flow - model to view" width="100%">
|
||||
</figure>
|
||||
|
||||
The steps below outline the model to view data flow.
|
||||
The steps below outline the data flow from model to view.
|
||||
|
||||
1. The `favoriteColorControl.setValue()` method is called, which updates the `FormControl` value.
|
||||
1. The user calls the `favoriteColorControl.setValue()` method, which updates the `FormControl` value.
|
||||
1. The `FormControl` instance emits the new value through the `valueChanges` observable.
|
||||
1. Any subscribers to the `valueChanges` observable receive the new value.
|
||||
1. The control value accessor on the form input element updates the element with the new value.
|
||||
|
||||
### Data flow in template-driven forms
|
||||
|
||||
In template-driven forms, each form element is linked to a directive that manages the form model internally. The diagrams below uses the same favorite color example to demonstrate how data flows when an input field's value is changed from the view and then from the model.
|
||||
In template-driven forms, each form element is linked to a directive that manages the form model internally. The diagrams below use the same favorite color example to demonstrate how data flows when an input field's value is changed from the view and then from the model.
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/forms-overview/dataflow-td-forms-vtm.png" alt="Template-driven forms view to model data flow" width="100%">
|
||||
<img src="generated/images/guide/forms-overview/dataflow-td-forms-vtm.png" alt="Template-driven forms data flow - view to model" width="100%">
|
||||
</figure>
|
||||
|
||||
The steps below outline the view to model data flow.
|
||||
The steps below outline the data flow from view to model when the input value changes from *Red* to *Blue*.
|
||||
|
||||
1. The end user types "Blue" into the input element.
|
||||
1. The input element emits an "input" event with the value "Blue".
|
||||
1. The user types *Blue* into the input element.
|
||||
1. The input element emits an "input" event with the value *Blue*.
|
||||
1. The control value accessor attached to the input triggers the `setValue()` method on the `FormControl` instance.
|
||||
1. The `FormControl` instance emits the new value through the `valueChanges` observable.
|
||||
1. Any subscribers to the `valueChanges` observable receive the new value.
|
||||
1. The control value accessor also calls the `NgModel.viewToModel()` method which emits an `ngModelChange` event.
|
||||
1. Because the component template uses two-way data binding for the `favoriteColor`, the `favoriteColor` property in the component
|
||||
is updated to the value emitted by the `ngModelChange` event ("Blue").
|
||||
1. The control value accessor also calls the `NgModel.viewToModelUpdate()` method which emits an `ngModelChange` event.
|
||||
1. Because the component template uses two-way data binding for the `favoriteColor` property, the `favoriteColor` property in the component
|
||||
is updated to the value emitted by the `ngModelChange` event (*Blue*).
|
||||
|
||||
<figure>
|
||||
<img src="generated/images/guide/forms-overview/dataflow-td-forms-mtv.png" alt="Template-driven forms model to view data flow" width="100%">
|
||||
<img src="generated/images/guide/forms-overview/dataflow-td-forms-mtv.png" alt="Template-driven forms data flow - model to view" width="100%">
|
||||
</figure>
|
||||
|
||||
The steps below outline the model to view data flow.
|
||||
The steps below outline the data flow from model to view when the `favoriteColor` changes from *Blue* to *Red*.
|
||||
|
||||
1. The `favoriteColor` value is updated in the component.
|
||||
1. Change detection begins.
|
||||
@ -150,110 +158,117 @@ The steps below outline the model to view data flow.
|
||||
|
||||
## Form validation
|
||||
|
||||
Validation is an integral part of managing any set of forms. Whether you’re checking for required fields or querying an external API for an existing username, Angular provides a set of built-in validators as well as the ability to create custom validators.
|
||||
Validation is an integral part of managing any set of forms. Whether you're checking for required fields or querying an external API for an existing username, Angular provides a set of built-in validators as well as the ability to create custom validators.
|
||||
|
||||
* **Reactive forms** define custom validators as **functions** that receive a control to validate.
|
||||
* **Template-driven forms** are tied to template **directives**, and must provide custom validator directives that wrap validation functions.
|
||||
|
||||
For more on form validation, see the [Form Validation](guide/form-validation) guide.
|
||||
For more information, see [Form Validation](guide/form-validation).
|
||||
|
||||
## Testing
|
||||
|
||||
Testing also plays a large part in complex applications and an easier testing strategy is always welcomed. One difference in testing reactive forms and template-driven forms is their reliance on rendering the UI in order to perform assertions based on form control and form field changes. The following examples demonstrate the process of testing forms with reactive and template-driven forms.
|
||||
Testing plays a large part in complex applications and a simpler testing strategy is useful when validating that your forms function correctly. Reactive forms and template-driven forms have different levels of reliance on rendering the UI to perform assertions based on form control and form field changes. The following examples demonstrate the process of testing forms with reactive and template-driven forms.
|
||||
|
||||
### Testing reactive forms
|
||||
|
||||
Reactive forms provide a relatively easy testing strategy because they provide synchronous access to the form and data models, and they can be tested without rendering the UI. In these set of tests, controls and data are queried and manipulated through the control without interacting with the change detection cycle.
|
||||
Reactive forms provide a relatively easy testing strategy because they provide synchronous access to the form and data models, and they can be tested without rendering the UI. In these tests, status and data are queried and manipulated through the control without interacting with the change detection cycle.
|
||||
|
||||
The following tests use the favorite color components mentioned earlier to verify the view to model and model to view data flows for a reactive form.
|
||||
The following tests use the favorite color components mentioned earlier to verify the data flows from view to model and model to view for a reactive form.
|
||||
|
||||
The following test verifies the view to model data flow:
|
||||
The following test verifies the data flow from view to model.
|
||||
|
||||
<code-example path="forms-overview/src/app/reactive/favorite-color/favorite-color.component.spec.ts" region="view-to-model" header="Favorite color test - view to model">
|
||||
</code-example>
|
||||
|
||||
The steps performed in the view to model test.
|
||||
Here are the steps performed in the view to model test.
|
||||
|
||||
1. Query the view for the form input element, and create a custom "input" event for the test.
|
||||
1. Set the new value for the input is set to *Red*, and dispatch the "input" event on the form input element.
|
||||
1. Assert that the `favoriteColor` `FormControl` instance value matches the value from the input.
|
||||
1. Set the new value for the input to *Red*, and dispatch the "input" event on the form input element.
|
||||
1. Assert that the component's `favoriteColorControl` value matches the value from the input.
|
||||
|
||||
The following test verifies the model to view data flow:
|
||||
The following test verifies the data flow from model to view.
|
||||
|
||||
<code-example path="forms-overview/src/app/reactive/favorite-color/favorite-color.component.spec.ts" region="model-to-view" header="Favorite color test - model to view">
|
||||
</code-example>
|
||||
|
||||
The steps performed in the model to view test.
|
||||
Here are the steps performed in the model to view test.
|
||||
|
||||
1. Use the `favoriteColor` `FormControl` instance to set the new value.
|
||||
1. Use the `favoriteColorControl`, a `FormControl` instance, to set the new value.
|
||||
1. Query the view for the form input element.
|
||||
1. Assert that the new value set on the control matches the value in the input.
|
||||
|
||||
### Testing template-driven forms
|
||||
|
||||
Writing tests with template-driven forms requires more detailed knowledge of the change detection process and how directives run on each cycle to ensure elements are queried, tested, or changed at the correct time.
|
||||
Writing tests with template-driven forms requires a detailed knowledge of the change detection process and an understanding of how directives run on each cycle to ensure that elements are queried, tested, or changed at the correct time.
|
||||
|
||||
The following tests use the favorite color components mentioned earlier to verify the view to model and model to view data flows for a template-driven form.
|
||||
The following tests use the favorite color components mentioned earlier to verify the data flows from view to model and model to view for a template-driven form.
|
||||
|
||||
The following test verifies the view to model data flow:
|
||||
The following test verifies the data flow from view to model.
|
||||
|
||||
<code-example path="forms-overview/src/app/template/favorite-color/favorite-color.component.spec.ts" region="view-to-model" header="Favorite color test - view to model">
|
||||
</code-example>
|
||||
|
||||
The steps performed in the view to model test.
|
||||
Here are the steps performed in the view to model test.
|
||||
|
||||
1. Query the view for the form input element, and create a custom "input" event for the test.
|
||||
1. Set the new value for the input is set to *Red*, and dispatch the "input" event on the form input element.
|
||||
1. Set the new value for the input to *Red*, and dispatch the "input" event on the form input element.
|
||||
1. Run change detection through the test fixture.
|
||||
1. Assert that the component `favoriteColor` property value matches the value from the input.
|
||||
|
||||
The following test verifies the model to view data flow:
|
||||
The following test verifies the data flow from model to view.
|
||||
|
||||
<code-example path="forms-overview/src/app/template/favorite-color/favorite-color.component.spec.ts" region="model-to-view" header="Favorite color test - model to view">
|
||||
</code-example>
|
||||
|
||||
The steps performed in the model to view test.
|
||||
Here are the steps performed in the model to view test.
|
||||
|
||||
1. Use the component instance to set the value of `favoriteColor` property.
|
||||
1. Use the component instance to set the value of the `favoriteColor` property.
|
||||
1. Run change detection through the test fixture.
|
||||
1. Use the `tick()` method to simulate passage of time within the `fakeAsync()` task.
|
||||
1. Use the `tick()` method to simulate the passage of time within the `fakeAsync()` task.
|
||||
1. Query the view for the form input element.
|
||||
1. Assert that the input value matches the `favoriteColor` value property in the component instance.
|
||||
1. Assert that the input value matches the value of the `favoriteColor` property in the component instance.
|
||||
|
||||
## Mutability
|
||||
|
||||
How changes are tracked plays a role in the efficiency of your application.
|
||||
The change tracking method plays a role in the efficiency of your application.
|
||||
|
||||
- **Reactive forms** keep the data model pure by providing it as an immutable data structure. Each time a change is triggered on the data model, the `FormControl` instance returns a new data model rather than updating the data model directly. This gives you the ability track unique changes to the data model through the control's observable. This allows change detection to be more efficient because it only needs to update on unique changes. It also follows reactive patterns that integrate with observable operators to transform data.
|
||||
- **Template-driven** forms rely on mutability with two-way data binding to update the data model in the component as changes are made in the template. Because there are no unique changes to track on the data model when using two-way data binding, change detection is less efficient at determining when updates are required.
|
||||
|
||||
* **Reactive forms** keep the data model pure by providing it as an immutable data structure. Each time a change is triggered on the data model, the `FormControl` instance returns a new data model rather than updating the existing data model. This gives you the ability to track unique changes to the data model through the control's observable. This provides one way for change detection to be more efficient because it only needs to update on unique changes. It also follows reactive patterns that integrate with observable operators to transform data.
|
||||
|
||||
* **Template-driven** forms rely on mutability with two-way data binding to update the data model in the component as changes are made in the template. Because there are no unique changes to track on the data model when using two-way data binding, change detection is less efficient at determining when updates are required.
|
||||
|
||||
The difference is demonstrated in the examples above using the **favorite color** input element.
|
||||
|
||||
- With reactive forms, the **`FormControl` instance** always returns a new value when the control's value is updated.
|
||||
- With template-driven forms, the **favorite color property** is always modified to its new value.
|
||||
|
||||
* With reactive forms, the **`FormControl` instance** always returns a new value when the control's value is updated.
|
||||
|
||||
* With template-driven forms, the **favorite color property** is always modified to its new value.
|
||||
|
||||
## Scalability
|
||||
|
||||
If forms are a central part of your application, scalability is very important. Being able to reuse form models across components is critical.
|
||||
|
||||
- **Reactive forms** make creating large scale forms easier by providing access to low-level APIs and synchronous access to the form model.
|
||||
- **Template-driven** forms focus on simple scenarios, are not as reusable, abstract away the low-level APIs and access to the form model is provided asynchronously. The abstraction with template-driven forms surfaces in testing also, where testing reactive forms requires less setup and no dependence on the change detection cycle when updating and validating the form and data models during testing.
|
||||
|
||||
## Final Thoughts
|
||||
* **Reactive forms** provide access to low-level APIs and synchronous access to the form model, making creating large-scale forms easier.
|
||||
|
||||
Choosing a strategy begins with understanding the strengths and weaknesses of the options presented. Low-level API and form model access, predictability, mutability, straightforward validation and testing strategies, and scalability are all important consideration in choosing the infrastructure you use when building your forms in Angular. Template-driven forms are similar to patterns in AngularJS, but they have limitations given the criteria of many modern, large-scale Angular apps. Reactive forms integrate with reactive patterns already present in other areas of the Angular architecture, and complement those requirements well. Those limitations are alleviated with reactive forms.
|
||||
* **Template-driven** forms focus on simple scenarios, are not as reusable, abstract away the low-level APIs, and provide asynchronous access to the form model. The abstraction with template-driven forms also surfaces in testing, where testing reactive forms requires less setup and no dependence on the change detection cycle when updating and validating the form and data models during testing.
|
||||
|
||||
## Final thoughts
|
||||
|
||||
Choosing a strategy begins with understanding the strengths and weaknesses of the options presented. Low-level API and form model access, predictability, mutability, straightforward validation and testing strategies, and scalability are all important considerations in choosing the infrastructure you use to build your forms in Angular. Template-driven forms are similar to patterns in AngularJS, but they have limitations given the criteria of many modern, large-scale Angular apps. Reactive forms minimize these limitations. Reactive forms integrate with reactive patterns already present in other areas of the Angular architecture, and complement those requirements well.
|
||||
|
||||
## Next steps
|
||||
|
||||
## Next Steps
|
||||
|
||||
The following guides are the next steps in the learning process.
|
||||
|
||||
To learn more about reactive forms, see the following guides:
|
||||
|
||||
* [Reactive Forms](guide/reactive-forms)
|
||||
* [Form Validation](guide/form-validation#reactive-form-validation)
|
||||
* [Dynamic forms](guide/dynamic-form)
|
||||
* [Dynamic Forms](guide/dynamic-form)
|
||||
|
||||
To learn more about template-driven forms, see the following guides:
|
||||
|
||||
* [Template-driven Forms](guide/forms)
|
||||
* [Template-driven Forms](guide/forms#template-driven-forms)
|
||||
* [Form Validation](guide/form-validation#template-driven-validation)
|
||||
|
||||
|
@ -1,173 +1,141 @@
|
||||
# Npm Packages
|
||||
# Workspace npm dependencies
|
||||
|
||||
The [**Angular CLI**](https://cli.angular.io/), Angular applications, and Angular itself depend upon features and functionality provided by libraries that are available as [**npm**](https://docs.npmjs.com/) packages.
|
||||
The Angular Framework, Angular CLI, and components used by Angular applicatins are packaged as [npm packages](https://docs.npmjs.com/getting-started/what-is-npm "What is npm?") and distributed via the [npm registry](https://docs.npmjs.com/).
|
||||
|
||||
You can download and install these npm packages with the [**npm client**](https://docs.npmjs.com/cli/install), which runs as a Node.js® application.
|
||||
You can download and install these npm packages by using the [npm CLI client](https://docs.npmjs.com/cli/install), which is installed with and runs as a [Node.js®](https://nodejs.org "Nodejs.org") application. By default, the Angular CLI uses the npm client.
|
||||
|
||||
Alternatively, you can use the [yarn client](https://yarnpkg.com/) for downloading and installing npm packages.
|
||||
|
||||
The [**yarn client**](https://yarnpkg.com/en/) is a popular alternative for downloading and installing npm packages.
|
||||
The Angular CLI uses `yarn` by default to install npm packages when you create a new project.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
Node.js and npm are essential to Angular development.
|
||||
See [Getting Started](guide/quickstart#prerequisites) for information about the required versions and installation of Node.js and npm.
|
||||
|
||||
[Get them now](https://docs.npmjs.com/getting-started/installing-node "Installing Node.js and updating npm")
|
||||
if they're not already installed on your machine.
|
||||
|
||||
**Verify that you are running Node.js `v8.x` or higher and npm `5.x` or higher**
|
||||
by running the commands `node -v` and `npm -v` in a terminal/console window.
|
||||
Older versions produce errors.
|
||||
|
||||
Consider using [nvm](https://github.com/creationix/nvm) for managing multiple
|
||||
versions of Node.js and npm. You may need [nvm](https://github.com/creationix/nvm) if
|
||||
you already have projects running on your machine that use other versions of Node.js and npm.
|
||||
If you already have projects running on your machine that use other versions of Node.js and npm, consider using [nvm](https://github.com/creationix/nvm) to manage the multiple versions of Node.js and npm.
|
||||
|
||||
</div>
|
||||
|
||||
## _package.json_
|
||||
|
||||
Both `npm` and `yarn` install packages that are identified in a [**package.json**](https://docs.npmjs.com/files/package.json) file.
|
||||
## `package.json`
|
||||
|
||||
The CLI `ng new` command creates a default `package.json` file for your project.
|
||||
This `package.json` specifies _a starter set of packages_ that work well together and
|
||||
jointly support many common application scenarios.
|
||||
Both `npm` and `yarn` install the packages that are identified in a [`package.json`](https://docs.npmjs.com/files/package.json) file.
|
||||
|
||||
You will add packages to `package.json` as your application evolves.
|
||||
You may even remove some.
|
||||
The CLI command `ng new` creates a `package.json` file when it creates the new workspace.
|
||||
This `package.json` is used by all projects in the workspace, including the initial app project that is created by the CLI when it creates the workspace.
|
||||
|
||||
This guide focuses on the most important packages in the starter set.
|
||||
Initially, this `package.json` includes _a starter set of packages_, some of which are required by Angular and others that support common application scenarios.
|
||||
You add packages to `package.json` as your application evolves.
|
||||
You may even remove some.
|
||||
|
||||
#### *dependencies* and *devDependencies*
|
||||
The `package.json` is organized into two groups of packages:
|
||||
|
||||
The `package.json` includes two sets of packages,
|
||||
[dependencies](guide/npm-packages#dependencies) and [devDependencies](guide/npm-packages#dev-dependencies).
|
||||
* [Dependencies](guide/npm-packages#dependencies) are essential to *running* applications.
|
||||
* [DevDependencies](guide/npm-packages#dev-dependencies) are only necessary to *develop* applications.
|
||||
|
||||
<div class="alert is-helpful">
|
||||
|
||||
**Library developers:** By default, the CLI command [`ng generate library`](cli/generate) creates a `package.json` for the new library. That `package.json` is used when publishing the library to npm.
|
||||
For more information, see the CLI wiki page [Library Support](https://github.com/angular/angular-cli/wiki/stories-create-library).
|
||||
</div>
|
||||
|
||||
The *dependencies* are essential to *running* the application.
|
||||
The *devDependencies* are only necessary to *develop* the application.
|
||||
|
||||
{@a dependencies}
|
||||
## Dependencies
|
||||
|
||||
The packages listed in the `dependencies` section of `package.json` are essential to *running* applications.
|
||||
|
||||
## *Dependencies*
|
||||
The `dependencies` section of `package.json` contains:
|
||||
|
||||
* **Angular packages**: Angular core and optional modules; their package names begin `@angular/`.
|
||||
* [**Angular packages**](#angular-packages): Angular core and optional modules; their package names begin `@angular/`.
|
||||
|
||||
* **Support packages**: 3rd party libraries that must be present for Angular apps to run.
|
||||
* [**Support packages**](#support-packages): 3rd party libraries that must be present for Angular apps to run.
|
||||
|
||||
* **Polyfill packages**: Polyfills plug gaps in a browser's JavaScript implementation.
|
||||
* [**Polyfill packages**](#polyfills): Polyfills plug gaps in a browser's JavaScript implementation.
|
||||
|
||||
### Angular Packages
|
||||
To add a new dependency, use the [`ng add`](cli/add) command.
|
||||
|
||||
**@angular/animations**: Angular's animations library makes it easy to define and apply animation effects such as page and list transitions.
|
||||
Read about it in the [Animations guide](guide/animations).
|
||||
{@a angular-packages}
|
||||
### Angular packages
|
||||
|
||||
**@angular/common**: The commonly needed services, pipes, and directives provided by the Angular team.
|
||||
The [`HttpClientModule`](guide/http) is also here, in the '@angular/common/http' subfolder.
|
||||
The following Angular packages are included as dependencies in the default `package.json` file for a new Angular workspace.
|
||||
For a complete list of Angular packages, see the [API reference](http://angular.io/api?type=package).
|
||||
|
||||
**@angular/core**: Critical runtime parts of the framework needed by every application.
|
||||
Includes all metadata decorators, `Component`, `Directive`, dependency injection, and the component lifecycle hooks.
|
||||
Package name | Description
|
||||
---------------------------------------- | --------------------------------------------------
|
||||
[**@angular/animations**](api/animations) | Angular's animations library makes it easy to define and apply animation effects such as page and list transitions. For more information, see the [Animations guide](guide/animations).
|
||||
[**@angular/common**](api/common) | The commonly-needed services, pipes, and directives provided by the Angular team. The [`HttpClientModule`](api/common/http/HttpClientModule) is also here, in the [`@angular/common/http`](api/common/http) subfolder. For more information, see the [HttpClient guide](guide/http).
|
||||
**@angular/compiler** | Angular's template compiler. It understands templates and can convert them to code that makes the application run and render. Typically you don’t interact with the compiler directly; rather, you use it indirectly via `platform-browser-dynamic` when JIT compiling in the browser. For more information, see the [Ahead-of-time Compilation guide](guide/aot-compiler).
|
||||
[**@angular/core**](api/core) | Critical runtime parts of the framework that are needed by every application. Includes all metadata decorators, `Component`, `Directive`, dependency injection, and the component lifecycle hooks.
|
||||
[**@angular/forms**](api/forms) | Support for both [template-driven](guide/forms) and [reactive forms](guide/reactive-forms). For information about choosing the best forms approach for your app, see [Introduction to forms](guide/forms-overview).
|
||||
[**@angular/http**](api/http) | Angular's legacy HTTP client, which was deprecated in version 5.0 in favor of [@angular/common/http](api/common/http).
|
||||
[**@angular/<br />platform‑browser**](api/platform-browser) | Everything DOM and browser related, especially the pieces that help render into the DOM. This package also includes the `bootstrapModuleFactory()` method for bootstrapping applications for production builds that pre-compile with [AOT](guide/aot-compiler).
|
||||
[**@angular/<br />platform‑browser‑dynamic**](api/platform-browser-dynamic) | Includes [providers](api/core/Provider) and methods to compile and run the app on the client using the [JIT compiler](guide/aot-compiler).
|
||||
[**@angular/router**](api/router) | The router module navigates among your app pages when the browser URL changes. For more information, see [Routing and Navigation](guide/router).
|
||||
|
||||
**@angular/compiler**: Angular's *Template Compiler*.
|
||||
It understands templates and can convert them to code that makes the application run and render.
|
||||
Typically you don’t interact with the compiler directly; rather, you use it indirectly via `platform-browser-dynamic` when [JIT compiling](guide/aot-compiler) in the browser.
|
||||
|
||||
**@angular/forms**: support for both [template-driven](guide/forms) and [reactive forms](guide/reactive-forms).
|
||||
{@a support-packages}
|
||||
### Support packages
|
||||
|
||||
**@angular/http**: Angular's old, deprecated, HTTP client.
|
||||
The following support packages are included as dependencies in the default `package.json` file for a new Angular workspace.
|
||||
|
||||
**@angular/platform-browser**: Everything DOM and browser related, especially
|
||||
the pieces that help render into the DOM.
|
||||
This package also includes the `bootstrapModuleFactory()` method
|
||||
for bootstrapping applications for production builds that pre-compile with [AOT](guide/aot-compiler).
|
||||
|
||||
**@angular/platform-browser-dynamic**: Includes [Providers](api/core/Provider)
|
||||
and methods to compile and run the app on the client
|
||||
using the [JIT compiler](guide/aot-compiler).
|
||||
Package name | Description
|
||||
---------------------------------------- | --------------------------------------------------
|
||||
[**rxjs**](https://github.com/ReactiveX/rxjs) | Many Angular APIs return [_observables_](guide/glossary#observable). RxJS is an implementation of the proposed [Observables specification](https://github.com/zenparsing/es-observable) currently before the [TC39](http://www.ecma-international.org/memento/TC39.htm) committee, which determines standards for the JavaScript language.
|
||||
[**zone.js**](https://github.com/angular/zone.js) | Angular relies on zone.js to run Angular's change detection processes when native JavaScript operations raise events. Zone.js is an implementation of a [specification](https://gist.github.com/mhevery/63fdcdf7c65886051d55) currently before the [TC39](http://www.ecma-international.org/memento/TC39.htm) committee that determines standards for the JavaScript language.
|
||||
|
||||
**@angular/router**: The [router module](/guide/router) navigates among your app pages when the browser URL changes.
|
||||
|
||||
**@angular/upgrade**: Set of utilities for upgrading AngularJS applications to Angular.
|
||||
|
||||
{@a polyfills}
|
||||
|
||||
### Polyfill packages
|
||||
|
||||
Many browsers lack native support for some features in the latest HTML standards,
|
||||
features that Angular requires.
|
||||
"[Polyfills](https://en.wikipedia.org/wiki/Polyfill)" can emulate the missing features.
|
||||
[_Polyfills_](https://en.wikipedia.org/wiki/Polyfill) can emulate the missing features.
|
||||
The [Browser Support](guide/browser-support) guide explains which browsers need polyfills and
|
||||
how you can add them.
|
||||
|
||||
The default `package.json` installs the **[core-js](https://github.com/zloirock/core-js)** package
|
||||
The `package.json` for a new Angular workspace installs the [core-js](https://github.com/zloirock/core-js) package,
|
||||
which polyfills missing features for several popular browser.
|
||||
|
||||
### Support packages
|
||||
|
||||
**[rxjs](https://github.com/benlesh/RxJS)**: Many Angular APIs return _observables_. RxJS is an implementation of the proposed [Observables specification](https://github.com/zenparsing/es-observable) currently before the
|
||||
[TC39](http://www.ecma-international.org/memento/TC39.htm) committee that determines standards for the JavaScript language.
|
||||
|
||||
|
||||
**[zone.js](https://github.com/angular/zone.js)**: Angular relies on zone.js to run Angular's change detection processes when native JavaScript operations raise events. Zone.js is an implementation of a [specification](https://gist.github.com/mhevery/63fdcdf7c65886051d55) currently before the
|
||||
[TC39](http://www.ecma-international.org/memento/TC39.htm) committee that determines standards for the JavaScript language.
|
||||
|
||||
|
||||
{@a dev-dependencies}
|
||||
|
||||
## *DevDependencies*
|
||||
## DevDependencies
|
||||
|
||||
The packages listed in the *devDependencies* section of the `package.json` help you develop the application on your local machine.
|
||||
The packages listed in the `devDependencies` section of `package.json` help you develop the application on your local machine. You don't deploy them with the production application.
|
||||
|
||||
You don't deploy them with the production application although there is no harm in doing so.
|
||||
To add a new `devDependency`, use either one of the following commands:
|
||||
|
||||
**[@angular/cli](https://github.com/angular/angular-cli/)**: The Angular CLI tools.
|
||||
<code-example language="sh" class="code-shell">
|
||||
npm install --dev <package-name>
|
||||
</code-example>
|
||||
|
||||
<code-example language="sh" class="code-shell">
|
||||
yarn add --dev <package-name>
|
||||
</code-example>
|
||||
|
||||
The following `devDependencies` are provided in the default `package.json` file for a new Angular workspace.
|
||||
|
||||
|
||||
**[@angular/compiler-cli](https://github.com/angular/angular/blob/master/packages/compiler-cli/README.md)**: The Angular compiler, which is invoked by the Angular CLI's `build` and `serve` commands.
|
||||
Package name | Description
|
||||
---------------------------------------- | -----------------------------------
|
||||
[**@angular‑devkit/<br />build‑angular**](https://github.com/angular/angular-cli/) | The Angular build tools.
|
||||
[**@angular/cli**](https://github.com/angular/angular-cli/) | The Angular CLI tools.
|
||||
**@angular/<br />compiler‑cli** | The Angular compiler, which is invoked by the Angular CLI's `ng build` and `ng serve` commands.
|
||||
**@angular/<br />language‑service** | The [Angular language service](guide/language-service) analyzes component templates and provides type and error information that TypeScript-aware editors can use to improve the developer's experience. For example, see the [Angular language service extension for VS Code](https://marketplace.visualstudio.com/items?itemName=Angular.ng-template).
|
||||
**@types/... ** | TypeScript definition files for 3rd party libraries such as Jasmine and Node.js.
|
||||
[**codelyzer**](https://www.npmjs.com/package/codelyzer) | A linter for Angular apps whose rules conform to the Angular [style guide](guide/styleguide).
|
||||
**jasmine/... ** | Packages to support the [Jasmine](https://jasmine.github.io/) test library.
|
||||
**karma/... ** | Packages to support the [karma](https://www.npmjs.com/package/karma) test runner.
|
||||
[**protractor**](https://www.npmjs.com/package/protractor) | An end-to-end (e2e) framework for Angular apps. Built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs).
|
||||
[**ts-node**](https://www.npmjs.com/package/ts-node) | TypeScript execution environment and REPL for Node.js.
|
||||
[**tslint**](https://www.npmjs.com/package/tslint) | A static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.
|
||||
[**typescript**](https://www.npmjs.com/package/typescript) | The TypeScript language server, including the *tsc* TypeScript compiler.
|
||||
|
||||
|
||||
**[@angular/language-service](https://github.com/angular/angular-cli/)**: The Angular language service analyzes component templates and provides type and error information that TypeScript-aware editors can use to improve the developer's experience.
|
||||
For example, see the [Angular language service extension for VS Code](https://marketplace.visualstudio.com/items?itemName=Angular.ng-template)
|
||||
## Related information
|
||||
|
||||
|
||||
**@types/... **: TypeScript definition files for 3rd party libraries such as Jasmine and Node.js.
|
||||
|
||||
|
||||
**[codelyzer](https://www.npmjs.com/package/codelyzer)**: A linter for Angular apps whose rules conform to the Angular [style guide](guide/styleguide).
|
||||
|
||||
|
||||
**jasmine/... **: packages to support the [Jasmine](https://jasmine.github.io/) test library.
|
||||
|
||||
|
||||
**karma/... **: packages to support the [karma](https://www.npmjs.com/package/karma) test runner.
|
||||
|
||||
|
||||
**[protractor](https://www.npmjs.com/package/protractor)**: an end-to-end (e2e) framework for Angular apps.
|
||||
Built on top of [WebDriverJS](https://github.com/SeleniumHQ/selenium/wiki/WebDriverJs).
|
||||
|
||||
|
||||
**[ts-node](https://www.npmjs.com/package/ts-node)**: TypeScript execution environment and REPL for Node.js.
|
||||
|
||||
|
||||
**[tslint](https://www.npmjs.com/package/tslint)**: a static analysis tool that checks TypeScript code for readability, maintainability, and functionality errors.
|
||||
|
||||
|
||||
**[typescript](https://www.npmjs.com/package/typescript)**:
|
||||
the TypeScript language server, including the *tsc* TypeScript compiler.
|
||||
|
||||
|
||||
## So many packages! So many files!
|
||||
|
||||
The default `package.json` installs more packages than you'll need for your project.
|
||||
|
||||
A given package may contain tens, hundreds, even thousands of files,
|
||||
all of them in your local machine's `node_modules` directory.
|
||||
The sheer volume of files is intimidating,
|
||||
|
||||
You can remove packages that you don't need but how can you be sure that you won't need it?
|
||||
As a practical matter, it's better to install a package you don't need than worry about it.
|
||||
Extra packages and package files on your local development machine are harmless.
|
||||
|
||||
By default the Angular CLI build process bundles into a single file just the few "vendor" library files that your application actually needs.
|
||||
The browser downloads this bundle, not the original package files.
|
||||
|
||||
See the [Deployment](guide/deployment) to learn more.
|
||||
For information about how the Angular CLI handles packages see the following guides:
|
||||
|
||||
* [Building and serving](guide/build) describes how packages come together to create a development build.
|
||||
* [Deployment](guide/deployment) describes how packages come together to create a production build.
|
@ -65,68 +65,34 @@ Disclaimer: The dates are offered as general guidance and may be adjusted by us
|
||||
|
||||
The following table contains our current target release dates for the next two major versions of Angular:
|
||||
|
||||
Date | Stable Release | Compatibility
|
||||
---------------------- | -------------- | ----------------
|
||||
September/October 2018 | 7.0.0 | ^6.0.0
|
||||
Date | Stable Release | Compatibility
|
||||
---------------------- | -------------- | -------------
|
||||
March/April 2019 | 8.0.0 | ^7.0.0
|
||||
September/October 2019 | 9.0.0 | ^8.0.0
|
||||
|
||||
Compatibility note: The primary goal of the backward compatibility promise is to ensure that changes in the core framework and tooling don't break the existing ecosystem of components and applications and don't put undue upgrade/migration burden on Angular application and component authors.
|
||||
|
||||
|
||||
{@a lts}
|
||||
{@a support}
|
||||
## Support policy
|
||||
## Support policy and schedule
|
||||
|
||||
All of our major releases are supported for 18 months.
|
||||
|
||||
* 6 months of active support, during which regularly-scheduled updates and patches are released, as described above in [Release frequency](#frequency "Release frequency").
|
||||
* 6 months of *active support*, during which regularly-scheduled updates and patches are released.
|
||||
|
||||
* 12 months of long-term support (LTS). During the LTS period, only critical fixes and security patches will be released.
|
||||
* 12 months of *long-term support (LTS)*, during which only critical fixes and security patches are released.
|
||||
|
||||
The following table provides the support status and key dates for Angular version 4.0.0 and higher.
|
||||
The following table provides the support status and key dates for Angular version 5.0.0 and higher.
|
||||
|
||||
<style>
|
||||
|
||||
td, th {vertical-align: top}
|
||||
|
||||
</style>
|
||||
|
||||
<table>
|
||||
|
||||
<tr>
|
||||
<th>Version</th>
|
||||
<th>Status</th>
|
||||
<th>Release Date</th>
|
||||
<th>LTS Start Date</th>
|
||||
<th>LTS End Date</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>^4.0.0</td>
|
||||
<td>LTS</td>
|
||||
<td>March 23, 2017</td>
|
||||
<td>September 23, 2017</td>
|
||||
<td>September 23, 2018</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>^5.0.0</td>
|
||||
<td>LTS</td>
|
||||
<td>November 1, 2017</td>
|
||||
<td>May 1, 2018</td>
|
||||
<td>May 1, 2019</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>^6.0.0</td>
|
||||
<td>Active</td>
|
||||
<td>May 3, 2018</td>
|
||||
<td>November 3, 2018</td>
|
||||
<td>November 3, 2019</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
Version | Status | Released | Active Ends | LTS Ends
|
||||
------- | ------ | ------------ | ------------ | ------------
|
||||
^7.0.0 | Active | Oct 18, 2018 | Apr 18, 2019 | Apr 18, 2020
|
||||
^6.0.0 | LTS | May 3, 2018 | Nov 3, 2018 | Nov 3, 2019
|
||||
^5.0.0 | LTS | Nov 1, 2017 | May 1, 2018 | May 1, 2019
|
||||
|
||||
LTS for Angular version ^4.0.0 ended on September 23, 2018.
|
||||
|
||||
|
||||
{@a deprecation}
|
||||
|
@ -161,7 +161,15 @@ This section defines the policy by which matching requests will be cached.
|
||||
For example, the string `3d12h` will cache content for up to three and a half days.
|
||||
|
||||
#### `timeout`
|
||||
This duration string specifies the network timeout. The network timeout is how long the Angular service worker will wait for the network to respond before using a cached response, if configured to do so.
|
||||
This duration string specifies the network timeout. The network timeout is how long the Angular service worker will wait for the network to respond before using a cached response, if configured to do so. `timeout` is a duration string, using the following unit suffixes:
|
||||
|
||||
* `d`: days
|
||||
* `h`: hours
|
||||
* `m`: minutes
|
||||
* `s`: seconds
|
||||
* `u`: milliseconds
|
||||
|
||||
For example, the string `5s30u` will translate to five seconds and 30 milliseconds of network timeout.
|
||||
|
||||
#### `strategy`
|
||||
|
||||
|
@ -31,7 +31,7 @@ Installing the Angular service worker is as simple as including an `NgModule`. I
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Your application must run in a web browser that supports service workers. Currently, the latest versions of Chrome and Firefox are supported. To learn about other browsers that are service worker ready, see the [Can I Use](http://caniuse.com/#feat=serviceworkers) page.
|
||||
Your application must run in a web browser that supports service workers. Currently, service workers are supported in the latest versions of Chrome, Firefox, Edge, Safari, Opera, UC Browser (Android version) and Samsung Internet. Browsers like IE and Opera Mini do not provide the support. To learn more about other browsers that are service worker ready, see the [Can I Use](https://caniuse.com/#feat=serviceworkers) page and [MDN docs](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API).
|
||||
|
||||
## Related resources
|
||||
|
||||
|
@ -23,7 +23,7 @@ Just run the [`ng test`](cli/test) CLI command:
|
||||
</code-example>
|
||||
|
||||
The `ng test` command builds the app in _watch mode_,
|
||||
and launches the [karma test runner](https://karma-runner.github.io/1.0/index.html).
|
||||
and launches the [karma test runner](https://karma-runner.github.io).
|
||||
|
||||
The console output looks a bit like this:
|
||||
|
||||
@ -184,7 +184,7 @@ You'll need to push a new commit to trigger a build.
|
||||
|
||||
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)
|
||||
There are configuration files for both the [Karma JavaScript test runner](https://karma-runner.github.io/latest/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.
|
||||
|
||||
@ -259,7 +259,7 @@ 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.
|
||||
To enable this, open the [Karma](https://karma-runner.github.io) test platform configuration file, `karma.conf.js`, and add the following in the `coverageIstanbulReporter:` key.
|
||||
|
||||
```
|
||||
coverageIstanbulReporter: {
|
||||
@ -1010,7 +1010,7 @@ _compiles the app before running the tests_.
|
||||
|
||||
However, if you run the tests in a **non-CLI environment**,
|
||||
tests of this component may fail.
|
||||
For example, if you run the `BannerComponent` tests in a web coding environment such as [plunker](http://plnkr.co/), you'll see a message like this one:
|
||||
For example, if you run the `BannerComponent` tests in a web coding environment such as [plunker](https://plnkr.co/), you'll see a message like this one:
|
||||
|
||||
<code-example language="sh" class="code-shell" hideCopy>
|
||||
Error: This test module uses the component BannerComponent
|
||||
@ -1489,7 +1489,7 @@ While the `async()` and `fakeAsync()` functions greatly
|
||||
simplify Angular asynchronous testing,
|
||||
you can still fall back to the traditional technique
|
||||
and pass `it` a function that takes a
|
||||
[`done` callback](http://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support).
|
||||
[`done` callback](https://jasmine.github.io/2.0/introduction.html#section-Asynchronous_Support).
|
||||
|
||||
You can't call `done()` in `async()` or `fakeAsync()` functions, because the `done parameter`
|
||||
is `undefined`.
|
||||
|
BIN
aio/content/images/bios/brian-love.jpg
Normal file
BIN
aio/content/images/bios/brian-love.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 162 KiB |
BIN
aio/content/images/bios/katerina.jpg
Normal file
BIN
aio/content/images/bios/katerina.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
@ -680,5 +680,23 @@
|
||||
"website": "https://lacolaco.net",
|
||||
"bio": "Suguru is a community-loving Frontend developer and a lead of Angular Japan User Group. He organizes the largest Angular event in Japan (ng-japan). And he is a contributor to Angular by sending patches, writing, speaking, and localizing resources in Japanese.",
|
||||
"group": "GDE"
|
||||
},
|
||||
|
||||
"katerina": {
|
||||
"name": "Katerina Skroumpelou",
|
||||
"picture": "katerina.jpg",
|
||||
"twitter": "psybercity",
|
||||
"website": "https://mandarini.github.io/",
|
||||
"bio": "Katerina is a front end software engineer, a conference speaker and AngularAthens meetup organizer. She is obsessed with sharing knowledge about things she loves. She is also trying to support diversity in the community. She lives with her cat in Athens.",
|
||||
"group": "GDE"
|
||||
},
|
||||
|
||||
"blove": {
|
||||
"name": "Brian Love",
|
||||
"picture": "brian-love.jpg",
|
||||
"twitter": "brian_love",
|
||||
"website": "https://brianflove.com",
|
||||
"bio": "Brian is a software engineer and GDE in Angular with a passion for learning, writing, speaking, teaching and mentoring. Brian has been building web applications for over 20 years and has long been a fanboy of JavaScript. When not in front of his Macbook Pro Brian is in the Rocky Mountains skiing or hiking.",
|
||||
"group": "GDE"
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,6 @@
|
||||
</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>
|
||||
@ -44,41 +38,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- AngularConnect-->
|
||||
<tr>
|
||||
<th><a href="http://angularconnect.com" title="AngularConnect">AngularConnect</a></th>
|
||||
<td>London, United Kingdom</td>
|
||||
<td>November 7-8, 2017</td>
|
||||
</tr>
|
||||
<!-- ngAtlanta-->
|
||||
<tr>
|
||||
<th><a href="http://ng-atl.org/" title="ngAtlanta">ngAtlanta</a></th>
|
||||
<td>Atlanta, Georgia</td>
|
||||
<td>January 30, 2018</td>
|
||||
</tr>
|
||||
<!-- ngVikings-->
|
||||
<tr>
|
||||
<th><a href="https://ngvikings.org/" title="ngVikings">ngVikings</a></th>
|
||||
<td>Helsinki, Finland</td>
|
||||
<td>March 1-2, 2018</td>
|
||||
</tr>
|
||||
<!-- ngconf 2018-->
|
||||
<tr>
|
||||
<th><a href="https://www.ng-conf.org/" title="ng-conf">ng-conf</a></th>
|
||||
<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, Austria</td>
|
||||
<td>May 16-18, 2018</td>
|
||||
</tr>
|
||||
<!-- ngJapan-->
|
||||
<tr>
|
||||
<th><a href="https://ngjapan.org/en.html" title="ng-japan">ng-japan</a></th>
|
||||
<td>Tokyo, Japan</td>
|
||||
<td>Jun 16, 2018</td>
|
||||
<!-- AngularMix -->
|
||||
<tr>
|
||||
<th><a href="https://angularmix.com/" title="AngularMix">AngularMix</a></th>
|
||||
<td>Orlando, Florida</td>
|
||||
<td>October 10-12, 2018</td>
|
||||
</tr>
|
||||
<!-- Angular Conf Australia-->
|
||||
<tr>
|
||||
@ -86,6 +50,36 @@
|
||||
<td>Melbourne, Australia</td>
|
||||
<td>Jun 22, 2018</td>
|
||||
</tr>
|
||||
<!-- ngJapan-->
|
||||
<tr>
|
||||
<th><a href="https://ngjapan.org/en.html" title="ng-japan">ng-japan</a></th>
|
||||
<td>Tokyo, Japan</td>
|
||||
<td>Jun 16, 2018</td>
|
||||
</tr>
|
||||
<!-- WeRDevs-->
|
||||
<tr>
|
||||
<th><a href="https://www.wearedevelopers.com/" title="WeAreDevs">WeAreDevelopers</a></th>
|
||||
<td>Vienna, Austria</td>
|
||||
<td>May 16-18, 2018</td>
|
||||
</tr>
|
||||
<!-- ngconf 2018-->
|
||||
<tr>
|
||||
<th><a href="https://www.ng-conf.org/" title="ng-conf">ng-conf</a></th>
|
||||
<td>Salt Lake City, Utah</td>
|
||||
<td>April 18-20, 2018</td>
|
||||
</tr>
|
||||
<!-- ngVikings-->
|
||||
<tr>
|
||||
<th><a href="https://ngvikings.org/" title="ngVikings">ngVikings</a></th>
|
||||
<td>Helsinki, Finland</td>
|
||||
<td>March 1-2, 2018</td>
|
||||
</tr>
|
||||
<!-- ngAtlanta-->
|
||||
<tr>
|
||||
<th><a href="http://ng-atl.org/" title="ngAtlanta">ngAtlanta</a></th>
|
||||
<td>Atlanta, Georgia</td>
|
||||
<td>January 30, 2018</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
|
@ -517,8 +517,8 @@
|
||||
},
|
||||
{
|
||||
"url": "guide/npm-packages",
|
||||
"title": "Packages",
|
||||
"tooltip": "Explanation of npm packages installed into a project by default."
|
||||
"title": "npm Dependencies",
|
||||
"tooltip": "Description of npm packages required at development time and at runtime."
|
||||
},
|
||||
{
|
||||
"url": "guide/typescript-configuration",
|
||||
@ -576,31 +576,15 @@
|
||||
"title": "Release Information",
|
||||
"tooltip": "Angular release practices, updating, and upgrading.",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/updating",
|
||||
"title": "Keeping Up-to-Date",
|
||||
"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/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.",
|
||||
"children": [
|
||||
{
|
||||
"url": "guide/upgrade",
|
||||
"title": "Upgrading Instructions",
|
||||
"tooltip": "Incrementally upgrade an AngularJS application to Angular."
|
||||
},
|
||||
{
|
||||
"url": "guide/ajs-quick-reference",
|
||||
"title": "AngularJS-Angular Concepts",
|
||||
"tooltip": "Learn how AngularJS concepts and techniques map to Angular."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -748,6 +732,7 @@
|
||||
],
|
||||
|
||||
"docVersions": [
|
||||
{ "title": "v6", "url": "https://v6.angular.io" },
|
||||
{ "title": "v5", "url": "https://v5.angular.io" },
|
||||
{ "title": "v4", "url": "https://v4.angular.io" },
|
||||
{ "title": "v2", "url": "https://v2.angular.io" },
|
||||
|
@ -73,17 +73,17 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@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",
|
||||
"@angular/animations": "^7.0.0",
|
||||
"@angular/cdk": "7.0.0",
|
||||
"@angular/common": "^7.0.0",
|
||||
"@angular/core": "^7.0.0",
|
||||
"@angular/elements": "^7.0.0",
|
||||
"@angular/forms": "^7.0.0",
|
||||
"@angular/material": "7.0.0",
|
||||
"@angular/platform-browser": "^7.0.0",
|
||||
"@angular/platform-browser-dynamic": "^7.0.0",
|
||||
"@angular/router": "^7.0.0",
|
||||
"@angular/service-worker": "^7.0.0",
|
||||
"@webcomponents/custom-elements": "^1.2.0",
|
||||
"classlist.js": "^1.1.20150312",
|
||||
"core-js": "^2.4.1",
|
||||
@ -93,11 +93,11 @@
|
||||
"zone.js": "^0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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",
|
||||
"@angular-devkit/build-angular": "~0.10.0",
|
||||
"@angular/cli": "^7.0.1",
|
||||
"@angular/compiler": "^7.0.0",
|
||||
"@angular/compiler-cli": "^7.0.0",
|
||||
"@angular/language-service": "^7.0.0",
|
||||
"@types/jasmine": "^2.5.52",
|
||||
"@types/jasminewd2": "^2.0.4",
|
||||
"@types/node": "~6.0.60",
|
||||
@ -151,7 +151,7 @@
|
||||
"tree-kill": "^1.1.0",
|
||||
"ts-node": "^3.3.0",
|
||||
"tslint": "~5.9.1",
|
||||
"typescript": "^3.1.2",
|
||||
"typescript": "^3.1.3",
|
||||
"uglify-js": "^3.0.15",
|
||||
"unist-util-filter": "^0.2.1",
|
||||
"unist-util-source": "^1.0.1",
|
||||
@ -163,4 +163,4 @@
|
||||
"xregexp": "^4.0.0",
|
||||
"yargs": "^7.0.2"
|
||||
}
|
||||
}
|
||||
}
|
@ -2,13 +2,12 @@
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
source "`dirname $0`/../../scripts/ci/env.sh" print
|
||||
|
||||
readonly INPUT_DIR=dist/
|
||||
readonly OUTPUT_FILE=$PROJECT_ROOT/$1
|
||||
readonly PR_NUMBER=$2
|
||||
readonly PR_LAST_SHA=$3
|
||||
readonly deployedUrl=https://pr${PR_NUMBER}-${PR_LAST_SHA:0:7}.ngbuilds.io/
|
||||
readonly relativeOutputPath=$1
|
||||
readonly prNumber=$2
|
||||
readonly prLastSha=$3
|
||||
readonly inputDir=dist/
|
||||
readonly outputFile=$PROJECT_ROOT/$relativeOutputPath
|
||||
readonly deployedUrl=https://pr${prNumber}-${prLastSha:0:7}.ngbuilds.io/
|
||||
|
||||
(
|
||||
cd $PROJECT_ROOT/aio
|
||||
@ -20,6 +19,6 @@ readonly deployedUrl=https://pr${PR_NUMBER}-${PR_LAST_SHA:0:7}.ngbuilds.io/
|
||||
# deployedUrl must end with /
|
||||
yarn set-opensearch-url $deployedUrl
|
||||
|
||||
mkdir -p "`dirname $OUTPUT_FILE`"
|
||||
tar --create --gzip --directory "$INPUT_DIR" --file "$OUTPUT_FILE" .
|
||||
mkdir -p "`dirname $outputFile`"
|
||||
tar --create --gzip --directory "$inputDir" --file "$outputFile" .
|
||||
)
|
||||
|
@ -1,35 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# WARNING: FIREBASE_TOKEN should NOT be printed.
|
||||
# WARNING: CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN should NOT be printed.
|
||||
set +x -eu -o pipefail
|
||||
|
||||
# Only deploy if this not a PR. PRs are deployed early in `build.sh`.
|
||||
if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then
|
||||
# Do not deploy if we are running in a fork.
|
||||
if [[ "$CI_REPO_OWNER/$CI_REPO_NAME" != "angular/angular" ]]; then
|
||||
echo "Skipping deploy because this is not angular/angular."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Do not deploy if this is a PR. PRs are deployed in the `aio_preview` CircleCI job.
|
||||
if [[ $CI_PULL_REQUEST != "false" ]]; then
|
||||
echo "Skipping deploy because this is a PR build."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Do not deploy if the current commit is not the latest on its branch.
|
||||
readonly LATEST_COMMIT=$(git ls-remote origin $TRAVIS_BRANCH | cut -c1-40)
|
||||
if [[ $TRAVIS_COMMIT != $LATEST_COMMIT ]]; then
|
||||
echo "Skipping deploy because $TRAVIS_COMMIT is not the latest commit ($LATEST_COMMIT)."
|
||||
readonly latestCommit=$(git ls-remote origin $CI_BRANCH | cut -c1-40)
|
||||
if [[ $CI_COMMIT != $latestCommit ]]; then
|
||||
echo "Skipping deploy because $CI_COMMIT is not the latest commit ($latestCommit)."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# The deployment mode is computed based on the branch we are building
|
||||
if [[ $TRAVIS_BRANCH == master ]]; then
|
||||
if [[ $CI_BRANCH == master ]]; then
|
||||
readonly deployEnv=next
|
||||
elif [[ $TRAVIS_BRANCH == $STABLE_BRANCH ]]; then
|
||||
elif [[ $CI_BRANCH == $CI_STABLE_BRANCH ]]; then
|
||||
readonly deployEnv=stable
|
||||
else
|
||||
# Extract the major versions from the branches, e.g. the 4 from 4.3.x
|
||||
readonly majorVersion=${TRAVIS_BRANCH%%.*}
|
||||
readonly majorVersionStable=${STABLE_BRANCH%%.*}
|
||||
readonly majorVersion=${CI_BRANCH%%.*}
|
||||
readonly majorVersionStable=${CI_STABLE_BRANCH%%.*}
|
||||
|
||||
# Do not deploy if the major version is not less than the stable branch major version
|
||||
if [[ !( "$majorVersion" < "$majorVersionStable" ) ]]; then
|
||||
echo "Skipping deploy of branch \"${TRAVIS_BRANCH}\" to firebase."
|
||||
echo "We only deploy archive branches with the major version less than the stable branch: \"${STABLE_BRANCH}\""
|
||||
echo "Skipping deploy of branch \"$CI_BRANCH\" to firebase."
|
||||
echo "We only deploy archive branches with the major version less than the stable branch: \"$CI_STABLE_BRANCH\""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -46,9 +52,9 @@ else
|
||||
)
|
||||
|
||||
# Do not deploy as it is not the latest branch for the given major version
|
||||
if [[ $TRAVIS_BRANCH != $mostRecentMinorVersion ]]; then
|
||||
echo "Skipping deploy of branch \"${TRAVIS_BRANCH}\" to firebase."
|
||||
echo "There is a more recent branch with the same major version: \"${mostRecentMinorVersion}\""
|
||||
if [[ $CI_BRANCH != $mostRecentMinorVersion ]]; then
|
||||
echo "Skipping deploy of branch \"$CI_BRANCH\" to firebase."
|
||||
echo "There is a more recent branch with the same major version: \"$mostRecentMinorVersion\""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -59,21 +65,21 @@ case $deployEnv in
|
||||
next)
|
||||
readonly projectId=aio-staging
|
||||
readonly deployedUrl=https://next.angular.io/
|
||||
readonly firebaseToken=$FIREBASE_TOKEN
|
||||
readonly firebaseToken=$CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN
|
||||
;;
|
||||
stable)
|
||||
readonly projectId=angular-io
|
||||
readonly deployedUrl=https://angular.io/
|
||||
readonly firebaseToken=$FIREBASE_TOKEN
|
||||
readonly firebaseToken=$CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN
|
||||
;;
|
||||
archive)
|
||||
readonly projectId=v${majorVersion}-angular-io
|
||||
readonly deployedUrl=https://v${majorVersion}.angular.io/
|
||||
readonly firebaseToken=$FIREBASE_TOKEN
|
||||
readonly firebaseToken=$CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Git branch : $TRAVIS_BRANCH"
|
||||
echo "Git branch : $CI_BRANCH"
|
||||
echo "Build/deploy mode : $deployEnv"
|
||||
echo "Firebase project : $projectId"
|
||||
echo "Deployment URL : $deployedUrl"
|
||||
@ -101,8 +107,8 @@ fi
|
||||
|
||||
# Deploy to Firebase
|
||||
firebase use "$projectId" --token "$firebaseToken"
|
||||
firebase deploy --message "Commit: $TRAVIS_COMMIT" --non-interactive --token "$firebaseToken"
|
||||
firebase deploy --message "Commit: $CI_COMMIT" --non-interactive --token "$firebaseToken"
|
||||
|
||||
# Run PWA-score tests
|
||||
yarn test-pwa-score "$deployedUrl" "$AIO_MIN_PWA_SCORE"
|
||||
yarn test-pwa-score "$deployedUrl" "$CI_AIO_MIN_PWA_SCORE"
|
||||
)
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set +x -eu -o pipefail
|
||||
|
||||
readonly deployToFirebaseDryRun="`dirname $0`/deploy-to-firebase.sh --dry-run"
|
||||
|
||||
function check {
|
||||
if [[ $1 == $2 ]]; then
|
||||
echo Pass
|
||||
@ -14,11 +16,38 @@ function check {
|
||||
exit 1
|
||||
}
|
||||
|
||||
(
|
||||
echo ===== master - skip deploy - not angular
|
||||
actual=$(
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=notangular
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy because this is not angular/angular."
|
||||
check "$actual" "$expected"
|
||||
)
|
||||
|
||||
(
|
||||
echo ===== master - skip deploy - angular fork
|
||||
actual=$(
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=notangular
|
||||
export CI_REPO_NAME=angular
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy because this is not angular/angular."
|
||||
check "$actual" "$expected"
|
||||
)
|
||||
|
||||
(
|
||||
echo ===== master - skip deploy - pull request
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=true
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=true
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy because this is a PR build."
|
||||
check "$actual" "$expected"
|
||||
@ -27,11 +56,14 @@ function check {
|
||||
(
|
||||
echo ===== master - deploy success
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=master
|
||||
export TRAVIS_COMMIT=$(git ls-remote origin master | cut -c-40)
|
||||
export FIREBASE_TOKEN=XXXXX
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=master
|
||||
export CI_COMMIT=$(git ls-remote origin master | cut -c1-40)
|
||||
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Git branch : master
|
||||
Build/deploy mode : next
|
||||
@ -43,10 +75,13 @@ Deployment URL : https://next.angular.io/"
|
||||
(
|
||||
echo ===== master - skip deploy - commit not HEAD
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=master
|
||||
export TRAVIS_COMMIT=DUMMY_TEST_COMMIT
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=master
|
||||
export CI_COMMIT=DUMMY_TEST_COMMIT
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy because DUMMY_TEST_COMMIT is not the latest commit ($(git ls-remote origin master | cut -c1-40))."
|
||||
check "$actual" "$expected"
|
||||
@ -55,12 +90,15 @@ Deployment URL : https://next.angular.io/"
|
||||
(
|
||||
echo ===== stable - deploy success
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=4.3.x
|
||||
export STABLE_BRANCH=4.3.x
|
||||
export TRAVIS_COMMIT=$(git ls-remote origin 4.3.x | cut -c-40)
|
||||
export FIREBASE_TOKEN=XXXXX
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=4.3.x
|
||||
export CI_STABLE_BRANCH=4.3.x
|
||||
export CI_COMMIT=$(git ls-remote origin 4.3.x | cut -c1-40)
|
||||
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Git branch : 4.3.x
|
||||
Build/deploy mode : stable
|
||||
@ -72,11 +110,14 @@ Deployment URL : https://angular.io/"
|
||||
(
|
||||
echo ===== stable - skip deploy - commit not HEAD
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=4.3.x
|
||||
export STABLE_BRANCH=4.3.x
|
||||
export TRAVIS_COMMIT=DUMMY_TEST_COMMIT
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=4.3.x
|
||||
export CI_STABLE_BRANCH=4.3.x
|
||||
export CI_COMMIT=DUMMY_TEST_COMMIT
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy because DUMMY_TEST_COMMIT is not the latest commit ($(git ls-remote origin 4.3.x | cut -c1-40))."
|
||||
check "$actual" "$expected"
|
||||
@ -85,12 +126,15 @@ Deployment URL : https://angular.io/"
|
||||
(
|
||||
echo ===== archive - deploy success
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=2.4.x
|
||||
export STABLE_BRANCH=4.3.x
|
||||
export TRAVIS_COMMIT=$(git ls-remote origin 2.4.x | cut -c-40)
|
||||
export FIREBASE_TOKEN=XXXXX
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=2.4.x
|
||||
export CI_STABLE_BRANCH=4.3.x
|
||||
export CI_COMMIT=$(git ls-remote origin 2.4.x | cut -c1-40)
|
||||
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Git branch : 2.4.x
|
||||
Build/deploy mode : archive
|
||||
@ -102,12 +146,15 @@ Deployment URL : https://v2.angular.io/"
|
||||
(
|
||||
echo ===== archive - skip deploy - commit not HEAD
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=2.4.x
|
||||
export STABLE_BRANCH=4.3.x
|
||||
export TRAVIS_COMMIT=DUMMY_TEST_COMMIT
|
||||
export FIREBASE_TOKEN=XXXXX
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=2.4.x
|
||||
export CI_STABLE_BRANCH=4.3.x
|
||||
export CI_COMMIT=DUMMY_TEST_COMMIT
|
||||
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy because DUMMY_TEST_COMMIT is not the latest commit ($(git ls-remote origin 2.4.x | cut -c1-40))."
|
||||
check "$actual" "$expected"
|
||||
@ -116,12 +163,15 @@ Deployment URL : https://v2.angular.io/"
|
||||
(
|
||||
echo ===== archive - skip deploy - major version too high, lower minor
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=2.1.x
|
||||
export STABLE_BRANCH=2.2.x
|
||||
export TRAVIS_COMMIT=$(git ls-remote origin 2.1.x | cut -c-40)
|
||||
export FIREBASE_TOKEN=XXXXX
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=2.1.x
|
||||
export CI_STABLE_BRANCH=2.2.x
|
||||
export CI_COMMIT=$(git ls-remote origin 2.1.x | cut -c-40)
|
||||
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy of branch \"2.1.x\" to firebase.
|
||||
We only deploy archive branches with the major version less than the stable branch: \"2.2.x\""
|
||||
@ -131,12 +181,15 @@ We only deploy archive branches with the major version less than the stable bran
|
||||
(
|
||||
echo ===== archive - skip deploy - major version too high, higher minor
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=2.4.x
|
||||
export STABLE_BRANCH=2.2.x
|
||||
export TRAVIS_COMMIT=$(git ls-remote origin 2.4.x | cut -c-40)
|
||||
export FIREBASE_TOKEN=XXXXX
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=2.4.x
|
||||
export CI_STABLE_BRANCH=2.2.x
|
||||
export CI_COMMIT=$(git ls-remote origin 2.4.x | cut -c-40)
|
||||
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy of branch \"2.4.x\" to firebase.
|
||||
We only deploy archive branches with the major version less than the stable branch: \"2.2.x\""
|
||||
@ -146,12 +199,15 @@ We only deploy archive branches with the major version less than the stable bran
|
||||
(
|
||||
echo ===== archive - skip deploy - minor version too low
|
||||
actual=$(
|
||||
export TRAVIS_PULL_REQUEST=false
|
||||
export TRAVIS_BRANCH=2.1.x
|
||||
export STABLE_BRANCH=4.3.x
|
||||
export TRAVIS_COMMIT=$(git ls-remote origin 2.1.x | cut -c-40)
|
||||
export FIREBASE_TOKEN=XXXXX
|
||||
`dirname $0`/deploy-to-firebase.sh --dry-run
|
||||
export BASH_ENV=/dev/null
|
||||
export CI_REPO_OWNER=angular
|
||||
export CI_REPO_NAME=angular
|
||||
export CI_PULL_REQUEST=false
|
||||
export CI_BRANCH=2.1.x
|
||||
export CI_STABLE_BRANCH=4.3.x
|
||||
export CI_COMMIT=$(git ls-remote origin 2.1.x | cut -c-40)
|
||||
export CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN=XXXXX
|
||||
$deployToFirebaseDryRun
|
||||
)
|
||||
expected="Skipping deploy of branch \"2.1.x\" to firebase.
|
||||
There is a more recent branch with the same major version: \"2.4.x\""
|
||||
|
@ -24,10 +24,14 @@ const SKIPPED_HTTPS_AUDITS = ['redirects-http'];
|
||||
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/';
|
||||
|
||||
|
||||
// Specify the path and flags for Chrome on Travis
|
||||
// Specify the path and flags for Chrome on Travis.
|
||||
if (process.env.TRAVIS) {
|
||||
process.env.LIGHTHOUSE_CHROMIUM_PATH = process.env.CHROME_BIN;
|
||||
CHROME_LAUNCH_OPTS.chromeFlags = ['--no-sandbox'];
|
||||
}
|
||||
|
||||
// Be less verbose on CI.
|
||||
if (process.env.CI) {
|
||||
LIGHTHOUSE_FLAGS.logLevel = 'error';
|
||||
}
|
||||
|
||||
|
@ -56,9 +56,7 @@ export class ApiListComponent implements OnInit {
|
||||
|
||||
statuses: Option[] = [
|
||||
{ value: 'all', title: 'All' },
|
||||
{ value: 'stable', title: 'Stable' },
|
||||
{ value: 'deprecated', title: 'Deprecated' },
|
||||
{ value: 'experimental', title: 'Experimental' },
|
||||
{ value: 'security-risk', title: 'Security Risk' }
|
||||
];
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
.cli-name, .cli-default {
|
||||
.cli-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cli-option-syntax {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
|
||||
.processor(require('./processors/removeInjectableConstructors'))
|
||||
.processor(require('./processors/processPackages'))
|
||||
.processor(require('./processors/processNgModuleDocs'))
|
||||
.processor(require('./processors/fixupRealProjectRelativePath'))
|
||||
|
||||
|
||||
/**
|
||||
|
14
aio/tools/transforms/angular-api-package/processors/fixupRealProjectRelativePath.js
vendored
Normal file
14
aio/tools/transforms/angular-api-package/processors/fixupRealProjectRelativePath.js
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
module.exports = function fixupRealProjectRelativePath(API_DOC_TYPES) {
|
||||
return {
|
||||
$runAfter: ['readTypeScriptModules'],
|
||||
$runBefore: ['processing-docs'],
|
||||
$process(docs) {
|
||||
docs.forEach(doc => {
|
||||
if (API_DOC_TYPES.indexOf(doc.docType) !== -1 && doc.fileInfo && doc.fileInfo.realProjectRelativePath) {
|
||||
// this is an API doc - so fix up its real path
|
||||
doc.fileInfo.realProjectRelativePath = 'packages/' + doc.fileInfo.realProjectRelativePath;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
const testPackage = require('../../helpers/test-package');
|
||||
const processorFactory = require('./fixupRealProjectRelativePath');
|
||||
const Dgeni = require('dgeni');
|
||||
|
||||
describe('fixupRealProjectRelativePath processor', () => {
|
||||
|
||||
it('should be available on the injector', () => {
|
||||
const dgeni = new Dgeni([testPackage('angular-api-package')]);
|
||||
const injector = dgeni.configureInjector();
|
||||
const processor = injector.get('fixupRealProjectRelativePath');
|
||||
expect(processor.$process).toBeDefined();
|
||||
expect(processor.$runAfter).toContain('readTypeScriptModules');
|
||||
expect(processor.$runBefore).toContain('processing-docs');
|
||||
});
|
||||
|
||||
it('should add `packages` segment to the start of `realProjectRelativePath` for API docs', () => {
|
||||
const processor = processorFactory(['class', 'member']);
|
||||
const docs = [
|
||||
{ docType: 'class', fileInfo: { realProjectRelativePath: 'a/b/c' } },
|
||||
{ docType: 'member', fileInfo: { realProjectRelativePath: 'a/b/c/d' } },
|
||||
{ docType: 'cli-command', fileInfo: { realProjectRelativePath: 'a/b/c' } },
|
||||
{ docType: 'class', fileInfo: { } },
|
||||
{ docType: 'class' },
|
||||
];
|
||||
processor.$process(docs);
|
||||
|
||||
expect(docs).toEqual([
|
||||
{ docType: 'class', fileInfo: { realProjectRelativePath: 'packages/a/b/c' } },
|
||||
{ docType: 'member', fileInfo: { realProjectRelativePath: 'packages/a/b/c/d' } },
|
||||
{ docType: 'cli-command', fileInfo: { realProjectRelativePath: 'a/b/c' } },
|
||||
{ docType: 'class', fileInfo: { } },
|
||||
{ docType: 'class' },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
@ -1,3 +1,3 @@
|
||||
module.exports = function() {
|
||||
return {name: 'experimental'};
|
||||
return {name: 'publicApi'};
|
||||
};
|
@ -3,7 +3,9 @@ const Package = require('dgeni').Package;
|
||||
const basePackage = require('../angular-base-package');
|
||||
const contentPackage = require('../content-package');
|
||||
const {CONTENTS_PATH, TEMPLATES_PATH, requireFolder} = require('../config');
|
||||
|
||||
const CLI_SOURCE_ROOT = resolve(CONTENTS_PATH, 'cli-src');
|
||||
const CLI_SOURCE_PATH = resolve(CLI_SOURCE_ROOT, 'node_modules/@angular/cli');
|
||||
const CLI_SOURCE_HELP_PATH = resolve(CLI_SOURCE_PATH, 'help');
|
||||
|
||||
// Define the dgeni package for generating the docs
|
||||
module.exports = new Package('cli-docs', [basePackage, contentPackage])
|
||||
@ -18,12 +20,11 @@ module.exports = new Package('cli-docs', [basePackage, contentPackage])
|
||||
|
||||
// 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'),
|
||||
basePath: CLI_SOURCE_HELP_PATH,
|
||||
include: resolve(CLI_SOURCE_HELP_PATH, '*.json'),
|
||||
fileReader: 'cliCommandFileReader'
|
||||
},
|
||||
{
|
||||
@ -42,6 +43,23 @@ module.exports = new Package('cli-docs', [basePackage, contentPackage])
|
||||
})
|
||||
|
||||
|
||||
.config(function(renderDocsProcessor) {
|
||||
|
||||
const cliPackage = require(resolve(CLI_SOURCE_PATH, 'package.json'));
|
||||
const repoUrlParts = cliPackage.repository.url.replace(/\.git$/, '').split('/');
|
||||
const version = `v${cliPackage.version}`;
|
||||
const repo = repoUrlParts.pop();
|
||||
const owner = repoUrlParts.pop();
|
||||
const cliVersionInfo = {
|
||||
gitRepoInfo: { owner, repo },
|
||||
currentVersion: { raw: version }
|
||||
};
|
||||
|
||||
// Add the cli version data to the renderer, for use in things like github links
|
||||
renderDocsProcessor.extraData.cliVersionInfo = cliVersionInfo;
|
||||
})
|
||||
|
||||
|
||||
.config(function(convertToJsonProcessor, postProcessHtml) {
|
||||
convertToJsonProcessor.docTypes = convertToJsonProcessor.docTypes.concat(['cli-command', 'cli-overview']);
|
||||
postProcessHtml.docTypes = postProcessHtml.docTypes.concat(['cli-command', 'cli-overview']);
|
||||
|
@ -15,6 +15,7 @@ module.exports = function cliCommandFileReader(log) {
|
||||
name: 'cliCommandFileReader',
|
||||
defaultPattern: /\.json$/,
|
||||
getDocs(fileInfo) {
|
||||
fileInfo.realProjectRelativePath = 'packages/angular/cli/commands/' + fileInfo.relativePath;
|
||||
try {
|
||||
const doc = json5.parse(fileInfo.content);
|
||||
const name = fileInfo.baseName;
|
||||
@ -23,7 +24,6 @@ module.exports = function cliCommandFileReader(log) {
|
||||
const result = Object.assign(doc, {
|
||||
content: doc.description,
|
||||
docType: 'cli-command',
|
||||
startingLine: 1,
|
||||
id: `cli-${doc.name}`,
|
||||
commandAliases: doc.aliases || [],
|
||||
aliases: computeAliases(doc),
|
||||
|
@ -82,11 +82,6 @@ describe('cli-command reader', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
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.');
|
||||
|
@ -18,7 +18,7 @@ module.exports = function contentFileReader() {
|
||||
getDocs: function(fileInfo) {
|
||||
|
||||
// We return a single element array because content files only contain one document
|
||||
return [{docType: 'content', content: fileInfo.content, startingLine: 1}];
|
||||
return [{docType: 'content', content: fileInfo.content}];
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -37,7 +37,7 @@ describe('contentFileReader', function() {
|
||||
'project/path/modules/someModule/foo/docs/subfolder/bar.ngdoc', 'A load of content',
|
||||
'project/path');
|
||||
expect(fileReader.getDocs(fileInfo)).toEqual([
|
||||
{docType: 'content', content: 'A load of content', startingLine: 1}
|
||||
{docType: 'content', content: 'A load of content'}
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
@ -1,6 +1,8 @@
|
||||
{% import 'lib/cli.html' as cli %}
|
||||
{% import "../lib/githubLinks.html" as github -%}
|
||||
|
||||
<article>
|
||||
{$ github.githubLinks(doc, cliVersionInfo) $}
|
||||
{% include 'include/cli-breadcrumb.html' %}
|
||||
{% include 'include/cli-header.html' %}
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
{% extends 'content.template.html' -%}
|
||||
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
{$ doc.description | marked $}
|
||||
</div>
|
||||
@ -20,4 +23,5 @@
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
@ -20,7 +20,7 @@
|
||||
<tbody>
|
||||
{% for option in arguments %}
|
||||
<tr class="cli-option">
|
||||
<td><code>{$ option.name $}</code></td>
|
||||
<td><code><<var>{$ option.name $}</var>></code></td>
|
||||
<td>
|
||||
{$ option.description | marked $}
|
||||
{% if option.subcommands.length -%}
|
||||
@ -53,16 +53,12 @@
|
||||
{% 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 -%}
|
||||
<code class="cli-option-syntax">{$ renderOption(option.name, option.type, option.default, option.enum) $}</code>
|
||||
</td>
|
||||
<td>
|
||||
{$ option.description | marked $}
|
||||
{% if option.default !== undefined %}<p><span class="cli-default">Default:</span> <code>{$ option.default $}</code></p>{% endif %}
|
||||
{% if option.aliases.length %}<p><span class="cli-aliases">Aliases:</span> {% for alias in option.aliases %}{$ renderOptionName(alias) $}{% if not loop.last %}, {% endif %}{% endfor %}</p>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -71,26 +67,24 @@
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro bold(isBold, contents) -%}
|
||||
<span {% if isBold %}class="cli-default"{% endif %}>{$ contents $}</span>
|
||||
{%- endmacro -%}
|
||||
{%- macro renderOptionName(name) -%}
|
||||
{% if name.length > 1 %}-{% endif %}-{$ name $}
|
||||
{%- endmacro %}
|
||||
|
||||
{%- macro renderValues(values, default) -%}
|
||||
{% for value in values %}{$ bold(value==default, value) $}{% if not loop.last %}|{% endif %}{% endfor %}
|
||||
{%- set valString = values.join('|') -%}
|
||||
{%- if valString.length > 15 %}<br> {% endif %}{$ valString $}
|
||||
{%- 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) $}
|
||||
{%- macro renderOption(name, type, default, values) -%}
|
||||
{% set prefix = '--' if name.length > 1 else '-' %}
|
||||
{%- if type === 'boolean' and not values.length %}{$ prefix $}{$ name $}={$ renderValues([true, false], default) $}
|
||||
{%- elif values.length -%}
|
||||
{$ prefix $}{$ alias $}={$ renderValues(values, default) $}
|
||||
{$ prefix $}{$ name $}={$ renderValues(values, default) $}
|
||||
{%- elif type === 'string' -%}
|
||||
{$ prefix $}{$ alias $}=<var>{$ name $}</var>
|
||||
{$ prefix $}{$ name $}={% if name.length > 15 %}<br> {% endif %}<var>{$ name $}</var>
|
||||
{%- else -%}
|
||||
{$ prefix $}{$ alias $}
|
||||
{$ prefix $}{$ name $}
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
|
@ -2,11 +2,13 @@
|
||||
|
||||
{% set relativePath = doc.fileInfo.relativePath %}
|
||||
{% if doc.title %}{$ ('# ' + doc.title.trim()) | marked $}{% endif %}
|
||||
{% if 'guide/' in relativePath or 'tutorial/' in relativePath or 'docs.md' in relativePath %}
|
||||
{% if '/' in relativePath or 'docs.md' in relativePath %}
|
||||
<div class="github-links">
|
||||
{$ github.githubEditLink(doc, versionInfo) $}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block content %}
|
||||
<div class="content">
|
||||
{$ doc.description | marked $}
|
||||
</div>
|
||||
{% endblock %}
|
@ -3,16 +3,21 @@
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro githubViewHref(doc, versionInfo) -%}
|
||||
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/tree/{$ versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw $}/packages/{$ doc.fileInfo.realProjectRelativePath $}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}
|
||||
{% set githubUrl = 'https://github.com/' + versionInfo.gitRepoInfo.owner + '/' + versionInfo.gitRepoInfo.repo -%}
|
||||
{% set version = versionInfo.currentVersion.isSnapshot and versionInfo.currentVersion.SHA or versionInfo.currentVersion.raw -%}
|
||||
{% set lineInfo = doc.startingLine and ('#L' + (doc.startingLine + 1) + '-L' + (doc.endingLine + 1)) or '' -%}
|
||||
{$ githubUrl $}/tree/{$ version $}/{$ projectRelativePath(doc.fileInfo) $}{$ lineInfo $}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro githubEditHref(doc, versionInfo) -%}
|
||||
https://github.com/{$ versionInfo.gitRepoInfo.owner $}/{$ versionInfo.gitRepoInfo.repo $}/edit/master{$ '/packages' if doc.docType !== 'content' $}/{$ projectRelativePath(doc.fileInfo) $}?message=docs
|
||||
{% macro githubEditHref(doc, versionInfo, pathPrefix) -%}
|
||||
{% set githubUrl = 'https://github.com/' + versionInfo.gitRepoInfo.owner + '/' + versionInfo.gitRepoInfo.repo -%}
|
||||
{% set lineInfo = doc.startingLine and ('#L' + (doc.startingLine + 1) + '-L' + (doc.endingLine + 1)) or '' -%}
|
||||
{$ githubUrl $}/edit/master/{$ projectRelativePath(doc.fileInfo) $}?message=docs
|
||||
{%- if doc.moduleDoc %}({$ doc.moduleDoc.id.split('/')[0] $})
|
||||
{%- elseif doc.docType === 'module' %}({$ doc.id.split('/')[0] $})
|
||||
{%- elseif doc.docType === 'content' %}
|
||||
{%- else %}(...){%- endif -%}
|
||||
%3A%20describe%20your%20change...{% if doc.docType !== 'content' %}#L{$ doc.startingLine + 1 $}-L{$ doc.endingLine + 1 $}{% endif %}
|
||||
%3A%20describe%20your%20change...{$ lineInfo $}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro githubEditLink(doc, versionInfo) -%}
|
||||
|
249
aio/yarn.lock
249
aio/yarn.lock
@ -2,24 +2,24 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@angular-devkit/architect@0.9.0-rc.2":
|
||||
version "0.9.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.9.0-rc.2.tgz#96c86e11263ab6d2bd5a988913fe67253bacf792"
|
||||
integrity sha512-D5vpo03kyBzn0lv6J2M2sC2+xxIo0K7aCKwHv7K0dN2RLPpvHWOTG0Eg+90s7a5OnekiAr9+vhR9vdlGriPBBw==
|
||||
"@angular-devkit/architect@0.10.1":
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.10.1.tgz#73996383ba040f858bf06595e90805c3f3bff1fe"
|
||||
integrity sha512-tlHLHeEKQ1mTDVVE7+4X4Q0JVu0+7RdnIVFVU3f5M976VPYLKaGBQT/HfC7OXZOARtEnh+ZP5/4eMsablM2YcA==
|
||||
dependencies:
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
rxjs "6.3.3"
|
||||
|
||||
"@angular-devkit/build-angular@~0.9.0-rc.1":
|
||||
version "0.9.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-0.9.0-rc.2.tgz#06f2c6d8743b11dc50340652049131cc9d19325d"
|
||||
integrity sha512-F13nSsdprd/eJNEtJLyDswLQ/kWUjzHiqriD9Aq+pNyIIZYlYPPkkfcu6KL/9fHifHvr9LD19Rf/o9/zgn7wug==
|
||||
"@angular-devkit/build-angular@~0.10.0":
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-0.10.1.tgz#6eccfd2eec4778c65e6b38b20304bfa5f134a4f1"
|
||||
integrity sha512-yyXcM7Zk0+bmeEnmaJ/VtfhOfOoi0QCwoQD3NO3uHINdselxnrw/ng+L+i8Cp7/ow4jMjwQornBxBRUJ1G/NMQ==
|
||||
dependencies:
|
||||
"@angular-devkit/architect" "0.9.0-rc.2"
|
||||
"@angular-devkit/build-optimizer" "0.9.0-rc.2"
|
||||
"@angular-devkit/build-webpack" "0.9.0-rc.2"
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@ngtools/webpack" "7.0.0-rc.2"
|
||||
"@angular-devkit/architect" "0.10.1"
|
||||
"@angular-devkit/build-optimizer" "0.10.1"
|
||||
"@angular-devkit/build-webpack" "0.10.1"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
"@ngtools/webpack" "7.0.1"
|
||||
ajv "6.5.3"
|
||||
autoprefixer "8.4.1"
|
||||
circular-dependency-plugin "5.0.2"
|
||||
@ -64,29 +64,29 @@
|
||||
optionalDependencies:
|
||||
node-sass "4.9.3"
|
||||
|
||||
"@angular-devkit/build-optimizer@0.9.0-rc.2":
|
||||
version "0.9.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/build-optimizer/-/build-optimizer-0.9.0-rc.2.tgz#0bf7b3c27ddb200d4c1df67cd8cbfd404ec48c1f"
|
||||
integrity sha512-GFNuV/cUIHLB7W3MDD4n9dFY+mD6nwva8haI882DmA0MGNA6G+eDnBTUMXWtZHVR3yofgOa/7e/XY6cfIKzhag==
|
||||
"@angular-devkit/build-optimizer@0.10.1":
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/build-optimizer/-/build-optimizer-0.10.1.tgz#09b1daaa375e03f768b46d995c111dd93ee802f0"
|
||||
integrity sha512-EnB64bdwQSJJsNlHPydLtJ0qyIhyeIpyyP8rZt0ZpIz56zxy01xLOjBD7gdBIhe6V7s0INDm+TRt5eesYwqSMA==
|
||||
dependencies:
|
||||
loader-utils "1.1.0"
|
||||
source-map "0.5.6"
|
||||
typescript "3.1.1"
|
||||
typescript "3.1.3"
|
||||
webpack-sources "1.2.0"
|
||||
|
||||
"@angular-devkit/build-webpack@0.9.0-rc.2":
|
||||
version "0.9.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.9.0-rc.2.tgz#7341d167041579567b3409f3520c5d188cf21a9a"
|
||||
integrity sha512-BuSmlaaPx1nPU/HyMkktPHCsNno4laHPQaHJOSVbbkXIkp0p8iCvT1drHuzSpTKHA9jLb2hcVyK3vSc5jt6WUQ==
|
||||
"@angular-devkit/build-webpack@0.10.1":
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.10.1.tgz#5101c0099067d6c09e0b17d03637e15ec1c2ef2c"
|
||||
integrity sha512-ZZzTr0R1mv4AbZXJXaQdzUlgYCG0xDdNMIcldNCwPKhwSnvz/AsYVrhviRQrk7ADl/nXGAFbUrdozruq1GH/Nw==
|
||||
dependencies:
|
||||
"@angular-devkit/architect" "0.9.0-rc.2"
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@angular-devkit/architect" "0.10.1"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
rxjs "6.3.3"
|
||||
|
||||
"@angular-devkit/core@7.0.0-rc.2":
|
||||
version "7.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-7.0.0-rc.2.tgz#5fe63ff17d6cfd6029507802e3d88b500c4e4e1e"
|
||||
integrity sha512-c2ODPqnc40Wz9Oerjdi3gHa+XBCvGj1rAZd38NdweCSFejUogbppB4MDoKOFuQi7qp+kXfJpXSX4aocDm6T67g==
|
||||
"@angular-devkit/core@7.0.1":
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-7.0.1.tgz#78e6af0be6364532186bf4ac2e1da0f1685d95cb"
|
||||
integrity sha512-IUzp2NdMJi4kqmYEZJeW3POzZGEv5QvSuiFqNpKXTztnXNRS9a91aPLYbfKlcYYsQ7ggguMRoaNbF33FzjKPUw==
|
||||
dependencies:
|
||||
ajv "6.5.3"
|
||||
chokidar "2.0.4"
|
||||
@ -94,57 +94,57 @@
|
||||
rxjs "6.3.3"
|
||||
source-map "0.7.3"
|
||||
|
||||
"@angular-devkit/schematics@7.0.0-rc.2":
|
||||
version "7.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-7.0.0-rc.2.tgz#1dbe684e9e752db54a2e6b1076ae1da3e3a7fbc2"
|
||||
integrity sha512-fzXCkCjBw4mJ+8OG07ss5m6kHLNU3zFeuEDl6UrD0bUnbnyfGPUFTKub33ZaBSKhXV3cVg8mGy+V6j/mJ/PgTw==
|
||||
"@angular-devkit/schematics@7.0.1":
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-7.0.1.tgz#ccd7c5349c08aaf6224a28881bfeeacaf0ee0307"
|
||||
integrity sha512-hjFtd0TSA4xBeM0MBEVD6bntCwHfJTKwPd03FiYm/bTbkEXxVGKcocNfOxf6g/+Mtp0rUhQHsxJdagewEagBaQ==
|
||||
dependencies:
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
rxjs "6.3.3"
|
||||
|
||||
"@angular/animations@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-7.0.0-rc.1.tgz#c6be8f8fcec434a66644550e52b50cc564023094"
|
||||
integrity sha512-VP3Lui1HyW7kQzdC/kfEw0NiH+VxA81EKMN1iLtDdNoOCpzTcnmjiiPUMtrGOhhhJJXH9y/eQMUOwUcSdKLPZg==
|
||||
"@angular/animations@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-7.0.0.tgz#5c9e1683063c29df10253b7dc5bb9b13694ee396"
|
||||
integrity sha512-IYdryQXdYfPvhJpExLSAr0o9rlUeyVS++a6h/sjqN1dkUt/yJBHLRreuHx8Udvlj2nH70raHJgevk8FwhAkTdA==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/cdk@7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-7.0.0-rc.1.tgz#9291bc176426f906a72179241c9648798360ebbb"
|
||||
integrity sha512-JI8j+vxRrBpqIkvUW9TvR9MdlxAodVV0FIreS7boZJaGQa6XuBYfmM9JRhKEZgTg/si8aArxQ4eYh5tdGsUjkA==
|
||||
"@angular/cdk@7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-7.0.0.tgz#b98d7378e84fed1af30c460aa91af4ada2cf252b"
|
||||
integrity sha512-HX+gIJzST/Nu07ASg1XR583KSEmHI6kUbiSBdq0LqF3mIQgId5z3auBqQcXAgvB0Cg29+/38aj31hnoK/LswEQ==
|
||||
dependencies:
|
||||
tslib "^1.7.1"
|
||||
optionalDependencies:
|
||||
parse5 "^5.0.0"
|
||||
|
||||
"@angular/cli@^7.0.0-rc.2":
|
||||
version "7.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-7.0.0-rc.2.tgz#4d5316f1c2933b363cfe82ea44a3a4765a005322"
|
||||
integrity sha512-C8jkrTZYQnm1PBV8u9GQ1LBtGqy51DDJvCOugm8VkwhtgTxfANPO1x8sZPvX6bpW821LKbCsZLRfkPOJOvTwQA==
|
||||
"@angular/cli@^7.0.1":
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-7.0.1.tgz#77811e468bfa8208e01398a81e793b25be75bc14"
|
||||
integrity sha512-A8AMBRk7mAqk8YtpUvg78vP83pxpMnFzBQg6AL7v0YauOx3qmpVF++Vwy/5gyVSnqFWyUCgsP/w1scgUlBPtcA==
|
||||
dependencies:
|
||||
"@angular-devkit/architect" "0.9.0-rc.2"
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@angular-devkit/schematics" "7.0.0-rc.2"
|
||||
"@schematics/angular" "7.0.0-rc.2"
|
||||
"@schematics/update" "0.9.0-rc.2"
|
||||
"@angular-devkit/architect" "0.10.1"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
"@angular-devkit/schematics" "7.0.1"
|
||||
"@schematics/angular" "7.0.1"
|
||||
"@schematics/update" "0.10.1"
|
||||
inquirer "6.2.0"
|
||||
opn "5.3.0"
|
||||
rxjs "6.3.3"
|
||||
semver "5.5.1"
|
||||
symbol-observable "1.2.0"
|
||||
|
||||
"@angular/common@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/common/-/common-7.0.0-rc.1.tgz#d3e17a5ccd30ee77ef134ebb789ef449afdae78f"
|
||||
integrity sha512-OXN0lIXDz1SWnuFH+vAM1o/8VoezPxyxk0s2t4TSr4AvwSMRAYL13+IeQcYcxyymuQry7XzFqXyjTVD2kNsoBA==
|
||||
"@angular/common@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/common/-/common-7.0.0.tgz#29206614d2b8dc79e5207b7dc6f9fc559e9a24f2"
|
||||
integrity sha512-jp6MA6EOq/a1m+F0c1aZC345pAYYYFpN1m7GMM91JlqkjzJMhyYVk+Bod9xQOEWadcpY+RFudG+jRsPCMO8bvQ==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/compiler-cli@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-7.0.0-rc.1.tgz#b8699d5f1260a6f4f6231db50cde057eaf125d35"
|
||||
integrity sha512-eue8bnD1uBYD7UZp1In8THnInoAwidKk5Ibv9aOloxYcx64FH6ca1ABKPdIZd3hNm0zJsR+ItDi2jyN0xK6+5A==
|
||||
"@angular/compiler-cli@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-7.0.0.tgz#fc3f2be293d00834ea5ba268e5aea796cc5deccc"
|
||||
integrity sha512-fj5ixB4X3BsUnUukFx+dK5z2KkO7lCx5vlbUT2GOMbGCG43dIH6JKUfy5HbpCodLsJHG0gRgZZuY7/k+pbzS+g==
|
||||
dependencies:
|
||||
canonical-path "0.0.2"
|
||||
chokidar "^1.4.2"
|
||||
@ -157,73 +157,71 @@
|
||||
source-map "^0.6.1"
|
||||
yargs "9.0.1"
|
||||
|
||||
"@angular/compiler@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-7.0.0-rc.1.tgz#24171ff262bfd6361a84ea873022a0d2892cc17d"
|
||||
integrity sha512-oCqavxWdx9eDtzW45MTkrTrLSC57MH8/PfY0luwu1R5AaJ9wldifrUCS9ThtpUncSOgZCK9BpJMcywMWhIqvPQ==
|
||||
"@angular/compiler@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-7.0.0.tgz#f953a213a01e4736e94fe1a370b07e13e2393b71"
|
||||
integrity sha512-4fkohfGyG1BEpeYenOartuJmduyZ/R3XQx46hDDiR/9A8/Go4qLGkgr9Bd/JL/gPIR1XAHH9D5ii2sh+28ZEmA==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/core@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/core/-/core-7.0.0-rc.1.tgz#b99b085911d3c4844ded470de9639165d74099c1"
|
||||
integrity sha512-pY7Aul+GOHHoVxbVTv26rFGwl34PKLI31lyC9mH0Eg2Wqq8XIa6XrNePQo4rbU0oO1ZplULSohMk8vVPfpWGpw==
|
||||
"@angular/core@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/core/-/core-7.0.0.tgz#01e9db9074a1db1c47a32f745b787d1c86f5d61a"
|
||||
integrity sha512-DjVyWNGBWKEeBvxeXy8FGBNlnr/W/tNygOZEd6/uCktcXTG4DNyNQrWuNZUKEpr7RuIT3YVMj+UNwgTq0jB/9g==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/elements@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/elements/-/elements-7.0.0-rc.1.tgz#55160432fa549f9cc099c9e639cdece9a2fa589e"
|
||||
integrity sha512-Ms9eL+XwRe57PfdmNEuUIUFAVCRdpBAwNakxc8LFzoAnAT4ogtk4YzQobXLp9EUe/uQ+wqXh3Um/BHSCJMmO0g==
|
||||
"@angular/elements@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/elements/-/elements-7.0.0.tgz#01059d317f9383b9675a1e1cd8eb3509812918d2"
|
||||
integrity sha512-tVnOXU7w+/l2cfr2q5WaxXNuBmXC9WzDIYWw/xZp8zGMXk2X5N+oNIpVWGwLKsoGhmzdKhESLRNCxKF/I/7EiA==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/forms@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-7.0.0-rc.1.tgz#48a5ba22055bdd72fe05956b9fd743fc6779f1c1"
|
||||
integrity sha512-wEmRMG8vLAcJzvXiFWp9r1fhBH846AwvY6+75fpSz7n9vAgDJSlh/v/k+d+kG5hoIatzmnKWKVF+Zn8mlpd4Ig==
|
||||
"@angular/forms@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-7.0.0.tgz#672c306b13e94a20b72c096214642a326c43699a"
|
||||
integrity sha512-rTg1UHq9gHR6zY3Kkip1KCm/YTck/rlR8CvVFIMwF0bdQxUCT51SXVn58nXts9yDaieABcGaQHNkQn1mARslgw==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/language-service@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-7.0.0-rc.1.tgz#c70d68c7469a401e9a5774de8aa0dc651b76b2db"
|
||||
integrity sha512-UU3OoNG4lixRKYPQ6bOlxBaKP521hjqvZjGSIMBJjhDOS4V0FwZ6wQfy73hHl522w+x/VX6lyRE3ugvtB555Hg==
|
||||
"@angular/language-service@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-7.0.0.tgz#1e99a1fcd34a2f7b1b3c26cddac516c59d978a4f"
|
||||
integrity sha512-JlBAXvKrXCCdFc9AnQRaMDl9c0qmASagmmbEX+fuxJbcyqtsUF2y/15Hy5UUmmA+ldZ+mwAoX/naPZZrFSP2rw==
|
||||
|
||||
"@angular/material@7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/material/-/material-7.0.0-rc.1.tgz#e9a88c8b6f6b48b87ed3d1da3037d14a0e3e8290"
|
||||
integrity sha512-4LC3y5ZorNjdF1lEkVN/3zwOEnBwjfWLCY92tA06Kdvs1yENZdu0fGTRwcu9Hz4y+t84sL/KEKC9VjKN3Z7PSg==
|
||||
"@angular/material@7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/material/-/material-7.0.0.tgz#00cacc2f210c5d7e822e34b09078f41df52d8f58"
|
||||
integrity sha512-HgHzHWsUvNiSpRmoOJqnH/TVb4Ki7sXxbWuw5OVKOKiBW6Gwvd29+cP4XauzH47wHMyvS9/HH8kj3gC72pLhJQ==
|
||||
dependencies:
|
||||
tslib "^1.7.1"
|
||||
optionalDependencies:
|
||||
parse5 "^5.0.0"
|
||||
|
||||
"@angular/platform-browser-dynamic@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.0.0-rc.1.tgz#2d4021d09dcd5cac2708536f8f43defe2a6f0c61"
|
||||
integrity sha512-LDULj9gdNxlzYjkHcxofSFwhchUT405Hh+8pCMcHxZEa1dtEzXGB8VYEMPc4EipZt3hleMzv6sjP9gL+4zXpeA==
|
||||
"@angular/platform-browser-dynamic@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.0.0.tgz#2b2a50b5a8176bee257f90ee47b1d873502f7182"
|
||||
integrity sha512-lH2KuH+Em1y/mTOE6yTJmsOxYkMbYKzKLP9gYzc9vZu3er1df6Jx6jxefeBmAr9v+kNCLnpnHWHz2y4GzAesJA==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/platform-browser@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-7.0.0-rc.1.tgz#92e4fcebca06b228756eb095bd3d17fae7a62a26"
|
||||
integrity sha512-P9W+Q9UZoZT+8pg5Id6shc7VXWdJ6YZQAdnxXpp9H2Be5DB6DD5aqsgxSgKNRW1EmQScJHq0EY28vUPGC5idhA==
|
||||
"@angular/platform-browser@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-7.0.0.tgz#8c13a6380cf465b3628e5b576a1313e9b4976093"
|
||||
integrity sha512-XyvL30d6meJ+SXlOmdR+sxoLdSvkQdmVNvpdvUzAHC/EqwA/byg4V3bTe5lpZmypclgFCjkGoTsz6uOnnwlQhw==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/router@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/router/-/router-7.0.0-rc.1.tgz#fd296bd74d4934a464c1b277f4399702d161b663"
|
||||
integrity sha512-y3hbUhyRIOkHym86CqVkKhCldaXreA13BH1D/dprEfIxgAHBKA/oNZrbGGc20n2+aI+AhSUJjAqnruKwr0dgWw==
|
||||
"@angular/router@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/router/-/router-7.0.0.tgz#a4741d8dfa57ac68283fd1c84ac0926eb625e507"
|
||||
integrity sha512-BK6Ho/7ckldFKc724piuPuMX0HPYXD8SUfwNj6yc0wgzDxdWzSmZj/xPEYll2pGNIA9x8Tg1NQKCD+kp1WXngw==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
"@angular/service-worker@^7.0.0-rc.1":
|
||||
version "7.0.0-rc.1"
|
||||
resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-7.0.0-rc.1.tgz#1ec62bab5bd4168e9a7d044b69d806576a91641b"
|
||||
integrity sha512-BqxgsEmB/RZu5EK7Rnkwm1CabOvdFk4DhydyBLssYOV1faxCqMYVhQ+uLk3FpVVteT1+5sxzWO5ub7bbbUTWQQ==
|
||||
"@angular/service-worker@^7.0.0":
|
||||
version "7.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@angular/service-worker/-/service-worker-7.0.0.tgz#25958e20a41680e6b1a5aa7eef424a4c64c397c3"
|
||||
integrity sha512-GFdT7EYLrLhW/Y+eAqPJzZvnz3VNrciStdplnesh+a6zPcoyOc09dMSF7vuDrtxUGY+J0kp0gNS4IEEhdoVoFQ==
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
@ -301,33 +299,33 @@
|
||||
string-format-obj "^1.0.0"
|
||||
through2 "^2.0.0"
|
||||
|
||||
"@ngtools/webpack@7.0.0-rc.2":
|
||||
version "7.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-7.0.0-rc.2.tgz#d5d4b67f012ced74e4d82c1a7449fe3cb83f561b"
|
||||
integrity sha512-82Db96cThozF0LGnSD6BQAzVbBTD/dYnQxSMIYSXbK1tp+oGiO6ggPypA1wLbze71H1Qf0XeSFg7184MbMFyfw==
|
||||
"@ngtools/webpack@7.0.1":
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-7.0.1.tgz#c3a341674808e9d7938abb36e8eeeed0818acd23"
|
||||
integrity sha512-2s/uqEOfCJ2afrmtN1aNHXgDhCTNWWYnO9WVg4WzBTN3v6wEWgDV4gtuSeGdgKt17gxfCG2g3hsAgLt5LrpTZg==
|
||||
dependencies:
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
enhanced-resolve "4.1.0"
|
||||
rxjs "6.3.3"
|
||||
tree-kill "1.2.0"
|
||||
webpack-sources "1.2.0"
|
||||
|
||||
"@schematics/angular@7.0.0-rc.2":
|
||||
version "7.0.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-7.0.0-rc.2.tgz#3ef308d6cab9e23586b53db4f08163356a10127c"
|
||||
integrity sha512-awy/wt+d2Dqf6iZmqZ3kWFvJ6oeXRrCQ16bD4hwZd00/6UsJ9Wlv1NodJ8LkzDEWZaCBZ4OHPevYZdfX2M77+Q==
|
||||
"@schematics/angular@7.0.1":
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-7.0.1.tgz#17ba40fe9665c60bcaa9a3cf722baf0862cf9b94"
|
||||
integrity sha512-IJd7nT5+w3IkJOzXMvgevGJk3HnqoUKOessT3epTEoPvuTLGxljqVNDAaT3KSDDA1lDqTsLIXuT6kK2L5OJO1g==
|
||||
dependencies:
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@angular-devkit/schematics" "7.0.0-rc.2"
|
||||
typescript "3.1.1"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
"@angular-devkit/schematics" "7.0.1"
|
||||
typescript "3.1.3"
|
||||
|
||||
"@schematics/update@0.9.0-rc.2":
|
||||
version "0.9.0-rc.2"
|
||||
resolved "https://registry.yarnpkg.com/@schematics/update/-/update-0.9.0-rc.2.tgz#a2447f7ad17835c1fd9d6bc17bf417ddcf9acd3c"
|
||||
integrity sha512-EhL96xGekUwuxxlG4EeGftzDaCbMyC23yikuecZdrM2RQUOePdBs2Np1RSOgrdujhe0kRXM7wLumJ+WYP32mrg==
|
||||
"@schematics/update@0.10.1":
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/@schematics/update/-/update-0.10.1.tgz#bbadb151aa3f71fbac22e63778c11cc060e6bc6d"
|
||||
integrity sha512-FYisk6HwRjNASuc3gTfvuhuvZagHwI38Y1LRDyANzkyIbEPsK/Txkq/VkoEn2ALoEucr6KQOoUBWT8a8I0ydcA==
|
||||
dependencies:
|
||||
"@angular-devkit/core" "7.0.0-rc.2"
|
||||
"@angular-devkit/schematics" "7.0.0-rc.2"
|
||||
"@angular-devkit/core" "7.0.1"
|
||||
"@angular-devkit/schematics" "7.0.1"
|
||||
npm-registry-client "8.6.0"
|
||||
rxjs "6.3.3"
|
||||
semver "5.5.1"
|
||||
@ -11212,21 +11210,16 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@3.1.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.1.tgz#3362ba9dd1e482ebb2355b02dfe8bcd19a2c7c96"
|
||||
integrity sha512-Veu0w4dTc/9wlWNf2jeRInNodKlcdLgemvPsrNpfu5Pq39sgfFjvIIgTsvUHCoLBnMhPoUA+tFxsXjU6VexVRQ==
|
||||
typescript@3.1.3, typescript@^3.1.3:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.3.tgz#01b70247a6d3c2467f70c45795ef5ea18ce191d5"
|
||||
integrity sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA==
|
||||
|
||||
typescript@^2.4.1:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
|
||||
integrity sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q=
|
||||
|
||||
typescript@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.2.tgz#c03a5d16f30bb60ad8bb6fe8e7cb212eedeec950"
|
||||
integrity sha512-gOoGJWbNnFAfP9FlrSV63LYD5DJqYJHG5ky1kOXSl3pCImn4rqWy/flyq1BRd4iChQsoCqjbQaqtmXO4yCVPCA==
|
||||
|
||||
typescript@~2.7.1:
|
||||
version "2.7.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836"
|
||||
|
@ -72,7 +72,7 @@ keeps the outputs up-to-date as you save sources.
|
||||
|
||||
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.
|
||||
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) 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.
|
||||
@ -165,7 +165,7 @@ You can see an overview at https://www.kchodorow.com/blog/2017/03/27/stamping-yo
|
||||
In our repo, here is how it's configured:
|
||||
|
||||
1) In `tools/bazel_stamp_vars.sh` we run the `git` commands to generate our versioning info.
|
||||
1) In `tools/bazel.rc` we register this script as the value for the `workspace_status_command` flag. Bazel will run the script when it needs to stamp a binary.
|
||||
1) In `.bazelrc` we register this script as the value for the `workspace_status_command` flag. Bazel will run the script when it needs to stamp a binary.
|
||||
|
||||
Note that Bazel has a `--stamp` argument to `bazel build`, but this has no effect since our stamping takes place in Skylark rules. See https://github.com/bazelbuild/bazel/issues/1054
|
||||
|
||||
|
@ -11,26 +11,3 @@ alias(
|
||||
name = "tsconfig.json",
|
||||
actual = "//src:tsconfig.json",
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "node_modules",
|
||||
srcs = glob(
|
||||
[
|
||||
# Include only .js, .json & .d.ts files to reduce the number of
|
||||
# files in the //:node_modules filegroup
|
||||
"node_modules/**/*.js",
|
||||
"node_modules/**/*.json",
|
||||
"node_modules/**/*.d.ts",
|
||||
# All the files in the http-server package are necesssary
|
||||
"node_modules/http-server/**",
|
||||
# All the files in the protractor package are necesssary
|
||||
"node_modules/protractor/**",
|
||||
# Also include all files in node_modules/.bin
|
||||
"node_modules/.bin/*",
|
||||
],
|
||||
exclude = [
|
||||
# Exclude files with spaces which are illegal bazel labels
|
||||
"node_modules/**/* *",
|
||||
],
|
||||
),
|
||||
)
|
||||
|
@ -3,47 +3,48 @@ workspace(name = "bazel_integration_test")
|
||||
#
|
||||
# Download Bazel toolchain dependencies as needed by build actions
|
||||
#
|
||||
local_repository(
|
||||
name = "build_bazel_rules_typescript",
|
||||
path = "node_modules/@bazel/typescript",
|
||||
)
|
||||
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
|
||||
rules_typescript_dependencies()
|
||||
|
||||
http_archive(
|
||||
name = "io_bazel_rules_sass",
|
||||
url = "https://github.com/bazelbuild/rules_sass/archive/1.11.0.zip",
|
||||
strip_prefix = "rules_sass-1.11.0",
|
||||
sha256 = "dbe9fb97d5a7833b2a733eebc78c9c1e3880f676ac8af16e58ccf2139cbcad03",
|
||||
)
|
||||
|
||||
#
|
||||
# Point Bazel to WORKSPACEs that live in subdirectories
|
||||
#
|
||||
|
||||
local_repository(
|
||||
name = "angular",
|
||||
path = "../..",
|
||||
)
|
||||
|
||||
local_repository(
|
||||
http_archive(
|
||||
name = "rxjs",
|
||||
path = "node_modules/rxjs/src",
|
||||
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
|
||||
strip_prefix = "package/src",
|
||||
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
|
||||
)
|
||||
|
||||
load("@angular//packages/bazel:package.bzl", "rules_angular_dependencies")
|
||||
|
||||
rules_angular_dependencies()
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
#
|
||||
# Load and install our dependencies downloaded above.
|
||||
# Setup dependencies loaded above
|
||||
#
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
|
||||
|
||||
check_bazel_version("0.17.0")
|
||||
node_repositories(
|
||||
package_json = ["//:package.json"],
|
||||
node_version = "10.9.0",
|
||||
yarn_version = "1.9.2",
|
||||
)
|
||||
|
||||
yarn_install(
|
||||
name = "npm",
|
||||
package_json = "//src:package.json",
|
||||
yarn_lock = "//src:yarn.lock",
|
||||
)
|
||||
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
|
||||
|
||||
go_rules_dependencies()
|
||||
|
@ -4,20 +4,10 @@
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"reflect-metadata": "file:../../node_modules/reflect-metadata",
|
||||
"rxjs": "file:../../node_modules/rxjs",
|
||||
"tslib": "file:../../node_modules/tslib",
|
||||
"zone.js": "file:../../node_modules/zone.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bazel/typescript": "0.17.0",
|
||||
"@types/jasmine": "file:../../node_modules/@types/jasmine",
|
||||
"@types/source-map": "0.5.1",
|
||||
"protractor": "file:../../node_modules/protractor",
|
||||
"tsickle": "file:../../node_modules/tsickle",
|
||||
"typescript": "file:../../node_modules/typescript"
|
||||
},
|
||||
"scripts": {
|
||||
"//": "deps are listed in src/package.json which is used by yarn_install",
|
||||
"//": "this package.json file is only here so that `yarn test` can be called by /integration/run_tests.sh",
|
||||
"test": "bazel build ... --noshow_progress && bazel test ..."
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ ng_module(
|
||||
"@angular//packages/common/http",
|
||||
"@angular//packages/core",
|
||||
"@angular//packages/platform-browser",
|
||||
"@npm//@types",
|
||||
],
|
||||
)
|
||||
|
||||
@ -21,14 +22,14 @@ load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
|
||||
ts_devserver(
|
||||
name = "devserver",
|
||||
additional_root_paths = [
|
||||
"bazel_integration_test/node_modules/tslib",
|
||||
"bazel_integration_test/node_modules/zone.js/dist",
|
||||
"npm/node_modules/tslib",
|
||||
"npm/node_modules/zone.js/dist",
|
||||
],
|
||||
entry_module = "bazel_integration_test/src/main",
|
||||
serving_path = "/bundle.min.js",
|
||||
static_files = [
|
||||
"//:node_modules/tslib/tslib.js",
|
||||
"//:node_modules/zone.js/dist/zone.min.js",
|
||||
"@npm//node_modules/tslib:tslib.js",
|
||||
"@npm//node_modules/zone.js:dist/zone.min.js",
|
||||
"index.html",
|
||||
],
|
||||
deps = ["//src"],
|
||||
@ -39,7 +40,6 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "rollup_bundle")
|
||||
rollup_bundle(
|
||||
name = "bundle",
|
||||
entry_point = "src/main",
|
||||
node_modules = "//:node_modules",
|
||||
deps = ["//src"],
|
||||
)
|
||||
|
||||
@ -47,7 +47,7 @@ rollup_bundle(
|
||||
# package.
|
||||
genrule(
|
||||
name = "zone.js",
|
||||
srcs = ["//:node_modules/zone.js/dist/zone.min.js"],
|
||||
srcs = ["@npm//node_modules/zone.js:dist/zone.min.js"],
|
||||
outs = ["zone.min.js"],
|
||||
cmd = "cp $< $@",
|
||||
)
|
||||
|
@ -18,13 +18,13 @@ ng_module(
|
||||
assets = [":hello-world-styles"],
|
||||
deps = [
|
||||
"@angular//packages/core",
|
||||
"@npm//@types",
|
||||
],
|
||||
)
|
||||
|
||||
ng_package(
|
||||
name = "npm_package",
|
||||
entry_point = "src/hello-world/index.js",
|
||||
node_modules = "//:node_modules",
|
||||
deps = [":hello-world"],
|
||||
)
|
||||
|
||||
@ -38,19 +38,23 @@ ts_library(
|
||||
"@angular//packages/core/testing",
|
||||
"@angular//packages/platform-browser",
|
||||
"@angular//packages/platform-browser-dynamic/testing",
|
||||
"@npm//@types",
|
||||
"@npm//jasmine",
|
||||
],
|
||||
)
|
||||
|
||||
ts_web_test_suite(
|
||||
name = "test",
|
||||
srcs = ["//:node_modules/tslib/tslib.js"],
|
||||
srcs = ["@npm//node_modules/tslib:tslib.js"],
|
||||
bootstrap = [
|
||||
"//:node_modules/zone.js/dist/zone-testing-bundle.js",
|
||||
"//:node_modules/reflect-metadata/Reflect.js",
|
||||
"@npm//node_modules/zone.js:dist/zone-testing-bundle.js",
|
||||
"@npm//node_modules/reflect-metadata:Reflect.js",
|
||||
],
|
||||
browsers = [
|
||||
"@io_bazel_rules_webtesting//browsers:chromium-local",
|
||||
"@io_bazel_rules_webtesting//browsers:firefox-local",
|
||||
# TODO(gregmagolan): re-enable firefox testing once fixed
|
||||
# See https://github.com/bazelbuild/rules_typescript/issues/296
|
||||
# "@io_bazel_rules_webtesting//browsers:firefox-local",
|
||||
],
|
||||
deps = [
|
||||
":test_lib",
|
||||
|
26
integration/bazel/src/package.json
Normal file
26
integration/bazel/src/package.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "angular-bazel",
|
||||
"description": "example and integration test for building Angular apps with Bazel",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"reflect-metadata": "0.1.12",
|
||||
"rxjs": "6.3.3",
|
||||
"tslib": "1.9.3",
|
||||
"zone.js": "0.8.26"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/bazel": "file:../angular/dist/packages-dist/bazel",
|
||||
"@angular/compiler": "file:../angular/dist/packages-dist/compiler",
|
||||
"@angular/compiler-cli": "file:../angular/dist/packages-dist/compiler-cli",
|
||||
"@bazel/karma": "0.20.3",
|
||||
"@bazel/typescript": "0.20.3",
|
||||
"@types/jasmine": "2.8.8",
|
||||
"@types/source-map": "0.5.1",
|
||||
"protractor": "5.1.2",
|
||||
"typescript": "3.1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"//": "TODO(gregmagolan): figure out how to keep dependencies here up to date with the root package.json"
|
||||
}
|
||||
}
|
3797
integration/bazel/src/yarn.lock
Normal file
3797
integration/bazel/src/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,10 @@ ts_library(
|
||||
testonly = 1,
|
||||
srcs = ["app.spec.ts"],
|
||||
tsconfig = ":tsconfig.json",
|
||||
deps = [
|
||||
"@npm//@types",
|
||||
"@npm//protractor",
|
||||
],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
@ -13,13 +17,20 @@ ts_library(
|
||||
testonly = 1,
|
||||
srcs = ["on-prepare.ts"],
|
||||
tsconfig = ":tsconfig.json",
|
||||
deps = ["@angular//packages/bazel/src/protractor/utils"],
|
||||
deps = [
|
||||
"@npm//@angular/bazel",
|
||||
"@npm//@types",
|
||||
"@npm//protractor",
|
||||
],
|
||||
)
|
||||
|
||||
protractor_web_test_suite(
|
||||
name = "devserver_test",
|
||||
configuration = "//:protractor.conf.js",
|
||||
data = ["@angular//packages/bazel/src/protractor/utils"],
|
||||
data = [
|
||||
"@npm//@angular/bazel",
|
||||
"@npm//protractor",
|
||||
],
|
||||
on_prepare = ":ts_on_prepare",
|
||||
server = "//src:devserver",
|
||||
deps = [":e2e"],
|
||||
@ -28,7 +39,10 @@ protractor_web_test_suite(
|
||||
protractor_web_test_suite(
|
||||
name = "prodserver_test",
|
||||
configuration = "//:protractor.conf.js",
|
||||
data = ["@angular//packages/bazel/src/protractor/utils"],
|
||||
data = [
|
||||
"@npm//@angular/bazel",
|
||||
"@npm//protractor",
|
||||
],
|
||||
on_prepare = ":ts_on_prepare",
|
||||
server = "//src:prodserver",
|
||||
deps = [":e2e"],
|
||||
|
@ -2,907 +2,3 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@bazel/typescript@github:bazelbuild/rules_typescript#87d892be147b66e5668ba14f89ef5df8259de102":
|
||||
version "0.16.2"
|
||||
resolved "https://codeload.github.com/bazelbuild/rules_typescript/tar.gz/87d892be147b66e5668ba14f89ef5df8259de102"
|
||||
dependencies:
|
||||
protobufjs "5.0.0"
|
||||
tsutils "2.20.0"
|
||||
|
||||
"@types/jasmine@file:../../node_modules/@types/jasmine":
|
||||
version "2.8.8"
|
||||
|
||||
"@types/node@^6.0.46":
|
||||
version "6.0.116"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.116.tgz#2f9cd62b4ecc4927e3942e2655c182eecf5b45f1"
|
||||
|
||||
"@types/q@^0.0.32":
|
||||
version "0.0.32"
|
||||
resolved "https://registry.yarnpkg.com/@types/q/-/q-0.0.32.tgz#bd284e57c84f1325da702babfc82a5328190c0c5"
|
||||
|
||||
"@types/selenium-webdriver@^2.53.35", "@types/selenium-webdriver@~2.53.39":
|
||||
version "2.53.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-2.53.43.tgz#2de3d718819bc20165754c4a59afb7e9833f6707"
|
||||
|
||||
"@types/source-map@0.5.1":
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/source-map/-/source-map-0.5.1.tgz#7e74db5d06ab373a712356eebfaea2fad0ea2367"
|
||||
|
||||
adm-zip@0.4.4:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.4.tgz#a61ed5ae6905c3aea58b3a657d25033091052736"
|
||||
|
||||
adm-zip@^0.4.7, adm-zip@^0.4.9:
|
||||
version "0.4.11"
|
||||
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.11.tgz#2aa54c84c4b01a9d0fb89bb11982a51f13e3d62a"
|
||||
|
||||
agent-base@2:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.1.1.tgz#d6de10d5af6132d5bd692427d46fc538539094c7"
|
||||
dependencies:
|
||||
extend "~3.0.0"
|
||||
semver "~5.0.1"
|
||||
|
||||
ajv@^5.3.0:
|
||||
version "5.5.2"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
|
||||
dependencies:
|
||||
co "^4.6.0"
|
||||
fast-deep-equal "^1.0.0"
|
||||
fast-json-stable-stringify "^2.0.0"
|
||||
json-schema-traverse "^0.3.0"
|
||||
|
||||
ansi-regex@^2.0.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
|
||||
|
||||
ansi-styles@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
array-union@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
|
||||
dependencies:
|
||||
array-uniq "^1.0.1"
|
||||
|
||||
array-uniq@^1.0.1:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
|
||||
|
||||
arrify@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
|
||||
|
||||
ascli@~1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc"
|
||||
dependencies:
|
||||
colour "~0.7.1"
|
||||
optjs "~3.2.2"
|
||||
|
||||
asn1@~0.2.3:
|
||||
version "0.2.4"
|
||||
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
|
||||
dependencies:
|
||||
safer-buffer "~2.1.0"
|
||||
|
||||
assert-plus@1.0.0, assert-plus@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
|
||||
|
||||
asynckit@^0.4.0:
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
|
||||
|
||||
aws4@^1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
|
||||
bcrypt-pbkdf@^1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
|
||||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
blocking-proxy@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/blocking-proxy/-/blocking-proxy-0.0.5.tgz#462905e0dcfbea970f41aa37223dda9c07b1912b"
|
||||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
|
||||
brace-expansion@^1.1.7:
|
||||
version "1.1.11"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
buffer-from@^1.0.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
|
||||
|
||||
bytebuffer@~5:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd"
|
||||
dependencies:
|
||||
long "~3"
|
||||
|
||||
camelcase@^2.0.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
|
||||
|
||||
chalk@^1.1.1, chalk@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
|
||||
dependencies:
|
||||
ansi-styles "^2.2.1"
|
||||
escape-string-regexp "^1.0.2"
|
||||
has-ansi "^2.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
supports-color "^2.0.0"
|
||||
|
||||
cliui@^3.0.3:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
|
||||
dependencies:
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
wrap-ansi "^2.0.0"
|
||||
|
||||
co@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
|
||||
|
||||
code-point-at@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
|
||||
|
||||
colour@~0.7.1:
|
||||
version "0.7.1"
|
||||
resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778"
|
||||
|
||||
combined-stream@1.0.6, combined-stream@~1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818"
|
||||
dependencies:
|
||||
delayed-stream "~1.0.0"
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
|
||||
core-util-is@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
|
||||
dashdash@^1.12.0:
|
||||
version "1.14.1"
|
||||
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
debug@2:
|
||||
version "2.6.9"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
decamelize@^1.1.1:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
|
||||
del@^2.2.0:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
|
||||
dependencies:
|
||||
globby "^5.0.0"
|
||||
is-path-cwd "^1.0.0"
|
||||
is-path-in-cwd "^1.0.0"
|
||||
object-assign "^4.0.1"
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
rimraf "^2.2.8"
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
|
||||
diff@^3.2.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
|
||||
|
||||
ecc-jsbn@~0.1.1:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
|
||||
dependencies:
|
||||
jsbn "~0.1.0"
|
||||
safer-buffer "^2.1.0"
|
||||
|
||||
escape-string-regexp@^1.0.2:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
|
||||
exit@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
|
||||
|
||||
extend@3, extend@~3.0.0, extend@~3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
|
||||
|
||||
extsprintf@1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
|
||||
|
||||
extsprintf@^1.2.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
|
||||
|
||||
fast-deep-equal@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614"
|
||||
|
||||
fast-json-stable-stringify@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
|
||||
|
||||
forever-agent@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||
|
||||
form-data@~2.3.2:
|
||||
version "2.3.2"
|
||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099"
|
||||
dependencies:
|
||||
asynckit "^0.4.0"
|
||||
combined-stream "1.0.6"
|
||||
mime-types "^2.1.12"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
|
||||
getpass@^0.1.1:
|
||||
version "0.1.7"
|
||||
resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
glob@^5.0.10:
|
||||
version "5.0.15"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
|
||||
dependencies:
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "2 || 3"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^7.0.3, glob@^7.0.5, glob@^7.0.6:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
globby@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d"
|
||||
dependencies:
|
||||
array-union "^1.0.1"
|
||||
arrify "^1.0.0"
|
||||
glob "^7.0.3"
|
||||
object-assign "^4.0.1"
|
||||
pify "^2.0.0"
|
||||
pinkie-promise "^2.0.0"
|
||||
|
||||
har-schema@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
|
||||
|
||||
har-validator@~5.1.0:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29"
|
||||
dependencies:
|
||||
ajv "^5.3.0"
|
||||
har-schema "^2.0.0"
|
||||
|
||||
has-ansi@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
http-signature@~1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
jsprim "^1.2.2"
|
||||
sshpk "^1.7.0"
|
||||
|
||||
https-proxy-agent@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6"
|
||||
dependencies:
|
||||
agent-base "2"
|
||||
debug "2"
|
||||
extend "3"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
|
||||
ini@^1.3.4:
|
||||
version "1.3.5"
|
||||
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
|
||||
|
||||
invert-kv@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
|
||||
|
||||
is-fullwidth-code-point@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
|
||||
dependencies:
|
||||
number-is-nan "^1.0.0"
|
||||
|
||||
is-path-cwd@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d"
|
||||
|
||||
is-path-in-cwd@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52"
|
||||
dependencies:
|
||||
is-path-inside "^1.0.0"
|
||||
|
||||
is-path-inside@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036"
|
||||
dependencies:
|
||||
path-is-inside "^1.0.1"
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
|
||||
isstream@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
|
||||
jasmine-core@~2.99.0:
|
||||
version "2.99.1"
|
||||
resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.99.1.tgz#e6400df1e6b56e130b61c4bcd093daa7f6e8ca15"
|
||||
|
||||
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.99.0"
|
||||
resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.99.0.tgz#8ca72d102e639b867c6489856e0e18a9c7aa42b7"
|
||||
dependencies:
|
||||
exit "^0.1.2"
|
||||
glob "^7.0.6"
|
||||
jasmine-core "~2.99.0"
|
||||
|
||||
jasminewd2@^2.1.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/jasminewd2/-/jasminewd2-2.2.0.tgz#e37cf0b17f199cce23bea71b2039395246b4ec4e"
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
|
||||
json-schema-traverse@^0.3.0:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340"
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
|
||||
json-stringify-safe@~5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
|
||||
|
||||
jsprim@^1.2.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
|
||||
dependencies:
|
||||
assert-plus "1.0.0"
|
||||
extsprintf "1.3.0"
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
lcid@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835"
|
||||
dependencies:
|
||||
invert-kv "^1.0.0"
|
||||
|
||||
long@~3:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b"
|
||||
|
||||
mime-db@~1.35.0:
|
||||
version "1.35.0"
|
||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47"
|
||||
|
||||
mime-types@^2.1.12, mime-types@~2.1.19:
|
||||
version "2.1.19"
|
||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0"
|
||||
dependencies:
|
||||
mime-db "~1.35.0"
|
||||
|
||||
"minimatch@2 || 3", minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
|
||||
minimist@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
|
||||
|
||||
minimist@~0.0.1:
|
||||
version "0.0.10"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
|
||||
|
||||
mkdirp@^0.5.1:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
ms@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||
|
||||
number-is-nan@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
|
||||
|
||||
oauth-sign@~0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
|
||||
|
||||
object-assign@^4.0.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
optimist@~0.6.0:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
|
||||
dependencies:
|
||||
minimist "~0.0.1"
|
||||
wordwrap "~0.0.2"
|
||||
|
||||
options@>=0.0.5:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/options/-/options-0.0.6.tgz#ec22d312806bb53e731773e7cdaefcf1c643128f"
|
||||
|
||||
optjs@~3.2.2:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee"
|
||||
|
||||
os-locale@^1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9"
|
||||
dependencies:
|
||||
lcid "^1.0.0"
|
||||
|
||||
os-tmpdir@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
|
||||
path-is-inside@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
|
||||
|
||||
performance-now@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
|
||||
|
||||
pify@^2.0.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||
|
||||
pinkie-promise@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
|
||||
dependencies:
|
||||
pinkie "^2.0.0"
|
||||
|
||||
pinkie@^2.0.0:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
|
||||
|
||||
protobufjs@5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.0.tgz#4223063233ea96ac063ca2b554035204db524fa1"
|
||||
dependencies:
|
||||
ascli "~1"
|
||||
bytebuffer "~5"
|
||||
glob "^5.0.10"
|
||||
yargs "^3.10.0"
|
||||
|
||||
"protractor@file:../../node_modules/protractor":
|
||||
version "5.1.2"
|
||||
dependencies:
|
||||
"@types/node" "^6.0.46"
|
||||
"@types/q" "^0.0.32"
|
||||
"@types/selenium-webdriver" "~2.53.39"
|
||||
blocking-proxy "0.0.5"
|
||||
chalk "^1.1.3"
|
||||
glob "^7.0.3"
|
||||
jasmine "^2.5.3"
|
||||
jasminewd2 "^2.1.0"
|
||||
optimist "~0.6.0"
|
||||
q "1.4.1"
|
||||
saucelabs "~1.3.0"
|
||||
selenium-webdriver "3.0.1"
|
||||
source-map-support "~0.4.0"
|
||||
webdriver-js-extender "^1.0.0"
|
||||
webdriver-manager "^12.0.6"
|
||||
|
||||
psl@^1.1.24:
|
||||
version "1.1.29"
|
||||
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67"
|
||||
|
||||
punycode@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
|
||||
q@1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
|
||||
|
||||
q@^1.4.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
|
||||
|
||||
qs@~6.5.2:
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||
|
||||
"reflect-metadata@file:../../node_modules/reflect-metadata":
|
||||
version "0.1.12"
|
||||
|
||||
request@^2.87.0:
|
||||
version "2.88.0"
|
||||
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
|
||||
dependencies:
|
||||
aws-sign2 "~0.7.0"
|
||||
aws4 "^1.8.0"
|
||||
caseless "~0.12.0"
|
||||
combined-stream "~1.0.6"
|
||||
extend "~3.0.2"
|
||||
forever-agent "~0.6.1"
|
||||
form-data "~2.3.2"
|
||||
har-validator "~5.1.0"
|
||||
http-signature "~1.2.0"
|
||||
is-typedarray "~1.0.0"
|
||||
isstream "~0.1.2"
|
||||
json-stringify-safe "~5.0.1"
|
||||
mime-types "~2.1.19"
|
||||
oauth-sign "~0.9.0"
|
||||
performance-now "^2.1.0"
|
||||
qs "~6.5.2"
|
||||
safe-buffer "^5.1.2"
|
||||
tough-cookie "~2.4.3"
|
||||
tunnel-agent "^0.6.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
|
||||
dependencies:
|
||||
glob "^7.0.5"
|
||||
|
||||
"rxjs@file:../../node_modules/rxjs":
|
||||
version "6.0.0"
|
||||
dependencies:
|
||||
tslib "^1.9.0"
|
||||
|
||||
safe-buffer@^5.0.1, safe-buffer@^5.1.2:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
|
||||
safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
|
||||
|
||||
saucelabs@~1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.3.0.tgz#d240e8009df7fa87306ec4578a69ba3b5c424fee"
|
||||
dependencies:
|
||||
https-proxy-agent "^1.0.0"
|
||||
|
||||
sax@0.6.x:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/sax/-/sax-0.6.1.tgz#563b19c7c1de892e09bfc4f2fc30e3c27f0952b9"
|
||||
|
||||
sax@>=0.6.0:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
|
||||
|
||||
selenium-webdriver@3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-3.0.1.tgz#a2dea5da4a97f6672e89e7ca7276cefa365147a7"
|
||||
dependencies:
|
||||
adm-zip "^0.4.7"
|
||||
rimraf "^2.5.4"
|
||||
tmp "0.0.30"
|
||||
xml2js "^0.4.17"
|
||||
|
||||
selenium-webdriver@^2.53.2:
|
||||
version "2.53.3"
|
||||
resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-2.53.3.tgz#d29ff5a957dff1a1b49dc457756e4e4bfbdce085"
|
||||
dependencies:
|
||||
adm-zip "0.4.4"
|
||||
rimraf "^2.2.8"
|
||||
tmp "0.0.24"
|
||||
ws "^1.0.1"
|
||||
xml2js "0.4.4"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477"
|
||||
|
||||
semver@~5.0.1:
|
||||
version "5.0.3"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a"
|
||||
|
||||
source-map-support@^0.5.0:
|
||||
version "0.5.9"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f"
|
||||
dependencies:
|
||||
buffer-from "^1.0.0"
|
||||
source-map "^0.6.0"
|
||||
|
||||
source-map-support@~0.4.0:
|
||||
version "0.4.18"
|
||||
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
|
||||
dependencies:
|
||||
source-map "^0.5.6"
|
||||
|
||||
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:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||
|
||||
sshpk@^1.7.0:
|
||||
version "1.14.2"
|
||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98"
|
||||
dependencies:
|
||||
asn1 "~0.2.3"
|
||||
assert-plus "^1.0.0"
|
||||
dashdash "^1.12.0"
|
||||
getpass "^0.1.1"
|
||||
safer-buffer "^2.0.2"
|
||||
optionalDependencies:
|
||||
bcrypt-pbkdf "^1.0.0"
|
||||
ecc-jsbn "~0.1.1"
|
||||
jsbn "~0.1.0"
|
||||
tweetnacl "~0.14.0"
|
||||
|
||||
string-width@^1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
|
||||
dependencies:
|
||||
code-point-at "^1.0.0"
|
||||
is-fullwidth-code-point "^1.0.0"
|
||||
strip-ansi "^3.0.0"
|
||||
|
||||
strip-ansi@^3.0.0, strip-ansi@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
|
||||
dependencies:
|
||||
ansi-regex "^2.0.0"
|
||||
|
||||
supports-color@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||
|
||||
tmp@0.0.24:
|
||||
version "0.0.24"
|
||||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.24.tgz#d6a5e198d14a9835cc6f2d7c3d9e302428c8cf12"
|
||||
|
||||
tmp@0.0.30:
|
||||
version "0.0.30"
|
||||
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.30.tgz#72419d4a8be7d6ce75148fd8b324e593a711c2ed"
|
||||
dependencies:
|
||||
os-tmpdir "~1.0.1"
|
||||
|
||||
tough-cookie@~2.4.3:
|
||||
version "2.4.3"
|
||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
|
||||
dependencies:
|
||||
psl "^1.1.24"
|
||||
punycode "^1.4.1"
|
||||
|
||||
"tsickle@file:../../node_modules/tsickle":
|
||||
version "0.32.0"
|
||||
dependencies:
|
||||
jasmine-diff "^0.1.3"
|
||||
minimist "^1.2.0"
|
||||
mkdirp "^0.5.1"
|
||||
source-map "^0.6.0"
|
||||
source-map-support "^0.5.0"
|
||||
|
||||
tslib@^1.8.1, tslib@^1.9.0:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||
|
||||
"tslib@file:../../node_modules/tslib":
|
||||
version "1.9.3"
|
||||
|
||||
tsutils@2.20.0:
|
||||
version "2.20.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3"
|
||||
dependencies:
|
||||
tslib "^1.8.1"
|
||||
|
||||
tunnel-agent@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
|
||||
dependencies:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
|
||||
version "0.14.5"
|
||||
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
|
||||
|
||||
"typescript@file:../../node_modules/typescript":
|
||||
version "3.0.1"
|
||||
|
||||
ultron@1.0.x:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa"
|
||||
|
||||
uuid@^3.3.2:
|
||||
version "3.3.2"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
|
||||
|
||||
verror@1.10.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
core-util-is "1.0.2"
|
||||
extsprintf "^1.2.0"
|
||||
|
||||
webdriver-js-extender@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/webdriver-js-extender/-/webdriver-js-extender-1.0.0.tgz#81c533a9e33d5bfb597b4e63e2cdb25b54777515"
|
||||
dependencies:
|
||||
"@types/selenium-webdriver" "^2.53.35"
|
||||
selenium-webdriver "^2.53.2"
|
||||
|
||||
webdriver-manager@^12.0.6:
|
||||
version "12.1.0"
|
||||
resolved "https://registry.yarnpkg.com/webdriver-manager/-/webdriver-manager-12.1.0.tgz#f6601e52de5f0c97fc7024c889eeb2416f2f1d9d"
|
||||
dependencies:
|
||||
adm-zip "^0.4.9"
|
||||
chalk "^1.1.1"
|
||||
del "^2.2.0"
|
||||
glob "^7.0.3"
|
||||
ini "^1.3.4"
|
||||
minimist "^1.2.0"
|
||||
q "^1.4.1"
|
||||
request "^2.87.0"
|
||||
rimraf "^2.5.2"
|
||||
semver "^5.3.0"
|
||||
xml2js "^0.4.17"
|
||||
|
||||
window-size@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876"
|
||||
|
||||
wordwrap@~0.0.2:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
|
||||
|
||||
wrap-ansi@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
|
||||
dependencies:
|
||||
string-width "^1.0.1"
|
||||
strip-ansi "^3.0.1"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
||||
ws@^1.0.1:
|
||||
version "1.1.5"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-1.1.5.tgz#cbd9e6e75e09fc5d2c90015f21f0c40875e0dd51"
|
||||
dependencies:
|
||||
options ">=0.0.5"
|
||||
ultron "1.0.x"
|
||||
|
||||
xml2js@0.4.4:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.4.tgz#3111010003008ae19240eba17497b57c729c555d"
|
||||
dependencies:
|
||||
sax "0.6.x"
|
||||
xmlbuilder ">=1.0.0"
|
||||
|
||||
xml2js@^0.4.17:
|
||||
version "0.4.19"
|
||||
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7"
|
||||
dependencies:
|
||||
sax ">=0.6.0"
|
||||
xmlbuilder "~9.0.1"
|
||||
|
||||
xmlbuilder@>=1.0.0:
|
||||
version "10.0.0"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-10.0.0.tgz#c64e52f8ae097fe5fd46d1c38adaade071ee1b55"
|
||||
|
||||
xmlbuilder@~9.0.1:
|
||||
version "9.0.7"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
|
||||
|
||||
y18n@^3.2.0:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
|
||||
|
||||
yargs@^3.10.0:
|
||||
version "3.32.0"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"
|
||||
dependencies:
|
||||
camelcase "^2.0.1"
|
||||
cliui "^3.0.3"
|
||||
decamelize "^1.1.1"
|
||||
os-locale "^1.4.0"
|
||||
string-width "^1.0.1"
|
||||
window-size "^0.1.4"
|
||||
y18n "^3.2.0"
|
||||
|
||||
"zone.js@file:../../node_modules/zone.js":
|
||||
version "0.8.26"
|
||||
|
@ -112,7 +112,7 @@ module.exports = function(config) {
|
||||
// don't need this entire config file.
|
||||
proxies: {
|
||||
'/base/angular/': '/base/',
|
||||
'/base/angular_deps/': '/base/',
|
||||
'/base/ngdeps/': '/base/',
|
||||
},
|
||||
|
||||
reporters: ['dots'],
|
||||
|
@ -23,5 +23,6 @@ ts_library(
|
||||
deps = [
|
||||
"//modules/e2e_util:lib",
|
||||
"//packages:types",
|
||||
"@ngdeps//protractor",
|
||||
],
|
||||
)
|
||||
|
@ -52,6 +52,10 @@ protractor_web_test(
|
||||
data = [
|
||||
"//packages/bazel/src/protractor/utils",
|
||||
"//packages/benchpress",
|
||||
"@ngdeps//node-uuid",
|
||||
"@ngdeps//protractor",
|
||||
"@ngdeps//reflect-metadata",
|
||||
"@ngdeps//yargs",
|
||||
],
|
||||
on_prepare = ":protractor.on-prepare.js",
|
||||
server = ":devserver",
|
||||
|
@ -9,5 +9,10 @@ ts_library(
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/benchpress",
|
||||
"@ngdeps//@types/fs-extra",
|
||||
"@ngdeps//@types/selenium-webdriver",
|
||||
"@ngdeps//fs-extra",
|
||||
"@ngdeps//protractor",
|
||||
"@ngdeps//selenium-webdriver",
|
||||
],
|
||||
)
|
||||
|
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "angular-srcs",
|
||||
"version": "7.0.0",
|
||||
"version": "7.0.1",
|
||||
"private": true,
|
||||
"branchPattern": "2.0.*",
|
||||
"description": "Angular - a web framework for modern web apps",
|
||||
@ -25,7 +25,11 @@
|
||||
"postinstall": "yarn update-webdriver && node ./tools/postinstall-patches.js",
|
||||
"update-webdriver": "webdriver-manager update --gecko false $CHROMEDRIVER_VERSION_ARG",
|
||||
"check-env": "gulp check-env",
|
||||
"commitmsg": "node ./scripts/git/commit-msg.js"
|
||||
"commitmsg": "node ./scripts/git/commit-msg.js",
|
||||
"test-ivy-jit": "bazel test --define=compile=jit --build_tag_filters=ivy-jit --test_tag_filters=ivy-jit",
|
||||
"test-fixme-ivy-jit": "bazel test --define=compile=jit --build_tag_filters=-no-ivy --test_tag_filters=-no-ivy",
|
||||
"test-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=ivy-aot --test_tag_filters=ivy-aot",
|
||||
"test-fixme-ivy-aot": "bazel test --define=compile=aot --build_tag_filters=-no-ivy --test_tag_filters=-no-ivy"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular-devkit/schematics": "^0.5.5",
|
||||
@ -41,9 +45,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bazel/ibazel": "^0.1.1",
|
||||
"@bazel/karma": "0.20.3",
|
||||
"@bazel/typescript": "0.20.3",
|
||||
"@types/angular": "^1.6.47",
|
||||
"@types/base64-js": "1.2.5",
|
||||
"@types/chai": "^4.1.2",
|
||||
"@types/chokidar": "1.7.3",
|
||||
"@types/convert-source-map": "^1.5.1",
|
||||
"@types/diff": "^3.2.2",
|
||||
@ -110,7 +115,6 @@
|
||||
"mock-fs": "^4.5.0",
|
||||
"mutation-observer": "^1.0.3",
|
||||
"node-uuid": "1.4.8",
|
||||
"protobufjs": "5.0.0",
|
||||
"protractor": "5.1.2",
|
||||
"rewire": "2.5.2",
|
||||
"rollup": "0.47.4",
|
||||
@ -123,10 +127,10 @@
|
||||
"source-map": "^0.6.1",
|
||||
"source-map-support": "0.4.18",
|
||||
"systemjs": "0.18.10",
|
||||
"tsickle": "0.32",
|
||||
"tsickle": "0.32.1",
|
||||
"tslint": "5.7.0",
|
||||
"tslint-eslint-rules": "4.1.1",
|
||||
"tsutils": "2.20.0",
|
||||
"tsutils": "2.27.2",
|
||||
"typescript": "~3.1.1",
|
||||
"uglify-es": "^3.3.9",
|
||||
"universal-analytics": "0.4.15",
|
||||
|
@ -11,6 +11,10 @@ load("//tools:defaults.bzl", "ts_library")
|
||||
ts_library(
|
||||
name = "types",
|
||||
srcs = glob(["*.ts"]),
|
||||
deps = [
|
||||
"@ngdeps//@types/hammerjs",
|
||||
"@ngdeps//zone.js",
|
||||
],
|
||||
)
|
||||
|
||||
exports_files([
|
||||
|
@ -25,8 +25,6 @@ ng_package(
|
||||
],
|
||||
entry_point = "packages/animations/index.js",
|
||||
tags = [
|
||||
"ivy-jit",
|
||||
"ivy-local",
|
||||
"release-with-framework",
|
||||
],
|
||||
deps = [
|
||||
|
@ -15,14 +15,14 @@ import {AnimationStateStyles, AnimationTransitionFactory} from './animation_tran
|
||||
|
||||
|
||||
/**
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function buildTrigger(name: string, ast: TriggerAst): AnimationTrigger {
|
||||
return new AnimationTrigger(name, ast);
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export class AnimationTrigger {
|
||||
public transitionFactories: AnimationTransitionFactory[] = [];
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class AnimationStyleNormalizer {
|
||||
abstract normalizePropertyName(propertyName: string, errors: string[]): string;
|
||||
@ -17,7 +17,7 @@ export abstract class AnimationStyleNormalizer {
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export class NoopAnimationStyleNormalizer {
|
||||
normalizePropertyName(propertyName: string, errors: string[]): string { return propertyName; }
|
||||
|
@ -11,7 +11,7 @@ import {Injectable} from '@angular/core';
|
||||
import {containsElement, invokeQuery, matchesElement, validateStyleProperty} from './shared';
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
@Injectable()
|
||||
export class NoopAnimationDriver implements AnimationDriver {
|
||||
@ -40,7 +40,7 @@ export class NoopAnimationDriver implements AnimationDriver {
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class AnimationDriver {
|
||||
static NOOP: AnimationDriver = new NoopAnimationDriver();
|
||||
|
@ -1,8 +1,8 @@
|
||||
load("//tools:defaults.bzl", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
|
||||
|
||||
ts_library(
|
||||
name = "test",
|
||||
testonly = 1,
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
@ -13,3 +13,19 @@ ts_library(
|
||||
"//packages/core/testing",
|
||||
],
|
||||
)
|
||||
|
||||
jasmine_node_test(
|
||||
name = "test",
|
||||
bootstrap = ["angular/tools/testing/init_node_spec.js"],
|
||||
deps = [
|
||||
":test_lib",
|
||||
"//tools/testing:node",
|
||||
],
|
||||
)
|
||||
|
||||
ts_web_test_suite(
|
||||
name = "test_web",
|
||||
deps = [
|
||||
":test_lib",
|
||||
],
|
||||
)
|
||||
|
@ -10,7 +10,7 @@ import {ɵAnimationDriver as AnimationDriver, ɵallowPreviousPlayerStylesMerge a
|
||||
|
||||
|
||||
/**
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export class MockAnimationDriver implements AnimationDriver {
|
||||
static log: AnimationPlayer[] = [];
|
||||
@ -42,7 +42,7 @@ export class MockAnimationDriver implements AnimationDriver {
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export class MockAnimationPlayer extends NoopAnimationPlayer {
|
||||
private __finished = false;
|
||||
|
@ -52,10 +52,11 @@ import {AnimationPlayer} from './players/animation_player';
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class AnimationBuilder {
|
||||
/**
|
||||
* Builds a factory for producing a defined animation.
|
||||
* Builds a factory for producing a defined animation.
|
||||
* @param animation A reusable animation definition.
|
||||
* @returns A factory object that can create a player for the defined animation.
|
||||
* @see `animate()`
|
||||
@ -66,6 +67,7 @@ export abstract class AnimationBuilder {
|
||||
/**
|
||||
* A factory object returned from the `AnimationBuilder`.`build()` method.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export abstract class AnimationFactory {
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationEvent {
|
||||
/**
|
||||
|
@ -12,9 +12,11 @@
|
||||
export interface ɵStyleData { [key: string]: string|number; }
|
||||
|
||||
/**
|
||||
* Represents animation-step timing parameters for an animation step.
|
||||
* @see `animate()`
|
||||
*/
|
||||
* Represents animation-step timing parameters for an animation step.
|
||||
* @see `animate()`
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export declare type AnimateTimings = {
|
||||
/**
|
||||
* The full duration of an animation step. A number and optional time unit,
|
||||
@ -53,6 +55,8 @@ export declare type AnimateTimings = {
|
||||
*
|
||||
* Programmatic animations built using the `AnimationBuilder` service also
|
||||
* make use of `AnimationOptions`.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export declare interface AnimationOptions {
|
||||
/**
|
||||
@ -74,6 +78,8 @@ export declare interface AnimationOptions {
|
||||
* Adds duration options to control animation styling and timing for a child animation.
|
||||
*
|
||||
* @see `animateChild()`
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export declare interface AnimateChildOptions extends AnimationOptions { duration?: number|string; }
|
||||
|
||||
@ -82,6 +88,8 @@ export declare interface AnimateChildOptions extends AnimationOptions { duration
|
||||
*
|
||||
* A corresponding function defines a set of parameters for each category, and
|
||||
* collects them into a corresponding `AnimationMetadata` object.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const enum AnimationMetadataType {
|
||||
/**
|
||||
@ -153,17 +161,23 @@ export const enum AnimationMetadataType {
|
||||
|
||||
/**
|
||||
* Specifies automatic styling.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export const AUTO_STYLE = '*';
|
||||
|
||||
/**
|
||||
* Base for animation data structures.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationMetadata { type: AnimationMetadataType; }
|
||||
|
||||
/**
|
||||
* Contains an animation trigger. Instantiated and returned by the
|
||||
* `trigger()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationTriggerMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -185,6 +199,8 @@ export interface AnimationTriggerMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates an animation state by associating a state name with a set of CSS styles.
|
||||
* Instantiated and returned by the `state()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationStateMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -206,6 +222,8 @@ export interface AnimationStateMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates an animation transition. Instantiated and returned by the
|
||||
* `transition()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationTransitionMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -230,6 +248,8 @@ export interface AnimationTransitionMetadata extends AnimationMetadata {
|
||||
* Encapsulates a reusable animation, which is a collection of individual animation steps.
|
||||
* Instantiated and returned by the `animation()` function, and
|
||||
* passed to the `useAnimation()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationReferenceMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -247,6 +267,8 @@ export interface AnimationReferenceMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates an animation query. Instantiated and returned by
|
||||
* the `query()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationQueryMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -266,6 +288,8 @@ export interface AnimationQueryMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates a keyframes sequence. Instantiated and returned by
|
||||
* the `keyframes()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -277,6 +301,8 @@ export interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates an animation style. Instantiated and returned by
|
||||
* the `style()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationStyleMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -292,6 +318,8 @@ export interface AnimationStyleMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates an animation step. Instantiated and returned by
|
||||
* the `animate()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationAnimateMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -307,6 +335,8 @@ export interface AnimationAnimateMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates a child animation, that can be run explicitly when the parent is run.
|
||||
* Instantiated and returned by the `animateChild` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationAnimateChildMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -320,6 +350,8 @@ export interface AnimationAnimateChildMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates a reusable animation.
|
||||
* Instantiated and returned by the `useAnimation()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationAnimateRefMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -337,6 +369,8 @@ export interface AnimationAnimateRefMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates an animation sequence.
|
||||
* Instantiated and returned by the `sequence()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationSequenceMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -354,6 +388,8 @@ export interface AnimationSequenceMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates an animation group.
|
||||
* Instantiated and returned by the `{@link animations/group group()}` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationGroupMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -371,6 +407,8 @@ export interface AnimationGroupMetadata extends AnimationMetadata {
|
||||
/**
|
||||
* Encapsulates animation query options.
|
||||
* Passed to the `query()` function.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export declare interface AnimationQueryOptions extends AnimationOptions {
|
||||
/**
|
||||
@ -391,6 +429,8 @@ export declare interface AnimationQueryOptions extends AnimationOptions {
|
||||
/**
|
||||
* Encapsulates parameters for staggering the start times of a set of animation steps.
|
||||
* Instantiated and returned by the `stagger()` function.
|
||||
*
|
||||
* @publicApi
|
||||
**/
|
||||
export interface AnimationStaggerMetadata extends AnimationMetadata {
|
||||
/**
|
||||
@ -413,7 +453,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
|
||||
* and `transition()` declarations.
|
||||
*
|
||||
* @return An object that encapsulates the trigger data.
|
||||
*
|
||||
*
|
||||
* @usageNotes
|
||||
* Define an animation trigger in the `animations` section of `@Component` metadata.
|
||||
* In the template, reference the trigger by name and bind it to a trigger expression that
|
||||
@ -421,12 +461,12 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
|
||||
*
|
||||
* `[@triggerName]="expression"`
|
||||
*
|
||||
* Animation trigger bindings convert all values to strings, and then match the
|
||||
* Animation trigger bindings convert all values to strings, and then match the
|
||||
* previous and current values against any linked transitions.
|
||||
* Booleans can be specified as `1` or `true` and `0` or `false`.
|
||||
*
|
||||
* ### Usage Example
|
||||
*
|
||||
*
|
||||
* The following example creates an animation trigger reference based on the provided
|
||||
* name value.
|
||||
* The provided animation value is expected to be an array consisting of state and
|
||||
@ -487,7 +527,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
|
||||
* ```
|
||||
*
|
||||
* ### Disabling Animations
|
||||
* When true, the special animation control binding `@.disabled` binding prevents
|
||||
* When true, the special animation control binding `@.disabled` binding prevents
|
||||
* all animations from rendering.
|
||||
* Place the `@.disabled` binding on an element to disable
|
||||
* animations on the element itself, as well as any inner animation triggers
|
||||
@ -519,7 +559,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
|
||||
* along with any inner animations.
|
||||
*
|
||||
* ### Disable animations application-wide
|
||||
* When an area of the template is set to have animations disabled,
|
||||
* When an area of the template is set to have animations disabled,
|
||||
* **all** inner components have their animations disabled as well.
|
||||
* This means that you can disable all animations for an app
|
||||
* by placing a host binding set on `@.disabled` on the topmost Angular component.
|
||||
@ -539,8 +579,8 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
|
||||
*
|
||||
* ### Overriding disablement of inner animations
|
||||
* Despite inner animations being disabled, a parent animation can `query()`
|
||||
* for inner elements located in disabled areas of the template and still animate
|
||||
* them if needed. This is also the case for when a sub animation is
|
||||
* for inner elements located in disabled areas of the template and still animate
|
||||
* them if needed. This is also the case for when a sub animation is
|
||||
* queried by a parent and then later animated using `animateChild()`.
|
||||
*
|
||||
* ### Detecting when an animation is disabled
|
||||
@ -549,7 +589,7 @@ export interface AnimationStaggerMetadata extends AnimationMetadata {
|
||||
* an instance of an `AnimationEvent`. If animations are disabled,
|
||||
* the `.disabled` flag on the event is true.
|
||||
*
|
||||
* @experimental Animation support is experimental.
|
||||
* @publicApi
|
||||
*/
|
||||
export function trigger(name: string, definitions: AnimationMetadata[]): AnimationTriggerMetadata {
|
||||
return {type: AnimationMetadataType.Trigger, name, definitions, options: {}};
|
||||
@ -610,6 +650,8 @@ export function trigger(name: string, definitions: AnimationMetadata[]): Animati
|
||||
* style({ background: "red" }))
|
||||
* ])
|
||||
* ```
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function animate(
|
||||
timings: string | number, styles: AnimationStyleMetadata | AnimationKeyframesSequenceMetadata |
|
||||
@ -626,7 +668,7 @@ export function animate(
|
||||
* - To specify offset styles to be applied at a later time, define steps with
|
||||
* `keyframes()`, or use `animate()` calls with a delay value.
|
||||
* For example:
|
||||
*
|
||||
*
|
||||
* ```typescript
|
||||
* group([
|
||||
* animate("1s", { background: "black" }))
|
||||
@ -641,12 +683,14 @@ export function animate(
|
||||
* @return An object that encapsulates the group data.
|
||||
*
|
||||
* @usageNotes
|
||||
* Grouped animations are useful when a series of styles must be
|
||||
* Grouped animations are useful when a series of styles must be
|
||||
* animated at different starting times and closed off at different ending times.
|
||||
*
|
||||
* When called within a `sequence()` or a
|
||||
* `transition()` call, does not continue to the next
|
||||
* instruction until all of the inner animation steps have completed.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function group(
|
||||
steps: AnimationMetadata[], options: AnimationOptions | null = null): AnimationGroupMetadata {
|
||||
@ -683,6 +727,7 @@ export function group(
|
||||
* execution continues to the next instruction only after each of the inner animation
|
||||
* steps have completed.
|
||||
*
|
||||
* @publicApi
|
||||
**/
|
||||
export function sequence(steps: AnimationMetadata[], options: AnimationOptions | null = null):
|
||||
AnimationSequenceMetadata {
|
||||
@ -701,7 +746,7 @@ export function sequence(steps: AnimationMetadata[], options: AnimationOptions |
|
||||
* - An asterisk (*), to use auto-styling, where styles are derived from the element
|
||||
* being animated and applied to the animation when it starts.
|
||||
*
|
||||
* Auto-styling can be used to define a state that depends on layout or other
|
||||
* Auto-styling can be used to define a state that depends on layout or other
|
||||
* environmental factors.
|
||||
*
|
||||
* @return An object that encapsulates the style data.
|
||||
@ -709,7 +754,7 @@ export function sequence(steps: AnimationMetadata[], options: AnimationOptions |
|
||||
* @usageNotes
|
||||
* The following examples create animation styles that collect a set of
|
||||
* CSS property values:
|
||||
*
|
||||
*
|
||||
* ```typescript
|
||||
* // string values for CSS properties
|
||||
* style({ background: "red", color: "blue" })
|
||||
@ -726,6 +771,7 @@ export function sequence(steps: AnimationMetadata[], options: AnimationOptions |
|
||||
* animate("1s", style({ height: "*" }))
|
||||
* ```
|
||||
*
|
||||
* @publicApi
|
||||
**/
|
||||
export function style(
|
||||
tokens: '*' | {[key: string]: string | number} |
|
||||
@ -759,6 +805,8 @@ export function style(
|
||||
* Use the `transition()` function to animate between states.
|
||||
* When a state is active within a component, its associated styles persist on the element,
|
||||
* even when the animation ends.
|
||||
*
|
||||
* @publicApi
|
||||
**/
|
||||
export function state(
|
||||
name: string, styles: AnimationStyleMetadata,
|
||||
@ -808,6 +856,8 @@ export function state(
|
||||
* style({ backgroundColor: "black" }) // offset = 1
|
||||
* ]))
|
||||
*```
|
||||
|
||||
* @publicApi
|
||||
*/
|
||||
export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSequenceMetadata {
|
||||
return {type: AnimationMetadataType.Keyframes, steps};
|
||||
@ -978,6 +1028,8 @@ export function keyframes(steps: AnimationStyleMetadata[]): AnimationKeyframesSe
|
||||
* transition('false <=> true', animate(500))
|
||||
* ])
|
||||
* ```
|
||||
*
|
||||
* @publicApi
|
||||
**/
|
||||
export function transition(
|
||||
stateChangeExpr: string | ((fromState: string, toState: string, element?: any,
|
||||
@ -1029,6 +1081,8 @@ export function transition(
|
||||
* If any of the passed-in parameter values are missing from this call,
|
||||
* the default values are used. If one or more parameter values are missing before a step is
|
||||
* animated, `useAnimation()` throws an error.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function animation(
|
||||
steps: AnimationMetadata | AnimationMetadata[],
|
||||
@ -1052,6 +1106,8 @@ export function animation(
|
||||
* Note that this feature designed to be used with `query()` and it will only work
|
||||
* with animations that are assigned using the Angular animation library. CSS keyframes
|
||||
* and transitions are not handled by this API.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function animateChild(options: AnimateChildOptions | null = null):
|
||||
AnimationAnimateChildMetadata {
|
||||
@ -1062,9 +1118,11 @@ export function animateChild(options: AnimateChildOptions | null = null):
|
||||
* Starts a reusable animation that is created using the `animation()` function.
|
||||
*
|
||||
* @param animation The reusable animation to start.
|
||||
* @param options An options object that can contain a delay value for the start of
|
||||
* @param options An options object that can contain a delay value for the start of
|
||||
* the animation, and additional override values for developer-defined parameters.
|
||||
* @return An object that contains the animation parameters.
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function useAnimation(
|
||||
animation: AnimationReferenceMetadata,
|
||||
@ -1121,7 +1179,7 @@ export function useAnimation(
|
||||
* ### Usage Example
|
||||
*
|
||||
* The following example queries for inner elements and animates them
|
||||
* individually using `animateChild()`.
|
||||
* individually using `animateChild()`.
|
||||
*
|
||||
* ```typescript
|
||||
* @Component({
|
||||
@ -1156,6 +1214,8 @@ export function useAnimation(
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function query(
|
||||
selector: string, animation: AnimationMetadata | AnimationMetadata[],
|
||||
@ -1240,6 +1300,8 @@ export function query(
|
||||
* ])
|
||||
* ])
|
||||
* ```
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export function stagger(
|
||||
timings: string | number,
|
||||
|
@ -14,8 +14,9 @@ import {scheduleMicroTask} from '../util';
|
||||
*
|
||||
* @see `AnimationBuilder`
|
||||
* @see `AnimationFactory`
|
||||
* @see `animate()`
|
||||
* @see `animate()`
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export interface AnimationPlayer {
|
||||
/**
|
||||
@ -112,6 +113,7 @@ export interface AnimationPlayer {
|
||||
* @see `AnimationPlayer`
|
||||
* @see `GroupPlayer`
|
||||
*
|
||||
* @publicApi
|
||||
*/
|
||||
export class NoopAnimationPlayer implements AnimationPlayer {
|
||||
private _onDoneFns: Function[] = [];
|
||||
|
@ -1,12 +1,28 @@
|
||||
load("//tools:defaults.bzl", "ts_library")
|
||||
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library", "ts_web_test_suite")
|
||||
|
||||
ts_library(
|
||||
name = "test",
|
||||
testonly = 1,
|
||||
srcs = glob(["test/**/*.ts"]),
|
||||
name = "test_lib",
|
||||
testonly = True,
|
||||
srcs = glob(["**/*.ts"]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/animations",
|
||||
"//packages/core/testing",
|
||||
],
|
||||
)
|
||||
|
||||
jasmine_node_test(
|
||||
name = "test",
|
||||
bootstrap = ["angular/tools/testing/init_node_spec.js"],
|
||||
deps = [
|
||||
":test_lib",
|
||||
"//tools/testing:node",
|
||||
],
|
||||
)
|
||||
|
||||
ts_web_test_suite(
|
||||
name = "test_web",
|
||||
deps = [
|
||||
":test_lib",
|
||||
],
|
||||
)
|
||||
|
@ -1,25 +1,20 @@
|
||||
load("//tools:defaults.bzl", "npm_package")
|
||||
|
||||
genrule(
|
||||
name = "workspace",
|
||||
outs = ["WORKSPACE"],
|
||||
cmd = "echo 'workspace(name=\"angular\")' > $@",
|
||||
)
|
||||
|
||||
npm_package(
|
||||
name = "npm_package",
|
||||
srcs = [
|
||||
"BUILD.bazel",
|
||||
"index.bzl",
|
||||
"check_version.js",
|
||||
"package.json",
|
||||
"protractor-utils.js",
|
||||
"//packages/bazel/src:package_assets",
|
||||
],
|
||||
packages = ["//packages/bazel/docs"],
|
||||
# Re-host //packages/bazel/ which is just // in the public distro
|
||||
replacements = {
|
||||
"//packages/bazel/": "//",
|
||||
"angular/packages/bazel/": "angular/",
|
||||
},
|
||||
packages = [
|
||||
"//packages/bazel/docs",
|
||||
],
|
||||
tags = ["release-with-framework"],
|
||||
deps = [":workspace"],
|
||||
deps = [
|
||||
"//packages/bazel/src/ng_package:lib",
|
||||
"//packages/bazel/src/ngc-wrapped:ngc_lib",
|
||||
"//packages/bazel/src/protractor/utils",
|
||||
],
|
||||
)
|
||||
|
74
packages/bazel/check_version.js
Normal file
74
packages/bazel/check_version.js
Normal file
@ -0,0 +1,74 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
/**
|
||||
* @fileoverview This script runs as a postinstall in the published npm packages
|
||||
* and checks that the version of the build_bazel_rules_typescript external
|
||||
* repository matches that of the published npm package.
|
||||
*
|
||||
* Note, this check is only performed with bazel managed deps when the yarn or
|
||||
* npm install is from a yarn_install or npm_install repository rule. For self
|
||||
* managed bazel deps this check is not performed and it is the responsibility
|
||||
* of the user to ensure that the versions match.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
// Version in package.bzl should match the npm package version
|
||||
// but this should be tolerant of development stamped versions such as
|
||||
// "0.17.0-7-g76dc057"
|
||||
const npmPackageVersion = process.env.npm_package_version.split('-')[0];
|
||||
|
||||
// If this is a bazel managed deps yarn_install or npm_install then the
|
||||
// cwd is $(bazel info
|
||||
// output_base)/external/<wksp>/node_modules/@angular/bazel and there should
|
||||
// be $(bazel info output_base)/external/<wksp>/internal/generate_build_file.js
|
||||
// folder
|
||||
function isBazelManagedDeps() {
|
||||
try {
|
||||
fs.statSync('../../../generate_build_file.js');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isBazelManagedDeps()) {
|
||||
let contents;
|
||||
try {
|
||||
// If this is a yarn_install or npm_install then the cwd is $(bazel info
|
||||
// output_base)/external/<wksp>/node_modules/@angular/bazel so we can look for
|
||||
// the package.json file under $(bazel info
|
||||
// output_base)/external/angular/package.json
|
||||
const packagePath = path.resolve(process.cwd(), '../../../../angular/package.json');
|
||||
contents = require(packagePath);
|
||||
} catch (e) {
|
||||
throw new Error('The angular repository is not installed in your Bazel WORKSPACE file');
|
||||
}
|
||||
if (contents.name !== 'angular-srcs') {
|
||||
throw new Error('Invalid package.json in angular repository');
|
||||
}
|
||||
// Be tolerant of versions such as "0.17.0-7-g76dc057"
|
||||
const angularPackageVersion = contents.version.split('-')[0];
|
||||
if (npmPackageVersion !== angularPackageVersion) {
|
||||
// TODO: we might need to support a range here.
|
||||
// For example, if you end up with @angular/bazel@6.1.8 and
|
||||
// @angular/bazel@6.1.9 both installed one of the postinstalls is
|
||||
// guaranteed to fail since there's only one version of
|
||||
// angular
|
||||
throw new Error(`Expected angular repository to be version ${
|
||||
npmPackageVersion} but found ${angularPackageVersion}`);
|
||||
}
|
||||
} else {
|
||||
// No version check
|
||||
console.warn(`WARNING: With self managed deps you must ensure the @angular/bazel
|
||||
npm package version matches the angular repository version.
|
||||
Use yarn_install or npm_install for this version to be checked automatically.
|
||||
`);
|
||||
}
|
115
packages/bazel/package.bzl
Normal file
115
packages/bazel/package.bzl
Normal file
@ -0,0 +1,115 @@
|
||||
# Copyright Google Inc. All Rights Reserved.
|
||||
#
|
||||
# Use of this source code is governed by an MIT-style license that can be
|
||||
# found in the LICENSE file at https://angular.io/license
|
||||
|
||||
"""Package file which defines dependencies of Angular rules in skylark
|
||||
"""
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
load(":rules_nodejs_package.bzl", "rules_nodejs_dependencies")
|
||||
load(":rules_typescript_package.bzl", "rules_typescript_dependencies")
|
||||
|
||||
def rules_angular_dependencies():
|
||||
"""
|
||||
Fetch our transitive dependencies.
|
||||
|
||||
If the user wants to get a different version of these, they can just fetch it
|
||||
from their WORKSPACE before calling this function, or not call this function at all.
|
||||
"""
|
||||
|
||||
#
|
||||
# Download Bazel toolchain dependencies as needed by build actions
|
||||
#
|
||||
# TODO(gmagolan): updated to next tagged rules_typescript release
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "build_bazel_rules_typescript",
|
||||
url = "https://github.com/bazelbuild/rules_typescript/archive/8ea1a55cf5cf8be84ddfeefc0940769b80da792f.zip",
|
||||
strip_prefix = "rules_typescript-8ea1a55cf5cf8be84ddfeefc0940769b80da792f",
|
||||
)
|
||||
|
||||
# Needed for Remote Execution
|
||||
_maybe(
|
||||
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",
|
||||
],
|
||||
)
|
||||
|
||||
rules_typescript_dependencies()
|
||||
rules_nodejs_dependencies()
|
||||
|
||||
def rules_angular_dev_dependencies():
|
||||
"""
|
||||
Fetch dependencies needed for local development, but not needed by users.
|
||||
|
||||
These are in this file to keep version information in one place, and make the WORKSPACE
|
||||
shorter.
|
||||
"""
|
||||
|
||||
# We have a source dependency on the Devkit repository, because it's built with
|
||||
# Bazel.
|
||||
# This allows us to edit sources and have the effect appear immediately without
|
||||
# re-packaging or "npm link"ing.
|
||||
# Even better, things like aspects will visit the entire graph including
|
||||
# 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",
|
||||
)
|
||||
|
||||
http_archive(
|
||||
name = "org_brotli",
|
||||
sha256 = "774b893a0700b0692a76e2e5b7e7610dbbe330ffbe3fe864b4b52ca718061d5a",
|
||||
strip_prefix = "brotli-1.0.5",
|
||||
url = "https://github.com/google/brotli/archive/v1.0.5.zip",
|
||||
)
|
||||
|
||||
# Fetching the Bazel source code allows us to compile the Skylark linter
|
||||
http_archive(
|
||||
name = "io_bazel",
|
||||
sha256 = "978f7e0440dd82182563877e2e0b7c013b26b3368888b57837e9a0ae206fd396",
|
||||
strip_prefix = "bazel-0.18.0",
|
||||
url = "https://github.com/bazelbuild/bazel/archive/0.18.0.zip",
|
||||
)
|
||||
|
||||
# This commit matches the version of buildifier in angular/ngcontainer
|
||||
# If you change this, also check if it matches the version in the angular/ngcontainer
|
||||
# version in /.circleci/config.yml
|
||||
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,
|
||||
)
|
||||
|
||||
#############################################
|
||||
# Dependencies for generating documentation #
|
||||
#############################################
|
||||
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",
|
||||
)
|
||||
|
||||
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",
|
||||
)
|
||||
|
||||
def _maybe(repo_rule, name, **kwargs):
|
||||
if name not in native.existing_rules():
|
||||
repo_rule(name = name, **kwargs)
|
@ -4,10 +4,18 @@
|
||||
"description": "Angular - bazel build rules",
|
||||
"author": "angular",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"ngc-wrapped": "./src/ngc-wrapped/index.js",
|
||||
"packager": "./src/ng_package/packager.js",
|
||||
"xi18n": "./src/ngc-wrapped/extract_i18n.js",
|
||||
"modify_tsconfig": "./src/modify_tsconfig.js"
|
||||
},
|
||||
"typings": "./src/ngc-wrapped/index.d.ts",
|
||||
"dependencies": {
|
||||
"@bazel/typescript": "^0.15.0",
|
||||
"@bazel/typescript": "^0.20.3",
|
||||
"@types/node": "6.0.84",
|
||||
"protobufjs": "5.0.0"
|
||||
"shelljs": "0.8.2",
|
||||
"tsickle": "0.32.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
|
||||
@ -19,5 +27,8 @@
|
||||
},
|
||||
"ng-update": {
|
||||
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./check_version.js"
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,4 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
System.import('index').catch(console.error.bind(console));
|
||||
module.exports = require('./src/protractor/utils');
|
56
packages/bazel/rules_nodejs_package.bzl
Normal file
56
packages/bazel/rules_nodejs_package.bzl
Normal file
@ -0,0 +1,56 @@
|
||||
# Copyright 2018 The Bazel Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Dependency-related rules defining our version and dependency versions.
|
||||
|
||||
Fulfills similar role as the package.json file.
|
||||
"""
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
|
||||
# This file mirrored from https://raw.githubusercontent.com/bazelbuild/rules_nodejs/0.15.3/package.bzl
|
||||
VERSION = "0.15.3"
|
||||
|
||||
def rules_nodejs_dependencies():
|
||||
"""
|
||||
Fetch our transitive dependencies.
|
||||
|
||||
If the user wants to get a different version of these, they can just fetch it
|
||||
from their WORKSPACE before calling this function, or not call this function at all.
|
||||
"""
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "bazel_skylib",
|
||||
url = "https://github.com/bazelbuild/bazel-skylib/archive/0.3.1.zip",
|
||||
strip_prefix = "bazel-skylib-0.3.1",
|
||||
sha256 = "95518adafc9a2b656667bbf517a952e54ce7f350779d0dd95133db4eb5c27fb1",
|
||||
)
|
||||
|
||||
# Needed for Remote Build Execution
|
||||
# See https://releases.bazel.build/bazel-toolchains.html
|
||||
# Not strictly a dependency for all users, but it is convenient for them to have this repository
|
||||
# defined to reduce the effort required to on-board to remote execution.
|
||||
http_archive(
|
||||
name = "bazel_toolchains",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/cdea5b8675914d0a354d89f108de5d28e54e0edc.tar.gz",
|
||||
"https://github.com/bazelbuild/bazel-toolchains/archive/cdea5b8675914d0a354d89f108de5d28e54e0edc.tar.gz",
|
||||
],
|
||||
strip_prefix = "bazel-toolchains-cdea5b8675914d0a354d89f108de5d28e54e0edc",
|
||||
sha256 = "cefb6ccf86ca592baaa029bcef04148593c0efe8f734542f10293ea58f170715",
|
||||
)
|
||||
|
||||
def _maybe(repo_rule, name, **kwargs):
|
||||
if name not in native.existing_rules():
|
||||
repo_rule(name = name, **kwargs)
|
94
packages/bazel/rules_typescript_package.bzl
Normal file
94
packages/bazel/rules_typescript_package.bzl
Normal file
@ -0,0 +1,94 @@
|
||||
# Copyright 2018 The Bazel Authors. All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Package file which defines build_bazel_rules_typescript version in skylark
|
||||
|
||||
check_rules_typescript_version can be used in downstream WORKSPACES to check
|
||||
against a minimum dependent build_bazel_rules_typescript version.
|
||||
"""
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
|
||||
# This file mirrored from https://raw.githubusercontent.com/bazelbuild/rules_typescript/0.20.3/package.bzl
|
||||
VERSION = "0.20.3"
|
||||
|
||||
def rules_typescript_dependencies():
|
||||
"""
|
||||
Fetch our transitive dependencies.
|
||||
|
||||
If the user wants to get a different version of these, they can just fetch it
|
||||
from their WORKSPACE before calling this function, or not call this function at all.
|
||||
"""
|
||||
|
||||
# TypeScript compiler runs on node.js runtime
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "build_bazel_rules_nodejs",
|
||||
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.15.3.zip"],
|
||||
strip_prefix = "rules_nodejs-0.15.3",
|
||||
)
|
||||
|
||||
# ts_web_test depends on the web testing rules to provision browsers.
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "io_bazel_rules_webtesting",
|
||||
urls = ["https://github.com/bazelbuild/rules_webtesting/archive/111d792b9a5b17f87b6e177e274dbbee46094791.zip"],
|
||||
strip_prefix = "rules_webtesting-111d792b9a5b17f87b6e177e274dbbee46094791",
|
||||
sha256 = "a13af63e928c34eff428d47d31bafeec4e38ee9b6940e70bf2c9cd47184c5c16",
|
||||
)
|
||||
|
||||
# ts_devserver depends on the Go rules.
|
||||
# See https://github.com/bazelbuild/rules_go#setup for the latest version.
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "io_bazel_rules_go",
|
||||
urls = ["https://github.com/bazelbuild/rules_go/archive/cbc1e32fba771845305f15e341fa26595d4a136d.zip"],
|
||||
strip_prefix = "rules_go-cbc1e32fba771845305f15e341fa26595d4a136d",
|
||||
sha256 = "d02b1d8d11fb67fb1e451645256e58a1542170eedd6e2ba160c8540c96f659da",
|
||||
)
|
||||
|
||||
# go_repository is defined in bazel_gazelle
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "bazel_gazelle",
|
||||
urls = ["https://github.com/bazelbuild/bazel-gazelle/archive/109bcfd6880aac2517a1a2d48987226da6337e11.zip"],
|
||||
strip_prefix = "bazel-gazelle-109bcfd6880aac2517a1a2d48987226da6337e11",
|
||||
sha256 = "8f80ce0f7a6f8a3fee1fb863c9a23e1de99d678c1cf3c6f0a128f3b883168208",
|
||||
)
|
||||
|
||||
# ts_auto_deps depends on com_github_bazelbuild_buildtools
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "com_github_bazelbuild_buildtools",
|
||||
url = "https://github.com/bazelbuild/buildtools/archive/0.12.0.zip",
|
||||
strip_prefix = "buildtools-0.12.0",
|
||||
sha256 = "ec495cbd19238c9dc488fd65ca1fee56dcb1a8d6d56ee69a49f2ebe69826c261",
|
||||
)
|
||||
|
||||
###############################################
|
||||
# Repeat the dependencies of rules_nodejs here!
|
||||
# We can't load() from rules_nodejs yet, because we've only just fetched it.
|
||||
# But we also don't want to make users load and call the rules_nodejs_dependencies
|
||||
# function because we can do that for them, mostly hiding the transitive dependency.
|
||||
_maybe(
|
||||
http_archive,
|
||||
name = "bazel_skylib",
|
||||
url = "https://github.com/bazelbuild/bazel-skylib/archive/0.5.0.zip",
|
||||
strip_prefix = "bazel-skylib-0.5.0",
|
||||
sha256 = "ca4e3b8e4da9266c3a9101c8f4704fe2e20eb5625b2a6a7d2d7d45e3dd4efffd",
|
||||
)
|
||||
|
||||
def _maybe(repo_rule, name, **kwargs):
|
||||
if name not in native.existing_rules():
|
||||
repo_rule(name = name, **kwargs)
|
@ -2,14 +2,13 @@ package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]) + [
|
||||
"//packages/bazel/src/ng_package:package_assets",
|
||||
"//packages/bazel/src/ngc-wrapped:package_assets",
|
||||
"//packages/bazel/src/protractor:package_assets",
|
||||
],
|
||||
srcs = ["modify_tsconfig.js"],
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
# For generating skydoc
|
||||
exports_files(glob(["*.bzl"]))
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
|
||||
nodejs_binary(
|
||||
|
@ -80,12 +80,20 @@ def _esm5_outputs_aspect(target, ctx):
|
||||
],
|
||||
)
|
||||
|
||||
replay_compiler = target.typescript.replay_params.compiler.path.split("/")[-1]
|
||||
if replay_compiler == "tsc_wrapped":
|
||||
compiler = ctx.executable._tsc_wrapped
|
||||
elif replay_compiler == "ngc-wrapped":
|
||||
compiler = ctx.executable._ngc_wrapped
|
||||
else:
|
||||
fail("Unknown replay compiler", target.typescript.replay_params.compiler.path)
|
||||
|
||||
ctx.actions.run(
|
||||
progress_message = "Compiling TypeScript (ES5 with ES Modules) %s" % target.label,
|
||||
inputs = target.typescript.replay_params.inputs + [tsconfig],
|
||||
outputs = outputs,
|
||||
arguments = [tsconfig.path],
|
||||
executable = target.typescript.replay_params.compiler,
|
||||
executable = compiler,
|
||||
execution_requirements = {
|
||||
# TODO(alexeagle): enable worker mode for these compilations
|
||||
"supports-workers": "0",
|
||||
@ -122,15 +130,11 @@ esm5_outputs_aspect = aspect(
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
# We must list tsc_wrapped here to ensure it's built before the action runs
|
||||
# For some reason, having the compiler output as an input to the action above
|
||||
# is not sufficient.
|
||||
"_tsc_wrapped": attr.label(
|
||||
default = Label("@build_bazel_rules_typescript//internal:tsc_wrapped_bin"),
|
||||
default = Label("@build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped"),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
# Same comment as for tsc_wrapped above.
|
||||
"_ngc_wrapped": attr.label(
|
||||
default = Label("//packages/bazel/src/ngc-wrapped"),
|
||||
executable = True,
|
||||
|
@ -13,10 +13,20 @@ load(
|
||||
_compile_ts = "compile_ts",
|
||||
_ts_providers_dict_to_struct = "ts_providers_dict_to_struct",
|
||||
)
|
||||
load(
|
||||
"@build_bazel_rules_nodejs//internal/common:node_module_info.bzl",
|
||||
_NodeModuleInfo = "NodeModuleInfo",
|
||||
_collect_node_modules_aspect = "collect_node_modules_aspect",
|
||||
)
|
||||
|
||||
NodeModuleInfo = _NodeModuleInfo
|
||||
collect_node_modules_aspect = _collect_node_modules_aspect
|
||||
tsc_wrapped_tsconfig = _tsc_wrapped_tsconfig
|
||||
COMMON_ATTRIBUTES = _COMMON_ATTRIBUTES
|
||||
COMMON_OUTPUTS = _COMMON_OUTPUTS
|
||||
compile_ts = _compile_ts
|
||||
DEPS_ASPECTS = _DEPS_ASPECTS
|
||||
ts_providers_dict_to_struct = _ts_providers_dict_to_struct
|
||||
|
||||
DEFAULT_NG_COMPILER = "@angular//:@angular/bazel/ngc-wrapped"
|
||||
DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n"
|
@ -6,10 +6,14 @@
|
||||
"""
|
||||
|
||||
load(
|
||||
":rules_typescript.bzl",
|
||||
":external.bzl",
|
||||
"COMMON_ATTRIBUTES",
|
||||
"COMMON_OUTPUTS",
|
||||
"DEFAULT_NG_COMPILER",
|
||||
"DEFAULT_NG_XI18N",
|
||||
"DEPS_ASPECTS",
|
||||
"NodeModuleInfo",
|
||||
"collect_node_modules_aspect",
|
||||
"compile_ts",
|
||||
"ts_providers_dict_to_struct",
|
||||
"tsc_wrapped_tsconfig",
|
||||
@ -26,14 +30,14 @@ def compile_strategy(ctx):
|
||||
ctx: skylark rule execution context
|
||||
|
||||
Returns:
|
||||
one of 'legacy', 'local', 'jit', or 'global' depending on the configuration in ctx
|
||||
one of 'legacy', 'aot', 'jit', or 'global' depending on the configuration in ctx
|
||||
"""
|
||||
|
||||
strategy = "legacy"
|
||||
if "compile" in ctx.var:
|
||||
strategy = ctx.var["compile"]
|
||||
|
||||
if strategy not in ["legacy", "local", "jit"]:
|
||||
if strategy not in ["legacy", "aot", "jit"]:
|
||||
fail("Unknown --define=compile value '%s'" % strategy)
|
||||
|
||||
if strategy == "legacy" and hasattr(ctx.attr, "_global_mode") and ctx.attr._global_mode:
|
||||
@ -56,7 +60,7 @@ def _compiler_name(ctx):
|
||||
return "ngc"
|
||||
elif strategy == "global":
|
||||
return "ngc.ivy"
|
||||
elif strategy == "local":
|
||||
elif strategy == "aot":
|
||||
return "ngtsc"
|
||||
elif strategy == "jit":
|
||||
return "tsc"
|
||||
@ -78,7 +82,7 @@ def _enable_ivy_value(ctx):
|
||||
return False
|
||||
elif strategy == "global":
|
||||
return True
|
||||
elif strategy == "local":
|
||||
elif strategy == "aot":
|
||||
return "ngtsc"
|
||||
elif strategy == "jit":
|
||||
return "tsc"
|
||||
@ -357,7 +361,7 @@ def ngc_compile_action(
|
||||
ctx.actions.run(
|
||||
inputs = list(inputs),
|
||||
outputs = messages_out,
|
||||
executable = ctx.executable._ng_xi18n,
|
||||
executable = ctx.executable.ng_xi18n,
|
||||
arguments = (_EXTRA_NODE_OPTIONS_FLAGS +
|
||||
[tsconfig_file.path] +
|
||||
# The base path is bin_dir because of the way the ngc
|
||||
@ -379,23 +383,32 @@ def ngc_compile_action(
|
||||
|
||||
return None
|
||||
|
||||
def _filter_ts_inputs(all_inputs):
|
||||
# The compiler only needs to see TypeScript sources from the npm dependencies,
|
||||
# but may need to look at package.json and ngsummary.json files as well.
|
||||
return [
|
||||
f
|
||||
for f in all_inputs
|
||||
if f.path.endswith(".js") or f.path.endswith(".ts") or f.path.endswith(".json")
|
||||
]
|
||||
|
||||
def _compile_action(ctx, inputs, outputs, messages_out, tsconfig_file, node_opts):
|
||||
# Give the Angular compiler all the user-listed assets
|
||||
file_inputs = list(ctx.files.assets)
|
||||
|
||||
# The compiler only needs to see TypeScript sources from the npm dependencies,
|
||||
# but may need to look at package.json and ngsummary.json files as well.
|
||||
if hasattr(ctx.attr, "node_modules"):
|
||||
file_inputs += [
|
||||
f
|
||||
for f in ctx.files.node_modules
|
||||
if f.path.endswith(".ts") or f.path.endswith(".json")
|
||||
]
|
||||
file_inputs.extend(_filter_ts_inputs(ctx.files.node_modules))
|
||||
|
||||
# If the user supplies a tsconfig.json file, the Angular compiler needs to read it
|
||||
if hasattr(ctx.attr, "tsconfig") and ctx.file.tsconfig:
|
||||
file_inputs.append(ctx.file.tsconfig)
|
||||
|
||||
# Also include files from npm fine grained deps as action_inputs.
|
||||
# These deps are identified by the NodeModuleInfo provider.
|
||||
for d in ctx.attr.deps:
|
||||
if NodeModuleInfo in d:
|
||||
file_inputs.extend(_filter_ts_inputs(d.files))
|
||||
|
||||
# Collect the inputs and summary files from our deps
|
||||
action_inputs = depset(
|
||||
file_inputs,
|
||||
@ -443,6 +456,13 @@ def ng_module_impl(ctx, ts_compile_actions):
|
||||
providers = ts_compile_actions(
|
||||
ctx,
|
||||
is_library = True,
|
||||
# Filter out the node_modules from deps passed to TypeScript compiler
|
||||
# since they don't have the required providers.
|
||||
# They were added to the action inputs for tsc_wrapped already.
|
||||
# strict_deps checking currently skips node_modules.
|
||||
# TODO(alexeagle): turn on strict deps checking when we have a real
|
||||
# provider for JS/DTS inputs to ts_library.
|
||||
deps = [d for d in ctx.attr.deps if not NodeModuleInfo in d],
|
||||
compile_action = _prodmode_compile_action,
|
||||
devmode_compile_action = _devmode_compile_action,
|
||||
tsc_wrapped_tsconfig = _ngc_tsconfig,
|
||||
@ -474,6 +494,11 @@ def ng_module_impl(ctx, ts_compile_actions):
|
||||
def _ng_module_impl(ctx):
|
||||
return ts_providers_dict_to_struct(ng_module_impl(ctx, compile_ts))
|
||||
|
||||
local_deps_aspects = [collect_node_modules_aspect, _collect_summaries_aspect]
|
||||
|
||||
# Workaround skydoc bug which assumes DEPS_ASPECTS is a str type
|
||||
[local_deps_aspects.append(a) for a in DEPS_ASPECTS]
|
||||
|
||||
NG_MODULE_ATTRIBUTES = {
|
||||
"srcs": attr.label_list(allow_files = [".ts"]),
|
||||
|
||||
@ -481,7 +506,7 @@ NG_MODULE_ATTRIBUTES = {
|
||||
# https://github.com/bazelbuild/skydoc/issues/21
|
||||
"deps": attr.label_list(
|
||||
doc = "Targets that are imported by this target",
|
||||
aspects = list(DEPS_ASPECTS) + [_collect_summaries_aspect],
|
||||
aspects = local_deps_aspects,
|
||||
),
|
||||
"assets": attr.label_list(
|
||||
doc = ".html and .css files needed by the Angular compiler",
|
||||
@ -500,12 +525,21 @@ NG_MODULE_ATTRIBUTES = {
|
||||
"inline_resources": attr.bool(default = True),
|
||||
"no_i18n": attr.bool(default = False),
|
||||
"compiler": attr.label(
|
||||
default = Label("//packages/bazel/src/ngc-wrapped"),
|
||||
doc = """Sets a different ngc compiler binary to use for this library.
|
||||
|
||||
The default ngc compiler depends on the `@npm//@angular/bazel`
|
||||
target which is setup for projects that use bazel managed npm deps that
|
||||
fetch the @angular/bazel npm package. It is recommended that you use
|
||||
the workspace name `@npm` for bazel managed deps so the default
|
||||
compiler works out of the box. Otherwise, you'll have to override
|
||||
the compiler attribute manually.
|
||||
""",
|
||||
default = Label(DEFAULT_NG_COMPILER),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
"_ng_xi18n": attr.label(
|
||||
default = Label("//packages/bazel/src/ngc-wrapped:xi18n"),
|
||||
"ng_xi18n": attr.label(
|
||||
default = Label(DEFAULT_NG_XI18N),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
@ -514,12 +548,69 @@ NG_MODULE_ATTRIBUTES = {
|
||||
|
||||
NG_MODULE_RULE_ATTRS = dict(dict(COMMON_ATTRIBUTES, **NG_MODULE_ATTRIBUTES), **{
|
||||
"tsconfig": attr.label(allow_files = True, single_file = True),
|
||||
|
||||
# @// is special syntax for the "main" repository
|
||||
# The default assumes the user specified a target "node_modules" in their
|
||||
# root BUILD file.
|
||||
"node_modules": attr.label(
|
||||
default = Label("@//:node_modules"),
|
||||
doc = """The npm packages which should be available during the compile.
|
||||
|
||||
The default value of `@npm//typescript:typescript__typings` is
|
||||
for projects that use bazel managed npm deps. It is recommended
|
||||
that you use the workspace name `@npm` for bazel managed deps so the
|
||||
default value works out of the box. Otherwise, you'll have to
|
||||
override the node_modules attribute manually. This default is in place
|
||||
since code compiled by ng_module will always depend on at least the
|
||||
typescript default libs which are provided by
|
||||
`@npm//typescript:typescript__typings`.
|
||||
|
||||
This attribute is DEPRECATED. As of version 0.18.0 the recommended
|
||||
approach to npm dependencies is to use fine grained npm dependencies
|
||||
which are setup with the `yarn_install` or `npm_install` rules.
|
||||
|
||||
For example, in targets that used a `//:node_modules` filegroup,
|
||||
|
||||
```
|
||||
ng_module(
|
||||
name = "my_lib",
|
||||
...
|
||||
node_modules = "//:node_modules",
|
||||
)
|
||||
```
|
||||
|
||||
which specifies all files within the `//:node_modules` filegroup
|
||||
to be inputs to the `my_lib`. Using fine grained npm dependencies,
|
||||
`my_lib` is defined with only the npm dependencies that are
|
||||
needed:
|
||||
|
||||
```
|
||||
ng_module(
|
||||
name = "my_lib",
|
||||
...
|
||||
deps = [
|
||||
"@npm//@types/foo",
|
||||
"@npm//@types/bar",
|
||||
"@npm//foo",
|
||||
"@npm//bar",
|
||||
...
|
||||
],
|
||||
)
|
||||
```
|
||||
|
||||
In this case, only the listed npm packages and their
|
||||
transitive deps are includes as inputs to the `my_lib` target
|
||||
which reduces the time required to setup the runfiles for this
|
||||
target (see https://github.com/bazelbuild/bazel/issues/5153).
|
||||
The default typescript libs are also available via the node_modules
|
||||
default in this case.
|
||||
|
||||
The @npm external repository and the fine grained npm package
|
||||
targets are setup using the `yarn_install` or `npm_install` rule
|
||||
in your WORKSPACE file:
|
||||
|
||||
yarn_install(
|
||||
name = "npm",
|
||||
package_json = "//:package.json",
|
||||
yarn_lock = "//:yarn.lock",
|
||||
)
|
||||
""",
|
||||
default = Label("@npm//typescript:typescript__typings"),
|
||||
),
|
||||
"entry_point": attr.string(),
|
||||
|
||||
|
@ -1,27 +1,30 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]),
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
exports_files(["rollup.config.js"])
|
||||
exports_files([
|
||||
"rollup.config.js",
|
||||
"ng_package.bzl",
|
||||
])
|
||||
|
||||
ts_library(
|
||||
name = "lib",
|
||||
srcs = glob(["*.ts"]),
|
||||
node_modules = "@angular_packager_deps//:node_modules",
|
||||
node_modules = "@ngdeps//typescript:typescript__typings",
|
||||
tsconfig = ":tsconfig.json",
|
||||
deps = [
|
||||
"@ngdeps//@types/node",
|
||||
"@ngdeps//@types/shelljs",
|
||||
],
|
||||
)
|
||||
|
||||
nodejs_binary(
|
||||
name = "packager",
|
||||
data = ["lib"],
|
||||
data = [
|
||||
"lib",
|
||||
"@ngdeps//shelljs",
|
||||
],
|
||||
entry_point = "angular/packages/bazel/src/ng_package/packager.js",
|
||||
install_source_map_support = False,
|
||||
node_modules = "@angular_packager_deps//:node_modules",
|
||||
)
|
||||
|
@ -17,7 +17,7 @@ load("@build_bazel_rules_nodejs//:internal/collect_es6_sources.bzl", "collect_es
|
||||
load(
|
||||
"@build_bazel_rules_nodejs//:internal/rollup/rollup_bundle.bzl",
|
||||
"ROLLUP_ATTRS",
|
||||
"rollup_module_mappings_aspect",
|
||||
"ROLLUP_DEPS_ASPECTS",
|
||||
"run_uglify",
|
||||
"write_rollup_config",
|
||||
)
|
||||
@ -28,8 +28,11 @@ load(
|
||||
"create_package",
|
||||
)
|
||||
load("@build_bazel_rules_nodejs//:internal/node.bzl", "sources_aspect")
|
||||
load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleInfo")
|
||||
load("//packages/bazel/src:esm5.bzl", "esm5_outputs_aspect", "esm5_root_dir", "flatten_esm5")
|
||||
|
||||
_DEFAULT_NG_PACKAGER = "@npm//@angular/bazel/bin:packager"
|
||||
|
||||
# Convert from some-dash-case to someCamelCase
|
||||
def _convert_dash_case_to_camel_case(s):
|
||||
parts = s.split("-")
|
||||
@ -160,6 +163,13 @@ def _filter_out_generated_files(files):
|
||||
def _esm2015_root_dir(ctx):
|
||||
return ctx.label.name + ".es6"
|
||||
|
||||
def _filter_js_inputs(all_inputs):
|
||||
return [
|
||||
f
|
||||
for f in all_inputs
|
||||
if f.path.endswith(".js") or f.path.endswith(".json")
|
||||
]
|
||||
|
||||
# ng_package produces package that is npm-ready.
|
||||
def _ng_package_impl(ctx):
|
||||
npm_package_directory = ctx.actions.declare_directory("%s.ng_pkg" % ctx.label.name)
|
||||
@ -235,11 +245,19 @@ def _ng_package_impl(ctx):
|
||||
umd_output = ctx.outputs.umd
|
||||
min_output = ctx.outputs.umd_min
|
||||
|
||||
node_modules_files = _filter_js_inputs(ctx.files.node_modules)
|
||||
|
||||
# Also include files from npm fine grained deps as inputs.
|
||||
# These deps are identified by the NodeModuleInfo provider.
|
||||
for d in ctx.attr.deps:
|
||||
if NodeModuleInfo in d:
|
||||
node_modules_files += _filter_js_inputs(d.files)
|
||||
|
||||
esm2015_config = write_rollup_config(ctx, [], "/".join([ctx.bin_dir.path, ctx.label.package, _esm2015_root_dir(ctx)]), filename = "_%s.rollup_esm2015.conf.js")
|
||||
esm5_config = write_rollup_config(ctx, [], "/".join([ctx.bin_dir.path, ctx.label.package, esm5_root_dir(ctx)]), filename = "_%s.rollup_esm5.conf.js")
|
||||
|
||||
fesm2015.append(_rollup(ctx, "fesm2015", esm2015_config, es2015_entry_point, esm_2015_files + ctx.files.node_modules, fesm2015_output))
|
||||
fesm5.append(_rollup(ctx, "fesm5", esm5_config, es5_entry_point, esm5_sources + ctx.files.node_modules, fesm5_output))
|
||||
fesm2015.append(_rollup(ctx, "fesm2015", esm2015_config, es2015_entry_point, esm_2015_files + node_modules_files, fesm2015_output))
|
||||
fesm5.append(_rollup(ctx, "fesm5", esm5_config, es5_entry_point, esm5_sources + node_modules_files, fesm5_output))
|
||||
|
||||
bundles.append(
|
||||
_rollup(
|
||||
@ -247,7 +265,7 @@ def _ng_package_impl(ctx):
|
||||
"umd",
|
||||
esm5_config,
|
||||
es5_entry_point,
|
||||
esm5_sources + ctx.files.node_modules,
|
||||
esm5_sources + node_modules_files,
|
||||
umd_output,
|
||||
format = "umd",
|
||||
package_name = package_name,
|
||||
@ -325,14 +343,15 @@ def _ng_package_impl(ctx):
|
||||
mnemonic = "AngularPackage",
|
||||
inputs = packager_inputs,
|
||||
outputs = [npm_package_directory],
|
||||
executable = ctx.executable._ng_packager,
|
||||
executable = ctx.executable.ng_packager,
|
||||
arguments = [packager_args],
|
||||
)
|
||||
|
||||
devfiles = depset()
|
||||
if ctx.attr.include_devmode_srcs:
|
||||
for d in ctx.attr.deps:
|
||||
devfiles = depset(transitive = [devfiles, d.files, d.node_sources])
|
||||
if not NodeModuleInfo in d:
|
||||
devfiles = depset(transitive = [devfiles, d.files, d.node_sources])
|
||||
|
||||
# Re-use the create_package function from the nodejs npm_package rule.
|
||||
package_dir = create_package(
|
||||
@ -344,13 +363,14 @@ def _ng_package_impl(ctx):
|
||||
files = depset([package_dir]),
|
||||
)]
|
||||
|
||||
DEPS_ASPECTS = [esm5_outputs_aspect, sources_aspect]
|
||||
|
||||
# Workaround skydoc bug which assumes ROLLUP_DEPS_ASPECTS is a str type
|
||||
[DEPS_ASPECTS.append(a) for a in ROLLUP_DEPS_ASPECTS]
|
||||
|
||||
NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **dict(ROLLUP_ATTRS, **{
|
||||
"srcs": attr.label_list(allow_files = True),
|
||||
"deps": attr.label_list(aspects = [
|
||||
rollup_module_mappings_aspect,
|
||||
esm5_outputs_aspect,
|
||||
sources_aspect,
|
||||
]),
|
||||
"deps": attr.label_list(aspects = DEPS_ASPECTS),
|
||||
"data": attr.label_list(
|
||||
doc = "Additional, non-Angular files to be added to the package, e.g. global CSS assets.",
|
||||
allow_files = True,
|
||||
@ -361,8 +381,8 @@ NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **dict(ROLLUP_ATTRS, **{
|
||||
"entry_point_name": attr.string(
|
||||
doc = "Name to use when generating bundle files for the primary entry-point.",
|
||||
),
|
||||
"_ng_packager": attr.label(
|
||||
default = Label("//packages/bazel/src/ng_package:packager"),
|
||||
"ng_packager": attr.label(
|
||||
default = Label(_DEFAULT_NG_PACKAGER),
|
||||
executable = True,
|
||||
cfg = "host",
|
||||
),
|
||||
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"description": "runtime dependences for packager",
|
||||
"devDependencies": {
|
||||
"@types/node": "6.0.84",
|
||||
"@types/shelljs": "0.7.7",
|
||||
"shelljs": "0.8.2",
|
||||
"typescript": "2.7.2"
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": true,
|
||||
"lib": ["es2015"]
|
||||
"lib": ["es2015"],
|
||||
"types": []
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,8 @@
|
||||
load(
|
||||
"@build_bazel_rules_nodejs//internal/rollup:rollup_bundle.bzl",
|
||||
"ROLLUP_ATTRS",
|
||||
"ROLLUP_DEPS_ASPECTS",
|
||||
"ROLLUP_OUTPUTS",
|
||||
"rollup_module_mappings_aspect",
|
||||
"run_rollup",
|
||||
"run_sourcemapexplorer",
|
||||
"run_uglify",
|
||||
@ -141,16 +141,18 @@ def _ng_rollup_bundle(ctx):
|
||||
|
||||
return DefaultInfo(files = depset([ctx.outputs.build_es5_min, sourcemap]))
|
||||
|
||||
DEPS_ASPECTS = [esm5_outputs_aspect]
|
||||
|
||||
# Workaround skydoc bug which assumes ROLLUP_DEPS_ASPECTS is a str type
|
||||
[DEPS_ASPECTS.append(a) for a in ROLLUP_DEPS_ASPECTS]
|
||||
|
||||
ng_rollup_bundle = rule(
|
||||
implementation = _ng_rollup_bundle,
|
||||
attrs = dict(ROLLUP_ATTRS, **{
|
||||
"deps": attr.label_list(
|
||||
doc = """Other targets that provide JavaScript files.
|
||||
Typically this will be `ts_library` or `ng_module` targets.""",
|
||||
aspects = [
|
||||
rollup_module_mappings_aspect,
|
||||
esm5_outputs_aspect,
|
||||
],
|
||||
aspects = DEPS_ASPECTS,
|
||||
),
|
||||
"_rollup": attr.label(
|
||||
executable = True,
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
"Install toolchain dependencies"
|
||||
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "check_rules_typescript_version")
|
||||
|
||||
def ng_setup_workspace():
|
||||
@ -14,12 +13,9 @@ def ng_setup_workspace():
|
||||
It creates some additional Bazel external repositories that are used internally
|
||||
by the Angular rules.
|
||||
"""
|
||||
yarn_install(
|
||||
name = "angular_packager_deps",
|
||||
package_json = "@angular//packages/bazel/src/ng_package:package.json",
|
||||
yarn_lock = "@angular//packages/bazel/src/ng_package:yarn.lock",
|
||||
)
|
||||
|
||||
# 0.16.0: minimal version required to work with ng_module
|
||||
# 0.16.2: bazel type resolution for zone.js types
|
||||
check_rules_typescript_version("0.16.2")
|
||||
# 0.20.1: fine grained deps
|
||||
# 0.20.2: version check fix
|
||||
check_rules_typescript_version("0.20.2")
|
||||
|
@ -1,12 +1,6 @@
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
||||
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]),
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
name = "ngc_lib",
|
||||
srcs = [
|
||||
@ -14,26 +8,35 @@ ts_library(
|
||||
"index.ts",
|
||||
],
|
||||
module_name = "@angular/bazel",
|
||||
node_modules = "@ngdeps//typescript:typescript__typings",
|
||||
tsconfig = ":tsconfig.json",
|
||||
visibility = ["//packages/bazel/test/ngc-wrapped:__subpackages__"],
|
||||
visibility = [
|
||||
"//packages/bazel:__pkg__",
|
||||
"//packages/bazel/test/ngc-wrapped:__subpackages__",
|
||||
],
|
||||
deps = [
|
||||
# BEGIN-INTERNAL
|
||||
# Only needed when compiling within the Angular repo.
|
||||
# Users will get this dependency from node_modules.
|
||||
"//packages/compiler-cli",
|
||||
# END-INTERNAL
|
||||
"@build_bazel_rules_typescript//internal:tsc_wrapped",
|
||||
"@ngdeps//@bazel/typescript",
|
||||
"@ngdeps//@types/node",
|
||||
"@ngdeps//tsickle",
|
||||
"@ngdeps//typescript",
|
||||
],
|
||||
)
|
||||
|
||||
nodejs_binary(
|
||||
name = "ngc-wrapped",
|
||||
configuration_env_vars = ["compile"],
|
||||
data = [
|
||||
":ngc_lib",
|
||||
"@build_bazel_rules_typescript//third_party/github.com/bazelbuild/bazel/src/main/protobuf:worker_protocol.proto",
|
||||
"@ngdeps//source-map-support",
|
||||
"@ngdeps//tslib",
|
||||
],
|
||||
entry_point = "angular/packages/bazel/src/ngc-wrapped/index.js",
|
||||
node_modules = "@//:node_modules",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
@ -41,8 +44,8 @@ nodejs_binary(
|
||||
name = "xi18n",
|
||||
data = [
|
||||
":ngc_lib",
|
||||
"@ngdeps//source-map-support",
|
||||
],
|
||||
entry_point = "angular/packages/bazel/src/ngc-wrapped/index.js/extract_i18n.js",
|
||||
node_modules = "@//:node_modules",
|
||||
entry_point = "angular/packages/bazel/src/ngc-wrapped/extract_i18n.js",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["es5", "es2015.collection", "es2015.core"]
|
||||
"lib": ["es5", "es2015.collection", "es2015.core"],
|
||||
"types": ["node"]
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,6 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "package_assets",
|
||||
srcs = glob(["*"]) + [
|
||||
"//packages/bazel/src/protractor/utils:package_assets",
|
||||
],
|
||||
visibility = ["//packages/bazel:__subpackages__"],
|
||||
)
|
||||
|
||||
exports_files([
|
||||
"protractor.conf.js",
|
||||
"protractor_web_test.bzl",
|
||||
])
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user