asljs-part
v0.1.42
Published
Project artefact tracing framework and CLI for markdown-defined project artefacts.
Maintainers
Readme
part
Part of Alexandrite Software Library - a set of high-quality, performant JavaScript libraries for everyday use.
Markdown-defined project artefact tracing framework with a CLI for inventory, definition inspection, and rule checks.
Quick Start
Create a definition such as Todo Item.md:
# Todo Item
A task that needs to be done.
## Properties
- Due date: when it needs to be done.
## Location
- Files: ../Todo Items/*.md
## Rules
- R1 - Due date must be in the future.Crate a data providing function in parts/Todo Item.js:
export async function getData(artefact, context)
{
const text =
await context
.markdownDocuments
.read(
artefact.path);
const dueDate =
text.match(/- Due date: (.*)/)[1];
return { dueDate };
}Create a matching rule in parts/Todo Item_R1.js:
export async function validate(artefact, context)
{
const artefactData =
await context.artefactData.tryGetArtefactData(artefact);
const dueDate =
artefactData['Todo Item'].dueDate;
const now = new Date();
if (dueDate <= now) {
throw new Error('Due date must be in the future.');
}
}Create an artefact in Todo Items/Buy milk.md:
# Buy milk
- Due date: 2026-07-01
Buy milk on the way home.Run inventory:
part inventoryBootstrap a definitions folder:
part init --definitions artefactsExample output:
| File | Definitions |
| ---------------------- | ----------- |
| Todo Items/Buy milk.md | Todo Item |If you want to embed PART in your own tooling instead of shelling out, import
the package-root helpers from asljs-part and call the report builders or
runCli(...) directly.
