Skip to content

Merge origin/feat/2.8 into origin/main#181

Merged
yiiqii merged 17 commits into
mainfrom
feat/2.8
Apr 28, 2026
Merged

Merge origin/feat/2.8 into origin/main#181
yiiqii merged 17 commits into
mainfrom
feat/2.8

Conversation

@yiiqii

@yiiqii yiiqii commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Animation event support for animation clips
    • Frame component data structures
    • Orientation component configuration
    • Maskable graphic component support
    • Scene version 3.7 with composition child nodes
  • Chores

    • Version updated to 2.8.0
    • Node.js 18 and pnpm 8 now required
    • Deprecated legacy animation curve types in favor of Bezier alternatives

wumaolinmaoan and others added 17 commits February 3, 2026 11:13
feat: add text auto resize options
chore: remove unused rich text size property
Merge orgin/main into origin/feat/2.8
feat: add composition and vfx item children list data
fix: rename transparent texture and unify guid length
* fix: sprite component data add geometry property

* chore: update
* feat: add FrameComponentData

* chore: update

* chore: update

* chore: update
- Add `engines` field to package.json (node: 18, pnpm: 8)
- Add .nvmrc for Node 18
- Add JSONSceneVersion 3.7 for text autoSize and element children
- Bump package version from 2.7.2 to 2.8.0
chore: add engines bound and bump version to 2.8.0
@yiiqii yiiqii requested review from Copilot and wumaolinmaoan April 28, 2026 03:34
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR extends the animation system with event support, introduces new component data types (frame, maskable graphics, orientation), bumps the package version to 2.8.0, adds Node.js/pnpm engine constraints, and includes Claude configuration scaffolding for build validation and git workflows.

Changes

Cohort / File(s) Summary
Claude Configuration & Agent Prompts
.claude/agents/build-validator.md, .claude/commands/commit-push-pr.md, .claude/commands/quick-commit.md, .claude/settings.json
Introduces Claude agent configuration with build validation, commit/push/PR workflow documentation, and shell command allowlists with auto-formatting hooks.
Node Runtime & Package Configuration
.nvmrc, package.json
Pins Node.js runtime to version 18 and adds engine constraints; bumps package version from 2.7.2 to 2.8.0.
Animation Events System
src/animation/animation-event.ts, src/animation/animation-clip-data.ts, src/animation/index.ts, src/index.ts
Introduces AnimationEventInfoData type with name, startTime, and optional duration fields; extends AnimationClipData with optional events array and creates barrel export module.
Component Data Types
src/components/frame-component-data.ts, src/components/maskable-graphic-data.ts, src/components/orientation-component-data.ts, src/components/index.ts
Adds three new component interface types (FrameComponentData, MaskableGraphicData, OrientationComponentData) and updates barrel exports; deprecates TransparentTexture in favor of EmptyTexture in src/buitin-object-guid.ts.
Core Type System & Data Definitions
src/data-type.ts, src/composition.ts, src/scene.ts, src/type.ts, src/number-expression.ts, src/vfx-item-data.ts
Adds FrameComponent enum value; marks Composition deprecated and adds children property to CompositionData; bumps scene JSON version to 3.7; marks legacy curve/bezier types as deprecated; refactors VFXItemData with endBehavior and components declarations and deprecates legacy fields.
Item Component Updates
src/item/camera-item.ts, src/item/particle-item.ts, src/item/sprite-item.ts, src/item/text-item.ts, src/item/rich-text-item.ts, src/item/model/tree.ts
Adds CameraControllerData and ModelTreeComponentData composite types; adds looping flag to ParticleOptions and removes mask field from ParticleTrail; adds optional geometry to SpriteComponentData; replaces autoWidth/autoHeight with autoResize: TextSizeMode in text sizing; removes unused size field from RichTextContentOptions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • galacean/effects-specification#180: Directly modifies the same files and export-level types including package.json engines/version, animation/event types, component interfaces, and scene version updates.
  • galacean/effects-specification#159: Updates shared component data types in src/composition.ts and related component exports with overlapping scope.

