mirror of
https://github.com/zotero/zotero.git
synced 2026-09-29 01:41:24 +00:00
ESMify: Use .mjs for Zotero modules everywhere
This commit is contained in:
parent
b2bd862271
commit
f21ea96b4f
3 changed files with 9 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue