Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Latest commit

 

History

History
86 lines (52 loc) · 2.41 KB

BUILDING.md

File metadata and controls

86 lines (52 loc) · 2.41 KB

Contribute to jqnpm

This is experimental software, so feedback is most appreciated!

Additional development requirements

Steps

  1. Run git clean -idX :/ to clean up any generated file. Use with care.
  2. Create a new git branch where you add your changes.
  3. Edit files in src/ with your code changes.
  • Follow current conventions to increase the chance of your patch being accepted.
  1. Write additional tests in a subfolder to tests/.
  • Code with tests have a much, much higher chance of being accepted without further fixes.
  1. If you have changed code in tests/*/package-source subfolders, run ./tests/create-bundles.sh to regenerate git .bundle files for tests.
  2. Run tests with ./tests/all.sh.
  3. Repeat until your feature is done, well tested and all tests pass.
  4. Create a pull request based on your new branch.

Debugging

export JQNPM_DEBUG_LEVEL=4

Set the JQNPM_DEBUG_LEVEL in your shell to get some debugging output. You can also define it directly on the command line.

JQNPM_DEBUG_LEVEL=4 jqnpm execute
  • 0 fatal
  • 1 errors
  • 2 warnings
  • 3 information
  • 4 debug
  • 5 verbose
  • 6 trace

Override for the temporary jq wrapper jqnpm execute

If you are runnings tests agains plain jq, it used to be a hassle to replace jqnpm execute. Now it's easy.

cd tests/
echo 'jq "$@"' >"jq-command-override.sh"
chmod u+x "jq-command-override.sh"

Now you can run ./tests/all.sh against the jq binary instead of using the temporary jq wrapper jqnpm execute -- it is not to be used once jq is up to speed.

Custom remote server (or fake directory)

Remotes and cache can be changed for testing by setting some environment variables in your shell.

Default values

config_default_packagesCache="$HOME/.jq/cache"
config_default_remoteBase="git://github.com"
config_default_remoteSuffix=".git"

Values are used during most tests.

export JQNPM_PACKAGES_CACHE="${BASH_SOURCE%/*}/package-cache"
export JQNPM_REMOTE_BASE="${BASH_SOURCE%/*}/remote-base"
export JQNPM_REMOTE_SUFFIX=".bundle"

Larger jq.json example.

This example has been removed in favor of generating a package skeleton with jqnpm generate. Generate a package and have a look!