valise-sh 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +320 -9
- package/README.md +104 -127
- package/bin/valise +67 -3266
- package/docs/architecture.md +76 -51
- package/docs/contrib-modules.md +180 -173
- package/docs/installation.md +210 -69
- package/docs/module-abi.md +211 -148
- package/docs/projects.md +249 -0
- package/docs/release-policy.md +90 -11
- package/docs/shared-modules.md +149 -26
- package/examples/README.md +20 -8
- package/examples/e2e/README.md +61 -68
- package/examples/e2e/bundles.tsv +6 -0
- package/examples/e2e/module.d/e2e_aliases.meta +1 -2
- package/examples/e2e/module.d/e2e_completions_bash.meta +0 -1
- package/examples/e2e/module.d/e2e_completions_zsh.meta +0 -1
- package/examples/e2e/module.d/e2e_env_setup.meta +2 -3
- package/examples/e2e/module.d/e2e_fish_features.meta +0 -1
- package/examples/e2e/module.d/e2e_generated_config.meta +1 -2
- package/examples/e2e/module.d/e2e_ksh_features.meta +0 -1
- package/examples/e2e/module.d/e2e_layer_probe.meta +1 -2
- package/examples/e2e/module.d/e2e_optional_network.meta +1 -2
- package/examples/e2e/module.d/e2e_platform_tools.meta +8 -0
- package/examples/e2e/module.d/e2e_platform_tools_bsd.meta +2 -3
- package/examples/e2e/module.d/e2e_platform_tools_darwin.meta +2 -3
- package/examples/e2e/module.d/e2e_platform_tools_linux.meta +2 -3
- package/examples/e2e/valise.conf +4 -0
- package/examples/e2e/variants.tsv +3 -0
- package/examples/local/module.d/hello_valise.meta +1 -2
- package/examples/profile-project/README.md +151 -0
- package/examples/profile-project/bundles.tsv +8 -0
- package/examples/profile-project/layers/demo/module.d/contrib_demo_greeting.meta +9 -0
- package/examples/profile-project/layers/demo/modules/shared/contrib_demo_greeting.sh +4 -0
- package/examples/profile-project/module.d/greeting.meta +9 -0
- package/examples/profile-project/module.d/profile_main.meta +8 -0
- package/examples/profile-project/modules/greeting.sh +5 -0
- package/examples/profile-project/valise.conf +4 -0
- package/examples/profile-project/variants.tsv +3 -0
- package/examples/shared/README.md +13 -34
- package/examples/shared/module.d/contrib_shared_paths.meta +2 -3
- package/examples/shared/module.d/contrib_shared_umask.meta +1 -2
- package/examples/shared/modules/shared/contrib_shared_paths.sh +2 -2
- package/lib/capabilities.sh +40 -13
- package/lib/cli/commands.sh +278 -0
- package/lib/cli/common.sh +326 -0
- package/lib/cli/devtools.sh +539 -0
- package/lib/cli/fish-hook.sh +986 -0
- package/lib/cli/integration.sh +337 -0
- package/lib/cli/lifecycle.sh +578 -0
- package/lib/cli/project.sh +1807 -0
- package/lib/cli/store.sh +1023 -0
- package/lib/cli/usage.sh +308 -0
- package/lib/compiler.awk +352 -24
- package/lib/fish/loader.fish +163 -28
- package/lib/fish/metadata.fish +62 -19
- package/lib/fish/profile.fish +170 -0
- package/lib/loader.sh +736 -158
- package/lib/metadata.sh +137 -55
- package/manifests/parser-support.tsv +2 -2
- package/module.d/valise_editor.meta +9 -0
- package/module.d/valise_history.meta +9 -0
- package/module.d/valise_pager.meta +9 -0
- package/module.d/valise_path.meta +9 -0
- package/module.d/{platform_bsd.meta → valise_platform_bsd.meta} +3 -4
- package/module.d/{platform_linux.meta → valise_platform_linux.meta} +3 -4
- package/module.d/{platform_macos.meta → valise_platform_macos.meta} +3 -4
- package/module.d/{platform_posix.meta → valise_platform_posix.meta} +2 -3
- package/module.d/valise_xdg.meta +9 -0
- package/modules/system/{contrib_editor.sh → valise_editor.sh} +2 -2
- package/modules/system/{contrib_history.sh → valise_history.sh} +2 -2
- package/modules/system/{contrib_pager.sh → valise_pager.sh} +2 -2
- package/modules/system/{contrib_path.sh → valise_path.sh} +3 -3
- package/modules/system/{contrib_xdg.sh → valise_xdg.sh} +2 -2
- package/package.json +91 -9
- package/docs/variants.md +0 -63
- package/entrypoints/.gitkeep +0 -0
- package/entrypoints/fish/profile.fish +0 -99
- package/examples/e2e/build-manifest.sh +0 -250
- package/examples/local/.gitkeep +0 -0
- package/lib/.gitkeep +0 -0
- package/manifests/.gitkeep +0 -0
- package/module.d/.gitkeep +0 -0
- package/module.d/contrib_editor.meta +0 -10
- package/module.d/contrib_history.meta +0 -10
- package/module.d/contrib_pager.meta +0 -10
- package/module.d/contrib_path.meta +0 -10
- package/module.d/contrib_xdg.meta +0 -10
- package/modules/.gitkeep +0 -0
package/examples/e2e/README.md
CHANGED
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
# End-to-end example
|
|
2
2
|
|
|
3
|
-
This directory is a
|
|
4
|
-
|
|
5
|
-
dependencies, and composition with the shared provider in
|
|
3
|
+
This directory is a valise project used by `tests/e2e.test.sh`. Its modules
|
|
4
|
+
exercise dependencies, shell and platform selection, exports, optional
|
|
5
|
+
dependencies, a Fish module, and composition with the shared provider in
|
|
6
|
+
`examples/shared/`.
|
|
6
7
|
|
|
7
8
|
## Modules
|
|
8
9
|
|
|
9
10
|
| Module | Shells | Platforms | Depends on | Export |
|
|
10
11
|
|---|---|---|---|---|
|
|
11
|
-
| `e2e_env_setup` |
|
|
12
|
-
| `e2e_aliases` |
|
|
12
|
+
| `e2e_env_setup` | posix | any | `valise_platform_posix` | `e2e_env_ready` |
|
|
13
|
+
| `e2e_aliases` | posix | any | `e2e_env_setup` | `e2e_show_aliases` |
|
|
13
14
|
| `e2e_completions_bash` | bash | any | `e2e_aliases` | `e2e_bash_completions_loaded` |
|
|
14
15
|
| `e2e_completions_zsh` | zsh | any | `e2e_aliases` | `e2e_zsh_completions_loaded` |
|
|
15
16
|
| `e2e_ksh_features` | ksh | any | `e2e_env_setup` | `e2e_ksh_loaded` |
|
|
16
17
|
| `e2e_fish_features` | fish | any | optional `e2e_env_setup` | `e2e_fish_loaded` |
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
| `e2e_platform_tools` | posix | any | `e2e_env_setup`, optional the three below | none |
|
|
19
|
+
| `e2e_platform_tools_darwin` | posix | darwin | `valise_platform_macos` | `e2e_darwin_tools_ready` |
|
|
20
|
+
| `e2e_platform_tools_linux` | posix | linux | `valise_platform_linux` | `e2e_linux_tools_ready` |
|
|
21
|
+
| `e2e_platform_tools_bsd` | posix | bsd | `valise_platform_bsd` | `e2e_bsd_tools_ready` |
|
|
22
|
+
| `e2e_optional_network` | posix | any | optional `e2e_env_setup` | `e2e_net_available` |
|
|
23
|
+
| `e2e_generated_config` | posix | any | `e2e_env_setup` | `e2e_config_loaded` |
|
|
24
|
+
| `e2e_layer_probe` | posix | any | `e2e_env_setup`, optional `contrib_shared_paths` | `e2e_layer_probe_ok` |
|
|
25
|
+
|
|
26
|
+
`bundles.tsv` gives each shell its roots. The POSIX rows name
|
|
27
|
+
`e2e_platform_tools`, which lists the per-platform modules as optional
|
|
28
|
+
dependencies: a platform module that does not match the running system is
|
|
29
|
+
skipped quietly, while naming it as a root would be a strict-mode failure on
|
|
30
|
+
every other platform. `variants.tsv` has `default` and `no-network`, which
|
|
31
|
+
excludes `e2e_optional_network`.
|
|
32
|
+
|
|
33
|
+
`e2e_layer_probe` optionally depends on `contrib_shared_paths` from the
|
|
34
|
+
shared provider. Without the provider it reports a standalone load; with the
|
|
35
|
+
provider vendored as a layer it reports that the layer resolved.
|
|
36
|
+
|
|
37
|
+
## Build, install, and load
|
|
29
38
|
|
|
30
39
|
Run these commands from the repository root. Installation writes shell
|
|
31
40
|
integration under `HOME`; this example uses a temporary home so it does not
|
|
@@ -33,7 +42,7 @@ touch your normal startup files.
|
|
|
33
42
|
|
|
34
43
|
```sh
|
|
35
44
|
export PATH="$PWD/bin:$PATH"
|
|
36
|
-
|
|
45
|
+
valise -C examples/e2e build
|
|
37
46
|
|
|
38
47
|
_demo=$(mktemp -d)
|
|
39
48
|
mkdir -p "$_demo/home"
|
|
@@ -42,39 +51,24 @@ export XDG_DATA_HOME="$_demo/data"
|
|
|
42
51
|
export XDG_CONFIG_HOME="$_demo/config"
|
|
43
52
|
export XDG_STATE_HOME="$_demo/state"
|
|
44
53
|
|
|
45
|
-
(cd examples/e2e && valise install)
|
|
46
|
-
valise verify
|
|
54
|
+
(cd examples/e2e/build/release && valise install)
|
|
55
|
+
valise release verify
|
|
47
56
|
```
|
|
48
57
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
58
|
+
`valise build` writes the release to `examples/e2e/build/release`: one plan
|
|
59
|
+
per POSIX shell class under `plans/`, the Fish runtime under `runtime/fish/`,
|
|
60
|
+
and only the modules some shell loads. `valise install` seals it, makes it
|
|
61
|
+
active, and writes the managed block to `~/.profile` (plus `~/.bashrc` or
|
|
62
|
+
`~/.zshrc` for those shells) and the Fish hook.
|
|
53
63
|
|
|
54
|
-
|
|
64
|
+
Start a shell through the startup file valise wrote:
|
|
55
65
|
|
|
56
66
|
```sh
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
VALISE_MODULES='e2e_env_setup e2e_aliases e2e_generated_config e2e_optional_network' \
|
|
60
|
-
VALISE_MODE=strict \
|
|
61
|
-
. "$_active/entrypoints/profile.sh"
|
|
62
|
-
|
|
63
|
-
e2e_env_ready
|
|
64
|
-
e2e_show_aliases
|
|
65
|
-
e2e_config_loaded
|
|
67
|
+
bash -c '. "$HOME/.bashrc"; e2e_env_ready; e2e_show_aliases; e2e_config_loaded'
|
|
68
|
+
fish -c 'functions -q e2e_fish_loaded; and valise release verify'
|
|
66
69
|
```
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
the sealed release at startup, so set the module list in the child's
|
|
70
|
-
environment before starting Fish:
|
|
71
|
-
|
|
72
|
-
```sh
|
|
73
|
-
VALISE_MODULES=e2e_fish_features VALISE_MODE=strict fish -c \
|
|
74
|
-
'functions -q e2e_fish_loaded; and valise verify-active'
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
When finished, stop using the functions and remove the temporary installation:
|
|
71
|
+
When finished, remove the temporary installation:
|
|
78
72
|
|
|
79
73
|
```sh
|
|
80
74
|
chmod -R u+w "$_demo"
|
|
@@ -83,31 +77,30 @@ rm -rf "$_demo"
|
|
|
83
77
|
|
|
84
78
|
## Shared provider composition
|
|
85
79
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
and verification above, load the cross-root probe and shared utilities:
|
|
80
|
+
A project composes a provider by vendoring its tree as `layers/<provider>/`.
|
|
81
|
+
To try it, copy this project, vendor `examples/shared/` as `layers/shared/`,
|
|
82
|
+
and add the provider's modules to the POSIX roots:
|
|
90
83
|
|
|
91
84
|
```sh
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
contrib_shared_paths_setup
|
|
101
|
-
contrib_shared_umask_secure # explicitly changes umask to 077
|
|
85
|
+
_proj=$(mktemp -d)
|
|
86
|
+
cp -R examples/e2e/valise.conf examples/e2e/variants.tsv \
|
|
87
|
+
examples/e2e/module.d examples/e2e/modules "$_proj/"
|
|
88
|
+
mkdir -p "$_proj/layers/shared"
|
|
89
|
+
cp -R examples/shared/module.d examples/shared/modules "$_proj/layers/shared/"
|
|
90
|
+
awk -F '\t' 'BEGIN { OFS = "\t" } NR > 1 && $2 != "fish" { $3 = $3 " contrib_shared_umask" } { print }' \
|
|
91
|
+
examples/e2e/bundles.tsv >"$_proj/bundles.tsv"
|
|
92
|
+
valise -C "$_proj" build
|
|
102
93
|
```
|
|
103
94
|
|
|
104
|
-
The
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
scenarios in quarantined homes
|
|
113
|
-
|
|
95
|
+
The release then carries the provider's modules under `layers/shared/`, and
|
|
96
|
+
`e2e_layer_probe_ok` reports that the shared layer resolved. The provider
|
|
97
|
+
modules are POSIX-only, so the Fish closure is unchanged. To update a
|
|
98
|
+
vendored provider in a real project, copy a reviewed commit, inspect the
|
|
99
|
+
diff, then rebuild and verify. See [the module ABI](../../docs/module-abi.md)
|
|
100
|
+
for dependency resolution and [the installation guide](../../docs/installation.md)
|
|
101
|
+
for the integrity and provenance limits.
|
|
102
|
+
|
|
103
|
+
`tests/e2e.test.sh` runs these scenarios in quarantined homes: every
|
|
104
|
+
available host shell, a tamper lane, and the composition lane. Configured
|
|
105
|
+
Lima Linux, BusyBox, and BSD guests run the same install and load checks
|
|
106
|
+
when their VMs are present.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
bundle shell roots
|
|
2
|
+
default sh e2e_env_setup e2e_generated_config e2e_optional_network e2e_layer_probe e2e_platform_tools
|
|
3
|
+
default bash e2e_env_setup e2e_generated_config e2e_optional_network e2e_layer_probe e2e_platform_tools e2e_aliases e2e_completions_bash
|
|
4
|
+
default zsh e2e_env_setup e2e_generated_config e2e_optional_network e2e_layer_probe e2e_platform_tools e2e_aliases e2e_completions_zsh
|
|
5
|
+
default ksh e2e_env_setup e2e_generated_config e2e_optional_network e2e_layer_probe e2e_platform_tools e2e_ksh_features
|
|
6
|
+
default fish e2e_fish_features
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
name=e2e_platform_tools_bsd
|
|
2
|
-
requires=
|
|
2
|
+
requires=valise_platform_bsd
|
|
3
3
|
optional=
|
|
4
|
-
shells=
|
|
4
|
+
shells=posix bash zsh ksh
|
|
5
5
|
platforms=bsd freebsd openbsd netbsd
|
|
6
6
|
side_effect=read-only
|
|
7
7
|
exports=e2e_bsd_tools_ready
|
|
8
|
-
updates=
|
|
9
8
|
load=modules/e2e/platform_tools_bsd.sh
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
name=e2e_platform_tools_darwin
|
|
2
|
-
requires=
|
|
2
|
+
requires=valise_platform_macos
|
|
3
3
|
optional=e2e_env_setup
|
|
4
|
-
shells=
|
|
4
|
+
shells=posix bash zsh ksh
|
|
5
5
|
platforms=darwin
|
|
6
6
|
side_effect=read-only
|
|
7
7
|
exports=e2e_darwin_tools_ready
|
|
8
|
-
updates=
|
|
9
8
|
load=modules/e2e/platform_tools_darwin.sh
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
name=e2e_platform_tools_linux
|
|
2
|
-
requires=
|
|
2
|
+
requires=valise_platform_linux
|
|
3
3
|
optional=
|
|
4
|
-
shells=
|
|
4
|
+
shells=posix bash zsh ksh
|
|
5
5
|
platforms=linux
|
|
6
6
|
side_effect=read-only
|
|
7
7
|
exports=e2e_linux_tools_ready
|
|
8
|
-
updates=
|
|
9
8
|
load=modules/e2e/platform_tools_linux.sh
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# profile-project: a small valise project
|
|
2
|
+
|
|
3
|
+
This project has two modules of its own, one module from a provider layer, a
|
|
4
|
+
bundle, and two variants. Everything is plain text; `valise` reads the
|
|
5
|
+
metadata and generates the rest.
|
|
6
|
+
|
|
7
|
+
## What is in it
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
valise.conf default bundle and variant
|
|
11
|
+
module.d/
|
|
12
|
+
profile_main.meta the root: requires greeting
|
|
13
|
+
greeting.meta defines greet
|
|
14
|
+
modules/
|
|
15
|
+
greeting.sh
|
|
16
|
+
layers/demo/ a provider layer
|
|
17
|
+
module.d/contrib_demo_greeting.meta
|
|
18
|
+
modules/shared/contrib_demo_greeting.sh
|
|
19
|
+
bundles.tsv the roots for bash, zsh, and ksh
|
|
20
|
+
variants.tsv default and workstation-lean
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`profile_main` is a meta module: it has `requires=greeting` and no body. It
|
|
24
|
+
names what the project loads. `greeting` is an ordinary module with
|
|
25
|
+
`shells=posix`.
|
|
26
|
+
|
|
27
|
+
The layer module is named `contrib_demo_greeting`, following the
|
|
28
|
+
`contrib_<owner>_<thing>` convention. A release copies it to
|
|
29
|
+
`layers/demo/`, so it cannot collide with the project's own files.
|
|
30
|
+
|
|
31
|
+
## Build it
|
|
32
|
+
|
|
33
|
+
From this directory:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
valise build
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
build/release/
|
|
41
|
+
valise-release.conf bundle, variant, roots, modules
|
|
42
|
+
manifest.tsv every file with its size and SHA-256
|
|
43
|
+
plans/bash.sh the compiled plan for bash
|
|
44
|
+
plans/zsh.sh
|
|
45
|
+
plans/ksh.sh
|
|
46
|
+
runtime/capabilities.sh the sp_cap_* helpers
|
|
47
|
+
module.d/, modules/ the project's modules
|
|
48
|
+
layers/demo/ the layer module
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The plans are plain POSIX shell; read one to see what will run at startup.
|
|
52
|
+
`bundles.tsv` has no `sh` row, so dash and other plain `sh` shells load
|
|
53
|
+
nothing.
|
|
54
|
+
|
|
55
|
+
## Load it
|
|
56
|
+
|
|
57
|
+
Run this in a scratch `HOME` (see the main README) unless you want it in your
|
|
58
|
+
real startup files:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
valise apply
|
|
62
|
+
bash -l -c greet
|
|
63
|
+
# hello from the valise profile project
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`apply` builds the release, installs it under your XDG data directory, and
|
|
67
|
+
writes a managed block into `~/.profile`, `~/.zprofile` when zsh is
|
|
68
|
+
installed, and `~/.bashrc` or `~/.zshrc` when that is your shell. It prints
|
|
69
|
+
each file it wrote. `valise apply --dry-run` prints what it would change
|
|
70
|
+
without changing it.
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
valise status
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
project: /path/to/profile-project
|
|
78
|
+
project default bundle: default
|
|
79
|
+
project default variant: default
|
|
80
|
+
integration: /home/you/.profile: managed block present
|
|
81
|
+
integration: /home/you/.zprofile: managed block present
|
|
82
|
+
active release: ad98ea2ba30bb6c6d4f08b6dec59585228cdf855b814543a37f80ee0f0518773
|
|
83
|
+
active bundle: default
|
|
84
|
+
active variant: default
|
|
85
|
+
active built by valise: 0.3.0
|
|
86
|
+
build output: /path/to/profile-project/build/release (bundle default, variant default)
|
|
87
|
+
drift: active release matches build output
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Edit a module and run `valise status` again after `valise build`: the drift
|
|
91
|
+
line reports that the active release no longer matches the build.
|
|
92
|
+
|
|
93
|
+
`valise uninstall` removes the managed blocks, the Fish hook, and the
|
|
94
|
+
installed releases.
|
|
95
|
+
|
|
96
|
+
## Try a variant
|
|
97
|
+
|
|
98
|
+
`workstation-lean` leaves out the layer module:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
valise explain-variant workstation-lean
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Variant: workstation-lean
|
|
106
|
+
Description: No provider layer
|
|
107
|
+
Excluded modules: contrib_demo_greeting@layers/demo/module.d
|
|
108
|
+
|
|
109
|
+
Per-shell impact (bundle default):
|
|
110
|
+
bash: 1 of 2 roots, 2 of 3 modules
|
|
111
|
+
zsh: 1 of 2 roots, 2 of 3 modules
|
|
112
|
+
ksh: 1 of 2 roots, 2 of 3 modules
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Build it with `valise apply --variant=workstation-lean`, or set
|
|
116
|
+
`variant=workstation-lean` in `valise.conf`. An exclusion that removes a
|
|
117
|
+
module something else still requires fails the build and names both
|
|
118
|
+
modules.
|
|
119
|
+
|
|
120
|
+
## Try a bundle
|
|
121
|
+
|
|
122
|
+
`bundles.tsv` lists the roots for each shell:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
default bash profile_main contrib_demo_greeting
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
A bare name means the project's own module when there is one, otherwise the
|
|
129
|
+
only module with that name. `name@layers/demo/module.d` names the layer's
|
|
130
|
+
copy exactly, which you need when two sources define the same name.
|
|
131
|
+
|
|
132
|
+
```sh
|
|
133
|
+
valise explain-bundles
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Check it
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
valise lint # metadata, layers, every bundle and variant, syntax
|
|
140
|
+
valise layer-lint demo
|
|
141
|
+
# layer demo: 1 module(s) validated
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Where to go next
|
|
145
|
+
|
|
146
|
+
- [Projects](../../docs/projects.md): bundles, variants, compile, and build.
|
|
147
|
+
- [Writing modules](../../docs/contrib-modules.md): authoring, linting, and
|
|
148
|
+
testing.
|
|
149
|
+
- [The module ABI](../../docs/module-abi.md): every metadata field.
|
|
150
|
+
- [Shared modules](../../docs/shared-modules.md): how layer modules are
|
|
151
|
+
named and owned.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
bundle shell roots
|
|
2
|
+
# Each row names a bundle, a shell (sh bash zsh ksh fish), and the
|
|
3
|
+
# space-separated root modules for that shell. A bare name means the module
|
|
4
|
+
# in module.d/, else the only module of that name; name@layers/<p>/module.d
|
|
5
|
+
# names a layer module exactly.
|
|
6
|
+
default bash profile_main contrib_demo_greeting
|
|
7
|
+
default zsh profile_main contrib_demo_greeting
|
|
8
|
+
default ksh profile_main contrib_demo_greeting
|
|
@@ -9,41 +9,20 @@ be pinned to a reviewed commit in the consuming project.
|
|
|
9
9
|
|
|
10
10
|
| Module | Version | Export | Behavior |
|
|
11
11
|
|---|---|---|---|
|
|
12
|
-
| `contrib_shared_paths` | 1.0.0 | `contrib_shared_paths_setup` | Adds `$HOME/.local/bin` and `$HOME/.go/bin` using `
|
|
12
|
+
| `contrib_shared_paths` | 1.0.0 | `contrib_shared_paths_setup` | Adds `$HOME/.local/bin` and `$HOME/.go/bin` using `valise_path_prepend`. |
|
|
13
13
|
| `contrib_shared_umask` | 1.0.0 | `contrib_shared_umask_secure` | Sets `umask 077` when explicitly called. |
|
|
14
14
|
|
|
15
15
|
The modules and their metadata are under `modules/shared/` and
|
|
16
16
|
`module.d/`. Layer-only modules use the `contrib_` prefix. The paths module
|
|
17
|
-
requires the engine's `
|
|
18
|
-
resolution from a layer into the
|
|
19
|
-
|
|
20
|
-
## Use in
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
cd examples/e2e
|
|
30
|
-
valise install
|
|
31
|
-
valise verify-active
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Then load the shared modules from a POSIX shell. The active release path
|
|
35
|
-
below uses the default XDG locations; if you set `XDG_CONFIG_HOME`, use that
|
|
36
|
-
instead.
|
|
37
|
-
|
|
38
|
-
```sh
|
|
39
|
-
_active=$(cd "$HOME/.config/valise/active" && pwd -P)
|
|
40
|
-
VALISE_MODULE_ROOT="$_active" \
|
|
41
|
-
VALISE_MODULE_PATH="$_active/layer/shared" \
|
|
42
|
-
VALISE_MODULES='e2e_layer_probe contrib_shared_umask' \
|
|
43
|
-
VALISE_MODE=strict \
|
|
44
|
-
. "$_active/entrypoints/profile.sh"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
For a Fish example and details about provider pinning, see
|
|
48
|
-
[the end-to-end walkthrough](../e2e/README.md) and the
|
|
49
|
-
[module ABI](../../docs/module-abi.md).
|
|
17
|
+
requires the engine's `valise_path` module; this exercises dependency
|
|
18
|
+
resolution from a layer into the engine's modules.
|
|
19
|
+
|
|
20
|
+
## Use in a project
|
|
21
|
+
|
|
22
|
+
A consuming project vendors this directory as `layers/<provider>/`, for
|
|
23
|
+
example `layers/shared/`, and names the modules it wants in `bundles.tsv` or
|
|
24
|
+
in the `requires=` and `optional=` fields of its own modules. `valise build`
|
|
25
|
+
then copies only the provider modules some plan loads into the release under
|
|
26
|
+
`layers/shared/`. [The end-to-end walkthrough](../e2e/README.md) shows the
|
|
27
|
+
steps against the sample project; see the [module ABI](../../docs/module-abi.md)
|
|
28
|
+
for dependency resolution across a project and its layers.
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
name=contrib_shared_paths
|
|
2
|
-
requires=
|
|
2
|
+
requires=valise_path
|
|
3
3
|
optional=
|
|
4
|
-
shells=
|
|
4
|
+
shells=posix bash zsh ksh
|
|
5
5
|
platforms=any
|
|
6
6
|
side_effect=path-env
|
|
7
7
|
exports=contrib_shared_paths_setup
|
|
8
|
-
updates=
|
|
9
8
|
version=1.0.0
|
|
10
9
|
load=modules/shared/contrib_shared_paths.sh
|