-
Notifications
You must be signed in to change notification settings - Fork 11
/
package.js
96 lines (81 loc) · 1.99 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
var fs = Npm.require('fs');
var path = Npm.require('path');
Package.describe({
name: 'meteorhacks:zones',
summary: 'Zone.Js integration for meteor',
version: "1.6.0",
git: "https://github.com/meteorhacks/zones.git"
});
Package.on_use(function (api) {
addPackageFiles(api);
api.export('Zones', 'server');
});
Package.on_test(function (api) {
addPackageFiles(api);
api.use([
'tinytest',
'test-helpers',
], 'client');
api.add_files([
'tests/_both.js'
], ['client', 'server']);
api.add_files([
'tests/_server.js'
], 'server');
api.add_files([
'tests/loader.js',
'tests/reporters.js',
'tests/hijacks/methods.js',
'tests/hijacks/subscriptions.js',
'tests/hijacks/collections.js',
], 'client');
});
function addPackageFiles(api) {
if(api.versionsFrom) {
api.versionsFrom('METEOR@0.9.2.1');
api.use('meteorhacks:inject-initial@1.0.0', ['server']);
} else {
api.use('inject-initial');
}
api.add_files([
'assets/utils.js',
'assets/before.js',
'assets/zone.js',
'assets/after.js',
'assets/reporters.js',
'assets/tracer.js',
], 'client', {isAsset: true});
api.add_files(['server/inject.js'], 'server');
api.add_files([
'client/hijack.js'
], 'client');
api.use('underscore', 'client');
api.use('ui', 'client');
api.use('templating', 'client');
api.use('deps', 'client');
api.use('session', 'client');
api.use('livedata', 'client');
api.use('minimongo', 'client');
}
//--------------------------------------------------------------------------\\
function meteorRoot() {
var currentDir = process.cwd();
while (currentDir) {
var newDir = path.dirname(currentDir);
if (isAppDir(currentDir)) {
break;
} else if (newDir === currentDir) {
return null;
} else {
currentDir = newDir;
}
}
return currentDir;
}
function isAppDir(filepath) {
try {
return fs.statSync(path.join(filepath, '.meteor', 'packages')).isFile();
} catch (e) {
return false;
}
}