Skip to content

Commit

Permalink
docs: Add proto v0.34 blog post. (#1440)
Browse files Browse the repository at this point in the history
* Update commands.

* Fix examples.

* Add blog post.

* Update deps.

* Fixes.

* Updaate packages.

* Fix build.

* Bump version.

* Fixes.

* Fix schemas.
  • Loading branch information
milesj authored Apr 19, 2024
1 parent b452f11 commit 557c0a0
Show file tree
Hide file tree
Showing 40 changed files with 4,389 additions and 4,094 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/target
node_modules/
.nx

# Yarn
.yarn/*
Expand All @@ -26,6 +27,7 @@ dist/
*.map
*.min.js
*.tsbuildinfo
tailwind.config.d.ts

# moon
.moon/cache
Expand Down
2 changes: 1 addition & 1 deletion .moon/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ node:
version: '20.8.0'
packageManager: 'yarn'
yarn:
version: '4.0.2'
version: '4.1.1'
addEnginesConstraint: false
inferTasksFromScripts: false

Expand Down
5 changes: 0 additions & 5 deletions .yarn/releases/declined.txt

This file was deleted.

672 changes: 336 additions & 336 deletions .yarn/releases/yarn-4.0.2.cjs → .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions .yarn/versions/ddbe3bd8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
releases:
"@moonrepo/nx-compat": patch
"@moonrepo/report": patch
"@moonrepo/runtime": patch
"@moonrepo/types": patch
"@moonrepo/visualizer": patch

declined:
- "@moonrepo/cli"
- website
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ npmScopes:
npmAuthToken: 23F99634-A6B0-4362-BB2B-7163253D741D
npmRegistryServer: "https://npm.fontawesome.com"

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
4 changes: 2 additions & 2 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 @@ -51,7 +51,7 @@ reqwest = { version = "0.12.3", default-features = false, features = [
"native-tls-vendored",
] }
rustc-hash = "1.1.0"
schematic = { version = "0.15.0", default-features = false, features = [
schematic = { version = "0.15.1", default-features = false, features = [
"schema",
] }
semver = "1.0.22"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "moon",
"private": true,
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.1.1",
"scripts": {
"moon": "target/debug/moon --log trace",
"type": "target/debug/moon --log trace run :typecheck",
Expand All @@ -16,17 +16,17 @@
},
"devDependencies": {
"@moonrepo/cli": "workspace:*",
"@types/node": "^18.19.9",
"babel-preset-moon": "^2.0.14",
"@types/node": "^20.12.7",
"babel-preset-moon": "^3.0.1",
"eslint": "^8.57.0",
"eslint-config-moon": "^2.1.1",
"eslint-config-moon": "^3.1.0",
"execa": "^6.1.0",
"jest": "^29.7.0",
"jest-preset-moon": "^2.0.7",
"packemon": "^3.2.3",
"jest-preset-moon": "^3.0.0",
"packemon": "^4.0.1",
"prettier": "^3.2.5",
"prettier-config-moon": "^1.1.2",
"tsconfig-moon": "^1.3.0",
"typescript": "5.3.3"
"typescript": "^5.4.5"
}
}
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"postinstall": "node ./postinstall.js"
},
"dependencies": {
"detect-libc": "^2.0.2"
"detect-libc": "^2.0.3"
},
"optionalDependencies": {
"@moonrepo/core-linux-arm64-gnu": "1.24.1",
Expand Down
18 changes: 7 additions & 11 deletions packages/nx-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,27 @@
}
},
"dependencies": {
"@boost/common": "^5.0.0-alpha.1",
"@boost/common": "^5.0.0",
"@moonrepo/types": "workspace:^",
"enhanced-resolve": "^5.15.0",
"enhanced-resolve": "^5.16.0",
"execa": "^8.0.1",
"yargs-parser": "^21.1.1"
},
"devDependencies": {
"nx": "^18.0.4"
"nx": "^18.3.2"
},
"engines": {
"node": ">=16.12.0"
},
"exports": {
"./package.json": "./package.json",
".": {
"node": {
"types": "./mjs/index.d.ts",
"import": "./mjs/index.mjs"
}
"types": "./mjs/index.d.ts",
"import": "./mjs/index.mjs"
},
"./*": {
"node": {
"types": "./mjs/*.d.ts",
"import": "./mjs/*.mjs"
}
"types": "./mjs/*.d.ts",
"import": "./mjs/*.mjs"
}
}
}
8 changes: 3 additions & 5 deletions packages/report/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@
"exports": {
"./package.json": "./package.json",
".": {
"node": {
"types": "./cjs/index.d.ts",
"import": "./cjs/index-wrapper.mjs",
"require": "./cjs/index.cjs"
}
"types": "./cjs/index.d.ts",
"import": "./cjs/index-wrapper.mjs",
"default": "./cjs/index.cjs"
}
}
}
8 changes: 3 additions & 5 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@
"exports": {
"./package.json": "./package.json",
".": {
"node": {
"types": "./cjs/index.d.ts",
"import": "./cjs/index-wrapper.mjs",
"require": "./cjs/index.cjs"
}
"types": "./cjs/index.d.ts",
"import": "./cjs/index-wrapper.mjs",
"default": "./cjs/index.cjs"
}
}
}
8 changes: 3 additions & 5 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@
"exports": {
"./package.json": "./package.json",
".": {
"node": {
"types": "./cjs/index.d.ts",
"import": "./cjs/index-wrapper.mjs",
"require": "./cjs/index.cjs"
}
"types": "./cjs/index.d.ts",
"import": "./cjs/index-wrapper.mjs",
"default": "./cjs/index.cjs"
}
}
}
18 changes: 9 additions & 9 deletions packages/visualizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
"build": "vite build"
},
"dependencies": {
"cytoscape": "^3.28.1",
"cytoscape": "^3.29.0",
"cytoscape-dagre": "^2.5.0",
"cytoscape-klay": "^3.1.4",
"preact": "^10.19.3"
"preact": "^10.20.2"
},
"devDependencies": {
"@preact/preset-vite": "^2.7.0",
"@types/cytoscape": "^3.19.16",
"@preact/preset-vite": "^2.8.2",
"@types/cytoscape": "^3.21.0",
"@types/cytoscape-dagre": "^2.3.3",
"@types/cytoscape-klay": "^3.1.4",
"autoprefixer": "^10.4.16",
"autoprefixer": "^10.4.19",
"eslint-config-preact": "^1.3.0",
"postcss": "^8.4.32",
"tailwindcss": "^3.4.1",
"vite": "^4.5.1",
"vite-plugin-css-injected-by-js": "^3.3.1"
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"vite": "^5.2.9",
"vite-plugin-css-injected-by-js": "^3.5.0"
},
"eslint": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion packages/visualizer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"include": [
"src/**/*",
"vite.config.ts",
"vite.config.mjs",
"*.cjs"
]
}
File renamed without changes.
90 changes: 90 additions & 0 deletions website/blog/2024-04-07_proto-v0.34.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
slug: proto-v0.34
title: proto v0.34 - New detection strategy, status command, and outdated improvements
authors: [milesj]
tags: [detection, status, outdated]
# image: ./img/proto/v0.26.png
---

