mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-20 23:28:03 +00:00
Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
This commit is contained in:
100
dot_config/nushell/nu_scripts/make_release/20k_club.nu
Normal file
100
dot_config/nushell/nu_scripts/make_release/20k_club.nu
Normal file
@@ -0,0 +1,100 @@
|
||||
# Readme
|
||||
# a .mailmap file needs to be in the root of each repo to aggregate users with multiple email addresses
|
||||
# we could add users if we need to map multiple email addresses to a single user
|
||||
# and commit the mailmap file to the repo if we wanted to. Format of the mailmap file is at the
|
||||
# end of the script.
|
||||
#
|
||||
# 1. git clone every repo in the list
|
||||
# 2. setup repos_root_folder to match your system
|
||||
# 3. setup the proper slash by system (TODO make the slash system agnostic)
|
||||
# 4. setup the output folder to the path you want it in
|
||||
|
||||
# Generate PR Counts for the XX Clubs.
|
||||
# example usage: get_pr_counts true
|
||||
# If true is provided as an argument, the script will also generate CSV files for each
|
||||
# repo with one line per commit, username, email, date in order for you to figure out
|
||||
# if you need to update the mailmap file so you can merge multiple users into one.
|
||||
# If false is provided as an argument, the script will summarize the PR counts and
|
||||
# display a table with the top 50 rows.
|
||||
# Whether you run in debug_csv mode or not, the output is written to csv files in the
|
||||
# $repos_root_folder/20k folder
|
||||
def get_pr_counts [debug_csv: bool, repos_root_folder = '/Users/fdncred/src'] {
|
||||
# let repos_root_folder = 'c:\users\dschroeder\source\repos\forks'
|
||||
# let repos_root_folder = '/Users/fdncred/src/forks'
|
||||
let repos = [[name, folder];
|
||||
[nushell, $'($repos_root_folder)(char psep)nushell'],
|
||||
[reedline, $'($repos_root_folder)(char psep)reedline'],
|
||||
[scripts, $'($repos_root_folder)(char psep)nu_scripts'],
|
||||
[vscode, $'($repos_root_folder)(char psep)vscode-nushell-lang'],
|
||||
[nana, $'($repos_root_folder)(char psep)nana'],
|
||||
[docs, $'($repos_root_folder)(char psep)nushell.github.io']
|
||||
]
|
||||
|
||||
let output_folder = $'($repos_root_folder)(char psep)20k'
|
||||
if not ($output_folder | path exists) {
|
||||
mkdir $output_folder
|
||||
}
|
||||
|
||||
$repos | each {|repo|
|
||||
let repo_name = $repo.name
|
||||
let repo_folder = $repo.folder
|
||||
|
||||
let output_file = $'($output_folder)(char psep)($repo_name).csv'
|
||||
print $"Working on ($repo_name). Saving to ($output_file)."
|
||||
|
||||
cd $repo.folder
|
||||
|
||||
if $debug_csv {
|
||||
# This outputs commit, name, email, date for use for adding info to mailmap file
|
||||
git log --pretty=%h»¦«%aN»¦«%aE»¦«%aD |
|
||||
lines |
|
||||
split column "»¦«" commit name email date |
|
||||
upsert date {|d| $d.date | into datetime} |
|
||||
to csv |
|
||||
save -f ($output_file)
|
||||
} else {
|
||||
git log --pretty=%h»¦«%aN»¦«%aE»¦«%aD |
|
||||
lines |
|
||||
split column "»¦«" commit name email date |
|
||||
upsert date {|d| $d.date | into datetime} |
|
||||
group-by name |
|
||||
transpose |
|
||||
upsert column1 {|c| $c.column1 | length} |
|
||||
sort-by column1 |
|
||||
rename name commits |
|
||||
reverse |
|
||||
to csv |
|
||||
save -f ($output_file)
|
||||
}
|
||||
}
|
||||
|
||||
cd $output_folder
|
||||
|
||||
if not $debug_csv {
|
||||
let data = (open docs.csv |
|
||||
append (open nana.csv) |
|
||||
append (open nushell.csv) |
|
||||
append (open reedline.csv) |
|
||||
append (open scripts.csv) |
|
||||
append (open vscode.csv)
|
||||
)
|
||||
|
||||
let data_dfr = ($data | dfr into-df)
|
||||
$data_dfr |
|
||||
dfr group-by name |
|
||||
dfr agg [(dfr col commits | dfr sum | dfr as "all_commits")] |
|
||||
dfr collect |
|
||||
dfr sort-by all_commits |
|
||||
dfr reverse |
|
||||
dfr into-nu |
|
||||
first 50
|
||||
}
|
||||
}
|
||||
|
||||
# .mailmap file
|
||||
# format
|
||||
# new_name <new_email> old_name <old_email>
|
||||
# name <email_we_now_want_to_use> some old name <old email address1>
|
||||
# name <email_we_now_want_to_use> some old name <old email address2>
|
||||
# name <email_we_now_want_to_use> some old name <old email address3>
|
||||
# name <email_we_now_want_to_use> some old name <old email address4>
|
||||
121
dot_config/nushell/nu_scripts/make_release/Readme.md
Normal file
121
dot_config/nushell/nu_scripts/make_release/Readme.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# The release process of Nushell
|
||||
## 0. Release direct dependencies
|
||||
> **Note**
|
||||
> the following procedure is the same for `nu-ansi-term` and `reedline` and needs to be repeated
|
||||
|
||||
> **Warning**
|
||||
> we usually can't include an update to `nu-ansi-term` unless `lscolors` has already updated to the newer version. if there's a major update to `nu-ansi-term` it needs to be done well beforehand. if not, don't bump it for Nushell
|
||||
|
||||
> **Warning**
|
||||
> release `nu-ansi-term` **before** `reedline` and `reedline` **before** Nushell
|
||||
|
||||
> **Note**
|
||||
> `nu-ansi-term` is typically released only when there are changes to publish.
|
||||
> `reedline` is typically released on the same schedule as Nushell.
|
||||
|
||||
> **Note**
|
||||
> in the following, `dep` denotes either the `reedline` or the `nu-ansi-term` remote
|
||||
> e.g. `https://github.com/nushell/reedline` or `git@github.com:nushell/nu-ansi-term`,
|
||||
> depending on the dependency being installed
|
||||
|
||||
- [ ] bump the version (example with [`reedline`][reedline bump example] and [`nu-ansi-term`][nu-ansi-term bump example])
|
||||
- [ ] get the latest revision with `git pull dep main`
|
||||
- [ ] publish the crate with `cargo publish` (*need to be a member of the publishing team*)
|
||||
- [ ] tag the project with `git tag v0.xx.0`
|
||||
- [ ] push the release tag with `git push dep main --tags`
|
||||
- [ ] publish the release (include the (breaking) changes and take inspiration from the [other releases](https://github.com/nushell/reedline/releases))
|
||||
- [ ] bump the version on the Nushell side ([example with `reedline`][reedline pin example]) (reference the release notes for courtesy)
|
||||
|
||||
## 1. Minor bump of the version ([example][nushell bump example])
|
||||
- [ ] in the repo of Nushell, run `/path/to/nu_scripts/make_release/bump-version.nu`
|
||||
- [ ] then, ensure there are no compilation errors with any combination of features by running:
|
||||
```nushell
|
||||
cargo hack --all --feature-powerset --skip default-no-clipboard,stable,mimalloc check
|
||||
```
|
||||
(this will take a while...)
|
||||
- [ ] check for build errors by running:
|
||||
```nushell
|
||||
cargo hack --all build
|
||||
```
|
||||
(this will build each crate with default features)
|
||||
- [ ] commit changes with bumped versions (this includes changes to `Cargo.lock`)
|
||||
|
||||
## 2. Tag the [`nushell`] repo
|
||||
> **Warning**
|
||||
> this is maybe the most critical step of the whole release process!!
|
||||
> this step, once pushed to *GitHub* will trigger the release workflows.
|
||||
|
||||
> **Note**
|
||||
> in the following, `nushell` will be used to pull and push to the [`nushell`] repo,
|
||||
> e.g. the `nushell` remote would be `https://github.com/nushell/nushell` or `git@github.com:nushell/nushell`
|
||||
|
||||
- [ ] get the latest version bump commit with `git pull nushell main`
|
||||
- [ ] tag the project with `git tag 0.xx.0`
|
||||
- [ ] :warning: push the release tag to *GitHub* `git push nushell main --tags` :warning:
|
||||
|
||||
:point_right: check the [CI jobs](https://github.com/nushell/nushell/actions)
|
||||
:point_right: check that there is the same number of targets compared to [last release](https://github.com/nushell/nushell/releases/latest)
|
||||
|
||||
## 3. Publish `nu` to *crates.io*
|
||||
- [ ] check the order of dependencies with `nushell/nu_scripts/make_release/nu_deps.nu` from the `nushell` repo
|
||||
- [ ] release the Nushell crates `nushell/nu_scripts/make_release/nu_release.nu` from the `nushell` repo
|
||||
- [ ] **Important!** add any new crates to the `github:nushell:publishing` group on crates.io: `cargo owner --add github:nushell:publishing -p <crate>`
|
||||
|
||||
> **Note**
|
||||
> if there is a new crate, you must add it to the `github:nushell:publishing` group (`cargo owner --list`)
|
||||
> this will make things very difficult for us next time if you don't, as we won't be able to release new versions of any dependent crates either
|
||||
|
||||
> **Note**
|
||||
> if a step fails
|
||||
> - ask the owner to `cargo owner --add github:nushell:publishing`
|
||||
> - edit the `nu_release.nu` script to start again where it failed
|
||||
> - re-run the script
|
||||
|
||||
## 4. Publish the release note on the website
|
||||
> **Note**
|
||||
> the scripts have been written in such a way they can be run from anywhere
|
||||
|
||||
- [ ] inspect the merged PRs to write changelogs with `./make_release/release-note/list-merged-prs nushell/nushell`
|
||||
- [ ] reorder sections by priority, what makes the most sense to the user?
|
||||
- [ ] paste the output of `./make_release/release-note/list-merged-prs nushell/nushell --label pr:breaking-change --pretty --no-author` to the "*Breaking changes*" section
|
||||
- [ ] make sure breaking changes titles are clear enough
|
||||
- [ ] paste the output of `./make_release/release-note/get-full-changelog` to the "*Full changelog*" section
|
||||
- [ ] mark as *ready for review* when uploading to *crates.io*
|
||||
- [ ] land when
|
||||
- **fully uploaded** to *crates.io*
|
||||
- **before** the *GitHub* release
|
||||
|
||||
## 5. Publish the release on *GitHub*
|
||||
- [ ] go to the draft release on the [release page](https://github.com/nushell/nushell/releases)
|
||||
- [ ] grab the message of [last one](https://github.com/nushell/nushell/releases/latest)
|
||||
- [ ] wait for the website to publish the release (in the [actions](https://github.com/nushell/nushell.github.io/actions) tab and on the [website](https://www.nushell.sh/blog/))
|
||||
- [ ] publish the release on *GitHub*
|
||||
|
||||
## 6. social media
|
||||
- [ ] post a status update on Discord
|
||||
- [ ] tweet about the new release
|
||||
|
||||
## 7. Create the next release note PR on the website
|
||||
- [ ] run `./make_release/release-note/create-pr 0.xx.0 ((date now) + 4wk | format date "%Y-%m-%d" | into datetime)`
|
||||
|
||||
## 8. Bump the version as development
|
||||
- [ ] bump the patch version on [`nushell`] ([example][nushell dev example]) by running
|
||||
```nushell
|
||||
/path/to/nu_scripts/make_release/bump-version.nu --patch
|
||||
```
|
||||
|
||||
## After the release
|
||||
The main things to do once a release has been published are
|
||||
- landing PRs marked with the [`wait-until-after-nushell-release`](https://github.com/nushell/nushell/labels/wait-until-after-nushell-release) label which have been already approved
|
||||
- listening to the community for feedback
|
||||
|
||||
|
||||
[reedline bump example]: https://github.com/nushell/reedline/pull/596/files
|
||||
[nu-ansi-term bump example]: https://github.com/nushell/nu-ansi-term/pull/45/files
|
||||
[reedline pin example]: https://github.com/nushell/nushell/pull/9532
|
||||
[nushell bump example]: https://github.com/nushell/nushell/pull/9530/files
|
||||
[nushell dev example]: https://github.com/nushell/nushell/pull/9543
|
||||
|
||||
[`nushell`]: https://github.com/nushell/nushell
|
||||
[`reedline`]: https://github.com/nushell/reedline
|
||||
[`nu-ansi-term`]: https://github.com/nushell/nu-ansi-term
|
||||
49
dot_config/nushell/nu_scripts/make_release/bump-version.nu
Normal file
49
dot_config/nushell/nu_scripts/make_release/bump-version.nu
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env nu
|
||||
use std log
|
||||
|
||||
# bump the minor or patch version of the Nushell project
|
||||
def main [
|
||||
--patch # update the minor version instead of the minor
|
||||
]: nothing -> nothing {
|
||||
let version = open Cargo.toml
|
||||
| get package.version
|
||||
| parse "{major}.{minor}.{patch}"
|
||||
| into int major minor patch
|
||||
| into record
|
||||
|
||||
let new_version = if $patch {
|
||||
$version | update patch { $in + 1 }
|
||||
} else {
|
||||
$version | update minor { $in + 1 } | update patch { 0 }
|
||||
}
|
||||
|
||||
let version = $version | transpose | get column1 | str join "."
|
||||
let new_version = $new_version | transpose | get column1 | str join "."
|
||||
|
||||
log info $"bumping all packages and Nushell files in (open Cargo.toml | get package.name) from ($version) to ($new_version)"
|
||||
|
||||
ls **/Cargo.toml | each {|file|
|
||||
log debug $"bumping ($file.name) from ($version) to ($new_version)"
|
||||
open --raw $file.name
|
||||
| str replace --all $'version = "($version)"' $'version = "($new_version)"'
|
||||
| save --force $file.name
|
||||
}
|
||||
|
||||
"crates/nu-utils/src/sample_config/default_{config,env}.nu" | str expand | each {|file|
|
||||
log debug $"bumping ($file) from ($version) to ($new_version)"
|
||||
open --raw $file
|
||||
| str replace --all $'version = "($version)"' $'version = "($new_version)"'
|
||||
| save --force $file
|
||||
}
|
||||
|
||||
[
|
||||
"crates/nu_plugin_python/nu_plugin_python_example.py"
|
||||
"crates/nu_plugin_nu_example/nu_plugin_nu_example.nu"
|
||||
] | each {|file|
|
||||
log debug $"bumping ($file) from ($version) to ($new_version)"
|
||||
open --raw $file
|
||||
| str replace --all $'NUSHELL_VERSION = "($version)"' $'NUSHELL_VERSION = "($new_version)"'
|
||||
| save --force $file
|
||||
}
|
||||
null
|
||||
}
|
||||
101
dot_config/nushell/nu_scripts/make_release/gen-js-ext.nu
Normal file
101
dot_config/nushell/nu_scripts/make_release/gen-js-ext.nu
Normal file
@@ -0,0 +1,101 @@
|
||||
def gen_keywords [] {
|
||||
let cmds = (scope commands
|
||||
| where is_extern == false
|
||||
and is_custom == false
|
||||
and category !~ deprecated
|
||||
and ($it.name | str contains -n ' ')
|
||||
| get name
|
||||
| str join '|')
|
||||
|
||||
let var_with_dash_or_under_regex = '(([a-zA-Z]+[\\-_]){1,}[a-zA-Z]+\\s)'
|
||||
let preamble = '\\b('
|
||||
let postamble = ')\\b'
|
||||
$'"match": "($var_with_dash_or_under_regex)|($preamble)($cmds)($postamble)",'
|
||||
}
|
||||
print $"Generating keywords(char nl)"
|
||||
print (gen_keywords)
|
||||
print (char nl)
|
||||
print (char nl)
|
||||
|
||||
def gen_sub_keywords [] {
|
||||
let sub_cmds = (scope commands
|
||||
| where is_extern == false
|
||||
and is_custom == false
|
||||
and category !~ deprecated
|
||||
and ($it.name | str contains ' ')
|
||||
| get name)
|
||||
|
||||
let preamble = '\\b('
|
||||
let postamble = ')\\b'
|
||||
let cmds = ($sub_cmds | each {|x|
|
||||
let parts = ($x | split row ' ')
|
||||
$'($parts.0)\\s($parts.1)'
|
||||
} | str join '|')
|
||||
$'"match": "($preamble)($cmds)($postamble)",'
|
||||
}
|
||||
print $"Generating sub keywords(char nl)"
|
||||
print (gen_sub_keywords)
|
||||
print (char nl)
|
||||
|
||||
def gen_keywords_alphabetically [] {
|
||||
let alphabet = [a b c d e f g h i j k l m n o p q r s t u v w x y z]
|
||||
let cmds = (scope commands
|
||||
| where is_extern == false
|
||||
and is_custom == false
|
||||
and category !~ deprecated
|
||||
and ($it.name | str contains -n ' ')
|
||||
| get name)
|
||||
|
||||
let preamble = '\\b('
|
||||
let postamble = ')\\b'
|
||||
|
||||
|
||||
$alphabet | each {|alpha|
|
||||
let letter_cmds = ($cmds | each {|cmd|
|
||||
if ($cmd | str starts-with $alpha) {
|
||||
$cmd
|
||||
} else {
|
||||
null
|
||||
}
|
||||
} | str join '|')
|
||||
if ($letter_cmds | str trim | str length) > 0 {
|
||||
$'"match": "($preamble)($letter_cmds)($postamble)",'
|
||||
}
|
||||
} | str join "\n"
|
||||
}
|
||||
|
||||
print "Generating keywords alphabetically\n"
|
||||
print (gen_keywords_alphabetically)
|
||||
print (char nl)
|
||||
|
||||
def gen_sub_keywords_alphabetically [] {
|
||||
let alphabet = [a b c d e f g h i j k l m n o p q r s t u v w x y z]
|
||||
let sub_cmds = (scope commands |
|
||||
| where is_extern == false
|
||||
and is_custom == false
|
||||
and category !~ deprecated
|
||||
and ($it.name | str contains ' ')
|
||||
| get name)
|
||||
|
||||
let preamble = '\\b('
|
||||
let postamble = ')\\b'
|
||||
|
||||
|
||||
$alphabet | each {|alpha|
|
||||
let letter_cmds = ($sub_cmds | each {|cmd|
|
||||
if ($cmd | str starts-with $alpha) {
|
||||
let parts = ($cmd | split row ' ')
|
||||
$'($parts.0)\\s($parts.1)'
|
||||
} else {
|
||||
null
|
||||
}
|
||||
} | str join '|')
|
||||
if ($letter_cmds | str trim | str length) > 0 {
|
||||
$'"match": "($preamble)($letter_cmds)($postamble)",'
|
||||
}
|
||||
} | str join "\n"
|
||||
}
|
||||
|
||||
print "Generating sub keywords alphabetically\n"
|
||||
print (gen_sub_keywords_alphabetically)
|
||||
print (char nl)
|
||||
93
dot_config/nushell/nu_scripts/make_release/gen-ts-ext.nu
Normal file
93
dot_config/nushell/nu_scripts/make_release/gen-ts-ext.nu
Normal file
@@ -0,0 +1,93 @@
|
||||
def gen-ts-cmds-begin [] {
|
||||
# hooray for multi-line strings
|
||||
[ "import * as vscode from 'vscode';
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
const keywordsWithSubCommandsProvider = vscode.languages.registerCompletionItemProvider(
|
||||
'nushell',
|
||||
{
|
||||
provideCompletionItems(
|
||||
document: vscode.TextDocument,
|
||||
position: vscode.Position,
|
||||
token: vscode.CancellationToken,
|
||||
context: vscode.CompletionContext
|
||||
) {
|
||||
" ] | str join
|
||||
}
|
||||
|
||||
# generate typescript from nushell commands
|
||||
def gen-ts-cmds [] {
|
||||
let cmds = (scope commands | where usage != '' | select name usage)
|
||||
let updated_cmds = (echo $cmds | insert camel {|it| $it.name + 'Completion' | str camel-case } )
|
||||
|
||||
let ts = (echo $updated_cmds |
|
||||
each {|it|
|
||||
let line1 = ([ " const " $it.camel " = new vscode.CompletionItem('" $it.name "');" (char newline) ] | str join)
|
||||
let line2 = ([ " " $it.camel ".commitCharacters = [' '];" (char newline) (char newline) ] | str join)
|
||||
$line1 + $line2
|
||||
} | str join)
|
||||
|
||||
[
|
||||
(echo $ts) (char nl)
|
||||
" return [ "
|
||||
(echo $updated_cmds | get camel | str join ', ')
|
||||
" ];"
|
||||
(char nl) ' },' (char nl), ' }' (char nl) ' );'
|
||||
(char nl) (char nl)
|
||||
] | str join
|
||||
}
|
||||
|
||||
# generate typescript from nushell subcommands
|
||||
def gen-ts-subs [] {
|
||||
let cmds = (scope commands | where is_sub == true | select name usage | insert base { get name | split column ' ' base sub } | flatten --all)
|
||||
let updated_cmds = (echo $cmds | insert camelProvider {|row| $row.base + 'SubCommandsProvider' | str camel-case } | insert method {|row| $row.name | str camel-case})
|
||||
let subs_count = (scope commands | where is_sub == true | select name usage | insert base { get name | split column ' ' base sub} | flatten --all | group-by base | transpose cmd cmd_count | update cmd_count { get cmd_count | length })
|
||||
let subs_collection = (scope commands | where is_sub == true | select name usage | insert base { get name | split column ' ' base sub} | flatten --all | group-by base | transpose cmd sub_cmds)
|
||||
|
||||
let ts = ($subs_collection | each {|it|
|
||||
let preamble = (get sub_cmds | enumerate | each {|it|
|
||||
let method = ([ $it.item.name | str camel-case ] | str join)
|
||||
let camel = ([ $it.item.base 'SubCommandsProvider' | str camel-case ] | str join)
|
||||
if $it.index == 0 {
|
||||
let line01 = ([" const " $camel " = vscode.languages.registerCompletionItemProvider(" (char newline)] | str join)
|
||||
let line02 = ([" 'nushell'," (char nl)] | str join)
|
||||
let line03 = ([" {" (char nl)] | str join)
|
||||
let line04 = ([ " provideCompletionItems(document: vscode.TextDocument, position: vscode.Position) {" (char nl) (char nl) ] | str join)
|
||||
let line05 = ([ " const linePrefix = document.lineAt(position).text.substr(0, position.character);" (char nl) ] | str join)
|
||||
let line06 = ([ " if (linePrefix.endsWith('" $it.item.base " ')) {" (char nl) (char nl) ] | str join)
|
||||
let line07 = ([ " const " $method " = new vscode.CompletionItem('" $it.item.sub "', vscode.CompletionItemKind.Method);" (char nl) ] | str join)
|
||||
let line08 = ([ ' ' $method '.detail = "' $it.item.usage '";' (char nl) (char nl) ] | str join)
|
||||
$line01 + $line02 + $line03 + $line04 + $line05 + $line06 + $line07 + $line08
|
||||
} else {
|
||||
let line07 = ([ " const " $method " = new vscode.CompletionItem('" $it.item.sub "', vscode.CompletionItemKind.Method);" (char nl) ] | str join)
|
||||
let line08 = ([ ' ' $method '.detail = "' $it.item.usage '";' (char nl) (char nl) ] | str join)
|
||||
$line07 + $line08
|
||||
}
|
||||
} | str join)
|
||||
|
||||
let methods = (echo $it.sub_cmds.name | str camel-case | str join ', ')
|
||||
|
||||
let lines = $"
|
||||
return [
|
||||
($methods)
|
||||
];
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
},
|
||||
' '
|
||||
);
|
||||
"
|
||||
|
||||
$preamble + $lines
|
||||
} | str join)
|
||||
|
||||
let post01 = (" context.subscriptions.push(" + (char nl))
|
||||
let post02 = ([ " " (echo $updated_cmds | get camelProvider | uniq | str join ', ') (char nl) ] | str join)
|
||||
let post03 = ([ " );" (char nl) "}" (char nl) ] | str join)
|
||||
|
||||
[$ts $post01 $post02 $post03] | str join
|
||||
}
|
||||
|
||||
|
||||
[ (gen-ts-cmds-begin) (gen-ts-cmds) (gen-ts-subs) ] | str join | save -f extension.ts
|
||||
32
dot_config/nushell/nu_scripts/make_release/get_coverage.nu
Normal file
32
dot_config/nushell/nu_scripts/make_release/get_coverage.nu
Normal file
@@ -0,0 +1,32 @@
|
||||
# Test coverage gathering for nushell
|
||||
# Uses cargo-llvm-cov
|
||||
# Uses separate execution to track the integration tests
|
||||
# Hacked together by @sholderbach
|
||||
|
||||
# Get test coverage for nushell
|
||||
def main [
|
||||
--extra # Get coverage for extra features
|
||||
] {
|
||||
cargo llvm-cov show-env --export-prefix |
|
||||
lines |
|
||||
str substring 7.. |
|
||||
split column '=' |
|
||||
str trim -c '"' |
|
||||
transpose |
|
||||
headers |
|
||||
reject 'column1' |
|
||||
get 0 |
|
||||
str trim |
|
||||
load-env
|
||||
|
||||
cargo llvm-cov clean --workspace
|
||||
if $extra {
|
||||
cargo build --workspace --features extra
|
||||
cargo test --workspace --features extra
|
||||
} else {
|
||||
cargo build --workspace
|
||||
cargo test --workspace
|
||||
}
|
||||
cargo llvm-cov --no-run --lcov --output-path lcov.info
|
||||
cargo llvm-cov --no-run --html
|
||||
}
|
||||
73
dot_config/nushell/nu_scripts/make_release/nu_deps.nu
Normal file
73
dot_config/nushell/nu_scripts/make_release/nu_deps.nu
Normal file
@@ -0,0 +1,73 @@
|
||||
# Go through Nushell dependencies in the first wave and find the right ordering
|
||||
#
|
||||
# Recommended usage is via a module which allows you to process the output
|
||||
# further.
|
||||
|
||||
# Extract target-specific dependencies from an opened Cargo.toml
|
||||
def get-target-dependencies [] {
|
||||
let target = ($in | get -i target)
|
||||
|
||||
mut res = []
|
||||
|
||||
if ($target | is-empty) {
|
||||
return $res
|
||||
}
|
||||
|
||||
for col in ($target | columns) {
|
||||
let deps = ($target | get -i $col | get -i dependencies)
|
||||
if not ($deps | is-empty) {
|
||||
$res ++= ($deps | columns)
|
||||
}
|
||||
}
|
||||
|
||||
$res
|
||||
}
|
||||
|
||||
# For each Nushell crate in the first publishing wave, open its Cargo.toml and
|
||||
# gather its dependencies.
|
||||
def find-deps [] {
|
||||
ls crates/nu-*/Cargo.toml | get name | each {|toml|
|
||||
let crate = ($toml | path dirname | path basename)
|
||||
let data = (open $toml)
|
||||
|
||||
mut deps = []
|
||||
$deps ++= ($data | get -i 'dependencies' | default {} | columns)
|
||||
$deps ++= ($data | get -i 'dev-dependencies' | default {} | columns)
|
||||
$deps ++= ($data | get-target-dependencies)
|
||||
let $deps = ($deps
|
||||
| where ($it | str starts-with 'nu-')
|
||||
| where not ($it == 'nu-ansi-term'))
|
||||
|
||||
{
|
||||
'crate': $crate
|
||||
'dependencies': $deps
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Find the right publish ordering of Nushell crates based on their dependencies
|
||||
#
|
||||
# Returns a list which you can process further, e.g.:
|
||||
# > nu_deps | str join (',' + (char nl))
|
||||
export def main [] {
|
||||
let deps = (find-deps)
|
||||
|
||||
mut list = []
|
||||
|
||||
while ($list | length) < ($deps | length) {
|
||||
for row in $deps {
|
||||
mut nsubdeps = 0
|
||||
for sub_dep in $row.dependencies {
|
||||
if not ($sub_dep in $list) {
|
||||
$nsubdeps += 1
|
||||
}
|
||||
}
|
||||
|
||||
if ($nsubdeps == 0) and ($row.crate not-in $list) {
|
||||
$list ++= [$row.crate]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$list
|
||||
}
|
||||
67
dot_config/nushell/nu_scripts/make_release/nu_release.nu
Normal file
67
dot_config/nushell/nu_scripts/make_release/nu_release.nu
Normal file
@@ -0,0 +1,67 @@
|
||||
use std log
|
||||
|
||||
export def main [] {
|
||||
let subcrates_wave_1 = [
|
||||
nu-glob,
|
||||
nu-path,
|
||||
nu-pretty-hex,
|
||||
nu-system,
|
||||
nu-utils,
|
||||
nu-term-grid,
|
||||
nu-test-support,
|
||||
nu-json,
|
||||
nu-derive-value,
|
||||
nu-protocol,
|
||||
nu-engine,
|
||||
nu-plugin-protocol,
|
||||
nu-color-config,
|
||||
nu-plugin-core,
|
||||
nu-plugin-engine,
|
||||
nu-table,
|
||||
nu-cmd-plugin,
|
||||
nu-parser,
|
||||
nu-plugin,
|
||||
nu-std,
|
||||
nuon,
|
||||
nu-cmd-base,
|
||||
]
|
||||
|
||||
# This crate has a `build.rs` file and thus needs `--no-verify`
|
||||
let subcrates_wave_2 = [
|
||||
nu-cmd-lang,
|
||||
]
|
||||
|
||||
let subcrates_wave_3 = [
|
||||
nu-command,
|
||||
nu-explore,
|
||||
nu-plugin-test-support,
|
||||
nu-cli,
|
||||
nu-cmd-extra,
|
||||
nu-lsp,
|
||||
|
||||
nu_plugin_query,
|
||||
nu_plugin_inc,
|
||||
nu_plugin_gstat,
|
||||
nu_plugin_formats,
|
||||
nu_plugin_polars,
|
||||
]
|
||||
|
||||
log warning "starting publish"
|
||||
|
||||
log warning "publishing the first wave of crates"
|
||||
for crate in $subcrates_wave_1 {
|
||||
cargo publish -p $crate
|
||||
}
|
||||
|
||||
log warning "publishing the second wave of crates"
|
||||
for crate in $subcrates_wave_2 {
|
||||
cargo publish -p $crate --no-verify
|
||||
}
|
||||
|
||||
log warning "publishing the third wave of crates"
|
||||
for crate in $subcrates_wave_3 {
|
||||
cargo publish -p $crate
|
||||
}
|
||||
|
||||
cargo publish
|
||||
}
|
||||
36
dot_config/nushell/nu_scripts/make_release/prs.nu
Normal file
36
dot_config/nushell/nu_scripts/make_release/prs.nu
Normal file
@@ -0,0 +1,36 @@
|
||||
use ./release-note/list-merged-prs
|
||||
|
||||
const LAST_RELEASE = 0.89.0
|
||||
|
||||
let matching_releases = ^gh api /repos/nushell/nushell/releases
|
||||
| from json
|
||||
| where tag_name == $LAST_RELEASE
|
||||
|
||||
match ($matching_releases | length) {
|
||||
0 => {
|
||||
error make --unspanned { msg: "no matching releases... did you set the last release?" }
|
||||
},
|
||||
1 => {},
|
||||
_ => {
|
||||
error make --unspanned { msg: $"too many matching releases... is ($LAST_RELEASE) correct?" }
|
||||
},
|
||||
}
|
||||
|
||||
let last_release_date = $matching_releases | into record | get published_at | into datetime
|
||||
print $last_release_date
|
||||
|
||||
let prs = list-merged-prs nushell/nushell $last_release_date
|
||||
| where author != "app/dependabot"
|
||||
| sort-by mergedAt
|
||||
| update url {|it| $"[#($it.number)]\(($it.url)\)" }
|
||||
| update author { $"[@($in)]\(https://github.com/($in)\)" }
|
||||
| select author title url
|
||||
| rename --column {url: pr}
|
||||
|
||||
print "ALL PRS:"
|
||||
print ($prs | to md --pretty)
|
||||
|
||||
print "BREAKING CHANGES:"
|
||||
mut breaking_prs = list-merged-prs nushell/nushell $last_release_date --label breaking-change --pretty --no-author
|
||||
$breaking_prs ++= (list-merged-prs nushell/nushell $last_release_date --label 'pr:breaking-change' --pretty --no-author)
|
||||
print ($breaking_prs | to md --pretty)
|
||||
@@ -0,0 +1,136 @@
|
||||
#!/usr/bin/env nu
|
||||
|
||||
use std log
|
||||
|
||||
def open-pr [
|
||||
repo: path
|
||||
remote: string
|
||||
pr: record<
|
||||
branch: string
|
||||
title: string
|
||||
body: string
|
||||
>
|
||||
] {
|
||||
cd $repo
|
||||
gh repo set-default $remote
|
||||
|
||||
log info "mock up pr"
|
||||
(
|
||||
gh pr create
|
||||
--head $pr.branch
|
||||
--base main
|
||||
--title $pr.title
|
||||
--body $pr.body
|
||||
--draft
|
||||
)
|
||||
}
|
||||
|
||||
def clean [repo: path] {
|
||||
log info "removing the repo"
|
||||
rm -rf $repo
|
||||
}
|
||||
|
||||
# open the release note PR interactively
|
||||
#
|
||||
# # Example
|
||||
# [this PR](https://github.com/nushell/nushell.github.io/pull/916) has been created with the script
|
||||
# > ./make_release/release-note/create-pr 0.81 2023-06-06
|
||||
def main [
|
||||
version: string # the version of the release, e.g. `0.80`
|
||||
date: datetime # the date of the upcoming release, e.g. `2023-05-16`
|
||||
] {
|
||||
let repo = ($nu.temp-path | path join (random uuid))
|
||||
let branch = $"release-notes-($version)"
|
||||
|
||||
let blog_path = (
|
||||
$repo | path join "blog" $"($date | format date "%Y-%m-%d")-nushell_($version | str replace --all '.' '_').md"
|
||||
)
|
||||
|
||||
let title = $"Release notes for `($version)`"
|
||||
let body = $"Please add your new features and breaking changes to the release notes
|
||||
by opening PRs against the `release-notes-($version)` branch.
|
||||
|
||||
## TODO
|
||||
- [ ] look at interesting contributions
|
||||
- [ ] write all the sections
|
||||
- [ ] order the sections by interest
|
||||
- [ ] add the breaking changes
|
||||
- [ ] detail the breaking changes
|
||||
- [ ] add the full changelog
|
||||
- [ ] complete all the `TODO`s inside the release note
|
||||
- [ ] ... \(PRs that need to land before the release, e.g. [deprecations]\(https://github.com/nushell/nushell/labels/deprecation\) or [removals]\(https://github.com/nushell/nushell/pulls?q=is%3Apr+is%3Aopen+label%3Aremoval-after-deprecation\)\)"
|
||||
|
||||
log info "creating release note from template"
|
||||
let release_note = $env.CURRENT_FILE
|
||||
| path dirname
|
||||
| path join "template.md"
|
||||
| open
|
||||
| str replace --all "{{VERSION}}" $version
|
||||
|
||||
log info $"branch: ($branch)"
|
||||
log info $"blog: ($blog_path | str replace $repo "" | path split | skip 1 | path join)"
|
||||
log info $"title: ($title)"
|
||||
|
||||
match (["yes" "no"] | input list --fuzzy "Inspect the release note document? ") {
|
||||
"yes" => {
|
||||
if $env.EDITOR? == null {
|
||||
error make --unspanned {
|
||||
msg: $"(ansi red_bold)$env.EDITOR is not defined(ansi reset)"
|
||||
}
|
||||
}
|
||||
|
||||
let temp_file = $nu.temp-path | path join $"(random uuid).md"
|
||||
$release_note | save --force $temp_file
|
||||
^$env.EDITOR $temp_file
|
||||
rm --recursive --force $temp_file
|
||||
},
|
||||
"no" | "" | _ => {},
|
||||
}
|
||||
|
||||
match (["no" "yes"] | input list --fuzzy "Open release note PR? ") {
|
||||
"yes" => {},
|
||||
"no" | "" | _ => {
|
||||
log warning "aborting."
|
||||
return
|
||||
},
|
||||
}
|
||||
|
||||
log info "setting up nushell.github.io repo"
|
||||
git clone https://github.com/nushell/nushell.github.io $repo --origin nushell --branch main --single-branch
|
||||
git -C $repo remote set-url nushell --push git@github.com:nushell/nushell.github.io.git
|
||||
|
||||
log info "creating release branch"
|
||||
git -C $repo checkout -b $branch
|
||||
|
||||
log info "writing release note"
|
||||
$release_note | save --force $blog_path
|
||||
|
||||
log info "committing release note"
|
||||
git -C $repo add $blog_path
|
||||
git -C $repo commit -m $"($title)\n\n($body)"
|
||||
|
||||
log info "pushing release note to nushell"
|
||||
git -C $repo push nushell $branch
|
||||
|
||||
let out = (do -i { gh auth status } | complete)
|
||||
if $out.exit_code != 0 {
|
||||
clean $repo
|
||||
|
||||
let pr_url = $"https://github.com/nushell/nushell.github.io/compare/($branch)?expand=1"
|
||||
error make --unspanned {
|
||||
msg: ([
|
||||
$out.stderr
|
||||
$"please open the PR manually from a browser (ansi blue_underline)($pr_url)(ansi reset)"
|
||||
] | str join "\n")
|
||||
}
|
||||
}
|
||||
|
||||
log info "opening pull request"
|
||||
open-pr $repo nushell/nushell.github.io {
|
||||
branch: $"nushell:($branch)"
|
||||
title: $title
|
||||
body: $body
|
||||
}
|
||||
|
||||
clean $repo
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env nu
|
||||
|
||||
def main [
|
||||
date?: datetime # the date of the last release (default to 4 weeks ago, excluded)
|
||||
] {
|
||||
let list_merged_prs_script = (
|
||||
$env.CURRENT_FILE | path dirname | path join "list-merged-prs"
|
||||
)
|
||||
|
||||
let changelogs = [
|
||||
[title repo];
|
||||
|
||||
[Nushell nushell/nushell]
|
||||
[Extension nushell/vscode-nushell-lang]
|
||||
[Documentation nushell/nushell.github.io]
|
||||
[Nu_Scripts nushell/nu_scripts]
|
||||
[Reedline nushell/reedline]
|
||||
]
|
||||
|
||||
$changelogs | each {|changelog|
|
||||
[
|
||||
$"## ($changelog.title)"
|
||||
(^$list_merged_prs_script $changelog.repo --pretty $date)
|
||||
] | str join "\n"
|
||||
}
|
||||
| str join "\n\n"
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env nu
|
||||
|
||||
|
||||
# Prepare the GitHub release text
|
||||
def main [
|
||||
versionname: string # The version we release now
|
||||
bloglink: string # The link to the blogpost
|
||||
date?: datetime # the date of the last release (default to 3 weeks ago, excluded)
|
||||
] {
|
||||
let date = (
|
||||
if $date == null { (date now) - 4wk + 1day } else { $date }
|
||||
| format date "%Y-%m-%d"
|
||||
)
|
||||
|
||||
let repo = "nushell/nushell"
|
||||
let query = $"merged:>($date)"
|
||||
|
||||
let prs = (
|
||||
gh --repo $repo pr list
|
||||
--state merged
|
||||
--limit (inf | into int)
|
||||
--json author,title,number,mergedAt,url
|
||||
--search $query
|
||||
| from json
|
||||
| sort-by mergedAt --reverse
|
||||
| update author { get login }
|
||||
)
|
||||
|
||||
let authors = $prs.author | uniq | sort -i
|
||||
|
||||
let author_string = ($authors | each {|name| $"@($name)"} | str join ", " )
|
||||
|
||||
let release_text = [
|
||||
$"This is the ($versionname) release of Nushell. You can learn more about this release here: ($bloglink)",
|
||||
"",
|
||||
"For convenience, we are providing full builds for Windows, Linux, and macOS. Be sure you have the requirements to enable all capabilities: https://www.nushell.sh/book/installation.html#dependencies",
|
||||
"",
|
||||
$"This release was made possible by PR contributions from ($author_string)"
|
||||
]
|
||||
|
||||
$release_text | str join "\n"
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/env nu
|
||||
use std log
|
||||
|
||||
def md-link [
|
||||
text: string
|
||||
link: string
|
||||
] {
|
||||
$"[($text)]\(($link)\)"
|
||||
}
|
||||
|
||||
# list all merged PRs since last release
|
||||
export def main [
|
||||
repo: string # the name of the repo, e.g. `nushell/nushell`
|
||||
--date: datetime # the date of the last release (default to 4 weeks ago, excluded, if no milestone is set)
|
||||
--milestone: string # search PRs by milestone
|
||||
--label: string # the label to filter the PRs by, e.g. `good-first-issue`
|
||||
--pretty # pretty-print for the MarkDown release not
|
||||
--no-author # do not group the contributions by author
|
||||
--table # make an Antoine table
|
||||
] {
|
||||
mut query_parts = []
|
||||
|
||||
let date = if $date == null and $milestone == null {
|
||||
(date now) - 4wk
|
||||
} else {
|
||||
$date
|
||||
}
|
||||
|
||||
if $date != null {
|
||||
let date = $date | format date "%Y-%m-%d"
|
||||
let since = (date now | format date %F | into datetime) - ($date | into datetime)
|
||||
log info $"listing PRs in ($repo) since ($date) \(($since) ago\)"
|
||||
$query_parts ++= [ $"merged:>($date)" ]
|
||||
}
|
||||
|
||||
if $milestone != null {
|
||||
log info $"listing PRs in milestone ($milestone)"
|
||||
$query_parts ++= [ $'milestone:"($milestone)"' ]
|
||||
}
|
||||
|
||||
if $label != null {
|
||||
log info $"listing PRs with label ($label)"
|
||||
$query_parts ++= [ $'label:($label)' ]
|
||||
}
|
||||
|
||||
let query = $query_parts | str join ' '
|
||||
|
||||
let prs = (
|
||||
gh --repo $repo pr list
|
||||
--state merged
|
||||
--limit (inf | into int)
|
||||
--json author,title,number,mergedAt,url
|
||||
--search $query
|
||||
| from json
|
||||
| sort-by mergedAt --reverse
|
||||
| update author { get login }
|
||||
)
|
||||
|
||||
if $table {
|
||||
return (
|
||||
$prs
|
||||
| update author {md-link $"@($in)" $"https://github.com/($in)"}
|
||||
| insert PR {|pr| md-link $"#($pr.number)" $pr.url}
|
||||
| select author title PR
|
||||
| to md
|
||||
)
|
||||
}
|
||||
|
||||
if $pretty {
|
||||
if $no_author {
|
||||
return (
|
||||
$prs | each {|pr|
|
||||
let link = (md-link $"#($pr.number)" $pr.url)
|
||||
$"- ($link) ($pr.title)"
|
||||
}
|
||||
| str join "\n"
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
$prs
|
||||
| group-by author
|
||||
| transpose author prs
|
||||
| each {|line|
|
||||
let author = (md-link $line.author $"https://github.com/($line.author)")
|
||||
|
||||
$"- ($author) created" | append (
|
||||
$line.prs | each {|pr|
|
||||
let link = (md-link $pr.title $pr.url)
|
||||
$" - ($link)"
|
||||
}
|
||||
)
|
||||
| str join "\n"
|
||||
}
|
||||
| to text
|
||||
)
|
||||
}
|
||||
|
||||
$prs
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
---
|
||||
title: Nushell {{VERSION}}
|
||||
author: The Nu Authors
|
||||
author_site: https://twitter.com/nu_shell
|
||||
author_image: https://www.nushell.sh/blog/images/nu_logo.png
|
||||
excerpt: Today, we're releasing version {{VERSION}} of Nu. This release adds...
|
||||
---
|
||||
<!-- TODO: complete the excerpt above -->
|
||||
|
||||
# Nushell {{VERSION}}
|
||||
|
||||
Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines.
|
||||
|
||||
<!-- TODO: write this excerpt -->
|
||||
Today, we're releasing version {{VERSION}} of Nu. This release adds...
|
||||
|
||||
# Where to get it
|
||||
|
||||
Nu {{VERSION}} is available as [pre-built binaries](https://github.com/nushell/nushell/releases/tag/{{VERSION}}) or from [crates.io](https://crates.io/crates/nu). If you have Rust installed you can install it using `cargo install nu`.
|
||||
|
||||
As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use `cargo install nu_plugin_<plugin name>`.
|
||||
|
||||
# Table of contents
|
||||
- [_Highlights and themes of this release_](#highlights-and-themes-of-this-release-toc)
|
||||
- [_Changes_](#changes-toc)
|
||||
- [_Additions_](#additions-toc)
|
||||
- [_Breaking changes_](#breaking-changes-toc)
|
||||
- [_Deprecations_](#deprecations-toc)
|
||||
- [_Removals_](#removals-toc)
|
||||
- [_Bug fixes and other changes_](#bug-fixes-and-other-changes-toc)
|
||||
- [_Notes for plugin developers_](#notes-for-plugin-developers-toc)
|
||||
- [_Hall of fame_](#hall-of-fame-toc)
|
||||
- [_Full changelog_](#full-changelog-toc)
|
||||
<!-- TODO: please add links to the other sections here
|
||||
|
||||
the following command should help pre-generate a great deal of the table of content.
|
||||
be careful with the format and false-positives :wink:
|
||||
```nushell
|
||||
rg '^#+ ' blog/...
|
||||
| lines
|
||||
| each {
|
||||
str replace '# ' '- '
|
||||
| str replace --all '#' ' '
|
||||
| str replace --regex '- (.*)' '- [_$1_](#$1-toc)'
|
||||
}
|
||||
| to text
|
||||
```
|
||||
-->
|
||||
|
||||
# Highlights and themes of this release [[toc](#table-of-content)]
|
||||
<!-- NOTE: if you wanna write a section about a breaking change, when it's a very important one,
|
||||
please add the following snippet to have a "warning" banner :)
|
||||
> see [an example](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal)
|
||||
|
||||
```md
|
||||
::: warning Breaking change
|
||||
See a full overview of the [breaking changes](#breaking-changes)
|
||||
:::
|
||||
```
|
||||
-->
|
||||
<!-- NOTE: see https://vuepress.github.io/reference/default-theme/markdown.html#custom-containers
|
||||
for the list of available *containers*
|
||||
-->
|
||||
|
||||
# Changes [[toc](#table-of-content)]
|
||||
|
||||
## Additions [[toc](#table-of-content)]
|
||||
|
||||
## Breaking changes [[toc](#table-of-content)]
|
||||
|
||||
## Deprecations [[toc](#table-of-content)]
|
||||
|
||||
## Removals [[toc](#table-of-content)]
|
||||
|
||||
## Bug fixes and other changes [[toc](#table-of-content)]
|
||||
|
||||
<!-- NOTE: to start investigating the contributions of last release, i like to list them all in a raw table.
|
||||
to achieve this, one can use the [`list-merged-prs` script from `nu_scripts`](https://github.com/nushell/nu_scripts/blob/main/make_release/release-note/list-merged-prs)
|
||||
as follows:
|
||||
|
||||
```nushell
|
||||
use ./make_release/release-note/list-merged-prs
|
||||
use std clip
|
||||
|
||||
let last_release_date = ^gh api /repos/nushell/nushell/releases
|
||||
| from json
|
||||
| into datetime published_at
|
||||
| get published_at
|
||||
| sort
|
||||
| last
|
||||
|
||||
let prs = list-merged-prs nushell/nushell $last_release_date
|
||||
| sort-by mergedAt
|
||||
| update url {|it| $"[#($it.number)]\(($it.url)\)" }
|
||||
| update author { $"[@($in)]\(https://github.com/($in)\)" }
|
||||
| select author title url
|
||||
| rename -c {url: pr}
|
||||
| to md --pretty
|
||||
|
||||
$prs | to md --pretty | clip
|
||||
```
|
||||
-->
|
||||
|
||||
# Notes for plugin developers [[toc](#table-of-content)]
|
||||
|
||||
# Hall of fame [[toc](#table-of-content)]
|
||||
|
||||
Thanks to all the contributors below for helping us solve issues and improve documentation :pray:
|
||||
|
||||
| author | title | url |
|
||||
| ------------------------------------ | ----------- | ------------------------------------------------------- |
|
||||
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |
|
||||
|
||||
# Full changelog [[toc](#table-of-content)]
|
||||
<!-- TODO:
|
||||
paste the output of
|
||||
```nu
|
||||
./make_release/release-note/get-full-changelog
|
||||
```
|
||||
here
|
||||
-->
|
||||
@@ -0,0 +1,62 @@
|
||||
# http get https://api.github.com/repos/nushell/nushell/pulls?q=is%3Apr+merged%3A%3E%3D2021-04-20+ | select html_url user.login title body
|
||||
# http get https://api.github.com/search/issues?q=repo:nushell/nushell+is:pr+is:merged+merged:%3E2021-05-08 | get items | select html_url user.login title body
|
||||
# Repos to monitor
|
||||
|
||||
def do-work [] {
|
||||
let site_table = [
|
||||
[site repo];
|
||||
[Nushell nushell]
|
||||
[Extension vscode-nushell-lang]
|
||||
[Documentation nushell.github.io]
|
||||
[Wasm demo]
|
||||
[Nu_Scripts nu_scripts] [RFCs rfcs]
|
||||
# ] [Jupyter jupyter]
|
||||
]
|
||||
|
||||
let query_prefix = "https://api.github.com/search/issues?q=repo:nushell/"
|
||||
let query_date = (seq date --days 21 -r | last)
|
||||
# We're looking for something like "is:pr is:merged merged:>=2021-05-31&per_page=100&page=1"
|
||||
let per_page = "100"
|
||||
let page_num = "1" # need to implement iterating pages
|
||||
let colon = "%3A"
|
||||
let gt = "%3E"
|
||||
let eq = "%3D"
|
||||
let amp = "%26"
|
||||
let query_suffix = $"+is($colon)pr+is($colon)merged+merged($colon)($gt)($eq)($query_date)&per_page=100&page=1"
|
||||
|
||||
let entries = ($site_table | each {|it|
|
||||
let query_string = $"($query_prefix)($it.repo)($query_suffix)"
|
||||
let site_json = (http get -u $env.GITHUB_USERNAME -p $env.GITHUB_PASSWORD $query_string | get items | select html_url user.login title body)
|
||||
print $"## ($it.site)(char nl)(char nl)"
|
||||
if ($site_json | all {is-empty}) {
|
||||
print $"none found this week(char nl)(char nl)"
|
||||
} else {
|
||||
print ($site_json | group-by user_login | transpose user prs | each { |row|
|
||||
let user_name = $row.user
|
||||
let pr_count = ($row.prs | length)
|
||||
|
||||
# only print the comma if there's another item
|
||||
let user_prs = ($row.prs | enumerate | each { |pr|
|
||||
if $pr_count == ($pr.index + 1) {
|
||||
print $"(char nl)### [($pr.item.title)](char lparen)($pr.item.html_url)(char rparen)(char nl)(char nl)($pr.item.body)(char nl)"
|
||||
} else {
|
||||
print $"(char nl)### [($pr.item.title)](char lparen)($pr.item.html_url)(char rparen)(char nl)(char nl)($pr.item.body)(char nl) and (char nl)"
|
||||
}
|
||||
} | str join)
|
||||
|
||||
print $"### **($user_name)**(char nl)(char nl)---(char nl)($user_prs)(char nl)"
|
||||
} | str join)
|
||||
print (char nl)
|
||||
}
|
||||
|
||||
# We need 2 seconds between fetches or github's api limiting will limit us
|
||||
sleep 2sec
|
||||
})
|
||||
|
||||
$entries | str join
|
||||
}
|
||||
|
||||
# 2019-08-23 was the release of 0.2.0, the first public release
|
||||
let week_num = (seq date -b '2019-08-23' -n 7 | length)
|
||||
print $"# This week in Nushell #($week_num)(char nl)(char nl)"
|
||||
print (do-work | str join)
|
||||
@@ -0,0 +1,63 @@
|
||||
# http get https://api.github.com/repos/nushell/nushell/pulls?q=is%3Apr+merged%3A%3E%3D2021-04-20+ | select html_url user.login title body
|
||||
# http get https://api.github.com/search/issues?q=repo:nushell/nushell+is:pr+is:merged+merged:%3E2021-05-08 | get items | select html_url user.login title body
|
||||
# Repos to monitor
|
||||
|
||||
def query-week-span [] {
|
||||
let site_table = [
|
||||
[site repo];
|
||||
[Nushell nushell]
|
||||
[Extension vscode-nushell-lang]
|
||||
[Documentation nushell.github.io]
|
||||
[Wasm demo]
|
||||
[Nu_Scripts nu_scripts]
|
||||
[RFCs rfcs]
|
||||
[reedline reedline]
|
||||
[Nana nana]
|
||||
# ] [Jupyter jupyter]
|
||||
]
|
||||
|
||||
let query_prefix = "https://api.github.com/search/issues?q=repo:nushell/"
|
||||
let query_date = (seq date --days 7 -r | get 6)
|
||||
let per_page = "100"
|
||||
let page_num = "1" # need to implement iterating pages
|
||||
let colon = "%3A"
|
||||
let gt = "%3E"
|
||||
let eq = "%3D"
|
||||
let amp = "%26"
|
||||
let query_suffix = $"+is($colon)pr+is($colon)merged+merged($colon)($gt)($eq)($query_date)&per_page=100&page=1"
|
||||
|
||||
for repo in $site_table {
|
||||
let query_string = $"($query_prefix)($repo.repo)($query_suffix)"
|
||||
let site_json = (http get -u $env.GITHUB_USERNAME -p $env.GITHUB_PASSWORD $query_string | get items | select html_url user.login title)
|
||||
|
||||
if not ($site_json | all { |it| $it | is-empty }) {
|
||||
print $"(char nl)## ($repo.site)(char nl)"
|
||||
|
||||
for user in ($site_json | group-by "user.login" | transpose user prs) {
|
||||
let user_name = $user.user
|
||||
let pr_count = ($user.prs | length)
|
||||
|
||||
print -n $"- ($user_name) created "
|
||||
for pr in ($user.prs | enumerate) {
|
||||
if $pr_count == ($pr.index + 1) {
|
||||
print -n $"[($pr.item.title)](char lparen)($pr.item.html_url)(char rparen)"
|
||||
} else {
|
||||
print -n $"[($pr.item.title)](char lparen)($pr.item.html_url)(char rparen), and "
|
||||
}
|
||||
}
|
||||
|
||||
print ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 2019-08-23 was the release of 0.2.0, the first public release
|
||||
let week_num = ((seq date -b '2019-08-23' -n 7 | length) - 1)
|
||||
print $"# This week in Nushell #($week_num)(char nl)"
|
||||
|
||||
if ($env | get -i GITHUB_USERNAME | is-empty) or ($env | get -i GITHUB_PASSWORD | is-empty) {
|
||||
print 'Please set GITHUB_USERNAME and GITHUB_PASSWORD in $env to use this script'
|
||||
} else {
|
||||
query-week-span
|
||||
}
|
||||
Reference in New Issue
Block a user