mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
Disabled following checks: - MD024/no-duplicate-heading - MD059/descriptive-link-text - MD060/table-column-style Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
3.4 KiB
3.4 KiB
HACKING.md
Documentation
README: Update the table of contents
- Install doctoc
- To update the TOC, run the following command:
doctoc --github README.md
Update asciidoc and/or zshelldoc
Important
- From the root of the repo, run:
make doc-container
If, for some reason, you want to build the zshelldocs or the PDF manually, you'll need:
- Patience, zsd is very finicky about locales. You have been warned.
- zshelldoc (zsd)
- asciidoc
make doc
Generate the manpage (doc/zinit.1)
- Install pandoc
- From the root of the repo run:
pandoc --standalone --to man README.md -o doc/zinit.1
Updating the gh-pages (zdharma-continuum.github.io)
- Check out the documentation branch
git fetch origin documentation
git checkout documentation
- Do your modifications and push your changes
- Keep an eye on the CI logs
- If all went well, head to https://zdharma-continuum.github.io/ to see your changes live.
Note
If you really need to push directly, without CI, please refer to the README in the documentation
Testing
We run our tests with zunit.
To add a new test case:
zinit for \
as"program" \
atclone"ln -sfv revolver.zsh-completion _revolver" \
atpull"%atclone" \
pick"revolver" \
@molovo/revolver \
as"completion" \
atclone"./build.zsh; ln -sfv zunit.zsh-completion _zunit" \
atpull"%atclone" \
sbin"zunit" \
@zunit-zsh/zunit
- Create a new
.zunitfile in thetests/dir. Here's a template:
#!/usr/bin/env zunit
@setup {
load setup
setup
}
@teardown {
load teardown
teardown
}
@test 'zinit-annex-bin-gem-node installation' {
# This spawns the official zinit container and executes a single zinit command
# inside it
run ./scripts/docker-run.sh --wrap --debug --zunit \
zinit light as"null" for zdharma-continuum/null
# Verify the exit code of the command above
assert $state equals 0
assert "$output" contains "Downloading"
local artifact="${PLUGINS_DIR}/zdharma-continuum---null/readme.md"
# Check if we downloaded the file correctly and if it is readable
assert "$artifact" is_file
assert "$artifact" is_readable
}
You should, of course, also check out the existing tests ;)
- To run your new test:
zunit --verbose tests/your_test.zunit
Debugging tests
If you ever need to inspect the ZINIT[HOME_DIR] dir, where zinit's internal data is stored, you can do so by commenting
out the @teardown section in your test. Then you can re-run said test and head over to ${TMPDIR:-/tmp}/zunit-zinit.
Good luck!
Misc
Get the list of supported ices
To get the list in a quick-and-dirty fashion, you issue:
zinit --help | tail -1
See zinit-autoload.zsh for implementation details.