Skip to content

Commit 73001dd

Browse files
fix: resolve image and font access, improve render, use new Trunk
1 parent e995af7 commit 73001dd

12 files changed

Lines changed: 43 additions & 104 deletions

File tree

.github/workflows/pr-preview-build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ jobs:
99

1010
- name: Install trunk
1111
run: |
12-
curl -sL https://github.com/trunk-rs/trunk/releases/download/v0.21.14/trunk-x86_64-unknown-linux-gnu.tar.gz -o trunk-x86_64-unknown-linux-gnu.tar.gz
12+
curl -sL https://github.com/trunk-rs/trunk/releases/download/v0.22.0-beta.1/trunk-x86_64-unknown-linux-gnu.tar.gz -o trunk-x86_64-unknown-linux-gnu.tar.gz
1313
tar xzf trunk-x86_64-unknown-linux-gnu.tar.gz
1414
sudo install trunk /usr/bin/trunk
15-
- uses: actions/setup-node@v4
16-
with:
17-
node-version: "20"
18-
- name: Install NPM dependencies
19-
run: npm install
2015
2116
- name: Set build timestamp
2217
run: echo "BUILD_TIMESTAMP=$(date --rfc-3339=seconds --utc)" >> $GITHUB_ENV

.github/workflows/publish.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,12 @@ jobs:
2828
target
2929
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3030

31-
- uses: actions/cache@v4
32-
with:
33-
path: ~/.npm
34-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
35-
restore-keys: |
36-
${{ runner.os }}-node-
37-
3831
- name: Install trunk
3932
run: |
40-
curl -sL https://github.com/thedodd/trunk/releases/download/v0.21.14/trunk-x86_64-unknown-linux-gnu.tar.gz -o trunk-x86_64-unknown-linux-gnu.tar.gz
33+
curl -sL https://github.com/thedodd/trunk/releases/download/v0.22.0-beta.1/trunk-x86_64-unknown-linux-gnu.tar.gz -o trunk-x86_64-unknown-linux-gnu.tar.gz
4134
tar xzf trunk-x86_64-unknown-linux-gnu.tar.gz
4235
sudo install trunk /usr/bin/trunk
4336
44-
- uses: actions/setup-node@v4
45-
with:
46-
node-version: '20'
47-
48-
- name: Install dependencies
49-
run: npm install
50-
5137
- name: Set build timestamp
5238
run: echo "BUILD_TIMESTAMP=$(date --rfc-3339=seconds --utc)" >> $GITHUB_ENV
5339

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ browser-panic-hook = "0.2"
1313
chrono = { version = "0.4.30", default-features = false, features = ["wasmbind"] }
1414
gloo-utils = "0.2"
1515
log = "0.4"
16-
patternfly-yew = { version = "0.7", features = ["tree", "icons-fab"] }
16+
patternfly-yew = { version = "0.7.3", features = ["tree", "icons-fab"] }
1717
popper-rs = { version = "0.4", features = ["yew", "debug"] }
1818
serde_json = "1"
1919
strum = { version = "0.27", features = ["derive"] }

Trunk.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[[node_packages]]
2+
name = "@patternfly/patternfly"
3+
version = "6.4.0"
4+
5+
[[node_packages]]
6+
name = "@fortawesome/fontawesome-free"
7+
version = "7.1.0"
8+

