Skip to content

Commit

Permalink
deps(proto): Upgrade to v0.23. (#1186)
Browse files Browse the repository at this point in the history
* First pass.

* Update commands.

* Add blog post.

* Update dep.

* Bump.
  • Loading branch information
milesj authored Nov 16, 2023
1 parent fc45a54 commit 6ebe5f8
Show file tree
Hide file tree
Showing 31 changed files with 373 additions and 225 deletions.
9 changes: 9 additions & 0 deletions .yarn/versions/8e4c715c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@moonrepo/cli": patch
"@moonrepo/core-linux-arm64-gnu": patch
"@moonrepo/core-linux-arm64-musl": patch
"@moonrepo/core-linux-x64-gnu": patch
"@moonrepo/core-linux-x64-musl": patch
"@moonrepo/core-macos-arm64": patch
"@moonrepo/core-macos-x64": patch
"@moonrepo/core-windows-x64-msvc": patch
8 changes: 4 additions & 4 deletions 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
Expand Up @@ -38,7 +38,7 @@ pathdiff = "0.2.1"
petgraph = { version = "0.6.4", default-features = false, features = [
"serde-1",
] }
proto_core = "0.22.5"
proto_core = "0.23.1"
relative-path = { version = "1.9.0", features = ["serde"] }
regex = "1.10.2"
reqwest = { version = "0.11.22", default-features = false, features = [
Expand Down
8 changes: 1 addition & 7 deletions nextgen/config/src/toolchain/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,6 @@ impl NodeConfig {
}

self.inherit_proto_yarn(proto_tools)?;

if let Some(yarn) = &mut self.yarn {
yarn.plugin = Some(PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.1/node_depman_plugin.wasm".into()
});
}
}
};

Expand All @@ -225,7 +219,7 @@ impl NodeConfig {

if self.plugin.is_none() {
self.plugin = Some(PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.0/node_plugin.wasm".into()
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_plugin.wasm".into()
});
}

Expand Down
12 changes: 6 additions & 6 deletions nextgen/config/tests/toolchain_config_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ node:
assert_eq!(
config.node.unwrap().plugin.unwrap(),
PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.0/node_plugin.wasm".into()
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_plugin.wasm".into()
}
);
}
Expand Down Expand Up @@ -322,7 +322,7 @@ node:
assert_eq!(
config.node.unwrap().npm.plugin.unwrap(),
PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.0/node_depman_plugin.wasm".into()
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_depman_plugin.wasm".into()
}
);
}
Expand Down Expand Up @@ -413,7 +413,7 @@ node:
assert_eq!(
config.node.unwrap().pnpm.unwrap().plugin.unwrap(),
PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.0/node_depman_plugin.wasm".into()
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_depman_plugin.wasm".into()
}
);
}
Expand All @@ -437,7 +437,7 @@ node:
assert_eq!(
config.node.unwrap().pnpm.unwrap().plugin.unwrap(),
PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.0/node_depman_plugin.wasm".into()
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_depman_plugin.wasm".into()
}
);
}
Expand Down Expand Up @@ -537,7 +537,7 @@ node:
assert_eq!(
config.node.unwrap().yarn.unwrap().plugin.unwrap(),
PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.1/node_depman_plugin.wasm".into()
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_depman_plugin.wasm".into()
}
);
}
Expand All @@ -561,7 +561,7 @@ node:
assert_eq!(
config.node.unwrap().yarn.unwrap().plugin.unwrap(),
PluginLocator::SourceUrl {
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.1/node_depman_plugin.wasm".into()
url: "https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_depman_plugin.wasm".into()
}
);
}
Expand Down
4 changes: 2 additions & 2 deletions website/blog/2023-07-21_proto-v0.13.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bun = "github:moonrepo/bun-plugin"

With the advent of plugins, we thought it would be nice to know which plugins are actually
configured and in use, without having to manually search config files across the file system, and as
such, have added a new [`proto plugins`](/docs/proto/commands/plugins) command.
such, have added a new [`proto plugins`](/docs/proto/commands/tool/list-plugins) command.

