related to
- https://github.com/nushell/nupm/pull/50
## description
`nu-scripts` was not really a package but rather a set of two module
packages.
this feature has been removed from Nupm in
https://github.com/nushell/nupm/pull/50 and this PR fixes the
`nu-scripts` packages.
> **Note**
> the files in `nu-hooks/` have been moved to `nu-hooks/nu-hooks/` to
fit into the current model of Nupm
this PR does not change anything from the user point of view, apart from
the install that goes from
```nushell
nupm install --path --force .
```
to
```nushell
for pkg in (ls **/package.nuon | get name | path dirname) {
nupm install --force --path $pkg
}
```
Closes#702. I was wrong in thinking the "night" and "storm" variants
should be much different — they're not. It's the divergent "moon"
variant between them that was missing. Added.
I have slight doubts about the darker gray `#828bb8` being used for e.g.
`ls` columns, but I think that basically correct. The high-contrast
foreground color `#c8d3f5` is the bright variant of that and should show
up in most other contexts I reckon.
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
```
* add the new `search_result` from nushell/nushell#9326
NOTE: color1 should be red-ish and color7 should be white-ish.
* regenerate all themes with the new `search_result` key
* add missing keys to the Nushell themes
these keys are "background", "foreground" and "cursor".
* remove the template
* update the theme generation script
* fix the local path to the lemnos themes
* use the real `export der main` module template
* remove the empty lines and the comments from theme files
* adapt the default config file theme to the template
This commit uses closures for `filesize`, `date` and `bool`.
* put quotes around all the colors in the template
* fix the `else` of `filesize` => returns a true record now
* use default colors for the filesize
* regenerate all the themes with `./make.nu`
* change the main command of the themes to `main`
Command used:
```
sd 'export def .* \[\] \{' 'export def main [] {' themes/themes/**/*
```
This commit mitigates the following equivalent error
```
>_ module spam { export def spam [] { "this is spam::spam" } }
Error: nu::parser::named_as_module
× Can't export command named same as the module.
╭─[entry #74:1:1]
1 │ module spam { export def spam [] { "this is spam::spam" } }
· ──┬─
· ╰── can't export from module spam
╰────
help: Module spam can't export command named the same as the module. Either change the module name, or export `main`
custom command.
```
when running `use themes/themes/dracula.nu` for instance.
* change the template as well to define a `main` function
* do not use * from the theme modules, they define a `main` function
* add my personal color config files
remove the useless colors.nu script
* add all lemnos theme files as a submodule
* add a template module from the default dark theme
the `map.csv` file:
```csv
code,bold,bash,nushell
0,false,black,black
1,false,red,red
2,false,green,green
3,false,yellow,yellow
4,false,blue,blue
5,false,magenta,purple
6,false,cyan,cyan
7,false,white,light_gray
8,true,black,dark_gray
9,true,red,red_bold
10,true,green,green_bold
11,true,yellow,yellow_bold
12,true,blue,blue_bold
13,true,magenta,purple_bold
14,true,cyan,light_cyan
14,true,cyan,cyan_bold
15,true,white,white
```
the command used was
```nushell
open map.csv |
each {
|it|
sed -i $"s/: ($it.nushell)$/: \"{{color($it.code)}}\"/" template.nu
}
```
or as a oneliner
```nushell
open map.csv | each {|it| sed -i $"s/: ($it.nushell)$/: \"{{color($it.code)}}\"/" template.nu}
```
* add a script to make all the scripts at once
* make all the themes
* add a README with some credits to lemnos
* add usage instructions to the README
* add desired values to the template
This commit adds the background, the foreground and the cursor
colors to the themes as commented lines.
These do not fit into any nushell theme as they should be set by the
terminal emulator, but they are included here for completeness.
Addresses https://github.com/nushell/nu_scripts/pull/286#issuecomment-1230814914
* regenerate the themes with the new template
* remove all the occurences of sed by str replace
* remove the lemnos submodule
Co-authored-by: amtoine <44101798+AntoineStevan@users.noreply.github.com>