Skip to content

Commit b29423d

Browse files
committed
Merge pull request #227 from 10gen/windows-keytar
🏁 keytar
2 parents 5e27436 + ab1995d commit b29423d

File tree

11 files changed

+99
-64
lines changed

11 files changed

+99
-64
lines changed

.evergreen.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ functions:
6363
script: |
6464
set -ev
6565
export PATH="${node_path}:$PATH"
66+
ls -alh ${node_path}
6667
test -n "${add_environment|}" && export ${add_environment|}
6768
${npm|npm} version --json
6869
${npm|npm} config set loglevel error
6970
${npm|npm} config -g list
71+
which -a npm
72+
node -p process.env
7073
${npm|npm} install
7174
7275
# For Windows: retrieve a fake "signtool.exe" which proxies to notary-service,
@@ -81,7 +84,7 @@ functions:
8184
curl -fs \
8285
-o "signtool.exe" \
8386
--url "https://s3.amazonaws.com/boxes.10gen.com/build/signtool.exe"
84-
rm node_modules/electron-installer-squirrel-windows/vendor/signtool.exe
87+
rm -f node_modules/electron-installer-squirrel-windows/vendor/signtool.exe
8588
8689
# Environment variables set for use by notary-service signtool.exe on Windows:
8790
# NOTARY_URL, NOTARY_AUTH_TOKEN, NOTARY_SIGNING_KEY, NOTARY_SIGNING_COMMENT

gulpfile.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ var del = require('del');
2525
var sequence = require('run-sequence');
2626
var watch = require('gulp-watch');
2727
var notify = require('./tasks/notify');
28+
var format = require('util').format;
2829
var pkg = require('./package.json');
2930

31+
var which = require('which');
32+
console.log('which npm?', which.sync('npm', {all: true}));
33+
3034
// Platform specific tasks
3135
var platform = require(path.join(__dirname, 'tasks', process.platform));
3236

