Skip to content

Commit fcef3f3

Browse files
committed
Merge branch 'main' into 1.32-releases
2 parents d2ad0d5 + 59300ae commit fcef3f3

File tree

349 files changed

+14782
-13165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+14782
-13165
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 Sun Jul 10 2022.
2+
This document was automatically generated on Mon Jul 18 2022.
33

44
## List of dependencies
55

configs/eslint-config-compass/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongodb-js/eslint-config-compass",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"description": "Shared Compass eslint configuration",
55
"license": "SSPL",
66
"main": "index.js",
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"@babel/core": "^7.14.3",
1717
"@babel/eslint-parser": "^7.14.3",
18-
"@mongodb-js/eslint-plugin-compass": "^0.3.0",
18+
"@mongodb-js/eslint-plugin-compass": "^0.4.0",
1919
"@typescript-eslint/eslint-plugin": "^5.30.5",
2020
"@typescript-eslint/parser": "^5.30.5",
2121
"eslint-config-prettier": "^8.3.0",

configs/eslint-plugin-compass/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"email": "[email protected]"
1414
},
1515
"homepage": "https://github.com/mongodb-js/compass",
16-
"version": "0.3.0",
16+
"version": "0.4.0",
1717
"repository": {
1818
"type": "git",
1919
"url": "https://github.com/mongodb-js/compass.git"
@@ -37,8 +37,8 @@
3737
"reformat": "npm run prettier -- --write ."
3838
},
3939
"devDependencies": {
40-
"@mongodb-js/mocha-config-compass": "^0.11.0",
41-
"@mongodb-js/prettier-config-compass": "^0.5.0",
40+
"@mongodb-js/mocha-config-compass": "^0.12.0",
41+
"@mongodb-js/prettier-config-compass": "^0.6.0",
4242
"depcheck": "^1.4.1",
4343
"eslint": "^7.25.0",
4444
"mocha": "^8.4.0",

configs/mocha-config-compass/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const specs = process.argv.slice(2).filter((arg) => !arg.startsWith('-'));
44
// This can be written as `{src,test}/**/*.{spec,test}.*`, but this causes
55
// issues for mocha on some version. It will try to parse every string in the
66
// array by splitting on commas causing a wrong spec pattern to be applied. It
7-
// is fixed in latest, but as we are still in the process of updaing
7+
// is fixed in latest, but as we are still in the process of updating
88
// everything to the same version and working around the issue helps with
99
// migration (this can be removed when mocha is not in depalignrc anymore)
1010
const defaultSpecs = [

configs/mocha-config-compass/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "@mongodb-js/mocha-config-compass",
3-
"version": "0.11.0",
3+
"version": "0.12.0",
44
"description": "Shared mocha mocha configuration for Compass packages",
55
"license": "SSPL",
66
"main": "index.js",
77
"devDependencies": {
8-
"@mongodb-js/prettier-config-compass": "^0.5.0",
8+
"@mongodb-js/prettier-config-compass": "^0.6.0",
99
"prettier": "^2.7.1"
1010
},
1111
"scripts": {

configs/prettier-config-compass/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongodb-js/prettier-config-compass",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "Shared Compass prettier configuration",
55
"license": "SSPL",
66
"main": "index.json",

configs/tsconfig-compass/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongodb-js/tsconfig-compass",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "Shared Compass Typescript configuration",
55
"license": "SSPL",
66
"files": [
@@ -11,7 +11,7 @@
1111
"typescript": "^4.3.5"
1212
},
1313
"devDependencies": {
14-
"@mongodb-js/prettier-config-compass": "^0.5.0",
14+
"@mongodb-js/prettier-config-compass": "^0.6.0",
1515
"prettier": "^2.7.1"
1616
},
1717
"scripts": {

configs/webpack-config-compass/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"email": "[email protected]"
1414
},
1515
"homepage": "https://github.com/mongodb-js/compass",
16-
"version": "0.10.0",
16+
"version": "0.11.1",
1717
"repository": {
1818
"type": "git",
1919
"url": "https://github.com/mongodb-js/compass.git"
@@ -24,8 +24,8 @@
2424
"license": "SSPL",
2525
"main": "dist/index.js",
2626
"exports": {
27-
"require": "./dist/index.js",
28-
"import": "./dist/.esm-wrapper.mjs"
27+
"import": "./dist/.esm-wrapper.mjs",
28+
"require": "./dist/index.js"
2929
},
3030
"bin": {
3131
"webpack-compass": "./bin/webpack.js"
@@ -45,9 +45,9 @@
4545
"reformat": "npm run prettier -- --write ."
4646
},
4747
"devDependencies": {
48-
"@mongodb-js/eslint-config-compass": "^0.10.0",
49-
"@mongodb-js/prettier-config-compass": "^0.5.0",
50-
"@mongodb-js/tsconfig-compass": "^0.6.0",
48+
"@mongodb-js/eslint-config-compass": "^0.11.0",
49+
"@mongodb-js/prettier-config-compass": "^0.6.0",
50+
"@mongodb-js/tsconfig-compass": "^0.7.0",
5151
"@types/cli-progress": "^3.9.2",
5252
"@types/html-webpack-plugin": "^3.2.6",
5353
"@types/mini-css-extract-plugin": "^2.3.0",

configs/webpack-config-compass/src/externals.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { execSync } from 'child_process';
2+
13
export const sharedExternals: string[] = [
24
// Native Modules are very hard to bundle correctly with Webpack (and there is
35
// not much reason to do so) so to make our lives easier, we will always
@@ -17,4 +19,28 @@ export const sharedExternals: string[] = [
1719
'bson-ext',
1820
'snappy',
1921
'snappy/package.json',
22+
// Only used by compass-shell, but in theory should stay external everywhere
23+
'@mongosh/node-runtime-worker-thread',
24+
];
25+
26+
const monorepoWorkspaces = (
27+
JSON.parse(
28+
execSync('npx lerna list --all --json', {
29+
encoding: 'utf-8',
30+
31+
stdio: ['ignore', 'pipe', 'ignore'],
32+
})
33+
) as { name: string; location: string }[]
34+
).map((ws) => ws.name);
35+
36+
export const pluginExternals: string[] = [
37+
// All monorepo dependencies should be externalized
38+
...monorepoWorkspaces,
39+
// React needs to always stay external to avoid the chance of having multiple
40+
// react runtimes in one context
41+
'react',
42+
// Arbitrary external dependencies that would make sense to keep out of the
43+
// plugin bundles, feel free to update this as needed
44+
'mongodb-ace-autocompleter',
45+
'bson',
2046
];

configs/webpack-config-compass/src/index.ts

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
entriesToHtml,
2828
getLibraryNameFromCwd,
2929
} from './util';
30-
import { sharedExternals } from './externals';
30+
import { sharedExternals, pluginExternals } from './externals';
3131
import { WebpackPluginMulticompilerProgress } from './webpack-plugin-multicompiler-progress';
3232
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
3333

@@ -310,14 +310,20 @@ export function compassPluginConfig(
310310
}
311311

312312
return [
313-
createElectronMainConfig({
314-
...opts,
315-
entry: sandboxMain,
316-
}),
317-
createElectronRendererConfig({
318-
...opts,
319-
entry: sandboxRenderer,
320-
}),
313+
merge(
314+
createElectronMainConfig({
315+
...opts,
316+
entry: sandboxMain,
317+
}),
318+
{ externals: toCommonJsExternal(pluginExternals) }
319+
),
320+
merge(
321+
createElectronRendererConfig({
322+
...opts,
323+
entry: sandboxRenderer,
324+
}),
325+
{ externals: toCommonJsExternal(pluginExternals) }
326+
),
321327
];
322328
}
323329

@@ -326,19 +332,26 @@ export function compassPluginConfig(
326332
: path.join(opts.cwd, 'src', 'index.js');
327333

328334
return [
329-
createElectronRendererConfig({
330-
...opts,
331-
entry,
332-
outputFilename: 'index.js',
333-
}),
334-
createWebConfig({
335-
...opts,
336-
entry,
337-
outputFilename: 'browser.js',
338-
}),
335+
merge(
336+
createElectronRendererConfig({
337+
...opts,
338+
entry,
339+
outputFilename: 'index.js',
340+
}),
341+
{ externals: toCommonJsExternal(pluginExternals) }
342+
),
343+
merge(
344+
createWebConfig({
345+
...opts,
346+
entry,
347+
outputFilename: 'browser.js',
348+
}),
349+
{ externals: toCommonJsExternal(pluginExternals) }
350+
),
339351
];
340352
}
341353

354+
export { sharedExternals, pluginExternals };
342355
export { webpackArgsWithDefaults, isServe } from './args';
343356
export { default as webpack } from 'webpack';
344357
export { merge } from 'webpack-merge';

0 commit comments

Comments
 (0)