diff --git a/.github/workflows/plugin-cli-release.yml b/.github/workflows/plugin-cli-release.yml index 14f62b5ce3..a6b5ee26b4 100644 --- a/.github/workflows/plugin-cli-release.yml +++ b/.github/workflows/plugin-cli-release.yml @@ -7,9 +7,9 @@ on: workflow_dispatch: inputs: version: - description: "Plugin CLI version to publish, for example 0.1.4" + description: "Plugin CLI version to publish, for example 0.1.5" required: true - default: "0.1.4" + default: "0.1.5" npm-tag: description: "npm distribution tag" required: true diff --git a/packages/plugin-cli-darwin-arm64/package.json b/packages/plugin-cli-darwin-arm64/package.json index 8c2f077c2e..119c3e92ce 100644 --- a/packages/plugin-cli-darwin-arm64/package.json +++ b/packages/plugin-cli-darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@dbx-app/plugin-cli-darwin-arm64", - "version": "0.1.4", + "version": "0.1.5", "description": "Precompiled DBX Plugin CLI binary for darwin arm64", "license": "Apache-2.0", "repository": { diff --git a/packages/plugin-cli-darwin-x64/package.json b/packages/plugin-cli-darwin-x64/package.json index 0854f7b0f5..c711c759b9 100644 --- a/packages/plugin-cli-darwin-x64/package.json +++ b/packages/plugin-cli-darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@dbx-app/plugin-cli-darwin-x64", - "version": "0.1.4", + "version": "0.1.5", "description": "Precompiled DBX Plugin CLI binary for darwin x64", "license": "Apache-2.0", "repository": { diff --git a/packages/plugin-cli-linux-arm64-gnu/package.json b/packages/plugin-cli-linux-arm64-gnu/package.json index 8a85993444..dbc77917de 100644 --- a/packages/plugin-cli-linux-arm64-gnu/package.json +++ b/packages/plugin-cli-linux-arm64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@dbx-app/plugin-cli-linux-arm64-gnu", - "version": "0.1.4", + "version": "0.1.5", "description": "Precompiled DBX Plugin CLI binary for linux arm64", "license": "Apache-2.0", "repository": { diff --git a/packages/plugin-cli-linux-x64-gnu/package.json b/packages/plugin-cli-linux-x64-gnu/package.json index f11c6711a9..1d2ceada68 100644 --- a/packages/plugin-cli-linux-x64-gnu/package.json +++ b/packages/plugin-cli-linux-x64-gnu/package.json @@ -1,6 +1,6 @@ { "name": "@dbx-app/plugin-cli-linux-x64-gnu", - "version": "0.1.4", + "version": "0.1.5", "description": "Precompiled DBX Plugin CLI binary for linux x64", "license": "Apache-2.0", "repository": { diff --git a/packages/plugin-cli-win32-arm64/package.json b/packages/plugin-cli-win32-arm64/package.json index 573e4449ac..6b954862c9 100644 --- a/packages/plugin-cli-win32-arm64/package.json +++ b/packages/plugin-cli-win32-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@dbx-app/plugin-cli-win32-arm64", - "version": "0.1.4", + "version": "0.1.5", "description": "Precompiled DBX Plugin CLI binary for win32 arm64", "license": "Apache-2.0", "repository": { diff --git a/packages/plugin-cli-win32-x64/package.json b/packages/plugin-cli-win32-x64/package.json index 495beff12a..2f4288323a 100644 --- a/packages/plugin-cli-win32-x64/package.json +++ b/packages/plugin-cli-win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@dbx-app/plugin-cli-win32-x64", - "version": "0.1.4", + "version": "0.1.5", "description": "Precompiled DBX Plugin CLI binary for win32 x64", "license": "Apache-2.0", "repository": { diff --git a/packages/plugin-cli/package.json b/packages/plugin-cli/package.json index bd67cda3ee..d458aca809 100644 --- a/packages/plugin-cli/package.json +++ b/packages/plugin-cli/package.json @@ -1,6 +1,6 @@ { "name": "@dbx-app/plugin-cli", - "version": "0.1.4", + "version": "0.1.5", "description": "Create and package DBX plugins without compiling the DBX plugin CLI", "keywords": [ "cli", @@ -34,12 +34,12 @@ "prepublishOnly": "npm run build && npm test" }, "optionalDependencies": { - "@dbx-app/plugin-cli-darwin-arm64": "0.1.4", - "@dbx-app/plugin-cli-darwin-x64": "0.1.4", - "@dbx-app/plugin-cli-linux-arm64-gnu": "0.1.4", - "@dbx-app/plugin-cli-linux-x64-gnu": "0.1.4", - "@dbx-app/plugin-cli-win32-arm64": "0.1.4", - "@dbx-app/plugin-cli-win32-x64": "0.1.4" + "@dbx-app/plugin-cli-darwin-arm64": "0.1.5", + "@dbx-app/plugin-cli-darwin-x64": "0.1.5", + "@dbx-app/plugin-cli-linux-arm64-gnu": "0.1.5", + "@dbx-app/plugin-cli-linux-x64-gnu": "0.1.5", + "@dbx-app/plugin-cli-win32-arm64": "0.1.5", + "@dbx-app/plugin-cli-win32-x64": "0.1.5" }, "engines": { "node": ">=18.18.0" diff --git a/plugins/sdk/cli/Cargo.lock b/plugins/sdk/cli/Cargo.lock index ac36edf7ab..6a5fad5ad5 100644 --- a/plugins/sdk/cli/Cargo.lock +++ b/plugins/sdk/cli/Cargo.lock @@ -119,7 +119,7 @@ dependencies = [ [[package]] name = "dbx-plugin-cli" -version = "0.1.4" +version = "0.1.5" dependencies = [ "dbx-plugin-packager", "semver", diff --git a/plugins/sdk/cli/Cargo.toml b/plugins/sdk/cli/Cargo.toml index 8f174ce6e7..11ea28e1b6 100644 --- a/plugins/sdk/cli/Cargo.toml +++ b/plugins/sdk/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dbx-plugin-cli" -version = "0.1.4" +version = "0.1.5" edition = "2021" license = "Apache-2.0" description = "Scaffold and package DBX plugins" diff --git a/plugins/sdk/cli/src/lib.rs b/plugins/sdk/cli/src/lib.rs index d6e0cda4b9..f5e1ac16cf 100644 --- a/plugins/sdk/cli/src/lib.rs +++ b/plugins/sdk/cli/src/lib.rs @@ -1151,8 +1151,8 @@ fn build_go_backend( &work_file, format!( "go 1.22\n\nuse (\n\t{}\n\t{}\n)\n", - serde_json::to_string(&backend_directory.to_string_lossy()).map_err(|error| error.to_string())?, - serde_json::to_string(&sdk.to_string_lossy()).map_err(|error| error.to_string())? + serde_json::to_string(&go_work_path(&backend_directory)).map_err(|error| error.to_string())?, + serde_json::to_string(&go_work_path(&sdk)).map_err(|error| error.to_string())? ), ) .map_err(|error| error.to_string())?; @@ -1161,6 +1161,10 @@ fn build_go_backend( run_command(&mut command, "Go backend build") } +fn go_work_path(path: &Path) -> String { + path.to_string_lossy().replace('\\', "/") +} + fn run_command(command: &mut Command, label: &str) -> Result<(), String> { command.stdin(Stdio::inherit()).stdout(Stdio::inherit()).stderr(Stdio::inherit()); let status = command.status().map_err(|error| format!("Failed to start {label}: {error}"))?; @@ -1565,7 +1569,7 @@ fn keygen_usage() -> String { #[cfg(test)] mod tests { use std::io::Cursor; - use std::path::PathBuf; + use std::path::{Path, PathBuf}; use super::{ color_enabled_with, create_project, generate_signing_key_file, package_manifest, package_project, @@ -1584,6 +1588,11 @@ mod tests { assert!(!output.join(".dbx-dev/connections.json").exists()); } + #[test] + fn normalizes_go_work_paths_for_windows() { + assert_eq!(super::go_work_path(Path::new(r"C:\workspace\backend")), "C:/workspace/backend"); + } + #[test] fn enables_colors_only_for_supported_terminal_modes() { assert!(color_enabled_with(true, false, Some("xterm-256color"), None, None)); @@ -1825,7 +1834,7 @@ mod tests { let workflow = std::fs::read_to_string(directory.join(".github/workflows/plugin-release.yml")).unwrap(); assert!(!workflow.contains("signing-key-id")); assert!(!workflow.contains("DBX_PLUGIN_SIGNING_KEY")); - assert!(workflow.contains("plugin-cli-version: 0.1.4")); + assert!(workflow.contains("plugin-cli-version: 0.1.5")); assert!(!workflow.contains("sdk-ref:")); match template { diff --git a/plugins/sdk/cli/templates/common/github/plugin-release.yml b/plugins/sdk/cli/templates/common/github/plugin-release.yml index a364be4df9..13b2442062 100644 --- a/plugins/sdk/cli/templates/common/github/plugin-release.yml +++ b/plugins/sdk/cli/templates/common/github/plugin-release.yml @@ -15,4 +15,4 @@ jobs: package-command: dbx-plugin package . package-path: dist/*.dbxp metadata-path: dist/*.artifact.json - plugin-cli-version: 0.1.4 + plugin-cli-version: 0.1.5 diff --git a/plugins/sdk/cli/templates/frontend/github/plugin-release.yml b/plugins/sdk/cli/templates/frontend/github/plugin-release.yml index 03c7b6f9b7..05c3b78915 100644 --- a/plugins/sdk/cli/templates/frontend/github/plugin-release.yml +++ b/plugins/sdk/cli/templates/frontend/github/plugin-release.yml @@ -15,5 +15,5 @@ jobs: package-command: dbx-plugin package . package-path: dist/*.dbxp metadata-path: dist/*.artifact.json - plugin-cli-version: 0.1.4 + plugin-cli-version: 0.1.5 build-matrix: '{"include":[{"runner":"ubuntu-24.04","target":"universal"}]}' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db34eb5553..6725deeaa5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -356,22 +356,22 @@ importers: packages/plugin-cli: optionalDependencies: '@dbx-app/plugin-cli-darwin-arm64': - specifier: 0.1.4 + specifier: 0.1.5 version: link:../plugin-cli-darwin-arm64 '@dbx-app/plugin-cli-darwin-x64': - specifier: 0.1.4 + specifier: 0.1.5 version: link:../plugin-cli-darwin-x64 '@dbx-app/plugin-cli-linux-arm64-gnu': - specifier: 0.1.4 + specifier: 0.1.5 version: link:../plugin-cli-linux-arm64-gnu '@dbx-app/plugin-cli-linux-x64-gnu': - specifier: 0.1.4 + specifier: 0.1.5 version: link:../plugin-cli-linux-x64-gnu '@dbx-app/plugin-cli-win32-arm64': - specifier: 0.1.4 + specifier: 0.1.5 version: link:../plugin-cli-win32-arm64 '@dbx-app/plugin-cli-win32-x64': - specifier: 0.1.4 + specifier: 0.1.5 version: link:../plugin-cli-win32-x64 packages/plugin-cli-darwin-arm64: {}