forked from lpender/meteor-accounts-patch-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.js
133 lines (116 loc) · 5.27 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
"use strict";
Package.describe({
name: 'lpender:accounts-patch-ui',
version: '0.1.14',
// Brief, one-line summary of the package.
summary: 'Monkey patches accounts UI packages to support logged in users ' +
'who have not signed up.',
// URL to the Git repository containing the source code for this package.
git: 'https://github.com/brettle/meteor-accounts-patch-ui.git',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting documentation, set this field to null.
documentation: 'README.md'
});
Package.onUse(function(api) {
api.versionsFrom('1.0.4');
api.use('underscore', 'client');
api.use('accounts-base', 'client');
api.use('templating', 'client');
api.use('tracker', 'client');
api.use('accounts-ui-unstyled', 'client', { weak: true });
api.use('ian:[email protected] || 0.1.0', 'client',
{ weak: true });
// Allows other packages/apps to help determine whether a user has signed up.
api.use('brettle:[email protected]');
api.use('brettle:[email protected]', { weak: true });
// Whatever UI variation is being used, it needs to load first so that
// we can monkey patch it's atNav and atForm templates.
// Tested:
api.use('useraccounts:[email protected]', 'client', { weak: true });
// Untested but probably work:
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.use('useraccounts:[email protected]', 'client', { weak: true });
// Use specific versions of the following packages because we rely on or
// monkey patch their internals. Those internals could change even in a patch
// release. So as new releases of these packages are published, we need to
// re-test this package with the new release, and add the supported version
// below.
// We monkey patch the _helpers and _eventMaps Template properties blaze
// manages.
api.use('[email protected]', 'client');
// Among other things, we assume that the hooks in the options object are used
// directly, not copied.
api.use('iron:router@=1.0.13 || 1.0.12 || =1.0.11 || =1.0.10 || =1.0.9',
'client', { weak: true });
// Among other things, we use the internal _routesMap and _action properties.
// Also need the stop() function passed to triggers which was added in 2.5.0.
api.use('kadira:flow-router' +
'@=2.12.1 || =2.10.1 || =2.9.0 || =2.8.0 || =2.7.0 || =2.6.2 || =2.5.0',
'client', { weak: true });
// We don't rely on the internals of these packages, but we do rely on
// Router.routes and FlowRouter.routes which are undocumented, so we
// should watch them closely.
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.use('useraccounts:[email protected]', 'client', { weak: true });
api.export('AccountsPatchUi');
api.addFiles('accounts-patch-ui.js', 'client');
api.addFiles('patch-accounts-ui-unstyled.js', 'client');
api.addFiles('patch-ian_accounts-ui-bootstrap-3.js', 'client');
api.addFiles('patch-useraccounts.js', 'client');
});
Package.onTest(function(api) {
api.versionsFrom('1.0.4');
api.use('tinytest');
api.use('templating', 'client');
api.use('underscore');
api.use('tracker');
api.use('accounts-password');
api.use('test-helpers');
api.use('random');
api.use('ejson');
api.use('twbs:bootstrap');
// Test the useraccounts routing package identified by the UI environment var
var ui = process.env.UI;
// Set versions to test against below.
var blazeVersion = '2.1.8';
var useraccountsVersion = '1.14.2';
var ironRouterVersion = '1.0.13';
var kadiraFlowRouterVersion = '2.12.1';
if (ui === 'iron-routing') {
api.use('useraccounts:bootstrap@' + useraccountsVersion);
api.use('useraccounts:iron-routing@' + useraccountsVersion);
api.use('iron:router@' + ironRouterVersion);
} else if (ui === 'flow-routing') {
api.use('useraccounts:bootstrap@' + useraccountsVersion);
api.use('useraccounts:flow-routing@' + useraccountsVersion);
api.use('kadira:flow-router@' + kadiraFlowRouterVersion);
} else if (ui === 'accounts-ui') {
api.use('accounts-ui-unstyled');
}
api.use('brettle:[email protected]');
api.use('brettle:[email protected]');
api.use('brettle:accounts-patch-ui');
// Workaround iron:layout package not depending on tracker as required by
// Meteor 1.2.
api.imply('tracker');
// Workaround iron:middleware-stack package not depending on ejson as required
// by Meteor 1.2.
api.use('ejson');
api.imply('ejson');
// Workaround kadira:blaze-layout package not depending on jquery as required
// by Meteor 1.2.
api.use('jquery');
api.imply('jquery');
// Workaround softwarerero:accounts-t9n package not depending on blaze as
// required by Meteor 1.2.
api.use('blaze@' + blazeVersion);
api.imply('blaze@' + blazeVersion);
api.addFiles('accounts-patch-ui-tests.html', 'client');
api.addFiles('accounts-patch-ui-tests.js', 'client');
api.addFiles('accounts-patch-ui-tests-server.js', 'server');
});