Skip to content

Commit ba75f98

Browse files
1.23.0-0.2.0: [feature] Configure CircleCI (#532)
* Add prettier formatting for svelte * Add linting to circleci config * Formatting
1 parent 61849b9 commit ba75f98

File tree

12 files changed

+85
-37
lines changed

12 files changed

+85
-37
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
- v1-dependencies-{{ checksum "package.json" }}
1111
- v1-dependencies-
1212
- run: yarn
13+
- run: yarn lint
1314
- run: yarn test
1415
- run: yarn build
1516
- save_cache:

.prettierrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ module.exports = {
55
printWidth: 80,
66
tabWidth: 2,
77
arrowParens: 'avoid',
8-
svelteSortOrder: 'scripts-styles-markup'
8+
svelteSortOrder: 'options-scripts-styles-markup',
9+
plugins: ['prettier-plugin-svelte']
910
}

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.23.0-0.1.0",
3+
"version": "1.23.0-0.2.0",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",
@@ -20,6 +20,14 @@
2020
"url": "https://github.com/blocknative/onboard"
2121
},
2222
"license": "MIT",
23+
"scripts": {
24+
"build": "rimraf dist && rollup -c && babel dist/cjs --out-dir dist/cjs && babel dist/esm --out-dir dist/esm",
25+
"test": "echo \"TBD\" && exit 0",
26+
"prepare": "npm run build",
27+
"lint": "eslint 'src/**/*.ts' && prettier --check {'src/**/*.ts','src/**/*.svelte'}",
28+
"lint:fix": "eslint 'src/**/*.ts' --fix",
29+
"format": "prettier --write {'src/**/*.ts','src/**/*.svelte'}"
30+
},
2331
"devDependencies": {
2432
"@babel/cli": "^7.7.0",
2533
"@babel/core": "^7.5.5",
@@ -61,14 +69,10 @@
6169
"ethereumjs-util": "^7.0.3",
6270
"fortmatic": "^2.2.1",
6371
"hdkey": "^2.0.1",
72+
"prettier-plugin-svelte": "^2.2.0",
6473
"regenerator-runtime": "^0.13.7",
6574
"trezor-connect": "^8.1.9",
6675
"walletlink": "^2.0.2",
6776
"web3-provider-engine": "^15.0.4"
68-
},
69-
"scripts": {
70-
"build": "rimraf dist && rollup -c && babel dist/cjs --out-dir dist/cjs && babel dist/esm --out-dir dist/esm",
71-
"test": "echo \"TBD\" && exit 0",
72-
"prepare": "npm run build"
7377
}
7478
}

