The scripts directory directly contains a "catch-all" command called ubik,
which is used to dispatch various subcommands in this project. This script
comes from the Bashy-lib project, see
which for helpful advice about integrating it into your shell environment.
$ ubik dev build
...
Build complete!
$By default, dev build deposits a runnable build in the directory out,
directly under the top-level source directory. The script takes other options;
dev --help for details.
ubik dev clean does what you (presumably) expect.
$ ubik dev lint
...
No linter errors! Yay!
$There are also some tools which adjust source files to be in a standardized form:
ubik node-project fix-package-json— Derives intra-project dependencies from the actual source files, and updates each module'spackage.jsonto match. It actually entirely rewrites the file with project-standard boilerplate and formatting.ubik node-project reflow-jsdoc— Reflows (fixes line breaks on) all the documentation comments in the source tree. Note: After running this, please double-check the results before committing, as this tool might produce results that indicate a need for the tool itself to be improved.ubik node-project sort-imports— Sorts and arrangesimportlines into a project-standard form.
Unit test files live in directories named tests directly under each local
package. They use Jest for both test definitions (describe(...), test(...))
and assertions (expect(...)...).
$ ubik run-tests
...
No errors! Yay!Integration tests live in the top-level project directory tests. To run them:
$ ubik run-tests --type=integration
...
No errors! Yay!You can also run ./tests/run-all, which provides options that can be useful
depending on context. ./tests/run-all --help for details.
The run-tests script takes other options; run-tests --help for details.
Beyond the above, TLDR:
run-tests --do=buildto do a build first, for convenience.run-tests --type=unit-coverageto generate a unit test coverage report.run-tests --type=unit-debugto enable interactive debugging while running the unit tests.
This will run the system using the example configuration defined in
etc/config, which includes a self-signed certificate for localhost, which
might satisfy your local web browser.
$ ubik dev run
...The run target of dev lets you pass arbitrary arguments to the server, by
using the --run[] option, and it also makes the default dev target be run.
TLDR very useful:
dev --run[]='--node-opts --inspect --'ordev --run[]='--node-opts --inspect=<arg>' --— Pass aninspectoption to Node (to start the inspector/debugger immediately).
You can also do a build first:
$ ubik dev build run
...Recognized signals:
SIGHUP— Does an in-process system reload. (The system shuts down and then re-runs from near-scratch.)SIGUSR1— Starts the Node inspector/debugger, listening on the usual port. (This is a standard signal recognized by Node. Just noting it here as a reminder or perhaps a TIL.)SIGUSR2— Produces a heap snapshot file. Look in the log for the file name. (Writes to the current directory if it is writable, and falls back to the value of environment variables$HOMEor$TMPDIR, finally trying/tmpas a last-ditch effort. The file can be inspected using the "Memory" panel available in the Chrome developer tools. Note: Node documentation claims that a process needs additional memory of about the same size as the heap being dumped; if the memory is not available you might find that your OS has killed the process before it completes the snapshot.SIGINTandSIGTERM— Shuts down as cleanly as possible. (Note:SIGINTis usually what gets sent when you typectrl-Cin a console.)
Use the script update-version will change the main version number, and
prepare the CHANGELOG file for release.
$ ubik update-version 123.45.6The project has checks to make sure only vetted versions of Node are used to build and run the project.
To update what Node versions are allowed when building:
- Update the
check-dependencyregex in the filescripts/lib/lactoserv/_prereqs.
To update what Node versions are allowed when running:
- Update the
--runner-versions=list in the filescripts/lib/lactoserv/dev.
Copyright 2022-2025 the Lactoserv Authors (Dan Bornstein et alia).
SPDX-License-Identifier: Apache-2.0