Meta Spark Studio TypeScript Bundler

0.3.0 · active · verified Wed Apr 22

sparkar-bundler is a command-line interface (CLI) tool designed to bundle TypeScript projects specifically for use within Meta Spark Studio. It leverages `esbuild` for high-performance bundling, enabling developers to write Spark AR scripts in TypeScript while benefiting from features like IntelliSense for both Meta Spark API definitions and external Node.js modules. This tool aims to streamline the development workflow by abstracting away complex bundling configurations. Currently at version 0.3.0, it is in active development with a focus on providing a seamless experience for integrating modern JavaScript/TypeScript practices into the Spark AR ecosystem. Its primary differentiator is the specialized handling of Meta Spark API type definitions, which is crucial for developer tooling in a proprietary environment. The release cadence is currently irregular as it's an early-stage project.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates the global installation and basic command-line usage to bundle a TypeScript source file into a Meta Spark Studio project.

npm install -g sparkar-bundler

# Navigate into your Meta Spark Studio project directory
cd ~/mySparkProject

# Ensure you have an empty JavaScript file saved in Spark AR Studio
# (e.g., scripts/script.js, ensure it's referenced in the project)

# Run the bundler, it will guide you to select the target script
sparkar-bundler

# The bundled output (e.g., main.js) will be written to your selected script file.
# You should see 'hello, world' (or your script's output) in Meta Spark Studio console.

view raw JSON →