Skip to content

Commit a14f609

Browse files
authored
Handle Webpack and Prettier breaking changes (#3103)
This updates the CLI and Webpack plugin to handle breaking changes following the bump required for ESLint 9. Unfortunately Prettier 3 makes it very complicated to load configuration files with CJS, since it loads the ESM bundle using a top-level await, which is not supported by Node.js without additional experimental parameters. For now I've removed the functionality for custom Prettier configs, but we can reconsider this in the future (i.e., through specifying a Prettier path in the CLI config, or allowing to provide the options directly).
1 parent 9398e50 commit a14f609

File tree

42 files changed

+81
-87
lines changed

Some content is hidden

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

42 files changed

+81
-87
lines changed

jest.config.base.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ module.exports = {
121121
// A preset that is used as a base for Jest's configuration
122122
// preset: '',
123123

124+
// The path to the Prettier executable used to format snapshots
125+
// Jest doesn't support Prettier 3 yet, so we use Prettier 2
126+
prettierPath: require.resolve('prettier-2'),
127+
124128
// Run tests from one or more projects
125129
// projects: undefined,
126130

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"lodash": "^4.17.21",
113113
"minimatch": "^7.4.1",
114114
"prettier": "^3.3.3",
115+
"prettier-2": "npm:prettier@^2.8.8",
115116
"prettier-plugin-packagejson": "^2.5.8",
116117
"rimraf": "^4.1.2",
117118
"semver": "^7.5.4",

packages/examples/packages/bip32/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "hKyk+E4FxoOrxVUot4h92CctQ35L8Zwo6y5x4DpdkZw=",
10+
"shasum": "IPmfU5Yfr8CtU8hqE+sKtIvrtoKWeNZbjDWxck0Q1c8=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/bip44/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "KQiLG98qS86ThxbVvJW6DLpRtkSq238/rh2tHEZiJmA=",
10+
"shasum": "Fe+hvYArPSD1N+RvmsAhRM2makxXA9xPJzMsT/xYDLU=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/browserify-plugin/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "t/mItLdi/miIU7FWJjijmmaFT/5svN1dK4Ik+1LMbqw=",
10+
"shasum": "AAbLURsZMLxSRC5F69z6Un2W2wZ0v9UJfuPoYutZoH8=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/browserify/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "3kC/z0z6RjjarArtxcs+iltJRQgvZNIPBueMP0cLQJw=",
10+
"shasum": "DpjsNMTfivqHjOV/NMrhSZR4o3dHAQOFIPkV0gzPeFU=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/client-status/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "Gk6JUIChMAQRJbHFCWyMtmMGmqknidjdE8nLnHyaM2Q=",
10+
"shasum": "tiOQUmZUUEjlVRuK7Sb1t8Lmcy5TQXsdj8uJ8Ecfd4k=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/cronjobs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "b/ZsZh0z0ieSBHzlazYSkpkLMUSV4c442IFQ8Zgepq0=",
10+
"shasum": "Gw/JAlj3moUPfdWya3XTZV+mkROKZpUQ7spUAHsu8zE=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/dialogs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "asBcwQ0fIXFCZ6skpbENtZiyskGDEdEIrAbWkOvEQ0s=",
10+
"shasum": "nsXCGehK5VQDG0DBaUuQKx9tfOQsWcgyyJptTEE+Glw=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/ethereum-provider/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "Vm44DmG3HizDFI1VHohwXafP+dnv3evvlhgFmB8DX98=",
10+
"shasum": "E5FILDC9eOuFG+3qvKiAFRTzTitjBDzFPcTicdFqB9k=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

0 commit comments

Comments
 (0)