Skip to content

Commit 4ea2304

Browse files
πŸ“¦ Update linting devDependencies (#40197)
* πŸ“¦ Update linting devDependencies * `amp lint --fix` * Fix formatting for Markdown files * Fix/remove broken links in Markdown files * Add [403, 429] HTTP status codes to the ignore-list for `amp check-links` --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Rozenberg <[email protected]>
1 parent 340918e commit 4ea2304

File tree

23 files changed

+1397
-970
lines changed

23 files changed

+1397
-970
lines changed

β€Žads/README.mdβ€Ž

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ This guide provides details for ad networks to create an `amp-ad` integration fo
1313

1414
<!-- {"maxdepth": 2} -->
1515

16-
- [Overview](#overview)
17-
- [Constraints](#constraints)
18-
- [The iframe sandbox](#the-iframe-sandbox)
19-
- [Available information to the ad](#available-information-to-the-ad)
20-
- [Available APIs](#available-apis)
21-
- [Exceptions to available APIs and information](#exceptions-to-available-apis-and-information)
22-
- [Ad viewability](#ad-viewability)
23-
- [Ad resizing](#ad-resizing)
24-
- [Support for multi-size ad requests](#support-for-multi-size-ad-requests)
25-
- [amp-consent integration](#amp-consent-integration)
26-
- [Optimizing ad performance](#optimizing-ad-performance)
27-
- [Ad markup](#ad-markup)
28-
- [1st party cookies](#1st-party-cookies)
29-
- [Developer guidelines for a pull request](#developer-guidelines-for-a-pull-request)
30-
- [Files to change](#files-to-change)
31-
- [Verify your examples](#verify-your-examples)
32-
- [Tests](#tests)
33-
- [Lint and type-check](#lint-and-type-check)
34-
- [Other tips](#other-tips)
35-
- [Developer announcements for ads related API changes](#developer-announcements-for-ads-related-api-changes)
16+
- [Overview](#overview)
17+
- [Constraints](#constraints)
18+
- [The iframe sandbox](#the-iframe-sandbox)
19+
- [Available information to the ad](#available-information-to-the-ad)
20+
- [Available APIs](#available-apis)
21+
- [Exceptions to available APIs and information](#exceptions-to-available-apis-and-information)
22+
- [Ad viewability](#ad-viewability)
23+
- [Ad resizing](#ad-resizing)
24+
- [Support for multi-size ad requests](#support-for-multi-size-ad-requests)
25+
- [amp-consent integration](#amp-consent-integration)
26+
- [Optimizing ad performance](#optimizing-ad-performance)
27+
- [Ad markup](#ad-markup)
28+
- [1st party cookies](#1st-party-cookies)
29+
- [Developer guidelines for a pull request](#developer-guidelines-for-a-pull-request)
30+
- [Files to change](#files-to-change)
31+
- [Verify your examples](#verify-your-examples)
32+
- [Tests](#tests)
33+
- [Lint and type-check](#lint-and-type-check)
34+
- [Other tips](#other-tips)
35+
- [Developer announcements for ads related API changes](#developer-announcements-for-ads-related-api-changes)
3636

3737
## Overview
3838

@@ -44,15 +44,15 @@ If you are an ad technology provider looking to integrate with AMP HTML, please
4444

4545
Below is a summary of constraints placed on external resources, such as ads in AMP HTML:
4646

47-
- Because AMP pages are served on HTTPS and ads cannot be proxied, ads must be served over HTTPS.
48-
- The size of an ad unit must be static. It must be knowable without fetching the ad and it cannot change at runtime except through [iframe resizing](#ad-resizing).
49-
- If placing the ad requires running JavaScript (assumed to be true for 100% of ads served through networks), the ad must be placed on an origin different from the AMP document itself. Reasons include:
50-
- Improved security.
51-
- Takes synchronous HTTP requests made by the ad out of the critical rendering path of the primary page.
52-
- Allows browsers to run the ad in a different process from the primary page (even better security and prevents JS inside the ad to block the main page UI thread).
53-
- Prevents ads doing less than optimal things to measure user behavior and other interference with the primary page.
54-
- The AMP Runtime may at any moment decide that there are too many iframes on a page and that memory is low. In that case, the AMP Runtime unloads ads that were previously loaded and are no longer visible. It may later load new ads in the same slot if the user scrolls them back into view.
55-
- The AMP Runtime may decide to set an ad that is currently not visible to `display: none` to reduce browser layout and compositing cost.
47+
- Because AMP pages are served on HTTPS and ads cannot be proxied, ads must be served over HTTPS.
48+
- The size of an ad unit must be static. It must be knowable without fetching the ad and it cannot change at runtime except through [iframe resizing](#ad-resizing).
49+
- If placing the ad requires running JavaScript (assumed to be true for 100% of ads served through networks), the ad must be placed on an origin different from the AMP document itself. Reasons include:
50+
- Improved security.
51+
- Takes synchronous HTTP requests made by the ad out of the critical rendering path of the primary page.
52+
- Allows browsers to run the ad in a different process from the primary page (even better security and prevents JS inside the ad to block the main page UI thread).
53+
- Prevents ads doing less than optimal things to measure user behavior and other interference with the primary page.
54+
- The AMP Runtime may at any moment decide that there are too many iframes on a page and that memory is low. In that case, the AMP Runtime unloads ads that were previously loaded and are no longer visible. It may later load new ads in the same slot if the user scrolls them back into view.
55+
- The AMP Runtime may decide to set an ad that is currently not visible to `display: none` to reduce browser layout and compositing cost.
5656

5757
## The iframe sandbox
5858

@@ -199,9 +199,9 @@ window.context
199199

200200
Here are some factors that affect whether the resize will be executed:
201201

202-
- Whether the resize is triggered by the user action;
203-
- Whether the resize is requested for a currently active ad;
204-
- Whether the resize is requested for an ad below the viewport or above the viewport.
202+
- Whether the resize is triggered by the user action;
203+
- Whether the resize is requested for a currently active ad;
204+
- Whether the resize is requested for an ad below the viewport or above the viewport.
205205

206206
#### Specifying an overflow element
207207

@@ -343,12 +343,12 @@ Please read through [developing.md](../docs/developing.md) before contributing t
343343

344344
If you're adding support for a new third-party ad service, changes to the following files are expected:
345345

346-
- `/ads/yournetwork.js`: Implement the main logic here. This is the code that's invoked in the third-party iframe once loaded.
347-
- `/ads/yournetwork.md`: Documentation detailing yourr ad service for publishers to read.
348-
- `/ads/_config.js`: Add service specific configuration here.
349-
- `/3p/vendors/yournetwork.js`: Register your service here.
350-
- `/extensions/amp-ad/amp-ad.md`: Add a link that points to your publisher doc.
351-
- `/examples/ads.amp.html`: Add publisher examples here. Since a real ad isn't guaranteed to fill, a consistently displayed fake ad is highly recommended here to help AMP developers confidently identify new bugs.
346+
- `/ads/yournetwork.js`: Implement the main logic here. This is the code that's invoked in the third-party iframe once loaded.
347+
- `/ads/yournetwork.md`: Documentation detailing yourr ad service for publishers to read.
348+
- `/ads/_config.js`: Add service specific configuration here.
349+
- `/3p/vendors/yournetwork.js`: Register your service here.
350+
- `/extensions/amp-ad/amp-ad.md`: Add a link that points to your publisher doc.
351+
- `/examples/ads.amp.html`: Add publisher examples here. Since a real ad isn't guaranteed to fill, a consistently displayed fake ad is highly recommended here to help AMP developers confidently identify new bugs.
352352

353353
### Verify your examples
354354

@@ -379,10 +379,10 @@ To speed up the review process, please run `amp lint` and `amp check-types`, the
379379

380380
### Other tips
381381

382-
- Add **cc ampproject/wg-monetization** in all pull request's descriptions.
383-
- It's highly recommended to maintain [an integration test outside AMP repo](../3p/README.md#adding-proper-integration-tests).
384-
- Please consider implementing the `render-start` and `no-content-available` APIs (see [Available APIs](#available-apis)), which helps AMP to provide user a much better ad loading experience.
385-
- [CLA](../docs/contributing.md#contributing-code): for anyone who has trouble to pass the automatic CLA check in a pull request, try to follow the guidelines provided by the CLA Bot. Common mistakes are:
382+
- Add **cc ampproject/wg-monetization** in all pull request's descriptions.
383+
- It's highly recommended to maintain [an integration test outside AMP repo](../3p/README.md#adding-proper-integration-tests).
384+
- Please consider implementing the `render-start` and `no-content-available` APIs (see [Available APIs](#available-apis)), which helps AMP to provide user a much better ad loading experience.
385+
- [CLA](../docs/contributing.md#contributing-code): for anyone who has trouble to pass the automatic CLA check in a pull request, try to follow the guidelines provided by the CLA Bot. Common mistakes are:
386386
1. Using a different email address in the git commit.
387387
2. Not providing the exact company name in the PR thread.
388388

β€Žads/google/a4a/docs/Network-Impl-Guide.mdβ€Ž

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ This guide outlines the requirements and steps for ad networks to implement Fast
44
Fetch for early ad request and support for AMP ads returned by the ad network to
55
be given preferential rendering.
66

7-
- _Status: Draft_
8-
- _Authors: [[email protected]](mailto:[email protected]),
9-
10-
- _Last Updated: 1-27-2016_
7+
- _Status: Draft_
8+
- _Authors: [[email protected]](mailto:[email protected]),
9+
10+
- _Last Updated: 1-27-2016_
1111

1212
<!--
1313
(Do not remove or edit this comment.)
@@ -16,19 +16,19 @@ be given preferential rendering.
1616
amp markdown-toc --fix
1717
-->
1818

19-
- [Background](#background)
20-
- [Overview](#overview)
21-
- [Detailed design](#detailed-design)
22-
- [Ad server requirements](#ad-server-requirements)
23-
- [SSL](#ssl)
24-
- [AMPHTML ad creative signature](#amphtml-ad-creative-signature)
25-
- [Ad response headers](#ad-response-headers)
26-
- [Creating an AMPHTML ad extension implementation](#creating-an-amphtml-ad-extension-implementation)
27-
- [Create the implementation script](#create-the-implementation-script)
28-
- [Create the configuration file](#create-the-configuration-file)
29-
- [Create documentation](#create-documentation)
30-
- [Create tests](#create-tests)
31-
- [Checklist for ad network implementation](#checklist-for-ad-network-implementation)
19+
- [Background](#background)
20+
- [Overview](#overview)
21+
- [Detailed design](#detailed-design)
22+
- [Ad server requirements](#ad-server-requirements)
23+
- [SSL](#ssl)
24+
- [AMPHTML ad creative signature](#amphtml-ad-creative-signature)
25+
- [Ad response headers](#ad-response-headers)
26+
- [Creating an AMPHTML ad extension implementation](#creating-an-amphtml-ad-extension-implementation)
27+
- [Create the implementation script](#create-the-implementation-script)
28+
- [Create the configuration file](#create-the-configuration-file)
29+
- [Create documentation](#create-documentation)
30+
- [Create tests](#create-tests)
31+
- [Checklist for ad network implementation](#checklist-for-ad-network-implementation)
3232

3333
## Background
3434

@@ -208,8 +208,7 @@ _For reference, see [Figure 1: Part A](#figure-1-fast-fetch-rendering-flow)_.
208208
});
209209
```
210210

211-
Example configs: [AdSense](https://github.com/ampproject/amphtml/blob/main/extensions/amp-ad-network-adsense-impl/0.1/adsense-a4a-config.js#L68).
212-
Usage of Google Ad Manager and AdSense configs can be seen in [\_a4a-config.js](https://github.com/ampproject/amphtml/blob/main/ads/_a4a-config.js).
211+
Example usage of Google Ad Manager and AdSense configs can be seen in [\_a4a-config.js](https://github.com/ampproject/amphtml/blob/main/ads/_a4a-config.js).
213212

214213
#### Create documentation
215214

@@ -226,14 +225,14 @@ for your AMP ad network implementation.
226225

227226
## Checklist for ad network implementation
228227

229-
- [ ] All Server-AMP communication done with SSL
230-
- [ ] AMP ads sent to validation server
231-
- [ ] Validated AMP ads sent from network to AMP with signature
232-
- [ ] Validated AMP ads sent from network to AMP with appropriate headers
233-
- [ ] File hierarchy created within amphtml/extensions
234-
- [ ] Custom `amp-ad-network-<TYPE>-impl.js` overwrites `getAdUrl()`
235-
- [ ] `<TYPE>-a4a-config.js` implements `<TYPE>IsA4AEnabled()`
236-
- [ ] Mapping added for ad network to a4aRegistry map within `_a4a-config.js`
237-
- [ ] Documentation written in `amp-ad-network-<TYPE>-impl-internal.md`
238-
- [ ] Tests written in `test-amp-ad-network-<TYPE>-impl.js`
239-
- [ ] Pull request merged to the repo
228+
- [ ] All Server-AMP communication done with SSL
229+
- [ ] AMP ads sent to validation server
230+
- [ ] Validated AMP ads sent from network to AMP with signature
231+
- [ ] Validated AMP ads sent from network to AMP with appropriate headers
232+
- [ ] File hierarchy created within amphtml/extensions
233+
- [ ] Custom `amp-ad-network-<TYPE>-impl.js` overwrites `getAdUrl()`
234+
- [ ] `<TYPE>-a4a-config.js` implements `<TYPE>IsA4AEnabled()`
235+
- [ ] Mapping added for ad network to a4aRegistry map within `_a4a-config.js`
236+
- [ ] Documentation written in `amp-ad-network-<TYPE>-impl-internal.md`
237+
- [ ] Tests written in `test-amp-ad-network-<TYPE>-impl.js`
238+
- [ ] Pull request merged to the repo

β€Žbuild-system/server/new-server/transforms/utilities/lazy.tsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export class Lazy<T> {
2-
private declare initializer_: () => T;
3-
private declare value_: T | undefined;
2+
declare private initializer_: () => T;
3+
declare private value_: T | undefined;
44

55
constructor(initializer: () => T) {
66
this.initializer_ = initializer;

β€Žbuild-system/tasks/check-links.jsβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ function checkLinksInFile(file) {
131131
},
132132
},
133133
],
134+
// Ignore:
135+
// - 403 [Forbidden], some sites block automated requests.
136+
// - 429 [Too Many Requests], some sites rate-limit requests.
137+
aliveStatusCodes: [200, 403, 429],
134138
};
135139

136140
return new Promise((resolve, reject) => {

β€Žbuild-system/tasks/e2e/README.mdβ€Ž

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ AMP contributors embrace testing to maintain confidence that their code is execu
1010

1111
<!-- {"maxdepth": 1} -->
1212

13-
- [What is an end-to-end test?](#what-is-an-end-to-end-test)
14-
- [Choosing which features to test](#choosing-which-features-to-test)
15-
- [Writing E2E tests](#writing-e2e-tests)
16-
- [Debugging E2E tests](#debugging-e2e-tests)
13+
- [What is an end-to-end test?](#what-is-an-end-to-end-test)
14+
- [Choosing which features to test](#choosing-which-features-to-test)
15+
- [Writing E2E tests](#writing-e2e-tests)
16+
- [Debugging E2E tests](#debugging-e2e-tests)
1717

1818
This document is a usage guide. For full test command documentation, consult the following resource:
1919

20-
- [Information on executing tests](../../../docs/testing.md)
20+
- [Information on executing tests](../../../docs/testing.md)
2121

2222
## What is an end-to-end test?
2323

2424
Let's compare the test types available to AMP contributors:
2525

26-
- Unit tests
27-
- Integration tests
28-
- End-to-end tests
26+
- Unit tests
27+
- Integration tests
28+
- End-to-end tests
2929

3030
Unit tests are useful for testing individual behaviors of a feature or fix. They are cheap to execute since they use mocks heavily to eliminate dependencies that need to also be executed during testing. These should be the most common type of test for a feature. These should fail rarely for reasons other than bugs.
3131

@@ -43,13 +43,13 @@ End-to-end tests are able to test a full page as the user's browser would load i
4343

4444
End-to-end tests should verify the most important user flows of a component. Prioritize tests for behaviors that would make the page appear very obviously broken if there was a failure. For example:
4545

46-
- The component's initial render
47-
- Primary user interactions
48-
- e.g. clicking the next button on a carousel
49-
- Features with heavy usage by a large number of AMP publishers
50-
- e.g. loading more content at the bottom of an amp page
51-
- Important behaviors that are frequently broken
52-
- e.g. browser updates often break video autoplay behavior
46+
- The component's initial render
47+
- Primary user interactions
48+
- e.g. clicking the next button on a carousel
49+
- Features with heavy usage by a large number of AMP publishers
50+
- e.g. loading more content at the bottom of an amp page
51+
- Important behaviors that are frequently broken
52+
- e.g. browser updates often break video autoplay behavior
5353

5454
## Writing E2E tests
5555

β€Žbuild-system/tasks/markdown-toc/test/all-are-complete/allows-paragraph-after-list.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
amp markdown-toc --fix
88
-->
99

10-
- [section](#section)
10+
- [section](#section)
1111

1212
This paragraph should be preserved.
1313

β€Žbuild-system/tasks/markdown-toc/test/all-are-complete/arbitrary-header-indentation.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This TOC header has newlines and indentation that doesn't match the lookup strin
1111
amp markdown-toc --fix
1212
-->
1313

14-
- [section](#section)
14+
- [section](#section)
1515

1616
## section
1717

β€Žbuild-system/tasks/markdown-toc/test/all-are-complete/complete.mdβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
amp markdown-toc --fix
88
-->
99

10-
- [tacos](#tacos)
11-
- [asada](#asada)
12-
- [al pastor](#al-pastor)
13-
- [veggie](#veggie)
10+
- [tacos](#tacos)
11+
- [asada](#asada)
12+
- [al pastor](#al-pastor)
13+
- [veggie](#veggie)
1414

1515
## tacos
1616

β€Žbuild-system/tasks/markdown-toc/test/all-are-complete/ignores-unparsable-options.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This file has unparsable TOC options, but should still have a TOC and should not
1111

1212
<!-- unparsable -->
1313

14-
- [section](#section)
14+
- [section](#section)
1515

1616
## section
1717

β€Žbuild-system/tasks/markdown-toc/test/all-are-complete/uses-options.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<!-- {"maxdepth": 1} -->
1111

12-
- [included header one](#included-header-one)
13-
- [included header two](#included-header-two)
12+
- [included header one](#included-header-one)
13+
- [included header two](#included-header-two)
1414

1515
## included header one
1616

0 commit comments

Comments
Β (0)