Skip to content

Latest commit

 

History

History
250 lines (206 loc) · 17.9 KB

File metadata and controls

250 lines (206 loc) · 17.9 KB

Contributing to WebSpatial

Thank you for your interest in contributing to WebSpatial! This document provides guidelines and instructions for contributors.

Prerequisites

Required Tools

  • Node.js 24+ and pnpm 11+ to install dependencies and run the local test website
  • Xcode 26.x with the Apple Vision Pro simulator (current CI selects Xcode 26.3 for visionOS builds)
  • VSCode Text editor (recommended)

Recommended Knowledge

Be familiar with web development and common tools like React (how to build UI) and libraries like ThreeJS (3D scene management). Would be good to know how to build a standard website first:

Know how to build/run an Apple vision pro app in XCode

Development Setup

  1. Clone the repository:
git clone https://github.com/webspatial/webspatial-sdk.git
cd webspatial-sdk
  1. Enable pnpm:
corepack enable
corepack prepare pnpm@11.25.0 --activate
  1. Install packages and link to workspace for local development:
npm run setup
  1. Start the development server:
npm run dev
  1. Verify that the server is started by going to http://localhost:5173/

If you develop an external app with a linked @webspatial/react-sdk and Vite HMR (not the monorepo test-server), dedupe react / react-dom in Vite and alias the SDK to a single copy. Portal hook invariants and regression tests are documented in packages/react/src/spatialized-container/ARCHITECTURE.md (section Portal lifecycle and local dev (HMR)).

Local CodeQL-Aligned Checks

Run the fast unused-local check before opening a PR that changes TypeScript or JavaScript:

pnpm run check:unused

This runs tsc --noUnusedLocals true --noEmit across the package, test-server, and compatibility tsconfigs. It catches stale imports, local helpers, and bindings that would otherwise show up in CodeQL quality checks such as js/unused-local-variable.

For a closer local match to GitHub code scanning, install the CodeQL CLI, put codeql on your PATH, then run:

pnpm run codeql:js

The script creates a JavaScript/TypeScript database under .codeql-db/ and writes SARIF results to .codeql-results/javascript-security-and-quality.sarif. Override paths with CODEQL_DATABASE or CODEQL_OUTPUT, or set CODEQL=/path/to/codeql if the binary is not on PATH.

Testing on Apple Vision Pro Simulator

  1. Open the project in Xcode:
    • It is located in /packages/visionOS/web-spatial.xcodeproj
    • Click play to launch in the simulator
    • You should now see webspatial running in the simulator
    • To set a custom initial URL, you can modify manifest.swift

Packages

  • @webspatial/react-sdk - The React SDK makes the WebSpatial API immediately available inside React.
  • @webspatial/core-sdk - The React SDK is implemented on top of the Core SDK, which is a framework-agnostic pure-JS API that enables the WebSpatial App Shell to natively spatialize 2D HTML content and render 3D content.
  • @webspatial/builder - The build tool transforms websites into Packaged WebSpatial Apps for debugging and distributing on spatial computing platforms.

Changesets (releases)

Published packages in this monorepo are versioned with Changesets. Configuration lives in .changeset/config.json.

When you need a changeset

If your pull request changes anything under packages/ (source, package.json, platform shells, etc.), add a changeset so the release notes and semver bumps stay accurate:

  1. From the repo root, run pnpm changeset (or npx changeset add).
  2. Select the affected @webspatial/* packages and patch, minor, or major as appropriate. The fixed group in config bumps several packages together when any of them changes.
  3. Commit the generated .changeset/<random-name>.md with your code.

You do not need a changeset for edits that only touch apps/, tests/, .github/ (unless they change published packages), docs outside packages, or other paths that do not modify packages/.

Bypass (maintainers)

For rare cases where packages/ changed but no release note or version bump should be recorded, a maintainer can add the GitHub label skip-changeset to the PR so CI allows merging without a new .changeset/*.md file. Create that label once under Issues → Labels if it does not exist yet.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Licenses and Attributions

This project uses the following third-party libraries: