Skip to content

Commit

Permalink
style: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
alsakhaev committed Sep 9, 2024
1 parent f581788 commit 78d22ed
Show file tree
Hide file tree
Showing 91 changed files with 1,468 additions and 1,758 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/extension-artifact-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
with:
name: mutable-web-extension-${{ github.head_ref }}
path: apps/extension/build/
if-no-files-found: error
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/extension-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
| Logs | ${{ env.JOB_PATH }}
| Extension Build | ${{ env.SUITES_PATH }}/${{ env.PREVIOUS_SUITE_ID }}/artifacts/${{ env.ARTIFACT_ID }}
[badge]: https://img.shields.io/badge/Build-Success!-3fb950?logo=github&style=for-the-badge
[badge]: https://img.shields.io/badge/Build-Success!-3fb950?logo=github&style=for-the-badge
2 changes: 1 addition & 1 deletion .github/workflows/extension-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
run: pnpm release
run: pnpm release
5 changes: 4 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
build
coverage
dist
package-lock.json
package-lock.json
node_modules
pnpm-lock.yaml
apps/extension/resources/custom-elements.min.js
42 changes: 9 additions & 33 deletions apps/extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
"options_page": "options.html",
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*"
],
"matches": ["http://*/*", "https://*/*"],
"exclude_globs": [
"https://social.dapplets.org/*",
"https://social.testnet.dapplets.org/*",
Expand All @@ -29,43 +26,22 @@
"http://127.0.0.1:3000/*",
"https://augm.link/*"
],
"js": [
"custom-elements.min.js",
"contentscript.js"
],
"js": ["custom-elements.min.js", "contentscript.js"],
"run_at": "document_idle"
},
{
"matches": [
"https://app.mynearwallet.com/*",
"https://testnet.mynearwallet.com/*"
],
"js": [
"mnw-patch-inpage.js"
],
"matches": ["https://app.mynearwallet.com/*", "https://testnet.mynearwallet.com/*"],
"js": ["mnw-patch-inpage.js"],
"run_at": "document_start",
"world": "MAIN"
}
],
"web_accessible_resources": [
{
"resources": [
"callback.html",
"bootstrap.min.css"
],
"matches": [
"*://*/*"
]
"resources": ["callback.html", "bootstrap.min.css"],
"matches": ["*://*/*"]
}
],
"permissions": [
"storage",
"tabs",
"contextMenus"
],
"host_permissions": [
"*://localhost/*",
"http://*/*",
"https://*/*"
]
}
"permissions": ["storage", "tabs", "contextMenus"],
"host_permissions": ["*://localhost/*", "http://*/*", "https://*/*"]
}
2 changes: 1 addition & 1 deletion apps/extension/src/common/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export const networkConfigs = {

export type NearNetworkId = 'testnet' | 'mainnet'

export const DefaultNetworkId: NearNetworkId = 'mainnet'
export const DefaultNetworkId: NearNetworkId = 'mainnet'
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export const MutationsList = styled.div`
display: flex;
flex-direction: column;
background: #fff;
box-shadow: 0 4px 5px rgb(45 52 60 / 10%), 0 4px 20px rgb(11 87 111 / 15%);
box-shadow:
0 4px 5px rgb(45 52 60 / 10%),
0 4px 20px rgb(11 87 111 / 15%);
width: 318px;
left: -26px;
top: 38px;
Expand Down Expand Up @@ -182,7 +184,9 @@ export const MutationsListWrapper = styled.div`
height: 2px;
background: #384bff;
border-radius: 2px;
box-shadow: 0 2px 6px rgb(0 0 0 / 9%), 0 2px 2px rgb(38 117 209 / 4%);
box-shadow:
0 2px 6px rgb(0 0 0 / 9%),
0 2px 2px rgb(38 117 209 / 4%);
}
`
export const ButtonListBlock = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ const WrapperAlert = styled.div<{ severity?: 'success' | 'info' | 'warning' | 'e
p.severity === 'success'
? 'rgba(233, 252, 240, 1)'
: p.severity === 'warning'
? 'rgba(255, 248, 235, 1)'
: p.severity === 'error'
? 'rgba(246, 240, 246, 1)'
: 'rgba(234, 241, 255, 1)'};
? 'rgba(255, 248, 235, 1)'
: p.severity === 'error'
? 'rgba(246, 240, 246, 1)'
: 'rgba(234, 241, 255, 1)'};
color: ${(p) =>
p.severity === 'success'
? 'rgba(3, 187, 66, 1)'
: p.severity === 'warning'
? 'rgba(208, 145, 26, 1)'
: p.severity === 'error'
? 'rgba(219, 80, 74, 1)'
: 'rgba(36, 110, 253, 1)'};
? 'rgba(208, 145, 26, 1)'
: p.severity === 'error'
? 'rgba(219, 80, 74, 1)'
: 'rgba(36, 110, 253, 1)'};
outline: none;
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const Image: FC<Props> = ({ image, alt, fallbackUrl }) => {
image?.ipfs_cid
? setImageUrl(`https://ipfs.near.social/ipfs/${image.ipfs_cid}`)
: image?.url
? setImageUrl(image?.url)
: setImageUrl(fallbackUrl)
? setImageUrl(image?.url)
: setImageUrl(fallbackUrl)
}, [image])

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ const AppsList = styled.div`
height: 2px;
background: #384bff;
border-radius: 2px;
box-shadow: 0 2px 6px rgb(0 0 0 / 9%), 0 2px 2px rgb(38 117 209 / 4%);
box-shadow:
0 2px 6px rgb(0 0 0 / 9%),
0 2px 2px rgb(38 117 209 / 4%);
}
`

