@ampproject/toolbox-linter
Advanced tools
Comparing version 1.1.2 to 2.0.0-alpha.0
@@ -13,3 +13,3 @@ /// <reference types="cheerio" /> | ||
export declare function buildSourceOrigin(url: string): string; | ||
export declare function corsEndpoints($: CheerioStatic): string[]; | ||
export declare function corsEndpoints($: CheerioStatic): String[]; | ||
export declare const absoluteUrl: (s: string | undefined, base: string | undefined) => string | undefined; | ||
@@ -16,0 +16,0 @@ export declare function fetchToCurl(url: string, init?: { |
@@ -36,7 +36,15 @@ "use strict"; | ||
function corsEndpoints($) { | ||
return [] | ||
.concat($("amp-list[src]") | ||
const result = []; | ||
const storyBookendSrc = $("amp-story amp-story-bookend").attr("src"); | ||
if (storyBookendSrc) { | ||
result.push(storyBookendSrc); | ||
} | ||
const bookendConfigSrc = $("amp-story").attr("bookend-config-src"); | ||
if (bookendConfigSrc) { | ||
result.push(bookendConfigSrc); | ||
} | ||
const ampListSrc = $("amp-list[src]") | ||
.map((_, e) => $(e).attr("src")) | ||
.get(), $("amp-story amp-story-bookend").attr("src"), $("amp-story").attr("bookend-config-src")) | ||
.filter(s => !!s); | ||
.get(); | ||
return result.concat(ampListSrc); | ||
} | ||
@@ -43,0 +51,0 @@ exports.corsEndpoints = corsEndpoints; |
@@ -39,6 +39,6 @@ /// <reference types="cheerio" /> | ||
export interface Metadata { | ||
"title": string; | ||
"publisher": string; | ||
"publisher-logo-src": string; | ||
"poster-portrait-src": string; | ||
"title"?: string; | ||
"publisher"?: string; | ||
"publisher-logo-src"?: string; | ||
"poster-portrait-src"?: string; | ||
"poster-square-src"?: string; | ||
@@ -45,0 +45,0 @@ "poster-landscape-src"?: string; |
@@ -63,5 +63,5 @@ "use strict"; | ||
.map((_, e) => { | ||
const src = $(e).attr("src"); | ||
const expectedHeight = parseInt($(e).attr("height"), 10); | ||
const expectedWidth = parseInt($(e).attr("width"), 10); | ||
const src = $(e).attr("src") || ""; | ||
const expectedHeight = parseInt($(e).attr("height") || "", 10); | ||
const expectedWidth = parseInt($(e).attr("width") || "", 10); | ||
const layout = $(e).attr("layout") || ""; | ||
@@ -68,0 +68,0 @@ return test(src, layout, expectedWidth, expectedHeight); |
@@ -25,3 +25,3 @@ "use strict"; | ||
}; | ||
return (await Promise.all(e.map(url => canXhrSameOrigin(helper_1.absoluteUrl(url, context.url) || "")))).filter(filter_1.notPass); | ||
return (await Promise.all(e.map(url => canXhrSameOrigin(helper_1.absoluteUrl(url.toString(), context.url) || "")))).filter(filter_1.notPass); | ||
} | ||
@@ -28,0 +28,0 @@ meta() { |
{ | ||
"name": "@ampproject/toolbox-linter", | ||
"version": "1.1.2", | ||
"version": "2.0.0-alpha.0", | ||
"description": "A linter for AMP documents", | ||
"repository": "https://github.com/ampproject/amp-toolbox/tree/@ampproject/toolbox-linter", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ampproject/amp-toolbox.git", | ||
"directory": "packages/linter" | ||
}, | ||
"homepage": "https://github.com/ampproject/amp-toolbox/tree/master/packages/linter", | ||
"license": "Apache-2.0", | ||
"author": "AMPHTML Team", | ||
"dependencies": { | ||
"@ampproject/toolbox-cache-list": "^1.1.1", | ||
"@ampproject/toolbox-cache-url": "^1.1.1", | ||
"amphtml-validator": "1.0.23", | ||
"chalk": "2.4.2", | ||
"@ampproject/toolbox-cache-list": "^2.0.0-alpha.0", | ||
"@ampproject/toolbox-cache-url": "^2.0.0-alpha.0", | ||
"amphtml-validator": "1.0.29", | ||
"chalk": "3.0.0", | ||
"cheerio": "1.0.0-rc.2", | ||
"commander": "3.0.2", | ||
"commander": "4.1.0", | ||
"debug": "4.1.1", | ||
"execa": "3.0.0", | ||
"execa": "4.0.0", | ||
"node-fetch": "2.6.0", | ||
@@ -33,3 +38,3 @@ "probe-image-size": "5.0.0", | ||
"scripts": { | ||
"build": "tsc --resolveJsonModule --module commonjs --target es2018 --esModuleInterop --noImplicitAny --strictNullChecks --declaration --outDir dist src/*.ts", | ||
"build": "tsc --resolveJsonModule --module commonjs --target es2018 --esModuleInterop --strictNullChecks --declaration --outDir dist src/*.ts", | ||
"transpile": "tsc --resolveJsonModule --module commonjs --target es2018 --esModuleInterop --noImplicitAny --strictNullChecks src/*.ts tests/*.ts", | ||
@@ -43,8 +48,8 @@ "test": "$npm_execpath run transpile && cd tests && for t in helper.js local.js network.js ; do ( test -e $t || $npm_execpath run build ) && ( node $t | tap-parser -t ) || exit 1 ; done ; exit 0", | ||
}, | ||
"gitHead": "e914411b6dca30b203875a6be32f2b07fcf385ed", | ||
"gitHead": "6140009b75eaa18afeaccf0a5f1996f490dcebfb", | ||
"devDependencies": { | ||
"prettier": "1.18.2", | ||
"tap-parser": "10.0.0", | ||
"typescript": "3.6.4" | ||
"prettier": "1.19.1", | ||
"tap-parser": "10.0.1", | ||
"typescript": "3.7.5" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
79846
1781
3
+ Added@ampproject/toolbox-cache-list@2.10.1(transitive)
+ Added@ampproject/toolbox-cache-url@2.10.1(transitive)
+ Added@ampproject/toolbox-core@2.10.1(transitive)
+ Addedamphtml-validator@1.0.29(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchalk@3.0.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcolors@1.2.5(transitive)
+ Addedcommander@2.15.14.1.0(transitive)
+ Addedcross-fetch@3.1.5(transitive)
+ Addedexeca@4.0.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhuman-signals@1.1.1(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addednode-fetch@2.6.7(transitive)
+ Addedpromise@8.0.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedurl-parse@1.5.10(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedyallist@4.0.0(transitive)
- Removed@ampproject/toolbox-cache-list@1.1.1(transitive)
- Removed@ampproject/toolbox-cache-url@1.1.1(transitive)
- Removed@ampproject/toolbox-core@1.1.1(transitive)
- Removedamphtml-validator@1.0.23(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcolors@1.1.2(transitive)
- Removedcommander@2.9.03.0.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedexeca@3.0.0(transitive)
- Removedgraceful-readlink@1.0.1(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedp-finally@2.0.1(transitive)
- Removedpromise@7.1.1(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedurl-parse@1.4.7(transitive)
Updatedamphtml-validator@1.0.29
Updatedchalk@3.0.0
Updatedcommander@4.1.0
Updatedexeca@4.0.0