forked from zotero/zotero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
128 lines (118 loc) · 3.46 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// 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'
];
// list of folders that are symlinked
const symlinkDirs = [
'chrome/content/zotero/xpcom/rdf',
'chrome/content/zotero/xpcom/translate/src',
'styles',
'translators',
'resource/vs'
];
// 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 = [
'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',
'!resource/react-virtualized.js',
// Only include dist directory of singleFile
// Also do a little bit of manipulation similar to React
'!resource/SingleFile/**/*',
'resource/SingleFile/lib/**/*',
'!resource/SingleFile/lib/single-file.js',
// We only need a couple Ace Editor files
'!resource/ace/**/*',
'resource/ace/ace.js',
// Enable for autocomplete
//'resource/ace/ext-language_tools.js',
'resource/ace/ext-searchbox.js',
'resource/ace/keybinding-emacs.js',
'resource/ace/keybinding-vim.js',
'resource/ace/mode-javascript.js',
'resource/ace/theme-chrome.js',
'resource/ace/theme-monokai.js',
'resource/ace/worker-javascript.js',
// Feed *.idl files are for documentation only
'!resource/feeds/*.idl',
'update.rdf',
'!chrome/skin/default/zotero/**/*.scss',
'!resource/citeproc_rs_wasm.js',
];
// these files will be browserified during the build
const browserifyConfigs = [
{
src: 'node_modules/react-select/dist/react-select.cjs.prod.js',
dest: 'resource/react-select.js',
config: {
standalone: 'react-select'
}
},
{
src: 'node_modules/url/url.js',
dest: 'resource/url.js',
config: {
standalone: 'url'
}
},
{
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
const ignoreMask = [
'**/#*',
'resource/schema/global/README.md',
'resource/schema/global/schema.json.gz',
'resource/schema/global/scripts/*',
'chrome/content/zotero/xpcom/translate/example/**/*',
'chrome/content/zotero/xpcom/translate/README.md',
'chrome/content/zotero/xpcom/utilities/node_modules/**/*',
'chrome/content/zotero/xpcom/utilities/test/**/*',
];
const jsFiles = [
`{${dirs.join(',')}}/**/*.js`,
`{${dirs.join(',')}}/**/*.jsx`,
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.js`,
`!{${symlinkDirs.concat(copyDirs).join(',')}}/**/*.jsx`,
// Special handling for React -- see note above
'resource/react.js',
'resource/react-dom.js',
'resource/react-virtualized.js',
'resource/SingleFile/lib/single-file.js',
'resource/citeproc_rs_wasm.js',
];
const scssFiles = [
'scss/**/*.scss',
'chrome/skin/default/zotero/**/*.scss'
];
const buildsURL = 'https://zotero-download.s3.amazonaws.com/ci/';
module.exports = {
dirs, symlinkDirs, copyDirs, symlinkFiles, browserifyConfigs, jsFiles, scssFiles, ignoreMask, buildsURL
};