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

Renamed most appearances of Wapm to Wasmer #3991

Merged
merged 3 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Or by building it inside the codebase:
cargo build --release --features "singlepass,cranelift"
```

> Note: installing `wasmer` via Cargo (or manual install) will not install
> the WAPM cli. If you want to use them together, please use the [wasmer installer](https://github.com/wasmerio/wasmer-install).


## Features

The Wasmer supports the following features:
Expand Down
6 changes: 3 additions & 3 deletions lib/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ use clap::{error::ErrorKind, CommandFactory, Parser};
)]
/// The options for the wasmer Command Line Interface
enum WasmerCLIOptions {
/// Login into a wapm.io-like registry
/// Login into a wasmer.io-like registry
Login(Login),

/// Login into a wapm.io-like registry
/// Login into a wasmer.io-like registry
#[clap(name = "publish")]
Publish(Publish),

Expand Down Expand Up @@ -152,7 +152,7 @@ enum WasmerCLIOptions {
/// Shows the current logged in user for the current active registry
Whoami(Whoami),

/// Add a WAPM package's bindings to your application.
/// Add a Wasmer package's bindings to your application.
Add(Add),

/// (unstable) Run a WebAssembly file or WEBC container.
Expand Down
8 changes: 4 additions & 4 deletions lib/cli/src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use anyhow::{Context, Error};
use clap::Parser;
use wasmer_registry::{Bindings, ProgrammingLanguage, WasmerConfig};

/// Add a WAPM package's bindings to your application.
/// Add a Wasmer package's bindings to your application.
#[derive(Debug, Parser)]
pub struct Add {
/// The registry to fetch bindings from.
#[clap(long, env = "WAPM_REGISTRY")]
#[clap(long, env = "WASMER_REGISTRY")]
registry: Option<String>,
/// Add the JavaScript bindings using "npm install".
#[clap(long, groups = &["bindings", "js"])]
Expand Down Expand Up @@ -57,7 +57,7 @@ impl Add {
}

fn lookup_bindings(&self, registry: &str) -> Result<Vec<Bindings>, Error> {
println!("Querying WAPM for package bindings");
println!("Querying Wasmer for package bindings");

let mut bindings_to_add = Vec::new();
let language = self.target()?.language();
Expand All @@ -79,7 +79,7 @@ impl Add {
WasmerConfig::get_wasmer_dir().map_err(|e| anyhow::anyhow!("{e}"))?;
let cfg = WasmerConfig::from_file(&wasmer_dir)
.map_err(Error::msg)
.context("Unable to load WAPM's config file")?;
.context("Unable to load Wasmer config file")?;
Ok(cfg.registry.get_current_registry())
}
}
Expand Down
12 changes: 6 additions & 6 deletions lib/cli/src/commands/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use wasmer_registry::WasmerConfig;
/// Subcommand for listing packages
#[derive(Debug, Clone, Parser)]
pub struct Login {
/// Registry to log into (default: wapm.io)
#[clap(long, default_value = "wapm.io")]
/// Registry to log into (default: wasmer.io)
#[clap(long, default_value = "wasmer.io")]
pub registry: String,
/// Login token
#[clap(name = "TOKEN")]
Expand Down Expand Up @@ -55,7 +55,7 @@ impl Login {
let wasmer_dir =
WasmerConfig::get_wasmer_dir().map_err(|e| anyhow::anyhow!("no wasmer dir: {e}"))?;
match wasmer_registry::login::login_and_save_token(&wasmer_dir, &self.registry, &token)? {
Some(s) => println!("Login for WAPM user {:?} saved", s),
Some(s) => println!("Login for Wasmer user {:?} saved", s),
None => println!(
"Error: no user found on registry {:?} with token {:?}. Token saved regardless.",
self.registry, token
Expand All @@ -68,17 +68,17 @@ impl Login {
#[test]
fn test_login_2() {
let login = Login {
registry: "wapm.dev".to_string(),
registry: "wasmer.wtf".to_string(),
token: None,
};

assert_eq!(
login.get_token_or_ask_user().unwrap(),
"Please paste the login token from https://wapm.dev/settings/access-tokens"
"Please paste the login token from https://wasmer.wtf/settings/access-tokens"
);

let login = Login {
registry: "wapm.dev".to_string(),
registry: "wasmer.wtf".to_string(),
token: Some("abc".to_string()),
};

Expand Down
8 changes: 4 additions & 4 deletions lib/cli/src/package_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ impl PackageSource {
#[test]
fn test_package_source() {
assert_eq!(
PackageSource::parse("registry.wapm.io/graphql/python/python").unwrap(),
PackageSource::File("registry.wapm.io/graphql/python/python".to_string()),
PackageSource::parse("registry.wasmer.io/graphql/python/python").unwrap(),
PackageSource::File("registry.wasmer.io/graphql/python/python".to_string()),
);

assert_eq!(
Expand Down Expand Up @@ -104,8 +104,8 @@ fn test_package_source() {
);

assert_eq!(
PackageSource::parse("https://wapm.io/syrusakbary/python").unwrap(),
PackageSource::Url(url::Url::parse("https://wapm.io/syrusakbary/python").unwrap()),
PackageSource::parse("https://wasmer.io/syrusakbary/python").unwrap(),
PackageSource::Url(url::Url::parse("https://wasmer.io/syrusakbary/python").unwrap()),
);

assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion lib/registry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wasmer-registry"
version = "5.0.0"
description = "Crate to interact with the wasmer registry (wapm.io), download packages, etc."
description = "Crate to interact with the wasmer registry, download packages, etc."
authors.workspace = true
edition.workspace = true
homepage.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion lib/registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The GraphQL API schema used for generating queries and mutations is located at
To update it to a deployed version of the backend, run:

```bash
npx get-graphql-schema https://registry.wapm.dev/graphql > graphql/schema.graphql
npx get-graphql-schema https://registry.wasmer.wtf/graphql > graphql/schema.graphql
```

### Formatting GraphQL Files
Expand Down
38 changes: 19 additions & 19 deletions lib/registry/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct WasmerConfig {
#[serde(default)]
pub update_notifications_enabled: bool,

/// The registry that wapm will connect to.
/// The registry that wasmer will connect to.
pub registry: MultiRegistry,

/// The proxy to use when connecting to the Internet.
Expand Down Expand Up @@ -53,7 +53,7 @@ pub struct RegistryLogin {
impl Default for MultiRegistry {
fn default() -> Self {
MultiRegistry {
active_registry: format_graphql("wapm.io"),
active_registry: format_graphql("wasmer.io"),
tokens: Vec::new(),
}
}
Expand All @@ -70,8 +70,8 @@ pub fn format_graphql(registry: &str) -> String {
// Looks like we've got a valid URL. Let's try to use it as-is.
if url.has_host() {
if url.path() == "/" {
// make sure we convert http://registry.wapm.io/ to
// http://registry.wapm.io/graphql
// make sure we convert http://registry.wasmer.io/ to
// http://registry.wasmer.io/graphql
url.set_path("/graphql");
}

Expand All @@ -89,8 +89,8 @@ pub fn format_graphql(registry: &str) -> String {
registry.to_string()
}

/// By convention, something like `"wapm.io"` should be converted to
/// `"https://registry.wapm.io/graphql"`.
/// By convention, something like `"wasmer.io"` should be converted to
/// `"https://registry.wasmer.io/graphql"`.
fn endpoint_from_domain_name(domain_name: &str) -> String {
if domain_name.contains("localhost") {
return format!("http://{domain_name}/graphql");
Expand Down Expand Up @@ -258,25 +258,25 @@ mod tests {
fn test_registries_switch_token() {
let mut registries = MultiRegistry::default();

registries.set_current_registry("https://registry.wapm.dev");
registries.set_current_registry("https://registry.wasmer.wtf");
assert_eq!(
registries.get_current_registry(),
"https://registry.wapm.dev/graphql".to_string()
"https://registry.wasmer.wtf/graphql".to_string()
);
registries.set_login_token_for_registry(
"https://registry.wapm.io",
"https://registry.wasmer.io",
"token1",
UpdateRegistry::LeaveAsIs,
);
assert_eq!(
registries.get_current_registry(),
"https://registry.wapm.dev/graphql".to_string()
"https://registry.wasmer.wtf/graphql".to_string()
);
assert_eq!(
registries.get_login_token_for_registry(&registries.get_current_registry()),
None
);
registries.set_current_registry("https://registry.wapm.io");
registries.set_current_registry("https://registry.wasmer.io");
assert_eq!(
registries.get_login_token_for_registry(&registries.get_current_registry()),
Some("token1".to_string())
Expand All @@ -292,21 +292,21 @@ mod tests {
fn format_registry_urls() {
let inputs = [
// Domain names work
("wapm.io", "https://registry.wapm.io/graphql"),
("wapm.dev", "https://registry.wapm.dev/graphql"),
("wasmer.io", "https://registry.wasmer.io/graphql"),
("wasmer.wtf", "https://registry.wasmer.wtf/graphql"),
// Plain URLs
(
"https://registry.wapm.dev/graphql",
"https://registry.wapm.dev/graphql",
"https://registry.wasmer.wtf/graphql",
"https://registry.wasmer.wtf/graphql",
),
(
"https://registry.wapm.dev/something/else",
"https://registry.wapm.dev/something/else",
"https://registry.wasmer.wtf/something/else",
"https://registry.wasmer.wtf/something/else",
),
// We don't automatically prepend the domain name with
// "registry", but we will make sure "/" gets turned into "/graphql"
("https://wapm.dev/", "https://wapm.dev/graphql"),
("https://wapm.dev", "https://wapm.dev/graphql"),
("https://wasmer.wtf/", "https://wasmer.wtf/graphql"),
("https://wasmer.wtf", "https://wasmer.wtf/graphql"),
// local development
(
"http://localhost:8000/graphql",
Expand Down
4 changes: 2 additions & 2 deletions lib/registry/src/graphql/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ pub fn maybe_set_up_proxy_blocking(

/// Tries to set up a proxy
///
/// This function reads from wapm config's `proxy.url` first, then checks
/// This function reads from wasmer config's `proxy.url` first, then checks
/// `ALL_PROXY`, `HTTPS_PROXY`, and `HTTP_PROXY` environment variables, in both
/// upper case and lower case, in that order.
///
/// If a proxy is specified in wapm config's `proxy.url`, it is assumed
/// If a proxy is specified in wasmer config's `proxy.url`, it is assumed
/// to be a general proxy
///
/// A return value of `Ok(None)` means that there was no attempt to set up a proxy,
Expand Down
8 changes: 4 additions & 4 deletions lib/registry/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! High-level interactions with the WAPM backend.
//! High-level interactions with the Wasmer backend.
//!
//! The GraphQL schema can be updated by running `make` in the Wasmer repo's
//! root directory.
//!
//! ```console
//! $ make update-graphql-schema
//! curl -sSfL https://registry.wapm.io/graphql/schema.graphql > lib/registry/graphql/schema.graphql
//! curl -sSfL https://registry.wasmer.io/graphql/schema.graphql > lib/registry/graphql/schema.graphql
//! ```