assets/initializer.mjs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ export default function initializer() {
55
console.time("trunk-initializer");
66

77
document.body.insertAdjacentHTML("afterbegin", `
8-
<div class="pf-v5-l-bullseye">
9-
<div class="pf-v5-l-bullseye__item" style="width: 50%;">
10-
<div id="initializer" class="pf-v5-c-progress">
8+
<div class="pf-v6-l-bullseye">
9+
<div class="pf-v6-l-bullseye__item" style="width: 50%;">
10+
<div id="initializer" class="pf-v6-c-progress">
1111
<div
12-
class="pf-v5-c-progress__description"
12+
class="pf-v6-c-progress__description"
1313
id="initializerState"
1414
>Loading</div>
15-
<div id="initializerStatus" class="pf-v5-c-progress__status" aria-hidden="true">
16-
<span id="initializerLabel" class="pf-v5-c-progress__measure">0%</span>
15+
<div id="initializerStatus" class="pf-v6-c-progress__status" aria-hidden="true">
16+
<span id="initializerLabel" class="pf-v6-c-progress__measure">0%</span>
1717
</div>
1818
<div
19-
class="pf-v5-c-progress__bar"
19+
class="pf-v6-c-progress__bar"
2020
id="initializerBar"
2121
role="progressbar"
2222
aria-valuemin="0"
2323
aria-valuemax="100"
2424
aria-valuenow="0"
2525
aria-labelledby="progress-simple-example-description"
2626
>
27-
<div id="initializerValue" class="pf-v5-c-progress__indicator" style="width:0;"></div>
27+
<div id="initializerValue" class="pf-v6-c-progress__indicator" style="width:0;"></div>
2828
</div>
2929
</div>
30-
<div id="initializerHelper" class="pf-v5-c-progress__helper-text pf-m-hidden">
31-
<div class="pf-v5-c-helper-text">
32-
<div class="pf-v5-c-helper-text__item">
33-
<span id="initializerHelperText" class="pf-v5-c-helper-text__item-text"></span>
30+
<div id="initializerHelper" class="pf-v6-c-progress__helper-text pf-m-hidden">
31+
<div class="pf-v6-c-helper-text">
32+
<div class="pf-v6-c-helper-text__item">
33+
<span id="initializerHelperText" class="pf-v6-c-helper-text__item-text"></span>
3434
</div>
3535
</div>
3636
</div>
@@ -93,7 +93,7 @@ function setState(value, helperText) {
9393
}
9494
const status = document.getElementById("initializerStatus");
9595
status.innerHTML = `
96-
<span class="pf-v5-c-progress__status-icon">
96+
<span class="pf-v6-c-progress__status-icon">
9797
<i class="fas fa-fw fa-times-circle" aria-hidden="true"></i>
9898
</span>
9999
`;

assets/style.scss

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
// only required if you are using the icons-far or icons-fab feature
22
// $fa-font-path: "webfonts";
3-
@import "../node_modules/@fortawesome/fontawesome-free/scss/fontawesome";
4-
@import "../node_modules/@fortawesome/fontawesome-free/scss/brands";
3+
@import "../target/node_modules/@fortawesome/fontawesome-free/7.1.0/scss/fontawesome";
4+
@import "../target/node_modules/@fortawesome/fontawesome-free/7.1.0/scss/brands";
55

66
// PatternFly styles
7-
@import "../node_modules/@patternfly/patternfly/patternfly.scss";
8-
@import "../node_modules/@patternfly/patternfly/patternfly-addons.scss";
7+
@import "../target/node_modules/@patternfly/patternfly/6.4.0/patternfly.scss";
8+
@import "../target/node_modules/@patternfly/patternfly/6.4.0/patternfly-addons.scss";
9+
10+
@font-face {
11+
font-family: "Font Awesome 7 Brands";
12+
font-style: normal;
13+
font-weight: 400;
14+
font-display: block;
15+
src: url("./webfonts/fa-brands-400.woff2");
16+
}

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
<link data-trunk rel="scss" href="assets/style.scss">
1414
<!-- This path needs to be here, otherwise icons won't render correctly -->
15-
<link data-trunk rel="copy-dir" href="node_modules/@patternfly/patternfly/assets" data-target-path="assets/">
15+
<link data-trunk rel="copy-dir" href="target/node_modules/@patternfly/patternfly/6.4.0/assets" data-target-path="assets/">
1616
<link data-trunk rel="copy-dir" href="assets/images">
1717

1818
<!-- include when using the icons-far or icons-fab feature -->
1919
<!-- also requires includes in the assets/styles.scss file -->
20-
<link data-trunk rel="copy-dir" href="node_modules/@fortawesome/fontawesome-free/webfonts">
20+
<link data-trunk rel="copy-dir" href="target/node_modules/@fortawesome/fontawesome-free/7.1.0/webfonts">
2121

2222
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="z" data-initializer="assets/initializer.mjs"/>
2323

package-lock.json

Lines changed: 0 additions & 43 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)