valise-sh 0.0.0-stage → 0.1.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 +16 -0
- package/LICENSE +21 -0
- package/README.md +145 -2
- package/bin/valise +3307 -0
- package/docs/architecture.md +77 -0
- package/docs/contrib-modules.md +193 -0
- package/docs/installation.md +161 -0
- package/docs/module-abi.md +340 -0
- package/docs/release-policy.md +50 -0
- package/docs/shared-modules.md +97 -0
- package/docs/variants.md +63 -0
- package/entrypoints/.gitkeep +0 -0
- package/entrypoints/fish/profile.fish +99 -0
- package/entrypoints/profile.sh +123 -0
- package/examples/README.md +33 -0
- package/examples/e2e/README.md +113 -0
- package/examples/e2e/build-manifest.sh +250 -0
- package/examples/e2e/module.d/e2e_aliases.meta +9 -0
- package/examples/e2e/module.d/e2e_completions_bash.meta +9 -0
- package/examples/e2e/module.d/e2e_completions_zsh.meta +9 -0
- package/examples/e2e/module.d/e2e_env_setup.meta +9 -0
- package/examples/e2e/module.d/e2e_fish_features.meta +9 -0
- package/examples/e2e/module.d/e2e_generated_config.meta +9 -0
- package/examples/e2e/module.d/e2e_ksh_features.meta +9 -0
- package/examples/e2e/module.d/e2e_layer_probe.meta +9 -0
- package/examples/e2e/module.d/e2e_optional_network.meta +9 -0
- package/examples/e2e/module.d/e2e_platform_tools_bsd.meta +9 -0
- package/examples/e2e/module.d/e2e_platform_tools_darwin.meta +9 -0
- package/examples/e2e/module.d/e2e_platform_tools_linux.meta +9 -0
- package/examples/e2e/modules/e2e/aliases.sh +19 -0
- package/examples/e2e/modules/e2e/completions_bash.sh +25 -0
- package/examples/e2e/modules/e2e/completions_zsh.sh +26 -0
- package/examples/e2e/modules/e2e/env_setup.sh +16 -0
- package/examples/e2e/modules/e2e/fish_features.fish +15 -0
- package/examples/e2e/modules/e2e/generated_config.sh +15 -0
- package/examples/e2e/modules/e2e/ksh_features.sh +22 -0
- package/examples/e2e/modules/e2e/layer_probe.sh +18 -0
- package/examples/e2e/modules/e2e/optional_network.sh +27 -0
- package/examples/e2e/modules/e2e/platform_tools_bsd.sh +16 -0
- package/examples/e2e/modules/e2e/platform_tools_darwin.sh +16 -0
- package/examples/e2e/modules/e2e/platform_tools_linux.sh +19 -0
- package/examples/local/.gitkeep +0 -0
- package/examples/local/module.d/hello_valise.meta +9 -0
- package/examples/local/modules/hello_valise.sh +6 -0
- package/examples/shared/README.md +49 -0
- package/examples/shared/module.d/contrib_shared_paths.meta +10 -0
- package/examples/shared/module.d/contrib_shared_umask.meta +10 -0
- package/examples/shared/modules/shared/contrib_shared_paths.sh +16 -0
- package/examples/shared/modules/shared/contrib_shared_umask.sh +14 -0
- package/lib/.gitkeep +0 -0
- package/lib/capabilities.sh +769 -0
- package/lib/compiler.awk +216 -0
- package/lib/fish/loader.fish +2233 -0
- package/lib/fish/metadata.fish +300 -0
- package/lib/loader.sh +1090 -0
- package/lib/metadata.sh +422 -0
- package/manifests/.gitkeep +0 -0
- package/manifests/parser-support.tsv +11 -0
- package/module.d/.gitkeep +0 -0
- package/module.d/contrib_editor.meta +10 -0
- package/module.d/contrib_history.meta +10 -0
- package/module.d/contrib_pager.meta +10 -0
- package/module.d/contrib_path.meta +10 -0
- package/module.d/contrib_xdg.meta +10 -0
- package/module.d/platform_bsd.meta +9 -0
- package/module.d/platform_linux.meta +9 -0
- package/module.d/platform_macos.meta +9 -0
- package/module.d/platform_posix.meta +9 -0
- package/modules/.gitkeep +0 -0
- package/modules/platform/bsd/capabilities.sh +14 -0
- package/modules/platform/linux/capabilities.sh +9 -0
- package/modules/platform/macos/capabilities.sh +10 -0
- package/modules/platform/posix.sh +13 -0
- package/modules/system/contrib_editor.sh +35 -0
- package/modules/system/contrib_history.sh +19 -0
- package/modules/system/contrib_pager.sh +28 -0
- package/modules/system/contrib_path.sh +84 -0
- package/modules/system/contrib_xdg.sh +31 -0
- package/package.json +38 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Notable user-facing changes are recorded here. Versions before 1.0 may include
|
|
4
|
+
module ABI or CLI changes; see [the release policy](docs/release-policy.md).
|
|
5
|
+
|
|
6
|
+
## Unreleased
|
|
7
|
+
|
|
8
|
+
- Made the editor-defaults test independent of host-installed editors by
|
|
9
|
+
supplying a temporary test `vi` executable.
|
|
10
|
+
- Fixed `valise` with no arguments: under `set -e`, a zero-argument `shift`
|
|
11
|
+
could terminate the CLI before it displayed its help text.
|
|
12
|
+
- Fixed Fish activation so functions loaded from package paths (for example,
|
|
13
|
+
Homebrew) are authenticated and preserved through the load instead of being
|
|
14
|
+
rejected or lost.
|
|
15
|
+
- Added an isolated sample install walkthrough and documented the release
|
|
16
|
+
checklist.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joseph Cumines
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,146 @@
|
|
|
1
|
-
#
|
|
1
|
+
# valise-sh
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
valise-sh is a POSIX shell-profile engine. It loads shell configuration from
|
|
4
|
+
modules described by declarative metadata files. The metadata is parsed as
|
|
5
|
+
data and never executed; the loader resolves the dependency graph and sources
|
|
6
|
+
module bodies in deterministic order. The POSIX core runs under `sh`, `dash`,
|
|
7
|
+
`ksh`, and `bash`; Fish is supported through a native loader in `lib/fish/`.
|
|
8
|
+
The repository also includes the `valise` CLI, which installs sealed
|
|
9
|
+
shell-profile releases and verifies them before use.
|
|
10
|
+
|
|
11
|
+
A consuming project can split its shell configuration into modules with
|
|
12
|
+
declared dependencies, then test and select those modules explicitly. The
|
|
13
|
+
engine is designed to be vendored by that project, for example as a Git
|
|
14
|
+
submodule; the consumer owns its profile and release contents.
|
|
15
|
+
|
|
16
|
+
## Try a sample release
|
|
17
|
+
|
|
18
|
+
This walkthrough builds and installs the included sample profile in an
|
|
19
|
+
isolated temporary home. `valise install` deploys its normal shell
|
|
20
|
+
integration there, so your real home directory and startup files are left
|
|
21
|
+
untouched.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
git clone https://github.com/joeycumines/valise-sh.git
|
|
25
|
+
cd valise-sh
|
|
26
|
+
export PATH="$PWD/bin:$PATH"
|
|
27
|
+
|
|
28
|
+
# Isolate HOME and XDG state; the trap also removes read-only release files.
|
|
29
|
+
(
|
|
30
|
+
set -eu
|
|
31
|
+
_demo_state=$(mktemp -d)
|
|
32
|
+
cleanup_demo() {
|
|
33
|
+
chmod -R u+w "$_demo_state" 2>/dev/null || :
|
|
34
|
+
rm -rf "$_demo_state"
|
|
35
|
+
}
|
|
36
|
+
trap cleanup_demo EXIT
|
|
37
|
+
trap 'exit 130' INT
|
|
38
|
+
trap 'exit 143' TERM
|
|
39
|
+
mkdir -p "$_demo_state/home"
|
|
40
|
+
export HOME="$_demo_state/home"
|
|
41
|
+
export XDG_DATA_HOME="$_demo_state/data"
|
|
42
|
+
export XDG_CONFIG_HOME="$_demo_state/config"
|
|
43
|
+
export XDG_STATE_HOME="$_demo_state/state"
|
|
44
|
+
|
|
45
|
+
# Build, install, and verify the sample release.
|
|
46
|
+
sh examples/e2e/build-manifest.sh
|
|
47
|
+
(cd examples/e2e && valise install)
|
|
48
|
+
valise verify-active
|
|
49
|
+
|
|
50
|
+
# Load two shipped utilities from the installed release.
|
|
51
|
+
_active=$(cd "$XDG_CONFIG_HOME/valise/active" && pwd -P)
|
|
52
|
+
VALISE_MODULE_ROOT="$_active" \
|
|
53
|
+
VALISE_MODULES='contrib_path contrib_editor' \
|
|
54
|
+
VALISE_MODE=strict \
|
|
55
|
+
. "$_active/entrypoints/profile.sh"
|
|
56
|
+
contrib_path_prepend "$HOME/.local/bin"
|
|
57
|
+
contrib_editor_defaults
|
|
58
|
+
printf 'EDITOR=%s\nPATH=%s\n' "${EDITOR-(unset: no supported editor found on PATH)}" "$PATH"
|
|
59
|
+
)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The end-to-end example documents Fish startup, shared-provider composition,
|
|
63
|
+
and other modules in
|
|
64
|
+
[examples/e2e/README.md](examples/e2e/README.md). For the smallest possible
|
|
65
|
+
loader example without installation, use `examples/local/` as described in
|
|
66
|
+
[examples/README.md](examples/README.md).
|
|
67
|
+
|
|
68
|
+
## Repository layout
|
|
69
|
+
|
|
70
|
+
- `entrypoints/profile.sh` — the portable entrypoint. It is sourced, not
|
|
71
|
+
executed: it resolves the engine root, sources the three libraries, and
|
|
72
|
+
calls the loader with the requested modules.
|
|
73
|
+
- `lib/metadata.sh` — parses `module.d/*.meta` files as data and validates
|
|
74
|
+
identifiers, lists, paths, shells, platforms, and side-effect classes.
|
|
75
|
+
- `lib/loader.sh` — resolves the dependency closure, selects modules by
|
|
76
|
+
shell/platform/phase, sources bodies, checks declared exports, and cleans
|
|
77
|
+
up on failure.
|
|
78
|
+
- `lib/capabilities.sh` — portable helpers (`sp_cap_*`) that modules call
|
|
79
|
+
instead of platform-specific commands.
|
|
80
|
+
- `lib/fish/` — native Fish loader and metadata reader. The Fish path never
|
|
81
|
+
sources POSIX shell bodies.
|
|
82
|
+
- `bin/valise` — the CLI: init, install, doctor, variant, make-manifest,
|
|
83
|
+
compile, verify-active, explain-variant, explain-bundles, layer-lint,
|
|
84
|
+
version. `init`, `install`, `doctor`, `variant`, `make-manifest`,
|
|
85
|
+
`verify-active`, and `version` run from a bare checkout; `compile`,
|
|
86
|
+
`explain-variant`, `explain-bundles`, and `layer-lint` require the
|
|
87
|
+
consuming project's source tree (see
|
|
88
|
+
[docs/variants.md](docs/variants.md) and
|
|
89
|
+
[docs/contrib-modules.md](docs/contrib-modules.md).
|
|
90
|
+
- `module.d/` and `modules/platform/` — generic platform modules
|
|
91
|
+
(`platform_posix`, `platform_macos`, `platform_linux`, `platform_bsd`).
|
|
92
|
+
- `manifests/parser-support.tsv` — declares the shell parsers used to check
|
|
93
|
+
each source-file class.
|
|
94
|
+
- `tests/` — the test suite. Every test runs in a quarantined environment:
|
|
95
|
+
fresh temporary HOME, controlled TMPDIR and PATH, cleared startup hooks.
|
|
96
|
+
- `examples/local/` — a minimal runnable module demonstrating the metadata
|
|
97
|
+
contract.
|
|
98
|
+
|
|
99
|
+
Product-specific modules, adapters, release packaging, and installer
|
|
100
|
+
transactions belong in the consuming project, not here. See
|
|
101
|
+
[docs/architecture.md](docs/architecture.md) for the scope.
|
|
102
|
+
|
|
103
|
+
## Documentation
|
|
104
|
+
|
|
105
|
+
- [docs/installation.md](docs/installation.md) — install paths, shell
|
|
106
|
+
integration, XDG layout, publishing, and the integrity and provenance limits.
|
|
107
|
+
- [docs/module-abi.md](docs/module-abi.md) — the metadata contract: fields,
|
|
108
|
+
allowed values, multi-root search path, runtime detection, side-effect
|
|
109
|
+
phases, and the capability layer.
|
|
110
|
+
- [docs/architecture.md](docs/architecture.md) — what this repository
|
|
111
|
+
provides and what stays in the consuming project.
|
|
112
|
+
- [docs/variants.md](docs/variants.md) — build variant selection and
|
|
113
|
+
exclusion lists.
|
|
114
|
+
- [docs/contrib-modules.md](docs/contrib-modules.md) — module authoring
|
|
115
|
+
reference.
|
|
116
|
+
- [docs/shared-modules.md](docs/shared-modules.md) — governance and index
|
|
117
|
+
for shared modules: namespace ownership, review, deprecation, removal.
|
|
118
|
+
- [docs/release-policy.md](docs/release-policy.md) — compatibility surfaces,
|
|
119
|
+
current pre-1.0 status, and the release checklist.
|
|
120
|
+
- [CHANGELOG.md](CHANGELOG.md) — user-facing changes.
|
|
121
|
+
|
|
122
|
+
## Running the tests
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
make check-fast # quick contributor lane; no optional shells required
|
|
126
|
+
make check # available shell/runtime checks, CLI and end-to-end tests
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Strict mode requires the parsers declared in
|
|
130
|
+
`manifests/parser-support.tsv`, the host shells used by the end-to-end lanes
|
|
131
|
+
(`sh`, `bash`, `zsh`, `ksh`, `dash`, and `fish`), and a BusyBox executor.
|
|
132
|
+
Missing tools skip with a visible message in an ordinary local run;
|
|
133
|
+
`CI=true` or `GITHUB_ACTIONS=true` makes them fail. Lima VM lanes are optional
|
|
134
|
+
and run only when the relevant instance is configured.
|
|
135
|
+
To require the standard runtime set locally, run:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
make VALISE_REQUIRE_TOOLING=1 check
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
To intentionally use non-strict behavior in CI, or require tools on a local
|
|
142
|
+
machine, the GNU Make command-line override takes precedence. The Makefile
|
|
143
|
+
also includes an optional untracked `config.mk` before its defaults, so
|
|
144
|
+
machine-local preferences can be set there; use `VALISE_REQUIRE_TOOLING ?= 1`
|
|
145
|
+
for a default that a command-line assignment can still override. The release
|
|
146
|
+
checklist is in [docs/release-policy.md](docs/release-policy.md).
|