Expand Down Expand Up @@ -220,8 +222,8 @@ export const MutationEditorModal: FC<Props> = ({ baseMutation, apps, onClose })
!baseMutation
? MutationModalMode.Creating
: isOwn
? MutationModalMode.Editing
: MutationModalMode.Forking
? MutationModalMode.Editing
: MutationModalMode.Forking
)

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const Notch = styled.div<{ $isAnimated?: boolean }>`
z-index: 5000;
border-radius: 0 0 6px 6px;
background: #384bff;
box-shadow: 0 4px 5px rgb(45 52 60 / 10%), 0 4px 20px rgb(11 87 111 / 15%);
box-shadow:
0 4px 5px rgb(45 52 60 / 10%),
0 4px 20px rgb(11 87 111 / 15%);
opacity: 0;
transform: translateY(-100%);
transition: ${(props) =>
Expand Down Expand Up @@ -217,8 +219,8 @@ export const MultitablePanel: FC<MultitablePanelProps> = ({ eventEmitter }) => {
isPin
? 'visible-pin'
: isNotchDisplayed || isDropdownVisible || isDragging
? 'visible-default'
: 'visible-notch'
? 'visible-default'
: 'visible-notch'
}
$isAnimated={!isDragging}
ref={notchRef}
Expand Down
4 changes: 2 additions & 2 deletions apps/extension/src/options/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
body {
margin: 16px;
}
margin: 16px;
}
2 changes: 1 addition & 1 deletion apps/extension/src/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<div id="app"></div>
</body>
<script src="./options.js"></script>
</html>
</html>
2 changes: 1 addition & 1 deletion apps/extension/src/options/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ if (container) {
createRoot(container).render(<App />)
} else {
console.error('Container not found')
}
}
10 changes: 5 additions & 5 deletions apps/extension/tests/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
IMAP_AUTH_HOST: string;
IMAP_AUTH_USER: string;
IMAP_AUTH_PASS: string;
SECRET_PHRASE: string;
IMAP_AUTH_HOST: string
IMAP_AUTH_USER: string
IMAP_AUTH_PASS: string
SECRET_PHRASE: string
}
}
}

export {};
export {}
2 changes: 1 addition & 1 deletion apps/extension/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module.exports = {
'resources',
{
from: 'src/options/index.html',
to: 'options.html'
to: 'options.html',
},
{
from: 'manifest.json',
Expand Down
22 changes: 11 additions & 11 deletions apps/gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,34 @@ yarn start
Profile view

```jsx
let accountId = props.accountId || "eugenethedream";
let profile = socialGetr(`${accountId}/profile`);
let accountId = props.accountId || 'eugenethedream'
let profile = socialGetr(`${accountId}/profile`)

<div>
;<div>
<img src={profile.image.url} />
<span>{profile.name}</span> <span>(@{accountId})</span>
</div>;
</div>
```

Profile editor

```jsx
let accountId = context.accountId;
let accountId = context.accountId

if (!accountId) {
return "Please sign in with NEAR wallet";
return 'Please sign in with NEAR wallet'
}

const profile = socialGetr(`${accountId}/profile`);
const profile = socialGetr(`${accountId}/profile`)

if (profile === null) {
return "Loading";
return 'Loading'
}

initState({
name: profile.name,
url: profile.image.url,
});
})

const data = {
profile: {
Expand All @@ -57,7 +57,7 @@ const data = {
url: state.url,
},
},
};
}

return (
<div>
Expand All @@ -78,5 +78,5 @@ return (
<CommitButton data={data}>Save profile</CommitButton>
</div>
</div>
);
)
```
12 changes: 6 additions & 6 deletions apps/gateway/config/paths.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const path = require("path");
const path = require('path')

const srcPath = path.resolve(__dirname, "../src");
const distPath = path.resolve(__dirname, "../dist");
const publicPath = path.resolve(__dirname, "../public");
const nodeModulesPath = path.resolve(__dirname, "../node_modules");
const srcPath = path.resolve(__dirname, '../src')
const distPath = path.resolve(__dirname, '../dist')
const publicPath = path.resolve(__dirname, '../public')
const nodeModulesPath = path.resolve(__dirname, '../node_modules')

module.exports = {
srcPath,
distPath,
publicPath,
nodeModulesPath,
};
}
14 changes: 7 additions & 7 deletions apps/gateway/config/presets/loadPreset.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const { merge } = require("webpack-merge");
const { merge } = require('webpack-merge')

const loadPresets = (env = { presets: [] }) => {
const presets = env.presets || [];
const presets = env.presets || []
/** @type {string[]} */
const mergedPresets = [].concat(...[presets]);
const mergedPresets = [].concat(...[presets])
const mergedConfigs = mergedPresets.map((presetName) =>
require(`./webpack.${presetName}.js`)(env)
);
)

return merge({}, ...mergedConfigs);
};
module.exports = loadPresets;
return merge({}, ...mergedConfigs)
}
module.exports = loadPresets
5 changes: 2 additions & 3 deletions apps/gateway/config/presets/webpack.analyze.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const WebpackBundleAnalyzer =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const WebpackBundleAnalyzer = require('webpack-bundle-analyzer').BundleAnalyzerPlugin

module.exports = () => ({
plugins: [new WebpackBundleAnalyzer()],
});
})
Loading

0 comments on commit 78d22ed

Please sign in to comment.