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.
Files changed (88) hide show
  1. package/CHANGELOG.md +320 -9
  2. package/README.md +104 -127
  3. package/bin/valise +67 -3266
  4. package/docs/architecture.md +76 -51
  5. package/docs/contrib-modules.md +180 -173
  6. package/docs/installation.md +210 -69
  7. package/docs/module-abi.md +211 -148
  8. package/docs/projects.md +249 -0
  9. package/docs/release-policy.md +90 -11
  10. package/docs/shared-modules.md +149 -26
  11. package/examples/README.md +20 -8
  12. package/examples/e2e/README.md +61 -68
  13. package/examples/e2e/bundles.tsv +6 -0
  14. package/examples/e2e/module.d/e2e_aliases.meta +1 -2
  15. package/examples/e2e/module.d/e2e_completions_bash.meta +0 -1
  16. package/examples/e2e/module.d/e2e_completions_zsh.meta +0 -1
  17. package/examples/e2e/module.d/e2e_env_setup.meta +2 -3
  18. package/examples/e2e/module.d/e2e_fish_features.meta +0 -1
  19. package/examples/e2e/module.d/e2e_generated_config.meta +1 -2
  20. package/examples/e2e/module.d/e2e_ksh_features.meta +0 -1
  21. package/examples/e2e/module.d/e2e_layer_probe.meta +1 -2
  22. package/examples/e2e/module.d/e2e_optional_network.meta +1 -2
  23. package/examples/e2e/module.d/e2e_platform_tools.meta +8 -0
  24. package/examples/e2e/module.d/e2e_platform_tools_bsd.meta +2 -3
  25. package/examples/e2e/module.d/e2e_platform_tools_darwin.meta +2 -3
  26. package/examples/e2e/module.d/e2e_platform_tools_linux.meta +2 -3
  27. package/examples/e2e/valise.conf +4 -0
  28. package/examples/e2e/variants.tsv +3 -0
  29. package/examples/local/module.d/hello_valise.meta +1 -2
  30. package/examples/profile-project/README.md +151 -0
  31. package/examples/profile-project/bundles.tsv +8 -0
  32. package/examples/profile-project/layers/demo/module.d/contrib_demo_greeting.meta +9 -0
  33. package/examples/profile-project/layers/demo/modules/shared/contrib_demo_greeting.sh +4 -0
  34. package/examples/profile-project/module.d/greeting.meta +9 -0
  35. package/examples/profile-project/module.d/profile_main.meta +8 -0
  36. package/examples/profile-project/modules/greeting.sh +5 -0
  37. package/examples/profile-project/valise.conf +4 -0
  38. package/examples/profile-project/variants.tsv +3 -0
  39. package/examples/shared/README.md +13 -34
  40. package/examples/shared/module.d/contrib_shared_paths.meta +2 -3
  41. package/examples/shared/module.d/contrib_shared_umask.meta +1 -2
  42. package/examples/shared/modules/shared/contrib_shared_paths.sh +2 -2
  43. package/lib/capabilities.sh +40 -13
  44. package/lib/cli/commands.sh +278 -0
  45. package/lib/cli/common.sh +326 -0
  46. package/lib/cli/devtools.sh +539 -0
  47. package/lib/cli/fish-hook.sh +986 -0
  48. package/lib/cli/integration.sh +337 -0
  49. package/lib/cli/lifecycle.sh +578 -0
  50. package/lib/cli/project.sh +1807 -0
  51. package/lib/cli/store.sh +1023 -0
  52. package/lib/cli/usage.sh +308 -0
  53. package/lib/compiler.awk +352 -24
  54. package/lib/fish/loader.fish +163 -28
  55. package/lib/fish/metadata.fish +62 -19
  56. package/lib/fish/profile.fish +170 -0
  57. package/lib/loader.sh +736 -158
  58. package/lib/metadata.sh +137 -55
  59. package/manifests/parser-support.tsv +2 -2
  60. package/module.d/valise_editor.meta +9 -0
  61. package/module.d/valise_history.meta +9 -0
  62. package/module.d/valise_pager.meta +9 -0
  63. package/module.d/valise_path.meta +9 -0
  64. package/module.d/{platform_bsd.meta → valise_platform_bsd.meta} +3 -4
  65. package/module.d/{platform_linux.meta → valise_platform_linux.meta} +3 -4
  66. package/module.d/{platform_macos.meta → valise_platform_macos.meta} +3 -4
  67. package/module.d/{platform_posix.meta → valise_platform_posix.meta} +2 -3
  68. package/module.d/valise_xdg.meta +9 -0
  69. package/modules/system/{contrib_editor.sh → valise_editor.sh} +2 -2
  70. package/modules/system/{contrib_history.sh → valise_history.sh} +2 -2
  71. package/modules/system/{contrib_pager.sh → valise_pager.sh} +2 -2
  72. package/modules/system/{contrib_path.sh → valise_path.sh} +3 -3
  73. package/modules/system/{contrib_xdg.sh → valise_xdg.sh} +2 -2
  74. package/package.json +91 -9
  75. package/docs/variants.md +0 -63
  76. package/entrypoints/.gitkeep +0 -0
  77. package/entrypoints/fish/profile.fish +0 -99
  78. package/examples/e2e/build-manifest.sh +0 -250
  79. package/examples/local/.gitkeep +0 -0
  80. package/lib/.gitkeep +0 -0
  81. package/manifests/.gitkeep +0 -0
  82. package/module.d/.gitkeep +0 -0
  83. package/module.d/contrib_editor.meta +0 -10
  84. package/module.d/contrib_history.meta +0 -10
  85. package/module.d/contrib_pager.meta +0 -10
  86. package/module.d/contrib_path.meta +0 -10
  87. package/module.d/contrib_xdg.meta +0 -10
  88. package/modules/.gitkeep +0 -0
@@ -1,31 +1,40 @@
1
1
  # End-to-end example
2
2
 
3
- This directory is a sample consuming profile. It includes twelve modules
4
- that exercise dependencies, shell and platform selection, exports, optional
5
- dependencies, and composition with the shared provider in `examples/shared/`.
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` | sh bash zsh ksh | any | `platform_posix` | `e2e_env_ready` |
12
- | `e2e_aliases` | sh bash zsh ksh | any | `e2e_env_setup` | `e2e_show_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
- | `e2e_platform_tools_darwin` | sh bash zsh ksh | darwin | `platform_macos` | `e2e_darwin_tools_ready` |
18
- | `e2e_platform_tools_linux` | sh bash zsh ksh | linux | `platform_linux` | `e2e_linux_tools_ready` |
19
- | `e2e_platform_tools_bsd` | sh bash zsh ksh | bsd | `platform_bsd` | `e2e_bsd_tools_ready` |
20
- | `e2e_optional_network` | sh bash zsh ksh | any | optional `e2e_env_setup` | `e2e_net_available` |
21
- | `e2e_generated_config` | sh bash zsh ksh | any | `e2e_env_setup` | `e2e_config_loaded` |
22
- | `e2e_layer_probe` | sh bash zsh ksh | any | `e2e_env_setup`, optional `contrib_shared_paths` | `e2e_layer_probe_ok` |
23
-
24
- `e2e_layer_probe` depends on a primary-root module and optionally on a
25
- module in the shared layer. It tests dependency resolution in both directions
26
- across the two roots.
27
-
28
- ## Build, install, and verify
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
- sh examples/e2e/build-manifest.sh
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-active
54
+ (cd examples/e2e/build/release && valise install)
55
+ valise release verify
47
56
  ```
48
57
 
49
- The build script copies the engine runtime and shared example into the e2e
50
- tree, then writes `shell/install/profile-release.manifest` with each file's
51
- size and SHA-256 digest. Generated release files are ignored by Git and can
52
- be rebuilt at any time.
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
- Load sample modules in a POSIX shell:
64
+ Start a shell through the startup file valise wrote:
55
65
 
56
66
  ```sh
