Skip to content

Commit 81b27e3

Browse files
authored
rename package file to nupm.nuon (#51)
1 parent f53aea7 commit 81b27e3

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ $env.PATH = (
5454

5555
## :test_tube: running a test suite [[toc](#table-of-content)]
5656
as it is done in Nupm, one can define tests in a project and run them with the `nupm test` command:
57-
- create a Nushell package with a `package.nuon` file, let's call this example package `package`
57+
- create a Nushell package with a `nupm.nuon` file, let's call this example package `package`
5858
- create a `tests/` directory next to the `package/` directory
5959
- `tests/` is a regular Nushell directory module, put a `mod.nu` there and any structure you want
6060
- import definitions from the package with something like

docs/design/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This file collects design ideas and directions. The intention is iterate on this
55
> **Note**
66
> in the following, until we settle down on precise names, we use the following placeholders:
77
> - `METADATA_FILE`: the file containing the metadata of a package,
8-
> e.g. `project.nuon`, `metadata.json` or `package.nuon`
8+
> e.g. `project.nuon`, `metadata.json` or `nupm.nuon`
99
> (name inspired by Julia's `Project.toml` or Rust's `Cargo.toml`)
1010
> - `NUPM_HOME`: the location of all the `nupm` files, overlays, scripts, libraries, ...,
1111
> e.g. `~/.nupm/`, `$env.XDG_DATA_HOME/nupm/` or `~/.local/share/nupm/`

package.nuon renamed to nupm.nuon

File renamed without changes.

nupm/install.nu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use utils/dirs.nu [ nupm-home-prompt script-dir module-dir tmp-dir ]
44
use utils/log.nu throw-error
55

66
def open-package-file [dir: path] {
7-
let package_file = $dir | path join "package.nuon"
7+
let package_file = $dir | path join "nupm.nuon"
88

99
if not ($package_file | path exists) {
1010
throw-error "package_file_not_found" (
11-
$'Could not find "package.nuon" in ($dir) or any parent directory.'
11+
$'Could not find "nupm.nuon" in ($dir) or any parent directory.'
1212
)
1313
}
1414

@@ -30,7 +30,7 @@ def open-package-file [dir: path] {
3030

3131
# Install list of scripts into a directory
3232
#
33-
# Input: Scripts taken from 'package.nuon'
33+
# Input: Scripts taken from 'nupm.nuon'
3434
def install-scripts [
3535
pkg_dir: path # Package directory
3636
scripts_dir: path # Target directory where to install
@@ -63,7 +63,7 @@ def install-scripts [
6363

6464
# Install package from a directory containing 'project.nuon'
6565
def install-path [
66-
pkg_dir: path # Directory (hopefully) containing 'package.nuon'
66+
pkg_dir: path # Directory (hopefully) containing 'nupm.nuon'
6767
--force(-f): bool # Overwrite already installed package
6868
] {
6969
let pkg_dir = $pkg_dir | path expand
@@ -128,7 +128,7 @@ def install-path [
128128

129129
do {
130130
cd $tmp_dir
131-
^$nu.current-exe $build_file ($pkg_dir | path join 'package.nuon')
131+
^$nu.current-exe $build_file ($pkg_dir | path join 'nupm.nuon')
132132
}
133133

134134
rm -rf $tmp_dir
@@ -147,7 +147,7 @@ def install-path [
147147
# Install a nupm package
148148
export def main [
149149
package # Name, path, or link to the package
150-
--path # Install package from a directory with package.nuon given by 'name'
150+
--path # Install package from a directory with nupm.nuon given by 'name'
151151
--force(-f) # Overwrite already installed package
152152
--no-confirm # Allows to bypass the interactive confirmation, useful for scripting
153153
]: nothing -> nothing {

nupm/test.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export def main [
1212

1313
if $pkg_root == null {
1414
throw-error "package_file_not_found" (
15-
$'Could not find "package.nuon" in ($dir) or any parent directory.'
15+
$'Could not find "nupm.nuon" in ($dir) or any parent directory.'
1616
)
1717
}
1818

nupm/utils/dirs.nu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ export def tmp-dir [subdir: string, --ensure]: nothing -> path {
8282
$d
8383
}
8484

85-
# Try to find the package root directory by looking for package.nuon in parent
85+
# Try to find the package root directory by looking for nupm.nuon in parent
8686
# directories.
8787
export def find-root [dir: path]: [ nothing -> path, nothing -> nothing] {
8888
let root_candidate = 1..($dir | path split | length)
8989
| reduce -f $dir {|_, acc|
90-
if ($acc | path join package.nuon | path exists) {
90+
if ($acc | path join nupm.nuon | path exists) {
9191
$acc
9292
} else {
9393
$acc | path dirname
9494
}
9595
}
9696

9797
# We need to do the last check in case the reduce loop ran to the end
98-
# without finding package.nuon
99-
if ($root_candidate | path join package.nuon | path type) == 'file' {
98+
# without finding nupm.nuon
99+
if ($root_candidate | path join nupm.nuon | path type) == 'file' {
100100
$root_candidate
101101
} else {
102102
null

0 commit comments

Comments
 (0)