diff --git a/.github/workflows/android-visual.yml b/.github/workflows/android-visual.yml index d484804..cc491ef 100644 --- a/.github/workflows/android-visual.yml +++ b/.github/workflows/android-visual.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 90 env: - PAM_NATIVE_COMMIT: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + PAM_NATIVE_COMMIT: dd486195a047471665d54fe9feb76b11a1391d87 PAM_PRODUCT_APPLICATION_ID: app.pam.productvisual steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ca00de..b707bd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v5 with: repository: push-in/pam-native - ref: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + ref: dd486195a047471665d54fe9feb76b11a1391d87 path: pam-native persist-credentials: false - name: Check out the pinned PAM Native plugin kit diff --git a/.github/workflows/evidence.yml b/.github/workflows/evidence.yml index bbb7ffc..c3d8956 100644 --- a/.github/workflows/evidence.yml +++ b/.github/workflows/evidence.yml @@ -59,7 +59,7 @@ jobs: uses: actions/checkout@v5 with: repository: push-in/pam-native - ref: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + ref: dd486195a047471665d54fe9feb76b11a1391d87 path: pam-native persist-credentials: false - uses: dtolnay/rust-toolchain@1.88.0 diff --git a/.github/workflows/ios-native.yml b/.github/workflows/ios-native.yml index e270e3b..8d49d59 100644 --- a/.github/workflows/ios-native.yml +++ b/.github/workflows/ios-native.yml @@ -54,7 +54,7 @@ jobs: uses: actions/checkout@v5 with: repository: push-in/pam-native - ref: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + ref: dd486195a047471665d54fe9feb76b11a1391d87 path: pam-native persist-credentials: false - name: Check out the iOS capability certification plugins diff --git a/.github/workflows/product-visual.yml b/.github/workflows/product-visual.yml index 42cfb52..e308567 100644 --- a/.github/workflows/product-visual.yml +++ b/.github/workflows/product-visual.yml @@ -74,7 +74,7 @@ jobs: --output "${evidence}/artifacts/product-visual-dark.json" - name: Seal and verify the portable evidence bundle env: - PAM_NATIVE_COMMIT: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + PAM_NATIVE_COMMIT: dd486195a047471665d54fe9feb76b11a1391d87 PAM_DESKTOP_COMMIT: c89ea15a78eb3509a8611e42302c867c3c09bbbf run: | evidence=product-visual-evidence diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3182e2a..775599b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v5 with: repository: push-in/pam-native - ref: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + ref: dd486195a047471665d54fe9feb76b11a1391d87 path: pam-native persist-credentials: false - uses: android-actions/setup-android@v4 @@ -145,7 +145,7 @@ jobs: uses: actions/checkout@v5 with: repository: push-in/pam-native - ref: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + ref: dd486195a047471665d54fe9feb76b11a1391d87 path: pam-native persist-credentials: false - uses: dtolnay/rust-toolchain@1.88.0 @@ -274,7 +274,7 @@ jobs: uses: actions/checkout@v5 with: repository: push-in/pam-native - ref: 5f42c2a5ba2c16bf4d487ee98de7b7eb4d90390a + ref: dd486195a047471665d54fe9feb76b11a1391d87 path: pam-native persist-credentials: false - uses: dtolnay/rust-toolchain@1.88.0 diff --git a/Cargo.lock b/Cargo.lock index 8ec3e96..6e73762 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -941,7 +941,7 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "pam" -version = "2.0.11" +version = "2.0.12" dependencies = [ "axum", "axum-server", diff --git a/Cargo.toml b/Cargo.toml index 0564a64..c2287f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pam" -version = "2.0.11" +version = "2.0.12" edition = "2024" rust-version = "1.88" description = "Pam — PHP, Always in Memory: a persistent PHP runtime powered by Rust and the Embed SAPI" diff --git a/src/commands.rs b/src/commands.rs index ca9f3f7..a96533f 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -5863,14 +5863,8 @@ struct LocalComposerRepository { fn local_native_repository() -> Option { let manifest_root = Path::new(env!("CARGO_MANIFEST_DIR")); let configured = std::env::var_os("PAM_NATIVE_PACKAGE_PATH").map(PathBuf::from); - let installed = std::env::current_exe().ok().and_then(|executable| { - executable - .parent() - .map(|binary| binary.join("../share/pam/native/packages/native")) - }); let candidates = [ configured, - installed, Some(manifest_root.join("pam-native/packages/native")), Some(manifest_root.join("../pam-native/packages/native")), ]; diff --git a/src/main.rs b/src/main.rs index d228b6e..67a06db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -266,13 +266,19 @@ fn run() -> Result { )); } - if let Some(context) = current_project() - && let Some(command) = project::registered_commands(&context) - .map_err(CliError::Commands)? + if let Some(context) = current_project() { + let commands = project::registered_commands(&context).map_err(CliError::Commands)?; + let requested = script_arg.to_string_lossy(); + let command_name = project_command_alias(context.kind, requested.as_ref()); + if command_name != requested { + eprintln!("PAM Native uses `pam dev`; forwarding `{requested}` to it."); + } + if let Some(command) = commands .into_iter() - .find(|command| command.name == script_arg.to_string_lossy()) - { - return run_registered_command(&executable, &context, &command, raw_args.collect()); + .find(|command| command.name == command_name) + { + return run_registered_command(&executable, &context, &command, raw_args.collect()); + } } if script_arg == "editor:install" { @@ -1414,6 +1420,14 @@ fn run_registered_command( } } +fn project_command_alias(kind: project::ProjectKind, requested: &str) -> &str { + if kind == project::ProjectKind::Native && matches!(requested, "serve" | "start") { + "dev" + } else { + requested + } +} + fn resolve_script(script: &OsStr) -> Result { let path = Path::new(script); let metadata = fs::metadata(path).map_err(|source| CliError::ScriptUnavailable { @@ -1612,6 +1626,22 @@ impl std::fmt::Display for CliError { mod tests { use super::*; + #[test] + fn native_server_commands_use_the_single_development_flow() { + assert_eq!( + project_command_alias(project::ProjectKind::Native, "serve"), + "dev" + ); + assert_eq!( + project_command_alias(project::ProjectKind::Native, "start"), + "dev" + ); + assert_eq!( + project_command_alias(project::ProjectKind::Api, "start"), + "start" + ); + } + #[test] fn post_dev_budget_removes_outputs_created_during_the_session() { let root =