Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:
run: |
cd packages/create-motionforge
bun install
# No build script for CLI yet as it is direct JS, but verify it exists
# Verify binary exists
ls bin/index.js
43 changes: 33 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,65 @@ jobs:
restore-keys: |
${{ runner.os }}-bun-

- name: Install Dependencies
run: bun install
- name: Verify NPM Token
run: |
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
echo "::error::NPM_TOKEN is missing. Please add it to your GitHub Repository Secrets."
exit 1
fi

- name: Publish MotionForge
run: |
echo "Processing motionforge..."
cd packages/motionforge
bun install
bun run build

# Only publish if version changed
PACKAGE_NAME=$(node -p "require('./package.json').name")
CURRENT_VERSION=$(node -p "require('./package.json').version")
NPM_VERSION=$(npm view motionforge version 2>/dev/null || echo "0.0.0")

echo "Checking if $PACKAGE_NAME@$CURRENT_VERSION is already published..."
# Use || true to prevent exit on error if package doesn't exist
NPM_VERSION=$(npm view $PACKAGE_NAME version 2>/dev/null || echo "")

if [ -z "$NPM_VERSION" ]; then
echo "Package $PACKAGE_NAME not found on NPM. Initial publication."
NPM_VERSION="0.0.0"
fi

if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then
echo "Publishing motionforge@$CURRENT_VERSION..."
echo "New version detected: $CURRENT_VERSION (NPM has $NPM_VERSION). Publishing..."
npm publish --access public --provenance
echo "Successfully published $PACKAGE_NAME@$CURRENT_VERSION"
else
echo "motionforge@$CURRENT_VERSION is already published."
echo "$PACKAGE_NAME@$CURRENT_VERSION is already up to date on NPM."
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Create-MotionForge
run: |
echo "Processing create-motionforge..."
cd packages/create-motionforge
bun install

# Only publish if version changed
PACKAGE_NAME=$(node -p "require('./package.json').name")
CURRENT_VERSION=$(node -p "require('./package.json').version")
NPM_VERSION=$(npm view create-motionforge version 2>/dev/null || echo "0.0.0")

echo "Checking if $PACKAGE_NAME@$CURRENT_VERSION is already published..."
NPM_VERSION=$(npm view $PACKAGE_NAME version 2>/dev/null || echo "")

if [ -z "$NPM_VERSION" ]; then
echo "Package $PACKAGE_NAME not found on NPM. Initial publication."
NPM_VERSION="0.0.0"
fi

if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then
echo "Publishing create-motionforge@$CURRENT_VERSION..."
echo "New version detected: $CURRENT_VERSION (NPM has $NPM_VERSION). Publishing..."
npm publish --access public --provenance
echo "Successfully published $PACKAGE_NAME@$CURRENT_VERSION"
else
echo "create-motionforge@$CURRENT_VERSION is already published."
echo "$PACKAGE_NAME@$CURRENT_VERSION is already up to date on NPM."
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,17 @@ This scaffold provides a robust foundation built with:

## 🚀 Quick Start

There are two ways to use MotionForge depending on your needs:

### 1. Starting a New Project (Recommended)
Use the CLI to bootstrap a complete video project with templates and configurations ready to go.
The fastest way to get started with MotionForge is by using the CLI tool:

```bash
# This will work once you publish the package to NPM
npx create-motionforge@latest
```

**Note:** If you haven't published to NPM yet, you can test it locally from this repo:
```bash
cd packages/create-motionforge
bun run start
```

### 2. Adding to an Existing Project
If you already have a Next.js or React project, just install the library:

```bash
npm install motionforge
```
This will guide you through:
- 📁 Choosing a project name
- 🎨 Selecting a template (**Hello World** or **Blank**)
- 💅 Adding **Tailwind CSS** support
- 🤖 Including **AI Agent Guidelines** (Google Gemini/Z.ai GLM)

## 🛠️ Development Setup (for Framework Contributors)

Expand Down Expand Up @@ -150,17 +139,12 @@ This scaffold includes a comprehensive set of modern web development tools:

MotionForge is a high-performance, React-based programmatic video framework. It is designed to be a modern alternative to Remotion, offering seamless integration with Next.js and Tailwind CSS.

### 🚀 Getting Started
To create a new project:
### 🚀 Getting Started with the CLI
You can create a new MotionForge project in seconds:
```bash
npx create-motionforge@latest
```

To add to an existing project:
```bash
npm install motionforge
```

### Key Features:
- **Frame-Perfect Rendering**: deterministic animations driven by frame number.
- **High-Speed Export**: Frame-by-frame video export using WebCodecs.
Expand Down
4 changes: 4 additions & 0 deletions packages/create-motionforge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@
"fs-extra": "^11.3.3",
"inquirer": "^13.2.2",
"ora": "8.0.1"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
}
}
2 changes: 1 addition & 1 deletion packages/motionforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- 📊 **Interpolation System** - Smooth transitions with 20+ easing functions
- 🎮 **Interactive Player** - Real-time preview with timeline controls
- 📦 **Frame Caching** - LRU cache for optimized performance
- 🎥 **Video Export** - High-performance WebCodecs & Frame-by-frame rendering
- 🎥 **Video Export** - WebM encoding with MediaRecorder API
- 🎯 **TypeScript First** - Full type safety out of the box

## 📦 Installation
Expand Down
Loading