Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move SVG to its own file. (Alternate PR) #34

Merged
merged 2 commits into from
Mar 28, 2024
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
117 changes: 117 additions & 0 deletions packages/snap/img/banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test": "jest"
},
"dependencies": {
"@metamask/snaps-sdk": "3.1.0",
"@metamask/snaps-sdk": "3.2.0",
"@metamask/utils": "^8.4.0",
"buffer": "^6.0.3"
},
Expand Down
13 changes: 12 additions & 1 deletion packages/snap/snap.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SnapConfig } from '@metamask/snaps-cli';
import { merge, type SnapConfig } from '@metamask/snaps-cli';
import { resolve } from 'path';

const config: SnapConfig = {
Expand All @@ -10,6 +10,17 @@ const config: SnapConfig = {
polyfills: {
buffer: true,
},
customizeWebpackConfig: (webpackConfig) =>
merge(webpackConfig, {
module: {
rules: [
{
test: /\.svg$/u,
type: 'asset/source',
},
],
},
}),
};

export default config;
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/Consensys/lxp-snap"
},
"source": {
"shasum": "wlgQrcTjUra39G2Y2d4+Y1O7jqyjYhBnIBc+2bH9fTI=",
"shasum": "UoOlIKigX7EpEbieg+P2xZDlsiq2m64xQSWSjVQEk2o=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
5 changes: 5 additions & 0 deletions packages/snap/src/types/image.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// eslint-disable-next-line import/unambiguous
declare module '*.svg' {
const content: string;
export default content;
}
7 changes: 3 additions & 4 deletions packages/snap/src/ui.ts

Large diffs are not rendered by default.

32 changes: 26 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ __metadata:
"@metamask/eslint-config-typescript": 12.1.0
"@metamask/snaps-cli": 6.0.2
"@metamask/snaps-jest": 6.0.1
"@metamask/snaps-sdk": 3.1.0
"@metamask/snaps-sdk": 3.2.0
"@metamask/utils": ^8.4.0
"@typescript-eslint/eslint-plugin": ^5.42.1
"@typescript-eslint/parser": ^5.42.1
Expand Down Expand Up @@ -2944,6 +2944,26 @@ __metadata:
languageName: node
linkType: hard

"@metamask/providers@npm:^16.0.0":
version: 16.0.0
resolution: "@metamask/providers@npm:16.0.0"
dependencies:
"@metamask/json-rpc-engine": ^7.3.2
"@metamask/json-rpc-middleware-stream": ^6.0.2
"@metamask/object-multiplex": ^2.0.0
"@metamask/rpc-errors": ^6.2.1
"@metamask/safe-event-emitter": ^3.0.0
"@metamask/utils": ^8.3.0
detect-browser: ^5.2.0
extension-port-stream: ^3.0.0
fast-deep-equal: ^3.1.3
is-stream: ^2.0.0
readable-stream: ^3.6.2
webextension-polyfill: ^0.10.0
checksum: cdc06796111edbf01e9aa8498170f7ffa3c68a4c0f66a629e3b0f7d37ee60eb32d83ee12f285c3d974d971c6af16a3fba531fb5733f5fa9412a18e1d3f648539
languageName: node
linkType: hard

"@metamask/rpc-errors@npm:^6.0.0, @metamask/rpc-errors@npm:^6.1.0, @metamask/rpc-errors@npm:^6.2.1":
version: 6.2.1
resolution: "@metamask/rpc-errors@npm:6.2.1"
Expand Down Expand Up @@ -3151,17 +3171,17 @@ __metadata:
languageName: node
linkType: hard

"@metamask/snaps-sdk@npm:3.1.0":
version: 3.1.0
resolution: "@metamask/snaps-sdk@npm:3.1.0"
"@metamask/snaps-sdk@npm:3.2.0":
version: 3.2.0
resolution: "@metamask/snaps-sdk@npm:3.2.0"
dependencies:
"@metamask/key-tree": ^9.0.0
"@metamask/providers": ^14.0.2
"@metamask/providers": ^16.0.0
"@metamask/rpc-errors": ^6.2.1
"@metamask/utils": ^8.3.0
fast-xml-parser: ^4.3.4
superstruct: ^1.0.3
checksum: 292c97eb4f98530fcb0dc207643686ad927ec4d86ac43c296ecc3b5500aef160556ae19eb3f8e15dbb5ffcf7763b51da90ff327a1f1a10ab2409afd3d9b8caed
checksum: a95f10403b50be7b6b35b49eef3724eabb8ef0763db6434e6c77a6d56fb18deab928764dee2738ee6428e77ea582b3dd71e5cbdb19dfb37389dc4c6d34294891
languageName: node
linkType: hard

Expand Down
Loading