diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000000..2a2130d6e838 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,509 @@ +# Configuration file for https://circleci.com/gh/angular/angular.js + +# Note: YAML anchors allow an object to be re-used, reducing duplication. +# The ampersand declares an alias for an object, then later the `<<: *name` +# syntax dereferences it. +# See http://blog.daemonl.com/2016/02/yaml.html +# To validate changes, use an online parser, eg. +# http://yaml-online-parser.appspot.com/ + +# CircleCI configuration version +# Version 2.1 allows for extra config reuse features +# https://circleci.com/docs/2.0/reusing-config/#getting-started-with-config-reuse +version: 2.1 + +# Workspace persisted by the `setup` job to share build artifacts with other jobs. +# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs +# https://circleci.com/blog/deep-diving-into-circleci-workspaces/ +var_workspace_location: &workspace_location ~/ + +# Executor Definitions +# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-executors +# **NOTE 1**: Pin to exact images using an ID (SHA). See https://circleci.com/docs/2.0/circleci-images/#using-a-docker-image-id-to-pin-an-image-to-a-fixed-version. +# (Using the tag in not necessary when pinning by ID, but include it anyway for documentation purposes.) +executors: + default-executor: + parameters: + resource_class: + type: string + default: medium + docker: + - image: circleci/node:14.16.1@sha256:b094e85848b43209ca83d9bb114d406fe62c75cb73b18c9d8eb1a9c6462c97d4 + resource_class: << parameters.resource_class >> + working_directory: ~/ng + cloud-sdk: + description: The docker container to use when running gcp-gcs commands + docker: + - image: google/cloud-sdk:alpine@sha256:7d0cae28cb282b76f2d9babe278c63c910d54f0cceca7a65fdf6806e2b43882e + working_directory: ~/ng + + +# Filter Definitions + +# Filter to run a job on all branches and any `v1.X.Y(-Z)` tags. +# Since the jobs need to run on tagged builds too, a `tags` section has to be explicitly specified. +# (The `branches` section could be omitted, since it defaults to all branches - just being explicit +# here). +# See also https://circleci.com/docs/2.0/workflows/#executing-workflows-for-a-git-tag. +var-filter-run-always: &run-always + filters: + branches: + only: /.*/ + tags: + only: /v1\.\d+\.\d.*/ + +# Filter to run a job when code might need to be deployed - i.e. on builds for the `master` branch. +# (Further checks are needed to determine whether a deployment is actually needed, but these are not +# possible via filters.) +var-filter-run-on-master: &run-on-master + filters: + branches: + only: + - master + tags: + ignore: /.*/ + +# Filter to run a job when code/docs might need to be deployed - i.e. on tagged builds and on builds +# for master and `v1.*.x` branches. +# (Further checks are needed to determine whether a deployment is actually needed, but these are not +# possible via filters.) +var-filter-run-on-tags-and-master-and-version-branches: &run-on-tags-and-master-and-version-branches + filters: + branches: + only: + - master + - /v1\.\d+\.x/ + tags: + only: /v1\.\d+\.\d.*/ + +# Filter to run a job when docs might need to be deployed - i.e. on builds for `v1.*.x` branches, +# which might correspond to the stable branch. +# (Further checks are needed to determine whether a deployment is actually needed, but these are not +# possible via filters.) +var-filter-run-on-version-branches: &run-on-version-branches + filters: + branches: + only: + - /v1\.\d+\.x/ + tags: + ignore: /.*/ + + +# Command Definitions +# https://circleci.com/docs/2.0/reusing-config/#authoring-reusable-commands +commands: + skip_on_pr_and_fork_builds: + description: Skip a job on pull request and fork builds + steps: + - run: + name: Skip this job if this is a pull request or fork build + # Note: Using `CIRCLE_*` env variables (instead of those defined in `env.sh` so that this + # step can be run before `init_environment`. + command: > + if [[ -n "$CIRCLE_PR_NUMBER" ]] || + [[ "$CIRCLE_PROJECT_USERNAME" != "angular" ]] || + [[ "$CIRCLE_PROJECT_REPONAME" != "angular.js" ]]; then + echo "Skipping this job, because this is either a pull request or a fork build." + circleci step halt + fi + + skip_unless_stable_branch: + description: Skip a job unless this is the stable branch + steps: + - run: + name: Skip this job unless this is the stable branch + command: > + if [[ "$DIST_TAG" != "latest" ]]; then + echo "Skipping deployment, because this is not the stable branch." + circleci step halt + fi + + skip_unless_tag_or_master_or_stable_branch: + description: Skip a job unless this is a tag or the master or stable branch + steps: + - run: + name: Skip this job unless this is a tag or the master or stable branch + command: > + if [[ "$CI_GIT_TAG" == "false" ]] && + [[ "$CI_BRANCH" != "master" ]] && + [[ "$DIST_TAG" != "latest" ]]; then + echo "Skipping this job, because this is neither a tag nor the master or stable branch." + circleci step halt + fi + + + custom_attach_workspace: + description: Attach workspace at a predefined location + steps: + - attach_workspace: + at: *workspace_location + + # Java is needed for running the Closure Compiler (during the `minall` task). + install_java: + description: Install java + steps: + - run: + name: Install java + command: | + sudo apt-get update + # Install java runtime + sudo apt-get install default-jre + + # Initializes the CI environment by setting up common environment variables. + init_environment: + description: Initializing environment (setting up variables) + steps: + - run: + name: Set up environment + environment: + CIRCLE_GIT_BASE_REVISION: << pipeline.git.base_revision >> + CIRCLE_GIT_REVISION: << pipeline.git.revision >> + command: ./.circleci/env.sh + - run: + # Configure git as the CircleCI `checkout` command does. + # This is needed because we only checkout on the setup job. + # Add GitHub to known hosts + name: Configure git + command: | + mkdir -p ~/.ssh + echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts + git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true + git config --global gc.auto 0 || true + + init_saucelabs_environment: + description: Sets up a domain that resolves to the local host. + steps: + - run: + name: Preparing environment for running tests on Saucelabs. + command: | + # For SauceLabs jobs, we set up a domain which resolves to the machine which launched + # the tunnel. We do this because devices are sometimes not able to properly resolve + # `localhost` or `127.0.0.1` through the SauceLabs tunnel. Using a domain that does not + # resolve to anything on SauceLabs VMs ensures that such requests are always resolved + # through the tunnel, and resolve to the actual tunnel host machine (i.e. the CircleCI VM). + # More context can be found in: https://github.com/angular/angular/pull/35171. + setPublicVar SAUCE_LOCALHOST_ALIAS_DOMAIN "angular-ci.local" + setSecretVar SAUCE_ACCESS_KEY $(echo $SAUCE_ACCESS_KEY | rev) + - run: + # Sets up a local domain in the machine's host file that resolves to the local + # host. This domain is helpful in Saucelabs tests where devices are not able to + # properly resolve `localhost` or `127.0.0.1` through the sauce-connect tunnel. + name: Setting up alias domain for local host. + command: echo "127.0.0.1 $SAUCE_LOCALHOST_ALIAS_DOMAIN" | sudo tee -a /etc/hosts + + start_saucelabs: + steps: + - run: + name: Starting Saucelabs tunnel service + command: ./lib/saucelabs/sauce-service.sh start-ready-wait + + stop_saucelabs: + steps: + - run: + name: Stopping Saucelabs tunnel service + command: ./lib/saucelabs/sauce-service.sh stop + + run_e2e_tests: + parameters: + specs: + type: string + steps: + - custom_attach_workspace + - init_environment + - init_saucelabs_environment + - start_saucelabs + - run: + command: yarn grunt test:circleci-protractor --specs="<< parameters.specs >>" + no_output_timeout: 30m + - stop_saucelabs + + run_e2e_tests_jquery: + parameters: + specs: + type: string + steps: + - custom_attach_workspace + - init_environment + - init_saucelabs_environment + - start_saucelabs + - run: + environment: + USE_JQUERY: 1 + command: yarn grunt test:circleci-protractor --specs="<< parameters.specs >>" + no_output_timeout: 30m + - stop_saucelabs + +# Job definitions +# Jobs can include parameters that are passed in the workflow job invocation. +# https://circleci.com/docs/2.0/reusing-config/#authoring-parameterized-jobs +jobs: + setup: + executor: default-executor + steps: + - checkout + - init_environment + - install_java + - run: + name: Running Yarn install + command: yarn install --frozen-lockfile --non-interactive + # Yarn's requests sometimes take more than 10mins to complete. + no_output_timeout: 45m + - run: yarn grunt package + # Persist any changes at this point to be reused by further jobs. + # **NOTE**: To add new content to the workspace, always persist on the same root. + - persist_to_workspace: + root: *workspace_location + paths: + - ./ng + + lint: + executor: default-executor + steps: + - custom_attach_workspace + - init_environment + - run: yarn grunt ci-checks + - run: yarn commitplease "$CI_COMMIT_RANGE" + - run: yarn grunt validate-angular-files + + unit-test: + executor: + name: default-executor + steps: + - custom_attach_workspace + - init_environment + - install_java + - init_saucelabs_environment + - run: yarn grunt test:promises-aplus + - run: + command: yarn grunt test:jqlite --browsers="$BROWSERS" --reporters=spec + no_output_timeout: 10m + - run: + command: yarn grunt test:modules --browsers="$BROWSERS" --reporters=spec + no_output_timeout: 10m + - run: + command: yarn grunt test:docs --browsers="$BROWSERS" --reporters=spec + no_output_timeout: 10m + + unit-test-jquery: + executor: + name: default-executor + steps: + - custom_attach_workspace + - init_environment + - init_saucelabs_environment + - run: + command: yarn grunt test:jquery --browsers="$BROWSERS" --reporters=spec + no_output_timeout: 10m + - run: + command: yarn grunt test:jquery-2.2 --browsers="$BROWSERS" --reporters=spec + no_output_timeout: 10m + - run: + command: yarn grunt test:jquery-2.1 --browsers="$BROWSERS" --reporters=spec + no_output_timeout: 10m + + e2e-test-1: + executor: + name: default-executor + steps: + - run_e2e_tests: + specs: test/e2e/tests/**/*.js + + e2e-test-2a: + executor: + name: default-executor + steps: + - run_e2e_tests: + specs: build/docs/ptore2e/example-ng*/**/default_test.js + + e2e-test-2b: + executor: + name: default-executor + steps: + - run_e2e_tests: + specs: "build/docs/ptore2e/!(example-ng*)/**/default_test.js" + + e2e-test-jquery-1: + executor: + name: default-executor + steps: + - run_e2e_tests_jquery: + specs: test/e2e/tests/**/*.js + + e2e-test-jquery-2a: + executor: + name: default-executor + steps: + - run_e2e_tests_jquery: + specs: build/docs/ptore2e/example-ng*/**/jquery_test.js + + e2e-test-jquery-2b: + executor: + name: default-executor + steps: + - run_e2e_tests_jquery: + specs: build/docs/ptore2e/!(example-ng*)/**/jquery_test.js + + prepare-deployment: + executor: + name: default-executor + steps: + - skip_on_pr_and_fork_builds + - custom_attach_workspace + - init_environment + - run: yarn grunt prepareDeploy + # Write the deployment files to the workspace to be used by deploy-docs and deploy-code + - persist_to_workspace: + root: *workspace_location + paths: + - ./ng + + # The `deploy-code-files` job should only run when all of these conditions are true for the build: + # - It is for the `angular/angular.js` repository (not a fork). + # - It is not for a pull request. + # - It is for a tag or the master branch or the stable branch(*). + # + # *: The stable branch is the one that has the value `latest` in `package.json > distTag`. + deploy-code-files: + executor: + name: cloud-sdk + steps: + - skip_on_pr_and_fork_builds + - custom_attach_workspace + - init_environment + - skip_unless_tag_or_master_or_stable_branch + - run: ls scripts/code.angularjs.org-firebase/deploy + - run: + name: Authenticate and configure Docker + command: | + echo $GCLOUD_SERVICE_KEY | gcloud auth activate-service-account --key-file=- + gcloud --quiet config set project ${GOOGLE_PROJECT_ID} + - run: + name: Sync files to code.angularjs.org + command: | + gsutil -m rsync -r scripts/code.angularjs.org-firebase/deploy gs://code-angularjs-org-338b8.appspot.com + + # The `deploy-code-firebase` job should only run when all of these conditions are true for the build: + # - It is for the `angular/angular.js` repository (not a fork). + # - It is not for a pull request. + # - It is for the master branch. + # (This is enforced via job filters, so we don't need to a step to check it here.) + deploy-code-firebase: + executor: + name: default-executor + steps: + - skip_on_pr_and_fork_builds + - custom_attach_workspace + - init_environment + # Install dependencies for Firebase functions to prevent parsing errors during deployment. + # See https://github.com/angular/angular.js/pull/16453. + - run: + name: Install dependencies in `scripts/code.angularjs.org-firebase/functions/`. + working_directory: scripts/code.angularjs.org-firebase/functions + command: yarn install --frozen-lockfile --ignore-engines --non-interactive + - run: + name: Deploy to Firebase from `scripts/code.angularjs.org-firebase/`. + working_directory: scripts/code.angularjs.org-firebase + command: | + # Do not use `yarn firebase` as that causes the Firebase CLI to look for `firebase.json` + # in the root directory, even if run from inside `scripts/code.angularjs.org-firebase/`. + firebase=$(yarn bin)/firebase + $firebase use + $firebase deploy --message "Commit:\ $CI_COMMIT" --non-interactive --token "$FIREBASE_TOKEN" + + # The `deploy-docs` job should only run when all of these conditions are true for the build: + # - It is for the `angular/angular.js` repository (not a fork). + # - It is not for a pull request. + # - It is for the stable branch(*). + # + # *: The stable branch is the one that has the value `latest` in `package.json > distTag`. + deploy-docs: + executor: + name: default-executor + steps: + - skip_on_pr_and_fork_builds + - custom_attach_workspace + - init_environment + - skip_unless_stable_branch + # Install dependencies for Firebase functions to prevent parsing errors during deployment. + # See https://github.com/angular/angular.js/pull/16453. + - run: + name: Install dependencies in `scripts/docs.angularjs.org-firebase/functions/`. + working_directory: scripts/docs.angularjs.org-firebase/functions + command: yarn install --frozen-lockfile --ignore-engines --non-interactive + - run: + name: Deploy to Firebase from `scripts/docs.angularjs.org-firebase/`. + working_directory: scripts/docs.angularjs.org-firebase + command: | + # Do not use `yarn firebase` as that causes the Firebase CLI to look for `firebase.json` + # in the root directory, even if run from inside `scripts/docs.angularjs.org-firebase/`. + firebase=$(yarn bin)/firebase + $firebase use + $firebase deploy --message "Commit:\ $CI_COMMIT" --non-interactive --token "$FIREBASE_TOKEN" + +workflows: + version: 2 + default_workflow: + jobs: + - setup: + <<: *run-always + - lint: + <<: *run-always + requires: + - setup + - unit-test: + <<: *run-always + requires: + - setup + - unit-test-jquery: + <<: *run-always + requires: + - setup + - e2e-test-1: + <<: *run-always + requires: + - setup + - e2e-test-2a: + <<: *run-always + requires: + - setup + - e2e-test-2b: + <<: *run-always + requires: + - setup + - e2e-test-jquery-1: + <<: *run-always + requires: + - setup + - e2e-test-jquery-2a: + <<: *run-always + requires: + - setup + - e2e-test-jquery-2b: + <<: *run-always + requires: + - setup + - prepare-deployment: + <<: *run-on-tags-and-master-and-version-branches + requires: + - setup + - lint + - unit-test + - unit-test-jquery + - e2e-test-1 + - e2e-test-2a + - e2e-test-2b + - e2e-test-jquery-1 + - e2e-test-jquery-2a + - e2e-test-jquery-2b + - deploy-code-files: + <<: *run-on-tags-and-master-and-version-branches + requires: + - prepare-deployment + - deploy-code-firebase: + <<: *run-on-master + requires: + - prepare-deployment + - deploy-docs: + <<: *run-on-version-branches + requires: + - prepare-deployment diff --git a/.circleci/env-helpers.inc.sh b/.circleci/env-helpers.inc.sh new file mode 100644 index 000000000000..5fa1263e112f --- /dev/null +++ b/.circleci/env-helpers.inc.sh @@ -0,0 +1,73 @@ +#################################################################################################### +# Helpers for defining environment variables for CircleCI. +# +# In CircleCI, each step runs in a new shell. The way to share ENV variables across steps is to +# export them from `$BASH_ENV`, which is automatically sourced at the beginning of every step (for +# the default `bash` shell). +# +# See also https://circleci.com/docs/2.0/env-vars/#using-bash_env-to-set-environment-variables. +#################################################################################################### + +# Set and print an environment variable. +# +# Use this function for setting environment variables that are public, i.e. it is OK for them to be +# visible to anyone through the CI logs. +# +# Usage: `setPublicVar ` +function setPublicVar() { + setSecretVar $1 "$2"; + echo "$1=$2"; +} + +# Set (without printing) an environment variable. +# +# Use this function for setting environment variables that are secret, i.e. should not be visible to +# everyone through the CI logs. +# +# Usage: `setSecretVar ` +function setSecretVar() { + # WARNING: Secrets (e.g. passwords, access tokens) should NOT be printed. + # (Keep original shell options to restore at the end.) + local -r originalShellOptions=$(set +o); + set +x -eu -o pipefail; + + echo "export $1=\"${2:-}\";" >> $BASH_ENV; + + # Restore original shell options. + eval "$originalShellOptions"; +} + + +# Create a function to set an environment variable, when called. +# +# Use this function for creating setter for public environment variables that require expensive or +# time-consuming computaions and may not be needed. When needed, you can call this function to set +# the environment variable (which will be available through `$BASH_ENV` from that point onwards). +# +# Arguments: +# - ``: The name of the environment variable. The generated setter function will be +# `setPublicVar_`. +# - ``: The code to run to compute the value for the variable. Since this code should be +# executed lazily, it must be properly escaped. For example: +# ```sh +# # DO NOT do this: +# createPublicVarSetter MY_VAR "$(whoami)"; # `whoami` will be evaluated eagerly +# +# # DO this isntead: +# createPublicVarSetter MY_VAR "\$(whoami)"; # `whoami` will NOT be evaluated eagerly +# ``` +# +# Usage: `createPublicVarSetter ` +# +# Example: +# ```sh +# createPublicVarSetter MY_VAR 'echo "FOO"'; +# echo $MY_VAR; # Not defined +# +# setPublicVar_MY_VAR; +# source $BASH_ENV; +# echo $MY_VAR; # FOO +# ``` +function createPublicVarSetter() { + echo "setPublicVar_$1() { setPublicVar $1 \"$2\"; }" >> $BASH_ENV; +} diff --git a/.circleci/env.sh b/.circleci/env.sh new file mode 100755 index 000000000000..338371017ccb --- /dev/null +++ b/.circleci/env.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +# Variables +readonly projectDir=$(realpath "$(dirname ${BASH_SOURCE[0]})/..") +readonly envHelpersPath="$projectDir/.circleci/env-helpers.inc.sh"; + +# Load helpers and make them available everywhere (through `$BASH_ENV`). +source $envHelpersPath; +echo "source $envHelpersPath;" >> $BASH_ENV; + +#################################################################################################### +# Define PUBLIC environment variables for CircleCI. +#################################################################################################### +# See https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables for more info. +#################################################################################################### +setPublicVar CI "$CI" +setPublicVar PROJECT_ROOT "$projectDir"; +# This is the branch being built; e.g. `pull/12345` for PR builds. +setPublicVar CI_BRANCH "$CIRCLE_BRANCH"; +setPublicVar CI_BUILD_URL "$CIRCLE_BUILD_URL"; +setPublicVar CI_COMMIT "$CIRCLE_SHA1"; +setPublicVar CI_GIT_BASE_REVISION "${CIRCLE_GIT_BASE_REVISION}"; +setPublicVar CI_GIT_REVISION "${CIRCLE_GIT_REVISION}"; +setPublicVar CI_GIT_TAG "${CIRCLE_TAG:-false}"; +setPublicVar CI_COMMIT_RANGE "$CIRCLE_GIT_BASE_REVISION..$CIRCLE_GIT_REVISION"; +setPublicVar CI_PULL_REQUEST "${CIRCLE_PR_NUMBER:-false}"; +setPublicVar CI_REPO_NAME "$CIRCLE_PROJECT_REPONAME"; +setPublicVar CI_REPO_OWNER "$CIRCLE_PROJECT_USERNAME"; +setPublicVar CI_PR_REPONAME "$CIRCLE_PR_REPONAME"; +setPublicVar CI_PR_USERNAME "$CIRCLE_PR_USERNAME"; + + +#################################################################################################### +# Define SauceLabs environment variables for CircleCI. +#################################################################################################### +setPublicVar BROWSER_PROVIDER "saucelabs" + +# The currently latest-1 version of desktop Safari on Saucelabs (v12.0) is unstable and disconnects +# consistently. The latest version (v12.1) works fine. +# TODO: Add `SL_Safari-1` back, once it no longer corresponds to v12.0. +setPublicVar BROWSERS "SL_Chrome,SL_Chrome-1,\ +SL_Firefox,SL_Firefox-1,\ +SL_Safari,\ +SL_iOS,SL_iOS-1,\ +SL_IE_9,SL_IE_10,SL_IE_11,\ +SL_EDGE,SL_EDGE-1" + +setPublicVar SAUCE_LOG_FILE /tmp/angular/sauce-connect.log +setPublicVar SAUCE_READY_FILE /tmp/angular/sauce-connect-ready-file.lock +setPublicVar SAUCE_PID_FILE /tmp/angular/sauce-connect-pid-file.lock +setPublicVar SAUCE_TUNNEL_IDENTIFIER "angularjs-framework-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}" +# Amount of seconds we wait for sauceconnect to establish a tunnel instance. In order to not +# acquire CircleCI instances for too long if sauceconnect failed, we need a connect timeout. +setPublicVar SAUCE_READY_FILE_TIMEOUT 120 + +#################################################################################################### +# Define additional environment variables +#################################################################################################### + +# NOTE: Make sure the tools used to compute this are available in all executors in `config.yml`. +setPublicVar DIST_TAG $( cat package.json | grep distTag | sed -E 's/^\s*"distTag"\s*:\s*"([^"]+)"\s*,\s*$/\1/' ) + +#################################################################################################### +#################################################################################################### +## Source `$BASH_ENV` to make the variables available immediately. ## +## *** NOTE: This must remain the last command in this script. *** ## +#################################################################################################### +#################################################################################################### +source $BASH_ENV; diff --git a/.eslintrc-todo.json b/.eslintrc-todo.json index 7e89110084b7..a7b24d7a05b0 100644 --- a/.eslintrc-todo.json +++ b/.eslintrc-todo.json @@ -15,7 +15,7 @@ // Stylistic issues "block-spacing": ["error", "always"], "comma-spacing": "error", - "id-blacklist": ["error", "event"], + "id-denylist": ["error", "event"], "indent": ["error", 2], "key-spacing": ["error", { "beforeColon": false, "afterColon": true, "mode": "minimum" }], "object-curly-spacing": ["error", "never"], diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index c2f27485348f..f5513f23390c 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -31,7 +31,7 @@ please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:yBpEi4). --> -**AngularJS version:** 1.7.x +**AngularJS version:** 1.8.x diff --git a/.gitignore b/.gitignore index 588beda3f172..9641ed4fd609 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /build/ -/deploy/ /benchpress-build/ .DS_Store gen_docs.disable @@ -12,6 +11,7 @@ performance/temp*.html angular.js.tmproj node_modules/ angular.xcodeproj +.firebase/ .idea *.iml .agignore @@ -22,3 +22,6 @@ npm-debug.log .vscode *.log *.stackdump +scripts/code.angularjs.org-firebase/deploy +scripts/docs.angularjs.org-firebase/deploy +scripts/docs.angularjs.org-firebase/functions/content diff --git a/.nvmrc b/.nvmrc index 45a4fb75db86..6b17d228d335 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -8 +14.16.1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c122a06bcdf2..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,104 +0,0 @@ -language: node_js -sudo: false -node_js: - - '8' - -cache: - yarn: true - -branches: - except: - - "/^g3_.*$/" - -env: - matrix: - - JOB=ci-checks - - JOB=unit-core BROWSER_PROVIDER=saucelabs - - JOB=unit-jquery BROWSER_PROVIDER=saucelabs - - JOB=unit-modules BROWSER_PROVIDER=saucelabs - - JOB=docs-app BROWSER_PROVIDER=saucelabs - - JOB=e2e TEST_TARGET=jqlite BROWSER_PROVIDER=saucelabs - - JOB=e2e TEST_TARGET=jquery BROWSER_PROVIDER=saucelabs - global: - - SAUCE_USERNAME=angular-ci - - SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987 - - LOGS_DIR=/tmp/angular-build/logs - - BROWSER_PROVIDER_READY_FILE=/tmp/browsersprovider-tunnel-ready - - secure: oTBjhnOKhs0qDSKTf7fE4f6DYiNDPycvB7qfSF5QRIbJK/LK/J4UtFwetXuXj79HhUZG9qnoT+5e7lPaiaMlpsIKn9ann7ffqFWN1E8TMtpJF+AGigx3djYElwfgf5nEnFUFhwjFzvbfpZNnxVGgX5YbIZpe/WUbHkP4ffU0Wks= - -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.10.1 - - export PATH="$HOME/.yarn/bin:$PATH" - -before_script: - - du -sh ./node_modules || true - - "./scripts/travis/before_build.sh" -script: - - "./scripts/travis/build.sh" - -after_script: - - "./scripts/travis/tear_down_browser_provider.sh" - - "./scripts/travis/print_logs.sh" - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/d2120f3f2bb39a4531b2 - - http://104.197.9.155:8484/hubot/travis/activity #hubot-server - on_success: always # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: always # default: false - -jobs: - include: - - stage: deploy - # Don't deploy from PRs. Only deploy from our default branches, or if commit is tagged. - # This is a Travis-specific boolean language: https://docs.travis-ci.com/user/conditional-builds-stages-jobs#Specifying-conditions - # The deployment logic for pushed branches is further defined in scripts\travis\build.sh - if: type != pull_request and (branch =~ ^(v1\.\d+\.x|master)$ or tag IS present) - env: - - JOB=deploy - before_script: skip - script: - # Export the variables into the current process - - . ./scripts/travis/build.sh - - "echo DEPLOY_DOCS: $DEPLOY_DOCS, DEPLOY_CODE: $DEPLOY_CODE" - after_script: skip - # Work around the 10min Travis timeout so the code.angularjs firebase+gcs code deploy can complete - # Only run the keep_alive once (before_deploy is run for each provider) - before_deploy: | - if ! [ "$BEFORE_DEPLOY_RUN" ]; then - export BEFORE_DEPLOY_RUN=1; - - function keep_alive() { - while true; do - echo -en "\a" - sleep 10 - done - } - keep_alive & - fi - deploy: - - provider: firebase - # the upload folder for firebase is configured in /firebase.json - skip_cleanup: true - project: docs-angularjs-org-9p2 - token: - secure: $FIREBASE_TOKEN - on: - repo: angular/angular.js - all_branches: true - condition: "$DEPLOY_DOCS == true" - - provider: gcs - skip_cleanup: true - access_key_id: GOOGLDB7W2J3LFHICF3R - secret_access_key: - secure: tHIFdSq55qkyZf9zT/3+VkhUrTvOTMuswxXU3KyWaBrSieZqG0UnUDyNm+n3lSfX95zEl/+rJAWbfvhVSxZi13ndOtvRF+MdI1cvow2JynP0aDSiPffEvVrZOmihD6mt2SlMfhskr5FTduQ69kZG6DfLcve1PPDaIwnbOv3phb8= - bucket: code-angularjs-org-338b8.appspot.com - local-dir: deploy/code - detect_encoding: true # detects gzip compression - on: - repo: angular/angular.js - all_branches: true - condition: "$DEPLOY_CODE == true" - diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b9b5f6d6a2..c720bd43ffa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,102 @@ +**AngularJS support has officially ended as of January 2022. +[See what ending support means](https://docs.angularjs.org/misc/version-support-status) +and [read the end of life announcement](https://goo.gle/angularjs-end-of-life).** + +**Visit [angular.io](https://angular.io) for the actively supported Angular.** + + +# 1.8.3 ultimate-farewell (2022-04-07) + +One final release of AngularJS in order to update package README files on npm. + + +# 1.8.2 meteoric-mining (2020-10-21) + +## Bug Fixes +- **$sceDelegate:** ensure that `resourceUrlWhitelist()` is identical to `trustedResourceUrlList()` + ([e41f01](https://github.com/angular/angular.js/commit/e41f018959934bfbf982ba996cd654b1fce88d43), + [#17090](https://github.com/angular/angular.js/issues/17090)) + + + +# 1.8.1 mutually-supporting (2020-09-30) + +## Bug Fixes +- **$sanitize:** do not trigger CSP alert/report in Firefox and Chrome + ([2fab3d](https://github.com/angular/angular.js/commit/2fab3d4e00f4fe35bfa3cf255160cb97404baf24)) + +## Refactorings + +- **SanitizeUriProvider:** remove usages of whitelist + ([76738102](https://github.com/angular/angular.js/commit/767381020d88bda2855ac87ca6f00748907e14ff)) +- **httpProvider:** remove usages of whitelist and blacklist + ([c953af6b](https://github.com/angular/angular.js/commit/c953af6b8cfeefe4acc0ca358550eed5da8cfe00)) +- **sceDelegateProvider:** remove usages of whitelist and blacklist + ([a206e267](https://github.com/angular/angular.js/commit/a206e2675c351c3cdcde3402978126774c1c5df9)) + +## Deprecation Notices + +- Deprecated ~~`$compileProvider.aHrefSanitizationWhitelist`~~. + It is now [`aHrefSanitizationTrustedUrlList`](https://docs.angularjs.org/api/ng/provider/$compileProvider#aHrefSanitizationTrustedUrlList). +- Deprecated ~~`$compileProvider.imgSrcSanitizationWhitelist`~~. + It is now [`imgSrcSanitizationTrustedUrlList`](https://docs.angularjs.org/api/ng/provider/$compileProvider#imgSrcSanitizationTrustedUrlList). +- Deprecated ~~`$httpProvider.xsrfWhitelistedOrigins`~~. + It is now [`xsrfTrustedOrigins`](https://docs.angularjs.org/api/ng/provider/$httpProvider#xsrfTrustedOrigins). +- Deprecated ~~`$sceDelegateProvider.resourceUrlWhitelist`~~. + It is now [`trustedResourceUrlList`](https://docs.angularjs.org/api/ng/provider/$sceDelegateProvider#trustedResourceUrlList). +- Deprecated ~~`$sceDelegateProvider.resourceUrlBlacklist`~~. + It is now [`bannedResourceUrlList`](https://docs.angularjs.org/api/ng/provider/$sceDelegateProvider#bannedResourceUrlList). + +For the purposes of backward compatibility, the previous symbols are aliased to their new symbol. + + + +# 1.8.0 nested-vaccination (2020-06-01) + +_This release contains a breaking change to resolve a security issue which was discovered by +Krzysztof Kotowicz(@koto); and independently by Esben Sparre Andreasen (@esbena) while +performing a Variant Analysis of [CVE-2020-11022](https://github.com/advisories/GHSA-gxr4-xjj5-5px2) +which itself was found and reported by Masato Kinugawa (@masatokinugawa)._ + +## Bug Fixes +- **jqLite:** + - prevent possible XSS due to regex-based HTML replacement + ([2df43c](https://github.com/angular/angular.js/commit/2df43c07779137d1bddf7f3b282a1287a8634acd)) + +## Breaking Changes + +### **jqLite** due to: + - **[2df43c](https://github.com/angular/angular.js/commit/2df43c07779137d1bddf7f3b282a1287a8634acd)**: prevent possible XSS due to regex-based HTML replacement + +JqLite no longer turns XHTML-like strings like `
` to sibling elements `
` +when not in XHTML mode. Instead it will leave them as-is. The browser, in non-XHTML mode, will convert these to: +`
`. + +This is a security fix to avoid an XSS vulnerability if a new jqLite element is created from a user-controlled HTML string. +If you must have this functionality and understand the risk involved then it is posible to restore the original behavior by calling + +```js +angular.UNSAFE_restoreLegacyJqLiteXHTMLReplacement(); +``` + +But you should adjust your code for this change and remove your use of this function as soon as possible. + +Note that this only patches jqLite. If you use jQuery 3.5.0 or newer, please read the [jQuery 3.5 upgrade guide](https://jquery.com/upgrade-guide/3.5/) for more details about the workarounds. + + + +# 1.7.9 pollution-eradication (2019-11-19) + +## Bug Fixes +- **angular.merge:** do not merge __proto__ property + ([726f49](https://github.com/angular/angular.js/commit/726f49dcf6c23106ddaf5cfd5e2e592841db743a)) +
(Thanks to the [Snyk Security Research Team](https://snyk.io/blog/snyk-research-team-discovers-severe-prototype-pollution-security-vulnerabilities-affecting-all-versions-of-lodash/) for identifyng this issue.) +- **ngStyle:** correctly remove old style when new style value is invalid + ([5edd25](https://github.com/angular/angular.js/commit/5edd25364f617083363dc2bd61f9230b38267578), + [#16860](https://github.com/angular/angular.js/issues/16860), + [#16868](https://github.com/angular/angular.js/issues/16868)) + + # 1.7.8 enthusiastic-oblation (2019-03-11) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 57c7dd2d6027..fadd5d01937d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,8 +125,8 @@ Before you submit your pull request consider the following guidelines: * Follow our [Coding Rules][developers.rules]. * If the changes affect public APIs, change or add relevant [documentation][developers.documentation]. * Run the AngularJS [unit][developers.tests-unit] and [E2E test][developers.tests-e2e] suites, and ensure that all tests - pass. It is generally sufficient to run the tests only on Chrome, as our Travis integration will - run the tests on all supported browsers. + pass. It is generally sufficient to run the tests only on Chrome, as our continuous integration test will + run the tests on additional browsers. * Run `yarn grunt eslint` to check that you have followed the automatically enforced coding rules * Commit your changes using a descriptive commit message that follows our [commit message conventions][developers.commits]. Adherence to the @@ -151,9 +151,9 @@ Before you submit your pull request consider the following guidelines: ``` * In GitHub, send a pull request to `angular.js:master`. This will trigger the check of the -[Contributor License Agreement](#cla) and the Travis integration. +[Contributor License Agreement](#cla) and the continuous integration tests. -* If you find that the Travis integration has failed, look into the logs on Travis to find out +* If you find that the continuous integration tests have failed, look into the logs to find out if your changes caused test failures, the commit message was malformed etc. If you find that the tests failed or times out for unrelated reasons, you can ping a team member so that the build can be restarted. @@ -172,7 +172,7 @@ restarted. git push origin my-fix-branch -f ``` - This is generally easier to follow, but seperate commits are useful if the Pull Request contains + This is generally easier to follow, but separate commits are useful if the Pull Request contains iterations that might be interesting to see side-by-side. That's it! Thank you for your contribution! diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 8a1ea954d514..cc91b6183dfb 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -249,7 +249,7 @@ format that includes a **type**, a **scope** and a **subject**: The **header** is mandatory and the **scope** of the header is optional. -Any line of the commit message cannot be longer 100 characters! This allows the message to be easier +Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools. ### Revert @@ -428,7 +428,7 @@ if it is enclosed in <pre>...</pre> tags and the code lines themselv It is possible to embed examples in the documentation along with appropriate e2e tests. These examples and scenarios will be converted to runnable code within the documentation. So it is important that they work correctly. To ensure this, all these e2e scenarios are run as part of the -automated Travis tests. +continuous integration tests. If you are adding an example with an e2e test, you should [run the test locally](#e2e-tests) first to ensure it passes. You can change `it(...)` to `fit(...)` to run only your test, diff --git a/Gruntfile.js b/Gruntfile.js index 3cfb82a8af30..4b647bb8f438 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -14,7 +14,8 @@ var semver = require('semver'); var exec = require('shelljs').exec; var pkg = require(__dirname + '/package.json'); -var docsScriptFolder = 'scripts/docs.angularjs.org-firebase'; +var codeScriptFolder = util.codeScriptFolder; +var docsScriptFolder = util.docsScriptFolder; // Node.js version checks if (!semver.satisfies(process.version, pkg.engines.node)) { @@ -45,7 +46,7 @@ if (!match) { } // Ensure Node.js dependencies have been installed -if (!process.env.TRAVIS && !process.env.JENKINS_HOME) { +if (!process.env.CI) { var yarnOutput = exec('yarn install'); if (yarnOutput.code !== 0) { throw new Error('Yarn install failed: ' + yarnOutput.stderr); @@ -109,16 +110,14 @@ module.exports = function(grunt) { }, testserver: { options: { - // We use end2end task (which does not start the webserver) - // and start the webserver as a separate process (in travis_build.sh) - // to avoid https://github.com/joyent/libuv/issues/826 + // We start the webserver as a separate process from the E2E tests port: 8000, hostname: '0.0.0.0', middleware: function(connect, options) { var base = Array.isArray(options.base) ? options.base[options.base.length - 1] : options.base; return [ function(req, resp, next) { - // cache get requests to speed up tests on travis + // cache GET requests to speed up tests if (req.method === 'GET') { resp.setHeader('Cache-control', 'public, max-age=3600'); } @@ -160,8 +159,7 @@ module.exports = function(grunt) { protractor: { normal: 'protractor-conf.js', - travis: 'protractor-travis-conf.js', - jenkins: 'protractor-jenkins-conf.js' + circleci: 'protractor-circleci-conf.js' }, @@ -169,9 +167,9 @@ module.exports = function(grunt) { build: ['build'], tmp: ['tmp'], deploy: [ - 'deploy/docs', - 'deploy/code', - docsScriptFolder + '/functions/html' + codeScriptFolder + '/deploy', + docsScriptFolder + '/deploy', + docsScriptFolder + '/functions/content' ] }, @@ -372,11 +370,10 @@ module.exports = function(grunt) { }, deployFirebaseCode: { files: [ - // copy files that are not handled by compress { cwd: 'build', - src: '**/*.{zip,jpg,jpeg,png}', - dest: 'deploy/code/' + deployVersion + '/', + src: '**', + dest: codeScriptFolder + '/deploy/' + deployVersion + '/', expand: true } ] @@ -386,19 +383,19 @@ module.exports = function(grunt) { // The source files are needed by the embedded examples in the docs app. { src: ['build/angular*.{js,js.map,min.js}', 'build/sitemap.xml'], - dest: 'deploy/docs/', + dest: docsScriptFolder + '/deploy/', expand: true, flatten: true }, { cwd: 'build/docs', src: ['**', '!ptore2e/**', '!index*.html'], - dest: 'deploy/docs/', + dest: docsScriptFolder + '/deploy/', expand: true }, { src: 'build/docs/index-production.html', - dest: 'deploy/docs/index.html' + dest: docsScriptFolder + '/deploy/index.html' }, { src: 'build/docs/index-production.html', @@ -407,7 +404,7 @@ module.exports = function(grunt) { { cwd: 'build/docs', src: 'partials/**', - dest: docsScriptFolder + '/functions/content', + dest: docsScriptFolder + '/functions/content/', expand: true } ] @@ -423,16 +420,6 @@ module.exports = function(grunt) { expand: true, dot: true, dest: dist + '/' - }, - deployFirebaseCode: { - options: { - mode: 'gzip' - }, - // Already compressed files should not be compressed again - src: ['**', '!**/*.{zip,png,jpeg,jpg}'], - cwd: 'build', - expand: true, - dest: 'deploy/code/' + deployVersion + '/' } }, @@ -498,14 +485,9 @@ module.exports = function(grunt) { 'connect:testserver', 'protractor:normal' ]); - grunt.registerTask('test:travis-protractor', 'Run the end to end tests with Protractor for Travis CI builds', [ + grunt.registerTask('test:circleci-protractor', 'Run the end to end tests with Protractor for CircleCI builds', [ 'connect:testserver', - 'protractor:travis' - ]); - grunt.registerTask('test:ci-protractor', 'Run the end to end tests with Protractor for Jenkins CI builds', [ - 'webdriver', - 'connect:testserver', - 'protractor:jenkins' + 'protractor:circleci' ]); grunt.registerTask('test:e2e', 'Alias for test:protractor', ['test:protractor']); grunt.registerTask('test:promises-aplus',[ @@ -535,10 +517,7 @@ module.exports = function(grunt) { 'eslint' ]); grunt.registerTask('prepareDeploy', [ - 'package', - 'compress:deployFirebaseCode', 'copy:deployFirebaseCode', - 'firebaseDocsJsonForTravis', 'copy:deployFirebaseDocs' ]); grunt.registerTask('default', ['package']); @@ -546,7 +525,7 @@ module.exports = function(grunt) { function reportOrFail(message) { - if (process.env.TRAVIS || process.env.JENKINS_HOME) { + if (process.env.CI) { throw new Error(message); } else { console.log('==============================================================================='); diff --git a/LICENSE b/LICENSE index 64c3d2875d8f..4ae0d5bb9fae 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2010-2019 Google, Inc. http://angularjs.org +Copyright (c) 2010-2020 Google LLC. http://angularjs.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 18d1280cd071..9a86e8b34858 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -AngularJS [![Build Status](https://travis-ci.org/angular/angular.js.svg?branch=master)](https://travis-ci.org/angular/angular.js) +AngularJS [![CircleCI](https://circleci.com/gh/angular/angular.js/tree/master.svg?style=shield)](https://circleci.com/gh/angular/workflows/angular.js/tree/master) ========= AngularJS lets you write client-side web applications as if you had a smarter browser. It lets you @@ -14,9 +14,11 @@ piece of cake. Best of all? It makes development fun! -------------------- -**On July 1, 2018 AngularJS entered a 3 year Long Term Support period:** [Find out more](https://docs.angularjs.org/misc/version-support-status) +**AngularJS support has officially ended as of January 2022. +[See what ending support means](https://docs.angularjs.org/misc/version-support-status) +and [read the end of life announcement](https://goo.gle/angularjs-end-of-life).** -**Looking for the new Angular? Go here:** https://github.com/angular/angular +**Visit [angular.io](https://angular.io) for the actively supported Angular.** -------------------- @@ -55,11 +57,12 @@ component in an interconnected way like a well-oiled machine. AngularJS is JavaS and done right. (Well it is not really MVC, read on, to understand what this means.) #### MVC, no, MV* done the right way! -MVC, short for Model-View-Controller, is a design pattern, i.e. how the code should be organized and -how the different parts of an application separated for proper readability and debugging. Model is -the data and the database. View is the user interface and what the user sees. Controller is the main -link between Model and View. These are the three pillars of major programming frameworks present on -the market today. On the other hand AngularJS works on MV*, short for Model-View-_Whatever_. The +[MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), short for +Model-View-Controller, is a design pattern, i.e. how the code should be organized and how the +different parts of an application separated for proper readability and debugging. Model is the data +and the database. View is the user interface and what the user sees. Controller is the main link +between Model and View. These are the three pillars of major programming frameworks present on the +market today. On the other hand AngularJS works on MV*, short for Model-View-_Whatever_. The _Whatever_ is AngularJS's way of telling that you may create any kind of linking between the Model and the View here. diff --git a/RELEASE.md b/RELEASE.md index 5f724633be45..8963b0be11bf 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -36,7 +36,7 @@ Usually this will be the commit containing the release notes, but it may also be ## Run "release" script ```bash - scripts/jenkins/release.sh --git-push-dryrun=false --commit-sha=8822a4f --version-number=1.7.6 --version-name=gravity-manipulation + scripts/release/release.sh --git-push-dryrun=false --commit-sha=8822a4f --version-number=1.7.6 --version-name=gravity-manipulation ``` 1) The SHA is of the commit to release (could be in the past). @@ -67,10 +67,10 @@ If we want to make our files available, we need submit our CLs before this time This is the version used to compute what version to link to in the CDN. If you update this too early then the CDN lookup fails and you end up with 'null, for the version, which breaks the docs. -## Verify angularjs.org download modal has latest version (updates via Travis job) +## Verify angularjs.org download modal has latest version (updates via CI job) -The versions in the modal are updated (based on the versions available on CDN) as part of the Travis deploy stage: https://github.com/angular/angularjs.org/blob/a4d25c5abcd39e8ce19d31cb1c78073d13c4c974/.travis.yml#L26 -(You may need to explicitly trigger the Travis job. e.g. re-running the last job.) +The versions in the modal are updated (based on the versions available on CDN) as part of the CI deploy stage. +(You may need to explicitly trigger the CI job. e.g. re-running the last `deploy` job.) ## Announce the release (via official Google accounts) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000000..584eca530514 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,16 @@ +# Security Policy + +## Supported Versions + +**AngularJS support has officially ended as of January 2022.** +[See what ending support means](https://docs.angularjs.org/misc/version-support-status) +and [read the end of life announcement](https://goo.gle/angularjs-end-of-life). + +Visit [angular.io](https://angular.io) for the actively supported Angular. + +| Version | Supported | Status | Comments | +| ----------- | ------------------ | --------------------- | ------------------------------------ | +| 1.8.x | :x: | All support ended | | +| 1.3.x-1.7.x | :x: | All support ended | | +| 1.2.x | :x: | All support ended | Last version to provide IE 8 support | +| <1.2.0 | :x: | All support ended | | diff --git a/docs/app/assets/css/docs.css b/docs/app/assets/css/docs.css index 65abc5247f0c..eb28ad39d044 100644 --- a/docs/app/assets/css/docs.css +++ b/docs/app/assets/css/docs.css @@ -478,10 +478,10 @@ iframe.example { #navbar-sub { padding-top: 10px; padding-bottom: 5px; - background: rgba(245,245,245,0.88); + background: rgba(245,245,245,1); box-shadow: 0 0 2px #999; z-index: 1028; - top: 83px; + top: 57px; } .main-body-grid { @@ -982,7 +982,7 @@ toc-container > div > toc-tree > ul > li > toc-tree > ul > li toc-tree > ul li { #navbar-sub { position: relative; - top: 17px; + top: 0; margin-top: 80px; padding-bottom: 0; margin-bottom: 0; diff --git a/docs/app/src/examples.js b/docs/app/src/examples.js index b5b21c5393fa..7a5ebb62325f 100644 --- a/docs/app/src/examples.js +++ b/docs/app/src/examples.js @@ -55,7 +55,7 @@ angular.module('examples', []) return function(url, newWindow, fields) { /** * If the form posts to target="_blank", pop-up blockers can cause it not to work. - * If a user choses to bypass pop-up blocker one time and click the link, they will arrive at + * If a user chooses to bypass pop-up blocker one time and click the link, they will arrive at * a new default plnkr, not a plnkr with the desired template. Given this undesired behavior, * some may still want to open the plnk in a new window by opting-in via ctrl+click. The * newWindow param allows for this possibility. @@ -74,7 +74,7 @@ angular.module('examples', []) }]) .factory('createCopyrightNotice', function() { - var COPYRIGHT = 'Copyright ' + (new Date()).getFullYear() + ' Google Inc. All Rights Reserved.\n' + var COPYRIGHT = 'Copyright ' + (new Date()).getFullYear() + ' Google LLC. All Rights Reserved.\n' + 'Use of this source code is governed by an MIT-style license that\n' + 'can be found in the LICENSE file at http://angular.io/license'; var COPYRIGHT_JS_CSS = '\n\n/*\n' + COPYRIGHT + '\n*/'; diff --git a/docs/config/processors/keywords.js b/docs/config/processors/keywords.js index 8babc671dc5b..40fb97c63a89 100644 --- a/docs/config/processors/keywords.js +++ b/docs/config/processors/keywords.js @@ -47,13 +47,13 @@ module.exports = function generateKeywordsProcessor(log, readFilesProcessor) { } - areasToSearch = _.indexBy(this.areasToSearch); - propertiesToIgnore = _.indexBy(this.propertiesToIgnore); + areasToSearch = _.keyBy(this.areasToSearch); + propertiesToIgnore = _.keyBy(this.propertiesToIgnore); log.debug('Properties to ignore', propertiesToIgnore); - docTypesToIgnore = _.indexBy(this.docTypesToIgnore); + docTypesToIgnore = _.keyBy(this.docTypesToIgnore); log.debug('Doc types to ignore', docTypesToIgnore); - var ignoreWordsMap = _.indexBy(wordsToIgnore); + var ignoreWordsMap = _.keyBy(wordsToIgnore); // If the title contains a name starting with ng, e.g. "ngController", then add the module name // without the ng to the title text, e.g. "controller". diff --git a/docs/config/processors/pages-data.js b/docs/config/processors/pages-data.js index 9dc39b331257..c6e24bcb9568 100644 --- a/docs/config/processors/pages-data.js +++ b/docs/config/processors/pages-data.js @@ -224,7 +224,7 @@ module.exports = function generatePagesDataProcessor(log) { .map(function(doc) { return _.pick(doc, ['name', 'area', 'path']); }) - .indexBy('path') + .keyBy('path') .value(); docs.push({ diff --git a/docs/config/processors/versions-data.js b/docs/config/processors/versions-data.js index d52b6c420f69..fd7aceaa4d70 100644 --- a/docs/config/processors/versions-data.js +++ b/docs/config/processors/versions-data.js @@ -13,11 +13,11 @@ module.exports = function generateVersionDocProcessor(gitData) { return { $runAfter: ['generatePagesDataProcessor'], $runBefore: ['rendering-docs'], - // the blacklist is to remove rogue builds that are in the npm repository but not on code.angularjs.org - blacklist: ['1.3.4-build.3588'], + // Remove rogue builds that are in the npm repository but not on code.angularjs.org + ignoredBuilds: ['1.3.4-build.3588'], $process: function(docs) { - var blacklist = this.blacklist; + var ignoredBuilds = this.ignoredBuilds; var currentVersion = require('../../../build/version.json'); var output = exec('yarn info angular versions --json', { silent: true }).stdout.split('\n')[0]; var allVersions = processAllVersionsResponse(JSON.parse(output).data); @@ -57,7 +57,7 @@ module.exports = function generateVersionDocProcessor(gitData) { versions = versions .filter(function(versionStr) { - return blacklist.indexOf(versionStr) === -1; + return ignoredBuilds.indexOf(versionStr) === -1; }) .map(function(versionStr) { return semver.parse(versionStr); diff --git a/docs/config/templates/app/indexPage.template.html b/docs/config/templates/app/indexPage.template.html index eb5c6614a2bc..126aab449e5e 100644 --- a/docs/config/templates/app/indexPage.template.html +++ b/docs/config/templates/app/indexPage.template.html @@ -1,3 +1,12 @@ +{# Macros #} +{%- macro addTag(name, attributes) %} + <{$ name $} + {%- for attrName, attrValue in attributes -%} + {$ ' ' + attrName $}="{$ attrValue $}" + {%- endfor -%} + > +{%- endmacro -%} + @@ -24,50 +33,27 @@ })(); + {% for stylesheet in doc.stylesheets %} + {$- addTag('link', {rel: 'stylesheet', href: stylesheet, type: 'text/css'}) -$} + {% endfor %} + {% for script in doc.scripts %} + {$- addTag('script', {src: script}) -$} + {% endfor %} + +