story-kit: merge 243_bug_replace_pnpm_with_npm

This commit is contained in:
Dave
2026-03-14 18:09:58 +00:00
parent 3a430dfaa2
commit 3abea68f9e
12 changed files with 72 additions and 6658 deletions

View File

@@ -1,7 +1,7 @@
[[component]] [[component]]
name = "frontend" name = "frontend"
path = "frontend" path = "frontend"
setup = ["pnpm install", "pnpm run build"] setup = ["npm install", "npm run build"]
teardown = [] teardown = []
[[component]] [[component]]
@@ -87,12 +87,12 @@ Read CLAUDE.md first, then .story_kit/README.md to understand the dev process.
- Run `git diff master...HEAD` to review the actual changes for obvious coding mistakes (unused imports, dead code, unhandled errors, hardcoded values) - Run `git diff master...HEAD` to review the actual changes for obvious coding mistakes (unused imports, dead code, unhandled errors, hardcoded values)
- Run `cargo clippy --all-targets --all-features` and note any warnings - Run `cargo clippy --all-targets --all-features` and note any warnings
- If a `frontend/` directory exists: - If a `frontend/` directory exists:
- Run `pnpm run build` and note any TypeScript errors - Run `npm run build` and note any TypeScript errors
- Run `npx @biomejs/biome check src/` and note any linting issues - Run `npx @biomejs/biome check src/` and note any linting issues
### 2. Test Verification ### 2. Test Verification
- Run `cargo test` and verify all tests pass - Run `cargo test` and verify all tests pass
- If `frontend/` exists: run `pnpm test --run` and verify all frontend tests pass - If `frontend/` exists: run `npm test` and verify all frontend tests pass
- Review test quality: look for tests that are trivial or don't assert meaningful behavior - Review test quality: look for tests that are trivial or don't assert meaningful behavior
### 3. Manual Testing Support ### 3. Manual Testing Support
@@ -118,7 +118,7 @@ Print your QA report to stdout before your process exits. The server will automa
### Test Verification ### Test Verification
- cargo test: PASS/FAIL (N tests) - cargo test: PASS/FAIL (N tests)
- pnpm test: PASS/FAIL/SKIP (N tests) - npm test: PASS/FAIL/SKIP (N tests)
- Test quality issues: (list any trivial/weak tests, or "None") - Test quality issues: (list any trivial/weak tests, or "None")
### Manual Testing Plan ### Manual Testing Plan
@@ -164,12 +164,12 @@ Read CLAUDE.md first, then .story_kit/README.md to understand the dev process.
- Run `git diff master...HEAD` to review the actual changes for obvious coding mistakes (unused imports, dead code, unhandled errors, hardcoded values) - Run `git diff master...HEAD` to review the actual changes for obvious coding mistakes (unused imports, dead code, unhandled errors, hardcoded values)
- Run `cargo clippy --all-targets --all-features` and note any warnings - Run `cargo clippy --all-targets --all-features` and note any warnings
- If a `frontend/` directory exists: - If a `frontend/` directory exists:
- Run `pnpm run build` and note any TypeScript errors - Run `npm run build` and note any TypeScript errors
- Run `npx @biomejs/biome check src/` and note any linting issues - Run `npx @biomejs/biome check src/` and note any linting issues
### 2. Test Verification ### 2. Test Verification
- Run `cargo test` and verify all tests pass - Run `cargo test` and verify all tests pass
- If `frontend/` exists: run `pnpm test --run` and verify all frontend tests pass - If `frontend/` exists: run `npm test` and verify all frontend tests pass
- Review test quality: look for tests that are trivial or don't assert meaningful behavior - Review test quality: look for tests that are trivial or don't assert meaningful behavior
### 3. Manual Testing Support ### 3. Manual Testing Support
@@ -195,7 +195,7 @@ Print your QA report to stdout before your process exits. The server will automa
### Test Verification ### Test Verification
- cargo test: PASS/FAIL (N tests) - cargo test: PASS/FAIL (N tests)
- pnpm test: PASS/FAIL/SKIP (N tests) - npm test: PASS/FAIL/SKIP (N tests)
- Test quality issues: (list any trivial/weak tests, or "None") - Test quality issues: (list any trivial/weak tests, or "None")
### Manual Testing Plan ### Manual Testing Plan
@@ -237,7 +237,7 @@ Read CLAUDE.md first, then .story_kit/README.md to understand the dev process.
The merge pipeline uses a temporary merge-queue branch and worktree to isolate merges from master. Simple additive conflicts (both branches adding code at the same location) are resolved automatically by keeping both additions. Complex conflicts (modifying the same lines differently) are reported without touching master. The merge pipeline uses a temporary merge-queue branch and worktree to isolate merges from master. Simple additive conflicts (both branches adding code at the same location) are resolved automatically by keeping both additions. Complex conflicts (modifying the same lines differently) are reported without touching master.
## Fixing Minor Gate Failures ## Fixing Minor Gate Failures
If quality gates fail (cargo clippy, cargo test, pnpm build, pnpm test), attempt to fix minor issues yourself before reporting to the human. If quality gates fail (cargo clippy, cargo test, npm run build, npm test), attempt to fix minor issues yourself before reporting to the human.
**Fix yourself (up to 2 attempts total):** **Fix yourself (up to 2 attempts total):**
- Syntax errors (missing semicolons, brackets, commas) - Syntax errors (missing semicolons, brackets, commas)

