@ampproject/toolbox-optimizer
Advanced tools
Comparing version 2.8.6 to 2.8.7
@@ -20,3 +20,2 @@ /** | ||
const {MaxAge} = require('@ampproject/toolbox-core'); | ||
const JSON5 = require('json5'); | ||
let fallbackRuntime; | ||
@@ -72,3 +71,3 @@ | ||
async function initValidatorRules(runtimeParameters, customRuntimeParameters, config) { | ||
if (!config.autoExtensionImport) { | ||
if (config.autoExtensionImport === false) { | ||
// Validation rules are large, don't import if not needed | ||
@@ -116,9 +115,4 @@ return; | ||
const componentConfigUrl = `https://raw.githubusercontent.com/ampproject/amphtml/${releaseTag}/build-system/compile/bundles.config.extensions.json`; | ||
const latestVersionsUrl = `https://raw.githubusercontent.com/ampproject/amphtml/${releaseTag}/build-system/compile/bundles.legacy-latest-versions.jsonc`; | ||
const responses = await Promise.all([ | ||
config.fetch(componentConfigUrl), | ||
config.fetch(latestVersionsUrl), | ||
]); | ||
const [configResponse, latestVersionsConfigResponse] = responses; | ||
const configResponse = await config.fetch(componentConfigUrl); | ||
if (!configResponse.ok) { | ||
@@ -129,17 +123,3 @@ throw new Error( | ||
} | ||
if (!latestVersionsConfigResponse.ok) { | ||
throw new Error( | ||
`Failed fetching latest component versions from ${latestVersionsUrl} with status: ${latestVersionsConfigResponse.status}` | ||
); | ||
} | ||
const extensionConfig = await configResponse.json(); | ||
const latestVersionsConfig = JSON5.parse(await latestVersionsConfigResponse.text()); | ||
// We add back the "latestVersion" field so that the auto importer | ||
// code knows what "stable" version of the extension to use. | ||
extensionConfig.forEach((entry) => { | ||
entry['latestVersion'] = latestVersionsConfig[entry.name]; | ||
}); | ||
return extensionConfig; | ||
return await configResponse.json(); | ||
} | ||
@@ -146,0 +126,0 @@ |
{ | ||
"name": "@ampproject/toolbox-optimizer", | ||
"version": "2.8.6", | ||
"version": "2.8.7", | ||
"description": "Server-side rendering for AMPs.", | ||
@@ -41,3 +41,2 @@ "main": "index.js", | ||
"https-proxy-agent": "5.0.0", | ||
"json5": "^2.2.0", | ||
"lru-cache": "6.0.0", | ||
@@ -53,3 +52,3 @@ "normalize-html-whitespace": "1.0.0", | ||
"homepage": "https://github.com/ampproject/amp-toolbox/tree/main/packages/optimizer", | ||
"gitHead": "9e537758baa2424a96d920308df75eb24b6e3dec" | ||
"gitHead": "7c5297fe6a977432eac8b2f606e43abf6550aec3" | ||
} |
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
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
17
253138
5684
- Removedjson5@^2.2.0
- Removedjson5@2.2.3(transitive)