diff --git a/index.json b/index.json index 022b2e0c..f5118365 100644 --- a/index.json +++ b/index.json @@ -134,21 +134,6 @@ "title": "CSS Extensions", "source": "spec" }, - { - "url": "https://drafts.csswg.org/css-forms-1/", - "seriesComposition": "full", - "shortname": "css-forms-1", - "series": { - "shortname": "css-forms", - "currentSpecification": "css-forms-1" - }, - "seriesVersion": "1", - "nightly": { - "url": "https://drafts.csswg.org/css-forms-1/" - }, - "title": "CSS Form Styling Module Level 1", - "source": "spec" - }, { "url": "https://drafts.csswg.org/css-gcpm-4/", "seriesComposition": "delta", @@ -729,6 +714,34 @@ "title": "Badging API", "source": "specref" }, + { + "url": "https://wicg.github.io/budget-api/", + "seriesComposition": "full", + "shortname": "budget-api", + "series": { + "shortname": "budget-api", + "currentSpecification": "budget-api" + }, + "nightly": { + "url": "https://wicg.github.io/budget-api/" + }, + "title": "Web Budget API", + "source": "specref" + }, + { + "url": "https://wicg.github.io/client-hints-infrastructure/", + "seriesComposition": "full", + "shortname": "client-hints-infrastructure", + "series": { + "shortname": "client-hints-infrastructure", + "currentSpecification": "client-hints-infrastructure" + }, + "nightly": { + "url": "https://wicg.github.io/client-hints-infrastructure/" + }, + "title": "Client Hints Infrastructure", + "source": "specref" + }, { "url": "https://wicg.github.io/compression/", "seriesComposition": "full", @@ -1163,6 +1176,34 @@ "title": "Accelerated Shape Detection in Images", "source": "specref" }, + { + "url": "https://wicg.github.io/shape-detection-api/text.html", + "seriesComposition": "full", + "shortname": "text-detection-api", + "series": { + "shortname": "text-detection-api", + "currentSpecification": "text-detection-api" + }, + "nightly": { + "url": "https://wicg.github.io/shape-detection-api/text.html" + }, + "title": "Accelerated Text Detection in Images", + "source": "specref" + }, + { + "url": "https://wicg.github.io/sms-one-time-codes/", + "seriesComposition": "full", + "shortname": "sms-one-time-codes", + "series": { + "shortname": "sms-one-time-codes", + "currentSpecification": "sms-one-time-codes" + }, + "nightly": { + "url": "https://wicg.github.io/sms-one-time-codes/" + }, + "title": "Origin-bound one-time codes delivered via SMS", + "source": "specref" + }, { "url": "https://wicg.github.io/speech-api/", "seriesComposition": "full", @@ -1368,7 +1409,7 @@ "currentSpecification": "battery-status" }, "release": { - "url": "http://www.w3.org/TR/battery-status/" + "url": "https://www.w3.org/TR/battery-status/" }, "nightly": { "url": "https://w3c.github.io/battery/" @@ -1438,7 +1479,7 @@ "seriesVersion": "1", "seriesNext": "compositing-2", "release": { - "url": "http://www.w3.org/TR/compositing-1/" + "url": "https://www.w3.org/TR/compositing-1/" }, "nightly": { "url": "https://drafts.fxtf.org/compositing-1/" @@ -1846,7 +1887,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/css-device-adapt-1/" + "url": "https://www.w3.org/TR/css-device-adapt-1/" }, "nightly": { "url": "https://drafts.csswg.org/css-device-adapt/" @@ -1918,7 +1959,7 @@ }, "seriesVersion": "3", "release": { - "url": "http://www.w3.org/TR/css-font-loading-3/" + "url": "https://www.w3.org/TR/css-font-loading-3/" }, "nightly": { "url": "https://drafts.csswg.org/css-font-loading/" @@ -1975,7 +2016,7 @@ "seriesVersion": "3", "seriesNext": "css-gcpm-4", "release": { - "url": "http://www.w3.org/TR/css-gcpm-3/" + "url": "https://www.w3.org/TR/css-gcpm-3/" }, "nightly": { "url": "https://drafts.csswg.org/css-gcpm/" @@ -2105,7 +2146,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/css-line-grid-1/" + "url": "https://www.w3.org/TR/css-line-grid-1/" }, "nightly": { "url": "https://drafts.csswg.org/css-line-grid/" @@ -2159,7 +2200,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/css-masking-1/" + "url": "https://www.w3.org/TR/css-masking-1/" }, "nightly": { "url": "https://drafts.fxtf.org/css-masking-1/" @@ -2196,7 +2237,7 @@ }, "seriesVersion": "3", "release": { - "url": "http://www.w3.org/TR/css-namespaces-3/" + "url": "https://www.w3.org/TR/css-namespaces-3/" }, "nightly": { "url": "https://drafts.csswg.org/css-namespaces/" @@ -2307,7 +2348,7 @@ }, "seriesVersion": "3", "release": { - "url": "http://www.w3.org/TR/css-page-floats-3/" + "url": "https://www.w3.org/TR/css-page-floats-3/" }, "nightly": { "url": "https://drafts.csswg.org/css-page-floats/" @@ -2397,7 +2438,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/css-regions-1/" + "url": "https://www.w3.org/TR/css-regions-1/" }, "nightly": { "url": "https://drafts.csswg.org/css-regions/" @@ -2469,7 +2510,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/css-scoping-1/" + "url": "https://www.w3.org/TR/css-scoping-1/" }, "nightly": { "url": "https://drafts.csswg.org/css-scoping/" @@ -2560,7 +2601,7 @@ "seriesVersion": "1", "seriesNext": "css-shapes-2", "release": { - "url": "http://www.w3.org/TR/css-shapes-1/" + "url": "https://www.w3.org/TR/css-shapes-1/" }, "nightly": { "url": "https://drafts.csswg.org/css-shapes/" @@ -2614,7 +2655,7 @@ "currentSpecification": "css-style-attr" }, "release": { - "url": "http://www.w3.org/TR/css-style-attr/" + "url": "https://www.w3.org/TR/css-style-attr/" }, "nightly": { "url": "https://drafts.csswg.org/css-style-attr/" @@ -2896,7 +2937,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/css-variables-1/" + "url": "https://www.w3.org/TR/css-variables-1/" }, "nightly": { "url": "https://drafts.csswg.org/css-variables/" @@ -2914,7 +2955,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/css-will-change-1/" + "url": "https://www.w3.org/TR/css-will-change-1/" }, "nightly": { "url": "https://drafts.csswg.org/css-will-change/" @@ -2971,7 +3012,7 @@ "seriesVersion": "2", "seriesNext": "CSS22", "release": { - "url": "http://www.w3.org/TR/CSS2/" + "url": "https://www.w3.org/TR/CSS2/" }, "nightly": { "url": "https://drafts.csswg.org/css2/" @@ -2990,7 +3031,7 @@ "seriesVersion": "2.2", "seriesPrevious": "CSS2", "release": { - "url": "http://www.w3.org/TR/CSS22/" + "url": "https://www.w3.org/TR/CSS22/" }, "nightly": { "url": "https://drafts.csswg.org/css2/" @@ -3009,7 +3050,7 @@ "seriesVersion": "3", "seriesNext": "css-conditional-4", "release": { - "url": "http://www.w3.org/TR/css3-conditional/" + "url": "https://www.w3.org/TR/css3-conditional/" }, "nightly": { "url": "https://drafts.csswg.org/css-conditional-3/" @@ -3027,7 +3068,7 @@ }, "seriesVersion": "3", "release": { - "url": "http://www.w3.org/TR/css3-exclusions/" + "url": "https://www.w3.org/TR/css3-exclusions/" }, "nightly": { "url": "https://drafts.csswg.org/css-exclusions/" @@ -3046,7 +3087,7 @@ "seriesVersion": "3", "seriesNext": "mediaqueries-4", "release": { - "url": "http://www.w3.org/TR/css3-mediaqueries/" + "url": "https://www.w3.org/TR/css3-mediaqueries/" }, "nightly": { "url": "https://drafts.csswg.org/mediaqueries-3/" @@ -3064,7 +3105,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/cssom-1/" + "url": "https://www.w3.org/TR/cssom-1/" }, "nightly": { "url": "https://drafts.csswg.org/cssom/" @@ -3082,7 +3123,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/cssom-view-1/" + "url": "https://www.w3.org/TR/cssom-view-1/" }, "nightly": { "url": "https://drafts.csswg.org/cssom-view/" @@ -3117,7 +3158,7 @@ "currentSpecification": "DOM-Parsing" }, "release": { - "url": "http://www.w3.org/TR/DOM-Parsing/" + "url": "https://www.w3.org/TR/DOM-Parsing/" }, "nightly": { "url": "https://w3c.github.io/DOM-Parsing/" @@ -3368,6 +3409,23 @@ "title": "\"MediaStream Image Capture\"", "source": "w3c" }, + { + "url": "https://www.w3.org/TR/image-resource/", + "seriesComposition": "full", + "shortname": "image-resource", + "series": { + "shortname": "image-resource", + "currentSpecification": "image-resource" + }, + "release": { + "url": "https://www.w3.org/TR/image-resource/" + }, + "nightly": { + "url": "https://w3c.github.io/image-resource/" + }, + "title": "Image Resource", + "source": "w3c" + }, { "url": "https://www.w3.org/TR/IndexedDB-2/", "seriesComposition": "full", @@ -4266,7 +4324,7 @@ "currentSpecification": "SRI" }, "release": { - "url": "http://www.w3.org/TR/SRI/" + "url": "https://www.w3.org/TR/SRI/" }, "nightly": { "url": "https://w3c.github.io/webappsec-subresource-integrity/" @@ -4274,6 +4332,23 @@ "title": "Subresource Integrity", "source": "w3c" }, + { + "url": "https://www.w3.org/TR/svg-integration/", + "seriesComposition": "full", + "shortname": "svg-integration", + "series": { + "shortname": "svg-integration", + "currentSpecification": "svg-integration" + }, + "release": { + "url": "https://www.w3.org/TR/svg-integration/" + }, + "nightly": { + "url": "https://svgwg.org/specs/integration/" + }, + "title": "SVG Integration", + "source": "w3c" + }, { "url": "https://www.w3.org/TR/svg-markers/", "seriesComposition": "full", @@ -4283,7 +4358,7 @@ "currentSpecification": "svg-markers" }, "release": { - "url": "http://www.w3.org/TR/svg-markers/" + "url": "https://www.w3.org/TR/svg-markers/" }, "nightly": { "url": "https://svgwg.org/specs/markers/" @@ -4291,6 +4366,23 @@ "title": "SVG Markers", "source": "w3c" }, + { + "url": "https://www.w3.org/TR/svg-paths/", + "seriesComposition": "full", + "shortname": "svg-paths", + "series": { + "shortname": "svg-paths", + "currentSpecification": "svg-paths" + }, + "release": { + "url": "https://www.w3.org/TR/svg-paths/" + }, + "nightly": { + "url": "https://svgwg.org/specs/paths/" + }, + "title": "SVG Paths", + "source": "w3c" + }, { "url": "https://www.w3.org/TR/svg-strokes/", "seriesComposition": "full", @@ -4300,7 +4392,7 @@ "currentSpecification": "svg-strokes" }, "release": { - "url": "http://www.w3.org/TR/svg-strokes/" + "url": "https://www.w3.org/TR/svg-strokes/" }, "nightly": { "url": "https://svgwg.org/specs/strokes/" @@ -4352,7 +4444,7 @@ "currentSpecification": "touch-events" }, "release": { - "url": "http://www.w3.org/TR/touch-events/" + "url": "https://www.w3.org/TR/touch-events/" }, "nightly": { "url": "https://w3c.github.io/touch-events/" @@ -4438,7 +4530,7 @@ "currentSpecification": "upgrade-insecure-requests" }, "release": { - "url": "http://www.w3.org/TR/upgrade-insecure-requests/" + "url": "https://www.w3.org/TR/upgrade-insecure-requests/" }, "nightly": { "url": "https://w3c.github.io/webappsec-upgrade-insecure-requests/" @@ -4516,6 +4608,24 @@ "title": "Wake Lock API", "source": "w3c" }, + { + "url": "https://www.w3.org/TR/wasm-core-1/", + "seriesComposition": "full", + "shortname": "wasm-core-1", + "series": { + "shortname": "wasm-core", + "currentSpecification": "wasm-core-1" + }, + "seriesVersion": "1", + "release": { + "url": "https://www.w3.org/TR/wasm-core-1/" + }, + "nightly": { + "url": "https://webassembly.github.io/spec/core/bikeshed/" + }, + "title": "WebAssembly Core Specification", + "source": "w3c" + }, { "url": "https://www.w3.org/TR/wasm-js-api-1/", "seriesComposition": "full", @@ -4684,7 +4794,7 @@ "currentSpecification": "webmidi" }, "release": { - "url": "http://www.w3.org/TR/webmidi/" + "url": "https://www.w3.org/TR/webmidi/" }, "nightly": { "url": "https://webaudio.github.io/web-midi-api/" @@ -4874,7 +4984,7 @@ }, "seriesVersion": "1", "release": { - "url": "http://www.w3.org/TR/worklets-1/" + "url": "https://www.w3.org/TR/worklets-1/" }, "nightly": { "url": "https://drafts.css-houdini.org/worklets/" diff --git a/specs.json b/specs.json index 55146a64..99a41905 100644 --- a/specs.json +++ b/specs.json @@ -8,7 +8,6 @@ "https://drafts.csswg.org/css-backgrounds-4/ delta", "https://drafts.csswg.org/css-env-1/", "https://drafts.csswg.org/css-extensions-1/", - "https://drafts.csswg.org/css-forms-1/", "https://drafts.csswg.org/css-gcpm-4/ delta", "https://drafts.csswg.org/css-highlight-api-1/", "https://drafts.csswg.org/css-multicol-2/ delta", @@ -55,6 +54,8 @@ "https://wicg.github.io/background-fetch/", "https://wicg.github.io/background-sync/spec/", "https://wicg.github.io/badging/", + "https://wicg.github.io/budget-api/", + "https://wicg.github.io/client-hints-infrastructure/", "https://wicg.github.io/compression/", "https://wicg.github.io/construct-stylesheets/", "https://wicg.github.io/contact-api/spec/", @@ -86,6 +87,11 @@ "https://wicg.github.io/ScrollToTextFragment/", "https://wicg.github.io/serial/", "https://wicg.github.io/shape-detection-api/", + { + "url": "https://wicg.github.io/shape-detection-api/text.html", + "shortname": "text-detection-api" + }, + "https://wicg.github.io/sms-one-time-codes/", "https://wicg.github.io/speech-api/", "https://wicg.github.io/video-rvfc/", "https://wicg.github.io/visual-viewport/", @@ -233,6 +239,7 @@ "https://www.w3.org/TR/hr-time-3/", "https://www.w3.org/TR/html-media-capture/", "https://www.w3.org/TR/image-capture/", + "https://www.w3.org/TR/image-resource/", "https://www.w3.org/TR/IndexedDB-2/", "https://www.w3.org/TR/input-events-2/", "https://www.w3.org/TR/intersection-observer/", @@ -285,7 +292,9 @@ "https://www.w3.org/TR/selectors-nonelement-1/", "https://www.w3.org/TR/server-timing/", "https://www.w3.org/TR/SRI/", + "https://www.w3.org/TR/svg-integration/", "https://www.w3.org/TR/svg-markers/", + "https://www.w3.org/TR/svg-paths/", "https://www.w3.org/TR/svg-strokes/", "https://www.w3.org/TR/SVG2/", "https://www.w3.org/TR/timing-entrytypes-registry/", @@ -299,6 +308,7 @@ "https://www.w3.org/TR/vibration/", "https://www.w3.org/TR/wai-aria-1.2/", "https://www.w3.org/TR/wake-lock/", + "https://www.w3.org/TR/wasm-core-1/", "https://www.w3.org/TR/wasm-js-api-1/", "https://www.w3.org/TR/wasm-web-api-1/", "https://www.w3.org/TR/web-animations-1/", diff --git a/src/fetch-info.js b/src/fetch-info.js index b8f6e8ff..3598efb3 100644 --- a/src/fetch-info.js +++ b/src/fetch-info.js @@ -65,6 +65,14 @@ async function fetchInfoFromW3CApi(specs, options) { if (res.statusCode === 404) { resolve(null); } + if (res.statusCode === 301) { + const location = res.headers.location.startsWith('/specifications/') ? + res.headers.location.substring('/specifications/'.length) : + res.headers.location; + reject(`W3C API redirected to "${location}" ` + + `for "${spec.shortname}" (${spec.url}), update the shortname!`); + return; + } if (res.statusCode !== 200) { reject(`W3C API returned an error, status code is ${res.statusCode}`); return; @@ -89,9 +97,25 @@ async function fetchInfoFromW3CApi(specs, options) { const results = {}; specs.forEach((spec, idx) => { if (info[idx]) { + if (info[idx].shortlink && + info[idx].shortlink.startsWith('http:')) { + console.warn(`[warning] force HTTPS for release of ` + + `"${spec.shortname}", W3C API returned "${info[idx].shortlink}"`); + } + if (info[idx]["editor-draft"] && + info[idx]["editor-draft"].startsWith('http:')) { + console.warn(`[warning] force HTTPS for nightly of ` + + `"${spec.shortname}", W3C API returned "${info[idx]["editor-draft"]}"`); + } + const release = info[idx].shortlink ? + info[idx].shortlink.replace(/^http:/, 'https:') : + null; + const nightly = info[idx]["editor-draft"] ? + info[idx]["editor-draft"].replace(/^http:/, 'https:') : + null; results[spec.shortname] = { - release: { url: info[idx].shortlink }, - nightly: { url: info[idx]["editor-draft"] }, + release: { url: release }, + nightly: { url: nightly }, title: info[idx].title }; } @@ -158,8 +182,20 @@ async function fetchInfoFromSpecref(specs, options) { Object.keys(chunkRes).forEach(name => { if (specs.find(spec => spec.shortname === name)) { const info = chunkRes[resolveAlias(name)]; + if (info.edDraft && info.edDraft.startsWith('http:')) { + console.warn(`[warning] force HTTPS for nightly of ` + + `"${spec.shortname}", Specref returned "${info.edDraft}"`); + } + if (info.href && info.href.startsWith('http:')) { + console.warn(`[warning] force HTTPS for nightly of ` + + `"${spec.shortname}", Specref returned "${info.href}"`); + } + const nightly = info.edDraft ? + info.edDraft.replace(/^http:/, 'https:') : + info.href ? info.href.replace(/^http:/, 'https:') : + null; results[name] = { - nightly: { url: info.edDraft || info.href }, + nightly: { url: nightly }, title: info.title }; } diff --git a/test/index.js b/test/index.js index 0c39170a..11ff83d7 100644 --- a/test/index.js +++ b/test/index.js @@ -28,6 +28,20 @@ describe("List of specs", () => { assert.deepStrictEqual(wrong, []); }); + it("has unique shortnames", () => { + const wrong = specs.filter((spec, idx) => + specs.findIndex(s => s.shortname === spec.shortname) !== idx); + assert.deepStrictEqual(wrong, []); + }); + + it("only contains HTTPS URLs", () => { + const wrong = specs.filter(s => + !s.url.startsWith('https:') || + (s.release && !s.release.url.startsWith('https:')) || + (s.nightly && !s.nightly.url.startsWith('https:'))); + assert.deepStrictEqual(wrong, []); + }); + it("has level info for specs that have a previous link", () => { const wrong = specs.filter(s => s.seriesPrevious && !s.seriesVersion); assert.deepStrictEqual(wrong, []);