Skip to content

Commit

Permalink
docs: Add proto v0.44. (#1760)
Browse files Browse the repository at this point in the history
* Update commands.

* Add blog post.

* Update config.
  • Loading branch information
milesj authored Dec 26, 2024
1 parent 77a4ced commit 42314cc
Show file tree
Hide file tree
Showing 34 changed files with 312 additions and 126 deletions.
2 changes: 1 addition & 1 deletion packages/types/src/project-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

/* eslint-disable */

import type { PartialTaskConfig, PlatformType, TaskConfig } from './tasks-config';
import type { UnresolvedVersionSpec } from './toolchain-config';
import type { PartialTaskConfig, PlatformType, TaskConfig } from './tasks-config';

/** The task-to-task relationship of the dependency. */
export type DependencyType = 'cleanup' | 'required' | 'optional';
Expand Down
6 changes: 1 addition & 5 deletions packages/types/src/toolchain-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,8 @@ export interface PythonConfig {
/**
* Assumes only the root `requirements.txt` is used for dependencies.
* Can be used to support the "one version policy" pattern.
*
* @default true
*/
rootRequirementsOnly?: boolean;
rootRequirementsOnly: boolean;
/**
* Defines the virtual environment name, which will be created in the workspace root.
* Project dependencies will be installed into this.
Expand Down Expand Up @@ -665,8 +663,6 @@ export interface PartialPythonConfig {
/**
* Assumes only the root `requirements.txt` is used for dependencies.
* Can be used to support the "one version policy" pattern.
*
* @default true
*/
rootRequirementsOnly?: boolean | null;
/**
Expand Down
96 changes: 96 additions & 0 deletions website/blog/2024-12-25_proto-v0.44.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
slug: proto-v0.44
title: proto v0.44 - New terminal user interface and versions command
authors: [milesj]
tags: [terminal, console, ui, user, interface]
# image: ./img/proto/v0.44.png
---

import Image from '@site/src/components/Image';

Merry Christmas and happy holidays 🎄! In this release, we're introducing a new terminal user
interface.

<!--truncate-->

## New terminal output

We're excited to introduce new terminal outputs, also known as a terminal user interface (TUI), for
all commands! We stumbled upon the [iocraft](https://docs.rs/iocraft/latest/iocraft/) Rust crate,
which is a library for rendering terminal output using components and JSX-like syntax. As fans of
[React](https://react.dev/) and [Ink](https://github.com/vadimdemedes/ink), this felt like the
perfect opportunity to revisit all of our commands and implement a new interface unique to proto
(and moon in the future).

Here are some examples of this new output. A lot of it is still a work in progress and will be
tweaked going forward, but we're already impressed with what iocraft can achieve!

### Notices

<Image src={require('./img/proto/v0.44/notice-success.png')} width="90%" />
<Image src={require('./img/proto/v0.44/notice-caution.png')} width="90%" />

### Information

<Image src={require('./img/proto/v0.44/info-env.png')} width="90%" />
<Image src={require('./img/proto/v0.44/info-plugin.png')} width="90%" />

### Tables

<Image src={require('./img/proto/v0.44/table-outdated.png')} width="90%" />
<Image src={require('./img/proto/v0.44/table-search.png')} width="90%" />

### Prompts

<Image src={require('./img/proto/v0.44/confirm.png')} width="90%" />
<Image src={require('./img/proto/v0.44/select.png')} width="90%" />

### Progress

<Image src={require('./img/proto/v0.44/progress.png')} width="90%" />

## New `proto versions` command

After much feedback, we've decided to merge the `proto list` and `proto list-remote` commands into a
new command, [`proto versions`](/docs/proto/commands/versions). This command will list all versions
available for the provided tool, while also annotating which of those versions has been installed
locally.

This data can now be accessed as JSON by passing the `--json` flag.

```shel
$ proto versions node
...
22.0.0
22.1.0
22.2.0
22.3.0
22.4.0
22.4.1
22.5.0
22.5.1
22.6.0
22.7.0
22.8.0
22.9.0
22.10.0
22.11.0
22.12.0
23.0.0
23.1.0
23.2.0
23.3.0
23.4.0 - installed 12/19/24
23.5.0 - installed 12/25/24
```

## Other changes

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

- Added a `--yes` option to `proto outdated`, that skips confirmation prompts.
- Added a `--json` option to `proto clean`, to capture the cleaned result as JSON.
- Updated `proto clean` to accept a target in which to clean as the 1st argument. For example,
`proto clean cache`.
- Moved the `--json` and `--yes` options into global options.
Binary file added website/blog/img/proto/v0.44/confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/info-env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/info-plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/notice-caution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/notice-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/table-outdated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/blog/img/proto/v0.44/table-search.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/proto/commands/activate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ proto activate murex -> source
Generate the hook:

```shell
proto activate nu > ~/.config/nushell/proto-hook.nu
(proto activate nu) | save ~/.config/nushell/proto-hook.nu
```

Then add the following line to your `~/.config/nushell/config.nu` file.
Expand Down
2 changes: 0 additions & 2 deletions website/docs/proto/commands/alias.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ the location.

## Options

- `--global` (deprecated) - Pin to the global `~/.proto/.prototools` instead of the local
`./.prototools`.
- `--to` - [Location of `.prototools`](../config#locations) to update.
<VersionLabel version="0.41.0" />
23 changes: 12 additions & 11 deletions website/docs/proto/commands/clean.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@
title: clean
---

The `proto clean` command can be used to uninstall stale and unused tools or plugins. By default, it
will remove items that haven't been used in the last 30 days.
import VersionLabel from '@site/src/components/Docs/VersionLabel';

The `proto clean` command can be used to uninstall stale and unused tools, plugins, and more. By
default, it will remove items that haven't been used in the last 30 days.

```shell
$ proto clean
```

Furthermore, the command can be used to purge a tool, which will remove it entirely from proto, or
purge all downloaded plugins.
Furthermore, the command can be used to target a specific artifact type.

```shell
# Delete node from proto
$ proto clean --purge node

# Delete all plugins
$ proto clean --purge-plugins
$ proto clean plugins
```

### Arguments

- `[target]` - Type of target. Accepts `cache`, `plugins`, `temp`, or `tools`.
<VersionLabel version="0.44.0" />

### Options

- `--days` - Number of days before a tool is considered stale.
- `--purge` - Purge and delete the installed tool by ID (`~/.proto/tools/<id>`).
- `--purge-plugins` - Purge and delete all downloaded plugins (`~/.proto/plugins`).
- `--json` - Print the clean result in JSON format. <VersionLabel version="0.44.0" />
- `--yes` - Avoid and confirm all prompts.
6 changes: 4 additions & 2 deletions website/docs/proto/commands/debug/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ end.
```
$ proto debug config
~/.proto/.prototools
/Users/name/.proto/.prototools ───────────────────────────────────────────
node = "20.0.0"
npm = "bundled"
Expand All @@ -24,7 +25,8 @@ $ proto debug config
[settings]
auto-clean = false
Configuration
Final configuration ───────────────────────────────────────────────────────
node = "20.0.0"
npm = "bundled"
Expand Down
44 changes: 24 additions & 20 deletions website/docs/proto/commands/debug/env.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,32 @@ the store location, relevant file paths, and environment variables.
```
$ proto debug env
Store
Root: ~/.proto
Bins: ~/.proto/bin
Shims: ~/.proto/shims
Plugins: ~/.proto/plugins
Tools: ~/.proto/tools
Temp: ~/.proto/temp
Virtual:
/userhome - ~
/proto - ~/.proto
/workspace - ~/Projects/example
Configs:
- ~/Projects/example/.prototools
- ~/.proto/.prototools
Environment
Proto version: 0.26.0
Store ─────────────────────────────────────────────────────────────────────
Root: /Users/name/.proto
Bins: /Users/name/.proto/bin
Shims: /Users/name/.proto/shims
Plugins: /Users/name/.proto/plugins
Tools: /Users/name/.proto/tools
Temp: /Users/name/.proto/temp
Environment ───────────────────────────────────────────────────────────────
Proto version: 0.44.0
Operating system: macos
Architecture: arm64
Variables:
PROTO_HOME - ~/.proto
PROTO_VERSION - 0.26.0
Config sources:
- /Users/name/Projects/example/.prototools
- /Users/name/.proto/.prototools
Virtual paths:
/userhome = /Users/name
/proto = /Users/name/.proto
/cwd = /Users/name/Projects/example
Environment variables:
PROTO_APP_LOG = proto=info,schematic=info,starbase=info,warpgate=info,extism::pdk=info
PROTO_HOME = /Users/name/.proto
PROTO_OFFLINE_TIMEOUT = 750
PROTO_VERSION = 0.44.0
```

### Options
Expand Down
12 changes: 5 additions & 7 deletions website/docs/proto/commands/diagnose.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ maybe fix (depending on your usage of proto).
$ proto diagnose
Shell: zsh
Shell profile: ~/.zshrc
Shell profile: /Users/name/.zshrc
Errors
Issue: Bin directory (~/.proto/bin) was found BEFORE the shims directory (~/.proto/shims) on PATH
Resolution: Ensure the shims path comes before the bin path in your shell
Errors ────────────────────────────────────────────────────────────────────
Warnings
Issue: Missing PROTO_HOME environment variable (Will default to ~/.proto if not defined)
Resolution: Export PROTO_HOME="$HOME/.proto" from your shell
- Issue: Bin directory /Users/name/.proto/bin was found BEFORE the shims directory /Users/name/.proto/shims on PATH
Resolution: Ensure the shims path comes before the bin path in your shell
Comment: Runtime version detection will not work correctly unless shims are used
```

### Options
Expand Down
6 changes: 6 additions & 0 deletions website/docs/proto/commands/list-remote.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
title: list-remote
---

:::danger

This command was removed in v0.44, use [`proto versions`](./versions) instead!

:::

The `proto list-remote <tool>` (or `proto lsr`) command will list available versions by resolving
versions from the tool's remote release manifest.

Expand Down
6 changes: 6 additions & 0 deletions website/docs/proto/commands/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
title: list
---

:::danger

This command was removed in v0.44, use [`proto versions`](./versions) instead!

:::

The `proto list <tool>` (or `proto ls`) command will list installed versions by scanning the
manifest at `~/.proto/tools/<tool>/manifest.json` for possible versions.

Expand Down
14 changes: 10 additions & 4 deletions website/docs/proto/commands/outdated.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ configuration file in which the version has been configured.
```
$ proto outdated
Tool Current Newest Latest Config
deno 1.40.0 1.42.4 1.42.4 ~/.prototools
node 20.8.0 20.12.2 21.7.3 ~/.prototools
npm 10.1.0 10.5.2 10.5.2 ~/.prototools
╭───────────────────────────────────────────────────────────────────────╮
│ Tool Current Newest Latest Config │
│───────────────────────────────────────────────────────────────────────│
│ bun 1.1.42 1.1.42 1.1.42 /Users/name/.proto/.prototools │
│ node 23.5.0 23.5.0 23.5.0 /Users/name/.proto/.prototools │
│ npm 10.7.0 10.7.0 11.0.0 /Users/name/.proto/.prototools │
│ rust 1.83.0 1.83.0 1.83.0 /Users/name/.proto/.prototools │
│ yarn 3.6.3 3.8.7 4.5.1 /Users/name/.proto/.prototools │
╰───────────────────────────────────────────────────────────────────────╯
```

> By default, this command _does not_ check tools for versions pinned in the global
Expand All @@ -27,3 +32,4 @@ npm 10.1.0 10.5.2 10.5.2 ~/.prototools
- `--json` - Print the list in JSON format.
- `--latest` - When updating versions with `--update`, use the latest version instead of newest.
- `--update` - Update and write newest/latest versions to their respective configuration.
- `--yes` - Avoid and confirm all prompts. <VersionLabel version="0.44.0" />
2 changes: 0 additions & 2 deletions website/docs/proto/commands/pin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ the location.

### Options

- `--global` (deprecated) - Pin to the global `~/.proto/.prototools` instead of the local
`./.prototools`.
- `--resolve` - Resolve the version to a fully-qualified semantic version before pinning.
- `--to` - [Location of `.prototools`](../config#locations) to update.
<VersionLabel version="0.41.0" />
2 changes: 0 additions & 2 deletions website/docs/proto/commands/plugin/add.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ $ proto plugin add node "https://github.com/moonrepo/node-plugin/releases/latest

### Options

- `--global` (deprecated) - Add to the global `~/.proto/.prototools` instead of the local
`./.prototools`.
- `--to` - [Location of `.prototools`](../../config#locations) to update.
<VersionLabel version="0.41.0" />
Loading

0 comments on commit 42314cc

Please sign in to comment.