Skip to content

Repository files navigation

DeepWiki

random-test-creator-web

Standalone frontend for the AST editor and preview UI.

Structure

  • src/ - Preact frontend
  • tests/ - unit and Playwright tests
  • cp-ast-ecosystems/ - git submodule providing the Rust AST core and wasm crate
  • wasm/ - local build output from cp-ast-wasm (generated, not committed)

Setup

git submodule update --init --recursive
npm install

Development

npm run dev

This builds cp-ast-ecosystems/crates/cp-ast-wasm into ./wasm before starting Vite.

For frontend-only iteration without rebuilding wasm:

npm run dev:fast

数式による制約編集

入力形式の変数を選び、値の範囲・文字列長の「数式で編集」を開くと、上下限を式で指定できます。 N - 1(N - 1) * 22 * 10^5min(N, 100) などを直接入力するか、変数候補と演算ボタンで組み立てます。 演算は選択中の下限または上限の式全体に適用され、「制約を適用」で上下限をまとめて確定します。 通常の数値入力では従来どおりスライダーとフォーカスを外したときの保存が使えます。

「総和を追加」から数値変数と上限を指定できます。追加済みの総和は制約行から再編集でき、変更・削除は取り消せます。 式の解析・合成、参照候補、スコープと循環依存の判定、定数区間の検証は Rust が担当します。 入力エラーは編集欄に表示され、確定済みの制約と生成結果を保持したまま修正できます。

Test

npm run test:unit
npm run test:e2e

数式のブラウザ操作は tests/e2e/constraint-expressions.spec.ts、解析・再投影・TeX・候補の検証は cp-ast-ecosystems/crates/cp-ast-core/tests/expression_editing.rs にあります。 Rust 全体のテストは cargo test --workspace --manifest-path cp-ast-ecosystems/Cargo.toml で実行します。

Deployment

Pushing a tag that starts with v triggers the Cloudflare Workers workflow. The GitHub Actions runner checks out cp-ast-ecosystems as a submodule, rebuilds wasm, builds the frontend, and deploys dist/ as static assets to the random-test-creator Worker via wrangler deploy.

Prerequisites

  1. A Cloudflare Workers project named random-test-creator must exist
  2. Generate a Cloudflare API token with Workers Scripts — Edit permission
  3. Add these GitHub repository secrets:
    • CLOUDFLARE_API_TOKEN — your Cloudflare API token
    • CLOUDFLARE_ACCOUNT_ID — your Cloudflare account ID (found in the Cloudflare dashboard URL)

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages