From 31ec9c4a9f28e922306213ec3089832172916559 Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Sun, 15 Jun 2025 15:12:55 +0000 Subject: [PATCH 01/11] minor update --- packages/perseus-cli/Cargo.toml | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/perseus-cli/Cargo.toml b/packages/perseus-cli/Cargo.toml index 47d027d455..3144bde048 100644 --- a/packages/perseus-cli/Cargo.toml +++ b/packages/perseus-cli/Cargo.toml @@ -9,13 +9,14 @@ repository = "https://github.com/framesurge/perseus" homepage = "https://framesurge.sh/perseus" readme = "./README.md" keywords = ["wasm", "cli", "webdev", "ssg", "ssr"] -categories = ["wasm", "development-tools", "asynchronous", "gui", "command-line-utilities"] -include = [ - "src/", - "Cargo.toml", - ".perseus/", - "README.proj.md" +categories = [ + "wasm", + "development-tools", + "asynchronous", + "gui", + "command-line-utilities", ] +include = ["src/", "Cargo.toml", ".perseus/", "README.proj.md"] autotests = false @@ -31,29 +32,29 @@ shell-words = "1" include_dir = "0.7" thiserror = "1" fmterr = "0.1" -cargo_toml = "0.15" +cargo_toml = "0.22" indicatif = "0.17" console = "0.15" serde = "1" serde_json = "1" -clap = { version = "4.2", features = [ "color", "derive" ] } +clap = { version = "4.2", features = ["color", "derive"] } fs_extra = "1" -tokio = { version = "1", features = [ "macros", "rt-multi-thread", "sync" ] } +tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync"] } warp = "0.3" command-group = "2" ctrlc = { version = "3.2", features = ["termination"] } notify = "6" futures = "0.3" tokio-stream = "0.1" -reqwest = { version = "0.11", features = [ "json", "stream" ] } +reqwest = { version = "0.11", features = ["json", "stream"] } tar = "0.4" flate2 = "1" directories = "5" -cargo_metadata = "0.15" -cargo-lock = "8" -minify-js = "=0.4.3" # Be careful changing this, and test extensively! +cargo_metadata = "0.20" +cargo-lock = "10" +minify-js = "=0.4.3" # Be careful changing this, and test extensively! walkdir = "2" -openssl = { version = "0.10.52", optional = true} +openssl = { version = "0.10.52", optional = true } brotlic = "0.8" [dev-dependencies] @@ -71,4 +72,4 @@ path = "src/bin/main.rs" [features] # `reqwest` uses the system-native transport layer by default, this is necessary in some environments -vendored-openssl = [ "openssl/vendored" ] +vendored-openssl = ["openssl/vendored"] From 46bb37c1fd76e93f1eeec0405091b8d26570c4d4 Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Sun, 15 Jun 2025 15:25:31 +0000 Subject: [PATCH 02/11] update --- packages/perseus-cli/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/perseus-cli/Cargo.toml b/packages/perseus-cli/Cargo.toml index 3144bde048..154b804e5c 100644 --- a/packages/perseus-cli/Cargo.toml +++ b/packages/perseus-cli/Cargo.toml @@ -52,7 +52,7 @@ flate2 = "1" directories = "5" cargo_metadata = "0.20" cargo-lock = "10" -minify-js = "=0.4.3" # Be careful changing this, and test extensively! +minify-js = "=0.6.0" # Be careful changing this, and test extensively! walkdir = "2" openssl = { version = "0.10.52", optional = true } brotlic = "0.8" From 439c7ec8bcd8d2f7f8b7a55ea6244cda7c912185 Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Wed, 18 Jun 2025 15:20:34 +0000 Subject: [PATCH 03/11] axum ommited --- examples/core/preload/Cargo.toml | 13 +++++++++---- packages/perseus-cli/Cargo.toml | 12 ++++++------ packages/perseus-cli/src/errors.rs | 4 +++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/examples/core/preload/Cargo.toml b/examples/core/preload/Cargo.toml index 37d0f65487..cbbad1c26e 100644 --- a/examples/core/preload/Cargo.toml +++ b/examples/core/preload/Cargo.toml @@ -6,7 +6,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -perseus = { path = "../../../packages/perseus", features = [ "hydrate", "translator-fluent" ] } +perseus = { path = "../../../packages/perseus", features = [ + "hydrate", + "translator-fluent", +] } sycamore = "^0.8.1" serde = { version = "1", features = ["derive"] } serde_json = "1" @@ -15,10 +18,12 @@ serde_json = "1" fantoccini = "0.19" [target.'cfg(engine)'.dependencies] -tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] } +tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] } ## **WARNING!** Before running this example outside the Perseus repo, replace the below line with ## the one commented out below it (changing the path dependency to the version you want to use) -perseus-axum = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false } -# perseus-axum = { path = "../../../packages/perseus-axum", features = [ "dflt-server" ] } +## perseus-axum = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false } +perseus-axum = { path = "../../../packages/perseus-axum", features = [ + "dflt-server", +] } [target.'cfg(client)'.dependencies] diff --git a/packages/perseus-cli/Cargo.toml b/packages/perseus-cli/Cargo.toml index 154b804e5c..3c403c94fb 100644 --- a/packages/perseus-cli/Cargo.toml +++ b/packages/perseus-cli/Cargo.toml @@ -30,7 +30,7 @@ path = "tests/lib.rs" [dependencies] shell-words = "1" include_dir = "0.7" -thiserror = "1" +thiserror = "2" fmterr = "0.1" cargo_toml = "0.22" indicatif = "0.17" @@ -41,15 +41,15 @@ clap = { version = "4.2", features = ["color", "derive"] } fs_extra = "1" tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync"] } warp = "0.3" -command-group = "2" +command-group = "5" ctrlc = { version = "3.2", features = ["termination"] } -notify = "6" +notify = "8" futures = "0.3" tokio-stream = "0.1" -reqwest = { version = "0.11", features = ["json", "stream"] } +reqwest = { version = "0.12", features = ["json", "stream"] } tar = "0.4" flate2 = "1" -directories = "5" +directories = "6" cargo_metadata = "0.20" cargo-lock = "10" minify-js = "=0.6.0" # Be careful changing this, and test extensively! @@ -61,7 +61,7 @@ brotlic = "0.8" assert_cmd = "2" assert_fs = "1" predicates = "3" -ureq = "2" +ureq = "3" [lib] name = "perseus_cli" diff --git a/packages/perseus-cli/src/errors.rs b/packages/perseus-cli/src/errors.rs index 152fcb020a..74b4ecdc3e 100644 --- a/packages/perseus-cli/src/errors.rs +++ b/packages/perseus-cli/src/errors.rs @@ -165,11 +165,13 @@ pub enum DeployError { #[source] source: std::io::Error, }, + #[error("failed to minify javascript bundle (this is probably an upstream bug, re-try with `--no-minify-js`)")] MinifyError { #[source] - source: minify_js::MinifyError, + source: minify_js::Error, }, + #[error("minified js was not utf-8 (this is a bug, re-try with `--no-minify-js` for now)")] MinifyNotUtf8 { #[source] From ec88345feab7c7f74ac9d9af90b9eafd0659f8fd Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Thu, 19 Jun 2025 07:25:21 +0000 Subject: [PATCH 04/11] update --- .github/workflows/ci.yml | 2 +- examples/core/preload/Cargo.toml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02e6ed91cb..03541651c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: - main - pull_request: + # pull_request: jobs: check: diff --git a/examples/core/preload/Cargo.toml b/examples/core/preload/Cargo.toml index cbbad1c26e..49a604bfee 100644 --- a/examples/core/preload/Cargo.toml +++ b/examples/core/preload/Cargo.toml @@ -21,9 +21,7 @@ fantoccini = "0.19" tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] } ## **WARNING!** Before running this example outside the Perseus repo, replace the below line with ## the one commented out below it (changing the path dependency to the version you want to use) -## perseus-axum = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false } -perseus-axum = { path = "../../../packages/perseus-axum", features = [ - "dflt-server", -] } +perseus-axum = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false } +# perseus-axum = { path = "../../../packages/perseus-axum", features = [ "dflt-server" ] } [target.'cfg(client)'.dependencies] From 4569caaa05b3d9f90721ceb0ca8faa9951545f48 Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Thu, 19 Jun 2025 08:47:53 +0000 Subject: [PATCH 05/11] reverted some dependencies --- packages/perseus-cli/Cargo.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/perseus-cli/Cargo.toml b/packages/perseus-cli/Cargo.toml index 3c403c94fb..919d6f00cc 100644 --- a/packages/perseus-cli/Cargo.toml +++ b/packages/perseus-cli/Cargo.toml @@ -30,9 +30,9 @@ path = "tests/lib.rs" [dependencies] shell-words = "1" include_dir = "0.7" -thiserror = "2" +thiserror = "1" fmterr = "0.1" -cargo_toml = "0.22" +cargo_toml = "0.15" indicatif = "0.17" console = "0.15" serde = "1" @@ -41,18 +41,18 @@ clap = { version = "4.2", features = ["color", "derive"] } fs_extra = "1" tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync"] } warp = "0.3" -command-group = "5" +command-group = "2" ctrlc = { version = "3.2", features = ["termination"] } -notify = "8" +notify = "6" futures = "0.3" tokio-stream = "0.1" -reqwest = { version = "0.12", features = ["json", "stream"] } +reqwest = { version = "0.11", features = ["json", "stream"] } tar = "0.4" flate2 = "1" -directories = "6" -cargo_metadata = "0.20" +directories = "5" +cargo_metadata = "0.15" cargo-lock = "10" -minify-js = "=0.6.0" # Be careful changing this, and test extensively! +minify-js = "=0.4.3" # Be careful changing this, and test extensively! walkdir = "2" openssl = { version = "0.10.52", optional = true } brotlic = "0.8" @@ -61,7 +61,7 @@ brotlic = "0.8" assert_cmd = "2" assert_fs = "1" predicates = "3" -ureq = "3" +ureq = "2" [lib] name = "perseus_cli" From 6afd4c5fa7cf933412f7cc9365fb79668aa6f626 Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Thu, 19 Jun 2025 08:55:20 +0000 Subject: [PATCH 06/11] fix 1 --- .github/workflows/bench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 5d2a34b39e..7b2c67dec2 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -71,7 +71,7 @@ jobs: run: bonnie bench size ${{ matrix.type }} ${{ matrix.name }} --json | tee output.txt # Download previous benchmark result from cache (if exists) - name: Download previous benchmark data - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ./cache key: ${{ runner.os }}-benchmark From 9e65bcdb3542e5efe9fce0e19c9ebe013ebf64c1 Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Sat, 12 Jul 2025 05:06:12 +0000 Subject: [PATCH 07/11] updt updt --- .idea/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..13566b81b0 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml From 698385929ffd420e40b1d8b7e12c5bc7fd8beccb Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Sat, 12 Jul 2025 05:08:58 +0000 Subject: [PATCH 08/11] UpdT updT --- .github/workflows/ci.yml | 46 ++++++++++++++++++++-------------------- .gitignore | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03541651c3..540b882cf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: - main - # pull_request: + pull_request: jobs: check: @@ -16,10 +16,10 @@ jobs: - uses: actions/cache@v3 id: cache with: - path: | - ~/.cargo/bin/ - # The cache should be OS-specific - key: ${{ runner.os }}-cargo-bins + path: | + ~/.cargo/bin/ + # The cache should be OS-specific + key: ${{ runner.os }}-cargo-bins # Only install the binaries if the cache doesn't have them - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' @@ -37,10 +37,10 @@ jobs: - uses: actions/cache@v3 id: cache with: - path: | - ~/.cargo/bin/ - # The cache should be OS-specific - key: ${{ runner.os }}-cargo-bins + path: | + ~/.cargo/bin/ + # The cache should be OS-specific + key: ${{ runner.os }}-cargo-bins # Only install the binaries if the cache doesn't have them - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' @@ -57,10 +57,10 @@ jobs: - uses: actions/cache@v3 id: cache with: - path: | - ~/.cargo/bin/ - # The cache should be OS-specific - key: ${{ runner.os }}-cargo-bins + path: | + ~/.cargo/bin/ + # The cache should be OS-specific + key: ${{ runner.os }}-cargo-bins # Only install the binaries if the cache doesn't have them - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' @@ -126,10 +126,10 @@ jobs: - uses: actions/cache@v3 id: cache with: - path: | - ~/.cargo/bin/ - # The cache should be OS-specific - key: ${{ runner.os }}-cargo-bins + path: | + ~/.cargo/bin/ + # The cache should be OS-specific + key: ${{ runner.os }}-cargo-bins # Only install the binaries if the cache doesn't have them - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' @@ -138,12 +138,12 @@ jobs: # Also cache all the other Cargo files, since plenty of CI runs won't involve different dependencies - uses: actions/cache@v3 with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} # # Also cache the apt packages we need for testing # - uses: awalsh128/cache-apt-pkgs-action@latest diff --git a/.gitignore b/.gitignore index cb00b5470e..773e6e1d60 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ Cargo.lock pkg/ .tribble/ - +.idea/ target_engine/ target_wasm/ dist/ From 25409754d3c9e4dd02808b6fd457c204bbd1e604 Mon Sep 17 00:00:00 2001 From: afidegnum Date: Sat, 12 Jul 2025 09:35:39 +0000 Subject: [PATCH 09/11] UPdate error fix --- .github/workflows/bench.yml | 66 +++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 7b2c67dec2..814d95672b 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -45,50 +45,58 @@ jobs: - uses: actions/checkout@v2 # Cache Cargo binaries - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cache with: - path: | - ~/.cargo/bin/ - # The cache should be OS-specific - key: ${{ runner.os }}-cargo-bins + path: | + ~/.cargo/bin/ + # The cache should be OS-specific + key: ${{ runner.os }}-cargo-bins # Only install the binaries if the cache doesn't have them - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: cargo install bonnie rust-script # Also cache all the other Cargo files, since plenty of CI runs won't involve different dependencies - - uses: actions/cache@v3 + - uses: actions/cache@v4 with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - name: Run benchmark for ${{ matrix.name }} in category ${{ matrix.type }} - run: bonnie bench size ${{ matrix.type }} ${{ matrix.name }} --json | tee output.txt + run: bonnie bench size ${{ matrix.type }} ${{ matrix.name }} --json > output.txt + + # Add this step to see what's actually in the file before the action runs + - name: "Debug: Display benchmark output file" + run: | + echo "--- Contents of output.txt ---" + cat output.txt + echo "------------------------------" + # Download previous benchmark result from cache (if exists) - name: Download previous benchmark data - uses: actions/cache@v3 + uses: actions/cache@v4 with: - path: ./cache - key: ${{ runner.os }}-benchmark + path: ./cache + key: ${{ runner.os }}-benchmark - name: Store benchmark result uses: benchmark-action/github-action-benchmark@v1 with: - # What benchmark tool the output.txt came from - tool: "customSmallerIsBetter" - # Where the output from the benchmark tool is stored - output-file-path: output.txt - # Where the previous data file is stored - external-data-json-path: ./cache/benchmark-data.json - # Workflow will fail when an alert happens - fail-on-alert: true - # GitHub API token to make a commit comment - github-token: ${{ secrets.GITHUB_TOKEN }} - alert-threshold: "110%" - comment-on-alert: true - alert-comment-cc-users: '@arctic-hen7' # We need this kind of quoting, `@` is special in YAML + # What benchmark tool the output.txt came from + tool: "customSmallerIsBetter" + # Where the output from the benchmark tool is stored + output-file-path: output.txt + # Where the previous data file is stored + external-data-json-path: ./cache/benchmark-data.json + # Workflow will fail when an alert happens + fail-on-alert: true + # GitHub API token to make a commit comment + github-token: ${{ secrets.GITHUB_TOKEN }} + alert-threshold: "110%" + comment-on-alert: true + alert-comment-cc-users: "@arctic-hen7" # We need this kind of quoting, `@` is special in YAML From aad327380aef46e3c74bf58bac22455d36e648e2 Mon Sep 17 00:00:00 2001 From: afidegnum Date: Sat, 12 Jul 2025 17:31:12 +0000 Subject: [PATCH 10/11] new fix fix rust errors --- packages/perseus-cli/src/deploy.rs | 6 +++++- packages/perseus-cli/src/errors.rs | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/perseus-cli/src/deploy.rs b/packages/perseus-cli/src/deploy.rs index cece514334..a075acf523 100644 --- a/packages/perseus-cli/src/deploy.rs +++ b/packages/perseus-cli/src/deploy.rs @@ -328,7 +328,11 @@ fn minify_js(from: &Path, to: &Path) -> Result<(), DeployError> { // Guaranteed to be UTF-8 output &mut minified, ) - .map_err(|err| DeployError::MinifyError { source: err })?; + // This is the updated line + .map_err(|err| DeployError::MinifyError { + source: Box::new(std::io::Error::other(err.to_string())), + })?; + let minified = String::from_utf8(minified).map_err(|err| DeployError::MinifyNotUtf8 { source: err })?; fs::write(to, minified).map_err(|err| DeployError::WriteMinifiedJsFailed { source: err })?; diff --git a/packages/perseus-cli/src/errors.rs b/packages/perseus-cli/src/errors.rs index 74b4ecdc3e..4a2cf9358b 100644 --- a/packages/perseus-cli/src/errors.rs +++ b/packages/perseus-cli/src/errors.rs @@ -169,7 +169,8 @@ pub enum DeployError { #[error("failed to minify javascript bundle (this is probably an upstream bug, re-try with `--no-minify-js`)")] MinifyError { #[source] - source: minify_js::Error, + source: Box, + // source: minify_js::Error, }, #[error("minified js was not utf-8 (this is a bug, re-try with `--no-minify-js` for now)")] From 6269136b8f0e383d9f0839a756339d98fc8a4668 Mon Sep 17 00:00:00 2001 From: KOKOU AFIDEGNON Date: Fri, 1 Aug 2025 05:21:30 +0000 Subject: [PATCH 11/11] Update .github/workflows/bench.yml Co-authored-by: Sam Brew --- .github/workflows/bench.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 814d95672b..49aab8b96d 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -99,4 +99,4 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} alert-threshold: "110%" comment-on-alert: true - alert-comment-cc-users: "@arctic-hen7" # We need this kind of quoting, `@` is special in YAML + alert-comment-cc-users: '@arctic-hen7' # We need this kind of quoting, `@` is special in YAML