valise-sh 0.1.0 → 0.2.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 +170 -9
- package/README.md +48 -24
- package/bin/valise +2453 -333
- package/docs/architecture.md +78 -9
- package/docs/contrib-modules.md +68 -15
- package/docs/installation.md +120 -33
- package/docs/module-abi.md +103 -39
- package/docs/release-policy.md +110 -6
- package/docs/shared-modules.md +124 -2
- package/docs/variants.md +318 -54
- package/examples/README.md +11 -0
- package/examples/e2e/README.md +7 -7
- package/examples/e2e/build-manifest.sh +45 -157
- package/examples/profile-project/README.md +181 -0
- package/examples/profile-project/shell/layers/demo/module.d/contrib_demo_greeting.meta +10 -0
- package/examples/profile-project/shell/layers/demo/modules/shared/contrib_demo_greeting.sh +4 -0
- package/examples/profile-project/shell/module.d/greeting.meta +10 -0
- package/examples/profile-project/shell/module.d/profile_main.meta +9 -0
- package/examples/profile-project/shell/modules/greeting.sh +5 -0
- package/examples/profile-project/shell/release/bundle-roots +9 -0
- package/examples/profile-project/shell/release/install-variants +3 -0
- package/examples/profile-project/shell/release/module-registry.tsv +4 -0
- package/examples/profile-project/shell/release/project.conf +3 -0
- package/examples/shared/README.md +2 -2
- package/lib/compiler.awk +341 -20
- package/lib/fish/loader.fish +94 -19
- package/lib/fish/metadata.fish +13 -14
- package/lib/loader.sh +737 -157
- package/lib/metadata.sh +27 -51
- package/package.json +2 -1
package/lib/fish/metadata.fish
CHANGED
|
@@ -48,6 +48,13 @@ function sp_fish_metadata_validate_identifier_list --description 'Validate space
|
|
|
48
48
|
sp_fish_metadata_error "invalid $label: $word"
|
|
49
49
|
return 1
|
|
50
50
|
end
|
|
51
|
+
if test "$label" = export
|
|
52
|
+
switch $word
|
|
53
|
+
case case do done elif else esac fi for if in then until while time
|
|
54
|
+
sp_fish_metadata_error "invalid export (reserved word): $word"
|
|
55
|
+
return 1
|
|
56
|
+
end
|
|
57
|
+
end
|
|
51
58
|
end
|
|
52
59
|
if test $seen -eq 0
|
|
53
60
|
sp_fish_metadata_error "missing required metadata field: $label"
|
|
@@ -128,7 +135,7 @@ end
|
|
|
128
135
|
|
|
129
136
|
function sp_fish_metadata_validate_side_effect --description 'Validate side_effect value'
|
|
130
137
|
switch "$argv[1]"
|
|
131
|
-
case read-only path-env generated-file update-network install-time local-secret work-only
|
|
138
|
+
case read-only path-env generated-file update-network install-time local-secret local-state work-only
|
|
132
139
|
return 0
|
|
133
140
|
case '*'
|
|
134
141
|
sp_fish_metadata_error "invalid side_effect: $argv[1]"
|
|
@@ -186,7 +193,6 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
|
|
|
186
193
|
set -l m_updates ''
|
|
187
194
|
set -l m_version ''
|
|
188
195
|
set -l m_load ''
|
|
189
|
-
set -l m_load_hook ''
|
|
190
196
|
|
|
191
197
|
while read -l line
|
|
192
198
|
# Skip empty lines and comments
|
|
@@ -211,7 +217,9 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
|
|
|
211
217
|
case updates; set m_updates $val
|
|
212
218
|
case version; set m_version $val
|
|
213
219
|
case load; set m_load $val
|
|
214
|
-
case load_hook
|
|
220
|
+
case load_hook
|
|
221
|
+
sp_fish_metadata_error 'metadata field load_hook is not supported; use load'
|
|
222
|
+
return 1
|
|
215
223
|
case '*'
|
|
216
224
|
sp_fish_metadata_error "unknown metadata field: $key"
|
|
217
225
|
return 1
|
|
@@ -239,16 +247,8 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
|
|
|
239
247
|
# Match the generic metadata ABI before the Fish loader applies its
|
|
240
248
|
# shell/body selection. Generic POSIX records must parse successfully so
|
|
241
249
|
# the loader can skip them when their shells do not include Fish.
|
|
242
|
-
if test -z "$m_load"; and test -z "$
|
|
243
|
-
sp_fish_metadata_error 'missing required metadata field: load or
|
|
244
|
-
return 1
|
|
245
|
-
end
|
|
246
|
-
if test -n "$m_load"; and test -n "$m_load_hook"
|
|
247
|
-
sp_fish_metadata_error 'metadata fields load and load_hook are mutually exclusive'
|
|
248
|
-
return 1
|
|
249
|
-
end
|
|
250
|
-
if test -n "$m_load_hook"; and not sp_fish_metadata_validate_identifier "$m_load_hook"
|
|
251
|
-
sp_fish_metadata_error "invalid load_hook: $m_load_hook"
|
|
250
|
+
if test -z "$m_load"; and test -z "$m_requires"
|
|
251
|
+
sp_fish_metadata_error 'missing required metadata field: load or requires'
|
|
252
252
|
return 1
|
|
253
253
|
end
|
|
254
254
|
|
|
@@ -295,6 +295,5 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
|
|
|
295
295
|
echo "updates=$m_updates"
|
|
296
296
|
echo "version=$m_version"
|
|
297
297
|
echo "load=$m_load"
|
|
298
|
-
echo "load_hook=$m_load_hook"
|
|
299
298
|
return 0
|
|
300
299
|
end
|