Skip to content

Commit

Permalink
Merge branch 'angular:master' into align-attr-as-input-in-dialog-acti…
Browse files Browse the repository at this point in the history
…ons-angular#18479-2
  • Loading branch information
PooSham committed Jan 31, 2022
2 parents 815cf8f + 1f40b7d commit 3276432
Show file tree
Hide file tree
Showing 291 changed files with 15,091 additions and 7,927 deletions.
3 changes: 3 additions & 0 deletions .bazelignore
@@ -1,5 +1,8 @@
node_modules

integration/harness-e2e-cli/.angular
integration/harness-e2e-cli/node_modules

integration/ng-update-v13/.angular
integration/ng-update-v13/node_modules

Expand Down
258 changes: 129 additions & 129 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/dev-infra.yml
Expand Up @@ -9,6 +9,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: angular/dev-infra/github-actions/commit-message-based-labels@f0f363cb4ce5b5faf14e3d3bb7eeb7c7aee72da7
- uses: angular/dev-infra/github-actions/commit-message-based-labels@8298e121c51960857ef39abc16b743775ff6be68
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/lock-closed.yml
Expand Up @@ -9,6 +9,6 @@ jobs:
lock_closed:
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/lock-closed@f0f363cb4ce5b5faf14e3d3bb7eeb7c7aee72da7
- uses: angular/dev-infra/github-actions/lock-closed@8298e121c51960857ef39abc16b743775ff6be68
with:
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -50,6 +50,3 @@ testem.log
*.log
.ng-dev.user*
.husky/_

