Skip to content

feat: Standard Schemaに対応するdowaSchemaを追加 - #14

Merged
otnc merged 3 commits into
mainfrom
feat/standard-schema
Sep 4, 2026
Merged

feat: Standard Schemaに対応するdowaSchemaを追加#14
otnc merged 3 commits into
mainfrom
feat/standard-schema

Conversation

@otnc

@otnc otnc commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Standard Schema ( https://standardschema.dev/ ) 準拠のスキーマを作る dowaSchema(options?) を追加。zod/valibotなどのバリデーションパイプラインにそのまま組み込めるようになり、スキーマのパースと冷笑検知を別々に行う必要がなくなります
  • DowaOptions の検証ロジックを lib/options.ts に、regexのマッチ処理を lib/regex.tsmatch() に切り出し、index.ts / lib/schema.ts で共有
  • @standard-schema/spec は型定義のみでビルド後のJSに影響しないため dependencies に追加(あらゆるランタイムで動作)
  • テスト用に zod / valibotdevDependencies に追加
  • CONTRIBUTINGの依存関係禁止事項を「あらゆるランタイムで動作すること」を条件とした表現に修正(型のみで実行時コードを持たないパッケージは例外)

closes #13

Test plan

  • npm run typecheck
  • npm test (282 tests, dowaSchemaのzod/valibot相互運用テスト含む)
  • npm run lint
  • npm run format:check
  • npm run build

zod/valibotなどのバリデーションパイプラインに直接組み込めるよう、
StandardSchemaV1準拠のスキーマを作るdowaSchema()を追加。
冷笑パターンが検出された場合はissuesとして弾く。

- DowaOptionsの検証ロジックをlib/options.tsに切り出し、index.tsとschema.tsで共有
- regexのマッチ処理をlib/regex.tsのmatch()関数に切り出し
- @standard-schema/specは型定義のみでビルド後のJSに影響しないためdependenciesに追加
- CONTRIBUTINGの依存関係禁止事項を「あらゆるランタイムで動作すること」を条件とした表現に修正

closes #13
@socket-security

socket-security Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedvalibot@​1.4.21001009984100
Addedzod@​4.5.410010010096100

View full report

Comment thread README.md Outdated
@bulebrainbrand

Copy link
Copy Markdown

issueへの対応ありがとうございます🙇

@otnc
otnc merged commit 5a004ee into main Sep 4, 2026
3 checks passed
@otnc
otnc deleted the feat/standard-schema branch September 4, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: StandardSchemaを追加しましょう

2 participants