From bffc09663451779b25683b55f483cef48059f0fa Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 13 Jan 2022 22:50:03 +0100 Subject: [PATCH 01/10] Add Deno and Node to implementers of various specs --- PULL_REQUEST_TEMPLATE.md.template | 2 +- factory.json | 15 +++++++++++---- factory.py | 8 +++++++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/PULL_REQUEST_TEMPLATE.md.template b/PULL_REQUEST_TEMPLATE.md.template index b8c4e7c..ff5c75d 100644 --- a/PULL_REQUEST_TEMPLATE.md.template +++ b/PULL_REQUEST_TEMPLATE.md.template @@ -10,6 +10,6 @@ Thank you for contributing to the @@h1@@ Standard! Please describe the change yo - [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed: * Chrome: … * Firefox: … - * Safari: … + * Safari: …@@extra_implementers@@ (See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.) diff --git a/factory.json b/factory.json index fbd6818..7950e66 100644 --- a/factory.json +++ b/factory.json @@ -4,12 +4,14 @@ }, "console": { "extra_files": "images/*.*", - "not_these_templates": [".editorconfig"] + "not_these_templates": [".editorconfig"], + "extra_implementers": ["Deno"] }, "encoding": { "extra_files": "*.txt *.json *.css", "post_build_step": "python visualize.py \"$$DIR/\"", - ".gitignore": ["/UnicodeData.txt"] + ".gitignore": ["/UnicodeData.txt"], + "extra_implementers": ["Deno", "Node"] }, "html": { "only_these_templates": ["LICENSE", "PULL_REQUEST_TEMPLATE.md"] @@ -19,11 +21,16 @@ }, "streams": { "extra_files": "demos/* demos/**/*", - "not_these_templates": [".editorconfig"] + "not_these_templates": [".editorconfig"], + "extra_implementers": ["Deno", "Node"] + }, + "url": { + "extra_implementers": ["Deno", "Node"] }, "webidl": { ".gitignore": ["/node_modules/"], "build_with_node": true, - "post_build_step": "node ./check-grammar.js \"$$DIR/index.html\" && npm run pp-webidl -- --input \"$$DIR/index.html\"" + "post_build_step": "node ./check-grammar.js \"$$DIR/index.html\" && npm run pp-webidl -- --input \"$$DIR/index.html\"", + "extra_implementers": ["Deno"] } } diff --git a/factory.py b/factory.py index 496db6a..c2c4427 100755 --- a/factory.py +++ b/factory.py @@ -71,6 +71,9 @@ def fill_template(contents, variables): return contents +def format_implementers(name): + return "\n * " + name + ": …" + def update_files(shortname, name): os.chdir("../{}".format(shortname)) @@ -82,7 +85,8 @@ def update_files(shortname, name): "post_build_step": "", ".gitignore": [], "only_these_templates": None, - "not_these_templates": None + "not_these_templates": None, + "extra_implementers": [] } if shortname in FACTORY_DB: variables.update(FACTORY_DB[shortname]) @@ -94,6 +98,8 @@ def update_files(shortname, name): bs = bs_file[:-len(".bs")] variables["bs"] = bs + variables["extra_implementers"] = map(format_implementers, variables["extra_implementers"]) + files = fill_templates(TEMPLATES, variables) subprocess.run(["git", "checkout", "main"], capture_output=True) From 0243f6bda8df5a490c927825a9289e22ff7f50e7 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 13 Jan 2022 23:17:27 +0100 Subject: [PATCH 02/10] Node -> Node.js --- factory.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/factory.json b/factory.json index 7950e66..2c0195c 100644 --- a/factory.json +++ b/factory.json @@ -11,7 +11,7 @@ "extra_files": "*.txt *.json *.css", "post_build_step": "python visualize.py \"$$DIR/\"", ".gitignore": ["/UnicodeData.txt"], - "extra_implementers": ["Deno", "Node"] + "extra_implementers": ["Deno", "Node.js"] }, "html": { "only_these_templates": ["LICENSE", "PULL_REQUEST_TEMPLATE.md"] @@ -22,10 +22,10 @@ "streams": { "extra_files": "demos/* demos/**/*", "not_these_templates": [".editorconfig"], - "extra_implementers": ["Deno", "Node"] + "extra_implementers": ["Deno", "Node.js"] }, "url": { - "extra_implementers": ["Deno", "Node"] + "extra_implementers": ["Deno", "Node.js"] }, "webidl": { ".gitignore": ["/node_modules/"], From 20dca37ec9efa6a19578d74f252cd485070dd82c Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 21 Jan 2022 14:04:50 +0100 Subject: [PATCH 03/10] address review comment --- factory.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/factory.py b/factory.py index c2c4427..fe1575f 100755 --- a/factory.py +++ b/factory.py @@ -67,13 +67,11 @@ def fill_template(contents, variables): for entry in data: output += "\n{}".format(entry) data = output + elif variable == "extra_implementers": + data = map(lambda name : "\n * " + name + ": …", data) contents = contents.replace("@@{}@@".format(variable), data) return contents - -def format_implementers(name): - return "\n * " + name + ": …" - def update_files(shortname, name): os.chdir("../{}".format(shortname)) @@ -98,8 +96,6 @@ def update_files(shortname, name): bs = bs_file[:-len(".bs")] variables["bs"] = bs - variables["extra_implementers"] = map(format_implementers, variables["extra_implementers"]) - files = fill_templates(TEMPLATES, variables) subprocess.run(["git", "checkout", "main"], capture_output=True) From 634d3e8fcf1f9cd16f390c0e28c7c9416dfadf54 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 21 Jan 2022 16:38:41 +0100 Subject: [PATCH 04/10] include more specs for node --- factory.json | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/factory.json b/factory.json index 2c0195c..890fd39 100644 --- a/factory.json +++ b/factory.json @@ -5,7 +5,13 @@ "console": { "extra_files": "images/*.*", "not_these_templates": [".editorconfig"], - "extra_implementers": ["Deno"] + "extra_implementers": ["Deno", "Node.js"] + }, + "dom": { + "extra_implementers": [ + "Deno (only for AbortController, AbortSignal, Event, and EventTarget)", + "Node.js (only for AbortController, AbortSignal, Event, and EventTarget)" + ] }, "encoding": { "extra_files": "*.txt *.json *.css", @@ -13,8 +19,15 @@ ".gitignore": ["/UnicodeData.txt"], "extra_implementers": ["Deno", "Node.js"] }, + "fetch": { + "extra_implementers": ["Deno (not for CORS changes)"] + }, "html": { - "only_these_templates": ["LICENSE", "PULL_REQUEST_TEMPLATE.md"] + "only_these_templates": ["LICENSE", "PULL_REQUEST_TEMPLATE.md"], + "extra_implementers": [ + "Deno (only for timers, structured clone, base64 utils, channel messaging, web workers, and web storage)", + "Node.js (only for timers, structured clone, base64 utils, channel messaging)" + ] }, "infra": { "not_these_templates": ["PULL_REQUEST_TEMPLATE.md"] @@ -32,5 +45,8 @@ "build_with_node": true, "post_build_step": "node ./check-grammar.js \"$$DIR/index.html\" && npm run pp-webidl -- --input \"$$DIR/index.html\"", "extra_implementers": ["Deno"] + }, + "websockets": { + "extra_implementers": ["Deno"] } } From 892312b15864620c854e62ee48d87d1333ccb9d6 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 21 Jan 2022 16:46:33 +0100 Subject: [PATCH 05/10] add node to webidl --- factory.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factory.json b/factory.json index 890fd39..24353ab 100644 --- a/factory.json +++ b/factory.json @@ -44,7 +44,7 @@ ".gitignore": ["/node_modules/"], "build_with_node": true, "post_build_step": "node ./check-grammar.js \"$$DIR/index.html\" && npm run pp-webidl -- --input \"$$DIR/index.html\"", - "extra_implementers": ["Deno"] + "extra_implementers": ["Deno", "Node.js"] }, "websockets": { "extra_implementers": ["Deno"] From 9ba62c58839303fe923136ac9a695e9a1833691e Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 21 Jan 2022 18:39:20 +0100 Subject: [PATCH 06/10] add "esm resolver" --- factory.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/factory.json b/factory.json index 24353ab..fb14811 100644 --- a/factory.json +++ b/factory.json @@ -25,8 +25,8 @@ "html": { "only_these_templates": ["LICENSE", "PULL_REQUEST_TEMPLATE.md"], "extra_implementers": [ - "Deno (only for timers, structured clone, base64 utils, channel messaging, web workers, and web storage)", - "Node.js (only for timers, structured clone, base64 utils, channel messaging)" + "Deno (only for timers, structured clone, base64 utils, channel messaging, esm resolver, web workers, and web storage)", + "Node.js (only for timers, structured clone, base64 utils, channel messaging, and esm resolver)" ] }, "infra": { From f60073875967363e2ae361aee6e6d24003288bd4 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 24 Jan 2022 11:59:20 +0100 Subject: [PATCH 07/10] nits --- factory.json | 8 ++++---- factory.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/factory.json b/factory.json index fb14811..b17a958 100644 --- a/factory.json +++ b/factory.json @@ -9,8 +9,8 @@ }, "dom": { "extra_implementers": [ - "Deno (only for AbortController, AbortSignal, Event, and EventTarget)", - "Node.js (only for AbortController, AbortSignal, Event, and EventTarget)" + "Deno (only for aborting and events)", + "Node.js (only for aborting and events)" ] }, "encoding": { @@ -25,8 +25,8 @@ "html": { "only_these_templates": ["LICENSE", "PULL_REQUEST_TEMPLATE.md"], "extra_implementers": [ - "Deno (only for timers, structured clone, base64 utils, channel messaging, esm resolver, web workers, and web storage)", - "Node.js (only for timers, structured clone, base64 utils, channel messaging, and esm resolver)" + "Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage)", + "Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution)" ] }, "infra": { diff --git a/factory.py b/factory.py index fe1575f..16604b4 100755 --- a/factory.py +++ b/factory.py @@ -72,6 +72,7 @@ def fill_template(contents, variables): contents = contents.replace("@@{}@@".format(variable), data) return contents + def update_files(shortname, name): os.chdir("../{}".format(shortname)) From 4dc1642d37c5bb0ef668ac412f7ebe23cf200797 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 24 Jan 2022 12:01:49 +0100 Subject: [PATCH 08/10] nit --- factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factory.py b/factory.py index 16604b4..3326973 100755 --- a/factory.py +++ b/factory.py @@ -158,7 +158,7 @@ def main(): else: print("Please invoke as one of:\n\n" + \ "./factory.py --single \n" + \ - "./factory.py --all" + \ + "./factory.py --all\n" + \ "./factory.py --all --create-prs") main() From 05d6cecae0cecb212eb4ee09a8d50e69f8f3c6ea Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 24 Jan 2022 12:11:38 +0100 Subject: [PATCH 09/10] map/lambda resulted in exception, so fix it --- factory.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/factory.py b/factory.py index 3326973..1a7c8c7 100755 --- a/factory.py +++ b/factory.py @@ -68,7 +68,10 @@ def fill_template(contents, variables): output += "\n{}".format(entry) data = output elif variable == "extra_implementers": - data = map(lambda name : "\n * " + name + ": …", data) + output = "" + for entry in data: + output += "\n * {}: …".format(entry) + data = output contents = contents.replace("@@{}@@".format(variable), data) return contents From 30f77a6c8dc9f7242e6bc83ee907331ba37576d7 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 24 Jan 2022 12:18:15 +0100 Subject: [PATCH 10/10] variable conflict --- factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/factory.py b/factory.py index 1a7c8c7..9409e5c 100755 --- a/factory.py +++ b/factory.py @@ -131,14 +131,14 @@ def create_pr(shortname): os.chdir(".") -def update_all_standards(create_pr = False): +def update_all_standards(create_prs = False): for workstream in DB["workstreams"]: for standard in workstream["standards"]: shortname = href_to_shortname(standard["href"]) update_files(shortname, standard["name"]) - if create_pr: + if create_prs: create_pr(shortname)