feat: support external lib usage #18
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces changes so that the modules independent and hence importable into external runtimes - as library functions.
AI Description
This pull request introduces significant changes to streamline the runtime initialization process, update build configurations, and enhance modularity.
The most important updates include consolidating feature-specific initialization under a unified runtime feature, modifying build matrix configurations, and extending crate types for better compatibility.
Build configuration updates:
.github/workflows/release.ymlto include theruntimefeature alongside other features likecrypto,fetch,llm, andwasip1. This ensures a consistent runtime environment for all builds. ([.github/workflows/release.ymlL16-R19](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L16-R19)).github/workflows/release.ymlby removing the special case for the "standard" build. ([.github/workflows/release.ymlL49-R48](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34L49-R48))Runtime initialization improvements:
crypto,fetch,llm,wasip1) under a newruntimefeature insrc/lib.rs. Each feature now has its ownset_*_globalsfunction to encapsulate initialization logic. ([[1]](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R1-R6),[[2]](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759L20-R88),[[3]](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759L79-R98),[[4]](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R114-R139))crypto.js,fetch.js,wasi/preview_1.js) during runtime initialization. ([src/lib.rsR114-R139](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R114-R139))Crate configuration updates:
crate-typeinCargo.tomlto includerlibalongsidecdylib, allowing for more flexible use cases. ([Cargo.tomlL14-R14](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L14-R14))runtimefeature inCargo.tomland added it to the default feature set. This ensures that runtime-related functionality is always included by default. ([Cargo.tomlL30-R31](https://github.com/blessnetwork/javy-bless-plugins/pull/18/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L30-R31))