Remove connectorTypeSchemaData.js and update build_typeSchemaData.js

We now use zoteroTypeSchemaData.js in the connector, so update the
build script to generate that.
This commit is contained in:
Dan Stillman 2023-05-06 01:56:19 -04:00
parent 2dc08a0dfb
commit 43373b77ec
2 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
import FilePicker from 'zotero/modules/filePicker';
(async function () {
// Create schema
var schema = {"itemTypes":{}, "creatorTypes":{}, "fields":{}};
@ -77,11 +77,12 @@ import FilePicker from 'zotero/modules/filePicker';
resultElem.innerHTML = '<p>Failed.</p>';
} else {
let schemaFile = Zotero.File.pathToFile(fp.file);
schemaFile.append("connectorTypeSchemaData.js");
schemaFile.append("zoteroTypeSchemaData.js");
await Zotero.File.putContentsAsync(
schemaFile,
`Zotero.Connector_Types.schema = ${JSON.stringify(schema)}`
`var ZOTERO_TYPE_SCHEMA = ${JSON.stringify(schema)};\n\n`
+ "if (typeof module !== 'undefined') {\n\tmodule.exports = ZOTERO_TYPE_SCHEMA;\n}\n"
);
resultElem.innerHTML = `<p>Wrote ${schemaFile} successfully.</p>`;
resultElem.innerHTML = `<p>Wrote ${schemaFile.path} successfully.</p>`;
}
})();

File diff suppressed because one or more lines are too long