Skip to content

Commit 58b2b3f

Browse files
committed
chore(components): revert changes to webpack config; patch button to add the missing export
1 parent 24a0e4a commit 58b2b3f

File tree

5 files changed

+33
-17
lines changed

5 files changed

+33
-17
lines changed

configs/webpack-config-compass/polyfills/@leafygreen-ui/button/constants/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,6 @@ const sharedResolveOptions = (
102102
'index.js'
103103
),
104104

105-
// TODO: document what's going on here
106-
'@leafygreen-ui/button/constants': path.resolve(
107-
__dirname,
108-
'..',
109-
'polyfills',
110-
'@leafygreen-ui',
111-
'button',
112-
'constants',
113-
'index.js'
114-
),
115-
116105
// This is an optional dependency of the AWS SDK that doesn't look like
117106
// an optional dependency to webpack because it's not wrapped in try/catch.
118107
'@aws-sdk/client-sso-oidc': false,
@@ -287,10 +276,10 @@ export function createElectronRendererConfig(
287276
writeToDisk: true,
288277
},
289278
client: {
290-
overlay: {
291-
errors: true,
292-
warnings: false,
293-
},
279+
overlay:
280+
process.env.DISABLE_DEVSERVER_OVERLAY === 'true'
281+
? false
282+
: { warnings: false, errors: true, runtimeErrors: true },
294283
},
295284
https: false,
296285
hot: opts.hot,

package-lock.json

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

packages/compass-components/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"test-cov": "nyc --compact=false --produce-source-map=false -x \"**/*.spec.*\" --reporter=lcov --reporter=text --reporter=html npm run test",
2929
"test-watch": "npm run test -- --watch",
3030
"test-ci": "npm run test-cov",
31-
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write ."
31+
"reformat": "npm run eslint . -- --fix && npm run prettier -- --write .",
32+
"postinstall": "node ./scripts/patch-leafygreen-button.js"
3233
},
3334
"dependencies": {
3435
"@dnd-kit/core": "^6.0.7",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* We can't update @leafygreen-ui/button component to latest because it breaks
3+
* the types across the whole application, but we also have to add a dependency
4+
* on a new leafygreen package that depends on a new export from the button
5+
* package, this new export is a one-liner color value. As a temporary
6+
* workaround, we will patch leafygreen package and add the export manually. For
7+
* more details see https://github.com/mongodb-js/compass/pull/7223
8+
*/
9+
const fs = require('fs');
10+
const path = require('path');
11+
12+
const leafygreenButtonPackage = path.dirname(
13+
require.resolve('@leafygreen-ui/button/package.json')
14+
);
15+
16+
// eslint-disable-next-line no-console
17+
console.log('Adding @leafygreen-ui/button/constants export...');
18+
19+
fs.writeFileSync(
20+
path.join(leafygreenButtonPackage, 'constants.js'),
21+
"export const PRIMARY_BUTTON_INTERACTIVE_GREEN = '#00593F';"
22+
);
23+
fs.writeFileSync(
24+
path.join(leafygreenButtonPackage, 'constants.d.ts'),
25+
'export declare const PRIMARY_BUTTON_INTERACTIVE_GREEN = "#00593F";'
26+
);

0 commit comments

Comments
 (0)