mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* chore: unify prettier setup across repo
there were slight inconsistencies in the prettier setup across the repo which lead to annoying problems. Running prettier from the root would modify files in subdirectories. But if you would run prettier from those subdirecotry -> the same files that were previously modified wouldn’t be treated as a problem.
Now every prettier command across the repo is loading the same root prettier config. In addition to this lintstaged should now only run on the staged files and not on the complete code base.
* fix: prettier
it turns out that the node_modules/.bin/prettier that we end up with is not from our set prettier v3.6.2, but rather from jest-snapshot-prettier. It sets:
bin:
prettier: bin-prettier.js
So, when we run `yarn prettier` - yarn correctly resolves with v3 and our config. But when we run it through lint-staged since we just call prettier - we end up with the jest-snapshot-prettier prettier binary… This would then reformat the files again and will change the changes made by prettier v3…
* fix: .prettierignore
54 lines
1.7 KiB
HTML
54 lines
1.7 KiB
HTML
<!-- This is an HTML page emitting Safe Apps events for testing the Web UI -->
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Safe App</title>
|
|
</head>
|
|
<body>
|
|
<h1>Cypress Test App</h1>
|
|
<script type="text/javascript">
|
|
// We'd need to disable web security (chromeWebSecurity) for spying on iframe.contentWindow.postMessage
|
|
// In order to avoid it we emit again received responses for spying them on main window
|
|
window.addEventListener('message', (msg) => {
|
|
window.parent.postMessage(msg.data.data, '*')
|
|
})
|
|
|
|
const sendMessage = (method, params, delay = 0) => {
|
|
setTimeout(() => {
|
|
window.parent.postMessage(
|
|
{
|
|
id: 'id',
|
|
method,
|
|
params,
|
|
env: { sdkVersion: 'sdkVersion' },
|
|
},
|
|
'*',
|
|
)
|
|
}, delay)
|
|
}
|
|
|
|
window.onload = function () {
|
|
const path = window.location.pathname
|
|
switch (path.split('/')[1]) {
|
|
case 'dummy':
|
|
// In case that fetching the manifest takes a bit longer
|
|
setTimeout(() => {
|
|
sendMessage('sendTransactions', {
|
|
txs: [{ to: '0x11Df0fa87b30080d59eba632570f620e37f2a8f7', value: '0', data: '0x' }],
|
|
params: { safeTxGas: 70000 },
|
|
})
|
|
}, 1000)
|
|
break
|
|
case 'get-permissions':
|
|
sendMessage('wallet_getPermissions')
|
|
break
|
|
case 'request-permissions':
|
|
sendMessage('wallet_requestPermissions', [{ requestAddressBook: {} }])
|
|
break
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|