Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/android-visual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/evidence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/product-visual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 0 additions & 6 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5863,14 +5863,8 @@ struct LocalComposerRepository {
fn local_native_repository() -> Option<LocalComposerRepository> {
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")),
];
Expand Down
42 changes: 36 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,19 @@ fn run() -> Result<u8, CliError> {
));
}

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" {
Expand Down Expand Up @@ -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<PathBuf, CliError> {
let path = Path::new(script);
let metadata = fs::metadata(path).map_err(|source| CliError::ScriptUnavailable {
Expand Down Expand Up @@ -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 =
Expand Down
Loading