npm run build
npm i
npm run build
npx smoz register
npm run openapi
npm run lint:fix
npm run templates:lint
npm run typecheck
npm run templates:typecheck
npm test
This repo uses ESLint to drive Prettier formatting:
'prettier/prettier': 'error'
npm run lint:fix
npm run templates:lint
eslint-plugin-simple-import-sort
.templates/*/tsconfig.json
and invokes tsc -p --noEmit
per template.tsconfig.json
.npx smoz register
npm run openapi
Commit app/generated/register.*.ts
to keep typecheck stable. openapi.json
may remain untracked.
Normalize separators when deriving paths:
import { fileURLToPath } from 'node:url';
import { toPosixPath } from '@karmaniverous/smoz';
export const APP_ROOT_ABS = toPosixPath(
fileURLToPath(new URL('..', import.meta.url)),
);
Stable step IDs and transforms ensure correctness:
See the middleware page for customization and invariants.
If your team uses lefthook, you can add an optional pre‑commit command to refresh registers when endpoint files change. This is not enforced by the toolkit and is safe to omit.
Example snippet (add to your lefthook.yml
):
pre-commit:
scripts:
smoz-register:
runner: bash
script: |
# If staged changes include app/functions/**/*.{ts,tsx}, refresh registers
if git diff --cached --name-only | grep -E '^app/functions/.*\.(ts|tsx)$' >/dev/null; then
npx smoz register
git add app/generated/register.functions.ts \
app/generated/register.openapi.ts \
app/generated/register.serverless.ts
fi
Keep this commented or opt‑in according to your team’s workflow.