Package Overview
@weaverse/core
This foundational package contains the core logic of Weaverse and Weaverse Items, focusing on essential operations and
data handling within the Weaverse ecosystem.
Key Features:
- Data model definitions for Weaverse components
- Core rendering logic
- State management utilities
- Type definitions shared across the ecosystem
@weaverse/react
Specializing in the user interface, this package provides React bindings for Weaverse, managing the rendering of Weaverse Items as React components and ensuring proper display and interaction within themes.
Key Features:
- React component rendering system for Weaverse items
- Context providers for Weaverse and item states
- Custom hooks for accessing Weaverse data and item instances
- Utility functions for CSS generation and class name handling
WeaverseRoot
: The main component that renders your Weaverse content treeWeaverseContextProvider
: Provides the Weaverse context to all child componentsItemComponent
: Renders individual Weaverse items based on their type and properties
useWeaverse()
: Access the Weaverse instance from any componentuseItemInstance(id?)
: Get a specific item instance by ID or the current itemuseParentInstance()
: Get the parent item of the current componentuseChildInstances(id?)
: Get all child instances of an item
@weaverse/hydrogen
Tailored for theme development, this package carries the logic required to build a Hydrogen Theme and facilitate its
integration with Weaverse Studio’s customization features.
Key Features:
- Shopify Hydrogen integration
- Theme customization components
- Studio preview capabilities
- Hydrogen-specific renderers and utilities
@weaverse/cli
A command-line tool included in the SDK, aiding developers in creating, managing, and deploying Weaverse Hydrogen themes
with ease and efficiency.
Key Features:
- Project scaffolding with templates
- Development workflow utilities
- Project configuration tools
- Build and deployment helpers
@weaverse/biome
A package that provides standardized Biome configuration for Weaverse projects, ensuring consistent code formatting and linting across all Weaverse-related codebases.
Key Features:
- Preconfigured Biome settings optimized for Weaverse development
- Consistent code style enforcement
- Standardized linting rules with appropriate severity levels
- Compatible with React and TypeScript projects
biome.json
file to extend the Weaverse configuration:
-
JavaScript/TypeScript formatting:
- Uses single quotes
- Employs spaces for indentation
- Semicolons only as needed
-
Linting rules with sensible defaults:
- Accessibility (a11y) checks
- React-specific best practices
- Security protections
- Code complexity guidance
Package Compatibility
The Weaverse SDK packages are designed to work together seamlessly, but each can also be used independently based on your project needs:Package | Compatible With | Required Dependencies |
---|---|---|
@weaverse/core | Any JavaScript project | None |
@weaverse/react | React 18+ applications | @weaverse/core |
@weaverse/hydrogen | Shopify Hydrogen | @weaverse/core , @weaverse/react |
@weaverse/cli | Node.js environment | None |
@weaverse/biome | Any JavaScript/TypeScript project | None (depends on @biomejs/biome ) |
System Requirements
- Node.js: v18.0.0 or higher
- npm: v7.0.0 or higher (or equivalent package manager)
- React: v18.0.0 or higher (for React-based packages)
- Shopify Hydrogen: Latest version recommended (for Hydrogen integration)