Skip to content
Closed
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
62 changes: 62 additions & 0 deletions .github/workflows/bun-library-consumption.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Bun Library Consumption Test

on:
pull_request:

jobs:
# This library consumption smoke test
# tests direct API use case
# rather than standalone or iframe consumption
library-consumption:
runs-on: ubuntu-latest
if: "${{ github.event_name != 'pull_request' || github.event.pull_request.title != 'chore: bump version' }}"
timeout-minutes: 10

steps:

- name: Checkout code
uses: actions/checkout@v2

- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Build package
run: bun run build

- name: Pack package
run: bun pm pack

- name: Test library consumption in blank Vite app
run: |
cd /tmp
bun create vite test-app --template react-ts --no-install --no-interactive
cd test-app
bun install
bun add ${{ github.workspace }}/tscircuit-runframe-*.tgz

cat > src/App.tsx <<'EOF'
import { RunFrame } from "@tscircuit/runframe/runner"
import { CircuitJsonPreview } from "@tscircuit/runframe/preview"

function App() {
return (
<div style={{ width: "100vw", height: "100vh" }}>
<RunFrame
fsMap={{ "main.tsx": "circuit.add(<resistor resistance='1k' />)" }}
entrypoint="main.tsx"
/>
<CircuitJsonPreview circuitJson={[]} />
</div>
)
}

export default App
EOF

bun run build
bunx tsc --noEmit
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@tscircuit/runframe",
"main": "dist/preview.js",
"type": "module",
"version": "0.0.2300",
"version": "0.0.2303",
"exports": {
".": "./dist/preview.js",
"./preview": "./dist/preview.js",
Expand Down Expand Up @@ -76,7 +76,6 @@
"comlink": "^4.4.2",
"concurrently": "^9.1.2",
"cssnano": "^7.0.6",
"debug": "^4.4.0",
"easyeda": "^0.0.275",
"fflate": "^0.8.2",
"fuse.js": "^7.1.0",
Expand Down Expand Up @@ -114,7 +113,8 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@tscircuit/eval": "^0.0.1082",
"@tscircuit/solver-utils": "^0.0.7"
"@tscircuit/eval": "^0.0.1085",
"@tscircuit/solver-utils": "^0.0.7",
"debug": "^4.4.0"
}
}
Loading