Skip to content
Open
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
65 changes: 0 additions & 65 deletions .github/workflows/cli-integration-test.yml

This file was deleted.

16 changes: 13 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
test:
Expand All @@ -20,5 +20,15 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test
- name: Build packages
run: pnpm run build
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps
- name: Run vitest tests
run: pnpm run test:vitest
- name: Run Playwright embed tests
run: pnpm run test:embed:playwright
- name: Run CLI integration tests
run: pnpm run test:cli:integration
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ wokwi.toml
*.bin
diagram.json
screenshot.png
playwright-report/
test-results/
test-project/
2 changes: 2 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export default defineConfig(
'**/.git/**',
'**/coverage/**',
'**/*.min.js',
'**/playwright-report/**',
'**/test-results/**',
],
},

Expand Down
18 changes: 6 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
"clean": "pnpm -r run clean",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "npm run lint && vitest --run",
"test": "pnpm run test:vitest && pnpm run test:embed:playwright && pnpm run test:cli:integration",
"test:vitest": "pnpm run lint && vitest --run",
"test:embed:playwright": "playwright test test/wokwi-embed",
"test:embed:playwright:ui": "playwright test test/wokwi-embed --ui",
"test:cli:integration": "bash scripts/test-cli-integration.sh",
"cli": "tsx packages/wokwi-cli/src/main.ts",
"prepare": "husky install"
},
Expand All @@ -19,19 +23,9 @@
"type": "git",
"url": "https://github.com/wokwi/wokwi-cli"
},
"dependencies": {
"@clack/prompts": "^0.7.0",
"@iarna/toml": "2.2.5",
"@modelcontextprotocol/sdk": "^1.0.0",
"arg": "^5.0.2",
"chalk": "^5.3.0",
"chalk-template": "^1.1.0",
"pngjs": "^7.0.0",
"ws": "^8.13.0",
"yaml": "^2.3.1"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@playwright/test": "^1.48.0",
"esbuild": "^0.25.2",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
Expand Down
12 changes: 9 additions & 3 deletions packages/wokwi-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
"main": "index.js",
"type": "module",
"scripts": {
"build": "node tools/build.js",
"package": "npm run build && pkg --public -o dist/bin/wokwi-cli -t node20-linuxstatic-arm64,node20-linuxstatic-x64,node20-macos-arm64,node20-macos-x64,node20-win-x64 dist/cli.cjs",
"prebuild": "pnpm run clean",
"build": "tsc && pnpm run bundle",
"bundle": "node tools/bundle.js",
"package": "pnpm run build && pkg --public -o dist/bin/wokwi-cli -t node20-linuxstatic-arm64,node20-linuxstatic-x64,node20-macos-arm64,node20-macos-x64,node20-win-x64 dist/cli.cjs",
"clean": "rimraf dist",
"lint": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix",
"cli": "tsx src/main.ts",
"test": "npm run lint && vitest --run",
"test": "pnpm run lint && vitest --run",
"test:watch": "vitest --watch"
},
"keywords": [
Expand Down Expand Up @@ -41,6 +46,7 @@
"chalk": "^5.3.0",
"chalk-template": "^1.1.0",
"pngjs": "^7.0.0",
"wokwi-client-js": "workspace:*",
"ws": "^8.13.0",
"yaml": "^2.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/wokwi-cli/src/TestScenario.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalkTemplate from 'chalk-template';
import type { APIClient } from './APIClient.js';
import type { APIClient } from 'wokwi-client-js';

export interface IScenarioCommand {
/** Validates the input to the command. Throws an exception of the input is not valid */
Expand Down
2 changes: 2 additions & 0 deletions packages/wokwi-cli/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const DEFAULT_SERVER = process.env.WOKWI_CLI_SERVER ?? 'wss://wokwi.com/api/ws/beta';

Loading
Loading