Skip to content

Latest commit

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..

README.md

eserstack Tooleser/stack on GitHubInstall:pnpm add jsr:@eserstack/codebase

@eserstack/codebase provides validation tools and project management utilities for maintaining code quality. It includes 24 validation tools, git hook management, release tooling, and a workflow integration layer.

The shared system command tree

cli-system/ owns the operational commands every shipped binary carries — install, uninstall, update, completions, version, doctor, info — built once and parameterised by a CliApp so eser, noskills and laroux each get a tree describing themselves.

import{attachStandardCommands}from"@eserstack/codebase/cli-support";constapp=attachStandardCommands(module.toCommand("noskills",version));

It attaches to a binary's ROOT command, never to a Module. That is deliberate: eser mounts the very same module object the standalone noskills binary re-roots, so a layer living on the module would appear in both — and eser noskills version would exist, implying a submodule has a version of its own.

🚀 Quick Start

Install git hooks

# Install hooks from .eser/manifest.yml into .git/hooks/
npx eser codebase install
# Show installed hook status
npx eser codebase status
# Remove managed hooks
npx eser codebase uninstall

Run individual tools

# Check JSON syntax
npx eser codebase validate-json
# Fix missing trailing newlines
npx eser codebase validate-eof --fix
# Validate commit message format
npx eser codebase validate-commit-msg --message "feat(core): add feature"

Cut a release

# Preview: prints old -> new version and whether a changelog entry is due
npx eser codebase release patch --dry-run
# Bump VERSION + every package.json, write the CHANGELOG section, commit# "chore(codebase): release v<version>", push, then push the v<version> tag
npx eser codebase release patch

The tag push is the trigger — CI reacts to v*.*.*, never to the commit, and never creates tags itself (a tag pushed by a workflow's own GITHUB_TOKEN dispatches nothing). rerelease re-fires the run by recreating the tag at HEAD; unrelease removes the tag and the GitHub Release. Neither is safe once JSR or npm has accepted the version — cut a new patch instead.

🛠 Available Tools

Setup

CommandDescription
installInstall git hooks from .eser/manifest.yml
uninstallRemove managed git hooks
statusShow git hook installation status

Release

CommandDescription
releaseBump, changelog, commit, push, then push the trigger tag
rereleaseDelete and recreate the current version tag at HEAD
unreleaseDelete the current version tag and its GitHub Release
versionsBump version across all workspace packages
changelog-genGenerate CHANGELOG entry from commits

GitHub

CommandDescription
gh contributorsUpdate contributor list in README.md
gh release-notesSync CHANGELOG to GitHub Releases
gh release-tagCreate and push the release tag (the release trigger)

Validation

CommandDescription
validate-eofEnsure files end with newline
validate-trailing-whitespaceRemove trailing whitespace
validate-bomRemove UTF-8 byte order markers
validate-line-endingsNormalize line endings to LF
validate-large-filesDetect files exceeding size limit
validate-case-conflictDetect case-conflicting filenames
validate-merge-conflictDetect merge conflict markers
validate-jsonValidate JSON syntax
validate-tomlValidate TOML syntax
validate-yamlValidate YAML syntax
validate-symlinksDetect broken symlinks
validate-shebangsValidate shebang consistency
validate-secretsDetect credentials and private keys
validate-filenamesEnforce filename conventions
validate-submodulesDetect git submodules
validate-commit-msgValidate conventional commit format
validate-docsValidate JSDoc documentation
validate-circular-depsDetect circular dependencies
validate-export-namesValidate export naming conventions
validate-licensesValidate license headers
validate-mod-exportsValidate mod.ts export coverage
validate-package-configsValidate deno.json/package.json consistency

Run any tool with --help for options:

npx eser codebase validate-filenames --help

📋 Configuration (.eser/manifest.yml)

Tools are configured through .eser/manifest.yml at the project root. Each tool receives its options from the workflow step configuration:

stack:
- javascript
- golangworkflows:
- id: defaulton: [precommit, prepush]steps:
# Validation tools with options
- validate-json:
exclude:
- "tsconfig.json"
- validate-filenames:
rules:
- directory: "apps/services/"convention: "snake_case"
- directory: "*"convention: "kebab-case"exclude:
- "Makefile"
- "README.md"
- validate-secrets:
allowMissingCredentials: true
- validate-commit-msg:
forceScope: trueallowAsterisk: trueallowMultipleScopes: truetypes: [ci, chore, docs, feat, fix, perf, refactor, revert, test]# Shell commands for external tools
- shell:
name: deno-formattercommand: deno fmt --checkfixCommand: deno fmt
- shell:
name: go-testscommand: "go test -race ./..."workingDirectory: ./apps/services/timeout: 300

🔌 API Usage

import*ascodebasefrom"@eserstack/codebase";// Git operationsconstcommits=awaitcodebase.getCommitsBetween("v1.0.0","HEAD");constbranch=awaitcodebase.getCurrentBranch();// Workspace discoveryconstpackages=awaitcodebase.discoverPackages(".");
import*asvalidationfrom"@eserstack/codebase/validation";// Get all registered tools as workflow-compatible objectsconsttools=validation.getWorkflowTools();// Run a specific validator programmaticallyconstvalidator=validation.getValidator("validate-json");constresult=awaitvalidator.validate({root: "."});

🔗 For further details, visit the eserstack repository.