diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c8059e1..a33de0c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -45,9 +45,10 @@ jobs: - name: Yarn run: corepack enable - # `comline-simulator` is a git dependency that compiles to WASM in its - # `prepack` (Rust to wasm-bindgen). The image has cargo, wasm-bindgen and - # wasm-opt; this caches the registry and git checkouts across runs. + # `comline-web-kit` (the playground's simulate view) is a git dependency, + # and so is its engine, `comline-simulator`, which compiles to WASM in + # its `prepack` (Rust to wasm-bindgen). The image has cargo, wasm-bindgen + # and wasm-opt; this caches the registry and git checkouts across runs. - name: Cache cargo uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: @@ -57,8 +58,8 @@ jobs: key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('yarn.lock') }} restore-keys: ${{ runner.os }}-${{ runner.arch }}-cargo- - # Yarn Berry's global cache holds the built `comline-simulator` - # archive: a hit skips the Rust build entirely. + # Yarn Berry's global cache holds the packed `comline-web-kit` and the + # built `comline-simulator` archives: a hit skips the Rust build entirely. - name: Cache yarn uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: @@ -70,6 +71,7 @@ jobs: - name: Install dependencies env: COMLINE_SIMULATOR_SCRIPT: '0' # the tutorial only needs the lean sim + COMLINE_KIT_EDITOR: '0' # and not the kit's editor WASM run: yarn install - name: build diff --git a/.gitignore b/.gitignore index 11701b9..e426790 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ vite.config.ts.timestamp-* # JetBrains IDEA settings .idea/ + +# Playwright +/test-results diff --git a/.yarnrc.yml b/.yarnrc.yml index 618f1ef..3e189ba 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1,11 +1,13 @@ yarnPath: .yarn/releases/yarn-4.18.0.cjs nodeLinker: node-modules -# `comline-simulator` is the sim engine — a git dep that builds itself to WASM -# in its `prepack`/`prepare`. Yarn 4 gates git deps and disables scripts by -# default; both are needed. The build is not byte-reproducible (wasm-opt runs -# only where installed) so let Yarn refresh the tarball checksum. +# `comline-web-kit` (the playground's simulate view, a workspace of the +# playground repo) and `comline-simulator` (its engine) are git deps that +# build in their `prepack`. Yarn 4 gates git deps and disables scripts by +# default; both are needed. The builds are not byte-reproducible (wasm-opt +# runs only where installed) so let Yarn refresh the tarball checksums. approvedGitRepositories: + - "https://github.com/ComlineProject/playground.git" - "https://github.com/ComlineProject/simulator.git" enableScripts: true checksumBehavior: update diff --git a/package.json b/package.json index e6c7ab7..f641587 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "type": "module", "dependencies": { "@sveltejs/adapter-static": "^3.0.10", - "comline-simulator": "git+https://github.com/ComlineProject/simulator.git#1eab1f84f1ae7760135ca4a7a519c78091001a44" + "comline-web-kit": "git+https://github.com/ComlineProject/playground.git#workspace=comline-web-kit&commit=fe53d2edcd25cf8bcd77d9f52a3c2ec09d453136" }, "resolutions": { "cookie": "^0.7.2", diff --git a/src/lib/sim/Simulation.svelte b/src/lib/sim/Simulation.svelte index ee81133..3bce105 100644 --- a/src/lib/sim/Simulation.svelte +++ b/src/lib/sim/Simulation.svelte @@ -1,246 +1,67 @@ -
+
{#if error}

{error}

- {:else if !model} + {:else if loading}

loading the simulation…

- {:else} -
-
{client?.name ?? 'client'}{client?.protocol} client
- -
{server?.name ?? 'server'}{server?.protocol} server
-
- - - -
{ - e.preventDefault(); - send(); - }} - > - send() - -
- - {#if result} -

{result}

- {/if} - -
    - {#each frames as f (f.seq)} -
  1. - {String(f.seq).padStart(2, '0')} - {f.from} → {f.to} - {f.kind} - {f.bytes.length} B -
  2. - {:else} -
  3. no frames yet — send a call
  4. - {/each} -
{/if} +