2017-06-20 23:18:46 +00:00
|
|
|
// list of folders from where .js files are compiled and non-js files are symlinked
|
|
|
|
const dirs = [
|
|
|
|
'chrome',
|
|
|
|
'components',
|
|
|
|
'defaults',
|
|
|
|
'test',
|
|
|
|
'test/resource/chai',
|
|
|
|
'test/resource/chai-as-promised',
|
|
|
|
'test/resource/mocha'
|
|
|
|
];
|
|
|
|
|
2019-03-20 08:39:33 +00:00
|
|
|
// list of folders that are symlinked
|
2017-06-20 23:18:46 +00:00
|
|
|
const symlinkDirs = [
|
2019-03-20 08:39:33 +00:00
|
|
|
'chrome/content/zotero/xpcom/rdf',
|
2017-06-20 23:18:46 +00:00
|
|
|
'styles',
|
|
|
|
'translators'
|
|
|
|
];
|
|
|
|
|
|
|
|
// list of folders which are copied to the build folder
|
|
|
|
const copyDirs = [
|
|
|
|
'test/tests/data' // browser follows symlinks when loading test data
|
|
|
|
// triggering false-positive test results with mismatched URIs
|
|
|
|
];
|
|
|
|
|
|
|
|
// list of files from root folder to symlink
|
|
|
|
const symlinkFiles = [
|
2019-03-20 08:39:33 +00:00
|
|
|
'chrome.manifest',
|
|
|
|
'install.rdf',
|
|
|
|
// React needs to be patched by babel-worker.js, so symlink all files in resource/ except for
|
|
|
|
// those. Babel transpilation for React is still disabled in .babelrc.
|
|
|
|
'resource/**/*',
|
|
|
|
'!resource/react.js',
|
|
|
|
'!resource/react-dom.js',
|
2019-03-28 09:19:41 +00:00
|
|
|
'!resource/react-virtualized.js',
|
2020-07-17 22:14:10 +00:00
|
|
|
// Only include lib directory of singleFile
|
|
|
|
// Also do a little bit of manipulation similar to React
|
2020-10-23 23:39:07 +00:00
|
|
|
'!resource/SingleFile/**/*',
|
|
|
|
'resource/SingleFile/lib/**/*',
|
|
|
|
'resource/SingleFile/extension/lib/single-file/fetch/content/content-fetch.js',
|
|
|
|
'!resource/SingleFile/lib/single-file/single-file.js',
|
2020-12-15 21:37:33 +00:00
|
|
|
// We only need a couple Ace Editor files
|
|
|
|
'!resource/ace/**/*',
|
|
|
|
'resource/ace/ace.js',
|
2020-12-24 07:48:54 +00:00
|
|
|
// Enable for autocomplete
|
|
|
|
//'resource/ace/ext-language_tools.js',
|
2020-12-15 21:37:33 +00:00
|
|
|
'resource/ace/ext-searchbox.js',
|
|
|
|
'resource/ace/keybinding-emacs.js',
|
|
|
|
'resource/ace/keybinding-vim.js',
|
|
|
|
'resource/ace/mode-javascript.js',
|
2020-12-24 07:43:52 +00:00
|
|
|
'resource/ace/theme-chrome.js',
|
2020-12-15 21:37:33 +00:00
|
|
|
'resource/ace/theme-monokai.js',
|
|
|
|
'resource/ace/worker-javascript.js',
|
2019-03-20 08:39:33 +00:00
|
|
|
'update.rdf'
|
2017-06-20 23:18:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
// these files will be browserified during the build
|
|
|
|
const browserifyConfigs = [
|
2019-11-08 08:40:20 +00:00
|
|
|
{
|
|
|
|
src: 'node_modules/react-select/dist/react-select.cjs.prod.js',
|
|
|
|
dest: 'resource/react-select.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'react-select'
|
|
|
|
}
|
|
|
|
},
|
2018-02-25 20:07:33 +00:00
|
|
|
{
|
|
|
|
src: 'node_modules/url/url.js',
|
|
|
|
dest: 'resource/url.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'url'
|
|
|
|
}
|
|
|
|
},
|
2017-06-20 23:18:46 +00:00
|
|
|
{
|
|
|
|
src: 'node_modules/sinon/lib/sinon.js',
|
|
|
|
dest: 'test/resource/sinon.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'sinon'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'node_modules/chai-as-promised/lib/chai-as-promised.js',
|
|
|
|
dest: 'test/resource/chai-as-promised.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'chaiAsPromised'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
// exclude mask used for js, copy, symlink and sass tasks
|
Type/field handling overhaul
This changes the way item types, item fields, creator types, and CSL
mappings are defined and handled, in preparation for updated types and
fields.
Instead of being predefined in SQL files or code, type/field info is
read from a bundled JSON file shared with other parts of the Zotero
ecosystem [1], referred to as the "global schema". Updates to the
bundled schema file are automatically applied to the database at first
run, allowing changes to be made consistently across apps.
When syncing, invalid JSON properties are now rejected instead of being
ignored and processed later, which will allow for schema changes to be
made without causing problems in existing clients. We considered many
alternative approaches, but this approach is by far the simplest,
safest, and most transparent to the user.
For now, there are no actual changes to types and fields, since we'll
first need to do a sync cut-off for earlier versions that don't reject
invalid properties.
For third-party code, the main change is that type and field IDs should
no longer be hard-coded, since they may not be consistent in new
installs. For example, code should use `Zotero.ItemTypes.getID('note')`
instead of hard-coding `1`.
[1] https://github.com/zotero/zotero-schema
2019-05-16 08:56:46 +00:00
|
|
|
const ignoreMask = [
|
|
|
|
'**/#*',
|
|
|
|
'**/_*.scss',
|
|
|
|
'resource/schema/global/schema.json.gz'
|
|
|
|
];
|
2017-06-20 23:18:46 +00:00
|
|
|
|
|
|
|
const jsFiles = [
|
|
|
|
`{${dirs.join(',')}}/**/*.js`,
|
2017-05-22 23:10:03 +00:00
|
|
|
`{${dirs.join(',')}}/**/*.jsx`,
|
|
|
|
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.js`,
|
2019-03-20 08:39:33 +00:00
|
|
|
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.jsx`,
|
|
|
|
// Special handling for React -- see note above
|
|
|
|
'resource/react.js',
|
|
|
|
'resource/react-dom.js',
|
2019-03-28 09:19:41 +00:00
|
|
|
'resource/react-virtualized.js',
|
2020-10-23 23:39:07 +00:00
|
|
|
'resource/SingleFile/lib/single-file/single-file.js'
|
2017-05-22 23:10:03 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
const scssFiles = [
|
|
|
|
'scss/**/*.scss',
|
|
|
|
'chrome/skin/default/zotero/**/*.scss'
|
2017-06-20 23:18:46 +00:00
|
|
|
];
|
|
|
|
|
2021-02-11 18:58:25 +00:00
|
|
|
const buildsURL = 'https://zotero-download.s3.amazonaws.com/ci/';
|
|
|
|
|
2017-06-20 23:18:46 +00:00
|
|
|
module.exports = {
|
2021-02-11 18:58:25 +00:00
|
|
|
dirs, symlinkDirs, copyDirs, symlinkFiles, browserifyConfigs, jsFiles, scssFiles, ignoreMask, buildsURL
|
2018-03-01 23:18:37 +00:00
|
|
|
};
|