Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:best-practices", "customManagers:biomeVersions"],
"extends": ["config:best-practices"],
"timezone": "Asia/Tokyo",
"schedule": ["before 5am on Monday"],
"labels": ["dependencies"],
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,7 @@ jobs:
name: Status Check
runs-on: ubuntu-slim
timeout-minutes: 1
needs:
[
setup,
lint-format,
type-check,
test,
export-validation,
dependency-review,
]
needs: [setup, lint-format, type-check, test, export-validation, dependency-review]
if: always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
steps:
- run: exit 1
22 changes: 22 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"useTabs": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": false,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "all",
"semi": true,
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"overrides": [
{
"files": ["*.md", "*.{yml,yaml}"],
"options": {
"useTabs": false
}
}
]
}
5 changes: 2 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ bun run check:type:example
| **tsup** | Build (bundler) |
| **vitest** | Test runner |
| **oxlint** | Linter |
| **Biome** | Formatter (TS/JS/JSON) |
| **Prettier** | Formatter (Markdown/YAML) |
| **oxfmt** | Formatter (TS/JS/JSON) |
| **publint** / **attw** | Package export validation |
| **npm-run-all2** | Script orchestration |

Expand All @@ -73,7 +72,7 @@ bun run test:watch # Watch mode for testing
```bash
bun run lint # oxlint (deny-warnings)
bun run lint:fix # oxlint --fix-suggestions
bun run format # Biome + Prettier (write)
bun run format # oxfmt (write)
bun run fix # lint:fix + format (all-in-one auto-fix)
```

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ It enforces strict rules on keys and forbids structural inference by design.
- [Result](#result)
- [Issues](#issues)
- [Versioning](#versioning)
- [Contributing](#contributing)
- [License](#license)

---
Expand Down
26 changes: 0 additions & 26 deletions biome.json

This file was deleted.

65 changes: 43 additions & 22 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 24 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,30 @@
"name": "safe-formdata",
"version": "0.1.3",
"description": "Boundary-focused FormData parser with strict security guarantees",
"keywords": [
"boundary",
"formdata",
"parser",
"prototype-pollution",
"security"
],
"homepage": "https://github.com/roottool/safe-formdata#readme",
"bugs": {
"url": "https://github.com/roottool/safe-formdata/issues"
},
"license": "MIT",
"author": "roottool",
"repository": {
"type": "git",
"url": "git+https://github.com/roottool/safe-formdata.git"
},
"bugs": {
"url": "https://github.com/roottool/safe-formdata/issues"
},
"homepage": "https://github.com/roottool/safe-formdata#readme",
"files": [
"dist"
],
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"imports": {
"#*": {
"types": "./src/*.ts",
Expand All @@ -19,39 +34,26 @@
},
"#safe-formdata": "./src/index.ts"
},
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [
"dist"
],
"scripts": {
"dev": "tsup --watch",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix-suggestions",
"format:biome": "biome check --write --assist-enabled true",
"format:prettier": "prettier --cache --write \"**/*.{md,yml,yaml}\"",
"format": "npm-run-all2 format:biome format:prettier",
"format": "oxfmt",
"fix": "npm-run-all2 lint:fix format",
"check:biome": "biome check . --assist-enabled true",
"check:prettier": "prettier --cache --check \"**/*.{md,yml,yaml}\"",
"check:format": "npm-run-all2 check:biome check:prettier",
"check:format": "oxfmt --check",
"check:source": "npm-run-all2 lint check:format",
"check": "bun run check:source",
"check:type:source": "tsc --noEmit",
"check:type:example": "tsc --project tsconfig.examples.json --noEmit",
"check:type": "npm-run-all2 check:type:source check:type:example",
"check:prettier:ci": "prettier --check \"**/*.{md,yml,yaml}\"",
"check:format:ci": "npm-run-all2 check:biome check:prettier:ci",
"check:source:ci": "npm-run-all2 lint check:format:ci",
"check:source:ci": "npm-run-all2 lint check:format",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
Expand All @@ -61,25 +63,16 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "0.18.2",
"@biomejs/biome": "2.3.10",
"@types/node": "25.0.3",
"@vitest/coverage-v8": "4.0.16",
"happy-dom": "20.0.11",
"npm-run-all2": "8.0.4",
"oxfmt": "0.35.0",
"oxlint": "1.34.0",
"prettier": "3.7.4",
"publint": "0.3.16",
"terser": "5.44.1",
"tsup": "8.5.1",
"typescript": "5.9.3",
"vitest": "4.0.16"
},
"license": "MIT",
"keywords": [
"formdata",
"parser",
"security",
"boundary",
"prototype-pollution"
]
}
}
6 changes: 1 addition & 5 deletions skills/boundary-validator/examples/bad-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,7 @@ export function parse(formData: FormData, strict?: boolean): ParseResult {

```typescript
// ❌ WRONG: Adding new issue code in minor version
export type IssueCode =
| "invalid_key"
| "forbidden_key"
| "duplicate_key"
| "invalid_value"; // NEW - requires major version bump!
export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key" | "invalid_value"; // NEW - requires major version bump!

// Problem: Breaking change without major version bump
// Violates: API contract (IssueCode stability)
Expand Down
11 changes: 2 additions & 9 deletions skills/boundary-validator/references/api-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ function parse(formData: FormData): ParseResult;
function parse(formData: FormData, options: ParseOptions): ParseResult;

// Adding options
function parse(
formData: FormData,
options?: { allowDuplicates?: boolean },
): ParseResult;
function parse(formData: FormData, options?: { allowDuplicates?: boolean }): ParseResult;

// Adding framework adapters
function parseRequest(req: NextRequest): ParseResult;
Expand Down Expand Up @@ -191,11 +188,7 @@ export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key";
export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key";

// v1.0.0 - Major version allows changes
export type IssueCode =
| "invalid_key"
| "forbidden_key"
| "duplicate_key"
| "invalid_value"; // OK in major version
export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key" | "invalid_value"; // OK in major version
```

---
Expand Down
10 changes: 2 additions & 8 deletions skills/boundary-validator/references/validation-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ data[key] = value; // If key exists, this silently overwrites
```typescript
// ❌ Violation: Converting to array for duplicates
if (data[key]) {
data[key] = Array.isArray(data[key])
? [...data[key], value]
: [data[key], value];
data[key] = Array.isArray(data[key]) ? [...data[key], value] : [data[key], value];
}

// ❌ Violation: Array push
Expand Down Expand Up @@ -392,11 +390,7 @@ export function parse(formData: FormData, strict: boolean): ParseResult;

```typescript
// ❌ Violation: Adding new issue codes without major version bump
export type IssueCode =
| "invalid_key"
| "forbidden_key"
| "duplicate_key"
| "invalid_value"; // NEW CODE - requires major version!
export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key" | "invalid_value"; // NEW CODE - requires major version!
```

### Correct Patterns
Expand Down