diff --git a/cocos/2d/assembler/graphics/types.ts b/cocos/2d/assembler/graphics/types.ts index 1ade132c5b5..9681eecacb3 100644 --- a/cocos/2d/assembler/graphics/types.ts +++ b/cocos/2d/assembler/graphics/types.ts @@ -23,7 +23,7 @@ THE SOFTWARE. */ -import { ccenum } from '../../../core'; +import { ccenum } from '@base/object'; /** * @en Enum for LineCap. diff --git a/cocos/2d/components/label.ts b/cocos/2d/components/label.ts index 7f1c3c8ff29..a45f6cbc2dc 100644 --- a/cocos/2d/components/label.ts +++ b/cocos/2d/components/label.ts @@ -27,9 +27,10 @@ import { ccclass, help, executionOrder, menu, tooltip, displayOrder, visible, mu import { BYTEDANCE, EDITOR, JSB } from 'internal:constants'; import { minigame } from 'pal/minigame'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { BitmapFont, Font, SpriteFrame } from '../assets'; import { ImageAsset, Texture2D } from '../../asset/assets'; -import { ccenum, Color, Vec2 } from '../../core'; +import { Color, Vec2 } from '../../core'; import { IBatcher } from '../renderer/i-batcher'; import { FontAtlas } from '../assets/bitmap-font'; import { CanvasPool, ISharedLabelData, LetterRenderTexture } from '../assembler/label/font-utils'; diff --git a/cocos/2d/components/mask.ts b/cocos/2d/components/mask.ts index 4a876f5ebd9..2f657478d15 100644 --- a/cocos/2d/components/mask.ts +++ b/cocos/2d/components/mask.ts @@ -27,7 +27,8 @@ import { ccclass, help, executionOrder, menu, tooltip, displayOrder, type, visib import { JSB } from 'internal:constants'; import { warnID, error } from '@base/debug'; import { cclegacy } from '@base/global'; -import { clamp, Color, Mat4, Vec2, Vec3, ccenum } from '../../core'; +import { ccenum } from '@base/object'; +import { clamp, Color, Mat4, Vec2, Vec3 } from '../../core'; import { Graphics } from './graphics'; import { TransformBit } from '../../scene-graph/node-enum'; import { Stage } from '../renderer/stencil-manager'; diff --git a/cocos/2d/components/rich-text.ts b/cocos/2d/components/rich-text.ts index ff57cc7cdb4..1b63e697567 100644 --- a/cocos/2d/components/rich-text.ts +++ b/cocos/2d/components/rich-text.ts @@ -28,9 +28,10 @@ import { DEBUG, DEV, EDITOR } from 'internal:constants'; import { assert, warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { js } from '@base/utils'; +import { CCObject } from '@base/object'; import { Font, SpriteAtlas, TTFFont, SpriteFrame } from '../assets'; import { EventTouch } from '../../input/types'; -import { Color, Vec2, CCObject, Size } from '../../core'; +import { Color, Vec2, Size } from '../../core'; import { BASELINE_RATIO, fragmentText, isUnicodeCJK, isUnicodeSpace, getEnglishWordPartAtFirst, getEnglishWordPartAtLast } from '../utils/text-utils'; import { HtmlTextParser, IHtmlTextParserResultObj, IHtmlTextParserStack } from '../utils/html-text-parser'; import { Node } from '../../scene-graph'; diff --git a/cocos/2d/components/sprite.ts b/cocos/2d/components/sprite.ts index ab903c9a122..7b7439e917a 100644 --- a/cocos/2d/components/sprite.ts +++ b/cocos/2d/components/sprite.ts @@ -27,9 +27,10 @@ import { ccclass, help, executionOrder, menu, tooltip, displayOrder, type, range import { BUILD, EDITOR } from 'internal:constants'; import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { SpriteAtlas } from '../assets/sprite-atlas'; import { SpriteFrame } from '../assets/sprite-frame'; -import { Vec2, ccenum, clamp } from '../../core'; +import { Vec2, clamp } from '../../core'; import { IBatcher } from '../renderer/i-batcher'; import { UIRenderer, InstanceMaterialType } from '../framework/ui-renderer'; import { PixelFormat } from '../../asset/assets/asset-enum'; diff --git a/cocos/2d/framework/canvas.ts b/cocos/2d/framework/canvas.ts index 60da885c3df..ae0e27a86c0 100644 --- a/cocos/2d/framework/canvas.ts +++ b/cocos/2d/framework/canvas.ts @@ -26,9 +26,10 @@ import { ccclass, help, disallowMultiple, executeInEditMode, executionOrder, menu, tooltip, type, serializable } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; import { Camera } from '../../misc/camera-component'; import { Widget } from '../../ui/widget'; -import { Vec3, screen, Enum, visibleRect } from '../../core'; +import { Vec3, screen, visibleRect } from '../../core'; import { view } from '../../ui/view'; import { RenderRoot2D } from './render-root-2d'; import { NodeEventType } from '../../scene-graph/node-event'; diff --git a/cocos/2d/framework/ui-renderer.ts b/cocos/2d/framework/ui-renderer.ts index 061f9b25596..d30ad194912 100644 --- a/cocos/2d/framework/ui-renderer.ts +++ b/cocos/2d/framework/ui-renderer.ts @@ -26,7 +26,8 @@ import { DEBUG, EDITOR, JSB } from 'internal:constants'; import { ccclass, executeInEditMode, requireComponent, tooltip, type, displayOrder, serializable, override, visible, displayName, disallowAnimation } from 'cc.decorator'; import { assert } from '@base/debug'; import { cclegacy } from '@base/global'; -import { Color, ccenum } from '../../core'; +import { ccenum } from '@base/object'; +import { Color } from '../../core'; import { builtinResMgr } from '../../asset/asset-manager'; import { Material } from '../../asset/assets'; import { BlendFactor, BlendOp, ColorMask } from '../../gfx'; diff --git a/cocos/3d/assets/skeleton.jsb.ts b/cocos/3d/assets/skeleton.jsb.ts index bfdf1f68054..fa6bc60642d 100644 --- a/cocos/3d/assets/skeleton.jsb.ts +++ b/cocos/3d/assets/skeleton.jsb.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { CCString, Mat4 } from '../../core'; +import { CCString } from '@base/object'; +import { Mat4 } from '../../core'; import { cclegacy } from '@base/global'; import { DataPoolManager } from '../skeletal-animation/data-pool-manager'; import { Asset } from '../../asset/assets/asset'; diff --git a/cocos/3d/assets/skeleton.ts b/cocos/3d/assets/skeleton.ts index ac87b158026..3782d5a0b60 100644 --- a/cocos/3d/assets/skeleton.ts +++ b/cocos/3d/assets/skeleton.ts @@ -24,7 +24,8 @@ import { ccclass, type, serializable } from 'cc.decorator'; import { cclegacy } from '@base/global'; -import { CCString, Mat4, murmurhash2_32_gc } from '../../core'; +import { CCString } from '@base/object'; +import { Mat4, murmurhash2_32_gc } from '../../core'; import type { DataPoolManager } from '../skeletal-animation/data-pool-manager'; import { Asset } from '../../asset/assets/asset'; diff --git a/cocos/3d/framework/mesh-renderer.ts b/cocos/3d/framework/mesh-renderer.ts index ff28d56222d..4fd89864ad1 100644 --- a/cocos/3d/framework/mesh-renderer.ts +++ b/cocos/3d/framework/mesh-renderer.ts @@ -27,10 +27,11 @@ import { displayOrder, group, range } from 'cc.decorator'; import { warnID } from '@base/debug'; import { assertIsTrue } from '@base/debug/internal'; import { cclegacy } from '@base/global'; +import { Enum, CCBoolean, CCFloat, CCInteger } from '@base/object'; import { Texture2D, TextureCube } from '../../asset/assets'; import { Material } from '../../asset/assets/material'; import { Mesh } from '../assets/mesh'; -import { Vec4, Enum, CCBoolean, CCFloat, _decorator, CCInteger, EventTarget } from '../../core'; +import { Vec4, _decorator, EventTarget } from '../../core'; import { scene } from '../../render-scene'; import { MorphModel } from '../models/morph-model'; import { Root } from '../../root'; diff --git a/cocos/3d/lights/directional-light-component.ts b/cocos/3d/lights/directional-light-component.ts index c63468f60a0..13630da7a9b 100644 --- a/cocos/3d/lights/directional-light-component.ts +++ b/cocos/3d/lights/directional-light-component.ts @@ -25,9 +25,10 @@ import { cclegacy } from '@base/global'; import { warnID } from '@base/debug'; +import { CCBoolean, CCFloat, CCInteger } from '@base/object'; import { Light } from './light-component'; import { scene } from '../../render-scene'; -import { clamp, CCBoolean, CCFloat, _decorator, settings, Settings, CCInteger } from '../../core'; +import { clamp, _decorator, settings, Settings } from '../../core'; import { Camera, PCFType, Shadows, ShadowType, CSMOptimizationMode, CSMLevel } from '../../render-scene/scene'; import { Root } from '../../root'; import { MeshRenderer } from '../framework/mesh-renderer'; diff --git a/cocos/3d/lights/light-component.ts b/cocos/3d/lights/light-component.ts index 75b4776ff2d..0a939e53b50 100644 --- a/cocos/3d/lights/light-component.ts +++ b/cocos/3d/lights/light-component.ts @@ -25,8 +25,9 @@ import { ccclass, tooltip, range, slide, type, displayOrder, serializable, editable } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; import { Component } from '../../scene-graph/component'; -import { Color, Vec3, Enum } from '../../core'; +import { Color, Vec3 } from '../../core'; import { scene } from '../../render-scene'; import { Root } from '../../root'; import { CAMERA_DEFAULT_MASK } from '../../rendering/define'; diff --git a/cocos/3d/lights/point-light-component.ts b/cocos/3d/lights/point-light-component.ts index c90f9c58b04..a42438022a5 100644 --- a/cocos/3d/lights/point-light-component.ts +++ b/cocos/3d/lights/point-light-component.ts @@ -24,10 +24,10 @@ import { ccclass, help, executeInEditMode, menu, tooltip, type, displayOrder, serializable, formerlySerializedAs, editable, rangeMin, range } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { CCFloat, CCInteger } from '@base/object'; import { scene } from '../../render-scene'; import { Camera, LightType } from '../../render-scene/scene'; import { Light, PhotometricTerm } from './light-component'; -import { CCFloat, CCInteger } from '../../core'; /** * @en The point light component, multiple point lights can be added to one scene. diff --git a/cocos/3d/lights/ranged-directional-light-component.ts b/cocos/3d/lights/ranged-directional-light-component.ts index e7e5847a355..0a87ec8ca9c 100644 --- a/cocos/3d/lights/ranged-directional-light-component.ts +++ b/cocos/3d/lights/ranged-directional-light-component.ts @@ -19,11 +19,11 @@ */ import { cclegacy } from '@base/global'; +import { CCInteger } from '@base/object'; import { Light } from './light-component'; import { ccclass, help, property, menu, executeInEditMode, formerlySerializedAs, serializable, tooltip, editable, type } from '../../core/data/class-decorator'; import { Camera, LightType } from '../../render-scene/scene'; import { scene } from '../../render-scene'; -import { CCInteger } from '../../core'; import { range } from '../../core/data/decorators'; /** diff --git a/cocos/3d/lights/sphere-light-component.ts b/cocos/3d/lights/sphere-light-component.ts index b8cd7afef09..ba94bf28366 100644 --- a/cocos/3d/lights/sphere-light-component.ts +++ b/cocos/3d/lights/sphere-light-component.ts @@ -25,9 +25,9 @@ import { ccclass, help, executeInEditMode, menu, tooltip, type, displayOrder, serializable, formerlySerializedAs, editable, slide, rangeMin, range } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { CCFloat, CCInteger } from '@base/object'; import { scene } from '../../render-scene'; import { Light, PhotometricTerm } from './light-component'; -import { CCFloat, CCInteger } from '../../core'; import { Camera } from '../../render-scene/scene'; import { Root } from '../../root'; diff --git a/cocos/3d/lights/spot-light-component.ts b/cocos/3d/lights/spot-light-component.ts index c212c513996..fa52a05234f 100644 --- a/cocos/3d/lights/spot-light-component.ts +++ b/cocos/3d/lights/spot-light-component.ts @@ -23,7 +23,8 @@ THE SOFTWARE. */ import { cclegacy } from '@base/global'; -import { toRadian, CCBoolean, CCFloat, _decorator } from '../../core'; +import { CCBoolean, CCFloat } from '@base/object'; +import { toRadian, _decorator } from '../../core'; import { scene } from '../../render-scene'; import { Light, PhotometricTerm } from './light-component'; import { Root } from '../../root'; diff --git a/cocos/3d/lod/lodgroup-component.ts b/cocos/3d/lod/lodgroup-component.ts index 8d4237307f4..4084a2d72f5 100644 --- a/cocos/3d/lod/lodgroup-component.ts +++ b/cocos/3d/lod/lodgroup-component.ts @@ -24,7 +24,8 @@ import { EDITOR, JSB } from 'internal:constants'; import { ccclass, editable, executeInEditMode, menu, serializable, type } from 'cc.decorator'; import { error, warn } from '@base/debug'; -import { Vec3, Mat4, geometry, CCInteger, CCFloat } from '../../core'; +import { CCInteger, CCFloat } from '@base/object'; +import { Vec3, Mat4, geometry } from '../../core'; import { Node } from '../../scene-graph/node'; import { Component } from '../../scene-graph/component'; import { MeshRenderer } from '../framework/mesh-renderer'; diff --git a/cocos/3d/reflection-probe/reflection-probe-component.ts b/cocos/3d/reflection-probe/reflection-probe-component.ts index ee28f0a40b3..24f5aa95488 100644 --- a/cocos/3d/reflection-probe/reflection-probe-component.ts +++ b/cocos/3d/reflection-probe/reflection-probe-component.ts @@ -24,7 +24,8 @@ import { ccclass, executeInEditMode, help, menu, playOnFocus, serializable, tooltip, type, visible } from 'cc.decorator'; import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { warn } from '@base/debug'; -import { CCBoolean, CCObject, Color, Enum, Vec3 } from '../../core'; +import { CCBoolean, CCObject, Enum } from '@base/object'; +import { Color, Vec3 } from '../../core'; import { TextureCube } from '../../asset/assets'; import { scene } from '../../render-scene'; diff --git a/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts b/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts index d39d58d726a..b362dbe5fb4 100644 --- a/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts +++ b/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts @@ -27,13 +27,14 @@ import { ccclass, help, executeInEditMode, executionOrder, menu, tooltip, type, import { ImageData } from 'pal/image'; import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; +import { CCString } from '@base/object'; import { getWorldTransformUntilRoot } from '../../animation/transform-utils'; import { Filter, PixelFormat } from '../../asset/assets/asset-enum'; import { Material } from '../../asset/assets/material'; import { Mesh } from '../assets/mesh'; import { Skeleton } from '../assets/skeleton'; import { Texture2D } from '../../asset/assets/texture-2d'; -import { CCString, Mat4, Vec2, Vec3 } from '../../core'; +import { Mat4, Vec2, Vec3 } from '../../core'; import { AttributeName, FormatInfos, Format, Type, Attribute, BufferTextureCopy } from '../../gfx'; import { mapBuffer, readBuffer, writeBuffer } from '../misc/buffer'; import { SkinnedMeshRenderer } from './skinned-mesh-renderer'; diff --git a/cocos/animation/animation-curve.ts b/cocos/animation/animation-curve.ts index fc0190e528e..342517b30c2 100644 --- a/cocos/animation/animation-curve.ts +++ b/cocos/animation/animation-curve.ts @@ -24,7 +24,8 @@ import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; -import { lerp, Quat, binarySearchEpsilon, ValueType, bezierByTime, BezierControlPoints, easing } from '../core'; +import { ValueType } from '@base/object'; +import { lerp, Quat, binarySearchEpsilon, bezierByTime, BezierControlPoints, easing } from '../core'; import { ILerpable, isLerpable } from './types'; import type * as legacy from './legacy-clip-data'; diff --git a/cocos/animation/animation-state.ts b/cocos/animation/animation-state.ts index 44860642c05..e174666ab4c 100644 --- a/cocos/animation/animation-state.ts +++ b/cocos/animation/animation-state.ts @@ -26,11 +26,12 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { cclegacy } from '@base/global'; import { debug } from '@base/debug'; import { assertIsTrue } from '@base/debug/internal'; +import { ccenum } from '@base/object'; import { Node } from '../scene-graph/node'; import { AnimationClip } from './animation-clip'; import { Playable } from './playable'; import { WrapMode, WrappedInfo } from './types'; -import { geometry, ccenum } from '../core'; +import { geometry } from '../core'; import { AnimationMask } from './marionette/animation-mask'; import { PoseOutput } from './pose-output'; import { BlendStateBuffer } from '../3d/skeletal-animation/skeletal-animation-blending'; diff --git a/cocos/animation/marionette/animation-graph-editor-extras-clone-helper.ts b/cocos/animation/marionette/animation-graph-editor-extras-clone-helper.ts index c78f30e94d3..8b678dc547b 100644 --- a/cocos/animation/marionette/animation-graph-editor-extras-clone-helper.ts +++ b/cocos/animation/marionette/animation-graph-editor-extras-clone-helper.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { EditorExtendableObject, editorExtrasTag } from '../../core/data/editor-extras-tag'; +import { EditorExtendableObject, editorExtrasTag } from '@base/object'; /** * Clones the editor extras from an animation-graph-specific object. diff --git a/cocos/animation/marionette/graph-debug.ts b/cocos/animation/marionette/graph-debug.ts index 4b80a90b4c8..aeec6e01dc5 100644 --- a/cocos/animation/marionette/graph-debug.ts +++ b/cocos/animation/marionette/graph-debug.ts @@ -23,7 +23,7 @@ */ import { EDITOR } from 'internal:constants'; -import { editorExtrasTag } from '../../core'; +import { editorExtrasTag } from '@base/object'; import { Motion } from './motion'; export const RUNTIME_ID_ENABLED = EDITOR; diff --git a/cocos/animation/marionette/motion/animation-blend-2d.ts b/cocos/animation/marionette/motion/animation-blend-2d.ts index c2a303a5574..63ba5eef2ee 100644 --- a/cocos/animation/marionette/motion/animation-blend-2d.ts +++ b/cocos/animation/marionette/motion/animation-blend-2d.ts @@ -23,7 +23,8 @@ */ import { assertIsTrue } from '@base/debug/internal'; -import { Vec2, _decorator, ccenum, editable } from '../../../core'; +import { ccenum } from '@base/object'; +import { Vec2, _decorator, editable } from '../../../core'; import { createEval } from '../create-eval'; import { AnimationBlend, AnimationBlendEval, AnimationBlendItem } from './animation-blend'; import { BindableNumber, bindOr, VariableType } from '../parametric'; diff --git a/cocos/animation/marionette/motion/animation-blend.ts b/cocos/animation/marionette/motion/animation-blend.ts index cfe62a039bf..009cb4c4f90 100644 --- a/cocos/animation/marionette/motion/animation-blend.ts +++ b/cocos/animation/marionette/motion/animation-blend.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { _decorator, EditorExtendable, editorExtrasTag } from '../../../core'; +import { editorExtrasTag } from '@base/object'; +import { _decorator, EditorExtendable } from '../../../core'; import { Motion, MotionEval, MotionPort } from './motion'; import { createEval } from '../create-eval'; import { VariableTypeMismatchedError } from '../errors'; diff --git a/cocos/animation/marionette/motion/clip-motion.ts b/cocos/animation/marionette/motion/clip-motion.ts index 8cfce0db347..e7ded4b3f0d 100644 --- a/cocos/animation/marionette/motion/clip-motion.ts +++ b/cocos/animation/marionette/motion/clip-motion.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { editorExtrasTag, _decorator, EditorExtendable, editable, serializable } from '../../../core'; +import { editorExtrasTag } from '@base/object'; +import { _decorator, EditorExtendable, editable, serializable } from '../../../core'; import { additiveSettingsTag, AnimationClip } from '../../animation-clip'; import { cloneAnimationGraphEditorExtrasFrom } from '../animation-graph-editor-extras-clone-helper'; import { createEval } from '../create-eval'; diff --git a/cocos/animation/marionette/pose-graph/decorator/input.ts b/cocos/animation/marionette/pose-graph/decorator/input.ts index 273e5cdacc9..06607829873 100644 --- a/cocos/animation/marionette/pose-graph/decorator/input.ts +++ b/cocos/animation/marionette/pose-graph/decorator/input.ts @@ -2,7 +2,7 @@ import { error } from '@base/debug'; import { js } from '@base/utils'; -import { PropertyStashInternalFlag } from '../../../../core/data/class-stash'; +import { PropertyStashInternalFlag } from '@base/object'; import { getOrCreatePropertyStash } from '../../../../core/data/decorators/property'; import { PoseGraphNodeInputMappingOptions, globalPoseGraphNodeInputManager } from '../foundation/authoring/input-authoring'; import { PoseGraphType } from '../foundation/type-system'; diff --git a/cocos/animation/marionette/pose-graph/pose-node.ts b/cocos/animation/marionette/pose-graph/pose-node.ts index 6aa1b0adfd2..ac2ec729a93 100644 --- a/cocos/animation/marionette/pose-graph/pose-node.ts +++ b/cocos/animation/marionette/pose-graph/pose-node.ts @@ -1,6 +1,6 @@ import { TEST } from 'internal:constants'; import { assertIsTrue } from '@base/debug/internal'; -import { ccenum } from '../../../core'; +import { ccenum } from '@base/object'; import { ccclass } from '../../../core/data/decorators'; import { Pose, PoseTransformSpace } from '../../core/pose'; import { CLASS_NAME_PREFIX_ANIM } from '../../define'; diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts b/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts index e4f44974aa8..319c96eddd4 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts @@ -1,11 +1,12 @@ import { EDITOR } from 'internal:constants'; import { error } from '@base/debug'; +import { ccenum } from '@base/object'; import { ccclass, editable, range, serializable, type, visible } from '../../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { PoseNode, PoseTransformSpaceRequirement } from '../pose-node'; import { AnimationGraphBindingContext, AnimationGraphEvaluationContext } from '../../animation-graph-context'; import { input } from '../decorator/input'; -import { approx, ccenum, Quat, Vec3 } from '../../../../core'; +import { approx, Quat, Vec3 } from '../../../../core'; import { TransformHandle } from '../../../core/animation-handle'; import { poseGraphNodeAppearance, poseGraphNodeCategory } from '../decorator/node'; import { POSE_GRAPH_NODE_MENU_PREFIX_POSE } from './menu-common'; diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/copy-transform.ts b/cocos/animation/marionette/pose-graph/pose-nodes/copy-transform.ts index 08d6da946e2..071dcd293a2 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/copy-transform.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/copy-transform.ts @@ -1,8 +1,8 @@ import { EDITOR } from 'internal:constants'; +import { ccenum } from '@base/object'; import { ccclass, editable, serializable, type } from '../../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { PoseTransformSpaceRequirement } from '../pose-node'; -import { ccenum } from '../../../../core'; import { TransformHandle } from '../../../core/animation-handle'; import { poseGraphNodeAppearance, poseGraphNodeCategory } from '../decorator/node'; import { POSE_GRAPH_NODE_MENU_PREFIX_POSE } from './menu-common'; diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts b/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts index 32d97cd404a..3a4dd5c2024 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/ik/two-bone-ik-solver.ts @@ -1,9 +1,10 @@ import { EDITOR } from 'internal:constants'; import { assertIsTrue } from '@base/debug/internal'; +import { ccenum } from '@base/object'; import { ccclass, editable, serializable, type, visible } from '../../../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../../../define'; import { PoseTransformSpaceRequirement } from '../../pose-node'; -import { ccenum, Vec3 } from '../../../../../core'; +import { Vec3 } from '../../../../../core'; import { TransformHandle } from '../../../../core/animation-handle'; import { input } from '../../decorator/input'; import { poseGraphNodeCategory } from '../../decorator/node'; diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts b/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts index 85922a169b4..63cb39128b5 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/intensity-specification.ts @@ -1,4 +1,4 @@ -import { ccenum } from '../../../../core'; +import { ccenum } from '@base/object'; import { ccclass, editable, range, serializable, type, visible } from '../../../../core/data/decorators'; import { AuxiliaryCurveHandle } from '../../../core/animation-handle'; import { Pose } from '../../../core/pose'; diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/set-auxiliary-curve.ts b/cocos/animation/marionette/pose-graph/pose-nodes/set-auxiliary-curve.ts index d25822d5b0e..1277532d892 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/set-auxiliary-curve.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/set-auxiliary-curve.ts @@ -1,7 +1,7 @@ import { EDITOR } from 'internal:constants'; +import { ccenum } from '@base/object'; import { ccclass, editable, serializable, type } from '../../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; -import { ccenum } from '../../../../core'; import { AuxiliaryCurveHandle } from '../../../core/animation-handle'; import { input } from '../decorator/input'; import { poseGraphNodeCategory } from '../decorator/node'; diff --git a/cocos/animation/marionette/pose-graph/pose-nodes/transform-space.ts b/cocos/animation/marionette/pose-graph/pose-nodes/transform-space.ts index 08315bfe8ea..248d33a2db9 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/transform-space.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/transform-space.ts @@ -1,4 +1,4 @@ -import { ccenum } from '../../../../core'; +import { ccenum } from '@base/object'; /** * @zh diff --git a/cocos/animation/marionette/state-machine/state.ts b/cocos/animation/marionette/state-machine/state.ts index 002eecd066d..f6bdd904516 100644 --- a/cocos/animation/marionette/state-machine/state.ts +++ b/cocos/animation/marionette/state-machine/state.ts @@ -23,9 +23,10 @@ */ import { js } from '@base/utils'; +import { editorExtrasTag } from '@base/object'; import { OwnedBy, ownerSymbol } from '../ownership'; import type { Layer, StateMachine, TransitionInternal } from '../animation-graph'; -import { EditorExtendable, editorExtrasTag, _decorator } from '../../../core'; +import { EditorExtendable, _decorator } from '../../../core'; import { CLASS_NAME_PREFIX_ANIM } from '../../define'; import { StateMachineComponent } from './state-machine-component'; import { instantiate } from '../../../serialization/instantiate'; diff --git a/cocos/animation/types.ts b/cocos/animation/types.ts index 2ec8815bc27..ab31aa8f56d 100644 --- a/cocos/animation/types.ts +++ b/cocos/animation/types.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { ccenum, geometry } from '../core'; +import { ccenum } from '@base/object'; +import { geometry } from '../core'; /** * 动画使用的循环模式。 diff --git a/cocos/asset/asset-manager/asset-manager.ts b/cocos/asset/asset-manager/asset-manager.ts index e4cc53d4329..455dac54668 100644 --- a/cocos/asset/asset-manager/asset-manager.ts +++ b/cocos/asset/asset-manager/asset-manager.ts @@ -29,20 +29,16 @@ import { cclegacy } from '@base/global'; import { Asset } from '../assets/asset'; import { sys, Settings, settings, path, EventTarget } from '../../core'; import Bundle from './bundle'; -import Cache from './cache'; -import { ICache } from './cache'; +import Cache, { ICache } from './cache'; import CacheManager from './cache-manager'; -import dependUtil from './depend-util'; -import { DependUtil } from './depend-util'; -import downloader from './downloader'; -import { Downloader } from './downloader'; +import dependUtil, { DependUtil } from './depend-util'; +import downloader, { Downloader } from './downloader'; import factory from './factory'; import fetch from './fetch'; import * as helper from './helper'; import load from './load'; import packManager from './pack-manager'; -import parser from './parser'; -import { Parser } from './parser'; +import parser, { Parser } from './parser'; import { Pipeline } from './pipeline'; import preprocess from './preprocess'; import { releaseManager } from './release-manager'; diff --git a/cocos/asset/asset-manager/bundle.ts b/cocos/asset/asset-manager/bundle.ts index 187501c6889..f93cc3be002 100644 --- a/cocos/asset/asset-manager/bundle.ts +++ b/cocos/asset/asset-manager/bundle.ts @@ -27,8 +27,7 @@ import { error, errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { Asset } from '../assets/asset'; import { SceneAsset } from '../assets/scene-asset'; -import Config from './config'; -import { IAddressableInfo, IAssetInfo, IConfigOption, ISceneInfo } from './config'; +import Config, { IAddressableInfo, IAssetInfo, IConfigOption, ISceneInfo } from './config'; import { releaseManager } from './release-manager'; import RequestItem from './request-item'; import { assets, bundles, RequestType } from './shared'; diff --git a/cocos/asset/asset-manager/deprecated.ts b/cocos/asset/asset-manager/deprecated.ts index 3029455c8a0..22a1f6ef147 100644 --- a/cocos/asset/asset-manager/deprecated.ts +++ b/cocos/asset/asset-manager/deprecated.ts @@ -29,15 +29,12 @@ import { removeProperty, replaceProperty } from '@base/utils'; import { Asset } from '../assets/asset'; import { macro, path } from '../../core'; import Cache from './cache'; -import assetManager from './asset-manager'; -import { AssetManager } from './asset-manager'; +import assetManager, { AssetManager } from './asset-manager'; import { resources } from './bundle'; import dependUtil from './depend-util'; -import downloader from './downloader'; -import { Downloader } from './downloader'; +import downloader, { Downloader } from './downloader'; import { getUuidFromURL, transform } from './helper'; -import parser from './parser'; -import { Parser } from './parser'; +import parser, { Parser } from './parser'; import { releaseManager } from './release-manager'; import { assets, BuiltinBundleName, bundles } from './shared'; import { parseLoadResArgs, setDefaultProgressCallback } from './utilities'; diff --git a/cocos/asset/asset-manager/factory.ts b/cocos/asset/asset-manager/factory.ts index 7848b9b6f76..6a26db3eec9 100644 --- a/cocos/asset/asset-manager/factory.ts +++ b/cocos/asset/asset-manager/factory.ts @@ -30,8 +30,7 @@ import JsonAsset from '../assets/json-asset'; import { TextAsset } from '../assets/text-asset'; import { Asset } from '../assets/asset'; import { BufferAsset } from '../assets/buffer-asset'; -import Bundle from './bundle'; -import { resources } from './bundle'; +import Bundle, { resources } from './bundle'; import Cache from './cache'; import { IConfigOption } from './config'; import { assets, BuiltinBundleName, bundles } from './shared'; diff --git a/cocos/asset/asset-manager/release-manager.ts b/cocos/asset/asset-manager/release-manager.ts index d1f5cd42397..f783b8f3b91 100644 --- a/cocos/asset/asset-manager/release-manager.ts +++ b/cocos/asset/asset-manager/release-manager.ts @@ -24,9 +24,10 @@ import { EDITOR, TEST } from 'internal:constants'; import { js } from '@base/utils'; +import { isValid } from '@base/object'; import { callInNextTick } from '../../core/utils/internal'; import { Asset } from '../assets/asset'; -import { isValid, misc } from '../../core'; +import { misc } from '../../core'; import { Node, Scene } from '../../scene-graph'; import Cache from './cache'; import dependUtil from './depend-util'; diff --git a/cocos/asset/asset-manager/url-transformer.ts b/cocos/asset/asset-manager/url-transformer.ts index 086b4c1248a..c1101d6ee1d 100644 --- a/cocos/asset/asset-manager/url-transformer.ts +++ b/cocos/asset/asset-manager/url-transformer.ts @@ -27,8 +27,7 @@ import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { js } from '@base/utils'; import { path } from '../../core'; -import Config from './config'; -import { IAddressableInfo, IAssetInfo } from './config'; +import Config, { IAddressableInfo, IAssetInfo } from './config'; import { decodeUuid } from './helper'; import RequestItem from './request-item'; import { assetsOverrideMap, bundles, presets, RequestType } from './shared'; diff --git a/cocos/asset/assets/asset.ts b/cocos/asset/assets/asset.ts index 679e7d8ff17..591fcc7e224 100644 --- a/cocos/asset/assets/asset.ts +++ b/cocos/asset/assets/asset.ts @@ -26,7 +26,8 @@ import { EDITOR, PREVIEW } from 'internal:constants'; import { debug, getError } from '@base/debug'; import { cclegacy } from '@base/global'; -import { _decorator, Eventify, path, CCObject } from '../../core'; +import { CCObject } from '@base/object'; +import { _decorator, Eventify, path } from '../../core'; import { getUrlWithUuid } from '../asset-manager/helper'; import { Node } from '../../scene-graph'; diff --git a/cocos/asset/assets/image-asset.ts b/cocos/asset/assets/image-asset.ts index 035aa8693ea..47609a066d3 100644 --- a/cocos/asset/assets/image-asset.ts +++ b/cocos/asset/assets/image-asset.ts @@ -28,12 +28,12 @@ import { EDITOR, ALIPAY, XIAOMI, JSB, TEST, BAIDU, TAOBAO, TAOBAO_MINIGAME, WECH import { ImageData } from 'pal/image'; import { warnID, warn } from '@base/debug'; import { cclegacy, ccwindow } from '@base/global'; +import { Enum } from '@base/object'; import { ImageSource, IMemoryImageSource, RawDataType } from '../../../pal/image/types'; import { Device, Format, FormatFeatureBit, deviceManager, API } from '../../gfx'; import { Asset } from './asset'; import { PixelFormat } from './asset-enum'; import { macro, sys } from '../../core'; -import { Enum } from '../../core/value-types/enum'; // Compress mipmap constants const COMPRESSED_HEADER_LENGTH = 4; diff --git a/cocos/asset/assets/texture-base.ts b/cocos/asset/assets/texture-base.ts index d618c91ea4e..d54ddf1d08e 100644 --- a/cocos/asset/assets/texture-base.ts +++ b/cocos/asset/assets/texture-base.ts @@ -28,10 +28,11 @@ import { ccclass, serializable } from 'cc.decorator'; import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { js } from '@base/utils'; +import { ccenum } from '@base/object'; import { Asset } from './asset'; import { Filter, PixelFormat, WrapMode } from './asset-enum'; import { Sampler, Texture, Device, Format, SamplerInfo, Address, Filter as GFXFilter, deviceManager } from '../../gfx'; -import { murmurhash2_32_gc, ccenum } from '../../core'; +import { murmurhash2_32_gc } from '../../core'; ccenum(Format); diff --git a/cocos/base/object/package.json b/cocos/base/object/package.json new file mode 100644 index 00000000000..666b04cb1e7 --- /dev/null +++ b/cocos/base/object/package.json @@ -0,0 +1,17 @@ +{ + "$schema": "../../../schemas/module-config.schema.json", + "name": "@base/object", + "version": "1.0.0", + "description": "", + "scripts": { + }, + "license": "MIT", + "exports": { + ".": { + "types": "./src/index.ts" + }, + "./internal": { + "types": "./src/internal-index.ts" + } + } +} diff --git a/cocos/core/data/class-stash.ts b/cocos/base/object/src/class-stash.ts similarity index 100% rename from cocos/core/data/class-stash.ts rename to cocos/base/object/src/class-stash.ts diff --git a/cocos/core/data/class.ts b/cocos/base/object/src/class.ts similarity index 99% rename from cocos/core/data/class.ts rename to cocos/base/object/src/class.ts index c78f0282ff7..d36a34ff442 100644 --- a/cocos/core/data/class.ts +++ b/cocos/base/object/src/class.ts @@ -27,8 +27,7 @@ import { DEV, EDITOR, SUPPORT_JIT, TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; import { errorID, warnID, error, _throw, StringSubstitution, getError } from '@base/debug'; import { js } from '@base/utils'; -import { BitMask } from '../value-types'; -import { Enum, EnumType } from '../value-types/enum'; +import { BitMask, Enum, EnumType } from './value-types'; import * as attributeUtils from './utils/attribute'; import { IAcceptableAttributes } from './utils/attribute-defines'; import { preprocessAttrs } from './utils/preprocess-class'; diff --git a/cocos/core/data/editor-extras-tag.ts b/cocos/base/object/src/editor-extras-tag.ts similarity index 100% rename from cocos/core/data/editor-extras-tag.ts rename to cocos/base/object/src/editor-extras-tag.ts diff --git a/cocos/base/object/src/index.ts b/cocos/base/object/src/index.ts new file mode 100644 index 00000000000..58388f8b733 --- /dev/null +++ b/cocos/base/object/src/index.ts @@ -0,0 +1,37 @@ +/* + Copyright (c) 2022-2023 Xiamen Yaji Software Co., Ltd. + + https://www.cocos.com/ + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +import * as RF from './utils/requiring-frame'; + +export { CCObject } from './object'; +export { type EditorExtendableObject, editorExtrasTag } from './editor-extras-tag'; +export { CCClass, isCCClassOrFastDefined } from './class'; +export { BitMask, Enum, ccenum, ValueType } from './value-types'; +export { DELIMETER, createAttrsSingle, createAttrs, attr, getClassAttrs, setClassAttr, PrimitiveType, CCInteger, CCFloat, CCBoolean, CCString } from './utils/attribute'; +export type { IExposedAttributes, IAcceptableAttributes } from './utils/attribute-defines'; +export { getFullFormOfProperty, doValidateMethodWithProps_DEV } from './utils/preprocess-class'; +export { RF }; +export { PropertyStashInternalFlag, type ClassStash, type PropertyStash } from './class-stash'; +export { setPropertyEnumType, setPropertyEnumTypeOnAttrs } from './utils/attribute-internal'; +export { isCCObject, isValid } from './object'; diff --git a/cocos/base/object/src/internal-index.ts b/cocos/base/object/src/internal-index.ts new file mode 100644 index 00000000000..945d7426403 --- /dev/null +++ b/cocos/base/object/src/internal-index.ts @@ -0,0 +1,26 @@ +/* + Copyright (c) 2022-2023 Xiamen Yaji Software Co., Ltd. + + https://www.cocos.com/ + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +export { ENUM_TAG, BITMASK_TAG } from './class'; +export { type EnumType } from './value-types'; diff --git a/cocos/core/data/object.ts b/cocos/base/object/src/object.ts similarity index 100% rename from cocos/core/data/object.ts rename to cocos/base/object/src/object.ts diff --git a/cocos/core/data/utils/attribute-defines.ts b/cocos/base/object/src/utils/attribute-defines.ts similarity index 100% rename from cocos/core/data/utils/attribute-defines.ts rename to cocos/base/object/src/utils/attribute-defines.ts diff --git a/cocos/core/data/utils/attribute-internal.ts b/cocos/base/object/src/utils/attribute-internal.ts similarity index 96% rename from cocos/core/data/utils/attribute-internal.ts rename to cocos/base/object/src/utils/attribute-internal.ts index dda597a15de..f8668458a5e 100644 --- a/cocos/core/data/utils/attribute-internal.ts +++ b/cocos/base/object/src/utils/attribute-internal.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { Enum, EnumType } from '../../value-types/enum'; +import { Enum, EnumType } from '../value-types'; import { getClassAttrs, DELIMETER } from './attribute'; // eslint-disable-next-line @typescript-eslint/ban-types diff --git a/cocos/core/data/utils/attribute.ts b/cocos/base/object/src/utils/attribute.ts similarity index 100% rename from cocos/core/data/utils/attribute.ts rename to cocos/base/object/src/utils/attribute.ts diff --git a/cocos/core/data/utils/preprocess-class.ts b/cocos/base/object/src/utils/preprocess-class.ts similarity index 100% rename from cocos/core/data/utils/preprocess-class.ts rename to cocos/base/object/src/utils/preprocess-class.ts diff --git a/cocos/core/data/utils/requiring-frame.ts b/cocos/base/object/src/utils/requiring-frame.ts similarity index 100% rename from cocos/core/data/utils/requiring-frame.ts rename to cocos/base/object/src/utils/requiring-frame.ts diff --git a/cocos/core/value-types/bitmask.ts b/cocos/base/object/src/value-types/bitmask.ts similarity index 100% rename from cocos/core/value-types/bitmask.ts rename to cocos/base/object/src/value-types/bitmask.ts diff --git a/cocos/core/value-types/enum.ts b/cocos/base/object/src/value-types/enum.ts similarity index 100% rename from cocos/core/value-types/enum.ts rename to cocos/base/object/src/value-types/enum.ts diff --git a/cocos/core/value-types/index.ts b/cocos/base/object/src/value-types/index.ts similarity index 95% rename from cocos/core/value-types/index.ts rename to cocos/base/object/src/value-types/index.ts index da711f4d2cb..a045e2a33b9 100644 --- a/cocos/core/value-types/index.ts +++ b/cocos/base/object/src/value-types/index.ts @@ -1,9 +1,9 @@ -/* - Copyright (c) 2013-2016 Chukong Technologies Inc. - Copyright (c) 2017-2023 Xiamen Yaji Software Co., Ltd. - - https://www.cocos.com/ - +/* + Copyright (c) 2013-2016 Chukong Technologies Inc. + Copyright (c) 2017-2023 Xiamen Yaji Software Co., Ltd. + + https://www.cocos.com/ + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to @@ -21,8 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -export { BitMask } from './bitmask'; -export { Enum, ccenum } from './enum'; -export { ValueType } from './value-type'; +*/ + +export { BitMask } from './bitmask'; +export { Enum, ccenum, type EnumType } from './enum'; +export { ValueType } from './value-type'; diff --git a/cocos/core/value-types/value-type.ts b/cocos/base/object/src/value-types/value-type.ts similarity index 100% rename from cocos/core/value-types/value-type.ts rename to cocos/base/object/src/value-types/value-type.ts diff --git a/cocos/base/object/tsconfig.json b/cocos/base/object/tsconfig.json new file mode 100644 index 00000000000..67f2e830c07 --- /dev/null +++ b/cocos/base/object/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib/", + "rootDir": "./src/", + "baseUrl": "./" + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/cocos/core/curves/curve.ts b/cocos/core/curves/curve.ts index d5709a9c736..d41c58f9572 100644 --- a/cocos/core/curves/curve.ts +++ b/cocos/core/curves/curve.ts @@ -24,13 +24,14 @@ import { DEBUG } from 'internal:constants'; import { assertIsTrue } from '@base/debug/internal'; +import { CCClass, editorExtrasTag } from '@base/object'; import { approx, lerp, pingPong, repeat } from '../math'; import { KeyframeCurve } from './keyframe-curve'; import { RealInterpolationMode, ExtrapolationMode, TangentWeightMode } from './real-curve-param'; import { binarySearchEpsilon } from '../algorithm/binary-search'; import { solveCubic } from './solve-cubic'; import { EditorExtendable } from '../data/editor-extendable'; -import { CCClass, deserializeTag, editorExtrasTag, SerializationContext, SerializationInput, SerializationOutput, serializeTag } from '../data'; +import { deserializeTag, SerializationContext, SerializationInput, SerializationOutput, serializeTag } from '../data'; import { DeserializationContext } from '../data/custom-serializable'; import { EasingMethod, getEasingFn } from './easing-method'; import { getOrCreateSerializationMetadata } from '../data/serialization-metadata'; diff --git a/cocos/core/curves/gradient.ts b/cocos/core/curves/gradient.ts index d451cf23ef4..48455c84a6c 100644 --- a/cocos/core/curves/gradient.ts +++ b/cocos/core/curves/gradient.ts @@ -22,8 +22,7 @@ THE SOFTWARE. */ -import { CCClass } from '../data'; -import { Enum } from '../value-types'; +import { CCClass, Enum } from '@base/object'; import { Color, lerp, repeat, EPSILON, approx, random } from '../math'; const Mode = Enum({ diff --git a/cocos/core/curves/keyframe-curve.ts b/cocos/core/curves/keyframe-curve.ts index a4f67361137..b6834249535 100644 --- a/cocos/core/curves/keyframe-curve.ts +++ b/cocos/core/curves/keyframe-curve.ts @@ -23,8 +23,8 @@ */ import { assertIsTrue } from '@base/debug/internal'; +import { CCClass } from '@base/object'; import { binarySearchEpsilon } from '../algorithm/binary-search'; -import { CCClass } from '../data/class'; import { approx } from '../math'; import type { CurveBase } from './curve-base'; diff --git a/cocos/core/data/decorators/ccclass.ts b/cocos/core/data/decorators/ccclass.ts index febfac4358f..2eb58d693e9 100644 --- a/cocos/core/data/decorators/ccclass.ts +++ b/cocos/core/data/decorators/ccclass.ts @@ -24,8 +24,7 @@ import { DEV } from 'internal:constants'; import { js } from '@base/utils'; -import { CCClass } from '../class'; -import { doValidateMethodWithProps_DEV } from '../utils/preprocess-class'; +import { CCClass, doValidateMethodWithProps_DEV } from '@base/object'; import { getClassDecoratorStash, makeSmartClassDecorator, deleteClassDecoratorStash } from './utils'; const { getSuper, mixin, getClassName } = js; diff --git a/cocos/core/data/decorators/component.ts b/cocos/core/data/decorators/component.ts index 82a18a8441b..c00c5107738 100644 --- a/cocos/core/data/decorators/component.ts +++ b/cocos/core/data/decorators/component.ts @@ -23,7 +23,6 @@ */ import { DEV } from 'internal:constants'; -import { CCClass } from '../class'; import { makeEditorClassDecoratorFn, makeSmartEditorClassDecorator, emptySmartClassDecorator } from './utils'; /** @@ -43,7 +42,7 @@ import { makeEditorClassDecoratorFn, makeSmartEditorClassDecorator, emptySmartCl * } * ``` */ -export const requireComponent: (requiredComponent: Function | Function[]) => ClassDecorator = makeEditorClassDecoratorFn('requireComponent'); +export const requireComponent: (requiredComponent: AnyFunction | AnyFunction[]) => ClassDecorator = makeEditorClassDecoratorFn('requireComponent'); /** * @en Set the component priority, it decides at which order the life cycle functions of components will be invoked. Smaller priority gets invoked before larger priority. diff --git a/cocos/core/data/decorators/editable.ts b/cocos/core/data/decorators/editable.ts index bf8d59df181..e0874270a91 100644 --- a/cocos/core/data/decorators/editable.ts +++ b/cocos/core/data/decorators/editable.ts @@ -23,10 +23,8 @@ */ import { DEV } from 'internal:constants'; -import { IExposedAttributes } from '../utils/attribute-defines'; +import { IExposedAttributes, PropertyStash, PropertyStashInternalFlag } from '@base/object'; import { getOrCreatePropertyStash } from './property'; -import { PropertyStash, PropertyStashInternalFlag } from '../class-stash'; - import { LegacyPropertyDecorator, emptyDecorator, makeSmartEditorClassDecorator, makeEditorClassDecoratorFn, emptySmartClassDecorator, emptyDecoratorFn } from './utils'; /** diff --git a/cocos/core/data/decorators/property.ts b/cocos/core/data/decorators/property.ts index 17d8e647658..ad3c1eea537 100644 --- a/cocos/core/data/decorators/property.ts +++ b/cocos/core/data/decorators/property.ts @@ -25,11 +25,8 @@ import { DEV, EDITOR, JSB, TEST } from 'internal:constants'; import { warnID, errorID } from '@base/debug'; import { js } from '@base/utils'; -import { CCString, CCInteger, CCFloat, CCBoolean } from '../utils/attribute'; -import { IExposedAttributes } from '../utils/attribute-defines'; +import { CCString, CCInteger, CCBoolean, IExposedAttributes, getFullFormOfProperty, ClassStash, PropertyStash, PropertyStashInternalFlag } from '@base/object'; import { LegacyPropertyDecorator, getSubDict, BabelPropertyDecoratorDescriptor, Initializer, getOrCreateClassDecoratorStash } from './utils'; -import { getFullFormOfProperty } from '../utils/preprocess-class'; -import { ClassStash, PropertyStash, PropertyStashInternalFlag } from '../class-stash'; const { getClassName, mixin } = js; diff --git a/cocos/core/data/decorators/serializable.ts b/cocos/core/data/decorators/serializable.ts index 7cb4dd0a8ab..b30d88a7605 100644 --- a/cocos/core/data/decorators/serializable.ts +++ b/cocos/core/data/decorators/serializable.ts @@ -23,9 +23,9 @@ */ import { EDITOR, TEST } from 'internal:constants'; +import { PropertyStash, PropertyStashInternalFlag } from '@base/object'; import { emptyDecorator, LegacyPropertyDecorator } from './utils'; import { getOrCreatePropertyStash } from './property'; -import { PropertyStash, PropertyStashInternalFlag } from '../class-stash'; import { getOrCreateSerializationMetadata } from '../serialization-metadata'; /** diff --git a/cocos/core/data/decorators/type.ts b/cocos/core/data/decorators/type.ts index 867863166d0..796a1c76b28 100644 --- a/cocos/core/data/decorators/type.ts +++ b/cocos/core/data/decorators/type.ts @@ -22,9 +22,9 @@ THE SOFTWARE. */ +import { CCString, CCInteger, CCFloat, CCBoolean, PrimitiveType } from '@base/object'; import { LegacyPropertyDecorator } from './utils'; import { property } from './property'; -import { CCString, CCInteger, CCFloat, CCBoolean, PrimitiveType } from '../utils/attribute'; /** * @en Declare the property as integer diff --git a/cocos/core/data/decorators/utils.ts b/cocos/core/data/decorators/utils.ts index e2e578f9343..ef712becdc1 100644 --- a/cocos/core/data/decorators/utils.ts +++ b/cocos/core/data/decorators/utils.ts @@ -25,8 +25,8 @@ import { DEV } from 'internal:constants'; import { error } from '@base/debug'; import { js } from '@base/utils'; -import { CCClass } from '../class'; -import type { ClassStash } from '../class-stash'; +import { CCClass } from '@base/object'; +import type { ClassStash } from '@base/object'; const { getClassName } = js; diff --git a/cocos/core/data/editor-extendable.ts b/cocos/core/data/editor-extendable.ts index 4e3e5d066b9..d43bf3db6d9 100644 --- a/cocos/core/data/editor-extendable.ts +++ b/cocos/core/data/editor-extendable.ts @@ -26,7 +26,7 @@ import { EDITOR } from 'internal:constants'; import { ccclass, editorOnly } from 'cc.decorator'; import { assertIsTrue } from '@base/debug/internal'; import { js } from '@base/utils'; -import { EditorExtendableObject, editorExtrasTag } from './editor-extras-tag'; +import { EditorExtendableObject, editorExtrasTag } from '@base/object'; const { getClassName } = js; diff --git a/cocos/core/data/index.ts b/cocos/core/data/index.ts index b39e0a9491d..5b669f9a1f0 100644 --- a/cocos/core/data/index.ts +++ b/cocos/core/data/index.ts @@ -27,11 +27,7 @@ import * as _decorator from './class-decorator'; cclegacy._decorator = _decorator; export { _decorator }; -export { CCClass, isCCClassOrFastDefined } from './class'; -export { CCObject } from './object'; -export { CCInteger, CCFloat, CCBoolean, CCString } from './utils/attribute'; export { CompactValueTypeArray } from './utils/compact-value-type-array'; -export { editorExtrasTag } from './editor-extras-tag'; export { deserializeTag, serializeTag } from './custom-serializable'; export type { SerializationInput, diff --git a/cocos/core/event/callbacks-invoker.ts b/cocos/core/event/callbacks-invoker.ts index be973cade00..dd5f4ae9529 100644 --- a/cocos/core/event/callbacks-invoker.ts +++ b/cocos/core/event/callbacks-invoker.ts @@ -26,7 +26,7 @@ import { TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; import { js, memop } from '@base/utils'; -import { isCCObject, isValid } from '../data/object'; +import { isCCObject, isValid } from '@base/object'; const { Pool } = memop; const { array, createMap } = js; diff --git a/cocos/core/geometry/curve.ts b/cocos/core/geometry/curve.ts index 9580e510722..463c28e6b8d 100644 --- a/cocos/core/geometry/curve.ts +++ b/cocos/core/geometry/curve.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { CCClass } from '../data/class'; +import { CCClass } from '@base/object'; import { clamp, pingPong, repeat } from '../math/utils'; import { ExtrapolationMode, RealCurve, RealInterpolationMode } from '../curves'; diff --git a/cocos/core/index.ts b/cocos/core/index.ts index e4a59ed9016..ce275e783f4 100644 --- a/cocos/core/index.ts +++ b/cocos/core/index.ts @@ -36,7 +36,6 @@ cclegacy.geometry = geometry; export { math, memop, geometry }; export * from './math'; -export * from './value-types'; export * from './utils'; export * from './data'; export * from './event'; diff --git a/cocos/core/internal-index.ts b/cocos/core/internal-index.ts index 711a214b235..c19b8d84a5e 100644 --- a/cocos/core/internal-index.ts +++ b/cocos/core/internal-index.ts @@ -40,11 +40,6 @@ export type { DeserializationContext } from './data/custom-serializable'; export * from './data/utils/compiler'; -export { setPropertyEnumType, setPropertyEnumTypeOnAttrs } from './data/utils/attribute-internal'; - -export { ENUM_TAG, BITMASK_TAG } from './data/class'; -export { isCCObject, isValid } from './data/object'; - export { EasingMethod } from './curves/easing-method'; export { CallbacksInvoker } from './event/callbacks-invoker'; diff --git a/cocos/core/math/color.ts b/cocos/core/math/color.ts index 5231c7fe5b7..20f0c98ec1d 100644 --- a/cocos/core/math/color.ts +++ b/cocos/core/math/color.ts @@ -25,8 +25,7 @@ import { cclegacy } from '@base/global'; import { assertIsTrue } from '@base/debug/internal'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { IColorLike } from './type-define'; import { clamp, EPSILON } from './utils'; import { Vec4 } from './vec4'; diff --git a/cocos/core/math/mat3.ts b/cocos/core/math/mat3.ts index 4cd56b9bd70..312779518fa 100644 --- a/cocos/core/math/mat3.ts +++ b/cocos/core/math/mat3.ts @@ -23,8 +23,7 @@ */ import { cclegacy } from '@base/global'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { Quat } from './quat'; import { IMat3Like, IMat4Like, IQuatLike, IVec2Like, IVec3Like } from './type-define'; import { EPSILON, HALF_PI } from './utils'; diff --git a/cocos/core/math/mat4.ts b/cocos/core/math/mat4.ts index a787139b36e..d8b924240bb 100644 --- a/cocos/core/math/mat4.ts +++ b/cocos/core/math/mat4.ts @@ -23,8 +23,7 @@ */ import { cclegacy } from '@base/global'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { Mat3 } from './mat3'; import { Quat } from './quat'; import { IMat4Like, IVec3Like } from './type-define'; diff --git a/cocos/core/math/math-base.ts b/cocos/core/math/math-base.ts index 8c7da18a3be..27f6e12b5e8 100644 --- a/cocos/core/math/math-base.ts +++ b/cocos/core/math/math-base.ts @@ -23,7 +23,7 @@ */ import { JSB } from 'internal:constants'; -import { ValueType } from '../value-types/value-type'; +import { ValueType } from '@base/object'; import { FloatArray } from './type-define'; export const MATH_FLOAT_ARRAY = JSB ? Float32Array : Float64Array; diff --git a/cocos/core/math/quat.ts b/cocos/core/math/quat.ts index 58bbbf332cd..fc2f8ac3b15 100644 --- a/cocos/core/math/quat.ts +++ b/cocos/core/math/quat.ts @@ -23,8 +23,7 @@ */ import { cclegacy } from '@base/global'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { Mat3 } from './mat3'; import { IQuatLike, IVec3Like } from './type-define'; import { EPSILON, toDegree } from './utils'; diff --git a/cocos/core/math/rect.ts b/cocos/core/math/rect.ts index 1ea5fc9e78e..70aab13cf7f 100644 --- a/cocos/core/math/rect.ts +++ b/cocos/core/math/rect.ts @@ -24,8 +24,7 @@ */ import { cclegacy } from '@base/global'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { Mat4 } from './mat4'; import { Size } from './size'; import { IRectLike, IVec2Like } from './type-define'; @@ -200,8 +199,10 @@ export class Rect extends ValueType { * @zh 获取或设置矩形中心点的坐标。 */ get center (): Vec2 { - return new Vec2(this.x + this.width * 0.5, - this.y + this.height * 0.5); + return new Vec2( + this.x + this.width * 0.5, + this.y + this.height * 0.5, + ); } set center (value) { diff --git a/cocos/core/math/size.ts b/cocos/core/math/size.ts index 0ba6c22207e..6d43e92e231 100644 --- a/cocos/core/math/size.ts +++ b/cocos/core/math/size.ts @@ -24,8 +24,7 @@ */ import { cclegacy } from '@base/global'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { ISizeLike } from './type-define'; /** diff --git a/cocos/core/math/utils.ts b/cocos/core/math/utils.ts index 607f937ba70..309d8cb8889 100644 --- a/cocos/core/math/utils.ts +++ b/cocos/core/math/utils.ts @@ -23,8 +23,8 @@ */ // Fix Circular dependency +import { ValueType } from '@base/object'; import * as bits from './bits'; -import { ValueType } from '../value-types'; import { IVec3Like } from './type-define'; const _d2r = Math.PI / 180.0; diff --git a/cocos/core/math/vec2.ts b/cocos/core/math/vec2.ts index 481e53da752..12cf3e92b66 100644 --- a/cocos/core/math/vec2.ts +++ b/cocos/core/math/vec2.ts @@ -25,8 +25,7 @@ import { cclegacy } from '@base/global'; import { warn } from '@base/debug'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { Mat4 } from './mat4'; import { IMat3Like, IMat4Like, IVec2Like } from './type-define'; import { clamp, EPSILON, random } from './utils'; diff --git a/cocos/core/math/vec3.ts b/cocos/core/math/vec3.ts index 24b49ef4d20..bc4c01ab7bf 100644 --- a/cocos/core/math/vec3.ts +++ b/cocos/core/math/vec3.ts @@ -25,8 +25,7 @@ import { cclegacy } from '@base/global'; import { warn } from '@base/debug'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { Mat4 } from './mat4'; import { IMat3Like, IMat4Like, IQuatLike, IVec3Like } from './type-define'; import { clamp, EPSILON, lerp, random } from './utils'; @@ -389,7 +388,7 @@ export class Vec3 extends ValueType { * from normalized `from` to normalized `to`, * then scaled by linear interpolation of lengths from `from` to `to`. */ - public static slerp= ((): (out: Out, from: Readonly, to: Readonly, t: number) => Out => { + public static slerp = ((): (out: Out, from: Readonly, to: Readonly, t: number) => Out => { const cacheV1 = new Vec3(); const cacheV2 = new Vec3(); const cacheV3 = new Vec3(); diff --git a/cocos/core/math/vec4.ts b/cocos/core/math/vec4.ts index 4fe8d32898f..412b4fc40b8 100644 --- a/cocos/core/math/vec4.ts +++ b/cocos/core/math/vec4.ts @@ -25,8 +25,7 @@ import { cclegacy } from '@base/global'; import { warn } from '@base/debug'; -import { CCClass } from '../data/class'; -import { ValueType } from '../value-types/value-type'; +import { CCClass, ValueType } from '@base/object'; import { Mat4 } from './mat4'; import { IMat4Like, IQuatLike, IVec4Like, IColorLike } from './type-define'; import { clamp, EPSILON, random } from './utils'; diff --git a/cocos/core/system.ts b/cocos/core/system.ts index bda71b2c35d..1e4738197bb 100644 --- a/cocos/core/system.ts +++ b/cocos/core/system.ts @@ -22,8 +22,8 @@ THE SOFTWARE. */ +import { Enum } from '@base/object'; import { ISchedulable } from './scheduler'; -import { Enum } from './value-types/enum'; /** * @en Base class for all functional system managed by [[Director]]. diff --git a/cocos/dragon-bones/ArmatureDisplay.ts b/cocos/dragon-bones/ArmatureDisplay.ts index 3f6500a0d8b..85ee61f2e85 100644 --- a/cocos/dragon-bones/ArmatureDisplay.ts +++ b/cocos/dragon-bones/ArmatureDisplay.ts @@ -27,8 +27,9 @@ import { Armature, Bone, EventObject, AnimationState } from '@cocos/dragonbones- import { errorID, warn, error } from '@base/debug'; import { cclegacy } from '@base/global'; import { js, memop } from '@base/utils'; +import { ccenum, Enum, CCObject, setPropertyEnumType } from '@base/object'; import { UIRenderer } from '../2d/framework/ui-renderer'; -import { Color, Enum, ccenum, CCObject, EventTarget, _decorator } from '../core'; +import { Color, EventTarget, _decorator } from '../core'; import { BlendFactor } from '../gfx'; import { AnimationCache, ArmatureCache, ArmatureFrame } from './ArmatureCache'; import { AttachUtil } from './AttachUtil'; @@ -45,7 +46,6 @@ import { RenderDrawInfo } from '../2d/renderer/render-draw-info'; import { Material, Texture2D } from '../asset/assets'; import { Node } from '../scene-graph'; import { builtinResMgr } from '../asset/asset-manager'; -import { setPropertyEnumType } from '../core/internal-index'; enum DefaultArmaturesEnum { default = -1, diff --git a/cocos/dragon-bones/DragonBonesAsset.ts b/cocos/dragon-bones/DragonBonesAsset.ts index f48558a5f12..c1a4b748f29 100644 --- a/cocos/dragon-bones/DragonBonesAsset.ts +++ b/cocos/dragon-bones/DragonBonesAsset.ts @@ -25,9 +25,10 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; import { Asset } from '../asset/assets'; import { ArmatureCache } from './ArmatureCache'; -import { Enum, _decorator } from '../core'; +import { _decorator } from '../core'; import { CCFactory } from './CCFactory'; import { Node } from '../scene-graph'; diff --git a/cocos/game/director.ts b/cocos/game/director.ts index 5140451d23c..da3171375d5 100644 --- a/cocos/game/director.ts +++ b/cocos/game/director.ts @@ -32,8 +32,9 @@ import { errorID, error, assertID, warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { js } from '@base/utils'; import { scalableContainerManager } from '@base/utils/internal'; +import { CCObject, isValid } from '@base/object'; import { SceneAsset } from '../asset/assets/scene-asset'; -import { System, EventTarget, Scheduler, macro, CCObject, isValid } from '../core'; +import { System, EventTarget, Scheduler, macro } from '../core'; import { input } from '../input'; import { Root } from '../root'; import { Node, Scene } from '../scene-graph'; diff --git a/cocos/game/game.ts b/cocos/game/game.ts index 2ec292f83e1..ae0126b0054 100644 --- a/cocos/game/game.ts +++ b/cocos/game/game.ts @@ -30,8 +30,7 @@ import { Pacer } from 'pal/pacer'; import { ConfigOrientation } from 'pal/screen-adapter'; import { assert, DebugMode, warn, _resetDebugSetting, log, error } from '@base/debug'; import { VERSION, cclegacy } from '@base/global'; -import assetManager from '../asset/asset-manager/asset-manager'; -import { IAssetManagerOptions } from '../asset/asset-manager/asset-manager'; +import assetManager, { IAssetManagerOptions } from '../asset/asset-manager/asset-manager'; import { EventTarget, AsyncDelegate, sys, macro, screen, Settings, settings, garbageCollectionManager } from '../core'; import { input } from '../input'; import { deviceManager, LegacyRenderMode } from '../gfx'; diff --git a/cocos/gfx/base/pipeline-state.editor.ts b/cocos/gfx/base/pipeline-state.editor.ts index bdd4cb592dd..48ef5562d39 100644 --- a/cocos/gfx/base/pipeline-state.editor.ts +++ b/cocos/gfx/base/pipeline-state.editor.ts @@ -24,30 +24,12 @@ */ import { ccclass, serializable, type, editable } from 'cc.decorator'; - -import { - RasterizerState, - DepthStencilState, - BlendTarget, - BlendState, -} from './pipeline-state'; - -import { - PolygonMode, - ShadeModel, - CullMode, - ComparisonFunc, - StencilOp, - BlendFactor, - BlendOp, - ColorMask, - PrimitiveMode, - DynamicStateFlagBit, -} from './define'; - +import { CCString, Enum } from '@base/object'; +import { RasterizerState, DepthStencilState, BlendTarget, BlendState } from './pipeline-state'; +import { PolygonMode, ShadeModel, CullMode, ComparisonFunc, StencilOp, BlendFactor, BlendOp, ColorMask, PrimitiveMode, DynamicStateFlagBit } from './define'; import { EffectAsset } from '../../asset/assets/effect-asset'; import { RenderPassStage } from '../../rendering/define'; -import { CCString, Enum, Color } from '../../core'; +import { Color } from '../../core'; function isNumber(obj: any) { return typeof obj === 'number' && !isNaN(obj); diff --git a/cocos/gi/light-probe/auto-placement.ts b/cocos/gi/light-probe/auto-placement.ts index 16ff013e518..ef64b3a6637 100644 --- a/cocos/gi/light-probe/auto-placement.ts +++ b/cocos/gi/light-probe/auto-placement.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { Vec3, Enum } from '../../core'; +import { Enum } from '@base/object'; +import { Vec3 } from '../../core'; export const PlaceMethod = Enum({ UNIFORM: 0, diff --git a/cocos/gi/light-probe/light-probe-group.ts b/cocos/gi/light-probe/light-probe-group.ts index 1e993cdb9d0..5b5c30b8829 100644 --- a/cocos/gi/light-probe/light-probe-group.ts +++ b/cocos/gi/light-probe/light-probe-group.ts @@ -22,24 +22,12 @@ THE SOFTWARE. */ -import { - ccclass, - disallowMultiple, - displayName, - editable, - executeInEditMode, - help, - menu, - range, - serializable, - tooltip, - type, - visible, -} from 'cc.decorator'; +import { ccclass, disallowMultiple, displayName, editable, executeInEditMode, help, menu, range, serializable, tooltip, type, visible } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; +import { CCInteger } from '@base/object'; import { NodeEventType } from '../../scene-graph/node-event'; import { Component } from '../../scene-graph/component'; -import { Vec3, CCInteger } from '../../core'; +import { Vec3 } from '../../core'; import { AutoPlacement, PlaceMethod } from './auto-placement'; /** diff --git a/cocos/misc/camera-component.ts b/cocos/misc/camera-component.ts index 922d949a9b7..a2173b7a27a 100644 --- a/cocos/misc/camera-component.ts +++ b/cocos/misc/camera-component.ts @@ -26,10 +26,11 @@ import { EDITOR } from 'internal:constants'; import { ccclass, help, executeInEditMode, menu, tooltip, displayOrder, type, serializable, visible, range, rangeMin } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; import { RenderTexture } from '../asset/assets/render-texture'; import { UITransform } from '../2d/framework'; import { Component } from '../scene-graph'; -import { Color, Rect, toRadian, Vec3, geometry, Enum } from '../core'; +import { Color, Rect, toRadian, Vec3, geometry } from '../core'; import { CAMERA_DEFAULT_MASK } from '../rendering/define'; import { scene } from '../render-scene'; import { SKYBOX_FLAG, CameraProjection, CameraFOVAxis, CameraAperture, CameraISO, CameraShutter, CameraType, TrackingType } from '../render-scene/scene/camera'; diff --git a/cocos/misc/model-renderer.ts b/cocos/misc/model-renderer.ts index a4409fa66e5..9e561330660 100644 --- a/cocos/misc/model-renderer.ts +++ b/cocos/misc/model-renderer.ts @@ -24,10 +24,11 @@ import { ccclass, serializable, tooltip, type, disallowAnimation } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { CCBoolean } from '@base/object'; import { scene } from '../render-scene'; import { Layers } from '../scene-graph/layers'; import { Renderer } from './renderer'; -import { CCBoolean, _decorator } from '../core'; +import { _decorator } from '../core'; import { Model, SubModel } from '../render-scene/scene'; import { isEnableEffect } from '../rendering/define'; import { Root } from '../root'; diff --git a/cocos/particle-2d/define.ts b/cocos/particle-2d/define.ts index a57244e52ee..d6a7c86c38c 100644 --- a/cocos/particle-2d/define.ts +++ b/cocos/particle-2d/define.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { Enum } from '../core'; +import { Enum } from '@base/object'; /** * @en The Particle emitter lives forever. diff --git a/cocos/particle/animator/curve-range.ts b/cocos/particle/animator/curve-range.ts index 9930acd2a23..a71b7d31356 100644 --- a/cocos/particle/animator/curve-range.ts +++ b/cocos/particle/animator/curve-range.ts @@ -24,10 +24,10 @@ import { ccclass } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; -import { lerp, RealCurve, CCClass, geometry, Enum, approx, EPSILON } from '../../core'; +import { CCClass, Enum, setPropertyEnumType } from '@base/object'; +import { lerp, RealCurve, geometry, approx, EPSILON } from '../../core'; import { PixelFormat, Filter, WrapMode } from '../../asset/assets/asset-enum'; import { Texture2D, ImageAsset } from '../../asset/assets'; -import { setPropertyEnumType } from '../../core/internal-index'; const setClassAttr = CCClass.Attr.setClassAttr; diff --git a/cocos/particle/animator/gradient-range.ts b/cocos/particle/animator/gradient-range.ts index ac0305cb144..ee045bca497 100644 --- a/cocos/particle/animator/gradient-range.ts +++ b/cocos/particle/animator/gradient-range.ts @@ -24,7 +24,8 @@ import { ccclass, type, serializable, editable } from 'cc.decorator'; import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; -import { Color, Enum, Gradient, AlphaKey, ColorKey } from '../../core'; +import { Enum } from '@base/object'; +import { Color, Gradient, AlphaKey, ColorKey } from '../../core'; import { Texture2D } from '../../asset/assets'; import { PixelFormat, Filter, WrapMode } from '../../asset/assets/asset-enum'; diff --git a/cocos/particle/animator/noise-module.ts b/cocos/particle/animator/noise-module.ts index 0eb677aed3f..7abb0a88530 100644 --- a/cocos/particle/animator/noise-module.ts +++ b/cocos/particle/animator/noise-module.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { CCFloat, CCInteger, _decorator, Vec3, random } from '../../core'; +import { CCFloat, CCInteger } from '@base/object'; +import { _decorator, Vec3, random } from '../../core'; import { ParticleNoise } from '../noise'; import { Particle, PARTICLE_MODULE_NAME, ParticleModuleBase } from '../particle'; diff --git a/cocos/particle/animator/texture-animation.ts b/cocos/particle/animator/texture-animation.ts index 4032ae2f5f9..508603d55d7 100644 --- a/cocos/particle/animator/texture-animation.ts +++ b/cocos/particle/animator/texture-animation.ts @@ -24,7 +24,8 @@ import { ccclass, tooltip, displayOrder, type, formerlySerializedAs, serializable, range } from 'cc.decorator'; import { error } from '@base/debug'; -import { lerp, pseudoRandom, repeat, Enum, random } from '../../core'; +import { Enum } from '@base/object'; +import { lerp, pseudoRandom, repeat, random } from '../../core'; import { Particle, ParticleModuleBase, PARTICLE_MODULE_NAME } from '../particle'; import CurveRange from './curve-range'; import { ModuleRandSeed } from '../enum'; diff --git a/cocos/particle/enum.ts b/cocos/particle/enum.ts index d81dbc71168..b24416c091a 100644 --- a/cocos/particle/enum.ts +++ b/cocos/particle/enum.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { Enum } from '../core'; +import { Enum } from '@base/object'; export const Space = Enum({ World: 0, diff --git a/cocos/particle/line.ts b/cocos/particle/line.ts index 064b15d3dbd..4f9ce47a744 100644 --- a/cocos/particle/line.ts +++ b/cocos/particle/line.ts @@ -24,8 +24,9 @@ import { ccclass, help, executeInEditMode, menu, tooltip, displayOrder, type, serializable, range, visible, override, displayName } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { CCBoolean } from '@base/object'; import { Material, Texture2D } from '../asset/assets'; -import { Vec3, Vec4, Vec2, CCBoolean } from '../core'; +import { Vec3, Vec4, Vec2 } from '../core'; import { LineModel } from './models/line-model'; import { builtinResMgr } from '../asset/asset-manager'; import CurveRange from './animator/curve-range'; diff --git a/cocos/particle/particle-system.ts b/cocos/particle/particle-system.ts index a8cb9fea81b..7fb08c2563e 100644 --- a/cocos/particle/particle-system.ts +++ b/cocos/particle/particle-system.ts @@ -27,14 +27,14 @@ import { ccclass, help, executeInEditMode, executionOrder, menu, tooltip, displa import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; +import { CCBoolean, CCFloat } from '@base/object'; import { Renderer } from '../misc/renderer'; import { ModelRenderer } from '../misc/model-renderer'; import { Material } from '../asset/assets/material'; -import { Mat4, pseudoRandom, Quat, randomRangeInt, Vec2, Vec3, CCBoolean, CCFloat, bits, geometry } from '../core'; +import { Mat4, pseudoRandom, Quat, randomRangeInt, Vec2, Vec3, bits, geometry } from '../core'; import { scene } from '../render-scene'; import ColorOverLifetimeModule from './animator/color-overtime'; -import CurveRange from './animator/curve-range'; -import { Mode } from './animator/curve-range'; +import CurveRange, { Mode } from './animator/curve-range'; import ForceOvertimeModule from './animator/force-overtime'; import GradientRange from './animator/gradient-range'; import LimitVelocityOvertimeModule from './animator/limit-velocity-overtime'; diff --git a/cocos/particle/particle-utils.ts b/cocos/particle/particle-utils.ts index 11194791a0d..434a821c834 100644 --- a/cocos/particle/particle-utils.ts +++ b/cocos/particle/particle-utils.ts @@ -23,8 +23,8 @@ */ import { memop } from '@base/utils'; +import { CCObject } from '@base/object'; import { instantiate } from '../serialization'; -import { CCObject } from '../core'; import { Director, director } from '../game/director'; import { Node } from '../scene-graph'; import { ParticleSystem } from './particle-system'; diff --git a/cocos/physics-2d/box2d-wasm/physics-world.ts b/cocos/physics-2d/box2d-wasm/physics-world.ts index a9f1b422977..3fca03da72e 100644 --- a/cocos/physics-2d/box2d-wasm/physics-world.ts +++ b/cocos/physics-2d/box2d-wasm/physics-world.ts @@ -24,9 +24,10 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { js } from '@base/utils'; +import { CCObject } from '@base/object'; import { B2, getImplPtr, addImplPtrReference, addImplPtrReferenceWASM, getTSObjectFromWASMObject, getTSObjectFromWASMObjectPtr, removeImplPtrReference, removeImplPtrReferenceWASM } from './instantiated'; import { IPhysicsWorld } from '../spec/i-physics-world'; -import { IVec2Like, Vec3, Quat, toRadian, Vec2, toDegree, Rect, CCObject } from '../../core'; +import { IVec2Like, Vec3, Quat, toRadian, Vec2, toDegree, Rect } from '../../core'; import { PHYSICS_2D_PTM_RATIO, ERaycast2DType, ERigidBody2DType } from '../framework/physics-types'; import { Canvas } from '../../2d/framework'; import { Graphics } from '../../2d/components'; diff --git a/cocos/physics-2d/box2d/physics-world.ts b/cocos/physics-2d/box2d/physics-world.ts index 0eefb0192ff..edafb1a82e7 100644 --- a/cocos/physics-2d/box2d/physics-world.ts +++ b/cocos/physics-2d/box2d/physics-world.ts @@ -26,8 +26,9 @@ import b2 from '@cocos/box2d'; import { EDITOR_NOT_IN_PREVIEW, TEST } from 'internal:constants'; import { js } from '@base/utils'; +import { CCObject } from '@base/object'; import { IPhysicsWorld } from '../spec/i-physics-world'; -import { IVec2Like, Vec3, Quat, toRadian, Vec2, toDegree, Rect, CCObject } from '../../core'; +import { IVec2Like, Vec3, Quat, toRadian, Vec2, toDegree, Rect } from '../../core'; import { PHYSICS_2D_PTM_RATIO, ERaycast2DType, ERigidBody2DType } from '../framework/physics-types'; // import { Canvas } from '../../2d/framework'; // import { Graphics } from '../../2d/components'; diff --git a/cocos/physics-2d/builtin/builtin-world.ts b/cocos/physics-2d/builtin/builtin-world.ts index 21ea98f3eec..b5d6ad4dd05 100644 --- a/cocos/physics-2d/builtin/builtin-world.ts +++ b/cocos/physics-2d/builtin/builtin-world.ts @@ -24,9 +24,10 @@ import { EDITOR_NOT_IN_PREVIEW, TEST } from 'internal:constants'; import { js } from '@base/utils'; +import { CCObject } from '@base/object'; import { IPhysicsWorld } from '../spec/i-physics-world'; // import { Graphics } from '../../2d'; -import { CCObject, Vec3, Color, IVec2Like, Vec2, Rect } from '../../core'; +import { Vec3, Color, IVec2Like, Vec2, Rect } from '../../core'; // import { Canvas } from '../../2d/framework'; import { BuiltinShape2D } from './shapes/shape-2d'; import { BuiltinBoxShape } from './shapes/box-shape-2d'; diff --git a/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts b/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts index 4d8abd25649..50abf8c2cc5 100644 --- a/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts +++ b/cocos/physics-2d/framework/components/colliders/circle-collider-2d.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { CCFloat, Vec2, _decorator } from '../../../../core'; +import { CCFloat } from '@base/object'; +import { Vec2, _decorator } from '../../../../core'; import { Collider2D } from './collider-2d'; import { ECollider2DType } from '../../physics-types'; import { ICircleShape } from '../../../spec/i-physics-shape'; diff --git a/cocos/physics-2d/framework/components/colliders/collider-2d.ts b/cocos/physics-2d/framework/components/colliders/collider-2d.ts index ebb0497efe8..fe7150e3393 100644 --- a/cocos/physics-2d/framework/components/colliders/collider-2d.ts +++ b/cocos/physics-2d/framework/components/colliders/collider-2d.ts @@ -25,7 +25,8 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { Vec2, Rect, _decorator, Eventify, tooltip, CCInteger, serializable, CCFloat, CCBoolean } from '../../../../core'; +import { CCInteger, CCFloat, CCBoolean } from '@base/object'; +import { Vec2, Rect, _decorator, Eventify, tooltip, serializable } from '../../../../core'; import { PhysicsGroup } from '../../../../physics/framework/physics-enum'; import { RigidBody2D } from '../rigid-body-2d'; diff --git a/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts b/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts index ff7a735d7f6..6461a9adbb9 100644 --- a/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts +++ b/cocos/physics-2d/framework/components/colliders/polygon-collider-2d.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { CCFloat, Vec2, _decorator } from '../../../../core'; +import { CCFloat } from '@base/object'; +import { Vec2, _decorator } from '../../../../core'; import { Collider2D } from './collider-2d'; import { ECollider2DType } from '../../physics-types'; import { IPolygonShape } from '../../../spec/i-physics-shape'; diff --git a/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts b/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts index 9ae6d5f968b..69d84f0fdd1 100644 --- a/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/distance-joint-2d.ts @@ -22,10 +22,11 @@ THE SOFTWARE. */ +import { CCBoolean, CCFloat } from '@base/object'; import { Joint2D } from './joint-2d'; import { IDistanceJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; -import { CCBoolean, CCFloat, Vec3, _decorator } from '../../../../core'; +import { Vec3, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; const { ccclass, menu, property } = _decorator; diff --git a/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts b/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts index 96a44ebdf7f..086c28457d7 100644 --- a/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/fixed-joint-2d.ts @@ -22,8 +22,9 @@ THE SOFTWARE. */ +import { CCFloat } from '@base/object'; import { Joint2D } from './joint-2d'; -import { CCFloat, _decorator } from '../../../../core'; +import { _decorator } from '../../../../core'; import { IFixedJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; diff --git a/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts b/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts index b359515fcd9..86bafebfaf2 100644 --- a/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/hinge-joint-2d.ts @@ -22,8 +22,9 @@ THE SOFTWARE. */ +import { CCBoolean, CCFloat } from '@base/object'; import { Joint2D } from './joint-2d'; -import { CCBoolean, CCFloat, _decorator } from '../../../../core'; +import { _decorator } from '../../../../core'; import { IHingeJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; diff --git a/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts b/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts index 4798b1175cc..c7fd7dbd4fb 100644 --- a/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/mouse-joint-2d.ts @@ -22,10 +22,11 @@ THE SOFTWARE. */ +import { CCFloat } from '@base/object'; import { Joint2D } from './joint-2d'; import { IMouseJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; -import { CCFloat, Vec2, _decorator } from '../../../../core'; +import { Vec2, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; const { ccclass, menu, property } = _decorator; diff --git a/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts b/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts index 1d0845efc05..53a965f1fd8 100644 --- a/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/relative-joint-2d.ts @@ -22,10 +22,11 @@ THE SOFTWARE. */ +import { CCFloat, CCBoolean } from '@base/object'; import { Joint2D } from './joint-2d'; import { IRelativeJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; -import { Vec3, Vec2, IVec2Like, Quat, _decorator, CCFloat, CCBoolean } from '../../../../core'; +import { Vec3, Vec2, IVec2Like, Quat, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; const tempVec3_1 = new Vec3(); diff --git a/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts b/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts index 35364eb2d1d..581eaa290d3 100644 --- a/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/slider-joint-2d.ts @@ -22,10 +22,11 @@ THE SOFTWARE. */ +import { CCFloat, CCBoolean } from '@base/object'; import { Joint2D } from './joint-2d'; import { ISliderJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; -import { Vec2, IVec2Like, toDegree, _decorator, CCFloat, CCBoolean } from '../../../../core'; +import { Vec2, IVec2Like, toDegree, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; const tempVec2 = new Vec2(); diff --git a/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts b/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts index 63e87f1e558..1e1798636d8 100644 --- a/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/spring-joint-2d.ts @@ -22,10 +22,11 @@ THE SOFTWARE. */ +import { CCBoolean, CCFloat } from '@base/object'; import { Joint2D } from './joint-2d'; import { ISpringJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; -import { CCBoolean, CCFloat, Vec3, _decorator } from '../../../../core'; +import { Vec3, _decorator } from '../../../../core'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; const { ccclass, property, menu } = _decorator; diff --git a/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts b/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts index eb352c681ad..a8e85c932f9 100644 --- a/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts +++ b/cocos/physics-2d/framework/components/joints/wheel-joint-2d.ts @@ -22,8 +22,9 @@ THE SOFTWARE. */ +import { CCBoolean, CCFloat } from '@base/object'; import { Joint2D } from './joint-2d'; -import { CCBoolean, CCFloat, _decorator } from '../../../../core'; +import { _decorator } from '../../../../core'; import { IWheelJoint } from '../../../spec/i-physics-joint'; import { EJoint2DType } from '../../physics-types'; import { help, serializable, tooltip, type } from '../../../../core/data/decorators'; diff --git a/cocos/physics-2d/framework/components/rigid-body-2d.ts b/cocos/physics-2d/framework/components/rigid-body-2d.ts index 13c5bfeaeb4..55241c5c9e7 100644 --- a/cocos/physics-2d/framework/components/rigid-body-2d.ts +++ b/cocos/physics-2d/framework/components/rigid-body-2d.ts @@ -23,8 +23,9 @@ */ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; +import { CCBoolean, CCFloat } from '@base/object'; import { IRigidBody2D } from '../../spec/i-rigid-body'; -import { _decorator, Vec2, IVec2Like, CCBoolean, CCFloat } from '../../../core'; +import { _decorator, Vec2, IVec2Like } from '../../../core'; import { ERigidBody2DType } from '../physics-types'; import { createRigidBody } from '../physics-selector'; import { PhysicsGroup } from '../../../physics/framework/physics-enum'; diff --git a/cocos/physics-2d/framework/physics-system.ts b/cocos/physics-2d/framework/physics-system.ts index bd21d897254..bf82f6fcea2 100644 --- a/cocos/physics-2d/framework/physics-system.ts +++ b/cocos/physics-2d/framework/physics-system.ts @@ -24,7 +24,8 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { System, Vec2, IVec2Like, Rect, Eventify, Enum, Settings, settings } from '../../core'; +import { Enum } from '@base/object'; +import { System, Vec2, IVec2Like, Rect, Eventify, Settings, settings } from '../../core'; import { createPhysicsWorld, selector, IPhysicsSelector } from './physics-selector'; import { DelayEvent } from './physics-internal-types'; diff --git a/cocos/physics-2d/framework/physics-types.ts b/cocos/physics-2d/framework/physics-types.ts index f8b2dccdf29..9fb7ba0e38e 100644 --- a/cocos/physics-2d/framework/physics-types.ts +++ b/cocos/physics-2d/framework/physics-types.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { Enum, Vec2 } from '../../core'; +import { Enum } from '@base/object'; +import { Vec2 } from '../../core'; import { Collider2D } from './components/colliders/collider-2d'; export enum ERigidBody2DType { diff --git a/cocos/physics/framework/assets/physics-material.ts b/cocos/physics/framework/assets/physics-material.ts index fb48fbf6bbb..61cb9c5039e 100644 --- a/cocos/physics/framework/assets/physics-material.ts +++ b/cocos/physics/framework/assets/physics-material.ts @@ -25,8 +25,9 @@ // @ts-check import { ccclass, editable, help, menu, serializable, tooltip, type } from 'cc.decorator'; +import { CCFloat } from '@base/object'; import { Asset } from '../../../asset/assets/asset'; -import { CCFloat, math } from '../../../core'; +import { math } from '../../../core'; /** * @en diff --git a/cocos/physics/framework/components/character-controllers/box-character-controller.ts b/cocos/physics/framework/components/character-controllers/box-character-controller.ts index c7bd5706039..ba7839d3e17 100644 --- a/cocos/physics/framework/components/character-controllers/box-character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/box-character-controller.ts @@ -25,7 +25,8 @@ import { ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; import { error, warn } from '@base/debug'; -import { Vec3, CCFloat } from '../../../../core'; +import { CCFloat } from '@base/object'; +import { Vec3 } from '../../../../core'; import { Component } from '../../../../scene-graph'; import { IBoxCharacterController } from '../../../spec/i-character-controller'; import { ECharacterControllerType } from '../../physics-enum'; diff --git a/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts b/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts index 1d7f9b73aba..87a24a734dc 100644 --- a/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts @@ -25,7 +25,8 @@ import { ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; import { error, warn } from '@base/debug'; -import { Vec3, CCFloat } from '../../../../core'; +import { CCFloat } from '@base/object'; +import { Vec3 } from '../../../../core'; import { Component } from '../../../../scene-graph'; import { ICapsuleCharacterController } from '../../../spec/i-character-controller'; import { ECharacterControllerType } from '../../physics-enum'; diff --git a/cocos/physics/framework/components/character-controllers/character-controller.ts b/cocos/physics/framework/components/character-controllers/character-controller.ts index 70526bf2982..4d1ada50932 100644 --- a/cocos/physics/framework/components/character-controllers/character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/character-controller.ts @@ -25,7 +25,8 @@ import { ccclass, disallowMultiple, tooltip, displayOrder, type, serializable } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; import { warn } from '@base/debug'; -import { Vec3, CCFloat, Eventify } from '../../../../core'; +import { CCFloat } from '@base/object'; +import { Vec3, Eventify } from '../../../../core'; import { Component } from '../../../../scene-graph'; import { IBaseCharacterController } from '../../../spec/i-character-controller'; import { ECharacterControllerType } from '../../physics-enum'; diff --git a/cocos/physics/framework/components/constraints/configurable-constraint.ts b/cocos/physics/framework/components/constraints/configurable-constraint.ts index 5760f8e3397..57dd59ab775 100644 --- a/cocos/physics/framework/components/constraints/configurable-constraint.ts +++ b/cocos/physics/framework/components/constraints/configurable-constraint.ts @@ -22,20 +22,11 @@ THE SOFTWARE. */ -import { - ccclass, - help, - menu, - serializable, - formerlySerializedAs, - type, - tooltip, - editable, - group, -} from 'cc.decorator'; +import { ccclass, help, menu, serializable, formerlySerializedAs, type, tooltip, editable, group } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; +import { CCFloat, CCBoolean } from '@base/object'; import { Constraint } from './constraint'; -import { Vec3, CCFloat, CCBoolean } from '../../../../core'; +import { Vec3 } from '../../../../core'; import { EConstraintType, EConstraintMode, EDriverMode } from '../../physics-enum'; import { IConfigurableConstraint } from '../../../spec/i-physics-constraint'; diff --git a/cocos/physics/framework/components/constraints/fixed-constraint.ts b/cocos/physics/framework/components/constraints/fixed-constraint.ts index 653735d7593..bf708052b20 100644 --- a/cocos/physics/framework/components/constraints/fixed-constraint.ts +++ b/cocos/physics/framework/components/constraints/fixed-constraint.ts @@ -22,18 +22,11 @@ THE SOFTWARE. */ -import { - ccclass, - help, - menu, - serializable, - formerlySerializedAs, - type, - tooltip, -} from 'cc.decorator'; +import { ccclass, help, menu, serializable, formerlySerializedAs, type, tooltip } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; +import { CCFloat } from '@base/object'; import { Constraint } from './constraint'; -import { CCFloat, IVec3Like, Vec3 } from '../../../../core'; +import { IVec3Like, Vec3 } from '../../../../core'; import { EConstraintType } from '../../physics-enum'; import { IFixedConstraint } from '../../../spec/i-physics-constraint'; diff --git a/cocos/physics/framework/components/constraints/hinge-constraint.ts b/cocos/physics/framework/components/constraints/hinge-constraint.ts index ffd283834d2..7ba6d900460 100644 --- a/cocos/physics/framework/components/constraints/hinge-constraint.ts +++ b/cocos/physics/framework/components/constraints/hinge-constraint.ts @@ -22,18 +22,11 @@ THE SOFTWARE. */ -import { - ccclass, - help, - menu, - serializable, - formerlySerializedAs, - type, - tooltip, -} from 'cc.decorator'; +import { ccclass, help, menu, serializable, formerlySerializedAs, type, tooltip } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; +import { CCFloat, CCBoolean } from '@base/object'; import { Constraint } from './constraint'; -import { Vec3, CCFloat, CCBoolean } from '../../../../core'; +import { Vec3 } from '../../../../core'; import { EConstraintType } from '../../physics-enum'; import { IHingeConstraint } from '../../../spec/i-physics-constraint'; diff --git a/cocos/physics/framework/physics-enum.ts b/cocos/physics/framework/physics-enum.ts index a84d210aa48..8742908fbe2 100644 --- a/cocos/physics/framework/physics-enum.ts +++ b/cocos/physics/framework/physics-enum.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { Enum } from '../../core'; +import { Enum } from '@base/object'; /** * @en diff --git a/cocos/physics/framework/physics-system.ts b/cocos/physics/framework/physics-system.ts index 99d26fefd98..0af42ed05c4 100644 --- a/cocos/physics/framework/physics-system.ts +++ b/cocos/physics/framework/physics-system.ts @@ -26,7 +26,8 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { warn, error } from '@base/debug'; import { cclegacy } from '@base/global'; import { memop } from '@base/utils'; -import { Vec3, Enum, System, Settings, settings, geometry, IQuatLike, IVec3Like } from '../../core'; +import { Enum } from '@base/object'; +import { Vec3, System, Settings, settings, geometry, IQuatLike, IVec3Like } from '../../core'; import { IPhysicsWorld, IRaycastOptions } from '../spec/i-physics-world'; import { director, Director, game } from '../../game'; import { PhysicsMaterial } from './assets/physics-material'; diff --git a/cocos/primitive/primitive.ts b/cocos/primitive/primitive.ts index 1a671262306..0d5d8867d41 100644 --- a/cocos/primitive/primitive.ts +++ b/cocos/primitive/primitive.ts @@ -24,10 +24,10 @@ import { ccclass, type, serializable, editable } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { createMesh } from '../3d/misc'; import { Mesh } from '../3d/assets/mesh'; import * as primitives from '.'; -import { ccenum } from '../core'; enum PrimitiveType { BOX = 0, diff --git a/cocos/render-scene/scene/fog.ts b/cocos/render-scene/scene/fog.ts index d22a865f7c5..695eeb2c02f 100644 --- a/cocos/render-scene/scene/fog.ts +++ b/cocos/render-scene/scene/fog.ts @@ -23,7 +23,8 @@ */ import { cclegacy } from '@base/global'; -import { Enum, Color, Vec4 } from '../../core'; +import { Enum } from '@base/object'; +import { Color, Vec4 } from '../../core'; import { FogInfo } from '../../scene-graph/scene-globals'; import { SRGBToLinear } from '../../rendering/pipeline-funcs'; import { Root } from '../../root'; diff --git a/cocos/render-scene/scene/index.jsb.ts b/cocos/render-scene/scene/index.jsb.ts index 3c699870ced..855802a4465 100644 --- a/cocos/render-scene/scene/index.jsb.ts +++ b/cocos/render-scene/scene/index.jsb.ts @@ -21,8 +21,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { Vec3, Enum } from '../../core'; import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; +import { Vec3 } from '../../core'; import type { LODData as JsbLODData, LODGroup as JsbLODGroup } from './lod-group'; export const LODData: typeof JsbLODData = jsb.LODData; diff --git a/cocos/render-scene/scene/post-settings.ts b/cocos/render-scene/scene/post-settings.ts index f574ffb9412..31f36aab635 100644 --- a/cocos/render-scene/scene/post-settings.ts +++ b/cocos/render-scene/scene/post-settings.ts @@ -1,5 +1,5 @@ import { cclegacy } from '@base/global'; -import { Enum } from '../../core'; +import { Enum } from '@base/object'; import { PostSettingsInfo } from '../../scene-graph/scene-globals'; export const ToneMappingType = Enum({ diff --git a/cocos/render-scene/scene/shadows.ts b/cocos/render-scene/scene/shadows.ts index 6663d18c5b7..497d9b8642d 100644 --- a/cocos/render-scene/scene/shadows.ts +++ b/cocos/render-scene/scene/shadows.ts @@ -25,8 +25,9 @@ import { DEBUG } from 'internal:constants'; import { assert } from '@base/debug'; import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; import { Material } from '../../asset/assets/material'; -import { Color, Mat4, Vec3, Vec2, Enum, geometry } from '../../core'; +import { Color, Mat4, Vec3, Vec2, geometry } from '../../core'; import type { ShadowsInfo } from '../../scene-graph/scene-globals'; import { IMacroPatch } from '../core/pass'; import { Shader } from '../../gfx'; diff --git a/cocos/render-scene/scene/skybox.ts b/cocos/render-scene/scene/skybox.ts index 6b33f77c921..3f4884e0bc4 100644 --- a/cocos/render-scene/scene/skybox.ts +++ b/cocos/render-scene/scene/skybox.ts @@ -23,6 +23,7 @@ */ import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; import { builtinResMgr } from '../../asset/asset-manager/builtin-res-mgr'; import { Material } from '../../asset/assets/material'; import { Mesh } from '../../3d/assets/mesh'; @@ -34,7 +35,6 @@ import type { SkyboxInfo } from '../../scene-graph/scene-globals'; import { Root } from '../../root'; import { GlobalDSManager } from '../../rendering/global-descriptor-set-manager'; import { deviceManager } from '../../gfx'; -import { Enum } from '../../core'; let skybox_mesh: Mesh | null = null; let skybox_material: Material | null = null; diff --git a/cocos/rendering/index.jsb.ts b/cocos/rendering/index.jsb.ts index 8889564f655..5b71c9b9be0 100644 --- a/cocos/rendering/index.jsb.ts +++ b/cocos/rendering/index.jsb.ts @@ -26,7 +26,8 @@ declare const nr: any; declare const jsb: any; import { OPEN_HARMONY } from 'internal:constants'; -import { ccenum, CCString } from '../core'; +import { ccenum } from '@base/object'; +import { CCString } from '@base/object'; import { js } from '@base/utils'; import * as pipeline from './define'; import { ccclass, serializable, editable, type } from '../core/data/class-decorator'; diff --git a/cocos/rendering/pipeline-serialization.ts b/cocos/rendering/pipeline-serialization.ts index 9fcd89a4d06..cdef15d0ac7 100644 --- a/cocos/rendering/pipeline-serialization.ts +++ b/cocos/rendering/pipeline-serialization.ts @@ -23,7 +23,7 @@ */ import { ccclass, type, serializable, editable } from 'cc.decorator'; -import { CCString, ccenum } from '../core'; +import { CCString, ccenum } from '@base/object'; import { AccessFlagBit, Format, LoadOp, StoreOp, TextureType, TextureUsageBit } from '../gfx'; import { RenderTexture } from '../asset/assets/render-texture'; import { Material } from '../asset/assets/material'; diff --git a/cocos/rendering/post-process/components/bloom.ts b/cocos/rendering/post-process/components/bloom.ts index 98593bafe21..92908283705 100644 --- a/cocos/rendering/post-process/components/bloom.ts +++ b/cocos/rendering/post-process/components/bloom.ts @@ -1,6 +1,6 @@ import { cclegacy } from '@base/global'; +import { CCBoolean, CCFloat, CCInteger } from '@base/object'; import { ccclass, disallowMultiple, executeInEditMode, help, menu, range, rangeMin, serializable, slide, tooltip, type, visible } from '../../../core/data/decorators'; -import { CCBoolean, CCFloat, CCInteger } from '../../../core/data/utils/attribute'; import { Root } from '../../../root'; import { PostProcessSetting } from './post-process-setting'; diff --git a/cocos/rendering/post-process/components/color-grading.ts b/cocos/rendering/post-process/components/color-grading.ts index 45f456b2849..5866abc2f42 100644 --- a/cocos/rendering/post-process/components/color-grading.ts +++ b/cocos/rendering/post-process/components/color-grading.ts @@ -1,5 +1,5 @@ +import { CCFloat } from '@base/object'; import { Texture2D } from '../../../asset/assets'; -import { CCFloat } from '../../../core'; import { property } from '../../../core/data/class-decorator'; import { ccclass, disallowMultiple, executeInEditMode, help, menu, range, serializable, slide, tooltip, type } from '../../../core/data/decorators'; import { PostProcessSetting } from './post-process-setting'; diff --git a/cocos/rendering/post-process/components/fsr.ts b/cocos/rendering/post-process/components/fsr.ts index b3d74377028..3934f002245 100644 --- a/cocos/rendering/post-process/components/fsr.ts +++ b/cocos/rendering/post-process/components/fsr.ts @@ -1,4 +1,4 @@ -import { CCFloat } from '../../../core'; +import { CCFloat } from '@base/object'; import { type } from '../../../core/data/class-decorator'; import { ccclass, disallowMultiple, executeInEditMode, help, menu, range, serializable, slide, tooltip } from '../../../core/data/decorators'; import { PostProcessSetting } from './post-process-setting'; diff --git a/cocos/rendering/post-process/components/hbao.ts b/cocos/rendering/post-process/components/hbao.ts index d98f1073cd9..bb05de20672 100644 --- a/cocos/rendering/post-process/components/hbao.ts +++ b/cocos/rendering/post-process/components/hbao.ts @@ -22,9 +22,8 @@ THE SOFTWARE. */ -import { CCBoolean, CCFloat, CCInteger } from '../../../core'; -import { ccclass, disallowMultiple, editable, executeInEditMode, help, menu, range, - serializable, slide, tooltip, type, visible } from '../../../core/data/decorators'; +import { CCBoolean, CCFloat, CCInteger } from '@base/object'; +import { ccclass, disallowMultiple, editable, executeInEditMode, help, menu, range, serializable, slide, tooltip, type, visible } from '../../../core/data/decorators'; import { PostProcessSetting } from './post-process-setting'; @ccclass('cc.HBAO') diff --git a/cocos/scene-graph/component-event-handler.schema.ts b/cocos/scene-graph/component-event-handler.schema.ts index d814a849ca4..a9048fb4def 100644 --- a/cocos/scene-graph/component-event-handler.schema.ts +++ b/cocos/scene-graph/component-event-handler.schema.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { CCClass } from '../core/data'; +import { CCClass } from '@base/object'; import { Node } from './node'; import { EventHandler } from './component-event-handler'; diff --git a/cocos/scene-graph/component-scheduler.ts b/cocos/scene-graph/component-scheduler.ts index 1dd153d0d32..36536f70ac3 100644 --- a/cocos/scene-graph/component-scheduler.ts +++ b/cocos/scene-graph/component-scheduler.ts @@ -26,7 +26,7 @@ import { EDITOR, SUPPORT_JIT, DEV, TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; import { error, assert } from '@base/debug'; import { js } from '@base/utils'; -import { CCObject } from '../core/data/object'; +import { CCObject } from '@base/object'; import { tryCatchFunctor_EDITOR } from './utils'; import type { Component } from './component'; diff --git a/cocos/scene-graph/component.ts b/cocos/scene-graph/component.ts index da6aa4e5762..caf3a25f8c0 100644 --- a/cocos/scene-graph/component.ts +++ b/cocos/scene-graph/component.ts @@ -28,11 +28,10 @@ import { EDITOR, TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; import { errorID, warnID, assertID } from '@base/debug'; import { js } from '@base/utils'; +import { CCObject, RF } from '@base/object'; import { Script } from '../asset/assets/scripts'; -import { CCObject } from '../core/data/object'; import { RenderScene } from '../render-scene/core/render-scene'; import { Rect } from '../core/math'; -import * as RF from '../core/data/utils/requiring-frame'; import { Node } from './node'; import { CompPrefabInfo } from './prefab/prefab-info'; import { EventHandler } from './component-event-handler'; diff --git a/cocos/scene-graph/deprecated.ts b/cocos/scene-graph/deprecated.ts index 120d797d118..4451a72d233 100644 --- a/cocos/scene-graph/deprecated.ts +++ b/cocos/scene-graph/deprecated.ts @@ -27,11 +27,11 @@ import { ccclass } from 'cc.decorator'; import { cclegacy } from '@base/global'; import { warnID } from '@base/debug'; import { replaceProperty, removeProperty } from '@base/utils'; +import { CCObject } from '@base/object'; import { Layers } from './layers'; import { Node } from './node'; import { Vec2 } from '../core/math/vec2'; import { Size } from '../core/math/size'; -import { CCObject } from '../core/data/object'; import { SceneGlobals } from './scene-globals'; import { SystemEventType } from '../input/types'; import { SystemEvent } from '../input'; diff --git a/cocos/scene-graph/layers.ts b/cocos/scene-graph/layers.ts index 890c5e8641e..76256be96a9 100644 --- a/cocos/scene-graph/layers.ts +++ b/cocos/scene-graph/layers.ts @@ -26,7 +26,7 @@ import { cclegacy } from '@base/global'; import { assertIsTrue } from '@base/debug/internal'; import { getError, warn } from '@base/debug'; import { js } from '@base/utils'; -import { BitMask, Enum } from '../core/value-types'; +import { BitMask, Enum } from '@base/object'; import { log2 } from '../core/math/bits'; import { Settings, settings } from '../core/settings'; diff --git a/cocos/scene-graph/node-activator.ts b/cocos/scene-graph/node-activator.ts index 58de55a7513..1ca9cffaf69 100644 --- a/cocos/scene-graph/node-activator.ts +++ b/cocos/scene-graph/node-activator.ts @@ -27,7 +27,7 @@ import { cclegacy } from '@base/global'; import { assert, errorID, getError, log } from '@base/debug'; import { assertIsTrue } from '@base/debug/internal'; import { js } from '@base/utils'; -import { CCObject, isValid } from '../core/data/object'; +import { CCObject, isValid } from '@base/object'; import { tryCatchFunctor_EDITOR } from './utils'; import { invokeOnEnable, createInvokeImpl, createInvokeImplJit, OneOffInvoker, LifeCycleInvoker } from './component-scheduler'; import { NodeEventType } from './node-event'; diff --git a/cocos/scene-graph/node-dev.ts b/cocos/scene-graph/node-dev.ts index 36eeb6d3d51..2bf7cd46148 100644 --- a/cocos/scene-graph/node-dev.ts +++ b/cocos/scene-graph/node-dev.ts @@ -26,7 +26,7 @@ import { EDITOR, DEV, TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; import { error, errorID, getError, warn } from '@base/debug'; import { js } from '@base/utils'; -import { CCObject } from '../core/data/object'; +import { CCObject } from '@base/object'; import { Component } from './component'; const Destroying = CCObject.Flags.Destroying; diff --git a/cocos/scene-graph/node-enum.ts b/cocos/scene-graph/node-enum.ts index b9cd58c435e..ce2bf0ca68d 100644 --- a/cocos/scene-graph/node-enum.ts +++ b/cocos/scene-graph/node-enum.ts @@ -23,7 +23,7 @@ */ import { cclegacy } from '@base/global'; -import { Enum } from '../core/value-types'; +import { Enum } from '@base/object'; /** * @en Node's coordinate space diff --git a/cocos/scene-graph/node.jsb.ts b/cocos/scene-graph/node.jsb.ts index 2f7d975f852..5e6a9d5fd01 100644 --- a/cocos/scene-graph/node.jsb.ts +++ b/cocos/scene-graph/node.jsb.ts @@ -26,12 +26,12 @@ import { errorID, getError } from '@base/debug'; import { js } from '@base/utils'; import { Component } from './component'; import { NodeEventType } from './node-event'; -import { CCObject } from '../core/data/object'; +import { CCObject, editorExtrasTag } from '@base/object'; import { NodeUIProperties } from './node-ui-properties'; import { MobilityMode, NodeSpace, TransformBit } from './node-enum'; import { Mat4, Quat, Vec3 } from '../core/math'; import { Layers } from './layers'; -import { editorExtrasTag, SerializationContext, SerializationOutput, serializeTag } from '../core/data'; +import { SerializationContext, SerializationOutput, serializeTag } from '../core/data'; import { _tempFloatArray, fillMat4WithTempFloatArray } from './utils.jsb'; import { syncNodeValues } from '../core/utils/jsb-utils'; import { nodePolyfill } from './node-dev'; diff --git a/cocos/scene-graph/node.ts b/cocos/scene-graph/node.ts index 59206612942..450b8fac946 100644 --- a/cocos/scene-graph/node.ts +++ b/cocos/scene-graph/node.ts @@ -27,14 +27,14 @@ import { DEV, DEBUG, EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { cclegacy } from '@base/global'; import { errorID, warnID, error, log, getError } from '@base/debug'; import { js } from '@base/utils'; +import { CCObject, editorExtrasTag } from '@base/object'; import { Layers } from './layers'; import { NodeUIProperties } from './node-ui-properties'; -import { CCObject } from '../core'; import { nodePolyfill } from './node-dev'; import { ISchedulable } from '../core/scheduler'; import { approx, EPSILON, Mat3, Mat4, Quat, Vec3 } from '../core/math'; import { MobilityMode, NodeSpace, TransformBit } from './node-enum'; -import { CustomSerializable, editorExtrasTag, SerializationContext, SerializationOutput, serializeTag } from '../core/data'; +import { CustomSerializable, SerializationContext, SerializationOutput, serializeTag } from '../core/data'; import { Component } from './component'; import { property } from '../core/data/decorators/property'; import type { Scene } from './scene'; diff --git a/cocos/scene-graph/prefab/prefab-info.ts b/cocos/scene-graph/prefab/prefab-info.ts index de1e4889f44..9dcb0a1fe34 100644 --- a/cocos/scene-graph/prefab/prefab-info.ts +++ b/cocos/scene-graph/prefab/prefab-info.ts @@ -25,8 +25,8 @@ import { ccclass, serializable, editable, type } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; import { cclegacy } from '@base/global'; +import { CCObject, CCString } from '@base/object'; import { Prefab } from './prefab'; -import { CCObject, CCString } from '../../core/data'; import { Component } from '../component'; import { Node } from '../node'; diff --git a/cocos/scene-graph/prefab/prefab.ts b/cocos/scene-graph/prefab/prefab.ts index e3f5c05fbea..7b0a1b9094c 100644 --- a/cocos/scene-graph/prefab/prefab.ts +++ b/cocos/scene-graph/prefab/prefab.ts @@ -28,8 +28,8 @@ import { SUPPORT_JIT, ALIPAY, RUNTIME_BASED, JSB } from 'internal:constants'; import { cclegacy } from '@base/global'; import { warnID } from '@base/debug'; import { js } from '@base/utils'; +import { Enum } from '@base/object'; import { compile } from '../../serialization/instantiate-jit'; -import { Enum } from '../../core/value-types'; import { Asset } from '../../asset/assets/asset'; import { Node } from '../node'; import { updateChildrenForDeserialize } from '../../core/utils/jsb-utils'; diff --git a/cocos/scene-graph/prefab/utils.ts b/cocos/scene-graph/prefab/utils.ts index 9914561ec30..5e673e077fb 100644 --- a/cocos/scene-graph/prefab/utils.ts +++ b/cocos/scene-graph/prefab/utils.ts @@ -26,11 +26,10 @@ import { EDITOR, SUPPORT_JIT } from 'internal:constants'; import { cclegacy } from '@base/global'; import { errorID, warn } from '@base/debug'; -import { editorExtrasTag } from '../../core'; +import { editorExtrasTag, ValueType } from '@base/object'; import { Node } from '../node'; import { Component } from '../component'; import { MountedChildrenInfo, PropertyOverrideInfo, MountedComponentsInfo, TargetInfo, TargetMap, PrefabInstance, TargetOverrideInfo } from './prefab-info'; -import { ValueType } from '../../core/value-types'; export * from './prefab-info'; diff --git a/cocos/scene-graph/scene-globals.jsb.ts b/cocos/scene-graph/scene-globals.jsb.ts index 9d4f7359c4a..1e558fc4a06 100644 --- a/cocos/scene-graph/scene-globals.jsb.ts +++ b/cocos/scene-graph/scene-globals.jsb.ts @@ -21,9 +21,9 @@ */ import { cclegacy } from '@base/global'; -import { CCFloat, CCInteger } from '../core/data'; +import { CCFloat, CCInteger } from '@base/object'; import { TextureCube } from '../asset/assets/texture-cube'; -import { Enum } from '../core/value-types'; +import { Enum } from '@base/object'; import { Ambient, EnvironmentLightingType, ToneMappingType } from '../render-scene/scene'; import { Material } from '../asset/assets/material'; import { Vec2, Vec3, Color, Vec4 } from '../core/math'; diff --git a/cocos/scene-graph/scene-globals.ts b/cocos/scene-graph/scene-globals.ts index 8cdde513ec9..1821bf2ccea 100644 --- a/cocos/scene-graph/scene-globals.ts +++ b/cocos/scene-graph/scene-globals.ts @@ -25,8 +25,8 @@ import { ccclass, visible, type, displayOrder, readOnly, slide, range, rangeStep import { BAIDU } from 'internal:constants'; import { cclegacy } from '@base/global'; import { warnID } from '@base/debug'; +import { CCFloat, CCInteger } from '@base/object'; import { TextureCube } from '../asset/assets/texture-cube'; -import { CCFloat, CCInteger } from '../core/data/utils/attribute'; import { Color, Quat, Vec3, Vec2, Vec4 } from '../core/math'; import { Ambient } from '../render-scene/scene/ambient'; import { Shadows, ShadowType, ShadowSize } from '../render-scene/scene/shadows'; diff --git a/cocos/scene-graph/scene.ts b/cocos/scene-graph/scene.ts index 615944075d8..b1855abf313 100644 --- a/cocos/scene-graph/scene.ts +++ b/cocos/scene-graph/scene.ts @@ -26,7 +26,7 @@ import { ccclass, serializable, editable } from 'cc.decorator'; import { EDITOR, TEST } from 'internal:constants'; import { assert, getError } from '@base/debug'; import { cclegacy } from '@base/global'; -import { CCObject } from '../core/data/object'; +import { CCObject } from '@base/object'; import { RenderScene } from '../render-scene/core/render-scene'; import { Node } from './node'; import { Component } from './component'; diff --git a/cocos/serialization/compiled/builtin-value-type.ts b/cocos/serialization/compiled/builtin-value-type.ts index f093cd98b2f..798d1cc7182 100644 --- a/cocos/serialization/compiled/builtin-value-type.ts +++ b/cocos/serialization/compiled/builtin-value-type.ts @@ -1,6 +1,7 @@ import { JSB } from 'internal:constants'; import { assertIsTrue } from '@base/debug/internal'; -import { Vec2, Vec3, Vec4, Color, Size, Rect, Quat, Mat4, ValueType } from '../../core'; +import { ValueType } from '@base/object'; +import { Vec2, Vec3, Vec4, Color, Size, Rect, Quat, Mat4 } from '../../core'; import type { IRuntimeFileData } from '../deserialize'; /** diff --git a/cocos/serialization/deserialize-dynamic.ts b/cocos/serialization/deserialize-dynamic.ts index 052c9c0b883..092e526d55d 100644 --- a/cocos/serialization/deserialize-dynamic.ts +++ b/cocos/serialization/deserialize-dynamic.ts @@ -28,7 +28,9 @@ import { error } from '@base/debug'; import { assertIsTrue } from '@base/debug/internal'; import { cclegacy } from '@base/global'; import { js } from '@base/utils'; -import { misc, CCClass, ENUM_TAG, BITMASK_TAG, sys, CustomSerializable, DeserializationContext, deserializeTag, SerializationInput } from '../core'; +import { CCClass } from '@base/object'; +import { ENUM_TAG, BITMASK_TAG } from '@base/object/internal'; +import { misc, sys, CustomSerializable, DeserializationContext, deserializeTag, SerializationInput } from '../core'; import { MissingScript } from '../misc/missing-script'; import { Details } from './deserialize'; import { Platform } from '../../pal/system-info/enum-type'; diff --git a/cocos/serialization/instantiate-jit.ts b/cocos/serialization/instantiate-jit.ts index 073fe6c706b..081cceed99c 100644 --- a/cocos/serialization/instantiate-jit.ts +++ b/cocos/serialization/instantiate-jit.ts @@ -28,7 +28,8 @@ import { TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; import { js } from '@base/utils'; -import { CCClass, isCCClassOrFastDefined, CCObject, isCCObject, flattenCodeArray } from '../core'; +import { CCClass, isCCClassOrFastDefined, CCObject, isCCObject } from '@base/object'; +import { flattenCodeArray } from '../core'; const Destroyed = CCObject.Flags.Destroyed; const PersistentMask = CCObject.Flags.PersistentMask; @@ -200,12 +201,14 @@ class Parser { // this.codeArray.push(this.instantiateArray(obj)); // } // else { - this.codeArray.push(`${VAR + LOCAL_OBJ},${LOCAL_TEMP_OBJ};`, + this.codeArray.push( + `${VAR + LOCAL_OBJ},${LOCAL_TEMP_OBJ};`, 'if(R){', `${LOCAL_OBJ}=R;`, '}else{', `${LOCAL_OBJ}=R=new ${this.getFuncModule(obj.constructor, true)}();`, - '}'); + '}', + ); obj._iN$t = { globalVar: 'R' }; this.objsToClear_iN$t.push(obj); this.enumerateObject(this.codeArray, obj); diff --git a/cocos/serialization/instantiate.ts b/cocos/serialization/instantiate.ts index 9e0cd362083..b95965e8282 100644 --- a/cocos/serialization/instantiate.ts +++ b/cocos/serialization/instantiate.ts @@ -28,7 +28,8 @@ import { getError, warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { js } from '@base/utils'; import { isDomNode } from '@pal/utils'; -import { CCObject, isCCObject, ValueType, jsbUtils, isCCClassOrFastDefined } from '../core'; +import { CCObject, isCCClassOrFastDefined, ValueType, isCCObject } from '@base/object'; +import { jsbUtils } from '../core'; import { Prefab } from '../scene-graph/prefab'; import { Node } from '../scene-graph/node'; import { Component } from '../scene-graph/component'; diff --git a/cocos/sorting/sorting-layers.ts b/cocos/sorting/sorting-layers.ts index f67355447b8..04298cbfe99 100644 --- a/cocos/sorting/sorting-layers.ts +++ b/cocos/sorting/sorting-layers.ts @@ -22,10 +22,10 @@ import { EDITOR } from 'internal:constants'; import { errorID } from '@base/debug'; +import { Enum } from '@base/object'; import { director } from '../game/director'; import { Game, game } from '../game'; import { Settings, settings } from '../core/settings'; -import { Enum } from '../core/value-types'; interface SortingItem { id: number; diff --git a/cocos/spine/index.jsb.ts b/cocos/spine/index.jsb.ts index 2b064dcd567..48710fc3438 100644 --- a/cocos/spine/index.jsb.ts +++ b/cocos/spine/index.jsb.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { ccenum } from '../core'; +import { ccenum } from '@base/object'; import { cclegacy } from '@base/global'; /** diff --git a/cocos/spine/index.ts b/cocos/spine/index.ts index 07eebe563d8..15325d9c68b 100644 --- a/cocos/spine/index.ts +++ b/cocos/spine/index.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { ccenum } from '../core'; +import { ccenum } from '@base/object'; import spine from './lib/spine-core'; /** diff --git a/cocos/spine/skeleton-data.ts b/cocos/spine/skeleton-data.ts index d862cc82d5a..e554accfe0d 100644 --- a/cocos/spine/skeleton-data.ts +++ b/cocos/spine/skeleton-data.ts @@ -25,7 +25,7 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { error } from '@base/debug'; import { cclegacy } from '@base/global'; -import { CCString, Enum } from '../core'; +import { CCString, Enum } from '@base/object'; import SkeletonCache from './skeleton-cache'; import { Skeleton } from './skeleton'; import spine from './lib/spine-core.js'; diff --git a/cocos/spine/skeleton.ts b/cocos/spine/skeleton.ts index 181bc6138b2..9ce673699a2 100644 --- a/cocos/spine/skeleton.ts +++ b/cocos/spine/skeleton.ts @@ -26,10 +26,11 @@ import { ccclass, executeInEditMode, help, menu, serializable, type, displayName import { error, logID, warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { js, memop } from '@base/utils'; +import { Enum, ccenum, CCObject, setPropertyEnumType } from '@base/object'; +import { EnumType } from '@base/object/internal'; import { Material, Texture2D } from '../asset/assets'; -import { Enum, EnumType, ccenum } from '../core/value-types/enum'; import { Node } from '../scene-graph'; -import { CCObject, Color } from '../core'; +import { Color } from '../core'; import { SkeletonData } from './skeleton-data'; import { Graphics, UIRenderer } from '../2d'; import { Batcher2D } from '../2d/renderer/batcher-2d'; @@ -44,7 +45,6 @@ import spine from './lib/spine-core.js'; import { VertexEffectDelegate } from './vertex-effect-delegate'; import SkeletonCache, { AnimationCache, AnimationFrame } from './skeleton-cache'; import { TrackEntryListeners } from './track-entry-listeners'; -import { setPropertyEnumType } from '../core/internal-index'; const spineTag = SPINE_WASM; const CachedFrameTime = 1 / 60; diff --git a/cocos/terrain/terrain.ts b/cocos/terrain/terrain.ts index 235b3bc8461..fba83836298 100644 --- a/cocos/terrain/terrain.ts +++ b/cocos/terrain/terrain.ts @@ -25,6 +25,7 @@ import { ccclass, disallowMultiple, executeInEditMode, help, visible, type, serializable, editable, disallowAnimation } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; import { cclegacy } from '@base/global'; +import { CCObject, CCFloat, isValid } from '@base/object'; import { builtinResMgr } from '../asset/asset-manager'; import { ModelRenderer } from '../misc/model-renderer'; import { EffectAsset, Texture2D } from '../asset/assets'; @@ -32,7 +33,6 @@ import { Filter, PixelFormat, WrapMode } from '../asset/assets/asset-enum'; import { Material } from '../asset/assets/material'; import { RenderingSubMesh } from '../asset/assets/rendering-sub-mesh'; import { Component } from '../scene-graph/component'; -import { CCObject, isValid } from '../core/data/object'; import { director } from '../game/director'; import { AttributeName, BufferUsageBit, Format, MemoryUsageBit, PrimitiveMode, Attribute, Buffer, BufferInfo, deviceManager, Texture } from '../gfx'; import { clamp, Rect, Size, Vec2, Vec3, Vec4 } from '../core/math'; @@ -41,7 +41,6 @@ import { Pass, scene } from '../render-scene'; import { Camera } from '../render-scene/scene/camera'; import { Root } from '../root'; import { HeightField } from './height-field'; -import { CCFloat } from '../core'; import { TerrainLod, TerrainLodKey, TERRAIN_LOD_LEVELS, TERRAIN_LOD_MAX_DISTANCE, TerrainIndexData } from './terrain-lod'; import { TerrainAsset, TerrainLayerInfo, TERRAIN_HEIGHT_BASE, TERRAIN_HEIGHT_FACTORY, TERRAIN_BLOCK_TILE_COMPLEXITY, TERRAIN_BLOCK_VERTEX_SIZE, TERRAIN_BLOCK_VERTEX_COMPLEXITY, TERRAIN_MAX_LAYER_COUNT, TERRAIN_HEIGHT_FMIN, TERRAIN_HEIGHT_FMAX, TERRAIN_MAX_BLEND_LAYERS, TERRAIN_DATA_VERSION5 } from './terrain-asset'; import { PipelineEventType } from '../rendering'; diff --git a/cocos/tiledmap/tiled-map-asset.ts b/cocos/tiledmap/tiled-map-asset.ts index 02e52d9e04c..c113da58c32 100644 --- a/cocos/tiledmap/tiled-map-asset.ts +++ b/cocos/tiledmap/tiled-map-asset.ts @@ -24,8 +24,9 @@ */ import { ccclass, type, serializable } from 'cc.decorator'; +import { CCString } from '@base/object'; import { Asset } from '../asset/assets/asset'; -import { CCString, Size } from '../core'; +import { Size } from '../core'; import { SpriteFrame } from '../2d/assets'; import { TextAsset } from '../asset/assets'; diff --git a/cocos/tiledmap/tiled-object-group.ts b/cocos/tiledmap/tiled-object-group.ts index e2a30164f93..477ee959b63 100644 --- a/cocos/tiledmap/tiled-object-group.ts +++ b/cocos/tiledmap/tiled-object-group.ts @@ -24,6 +24,7 @@ */ import { ccclass, help, type, requireComponent } from 'cc.decorator'; +import { CCBoolean, CCObject } from '@base/object'; import { Component } from '../scene-graph/component'; import { Sprite } from '../2d/components/sprite'; import { Label } from '../2d/components/label'; @@ -32,7 +33,7 @@ import { BlendFactor } from '../gfx'; import { TMXMapInfo } from './tmx-xml-parser'; import { TiledTextureGrids, GID, TileFlag, Orientation, StaggerAxis, TMXObjectType, PropertiesInfo, TiledAnimationType, TMXObject, TMXObjectGroupInfo } from './tiled-types'; import { UITransform } from '../2d/framework/ui-transform'; -import { CCBoolean, Vec2, Color, CCObject } from '../core'; +import { Vec2, Color } from '../core'; import { SpriteFrame } from '../2d/assets'; import { Node } from '../scene-graph/node'; diff --git a/cocos/tiledmap/tiled-tile.ts b/cocos/tiledmap/tiled-tile.ts index 26374fcfcca..10a8f67635f 100644 --- a/cocos/tiledmap/tiled-tile.ts +++ b/cocos/tiledmap/tiled-tile.ts @@ -35,9 +35,9 @@ import { ccclass, executeInEditMode, help, menu, requireComponent, type } from 'cc.decorator'; import { warn } from '@base/debug'; +import { CCInteger } from '@base/object'; import { Component } from '../scene-graph/component'; import { TiledLayer } from './tiled-layer'; -import { CCInteger } from '../core'; import { UITransform } from '../2d/framework'; import { NodeEventType } from '../scene-graph/node-event'; diff --git a/cocos/tiledmap/tiled-types.ts b/cocos/tiledmap/tiled-types.ts index d87427b9fbf..be37d29d58b 100644 --- a/cocos/tiledmap/tiled-types.ts +++ b/cocos/tiledmap/tiled-types.ts @@ -22,9 +22,9 @@ THE SOFTWARE. */ +import { ccenum } from '@base/object'; import { Color, Rect, Size, Vec2 } from '../core'; import { SpriteFrame } from '../2d/assets'; -import { ccenum } from '../core/value-types/enum'; import { HorizontalTextAlignment, VerticalTextAlignment } from '../2d/components/label'; import { Texture2D } from '../asset/assets'; diff --git a/cocos/tween/actions/action-manager.ts b/cocos/tween/actions/action-manager.ts index eadbcf66c1c..04158ac862b 100644 --- a/cocos/tween/actions/action-manager.ts +++ b/cocos/tween/actions/action-manager.ts @@ -27,9 +27,9 @@ import { errorID, logID } from '@base/debug'; import { cclegacy } from '@base/global'; +import { isCCObject } from '@base/object'; import { Action } from './action'; import { Node } from '../../scene-graph'; -import { isCCObject } from '../../core/data/object'; import type { ActionInterval } from './action-interval'; let ID_COUNTER = 0; diff --git a/cocos/ui/button.ts b/cocos/ui/button.ts index e3c7d51af76..1843560a068 100644 --- a/cocos/ui/button.ts +++ b/cocos/ui/button.ts @@ -26,12 +26,12 @@ import { ccclass, help, executionOrder, menu, requireComponent, tooltip, displayOrder, type, rangeMin, rangeMax, serializable, executeInEditMode } from 'cc.decorator'; import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { SpriteFrame } from '../2d/assets'; import { Component, EventHandler as ComponentEventHandler } from '../scene-graph'; import { UITransform, UIRenderer } from '../2d/framework'; import { EventMouse, EventTouch } from '../input/types'; import { Color, Vec3 } from '../core/math'; -import { ccenum } from '../core/value-types/enum'; import { lerp } from '../core/math/utils'; import { Node } from '../scene-graph/node'; import { Sprite } from '../2d/components/sprite'; diff --git a/cocos/ui/editbox/types.ts b/cocos/ui/editbox/types.ts index 709136b9cf1..a33db0e333d 100644 --- a/cocos/ui/editbox/types.ts +++ b/cocos/ui/editbox/types.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { Enum } from '../../core/value-types'; +import { Enum } from '@base/object'; /** * 键盘的返回键类型。 * @readonly diff --git a/cocos/ui/layout.ts b/cocos/ui/layout.ts index d6fa8a0b20c..9b46dde20a9 100644 --- a/cocos/ui/layout.ts +++ b/cocos/ui/layout.ts @@ -26,9 +26,9 @@ import { ccclass, help, executeInEditMode, executionOrder, menu, requireComponent, tooltip, type, displayOrder, serializable, visible } from 'cc.decorator'; import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { Component } from '../scene-graph/component'; import { Size, Vec2, Vec3 } from '../core/math'; -import { ccenum } from '../core/value-types/enum'; import { UITransform } from '../2d/framework/ui-transform'; import { director, Director } from '../game/director'; import { TransformBit } from '../scene-graph/node-enum'; diff --git a/cocos/ui/page-view-indicator.ts b/cocos/ui/page-view-indicator.ts index 187638fa7b1..95ad19934c5 100644 --- a/cocos/ui/page-view-indicator.ts +++ b/cocos/ui/page-view-indicator.ts @@ -25,10 +25,10 @@ import { ccclass, help, executionOrder, menu, tooltip, type, serializable } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { SpriteFrame } from '../2d/assets'; import { Component } from '../scene-graph/component'; import { Color, Size } from '../core/math'; -import { ccenum } from '../core/value-types/enum'; import { Node } from '../scene-graph'; import { Layout } from './layout'; import { PageView } from './page-view'; diff --git a/cocos/ui/page-view.ts b/cocos/ui/page-view.ts index 80dcfd229f2..d1fc43f8402 100644 --- a/cocos/ui/page-view.ts +++ b/cocos/ui/page-view.ts @@ -27,10 +27,10 @@ import { ccclass, help, executionOrder, menu, tooltip, type, slide, range, visib import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { warnID, logID } from '@base/debug'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { EventHandler as ComponentEventHandler, Node } from '../scene-graph'; import { EventTouch } from '../input/types'; import { Vec2, Vec3 } from '../core/math'; -import { ccenum } from '../core/value-types/enum'; import { Layout } from './layout'; import { PageViewIndicator } from './page-view-indicator'; import { ScrollView, EventType as ScrollEventType } from './scroll-view'; diff --git a/cocos/ui/progress-bar.ts b/cocos/ui/progress-bar.ts index 6a14aeaeb52..613a03a136f 100644 --- a/cocos/ui/progress-bar.ts +++ b/cocos/ui/progress-bar.ts @@ -26,10 +26,10 @@ import { ccclass, help, executionOrder, menu, requireComponent, tooltip, type, range, slide, serializable } from 'cc.decorator'; import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; +import { Enum } from '@base/object'; import { Component } from '../scene-graph/component'; import { UITransform } from '../2d/framework'; import { Size, Vec2, Vec3 } from '../core/math'; -import { Enum } from '../core/value-types'; import { clamp01 } from '../core/math/utils'; import { Sprite } from '../2d/components/sprite'; diff --git a/cocos/ui/scroll-bar.ts b/cocos/ui/scroll-bar.ts index ca156ff41ed..2fa891d0d15 100644 --- a/cocos/ui/scroll-bar.ts +++ b/cocos/ui/scroll-bar.ts @@ -25,10 +25,10 @@ import { ccclass, help, executionOrder, menu, requireComponent, tooltip, displayOrder, type, serializable } from 'cc.decorator'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { Component } from '../scene-graph/component'; import { UITransform } from '../2d/framework'; import { Color, Size, Vec2, Vec3 } from '../core/math'; -import { ccenum } from '../core/value-types/enum'; import { clamp01 } from '../core/math/utils'; import { ScrollView } from './scroll-view'; import { Sprite } from '../2d/components/sprite'; diff --git a/cocos/ui/slider.ts b/cocos/ui/slider.ts index ae8a82246d5..f7e47a96a5b 100644 --- a/cocos/ui/slider.ts +++ b/cocos/ui/slider.ts @@ -26,11 +26,11 @@ import { ccclass, help, executionOrder, menu, requireComponent, tooltip, type, slide, range, serializable } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { Component, EventHandler } from '../scene-graph'; import { UITransform } from '../2d/framework'; import { EventTouch, Touch } from '../input/types'; import { Vec3 } from '../core/math'; -import { ccenum } from '../core/value-types/enum'; import { clamp01 } from '../core/math/utils'; import { Sprite } from '../2d/components/sprite'; import { NodeEventType } from '../scene-graph/node-event'; diff --git a/cocos/ui/sub-context-view.ts b/cocos/ui/sub-context-view.ts index 43a21feb0b5..8428126925e 100644 --- a/cocos/ui/sub-context-view.ts +++ b/cocos/ui/sub-context-view.ts @@ -27,6 +27,7 @@ import { EDITOR, WECHAT, WECHAT_MINI_PROGRAM } from 'internal:constants'; import { minigame } from 'pal/minigame'; import { screenAdapter } from 'pal/screen-adapter'; import { cclegacy } from '@base/global'; +import { CCObject } from '@base/object'; import { Component } from '../scene-graph/component'; import { view } from './view'; import { Sprite } from '../2d/components/sprite'; @@ -36,7 +37,6 @@ import { SpriteFrame } from '../2d/assets'; import { ImageAsset } from '../asset/assets/image-asset'; import { Size } from '../core/math'; -import { CCObject } from '../core'; import { NodeEventType } from '../scene-graph/node-event'; import { Texture2D } from '../asset/assets'; diff --git a/cocos/ui/view.ts b/cocos/ui/view.ts index e523d6725ad..7b084d800f7 100644 --- a/cocos/ui/view.ts +++ b/cocos/ui/view.ts @@ -25,7 +25,6 @@ THE SOFTWARE. */ -import '../core/data/class'; import { MINIGAME, JSB, RUNTIME_BASED, EDITOR } from 'internal:constants'; import { screenAdapter } from 'pal/screen-adapter'; import { errorID } from '@base/debug'; diff --git a/cocos/ui/widget.ts b/cocos/ui/widget.ts index ab8698bd6d3..90b8fa1f48f 100644 --- a/cocos/ui/widget.ts +++ b/cocos/ui/widget.ts @@ -27,9 +27,10 @@ import { ccclass, help, executeInEditMode, executionOrder, menu, requireComponen import { EDITOR, DEV, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; +import { ccenum } from '@base/object'; import { Component } from '../scene-graph/component'; import { UITransform } from '../2d/framework/ui-transform'; -import { Size, Vec2, Vec3, visibleRect, ccenum, Rect } from '../core'; +import { Size, Vec2, Vec3, visibleRect, Rect } from '../core'; import { View } from './view'; import { Scene } from '../scene-graph'; import { Node } from '../scene-graph/node'; diff --git a/cocos/video/video-player-enums.ts b/cocos/video/video-player-enums.ts index 21c5fc0ad57..01cc7d56740 100644 --- a/cocos/video/video-player-enums.ts +++ b/cocos/video/video-player-enums.ts @@ -26,7 +26,7 @@ * @en Enum for video resource type. * @zh 视频资源类型枚举。 */ -import { Enum } from '../core/value-types'; +import { Enum } from '@base/object'; export const ResourceType = Enum({ /** diff --git a/editor/src/marionette/get-variable-value-attributes.ts b/editor/src/marionette/get-variable-value-attributes.ts index 5c2d4546ed4..33212b27e02 100644 --- a/editor/src/marionette/get-variable-value-attributes.ts +++ b/editor/src/marionette/get-variable-value-attributes.ts @@ -1,7 +1,7 @@ import { js } from '@base/utils'; +import { CCClass, CCInteger } from '@base/object'; import { CLASS_NAME_PREFIX_ANIM } from '../../../cocos/animation/define'; import { ccclass, property } from '../../../cocos/core/data/class-decorator'; -import { CCClass, CCInteger } from '../../../exports/base'; import { VariableDescription, VariableType } from '../../exports/new-gen-anim'; @ccclass(`${CLASS_NAME_PREFIX_ANIM}internal/VariableValueAttributeRegistry`) diff --git a/editor/src/marionette/pose-graph-editor-api.ts b/editor/src/marionette/pose-graph-editor-api.ts index 3aa62ad8ae2..d4d6189563d 100644 --- a/editor/src/marionette/pose-graph-editor-api.ts +++ b/editor/src/marionette/pose-graph-editor-api.ts @@ -1,20 +1,17 @@ import { assertIsTrue } from '@base/debug/internal'; -import { PoseGraphNode } from "../../../cocos/animation/marionette/pose-graph/foundation/pose-graph-node"; -import { - getPoseGraphNodeEditorMetadata, PoseGraphCreateNodeContext, PoseGraphNodeAppearanceOptions, -} from "../../../cocos/animation/marionette/pose-graph/foundation/authoring/node-authoring"; -import { Layer, poseGraphOp } from "../../exports/new-gen-anim"; -import { instantiate } from "../../../cocos/serialization"; -import { PoseGraphOutputNode } from "../../../cocos/animation/marionette/pose-graph/graph-output-node"; -import { PoseNode } from "../../../cocos/animation/marionette/pose-graph/pose-node"; -import { PureValueNode } from "../../../cocos/animation/marionette/pose-graph/pure-value-node"; -import { editorExtrasTag } from "../../../exports/base"; +import { editorExtrasTag, attr } from '@base/object'; +import { PoseGraphNode } from '../../../cocos/animation/marionette/pose-graph/foundation/pose-graph-node'; +import { getPoseGraphNodeEditorMetadata, PoseGraphCreateNodeContext, PoseGraphNodeAppearanceOptions } from '../../../cocos/animation/marionette/pose-graph/foundation/authoring/node-authoring'; +import { Layer, poseGraphOp } from '../../exports/new-gen-anim'; +import { instantiate } from '../../../cocos/serialization'; +import { PoseGraphOutputNode } from '../../../cocos/animation/marionette/pose-graph/graph-output-node'; +import { PoseNode } from '../../../cocos/animation/marionette/pose-graph/pose-node'; +import { PureValueNode } from '../../../cocos/animation/marionette/pose-graph/pure-value-node'; import { PoseNodeUseStashedPose } from '../../../cocos/animation/marionette/pose-graph/pose-nodes/use-stashed-pose'; -import { PoseGraphStash, StateMachine } from "../../../cocos/animation/marionette/animation-graph"; -import { PoseNodeLocation, visitPoseNodeInLayer } from "./visit/visit-pose-node"; +import { PoseGraphStash, StateMachine } from '../../../cocos/animation/marionette/animation-graph'; +import { PoseNodeLocation, visitPoseNodeInLayer } from './visit/visit-pose-node'; import { PoseGraph } from '../../../cocos/animation/marionette/pose-graph/pose-graph'; -import { PoseNodeStateMachine } from "../../../cocos/animation/marionette/pose-graph/pose-nodes/state-machine"; -import { attr } from "../../../cocos/core/data/utils/attribute"; +import { PoseNodeStateMachine } from '../../../cocos/animation/marionette/pose-graph/pose-nodes/state-machine'; type Constructor = new (...args: any[]) => T; diff --git a/editor/src/marionette/state-machine-operation.ts b/editor/src/marionette/state-machine-operation.ts index 4f77f89627a..b7f9bb84a49 100644 --- a/editor/src/marionette/state-machine-operation.ts +++ b/editor/src/marionette/state-machine-operation.ts @@ -1,18 +1,9 @@ -import { assertIsTrue } from "@base/debug/internal"; -import { - EmptyStateTransition, - State, - StateMachine, - Transition, - isAnimationTransition, - EmptyState, - SubStateMachine, - ProceduralPoseState, -} from "../../../cocos/animation/marionette/animation-graph"; -import { cloneAnimationGraphEditorExtrasFrom } from "../../../cocos/animation/marionette/animation-graph-editor-extras-clone-helper"; -import { MotionState } from "../../../cocos/animation/marionette/state-machine/motion-state"; -import { editorExtrasTag } from "../../../exports/base"; -import { copyPoseGraphNodes, pastePoseGraphNodes } from "../../exports/new-gen-anim"; +import { assertIsTrue } from '@base/debug/internal'; +import { editorExtrasTag } from '@base/object'; +import { EmptyStateTransition, State, StateMachine, Transition, isAnimationTransition, EmptyState, SubStateMachine, ProceduralPoseState } from '../../../cocos/animation/marionette/animation-graph'; +import { cloneAnimationGraphEditorExtrasFrom } from '../../../cocos/animation/marionette/animation-graph-editor-extras-clone-helper'; +import { MotionState } from '../../../cocos/animation/marionette/state-machine/motion-state'; +import { copyPoseGraphNodes, pastePoseGraphNodes } from '../../exports/new-gen-anim'; function copyTransitionConditions(lhs: Transition, rhs: Transition) { lhs.conditions = rhs.conditions.map((condition) => condition.clone()); diff --git a/editor/src/marionette/visit.ts b/editor/src/marionette/visit.ts index 12bf082ece7..2634ec6c8c8 100644 --- a/editor/src/marionette/visit.ts +++ b/editor/src/marionette/visit.ts @@ -1,21 +1,16 @@ -import { AnimationClip } from "../../../cocos/animation/animation-clip"; -import { Motion, ClipMotion, AnimationBlend1D, AnimationBlend2D, AnimationBlendDirect } from "../../../cocos/animation/marionette/motion"; -import { AnimationController } from "../../../cocos/animation/marionette/animation-controller"; -import { - StateMachine, - SubStateMachine, - AnimationGraph, - ProceduralPoseState, -} from "../../../cocos/animation/marionette/animation-graph"; -import { MotionState } from "../../../cocos/animation/marionette/state-machine/motion-state"; -import { EditorExtendableObject } from "../../../cocos/core/data/editor-extras-tag"; -import { PoseGraphNode } from "../../../cocos/animation/marionette/pose-graph/foundation/pose-graph-node"; +import { EditorExtendableObject } from '@base/object'; +import { AnimationClip } from '../../../cocos/animation/animation-clip'; +import { Motion, ClipMotion, AnimationBlend1D, AnimationBlend2D, AnimationBlendDirect } from '../../../cocos/animation/marionette/motion'; +import { AnimationController } from '../../../cocos/animation/marionette/animation-controller'; +import { StateMachine, SubStateMachine, AnimationGraph, ProceduralPoseState } from '../../../cocos/animation/marionette/animation-graph'; +import { MotionState } from '../../../cocos/animation/marionette/state-machine/motion-state'; +import { PoseGraphNode } from '../../../cocos/animation/marionette/pose-graph/foundation/pose-graph-node'; import { PoseNodeStateMachine } from '../../../cocos/animation/marionette/pose-graph/pose-nodes/state-machine'; -import { PoseNodePlayMotion } from "../../../cocos/animation/marionette/pose-graph/pose-nodes/play-motion"; -import { PoseNodeSampleMotion } from "../../../cocos/animation/marionette/pose-graph/pose-nodes/sample-motion"; -import { PoseGraph } from "../../../cocos/animation/marionette/pose-graph/pose-graph"; -import { AnimationGraphVariant } from "../../../cocos/animation/marionette/animation-graph-variant"; +import { PoseNodePlayMotion } from '../../../cocos/animation/marionette/pose-graph/pose-nodes/play-motion'; +import { PoseNodeSampleMotion } from '../../../cocos/animation/marionette/pose-graph/pose-nodes/sample-motion'; +import { PoseGraph } from '../../../cocos/animation/marionette/pose-graph/pose-graph'; +import { AnimationGraphVariant } from '../../../cocos/animation/marionette/animation-graph-variant'; export function* visitAnimationGraphEditorExtras(animationGraph: AnimationGraph): Generator { for (const layer of animationGraph.layers) { diff --git a/exports/base.ts b/exports/base.ts index 96fb0686530..ae857cd3d84 100644 --- a/exports/base.ts +++ b/exports/base.ts @@ -36,6 +36,7 @@ export * from '../cocos/core'; export * from '@base/utils'; export { cclegacy, VERSION } from '@base/global'; export { debug, log, error, warn, assert, logID, errorID, warnID, assertID, isDisplayStats, setDisplayStats, getError, DebugMode } from '@base/debug'; +export { BitMask, Enum, ccenum, ValueType, CCClass, isCCClassOrFastDefined, CCObject, CCInteger, CCFloat, CCBoolean, CCString, editorExtrasTag, setPropertyEnumType, setPropertyEnumTypeOnAttrs, isCCObject, isValid } from '@base/object'; export * from '../cocos/rendering'; export * from '../cocos/rendering/custom/builtin-pipelines'; diff --git a/package-lock.json b/package-lock.json index aa366fcbd6b..de22c4a566a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -96,7 +96,13 @@ "version": "1.0.0", "license": "MIT" }, + "cocos/base/object": { + "name": "@base/object", + "version": "1.0.0", + "license": "MIT" + }, "cocos/base/utils": { + "name": "@base/utils", "version": "1.0.0", "license": "MIT" }, @@ -1826,6 +1832,10 @@ "resolved": "cocos/base/global", "link": true }, + "node_modules/@base/object": { + "resolved": "cocos/base/object", + "link": true + }, "node_modules/@base/utils": { "resolved": "cocos/base/utils", "link": true diff --git a/tests/animation/animaion-clip-migration-3.x.test.ts b/tests/animation/animaion-clip-migration-3.x.test.ts index 5435fe58e11..35dcf61ab35 100644 --- a/tests/animation/animaion-clip-migration-3.x.test.ts +++ b/tests/animation/animaion-clip-migration-3.x.test.ts @@ -1,5 +1,5 @@ import { SpriteFrame } from "../../cocos/2d/assets"; -import { math, RealInterpolationMode } from "../../cocos/core"; +import { math, RealInterpolationMode , BezierControlPoints, bezierByTime } from "../../cocos/core"; import { AnimationClip, animation} from "../../cocos/animation"; import { ColorTrack, IValueProxyFactory, RealTrack, Track, TrackPath, VectorTrack } from "../../cocos/animation/animation"; import { LegacyClipCurve, LegacyCommonTarget, LegacyEasingMethod, timeBezierToTangents } from "../../cocos/animation/legacy-clip-data"; @@ -8,7 +8,6 @@ import { RealChannel } from "../../cocos/animation/tracks/track"; import { UntypedTrack } from "../../cocos/animation/tracks/untyped-track"; import { EasingMethod, ExtrapolationMode, RealCurve, TangentWeightMode } from "../../cocos/core/curves/curve"; import { createMultipleRealKeyframesWithoutTangent, createRealKeyframeValueLike } from "../curves/curve-test-utils"; -import { BezierControlPoints, bezierByTime } from "../../cocos/core" class ValueProxyFactorFoo implements IValueProxyFactory { forTarget(_target: any): animation.IValueProxy { diff --git a/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts b/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts index e82f76e6e2c..d9e467b09b9 100644 --- a/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts +++ b/tests/animation/new-gen-anim/pose-graph/pose-graph-authoring.test.ts @@ -1,5 +1,6 @@ import { assertIsTrue } from '@base/debug/internal'; import { js } from '@base/utils'; +import { attr } from '@base/object'; import { Pose } from '../../../../cocos/animation/core/pose'; import { AnimationGraph, PoseGraph } from '../../../../cocos/animation/marionette/asset-creation'; import { lerp, quat, v3, Vec3 } from '../../../../cocos/core'; @@ -16,7 +17,6 @@ import { PoseGraphNodeEditorMetadata, getPoseGraphNodeEditorMetadata } from '../ import { composeInputKeyInternally, createPoseGraph, getTheOnlyInputKey, getTheOnlyOutputKey, normalizeNodeInputMetadata, UnimplementedPoseNode, UnimplementedPVNode } from './utils/misc'; import { PoseNode } from '../../../../cocos/animation/marionette/pose-graph/pose-node'; import { ccclass } from '../../../../cocos/core/data/class-decorator'; -import { attr } from '../../../../cocos/core/data/utils/attribute'; const { unregisterClass } = js; diff --git a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/blend-in-proportion-factory.ts b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/blend-in-proportion-factory.ts index f0406a75c36..aa15e377257 100644 --- a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/blend-in-proportion-factory.ts +++ b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/blend-in-proportion-factory.ts @@ -2,7 +2,6 @@ import { PoseNodeBlendInProportion } from '../../../../../../../cocos/animation/marionette/pose-graph/pose-nodes/blend-in-proportion'; import { connectNode } from '../../../../../../../cocos/animation/marionette/pose-graph/op/internal'; import { poseGraphOp } from '../../../../../../../cocos/animation/marionette/pose-graph/op'; -import '../../../../utils/factory'; import { addPoseNodeFactory, createPoseNode, PoseNodeParams } from '../../../../utils/factory'; declare global { diff --git a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/motion-node-factory.ts b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/motion-node-factory.ts index ead01056b56..3a825a8d14f 100644 --- a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/motion-node-factory.ts +++ b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/motion-node-factory.ts @@ -1,7 +1,6 @@ import { Motion } from '../../../../../../../cocos/animation/marionette/motion'; import { PoseNodePlayMotion } from '../../../../../../../cocos/animation/marionette/pose-graph/pose-nodes/play-motion'; -import '../../../../utils/factory'; import { addPoseNodeFactory, createMotion, MotionParams } from '../../../../utils/factory'; declare global { diff --git a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/state-machine-node-factory.ts b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/state-machine-node-factory.ts index 1fe73fcdec0..ea80739c925 100644 --- a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/state-machine-node-factory.ts +++ b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/state-machine-node-factory.ts @@ -1,4 +1,3 @@ -import '../../../../utils/factory'; import { addPoseNodeFactory, createMotion, fillStateMachine, MotionParams, StateMachineParams } from '../../../../utils/factory'; import { PoseNodeStateMachine } from '../../../../../../../cocos/animation/marionette/pose-graph/pose-nodes/state-machine'; diff --git a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/use-stash-factory.ts b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/use-stash-factory.ts index c1faf9f77c3..70f5a471479 100644 --- a/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/use-stash-factory.ts +++ b/tests/animation/new-gen-anim/pose-graph/pose-nodes/utils/factories/use-stash-factory.ts @@ -1,6 +1,5 @@ import { PoseNodeUseStashedPose } from '../../../../../../../cocos/animation/marionette/pose-graph/pose-nodes/use-stashed-pose'; -import '../../../../utils/factory'; import { addPoseNodeFactory } from '../../../../utils/factory'; declare global { diff --git a/tests/animation/skeletal-animation.test.ts b/tests/animation/skeletal-animation.test.ts index a73c9cac0ed..6aa7062b73c 100644 --- a/tests/animation/skeletal-animation.test.ts +++ b/tests/animation/skeletal-animation.test.ts @@ -1,7 +1,7 @@ +import { CCObject } from '@base/object'; import { SkeletalAnimationState } from '../../cocos/3d/skeletal-animation/skeletal-animation-state'; import { SkeletalAnimation } from '../../cocos/3d/skeletal-animation/skeletal-animation'; -import { CCObject } from '../../cocos/core'; import { AnimationClip } from '../../cocos/animation/animation-clip'; import { VectorTrack } from '../../cocos/animation/animation'; import { JointAnimationInfo } from '../../cocos/3d/skeletal-animation/skeletal-animation-utils'; diff --git a/tests/asset-manager/finalizer.test.ts b/tests/asset-manager/finalizer.test.ts index 33145019bf3..0a05b4360f0 100644 --- a/tests/asset-manager/finalizer.test.ts +++ b/tests/asset-manager/finalizer.test.ts @@ -1,10 +1,10 @@ -import { SpriteFrame } from "../../cocos/2d/assets/sprite-frame"; -import { Sprite } from "../../cocos/2d/components/sprite"; -import { assetManager, loader } from "../../cocos/asset/asset-manager"; -import { releaseManager } from "../../cocos/asset/asset-manager/release-manager"; -import { Texture2D } from "../../cocos/asset/assets/texture-2d"; -import { isValid } from "../../cocos/core/data/object"; -import { Scene, Node } from "../../cocos/scene-graph"; +import { isValid } from '@base/object'; +import { SpriteFrame } from '../../cocos/2d/assets/sprite-frame'; +import { Sprite } from '../../cocos/2d/components/sprite'; +import { assetManager, loader } from '../../cocos/asset/asset-manager'; +import { releaseManager } from '../../cocos/asset/asset-manager/release-manager'; +import { Texture2D } from '../../cocos/asset/assets/texture-2d'; +import { Scene, Node } from '../../cocos/scene-graph'; describe('releaseManager', () => { diff --git a/tests/core/attribute.test.ts b/tests/core/attribute.test.ts index 44efa8dc065..25e817033f5 100644 --- a/tests/core/attribute.test.ts +++ b/tests/core/attribute.test.ts @@ -1,5 +1,5 @@ import { js } from '@base/utils'; -import { CCClass } from '../../cocos/core/data/class'; +import { CCClass } from '@base/object'; describe('Attribute', function () { test('base', function () { diff --git a/tests/core/callbacks-invoker.test.ts b/tests/core/callbacks-invoker.test.ts index e46aff39538..e050f85ee20 100644 --- a/tests/core/callbacks-invoker.test.ts +++ b/tests/core/callbacks-invoker.test.ts @@ -1,8 +1,8 @@ +import { CCObject } from '@base/object'; import { CallbacksInvoker } from '../../cocos/core/event/callbacks-invoker'; import { Event } from '../../cocos/input/types'; import { Node } from '../../cocos/scene-graph/node'; import { Component } from '../../cocos/scene-graph/component'; -import { CCObject } from '../../cocos/core/data/object'; test('test', function () { let ci = new CallbacksInvoker(); diff --git a/tests/core/ccclass.test.ts b/tests/core/ccclass.test.ts index 64bb88de653..390a42eda08 100644 --- a/tests/core/ccclass.test.ts +++ b/tests/core/ccclass.test.ts @@ -1,8 +1,8 @@ import { ccclass } from 'cc.decorator'; import { warnID } from '@base/debug'; import { js } from '@base/utils'; +import { RF } from '@base/object'; import { float, property } from '../../cocos/core/data/class-decorator'; -import * as requiringFrame from '../../cocos/core/data/utils/requiring-frame'; import { Component } from '../../cocos/scene-graph/component'; const { getClassName, unregisterClass, getClassId } = js; @@ -107,7 +107,7 @@ describe('Class id & class name', () => { })(); if (withinRequiringFrame) { - requiringFrame.push( + RF.push( {}, // module FRAME_UUID, // uuid FRAME_NAME, // script @@ -128,7 +128,7 @@ describe('Class id & class name', () => { } if (withinRequiringFrame) { - requiringFrame.pop(); + RF.pop(); } try { diff --git a/tests/core/decorator.test.ts b/tests/core/decorator.test.ts index 13557c84b66..e5fe6b55b3d 100644 --- a/tests/core/decorator.test.ts +++ b/tests/core/decorator.test.ts @@ -1,12 +1,10 @@ import { js } from '@base/utils'; +import { CCClass, CCBoolean, CCFloat, CCInteger, CCString, PrimitiveType } from '@base/object'; import { getSerializationMetadata } from '../../cocos/core/data/serialization-metadata'; import { uniquelyReferenced } from '../../cocos/core/data/decorators/serializable'; import { visible, editable, tooltip, ccclass, serializable, formerlySerializedAs, readOnly, displayName, group, range, rangeMin, rangeMax, rangeStep, slide, displayOrder, unit, radian, multiline, disallowAnimation, editorOnly, type, float } from '../../cocos/core/data/decorators'; -import { CCClass } from '../../cocos/core/data/class'; import { property } from '../../cocos/core/data/decorators/property'; import { LegacyPropertyDecorator } from '../../cocos/core/data/decorators/utils'; -import { CCBoolean, CCFloat, CCInteger, CCString } from '../../exports/base'; -import { PrimitiveType } from '../../cocos/core/data/utils/attribute'; const { getClassByName, unregisterClass } = js; diff --git a/tests/core/deserialize.test.ts b/tests/core/deserialize.test.ts index f73b9aab0d3..ae4b00a7b8e 100644 --- a/tests/core/deserialize.test.ts +++ b/tests/core/deserialize.test.ts @@ -1,8 +1,7 @@ -import { CCClass, ccenum } from '../../cocos/core'; +import { CCClass, ccenum, BitMask } from '@base/object'; import { property } from '../../cocos/core/data/class-decorator'; import { ccclass, type } from '../../cocos/core/data/decorators'; import { deserialize } from '../../cocos/serialization/deserialize'; -import { BitMask } from '../../cocos/core/value-types/bitmask'; import './serialization/deserialize-common-tests'; describe('Deserialize', () => { diff --git a/tests/core/editor-extendable.test.ts b/tests/core/editor-extendable.test.ts index ad28a907e40..2c1f924a2b2 100644 --- a/tests/core/editor-extendable.test.ts +++ b/tests/core/editor-extendable.test.ts @@ -1,5 +1,5 @@ -import { EditorExtendable } from "../../cocos/core/data/editor-extendable"; -import { editorExtrasTag } from "../../cocos/core/data/editor-extras-tag"; +import { editorExtrasTag } from '@base/object'; +import { EditorExtendable } from '../../cocos/core/data/editor-extendable'; describe('Editor extendable', () => { test('Serialize', () => { diff --git a/tests/core/node.test.ts b/tests/core/node.test.ts index e1a53aaee2d..e18a1f30317 100644 --- a/tests/core/node.test.ts +++ b/tests/core/node.test.ts @@ -1,9 +1,9 @@ -import { find, Node, Scene, Component } from "../../cocos/scene-graph" -import { Mat4, Vec3 } from "../../cocos/core/math" -import { CCObject } from "../../cocos/core"; -import { NodeEventType } from "../../cocos/scene-graph/node-event"; -import { ccclass } from "../../cocos/core/data/decorators"; -import {director, game } from '../../cocos/game'; +import { CCObject } from '@base/object'; +import { find, Node, Scene, Component } from '../../cocos/scene-graph'; +import { Mat4, Vec3 } from '../../cocos/core/math'; +import { NodeEventType } from '../../cocos/scene-graph/node-event'; +import { ccclass } from '../../cocos/core/data/decorators'; +import { director, game } from '../../cocos/game'; describe(`Node`, () => { diff --git a/tests/core/serialization/deserialize-common-tests.ts b/tests/core/serialization/deserialize-common-tests.ts index b81c586e5c3..610ff7c512c 100644 --- a/tests/core/serialization/deserialize-common-tests.ts +++ b/tests/core/serialization/deserialize-common-tests.ts @@ -1,7 +1,6 @@ import { js } from '@base/utils'; -import { CCClass, ccenum } from '../../../cocos/core'; import { property } from '../../../cocos/core/data/class-decorator'; -import { ccclass, type } from '../../../cocos/core/data/decorators'; +import { ccclass } from '../../../cocos/core/data/decorators'; import { deserialize } from '../../../cocos/serialization/deserialize'; const { getClassId, unregisterClass } = js; diff --git a/tests/curves/curve.test.ts b/tests/curves/curve.test.ts index 0b26ef0b89b..10444059a3c 100644 --- a/tests/curves/curve.test.ts +++ b/tests/curves/curve.test.ts @@ -1,4 +1,5 @@ -import { editorExtrasTag, toRadian } from '../../cocos/core'; +import { editorExtrasTag } from '@base/object'; +import { toRadian } from '../../cocos/core'; import { RealCurve, RealInterpolationMode } from '../../cocos/core/curves'; import { EasingMethod, RealKeyframeValue } from '../../cocos/core/curves/curve'; import { ExtrapolationMode, TangentWeightMode } from '../../cocos/core/curves/real-curve-param'; diff --git a/tests/init.ts b/tests/init.ts index 67033a56409..116e7ca4027 100644 --- a/tests/init.ts +++ b/tests/init.ts @@ -73,6 +73,18 @@ jest.mock( { virtual: true, }, ); +jest.mock( + '@base/object', + () => jest.requireActual('../cocos/base/object/src/index.ts'), + { virtual: true, }, +); + +jest.mock( + '@base/object/internal', + () => jest.requireActual('../cocos/base/object/src/internal-index.ts'), + { virtual: true, }, +); + jest.mock( 'pal/pacer', () => jest.requireActual('../pal/pacer/pacer-web'), @@ -164,7 +176,6 @@ jest.mock('serialization-test-helper/run-test', () => { virtual: true, }); -import '../exports/base'; import { DebugMode } from '@base/debug'; import { EffectAsset, Game, game, IGameConfig } from '../exports/base'; import './asset-manager/init'; diff --git a/tests/physics2d/utilis.ts b/tests/physics2d/utilis.ts index 662cddad44c..bdee8eeedbd 100644 --- a/tests/physics2d/utilis.ts +++ b/tests/physics2d/utilis.ts @@ -1,5 +1,6 @@ -import { Vec2, IVec2Like, isValid } from "../../cocos/core"; -import * as physics2d from "../../exports/physics-2d-framework"; +import { isValid } from '@base/object'; +import { Vec2, IVec2Like } from '../../cocos/core'; +import * as physics2d from '../../exports/physics-2d-framework'; /** * This function is used to test physics2d utils diff --git a/tests/scene-graph/layers.test.ts b/tests/scene-graph/layers.test.ts index 304d58878ab..344d0275ff4 100644 --- a/tests/scene-graph/layers.test.ts +++ b/tests/scene-graph/layers.test.ts @@ -1,5 +1,5 @@ +import { attr } from '@base/object'; import { ccclass, property } from '../../cocos/core/data/class-decorator'; -import { attr } from '../../cocos/core/data/utils/attribute'; import { Layers } from '../../cocos/scene-graph/layers'; @ccclass('LayerFlagUser')