This command is simple. It will list all plugins that are currently configured for the current
project, by loading all `.prototools` files up the tree, and loading the user
Expand All @@ -75,7 +75,7 @@ go - Go
Tag: latest
```

[Learn more about this new command!](/docs/proto/commands/plugins)
[Learn more about this new command!](/docs/proto/commands/tool/list-plugins)

## Other changes

Expand Down
4 changes: 2 additions & 2 deletions website/blog/2023-09-04_proto-v0.16.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ This release adds functionality for managing plugins and purging the proto store

Now that proto has fully embraced a plugin based architecture, we thought it'd be nice to support
the management of these plugins through the CLI. This release adds two new commands:
[`proto add-plugin`](/docs/proto/commands/add-plugin) and
[`proto remove-plugin`](/docs/proto/commands/remove-plugin).
[`proto add-plugin`](/docs/proto/commands/tool/add) and
[`proto remove-plugin`](/docs/proto/commands/tool/remove).

Adding a plugin requires a unique ID and what we call a locator, which is a string that dictates
where to locate and download the plugin from. Here's an example for Node.js, but this isn't
Expand Down
4 changes: 2 additions & 2 deletions website/blog/2023-09-18_proto-v0.18.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Today we've got a small release that includes some helpful features.

Are you curious what tools you have installed? And more specifically, which versions? What about
configured aliases? Until now, you had to manually check the `~/.proto/tools` directory for this
information, but now, you can simply run [`proto tools`](/docs/proto/commands/tools) to get a list
of all installed tools.
information, but now, you can simply run [`proto tools`](/docs/proto/commands/tool/list) to get a
list of all installed tools.

This command will list all tools that have been installed, along with their installed versions,
relevant timestamps, available aliases, and store location.
Expand Down
81 changes: 81 additions & 0 deletions website/blog/2023-11-16_proto-v0.23.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
slug: proto-v0.23
title: proto v0.23 - New detection strategy, tool commands, and more
authors: [milesj]
tags: [proto]
image: ./img/proto/v0.23.png
---

With this release, we've reorganized our commands, improved version detection, and Windows support.

<!--truncate-->

## New `detect-strategy` setting

Up until now, when proto would attempt to detect a version, it would use a version from the closest
`.prototools` file, or tool specific file (`package.json`, `.nvmrc`, etc), which ever matched first.
For the most part, this works great, but what if you wanted `.prototools` to take precedence over
other files, even if found in a higher parent directory? You unfortunately couldn't.

To support this new flow, we're introducing a new
[`~/.proto/config.toml`](/docs/proto/config#user-configuration) setting called
[`detect-strategy`](/docs/proto/config#detect-strategy). This setting supports the following values,
with more possibly in the future!

- `first-available` (default) - Will use the first available version that is found. Either from
`.prototools` or a tool specific file.
- `prefer-prototools` - Prefer a `.prototools` version, even if found in a parent directory. If none
found, falls back to tool specific file.

```toml title="~/.proto/config.toml"
detect-strategy = "prefer-prototools"
```

## New `proto tool` command group (breaking)

Our CLI surface area has been growing and we felt it was time to start grouping commands, starting
with the new [`proto tool`](/docs/proto/commands/tool) command. This command will contain "not used
very often" subcommands in relation to tools and their plugins, primarily for managing plugins, and
viewing tool information and inventory. As such, we've deprecated and moved the following top-level
commands:

- Moved `proto add-plugin` to `proto tool add`.
- Moved `proto remove-plugin` to `proto tool remove`.
- Moved `proto plugins` to `proto tool list-plugins`.
- Moved `proto tools` to `proto tool list`.

## New `proto tool info` command

Continuing with the changes above, we're also introducing a new command,
[`proto tool info`](/docs/proto/commands/tool/info), which displays detailed information about a
tool and its backing plugin. For example:

```
$ proto tool info node

node - Node.js

Inventory
Store: ~/.proto/tools/node
Executable: ~/.proto/tools/node/20.0.0/bin/node
Globals directory: ~/.proto/tools/node/globals/bin
Binaries:
- ~/.proto/bin/node (primary)
Shims:
- ~/.proto/shims/node (primary)

