Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/examples/packages/bip32/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "F7ivhZmdIvKZscE0qwB0R+xSc4HRTT0a95gMKeJl16Q=",
"shasum": "dzOD3mPn8PgVXC3LT3OtKqs09WIcvuYo/mIZGfhsTPw=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/bip44/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "N5Q+VpmbEeHQaPvmkcVBFjklgZRtRQduE6DrpSsOOWg=",
"shasum": "t0+OXVvAOnJOEgxjLB9Gz9CtAhNJr0nj9WC7nEeEZUs=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "2OBivoL7fIcLdItL+xVPHfXmQGRuTOivsbe64+GLQBs=",
"shasum": "F82zbRfEEnc1c86GZ4InV+zw8QWVrLUidEXAn9JEsQU=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/browserify/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "2nGjLyvpliG86yQdB2XXVd8sJRGVgZ5+G1u4VEu38ZI=",
"shasum": "1sJyCRTlEdkAIK1YhFlrKr10ANhP1JkHj6dO9TE2HNc=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/cronjobs/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "cybkClzduKLQkOV9Xys+VqARKLhM2eNV1j2JWVBImsQ=",
"shasum": "cN0208xWa/KFZC1yxBzxI5kX8ippChcAvh6EktyVZc8=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/dialogs/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "s6P1F+6Smeqs9JtfkYqJirNEXQHBmG3rpuLfO5+d1SI=",
"shasum": "IYw+FXMDWsuPR9+Di86/XAyYLNKhGRD0V+cxpVRmE/k=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/ethers-js/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "K+FpXp3Gdi9oVc1mtZvYc7fxgHV/azyRWrTKU5Cw0tA=",
"shasum": "Jlze2D18cQUFtRPMu4IbpSa+54YvNYgr1Sa7Jqj2tX4=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/get-entropy/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "tstA8WXQC7MJ0JSVZtXwKgUnsw2be2uHhzBAZ3lvsBE=",
"shasum": "lmkCL1vKbBcM9oIiHMkfGq1P7CATFx/fksf+kvlv+eU=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/packages/images/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "UQ7StQt/zx02mi9KSctaGDrRda9D8S4lpEisnHurpdI=",
"shasum": "CfLAZ5yE8Fpk5YX6CDSTVNHO6E6QikompdWug6768Oo=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "OM2JgZ2JWizvGRFKtFRmk0m5llAPB1onsd0DIZqgQDs=",
"shasum": "7/M6NL4m5ofiZWsPt9mXf095lXBwq81rEugAAiDMHiY=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "aBna+Q/8uYXqPAam8KGHdJsUM1p9CQ/AKQZM4iUNZUo=",
"shasum": "Yv7P2vKDYmTXIHpy4TkFgUQhXAaLUSnvg6b2LZ+88OI=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/MetaMask/snaps.git"
},
"source": {
"shasum": "VZUO5kVGwedoq6iiiVOHODsE+MI+EvJQqiSabotepes=",
"shasum": "ndVs9qXJP41bolCI4yMyQ3RNSFMGkS7s8usi9Ieph0Y=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
6 changes: 4 additions & 2 deletions packages/snaps-browserify-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ export class SnapsBrowserifyTransform extends Transform {

postBundle(this.#options, result.code)
.catch((error) => {
// Wrapped in `setTimeout` to avoid calling `callback` twice.
setTimeout(() => callback(error), 0);
// TODO: Either fix this lint violation or explain why it's necessary to
// ignore.
// eslint-disable-next-line promise/no-callback-in-promise
callback(error);
})
.finally(() => {
this.push(result.code);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
declare module 'readable-stream' {
export type {
DuplexOptions,
Readable,
Writable,
TransformCallback,
} from 'stream';
export { Transform, Duplex, pipeline } from 'stream';
export type { DuplexOptions, Writable, TransformCallback } from 'stream';
export { Readable, Transform, Duplex, pipeline } from 'stream';
}
4 changes: 2 additions & 2 deletions packages/snaps-controllers/coverage.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"branches": 93.31,
"functions": 97.05,
"lines": 98.2,
"statements": 97.93
"lines": 98.25,
"statements": 97.98
}
2 changes: 1 addition & 1 deletion packages/snaps-jest/src/internals/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('startServer', () => {
"registry": "https://registry.npmjs.org",
},
},
"shasum": "uaLwMO39qzKbshqPM6W2Ju7gkO/czuwgNKpjzXRXJj0=",
"shasum": "zp08CpwhlXWqh4cq0kjRownzH8Ujte70VVoiqikNKQs=",
},
"version": "1.0.0",
}
Expand Down
4 changes: 3 additions & 1 deletion packages/snaps-jest/src/matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ const toRenderLegacy: MatcherFunction<[expected: Component]> = function (
};

export const toRender: MatcherFunction<[expected: ComponentOrElement]> =
async function (actual, expected) {
// This should not return a promise.
// eslint-disable-next-line @typescript-eslint/promise-function-async
function (actual, expected) {
assertHasInterface(actual, 'toRender');

if (!isJSXElementUnsafe(expected)) {
Expand Down
1 change: 1 addition & 0 deletions packages/snaps-jest/src/test-utils/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ export function getMockInterfaceResponse(
selectFromRadioGroup: jest.fn(),
selectFromSelector: jest.fn(),
uploadFile: jest.fn(),
waitForUpdate: jest.fn(),
};
}
2 changes: 1 addition & 1 deletion packages/snaps-jest/src/test-utils/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "baz",
"version": "1.0.0",
"source": {
"shasum": "uaLwMO39qzKbshqPM6W2Ju7gkO/czuwgNKpjzXRXJj0=",
"shasum": "zp08CpwhlXWqh4cq0kjRownzH8Ujte70VVoiqikNKQs=",
"location": {
"npm": {
"filePath": "snap.js",
Expand Down
14 changes: 7 additions & 7 deletions packages/snaps-simulation/src/files.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('getFileSize', () => {
it('returns the file size for a file path', async () => {
expect(
await getFileSize(resolve(__dirname, './test-utils/snap/snap.js')),
).toBe(112);
).toBe(73);
});
});

Expand All @@ -73,9 +73,9 @@ describe('getFileToUpload', () => {
expect(file).toStrictEqual({
name: 'bar.js',
contentType: 'application/foo',
size: 112,
size: 73,
contents:
'Ly8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWNvbnNvbGUKY29uc29sZS5sb2coJ0hlbGxvLCB3b3JsZCEnKTsKCm1vZHVsZS5leHBvcnRzLm9uUnBjUmVxdWVzdCA9ICgpID0+IG51bGw7Cg==',
'Y29uc29sZS5sb2coJ0hlbGxvLCB3b3JsZCEnKTsKCm1vZHVsZS5leHBvcnRzLm9uUnBjUmVxdWVzdCA9ICgpID0+IG51bGw7Cg==',
});
});

Expand All @@ -87,9 +87,9 @@ describe('getFileToUpload', () => {
expect(file).toStrictEqual({
name: 'bar.js',
contentType: 'application/javascript',
size: 112,
size: 73,
contents:
'Ly8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWNvbnNvbGUKY29uc29sZS5sb2coJ0hlbGxvLCB3b3JsZCEnKTsKCm1vZHVsZS5leHBvcnRzLm9uUnBjUmVxdWVzdCA9ICgpID0+IG51bGw7Cg==',
'Y29uc29sZS5sb2coJ0hlbGxvLCB3b3JsZCEnKTsKCm1vZHVsZS5leHBvcnRzLm9uUnBjUmVxdWVzdCA9ICgpID0+IG51bGw7Cg==',
});
});

Expand All @@ -99,9 +99,9 @@ describe('getFileToUpload', () => {
expect(file).toStrictEqual({
name: 'snap.js',
contentType: 'application/javascript',
size: 112,
size: 73,
contents:
'Ly8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWNvbnNvbGUKY29uc29sZS5sb2coJ0hlbGxvLCB3b3JsZCEnKTsKCm1vZHVsZS5leHBvcnRzLm9uUnBjUmVxdWVzdCA9ICgpID0+IG51bGw7Cg==',
'Y29uc29sZS5sb2coJ0hlbGxvLCB3b3JsZCEnKTsKCm1vZHVsZS5leHBvcnRzLm9uUnBjUmVxdWVzdCA9ICgpID0+IG51bGw7Cg==',
});
});

Expand Down
1 change: 1 addition & 0 deletions packages/snaps-simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"lodash.memoize": "^4.1.2",
"lodash.throttle": "^4.1.1",
"monaco-editor": "^0.38.0",
"prettier-2": "npm:prettier@^2.7.1",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
"react-dom": "^18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-simulator/src/features/builder/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
import { is } from '@metamask/superstruct';
import { assert, hasProperty } from '@metamask/utils';
import type { NodeModel } from '@minoru/react-dnd-treeview';
import typescript from 'prettier/parser-typescript';
import { format } from 'prettier/standalone';
import typescript from 'prettier-2/parser-typescript';
import { format } from 'prettier-2/standalone';

/**
* Get the text of a node model.
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5733,6 +5733,7 @@ __metadata:
monaco-editor: "npm:^0.38.0"
monaco-editor-webpack-plugin: "npm:^7.0.1"
prettier: "npm:^3.3.3"
prettier-2: "npm:prettier@^2.7.1"
process: "npm:^0.11.10"
react: "npm:^18.2.0"
react-dnd: "npm:^16.0.1"
Expand Down Expand Up @@ -18472,7 +18473,7 @@ __metadata:
languageName: node
linkType: hard

"prettier-2@npm:prettier@^2.8.8":
"prettier-2@npm:prettier@^2.7.1, prettier-2@npm:prettier@^2.8.8":
version: 2.8.8
resolution: "prettier@npm:2.8.8"
bin:
Expand Down
Loading