-
Notifications
You must be signed in to change notification settings - Fork 23
/
package.js
174 lines (147 loc) · 4.37 KB
/
package.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Package.describe({
name: "mizzao:turkserver",
summary: "Web-based, real-time behavioral studies and experiments",
version: "0.5.0",
git: "https://github.com/TurkServer/turkserver-meteor.git"
});
Npm.depends({
"mturk-api": "1.3.2",
jspath: "0.3.2",
deepmerge: "0.2.7" // For merging config parameters
});
Package.onUse(function(api) {
api.versionsFrom("1.4.4.6");
// Client-only deps
api.use(["session", "ui", "templating", "reactive-var"], "client");
// Client & Server deps
api.use([
"accounts-base",
"accounts-ui",
"accounts-password", // for the admin user
"check",
"deps",
"ejson",
"jquery",
"random",
"underscore",
"ecmascript",
"facts"
]);
api.use(["ddp", "mongo"]); // For pub/sub and collections
// To use the promises in mturk-api from Fibers code
api.use("promise");
// Non-core packages
api.use("aldeed:[email protected]");
api.use("mizzao:[email protected]");
api.use("iron:[email protected]");
api.use("iron:[email protected]"); // Fixes route error in Chrome 51+
api.use("momentjs:[email protected]");
api.use("twbs:[email protected]");
api.use("d3js:[email protected]");
api.use("mizzao:[email protected]");
api.use("natestrauser:[email protected]_1");
// Dev packages - may be locally installed with submodule
api.use("matb33:[email protected]");
api.use("mizzao:[email protected]");
api.use("mizzao:[email protected]");
api.use("mizzao:[email protected]");
// Shared files
api.addFiles(["lib/shared.js", "lib/common.js", "lib/util.js"]);
// Server files
api.addFiles(
[
"server/config.js",
"server/turkserver.js",
"server/server_api.js",
"server/mturk.js",
"server/lobby_server.js",
"server/batches.js",
"server/instance.js",
"server/logging.js",
"server/assigners.js",
"server/assigners_extra.js",
"server/assignment.js",
"server/connections.js",
"server/timers_server.js",
"server/accounts_mturk.js"
],
"server"
);
// Client
api.addFiles(
[
"client/templates.html",
"client/login.html",
"client/client_api.js",
"client/ts_client.css",
"client/ts_client.js",
"client/login.js",
"client/logging_client.js",
"client/timers_client.js",
"client/helpers.js",
"client/lobby_client.html",
"client/lobby_client.js",
"client/dialogs.js"
],
"client"
);
// Admin
api.addFiles(
[
"admin/admin.css",
"admin/util.html",
"admin/util.js",
"admin/clientAdmin.html",
"admin/clientAdmin.js",
"admin/mturkAdmin.html",
"admin/mturkAdmin.js",
"admin/experimentAdmin.html",
"admin/experimentAdmin.js",
"admin/lobbyAdmin.html",
"admin/lobbyAdmin.js"
],
"client"
);
api.addFiles("admin/admin.js", "server");
api.export(["TurkServer"]);
/*
Exported collections for legacy purposes
TODO Direct access to these should be deprecated in the future
*/
api.export(["Batches", "Treatments", "Experiments", "LobbyStatus", "Logs", "RoundTimers"]);
api.export(["ErrMsg", "TestUtils"], { testOnly: true });
});
Package.onTest(function(api) {
api.use([
"accounts-base",
"accounts-password",
"check",
"deps",
"ecmascript",
"mongo",
"random",
"ui",
"underscore"
]);
api.use(["tinytest", "test-helpers"]);
api.use("session", "client");
api.use("iron:router"); // Needed so we can un-configure the router
api.use("mizzao:partitioner");
api.use("mizzao:timesync");
api.use("mizzao:turkserver"); // This package!
api.addFiles("tests/display_fix.css");
api.addFiles("tests/utils.js"); // Deletes users so do it before insecure login
api.addFiles("tests/insecure_login.js");
api.addFiles("tests/lobby_tests.js");
api.addFiles("tests/admin_tests.js", "server");
api.addFiles("tests/auth_tests.js", "server");
api.addFiles("tests/connection_tests.js", "server");
api.addFiles("tests/experiment_tests.js", "server");
api.addFiles("tests/experiment_client_tests.js");
api.addFiles("tests/timer_tests.js", "server");
api.addFiles("tests/logging_tests.js");
// This goes after experiment tests, so we can be sure that assigning works
api.addFiles("tests/assigner_tests.js", "server");
// This runs after user is logged in, as it requires a userId
api.addFiles("tests/helper_tests.js");
});