Conversation
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
feat: add animation event info data
feat: add particle looping option
* 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
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.7and introducechildrenrelationships for items/compositions. - Introduce/extend component data types (e.g.,
FrameComponentData,OrientationComponentData, sprite customgeometry) and add animation events toAnimationClipData. - Deprecate/relocate legacy fields and update exports/module structure (e.g.,
animationbarrel 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'; | |||
| export const BuiltinObjectGUID = { | ||
| WhiteTexture: 'whitetexture00000000000000000000', | ||
| TransparentTexture: 'transparenttexture00000000000000000000', | ||
| EmptyTexture: 'emptyTexture00000000000000000000', |
| 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'; |
There was a problem hiding this comment.
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/eventDatablock 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
📒 Files selected for processing (27)
.claude/agents/build-validator.md.claude/commands/commit-push-pr.md.claude/commands/quick-commit.md.claude/settings.json.nvmrcpackage.jsonsrc/animation/animation-clip-data.tssrc/animation/animation-event.tssrc/animation/index.tssrc/buitin-object-guid.tssrc/components/frame-component-data.tssrc/components/index.tssrc/components/maskable-graphic-data.tssrc/components/orientation-component-data.tssrc/composition.tssrc/data-type.tssrc/index.tssrc/item/camera-item.tssrc/item/model/tree.tssrc/item/particle-item.tssrc/item/rich-text-item.tssrc/item/sprite-item.tssrc/item/text-item.tssrc/number-expression.tssrc/scene.tssrc/type.tssrc/vfx-item-data.ts
💤 Files with no reviewable changes (1)
- src/item/rich-text-item.ts
| "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" |
There was a problem hiding this comment.
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.
| * 曲线(Hermite 曲线) | ||
| * @deprecated 使用 BEZIER_CURVE 替代,此类型仅用于旧数据迁移兼容 | ||
| */ | ||
| CURVE = 6, | ||
| /** | ||
| * 贝塞尔路径 | ||
| * @deprecated 使用 BEZIER_CURVE_PATH 替代,此类型仅用于旧数据迁移兼容 | ||
| */ |
There was a problem hiding this comment.
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.
Summary by CodeRabbit
New Features
Chores