Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add proto v0.19 blog post. #1086

Merged
merged 5 commits into from
Sep 29, 2023
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
62 changes: 41 additions & 21 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ default-members = ["crates/cli"]

[workspace.dependencies]
async-trait = "0.1.73"
cached = "0.45.1"
cached = "0.46.0"
chrono = { version = "0.4.31", features = ["serde"] }
cd_env = "0.1.2"
ci_env = "0.2.1"
Expand All @@ -39,7 +39,7 @@ pathdiff = "0.2.1"
petgraph = { version = "0.6.4", default-features = false, features = [
"serde-1",
] }
proto_core = "0.18.6"
proto_core = "0.19.0"
relative-path = { version = "1.9.0", features = ["serde"] }
regex = "1.9.5"
reqwest = { version = "0.11.20", default-features = false, features = [
Expand Down
2 changes: 1 addition & 1 deletion crates/node/tool/src/node_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl Tool for NodeTool {
if setup || !self.tool.get_tool_dir().exists() {
print_checkpoint(format!("installing node {version}"), Checkpoint::Setup);

if self.tool.setup(version).await? {
if self.tool.setup(version, false).await? {
last_versions.insert("node".into(), version.to_owned());
installed += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/node/tool/src/npm_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Tool for NpmTool {

print_checkpoint(format!("installing npm {version}"), Checkpoint::Setup);

if self.tool.setup(version).await? {
if self.tool.setup(version, false).await? {
last_versions.insert("npm".into(), version.to_owned());
count += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/node/tool/src/pnpm_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl Tool for PnpmTool {

print_checkpoint(format!("installing pnpm {version}"), Checkpoint::Setup);

if self.tool.setup(version).await? {
if self.tool.setup(version, false).await? {
last_versions.insert("pnpm".into(), version.to_owned());
count += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/node/tool/src/yarn_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Tool for YarnTool {

print_checkpoint(format!("installing yarn {version}"), Checkpoint::Setup);

if self.tool.setup(version).await? {
if self.tool.setup(version, false).await? {
last_versions.insert("yarn".into(), version.to_owned());
count += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rust/tool/src/rust_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl Tool for RustTool {
if setup || !self.tool.get_tool_dir().exists() {
print_checkpoint(format!("installing rust {version}"), Checkpoint::Setup);

if self.tool.setup(version).await? {
if self.tool.setup(version, false).await? {
last_versions.insert("rust".into(), version.to_owned());
installed += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion nextgen/app/src/systems/startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub fn load_toolchain_config(workspace_root: StateRef<WorkspaceRoot>, resources:
);
}

let mut proto_tools = ToolsConfig::load(proto_path)?;
let mut proto_tools = ToolsConfig::load_from(workspace_root)?;
proto_tools.inherit_builtin_plugins();

let config = if config_path.exists() {
Expand Down
4 changes: 2 additions & 2 deletions nextgen/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use moon_common::consts;
use moon_config::{InheritedTasksManager, ToolchainConfig, WorkspaceConfig};
use moon_hash::HashEngine;
use moon_vcs::{BoxedVcs, Git};
use proto_core::{ProtoEnvironment, ToolsConfig, Version, TOOLS_CONFIG_NAME};
use proto_core::{ProtoEnvironment, ToolsConfig, Version};
use starbase::Resource;
use starbase_styles::color;
use starbase_utils::{dirs, fs};
Expand Down Expand Up @@ -176,7 +176,7 @@ impl Workspace {

// Load proto tools
let proto_env = ProtoEnvironment::new()?;
let mut proto_tools = ToolsConfig::load(root_dir.join(TOOLS_CONFIG_NAME))?;
let mut proto_tools = ToolsConfig::load_from(&root_dir)?;
proto_tools.inherit_builtin_plugins();

// Load configs
Expand Down
1 change: 1 addition & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#### 🚀 Updates

- Updated `moon dep-graph` to support a task in closest project, similar to `moon run`.
- Updated to proto v0.19.

#### 🐞 Fixes

Expand Down
78 changes: 78 additions & 0 deletions website/blog/2023-09-29_proto-v0.19.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
slug: proto-v0.19
title: proto v0.19 - Version pinning and outdated checks
authors: [milesj]
tags: [proto, pin, global, local, outdated]
image: ./img/proto/v0.18.png
---

In this release, we're improving version pinning and introducing a new command to check for outdated
versions.

<!--truncate-->

## New `proto pin` command (breaking)

Before our official v1 release, which is relatively soon, we'll be making some breaking changes with
the proto APIs. The first is the introduction of the new [`proto pin`](/docs/proto/commands/pin)
command, which replaces the previous `proto local` and `proto global` commands. We felt this was a
much cleaner change, and far easier to understand than the previous command names.

```shell
# v0.18
$ proto local go 1.20
$ proto global node 20

# v0.19+
$ proto pin go 1.20
$ proto pin node 20 --global
```

## New `pin-latest` setting

While we're on the subject of pinning versions, we've also introduced a new
[`pin-latest`](/docs/proto/config#pin-latest) setting. Do you want the latest version to always be
pinned? Do you forgot to pass `--pin` when installing? Do you forget to run the `proto global` or
`proto local` commands (now `proto pin`)? If you answered yes to any of these questions, then this
setting is for you.

When enabled, and a tool is installed with the "latest" version, the resolved version will
automatically be pinned to the configuration of your choice. For example, say we have the following
user config:

```toml title="~/.proto/config.toml"
pin-latest = "local"
```

And we run one of the following commands:

```shell
$ proto install go
$ proto install node latest
```

Then the resolved version of the tool will automatically be set to the `.prototools` file in the
current directory. Handy right?

## New `proto outdated` command

By request of the community, we're introducing yet another new command,
[`proto outdated`](/docs/proto/commands/outdated). If you're familiar with package managers, you can
probably guess what this command does! It'll check for newer available versions, for all tools
configured in the closest `.prototools` file. Very handy for keeping your tools up to date.

```
$ proto outdated

go - current version 1.20.2 (via ~1.20), newer version 1.20.8, update available!
node - current version 20.7.0 (via 20.7.0), latest version 20.8.0, update available!
```

## Other changes

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

- Added `PROTO_WASM_LOG` environment variable to toggle the logging of messages from Extism and WASM
plugins. Useful for debugging.
- Updated `proto install` to auto-clean stale plugins after a successful installation.
Binary file added website/blog/img/proto/v0.19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions website/docs/proto/commands/add-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
title: add-plugin
---

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

<VersionLabel version="0.16.0" header />

The `proto add-plugin <id> <locator>` (or `proto ap`) command will add the provided plugin ID and
locator string to the `[plugins]` section of the local (`.prototools`) or global
(`~/.proto/config.toml`) config file.
Expand Down
16 changes: 0 additions & 16 deletions website/docs/proto/commands/global.mdx

This file was deleted.

19 changes: 0 additions & 19 deletions website/docs/proto/commands/local.mdx

This file was deleted.

Loading