View File

@@ -9,7 +9,7 @@ This project is a standalone Rust **web server binary** that serves a Vite/React
* **Framework:** Poem HTTP server with WebSocket support for streaming; HTTP APIs should use Poem OpenAPI (Swagger) for non-streaming endpoints. * **Framework:** Poem HTTP server with WebSocket support for streaming; HTTP APIs should use Poem OpenAPI (Swagger) for non-streaming endpoints.
* **Frontend:** TypeScript + React * **Frontend:** TypeScript + React
* **Build Tool:** Vite * **Build Tool:** Vite
* **Package Manager:** pnpm (required) * **Package Manager:** npm
* **Styling:** CSS Modules or Tailwind (TBD - Defaulting to CSS Modules) * **Styling:** CSS Modules or Tailwind (TBD - Defaulting to CSS Modules)
* **State Management:** React Context / Hooks * **State Management:** React Context / Hooks
* **Chat UI:** Rendered Markdown with syntax highlighting. * **Chat UI:** Rendered Markdown with syntax highlighting.
@@ -91,8 +91,8 @@ To support both Remote and Local models, the system implements a `ModelProvider`
* **Quality Gates:** * **Quality Gates:**
* `npx @biomejs/biome check src/` must show 0 errors, 0 warnings * `npx @biomejs/biome check src/` must show 0 errors, 0 warnings
* `npm run build` must succeed * `npm run build` must succeed
* `npx vitest run` must pass * `npm test` must pass
* `npx playwright test` must pass * `npm run test:e2e` must pass
* No `any` types allowed (use proper types or `unknown`) * No `any` types allowed (use proper types or `unknown`)
* React keys must use stable IDs, not array indices * React keys must use stable IDs, not array indices
* All buttons must have explicit `type` attribute * All buttons must have explicit `type` attribute
@@ -119,7 +119,7 @@ To support both Remote and Local models, the system implements a `ModelProvider`
Multiple instances can run simultaneously in different worktrees. To avoid port conflicts: Multiple instances can run simultaneously in different worktrees. To avoid port conflicts:
- **Backend:** Set `STORYKIT_PORT` to a unique port (default is 3001). Example: `STORYKIT_PORT=3002 cargo run` - **Backend:** Set `STORYKIT_PORT` to a unique port (default is 3001). Example: `STORYKIT_PORT=3002 cargo run`
- **Frontend:** Run `pnpm dev` from `frontend/`. It auto-selects the next unused port. It reads `STORYKIT_PORT` to know which backend to talk to, so export it before running: `export STORYKIT_PORT=3002 && cd frontend && pnpm dev` - **Frontend:** Run `npm run dev` from `frontend/`. It auto-selects the next unused port. It reads `STORYKIT_PORT` to know which backend to talk to, so export it before running: `export STORYKIT_PORT=3002 && cd frontend && npm run dev`
When running in a worktree, use a port that won't conflict with the main instance (3001). Ports 3002+ are good choices. When running in a worktree, use a port that won't conflict with the main instance (3001). Ports 3002+ are good choices.