Suggested reviewers

  • wumaolinmaoan
  • Copilot

Poem

🐰 Hops with glee through frames and animation,
New events dancing in celebration!
Components compose, from camera to sprite,
Legacy curves fade into the night.
Build and commit workflows, automation's delight—
A rabbit's work makes the code just right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The pull request title is vague and does not meaningfully describe the changeset. It merely states a branch merge operation without conveying what features or changes are included in the 2.8 release. Consider revising the title to describe the actual changes, such as 'Release v2.8: Add animation events, component data structures, and CLI tools' or similar to better communicate the content of the merge.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2.8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Effects JSON specification to v2.8.0 by introducing new schema capabilities (scene v3.7, child-node relationships, additional component data types) and deprecating/restructuring several legacy fields to support newer runtime data layouts.

Changes:

  • Add scene JSON version 3.7 and introduce children relationships for items/compositions.
  • Introduce/extend component data types (e.g., FrameComponentData, OrientationComponentData, sprite custom geometry) and add animation events to AnimationClipData.
  • Deprecate/relocate legacy fields and update exports/module structure (e.g., animation barrel export), plus bump package version and add Node/pnpm engine hints.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vfx-item-data.ts Adds endBehavior, components, children and organizes deprecated fields.
src/type.ts Deprecates RendererOptions.shape in favor of sprite geometry component data.
src/scene.ts Imports animation from new barrel; adds JSON scene version 3.7 and updates LATEST; clarifies legacy deprecation text.
src/number-expression.ts Adds deprecation notes for legacy curve/path value types and clarifies comments.
src/item/text-item.ts Replaces autoWidth/autoHeight with autoResize: TextSizeMode in text options.
src/item/sprite-item.ts Adds geometry?: DataPath for custom geometry on sprite components.
src/item/rich-text-item.ts Removes rich-text size option (and unused vec2 import).
src/item/particle-item.ts Adds looping?: boolean; removes trail mask field/import.
src/item/model/tree.ts Adds ModelTreeComponentData interface wrapper.
src/item/camera-item.ts Adds CameraControllerData; adjusts imports.
src/index.ts Switches export from animation-clip-data to new animation module barrel.
src/data-type.ts Adds FrameComponent to DataType enum.
src/composition.ts Marks Composition deprecated; adds children?: DataPath[] to CompositionData.
src/components/orientation-component-data.ts New orientation component data type.
src/components/maskable-graphic-data.ts New maskable graphic component data type.
src/components/index.ts Exports newly added component data modules.
src/components/frame-component-data.ts New frame component data type referencing DataType.FrameComponent.
src/buitin-object-guid.ts Renames builtin texture GUID entry to EmptyTexture.
src/animation/index.ts New animation barrel exports.
src/animation/animation-event.ts Adds animation event info data type.
src/animation/animation-clip-data.ts Updates imports due to relocation; adds events to clip data.
package.json Bumps version to 2.8.0; adds engines constraints.
.nvmrc Pins Node major version to 18 for local dev.
.claude/settings.json Adds Claude tool permissions and formatting/lint hooks.
.claude/commands/quick-commit.md Adds documented commit helper command.
.claude/commands/commit-push-pr.md Adds documented commit/push/PR helper command.
.claude/agents/build-validator.md Adds build validation agent instructions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,8 @@
import type { ComponentData } from './component-data';
import type { ColorData } from '../math/color-data';
import type { DataType } from 'src/data-type';
Comment thread src/buitin-object-guid.ts
export const BuiltinObjectGUID = {
WhiteTexture: 'whitetexture00000000000000000000',
TransparentTexture: 'transparenttexture00000000000000000000',
EmptyTexture: 'emptyTexture00000000000000000000',
Comment thread src/item/camera-item.ts
import type { ItemType, RotationOverLifetime } from '../type';
import type { FixedNumberExpression, FixedVec3Expression } from '../number-expression';
import type { CameraClipMode } from '../composition';
import type { ComponentData } from '../components/component-data';

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.claude/commands/commit-push-pr.md (1)

12-13: Make the CLI examples fully executable and consistent.

Line 12 and Line 13 currently read like partial commands; users copying them may fail (-u origin <branch> alone) or miss the stated default-base behavior.

Suggested doc tweak
-6. Push to the remote branch (create remote branch if needed with `-u origin <branch>`)
-7. Create a Pull Request using `gh pr create --base $name` with (If no name argument was provided, use main instead):
+6. Push to the remote branch (`git push -u origin <branch>` for first push, then `git push`)
+7. Create a Pull Request using `gh pr create --base <base-branch>` (use `main` if no base argument was provided), with:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/commands/commit-push-pr.md around lines 12 - 13, Update the two CLI
examples so they are complete, copy-pasteable commands: replace the fragment "-u
origin <branch>" with a full git push invocation that includes the upstream flag
and branch name, and make the gh PR example show a concrete, executable command
for creating a PR that documents the fallback to "main" when no name is supplied
(replace the ambiguous "gh pr create --base $name" text with a full example that
clearly indicates "use provided name or default to main"). Ensure the edited
strings that currently read "-u origin <branch>" and "gh pr create --base $name"
are replaced in the file so readers get runnable commands and explicit
default-base behavior.
src/animation/animation-event.ts (1)

1-10: Remove the commented-out scaffold.

The inactive AnimationEventData / eventData block makes the new public type harder to read. If it is not part of this release, please delete it instead of leaving dead commented code.

Proposed cleanup
-// export interface AnimationEventData {
-//   typeName?: string,
-// }
-
 export interface AnimationEventInfoData {
   name: string,
   startTime: number,
   duration?: number,
-//   eventData?: AnimationEventData,
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/animation/animation-event.ts` around lines 1 - 10, Remove the dead
commented scaffold for AnimationEventData and the commented eventData property
inside AnimationEventInfoData: delete the commented block starting with "export
interface AnimationEventData" and the commented line "//   eventData?:
AnimationEventData," so the file only contains the active public type
AnimationEventInfoData (name, startTime, duration?). Ensure no leftover
commented references to AnimationEventData or eventData remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/settings.json:
- Around line 38-45: The PostToolUse hook command currently falls back to a
non-existent "pnpm format --write" and ends with "|| true" which hides failures;
update the hook (in the "hooks" -> "PostToolUse" entry with matcher
"Write|Edit") to either call an existing formatter binary directly (for example
run the project's Prettier/clang-format/eslint --fix CLI with
"$CLAUDE_FILE_PATH") or add a real "format" script to package.json and call
"pnpm format \"$CLAUDE_FILE_PATH\"", and remove the trailing "|| true" so
lint/format failures surface instead of being silently ignored; ensure the
command still tries "pnpm lint:fix" first, then the explicit formatter command
as the fallback.

In `@src/number-expression.ts`:
- Around line 32-39: Update the deprecation comment on FixedVec3Expression to
accurately reflect that BezierPath is legacy and should be migrated to
BezierCurvePath, while LinearPath is still supported and should not be described
as legacy; specifically mention the recommended replacement BezierCurvePath for
BezierPath and clarify that LinearPath remains part of the current union. Make
the same clarification in the other related comment blocks that reference
FixedVec3Expression / BezierPath / LinearPath (the other occurrences you noted)
so all deprecation guidance is consistent with the actual union types.

---

Nitpick comments:
In @.claude/commands/commit-push-pr.md:
- Around line 12-13: Update the two CLI examples so they are complete,
copy-pasteable commands: replace the fragment "-u origin <branch>" with a full
git push invocation that includes the upstream flag and branch name, and make
the gh PR example show a concrete, executable command for creating a PR that
documents the fallback to "main" when no name is supplied (replace the ambiguous
"gh pr create --base $name" text with a full example that clearly indicates "use
provided name or default to main"). Ensure the edited strings that currently
read "-u origin <branch>" and "gh pr create --base $name" are replaced in the
file so readers get runnable commands and explicit default-base behavior.

In `@src/animation/animation-event.ts`:
- Around line 1-10: Remove the dead commented scaffold for AnimationEventData
and the commented eventData property inside AnimationEventInfoData: delete the
commented block starting with "export interface AnimationEventData" and the
commented line "//   eventData?: AnimationEventData," so the file only contains
the active public type AnimationEventInfoData (name, startTime, duration?).
Ensure no leftover commented references to AnimationEventData or eventData
remain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ac32dd8-4018-4595-9c97-e90b2cf17abd

📥 Commits

Reviewing files that changed from the base of the PR and between d0b9503 and b0df3f2.

📒 Files selected for processing (27)
  • .claude/agents/build-validator.md
  • .claude/commands/commit-push-pr.md
  • .claude/commands/quick-commit.md
  • .claude/settings.json
  • .nvmrc
  • package.json
  • src/animation/animation-clip-data.ts
  • src/animation/animation-event.ts
  • src/animation/index.ts
  • src/buitin-object-guid.ts
  • src/components/frame-component-data.ts
  • src/components/index.ts
  • src/components/maskable-graphic-data.ts
  • src/components/orientation-component-data.ts
  • src/composition.ts
  • src/data-type.ts
  • src/index.ts
  • src/item/camera-item.ts
  • src/item/model/tree.ts
  • src/item/particle-item.ts
  • src/item/rich-text-item.ts
  • src/item/sprite-item.ts
  • src/item/text-item.ts
  • src/number-expression.ts
  • src/scene.ts
  • src/type.ts
  • src/vfx-item-data.ts
💤 Files with no reviewable changes (1)
  • src/item/rich-text-item.ts

Comment thread .claude/settings.json
Comment on lines +38 to +45
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "pnpm lint:fix 2>/dev/null || pnpm format --write \"$CLAUDE_FILE_PATH\" 2>/dev/null || true"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix the post-write hook so formatting actually runs.

pnpm format --write is not defined in package.json, so the fallback never formats anything. The trailing || true also masks real lint/format failures, which makes this hook report success even when the file is still broken.

Please add a real format script or call the formatter directly, and avoid swallowing unexpected failures.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/settings.json around lines 38 - 45, The PostToolUse hook command
currently falls back to a non-existent "pnpm format --write" and ends with "||
true" which hides failures; update the hook (in the "hooks" -> "PostToolUse"
entry with matcher "Write|Edit") to either call an existing formatter binary
directly (for example run the project's Prettier/clang-format/eslint --fix CLI
with "$CLAUDE_FILE_PATH") or add a real "format" script to package.json and call
"pnpm format \"$CLAUDE_FILE_PATH\"", and remove the trailing "|| true" so
lint/format failures surface instead of being silently ignored; ensure the
command still tries "pnpm lint:fix" first, then the explicit formatter command
as the fallback.

Comment thread src/number-expression.ts
Comment on lines +32 to 39
* 曲线(Hermite 曲线)
* @deprecated 使用 BEZIER_CURVE 替代,此类型仅用于旧数据迁移兼容
*/
CURVE = 6,
/**
* 贝塞尔路径
* @deprecated 使用 BEZIER_CURVE_PATH 替代,此类型仅用于旧数据迁移兼容
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify the FixedVec3Expression deprecation note.

The ValueType deprecations are fine, but the FixedVec3Expression comment says BezierPath and LinearPath are legacy while recommending BezierCurvePath. Since LinearPath is still part of the union, please make the migration guidance match the actual supported set so consumers don't get mixed signals.

Also applies to: 122-126, 155-165

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/number-expression.ts` around lines 32 - 39, Update the deprecation
comment on FixedVec3Expression to accurately reflect that BezierPath is legacy
and should be migrated to BezierCurvePath, while LinearPath is still supported
and should not be described as legacy; specifically mention the recommended
replacement BezierCurvePath for BezierPath and clarify that LinearPath remains
part of the current union. Make the same clarification in the other related
comment blocks that reference FixedVec3Expression / BezierPath / LinearPath (the
other occurrences you noted) so all deprecation guidance is consistent with the
actual union types.

@yiiqii yiiqii merged commit e997d15 into main Apr 28, 2026
7 checks passed
@yiiqii yiiqii deleted the feat/2.8 branch May 18, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants