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
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

- name: Install Dependencies
run: bun install

- name: Lint
run: bun run lint
continue-on-error: true

- name: Build Framework
run: |
cd packages/motionforge
bun install
bun run build

- name: Build CLI
run: |
cd packages/create-motionforge
bun install
# No build script for CLI yet as it is direct JS, but verify it exists
ls bin/index.js
73 changes: 73 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Publish to NPM

on:
push:
branches: [ main ]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for provenance
steps:
- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

- name: Install Dependencies
run: bun install

- name: Publish MotionForge
run: |
cd packages/motionforge
bun install
bun run build

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

if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then
echo "Publishing motionforge@$CURRENT_VERSION..."
npm publish --access public --provenance
else
echo "motionforge@$CURRENT_VERSION is already published."
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Create-MotionForge
run: |
cd packages/create-motionforge
bun install

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

if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then
echo "Publishing create-motionforge@$CURRENT_VERSION..."
npm publish --access public --provenance
else
echo "create-motionforge@$CURRENT_VERSION is already published."
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49 changes: 41 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,28 @@ This scaffold provides a robust foundation built with:

## 🚀 Quick Start

The fastest way to get started with MotionForge is by using the CLI tool:
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.

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

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)
**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
```

## 🛠️ Development Setup (for Framework Contributors)

Expand Down Expand Up @@ -139,12 +150,17 @@ 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 with the CLI
You can create a new MotionForge project in seconds:
### 🚀 Getting Started
To create a new project:
```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 All @@ -154,6 +170,23 @@ npx create-motionforge@latest
### Exporting Video:
Use the "Export" button in the Player to render your composition to a high-quality WebM video.

## 🚀 CI/CD & Automated Publishing

MotionForge is configured with GitHub Actions to automate testing and publishing.

### Automated Publishing
Whenever you push a change to the `main` branch, the workflow will:
1. Run the CI verification suite (Lint, Build, Type-check).
2. Check if the version in `package.json` for `motionforge` or `create-motionforge` has been bumped.
3. If a new version is detected, it will automatically publish the package to NPM with **Provenance** (secure, verifiable builds).

### How to set up
To enable automated publishing, you must add your NPM token to your GitHub repository:
1. Go to your GitHub Repository **Settings** > **Secrets and variables** > **Actions**.
2. Create a **New repository secret**.
3. Name: `NPM_TOKEN`.
4. Value: Your NPM Access Token (Automation type recommended).

---

Built with ❤️ for the developer community.
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** - WebM encoding with MediaRecorder API
- 🎥 **Video Export** - High-performance WebCodecs & Frame-by-frame rendering
- 🎯 **TypeScript First** - Full type safety out of the box

## 📦 Installation
Expand Down
Loading
Loading