57
- _active=$(cd "$XDG_CONFIG_HOME/valise/active" && pwd -P)
58
- VALISE_MODULE_ROOT="$_active" \
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
- Try the Fish module in a new Fish process. The installed `conf.d` hook loads
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
- The build script vendors `examples/shared/` under `layer/shared/` and records
87
- its source revision in `layer/shared/layer-pin.txt`. The release manifest
88
- covers both the profile and provider files. After the build, installation,
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
- _active=$(cd "$XDG_CONFIG_HOME/valise/active" && pwd -P)
93
- VALISE_MODULE_ROOT="$_active" \
94
- VALISE_MODULE_PATH="$_active/layer/shared" \
95
- VALISE_MODULES='e2e_layer_probe contrib_shared_paths contrib_shared_umask' \
96
- VALISE_MODE=strict \
97
- . "$_active/entrypoints/profile.sh"
98
-
99
- e2e_layer_probe_ok
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 provider modules are POSIX-only; Fish users can load the profile's Fish
105
- modules but not these utilities. To update the provider in a real consuming
106
- project, vendor a reviewed commit, inspect the diff, then rebuild and verify
107
- the release. See [the module ABI](../../docs/module-abi.md) for multi-root
108
- resolution and [the installation guide](../../docs/installation.md) for the
109
- integrity and provenance limits.
110
-
111
- `tests/e2e.test.sh` runs the install, verification, tamper, and composition
112
- scenarios in quarantined homes. It also runs available host-shell lanes;
113
- configured Lima Linux, BusyBox, and BSD lanes run when their VMs are present.
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_aliases
2
2
  requires=e2e_env_setup
3
3
  optional=
4
- shells=sh bash zsh ksh
4
+ shells=posix bash zsh ksh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_show_aliases
8
- updates=
9
8
  load=modules/e2e/aliases.sh
@@ -5,5 +5,4 @@ shells=bash
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_bash_completions_loaded
8
- updates=
9
8
  load=modules/e2e/completions_bash.sh
@@ -5,5 +5,4 @@ shells=zsh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_zsh_completions_loaded
8
- updates=
9
8
  load=modules/e2e/completions_zsh.sh
@@ -1,9 +1,8 @@
1
1
  name=e2e_env_setup
2
- requires=platform_posix
2
+ requires=valise_platform_posix
3
3
  optional=
4
- shells=sh bash zsh ksh
4
+ shells=posix bash zsh ksh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_env_ready
8
- updates=
9
8
  load=modules/e2e/env_setup.sh
@@ -5,5 +5,4 @@ shells=fish
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_fish_loaded
8
- updates=
9
8
  load=modules/e2e/fish_features.fish
@@ -1,9 +1,8 @@
1
1
  name=e2e_generated_config
2
2
  requires=e2e_env_setup
3
3
  optional=
4
- shells=sh bash zsh ksh
4
+ shells=posix bash zsh ksh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_config_loaded
8
- updates=
9
8
  load=modules/e2e/generated_config.sh
@@ -5,5 +5,4 @@ shells=ksh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_ksh_loaded
8
- updates=
9
8
  load=modules/e2e/ksh_features.sh
@@ -1,9 +1,8 @@
1
1
  name=e2e_layer_probe
2
2
  requires=e2e_env_setup
3
3
  optional=contrib_shared_paths
4
- shells=sh bash zsh ksh
4
+ shells=posix bash zsh ksh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_layer_probe_ok
8
- updates=
9
8
  load=modules/e2e/layer_probe.sh
@@ -1,9 +1,8 @@
1
1
  name=e2e_optional_network
2
2
  requires=
3
3
  optional=e2e_env_setup
4
- shells=sh bash zsh ksh
4
+ shells=posix bash zsh ksh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=e2e_net_available
8
- updates=
9
8
  load=modules/e2e/optional_network.sh
@@ -0,0 +1,8 @@
1
+ name=e2e_platform_tools
2
+ requires=e2e_env_setup
3
+ optional=e2e_platform_tools_darwin e2e_platform_tools_linux e2e_platform_tools_bsd
4
+ shells=posix
5
+ platforms=any
6
+ side_effect=read-only
7
+ exports=
8
+ load=
@@ -1,9 +1,8 @@
1
1
  name=e2e_platform_tools_bsd
