Skip to content

Commit 97f9e90

Browse files
chore(UI): migrate to host-api (#170)
## Description ## Type - [ ] Bug fix - [ ] Feature - [ ] Breaking change - [ ] Documentation - [x] Chore ## Package - [ ] `@parity/dotns-cli` - [x] `dotns-ui` - [ ] Root/monorepo - [ ] Documentation ## Related Issues ## Fixes ## Checklist ### Code - [x] Follows project style - [x] `bun run lint` passes - [x] `bun run format` passes - [x] `bun run typecheck` passes ### Documentation - [x] README updated if needed - [ ] Types updated if needed ### Breaking Changes - [x] No breaking changes - [ ] Breaking changes documented below **Breaking changes:** ## Testing How to test: 1. 2. ## Notes migrates dotns-ui to @parity/product-sdk v0.10; migrate to CDM for current contract addresses + ABIs, bulletin upload was not touched and does not work --------- Co-authored-by: Siphamandla Mjoli <siphamandla@parity.io>
1 parent 721b021 commit 97f9e90

191 files changed

Lines changed: 14937 additions & 14078 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/usr/bin/env sh
22
set -eu
33

4+
# GUI git clients (GitHub Desktop, IDE integrations) launch without the user's
5+
# shell profile, so PATH often misses bun's install directory. Prepend the
6+
# common locations before resolving it.
7+
export PATH="$HOME/.bun/bin:$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:$PATH"
8+
9+
if ! command -v bun >/dev/null 2>&1; then
10+
echo "pre-commit: bun was not found on PATH."
11+
echo "Install bun (https://bun.sh) or add its bin directory to your PATH, then commit again."
12+
exit 1
13+
fi
14+
415
echo "Running formatters and linters before commit..."
516
bun run precommit
617

.github/workflows/benchmark-ui-pr.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
FQDN: ${{ needs.deploy.outputs.fqdn || 'n/a' }}
8686
PREVIEW_URL: ${{ needs.deploy.outputs.url || '' }}
8787
PREVIEW_URL_DIRECT: ${{ needs.deploy.outputs.url-direct || '' }}
88-
PREVIEW_URL_DOTLI_PATH: ${{ needs.deploy.outputs.url-dotli-path || '' }}
89-
PREVIEW_URL_DOTLI_HOST: ${{ needs.deploy.outputs.url-dotli-host || '' }}
88+
PREVIEW_URL_DOTLI: ${{ needs.deploy.outputs.url-dotli || '' }}
89+
PREVIEW_URL_DOTLI_PASEO: ${{ needs.deploy.outputs.url-dotli-paseo || '' }}
9090
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
9191
with:
9292
script: |
@@ -99,8 +99,8 @@ jobs:
9999
const fqdn = process.env.FQDN;
100100
const previewUrl = process.env.PREVIEW_URL;
101101
const previewUrlDirect = process.env.PREVIEW_URL_DIRECT;
102-
const previewUrlDotliPath = process.env.PREVIEW_URL_DOTLI_PATH;
103-
const previewUrlDotliHost = process.env.PREVIEW_URL_DOTLI_HOST;
102+
const previewUrlDotli = process.env.PREVIEW_URL_DOTLI;
103+
const previewUrlDotliPaseo = process.env.PREVIEW_URL_DOTLI_PASEO;
104104
const runUrl = process.env.RUN_URL;
105105
106106
const { owner, repo } = context.repo;
@@ -141,15 +141,14 @@ jobs:
141141
rows[section] = status === "Passed" ? `Passed` : `[Failed](${runUrl})`;
142142
143143
const previewRows = [];
144-
if (previewUrlDotliHost) {
145-
previewRows.push(`| Preview | [open](${previewUrlDotliHost}) |`);
146-
} else {
147-
if (previewUrlDotliPath) {
148-
previewRows.push(`| Preview (dot.li) | [open](${previewUrlDotliPath}) |`);
149-
}
150-
if (previewUrlDirect) {
151-
previewRows.push(`| Preview (direct) | [open](${previewUrlDirect}) |`);
152-
}
144+
if (previewUrlDotli) {
145+
previewRows.push(`| Preview (dot.li) | [open](${previewUrlDotli}) |`);
146+
}
147+
if (previewUrlDotliPaseo) {
148+
previewRows.push(`| Preview (paseo.li) | [open](${previewUrlDotliPaseo}) |`);
149+
}
150+
if (previewUrlDirect) {
151+
previewRows.push(`| Preview (direct) | [open](${previewUrlDirect}) |`);
153152
}
154153
if (previewRows.length === 0 && previewUrl) {
155154
previewRows.push(`| Preview | [open](${previewUrl}) |`);

.github/workflows/build-ui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
retention-days: 7
8686

8787
- name: Update PR comment
88+
continue-on-error: true
8889
if: github.event_name == 'pull_request'
8990
uses: actions/github-script@v7
9091
env:

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
retention-days: 7
8282

8383
- name: Update PR comment
84+
continue-on-error: true
8485
if: github.event_name == 'pull_request'
8586
uses: actions/github-script@v7
8687
env:

.github/workflows/deploy-example.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ jobs:
129129
continue-on-error: true
130130

131131
- name: Update PR comment
132+
continue-on-error: true
132133
uses: actions/github-script@v7
133134
env:
134135
SECTION: Deploy Example
@@ -140,8 +141,8 @@ jobs:
140141
DEPLOY_FQDN: ${{ needs.deploy.outputs.fqdn }}
141142
DEPLOY_URL: ${{ needs.deploy.outputs.url }}
142143
DEPLOY_URL_DIRECT: ${{ needs.deploy.outputs.url-direct }}
143-
DEPLOY_URL_DOTLI_PATH: ${{ needs.deploy.outputs.url-dotli-path }}
144-
DEPLOY_URL_DOTLI_HOST: ${{ needs.deploy.outputs.url-dotli-host }}
144+
DEPLOY_URL_DOTLI: ${{ needs.deploy.outputs.url-dotli }}
145+
DEPLOY_URL_DOTLI_PASEO: ${{ needs.deploy.outputs.url-dotli-paseo }}
145146
DEPLOY_CACHE_HIT: ${{ needs.deploy.outputs.cache-hit }}
146147
DEPLOY_DURATION_SECONDS: ${{ needs.deploy.outputs.duration-seconds }}
147148
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
@@ -182,8 +183,8 @@ jobs:
182183
const fqdn = process.env.DEPLOY_FQDN;
183184
const url = process.env.DEPLOY_URL;
184185
const urlDirect = process.env.DEPLOY_URL_DIRECT;
185-
const urlDotliPath = process.env.DEPLOY_URL_DOTLI_PATH;
186-
const urlDotliHost = process.env.DEPLOY_URL_DOTLI_HOST;
186+
const urlDotli = process.env.DEPLOY_URL_DOTLI;
187+
const urlDotliPaseo = process.env.DEPLOY_URL_DOTLI_PASEO;
187188
const cacheHit = process.env.DEPLOY_CACHE_HIT === "true";
188189
const durationSeconds = process.env.DEPLOY_DURATION_SECONDS;
189190
@@ -278,15 +279,14 @@ jobs:
278279
if (allPassed && cid && fqdn) {
279280
const cidDisplay = cacheHit ? `\`${cid}\` (cached)` : `\`${cid}\``;
280281
const urlRows = [];
281-
if (urlDotliHost) {
282-
urlRows.push(`| URL | [${urlDotliHost}](${urlDotliHost}) |`);
283-
} else {
284-
if (urlDotliPath) {
285-
urlRows.push(`| URL (dot.li) | [${urlDotliPath}](${urlDotliPath}) |`);
286-
}
287-
if (urlDirect) {
288-
urlRows.push(`| URL (direct) | [${urlDirect}](${urlDirect}) |`);
289-
}
282+
if (urlDotli) {
283+
urlRows.push(`| URL (dot.li) | [${urlDotli}](${urlDotli}) |`);
284+
}
285+
if (urlDotliPaseo) {
286+
urlRows.push(`| URL (paseo.li) | [${urlDotliPaseo}](${urlDotliPaseo}) |`);
287+
}
288+
if (urlDirect) {
289+
urlRows.push(`| URL (direct) | [${urlDirect}](${urlDirect}) |`);
290290
}
291291
if (urlRows.length === 0 && url) {
292292
urlRows.push(`| URL | [${url}](${url}) |`);

.github/workflows/deploy-sized-examples.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
114114

115115
- name: Update PR comment
116+
continue-on-error: true
116117
if: github.event_name == 'pull_request'
117118
uses: marocchino/sticky-pull-request-comment@v2
118119
with:

.github/workflows/deploy-ui.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ jobs:
150150
continue-on-error: true
151151

152152
- name: Update PR comment
153+
continue-on-error: true
153154
uses: actions/github-script@v7
154155
env:
155156
SECTION: Deploy UI
@@ -161,8 +162,8 @@ jobs:
161162
DEPLOY_FQDN: ${{ needs.deploy-preview.outputs.fqdn }}
162163
DEPLOY_URL: ${{ needs.deploy-preview.outputs.url }}
163164
DEPLOY_URL_DIRECT: ${{ needs.deploy-preview.outputs.url-direct }}
164-
DEPLOY_URL_DOTLI_PATH: ${{ needs.deploy-preview.outputs.url-dotli-path }}
165-
DEPLOY_URL_DOTLI_HOST: ${{ needs.deploy-preview.outputs.url-dotli-host }}
165+
DEPLOY_URL_DOTLI: ${{ needs.deploy-preview.outputs.url-dotli }}
166+
DEPLOY_URL_DOTLI_PASEO: ${{ needs.deploy-preview.outputs.url-dotli-paseo }}
166167
DEPLOY_CACHE_HIT: ${{ needs.deploy-preview.outputs.cache-hit }}
167168
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
168169
with:
@@ -202,8 +203,8 @@ jobs:
202203
const fqdn = process.env.DEPLOY_FQDN;
203204
const url = process.env.DEPLOY_URL;
204205
const urlDirect = process.env.DEPLOY_URL_DIRECT;
205-
const urlDotliPath = process.env.DEPLOY_URL_DOTLI_PATH;
206-
const urlDotliHost = process.env.DEPLOY_URL_DOTLI_HOST;
206+
const urlDotli = process.env.DEPLOY_URL_DOTLI;
207+
const urlDotliPaseo = process.env.DEPLOY_URL_DOTLI_PASEO;
207208
const cacheHit = process.env.DEPLOY_CACHE_HIT === "true";
208209
209210
const buildPassed = buildStatus === "Passed";
@@ -297,15 +298,14 @@ jobs:
297298
if (allPassed && cid && fqdn) {
298299
const cidDisplay = cacheHit ? `\`${cid}\` (cached)` : `\`${cid}\``;
299300
const urlRows = [];
300-
if (urlDotliHost) {
301-
urlRows.push(`| URL | [${urlDotliHost}](${urlDotliHost}) |`);
302-
} else {
303-
if (urlDotliPath) {
304-
urlRows.push(`| URL (dot.li) | [${urlDotliPath}](${urlDotliPath}) |`);
305-
}
306-
if (urlDirect) {
307-
urlRows.push(`| URL (direct) | [${urlDirect}](${urlDirect}) |`);
308-
}
301+
if (urlDotli) {
302+
urlRows.push(`| URL (dot.li) | [${urlDotli}](${urlDotli}) |`);
303+
}
304+
if (urlDotliPaseo) {
305+
urlRows.push(`| URL (paseo.li) | [${urlDotliPaseo}](${urlDotliPaseo}) |`);
306+
}
307+
if (urlDirect) {
308+
urlRows.push(`| URL (direct) | [${urlDirect}](${urlDirect}) |`);
309309
}
310310
if (urlRows.length === 0 && url) {
311311
urlRows.push(`| URL | [${url}](${url}) |`);

.github/workflows/deploy.yml

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ on:
139139
value: ${{ jobs.deploy.outputs.url-alt }}
140140
url-direct:
141141
value: ${{ jobs.deploy.outputs.url-direct }}
142-
url-dotli-path:
143-
value: ${{ jobs.deploy.outputs.url-dotli-path }}
144-
url-dotli-host:
145-
value: ${{ jobs.deploy.outputs.url-dotli-host }}
142+
url-dotli:
143+
value: ${{ jobs.deploy.outputs.url-dotli }}
144+
url-dotli-paseo:
145+
value: ${{ jobs.deploy.outputs.url-dotli-paseo }}
146146
cache-hit:
147147
value: ${{ jobs.deploy.outputs.cache-hit }}
148148
duration-seconds:
@@ -165,8 +165,8 @@ jobs:
165165
url: ${{ steps.final.outputs.url }}
166166
url-alt: ${{ steps.final.outputs.url-alt }}
167167
url-direct: ${{ steps.final.outputs.url-direct }}
168-
url-dotli-path: ${{ steps.final.outputs.url-dotli-path }}
169-
url-dotli-host: ${{ steps.final.outputs.url-dotli-host }}
168+
url-dotli: ${{ steps.final.outputs.url-dotli }}
169+
url-dotli-paseo: ${{ steps.final.outputs.url-dotli-paseo }}
170170
cache-hit: ${{ steps.cache.outputs.cache-hit }}
171171
duration-seconds: ${{ steps.duration.outputs.seconds }}
172172

@@ -390,29 +390,24 @@ jobs:
390390
- name: Set outputs
391391
id: final
392392
run: |
393-
DOTLI_PATH_URL="https://dot.li/${FQDN}"
393+
# dot.li serves a name as a gateway subdomain: strip the .dot TLD and
394+
# append the gateway domain (mainnet dot.li, Paseo testnet paseo.li).
395+
# e.g. pr170.dotns.dot -> pr170.dotns.dot.li / pr170.dotns.paseo.li
396+
STEM="${FQDN%.dot}"
397+
DOTLI_URL="https://${STEM}.dot.li"
398+
DOTLI_PASEO_URL="https://${STEM}.paseo.li"
394399
DIRECT_URL="https://${FQDN}"
395-
DOTLI_HOST_URL=""
396-
397-
if [[ -n "$SUBNAME" ]]; then
398-
PRIMARY_URL="$DOTLI_PATH_URL"
399-
else
400-
DOTLI_HOST_URL="https://${DOMAIN}.dot.li"
401-
PRIMARY_URL="$DOTLI_HOST_URL"
402-
fi
403400
404401
echo "cid=$CID" >> "$GITHUB_OUTPUT"
405402
echo "fqdn=$FQDN" >> "$GITHUB_OUTPUT"
406-
echo "url=$PRIMARY_URL" >> "$GITHUB_OUTPUT"
403+
echo "url=$DOTLI_URL" >> "$GITHUB_OUTPUT"
407404
echo "url-alt=$DIRECT_URL" >> "$GITHUB_OUTPUT"
408405
echo "url-direct=$DIRECT_URL" >> "$GITHUB_OUTPUT"
409-
echo "url-dotli-path=$DOTLI_PATH_URL" >> "$GITHUB_OUTPUT"
410-
echo "url-dotli-host=$DOTLI_HOST_URL" >> "$GITHUB_OUTPUT"
406+
echo "url-dotli=$DOTLI_URL" >> "$GITHUB_OUTPUT"
407+
echo "url-dotli-paseo=$DOTLI_PASEO_URL" >> "$GITHUB_OUTPUT"
411408
env:
412409
CID: ${{ steps.cid.outputs.cid }}
413410
FQDN: ${{ steps.target.outputs.fqdn }}
414-
DOMAIN: ${{ steps.target.outputs.domain }}
415-
SUBNAME: ${{ steps.target.outputs.subname }}
416411

417412
- name: Compute deploy duration
418413
id: duration
@@ -436,15 +431,12 @@ jobs:
436431
BULLETIN_AUTH="alice"
437432
fi
438433
439-
if [[ -n "$SUBNAME" ]]; then
440-
URL_ROWS=$(cat <<EOF
441-
| URL (dot.li) | [${URL_DOTLI_PATH}](${URL_DOTLI_PATH}) |
434+
URL_ROWS=$(cat <<EOF
435+
| URL (dot.li) | [${URL_DOTLI}](${URL_DOTLI}) |
436+
| URL (paseo.li) | [${URL_DOTLI_PASEO}](${URL_DOTLI_PASEO}) |
442437
| URL (direct) | [${URL_DIRECT}](${URL_DIRECT}) |
443438
EOF
444-
)
445-
else
446-
URL_ROWS="| URL | [${URL_DOTLI_HOST}](${URL_DOTLI_HOST}) |"
447-
fi
439+
)
448440
449441
cat >> "$GITHUB_STEP_SUMMARY" <<EOF
450442
## Deployment Complete
@@ -463,9 +455,8 @@ jobs:
463455
FQDN: ${{ steps.final.outputs.fqdn }}
464456
CID: ${{ steps.final.outputs.cid }}
465457
URL_DIRECT: ${{ steps.final.outputs.url-direct }}
466-
URL_DOTLI_PATH: ${{ steps.final.outputs.url-dotli-path }}
467-
URL_DOTLI_HOST: ${{ steps.final.outputs.url-dotli-host }}
468-
SUBNAME: ${{ steps.target.outputs.subname }}
458+
URL_DOTLI: ${{ steps.final.outputs.url-dotli }}
459+
URL_DOTLI_PASEO: ${{ steps.final.outputs.url-dotli-paseo }}
469460
DURATION_SECONDS: ${{ steps.duration.outputs.seconds }}
470461
BULLETIN_MNEMONIC: ${{ secrets.bulletin-mnemonic }}
471462
CACHE_HIT: ${{ steps.cache.outputs.cache-hit }}

.github/workflows/format-ui.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
fi
6363
6464
- name: Update PR comment
65+
continue-on-error: true
6566
if: github.event_name == 'pull_request'
6667
uses: actions/github-script@v7
6768
env:

.github/workflows/format.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
fi
5959
6060
- name: Update PR comment
61+
continue-on-error: true
6162
if: github.event_name == 'pull_request'
6263
uses: actions/github-script@v7
6364
env:

0 commit comments

Comments
 (0)