Skip to content

Commit f15ec06

Browse files
committed
Merge branch 'main' into 1.32-releases
2 parents d7569fa + 9470303 commit f15ec06

File tree

7 files changed

+80
-94
lines changed

7 files changed

+80
-94
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **compass**.
2-
This document was automatically generated on Tue Aug 02 2022.
2+
This document was automatically generated on Wed Aug 03 2022.
33

44
## List of dependencies
55

packages/bson-transpilers/lib/symbol-table/pythontojavascript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/bson-transpilers/lib/symbol-table/shelltojavascript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/bson-transpilers/symbols/javascript/templates.yaml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Templates:
1515
l: 'l'
1616
u: 'u'
1717
# Syntax
18-
DriverTemplate: &DriverTemplate !!js/function >
18+
DriverTemplate: &DriverTemplate !!js/function |
1919
(spec) => {
2020
const comment = `/*
2121
* Requires the MongoDB Node.js Driver
@@ -29,7 +29,7 @@ Templates:
2929
let defs;
3030
if ('aggregation' in spec) {
3131
const agg = spec.aggregation;
32-
cmd = `coll.aggregate(agg, (cmdErr, result) => {`;
32+
cmd = `const cursor = coll.aggregate(agg);`;
3333
defs = `const agg = ${agg};\n`;
3434
} else {
3535
let opts = '';
@@ -44,29 +44,26 @@ Templates:
4444
defs = Object.keys(args).reduce((s, k) => {
4545
if (k !== 'filter') {
4646
if (opts === '') {
47-
opts = `${k}: ${k}`;
47+
opts = `${k}`;
4848
} else {
49-
opts = `${opts}, ${k}: ${k}`;
49+
opts = `${opts}, ${k}`;
5050
}
5151
}
5252
return `${s}const ${k} = ${args[k]};\n`;
5353
}, '');
5454
opts = opts === '' ? '' : `, { ${opts} }`;
5555
}
56-
cmd = `coll.find(filter${opts}, (cmdErr, result) => {`;
56+
cmd = `const cursor = coll.find(filter${opts});`;
5757
}
5858
return `${comment}\n\n${defs}
59-
MongoClient.connect(
59+
const client = await MongoClient.connect(
6060
'${spec.options.uri}',
61-
{ useNewUrlParser: true, useUnifiedTopology: true },
62-
function(connectErr, client) {
63-
assert.equal(null, connectErr);
64-
const coll = client.db('${spec.options.database}').collection('${spec.options.collection}');
65-
${cmd}
66-
assert.equal(null, cmdErr);
67-
});
68-
client.close();
69-
});`;
61+
{ useNewUrlParser: true, useUnifiedTopology: true }
62+
);
63+
const coll = client.db('${spec.options.database}').collection('${spec.options.collection}');
64+
${cmd}
65+
const result = await cursor.toArray();
66+
await client.close();`;
7067
}
7168
EqualitySyntaxTemplate: &EqualitySyntaxTemplate !!js/function >
7269
(lhs, op, rhs) => {
@@ -574,14 +571,13 @@ Templates:
574571
}
575572
);
576573
if (bson.length) {
577-
other.push(`const {\n ${bson.join(',\n ')}\n} = require('mongodb');`);
574+
other.push(`import {\n ${bson.join(',\n ')}\n} from 'mongodb';`);
578575
}
579576
return other.join('\n');
580577
}
581578
DriverImportTemplate: &DriverImportTemplate !!js/function >
582579
() => {
583-
return `const MongoClient = require('mongodb').MongoClient;
584-
const assert = require('assert');`;
580+
return `import { MongoClient } from 'mongodb';`;
585581
}
586582
0ImportTemplate: &0ImportTemplate null
587583
1ImportTemplate: &1ImportTemplate null

packages/bson-transpilers/test/yaml/driver-syntax.yaml

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,14 @@ tests:
5555
'y': new ObjectId()
5656
};
5757
58-
MongoClient.connect(
58+
const client = await MongoClient.connect(
5959
'mongodb://localhost:27017',
60-
{ useNewUrlParser: true, useUnifiedTopology: true },
61-
function(connectErr, client) {
62-
assert.equal(null, connectErr);
63-
const coll = client.db('db').collection('collection');
64-
coll.aggregate(agg, (cmdErr, result) => {
65-
assert.equal(null, cmdErr);
66-
});
67-
client.close();
68-
});
60+
{ useNewUrlParser: true, useUnifiedTopology: true }
61+
);
62+
const coll = client.db('db').collection('collection');
63+
const cursor = coll.aggregate(agg);
64+
const result = await cursor.toArray();
65+
await client.close();
6966
shell: |-
7067
mongo 'mongodb://localhost:27017' --eval "db = db.getSiblingDB('db');
7168
db.collection.aggregate({
@@ -142,12 +139,11 @@ tests:
142139
import java.util.concurrent.TimeUnit;
143140
import org.bson.Document;
144141
javascript: |-
145-
const MongoClient = require('mongodb').MongoClient;
146-
const assert = require('assert');
147-
const {
142+
import { MongoClient } from 'mongodb';
143+
import {
148144
ObjectId,
149145
Long
150-
} = require('mongodb');
146+
} from 'mongodb';
151147
shell: ''
152148
php: |-
153149
use MongoDB\BSON\ObjectId;
@@ -213,17 +209,14 @@ tests:
213209
'x': Long.fromNumber(0)
214210
};
215211
216-
MongoClient.connect(
212+
const client = await MongoClient.connect(
217213
'mongodb://localhost:27017',
218-
{ useNewUrlParser: true, useUnifiedTopology: true },
219-
function(connectErr, client) {
220-
assert.equal(null, connectErr);
221-
const coll = client.db('db').collection('collection');
222-
coll.find(filter, (cmdErr, result) => {
223-
assert.equal(null, cmdErr);
224-
});
225-
client.close();
226-
});
214+
{ useNewUrlParser: true, useUnifiedTopology: true }
215+
);
216+
const coll = client.db('db').collection('collection');
217+
const cursor = coll.find(filter);
218+
const result = await cursor.toArray();
219+
await client.close();
227220
shell: |-
228221
mongo 'mongodb://localhost:27017' --eval "db = db.getSiblingDB('db');
229222
db.collection.find({
@@ -293,11 +286,10 @@ tests:
293286
import java.util.concurrent.TimeUnit;
294287
import org.bson.Document;
295288
javascript: |-
296-
const MongoClient = require('mongodb').MongoClient;
297-
const assert = require('assert');
298-
const {
289+
import { MongoClient } from 'mongodb';
290+
import {
299291
Long
300-
} = require('mongodb');
292+
} from 'mongodb';
301293
shell: ''
302294
php: |-
303295
use MongoDB\Client;
@@ -431,17 +423,14 @@ tests:
431423
'locale': 'zh'
432424
};
433425
434-
MongoClient.connect(
426+
const client = await MongoClient.connect(
435427
'mongodb://localhost:27017',
436-
{ useNewUrlParser: true, useUnifiedTopology: true },
437-
function(connectErr, client) {
438-
assert.equal(null, connectErr);
439-
const coll = client.db('db').collection('collection');
440-
coll.find(filter, { projection: projection, sort: sort, skip: skip, limit: limit, maxTimeMS: maxTimeMS, collation: collation }, (cmdErr, result) => {
441-
assert.equal(null, cmdErr);
442-
});
443-
client.close();
444-
});
428+
{ useNewUrlParser: true, useUnifiedTopology: true }
429+
);
430+
const coll = client.db('db').collection('collection');
431+
const cursor = coll.find(filter, { projection, sort, skip, limit, maxTimeMS, collation });
432+
const result = await cursor.toArray();
433+
await client.close();
445434
shell: |-
446435
mongo 'mongodb://localhost:27017' --eval "db = db.getSiblingDB('db');
447436
db.collection.find({
@@ -560,12 +549,11 @@ tests:
560549
import java.util.concurrent.TimeUnit;
561550
import org.bson.Document;
562551
javascript: |-
563-
const MongoClient = require('mongodb').MongoClient;
564-
const assert = require('assert');
565-
const {
552+
import { MongoClient } from 'mongodb';
553+
import {
566554
ObjectId,
567555
Long
568-
} = require('mongodb');
556+
} from 'mongodb';
569557
shell: ''
570558
php: |-
571559
use MongoDB\BSON\ObjectId;

packages/bson-transpilers/test/yaml/imports.yaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ tests:
7171
using MongoDB.Driver;
7272
python: from bson import Code
7373
javascript: |-
74-
const {
74+
import {
7575
Code
76-
} = require('mongodb');
76+
} from 'mongodb';
7777
php: |-
7878
use MongoDB\BSON\Javascript;
7979
ruby: require 'bson'
@@ -101,9 +101,9 @@ tests:
101101
using MongoDB.Driver;
102102
python: from bson import Code
103103
javascript: |-
104-
const {
104+
import {
105105
Code
106-
} = require('mongodb');
106+
} from 'mongodb';
107107
php: |-
108108
use MongoDB\BSON\Javascript;
109109
ruby: require 'bson'
@@ -130,9 +130,9 @@ tests:
130130
using MongoDB.Driver;
131131
python: from bson import ObjectId
132132
javascript: |-
133-
const {
133+
import {
134134
ObjectId
135-
} = require('mongodb');
135+
} from 'mongodb';
136136
php: |-
137137
use MongoDB\BSON\ObjectId;
138138
ruby: require 'bson'
@@ -159,9 +159,9 @@ tests:
159159
using MongoDB.Driver;
160160
python: from bson import Timestamp
161161
javascript: |-
162-
const {
162+
import {
163163
Timestamp
164-
} = require('mongodb');
164+
} from 'mongodb';
165165
php: |-
166166
use MongoDB\BSON\Timestamp;
167167
go: |-
@@ -187,10 +187,10 @@ tests:
187187
using MongoDB.Driver;
188188
python: from bson import ObjectId, DBRef
189189
javascript: |-
190-
const {
190+
import {
191191
ObjectId,
192192
DBRef
193-
} = require('mongodb');
193+
} from 'mongodb';
194194
php: |-
195195
use MongoDB\BSON\ObjectId;
196196
ruby: require 'bson'
@@ -230,9 +230,9 @@ tests:
230230
using MongoDB.Driver;
231231
python: ''
232232
javascript: |-
233-
const {
233+
import {
234234
Int32
235-
} = require('mongodb');
235+
} from 'mongodb';
236236
php: ''
237237
ruby: ''
238238
go: |-
@@ -254,9 +254,9 @@ tests:
254254
using MongoDB.Driver;
255255
python: from bson import Int64
256256
javascript: |-
257-
const {
257+
import {
258258
Long
259-
} = require('mongodb');
259+
} from 'mongodb';
260260
php: ''
261261
ruby: ''
262262
go: |-
@@ -280,9 +280,9 @@ tests:
280280
using MongoDB.Driver;
281281
python: from bson import MinKey
282282
javascript: |-
283-
const {
283+
import {
284284
MinKey
285-
} = require('mongodb');
285+
} from 'mongodb';
286286
php: |-
287287
use MongoDB\BSON\MinKey;
288288
ruby: require 'bson'
@@ -308,9 +308,9 @@ tests:
308308
using MongoDB.Driver;
309309
python: from bson import MaxKey
310310
javascript: |-
311-
const {
311+
import {
312312
MaxKey
313-
} = require('mongodb');
313+
} from 'mongodb';
314314
php: |-
315315
use MongoDB\BSON\MaxKey;
316316
ruby: require 'bson'
@@ -409,9 +409,9 @@ tests:
409409
using MongoDB.Driver;
410410
python: from bson import Timestamp
411411
javascript: |-
412-
const {
412+
import {
413413
Timestamp
414-
} = require('mongodb');
414+
} from 'mongodb';
415415
php: |-
416416
use MongoDB\BSON\Timestamp;
417417
ruby: require 'bson'
@@ -436,9 +436,9 @@ tests:
436436
using MongoDB.Driver;
437437
python: ''
438438
javascript: |-
439-
const {
439+
import {
440440
BSONSymbol
441-
} = require('mongodb');
441+
} from 'mongodb';
442442
php: ''
443443
ruby: ''
444444
go: |-
@@ -461,9 +461,9 @@ tests:
461461
using MongoDB.Driver;
462462
python: from bson import Decimal128
463463
javascript: |-
464-
const {
464+
import {
465465
Decimal128
466-
} = require('mongodb');
466+
} from 'mongodb';
467467
php: |-
468468
use MongoDB\BSON\Decimal128;
469469
ruby: require 'bson'
@@ -598,7 +598,7 @@ tests:
598598
from datetime import datetime, tzinfo, timezone
599599
from bson import Code, ObjectId, DBRef, Int64, MinKey, MaxKey, Timestamp, Decimal128
600600
javascript: |-
601-
const {
601+
import {
602602
Code,
603603
ObjectId,
604604
DBRef,
@@ -609,7 +609,7 @@ tests:
609609
Timestamp,
610610
BSONSymbol,
611611
Decimal128
612-
} = require('mongodb');
612+
} from 'mongodb';
613613
php: |-
614614
use MongoDB\BSON\Decimal128;
615615
use MongoDB\BSON\Javascript;

packages/hadron-build/lib/target.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,22 +496,24 @@ class Target {
496496
this.packagerOptions.appBundleId += `.${this.channel}`;
497497
}
498498

499-
this.osx_dmg_label = this.osx_dmg_filename = `${this.productName}.dmg`;
500-
this.osx_zip_label = this.osx_zip_filename = `${this.productName}.zip`;
499+
this.osx_dmg_label =
500+
this.osx_dmg_filename = `${this.id}-${this.version}-${this.platform}-${this.arch}.dmg`;
501+
this.osx_zip_label =
502+
this.osx_zip_filename = `${this.id}-${this.version}-${this.platform}-${this.arch}.zip`;
501503

502504
this.assets = [
503505
{
504-
name: `${this.id}-${this.version}-${this.platform}-${this.arch}.dmg`,
506+
name: this.osx_dmg_label,
505507
path: this.dest(this.osx_dmg_label)
506508
},
507509
{
508-
name: `${this.id}-${this.version}-${this.platform}-${this.arch}.zip`,
510+
name: this.osx_zip_label,
509511
path: this.dest(this.osx_zip_label)
510512
}
511513
];
512514

513515
this.installerOptions = {
514-
dmgPath: this.dest(`${this.productName}.dmg`),
516+
dmgPath: this.dest(this.osx_dmg_filename),
515517
title: this.truncatedProductName, // actually names the dmg
516518
overwrite: true,
517519
out: this.out,

0 commit comments

Comments
 (0)