# Variables that are inlined into the dev app index.html
/src/dev-app/variables.json
3 changes: 2 additions & 1 deletion .ng-dev/release.ts
Expand Up @@ -90,7 +90,8 @@ export const release: ReleaseConfig = {
},
},
publishRegistry: 'https://wombat-dressing-room.appspot.com',
npmPackages: releasePackages.map(pkg => `@angular/${pkg}`),
representativeNpmPackage: '@angular/cdk',
npmPackages: releasePackages.map(pkg => ({name: `@angular/${pkg}`})),
buildPackages: async () => {
// The `performNpmReleaseBuild` function is loaded at runtime as loading of the
// script results in an invocation of Bazel for any `yarn ng-dev` command.
Expand Down
135 changes: 131 additions & 4 deletions CHANGELOG.md

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions DEV_ENVIRONMENT.md
Expand Up @@ -78,8 +78,18 @@ export HUSKY=0
```

### Injecting variables into the dev app
Variables can be injected into the dev app by creating the `src/dev-app/variables.json` file.
They'll be made available under the `window.DEV_APP_VARIABLES` object. The file isn't checked into
Git and it can be used to pass private configuration like API keys. Variables currently being used:

A set of environment variables is made available within the dev-app. Such variables
will be injected into the dev-app, so that e.g. API keys can be used for development
without requiring secrets to be committed.

The following variables are currently used in the dev-app:

* `GOOGLE_MAPS_KEY` - Optional key for the Google Maps API.

For example, you can store a personal development Google Maps API key for the
dev-app within your `.bashrc` or `.zshrc` file.

```bash
export GOOGLE_MAPS_KEY=<api-key>
```
6 changes: 3 additions & 3 deletions WORKSPACE
Expand Up @@ -16,10 +16,10 @@ http_archive(
# Add sass rules
http_archive(
name = "io_bazel_rules_sass",
sha256 = "435efe759f1c8baffadc320ecc1830454da181fa790aa83bb4326f07e903a0f4",
strip_prefix = "rules_sass-1.41.0",
sha256 = "903858e0fb5eda0b36d37e1ce4cbcfbe03f65a5f153d894dc8a9894a4884e564",
strip_prefix = "rules_sass-1.49.0",
urls = [
"https://github.com/bazelbuild/rules_sass/archive/1.41.0.zip",
"https://github.com/bazelbuild/rules_sass/archive/1.49.0.zip",
],
)

Expand Down
8 changes: 4 additions & 4 deletions guides/using-component-harnesses.md
Expand Up @@ -28,14 +28,14 @@ The following sections will illustrate these benefits in more detail.
## Which kinds of tests can use harnesses?

The Angular CDK's component harnesses are designed to work in multiple different test environments.
Support currently includes Angular's Testbed environment in Karma unit tests and Protractor
Support currently includes Angular's Testbed environment in Karma unit tests and Selenium WebDriver
end-to-end (e2e) tests. You can also support additional environments by creating custom extensions
of the CDK's `HarnessEnvironment` and `TestElement` classes.

## Getting started

The foundation for all test harnesses lives in `@angular/cdk/testing`. Start by importing either
`TestbedHarnessEnvironment` or `ProtractorHarnessEnvironment` based on whether you're writing a
`TestbedHarnessEnvironment` or `SeleniumWebDriverHarnessEnvironment` based on whether you're writing a
unit test or an e2e test. From the `HarnessEnvironment`, you can get a `HarnessLoader` instance,
which you will use to load Angular Material component harnesses. For example, if we're writing unit
tests for a `UserProfile` component, the code might look like this:
Expand Down Expand Up @@ -64,8 +64,8 @@ different paths.
- `@angular/cdk/testing` contains symbols that are shared regardless of the environment your tests
are in.
- `@angular/cdk/testing/testbed` contains symbols that are used only in Karma tests.
- `@angular/cdk/testing/protractor` (not shown above) contains symbols that are used only in
Protractor tests.
- `@angular/cdk/testing/selenium-webdriver` (not shown above) contains symbols that are used only in
Selenium WebDriver tests.
## Loading an Angular Material harness
Expand Down
16 changes: 16 additions & 0 deletions integration/harness-e2e-cli/.browserslistrc
@@ -0,0 +1,16 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
16 changes: 16 additions & 0 deletions integration/harness-e2e-cli/.editorconfig
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions integration/harness-e2e-cli/.gitignore
@@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
30 changes: 30 additions & 0 deletions integration/harness-e2e-cli/BUILD.bazel
@@ -0,0 +1,30 @@
load("@bazel_skylib//lib:dicts.bzl", "dicts")
load("//tools:integration.bzl", "CLI_PROJECT_MAPPINGS")
load("//tools:defaults.bzl", "node_integration_test")

npmPackageMappings = dicts.add(
CLI_PROJECT_MAPPINGS,
{
"//src/cdk:npm_package_archive": "@angular/cdk",
"//src/material:npm_package_archive": "@angular/material",
},
)

node_integration_test(
name = "test",
srcs = glob(["**/*"]),
commands = [
# Note: We use a cache folder within the integration test as otherwise
# the NPM package mapped archive would be cached in the system.
# See: https://github.com/yarnpkg/yarn/issues/2165.
# TODO(devversion): determine if a solution/workaround could live in the test runner.
"yarn install --cache-folder .yarn_cache_folder/",
"yarn e2e",
],
npm_packages = npmPackageMappings,
setup_chromium = True,
tags = [
# This test relies on `yarn` so there needs to be internet access.
"requires-network",
],
)
27 changes: 27 additions & 0 deletions integration/harness-e2e-cli/README.md
@@ -0,0 +1,27 @@
# HarnessE2eCli

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0-next.1.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
111 changes: 111 additions & 0 deletions integration/harness-e2e-cli/angular.json
@@ -0,0 +1,111 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"harness-e2e-cli": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/harness-e2e-cli",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "harness-e2e-cli:build:production"
},
"development": {
"browserTarget": "harness-e2e-cli:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "harness-e2e-cli:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
}
}
}
},
"defaultProject": "harness-e2e-cli"
}
19 changes: 19 additions & 0 deletions integration/harness-e2e-cli/e2e/driver.ts
@@ -0,0 +1,19 @@
import {Builder} from 'selenium-webdriver';
import {
ServiceBuilder,
Options as ChromeOptions,
setDefaultService,
} from 'selenium-webdriver/chrome.js';

export function configureDriver() {
const options = new ChromeOptions();
const service = new ServiceBuilder(process.env['CHROMEDRIVER_BIN']!);

options.headless();
options.addArguments('--no-sandbox');
options.setChromeBinaryPath(process.env['CHROME_BIN']!);

setDefaultService(service.build());

return new Builder().forBrowser('chrome').setChromeOptions(options).build();
}
9 changes: 9 additions & 0 deletions integration/harness-e2e-cli/e2e/jasmine.json
@@ -0,0 +1,9 @@
{
"spec_dir": "e2e",
"spec_files": [
"**/*.spec.ts"
],
"env": {
"random": true
}
}
3 changes: 3 additions & 0 deletions integration/harness-e2e-cli/e2e/package.json
@@ -0,0 +1,3 @@
{
"type": "module"
}

0 comments on commit 3276432

Please sign in to comment.