Skip to content

Commit ffdf690

Browse files
authored
build: replace squirrelly with eta (#23215)
1 parent 5915234 commit ffdf690

File tree

10 files changed

+35
-51
lines changed

10 files changed

+35
-51
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ app/_locales/** linguist-generated
2020
# yarn berry suggested .gitattributes
2121
/.yarn/releases/** binary
2222
/.yarn/plugins/** binary
23+
24+
app/*.html linguist-language=EJS

.vscode/extensions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"recommendations": [
33
"rvest.vs-code-prettier-eslint",
4-
"streetsidesoftware.code-spell-checker"
4+
"streetsidesoftware.code-spell-checker",
5+
"DigitalBrainstem.javascript-ejs-support"
56
]
67
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"cSpell.words": ["blockaid", "lavamoat"],
33
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
44
"editor.tabSize": 2,
5+
"files.associations": {
6+
"app/*.html": "ejs"
7+
},
58
"files.trimTrailingWhitespace": true,
69
"javascript.preferences.importModuleSpecifier": "relative",
710
"json.schemas": [

.yarn/patches/squirrelly-npm-9.0.0-3cf710c7bb.patch

-13
This file was deleted.

app/home.html

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
6-
{{ @if (it.isTest) }}
7-
<title>MetaMask</title>
8-
{{ #elif (it.isMMI) }}
6+
<% if (it.isMMI && !it.isTest) { %>
97
<title>MetaMask Institutional</title>
10-
{{ #else }}
8+
<% } else { %>
119
<title>MetaMask</title>
12-
{{/if}}
10+
<% } %>
1311
<link rel="stylesheet" type="text/css" href="./index.css">
1412
</head>
1513
<body>

app/notification.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
55
<meta charset="utf-8" />
66

7-
{{ @if (it.isTest) }}
7+
<% if (it.isTest) { %>
88
<title>MetaMask Dialog</title>
9-
{{ #elif (it.isMMI) }}
9+
<% } else if (it.isMMI) { %>
1010
<title>MetaMask Institutional</title>
11-
{{ #else }}
11+
<% } else { %>
1212
<title>MetaMask</title>
13-
{{/if}}
13+
<% } %>
1414

1515
<style>
1616
#app-content {

development/build/scripts.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const through = require('through2');
2323
const endOfStream = pify(require('end-of-stream'));
2424
const labeledStreamSplicer = require('labeled-stream-splicer').obj;
2525
const wrapInStream = require('pumpify').obj;
26-
const Sqrl = require('squirrelly');
26+
const { Eta } = require('eta');
2727
const lavapack = require('@lavamoat/lavapack');
2828
const lavamoatBrowserify = require('lavamoat-browserify');
2929
const terser = require('terser');
@@ -1325,7 +1325,8 @@ function renderHtmlFile({
13251325
const htmlFilePath = `./app/${htmlName}.html`;
13261326
const htmlTemplate = readFileSync(htmlFilePath, 'utf8');
13271327

1328-
const htmlOutput = Sqrl.render(htmlTemplate, { isMMI, isTest });
1328+
const eta = new Eta();
1329+
const htmlOutput = eta.renderString(htmlTemplate, { isMMI, isTest });
13291330
browserPlatforms.forEach((platform) => {
13301331
const dest = `./dist/${platform}/${htmlName}.html`;
13311332
// we dont have a way of creating async events atm

lavamoat/build-system/policy.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -3283,6 +3283,15 @@
32833283
"eslint>strip-ansi>ansi-regex": true
32843284
}
32853285
},
3286+
"eta": {
3287+
"builtin": {
3288+
"node:fs": true,
3289+
"node:path": true
3290+
},
3291+
"globals": {
3292+
"define": true
3293+
}
3294+
},
32863295
"fancy-log": {
32873296
"builtin": {
32883297
"console.Console": true
@@ -7533,15 +7542,6 @@
75337542
"fetch": true
75347543
}
75357544
},
7536-
"squirrelly": {
7537-
"builtin": {
7538-
"fs.existsSync": true,
7539-
"fs.readFileSync": true,
7540-
"path.dirname": true,
7541-
"path.extname": true,
7542-
"path.resolve": true
7543-
}
7544-
},
75457545
"string.prototype.matchall": {
75467546
"packages": {
75477547
"string.prototype.matchall>call-bind": true,

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@
200200
"web3@^0.20.7": "patch:web3@npm%3A0.20.7#./.yarn/patches/web3-npm-0.20.7-ee7ef00c57.patch",
201201
"watchify@^4.0.0": "patch:watchify@npm%3A4.0.0#./.yarn/patches/watchify-npm-4.0.0-4fd965dd49.patch",
202202
"undeclared-identifiers@^1.1.2": "patch:undeclared-identifiers@npm%3A1.1.2#./.yarn/patches/undeclared-identifiers-npm-1.1.2-13d6792e9e.patch",
203-
"squirrelly@^9.0.0": "patch:squirrelly@npm%3A9.0.0#./.yarn/patches/squirrelly-npm-9.0.0-3cf710c7bb.patch",
204203
"stylelint@^13.6.1": "patch:stylelint@npm%3A13.6.1#./.yarn/patches/stylelint-npm-13.6.1-47aaddf62b.patch",
205204
"luxon@^3.0.1": "patch:luxon@npm%3A3.2.1#./.yarn/patches/luxon-npm-3.2.1-56f8d97395.patch",
206205
"luxon@^3.2.1": "patch:luxon@npm%3A3.2.1#./.yarn/patches/luxon-npm-3.2.1-56f8d97395.patch",
@@ -502,6 +501,7 @@
502501
"eslint-plugin-react": "^7.23.1",
503502
"eslint-plugin-react-hooks": "^4.2.0",
504503
"eslint-plugin-storybook": "^0.6.15",
504+
"eta": "^3.2.0",
505505
"fake-indexeddb": "^4.0.1",
506506
"fancy-log": "^1.3.3",
507507
"fast-glob": "^3.2.2",
@@ -567,7 +567,6 @@
567567
"source-map": "^0.7.4",
568568
"source-map-explorer": "^2.4.2",
569569
"sprintf-js": "^1.1.3",
570-
"squirrelly": "^9.0.0",
571570
"storybook": "^7.4.6",
572571
"storybook-dark-mode": "^3.0.1",
573572
"stream-browserify": "^3.0.0",

yarn.lock

+8-15
Original file line numberDiff line numberDiff line change
@@ -17251,6 +17251,13 @@ __metadata:
1725117251
languageName: node
1725217252
linkType: hard
1725317253

17254+
"eta@npm:^3.2.0":
17255+
version: 3.2.0
17256+
resolution: "eta@npm:3.2.0"
17257+
checksum: f4aa8ff6b9a4adf3d5db83255793be0136bdbcf2341154ad64c019bacc04d69e10218e54764af572eb8ba016996b8cbac9dc7a6fc2e9eb5005a0323bab883692
17258+
languageName: node
17259+
linkType: hard
17260+
1725417261
"etag@npm:~1.8.1":
1725517262
version: 1.8.1
1725617263
resolution: "etag@npm:1.8.1"
@@ -24979,6 +24986,7 @@ __metadata:
2497924986
eslint-plugin-react: "npm:^7.23.1"
2498024987
eslint-plugin-react-hooks: "npm:^4.2.0"
2498124988
eslint-plugin-storybook: "npm:^0.6.15"
24989+
eta: "npm:^3.2.0"
2498224990
eth-ens-namehash: "npm:^2.0.8"
2498324991
eth-json-rpc-filters: "npm:^6.0.0"
2498424992
eth-lattice-keyring: "npm:^0.12.4"
@@ -25098,7 +25106,6 @@ __metadata:
2509825106
source-map: "npm:^0.7.4"
2509925107
source-map-explorer: "npm:^2.4.2"
2510025108
sprintf-js: "npm:^1.1.3"
25101-
squirrelly: "npm:^9.0.0"
2510225109
storybook: "npm:^7.4.6"
2510325110
storybook-dark-mode: "npm:^3.0.1"
2510425111
stream-browserify: "npm:^3.0.0"
@@ -32243,20 +32250,6 @@ __metadata:
3224332250
languageName: node
3224432251
linkType: hard
3224532252

32246-
"squirrelly@npm:9.0.0":
32247-
version: 9.0.0
32248-
resolution: "squirrelly@npm:9.0.0"
32249-
checksum: c0c0b7f3f6825a3e601baaf0c3848bc56d2d05482a3cf4d4cf4a01ee25312e775b0ffbcca7b8660c3ad5a3dd905fd5d34642d4324c36d0ed45c2bcb4de343002
32250-
languageName: node
32251-
linkType: hard
32252-
32253-
"squirrelly@patch:squirrelly@npm%3A9.0.0#./.yarn/patches/squirrelly-npm-9.0.0-3cf710c7bb.patch::locator=metamask-crx%40workspace%3A.":
32254-
version: 9.0.0
32255-
resolution: "squirrelly@patch:squirrelly@npm%3A9.0.0#./.yarn/patches/squirrelly-npm-9.0.0-3cf710c7bb.patch::version=9.0.0&hash=bf49f6&locator=metamask-crx%40workspace%3A."
32256-
checksum: 2b30969650de3350fa9db401af32633359a41b2500c10c8cf6f926f27c968cbedbbd3cb22b79a9f150f7e9d5ea0f31e1bccc2c2c851389d3d83e8347f19f9d6c
32257-
languageName: node
32258-
linkType: hard
32259-
3226032253
"ssri@npm:^10.0.0":
3226132254
version: 10.0.4
3226232255
resolution: "ssri@npm:10.0.4"

0 commit comments

Comments
 (0)