Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mihaip/infinite-mac/llms.txt

Use this file to discover all available pages before exploring further.

All development tasks in Infinite Mac are driven through npm run. The scripts are defined in package.json and delegate to shell scripts under scripts/ or to Python programs invoked via uv run. The sections below group every script by purpose.

Development Server

start

npm run start
Launches the Vite development server via scripts/start-dev.sh. The app is served at http://localhost:3127 with Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp headers set automatically so that SharedArrayBuffer works without additional configuration.

preview

npm run preview
Serves the pre-built assets from the build/ directory using Vite’s preview server. Runs at https://localhost:4127 (TLS is provided by @vitejs/plugin-basic-ssl). Requires a prior npm run build.

worker-dev

npm run worker-dev
Starts a local Cloudflare Worker preview using wrangler dev --port=3128. The result is accessible at http://localhost:3128. Requires a separate npm run build invocation before running, since wrangler serves the pre-built assets from build/.

Building

build-tools

npm run build-tools
Runs scripts/build-tools.sh to compile the native helper programs that the disk and library import scripts depend on. Run this once after npm install before using any of the import-* scripts.

build

npm run build
Runs vite build and outputs the compiled app into the build/ directory. The same output is used for local preview (preview) and Cloudflare Worker deployment (worker-deploy). The worker-deploy script sets CLOUDFLARE_ENV=production before invoking Vite to enable the production-only R2 bucket bindings and CDN cache configuration defined in wrangler.jsonc.

Importing Data

import-disks [minimal]

npm run import-disks
npm run import-disks minimal
Builds disk images for serving. Copies base OS images for each supported emulator, chunks them, and generates a disk manifest. When run without arguments the full import runs, including populating the “Infinite HD” disk image from the Library/ directory.
  • minimal — builds System 1 through System 7.5.5 only and skips populating Infinite HD, providing a fast path for development
This script calls the native macOS Mini vMac and Basilisk II binaries as a final step to validate the desktop database on the generated disk. If they are not installed, a warning is logged and the disk may take longer to mount in the emulator.

import-cd-roms [placeholder] [--sync-media]

npm run import-cd-roms
npm run import-cd-roms placeholder
npm run import-cd-roms -- --sync-media
Builds the CD-ROM and floppy disk library. Most CD-ROMs are hosted on external sites; floppies and local media are self-hosted in the Cloudflare R2 bucket.
  • placeholder — creates an empty CD-ROM library stub so the app runs without errors during development
  • --sync-media — syncs self-hosted media files to the Cloudflare R2 bucket; this is separate from the disk image sync performed by sync-disks

import-library [placeholder]

npm run import-library
npm run import-library placeholder
Builds the Macintosh Garden downloads library. Actual downloads are hosted on macintoshgarden.org and other sites; the library contains only metadata.
  • placeholder — generates a minimal library that does not require a local Macintosh Garden data dump, suitable for development

import-emulator <emulator>

npm run import-emulator basiliskii
npm run import-emulator minivmac-Plus
Copies the compiled WebAssembly output from an emulator submodule into src/emulator/worker/emscripten/. Only necessary when modifying an emulator core and rebuilding it from source. The following emulator targets are supported:
TargetSource
basiliskiimacemu/BasiliskII/src/Unix
sheepshavermacemu/SheepShaver/src/Unix
minivmac-Plusminivmac/
minivmac-128Kminivmac/
minivmac-512Keminivmac/
minivmac-SEminivmac/
minivmac-IIminivmac/
minivmac-IIxminivmac/
dingusppcdingusppc/build/bin
previousprevious/build/src
pearpcpearpc/src
snowsnow/target/wasm32-unknown-emscripten/release

Deployment

worker-deploy

npm run worker-deploy
Runs scripts/worker-deploy.sh, which performs a TypeScript check (tsc --noEmit) on both the app and worker tsconfigs, then runs vite build with CLOUDFLARE_ENV=production, and finally calls wrangler deploy to push the Worker to Cloudflare.

sync-disks

npm run sync-disks
Runs scripts/sync-disks.sh, which uses rclone to sync the chunked disk images from Images/build to the infinite-mac-disk Cloudflare R2 bucket. Requires rclone to be installed and configured via scripts/rclone.conf.

Code Quality

prettier

npm run prettier
Auto-formats all files under src/ and worker/ with Prettier using the project configuration in package.json (4-space indentation, ES5 trailing commas, double quotes, no bracket spacing).

lint

npm run lint
Runs ESLint with --fix over src/ and worker/. The ESLint config enforces TypeScript-aware rules via @typescript-eslint and React Hooks lint rules.

check

npm run check
Runs two TypeScript type checks in sequence — one for the main app (tsconfig.json) and one for the Cloudflare Worker (worker/tsconfig.json) — with --noEmit so no output files are written. Both must pass for the check to succeed.

format-macemu

npm run format-macemu
Runs clang-format -i over all files matching macemu/BasiliskII/src/Unix/JS/*, formatting the Basilisk II JavaScript glue files to the project’s C/C++ style.

Utilities

load-placeholder-stickies-file

npm run load-placeholder-stickies-file
Runs scripts/load-placeholder-stickies-file.py via uv run. Injects a placeholder Stickies file into the generated disk image so that the Stickies application opens with sample notes. Used during development to verify that the Stickies injection pipeline works correctly.

generate-local-ca-bundle

npm run generate-local-ca-bundle
Runs scripts/generate-local-ca-bundle.mjs via Node. Generates a local CA certificate bundle used to support HTTPS in the development server (npm run start). Only needed when working on features that require a trusted TLS certificate locally.

Build docs developers (and LLMs) love