Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow nightly URL in specs.json, adjust Service Workers entry #101

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ property in `index.json`.
- `seriesComposition`: same as the [`seriesVersion`](README.md#seriesversion)
property in `index.json`. The property must only be set for delta spec (since
full is the default).
- `nightly`: same as the [`nightly`](REAMDE.md#nightly) property in
`index.json`. The property must only be set when the URL of the nightly spec
returned by external sources would be wrong **and** when it cannot be fixed at
the source.
- `forceCurrent`: a boolean flag to tell the code that the spec should be seen
as the current spec in the series. The property must only be set when value is
`true`.
Expand Down
1 change: 1 addition & 0 deletions schema/specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"series": { "$ref": "definitions.json#/proptype/series" },
"seriesVersion": { "$ref": "definitions.json#/proptype/seriesVersion" },
"seriesComposition": { "$ref": "definitions.json#/proptype/seriesComposition" },
"nightly": { "$ref": "definitions.json#/proptype/release" },
"forceCurrent": { "type": "boolean" }
},
"required": ["url"],
Expand Down
13 changes: 6 additions & 7 deletions specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@
"https://w3c.github.io/gamepad/extensions.html",
"https://w3c.github.io/mathml-aam/",
"https://w3c.github.io/media-playback-quality/",
{
"url": "https://w3c.github.io/ServiceWorker/",
"shortname": "service-workers",
"series": {
"shortname": "service-workers"
}
},
"https://w3c.github.io/web-nfc/",
"https://w3c.github.io/web-share-target/",
"https://w3c.github.io/webappsec-trusted-types/dist/spec/",
Expand Down Expand Up @@ -310,6 +303,12 @@
"https://www.w3.org/TR/selectors-4/",
"https://www.w3.org/TR/selectors-nonelement-1/",
"https://www.w3.org/TR/server-timing/",
{
"url": "https://www.w3.org/TR/service-workers-1/",
"nightly": {
"url": "https://w3c.github.io/ServiceWorker/"
}
},
"https://www.w3.org/TR/SRI/",
"https://www.w3.org/TR/svg-aam-1.0/",
"https://www.w3.org/TR/svg-integration/",
Expand Down
9 changes: 8 additions & 1 deletion src/build-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,17 @@ const specs = require("../specs.json")


// Fetch additional spec info from external sources and complete the list
// Note on the "assign" call:
// - `{}` is needed to avoid overriding spec
// - `spec` appears first to impose the order of properties computed above in
// the resulting object
// - `specInfo[spec.shortname]` is the info we retrieved from the source
// - final `spec` ensures that properties defined in specs.json override info
// from the source.
fetchInfo(specs, { w3cApiKey })
.then(specInfo => {
const index = specs
.map(spec => Object.assign(spec, specInfo[spec.shortname]));
.map(spec => Object.assign({}, spec, specInfo[spec.shortname], spec));

// Return the resulting list
console.log(JSON.stringify(index, null, 2));
Expand Down