Skip to content

Conversation

thephez
Copy link
Collaborator

@thephez thephez commented Jul 24, 2025

Issue being fixed or feature implemented

The WASM SDK web interface at packages/wasm-sdk/index.html does not show version, build, or commit information, making it difficult for developers to know which version they are testing against. This can be important for debugging and ensuring they're working with the correct build.

What was done?

  • Added new WASM functions in src/sdk.rs:

    • packageVersion() - exposes Cargo package version (not used because it's currently not set in Cargo.toml, but presumably will be at some point)
    • gitCommit() - exposes git commit hash (injected at build time)
    • gitBranch() - exposes git branch (injected at build time)
    • buildTime() - exposes build timestamp (injected at build time)
  • Modified build script (packages/scripts/build-wasm.sh):

    • Extracts git commit hash and branch at build time using git rev-parse and git branch
    • Sets build timestamp using date -u
    • Exports these as environment variables for Rust compilation
  • Updated web interface (index.html):

    • Added version info display in the header below the title
    • Shows: package version, git commit, branch, protocol version, and build time
    • Includes detailed tooltip with version breakdown on hover
    • Graceful fallback if version info is unavailable

Example display: v2.0.0 ([email protected]) • Protocol v10 • Built 2025-07-24T17:08:34Z

How Has This Been Tested?

  • ✅ Code compiles without errors
  • ✅ Build script correctly extracts git information
  • ✅ New WASM functions are properly exposed via wasm-bindgen
  • ✅ Web interface code correctly calls the new functions
  • ⚠️ Full integration test requires wasm-pack to be installed for building

Testing environment:

  • Platform: Linux 6.8.0-64-generic
  • Branch: v2.1-dev
  • Commit: dde8678

Breaking Changes

None. This is a purely additive feature that enhances the developer experience without changing any existing functionality.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • The SDK now provides runtime access to build and version information, including package version, Git commit, branch, and build time.
    • The web demo displays detailed SDK version information in the page header after initialization, with a tooltip for additional details.
  • Chores

    • Build scripts now set and export metadata (commit, branch, build time) for improved traceability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

"""

Walkthrough

Build-time environment variables for git commit, branch, and build timestamp are now set and exported in the WASM build script. The SDK exposes new methods to retrieve this metadata at runtime. The web demo displays this build and version information in the page header after SDK initialization.

Changes

Cohort / File(s) Change Summary
Build Script Enhancements
packages/scripts/build-wasm.sh
Adds helper function to set and export GIT_COMMIT, GIT_BRANCH, BUILD_TIME; updates RUSTFLAGS.
SDK Runtime Metadata Methods
packages/wasm-sdk/src/sdk.rs
Adds four new WasmSdk public methods for build/version info, exposed to JS via wasm_bindgen.
Web Demo Version Display
packages/wasm-sdk/index.html
Adds version info display in header; JS retrieves and sets SDK build/version info post-init.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant WasmSdk

    User->>Browser: Load index.html
    Browser->>Browser: Show "Loading version info..."
    Browser->>WasmSdk: initializeSdk(network)
    WasmSdk-->>Browser: SDK instance
    Browser->>WasmSdk: gitCommit(), gitBranch()
    WasmSdk-->>Browser: Return commit and branch strings
    Browser->>Browser: Update versionInfo element with formatted version info
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

In the warren where code does run,
We now can see how builds are done!
Commit and branch, the time of day—
The SDK reveals it, hip-hip-hooray!
Version info shines, clear and bright,
Thanks to scripts and methods, all in sight.
🐇✨
"""

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 828d0fc and 2914e15.

📒 Files selected for processing (3)
  • packages/scripts/build-wasm.sh (2 hunks)
  • packages/wasm-sdk/index.html (2 hunks)
  • packages/wasm-sdk/src/sdk.rs (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/wasm-sdk/src/sdk.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/scripts/build-wasm.sh
  • packages/wasm-sdk/index.html
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build JS packages / Build JS
  • GitHub Check: build-and-test-wasm-sdk
  • GitHub Check: build-wasm-sdk
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/wasm-sdk-version-info

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@thephez
Copy link
Collaborator Author

thephez commented Jul 24, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
packages/scripts/build-wasm.sh (1)

115-115: Don’t clobber existing RUSTFLAGS

Overwriting RUSTFLAGS discards any caller-supplied flags. Append instead:

-export RUSTFLAGS="-C lto=off --cfg=env_vars_set"
+export RUSTFLAGS="${RUSTFLAGS:-} -C lto=off --cfg=env_vars_set"

Keeps the optimisation tweak while respecting user/CI settings.

packages/wasm-sdk/src/sdk.rs (1)

58-81: Consider making build-info helpers static functions

The four getters return compile-time constants and don’t depend on &self.
Exposing them as associated impl WasmSdk functions (or free functions) avoids forcing callers to have an SDK instance solely to query metadata:

-#[wasm_bindgen(js_name = packageVersion)]
-pub fn package_version(&self) -> String {
+#[wasm_bindgen(js_name = packageVersion)]
+pub fn package_version() -> String {

(and similarly for the other three).
This keeps the JS API surface minimal and sidesteps needless allocations during SDK initialisation.

packages/wasm-sdk/index.html (1)

794-799: Consider moving inline styling & placeholder text into CSS for maintainability

<div id="versionInfo" style="font-size: 0.8em; color: #b0b0b0; margin-top: -5px;">Loading version info...</div> embeds styling and placeholder copy directly in the markup.
Moving these attributes to the existing <style> block (or a dedicated class) keeps presentation concerns in one place and avoids repeating inline declarations if the element is reused elsewhere.
A minimal diff:

-      <div id="versionInfo" style="font-size: 0.8em; color: #b0b0b0; margin-top: -5px;">
-        Loading version info...
-      </div>
+      <div id="versionInfo" class="sdk-version-info">Loading version info...</div>

and add in the CSS section:

+.sdk-version-info {
+  font-size: 0.8em;
+  color: #b0b0b0;
+  margin-top: -5px;
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dde8678 and 1685df3.

📒 Files selected for processing (3)
  • packages/scripts/build-wasm.sh (2 hunks)
  • packages/wasm-sdk/index.html (2 hunks)
  • packages/wasm-sdk/src/sdk.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: lklimek
PR: dashpay/platform#2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.
packages/scripts/build-wasm.sh (10)

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'

Learnt from: shumkov
PR: #2248
File: packages/rs-drive-abci/src/main.rs:106-111
Timestamp: 2024-10-17T08:52:54.300Z
Learning: In this project, the environment variable CARGO_PKG_RUST_VERSION is defined and can be used safely with the env! macro.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.

Learnt from: lklimek
PR: #2374
File: Dockerfile:117-118
Timestamp: 2024-12-16T08:59:40.337Z
Learning: In our Dockerfiles, using ONBUILD ARG CARGO_BUILD_PROFILE=dev works correctly, and CARGO_BUILD_PROFILE is recognized in subsequent stages.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration

packages/wasm-sdk/src/sdk.rs (12)

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'

Learnt from: lklimek
PR: #2254
File: packages/rs-sdk/src/sdk.rs:585-585
Timestamp: 2024-10-18T15:39:51.172Z
Learning: The 'platform' project uses Rust version 1.80, so code in 'packages/rs-sdk' can use features available in Rust 1.80, such as the abs_diff() method.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.

Learnt from: shumkov
PR: #2248
File: packages/rs-drive-abci/src/main.rs:106-111
Timestamp: 2024-10-17T08:52:54.300Z
Learning: In this project, the environment variable CARGO_PKG_RUST_VERSION is defined and can be used safely with the env! macro.

Learnt from: shumkov
PR: #2489
File: packages/rs-dpp/Cargo.toml:32-32
Timestamp: 2025-03-11T09:39:23.071Z
Learning: In the Dash Platform project, dependencies are currently managed using Git repository references with tags (repo+tag format in Cargo.toml) rather than published crates, as the team is not currently publishing crates to crates.io.

packages/wasm-sdk/index.html (10)

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.

Learnt from: lklimek
PR: #2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.

🪛 Shellcheck (0.10.0)
packages/scripts/build-wasm.sh

[warning] 107-107: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 108-108: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 109-109: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 135-135: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 136-136: Declare and assign separately to avoid masking return values.

(SC2155)


[warning] 137-137: Declare and assign separately to avoid masking return values.

(SC2155)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-wasm-sdk
🔇 Additional comments (3)
packages/scripts/build-wasm.sh (1)

128-129: wasm-pack build flag --no-opt may be invalid – please verify

wasm-pack 0.12.x recognises --dev, --release, --profiling, but not --no-opt; an unknown flag aborts the build. Double-check the intended option (perhaps --profiling or --dev?).

packages/wasm-sdk/src/sdk.rs (1)

58-81: Implementation looks solid

Environment variables are accessed correctly (env! / option_env!), fallbacks are sensible, and JS names are camel-cased.

packages/wasm-sdk/index.html (1)

2997-3012: Verify that the new WASM getters are synchronous; otherwise await them

initializeSdk() builds the display string by calling
sdk.packageVersion(), sdk.gitCommit(), sdk.gitBranch(), sdk.buildTime(), and sdk.version() without await.
If any of these wasm-bindgen exports return a Promise (common when returning JsValue or strings that cross the boundary), the UI will show [object Promise] instead of the expected text.

  1. Confirm in src/sdk.rs that each #[wasm_bindgen] function returns String (not JsValue or Promise).
  2. If any are async, mark the calls with await and make the containing block async.

Example fix if needed:

-const packageVersion = sdk.packageVersion();
+const packageVersion = await sdk.packageVersion();

Failure to do so will silently degrade the header display and could mislead users about the active build.

@thephez thephez marked this pull request as ready for review July 24, 2025 19:44
@thephez thephez requested a review from QuantumExplorer as a code owner July 24, 2025 19:44
@thephez
Copy link
Collaborator Author

thephez commented Jul 24, 2025

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

✅ Actions performed

Full review triggered.

1 similar comment
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

✅ Actions performed

Full review triggered.

@thephez thephez changed the title feat(wasm-sdk): add version/build information display to web interface feat(sdk): add version/build information display to web interface Jul 24, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/wasm-sdk/src/sdk.rs (1)

58-81: Prefer compile-time constants to avoid repeated allocation

Every call to these getters allocates a fresh String.
Since the values are compile-time literals, cache them in const/static vars and return &'static str (wasm-bindgen can clone for JS):

+const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
+const GIT_COMMIT:  &str = option_env!("GIT_COMMIT").unwrap_or("unknown");
+const GIT_BRANCH:  &str = option_env!("GIT_BRANCH").unwrap_or("unknown");
+const BUILD_TIME:  &str = option_env!("BUILD_TIME").unwrap_or("unknown");

 #[wasm_bindgen(js_name = packageVersion)]
-pub fn package_version(&self) -> String {
-    env!("CARGO_PKG_VERSION").to_string()
-}
+pub fn package_version(&self) -> String {
+    PKG_VERSION.into()
+}

Repeat for the other three methods. This eliminates heap work and shrinks generated wasm a little.

packages/wasm-sdk/index.html (1)

794-799: Avoid inline styles & introduce semantic class for version banner.

The new versionInfo element is rendered with inline styling directly in the markup.
Inline styles make subsequent re-styling, theming, and dark-mode support cumbersome and violate separation-of-concerns.

Consider extracting these rules into the existing <style> section and binding the element via a CSS class instead:

-<div id="versionInfo" style="font-size: 0.8em; color: #b0b0b0; margin-top: -5px;">
-  Loading version info...
-</div>
+<div id="versionInfo" class="version-banner">Loading version info…</div>

and then in the stylesheet:

.version-banner {
  font-size: 0.8em;
  color: #b0b0b0;
  margin-top: -5px;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dde8678 and 828d0fc.

📒 Files selected for processing (3)
  • packages/scripts/build-wasm.sh (2 hunks)
  • packages/wasm-sdk/index.html (2 hunks)
  • packages/wasm-sdk/src/sdk.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.
Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.
Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.
Learnt from: lklimek
PR: dashpay/platform#2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.
packages/scripts/build-wasm.sh (13)

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

Learnt from: shumkov
PR: #2248
File: packages/rs-drive-abci/src/main.rs:106-111
Timestamp: 2024-10-17T08:52:54.300Z
Learning: In this project, the environment variable CARGO_PKG_RUST_VERSION is defined and can be used safely with the env! macro.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/generate_docs.py : When adding new queries or state transitions, run python3 generate_docs.py to regenerate documentation.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'

Learnt from: lklimek
PR: #2381
File: packages/rs-sdk/scripts/connect_to_remote.sh:0-0
Timestamp: 2024-12-10T12:39:38.182Z
Learning: When reviewing scripts in packages/rs-sdk/scripts/, avoid suggesting additional error handling and timeout management that complicate the script without adding significant value.

Learnt from: lklimek
PR: #2344
File: .github/actions/sccache/action.yaml:0-0
Timestamp: 2024-11-26T12:46:54.812Z
Learning: In the .github/actions/sccache/action.yaml file, the environment variables CC and CXX need quotes around their values (e.g., CC="sccache cc") to be interpreted correctly.

Learnt from: lklimek
PR: #2318
File: Dockerfile:0-0
Timestamp: 2024-11-13T10:32:02.981Z
Learning: In the Dockerfile's sccache configuration script, the team relies on sccache to validate required arguments, so explicit error handling for missing variables is unnecessary.

Learnt from: lklimek
PR: #2374
File: Dockerfile:117-118
Timestamp: 2024-12-16T08:59:40.337Z
Learning: In our Dockerfiles, using ONBUILD ARG CARGO_BUILD_PROFILE=dev works correctly, and CARGO_BUILD_PROFILE is recognized in subsequent stages.

packages/wasm-sdk/src/sdk.rs (12)

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : Token functions are methods on WasmSdk, not standalone functions; avoid importing them as standalone.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Use WASM bindings to connect Rust and JavaScript code for cross-language integration

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'

Learnt from: lklimek
PR: #2254
File: packages/rs-sdk/src/sdk.rs:585-585
Timestamp: 2024-10-18T15:39:51.172Z
Learning: The 'platform' project uses Rust version 1.80, so code in 'packages/rs-sdk' can use features available in Rust 1.80, such as the abs_diff() method.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.

Learnt from: shumkov
PR: #2248
File: packages/rs-drive-abci/src/main.rs:106-111
Timestamp: 2024-10-17T08:52:54.300Z
Learning: In this project, the environment variable CARGO_PKG_RUST_VERSION is defined and can be used safely with the env! macro.

Learnt from: shumkov
PR: #2489
File: packages/rs-dpp/Cargo.toml:32-32
Timestamp: 2025-03-11T09:39:23.071Z
Learning: In the Dash Platform project, dependencies are currently managed using Git repository references with tags (repo+tag format in Cargo.toml) rather than published crates, as the team is not currently publishing crates to crates.io.

packages/wasm-sdk/index.html (8)

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/index.html : Test the WASM SDK using the web interface at 'index.html' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : When adding new queries or state transitions, update the definitions in index.html.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/**/index.html : The WASM SDK now fully supports where and orderBy clauses for document queries; use the specified JSON array formats and supported operators.

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/build.sh : Build the WASM SDK by running './build.sh' in 'packages/wasm-sdk'

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : When implementing WASM SDK functionality, always refer to AI_REFERENCE.md first for accurate method signatures and examples.

Learnt from: CR
PR: dashpay/platform#0
File: packages/wasm-sdk/CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:42.268Z
Learning: Applies to packages/wasm-sdk/src/**/*.rs : For WASM builds, fix 'time not implemented on this platform' errors by using js_sys::Date::now().

Learnt from: CR
PR: dashpay/platform#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-23T08:31:05.082Z
Learning: Applies to packages/wasm-sdk/generate_docs.py : Keep documentation for the WASM SDK in sync by running 'python3 generate_docs.py' in 'packages/wasm-sdk'

Learnt from: lklimek
PR: #2405
File: packages/wasm-sdk/src/verify.rs:26-68
Timestamp: 2025-02-10T11:26:36.709Z
Learning: In the wasm-sdk package, empty vectors and placeholder values are intentionally used in verification functions during the proof-of-concept stage to ensure proper compilation and type checking.

🔇 Additional comments (1)
packages/scripts/build-wasm.sh (1)

99-110: Nice extraction of build-metadata logic

Moving the duplicated export statements into set_build_env_vars removes redundancy and resolves the earlier SC2155 warnings.
The helper is concise and the fallback to "unknown" covers CI/detached-HEAD cases well.

Comment on lines +124 to 125
export RUSTFLAGS="-C lto=off --cfg=env_vars_set"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Preserve existing RUSTFLAGS instead of clobbering it

export RUSTFLAGS="-C lto=off --cfg=env_vars_set" overwrites any flags a caller might have set (e.g. -C target-cpu=native). Safer to append:

-export RUSTFLAGS="-C lto=off --cfg=env_vars_set"
+export RUSTFLAGS="${RUSTFLAGS:-} -C lto=off --cfg=env_vars_set"

This keeps the new switches while respecting upstream configuration.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export RUSTFLAGS="-C lto=off --cfg=env_vars_set"
export RUSTFLAGS="${RUSTFLAGS:-} -C lto=off --cfg=env_vars_set"
🤖 Prompt for AI Agents
In packages/scripts/build-wasm.sh at lines 124 to 125, the current export of
RUSTFLAGS overwrites any existing flags set by the caller. To fix this, modify
the export statement to append the new flags to the existing RUSTFLAGS variable
instead of replacing it, ensuring that any previously set flags are preserved
while adding "-C lto=off --cfg=env_vars_set".

Comment on lines +2997 to +3299
// Display version information in header
try {
const gitCommit = sdk.gitCommit();
const gitBranch = sdk.gitBranch();

const versionText = `Built from branch: ${gitBranch} (${gitCommit})`;
document.getElementById('versionInfo').textContent = versionText;
document.getElementById('versionInfo').title = `Branch: ${gitBranch}\nCommit: ${gitCommit}`;
} catch (error) {
console.warn('Failed to get version info:', error);
document.getElementById('versionInfo').textContent = 'Version info unavailable';
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Expose all available build metadata & improve formatting/fallbacks.

Only branch/commit are surfaced; packageVersion() and buildTime() exported in sdk.rs remain unused.
Additionally, very long commit hashes reduce readability and empty/placeholder values aren’t handled.

-const gitCommit = sdk.gitCommit();
-const gitBranch = sdk.gitBranch();
-
-const versionText = `Built from branch: ${gitBranch} (${gitCommit})`;
-document.getElementById('versionInfo').textContent = versionText;
-document.getElementById('versionInfo').title = `Branch: ${gitBranch}\nCommit: ${gitCommit}`;
+const gitCommit  = sdk.gitCommit?.()  ?? '';
+const gitBranch  = sdk.gitBranch?.()  ?? '';
+const pkgVer     = sdk.packageVersion?.() ?? '';
+const buildTime  = sdk.buildTime?.()  ?? '';
+
+// keep first 9 chars of hash for compactness
+const shortCommit = gitCommit.slice(0, 9);
+
+let header = [];
+if (pkgVer)        header.push(`v${pkgVer}`);
+if (shortCommit)   header.push(shortCommit + (gitBranch ? `@${gitBranch}` : ''));
+if (buildTime)     header.push(`• Built ${buildTime}`);
+
+const versionText = header.join(' ');
+
+const tooltip = `Package: ${pkgVer || 'unknown'}\nBranch: ${gitBranch || 'unknown'}\nCommit: ${gitCommit || 'unknown'}\nBuilt: ${buildTime || 'unknown'}`;
+
+const versionElem = document.getElementById('versionInfo');
+versionElem.textContent = versionText || 'Version info unavailable';
+versionElem.title       = tooltip;

Benefits:

  1. Surfaces all metadata the build script provides.
  2. Shortens the commit hash for UX while retaining full hash in tooltip.
  3. Gracefully degrades if any field is missing.
  4. Guards against optional chaining runtime errors on older builds.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Display version information in header
try {
const gitCommit = sdk.gitCommit();
const gitBranch = sdk.gitBranch();
const versionText = `Built from branch: ${gitBranch} (${gitCommit})`;
document.getElementById('versionInfo').textContent = versionText;
document.getElementById('versionInfo').title = `Branch: ${gitBranch}\nCommit: ${gitCommit}`;
} catch (error) {
console.warn('Failed to get version info:', error);
document.getElementById('versionInfo').textContent = 'Version info unavailable';
}
// Display version information in header
try {
const gitCommit = sdk.gitCommit?.() ?? '';
const gitBranch = sdk.gitBranch?.() ?? '';
const pkgVer = sdk.packageVersion?.() ?? '';
const buildTime = sdk.buildTime?.() ?? '';
// keep first 9 chars of hash for compactness
const shortCommit = gitCommit.slice(0, 9);
let header = [];
if (pkgVer) header.push(`v${pkgVer}`);
if (shortCommit) header.push(shortCommit + (gitBranch ? `@${gitBranch}` : ''));
if (buildTime) header.push(`• Built ${buildTime}`);
const versionText = header.join(' ');
const tooltip =
`Package: ${pkgVer || 'unknown'}\n` +
`Branch: ${gitBranch || 'unknown'}\n` +
`Commit: ${gitCommit || 'unknown'}\n` +
`Built: ${buildTime || 'unknown'}`;
const versionElem = document.getElementById('versionInfo');
versionElem.textContent = versionText || 'Version info unavailable';
versionElem.title = tooltip;
} catch (error) {
console.warn('Failed to get version info:', error);
document.getElementById('versionInfo').textContent = 'Version info unavailable';
}
🤖 Prompt for AI Agents
In packages/wasm-sdk/index.html around lines 2997 to 3009, enhance the version
info display by including packageVersion() and buildTime() from sdk.rs along
with gitBranch() and gitCommit(). Shorten the displayed commit hash for
readability but keep the full hash in the tooltip. Add checks to handle missing
or empty values gracefully to avoid runtime errors, and ensure all metadata
fields are shown with proper formatting and fallback text if unavailable.

thephez and others added 3 commits July 28, 2025 08:42
- Add new WASM functions to expose package version, git commit, branch, and build time
- Modify build script to inject git information at build time
- Update index.html to display version info in header with tooltip
- Provides developers with clear build context and version information

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Create set_build_env_vars() helper function to set build variables
- Remove duplicate code between wasm-pack and cargo build paths
- Fix SC2155 shellcheck warning by separating variable assignment from export
- Maintain same functionality while improving code maintainability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@thephez thephez force-pushed the feat/wasm-sdk-version-info branch from 828d0fc to 2914e15 Compare July 28, 2025 12:42
@thephez thephez closed this Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant