Repository navigation
Expand file tree
/
Copy pathpackage.js
More file actions
85 lines (75 loc) 路 1.98 KB
/
Copy pathpackage.js
File metadata and controls
85 lines (75 loc) 路 1.98 KB
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
Package.describe({
name: 'ostrio:mailer',
version: '5.3.1',
summary: '馃摦 Email queue extending nodemailer with multi-SMTP transports and horizontally scaled apps support',
git: 'https://github.com/veliovgroup/mail-time',
documentation: 'README.md'
});
/**
* Single source of truth for the `josk` runtime dependency version.
* Declared in both `onUse` and `onTest`.
* josk 6.5.0 declares `engines.node >=14.21.3`, so Meteor 2.14-2.16 (Node 14)
* install and run it; the Meteor 2.x CI jobs verify this on every change.
*/
const JOSK_VERSION = '6.5.0';
/**
* Meteor test-packages runs package.js under each release's bundled Node.
* @returns {{ npm: Record<string, string>, mocha: string }}
*/
const meteorTestProfile = () => {
const nodeMajor = parseInt(String(process.versions.node).split('.')[0], 10);
if (nodeMajor >= 20) {
return {
npm: {
chai: '6.2.2',
pg: '8.20.0',
redis: '5.12.1',
},
mocha: 'meteortesting:mocha@3.3.0',
};
}
if (nodeMajor >= 18) {
return {
npm: {
chai: '5.3.3',
redis: '4.7.1',
pg: '8.16.3',
},
mocha: 'meteortesting:mocha@3.3.0',
};
}
if (nodeMajor >= 14) {
return {
npm: {
chai: '4.4.1',
redis: '4.7.1',
pg: '8.11.3',
},
mocha: 'meteortesting:mocha@2.1.0',
};
}
throw new Error(`ostrio:mailer requires Node >= 14 (got ${process.version})`);
};
Package.onUse((api) => {
Npm.depends({
josk: JOSK_VERSION,
});
api.versionsFrom(['2.14', '3.2']);
api.use([
'ecmascript',
'mongo',
'zodern:types@1.0.13',
], 'server');
api.mainModule('index.js', 'server');
});
Package.onTest((api) => {
const profile = meteorTestProfile();
Npm.depends({ josk: JOSK_VERSION, ...profile.npm });
api.use([
'ecmascript',
'mongo',
profile.mocha,
], 'server');
api.addFiles('test/recipient-policy-scenarios.js', 'server', { lazy: true });
api.addFiles('test/meteor.js', 'server');
});