Commit Graph

1024 Commits

Author SHA1 Message Date
Antoine Stevan
14459f923b
make hooks a module (#650) 2023-10-23 19:51:49 +03:00
Antoine Stevan
cc0719bdad
make the themes a module (#648)
related to
- https://github.com/nushell/nupm/pull/33

## description
with https://github.com/nushell/nupm/pull/33, Nupm can now install
separate modules from a single package 🥳

the `nu_scripts` are a package and looks like they contain a few
potential standalone modules:
- the themes
- the hooks
- the custom completions
- ...

this PR is a proposal to move `themes/` to `nu-themes/` and add
`./nu-themes/` as a module to the `nu-scripts` package.
that way when running `nupm install --path .` in the root of the
`nu_scripts`, a `nu-themes` module will be installed in
`$env.NUPM_HOME/modules`.

then one can run
```nushell
use nu-themes/themes/nushell-dark.nu
```
and next get the theme with
```nushell
nushell-dark
```
2023-10-23 18:25:04 +02:00
Hullabaloo-and-Howdy-Do
2fa5caa586
null-stream.nu as stdlib-candidate (#649)
This is a way to redirect to a null stream with the same syntax
regardless of platform.
2023-10-23 17:57:50 +02:00
Antoine Sébert
7b2856ddff
fix: replace -c ['name' 'connection'] by --column { name: connection } (#646)
The documentation states that the flag `-c`/`--column` now takes a
record as argument instead of an array:
https://www.nushell.sh/commands/docs/rename.html#flags.

I have made the change, and you can check in a nu prompt that it works
as intended:
```nu
let input = (^lsof +c 0xFFFF -i -n -P)
let header = ($input | lines
	| take 1
	| each { str downcase | str replace ' name$' ' name state' })
let body = ($input | lines
	| skip 1
	| each { str replace '([^)])$' '$1 (NONE)' | str replace ' \((.+)\)$' ' $1' })
[$header] | append $body
	| to text
	| detect columns
	| upsert 'pid' { |r| $r.pid | into int }
	| rename --column { name: connection }
```
2023-10-19 15:28:19 -05:00
Antoine Stevan
ed9165fda1
fix removed commands (#645)
related to
- https://github.com/nushell/nushell/pull/10567
- https://github.com/nushell/nushell/pull/10668
- https://github.com/nushell/nushell/pull/10568

this PR removes mentions to removed commands from
https://github.com/nushell/nushell/pull/10567,
https://github.com/nushell/nushell/pull/10668 and
https://github.com/nushell/nushell/pull/10568.

the main change has been introduced with
```nushell
sd 'random integer' 'random int' **/*.nu
```

running `rg "$nothing|random integer|to xml .* --pretty"` gives
- before
```
modules/random-list/random-list.nu
85:# Generate a random integer list.
95:        random integer $range

modules/fun/wordle.nu
11:  let word = ($words | get (random integer 0..($words | length)) | get column1)

benchmarks/random-bytes.nu
5:        | each { random integer }

sourced/misc/password_generator/ReadMe.md
84:Obviously you can just use the `random chars` or `random integers` commands but I like to have words I can read in my passwords, and I think those generated by this script have sufficient entropy.

sourced/misc/password_generator/nupass.nu
43:  let random_numbers = (1..$words | par-each { |i| (random integer 0..99) } --threads $threads)
71:    return (0..($words - 1) | each { |it| (random integer 0..99 | into string) + ($random_words | get $it) } | reduce { |it
, acc| $acc + $it })
92:    | get (random integer 1..($numlines))
99:        let rint = (random integer 1..4)
119:    | get (random integer 0..($symbolcharslen - 1))
```
- after
```
modules/random-list/random-list.nu
85:# Generate a random integer list.

sourced/misc/password_generator/ReadMe.md
84:Obviously you can just use the `random chars` or `random integers` commands but I like to have words I can read in my passwords, and I think those generated by this script have sufficient entropy.
```
2023-10-19 19:35:23 +02:00
Eric Hodel
c93ce14fc9
Improved CDPATH (#644)
This updated `c` command supports:
* Changing to the previous directory with `c -`
* Changing to absolute directories
* Completion of CDPATH entries
* Completion of absolute paths
* Completion of children

When completing CDPATH entries the parent directory is shown to provide
context in case multiple CDPATH entries have the same child directory
names.

Fixes #244
2023-10-19 06:35:32 -05:00
fj0r
c39a41ad2d
replace def-env with def --env (#641)
- upgrade to 0.86

Co-authored-by: agent <agent@nuc>
2023-10-18 06:25:54 -05:00
fj0r
0a030b524b
upgrade to 0.86 (#640)
- upgrade to 0.86
- power.nu: new time's colorscheme `rainbow`

Co-authored-by: agent <agent@nuc>
2023-10-17 20:34:20 -05:00
Alexandre Nédélec
35669a39a9
Move def before extern in winget-completions.nu (#638) 2023-10-15 17:03:53 -05:00
Antoine Stevan
bc89655422
make_release: do not annotate boolean switches in public API (#635)
related to
- https://github.com/nushell/nushell/pull/10456
- https://github.com/nushell/nushell.github.io/pull/1071

## description
after the changes on boolean switches from
https://github.com/nushell/nushell/pull/10456, we need to not annotate
then with `: bool` when part of a public API.

this PR is required for
https://github.com/nushell/nushell.github.io/pull/1071 to move forward.
2023-10-14 16:19:04 +02:00
Bob Hyman
907612cc70
Add widget for nu exe (debug/release, and main vs other branch) (#634)
Full line prompt looks like:
```
---<exeStatus>---------- <workingDirectory> ------ <gitRepoStatus> --- <dirs>
>
```
Where `<exeStatus>` shows `<exe-path> <exe-branch>`, 
but is empty if:
* nu exe running from a "bin" folder (based on `$nu.current-exe` path)
* nu exe built from a "main" branch (otherwise shows `(version | get
branch)`)
2023-10-14 06:35:05 -05:00
Antoine Stevan
4fe113714a
add a section about *after the release* in the release README (#560)
i thought some words about what happens *after the release* could be
worth adding to the release guide 😋
2023-10-14 09:40:05 +02:00
Antoine Stevan
a68382130c
enhance release note PR template (#618)
in this PR i propose
- to add a note about the use of a "breaking change" banner when
detailing a breaking change in it's own section
👉 see the [*Pythonesque operators removal* section of
0.85](https://www.nushell.sh/blog/2023-09-19-nushell_0_85_0.html#pythonesque-operators-removal)
- because we have had these sections for a few releases now, add "hall
of fame" and "changed to commands" sections
2023-10-14 09:39:24 +02:00
Piepmatz
85da8c2fb5
Use Existing Path Env Var for FNM (#632)
The module for `fnm` did not set the path for Windows correctly. I fixed
it by searching for the used `Path` variable (or `PATH`) and use that
instead.

Works now better on Windows without breaking other OSes.
2023-10-07 16:25:15 +02:00
fj0r
c9d63946ec
mask-completions (#631)
- mask-completions
- kubernetes: rename kgpw to kwp

---------

Co-authored-by: agent <agent@nuc>
2023-10-07 12:26:58 +02:00
Antoine Stevan
1019cca060
update the direnv hook (#628)
i wanted to install and run `direnv` with Nushell, came accross this
hook and thought i could update it a bit 😋


## changelog
- make `config.nu` possible to `source` => it will add the hook to the
list of hooks, without overwriting
- will run the hook on environment change thank to
`$env.config.hooks.env_change.PWD` instead of
`$env.config.hooks.pre_prompt` => i think this is the most controversial
change, we can discuss that of course
- checks if `direnv` is in the `PATH` before running the rest of the
hook
- uses a oneliner with `default` to load the environment
- uses directly a closure instead of string
- the comments were out of date, so i removed them

i tested this before and after and i think this works just as before
😌
2023-10-04 19:33:11 +02:00
Sam Vente
dae6115d4d
add tests to str.nu (#627)
As requested by @amtoine 😋

---------

Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
2023-10-02 19:12:08 +02:00
Sam Vente
150105f93f
Add gnu wc wrapper (#625)
Wasn't quite sure where to place this, if anyone has a better place for
it please let me know. It's a nice wrapper around the gnu `wc` command
that gives you named columns back. Nice imo, since I always forget which
number means which.
2023-09-30 17:14:19 -05:00
Sam Vente
20a297be73
Add str append to stdlib-candidate (#626)
As discussed in https://github.com/nushell/nushell/issues/10486 I've
added an stdlib-candidate folder where we can add scripts that might
want to be in std-lib at some point. Currently it only contains `str
append` and `str prepend` which work about how you'd expect. Thanks to
@amtoine for writing the initial function. I added a default branch that
just returns the input unaltered so it can be used more easily in the
middle of a pipe.
2023-09-30 17:13:46 -05:00
Antoine Stevan
9d21cd5cd3
Add cartesian product to math module (#624)
related to
- https://github.com/nushell/nushell/pull/10383

this PR resurrects the `cartesian product` command from
https://github.com/nushell/nushell/pull/10383 and adds it to the `maths`
module of the `nu_scripts`:
- a new `cartesian product` command
- some unit tests for it

## use the command
i've installed the `nu_scripts` with `nupm`, thus i'm able to do
```nushell
use nu-scripts/modules/maths/math_functions.nu "cartesian product"
cartesian product ...
```

## run the tests
from the root of the `nu_scripts`, checked out on this PR, run
```nushell
use std; std testing run-tests --path modules/maths/ --test cartesian_product
```
2023-09-30 09:46:04 -05:00
Stefan Holderbach
6947014306
Replace use of $nothing with null (#621)
`$nothing` will be deprecated in nu 0.86

This accompanies
- https://github.com/nushell/nushell/pull/10478
2023-09-26 18:52:49 +02:00
Marc Schreiber
9ceac61989
Fix git-completions.nu (#620)
The parsing of local git branches accidentally escaped an asterisks
because it had been used as an regular expression in the past.
2023-09-25 06:39:43 -05:00
1adept
6745d1cf93
Fix: Completions Broken '-s' flag in man-completions (#619)
With 85.0 the deprecated `-s` flag in `str replace` was removed because
its matched against a substring automatically now.
2023-09-24 11:05:37 +02:00
Faïz Hernawan
9d0a182a86
completions/git: add filename completion to diff and checkout (#617) 2023-09-22 16:29:05 -05:00
marcel
c3086bc833
only change func name (#614) 2023-09-22 18:20:22 +02:00
fj0r
470ad04bc5
git-v2: new command gcf for copying files from other branch (#616)
`_git_log`: use `git --reverse` instead of nushell's reverse
        `nu-complete git log all`(gcp): show tags of all branches
        rename `gcf` to `gcl`
        new `gcf` for copying files from other branch

Co-authored-by: agent <agent@nuc>
2023-09-22 07:45:59 -05:00
marcel
d459a7de1d
use 0.85 valid syntax (#615) 2023-09-21 10:47:30 -05:00
baehyunsol
79fcd05525
use repeat instead of string multiplication (#612) 2023-09-21 13:20:49 +02:00
Stefan Holderbach
36a45f28a3
Move random/into decimal to random/into float (#606)
* Move `random-list decimal` to `random-list float`

Updates internally to `random float` published with `0.85`

* Update kubernetes wrapper to `into float`

* Update temp script to `into float`

* Update `nupass` to `random float`
2023-09-20 19:13:52 +02:00
Antoine Stevan
e64355b2ce
tix the release note PR opening script (#611)
* remove `str replace --string`

related to nushell/nushell#10064

* remove the return

lol otherwise of course it won't work xD
2023-09-20 18:58:59 +02:00
fj0r
2cbd0de3d4
kubernetes/kn: create namespace when it doesn't exist (#610)
* kubernetes/kn: create namespace when it doesn't exist

* upgrade to 0.85: decimal -> float

---------

Co-authored-by: agent <agent@nuc>
2023-09-20 06:30:48 -05:00
Stefan Holderbach
30b06ccc3d
Update the bump-version script (#609)
Remove deprecated `--string` of `str replace`
Use `version = ""` for config as well as folks want to have the same
experience in `rg`
2023-09-19 05:55:53 -05:00
Antoine Stevan
56d948e787
fix scripts (#594) 2023-09-16 10:41:46 +02:00
WindSoilder
920cf73cbb
Improve background job.nu (#607)
* add Q&A session in README, and add `--label`, `--group` flag to spawn, add `output` sub command to acquire output easily

* make detailed to be a flag
2023-09-14 06:28:08 -05:00
Zinvoke
c352f26154
FEATURE: add catppuccin-mocha theme (#601)
* FEATURE: add `catppuccin-mocha` theme

* FEATURE: add `catppuccin-mocha` theme
2023-09-12 18:20:16 -05:00
Marshall Bruner
8260da5fb9
Change nu_conda list to output active status of environment as well (#604) (#605) 2023-09-12 14:50:42 -05:00
WindSoilder
e61b94efce
use closure instead of block (#602) 2023-09-12 08:41:12 -05:00
Antoine Stevan
cfd7a7950b
add a typeof command (#597)
* add the `typeof` command

* add some tests
2023-09-10 08:13:04 -05:00
Antoine Stevan
6255be7ffa
add $.type to package.nuon (#582)
related to nushell/nupm#12
2023-09-10 13:24:05 +02:00
icp
51cc782344
feat(hooks): add rusty-paths.nu (#596) 2023-09-10 10:40:59 +02:00
Antoine Stevan
0dd97178ad
add the random-bytes benchmark (#595)
* add the `random-bytes` benchmark

* add report
2023-09-08 12:24:01 -05:00
daniel sieradski
411496d311
Add support for fnm (#593)
* add fnm

Signed-off-by: Daniel Sieradski <daniel@self.agency>

* restore path list

---------

Signed-off-by: Daniel Sieradski <daniel@self.agency>
2023-09-08 06:18:55 -05:00
fnuttens
11bc9c6d33
Add eza aliases (#591)
eza is an active fork of exa, which is now unmaintained.
See https://github.com/ogham/exa/issues/1243
2023-09-07 08:36:19 -05:00
Maxim Uvarov
5ed3a961af
Update bar function (#589)
* fix indexing issue

* [bar] make default output without ansi codes

* [bar] use actual testing framework
2023-09-01 07:18:21 -05:00
Noah
4cbd678d78
Expand git completions (#587)
* Complete popping a particular stash

* Add some missing git completions

* Git prune subcommand

* Add filepath completion for `git add`
2023-08-31 07:46:59 -05:00
Antoine Sébert
45c051dad0
Add dfr before into df and into nu (#585)
It seems that the file is slightly out-of-date.
2023-08-24 06:11:39 -05:00
Chris Dawkins
745896c85a
init nix scripts (#584)
Commands for working with nix package manager.
2023-08-23 14:01:50 -05:00
fj0r
e5cf9b15ae
Upgraded to 0.84 (#583)
`gig` for editing .gitignore
export aliases of `docker.nu`
implement `kdh` without helm-diff installed

Co-authored-by: agent <agent@nuc>
2023-08-23 06:23:14 -05:00
Stefan Holderbach
f2e35e153c
Script to generate the excerpt of the GH release (#566)
* Script to generate the excerpt of the GH release

This will add a list of PR authors so they will be shown with a profile
image at the end of the GH release.

* Update make_release/release-note/gh-release-excerpt

Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>

* Sort authors, feeks default release cycle

---------

Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
2023-08-23 00:42:15 +02:00
Darren Schroeder
459b8c9d4f
fix the other place (#581) 2023-08-18 12:45:18 -05:00