Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version in more places #482

Open
dbanty opened this issue Jun 24, 2023 · 3 comments
Open

Update version in more places #482

dbanty opened this issue Jun 24, 2023 · 3 comments
Labels
🎸 Feature New feature or request

Comments

@dbanty
Copy link
Member

dbanty commented Jun 24, 2023

There are many times you'll want to keep your version up to date in multiple places (e.g., documentation's install instructions). Knope should facilitate this somehow. The most obvious solution is probably regex match groups for set files but maybe there's a simpler option (that doesn't require testing regexs, which is hard)?

@alex-way
Copy link
Contributor

Just throwing out a potentially terrible idea here but could something like the following work:

[package]
# Query parameter style. Similar to vite asset importing: https://vitejs.dev/guide/assets.html#importing-asset-as-string
versioned_files = ["docker-compose.yml?replace=REGEX$version"]
[package]
# Potentially simpler, but could be limiting if further features are required in the future
versioned_files = ["docker-compose.yml:REGEX$version"]

The idea being that there's a defined separator (? or :) between the filename (docker-compose.yml) and the regex. One other thing we'll need is an identifier for the current version rather than relying on regex. I suggest $version as it's what's used elsewhere in the documentation for similar purposes.

We'd need to replace the $version first, prior to evaluating the regex to avoid the $version from mangling the regex.

I think whatever method is implemented should only be used as a fallback and as further development is done to parse different files, the reliance on this should be less prevalent and hopefully less of an issue.

@alex-way
Copy link
Contributor

alex-way commented Jun 2, 2024

Another idea I've had is some kind've plugin system which will allow developers to be able to implement their own systems.

@alex-way
Copy link
Contributor

Following the idea of a plugin system, I've come across a framework, Extism, which allows extremely easy consumption of functions exported via WASM modules. WASM is seemingly the perfect fit as it'll allow users to be able to write plugins in any of the supported languages and provides extreme safety via sandboxing.

Executing an exposed function is as simple as:

let url = Wasm::url(
  "https://github.com/extism/plugins/releases/latest/download/count_vowels.wasm"
);
let manifest = Manifest::new([url]);
let mut plugin = Plugin::new(&manifest, [], true).unwrap();
let res = plugin.call::<&str, &str>("count_vowels", "Hello, world!").unwrap();
println!("{}", res);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎸 Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants