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',
|
2021-07-26 10:14:56 +00:00
|
|
|
'chrome/content/zotero/xpcom/translate/src',
|
2017-06-20 23:18:46 +00:00
|
|
|
'styles',
|
2021-12-29 01:32:56 +00:00
|
|
|
'translators',
|
2017-06-20 23:18:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
// 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',
|
2021-11-17 13:50:36 +00:00
|
|
|
// Only include dist directory of singleFile
|
2020-07-17 22:14:10 +00:00
|
|
|
// Also do a little bit of manipulation similar to React
|
2020-10-23 23:39:07 +00:00
|
|
|
'!resource/SingleFile/**/*',
|
2022-07-20 11:23:28 +00:00
|
|
|
'resource/SingleFile/lib/**/*',
|
|
|
|
'!resource/SingleFile/lib/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',
|
2021-05-08 22:45:24 +00:00
|
|
|
// Feed *.idl files are for documentation only
|
|
|
|
'!resource/feeds/*.idl',
|
2021-02-24 15:36:27 +00:00
|
|
|
'update.rdf',
|
2021-12-15 22:28:41 +00:00
|
|
|
'!chrome/skin/default/zotero/**/*.scss',
|
|
|
|
'!resource/citeproc_rs_wasm.js',
|
2022-09-12 21:06:17 +00:00
|
|
|
// We only need a few Monaco languages
|
|
|
|
'!resource/vs/**/*',
|
|
|
|
'resource/vs/loader.js',
|
|
|
|
'resource/vs/editor/editor.main.{js,css,nls.js}',
|
|
|
|
'resource/vs/base/**/*',
|
|
|
|
'resource/vs/basic-languages/javascript/*.js',
|
|
|
|
'resource/vs/basic-languages/typescript/*.js',
|
|
|
|
'resource/vs/basic-languages/xml/*.js',
|
|
|
|
'resource/vs/language/typescript/*.js',
|
|
|
|
'resource/vs/language/json/*.js',
|
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'
|
|
|
|
}
|
2022-10-09 12:01:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'node_modules/multimatch/index.js',
|
|
|
|
dest: 'resource/multimatch.js',
|
|
|
|
config: {
|
|
|
|
standalone: 'multimatch'
|
|
|
|
}
|
|
|
|
},
|
2017-06-20 23:18:46 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
// 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 = [
|
|
|
|
'**/#*',
|
2021-07-08 04:13:40 +00:00
|
|
|
'resource/schema/global/README.md',
|
|
|
|
'resource/schema/global/schema.json.gz',
|
2021-07-26 10:14:56 +00:00
|
|
|
'resource/schema/global/scripts/*',
|
|
|
|
'chrome/content/zotero/xpcom/translate/example/**/*',
|
|
|
|
'chrome/content/zotero/xpcom/translate/README.md',
|
2022-04-30 08:55:11 +00:00
|
|
|
'chrome/content/zotero/xpcom/utilities/node_modules/**/*',
|
|
|
|
'chrome/content/zotero/xpcom/utilities/test/**/*',
|
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
|
|
|
];
|
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',
|
2022-07-20 11:23:28 +00:00
|
|
|
'resource/SingleFile/lib/single-file.js',
|
2021-12-15 22:28:41 +00:00
|
|
|
'resource/citeproc_rs_wasm.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
|
|
|
};
|