How hubenchang0515/shift works
Shift is a browser-based WebAssembly coding playground. Users choose a language, edit code, provide standard input, run it and view output in a terminal; they can also share code and input through a link. Python package installation is a separate capability that installs supported wheels into the Python runtime. The README establishes the main workflow and language breadth; the excerpts do not show all runtime dispatch and terminal plumbing, so uncertain internal links are omitted.
Main entry points: App.tsx Playground controller · PipInstaller.tsx Package manager UI · webpip.ts Wheel installer · pypiProxy.ts PyPI proxy helper
Components 19
Playground UI
- Playground controller
src/App.tsx - Code editor
src/components/HighlightEditor.tsx - Terminal
src/App.tsx - Share links
src/App.tsx
Language runtimes
- Python runtime
src/wasm/python.js - Lua runtime
src/wasm/lua.js - Ruby runtime
src/wasm/ruby.js - Bash runtime
src/wasm/bash.js - Chibi runtime
src/wasm/chibi.js - PicoC runtime
src/wasm/picoc.js - QuickJS runtime
src/wasm/qjs.js
Python packages
- Package manager UI
src/components/PipInstaller.tsx - Wheel installer
src/utils/webpip.ts - PyPI proxy helper
src/utils/pypiProxy.ts
Browser utilities
- ANSI formatting
src/utils/ansi.ts - Fetch helper
src/utils/fetch.ts - Package filesystem
src/utils/pipfs.ts
Other components
- User
- PyPI
Connections 18
- User → Playground controller: uses
- Playground controller → Code editor: edits code
- Playground controller → Terminal: controls
- Playground controller → Share links: creates links
- Playground controller → Python runtime: runs selected
- Playground controller → Lua runtime: runs selected
- Playground controller → Ruby runtime: runs selected
- Playground controller → Bash runtime: runs selected
- Playground controller → Chibi runtime: runs selected
- Playground controller → PicoC runtime: runs selected
- Playground controller → QuickJS runtime: runs selected
- Playground controller → Package manager UI: opens packages
- Package manager UI → Python runtime: initializes
- Package manager UI → Wheel installer: installs or removes
- Wheel installer → PyPI proxy helper: fetches through
- PyPI proxy helper → PyPI: requests package data
- Wheel installer → Package filesystem: updates files
- Playground controller → ANSI formatting: formats terminal text