From f684706fdcdc7f5804b067d99821f978fd9e2369 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 22 Jan 2025 10:07:34 -0800 Subject: [PATCH] new: Add new built-in tools. (#704) --- CHANGELOG.md | 24 +++++++- Cargo.lock | 4 +- Cargo.toml | 2 +- README.md | 4 +- crates/cli/src/workflows/install_workflow.rs | 18 +++++- crates/cli/tests/plugins_test.rs | 61 +++++++++++++++++++ crates/cli/tests/run_test.rs | 20 ++++-- ...est__plugins__builtins__supports_moon.snap | 7 +++ ...est__plugins__builtins__supports_ruby.snap | 19 ++++++ ..._test__plugins__builtins__supports_uv.snap | 11 ++++ crates/cli/tests/utils.rs | 2 +- crates/core/src/flow/build.rs | 30 +++++++-- crates/core/src/proto_config.rs | 45 +++++++++++--- crates/core/tests/proto_config_test.rs | 2 +- package/src/api-types.ts | 56 ++++++++++++----- registry/data/built-in.json | 55 ++++++++++++++++- registry/data/third-party.json | 13 ---- 17 files changed, 318 insertions(+), 55 deletions(-) create mode 100644 crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_moon.snap create mode 100644 crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_ruby.snap create mode 100644 crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_uv.snap diff --git a/CHANGELOG.md b/CHANGELOG.md index cf7747da7..1153b881e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,12 @@ - [Bun](https://github.com/moonrepo/plugins/blob/master/tools/bun/CHANGELOG.md) - [Deno](https://github.com/moonrepo/plugins/blob/master/tools/deno/CHANGELOG.md) - [Go](https://github.com/moonrepo/plugins/blob/master/tools/go/CHANGELOG.md) +- [moon](https://github.com/moonrepo/plugins/blob/master/tools/moon/CHANGELOG.md) - [Node](https://github.com/moonrepo/plugins/blob/master/tools/node/CHANGELOG.md) +- [npm, pnpm, yarn](https://github.com/moonrepo/plugins/blob/master/tools/node-depman/CHANGELOG.md) - [Python](https://github.com/moonrepo/plugins/blob/master/tools/python/CHANGELOG.md) +- [uv](https://github.com/moonrepo/plugins/blob/master/tools/python_uv/CHANGELOG.md) +- [Ruby](https://github.com/moonrepo/plugins/blob/master/tools/ruby/CHANGELOG.md) - [Rust](https://github.com/moonrepo/plugins/blob/master/tools/rust/CHANGELOG.md) - [Schema (TOML, JSON, YAML)](https://github.com/moonrepo/plugins/blob/master/tools/internal-schema/CHANGELOG.md) @@ -14,15 +18,33 @@ #### 🚀 Updates +- Added new built-in tools: `moon`, `uv` (Python), and `ruby`. - Added a new interactive "build from source" flow for many built-in tools. - Added `--build` and `--no-build` to `proto install`. - - Supported for `deno`, `go`, `node`, `python`, and `ruby`. + - Supported for `deno`, `go`, `moon`, `node`, `python`, and `ruby`. - WASM API - Added a `build_instructions` plugin function for building from source, with associated structs and enums. - Added a `ToolMetadataOutput.default_install_strategy` field, which defaults to prebuilds. - Added a `ToolMetadataOutput.unstable` field, which can mark the tool as unstable. - Added a `ToolContext.temp_dir` field. +#### 🧩 Plugins + +- Added `moon_tool` v0.1. +- Added `python_uv_tool` v0.1. +- Added `ruby_tool` v0.1 (via `ruby-build`). +- Updated `bun_tool` to v0.14.1. +- Updated `deno_tool` to v0.14. + - Added build from source support. +- Updated `go_tool` to v0.15. + - Added build from source support. +- Updated `node_tool` to v0.14. + - Added build from source support. +- Updated `node_depman_tool` to v0.14.2. +- Updated `python_tool` to v0.13. + - Added build from source support (via `python-build`). +- Updated `rust_tool` to v0.12.1. + ## 0.44.7 #### 🚀 Updates diff --git a/Cargo.lock b/Cargo.lock index 1c68f7c17..14d7e8b5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3742,9 +3742,9 @@ dependencies = [ [[package]] name = "starbase_archive" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550327b4bb767734859d2bca7ed08ba362ac289fbf3fbf52ae54c41ce68f25a2" +checksum = "2ce12cbf3c33fd5376cddcab20c12309ca938f4320e35aa764a51f7a60df7669" dependencies = [ "binstall-tar", "bzip2", diff --git a/Cargo.toml b/Cargo.toml index 1f0534fcb..2a9ce3ffe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ serde_json = "1.0.137" sha2 = "0.10.8" shell-words = "1.1.0" starbase = { version = "0.9.9" } -starbase_archive = { version = "0.9.3", features = [ +starbase_archive = { version = "0.9.4", features = [ "gz", "miette", "tar-bz2", diff --git a/README.md b/README.md index 984e1868d..ff2ea7b5d 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,10 @@ proto is a pluggable next-generation version manager for multiple programming la - Bun - Deno - Go +- moon - Node (and npm, pnpm, yarn) -- Python +- Python (and uv) +- Ruby - Rust - ... [and more via plugins!](https://moonrepo.dev/docs/proto/tools) diff --git a/crates/cli/src/workflows/install_workflow.rs b/crates/cli/src/workflows/install_workflow.rs index 993f40240..b283b08af 100644 --- a/crates/cli/src/workflows/install_workflow.rs +++ b/crates/cli/src/workflows/install_workflow.rs @@ -5,13 +5,15 @@ use crate::telemetry::*; use crate::utils::tool_record::ToolRecord; use proto_core::flow::install::{InstallOptions, InstallPhase}; use proto_core::{PinLocation, UnresolvedVersionSpec, PROTO_PLUGIN_KEY}; -use proto_pdk_api::{InstallHook, InstallStrategy, SyncShellProfileInput, SyncShellProfileOutput}; +use proto_pdk_api::{ + InstallHook, InstallStrategy, Switch, SyncShellProfileInput, SyncShellProfileOutput, +}; use starbase_console::ui::{ProgressDisplay, ProgressReporter}; use starbase_console::utils::formats::format_duration; use starbase_shell::ShellType; use std::env; use std::time::{Duration, Instant}; -use tracing::debug; +use tracing::{debug, warn}; pub enum InstallOutcome { AlreadyInstalled, @@ -37,6 +39,18 @@ pub struct InstallWorkflow { impl InstallWorkflow { pub fn new(tool: ToolRecord, console: ProtoConsole) -> Self { + if tool.metadata.unstable.is_enabled() { + warn!( + "{} is currently unstable. {}", + tool.get_name(), + if let Switch::Message(msg) = &tool.metadata.unstable { + msg + } else { + "" + } + ); + } + Self { console, progress_reporter: ProgressReporter::default(), diff --git a/crates/cli/tests/plugins_test.rs b/crates/cli/tests/plugins_test.rs index b2a8800f4..2dcbba42a 100644 --- a/crates/cli/tests/plugins_test.rs +++ b/crates/cli/tests/plugins_test.rs @@ -221,6 +221,26 @@ mod plugins { ); } + #[test] + fn supports_moon() { + let sandbox = create_empty_proto_sandbox(); + + sandbox + .run_bin(|cmd| { + cmd.arg("install").arg("moon"); + }) + .success(); + + create_shim_command(sandbox.path(), "moon") + .arg("--version") + .assert() + .success(); + + assert_snapshot!( + fs::read_to_string(sandbox.path().join(".proto/shims/registry.json")).unwrap() + ); + } + #[test] fn supports_node() { let sandbox = create_empty_proto_sandbox(); @@ -352,6 +372,47 @@ mod plugins { ); } + #[test] + fn supports_uv() { + let sandbox = create_empty_proto_sandbox(); + + sandbox + .run_bin(|cmd| { + cmd.arg("install").arg("uv"); + }) + .success(); + + create_shim_command(sandbox.path(), "uv") + .arg("--version") + .assert() + .success(); + + assert_snapshot!( + fs::read_to_string(sandbox.path().join(".proto/shims/registry.json")).unwrap() + ); + } + + #[cfg(unix)] + #[test] + fn supports_ruby() { + let sandbox = create_empty_proto_sandbox(); + + sandbox + .run_bin(|cmd| { + cmd.arg("install").arg("ruby").arg("--yes"); + }) + .success(); + + create_shim_command(sandbox.path(), "ruby") + .arg("--version") + .assert() + .success(); + + assert_snapshot!( + fs::read_to_string(sandbox.path().join(".proto/shims/registry.json")).unwrap() + ); + } + #[test] fn supports_rust() { let sandbox = create_empty_proto_sandbox(); diff --git a/crates/cli/tests/run_test.rs b/crates/cli/tests/run_test.rs index 7bc1c9063..158d3e7ce 100644 --- a/crates/cli/tests/run_test.rs +++ b/crates/cli/tests/run_test.rs @@ -190,7 +190,10 @@ mod run { }) .success(); - assert.stdout(predicate::str::contains("installed")); + // Output on macos is truncated + if cfg!(not(target_os = "macos")) { + assert.stdout(predicate::str::contains("installed")); + } } #[test] @@ -209,7 +212,10 @@ mod run { }) .success(); - assert.stdout(predicate::str::contains("installed")); + // Output on macos is truncated + if cfg!(not(target_os = "macos")) { + assert.stdout(predicate::str::contains("installed")); + } env::remove_var("PROTO_AUTO_INSTALL"); } @@ -247,7 +253,10 @@ mod run { }) .success(); - assert.stdout(predicate::str::contains("Node.js 19.0.0 installed")); + // Output on macos is truncated + if cfg!(not(target_os = "macos")) { + assert.stdout(predicate::str::contains("Node.js 19.0.0 installed")); + } let assert = sandbox .run_bin(|cmd| { @@ -259,7 +268,10 @@ mod run { }) .success(); - assert.stdout(predicate::str::contains("Node.js 19.0.0 installed").not()); + // Output on macos is truncated + if cfg!(not(target_os = "macos")) { + assert.stdout(predicate::str::contains("Node.js 19.0.0 installed").not()); + } } #[test] diff --git a/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_moon.snap b/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_moon.snap new file mode 100644 index 000000000..9a2dff4e7 --- /dev/null +++ b/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_moon.snap @@ -0,0 +1,7 @@ +--- +source: crates/cli/tests/plugins_test.rs +expression: "fs::read_to_string(sandbox.path().join(\".proto/shims/registry.json\")).unwrap()" +--- +{ + "moon": {} +} diff --git a/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_ruby.snap b/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_ruby.snap new file mode 100644 index 000000000..71ff8cabd --- /dev/null +++ b/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_ruby.snap @@ -0,0 +1,19 @@ +--- +source: crates/cli/tests/plugins_test.rs +expression: "fs::read_to_string(sandbox.path().join(\".proto/shims/registry.json\")).unwrap()" +--- +{ + "bundle": { + "alt_bin": true, + "parent": "ruby" + }, + "gem": { + "alt_bin": true, + "parent": "ruby" + }, + "rake": { + "alt_bin": true, + "parent": "ruby" + }, + "ruby": {} +} diff --git a/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_uv.snap b/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_uv.snap new file mode 100644 index 000000000..b53f57798 --- /dev/null +++ b/crates/cli/tests/snapshots/plugins_test__plugins__builtins__supports_uv.snap @@ -0,0 +1,11 @@ +--- +source: crates/cli/tests/plugins_test.rs +expression: "fs::read_to_string(sandbox.path().join(\".proto/shims/registry.json\")).unwrap()" +--- +{ + "uv": {}, + "uvx": { + "alt_bin": true, + "parent": "uv" + } +} diff --git a/crates/cli/tests/utils.rs b/crates/cli/tests/utils.rs index 837e338f0..09354df93 100644 --- a/crates/cli/tests/utils.rs +++ b/crates/cli/tests/utils.rs @@ -47,7 +47,7 @@ fn apply_settings(sandbox: &mut Sandbox) { env.insert("PROTO_TEST", "true"); sandbox.settings.bin = "proto".into(); - sandbox.settings.timeout = 240; + sandbox.settings.timeout = 300; sandbox .settings diff --git a/crates/core/src/flow/build.rs b/crates/core/src/flow/build.rs index fe987e4df..5bc5eb887 100644 --- a/crates/core/src/flow/build.rs +++ b/crates/core/src/flow/build.rs @@ -16,6 +16,7 @@ use starbase_console::ui::{ }; use starbase_styles::color; use starbase_utils::{fs, net}; +use std::env; use std::path::{Path, PathBuf}; use std::process::Stdio; use system_env::{find_command_on_path, is_command_on_path, System}; @@ -49,6 +50,11 @@ impl StepManager<'_> { self.errors > 0 } + #[allow(dead_code)] + pub fn is_ci(&self) -> bool { + env::var("CI").is_ok_and(|v| !v.is_empty()) + } + pub fn render_header(&self, title: impl AsRef) -> miette::Result<()> { let title = title.as_ref(); @@ -294,19 +300,32 @@ pub async fn install_system_dependencies( func(InstallPhase::InstallDeps); }); - if let Some(mut index_args) = system + // In CI, like GitHub Actions, package manager commands + // need to be ran with sudo on Linux. Has to be a better way? + let wrap_with_sudo = |base_args| { + let mut args = vec![]; + #[cfg(target_os = "linux")] + if step.is_ci() { + args.push("sudo".to_string()); + } + args.extend(base_args); + args + }; + + if let Some(index_args) = system .get_update_index_command(!options.skip_prompts) .into_diagnostic()? { step.render_checkpoint("Updating package manager index")?; - exec_command(Command::new(index_args.remove(0)).args(index_args)).await?; + let mut args = wrap_with_sudo(index_args); + exec_command(Command::new(args.remove(0)).args(args)).await?; } let dep_configs = system.resolve_dependencies(&build.system_dependencies); if !dep_configs.is_empty() { - if let Some(mut install_args) = system + if let Some(install_args) = system .get_install_packages_command(&dep_configs, !options.skip_prompts) .into_diagnostic()? { @@ -324,7 +343,8 @@ pub async fn install_system_dependencies( step.prompt_continue("Install packages?").await?; - exec_command(Command::new(install_args.remove(0)).args(install_args)).await?; + let mut args = wrap_with_sudo(install_args); + exec_command(Command::new(args.remove(0)).args(args)).await?; } } @@ -730,7 +750,7 @@ pub async fn execute_instructions( "{prefix} Setting environment variable {key} to {value}", ))?; - std::env::set_var(key, value); + env::set_var(key, value); } }; } diff --git a/crates/core/src/proto_config.rs b/crates/core/src/proto_config.rs index 941650c4d..bc06bbcc4 100644 --- a/crates/core/src/proto_config.rs +++ b/crates/core/src/proto_config.rs @@ -306,7 +306,7 @@ impl ProtoConfig { pub fn builtin_proto_plugin(&self) -> PluginLocator { PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/proto_tool-v0.3.0/proto_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/proto_tool-v0.4.0/proto_tool.wasm".into() })) } @@ -320,7 +320,7 @@ impl ProtoConfig { self.plugins.insert( Id::raw("bun"), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/bun_tool-v0.14.0/bun_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/bun_tool-v0.14.1/bun_tool.wasm".into() })) ); } @@ -329,7 +329,7 @@ impl ProtoConfig { self.plugins.insert( Id::raw("deno"), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/deno_tool-v0.13.0/deno_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/deno_tool-v0.14.0/deno_tool.wasm".into() })) ); } @@ -338,7 +338,16 @@ impl ProtoConfig { self.plugins.insert( Id::raw("go"), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/go_tool-v0.14.0/go_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/go_tool-v0.15.0/go_tool.wasm".into() + })) + ); + } + + if !self.plugins.contains_key("moon") && is_allowed("moon") { + self.plugins.insert( + Id::raw("moon"), + PluginLocator::Url(Box::new(UrlLocator { + url: "https://github.com/moonrepo/plugins/releases/download/moon_tool-v0.1.0/moon_tool.wasm".into() })) ); } @@ -347,7 +356,7 @@ impl ProtoConfig { self.plugins.insert( Id::raw("node"), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/node_tool-v0.13.0/node_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/node_tool-v0.14.0/node_tool.wasm".into() })) ); } @@ -357,7 +366,7 @@ impl ProtoConfig { self.plugins.insert( Id::raw(depman), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/node_depman_tool-v0.14.1/node_depman_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/node_depman_tool-v0.14.2/node_depman_tool.wasm".into() })) ); } @@ -367,7 +376,25 @@ impl ProtoConfig { self.plugins.insert( Id::raw("python"), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/python_tool-v0.12.2/python_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/python_tool-v0.13.0/python_tool.wasm".into() + })) + ); + } + + if !self.plugins.contains_key("uv") && is_allowed("uv") { + self.plugins.insert( + Id::raw("uv"), + PluginLocator::Url(Box::new(UrlLocator { + url: "https://github.com/moonrepo/plugins/releases/download/python_uv_tool-v0.1.0/python_uv_tool.wasm".into() + })) + ); + } + + if !self.plugins.contains_key("ruby") && is_allowed("ruby") { + self.plugins.insert( + Id::raw("ruby"), + PluginLocator::Url(Box::new(UrlLocator { + url: "https://github.com/moonrepo/plugins/releases/download/ruby_tool-v0.1.0/ruby_tool.wasm".into() })) ); } @@ -376,7 +403,7 @@ impl ProtoConfig { self.plugins.insert( Id::raw("rust"), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/rust_tool-v0.12.0/rust_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/rust_tool-v0.12.1/rust_tool.wasm".into() })) ); } @@ -385,7 +412,7 @@ impl ProtoConfig { self.plugins.insert( Id::raw(SCHEMA_PLUGIN_KEY), PluginLocator::Url(Box::new(UrlLocator { - url: "https://github.com/moonrepo/plugins/releases/download/schema_tool-v0.16.2/schema_tool.wasm".into() + url: "https://github.com/moonrepo/plugins/releases/download/schema_tool-v0.16.3/schema_tool.wasm".into() })) ); } diff --git a/crates/core/tests/proto_config_test.rs b/crates/core/tests/proto_config_test.rs index e208aa4b0..b9dd15d47 100644 --- a/crates/core/tests/proto_config_test.rs +++ b/crates/core/tests/proto_config_test.rs @@ -586,7 +586,7 @@ builtin-plugins = true BuiltinPlugins::Enabled(true) ); - assert_eq!(config.builtin_plugins().len(), 11); + assert_eq!(config.builtin_plugins().len(), 14); } #[test] diff --git a/package/src/api-types.ts b/package/src/api-types.ts index 05d8ef97f..2fafc2f5c 100644 --- a/package/src/api-types.ts +++ b/package/src/api-types.ts @@ -75,6 +75,8 @@ export type PluginLocator = string; export interface ToolContext { /** The version of proto (the core crate) calling plugin functions. */ protoVersion?: string | null; + /** Virtual path to the tool's temporary directory. */ + tempDir: VirtualPath; /** Virtual path to the tool's installation directory. */ toolDir: VirtualPath; /** Current version. Will be a "latest" alias if not resolved. */ @@ -101,10 +103,21 @@ export interface ToolInventoryMetadata { versionSuffix?: string | null; } +/** Supported strategies for installing a tool. */ +export type InstallStrategy = 'build-from-source' | 'download-prebuilt'; + +export type Switch = boolean | string; + /** Output returned by the `register_tool` function. */ export interface ToolMetadataOutput { /** Schema shape of the tool's configuration. */ configSchema?: unknown | null; + /** + * Default strategy to use when installing a tool. + * + * @type {'build-from-source' | 'download-prebuilt'} + */ + defaultInstallStrategy?: InstallStrategy; /** Default alias or version to use as a fallback. */ defaultVersion?: UnresolvedVersionSpec | null; /** @@ -133,6 +146,8 @@ export interface ToolMetadataOutput { * @type {'command-line' | 'language' | 'dependency-manager' | 'version-manager'} */ type: PluginType; + /** Whether this plugin is unstable or not. */ + unstable?: Switch; } /** Output returned by the `detect_version_files` function. */ @@ -303,7 +318,7 @@ export interface LocateExecutablesOutput { /** * Relative directory path from the tool install directory in which * pre-installed executables can be located. This directory path - * will be used during `proto active`, but not for bins/shims. + * will be used during `proto activate`, but not for bins/shims. */ exesDir?: string | null; /** @@ -460,7 +475,7 @@ export interface ArchiveSource { /** Source code is located in a Git repository. */ export interface GitSource { /** The branch/commit/tag to checkout. */ - reference: string; + reference?: string | null; /** Include submodules during checkout. */ submodules?: boolean; type: 'git'; @@ -471,6 +486,17 @@ export interface GitSource { export type SourceLocation = ArchiveSource | GitSource; export type BuildInstruction = { + /** A builder and its parameters for installing the builder. */ + instruction: { + /** Main executable, relative from the source root. */ + exe: string; + /** The Git source location for the builder. */ + git: GitSource; + /** Unique identifier for this builder. */ + id: string; + }; + type: 'install-builder'; +} | { instruction: string; type: 'make-executable'; } | { @@ -489,20 +515,28 @@ export type BuildInstruction = { /** A command and its parameters to be executed as a child process. */ instruction: { /** List of arguments. */ - args: string[]; + args?: string[]; /** The binary on `PATH`. */ bin: string; + /** If the binary should reference a builder executable. */ + builder: boolean; /** The working directory. */ cwd?: string | null; /** Map of environment variables. */ env?: Record; }; type: 'run-command'; +} | { + instruction: [string, string]; + type: 'set-env-var'; }; export type BuildRequirement = { requirement: string; type: 'command-exists-on-path'; +} | { + requirement: [string, string, string | null]; + type: 'command-version'; } | { requirement: string; type: 'manual-intercept'; @@ -512,12 +546,6 @@ export type BuildRequirement = { } | { requirement: string; type: 'git-version'; -} | { - requirement: string; - type: 'python-version'; -} | { - requirement: string; - type: 'ruby-version'; } | { requirement: 'xcode-command-line-tools'; type: 'xcode-command-line-tools'; @@ -526,12 +554,12 @@ export type BuildRequirement = { type: 'windows-developer-mode'; }; -export type DependencyName = string | Record | string[]; - /** Package manager of the system environment. */ -export type SystemPackageManager = 'pkg' | 'pkgin' | 'apk' | 'apt' | 'dnf' | 'pacman' | 'yum' | 'brew' | 'choco' | 'scoop'; +export type SystemPackageManager = 'pkg' | 'pkgin' | 'apk' | 'apt' | 'dnf' | 'pacman' | 'yum' | 'brew' | 'choco' | 'scoop' | 'all'; -export type SystemDependency = string | string[] | { +export type DependencyName = string | Record | string[] | Record; + +export type SystemDependency = string | Record | string[] | Record | { /** Only install on this architecture. */ arch?: SystemArch | null; /** The dependency name or name(s) to install. */ @@ -544,7 +572,7 @@ export type SystemDependency = string | string[] | { sudo?: boolean; /** The version to install. */ version?: string | null; -} | Record; +}; /** Output returned by the `build_instructions` function. */ export interface BuildInstructionsOutput { diff --git a/registry/data/built-in.json b/registry/data/built-in.json index fccd20c59..07ee924ee 100644 --- a/registry/data/built-in.json +++ b/registry/data/built-in.json @@ -76,6 +76,19 @@ "~/go/bin" ] }, + { + "id": "moon", + "locator": "github://moonrepo/plugins/moon_tool", + "format": "wasm", + "name": "moon", + "description": "moon is a multi-language build system and codebase management tool.", + "author": "moonrepo", + "homepageUrl": "https://moonrepo.dev/moon", + "repositoryUrl": "https://github.com/moonrepo/plugins", + "bins": [ + "moon" + ] + }, { "id": "node", "locator": "github://moonrepo/plugins/node_tool", @@ -85,6 +98,7 @@ "author": "moonrepo", "homepageUrl": "https://nodejs.org/", "repositoryUrl": "https://github.com/moonrepo/plugins", + "devicon": "nodejs", "bins": [ "node" ], @@ -157,11 +171,12 @@ "id": "python", "locator": "github://moonrepo/plugins/python_tool", "format": "wasm", - "name": "Python (experimental)", + "name": "Python", "description": "Python is a high-level, general-purpose programming language.", "author": "moonrepo", "homepageUrl": "https://www.python.org/", "repositoryUrl": "https://github.com/moonrepo/plugins", + "devicon": "python", "bins": [ "python", "pip" @@ -176,6 +191,29 @@ "~/.proto/tools/python/x.x.x/install/bin" ] }, + { + "id": "ruby", + "locator": "github://moonrepo/plugins/ruby_tool", + "format": "wasm", + "name": "Ruby", + "description": "A dynamic, open source programming language with a focus on simplicity and productivity.", + "author": "moonrepo", + "homepageUrl": "https://www.ruby-lang.org/en/", + "repositoryUrl": "https://github.com/moonrepo/plugins", + "devicon": "ruby", + "bins": [ + "ruby", + "rake", + "gem", + "bundle" + ], + "detectionSources": [ + { + "file": ".ruby-version", + "url": "https://github.com/rbenv/rbenv" + } + ] + }, { "id": "rust", "locator": "github://moonrepo/plugins/rust_tool", @@ -185,6 +223,7 @@ "author": "moonrepo", "homepageUrl": "https://www.rust-lang.org/", "repositoryUrl": "https://github.com/moonrepo/plugins", + "devicon": "rust", "bins": [], "detectionSources": [ { @@ -200,6 +239,20 @@ "~/.cargo/bin" ] }, + { + "id": "uv", + "locator": "github://moonrepo/plugins/python_uv_tool", + "format": "wasm", + "name": "uv", + "description": "An extremely fast Python package and project manager.", + "author": "moonrepo", + "homepageUrl": "https://docs.astral.sh/uv", + "repositoryUrl": "https://github.com/astral-sh/uv", + "bins": [ + "uv", + "uvx" + ] + }, { "id": "yarn", "locator": "github://moonrepo/plugins/node_depman_tool", diff --git a/registry/data/third-party.json b/registry/data/third-party.json index a08301aaa..cf3c1bdce 100644 --- a/registry/data/third-party.json +++ b/registry/data/third-party.json @@ -681,19 +681,6 @@ "mockery" ] }, - { - "id": "moon", - "locator": "https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml", - "format": "toml", - "name": "moon", - "description": "moon is a multi-language build system and codebase management tool.", - "author": "moonrepo", - "homepageUrl": "https://moonrepo.dev/moon", - "repositoryUrl": "https://github.com/moonrepo/moon/blob/master/proto-plugin.toml", - "bins": [ - "moon" - ] - }, { "id": "ninja", "locator": "https://raw.githubusercontent.com/Phault/proto-toml-plugins/main/ninja/plugin.toml",