Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .aiignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git/
node_modules/
coverage/
dist/
*.tgz
package-lock.json
.env
.env.*
.vscode/
.idea/
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Summary

-

## Validation

- [ ] `npm run lint`
- [ ] `npm run typecheck`
- [ ] `npm run test:coverage`
- [ ] `npm run build`
- [ ] `npm pack --dry-run`

## Review Safety

- [ ] CI checks pass
- [ ] Required reviews approved
- [ ] Requested changes resolved
- [ ] Conversation threads resolved
44 changes: 44 additions & 0 deletions .github/skills/formrequest-package/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# FormRequest Package Skill

Use this skill when changing the FormRequest runtime, Zod validation lifecycle, exceptions, Express 4 adapter, docs, tests, or release metadata.

## Runtime Ownership

- `src/FormRequest.ts` owns validation orchestration, authorization checks, validated data, context storage, and context helpers.
- `src/exceptions/` owns standardized FormRequest exceptions.
- `src/adapters/express.ts` owns optional Express 4-style middleware behavior.
- `src/types.ts` owns public TypeScript contracts.
- `tests/` must cover public behavior at 100% statement, branch, function, and line coverage.

## Guardrails

- Inspect source before editing; do not assume.
- `rules()` returns a Zod schema.
- Do not add Laravel string rules.
- Do not add database validation rules into the base package.
- Do not add a service container.
- Do not put business logic inside FormRequest.
- Keep the core framework-neutral.
- Do not require Express at runtime.
- Express adapter targets Express 4.x.
- Do not weaken 100% coverage.
- Update docs when behavior changes.

## Versioning

- Feature PRs do not bump `package.json`.
- Version bumps happen only in `release/<version>` branches.
- The initial public release is `0.1.0`.

## Validation

Run:

```bash
npm run lint
npm run typecheck
npm run test:coverage
npm run build
npm pack --dry-run
```

46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
pull_request:
branches:
- develop
- master
push:
branches:
- develop
- master

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Coverage
run: npm run test:coverage

- name: Build
run: npm run build

- name: Package dry-run
run: npm pack --dry-run
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DS_Store
.env
.env.*
!.env.example
.vscode/
.idea/
node_modules/
coverage/
dist/
*.tsbuildinfo
*.tgz
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
7 changes: 7 additions & 0 deletions .humanignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
coverage/
dist/
package-lock.json
*.tsbuildinfo
*.tgz
.DS_Store
47 changes: 47 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# JOOservices Node FormRequest Repository Instructions

This repository is a Node.js package named `@jooservices/node-formrequest`.

## Core Intent

- Inspect source before editing; do not assume docs or previous implementation are correct.
- Keep FormRequest class-based and Laravel-inspired, not Laravel-compatible.
- `rules()` returns a Zod schema and validation uses `parseAsync`.
- Keep the core framework-neutral.
- Keep the optional adapter targeted to Express 4.x.
- Keep business logic outside FormRequest.
- Update tests and docs with behavior changes.
- Do not weaken the 100% coverage gate.
- Follow the approved `master` and `develop` Git flow.

## Required Commands

- `npm run lint`
- `npm run typecheck`
- `npm run test:coverage`
- `npm run build`
- `npm pack --dry-run`

## Architecture Rules

- No Laravel string rule parser.
- No database-backed validation rules in the base package.
- No service container.
- No persistence or business workflows.
- No Express import in the core FormRequest class.
- Do not document unimplemented behavior.

## Versioning

- Feature PRs into `develop` do not bump `package.json`.
- Version bumps happen only in `release/<version>` branches.
- The initial public release is `0.1.0`.

## Branch Workflow

- `master`: stable release branch only.
- `develop`: integration branch.
- `feature/*`: branch from latest `develop` and PR back into `develop`.
- `release/<version>`: branch from latest `develop` and PR into `master`.
- Tags are created from `master` only.

19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to this project will be documented in this file.

## Unreleased

## 0.1.0 - 2026-05-13

### Added

- Laravel-inspired class-based FormRequest abstraction.
- Zod-based validation lifecycle using async parsing.
- Optional Express 4 adapter.
- Authorization and validation exceptions.
- Context helpers for body, params, query, headers, and user.
- 100% coverage quality gate.
- CI/CD validation workflow.
- AI contributor guidance.

16 changes: 16 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Claude Code Instructions For `jooservices/node-formrequest`

Read [AGENTS.md](./AGENTS.md) first.

When working in this repository:

- Inspect actual source and tests before changing behavior.
- Match the class-based Zod FormRequest architecture.
- Keep changes small, typed, tested, and documented.
- Preserve framework-neutral core behavior.
- Keep the Express adapter optional and Express 4.x-focused.
- Do not add Laravel string parsers, database rules, service containers, or business logic.
- Run lint, typecheck, coverage, build, and package dry-run before PRs.
- Do not bump `package.json` in feature branches; version bumps happen only in `release/<version>` branches.
- Follow the approved Git flow: feature work into `develop`, release PRs into `master`, and tags from `master`.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 JOOservices

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading