Skip to content

Commit 3276432

Browse files
authored
Merge branch 'angular:master' into align-attr-as-input-in-dialog-actions-#18479-2
2 parents 815cf8f + 1f40b7d commit 3276432

File tree

291 files changed

+15091
-7927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+15091
-7927
lines changed

.bazelignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
node_modules
22

3+
integration/harness-e2e-cli/.angular
4+
integration/harness-e2e-cli/node_modules
5+
36
integration/ng-update-v13/.angular
47
integration/ng-update-v13/node_modules
58

.github/CODEOWNERS

Lines changed: 129 additions & 129 deletions
Large diffs are not rendered by default.

.github/workflows/dev-infra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: angular/dev-infra/github-actions/commit-message-based-labels@f0f363cb4ce5b5faf14e3d3bb7eeb7c7aee72da7
12+
- uses: angular/dev-infra/github-actions/commit-message-based-labels@8298e121c51960857ef39abc16b743775ff6be68
1313
with:
1414
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}

.github/workflows/lock-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
lock_closed:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: angular/dev-infra/github-actions/lock-closed@f0f363cb4ce5b5faf14e3d3bb7eeb7c7aee72da7
12+
- uses: angular/dev-infra/github-actions/lock-closed@8298e121c51960857ef39abc16b743775ff6be68
1313
with:
1414
lock-bot-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,3 @@ testem.log
5050
*.log
5151
.ng-dev.user*
5252
.husky/_
53-
54-
# Variables that are inlined into the dev app index.html
55-
/src/dev-app/variables.json