In this release, we've focused on the developer experience for common workflows.

<!--truncate-->

## New `only-prototools` detection strategy

proto currently detects versions at runtime using
[1 of 2 strategies](/docs/proto/config#detect-strategy), `first-available` which checks
`.prototools` files and tool-specific files (like `package.json` engines), whichever is first, or
`prefer-prototools` which works like the previous strategy, but prefers `.prototools` (even in a
parent directory).

In this release, we're adding a 3rd strategy called `only-prototools`. This strategy will only check
`.prototools` files and will not check tool-specific files. This is useful if you want explicit
versions, and to avoid unexpected versions from random configs/directories.

```toml title=".prototools"
[settings]
detect-strategy = "only-prototools"
```

> For the v1 release, we plan to make this strategy the new default.

## New `proto status` command

Sometimes you simply want to know what tools are currently active for a target directory, what
versions those tools are resolved to, and the configuration file in which they are defined. To
satisfy this requirement, we've added a new [`proto status`](/docs/proto/commands/status) command,
which outputs something like the following:

```
$ proto status
Tool Configured Resolved Installed Config
deno 1.40.0 1.40.0 ~/.proto/tools/deno/1.40.0 ~/.prototools
node 20.8.0 20.8.0 ~/.proto/tools/node/20.8.0 ~/.prototools
npm 10.1.0 10.1.0 ~/.proto/tools/npm/10.1.0 ~/.prototools
```

By default this includes tools from all `.prototools` files up the hierarchy, excluding
`~/.proto/.prototools`. To include global tools as well, pass `--include-global`.

## Improved `proto outdated` experience

The [`proto outdated`](/docs/proto/commands/outdated) command has worked "alright" but its developer
experience wasn't the best. The terminal output was rudimentary, and writing updated versions to
`.prototools` would save to the current directory, instead of the directory they are configured in.

To improve the overall developer experience, we've made the following changes to this command:

- Displays all tools and available updates as a table of data.
- Includes both newest (matching range) and latest versions available.
- Includes the config file that the tool + version was loaded from.
- When `--update` is passed, will now prompt to confirm the update.
- When updating versions, versions are now written to their original config file, instead of local.
- Updated the `--latest` flag to use the latest version when updating, instead of newest.

```
$ 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
```

## What about v0.32 and v0.33?

You may have noticed that we don't have blog posts for either of these versions. The v0.32 release
was a relatively light release with no meaningful changes, so we opted to not write a blog post for
it. As for v0.33, we ran into build issues while releasing it, so we decided to skip it and move on
to v0.34.

## Other changes

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

- Added a `dist-url` setting to some plugins, allowing the distribution download URL to be
customized.
- Updated `proto setup` (which is ran during proto installation) to modify the `PATH` system
environment variable on Windows. To disable this functionality, pass `--no-modify-path`.
4 changes: 2 additions & 2 deletions website/docs/config/project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -917,8 +917,8 @@ differences are around quote handling and variable substitution, so be aware of

<HeadingApiLink to="/api/types/interface/TaskOptionsConfig#internal" />

Marks the task as internal only. [Internal tasks](../concepts/task#internal) can not be explicitly
ran on the command line, but can be depended on by other tasks.
Marks the task as internal only. [Internal tasks](../concepts/task#internal-only) can not be
explicitly ran on the command line, but can be depended on by other tasks.

```yaml title="moon.yml" {5}
tasks:
Expand Down
10 changes: 5 additions & 5 deletions website/docs/proto/commands/alias.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
title: alias
---

The `proto alias <tool> <label> <version>` (or `proto a`) command will define a custom alias that
The `proto alias <tool> <alias> <version>` (or `proto a`) command will define a custom alias that
maps to a specific version for the provided tool. Aliases can be used anywhere a version is
accepted.

```shell
$ proto alias node work 16.16
```

By default this will update the local [`.prototools`](../config) file. Pass `--global` to update the
global [`~/.proto/.prototools`](../config) file instead.
By default this will update the local [`./.prototools`](../config) file. Pass `--global` to update
the global [`~/.proto/.prototools`](../config) file instead.

```shell
$ proto alias yarn berry 4 --global
Expand All @@ -20,9 +20,9 @@ $ proto alias yarn berry 4 --global
### Arguments

- `<tool>` - Type of tool.
- `<label>` - Name of the alias. Supports alphanumeric chars.
- `<alias>` - Name of the alias. Supports alphanumeric chars.
- `<version>` - Version to map to the alias.

## Options

- `--global` - Pin the version globally, rather than in the current directory.
- `--global` - Pin to the global `~/.proto/.prototools` instead of the local `./.prototools`.
6 changes: 3 additions & 3 deletions website/docs/proto/commands/bin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: bin
---

The `proto bin <tool>` command will return an absolute path to a tool's binary within the toolchain.
When a tool has not been installed, or a version cannot be resolved, the command will exit with a
failure.
The `proto bin <tool> [version]` command will return an absolute path to a tool's binary within the
toolchain. When a tool has not been installed, or a version cannot be resolved, the command will
exit with a failure.

```shell
$ proto bin node 16.10.0
Expand Down
3 changes: 1 addition & 2 deletions website/docs/proto/commands/completions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ $ proto completions > ./path/to/write/to

### Options

- `--shell` - Shell to explicitly generate for. Accepts "bash", "elvish", "fish", "powershell", or
"zsh".
- `--shell` - Shell to explicitly generate for.

### Examples

Expand Down
Loading

0 comments on commit 557c0a0

Please sign in to comment.