Skip to content

Commit 458276b

Browse files
committed
Merge branch 'main' of github.com:mongodb-js/compass into gagik/collection-tab
2 parents 2863676 + 37c9633 commit 458276b

File tree

243 files changed

+7508
-4301
lines changed

Some content is hidden

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

243 files changed

+7508
-4301
lines changed

.evergreen/print-compass-env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ if [[ "${EVERGREEN_PROJECT}" == "10gen-compass-main" ]]; then
4343
month=$(escapeLeadingZero "${ts[1]}")
4444
day=$(escapeLeadingZero "${ts[2]}")
4545
hour=$(escapeLeadingZero "${ts[3]}")
46-
minute="${ts[4]}"
47-
second="${ts[5]}"
46+
minute=$(escapeLeadingZero "${ts[4]}")
47+
second=$(escapeLeadingZero "${ts[5]}")
4848
export DEV_VERSION_IDENTIFIER="${year}.${month}.${day}-dev.${hour}${minute}${second}"
4949
fi
5050
fi

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @mongodb-js/compass-developers

.github/workflows/test-installers.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ jobs:
4646
run: echo "[Evergreen Task](${{ github.event.inputs.evergreen_task_url }})" >> $GITHUB_STEP_SUMMARY
4747
test:
4848
name: ${{ matrix.package }} test ${{ matrix.test }} (${{ matrix.hadron-distribution }})
49-
timeout-minutes: 30
49+
# Windows specifically takes A TON of time to bootstrap itself before being
50+
# able to run tests, so we're setting the timeout pretty high to account for
51+
# that
52+
timeout-minutes: 60
5053
strategy:
5154
fail-fast: false
5255
matrix:
@@ -174,7 +177,7 @@ jobs:
174177
runs-on: ${{ matrix.runs-on }}
175178
container: ${{ matrix.container }}
176179
env:
177-
DEBUG: compass:smoketests:*
180+
DEBUG: compass:smoketests:*,compass-e2e-tests:*
178181
steps:
179182
- name: Checkout
180183
uses: actions/checkout@v2

.github/workflows/update-eslint.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ jobs:
3838
3939
- name: Bump eslint
4040
run: |
41-
npm i --save eslint@8 -w @mongodb-js/eslint-config-compass
41+
npm i --save --workspace @mongodb-js/eslint-config-compass \
42+
eslint@8 \
43+
@typescript-eslint/eslint-plugin@latest \
44+
@typescript-eslint/parser@latest
4245
4346
- name: Create Pull Request
4447
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,4 @@ Dylan Richardson <[email protected]>
104104
Ruby Dong <[email protected]>
105105
Neal Beeken <[email protected]>
106106
Walter Tan <[email protected]>
107+
Raymond Lo <[email protected]>

THIRD-PARTY-NOTICES.md

Lines changed: 388 additions & 41 deletions
Large diffs are not rendered by default.

configs/eslint-config-compass/index.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const path = require('path');
44
const shared = require('@mongodb-js/eslint-config-devtools');
55
const common = require('@mongodb-js/eslint-config-devtools/common');
6+
const chaiFriendly = require('eslint-plugin-chai-friendly');
67

78
const extraTsRules = {
89
// Newly converted plugins use `any` quite a lot, we can't enable the rule,
@@ -15,6 +16,18 @@ const extraTsRules = {
1516
'error',
1617
{ fixMixedExportsWithInlineTypeSpecifier: false },
1718
],
19+
// We use chai outside of tests, hence applying these rules to all ts files
20+
...chaiFriendly.configs.recommended.rules,
21+
'@typescript-eslint/prefer-promise-reject-errors': 'off',
22+
'@typescript-eslint/only-throw-error': 'off',
23+
24+
// TODO: a lot new hits with latest typescript-eslint, we should gradually
25+
// clean those out and re-enable the rules
26+
'@typescript-eslint/no-explicit-any': 'warn',
27+
'@typescript-eslint/no-base-to-string': 'warn',
28+
'@typescript-eslint/unbound-method': 'warn',
29+
'@typescript-eslint/no-duplicate-type-constituents': 'warn',
30+
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
1831
};
1932

