Skip to content
Merged
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
68 changes: 68 additions & 0 deletions .github/workflows/bun-library-consumption.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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: canary

- 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
# workaround for bun add hanging
# bun add ${{ github.workspace }}/tscircuit-runframe-*.tgz
# Maybe fixed by https://github.com/oven-sh/bun/pull/33156
npm install ${{ github.workspace }}/tscircuit-runframe-*.tgz --no-package-lock
bun pm cache rm
bun install --offline
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
Loading
Loading