@@ -63,6 +67,7 @@ gulp.task('build', function(done) {
6367
'copy:package.json'
6468
],
6569
'npm:install',
70+
'electron-rebuild',
6671
'build:js'
6772
, done);
6873
});
@@ -258,3 +263,18 @@ gulp.task('npm:install', shell.task('npm install --production --quiet --loglevel
258263
gulp.task('clean', function(done) {
259264
del(['build/', 'dist/', 'node_modules/'], done);
260265
});
266+
267+
268+
/**
269+
* @note (imlucas): When our electron updates to [email protected], we'll need to update
270+
* the `--node-module-version` used here to `47`.
271+
* You're very welcome, @futurelucas.
272+
*/
273+
gulp.task('electron-rebuild',
274+
shell.task(format([
275+
'electron-rebuild',
276+
'--version %s',
277+
'--node-module-version 46',
278+
'--module-dir ./build/node_modules',
279+
'--which-module keytar'
280+
].join(' '), pkg.electron_version)));

package.json

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"release": "gulp release",
6464
"test": "mocha",
6565
"ci": "npm run check && npm test && npm run release",
66-
"check": "mongodb-js-precommit ./*.js src/{**/*.js,*.js} test/{**/*.js,*.js} tasks/*.js",
66+
"check": "mongodb-js-precommit --debug ./*.js src/{**/*.js,*.js} test/{**/*.js,*.js} tasks/*.js",
6767
"fmt": "mongodb-js-fmt ./*.js src/{**/*.js,*.js} test/{**/*.js,*.js} tasks/*.js"
6868
},
6969
"pre-commit": [
@@ -74,23 +74,6 @@
7474
"url": "git://github.com/10gen/scout.git"
7575
},
7676
"dependencies": {
77-
"debug": "^2.2.0",
78-
"electron-squirrel-startup": "^0.1.4",
79-
"highlight.js": "^8.9.1",
80-
"kerberos": "0.0.17",
81-
"keytar": "mongodb-js/node-keytar",
82-
"localforage": "^1.3.0",
83-
"marky-mark": "^1.2.1",
84-
"mongodb-collection-model": "^0.1.1",
85-
"mongodb-connection-model": "^3.0.7",
86-
"mongodb-instance-model": "^1.0.2",
87-
"mongodb-js-metrics": "^0.2.2",
88-
"mongodb-ns": "^1.0.1",
89-
"ms": "^0.7.1",
90-
"node-notifier": "^4.3.1",
91-
"scout-server": "http://bin.mongodb.org/js/scout-server/v0.4.6/scout-server-0.4.6.tar.gz"
92-
},
93-
"devDependencies": {
9477
"ampersand-app": "^1.0.4",
9578
"ampersand-collection": "^1.5.0",
9679
"ampersand-collection-filterable": "^0.2.1",
@@ -111,14 +94,34 @@
11194
"async": "^1.5.0",
11295
"backoff": "^2.4.1",
11396
"bootstrap": "https://github.com/twbs/bootstrap/archive/v3.3.5.tar.gz",
97+
"debug": "^2.2.0",
98+
"electron-squirrel-startup": "^0.1.4",
99+
"highlight.js": "^8.9.1",
100+
"kerberos": "0.0.17",
101+
"keytar": "mongodb-js/node-keytar#compass-production",
102+
"localforage": "^1.3.0",
103+
"marky-mark": "^1.2.1",
104+
"mongodb-collection-model": "^0.1.1",
105+
"mongodb-connection-model": "^3.0.7",
106+
"mongodb-instance-model": "^1.0.2",
107+
"mongodb-js-metrics": "^0.2.2",
108+
"mongodb-ns": "^1.0.1",
109+
"ms": "^0.7.1",
110+
"mongodb-language-model": "^0.3.3",
111+
"mongodb-schema": "^3.3.1",
112+
"node-notifier": "^4.3.1",
113+
"scout-server": "http://bin.mongodb.org/js/scout-server/v0.4.6/scout-server-0.4.6.tar.gz"
114+
},
115+
"devDependencies": {
114116
"browserify": "^12.0.1",
115117
"chalk": "^1.1.1",
116118
"d3": "^3.5.6",
117119
"del": "^2.0.2",
118120
"domready": "^1.0.8",
119121
"electron-installer-dmg": "^0.1.0",
120-
"electron-installer-squirrel-windows": "^0.4.0",
122+
"electron-installer-squirrel-windows": "^1.0.0",
121123
"electron-packager": "^5.1.1",
124+
"electron-rebuild": "^1.0.2",
122125
"eslint": "^1.9.0",
123126
"eslint-config-mongodb-js": "^1.0.6",
124127
"event-stream": "^3.3.2",
@@ -144,10 +147,9 @@
144147
"mongodb-extended-json": "^1.5.3",
145148
"mongodb-js-fmt": "^0.0.3",
146149
"mongodb-js-precommit": "^0.2.8",
147-
"mongodb-language-model": "^0.3.3",
148-
"mongodb-schema": "^3.3.1",
149150
"mousetrap": "^1.5.3",
150151
"node-notifier": "^4.3.1",
152+
"npm": "^3.4.0",
151153
"numeral": "^1.5.3",
152154
"octicons": "https://github.com/github/octicons/archive/v3.1.0.tar.gz",
153155
"pluralize": "^1.2.1",

src/minicharts/d3fns/coordinates.js

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,23 @@ var minicharts_d3fns_coordinates = function() {
5656

5757
xScale
5858
.domain([
59-
d3.min(data, function(d) { return d[0]; }) - 3,
60-
d3.max(data, function(d) { return d[0]; }) + 3
59+
d3.min(data, function(d) {
60+
return d[0];
61+
}) - 3,
62+
d3.max(data, function(d) {
63+
return d[0];
64+
}) + 3
6165
])
6266
.range([0, innerWidth]);
6367

6468
yScale
6569
.domain([
66-
d3.min(data, function(d) { return d[1]; }) - 3,
67-
d3.max(data, function(d) { return d[1]; }) + 3
70+
d3.min(data, function(d) {
71+
return d[1];
72+
}) - 3,
73+
d3.max(data, function(d) {
74+
return d[1];
75+
}) + 3
6876
])
6977
.range([innerHeight, 0]);
7078

@@ -82,26 +90,26 @@ var minicharts_d3fns_coordinates = function() {
8290
.attr('class', 'x axis')
8391
.attr('transform', 'translate(0, ' + innerHeight + ')')
8492
.append('text')
85-
// .attr('class', 'label')
86-
.attr('x', innerWidth)
87-
.attr('y', -6)
88-
.style('text-anchor', 'end')
89-
.text('lng');
93+
// .attr('class', 'label')
94+
.attr('x', innerWidth)
95+
.attr('y', -6)
96+
.style('text-anchor', 'end')
97+
.text('lng');
9098
x.call(xAxis);
9199

92100
var y = g.selectAll('.y.axis').data([null]);
93101
y.enter().append('g')
94102
.attr('class', 'y axis')
95103
.append('text')
96-
// .attr('class', 'label')
97-
.attr('transform', 'rotate(-90)')
98-
.attr('y', 6)
99-
.attr('dy', '.71em')
100-
.style('text-anchor', 'end')
101-
.text('lat');
104+
// .attr('class', 'label')
105+
.attr('transform', 'rotate(-90)')
106+
.attr('y', 6)
107+
.attr('dy', '.71em')
108+
.style('text-anchor', 'end')
109+
.text('lat');
102110
y.call(yAxis);
103111

104-
// select all g.bar elements
112+
// select all g.bar elements
105113
var circle = g.selectAll('circle.circle')
106114
.data(data);
107115

src/minicharts/d3fns/date.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ var minicharts_d3fns_date = function() {
265265
.on('mousedown', handleMouseDown);
266266

267267
// disabling direct onClick handler in favor of click-drag
268-
// .on('click', handleClick);
268+
// .on('click', handleClick);
269269

270270
lines
271271
.attr('y1', barcodeTop)

src/minicharts/d3fns/few.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var minicharts_d3fns_few = function() {
3030
.attr('class', 'd3-tip')
3131
.direction('n')
3232
.offset([-9, 0]);
33-
// --- end chart setup ---
33+
// --- end chart setup ---
3434

3535
function handleClick(d) {
3636
if (!options.view) {

src/minicharts/d3fns/geo.js

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ var minicharts_d3fns_geo = function() {
111111
buttons: ['OK']
112112
});
113113

114-
// @todo thomasr/imlucas: add call to metrics.error here with errror code
114+
// @todo thomasr/imlucas: add call to metrics.error here with errror code
115115
};
116116

117117
var script = document.createElement('script');
@@ -152,14 +152,18 @@ var minicharts_d3fns_geo = function() {
152152
function onKeyDown() {
153153
if (d3.event.keyCode === SHIFTKEY) {
154154
// disable dragging while shift is pressed
155-
googleMap.setOptions({ draggable: false });
155+
googleMap.setOptions({
156+
draggable: false
157+
});
156158
}
157159
}
158160

159161
function onKeyUp() {
160162
if (d3.event.keyCode === SHIFTKEY) {
161163
// disable dragging while shift is pressed
162-
googleMap.setOptions({ draggable: true });
164+
googleMap.setOptions({
165+
draggable: true
166+
});
163167
}
164168
}
165169

@@ -334,25 +338,25 @@ var minicharts_d3fns_geo = function() {
334338
};
335339

336340
var marker = layer.selectAll('svg.marker')
337-
.data(data)
338-
.each(transform) // update existing markers
341+
.data(data)
342+
.each(transform) // update existing markers
339343
.enter().append('svg:svg')
340-
.each(transform)
341-
.attr('class', 'marker');
344+
.each(transform)
345+
.attr('class', 'marker');
342346

343347
// Add a circle
344348
marker.append('circle')
345-
.attr('r', 4.5)
346-
.attr('cx', padding)
347-
.attr('cy', padding);
349+
.attr('r', 4.5)
350+
.attr('cx', padding)
351+
.attr('cy', padding);
348352
}; // end overlay.draw
349353

350354
overlay.setMap(googleMap);
351355
innerDiv.on('mousedown', startSelection);
352356

353357
d3.select('body')
354-
.on('keydown', onKeyDown)
355-
.on('keyup', onKeyUp);
358+
.on('keydown', onKeyDown)
359+
.on('keyup', onKeyUp);
356360
} // end if (!googleMap) ...
357361

358362
// var innerWidth = width - margin.left - margin.right;
@@ -368,11 +372,14 @@ var minicharts_d3fns_geo = function() {
368372
fillColor: '#F68A1E',
369373
fillOpacity: 0.35,
370374
map: googleMap,
371-
center: { lat: 0, lng: 0 },
375+
center: {
376+
lat: 0,
377+
lng: 0
378+
},
372379
radius: 0,
373380
visible: false,
374381
draggable: true
375-
// editable: true
382+
// editable: true
376383
});
377384

378385
selectionCircle.addListener('drag', function() {

src/minicharts/d3fns/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ module.exports = {
44
date: require('./date'),
55
string: require('./string'),
66
objectid: require('./date'),
7-
geo: require('./geo'), // google maps
7+
geo: require('./geo'), // google maps
88
coordinates: require('./coordinates')
99
};

src/minicharts/d3fns/many.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var minicharts_d3fns_many = function() {
3535
.on('brushstart', brushstart)
3636
.on('brush', brushed)
3737
.on('brushend', brushend);
38-
// --- end chart setup ---
38+
// --- end chart setup ---
3939

4040
function handleClick(d) {
4141
if (!options.view || !options.selectable) {

src/tour/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ var TourView = View.extend({
3939
evt.preventDefault();
4040
evt.stopPropagation();
4141
this.tourRemove();
42-
} else if ([
43-
RIGHT_ARROW_KEY,
44-
TAB_KEY,
45-
ENTER_KEY,
46-
SPACE_KEY
47-
].indexOf(evt.keyCode) !== -1) {
42+
} else if ([RIGHT_ARROW_KEY, TAB_KEY, ENTER_KEY, SPACE_KEY].indexOf(evt.keyCode) !== -1) {
4843
this.showNextFeature();
4944
} else if (evt.keyCode === LEFT_ARROW_KEY) {
5045
this.showPreviousFeature();

0 commit comments

Comments
 (0)