Plugin
Version: 0.5.2
Source: https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_plugin.wasm
```

> This command also supports JSON output via `--json`.

## Other changes

View the [official release](https://github.com/moonrepo/proto/releases/tag/v0.23.0) for a full list
of changes.

- Added support to plugins to ignore certain paths when detecting a version.
- Updated Windows to create 3 shim files for each tool: `.cmd` (cmd.exe), `.ps1` (powershell), and
no extension (bash).
Binary file added website/blog/img/proto/v0.23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion website/docs/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ moon can be installed and managed in [proto's toolchain](/proto) using a TOML pl
install moon to `~/.proto/tools/moon` and make the binary available at `~/.proto/bin`.

```shell
proto add-plugin moon "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
proto tool add moon "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
proto install moon
```

Expand Down
26 changes: 0 additions & 26 deletions website/docs/proto/commands/add-plugin.mdx

This file was deleted.

3 changes: 2 additions & 1 deletion website/docs/proto/commands/bin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ $ proto bin node 16.10.0

### Options

- `--shim` - When applicable, return an absolute path to a tool's local shim file.
- `--bin` - When applicable, return the `~/.proto/bin` path.
- `--shim` - When applicable, return the `~/.proto/shims` path.
24 changes: 0 additions & 24 deletions website/docs/proto/commands/remove-plugin.mdx

This file was deleted.

27 changes: 27 additions & 0 deletions website/docs/proto/commands/tool/add.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: tool add
sidebar_label: add
---

import VersionLabel from '@site/src/components/Docs/VersionLabel';

<VersionLabel version="0.23.0" header />

The `proto tool add <id> <plugin>` command (formerly `proto add-plugin`) will add the provided ID
and plugin locator string to the `[plugins]` section of the local (`.prototools`) or global
(`~/.proto/config.toml`) config file.

```shell
$ proto tool add node "source:https://github.com/moonrepo/node-plugin/releases/latest/download/node_plugin.wasm"
```

> Learn more about [plugin locator strings](../../plugins#enabling-plugins).
### Arguments

- `<id>` - ID of the tool.
- `<plugin>` - How to locate the plugin.

### Options

- `--global` - Add to the global config instead of local.
37 changes: 37 additions & 0 deletions website/docs/proto/commands/tool/info.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: tool info
sidebar_label: info
---

import VersionLabel from '@site/src/components/Docs/VersionLabel';

<VersionLabel version="0.23.0" header />

The `proto tool info <id>` command will display information about a tool and its plugin.

```
$ proto tool info node
node - Node.js
Inventory
Store: ~/.proto/tools/node
Executable: ~/.proto/tools/node/20.0.0/bin/node
Globals directory: ~/.proto/tools/node/globals/bin
Binaries:
- ~/.proto/bin/node (primary)
Shims:
- ~/.proto/shims/node (primary)
Plugin
Version: 0.5.2
Source: https://github.com/moonrepo/node-plugin/releases/download/v0.5.2/node_plugin.wasm
```

### Arguments

- `<id>` - ID of tool.

### Options

- `--json` - Print the info in JSON format.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
title: plugins
title: tool list-plugins
sidebar_label: list-plugins
---

import VersionLabel from '@site/src/components/Docs/VersionLabel';

<VersionLabel version="0.14.0" header />
<VersionLabel version="0.23.0" header />

The `proto plugins` command will list all available and configured plugins. Will load all
`.prototools` traversing upwards, and the `~/.proto/config.toml` file.
The `proto tool list-plugins` command (formerly `proto plugins`) will list all available and
configured plugins, for both third-party and built-in tools. Will load all `.prototools` traversing
upwards, and the `~/.proto/config.toml` file.

```
$ proto plugins
$ proto tool list-plugins
bun - Bun v1.2
Source: https://github.com/moonrepo/bun-plugin/releases/latest/download/bun_plugin.wasm
Expand Down
Loading

0 comments on commit 6ebe5f8

Please sign in to comment.