src/components/Modal.svelte

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@
8787
<aside
8888
transition:fade
8989
class="bn-onboard-custom bn-onboard-modal"
90-
on:click={closeModal}>
90+
on:click={closeModal}
91+
>
9192
<section
9293
class:bn-onboard-dark-mode={$app.darkMode}
9394
class:no-padding-branding={$app.displayBranding}
9495
class="bn-onboard-custom bn-onboard-modal-content"
95-
on:click={e => e.stopPropagation()}>
96+
on:click={e => e.stopPropagation()}
97+
>
9698
<slot />
9799
{#if $app.displayBranding}
98100
<Branding darkMode={$app.darkMode} />
@@ -103,7 +105,8 @@
103105
class:bn-onboard-dark-mode-close-background={$app.darkMode}
104106
on:click={closeModal}
105107
on:mouseenter={() => (closeHovered = true)}
106-
on:mouseleave={() => (closeHovered = false)}>
108+
on:mouseleave={() => (closeHovered = false)}
109+
>
107110
<svg
108111
xmlns="http://www.w3.org/2000/svg"
109112
xmlns:xlink="http://www.w3.org/1999/xlink"
@@ -112,14 +115,20 @@
112115
viewBox="0 0 47.971 47.971"
113116
style="enable-background:new 0 0 47.971 47.971; transition: fill 150ms
114117
ease-in-out;"
115-
fill={closeHovered ? ($app.darkMode ? '#ffffff' : '#4a4a4a') : '#9B9B9B'}
116-
xml:space="preserve">
118+
fill={closeHovered
119+
? $app.darkMode
120+
? '#ffffff'
121+
: '#4a4a4a'
122+
: '#9B9B9B'}
123+
xml:space="preserve"
124+
>
117125
<g>
118126
<path
119127
d="M28.228,23.986L47.092,5.122c1.172-1.171,1.172-3.071,0-4.242c-1.172-1.172-3.07-1.172-4.242,0L23.986,19.744L5.121,0.88
120128
c-1.172-1.172-3.07-1.172-4.242,0c-1.172,1.171-1.172,3.071,0,4.242l18.865,18.864L0.879,42.85c-1.172,1.171-1.172,3.071,0,4.242
121129
C1.465,47.677,2.233,47.97,3,47.97s1.535-0.293,2.121-0.879l18.865-18.864L42.85,47.091c0.586,0.586,1.354,0.879,2.121,0.879
122-
s1.535-0.293,2.121-0.879c1.172-1.171,1.172-3.071,0-4.242L28.228,23.986z" />
130+
s1.535-0.293,2.121-0.879c1.172-1.171,1.172-3.071,0-4.242L28.228,23.986z"
131+
/>
123132
</g>
124133
<g />
125134
<g />

src/components/ModalHeader.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
<header class="bn-onboard-custom bn-onboard-modal-content-header">
3939
<div
4040
class:bn-onboard-dark-mode-background={$app.darkMode}
41-
class="bn-onboard-custom bn-onboard-modal-content-header-icon">
41+
class="bn-onboard-custom bn-onboard-modal-content-header-icon"
42+
>
4243
{@html icon}
4344
</div>
4445
<h3 class="bn-onboard-custom bn-onboard-modal-content-header-heading">

src/components/Wallets.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,16 @@
7575
svg={wallet.svg}
7676
text={wallet.name}
7777
currentlySelected={wallet.name === selectedWallet.name}
78-
{loadingWallet} />
78+
{loadingWallet}
79+
/>
7980
</li>
8081
{/each}
8182

8283
{#if modalData.secondaryWallets && modalData.secondaryWallets.length && !showingAllWalletModules}
8384
<div>
84-
<Button disabled={!$app.termsAgreed} onclick={showAllWallets}>Show More</Button>
85+
<Button disabled={!$app.termsAgreed} onclick={showAllWallets}
86+
>Show More</Button
87+
>
8588
</div>
8689
{/if}
8790

@@ -96,7 +99,8 @@
9699
svg={wallet.svg}
97100
text={wallet.name}
98101
currentlySelected={wallet.name === selectedWallet.name}
99-
{loadingWallet} />
102+
{loadingWallet}
103+
/>
100104
</li>
101105
{/each}
102106
{/if}

src/elements/Branding.svelte

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,21 @@
4242
href="https://hubs.ly/H0qh2g10"
4343
class="bn-onboard-clickable"
4444
target="_blank"
45-
rel="noopener noreferrer">
45+
rel="noopener noreferrer"
46+
>
4647
<span>Blocknative</span>
4748
<div class="bn-logo">
4849
{#if darkMode}
4950
<svg
5051
height="130"
5152
viewBox="0 0 91 130"
5253
width="91"
53-
xmlns="http://www.w3.org/2000/svg">
54+
xmlns="http://www.w3.org/2000/svg"
55+
>
5456
<g
5557
style="stroke:#fff;stroke-width:2.70793;fill:none;fill-rule:evenodd;stroke-linecap:round;stroke-linejoin:round"
56-
transform="translate(1.818182 .909091)">
58+
transform="translate(1.818182 .909091)"
59+
>
5760
<path
5861
d="m1.35473654 25.2695268
5962
41.68515786-24.21771792c.5647044-.32807482 1.2619836-.32807795
@@ -63,25 +66,29 @@
6366
12.1113348c.5601525.3254236.9048434.9243111.9048434
6467
1.5721317v48.4560123c0 .647825-.3446953 1.246715-.9048537
6568
1.572138l-41.6835092
66-
24.215895c-.5655731.328567-1.2640448.328023-1.8291052-.001426l-41.5311197-24.21401c-.5587764-.325785-.90240476-.923899-.90240476-1.570712v-49.505258-24.5082917c0-.6478147.34468473-1.2466978.9048293-1.5721235z" />
69+
24.215895c-.5655731.328567-1.2640448.328023-1.8291052-.001426l-41.5311197-24.21401c-.5587764-.325785-.90240476-.923899-.90240476-1.570712v-49.505258-24.5082917c0-.6478147.34468473-1.2466978.9048293-1.5721235z"
70+
/>
6771
<path
6872
d="m22.0428451 114.442824v-25.2731141l-21.59284788-12.5449388
6973
42.75014288 24.6551909c.5648507.325765 1.260898.324109
7074
1.8241926-.004339l42.2766571-24.6508519-21.5955473
7175
12.6370084v-24.2248276c0-.6488012-.3457266-1.2484405-.9072187-1.5735092l-20.9222804-12.1126883
7276
21.6729314-12.6370084-42.4525958
73-
24.4763352c-.5545159.3197099-1.236865.3218902-1.7934127.0057303l-20.85286908-11.8459598" />
77+
24.4763352c-.5545159.3197099-1.236865.3218902-1.7934127.0057303l-20.85286908-11.8459598"
78+
/>
7479
</g>
7580
</svg>
7681
{:else}
7782
<svg
7883
height="130"
7984
viewBox="0 0 91 130"
8085
width="91"
81-
xmlns="http://www.w3.org/2000/svg">
86+
xmlns="http://www.w3.org/2000/svg"
87+
>
8288
<g
8389
style="stroke:#000;stroke-width:2.70793;fill:none;fill-rule:evenodd;stroke-linecap:round;stroke-linejoin:round"
84-
transform="translate(1.818182 .909091)">
90+
transform="translate(1.818182 .909091)"
91+
>
8592
<path
8693
d="m1.35473654 25.2695268
8794
41.68515786-24.21771792c.5647044-.32807482 1.2619836-.32807795
@@ -91,14 +98,16 @@
9198
12.1113348c.5601525.3254236.9048434.9243111.9048434
9299
1.5721317v48.4560123c0 .647825-.3446953 1.246715-.9048537
93100
1.572138l-41.6835092
94-
24.215895c-.5655731.328567-1.2640448.328023-1.8291052-.001426l-41.5311197-24.21401c-.5587764-.325785-.90240476-.923899-.90240476-1.570712v-49.505258-24.5082917c0-.6478147.34468473-1.2466978.9048293-1.5721235z" />
101+
24.215895c-.5655731.328567-1.2640448.328023-1.8291052-.001426l-41.5311197-24.21401c-.5587764-.325785-.90240476-.923899-.90240476-1.570712v-49.505258-24.5082917c0-.6478147.34468473-1.2466978.9048293-1.5721235z"
102+
/>
95103
<path
96104
d="m22.0428451 114.442824v-25.2731141l-21.59284788-12.5449388
97105
42.75014288 24.6551909c.5648507.325765 1.260898.324109
98106
1.8241926-.004339l42.2766571-24.6508519-21.5955473
99107
12.6370084v-24.2248276c0-.6488012-.3457266-1.2484405-.9072187-1.5735092l-20.9222804-12.1126883
100108
21.6729314-12.6370084-42.4525958
101-
24.4763352c-.5545159.3197099-1.236865.3218902-1.7934127.0057303l-20.85286908-11.8459598" />
109+
24.4763352c-.5545159.3197099-1.236865.3218902-1.7934127.0057303l-20.85286908-11.8459598"
110+
/>
102111
</g>
103112
</svg>
104113
{/if}

src/elements/Button.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
.disabled {
4343
cursor: inherit;
4444
pointer-events: none;
45-
opacity: .4;
45+
opacity: 0.4;
4646
}
4747
</style>
4848

@@ -53,8 +53,10 @@
5353
class="bn-onboard-custom bn-onboard-prepare-button"
5454
class:bn-onboard-prepare-button-right={position === 'right'}
5555
class:bn-onboard-prepare-button-left={position === 'left'}
56-
class:bn-onboard-prepare-button-center={position !== 'left' && position !== 'right'}
56+
class:bn-onboard-prepare-button-center={position !== 'left' &&
57+
position !== 'right'}
5758
class:bn-onboard-dark-mode-link={$app.darkMode}
58-
class:bn-onboard-dark-mode-background-hover={$app.darkMode}>
59+
class:bn-onboard-dark-mode-background-hover={$app.darkMode}
60+
>
5961
<slot />
6062
</button>

src/elements/IconButton.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
.disabled {
3636
cursor: inherit;
3737
pointer-events: none;
38-
opacity: .4;
38+
opacity: 0.4;
3939
}
4040
4141
button:hover {
@@ -99,7 +99,8 @@
9999
class:disabled
100100
class="bn-onboard-custom bn-onboard-icon-button"
101101
class:bn-onboard-dark-mode-background-hover={$app.darkMode}
102-
class:bn-onboard-selected-wallet={currentlySelected}>
102+
class:bn-onboard-selected-wallet={currentlySelected}
103+
>
103104
<div>
104105
{#if loadingWallet === text}
105106
<Spinner />

src/views/WalletCheck.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@
328328
<span
329329
class:bn-onboard-dark-mode-background={$app.darkMode}
330330
class="bn-onboard-custom bn-onboard-prepare-error"
331-
in:fade>
331+
in:fade
332+
>
332333
{errorMsg}
333334
</span>
334335
{/if}

src/views/WalletSelect.svelte

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
wallets
5757
} = module
5858
59-
let showTermsOfService: boolean = !!(termsOfServiceUrl || privacyPolicyUrl) && !get(app).termsAgreed
59+
let showTermsOfService: boolean =
60+
!!(termsOfServiceUrl || privacyPolicyUrl) && !get(app).termsAgreed
6061
6162
$: {
6263
if ($app.termsAgreed) {
@@ -271,11 +272,20 @@
271272
{#if showTermsOfService}
272273
<p>
273274
<label class="terms-of-service">
274-
<input class="terms-of-service-check-box" type="checkbox" bind:checked={$app.termsAgreed} />
275+
<input
276+
class="terms-of-service-check-box"
277+
type="checkbox"
278+
bind:checked={$app.termsAgreed}
279+
/>
275280
<span>
276-
I agree to the
277-
{#if termsOfServiceUrl}<a href={termsOfServiceUrl} target="_blank">Terms & Conditions</a>{privacyPolicyUrl ? ' and' : '.'} {/if}
278-
{#if privacyPolicyUrl}<a href={privacyPolicyUrl} target="_blank">Privacy Policy</a>.{/if}
281+
I agree to the
282+
{#if termsOfServiceUrl}<a href={termsOfServiceUrl} target="_blank"
283+
>Terms & Conditions</a
284+
>{privacyPolicyUrl ? ' and' : '.'}
285+
{/if}
286+
{#if privacyPolicyUrl}<a href={privacyPolicyUrl} target="_blank"
287+
>Privacy Policy</a
288+
>.{/if}
279289
</span>
280290
</label>
281291
</p>

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6067,6 +6067,11 @@ prettier-linter-helpers@^1.0.0:
60676067
dependencies:
60686068
fast-diff "^1.1.2"
60696069

6070+
prettier-plugin-svelte@^2.2.0:
6071+
version "2.2.0"
6072+
resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-2.2.0.tgz#4bd94992fa5b76413a8a5556f90b128c4fdaf7a6"
6073+
integrity sha512-Xdmqgr71tAuMqqzNCK52/v94g/Yv7V7lz+nmbO9NEA+9ol15VV3uUHOfydMNOo3SWvFaVlBcp947ebEaMWqVfQ==
6074+
60706075
prettier@^2.0.5:
60716076
version "2.0.5"
60726077
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"

0 commit comments

Comments
 (0)