2033
const tsRules = {
@@ -50,7 +63,7 @@ const commonTestOverrides = {
5063
{
5164
patterns: [
5265
{
53-
group: '@testing-library/*',
66+
group: ['@testing-library/*'],
5467
message: 'Use @mongodb-js/testing-library-compass instead',
5568
allowTypeImports: false,
5669
},
@@ -84,7 +97,7 @@ const testTsOverrides = {
8497
};
8598

8699
module.exports = {
87-
plugins: [...shared.plugins, '@mongodb-js/compass'],
100+
plugins: [...shared.plugins, '@mongodb-js/compass', 'chai-friendly'],
88101
rules: {
89102
...shared.rules,
90103
'@mongodb-js/compass/no-leafygreen-outside-compass-components': 'error',

configs/eslint-config-compass/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mongodb-js/eslint-config-compass",
3-
"version": "1.3.9",
3+
"version": "1.3.10",
44
"description": "Shared Compass eslint configuration",
55
"license": "SSPL",
66
"main": "index.js",
@@ -18,10 +18,11 @@
1818
"@babel/eslint-parser": "^7.14.3",
1919
"@mongodb-js/eslint-config-devtools": "^0.9.9",
2020
"@mongodb-js/eslint-plugin-compass": "^1.2.9",
21-
"@typescript-eslint/eslint-plugin": "^5.59.0",
22-
"@typescript-eslint/parser": "^5.59.0",
21+
"@typescript-eslint/eslint-plugin": "^8.34.0",
22+
"@typescript-eslint/parser": "^8.34.0",
2323
"eslint": "^8.57.1",
2424
"eslint-config-prettier": "^8.3.0",
25+
"eslint-plugin-chai-friendly": "^1.1.0",
2526
"eslint-plugin-filename-rules": "^1.2.0",
2627
"eslint-plugin-jsx-a11y": "^6.10.2",
2728
"eslint-plugin-mocha": "^8.0.0",

configs/eslint-config-compass/plugin.js

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,51 @@ function restrictedProviderImport(servicePkg) {
1010
};
1111
}
1212

13+
// node built-ins with meaningful polyfills in web environment
14+
const allowedNodeJSBuiltinModules = ['assert', 'stream', 'events'];
15+
1316
module.exports = {
1417
...baseConfig,
1518
rules: {
1619
...baseConfig.rules,
1720
'no-restricted-imports': 'off',
1821
'@typescript-eslint/no-restricted-imports': [
1922
'error',
20-
restrictedProviderImport('@mongodb-js/compass-logging'),
21-
restrictedProviderImport('@mongodb-js/compass-telemetry'),
22-
restrictedProviderImport('@mongodb-js/compass-app-stores'),
23-
restrictedProviderImport('@mongodb-js/my-queries-storage'),
24-
restrictedProviderImport('@mongodb-js/atlas-service'),
25-
restrictedProviderImport('compass-preferences-model'),
26-
{
27-
paths: require('module').builtinModules,
28-
message: 'Using Node.js built-in modules in plugins is not allowed.',
29-
allowTypeImports: false,
30-
},
3123
{
32-
paths: ['electron', '@electron/remote'],
33-
message: 'Using electron modules in plugins is not allowed.',
34-
allowTypeImports: false,
24+
paths: [
25+
restrictedProviderImport('@mongodb-js/compass-logging'),
26+
restrictedProviderImport('@mongodb-js/compass-telemetry'),
27+
restrictedProviderImport('@mongodb-js/compass-app-stores'),
28+
restrictedProviderImport('@mongodb-js/my-queries-storage'),
29+
restrictedProviderImport('@mongodb-js/atlas-service'),
30+
restrictedProviderImport('compass-preferences-model'),
31+
...require('module')
32+
.builtinModules.filter((module) => {
33+
return (
34+
!module.startsWith('_') &&
35+
!allowedNodeJSBuiltinModules.includes(module)
36+
);
37+
})
38+
.flatMap((name) => {
39+
const config = {
40+
message:
41+
'Using Node.js built-in modules in plugins is not allowed.',
42+
allowTypeImports: true,
43+
};
44+
45+
return [
46+
{ name, ...config },
47+
{ name: `node:${name}`, ...config },
48+
];
49+
}),
50+
...['electron', '@electron/remote'].map((name) => {
51+
return {
52+
name,
53+
message: 'Using electron modules in plugins is not allowed.',
54+
allowTypeImports: false,
55+
};
56+
}),
57+
],
3558
},
3659
],
3760
},

configs/testing-library-compass/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"email": "[email protected]"
1212
},
1313
"homepage": "https://github.com/mongodb-js/compass",
14-
"version": "1.3.1",
14+
"version": "1.3.2",
1515
"repository": {
1616
"type": "git",
1717
"url": "https://github.com/mongodb-js/compass.git"
@@ -45,7 +45,7 @@
4545
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
4646
},
4747
"devDependencies": {
48-
"@mongodb-js/eslint-config-compass": "^1.3.9",
48+
"@mongodb-js/eslint-config-compass": "^1.3.10",
4949
"@mongodb-js/mocha-config-compass": "^1.6.8",
5050
"@mongodb-js/prettier-config-compass": "^1.2.8",
5151
"@mongodb-js/tsconfig-compass": "^1.2.8",

0 commit comments

Comments
 (0)