diff --git a/scripts/migrate-fx140/is-esmified.js b/scripts/migrate-fx140/is-esmified.js index dd33fdf453..7bbe1799b6 100755 --- a/scripts/migrate-fx140/is-esmified.js +++ b/scripts/migrate-fx140/is-esmified.js @@ -34,6 +34,7 @@ function generateESMURIMap(jsm_map) { function isESMifiedSlow(resourceURI) { if (resourceURI.endsWith('.jsm')) { + console.log(resourceURI.includes('/zotero/')) if (resourceURI.includes('/zotero/')) { return { result: true, jsms: [resourceURI.replace('.jsm', '.mjs')] }; } else { diff --git a/scripts/migrate-fx140/migrate.py b/scripts/migrate-fx140/migrate.py index 56ed798b55..081b6c3c3d 100755 --- a/scripts/migrate-fx140/migrate.py +++ b/scripts/migrate-fx140/migrate.py @@ -664,12 +664,12 @@ def try_rename_components_conf(command_context, path, jsm_name, esm_name): def esmify_name(name): - return re.sub(r"\.(jsm|js|jsm\.js)$", ".sys.mjs", name) + return re.sub(r"\.(jsm|js|jsm\.js)$", ".mjs", name) def esmify_path(jsm_path): jsm_name = jsm_path.name - esm_name = re.sub(r"\.(jsm|js|jsm\.js)$", ".sys.mjs", jsm_name) + esm_name = re.sub(r"\.(jsm|js|jsm\.js)$", ".mjs", jsm_name) esm_path = jsm_path.parent / esm_name return esm_path @@ -713,7 +713,7 @@ def find_jsm_uri(jsm_path): def rename_single_file(command_context, vcs_utils, jsm_path, summary): - """Rename `jsm_path` to .sys.mjs, and fix references to the file in build + """Rename `jsm_path` to .mjs, and fix references to the file in build and test definitions.""" def info(text): diff --git a/scripts/migrate-fx140/utils.js b/scripts/migrate-fx140/utils.js index 801aab62af..9e275dca3b 100755 --- a/scripts/migrate-fx140/utils.js +++ b/scripts/migrate-fx140/utils.js @@ -68,7 +68,11 @@ function isString(node) { const jsmExtPattern = /\.(jsm|js|jsm\.js)$/; function esmifyExtension(path) { - return path.replace(jsmExtPattern, ".sys.mjs"); + if (path.includes('/zotero/')) { + return path.replace(jsmExtPattern, ".mjs"); + } else { + return path.replace(jsmExtPattern, ".sys.mjs"); + } } // Given possible member expression, return the list of Identifier nodes in