pub mod api;
Expand Down Expand Up @@ -140,7 +140,7 @@ pub enum GetIfPackageHasNewVersionResult {
}

/// Returns the download info of the packages, on error returns all the available packages
/// i.e. (("foo/python", "wapm.io"), ("bar/python" "wapm.io")))
/// i.e. (("foo/python", "wasmer.io"), ("bar/python" "wasmer.io")))
pub fn query_package_from_registry(
registry_url: &str,
name: &str,
Expand Down Expand Up @@ -417,7 +417,7 @@ pub fn get_all_available_registries(wasmer_dir: &Path) -> Result<Vec<String>, St
Ok(registries)
}

/// A library that exposes bindings to a WAPM package.
/// A library that exposes bindings to a Wasmer package.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Bindings {
/// A unique ID specifying this set of bindings.
Expand Down
2 changes: 1 addition & 1 deletion lib/registry/src/package/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ pub struct PersonalKey {
pub private_key_location: Option<String>,
/// The type of private/public key this is
pub key_type_identifier: String,
/// The time at which the key was registered with wapm
/// The time at which the key was registered with wasmer
pub date_created: OffsetDateTime,
}

Expand Down
2 changes: 1 addition & 1 deletion lib/registry/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn try_chunked_uploading(
}
SignArchiveResult::NoKeyRegistered => {
// TODO: uncomment this when we actually want users to start using it
//warn!("Publishing package without a verifying signature. Consider registering a key pair with wapm");
//warn!("Publishing package without a verifying signature. Consider registering a key pair with wasmer");
None
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi-web/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl WebRuntime {

let http_client = Arc::new(WebHttpClient { pool: pool.clone() });
let source = WapmSource::new(
WapmSource::WAPM_PROD_ENDPOINT.parse().unwrap(),
WapmSource::WASMER_PROD_ENDPOINT.parse().unwrap(),
http_client.clone(),
);

Expand Down
2 changes: 1 addition & 1 deletion lib/wasix-http-client/examples/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use wasix_http_client::{Body, HttpClient, RequestBuilder};
fn main() {
let c = HttpClient::new().unwrap();
let r = RequestBuilder::new()
.uri("http://ferris2.christoph.app.wapm.dev/http-client-test")
.uri("http://ferris2.christoph.app.wasmer.wtf/http-client-test")
.body(Body::empty())
.unwrap();
eprintln!("fetching: {r:?}");
Expand Down
12 changes: 6 additions & 6 deletions lib/wasix/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ pub enum SpawnError {
/// Failed during deserialization
#[error("deserialization failed")]
Deserialization,
/// Invalid WAPM process
#[error("invalid wapm")]
InvalidWapm,
/// Failed to fetch the WAPM process
/// Invalid Wasmer process
#[error("invalid wasmer")]
InvalidWasmer,
/// Failed to fetch the Wasmer process
#[error("fetch failed")]
FetchFailed,
/// Failed to compile the WAPM process
/// Failed to compile the Wasmer process
#[error("compile error")]
CompileError,
/// Invalid ABI
#[error("WAPM process has an invalid ABI")]
#[error("Wasmer process has an invalid ABI")]
InvalidABI,
/// Bad handle
#[error("bad handle")]
Expand Down
2 changes: 1 addition & 1 deletion lib/wasix/src/os/console/txt/about.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Wasmer Terminal

This terminal is an Wasmer powered terminal hosted in a browser which implements
a basic operating system and is natively integrated with ATE and WAPM.
a basic operating system and is natively integrated with ATE and Wasmer.

For more information try:

Expand Down
2 changes: 1 addition & 1 deletion lib/wasix/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl PluggableRuntime {
let mut source = MultiSource::new();
if let Some(client) = &http_client {
source.add_source(WapmSource::new(
WapmSource::WAPM_PROD_ENDPOINT.parse().unwrap(),
WapmSource::WASMER_PROD_ENDPOINT.parse().unwrap(),
client.clone(),
));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/wasix/src/runtime/package_loader/builtin_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ mod tests {
filesystem: Vec::new(),
},
dist: DistributionInfo {
webc: "https://wapm.io/python/python".parse().unwrap(),
webc: "https://wasmer.io/python/python".parse().unwrap(),
webc_sha256: [0xaa; 32].into(),
},
};
Expand Down
Loading