View File

@@ -8,7 +8,7 @@ help:
@echo " make release V=x.y.z Build both targets and publish a Gitea release" @echo " make release V=x.y.z Build both targets and publish a Gitea release"
@echo "" @echo ""
@echo "Prerequisites:" @echo "Prerequisites:"
@echo " build-macos: Rust stable toolchain, pnpm" @echo " build-macos: Rust stable toolchain, npm"
@echo " build-linux: cargo install cross AND Docker Desktop running" @echo " build-linux: cargo install cross AND Docker Desktop running"
@echo "" @echo ""
@echo "Output:" @echo "Output:"
@@ -16,7 +16,7 @@ help:
@echo " Linux : target/x86_64-unknown-linux-musl/release/story-kit" @echo " Linux : target/x86_64-unknown-linux-musl/release/story-kit"
## Build a native macOS release binary. ## Build a native macOS release binary.
## The frontend is compiled by build.rs (pnpm build) and embedded via rust-embed. ## The frontend is compiled by build.rs (npm run build) and embedded via rust-embed.
## Verify dynamic deps afterwards: otool -L target/release/story-kit ## Verify dynamic deps afterwards: otool -L target/release/story-kit
build-macos: build-macos:
cargo build --release cargo build --release

View File

@@ -10,8 +10,8 @@ You can also run the frontend and backend separately in development (Vite dev se
```bash ```bash
# Build the frontend # Build the frontend
cd frontend cd frontend
pnpm install npm install
pnpm dev npm run dev
# Run the server (serves embedded frontend/dist/) # Run the server (serves embedded frontend/dist/)
cargo run cargo run
@@ -35,7 +35,7 @@ Story Kit ships as a **single self-contained binary** with the React frontend em
### macOS ### macOS
```bash ```bash
# Native build no extra tools required beyond Rust + pnpm # Native build no extra tools required beyond Rust + npm
make build-macos make build-macos
# Output: target/release/story-kit # Output: target/release/story-kit
@@ -109,10 +109,10 @@ The frontend uses **Vitest** for unit tests and **Playwright** for end-to-end te
cd frontend cd frontend
# Run unit tests # Run unit tests
pnpm test npm test
# Run end-to-end tests # Run end-to-end tests
pnpm test:e2e npm run test:e2e
``` ```
### Backend Tests ### Backend Tests

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
"@biomejs/biome": "^2.4.2", "@biomejs/biome": "^2.4.2",
"@playwright/test": "^1.47.2", "@playwright/test": "^1.47.2",
"@testing-library/jest-dom": "^6.0.0", "@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^14.0.0", "@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.4.3", "@testing-library/user-event": "^14.4.3",
"@types/node": "^25.0.0", "@types/node": "^25.0.0",
"@types/react": "^19.1.8", "@types/react": "^19.1.8",

5673
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -25,6 +25,7 @@ vi.mock("../api/agents", () => ({
import { agentsApi, subscribeAgentStream } from "../api/agents"; import { agentsApi, subscribeAgentStream } from "../api/agents";
import { api } from "../api/client"; import { api } from "../api/client";
const { WorkItemDetailPanel } = await import("./WorkItemDetailPanel"); const { WorkItemDetailPanel } = await import("./WorkItemDetailPanel");
const mockedGetWorkItemContent = vi.mocked(api.getWorkItemContent); const mockedGetWorkItemContent = vi.mocked(api.getWorkItemContent);

View File

@@ -482,9 +482,10 @@ export function WorkItemDetailPanel({
{/* Placeholder sections for future content */} {/* Placeholder sections for future content */}
{( {(
[ [{ id: "coverage", label: "Coverage" }] as {
{ id: "coverage", label: "Coverage" }, id: string;
] as { id: string; label: string }[] label: string;
}[]
).map(({ id, label }) => ( ).map(({ id, label }) => (
<div <div
key={id} key={id}

View File

@@ -9,7 +9,7 @@ cargo test --manifest-path "$PROJECT_ROOT/Cargo.toml"
echo "=== Running frontend unit tests ===" echo "=== Running frontend unit tests ==="
cd "$PROJECT_ROOT/frontend" cd "$PROJECT_ROOT/frontend"
pnpm test npm test
echo "=== Running e2e tests ===" echo "=== Running e2e tests ==="
pnpm test:e2e npm run test:e2e

View File

@@ -64,7 +64,7 @@ echo "=== Running frontend tests with coverage ==="
FRONTEND_DIR="$PROJECT_ROOT/frontend" FRONTEND_DIR="$PROJECT_ROOT/frontend"
FRONTEND_LINE_COV=0 FRONTEND_LINE_COV=0
if [ -d "$FRONTEND_DIR" ]; then if [ -d "$FRONTEND_DIR" ]; then
FRONTEND_REPORT=$(cd "$FRONTEND_DIR" && pnpm run test:coverage 2>&1) || true FRONTEND_REPORT=$(cd "$FRONTEND_DIR" && npm run test:coverage 2>&1) || true
echo "$FRONTEND_REPORT" echo "$FRONTEND_REPORT"
# Parse "All files" line from vitest coverage text table. # Parse "All files" line from vitest coverage text table.

View File

@@ -18,7 +18,7 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=PROFILE"); println!("cargo:rerun-if-env-changed=PROFILE");
println!("cargo:rerun-if-changed=../frontend/package.json"); println!("cargo:rerun-if-changed=../frontend/package.json");
println!("cargo:rerun-if-changed=../frontend/pnpm-lock.yaml"); println!("cargo:rerun-if-changed=../frontend/package-lock.json");
println!("cargo:rerun-if-changed=../frontend/vite.config.ts"); println!("cargo:rerun-if-changed=../frontend/vite.config.ts");
println!("cargo:rerun-if-changed=../frontend/index.html"); println!("cargo:rerun-if-changed=../frontend/index.html");
println!("cargo:rerun-if-changed=../frontend/src"); println!("cargo:rerun-if-changed=../frontend/src");
@@ -30,7 +30,7 @@ fn main() {
} }
// When cross-compiling (e.g. musl via `cross`), the Docker container // When cross-compiling (e.g. musl via `cross`), the Docker container
// has no Node/pnpm. The release script builds macOS first, so // has no Node/npm. The release script builds macOS first, so
// frontend/dist/ already exists. Skip the frontend build in that case. // frontend/dist/ already exists. Skip the frontend build in that case.
let target = env::var("TARGET").unwrap_or_default(); let target = env::var("TARGET").unwrap_or_default();
let host = env::var("HOST").unwrap_or_default(); let host = env::var("HOST").unwrap_or_default();
@@ -45,6 +45,6 @@ fn main() {
let frontend_dir = Path::new("../frontend"); let frontend_dir = Path::new("../frontend");
// Ensure dependencies are installed and build the frontend bundle. // Ensure dependencies are installed and build the frontend bundle.
run("pnpm", &["install"], frontend_dir); run("npm", &["install"], frontend_dir);
run("pnpm", &["build"], frontend_dir); run("npm", &["run", "build"], frontend_dir);
} }