2
- requires=platform_bsd
2
+ requires=valise_platform_bsd
3
3
  optional=
4
- shells=sh bash zsh ksh
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=platform_macos
2
+ requires=valise_platform_macos
3
3
  optional=e2e_env_setup
4
- shells=sh bash zsh ksh
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=platform_linux
2
+ requires=valise_platform_linux
3
3
  optional=
4
- shells=sh bash zsh ksh
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,4 @@
1
+ # valise project configuration.
2
+ bundle=default
3
+ variant=default
4
+ requires_valise=0.3.0
@@ -0,0 +1,3 @@
1
+ variant description excluded
2
+ default Every e2e module
3
+ no-network Without the network probe e2e_optional_network
@@ -1,9 +1,8 @@
1
1
  name=hello_valise
2
2
  requires=
3
3
  optional=
4
- shells=sh bash zsh ksh
4
+ shells=posix bash zsh ksh
5
5
  platforms=any
6
6
  side_effect=read-only
7
7
  exports=hello_valise_loaded
8
- updates=
9
8
  load=modules/hello_valise.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
@@ -0,0 +1,9 @@
1
+ name=contrib_demo_greeting
2
+ version=1.0.0
3
+ side_effect=read-only
4
+ requires=
5
+ optional=
6
+ shells=posix
7
+ platforms=any
8
+ exports=contrib_demo_greeting_ready
9
+ load=modules/shared/contrib_demo_greeting.sh
@@ -0,0 +1,4 @@
1
+ # A provider layer module. Layer-only modules must carry the `contrib_`
2
+ # prefix; `valise layer-lint demo` enforces that, along with the version,
3
+ # the load target, the file modes, and the dependency closure.
4
+ contrib_demo_greeting_ready() { :; }
@@ -0,0 +1,9 @@
1
+ name=greeting
2
+ version=1.0.0
3
+ side_effect=read-only
4
+ requires=
5
+ optional=
6
+ shells=posix
7
+ platforms=any
8
+ exports=greet
9
+ load=modules/greeting.sh
@@ -0,0 +1,8 @@
1
+ name=profile_main
2
+ version=1.0.0
3
+ side_effect=read-only
4
+ requires=greeting
5
+ optional=
6
+ shells=bash zsh ksh
7
+ platforms=any
8
+ exports=
@@ -0,0 +1,5 @@
1
+ # A plain POSIX module. `shells=posix` covers every POSIX shell: sh, bash,
2
+ # zsh, ksh, and dash.
3
+ greet() {
4
+ printf '%s\n' "hello from the valise profile project"
5
+ }
@@ -0,0 +1,4 @@
1
+ # valise project configuration. `valise build` and `valise apply` read these
2
+ # defaults; --bundle and --variant override them.
3
+ bundle=default
4
+ variant=default
@@ -0,0 +1,3 @@
1
+ variant description excluded
2
+ default Every module in the project
3
+ workstation-lean No provider layer contrib_demo_greeting@layers/demo/module.d
@@ -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 `contrib_path_prepend`. |
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 `contrib_path` module; this exercises dependency
18
- resolution from a layer into the primary module root.
19
-
20
- ## Use in the sample profile
21
-
22
- From the repository root, build the sample release and install it from the
23
- e2e directory. Installation adds an integration hook under `HOME`; use a
24
- temporary home to avoid changing your own shell startup files (see the top
25
- level README).
26
-
27
- ```sh
28
- sh examples/e2e/build-manifest.sh
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=contrib_path
2
+ requires=valise_path
3
3
  optional=
4
- shells=sh bash zsh ksh
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
@@ -1,10 +1,9 @@
1
1
  name=contrib_shared_umask
2
2
  requires=
3
3
  optional=
4
- shells=sh bash zsh ksh
4
+ shells=posix bash zsh ksh
5
5
  platforms=any
6
6
  side_effect=work-only
7
7
  exports=contrib_shared_umask_secure
8
- updates=
9
8
  version=1.0.0
10
9
  load=modules/shared/contrib_shared_umask.sh