.ng-dev/release.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ export const release: ReleaseConfig = {
9090
},
9191
},
9292
publishRegistry: 'https://wombat-dressing-room.appspot.com',
93-
npmPackages: releasePackages.map(pkg => `@angular/${pkg}`),
93+
representativeNpmPackage: '@angular/cdk',
94+
npmPackages: releasePackages.map(pkg => ({name: `@angular/${pkg}`})),
9495
buildPackages: async () => {
9596
// The `performNpmReleaseBuild` function is loaded at runtime as loading of the
9697
// script results in an invocation of Bazel for any `yarn ng-dev` command.

CHANGELOG.md

Lines changed: 131 additions & 4 deletions
Large diffs are not rendered by default.

DEV_ENVIRONMENT.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,18 @@ export HUSKY=0
7878
```
7979

8080
### Injecting variables into the dev app
81-
Variables can be injected into the dev app by creating the `src/dev-app/variables.json` file.
82-
They'll be made available under the `window.DEV_APP_VARIABLES` object. The file isn't checked into
83-
Git and it can be used to pass private configuration like API keys. Variables currently being used:
81+
82+
A set of environment variables is made available within the dev-app. Such variables
83+
will be injected into the dev-app, so that e.g. API keys can be used for development
84+
without requiring secrets to be committed.
85+
86+
The following variables are currently used in the dev-app:
8487

8588
* `GOOGLE_MAPS_KEY` - Optional key for the Google Maps API.
89+
90+
For example, you can store a personal development Google Maps API key for the
91+
dev-app within your `.bashrc` or `.zshrc` file.
92+
93+
```bash
94+
export GOOGLE_MAPS_KEY=<api-key>
95+
```

WORKSPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ http_archive(
1616
# Add sass rules
1717
http_archive(
1818
name = "io_bazel_rules_sass",
19-
sha256 = "435efe759f1c8baffadc320ecc1830454da181fa790aa83bb4326f07e903a0f4",
20-
strip_prefix = "rules_sass-1.41.0",
19+
sha256 = "903858e0fb5eda0b36d37e1ce4cbcfbe03f65a5f153d894dc8a9894a4884e564",
20+
strip_prefix = "rules_sass-1.49.0",
2121
urls = [
22-
"https://github.com/bazelbuild/rules_sass/archive/1.41.0.zip",
22+
"https://github.com/bazelbuild/rules_sass/archive/1.49.0.zip",
2323
],
2424
)
2525

guides/using-component-harnesses.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ The following sections will illustrate these benefits in more detail.
2828
## Which kinds of tests can use harnesses?
2929

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

3535
## Getting started
3636

3737
The foundation for all test harnesses lives in `@angular/cdk/testing`. Start by importing either
38-
`TestbedHarnessEnvironment` or `ProtractorHarnessEnvironment` based on whether you're writing a
38+
`TestbedHarnessEnvironment` or `SeleniumWebDriverHarnessEnvironment` based on whether you're writing a
3939
unit test or an e2e test. From the `HarnessEnvironment`, you can get a `HarnessLoader` instance,
4040
which you will use to load Angular Material component harnesses. For example, if we're writing unit
4141
tests for a `UserProfile` component, the code might look like this:
@@ -64,8 +64,8 @@ different paths.
6464
- `@angular/cdk/testing` contains symbols that are shared regardless of the environment your tests
6565
are in.
6666
- `@angular/cdk/testing/testbed` contains symbols that are used only in Karma tests.
67-
- `@angular/cdk/testing/protractor` (not shown above) contains symbols that are used only in
68-
Protractor tests.
67+
- `@angular/cdk/testing/selenium-webdriver` (not shown above) contains symbols that are used only in
68+
Selenium WebDriver tests.
6969
7070
## Loading an Angular Material harness
7171
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
16+
# IDEs and editors
17+
/.idea
18+
.project
19+
.classpath
20+
.c9/
21+
*.launch
22+
.settings/
23+
*.sublime-workspace
24+
25+
# IDE - VSCode
26+
.vscode/*
27+
!.vscode/settings.json
28+
!.vscode/tasks.json
29+
!.vscode/launch.json
30+
!.vscode/extensions.json
31+
.history/*
32+
33+
# misc
34+
/.angular/cache
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
load("@bazel_skylib//lib:dicts.bzl", "dicts")
2+
load("//tools:integration.bzl", "CLI_PROJECT_MAPPINGS")
3+
load("//tools:defaults.bzl", "node_integration_test")
4+
5+
npmPackageMappings = dicts.add(
6+
CLI_PROJECT_MAPPINGS,
7+
{
8+
"//src/cdk:npm_package_archive": "@angular/cdk",
9+
"//src/material:npm_package_archive": "@angular/material",
10+
},
11+
)
12+
13+
node_integration_test(
14+
name = "test",
15+
srcs = glob(["**/*"]),
16+
commands = [
17+
# Note: We use a cache folder within the integration test as otherwise
18+
# the NPM package mapped archive would be cached in the system.
19+
# See: https://github.com/yarnpkg/yarn/issues/2165.
20+
# TODO(devversion): determine if a solution/workaround could live in the test runner.
21+
"yarn install --cache-folder .yarn_cache_folder/",
22+
"yarn e2e",
23+
],
24+
npm_packages = npmPackageMappings,
25+
setup_chromium = True,
26+
tags = [
27+
# This test relies on `yarn` so there needs to be internet access.
28+
"requires-network",
29+
],
30+
)

integration/harness-e2e-cli/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# HarnessE2eCli
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0-next.1.
4+
5+
## Development server
6+
7+
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.
8+
9+
## Code scaffolding
10+
11+
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`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
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.
24+
25+
## Further help
26+
27+
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.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"harness-e2e-cli": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
},
12+
"@schematics/angular:application": {
13+
"strict": true
14+
}
15+
},
16+
"root": "",
17+
"sourceRoot": "src",
18+
"prefix": "app",
19+
"architect": {
20+
"build": {
21+
"builder": "@angular-devkit/build-angular:browser",
22+
"options": {
23+
"outputPath": "dist/harness-e2e-cli",
24+
"index": "src/index.html",
25+
"main": "src/main.ts",
26+
"polyfills": "src/polyfills.ts",
27+
"tsConfig": "tsconfig.app.json",
28+
"inlineStyleLanguage": "scss",
29+
"assets": [
30+
"src/favicon.ico",
31+
"src/assets"
32+
],
33+
"styles": [
34+
"src/styles.scss"
35+
],
36+
"scripts": []
37+
},
38+
"configurations": {
39+
"production": {
40+
"budgets": [
41+
{
42+
"type": "initial",
43+
"maximumWarning": "500kb",
44+
"maximumError": "1mb"
45+
},
46+
{
47+
"type": "anyComponentStyle",
48+
"maximumWarning": "2kb",
49+
"maximumError": "4kb"
50+
}
51+
],
52+
"fileReplacements": [
53+
{
54+
"replace": "src/environments/environment.ts",
55+
"with": "src/environments/environment.prod.ts"
56+
}
57+
],
58+
"outputHashing": "all"
59+
},
60+
"development": {
61+
"buildOptimizer": false,
62+
"optimization": false,
63+
"vendorChunk": true,
64+
"extractLicenses": false,
65+
"sourceMap": true,
66+
"namedChunks": true
67+
}
68+
},
69+
"defaultConfiguration": "production"
70+
},
71+
"serve": {
72+
"builder": "@angular-devkit/build-angular:dev-server",
73+
"configurations": {
74+
"production": {
75+
"browserTarget": "harness-e2e-cli:build:production"
76+
},
77+
"development": {
78+
"browserTarget": "harness-e2e-cli:build:development"
79+
}
80+
},
81+
"defaultConfiguration": "development"
82+
},
83+
"extract-i18n": {
84+
"builder": "@angular-devkit/build-angular:extract-i18n",
85+
"options": {
86+
"browserTarget": "harness-e2e-cli:build"
87+
}
88+
},
89+
"test": {
90+
"builder": "@angular-devkit/build-angular:karma",
91+
"options": {
92+
"main": "src/test.ts",
93+
"polyfills": "src/polyfills.ts",
94+
"tsConfig": "tsconfig.spec.json",
95+
"karmaConfig": "karma.conf.js",
96+
"inlineStyleLanguage": "scss",
97+
"assets": [
98+
"src/favicon.ico",
99+
"src/assets"
100+
],
101+
"styles": [
102+
"src/styles.scss"
103+
],
104+
"scripts": []
105+
}
106+
}
107+
}
108+
}
109+
},
110+
"defaultProject": "harness-e2e-cli"
111+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {Builder} from 'selenium-webdriver';
2+
import {
3+
ServiceBuilder,
4+
Options as ChromeOptions,
5+
setDefaultService,
6+
} from 'selenium-webdriver/chrome.js';
7+
8+
export function configureDriver() {
9+
const options = new ChromeOptions();
10+
const service = new ServiceBuilder(process.env['CHROMEDRIVER_BIN']!);
11+
12+
options.headless();
13+
options.addArguments('--no-sandbox');
14+
options.setChromeBinaryPath(process.env['CHROME_BIN']!);
15+
16+
setDefaultService(service.build());
17+
18+
return new Builder().forBrowser('chrome').setChromeOptions(options).build();
19+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"spec_dir": "e2e",
3+
"spec_files": [
4+
"**/*.spec.ts"
5+
],
6+
"env": {
7+
"random": true
8+
}
9+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

0 commit comments

Comments
 (0)