diff --git a/.circleci/config.yml b/.circleci/config.yml index ffba6d7ab3b..4c096271944 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,6 @@ jobs: - checkout - run: sudo npm install -g gulp - run: npm install - - run: gulp build-debug-infos - run: npm test workflows: diff --git a/.eslintrc.yaml b/.eslintrc.yaml index df438194553..311ffeb8ca8 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -83,7 +83,7 @@ rules: lines-between-class-members: off # be more lenient on member declarations max-classes-per-file: off # helper classes are common - max-len: [warn, 150] # more lenient on max length per line + max-len: off # no max line length limitation no-console: error # prefer the uniform logging methods no-plusplus: off # allow increment/decrement operators no-continue: off # allow unlabeled continues diff --git a/.github/workflows/native-ts-build.yml b/.github/workflows/native-ts-build.yml index bb4955c72ca..d642260815d 100644 --- a/.github/workflows/native-ts-build.yml +++ b/.github/workflows/native-ts-build.yml @@ -28,7 +28,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm ci - - run: npx gulp build-debug-infos - name: Download external run: | EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` diff --git a/.github/workflows/web-npm_test.yml b/.github/workflows/web-npm_test.yml index 7fc260ea723..8434959aabf 100644 --- a/.github/workflows/web-npm_test.yml +++ b/.github/workflows/web-npm_test.yml @@ -31,10 +31,6 @@ jobs: - name: npm install run: | npm install - - - name: build-debug-infos - run: | - gulp build-debug-infos - name: run test run: | diff --git a/DebugInfos.d.ts b/DebugInfos.d.ts deleted file mode 100644 index abd3cfcb183..00000000000 --- a/DebugInfos.d.ts +++ /dev/null @@ -1,15 +0,0 @@ - -/** - * This is a declaration file for 'DebugInfos.json' - * which is generated from 'EngineErrorMap.md'. - * You may run cli command - * `gulp build-debug-infos` or `npx gulp build-debug-infos` to generate the json file. - */ - -/** - * Engine error maps. - * The keys are error codes and their values are format strings. - */ -declare const $: Record; - -export default $; \ No newline at end of file diff --git a/cocos/2d/assembler/label/bmfontUtils.ts b/cocos/2d/assembler/label/bmfontUtils.ts index 6fc9630bae9..705ed8424e6 100644 --- a/cocos/2d/assembler/label/bmfontUtils.ts +++ b/cocos/2d/assembler/label/bmfontUtils.ts @@ -25,7 +25,8 @@ import { JSB } from 'internal:constants'; import { IConfig, FontAtlas } from '../../assets/bitmap-font'; import { SpriteFrame } from '../../assets/sprite-frame'; -import { Rect, error } from '../../../core'; +import { Rect } from '../../../core'; +import { error } from '@base/debug'; import { Label, Overflow, CacheMode } from '../../components/label'; import { UITransform } from '../../framework/ui-transform'; import { LetterAtlas, shareLabelInfo } from './font-utils'; diff --git a/cocos/2d/assembler/label/font-utils.ts b/cocos/2d/assembler/label/font-utils.ts index 8581a093666..9f177c7f433 100644 --- a/cocos/2d/assembler/label/font-utils.ts +++ b/cocos/2d/assembler/label/font-utils.ts @@ -23,7 +23,8 @@ */ import { FontAtlas } from '../../assets/bitmap-font'; -import { Color, macro, warn, warnID, ImageData } from '../../../core'; +import { Color, macro, ImageData } from '../../../core'; +import { warn, warnID } from '@base/debug'; import { ImageAsset, Texture2D } from '../../../asset/assets'; import { PixelFormat } from '../../../asset/assets/asset-enum'; import { BufferTextureCopy } from '../../../gfx'; diff --git a/cocos/2d/assembler/label/text-processing.ts b/cocos/2d/assembler/label/text-processing.ts index 06db2bf6e88..0ec86755462 100644 --- a/cocos/2d/assembler/label/text-processing.ts +++ b/cocos/2d/assembler/label/text-processing.ts @@ -26,7 +26,7 @@ import { Texture2D } from '../../../asset/assets'; import { WrapMode } from '../../../asset/assets/asset-enum'; import { cclegacy } from '@base/global'; import { Color, Pool, Rect, Vec2 } from '../../../core'; -import { log, logID, warn } from '../../../core/platform'; +import { log, logID, warn } from '@base/debug'; import { SpriteFrame } from '../../assets'; import { FontLetterDefinition } from '../../assets/bitmap-font'; import { HorizontalTextAlignment, Overflow, VerticalTextAlignment } from '../../components/label'; diff --git a/cocos/2d/assembler/sprite/bar-filled.ts b/cocos/2d/assembler/sprite/bar-filled.ts index 31e164023ad..b69fe1c8e58 100644 --- a/cocos/2d/assembler/sprite/bar-filled.ts +++ b/cocos/2d/assembler/sprite/bar-filled.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { Mat4, errorID } from '../../../core'; +import { Mat4 } from '../../../core'; +import { errorID } from '@base/debug'; import { IRenderData, RenderData } from '../../renderer/render-data'; import { IBatcher } from '../../renderer/i-batcher'; import { Sprite } from '../../components'; diff --git a/cocos/2d/assembler/sprite/tiled.ts b/cocos/2d/assembler/sprite/tiled.ts index 8c271e500b5..2144c23c2f9 100644 --- a/cocos/2d/assembler/sprite/tiled.ts +++ b/cocos/2d/assembler/sprite/tiled.ts @@ -24,7 +24,8 @@ import { JSB } from 'internal:constants'; import { IUV, SpriteFrame } from '../../assets/sprite-frame'; -import { Mat4, Vec3, Color, error } from '../../../core'; +import { Mat4, Vec3, Color } from '../../../core'; +import { error } from '@base/debug'; import { IRenderData, RenderData } from '../../renderer/render-data'; import { IBatcher } from '../../renderer/i-batcher'; import { Sprite } from '../../components/sprite'; diff --git a/cocos/2d/assets/bitmap-font.ts b/cocos/2d/assets/bitmap-font.ts index e13876a7b8c..c6b4ff9af5f 100644 --- a/cocos/2d/assets/bitmap-font.ts +++ b/cocos/2d/assets/bitmap-font.ts @@ -27,7 +27,8 @@ import { ccclass, type, serializable, editable } from 'cc.decorator'; import { Font } from './font'; import { SpriteFrame } from './sprite-frame'; import { cclegacy } from '@base/global'; -import { js, warn } from '../../core'; +import { js } from '../../core'; +import { warn } from '@base/debug'; export interface IConfig { [key: string]: any; diff --git a/cocos/2d/assets/sprite-frame.ts b/cocos/2d/assets/sprite-frame.ts index f707d088530..e84cdc298c5 100644 --- a/cocos/2d/assets/sprite-frame.ts +++ b/cocos/2d/assets/sprite-frame.ts @@ -28,7 +28,8 @@ import { ccclass } from 'cc.decorator'; import { EDITOR, TEST, BUILD } from 'internal:constants'; import { IMemoryImageSource } from '../../../pal/image/types'; -import { Mat4, Rect, Size, Vec2, Vec3, Vec4, errorID, warnID, js } from '../../core'; +import { Mat4, Rect, Size, Vec2, Vec3, Vec4, js } from '../../core'; +import { errorID, warnID } from '@base/debug'; import { cclegacy, ccwindow } from '@base/global'; import { Asset } from '../../asset/assets/asset'; import { TextureBase } from '../../asset/assets/texture-base'; diff --git a/cocos/2d/components/graphics.ts b/cocos/2d/components/graphics.ts index 150f1f8aab1..3d1c6a70f50 100644 --- a/cocos/2d/components/graphics.ts +++ b/cocos/2d/components/graphics.ts @@ -28,7 +28,8 @@ import { JSB } from 'internal:constants'; import { builtinResMgr } from '../../asset/asset-manager'; import { InstanceMaterialType, UIRenderer } from '../framework/ui-renderer'; import { director } from '../../game/director'; -import { Color, warnID } from '../../core'; +import { Color } from '../../core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { scene } from '../../render-scene'; import { IAssembler } from '../renderer/base'; diff --git a/cocos/2d/components/mask.ts b/cocos/2d/components/mask.ts index d03e7ac0c23..922fe303f62 100644 --- a/cocos/2d/components/mask.ts +++ b/cocos/2d/components/mask.ts @@ -25,7 +25,8 @@ import { ccclass, help, executionOrder, menu, tooltip, displayOrder, type, visible, serializable, range, slide, executeInEditMode } from 'cc.decorator'; import { JSB } from 'internal:constants'; -import { clamp, Color, Mat4, Vec2, Vec3, warnID, ccenum, error } from '../../core'; +import { clamp, Color, Mat4, Vec2, Vec3, ccenum } from '../../core'; +import { warnID, error } from '@base/debug'; import { cclegacy } from '@base/global'; import { Graphics } from './graphics'; import { TransformBit } from '../../scene-graph/node-enum'; diff --git a/cocos/2d/components/rich-text.ts b/cocos/2d/components/rich-text.ts index b97da8aad82..27aeb741bbc 100644 --- a/cocos/2d/components/rich-text.ts +++ b/cocos/2d/components/rich-text.ts @@ -27,7 +27,8 @@ import { ccclass, executeInEditMode, executionOrder, help, menu, tooltip, multil import { DEBUG, DEV, EDITOR } from 'internal:constants'; import { Font, SpriteAtlas, TTFFont, SpriteFrame } from '../assets'; import { EventTouch } from '../../input/types'; -import { assert, warnID, Color, Vec2, CCObject, js, Size } from '../../core'; +import { assert, warnID } from '@base/debug'; +import { Color, Vec2, CCObject, js, Size } from '../../core'; import { cclegacy } from '@base/global'; import { BASELINE_RATIO, fragmentText, isUnicodeCJK, isUnicodeSpace, getEnglishWordPartAtFirst, getEnglishWordPartAtLast } from '../utils/text-utils'; import { HtmlTextParser, IHtmlTextParserResultObj, IHtmlTextParserStack } from '../utils/html-text-parser'; diff --git a/cocos/2d/components/sprite.ts b/cocos/2d/components/sprite.ts index 286eedd5a3b..d4c77af3604 100644 --- a/cocos/2d/components/sprite.ts +++ b/cocos/2d/components/sprite.ts @@ -27,7 +27,8 @@ import { ccclass, help, executionOrder, menu, tooltip, displayOrder, type, range import { BUILD, EDITOR } from 'internal:constants'; import { SpriteAtlas } from '../assets/sprite-atlas'; import { SpriteFrame } from '../assets/sprite-frame'; -import { Vec2, ccenum, clamp, warn } from '../../core'; +import { Vec2, ccenum, clamp } from '../../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { IBatcher } from '../renderer/i-batcher'; import { UIRenderer, InstanceMaterialType } from '../framework/ui-renderer'; diff --git a/cocos/2d/components/ui-mesh-renderer.ts b/cocos/2d/components/ui-mesh-renderer.ts index 64f7a818b2a..c5543e46561 100644 --- a/cocos/2d/components/ui-mesh-renderer.ts +++ b/cocos/2d/components/ui-mesh-renderer.ts @@ -34,7 +34,7 @@ import { NativeUIModelProxy } from '../renderer/native-2d'; import { uiRendererManager } from '../framework/ui-renderer-manager'; import { RenderEntity, RenderEntityType } from '../renderer/render-entity'; import { MeshRenderData, RenderData } from '../renderer/render-data'; -import { assert, warn } from '../../core'; +import { assert, warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { RenderDrawInfoType } from '../renderer/render-draw-info'; import type { UIRenderer } from '../framework/ui-renderer'; diff --git a/cocos/2d/framework/ui-renderer-manager.ts b/cocos/2d/framework/ui-renderer-manager.ts index c9627ca129f..1074a6aa7e4 100644 --- a/cocos/2d/framework/ui-renderer-manager.ts +++ b/cocos/2d/framework/ui-renderer-manager.ts @@ -23,7 +23,8 @@ */ import { DEBUG } from 'internal:constants'; -import { assert, js } from '../../core'; +import { assert } from '@base/debug'; +import { js } from '../../core'; import { UIMeshRenderer } from '../components'; import { UIRenderer } from './ui-renderer'; diff --git a/cocos/2d/framework/ui-renderer.ts b/cocos/2d/framework/ui-renderer.ts index 71b4122279c..f0ffd3d1d9c 100644 --- a/cocos/2d/framework/ui-renderer.ts +++ b/cocos/2d/framework/ui-renderer.ts @@ -24,7 +24,8 @@ import { DEBUG, EDITOR, JSB } from 'internal:constants'; import { ccclass, executeInEditMode, requireComponent, tooltip, type, displayOrder, serializable, override, visible, displayName, disallowAnimation } from 'cc.decorator'; -import { Color, assert, ccenum } from '../../core'; +import { Color, ccenum } from '../../core'; +import { assert } from '@base/debug'; import { cclegacy } from '@base/global'; import { builtinResMgr } from '../../asset/asset-manager'; import { Material } from '../../asset/assets'; diff --git a/cocos/2d/framework/ui-transform.ts b/cocos/2d/framework/ui-transform.ts index 797270dece6..bee10dfd438 100644 --- a/cocos/2d/framework/ui-transform.ts +++ b/cocos/2d/framework/ui-transform.ts @@ -25,7 +25,8 @@ import { ccclass, help, executeInEditMode, executionOrder, menu, tooltip, displayOrder, serializable, disallowMultiple } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; import { Component, Node } from '../../scene-graph'; -import { Mat4, Rect, Size, Vec2, Vec3, geometry, warnID, visibleRect, approx, EPSILON } from '../../core'; +import { Mat4, Rect, Size, Vec2, Vec3, geometry, visibleRect, approx, EPSILON } from '../../core'; +import { warnID } from '@base/debug'; import { Director, director } from '../../game/director'; import { NodeEventType } from '../../scene-graph/node-event'; import { IMask } from '../../scene-graph/node-event-processor'; diff --git a/cocos/2d/renderer/batcher-2d.ts b/cocos/2d/renderer/batcher-2d.ts index 6237e1d3037..81e0546d5e4 100644 --- a/cocos/2d/renderer/batcher-2d.ts +++ b/cocos/2d/renderer/batcher-2d.ts @@ -24,12 +24,12 @@ import { DEBUG, JSB } from 'internal:constants'; import { cclegacy } from '@base/global'; +import { assert } from '@base/debug'; import { Camera, Model } from '../../render-scene/scene'; import { Material } from '../../asset/assets/material'; import { RenderRoot2D, UIRenderer } from '../framework'; -import { Texture, Device, Attribute, Sampler, DescriptorSetInfo, Buffer, BufferInfo, BufferUsageBit, - MemoryUsageBit, DescriptorSet, InputAssembler, deviceManager, PrimitiveMode } from '../../gfx'; -import { CachedArray, Pool, Mat4, assertIsTrue, assert, approx, EPSILON } from '../../core'; +import { Texture, Device, Attribute, Sampler, DescriptorSetInfo, Buffer, BufferInfo, BufferUsageBit, MemoryUsageBit, DescriptorSet, InputAssembler, deviceManager, PrimitiveMode } from '../../gfx'; +import { CachedArray, Pool, Mat4, assertIsTrue, approx, EPSILON } from '../../core'; import { Root } from '../../root'; import { Node } from '../../scene-graph'; import { Stage, StencilManager } from './stencil-manager'; diff --git a/cocos/2d/renderer/deprecated.ts b/cocos/2d/renderer/deprecated.ts index 36ced8f1d73..ac92ec01d6e 100644 --- a/cocos/2d/renderer/deprecated.ts +++ b/cocos/2d/renderer/deprecated.ts @@ -25,7 +25,8 @@ import * as VertexFormat from './vertex-format'; import { Batcher2D } from './batcher-2d'; import { DrawBatch2D } from './draw-batch'; -import { markAsWarning, replaceProperty, removeProperty, warnID } from '../../core'; +import { markAsWarning, replaceProperty, removeProperty } from '../../core'; +import { warnID } from '@base/debug'; import { MeshBuffer } from './mesh-buffer'; import { MeshRenderData } from './render-data'; diff --git a/cocos/2d/renderer/linear-buffer-accessor.ts b/cocos/2d/renderer/linear-buffer-accessor.ts index 668e1489e4f..d3aab839ae9 100644 --- a/cocos/2d/renderer/linear-buffer-accessor.ts +++ b/cocos/2d/renderer/linear-buffer-accessor.ts @@ -25,7 +25,8 @@ import { InputAssembler, Device, Attribute } from '../../gfx'; import { MeshBuffer } from './mesh-buffer'; import { BufferAccessor } from './buffer-accessor'; -import { assertID, macro, assertIsNonNullable } from '../../core'; +import { assertID } from '@base/debug'; +import { macro, assertIsNonNullable } from '../../core'; export class LinearBufferAccessor extends BufferAccessor { public static IB_SCALE = 4; // ib size scale based on vertex count diff --git a/cocos/2d/renderer/mesh-buffer.ts b/cocos/2d/renderer/mesh-buffer.ts index 1cfac55efda..181ae3d92cc 100644 --- a/cocos/2d/renderer/mesh-buffer.ts +++ b/cocos/2d/renderer/mesh-buffer.ts @@ -25,7 +25,8 @@ import { JSB } from 'internal:constants'; import { Device, BufferUsageBit, MemoryUsageBit, Attribute, Buffer, BufferInfo, InputAssembler, InputAssemblerInfo } from '../../gfx'; import { getAttributeStride } from './vertex-format'; -import { sys, getError, warnID, assertIsTrue } from '../../core'; +import { sys, assertIsTrue } from '../../core'; +import { getError, warnID } from '@base/debug'; import { NativeUIMeshBuffer } from './native-2d'; interface IIARef { diff --git a/cocos/2d/renderer/render-data.ts b/cocos/2d/renderer/render-data.ts index 1efde4633ab..3e1729174a8 100644 --- a/cocos/2d/renderer/render-data.ts +++ b/cocos/2d/renderer/render-data.ts @@ -26,7 +26,8 @@ import { DEBUG, JSB } from 'internal:constants'; import { director } from '../../game/director'; import { Material } from '../../asset/assets/material'; import { TextureBase } from '../../asset/assets/texture-base'; -import { Color, Pool, RecyclePool, murmurhash2_32_gc, assert, assertIsTrue } from '../../core'; +import { Color, Pool, RecyclePool, murmurhash2_32_gc, assertIsTrue } from '../../core'; +import { assert } from '@base/debug'; import { SpriteFrame } from '../assets/sprite-frame'; import { UIRenderer } from '../framework/ui-renderer'; import { StaticVBAccessor, StaticVBChunk } from './static-vb-accessor'; diff --git a/cocos/2d/renderer/static-vb-accessor.ts b/cocos/2d/renderer/static-vb-accessor.ts index d3a5fd49815..6e6790de15e 100644 --- a/cocos/2d/renderer/static-vb-accessor.ts +++ b/cocos/2d/renderer/static-vb-accessor.ts @@ -26,7 +26,8 @@ import { JSB } from 'internal:constants'; import { Device, Attribute } from '../../gfx'; import { MeshBuffer } from './mesh-buffer'; import { BufferAccessor } from './buffer-accessor'; -import { assertID, errorID, Pool, macro, assertIsTrue } from '../../core'; +import { assertID, errorID } from '@base/debug'; +import { Pool, macro, assertIsTrue } from '../../core'; import { director } from '../../game'; interface IFreeEntry { diff --git a/cocos/2d/utils/dynamic-atlas/atlas.ts b/cocos/2d/utils/dynamic-atlas/atlas.ts index e3dde76d033..1227e46ba82 100644 --- a/cocos/2d/utils/dynamic-atlas/atlas.ts +++ b/cocos/2d/utils/dynamic-atlas/atlas.ts @@ -27,7 +27,7 @@ import { ImageAsset } from '../../../asset/assets/image-asset'; import { Texture2D } from '../../../asset/assets/texture-2d'; import { BufferTextureCopy } from '../../../gfx'; import { cclegacy } from '@base/global'; -import { warn } from '../../../core'; +import { warn } from '@base/debug'; import { SpriteFrame } from '../../assets/sprite-frame'; const space = 2; diff --git a/cocos/2d/utils/font-loader.ts b/cocos/2d/utils/font-loader.ts index 6ff7b6506fb..56acb168a62 100644 --- a/cocos/2d/utils/font-loader.ts +++ b/cocos/2d/utils/font-loader.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { warnID } from '../../core'; +import { warnID } from '@base/debug'; import { safeMeasureText } from './text-utils'; import downloader from '../../asset/asset-manager/downloader'; import factory from '../../asset/asset-manager/factory'; diff --git a/cocos/3d/assets/mesh.ts b/cocos/3d/assets/mesh.ts index 4354a0413c3..f2aafacd52b 100644 --- a/cocos/3d/assets/mesh.ts +++ b/cocos/3d/assets/mesh.ts @@ -28,7 +28,8 @@ import { Asset } from '../../asset/assets/asset'; import { IDynamicGeometry } from '../../primitive/define'; import { BufferBlob } from '../misc/buffer-blob'; import { Skeleton } from './skeleton'; -import { geometry, sys, warnID, Mat4, Quat, Vec3, assertIsTrue, murmurhash2_32_gc, errorID } from '../../core'; +import { geometry, sys, Mat4, Quat, Vec3, assertIsTrue, murmurhash2_32_gc } from '../../core'; +import { warnID, errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { RenderingSubMesh } from '../../asset/assets'; import { Attribute, Device, Buffer, BufferInfo, AttributeName, BufferUsageBit, Feature, Format, FormatInfos, FormatType, MemoryUsageBit, PrimitiveMode, getTypedArrayConstructor, DrawInfo, FormatInfo, deviceManager } from '../../gfx'; diff --git a/cocos/3d/assets/morph-rendering.ts b/cocos/3d/assets/morph-rendering.ts index ba8f0a71f77..c2f5d44fabe 100644 --- a/cocos/3d/assets/morph-rendering.ts +++ b/cocos/3d/assets/morph-rendering.ts @@ -28,7 +28,8 @@ import { Texture2D } from '../../asset/assets/texture-2d'; import { ImageAsset } from '../../asset/assets/image-asset'; import { UBOMorph, UNIFORM_NORMAL_MORPH_TEXTURE_BINDING, UNIFORM_POSITION_MORPH_TEXTURE_BINDING, UNIFORM_TANGENT_MORPH_TEXTURE_BINDING } from '../../rendering/define'; import { Morph, SubMeshMorph } from './morph'; -import { assertIsNonNullable, assertIsTrue, warn, bits, nextPow2 } from '../../core'; +import { assertIsNonNullable, assertIsTrue, bits, nextPow2 } from '../../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { IMacroPatch } from '../../render-scene'; import { PixelFormat } from '../../asset/assets/asset-enum'; diff --git a/cocos/3d/framework/mesh-renderer.ts b/cocos/3d/framework/mesh-renderer.ts index 9491aec8c96..a6778731518 100644 --- a/cocos/3d/framework/mesh-renderer.ts +++ b/cocos/3d/framework/mesh-renderer.ts @@ -27,7 +27,8 @@ import { displayOrder, group, range } from 'cc.decorator'; import { Texture2D, TextureCube } from '../../asset/assets'; import { Material } from '../../asset/assets/material'; import { Mesh } from '../assets/mesh'; -import { Vec4, Enum, CCBoolean, CCFloat, assertIsTrue, _decorator, CCInteger, EventTarget, warnID } from '../../core'; +import { Vec4, Enum, CCBoolean, CCFloat, assertIsTrue, _decorator, CCInteger, EventTarget } from '../../core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { scene } from '../../render-scene'; import { MorphModel } from '../models/morph-model'; diff --git a/cocos/3d/lights/directional-light-component.ts b/cocos/3d/lights/directional-light-component.ts index 69c87b80e00..7856d6455de 100644 --- a/cocos/3d/lights/directional-light-component.ts +++ b/cocos/3d/lights/directional-light-component.ts @@ -26,7 +26,8 @@ import { Light } from './light-component'; import { scene } from '../../render-scene'; import { cclegacy } from '@base/global'; -import { clamp, warnID, CCBoolean, CCFloat, _decorator, settings, Settings, CCInteger } from '../../core'; +import { clamp, CCBoolean, CCFloat, _decorator, settings, Settings, CCInteger } from '../../core'; +import { warnID } from '@base/debug'; 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/lod/lodgroup-component.ts b/cocos/3d/lod/lodgroup-component.ts index a13dbf88f7c..cdd276b6e9b 100644 --- a/cocos/3d/lod/lodgroup-component.ts +++ b/cocos/3d/lod/lodgroup-component.ts @@ -23,7 +23,8 @@ */ import { EDITOR, JSB } from 'internal:constants'; import { ccclass, editable, executeInEditMode, menu, serializable, type } from 'cc.decorator'; -import { Vec3, Mat4, geometry, CCInteger, CCFloat, error, warn } from '../../core'; +import { Vec3, Mat4, geometry, CCInteger, CCFloat } from '../../core'; +import { error, warn } from '@base/debug'; import { Node } from '../../scene-graph/node'; import { Component } from '../../scene-graph/component'; import { MeshRenderer } from '../framework/mesh-renderer'; diff --git a/cocos/3d/misc/batch-utils.ts b/cocos/3d/misc/batch-utils.ts index 0c0d0af9bdb..4a0314b565b 100644 --- a/cocos/3d/misc/batch-utils.ts +++ b/cocos/3d/misc/batch-utils.ts @@ -24,7 +24,8 @@ import { MeshRenderer } from '../framework/mesh-renderer'; import { Mesh } from '../assets/mesh'; -import { Mat4, error } from '../../core'; +import { Mat4 } from '../../core'; +import { error } from '@base/debug'; import { Node } from '../../scene-graph/node'; function checkMaterialisSame (comp1: MeshRenderer, comp2: MeshRenderer): boolean { diff --git a/cocos/3d/misc/mesh-codec.ts b/cocos/3d/misc/mesh-codec.ts index dccb982bc0d..07e59dfa374 100644 --- a/cocos/3d/misc/mesh-codec.ts +++ b/cocos/3d/misc/mesh-codec.ts @@ -24,7 +24,8 @@ import { WASM_SUPPORT_MODE } from 'internal:constants'; import { ensureWasmModuleReady, instantiateWasm } from 'pal/wasm'; -import { sys, logID } from '../../core'; +import { sys } from '../../core'; +import { logID } from '@base/debug'; import { cclegacy } from '@base/global'; import { WebAssemblySupportMode } from '../../misc/webassembly-support'; diff --git a/cocos/3d/models/skinning-model.ts b/cocos/3d/models/skinning-model.ts index 3ebd761b052..06c9a90bb14 100644 --- a/cocos/3d/models/skinning-model.ts +++ b/cocos/3d/models/skinning-model.ts @@ -26,7 +26,8 @@ import { Material } from '../../asset/assets/material'; import { RenderingSubMesh } from '../../asset/assets/rendering-sub-mesh'; import { Mesh } from '../assets/mesh'; import { Skeleton } from '../assets/skeleton'; -import { geometry, Mat4, Vec3, warnID } from '../../core'; +import { geometry, Mat4, Vec3 } from '../../core'; +import { warnID } from '@base/debug'; import { BufferUsageBit, MemoryUsageBit, DescriptorSet, Buffer, BufferInfo, Attribute, FormatFeatureBit, Format } from '../../gfx'; import { UBOSkinning, UNIFORM_REALTIME_JOINT_TEXTURE_BINDING } from '../../rendering/define'; import { Node } from '../../scene-graph/node'; diff --git a/cocos/3d/reflection-probe/reflection-probe-component.ts b/cocos/3d/reflection-probe/reflection-probe-component.ts index a4fe36a18c8..d0649f1ef26 100644 --- a/cocos/3d/reflection-probe/reflection-probe-component.ts +++ b/cocos/3d/reflection-probe/reflection-probe-component.ts @@ -23,7 +23,8 @@ */ import { ccclass, executeInEditMode, help, menu, playOnFocus, serializable, tooltip, type, visible } from 'cc.decorator'; import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; -import { CCBoolean, CCObject, Color, Enum, Vec3, warn } from '../../core'; +import { CCBoolean, CCObject, Color, Enum, Vec3 } from '../../core'; +import { warn } from '@base/debug'; import { TextureCube } from '../../asset/assets'; import { scene } from '../../render-scene'; diff --git a/cocos/3d/skeletal-animation/skeletal-animation.ts b/cocos/3d/skeletal-animation/skeletal-animation.ts index ba490e68200..8754c5d0107 100644 --- a/cocos/3d/skeletal-animation/skeletal-animation.ts +++ b/cocos/3d/skeletal-animation/skeletal-animation.ts @@ -25,7 +25,8 @@ import { ccclass, executeInEditMode, executionOrder, help, menu, type, serializable, editable } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { SkinnedMeshRenderer } from '../skinned-mesh-renderer'; -import { Mat4, js, assertIsTrue, warn } from '../../core'; +import { Mat4, js, assertIsTrue } from '../../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { DataPoolManager } from './data-pool-manager'; import { Node } from '../../scene-graph/node'; 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 9c009f966cb..c7c8b561608 100644 --- a/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts +++ b/cocos/3d/skinned-mesh-renderer/skinned-mesh-batch-renderer.ts @@ -31,7 +31,8 @@ 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, warn } from '../../core'; +import { CCString, Mat4, Vec2, Vec3 } from '../../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { AttributeName, FormatInfos, Format, Type, Attribute, BufferTextureCopy } from '../../gfx'; import { mapBuffer, readBuffer, writeBuffer } from '../misc/buffer'; diff --git a/cocos/animation/animation-clip.ts b/cocos/animation/animation-clip.ts index d8b36e6f669..b7026b6c7a8 100644 --- a/cocos/animation/animation-clip.ts +++ b/cocos/animation/animation-clip.ts @@ -26,7 +26,8 @@ import { ccclass, serializable } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; import { Asset } from '../asset/assets/asset'; import { SpriteFrame } from '../2d/assets/sprite-frame'; -import { errorID, warnID, js, geometry, approx, clamp, Mat4, Quat, Vec3, murmurhash2_32_gc, binarySearchEpsilon, assertIsTrue, RealCurve } from '../core'; +import { errorID, warnID } from '@base/debug'; +import { js, geometry, approx, clamp, Mat4, Quat, Vec3, murmurhash2_32_gc, binarySearchEpsilon, assertIsTrue, RealCurve } from '../core'; import { cclegacy } from '@base/global'; import { SkelAnimDataHub } from '../3d/skeletal-animation/skeletal-animation-data-hub'; import { WrapMode as AnimationWrapMode, WrapMode } from './types'; diff --git a/cocos/animation/animation-component.ts b/cocos/animation/animation-component.ts index a527be4a40b..d477f4b2862 100644 --- a/cocos/animation/animation-component.ts +++ b/cocos/animation/animation-component.ts @@ -25,7 +25,8 @@ import { ccclass, executeInEditMode, executionOrder, help, menu, type, serializable, editable } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW, TEST } from 'internal:constants'; import { Component } from '../scene-graph/component'; -import { Eventify, warnID, js } from '../core'; +import { Eventify, js } from '../core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { AnimationClip } from './animation-clip'; import { AnimationState, EventType } from './animation-state'; diff --git a/cocos/animation/animation-curve.ts b/cocos/animation/animation-curve.ts index 3d94fc504e2..5acdfecd7d5 100644 --- a/cocos/animation/animation-curve.ts +++ b/cocos/animation/animation-curve.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { lerp, Quat, errorID, binarySearchEpsilon, ValueType, bezierByTime, BezierControlPoints, easing } from '../core'; +import { lerp, Quat, binarySearchEpsilon, ValueType, bezierByTime, BezierControlPoints, easing } from '../core'; +import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { ILerpable, isLerpable } from './types'; import type * as legacy from './legacy-clip-data'; diff --git a/cocos/animation/animation-manager.ts b/cocos/animation/animation-manager.ts index c11154a1694..84b65ce3310 100644 --- a/cocos/animation/animation-manager.ts +++ b/cocos/animation/animation-manager.ts @@ -23,7 +23,8 @@ */ import { ccclass } from 'cc.decorator'; -import { System, errorID, js } from '../core'; +import { System, js } from '../core'; +import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { director, Director } from '../game/director'; import { Node } from '../scene-graph'; diff --git a/cocos/animation/animation-state.ts b/cocos/animation/animation-state.ts index e2fb94e234c..7b2f18b5548 100644 --- a/cocos/animation/animation-state.ts +++ b/cocos/animation/animation-state.ts @@ -28,7 +28,8 @@ import { AnimationClip } from './animation-clip'; import { Playable } from './playable'; import { WrapMode, WrappedInfo } from './types'; import { cclegacy } from '@base/global'; -import { debug, geometry, ccenum, assertIsTrue } from '../core'; +import { debug } from '@base/debug'; +import { geometry, ccenum, assertIsTrue } 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/embedded-player/embedded-animation-clip-player.ts b/cocos/animation/embedded-player/embedded-animation-clip-player.ts index 0f86bd4a49e..a1da264e80c 100644 --- a/cocos/animation/embedded-player/embedded-animation-clip-player.ts +++ b/cocos/animation/embedded-player/embedded-animation-clip-player.ts @@ -23,7 +23,7 @@ */ import { ccclass, serializable } from 'cc.decorator'; -import { errorID } from '../../core'; +import { errorID } from '@base/debug'; import type { Node } from '../../scene-graph/node'; import { AnimationClip } from '../animation-clip'; import { AnimationState } from '../animation-state'; diff --git a/cocos/animation/embedded-player/embedded-particle-system-player.ts b/cocos/animation/embedded-player/embedded-particle-system-player.ts index f0777e35745..f0ab3570827 100644 --- a/cocos/animation/embedded-player/embedded-particle-system-player.ts +++ b/cocos/animation/embedded-player/embedded-particle-system-player.ts @@ -24,7 +24,8 @@ import { ccclass, serializable } from 'cc.decorator'; import type { ParticleSystem } from '../../particle'; -import { warn, js } from '../../core'; +import { warn } from '@base/debug'; +import { js } from '../../core'; import type { Node } from '../../scene-graph/node'; import { CLASS_NAME_PREFIX_ANIM } from '../define'; import { EmbeddedPlayableState, EmbeddedPlayable } from './embedded-player'; diff --git a/cocos/animation/legacy-clip-data.ts b/cocos/animation/legacy-clip-data.ts index 51f5af42cbe..947748029b2 100644 --- a/cocos/animation/legacy-clip-data.ts +++ b/cocos/animation/legacy-clip-data.ts @@ -24,8 +24,8 @@ import { ComponentPath, HierarchyPath, TargetPath } from './target-path'; import { IValueProxyFactory } from './value-proxy'; -import { easing, QuatCurve, QuatInterpolationMode, RealCurve, RealInterpolationMode, RealKeyframeValue, TangentWeightMode, - warnID, Color, Quat, Size, Vec2, Vec3, Vec4, assertIsTrue, EasingMethod, BezierControlPoints, CompactValueTypeArray } from '../core'; +import { easing, QuatCurve, QuatInterpolationMode, RealCurve, RealInterpolationMode, RealKeyframeValue, TangentWeightMode, Color, Quat, Size, Vec2, Vec3, Vec4, assertIsTrue, EasingMethod, BezierControlPoints, CompactValueTypeArray } from '../core'; +import { warnID } from '@base/debug'; import { AnimCurve, RatioSampler } from './animation-curve'; import { Track, TrackPath } from './tracks/track'; import { UntypedTrack } from './tracks/untyped-track'; diff --git a/cocos/animation/marionette/animation-controller.ts b/cocos/animation/marionette/animation-controller.ts index d4c880dedc8..dfb9a52e7d9 100644 --- a/cocos/animation/marionette/animation-controller.ts +++ b/cocos/animation/marionette/animation-controller.ts @@ -26,7 +26,8 @@ import { DEBUG } from 'internal:constants'; import { Component } from '../../scene-graph/component'; import { AnimationGraph } from './animation-graph'; import type { AnimationGraphRunTime } from './animation-graph'; -import { EventTarget, _decorator, assertIsNonNullable, assertIsTrue, warn } from '../../core'; +import { EventTarget, _decorator, assertIsNonNullable, assertIsTrue } from '../../core'; +import { warn } from '@base/debug'; import { AnimationGraphEval } from './graph-eval'; import type { MotionStateStatus, TransitionStatus, ClipStatus } from './state-machine/state-machine-eval'; import { PrimitiveValue, Value, VariableType } from './variable'; diff --git a/cocos/animation/marionette/animation-graph-animation-clip-binding.ts b/cocos/animation/marionette/animation-graph-animation-clip-binding.ts index 4d01923400b..3a5533bdc48 100644 --- a/cocos/animation/marionette/animation-graph-animation-clip-binding.ts +++ b/cocos/animation/marionette/animation-graph-animation-clip-binding.ts @@ -1,5 +1,6 @@ import { DEBUG } from 'internal:constants'; -import { error, Quat, RealCurve, Vec3, warnID } from '../../core'; +import { error, warnID } from '@base/debug'; +import { Quat, RealCurve, Vec3 } from '../../core'; import { assertIsTrue } from '../../core/data/utils/asserts'; import { Node } from '../../scene-graph/node'; import { additiveSettingsTag, AnimationClip, exoticAnimationTag } from '../animation-clip'; diff --git a/cocos/animation/marionette/animation-graph-context.ts b/cocos/animation/marionette/animation-graph-context.ts index ea090ca4bac..01dec528d81 100644 --- a/cocos/animation/marionette/animation-graph-context.ts +++ b/cocos/animation/marionette/animation-graph-context.ts @@ -8,7 +8,7 @@ import { TransformHandle, AuxiliaryCurveHandle } from '../core/animation-handle' import { Transform, ZERO_DELTA_TRANSFORM } from '../core/transform'; import { VarInstance } from './variable'; import { AnimationMask } from './animation-mask'; -import { error } from '../../core'; +import { error } from '@base/debug'; import { partition } from '../../core/algorithm/partition'; import { AnimationController } from './animation-controller'; import { TransformSpace } from './pose-graph/pose-nodes/transform-space'; diff --git a/cocos/animation/marionette/pose-graph/decorator/input.ts b/cocos/animation/marionette/pose-graph/decorator/input.ts index 2c223606ccb..74610efae85 100644 --- a/cocos/animation/marionette/pose-graph/decorator/input.ts +++ b/cocos/animation/marionette/pose-graph/decorator/input.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/ban-types */ -import { error, js } from '../../../../core'; +import { error } from '@base/debug'; +import { js } from '../../../../core'; import { PropertyStashInternalFlag } from '../../../../core/data/class-stash'; import { getOrCreatePropertyStash } from '../../../../core/data/decorators/property'; import { PoseGraphNodeInputMappingOptions, globalPoseGraphNodeInputManager } from '../foundation/authoring/input-authoring'; diff --git a/cocos/animation/marionette/pose-graph/decorator/node.ts b/cocos/animation/marionette/pose-graph/decorator/node.ts index 856e22e9fd7..78c197b8122 100644 --- a/cocos/animation/marionette/pose-graph/decorator/node.ts +++ b/cocos/animation/marionette/pose-graph/decorator/node.ts @@ -1,20 +1,10 @@ -import { error, js } from '../../../../core'; +import { error } from '@base/debug'; +import { js } from '../../../../core'; import { PoseGraphNode } from '../foundation/pose-graph-node'; -import { - PoseGraphCreateNodeFactory, - PoseGraphNodeEditorMetadata, - PoseGraphNodeAppearanceOptions, - getOrCreateNodeEditorMetadata, -} from '../foundation/authoring/node-authoring'; - -export type { - PoseGraphCreateNodeContext, - PoseGraphCreateNodeEntry, - PoseGraphCreateNodeFactory, - PoseGraphNodeEditorMetadata, - PoseGraphNodeAppearanceOptions, -} from '../foundation/authoring/node-authoring'; +import { PoseGraphCreateNodeFactory, PoseGraphNodeEditorMetadata, PoseGraphNodeAppearanceOptions, getOrCreateNodeEditorMetadata } from '../foundation/authoring/node-authoring'; + +export type { PoseGraphCreateNodeContext, PoseGraphCreateNodeEntry, PoseGraphCreateNodeFactory, PoseGraphNodeEditorMetadata, PoseGraphNodeAppearanceOptions } from '../foundation/authoring/node-authoring'; function makeNodeEditorMetadataModifier (edit: (metadata: PoseGraphNodeEditorMetadata) => void): ClassDecorator { return (target): void => { diff --git a/cocos/animation/marionette/pose-graph/instantiation.ts b/cocos/animation/marionette/pose-graph/instantiation.ts index 0b1db72ed13..8a4c776a44a 100644 --- a/cocos/animation/marionette/pose-graph/instantiation.ts +++ b/cocos/animation/marionette/pose-graph/instantiation.ts @@ -1,7 +1,8 @@ // cSpell:words Evaluatable import { DEBUG } from 'internal:constants'; -import { assertIsTrue, warn } from '../../../core'; +import { assertIsTrue } from '../../../core'; +import { warn } from '@base/debug'; import { instantiate } from '../../../serialization'; import { PoseNode, PoseTransformSpaceRequirement } from './pose-node'; import { PoseGraph } from './pose-graph'; @@ -9,10 +10,7 @@ import { PureValueNode, PureValueNodeLinkContext } from './pure-value-node'; import { NodeInputPath } from './foundation/node-shell'; import { PoseGraphNode } from './foundation/pose-graph-node'; import { PoseNodePlayMotion } from './pose-nodes/play-motion'; -import { - AnimationGraphBindingContext, AnimationGraphSettleContext, - AnimationGraphUpdateContext, AnimationGraphEvaluationContext, -} from '../animation-graph-context'; +import { AnimationGraphBindingContext, AnimationGraphSettleContext, AnimationGraphUpdateContext, AnimationGraphEvaluationContext } from '../animation-graph-context'; import type { Pose } from '../../core/pose'; type EvaluatableNode = PoseNode | PureValueNode; diff --git a/cocos/animation/marionette/pose-graph/op/internal.ts b/cocos/animation/marionette/pose-graph/op/internal.ts index 75af4e5a80d..e707a8b51b2 100644 --- a/cocos/animation/marionette/pose-graph/op/internal.ts +++ b/cocos/animation/marionette/pose-graph/op/internal.ts @@ -1,18 +1,14 @@ import { PoseNode } from '../pose-node'; import { PoseGraphNodeInputInsertId, PoseGraphInputKey, globalPoseGraphNodeInputManager } from '../foundation/authoring/input-authoring'; import { PureValueNode } from '../pure-value-node'; -import { assertIsTrue, error } from '../../../../core'; +import { assertIsTrue } from '../../../../core'; +import { error } from '@base/debug'; import { PoseGraphType } from '../foundation/type-system'; import { PoseGraphNode } from '../foundation/pose-graph-node'; import { PoseGraphOutputNode } from '../graph-output-node'; import type { PoseGraph } from '../pose-graph'; -export type { - PoseGraphInputKey as InputKey, - PoseGraphNodeInputDisplayName as InputDisplayName, - PoseGraphNodeInputMetadata as InputMetadata, - PoseGraphNodeInputInsertId as InputInsertId, -} from '../foundation/authoring/input-authoring'; +export type { PoseGraphInputKey as InputKey, PoseGraphNodeInputDisplayName as InputDisplayName, PoseGraphNodeInputMetadata as InputMetadata, PoseGraphNodeInputInsertId as InputInsertId } from '../foundation/authoring/input-authoring'; export type OutputKey = number; diff --git a/cocos/animation/marionette/pose-graph/pose-graph.ts b/cocos/animation/marionette/pose-graph/pose-graph.ts index 09063f6f57c..216604e43c0 100644 --- a/cocos/animation/marionette/pose-graph/pose-graph.ts +++ b/cocos/animation/marionette/pose-graph/pose-graph.ts @@ -1,4 +1,5 @@ -import { EditorExtendable, assertIsTrue, error, js, warn } from '../../../core'; +import { EditorExtendable, assertIsTrue, js } from '../../../core'; +import { error, warn } from '@base/debug'; import { ccclass, serializable } from '../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../define'; import { PoseGraphNodeShell } from './foundation/node-shell'; 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 fb3e2eb4e45..e63b732199d 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/apply-transform.ts @@ -2,11 +2,10 @@ import { EDITOR } from 'internal:constants'; 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 { AnimationGraphBindingContext, AnimationGraphEvaluationContext } from '../../animation-graph-context'; import { input } from '../decorator/input'; -import { approx, assertIsTrue, ccenum, error, Quat, Vec3 } from '../../../../core'; +import { approx, assertIsTrue, ccenum, Quat, Vec3 } from '../../../../core'; +import { error } from '@base/debug'; 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/use-stashed-pose.ts b/cocos/animation/marionette/pose-graph/pose-nodes/use-stashed-pose.ts index 345bcb1f179..c0491dd1a0f 100644 --- a/cocos/animation/marionette/pose-graph/pose-nodes/use-stashed-pose.ts +++ b/cocos/animation/marionette/pose-graph/pose-nodes/use-stashed-pose.ts @@ -1,5 +1,5 @@ import { EDITOR } from 'internal:constants'; -import { warn } from '../../../../core'; +import { warn } from '@base/debug'; import { ccclass, editable, serializable } from '../../../../core/data/decorators'; import { CLASS_NAME_PREFIX_ANIM } from '../../../define'; import { PoseGraphCreateNodeFactory, poseGraphCreateNodeFactory, poseGraphNodeAppearance, poseGraphNodeCategory } from '../decorator/node'; diff --git a/cocos/animation/marionette/pose-graph/stash/runtime-stash.ts b/cocos/animation/marionette/pose-graph/stash/runtime-stash.ts index 2c35fcba815..b0c74311e43 100644 --- a/cocos/animation/marionette/pose-graph/stash/runtime-stash.ts +++ b/cocos/animation/marionette/pose-graph/stash/runtime-stash.ts @@ -1,10 +1,9 @@ import { DEBUG } from 'internal:constants'; -import { approx, assertIsTrue, error } from '../../../../core'; +import { approx, assertIsTrue } from '../../../../core'; +import { error } from '@base/debug'; import { Pose } from '../../../core/pose'; import { PoseGraphStash } from '../../animation-graph'; -import { AnimationGraphBindingContext, AnimationGraphEvaluationContext, - AnimationGraphSettleContext, AnimationGraphUpdateContext, AnimationGraphUpdateContextGenerator, -} from '../../animation-graph-context'; +import { AnimationGraphBindingContext, AnimationGraphEvaluationContext, AnimationGraphSettleContext, AnimationGraphUpdateContext, AnimationGraphUpdateContextGenerator } from '../../animation-graph-context'; import { InstantiatedPoseGraph, instantiatePoseGraph } from '../instantiation'; interface RuntimeStash { diff --git a/cocos/animation/marionette/state-machine/state-machine-eval.ts b/cocos/animation/marionette/state-machine/state-machine-eval.ts index 9536abb54f4..e37a66cd404 100644 --- a/cocos/animation/marionette/state-machine/state-machine-eval.ts +++ b/cocos/animation/marionette/state-machine/state-machine-eval.ts @@ -1,25 +1,17 @@ import { DEBUG } from 'internal:constants'; -import { - StateMachine, State, isAnimationTransition, - SubStateMachine, EmptyState, EmptyStateTransition, - ProceduralPoseState, ProceduralPoseTransition, -} from '../animation-graph'; +import { StateMachine, State, isAnimationTransition, SubStateMachine, EmptyState, EmptyStateTransition, ProceduralPoseState, ProceduralPoseTransition } from '../animation-graph'; import { MotionEval, MotionPort } from '../motion'; import { createEval } from '../create-eval'; import { BindContext, validateVariableExistence, validateVariableType, VariableType } from '../parametric'; import { ConditionEval, TriggerCondition } from './condition'; import { MotionState } from './motion-state'; -import { warnID, assertIsTrue, assertIsNonNullable, Pool, approx, clamp01 } from '../../../core'; +import { warnID } from '@base/debug'; +import { assertIsTrue, assertIsNonNullable, Pool, approx, clamp01 } from '../../../core'; import { AnimationClip } from '../../animation-clip'; import type { AnimationController } from '../animation-controller'; import { StateMachineComponent } from './state-machine-component'; import { InteractiveState } from './state'; -import { - AnimationGraphBindingContext, AnimationGraphEvaluationContext, - AnimationGraphUpdateContext, AnimationGraphUpdateContextGenerator, - AnimationGraphSettleContext, - TriggerResetter, -} from '../animation-graph-context'; +import { AnimationGraphBindingContext, AnimationGraphEvaluationContext, AnimationGraphUpdateContext, AnimationGraphUpdateContextGenerator, AnimationGraphSettleContext, TriggerResetter } from '../animation-graph-context'; import { blendPoseInto, Pose } from '../../core/pose'; import { PoseNode } from '../pose-graph/pose-node'; import { instantiatePoseGraph, InstantiatedPoseGraph } from '../pose-graph/instantiation'; diff --git a/cocos/animation/playable.ts b/cocos/animation/playable.ts index 3b59721c490..f2984a7949d 100644 --- a/cocos/animation/playable.ts +++ b/cocos/animation/playable.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { getError } from '../core'; +import { getError } from '@base/debug'; export class Playable { /** diff --git a/cocos/animation/target-path.ts b/cocos/animation/target-path.ts index 18e9e30191c..db75513f3bc 100644 --- a/cocos/animation/target-path.ts +++ b/cocos/animation/target-path.ts @@ -24,7 +24,7 @@ import { ccclass, serializable } from 'cc.decorator'; import { Node } from '../scene-graph/node'; -import { warnID } from '../core'; +import { warnID } from '@base/debug'; import type { Component } from '../scene-graph'; /** diff --git a/cocos/animation/tracks/track.ts b/cocos/animation/tracks/track.ts index c518ed5e528..e5170da28cb 100644 --- a/cocos/animation/tracks/track.ts +++ b/cocos/animation/tracks/track.ts @@ -25,7 +25,8 @@ import { ccclass, serializable, uniquelyReferenced } from 'cc.decorator'; import { SUPPORT_JIT } from 'internal:constants'; import type { Component } from '../../scene-graph/component'; -import { error, ObjectCurve, QuatCurve, RealCurve, errorID, warnID, js } from '../../core'; +import { error, errorID, warnID } from '@base/debug'; +import { ObjectCurve, QuatCurve, RealCurve, js } from '../../core'; import { assertIsTrue } from '../../core/data/utils/asserts'; import { Node } from '../../scene-graph'; diff --git a/cocos/animation/tracks/untyped-track.ts b/cocos/animation/tracks/untyped-track.ts index 29ecce4cf54..b60aefeed22 100644 --- a/cocos/animation/tracks/untyped-track.ts +++ b/cocos/animation/tracks/untyped-track.ts @@ -23,7 +23,8 @@ */ import { ccclass, serializable } from 'cc.decorator'; -import { RealCurve, Color, Size, Vec2, Vec3, Vec4, getError } from '../../core'; +import { RealCurve, Color, Size, Vec2, Vec3, Vec4 } from '../../core'; +import { getError } from '@base/debug'; import { CLASS_NAME_PREFIX_ANIM, createEvalSymbol } from '../define'; import { IValueProxyFactory } from '../value-proxy'; import { ColorTrack, ColorTrackEval } from './color-track'; diff --git a/cocos/animation/value-proxy-factories/uniform.ts b/cocos/animation/value-proxy-factories/uniform.ts index 540d0e5969c..7d4b4804438 100644 --- a/cocos/animation/value-proxy-factories/uniform.ts +++ b/cocos/animation/value-proxy-factories/uniform.ts @@ -31,7 +31,7 @@ import { deviceManager, Type } from '../../gfx'; import { Pass } from '../../render-scene/core/pass'; import { getDefaultFromType, getStringFromType } from '../../render-scene/core/pass-utils'; import { IValueProxy, IValueProxyFactory } from '../value-proxy'; -import { warn, warnID } from '../../core'; +import { warn, warnID } from '@base/debug'; /** * @en diff --git a/cocos/asset/asset-manager/asset-manager.ts b/cocos/asset/asset-manager/asset-manager.ts index b87c72263d1..24db8eaf9eb 100644 --- a/cocos/asset/asset-manager/asset-manager.ts +++ b/cocos/asset/asset-manager/asset-manager.ts @@ -25,7 +25,8 @@ import { BUILD, EDITOR, PREVIEW } from 'internal:constants'; import { Asset } from '../assets/asset'; -import { error, sys, Settings, settings, path, EventTarget } from '../../core'; +import { error } from '@base/debug'; +import { sys, Settings, settings, path, EventTarget } from '../../core'; import { cclegacy } from '@base/global'; import Bundle from './bundle'; import Cache from './cache'; diff --git a/cocos/asset/asset-manager/bundle.ts b/cocos/asset/asset-manager/bundle.ts index 6e63a44eefa..d78bfa4d1aa 100644 --- a/cocos/asset/asset-manager/bundle.ts +++ b/cocos/asset/asset-manager/bundle.ts @@ -25,7 +25,7 @@ import { Asset } from '../assets/asset'; import { SceneAsset } from '../assets/scene-asset'; -import { error, errorID } from '../../core'; +import { error, errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import Config from './config'; import { IAddressableInfo, IAssetInfo, IConfigOption, ISceneInfo } from './config'; diff --git a/cocos/asset/asset-manager/deprecated.ts b/cocos/asset/asset-manager/deprecated.ts index 0600725d42f..7e60a6bd9fa 100644 --- a/cocos/asset/asset-manager/deprecated.ts +++ b/cocos/asset/asset-manager/deprecated.ts @@ -24,7 +24,8 @@ import { BUILD } from 'internal:constants'; import { Asset } from '../assets/asset'; -import { getError, macro, path, removeProperty, replaceProperty } from '../../core'; +import { getError } from '@base/debug'; +import { macro, path, removeProperty, replaceProperty } from '../../core'; import { cclegacy } from '@base/global'; import Cache from './cache'; import assetManager from './asset-manager'; diff --git a/cocos/asset/asset-manager/deserialize.ts b/cocos/asset/asset-manager/deserialize.ts index 0b0afe26df5..6149e63b840 100644 --- a/cocos/asset/asset-manager/deserialize.ts +++ b/cocos/asset/asset-manager/deserialize.ts @@ -26,7 +26,8 @@ import { EDITOR } from 'internal:constants'; import { Asset } from '../assets/asset'; import { MissingScript } from '../../misc/missing-script'; import { deserialize, Details } from '../../serialization/deserialize'; -import { error, js } from '../../core'; +import { error } from '@base/debug'; +import { js } from '../../core'; import { dependMap, nativeDependMap } from './depend-maps'; import { decodeUuid } from './helper'; diff --git a/cocos/asset/asset-manager/download-script.ts b/cocos/asset/asset-manager/download-script.ts index 96ded9e984d..0c1217a8463 100644 --- a/cocos/asset/asset-manager/download-script.ts +++ b/cocos/asset/asset-manager/download-script.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { getError } from '../../core'; +import { getError } from '@base/debug'; import { ccwindow } from '@base/global'; const ccdocument = ccwindow.document; diff --git a/cocos/asset/asset-manager/editor-path-replace.ts b/cocos/asset/asset-manager/editor-path-replace.ts index d45197b25de..f5d2f16146e 100644 --- a/cocos/asset/asset-manager/editor-path-replace.ts +++ b/cocos/asset/asset-manager/editor-path-replace.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ import { EDITOR, NATIVE, PREVIEW, TEST } from 'internal:constants'; -import { assert, error, Settings, settings } from '../../core'; +import { assert, error } from '@base/debug'; +import { Settings, settings } from '../../core'; import { fetchPipeline, pipeline } from './shared'; import Task from './task'; diff --git a/cocos/asset/asset-manager/fetch.ts b/cocos/asset/asset-manager/fetch.ts index 61d9115705b..eae296b70f0 100644 --- a/cocos/asset/asset-manager/fetch.ts +++ b/cocos/asset/asset-manager/fetch.ts @@ -23,7 +23,7 @@ */ import { Asset } from '../assets'; -import { error } from '../../core'; +import { error } from '@base/debug'; import { cclegacy } from '@base/global'; import packManager from './pack-manager'; import RequestItem from './request-item'; diff --git a/cocos/asset/asset-manager/helper.ts b/cocos/asset/asset-manager/helper.ts index ff48d0d324f..c067323ca03 100644 --- a/cocos/asset/asset-manager/helper.ts +++ b/cocos/asset/asset-manager/helper.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ import { cclegacy } from '@base/global'; -import { error } from '../../core'; +import { error } from '@base/debug'; import RequestItem from './request-item'; import { bundles, transformPipeline } from './shared'; import Task from './task'; diff --git a/cocos/asset/asset-manager/load.ts b/cocos/asset/asset-manager/load.ts index fc7b49f123d..2f30888df5b 100644 --- a/cocos/asset/asset-manager/load.ts +++ b/cocos/asset/asset-manager/load.ts @@ -23,7 +23,7 @@ */ import { BUILD, EDITOR, PREVIEW } from 'internal:constants'; import { Asset } from '../assets/asset'; -import { error } from '../../core'; +import { error } from '@base/debug'; import { cclegacy } from '@base/global'; import packManager from './pack-manager'; import parser from './parser'; diff --git a/cocos/asset/asset-manager/pack-manager.ts b/cocos/asset/asset-manager/pack-manager.ts index 28885e02e9f..59049c2af77 100644 --- a/cocos/asset/asset-manager/pack-manager.ts +++ b/cocos/asset/asset-manager/pack-manager.ts @@ -25,7 +25,8 @@ import { ImageAsset } from '../assets/image-asset'; import { Texture2D } from '../assets/texture-2d'; import { isGeneralPurposePack, packCustomObjData, unpackJSONs } from '../../serialization/deserialize'; -import { assertIsTrue, error, errorID, js } from '../../core'; +import { assertIsTrue, js } from '../../core'; +import { error, errorID } from '@base/debug'; import Cache from './cache'; import downloader from './downloader'; import { transform } from './helper'; diff --git a/cocos/asset/asset-manager/parser.ts b/cocos/asset/asset-manager/parser.ts index 6acf6f4fba4..220a61d5d02 100644 --- a/cocos/asset/asset-manager/parser.ts +++ b/cocos/asset/asset-manager/parser.ts @@ -25,7 +25,8 @@ import { ImageData } from 'pal/image'; import { IMemoryImageSource } from '../../../pal/image/types'; import { ImageAsset } from '../assets/image-asset'; -import { js, warn } from '../../core'; +import { js } from '../../core'; +import { warn } from '@base/debug'; import Cache from './cache'; import deserialize from './deserialize'; import { isScene } from './helper'; diff --git a/cocos/asset/asset-manager/pipeline.ts b/cocos/asset/asset-manager/pipeline.ts index 2b743a131ab..6239d98dd0c 100644 --- a/cocos/asset/asset-manager/pipeline.ts +++ b/cocos/asset/asset-manager/pipeline.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { warnID } from '../../core'; +import { warnID } from '@base/debug'; import Task from './task'; /** diff --git a/cocos/asset/asset-manager/plist-parser.ts b/cocos/asset/asset-manager/plist-parser.ts index 5f240990996..5909a002f47 100644 --- a/cocos/asset/asset-manager/plist-parser.ts +++ b/cocos/asset/asset-manager/plist-parser.ts @@ -25,7 +25,7 @@ THE SOFTWARE. */ -import { warnID } from '../../core'; +import { warnID } from '@base/debug'; /** * A SAX Parser diff --git a/cocos/asset/asset-manager/url-transformer.ts b/cocos/asset/asset-manager/url-transformer.ts index a5bd757054a..0742368d8fa 100644 --- a/cocos/asset/asset-manager/url-transformer.ts +++ b/cocos/asset/asset-manager/url-transformer.ts @@ -23,7 +23,8 @@ */ import { EDITOR, PREVIEW } from 'internal:constants'; -import { warnID, js, path } from '../../core'; +import { warnID } from '@base/debug'; +import { js, path } from '../../core'; import { cclegacy } from '@base/global'; import Config from './config'; import { IAddressableInfo, IAssetInfo } from './config'; diff --git a/cocos/asset/asset-manager/utilities.ts b/cocos/asset/asset-manager/utilities.ts index 0bb94059fdc..4e419e8f36a 100644 --- a/cocos/asset/asset-manager/utilities.ts +++ b/cocos/asset/asset-manager/utilities.ts @@ -25,7 +25,8 @@ import { EDITOR } from 'internal:constants'; import { Asset } from '../assets/asset'; import { cclegacy } from '@base/global'; -import { error, js, misc } from '../../core'; +import { error } from '@base/debug'; +import { js, misc } from '../../core'; import Config from './config'; import { dependMap, nativeDependMap } from './depend-maps'; import dependUtil from './depend-util'; diff --git a/cocos/asset/assets/asset.ts b/cocos/asset/assets/asset.ts index 8346cf73e44..dcb1a34708e 100644 --- a/cocos/asset/assets/asset.ts +++ b/cocos/asset/assets/asset.ts @@ -24,7 +24,8 @@ */ import { EDITOR, PREVIEW } from 'internal:constants'; -import { _decorator, Eventify, path, debug, getError, CCObject } from '../../core'; +import { _decorator, Eventify, path, CCObject } from '../../core'; +import { debug, getError } from '@base/debug'; import { cclegacy } from '@base/global'; import { getUrlWithUuid } from '../asset-manager/helper'; import { Node } from '../../scene-graph'; diff --git a/cocos/asset/assets/effect-asset.ts b/cocos/asset/assets/effect-asset.ts index 6d729b226bf..8c757ea3662 100644 --- a/cocos/asset/assets/effect-asset.ts +++ b/cocos/asset/assets/effect-asset.ts @@ -31,7 +31,7 @@ import { MacroRecord } from '../../render-scene/core/pass-utils'; import { programLib } from '../../render-scene/core/program-lib'; import { Asset } from './asset'; import { cclegacy } from '@base/global'; -import { warnID } from '../../core'; +import { warnID } from '@base/debug'; import { ProgramLibrary } from '../../rendering/custom/private'; import { addEffectDefaultProperties, getCombinationDefines } from '../../render-scene/core/program-utils'; diff --git a/cocos/asset/assets/image-asset.jsb.ts b/cocos/asset/assets/image-asset.jsb.ts index 13f4a1def9f..9ee7b8805b0 100644 --- a/cocos/asset/assets/image-asset.jsb.ts +++ b/cocos/asset/assets/image-asset.jsb.ts @@ -27,7 +27,8 @@ import { Format, FormatFeatureBit, deviceManager } from '../../gfx'; import { ImageData } from 'pal/image'; import { IMemoryImageSource, ImageSource } from '../../../pal/image/types'; import { PixelFormat } from './asset-enum'; -import { sys, macro, warnID, error } from '../../core'; +import { sys, macro } from '../../core'; +import { warnID, error } from '@base/debug'; import { cclegacy } from '@base/global'; import { patch_cc_ImageAsset } from '../../native-binding/decorators'; import './asset'; diff --git a/cocos/asset/assets/image-asset.ts b/cocos/asset/assets/image-asset.ts index 00d0802f1c0..838bd67d6ff 100644 --- a/cocos/asset/assets/image-asset.ts +++ b/cocos/asset/assets/image-asset.ts @@ -30,7 +30,8 @@ import { ImageSource, IMemoryImageSource, RawDataType } from '../../../pal/image import { Device, Format, FormatFeatureBit, deviceManager, API } from '../../gfx'; import { Asset } from './asset'; import { PixelFormat } from './asset-enum'; -import { warnID, macro, sys, warn } from '../../core'; +import { warnID, warn } from '@base/debug'; +import { macro, sys } from '../../core'; import { cclegacy, ccwindow } from '@base/global'; import { Enum } from '../../core/value-types/enum'; diff --git a/cocos/asset/assets/material.ts b/cocos/asset/assets/material.ts index c712cf24d06..de75288f64f 100644 --- a/cocos/asset/assets/material.ts +++ b/cocos/asset/assets/material.ts @@ -29,7 +29,8 @@ import { Texture, Type } from '../../gfx'; import { TextureBase } from './texture-base'; import { IPassInfoFull, Pass, PassOverrides } from '../../render-scene/core/pass'; import { MacroRecord, MaterialProperty } from '../../render-scene/core/pass-utils'; -import { Color, warnID, Vec4, warn } from '../../core'; +import { Color, Vec4 } from '../../core'; +import { warnID, warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { SRGBToLinear } from '../../rendering/pipeline-funcs'; import { Renderer } from '../../misc/renderer'; diff --git a/cocos/asset/assets/render-texture.ts b/cocos/asset/assets/render-texture.ts index 902b8ba0285..6d13eaa996a 100644 --- a/cocos/asset/assets/render-texture.ts +++ b/cocos/asset/assets/render-texture.ts @@ -24,7 +24,8 @@ import { ccclass } from 'cc.decorator'; import { EDITOR, TEST } from 'internal:constants'; -import { clamp, errorID } from '../../core'; +import { clamp } from '../../core'; +import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { Texture, ColorAttachment, DepthStencilAttachment, GeneralBarrierInfo, AccessFlagBit, RenderPassInfo, Format, deviceManager, BufferTextureCopy, TextureFlags, TextureFlagBit } from '../../gfx'; import { RenderWindow, IRenderWindowInfo } from '../../render-scene/core/render-window'; diff --git a/cocos/asset/assets/simple-texture.ts b/cocos/asset/assets/simple-texture.ts index 945f8eea937..fdaeec7a3f1 100644 --- a/cocos/asset/assets/simple-texture.ts +++ b/cocos/asset/assets/simple-texture.ts @@ -28,7 +28,8 @@ import { ImageData } from 'pal/image'; import { IMemoryImageSource } from '../../../pal/image/types'; import { TextureFlagBit, TextureUsageBit, API, Texture, TextureInfo, TextureViewInfo, Device, BufferTextureCopy } from '../../gfx'; -import { assertID, error, js, macro } from '../../core'; +import { assertID, error } from '@base/debug'; +import { js, macro } from '../../core'; import { cclegacy } from '@base/global'; import { Filter } from './asset-enum'; import { ImageAsset } from './image-asset'; diff --git a/cocos/asset/assets/texture-base.ts b/cocos/asset/assets/texture-base.ts index 630cf30c52e..aae15e54032 100644 --- a/cocos/asset/assets/texture-base.ts +++ b/cocos/asset/assets/texture-base.ts @@ -28,7 +28,8 @@ import { ccclass, serializable } from 'cc.decorator'; 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 { errorID, murmurhash2_32_gc, ccenum, js } from '../../core'; +import { errorID } from '@base/debug'; +import { murmurhash2_32_gc, ccenum, js } from '../../core'; import { cclegacy } from '@base/global'; ccenum(Format); diff --git a/cocos/asset/assets/texture-cube.ts b/cocos/asset/assets/texture-cube.ts index 1d166f72475..cd2d26e0557 100644 --- a/cocos/asset/assets/texture-cube.ts +++ b/cocos/asset/assets/texture-cube.ts @@ -29,7 +29,8 @@ import { ImageAsset } from './image-asset'; import { PresumedGFXTextureInfo, PresumedGFXTextureViewInfo, SimpleTexture } from './simple-texture'; import { ITexture2DCreateInfo, Texture2D } from './texture-2d'; import { ccwindow, cclegacy } from '@base/global'; -import { error, js, sys } from '../../core'; +import { error } from '@base/debug'; +import { js, sys } from '../../core'; import { OS } from '../../../pal/system-info/enum-type'; export type ITextureCubeCreateInfo = ITexture2DCreateInfo; diff --git a/cocos/audio/audio-manager.ts b/cocos/audio/audio-manager.ts index a7041c5dd52..60c4f10015a 100644 --- a/cocos/audio/audio-manager.ts +++ b/cocos/audio/audio-manager.ts @@ -23,7 +23,8 @@ */ import { AudioPlayer, OneShotAudio } from 'pal/audio'; -import { error, js } from '../core'; +import { error } from '@base/debug'; +import { js } from '../core'; type ManagedAudio = AudioPlayer | OneShotAudio; interface AudioInfo { diff --git a/cocos/audio/audio-source.ts b/cocos/audio/audio-source.ts index ab4378f6817..8a1b82dabde 100644 --- a/cocos/audio/audio-source.ts +++ b/cocos/audio/audio-source.ts @@ -26,7 +26,8 @@ import { AudioPlayer, OneShotAudio } from 'pal/audio'; import { ccclass, help, menu, tooltip, type, range, serializable } from 'cc.decorator'; import { AudioPCMDataView, AudioState } from '../../pal/audio/type'; import { Component } from '../scene-graph/component'; -import { clamp, error, warn } from '../core'; +import { clamp } from '../core'; +import { error, warn } from '@base/debug'; import { AudioClip } from './audio-clip'; import { audioManager } from './audio-manager'; import { Node } from '../scene-graph'; diff --git a/cocos/base/debug/package.json b/cocos/base/debug/package.json new file mode 100644 index 00000000000..675927065da --- /dev/null +++ b/cocos/base/debug/package.json @@ -0,0 +1,15 @@ +{ + "$schema": "../../../schemas/module-config.schema.json", + "name": "@base/debug", + "version": "1.0.0", + "description": "", + "scripts": { + "build": "node ./scripts/build-debug-infos.js" + }, + "license": "MIT", + "exports": { + ".": { + "types": "./src/index.ts" + } + } +} diff --git a/cocos/base/debug/scripts/build-debug-infos.js b/cocos/base/debug/scripts/build-debug-infos.js new file mode 100644 index 00000000000..ea317882def --- /dev/null +++ b/cocos/base/debug/scripts/build-debug-infos.js @@ -0,0 +1,53 @@ +const fs = require('fs-extra'); +const ps = require('path'); + +function formatPath (path) { + return path.replace(/\\/g, '/'); +} + +function buildDebugInfos () { + let readContent = fs.readFileSync(formatPath(ps.join(__dirname, '../../../../EngineErrorMap.md')), 'utf-8'); + let titleRegExp = /### \d+/g; + let debugInfos = {}; + + let result1 = titleRegExp.exec(readContent); + while (result1) { + let result2 = titleRegExp.exec(readContent); + let errInfoHead = result1.index + result1[0].length; + let errInfoTail = result2? result2.index: readContent.length; + + let errCode = /\d+/.exec(result1[0])[0]; + let errInfo = readContent.slice(errInfoHead, errInfoTail); + errInfo = errInfo.replace(/```/g, ' '); + errInfo = errInfo.trim(); + errInfo = errInfo.replace(/\r\n/g, '\n'); + + if (!errInfo.includes('')) { + debugInfos[`${errCode}`] = errInfo; + } + + result1 = result2; + } + + let writeContent = JSON.stringify(debugInfos, null, 4); + fs.outputFileSync(formatPath(ps.join(__dirname, '../lib/DebugInfos.json')), writeContent); + + const dtsContent = ` +/** + * This is a declaration file for 'DebugInfos.json' + * which is generated from 'EngineErrorMap.md'. + * You may run cli command + * \`npm run build\` to generate the json file. + */ + +/** + * Engine error maps. + * The keys are error codes and their values are format strings. + */ +declare const $: Record; + +export default $;`; + fs.outputFileSync(formatPath(ps.join(__dirname, '../lib/DebugInfos.d.ts')), dtsContent); +}; + +buildDebugInfos(); \ No newline at end of file diff --git a/cocos/core/platform/debug.ts b/cocos/base/debug/src/index.ts similarity index 99% rename from cocos/core/platform/debug.ts rename to cocos/base/debug/src/index.ts index 522b1adbd4a..479d3d0ff36 100644 --- a/cocos/core/platform/debug.ts +++ b/cocos/base/debug/src/index.ts @@ -24,7 +24,7 @@ import { EDITOR, JSB, DEV, DEBUG } from 'internal:constants'; import { ccwindow, cclegacy } from '@base/global'; -import debugInfos from '../../../DebugInfos'; +import debugInfos from '../lib/DebugInfos'; const ccdocument = ccwindow.document; diff --git a/cocos/base/debug/tsconfig.json b/cocos/base/debug/tsconfig.json new file mode 100644 index 00000000000..67f2e830c07 --- /dev/null +++ b/cocos/base/debug/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./lib/", + "rootDir": "./src/", + "baseUrl": "./" + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/cocos/base/global/package.json b/cocos/base/global/package.json index e62f4aba975..edf307a1ab4 100644 --- a/cocos/base/global/package.json +++ b/cocos/base/global/package.json @@ -8,7 +8,6 @@ "license": "MIT", "exports": { ".": { - "node": "./package.json", "types": "./src/index.ts" } } diff --git a/cocos/core/data/class.ts b/cocos/core/data/class.ts index d043768a127..1dd13547b43 100644 --- a/cocos/core/data/class.ts +++ b/cocos/core/data/class.ts @@ -25,7 +25,7 @@ import { DEV, EDITOR, SUPPORT_JIT, TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { errorID, warnID, error } from '../platform/debug'; +import { errorID, warnID, error } from '@base/debug'; import * as js from '../utils/js'; import { getSuper } from '../utils/js'; import { BitMask } from '../value-types'; diff --git a/cocos/core/data/decorators/property.ts b/cocos/core/data/decorators/property.ts index 269ddd87ec7..87029d9f59e 100644 --- a/cocos/core/data/decorators/property.ts +++ b/cocos/core/data/decorators/property.ts @@ -26,7 +26,7 @@ import { DEV, EDITOR, JSB, TEST } from 'internal:constants'; import { CCString, CCInteger, CCFloat, CCBoolean } from '../utils/attribute'; import { IExposedAttributes } from '../utils/attribute-defines'; import { LegacyPropertyDecorator, getSubDict, BabelPropertyDecoratorDescriptor, Initializer, getOrCreateClassDecoratorStash } from './utils'; -import { warnID, errorID } from '../../platform/debug'; +import { warnID, errorID } from '@base/debug'; import { getFullFormOfProperty } from '../utils/preprocess-class'; import { ClassStash, PropertyStash, PropertyStashInternalFlag } from '../class-stash'; import { getClassName, mixin } from '../../utils/js-typed'; diff --git a/cocos/core/data/decorators/utils.ts b/cocos/core/data/decorators/utils.ts index 8ea1e4e95bc..1d94c1e7ad2 100644 --- a/cocos/core/data/decorators/utils.ts +++ b/cocos/core/data/decorators/utils.ts @@ -24,7 +24,7 @@ import { DEV } from 'internal:constants'; import { CCClass } from '../class'; -import { error } from '../../platform/debug'; +import { error } from '@base/debug'; import { getClassName } from '../../utils/js-typed'; import type { ClassStash } from '../class-stash'; diff --git a/cocos/core/data/object.ts b/cocos/core/data/object.ts index 2a3fe9f4876..dbf2338b8e1 100644 --- a/cocos/core/data/object.ts +++ b/cocos/core/data/object.ts @@ -26,7 +26,7 @@ import { SUPPORT_JIT, EDITOR, TEST, JSB, EDITOR_NOT_IN_PREVIEW } from 'internal: import { cclegacy } from '@base/global'; import * as js from '../utils/js'; import { CCClass } from './class'; -import { errorID, warnID } from '../platform/debug'; +import { errorID, warnID } from '@base/debug'; import { EditorExtendableObject, editorExtrasTag } from './editor-extras-tag'; import { copyAllProperties } from '../utils/js'; diff --git a/cocos/core/data/utils/attribute.ts b/cocos/core/data/utils/attribute.ts index 6296d662b2e..014a44e6107 100644 --- a/cocos/core/data/utils/attribute.ts +++ b/cocos/core/data/utils/attribute.ts @@ -24,7 +24,7 @@ */ import { EDITOR } from 'internal:constants'; -import { log, warnID } from '../../platform/debug'; +import { log, warnID } from '@base/debug'; import { formatStr, get, getClassName, isChildClassOf, value } from '../../utils/js'; import { isPlainEmptyObj_DEV } from '../../utils/misc'; import { cclegacy } from '@base/global'; diff --git a/cocos/core/data/utils/compact-value-type-array.ts b/cocos/core/data/utils/compact-value-type-array.ts index 338ac3450df..185fc1d13da 100644 --- a/cocos/core/data/utils/compact-value-type-array.ts +++ b/cocos/core/data/utils/compact-value-type-array.ts @@ -24,7 +24,7 @@ import { ccclass, serializable } from 'cc.decorator'; import { Vec3, Quat, Vec4, Vec2, Mat4 } from '../../math'; -import { error } from '../../platform'; +import { error } from '@base/debug'; export enum StorageUnit { Uint8, Uint16, Uint32, diff --git a/cocos/core/data/utils/extends-enum.ts b/cocos/core/data/utils/extends-enum.ts index 09a4abe70f1..a4849d231f5 100644 --- a/cocos/core/data/utils/extends-enum.ts +++ b/cocos/core/data/utils/extends-enum.ts @@ -23,7 +23,7 @@ */ import { DEV } from 'internal:constants'; -import { errorID } from '../../platform/debug'; +import { errorID } from '@base/debug'; /** * @zh diff --git a/cocos/core/data/utils/preprocess-class.ts b/cocos/core/data/utils/preprocess-class.ts index d9cc527aa6a..1164ba98373 100644 --- a/cocos/core/data/utils/preprocess-class.ts +++ b/cocos/core/data/utils/preprocess-class.ts @@ -24,7 +24,7 @@ */ import { DEV, EDITOR, TEST } from 'internal:constants'; -import { error, errorID, warn, warnID } from '../../platform/debug'; +import { error, errorID, warn, warnID } from '@base/debug'; import * as js from '../../utils/js'; import { PrimitiveType } from './attribute'; import { cclegacy } from '@base/global'; diff --git a/cocos/core/geometry/deprecated-3.0.0.ts b/cocos/core/geometry/deprecated-3.0.0.ts index 7d9a0692128..4d025b368b7 100644 --- a/cocos/core/geometry/deprecated-3.0.0.ts +++ b/cocos/core/geometry/deprecated-3.0.0.ts @@ -34,7 +34,7 @@ import { AABB } from './aabb'; import { OBB } from './obb'; import { Capsule } from './capsule'; import { Frustum } from './frustum'; -import { warn } from '../platform'; +import { warn } from '@base/debug'; replaceProperty(intersect, 'intersect', [ { diff --git a/cocos/core/geometry/geometry-native-ext.ts b/cocos/core/geometry/geometry-native-ext.ts index bf4ecff2732..b927518d529 100644 --- a/cocos/core/geometry/geometry-native-ext.ts +++ b/cocos/core/geometry/geometry-native-ext.ts @@ -30,7 +30,7 @@ import { Sphere } from './sphere'; import { AABB } from './aabb'; import { Capsule } from './capsule'; import { Frustum } from './frustum'; -import { assert, error } from '../platform'; +import { assert, error } from '@base/debug'; /** * cache jsb attributes in js, reduce cross language invokations. diff --git a/cocos/core/geometry/spline.ts b/cocos/core/geometry/spline.ts index 876d4a0141c..b54d7ca3269 100644 --- a/cocos/core/geometry/spline.ts +++ b/cocos/core/geometry/spline.ts @@ -24,7 +24,7 @@ import { assertIsTrue } from '../data/utils/asserts'; import { clamp, Vec3 } from '../math'; -import { warnID } from '../platform/debug'; +import { warnID } from '@base/debug'; import enums from './enums'; export enum SplineMode { diff --git a/cocos/core/index.ts b/cocos/core/index.ts index 51394cc89f7..45d307cbd74 100644 --- a/cocos/core/index.ts +++ b/cocos/core/index.ts @@ -23,7 +23,7 @@ THE SOFTWARE. */ -import { cclegacy, VERSION } from '@base/global'; +import { cclegacy } from '@base/global'; import * as geometry from './geometry'; import * as math from './math'; import * as memop from './memop'; @@ -33,7 +33,7 @@ import './deprecated-3.7.0'; cclegacy.math = math; cclegacy.geometry = geometry; -export { math, memop, geometry, VERSION, cclegacy }; +export { math, memop, geometry }; export * from './math'; export * from './memop'; diff --git a/cocos/core/internal-index.ts b/cocos/core/internal-index.ts index 25bfb414cf8..536420acc89 100644 --- a/cocos/core/internal-index.ts +++ b/cocos/core/internal-index.ts @@ -51,8 +51,6 @@ export { EasingMethod } from './curves/easing-method'; export { CallbacksInvoker } from './event/callbacks-invoker'; export { applyMixins } from './event/event-target-factory'; -export { _resetDebugSetting } from './platform/debug'; - /** * @engineInternal */ diff --git a/cocos/core/legacy.ts b/cocos/core/legacy.ts index 3bf803067e4..55643907dfc 100644 --- a/cocos/core/legacy.ts +++ b/cocos/core/legacy.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import * as debug from './platform/debug'; +import * as debug from '@base/debug'; import { _normalize, basename, changeBasename, changeExtname, dirname, extname, getSeperator, join, mainFileName, stripSep } from './utils/path'; import { cclegacy } from '@base/global'; diff --git a/cocos/core/math/vec2.ts b/cocos/core/math/vec2.ts index 2b8b58514da..59183571de8 100644 --- a/cocos/core/math/vec2.ts +++ b/cocos/core/math/vec2.ts @@ -31,7 +31,7 @@ import { IMat3Like, IMat4Like, IVec2Like } from './type-define'; import { clamp, EPSILON, random } from './utils'; import { Vec3 } from './vec3'; -import { warn } from '../platform/debug'; +import { warn } from '@base/debug'; /** * @en Representation of 2D vectors and points. diff --git a/cocos/core/math/vec3.ts b/cocos/core/math/vec3.ts index afac9896b3f..a5bd4181af5 100644 --- a/cocos/core/math/vec3.ts +++ b/cocos/core/math/vec3.ts @@ -29,7 +29,7 @@ import { ValueType } from '../value-types/value-type'; import { Mat4 } from './mat4'; import { IMat3Like, IMat4Like, IQuatLike, IVec3Like } from './type-define'; import { clamp, EPSILON, lerp, random } from './utils'; -import { warn } from '../platform/debug'; +import { warn } from '@base/debug'; /** * @en Representation of 3D vectors and points. diff --git a/cocos/core/math/vec4.ts b/cocos/core/math/vec4.ts index 6ade873f9cb..d5659705b12 100644 --- a/cocos/core/math/vec4.ts +++ b/cocos/core/math/vec4.ts @@ -29,7 +29,7 @@ import { ValueType } from '../value-types/value-type'; import { Mat4 } from './mat4'; import { IMat4Like, IQuatLike, IVec4Like, IColorLike } from './type-define'; import { clamp, EPSILON, random } from './utils'; -import { warn } from '../platform/debug'; +import { warn } from '@base/debug'; /** * @en Representation of four-dimensional vectors. diff --git a/cocos/core/memop/pool.ts b/cocos/core/memop/pool.ts index a0a6f505a68..2a8c23602de 100644 --- a/cocos/core/memop/pool.ts +++ b/cocos/core/memop/pool.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { warnID } from '../platform/debug'; +import { warnID } from '@base/debug'; import { ScalableContainer } from './scalable-container'; /** diff --git a/cocos/core/platform/index.ts b/cocos/core/platform/index.ts index 6e4e54e44d8..313f93dd098 100644 --- a/cocos/core/platform/index.ts +++ b/cocos/core/platform/index.ts @@ -28,21 +28,6 @@ import './deprecated'; export * from './sys'; export * from './macro'; export * from './visible-rect'; -export { - debug, - log, - error, - warn, - assert, - logID, - errorID, - warnID, - assertID, - isDisplayStats, - setDisplayStats, - getError, - DebugMode, -} from './debug'; export { screen } from './screen'; export type { Screen } from './screen'; diff --git a/cocos/core/platform/screen.ts b/cocos/core/platform/screen.ts index 840b33f0bcd..2e627909e9c 100644 --- a/cocos/core/platform/screen.ts +++ b/cocos/core/platform/screen.ts @@ -29,7 +29,7 @@ import { IScreenOptions, screenAdapter } from 'pal/screen-adapter'; import { cclegacy } from '@base/global'; import { Size } from '../math'; import { Settings, settings } from '../settings'; -import { error, warn, warnID } from './debug'; +import { error, warn, warnID } from '@base/debug'; import { PalScreenEvent } from '../../../pal/screen-adapter/enum-type'; /** * @en The screen API provides an easy way to do some screen managing stuff. diff --git a/cocos/core/platform/sys.ts b/cocos/core/platform/sys.ts index 9ad9b5c3174..c53cb258216 100644 --- a/cocos/core/platform/sys.ts +++ b/cocos/core/platform/sys.ts @@ -29,7 +29,7 @@ import { WECHAT, WECHAT_MINI_PROGRAM } from 'internal:constants'; import { cclegacy } from '@base/global'; import { Rect } from '../math/rect'; import { Vec2 } from '../math/vec2'; -import { warnID, log } from './debug'; +import { warnID, log } from '@base/debug'; import { NetworkType, Language, OS, Platform, BrowserType, Feature } from '../../../pal/system-info/enum-type'; import { screen } from './screen'; diff --git a/cocos/core/scheduler.ts b/cocos/core/scheduler.ts index d8cb9f299b6..ad95963baa9 100644 --- a/cocos/core/scheduler.ts +++ b/cocos/core/scheduler.ts @@ -23,11 +23,11 @@ THE SOFTWARE. */ -import { cclegacy } from '@base/global'; -import { IDGenerator } from './utils/id-generator'; -import { createMap } from './utils/js'; -import { System } from './system'; -import { errorID, warnID, logID, assertID } from './platform/debug'; +import { cclegacy } from '@base/global'; +import { IDGenerator } from './utils/id-generator'; +import { createMap } from './utils/js'; +import { System } from './system'; +import { errorID, warnID, logID, assertID } from '@base/debug'; const MAX_POOL_SIZE = 20; diff --git a/cocos/core/utils/array.ts b/cocos/core/utils/array.ts index c01f4605919..fcdacde0491 100644 --- a/cocos/core/utils/array.ts +++ b/cocos/core/utils/array.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { logID } from '../platform/debug'; +import { logID } from '@base/debug'; export { default as MutableForwardIterator } from './mutable-forward-iterator'; diff --git a/cocos/core/utils/js-typed.ts b/cocos/core/utils/js-typed.ts index 04e8c08b152..a3b9a4f8405 100644 --- a/cocos/core/utils/js-typed.ts +++ b/cocos/core/utils/js-typed.ts @@ -23,8 +23,8 @@ */ import { EDITOR, DEV, TEST } from 'internal:constants'; -import { warnID, error, errorID, StringSubstitution, log } from '../platform/debug'; -import { IDGenerator } from './id-generator'; +import { warnID, error, errorID, StringSubstitution, log } from '@base/debug'; +import { IDGenerator } from './id-generator'; const tempCIDGenerator = new IDGenerator('TmpCId.'); diff --git a/cocos/core/utils/misc.ts b/cocos/core/utils/misc.ts index 53a0f585566..73cd0bc7b06 100644 --- a/cocos/core/utils/misc.ts +++ b/cocos/core/utils/misc.ts @@ -29,7 +29,7 @@ import { DEV } from 'internal:constants'; import { setTimeoutRAF } from '@pal/utils'; import { cclegacy } from '@base/global'; import { getClassName, getset, isEmptyObject } from './js'; -import { warnID } from '../platform/debug'; +import { warnID } from '@base/debug'; import { macro } from '../platform/macro'; import type { Component } from '../../scene-graph'; diff --git a/cocos/core/utils/x-deprecated.ts b/cocos/core/utils/x-deprecated.ts index d446b3c5a28..3ecca61de62 100644 --- a/cocos/core/utils/x-deprecated.ts +++ b/cocos/core/utils/x-deprecated.ts @@ -29,7 +29,7 @@ /* eslint-disable prefer-const */ import { DEBUG } from 'internal:constants'; -import { error, errorID, warn, warnID } from '../platform/debug'; +import { error, errorID, warn, warnID } from '@base/debug'; let defaultLogTimes = 10; diff --git a/cocos/core/value-types/bitmask.ts b/cocos/core/value-types/bitmask.ts index acf4ef3bd00..dcc688808a0 100644 --- a/cocos/core/value-types/bitmask.ts +++ b/cocos/core/value-types/bitmask.ts @@ -22,10 +22,10 @@ THE SOFTWARE. */ -import { EDITOR, TEST } from 'internal:constants'; -import { value } from '../utils/js'; -import { cclegacy } from '@base/global'; -import { errorID } from '../platform/debug'; +import { EDITOR, TEST } from 'internal:constants'; +import { value } from '../utils/js'; +import { cclegacy } from '@base/global'; +import { errorID } from '@base/debug'; /** * @en diff --git a/cocos/core/value-types/enum.ts b/cocos/core/value-types/enum.ts index d68a49e98f8..3609736a42d 100644 --- a/cocos/core/value-types/enum.ts +++ b/cocos/core/value-types/enum.ts @@ -26,7 +26,7 @@ import { EDITOR, TEST, DEV } from 'internal:constants'; import { value } from '../utils/js'; import { cclegacy } from '@base/global'; -import { errorID } from '../platform/debug'; +import { errorID } from '@base/debug'; import { assertIsTrue } from '../data/utils/asserts'; export type EnumType = Record; diff --git a/cocos/core/value-types/value-type.ts b/cocos/core/value-types/value-type.ts index 7d87ff2a964..d61616c4d44 100644 --- a/cocos/core/value-types/value-type.ts +++ b/cocos/core/value-types/value-type.ts @@ -23,7 +23,7 @@ THE SOFTWARE. */ -import { errorID } from '../platform/debug'; +import { errorID } from '@base/debug'; import * as js from '../utils/js'; import { cclegacy } from '@base/global'; diff --git a/cocos/dragon-bones/ArmatureDisplay.ts b/cocos/dragon-bones/ArmatureDisplay.ts index fea21ee8e53..257f1269b49 100644 --- a/cocos/dragon-bones/ArmatureDisplay.ts +++ b/cocos/dragon-bones/ArmatureDisplay.ts @@ -25,7 +25,8 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { Armature, Bone, EventObject, AnimationState } from '@cocos/dragonbones-js'; import { UIRenderer } from '../2d/framework/ui-renderer'; -import { Color, Enum, ccenum, errorID, RecyclePool, js, CCObject, EventTarget, _decorator, warn, error } from '../core'; +import { Color, Enum, ccenum, RecyclePool, js, CCObject, EventTarget, _decorator } from '../core'; +import { errorID, warn, error } from '@base/debug'; import { cclegacy } from '@base/global'; import { BlendFactor } from '../gfx'; import { AnimationCache, ArmatureCache, ArmatureFrame } from './ArmatureCache'; diff --git a/cocos/dragon-bones/CCArmatureDisplay.ts b/cocos/dragon-bones/CCArmatureDisplay.ts index 4d9918f91ff..db6658b58b2 100644 --- a/cocos/dragon-bones/CCArmatureDisplay.ts +++ b/cocos/dragon-bones/CCArmatureDisplay.ts @@ -24,7 +24,8 @@ */ import { Armature, DisplayData, IEventDispatcher, Slot } from '@cocos/dragonbones-js'; -import { Vec3, EventTarget, _decorator, warn } from '../core'; +import { Vec3, EventTarget, _decorator } from '../core'; +import { warn } from '@base/debug'; // eslint-disable-next-line import/named import { CCSlot } from './CCSlot'; import { ArmatureDisplay } from './ArmatureDisplay'; diff --git a/cocos/dragon-bones/CCSlot.ts b/cocos/dragon-bones/CCSlot.ts index 9d244949492..493a225ce26 100644 --- a/cocos/dragon-bones/CCSlot.ts +++ b/cocos/dragon-bones/CCSlot.ts @@ -24,7 +24,8 @@ import { BoneType, BinaryOffset, Slot } from '@cocos/dragonbones-js'; import { Texture2D } from '../asset/assets'; -import { Color, Mat4, _decorator, error } from '../core'; +import { Color, Mat4, _decorator } from '../core'; +import { error } from '@base/debug'; import { CCTextureData } from './CCTextureData'; const { ccclass } = _decorator; diff --git a/cocos/dragon-bones/DragonBonesAsset.ts b/cocos/dragon-bones/DragonBonesAsset.ts index 6d0d2d5d419..8f148ecbbdc 100644 --- a/cocos/dragon-bones/DragonBonesAsset.ts +++ b/cocos/dragon-bones/DragonBonesAsset.ts @@ -25,7 +25,8 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { Asset } from '../asset/assets'; import { ArmatureCache } from './ArmatureCache'; -import { Enum, _decorator, warn } from '../core'; +import { Enum, _decorator } from '../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { CCFactory } from './CCFactory'; import { Node } from '../scene-graph'; diff --git a/cocos/game/director.ts b/cocos/game/director.ts index 8c728de81f8..fd9cf42bd92 100644 --- a/cocos/game/director.ts +++ b/cocos/game/director.ts @@ -29,7 +29,8 @@ import { DEBUG, EDITOR, BUILD, TEST, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { SceneAsset } from '../asset/assets/scene-asset'; -import { System, EventTarget, Scheduler, js, errorID, error, assertID, warnID, macro, CCObject, isValid } from '../core'; +import { System, EventTarget, Scheduler, js, macro, CCObject, isValid } from '../core'; +import { errorID, error, assertID, warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { input } from '../input'; import { Root } from '../root'; diff --git a/cocos/game/game.ts b/cocos/game/game.ts index afa84144564..97070ec6e10 100644 --- a/cocos/game/game.ts +++ b/cocos/game/game.ts @@ -30,7 +30,8 @@ import { Pacer } from 'pal/pacer'; import { ConfigOrientation } from 'pal/screen-adapter'; import assetManager from '../asset/asset-manager/asset-manager'; import { IAssetManagerOptions } from '../asset/asset-manager/asset-manager'; -import { EventTarget, AsyncDelegate, sys, macro, screen, Settings, settings, assert, garbageCollectionManager, DebugMode, warn, _resetDebugSetting, log, error } from '../core'; +import { EventTarget, AsyncDelegate, sys, macro, screen, Settings, settings, garbageCollectionManager } from '../core'; +import { assert, DebugMode, warn, _resetDebugSetting, log, error } from '@base/debug'; import { VERSION, cclegacy } from '@base/global'; import { input } from '../input'; import { deviceManager, LegacyRenderMode } from '../gfx'; diff --git a/cocos/gfx/device-manager.ts b/cocos/gfx/device-manager.ts index 7a00e49d75b..f7274a8cc51 100644 --- a/cocos/gfx/device-manager.ts +++ b/cocos/gfx/device-manager.ts @@ -25,7 +25,8 @@ import { JSB, WEBGPU } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { error, getError, sys, screen, Settings, settings } from '../core'; +import { error, getError } from '@base/debug'; +import { sys, screen, Settings, settings } from '../core'; import { BindingMappingInfo, DeviceInfo, SwapchainInfo } from './base/define'; import { Device } from './base/device'; import { Swapchain } from './base/swapchain'; diff --git a/cocos/gfx/empty/empty-device.ts b/cocos/gfx/empty/empty-device.ts index e95bf30da9a..defbe9388c1 100644 --- a/cocos/gfx/empty/empty-device.ts +++ b/cocos/gfx/empty/empty-device.ts @@ -55,7 +55,7 @@ import { EmptyRenderPass } from './empty-render-pass'; import { EmptyShader } from './empty-shader'; import { EmptySwapchain } from './empty-swapchain'; import { EmptyTexture } from './empty-texture'; -import { debug } from '../../core'; +import { debug } from '@base/debug'; import { cclegacy } from '@base/global'; import { ImageAsset } from '../../asset/assets'; diff --git a/cocos/gfx/empty/empty-shader.ts b/cocos/gfx/empty/empty-shader.ts index 3df59be25aa..9db1bee8d81 100644 --- a/cocos/gfx/empty/empty-shader.ts +++ b/cocos/gfx/empty/empty-shader.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { debug } from '../../core'; +import { debug } from '@base/debug'; import { ShaderInfo } from '../base/define'; import { Shader } from '../base/shader'; diff --git a/cocos/gfx/webgl/webgl-buffer.ts b/cocos/gfx/webgl/webgl-buffer.ts index 99c74ae324d..5fa0e427457 100644 --- a/cocos/gfx/webgl/webgl-buffer.ts +++ b/cocos/gfx/webgl/webgl-buffer.ts @@ -25,15 +25,10 @@ import { BufferSource, BufferInfo, BufferViewInfo, BufferUsageBit } from '../base/define'; import { Buffer } from '../base/buffer'; -import { - WebGLCmdFuncCreateBuffer, - WebGLCmdFuncDestroyBuffer, - WebGLCmdFuncResizeBuffer, - WebGLCmdFuncUpdateBuffer, -} from './webgl-commands'; +import { WebGLCmdFuncCreateBuffer, WebGLCmdFuncDestroyBuffer, WebGLCmdFuncResizeBuffer, WebGLCmdFuncUpdateBuffer } from './webgl-commands'; import { IWebGLGPUBuffer, IWebGLGPUBufferView, WebGLIndirectDrawInfos } from './webgl-gpu-objects'; import { WebGLDeviceManager } from './webgl-define'; -import { warn } from '../../core'; +import { warn } from '@base/debug'; export class WebGLBuffer extends Buffer { get gpuBuffer (): IWebGLGPUBuffer { diff --git a/cocos/gfx/webgl/webgl-command-buffer.ts b/cocos/gfx/webgl/webgl-command-buffer.ts index 56bd2b55038..6dffd269a0f 100644 --- a/cocos/gfx/webgl/webgl-command-buffer.ts +++ b/cocos/gfx/webgl/webgl-command-buffer.ts @@ -39,15 +39,13 @@ import { WebGLPipelineState } from './webgl-pipeline-state'; import { WebGLTexture } from './webgl-texture'; import { RenderPass } from '../base/render-pass'; import { WebGLRenderPass } from './webgl-render-pass'; -import { BufferUsageBit, CommandBufferType, StencilFace, BufferSource, - CommandBufferInfo, BufferTextureCopy, Color, Rect, Viewport, DrawInfo, DynamicStates, TextureBlit, Filter } from '../base/define'; -import { WebGLCmd, WebGLCmdBeginRenderPass, WebGLCmdBindStates, WebGLCmdBlitTexture, WebGLCmdCopyBufferToTexture, - WebGLCmdDraw, WebGLCmdPackage, WebGLCmdUpdateBuffer } from './webgl-commands'; +import { BufferUsageBit, CommandBufferType, StencilFace, BufferSource, CommandBufferInfo, BufferTextureCopy, Color, Rect, Viewport, DrawInfo, DynamicStates, TextureBlit, Filter } from '../base/define'; +import { WebGLCmd, WebGLCmdBeginRenderPass, WebGLCmdBindStates, WebGLCmdBlitTexture, WebGLCmdCopyBufferToTexture, WebGLCmdDraw, WebGLCmdPackage, WebGLCmdUpdateBuffer } from './webgl-commands'; import { GeneralBarrier } from '../base/states/general-barrier'; import { TextureBarrier } from '../base/states/texture-barrier'; import { BufferBarrier } from '../base/states/buffer-barrier'; import { WebGLDeviceManager } from './webgl-define'; -import { error } from '../../core'; +import { error } from '@base/debug'; export class WebGLCommandBuffer extends CommandBuffer { public cmdPackage: WebGLCmdPackage = new WebGLCmdPackage(); diff --git a/cocos/gfx/webgl/webgl-commands.ts b/cocos/gfx/webgl/webgl-commands.ts index 7648969513f..c3de6ccc730 100644 --- a/cocos/gfx/webgl/webgl-commands.ts +++ b/cocos/gfx/webgl/webgl-commands.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { debug, error, errorID, CachedArray, assertID } from '../../core'; +import { debug, error, errorID, assertID } from '@base/debug'; +import { CachedArray } from '../../core'; import { cclegacy } from '@base/global'; import { WebGLCommandAllocator } from './webgl-command-allocator'; import { WebGLEXT } from './webgl-define'; diff --git a/cocos/gfx/webgl/webgl-device.ts b/cocos/gfx/webgl/webgl-device.ts index 55d57f11737..530166491d8 100644 --- a/cocos/gfx/webgl/webgl-device.ts +++ b/cocos/gfx/webgl/webgl-device.ts @@ -52,17 +52,12 @@ import { WebGLSampler } from './states/webgl-sampler'; import { WebGLShader } from './webgl-shader'; import { getContext, getExtensions, WebGLSwapchain } from './webgl-swapchain'; import { WebGLTexture } from './webgl-texture'; -import { - CommandBufferType, ShaderInfo, - QueueInfo, CommandBufferInfo, DescriptorSetInfo, DescriptorSetLayoutInfo, FramebufferInfo, InputAssemblerInfo, PipelineLayoutInfo, - RenderPassInfo, SamplerInfo, TextureInfo, TextureViewInfo, BufferInfo, BufferViewInfo, DeviceInfo, TextureBarrierInfo, GeneralBarrierInfo, - BufferBarrierInfo, QueueType, API, Feature, BufferTextureCopy, SwapchainInfo, FormatFeature, FormatFeatureBit, Format, -} from '../base/define'; +import { CommandBufferType, ShaderInfo, QueueInfo, CommandBufferInfo, DescriptorSetInfo, DescriptorSetLayoutInfo, FramebufferInfo, InputAssemblerInfo, PipelineLayoutInfo, RenderPassInfo, SamplerInfo, TextureInfo, TextureViewInfo, BufferInfo, BufferViewInfo, DeviceInfo, TextureBarrierInfo, GeneralBarrierInfo, BufferBarrierInfo, QueueType, API, Feature, BufferTextureCopy, SwapchainInfo, FormatFeature, FormatFeatureBit, Format } from '../base/define'; import { WebGLCmdFuncCopyBuffersToTexture, WebGLCmdFuncCopyTextureToBuffers, WebGLCmdFuncCopyTexImagesToTexture } from './webgl-commands'; import { GeneralBarrier } from '../base/states/general-barrier'; import { TextureBarrier } from '../base/states/texture-barrier'; import { BufferBarrier } from '../base/states/buffer-barrier'; -import { debug, error } from '../../core'; +import { debug, error } from '@base/debug'; import { Swapchain } from '../base/swapchain'; import { IWebGLExtensions, WebGLDeviceManager } from './webgl-define'; import { IWebGLBindingMapping, IWebGLBlitManager } from './webgl-gpu-objects'; diff --git a/cocos/gfx/webgl/webgl-input-assembler.ts b/cocos/gfx/webgl/webgl-input-assembler.ts index bd93e260e41..23185758375 100644 --- a/cocos/gfx/webgl/webgl-input-assembler.ts +++ b/cocos/gfx/webgl/webgl-input-assembler.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { error } from '../../core'; +import { error } from '@base/debug'; import { InputAssemblerInfo } from '../base/define'; import { InputAssembler } from '../base/input-assembler'; import { WebGLBuffer } from './webgl-buffer'; diff --git a/cocos/gfx/webgl/webgl-primary-command-buffer.ts b/cocos/gfx/webgl/webgl-primary-command-buffer.ts index 02e6a58f95d..f9fe86ca2c5 100644 --- a/cocos/gfx/webgl/webgl-primary-command-buffer.ts +++ b/cocos/gfx/webgl/webgl-primary-command-buffer.ts @@ -30,15 +30,13 @@ import { InputAssembler } from '../base/input-assembler'; import { Texture } from '../base/texture'; import { WebGLBuffer } from './webgl-buffer'; import { WebGLCommandBuffer } from './webgl-command-buffer'; -import { - WebGLCmdFuncBeginRenderPass, WebGLCmdFuncBindStates, WebGLCmdFuncBlitTexture, WebGLCmdFuncCopyBuffersToTexture, - WebGLCmdFuncDraw, WebGLCmdFuncExecuteCmds, WebGLCmdFuncUpdateBuffer } from './webgl-commands'; +import { WebGLCmdFuncBeginRenderPass, WebGLCmdFuncBindStates, WebGLCmdFuncBlitTexture, WebGLCmdFuncCopyBuffersToTexture, WebGLCmdFuncDraw, WebGLCmdFuncExecuteCmds, WebGLCmdFuncUpdateBuffer } from './webgl-commands'; import { WebGLFramebuffer } from './webgl-framebuffer'; import { WebGLTexture } from './webgl-texture'; import { RenderPass } from '../base/render-pass'; import { WebGLRenderPass } from './webgl-render-pass'; import { WebGLDeviceManager } from './webgl-define'; -import { error } from '../../core'; +import { error } from '@base/debug'; export class WebGLPrimaryCommandBuffer extends WebGLCommandBuffer { public beginRenderPass ( diff --git a/cocos/gfx/webgl/webgl-swapchain.ts b/cocos/gfx/webgl/webgl-swapchain.ts index 5d84c51ad3a..2086101ac3a 100644 --- a/cocos/gfx/webgl/webgl-swapchain.ts +++ b/cocos/gfx/webgl/webgl-swapchain.ts @@ -27,11 +27,11 @@ import { systemInfo } from 'pal/system-info'; import { WebGLCommandAllocator } from './webgl-command-allocator'; import { WebGLStateCache } from './webgl-state-cache'; import { WebGLTexture } from './webgl-texture'; -import { Format, TextureInfo, TextureFlagBit, TextureType, TextureUsageBit, - BufferTextureCopy, SwapchainInfo, SurfaceTransform } from '../base/define'; +import { Format, TextureInfo, TextureFlagBit, TextureType, TextureUsageBit, BufferTextureCopy, SwapchainInfo, SurfaceTransform } from '../base/define'; import { Swapchain } from '../base/swapchain'; import { IWebGLExtensions, WebGLDeviceManager } from './webgl-define'; -import { macro, warnID, warn, debug } from '../../core'; +import { macro } from '../../core'; +import { warnID, warn, debug } from '@base/debug'; import { BrowserType, OS } from '../../../pal/system-info/enum-type'; import { IWebGLBlitManager } from './webgl-gpu-objects'; diff --git a/cocos/gfx/webgl2/webgl2-buffer.ts b/cocos/gfx/webgl2/webgl2-buffer.ts index 8055d27dc5d..9f3cd798187 100644 --- a/cocos/gfx/webgl2/webgl2-buffer.ts +++ b/cocos/gfx/webgl2/webgl2-buffer.ts @@ -22,15 +22,10 @@ THE SOFTWARE. */ -import { warn } from '../../core'; +import { warn } from '@base/debug'; import { Buffer } from '../base/buffer'; import { BufferUsageBit, BufferSource, BufferInfo, BufferViewInfo } from '../base/define'; -import { - WebGL2CmdFuncCreateBuffer, - WebGL2CmdFuncDestroyBuffer, - WebGL2CmdFuncResizeBuffer, - WebGL2CmdFuncUpdateBuffer, -} from './webgl2-commands'; +import { WebGL2CmdFuncCreateBuffer, WebGL2CmdFuncDestroyBuffer, WebGL2CmdFuncResizeBuffer, WebGL2CmdFuncUpdateBuffer } from './webgl2-commands'; import { WebGL2DeviceManager } from './webgl2-define'; import { IWebGL2GPUBuffer, WebGL2IndirectDrawInfos } from './webgl2-gpu-objects'; diff --git a/cocos/gfx/webgl2/webgl2-command-buffer.ts b/cocos/gfx/webgl2/webgl2-command-buffer.ts index 34521ae6537..069c818ad32 100644 --- a/cocos/gfx/webgl2/webgl2-command-buffer.ts +++ b/cocos/gfx/webgl2/webgl2-command-buffer.ts @@ -25,13 +25,7 @@ import { DescriptorSet } from '../base/descriptor-set'; import { Buffer } from '../base/buffer'; import { CommandBuffer } from '../base/command-buffer'; -import { - BufferUsageBit, - CommandBufferType, - StencilFace, - BufferSource, CommandBufferInfo, - BufferTextureCopy, Color, Rect, Viewport, DrawInfo, DynamicStates, TextureBlit, Filter, -} from '../base/define'; +import { BufferUsageBit, CommandBufferType, StencilFace, BufferSource, CommandBufferInfo, BufferTextureCopy, Color, Rect, Viewport, DrawInfo, DynamicStates, TextureBlit, Filter } from '../base/define'; import { Framebuffer } from '../base/framebuffer'; import { InputAssembler } from '../base/input-assembler'; import { PipelineState } from '../base/pipeline-state'; @@ -39,16 +33,7 @@ import { Texture } from '../base/texture'; import { WebGL2DescriptorSet } from './webgl2-descriptor-set'; import { WebGL2Buffer } from './webgl2-buffer'; import { WebGL2CommandAllocator } from './webgl2-command-allocator'; -import { - WebGL2Cmd, - WebGL2CmdBeginRenderPass, - WebGL2CmdBindStates, - WebGL2CmdBlitTexture, - WebGL2CmdCopyBufferToTexture, - WebGL2CmdDraw, - WebGL2CmdPackage, - WebGL2CmdUpdateBuffer, -} from './webgl2-commands'; +import { WebGL2Cmd, WebGL2CmdBeginRenderPass, WebGL2CmdBindStates, WebGL2CmdBlitTexture, WebGL2CmdCopyBufferToTexture, WebGL2CmdDraw, WebGL2CmdPackage, WebGL2CmdUpdateBuffer } from './webgl2-commands'; import { WebGL2Framebuffer } from './webgl2-framebuffer'; import { IWebGL2GPUInputAssembler, IWebGL2GPUDescriptorSet, IWebGL2GPUPipelineState } from './webgl2-gpu-objects'; import { WebGL2InputAssembler } from './webgl2-input-assembler'; @@ -60,7 +45,7 @@ import { GeneralBarrier } from '../base/states/general-barrier'; import { TextureBarrier } from '../base/states/texture-barrier'; import { BufferBarrier } from '../base/states/buffer-barrier'; import { WebGL2DeviceManager } from './webgl2-define'; -import { error } from '../../core'; +import { error } from '@base/debug'; export class WebGL2CommandBuffer extends CommandBuffer { public cmdPackage: WebGL2CmdPackage = new WebGL2CmdPackage(); diff --git a/cocos/gfx/webgl2/webgl2-commands.ts b/cocos/gfx/webgl2/webgl2-commands.ts index f942f0f07cc..35f57370283 100644 --- a/cocos/gfx/webgl2/webgl2-commands.ts +++ b/cocos/gfx/webgl2/webgl2-commands.ts @@ -27,7 +27,8 @@ import { WebGL2EXT } from './webgl2-define'; import { WebGL2CommandAllocator } from './webgl2-command-allocator'; import { WebGL2Device } from './webgl2-device'; import { IWebGL2GPUInputAssembler, IWebGL2Attrib, IWebGL2GPUDescriptorSet, IWebGL2GPUBuffer, IWebGL2GPUFramebuffer, IWebGL2GPUInput, IWebGL2GPUPipelineState, IWebGL2GPUSampler, IWebGL2GPUShader, IWebGL2GPUTexture, IWebGL2GPUUniformBlock, IWebGL2GPUUniformSamplerTexture, IWebGL2GPURenderPass } from './webgl2-gpu-objects'; -import { CachedArray, error, errorID, debug, assertID } from '../../core'; +import { CachedArray } from '../../core'; +import { error, errorID, debug, assertID } from '@base/debug'; import { cclegacy } from '@base/global'; const WebGLWraps: GLenum[] = [ diff --git a/cocos/gfx/webgl2/webgl2-device.ts b/cocos/gfx/webgl2/webgl2-device.ts index 6d68c15803b..cd7e017b6c9 100644 --- a/cocos/gfx/webgl2/webgl2-device.ts +++ b/cocos/gfx/webgl2/webgl2-device.ts @@ -52,17 +52,13 @@ import { WebGL2Sampler } from './states/webgl2-sampler'; import { WebGL2Shader } from './webgl2-shader'; import { WebGL2Swapchain, getExtensions, getContext } from './webgl2-swapchain'; import { WebGL2Texture } from './webgl2-texture'; -import { - CommandBufferType, DescriptorSetLayoutInfo, DescriptorSetInfo, - PipelineLayoutInfo, BufferViewInfo, CommandBufferInfo, BufferInfo, FramebufferInfo, InputAssemblerInfo, - QueueInfo, RenderPassInfo, SamplerInfo, ShaderInfo, TextureInfo, TextureViewInfo, DeviceInfo, GeneralBarrierInfo, TextureBarrierInfo, - BufferBarrierInfo, QueueType, API, Feature, BufferTextureCopy, SwapchainInfo, FormatFeature, Format, FormatFeatureBit, -} from '../base/define'; +import { CommandBufferType, DescriptorSetLayoutInfo, DescriptorSetInfo, PipelineLayoutInfo, BufferViewInfo, CommandBufferInfo, BufferInfo, FramebufferInfo, InputAssemblerInfo, QueueInfo, RenderPassInfo, SamplerInfo, ShaderInfo, TextureInfo, TextureViewInfo, DeviceInfo, GeneralBarrierInfo, TextureBarrierInfo, BufferBarrierInfo, QueueType, API, Feature, BufferTextureCopy, SwapchainInfo, FormatFeature, Format, FormatFeatureBit } from '../base/define'; import { WebGL2CmdFuncCopyTextureToBuffers, WebGL2CmdFuncCopyBuffersToTexture, WebGL2CmdFuncCopyTexImagesToTexture } from './webgl2-commands'; import { GeneralBarrier } from '../base/states/general-barrier'; import { TextureBarrier } from '../base/states/texture-barrier'; import { BufferBarrier } from '../base/states/buffer-barrier'; -import { debug, error, sys } from '../../core'; +import { debug, error } from '@base/debug'; +import { sys } from '../../core'; import { Swapchain } from '../base/swapchain'; import { IWebGL2Extensions, WebGL2DeviceManager } from './webgl2-define'; import { IWebGL2BindingMapping, IWebGL2BlitManager } from './webgl2-gpu-objects'; diff --git a/cocos/gfx/webgl2/webgl2-input-assembler.ts b/cocos/gfx/webgl2/webgl2-input-assembler.ts index 138a9e81f29..f50d0a7779d 100644 --- a/cocos/gfx/webgl2/webgl2-input-assembler.ts +++ b/cocos/gfx/webgl2/webgl2-input-assembler.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { error } from '../../core'; +import { error } from '@base/debug'; import { InputAssemblerInfo } from '../base/define'; import { InputAssembler } from '../base/input-assembler'; import { WebGL2Buffer } from './webgl2-buffer'; diff --git a/cocos/gfx/webgl2/webgl2-primary-command-buffer.ts b/cocos/gfx/webgl2/webgl2-primary-command-buffer.ts index 493b08e8bc0..109c2cec5d6 100644 --- a/cocos/gfx/webgl2/webgl2-primary-command-buffer.ts +++ b/cocos/gfx/webgl2/webgl2-primary-command-buffer.ts @@ -30,15 +30,13 @@ import { InputAssembler } from '../base/input-assembler'; import { Texture } from '../base/texture'; import { WebGL2Buffer } from './webgl2-buffer'; import { WebGL2CommandBuffer } from './webgl2-command-buffer'; -import { - WebGL2CmdFuncBeginRenderPass, WebGL2CmdFuncBindStates, WebGL2CmdFuncBlitTexture, WebGL2CmdFuncCopyBuffersToTexture, - WebGL2CmdFuncDraw, WebGL2CmdFuncExecuteCmds, WebGL2CmdFuncUpdateBuffer } from './webgl2-commands'; +import { WebGL2CmdFuncBeginRenderPass, WebGL2CmdFuncBindStates, WebGL2CmdFuncBlitTexture, WebGL2CmdFuncCopyBuffersToTexture, WebGL2CmdFuncDraw, WebGL2CmdFuncExecuteCmds, WebGL2CmdFuncUpdateBuffer } from './webgl2-commands'; import { WebGL2Framebuffer } from './webgl2-framebuffer'; import { WebGL2Texture } from './webgl2-texture'; import { RenderPass } from '../base/render-pass'; import { WebGL2RenderPass } from './webgl2-render-pass'; import { WebGL2DeviceManager } from './webgl2-define'; -import { error } from '../../core'; +import { error } from '@base/debug'; export class WebGL2PrimaryCommandBuffer extends WebGL2CommandBuffer { public beginRenderPass ( diff --git a/cocos/gfx/webgl2/webgl2-swapchain.ts b/cocos/gfx/webgl2/webgl2-swapchain.ts index 6b499933e56..47ce4b9fdcc 100644 --- a/cocos/gfx/webgl2/webgl2-swapchain.ts +++ b/cocos/gfx/webgl2/webgl2-swapchain.ts @@ -24,11 +24,11 @@ import { EDITOR } from 'internal:constants'; import { systemInfo } from 'pal/system-info'; -import { warnID, warn, debug, macro } from '../../core'; +import { warnID, warn, debug } from '@base/debug'; +import { macro } from '../../core'; import { WebGL2StateCache } from './webgl2-state-cache'; import { WebGL2Texture } from './webgl2-texture'; -import { Format, TextureInfo, TextureFlagBit, TextureType, - TextureUsageBit, BufferTextureCopy, SwapchainInfo, SurfaceTransform } from '../base/define'; +import { Format, TextureInfo, TextureFlagBit, TextureType, TextureUsageBit, BufferTextureCopy, SwapchainInfo, SurfaceTransform } from '../base/define'; import { Swapchain } from '../base/swapchain'; import { IWebGL2Extensions, WebGL2DeviceManager } from './webgl2-define'; import { OS } from '../../../pal/system-info/enum-type'; diff --git a/cocos/gfx/webgl2/webgl2-texture.ts b/cocos/gfx/webgl2/webgl2-texture.ts index 6bb0cb82664..1c43780f51e 100644 --- a/cocos/gfx/webgl2/webgl2-texture.ts +++ b/cocos/gfx/webgl2/webgl2-texture.ts @@ -22,11 +22,8 @@ THE SOFTWARE. */ -import { log } from '../../core'; -import { - FormatSurfaceSize, TextureInfo, IsPowerOf2, TextureViewInfo, ISwapchainTextureInfo, - FormatInfos, TextureUsageBit, -} from '../base/define'; +import { log } from '@base/debug'; +import { FormatSurfaceSize, TextureInfo, IsPowerOf2, TextureViewInfo, ISwapchainTextureInfo, FormatInfos, TextureUsageBit } from '../base/define'; import { Texture } from '../base/texture'; import { WebGL2CmdFuncCreateTexture, WebGL2CmdFuncDestroyTexture, WebGL2CmdFuncResizeTexture } from './webgl2-commands'; import { WebGL2DeviceManager } from './webgl2-define'; diff --git a/cocos/input/input.ts b/cocos/input/input.ts index 3cc5c2d3899..ba1d447eefa 100644 --- a/cocos/input/input.ts +++ b/cocos/input/input.ts @@ -27,7 +27,8 @@ import { EDITOR_NOT_IN_PREVIEW, NATIVE } from 'internal:constants'; import { TouchInputSource, MouseInputSource, KeyboardInputSource, AccelerometerInputSource, GamepadInputDevice, HandleInputDevice, HMDInputDevice, HandheldInputDevice } from 'pal/input'; import { touchManager } from '../../pal/input/touch-manager'; -import { sys, EventTarget, error } from '../core'; +import { sys, EventTarget } from '../core'; +import { error } from '@base/debug'; import { Event, EventAcceleration, EventGamepad, EventHandle, EventHandheld, EventHMD, EventKeyboard, EventMouse, EventTouch, Touch } from './types'; import { InputEventType } from './types/event-enum'; diff --git a/cocos/misc/missing-script.ts b/cocos/misc/missing-script.ts index 69755a25ffe..03880257b90 100644 --- a/cocos/misc/missing-script.ts +++ b/cocos/misc/missing-script.ts @@ -25,7 +25,8 @@ import { ccclass, inspector, editorOnly, serializable } from 'cc.decorator'; import { Component } from '../scene-graph/component'; -import { warnID, error, js } from '../core'; +import { warnID, error } from '@base/debug'; +import { js } from '../core'; import { cclegacy } from '@base/global'; /** diff --git a/cocos/misc/renderer.ts b/cocos/misc/renderer.ts index 4066ba0eebf..f3643e5696d 100644 --- a/cocos/misc/renderer.ts +++ b/cocos/misc/renderer.ts @@ -26,7 +26,8 @@ import { EDITOR } from 'internal:constants'; import { Material } from '../asset/assets/material'; import { Component } from '../scene-graph'; import { IMaterialInstanceInfo, MaterialInstance } from '../render-scene/core/material-instance'; -import { warnID, _decorator, error } from '../core'; +import { warnID, error } from '@base/debug'; +import { _decorator } from '../core'; const _matInsInfo: IMaterialInstanceInfo = { parent: null!, diff --git a/cocos/particle-2d/particle-system-2d.ts b/cocos/particle-2d/particle-system-2d.ts index 553a0b1e529..e5eb8bcca9c 100644 --- a/cocos/particle-2d/particle-system-2d.ts +++ b/cocos/particle-2d/particle-system-2d.ts @@ -26,7 +26,8 @@ import { ccclass, editable, type, displayOrder, menu, executeInEditMode, serializable, playOnFocus, tooltip, visible, formerlySerializedAs, override } from 'cc.decorator'; import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { UIRenderer } from '../2d/framework/ui-renderer'; -import { Color, Vec2, warnID, errorID, error, path } from '../core'; +import { Color, Vec2, path } from '../core'; +import { warnID, errorID, error } from '@base/debug'; import { Simulator } from './particle-simulator-2d'; import { SpriteFrame } from '../2d/assets/sprite-frame'; import { ImageAsset } from '../asset/assets/image-asset'; diff --git a/cocos/particle-2d/png-reader.ts b/cocos/particle-2d/png-reader.ts index 3f12e22b515..1dd3c19fa0e 100644 --- a/cocos/particle-2d/png-reader.ts +++ b/cocos/particle-2d/png-reader.ts @@ -26,8 +26,8 @@ THE SOFTWARE. */ -import { getError } from '../core'; -import zlib from '../../external/compression/zlib.min'; +import { getError } from '@base/debug'; +import zlib from '../../external/compression/zlib.min'; /** * A png file reader diff --git a/cocos/particle-2d/tiff-reader.ts b/cocos/particle-2d/tiff-reader.ts index fe88eac2779..167940d556e 100644 --- a/cocos/particle-2d/tiff-reader.ts +++ b/cocos/particle-2d/tiff-reader.ts @@ -28,7 +28,7 @@ THE SOFTWARE. */ -import { getError, log, logID } from '../core'; +import { getError, log, logID } from '@base/debug'; import { ccwindow } from '@base/global'; interface IFile { diff --git a/cocos/particle/animator/texture-animation.ts b/cocos/particle/animator/texture-animation.ts index fd15feccbc1..2d9f032a31b 100644 --- a/cocos/particle/animator/texture-animation.ts +++ b/cocos/particle/animator/texture-animation.ts @@ -23,7 +23,8 @@ */ import { ccclass, tooltip, displayOrder, type, formerlySerializedAs, serializable, range } from 'cc.decorator'; -import { lerp, pseudoRandom, repeat, Enum, random, error } from '../../core'; +import { lerp, pseudoRandom, repeat, Enum, random } from '../../core'; +import { error } from '@base/debug'; import { Particle, ParticleModuleBase, PARTICLE_MODULE_NAME } from '../particle'; import CurveRange from './curve-range'; import { ModuleRandSeed } from '../enum'; diff --git a/cocos/particle/emitter/shape-module.ts b/cocos/particle/emitter/shape-module.ts index 8c48b58ee25..ef1ab3cb9f8 100644 --- a/cocos/particle/emitter/shape-module.ts +++ b/cocos/particle/emitter/shape-module.ts @@ -23,12 +23,12 @@ */ import { ccclass, tooltip, displayOrder, type, formerlySerializedAs, serializable, visible, range } from 'cc.decorator'; -import { Mat4, Quat, Vec2, Vec3, clamp, pingPong, random, randomRange, repeat, toDegree, toRadian, warn } from '../../core'; +import { Mat4, Quat, Vec2, Vec3, clamp, pingPong, random, randomRange, repeat, toDegree, toRadian } from '../../core'; +import { warn } from '@base/debug'; import CurveRange from '../animator/curve-range'; import { ArcMode, EmitLocation, ShapeType } from '../enum'; -import { fixedAngleUnitVector2, particleEmitZAxis, randomPointBetweenCircleAtFixedAngle, randomPointBetweenSphere, - randomPointInCube, randomSign, randomSortArray, randomUnitVector } from '../particle-general-function'; +import { fixedAngleUnitVector2, particleEmitZAxis, randomPointBetweenCircleAtFixedAngle, randomPointBetweenSphere, randomPointInCube, randomSign, randomSortArray, randomUnitVector } from '../particle-general-function'; import { ParticleSystem } from '../particle-system'; const _intermediVec = new Vec3(0, 0, 0); diff --git a/cocos/particle/particle-system.ts b/cocos/particle/particle-system.ts index fcc9bbc8f8f..153daf11903 100644 --- a/cocos/particle/particle-system.ts +++ b/cocos/particle/particle-system.ts @@ -28,7 +28,8 @@ import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; 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, warn } from '../core'; +import { Mat4, pseudoRandom, Quat, randomRangeInt, Vec2, Vec3, CCBoolean, CCFloat, bits, geometry } from '../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { scene } from '../render-scene'; import ColorOverLifetimeModule from './animator/color-overtime'; diff --git a/cocos/particle/renderer/particle-system-renderer-cpu.ts b/cocos/particle/renderer/particle-system-renderer-cpu.ts index 0f91aae63a5..1a143fb59e5 100644 --- a/cocos/particle/renderer/particle-system-renderer-cpu.ts +++ b/cocos/particle/renderer/particle-system-renderer-cpu.ts @@ -26,7 +26,8 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { builtinResMgr } from '../../asset/asset-manager'; import { Material, Texture2D } from '../../asset/assets'; import { AttributeName, Format, Attribute, FormatInfos } from '../../gfx'; -import { Mat4, Vec2, Vec3, Vec4, pseudoRandom, Quat, EPSILON, approx, RecyclePool, warn } from '../../core'; +import { Mat4, Vec2, Vec3, Vec4, pseudoRandom, Quat, EPSILON, approx, RecyclePool } from '../../core'; +import { warn } from '@base/debug'; import { MaterialInstance, IMaterialInstanceInfo } from '../../render-scene/core/material-instance'; import { MacroRecord } from '../../render-scene/core/pass-utils'; import { AlignmentSpace, RenderMode, Space } from '../enum'; diff --git a/cocos/particle/renderer/particle-system-renderer-data.ts b/cocos/particle/renderer/particle-system-renderer-data.ts index 9e1e3f38ecf..fc9e9789ecc 100644 --- a/cocos/particle/renderer/particle-system-renderer-data.ts +++ b/cocos/particle/renderer/particle-system-renderer-data.ts @@ -30,7 +30,7 @@ import ParticleSystemRendererCPU from './particle-system-renderer-cpu'; import ParticleSystemRendererGPU from './particle-system-renderer-gpu'; import { director } from '../../game/director'; import { Device, Format, FormatFeatureBit } from '../../gfx'; -import { errorID, warnID } from '../../core'; +import { errorID, warnID } from '@base/debug'; import { cclegacy } from '@base/global'; function isSupportGPUParticle (): boolean { diff --git a/cocos/particle/renderer/particle-system-renderer-gpu.ts b/cocos/particle/renderer/particle-system-renderer-gpu.ts index a01785aec24..783f6d2144d 100644 --- a/cocos/particle/renderer/particle-system-renderer-gpu.ts +++ b/cocos/particle/renderer/particle-system-renderer-gpu.ts @@ -27,7 +27,8 @@ import { builtinResMgr } from '../../asset/asset-manager'; import { Material, Texture2D } from '../../asset/assets'; import { Component } from '../../scene-graph'; import { AttributeName, Format, Attribute, API, deviceManager, FormatInfos } from '../../gfx'; -import { Mat4, Vec2, Vec4, Quat, Vec3, warn } from '../../core'; +import { Mat4, Vec2, Vec4, Quat, Vec3 } from '../../core'; +import { warn } from '@base/debug'; import { MaterialInstance, IMaterialInstanceInfo } from '../../render-scene/core/material-instance'; import { MacroRecord } from '../../render-scene/core/pass-utils'; import { AlignmentSpace, RenderMode, Space } from '../enum'; diff --git a/cocos/particle/renderer/trail.ts b/cocos/particle/renderer/trail.ts index dc5d32a5291..2bf43ddb621 100644 --- a/cocos/particle/renderer/trail.ts +++ b/cocos/particle/renderer/trail.ts @@ -27,7 +27,8 @@ import { Material } from '../../asset/assets/material'; import { RenderingSubMesh } from '../../asset/assets/rendering-sub-mesh'; import { director } from '../../game/director'; import { AttributeName, BufferUsageBit, Format, FormatInfos, MemoryUsageBit, PrimitiveMode, Device, Attribute, Buffer, BufferInfo, DrawInfo, DRAW_INFO_SIZE } from '../../gfx'; -import { Color, Mat4, Quat, toRadian, Vec3, Pool, warnID } from '../../core'; +import { Color, Mat4, Quat, toRadian, Vec3, Pool } from '../../core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { scene } from '../../render-scene'; import CurveRange from '../animator/curve-range'; diff --git a/cocos/physics-2d/box2d-wasm/instantiated.ts b/cocos/physics-2d/box2d-wasm/instantiated.ts index 5156374fd49..a529a3d21f7 100644 --- a/cocos/physics-2d/box2d-wasm/instantiated.ts +++ b/cocos/physics-2d/box2d-wasm/instantiated.ts @@ -28,7 +28,8 @@ import { wasmFactory, box2dWasmUrl } from './box2d.wasmjs'; import { asmFactory } from './box2d.asmjs'; import { game } from '../../game'; -import { getError, error, sys, debug, IVec2Like } from '../../core'; +import { getError, error, debug } from '@base/debug'; +import { sys, IVec2Like } from '../../core'; import { WebAssemblySupportMode } from '../../misc/webassembly-support'; export const B2 = {} as any; diff --git a/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts b/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts index 2f0990e0d6b..c8cedd68a62 100644 --- a/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts +++ b/cocos/physics-2d/box2d-wasm/joints/joint-2d.ts @@ -26,7 +26,8 @@ import { B2, addImplPtrReference, addImplPtrReferenceWASM, getImplPtr } from '.. import { IJoint2D } from '../../spec/i-physics-joint'; import { Joint2D, PhysicsSystem2D, RigidBody2D } from '../../framework'; import { B2PhysicsWorld } from '../physics-world'; -import { Vec2, warn } from '../../../core'; +import { Vec2 } from '../../../core'; +import { warn } from '@base/debug'; export class B2Joint implements IJoint2D { get impl (): B2.Joint | null { diff --git a/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts b/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts index 088620079c3..cb8e34d17b3 100644 --- a/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts +++ b/cocos/physics-2d/box2d-wasm/platform/physics-contact-listener.ts @@ -23,7 +23,8 @@ */ import { B2 } from '../instantiated'; -import { js, warn } from '../../../core'; +import { js } from '../../../core'; +import { warn } from '@base/debug'; export class PhysicsContactListener { static _BeginContact: Function | null = null; diff --git a/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts b/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts index 9127274bdb5..07c95adbc1f 100644 --- a/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts +++ b/cocos/physics-2d/box2d-wasm/platform/physics-debug-draw.ts @@ -23,7 +23,8 @@ */ import { B2, b2Mul } from '../instantiated'; -import { Color, warn } from '../../../core'; +import { Color } from '../../../core'; +import { warn } from '@base/debug'; import { PHYSICS_2D_PTM_RATIO } from '../../framework'; import { Graphics } from '../../../2d'; diff --git a/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts b/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts index e192901f5ad..d25304a7b25 100644 --- a/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts +++ b/cocos/physics-2d/box2d-wasm/shapes/polygon-shape-2d.ts @@ -28,7 +28,8 @@ import * as PolygonPartition from '../../framework/utils/polygon-partition'; import { PolygonCollider2D } from '../../framework'; import { PHYSICS_2D_PTM_RATIO } from '../../framework/physics-types'; import { IPolygonShape } from '../../spec/i-physics-shape'; -import { Vec2, IVec2Like, warn } from '../../../core'; +import { Vec2, IVec2Like } from '../../../core'; +import { warn } from '@base/debug'; export class B2PolygonShape extends B2Shape2D implements IPolygonShape { _worldPoints: Vec2[] = []; diff --git a/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts b/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts index d112aba37bc..5fddb859343 100644 --- a/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts +++ b/cocos/physics-2d/box2d/shapes/polygon-shape-2d.ts @@ -29,7 +29,8 @@ import * as PolygonPartition from '../../framework/utils/polygon-partition'; import { PolygonCollider2D } from '../../framework'; import { PHYSICS_2D_PTM_RATIO } from '../../framework/physics-types'; import { IPolygonShape } from '../../spec/i-physics-shape'; -import { Vec2, IVec2Like, log } from '../../../core'; +import { Vec2, IVec2Like } from '../../../core'; +import { log } from '@base/debug'; export class b2PolygonShape extends b2Shape2D implements IPolygonShape { _worldPoints: Vec2[] = []; diff --git a/cocos/physics-2d/builtin/builtin-contact.ts b/cocos/physics-2d/builtin/builtin-contact.ts index c13335e7b31..51c3abea7b8 100644 --- a/cocos/physics-2d/builtin/builtin-contact.ts +++ b/cocos/physics-2d/builtin/builtin-contact.ts @@ -27,7 +27,7 @@ import Intersection2D from './intersection-2d'; import { BuiltinBoxShape } from './shapes/box-shape-2d'; import { BuiltinPolygonShape } from './shapes/polygon-shape-2d'; import { BuiltinCircleShape } from './shapes/circle-shape-2d'; -import { error } from '../../core'; +import { error } from '@base/debug'; import { Contact2DType } from '../framework'; export class BuiltinContact { diff --git a/cocos/physics-2d/framework/physics-selector.ts b/cocos/physics-2d/framework/physics-selector.ts index 958ae1da47b..a03d07f3037 100644 --- a/cocos/physics-2d/framework/physics-selector.ts +++ b/cocos/physics-2d/framework/physics-selector.ts @@ -27,10 +27,9 @@ import { EDITOR, DEBUG, TEST, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { IRigidBody2D } from '../spec/i-rigid-body'; import { IBoxShape, ICircleShape, IPolygonShape, IBaseShape } from '../spec/i-physics-shape'; import { IPhysicsWorld } from '../spec/i-physics-world'; -import { errorID, log } from '../../core'; -import { ECollider2DType, EJoint2DType } from './physics-types'; -import { IJoint2D, IDistanceJoint, ISpringJoint, IFixedJoint, IMouseJoint, - IRelativeJoint, ISliderJoint, IWheelJoint, IHingeJoint } from '../spec/i-physics-joint'; +import { errorID, log } from '@base/debug'; +import { ECollider2DType, EJoint2DType } from './physics-types'; +import { IJoint2D, IDistanceJoint, ISpringJoint, IFixedJoint, IMouseJoint, IRelativeJoint, ISliderJoint, IWheelJoint, IHingeJoint } from '../spec/i-physics-joint'; // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents export type IPhysicsEngineId = 'builtin' | 'box2d' | 'box2d-wasm'| string; diff --git a/cocos/physics-2d/framework/utils/polygon-partition.ts b/cocos/physics-2d/framework/utils/polygon-partition.ts index c98c114abb6..89b7a5132d4 100644 --- a/cocos/physics-2d/framework/utils/polygon-partition.ts +++ b/cocos/physics-2d/framework/utils/polygon-partition.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { IVec2Like, log } from '../../../core'; +import { IVec2Like } from '../../../core'; +import { log } from '@base/debug'; //https://github.com/x6ud/poly-partition-js diff --git a/cocos/physics/bullet/bullet-world.ts b/cocos/physics/bullet/bullet-world.ts index 431158135f4..c92a9de1634 100644 --- a/cocos/physics/bullet/bullet-world.ts +++ b/cocos/physics/bullet/bullet-world.ts @@ -32,7 +32,8 @@ import { TriggerEventObject, CollisionEventObject, CC_V3_0, CC_V3_1, CC_V3_2, Bu import { bullet2CocosVec3, cocos2BulletQuat, cocos2BulletVec3 } from './bullet-utils'; import { IRaycastOptions, IPhysicsWorld } from '../spec/i-physics-world'; import { PhysicsRayResult, PhysicsMaterial, CharacterControllerContact } from '../framework'; -import { error, RecyclePool, Vec3, js, IVec3Like, geometry, IQuatLike, Quat } from '../../core'; +import { error } from '@base/debug'; +import { RecyclePool, Vec3, js, IVec3Like, geometry, IQuatLike, Quat } from '../../core'; import { BulletContactData } from './bullet-contact-data'; import { BulletConstraint } from './constraints/bullet-constraint'; import { BulletCharacterController } from './character-controllers/bullet-character-controller'; diff --git a/cocos/physics/bullet/character-controllers/bullet-character-controller.ts b/cocos/physics/bullet/character-controllers/bullet-character-controller.ts index 7c50e656fd5..2418bad172d 100644 --- a/cocos/physics/bullet/character-controllers/bullet-character-controller.ts +++ b/cocos/physics/bullet/character-controllers/bullet-character-controller.ts @@ -22,8 +22,9 @@ THE SOFTWARE. */ -import { error, IVec3Like, Vec3 } from '../../../core'; -import { CharacterControllerContact, PhysicsSystem } from '../../framework'; +import { error } from '@base/debug'; +import { IVec3Like, Vec3 } from '../../../core'; +import { CharacterControllerContact, PhysicsSystem } from '../../framework'; import { CharacterController } from '../../framework/components/character-controllers/character-controller'; import { IBaseCharacterController } from '../../spec/i-character-controller'; import { BulletCache } from '../bullet-cache'; diff --git a/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts b/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts index 491943f761c..55de40e98fa 100644 --- a/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts +++ b/cocos/physics/bullet/constraints/bullet-configurable-constraint.ts @@ -25,7 +25,8 @@ /* eslint-disable new-cap */ import { BulletConstraint } from './bullet-constraint'; import { IConfigurableConstraint } from '../../spec/i-physics-constraint'; -import { error, IVec3Like, Mat4, Quat, Vec3, toRadian } from '../../../core'; +import { error } from '@base/debug'; +import { IVec3Like, Mat4, Quat, Vec3, toRadian } from '../../../core'; import { ConfigurableConstraint, EConstraintMode, EConstraintType, EDriverMode, PhysicsSystem } from '../../framework'; import { bt } from '../instantiated'; import { BulletRigidBody } from '../bullet-rigid-body'; diff --git a/cocos/physics/bullet/instantiated.ts b/cocos/physics/bullet/instantiated.ts index ea1d45831a4..7ce4a0e13fb 100644 --- a/cocos/physics/bullet/instantiated.ts +++ b/cocos/physics/bullet/instantiated.ts @@ -25,7 +25,8 @@ import { ensureWasmModuleReady, instantiateWasm } from 'pal/wasm'; import { CULL_ASM_JS_MODULE, FORCE_BANNING_BULLET_WASM, WASM_SUPPORT_MODE } from 'internal:constants'; import { game } from '../../game'; -import { debug, error, getError, log, sys } from '../../core'; +import { debug, error, getError, log } from '@base/debug'; +import { sys } from '../../core'; import { pageSize, pageCount, importFunc } from './bullet-env'; import { WebAssemblySupportMode } from '../../misc/webassembly-support'; diff --git a/cocos/physics/bullet/shapes/bullet-terrain-shape.ts b/cocos/physics/bullet/shapes/bullet-terrain-shape.ts index 71b9674073c..3157ba5d6d9 100644 --- a/cocos/physics/bullet/shapes/bullet-terrain-shape.ts +++ b/cocos/physics/bullet/shapes/bullet-terrain-shape.ts @@ -23,7 +23,8 @@ */ import { BulletShape } from './bullet-shape'; -import { Vec3, warn, IVec3Like } from '../../../core'; +import { Vec3, IVec3Like } from '../../../core'; +import { warn } from '@base/debug'; import { TerrainCollider } from '../../../../exports/physics-framework'; import { cocos2BulletVec3 } from '../bullet-utils'; import { ITerrainShape } from '../../spec/i-physics-shape'; diff --git a/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts b/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts index 935fe7f4b93..976aa30367a 100644 --- a/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts +++ b/cocos/physics/bullet/shapes/bullet-trimesh-shape.ts @@ -23,7 +23,7 @@ */ import { BulletShape } from './bullet-shape'; -import { warnID } from '../../../core'; +import { warnID } from '@base/debug'; import { Mesh } from '../../../3d/assets'; import { MeshCollider } from '../../../../exports/physics-framework'; import { cocos2BulletVec3, cocos2BulletTriMesh } from '../bullet-utils'; diff --git a/cocos/physics/cannon/cannon-world.ts b/cocos/physics/cannon/cannon-world.ts index 03b271d7aed..510339136ae 100644 --- a/cocos/physics/cannon/cannon-world.ts +++ b/cocos/physics/cannon/cannon-world.ts @@ -23,7 +23,8 @@ */ import CANNON from '@cocos/cannon'; -import { Vec3, RecyclePool, error, js, geometry, IVec3Like, IQuatLike, warnID } from '../../core'; +import { Vec3, RecyclePool, js, geometry, IVec3Like, IQuatLike } from '../../core'; +import { error, warnID } from '@base/debug'; import { fillRaycastResult, toCannonRaycastOptions } from './cannon-util'; import { CannonConstraint } from './constraints/cannon-constraint'; import { CannonShape } from './shapes/cannon-shape'; diff --git a/cocos/physics/cannon/constraints/cannon-hinge-constraint.ts b/cocos/physics/cannon/constraints/cannon-hinge-constraint.ts index 8e36fe127dc..8cf974dbc94 100644 --- a/cocos/physics/cannon/constraints/cannon-hinge-constraint.ts +++ b/cocos/physics/cannon/constraints/cannon-hinge-constraint.ts @@ -27,7 +27,8 @@ import { CannonConstraint } from './cannon-constraint'; import { IHingeConstraint } from '../../spec/i-physics-constraint'; import { HingeConstraint } from '../../framework'; import { CannonRigidBody } from '../cannon-rigid-body'; -import { IVec3Like, Vec3, Quat, warnID } from '../../../core'; +import { IVec3Like, Vec3, Quat } from '../../../core'; +import { warnID } from '@base/debug'; const v3_0 = new Vec3(); const quat_0 = new Quat(); diff --git a/cocos/physics/cocos/builtin-world.ts b/cocos/physics/cocos/builtin-world.ts index 304cea733a2..e80cf0bd4e4 100644 --- a/cocos/physics/cocos/builtin-world.ts +++ b/cocos/physics/cocos/builtin-world.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { Vec3, RecyclePool, error, js, IVec3Like, geometry, IQuatLike, warnID } from '../../core'; +import { Vec3, RecyclePool, js, IVec3Like, geometry, IQuatLike } from '../../core'; +import { error, warnID } from '@base/debug'; import { PhysicsRayResult } from '../framework/physics-ray-result'; import { BuiltinSharedBody } from './builtin-shared-body'; import { BuiltinShape } from './shapes/builtin-shape'; 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 8e91ba1cbea..3b2e3b2284e 100644 --- a/cocos/physics/framework/components/character-controllers/box-character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/box-character-controller.ts @@ -22,11 +22,10 @@ THE SOFTWARE. */ -import { - ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, - tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; +import { ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; -import { Vec3, error, warn, CCFloat } from '../../../../core'; +import { Vec3, CCFloat } from '../../../../core'; +import { error, warn } from '@base/debug'; 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 e08f9fd95d0..fd0bd07fc00 100644 --- a/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/capsule-character-controller.ts @@ -22,11 +22,10 @@ THE SOFTWARE. */ -import { - ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, - tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; +import { ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, tooltip, displayOrder, visible, type, serializable } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; -import { Vec3, error, warn, CCFloat } from '../../../../core'; +import { Vec3, CCFloat } from '../../../../core'; +import { error, warn } from '@base/debug'; 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 ef6a0509058..2768e689deb 100644 --- a/cocos/physics/framework/components/character-controllers/character-controller.ts +++ b/cocos/physics/framework/components/character-controllers/character-controller.ts @@ -22,11 +22,10 @@ THE SOFTWARE. */ -import { - ccclass, disallowMultiple, - tooltip, displayOrder, type, serializable } from 'cc.decorator'; +import { ccclass, disallowMultiple, tooltip, displayOrder, type, serializable } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; -import { Vec3, warn, CCFloat, Eventify } from '../../../../core'; +import { Vec3, CCFloat, Eventify } from '../../../../core'; +import { warn } from '@base/debug'; import { Component } from '../../../../scene-graph'; import { IBaseCharacterController } from '../../../spec/i-character-controller'; import { ECharacterControllerType } from '../../physics-enum'; diff --git a/cocos/physics/framework/components/colliders/collider.ts b/cocos/physics/framework/components/colliders/collider.ts index 8caffad63e7..cfb73be2777 100644 --- a/cocos/physics/framework/components/colliders/collider.ts +++ b/cocos/physics/framework/components/colliders/collider.ts @@ -25,7 +25,8 @@ import { ccclass, tooltip, displayOrder, displayName, readOnly, type, serializable } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; -import { Eventify, Vec3, error, geometry } from '../../../../core'; +import { Eventify, Vec3, geometry } from '../../../../core'; +import { error } from '@base/debug'; import { CharacterTriggerEventType, CollisionEventType, TriggerEventType } from '../../physics-interface'; import { RigidBody } from '../rigid-body'; import { PhysicsMaterial } from '../../assets/physics-material'; diff --git a/cocos/physics/framework/components/colliders/mesh-collider.ts b/cocos/physics/framework/components/colliders/mesh-collider.ts index 608ad551b74..1a8fbbf3153 100644 --- a/cocos/physics/framework/components/colliders/mesh-collider.ts +++ b/cocos/physics/framework/components/colliders/mesh-collider.ts @@ -22,21 +22,12 @@ THE SOFTWARE. */ -import { - ccclass, - help, - executeInEditMode, - menu, - type, - editable, - serializable, - tooltip, -} from 'cc.decorator'; +import { ccclass, help, executeInEditMode, menu, type, editable, serializable, tooltip } from 'cc.decorator'; import { Collider } from './collider'; import { Mesh } from '../../../../3d/assets'; import { ITrimeshShape } from '../../../spec/i-physics-shape'; import { EColliderType, ERigidBodyType } from '../../physics-enum'; -import { warnID } from '../../../../core'; +import { warnID } from '@base/debug'; import { RigidBody } from '../rigid-body'; /** diff --git a/cocos/physics/framework/components/colliders/plane-collider.ts b/cocos/physics/framework/components/colliders/plane-collider.ts index 7a9203e07de..e780e97c66f 100644 --- a/cocos/physics/framework/components/colliders/plane-collider.ts +++ b/cocos/physics/framework/components/colliders/plane-collider.ts @@ -22,17 +22,9 @@ THE SOFTWARE. */ -import { - ccclass, - help, - executeInEditMode, - menu, - tooltip, - type, - editable, - serializable, -} from 'cc.decorator'; -import { Vec3, warnID } from '../../../../core'; +import { ccclass, help, executeInEditMode, menu, tooltip, type, editable, serializable } from 'cc.decorator'; +import { Vec3 } from '../../../../core'; +import { warnID } from '@base/debug'; import { Collider } from './collider'; import { IPlaneShape } from '../../../spec/i-physics-shape'; import { EColliderType, ERigidBodyType } from '../../physics-enum'; diff --git a/cocos/physics/framework/components/colliders/terrain-collider.ts b/cocos/physics/framework/components/colliders/terrain-collider.ts index 0d511c45295..e9d82f7ed68 100644 --- a/cocos/physics/framework/components/colliders/terrain-collider.ts +++ b/cocos/physics/framework/components/colliders/terrain-collider.ts @@ -22,22 +22,14 @@ THE SOFTWARE. */ -import { - ccclass, - help, - executeInEditMode, - menu, - type, - serializable, - tooltip, -} from 'cc.decorator'; +import { ccclass, help, executeInEditMode, menu, type, serializable, tooltip } from 'cc.decorator'; import { Collider } from './collider'; import { ITerrainShape } from '../../../spec/i-physics-shape'; import { ITerrainAsset } from '../../../spec/i-external'; import { TerrainAsset } from '../../../../terrain/terrain-asset'; import { EColliderType, ERigidBodyType } from '../../physics-enum'; import { RigidBody } from '../rigid-body'; -import { warnID } from '../../../../core'; +import { warnID } from '@base/debug'; /** * @en diff --git a/cocos/physics/framework/components/rigid-body.ts b/cocos/physics/framework/components/rigid-body.ts index a2ae7329607..552ca90b10c 100644 --- a/cocos/physics/framework/components/rigid-body.ts +++ b/cocos/physics/framework/components/rigid-body.ts @@ -24,22 +24,10 @@ THE SOFTWARE. */ -import { - ccclass, - help, - disallowMultiple, - executeInEditMode, - menu, - executionOrder, - tooltip, - displayOrder, - visible, - type, - serializable, - override, -} from 'cc.decorator'; +import { ccclass, help, disallowMultiple, executeInEditMode, menu, executionOrder, tooltip, displayOrder, visible, type, serializable, override } from 'cc.decorator'; import { DEBUG } from 'internal:constants'; -import { Vec3, error, warn } from '../../../core'; +import { Vec3 } from '../../../core'; +import { error, warn } from '@base/debug'; import { Component } from '../../../scene-graph'; import { IRigidBody } from '../../spec/i-rigid-body'; import { selector, createRigidBody } from '../physics-selector'; diff --git a/cocos/physics/framework/physics-selector.ts b/cocos/physics/framework/physics-selector.ts index 309ce068020..2655e126585 100644 --- a/cocos/physics/framework/physics-selector.ts +++ b/cocos/physics/framework/physics-selector.ts @@ -31,7 +31,8 @@ import { IBoxShape, ISphereShape, ICapsuleShape, ITrimeshShape, ICylinderShape, import { IPhysicsWorld } from '../spec/i-physics-world'; import { IRigidBody } from '../spec/i-rigid-body'; import { IBoxCharacterController, ICapsuleCharacterController } from '../spec/i-character-controller'; -import { errorID, IVec3Like, warn, debug } from '../../core'; +import { errorID, warn, debug } from '@base/debug'; +import { IVec3Like } from '../../core'; import { cclegacy } from '@base/global'; import { EColliderType, EConstraintType, ECharacterControllerType } from './physics-enum'; import { PhysicsMaterial } from '.'; diff --git a/cocos/physics/framework/physics-system.ts b/cocos/physics/framework/physics-system.ts index c816bc53156..40c62f4d487 100644 --- a/cocos/physics/framework/physics-system.ts +++ b/cocos/physics/framework/physics-system.ts @@ -23,7 +23,8 @@ */ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; -import { Vec3, RecyclePool, Enum, System, Settings, settings, geometry, warn, IQuatLike, IVec3Like, error } from '../../core'; +import { Vec3, RecyclePool, Enum, System, Settings, settings, geometry, IQuatLike, IVec3Like } from '../../core'; +import { warn, error } from '@base/debug'; import { cclegacy } from '@base/global'; import { IPhysicsWorld, IRaycastOptions } from '../spec/i-physics-world'; import { director, Director, game } from '../../game'; diff --git a/cocos/physics/physx/character-controllers/physx-character-controller.ts b/cocos/physics/physx/character-controllers/physx-character-controller.ts index a5361c282ec..1b80414314f 100644 --- a/cocos/physics/physx/character-controllers/physx-character-controller.ts +++ b/cocos/physics/physx/character-controllers/physx-character-controller.ts @@ -22,8 +22,9 @@ THE SOFTWARE. */ -import { error, IVec3Like, Vec3 } from '../../../core'; -import { PhysicsSystem } from '../../framework'; +import { error } from '@base/debug'; +import { IVec3Like, Vec3 } from '../../../core'; +import { PhysicsSystem } from '../../framework'; import { CharacterController } from '../../framework/components/character-controllers/character-controller'; import { IBaseCharacterController } from '../../spec/i-character-controller'; import { getWrapShape, PX, _trans, getJsTransform } from '../physx-adapter'; diff --git a/cocos/physics/physx/joints/physx-configurable-joint.ts b/cocos/physics/physx/joints/physx-configurable-joint.ts index fcedd4401e1..6959a4dfcec 100644 --- a/cocos/physics/physx/joints/physx-configurable-joint.ts +++ b/cocos/physics/physx/joints/physx-configurable-joint.ts @@ -24,7 +24,8 @@ Copyright (c) 2023 Xiamen Yaji Software Co., Ltd. /* eslint-disable @typescript-eslint/no-unsafe-return */ -import { IVec3Like, Vec3, Quat, Mat4, error, math, toRadian } from '../../../core'; +import { IVec3Like, Vec3, Quat, Mat4, math, toRadian } from '../../../core'; +import { error } from '@base/debug'; import { ConfigurableConstraint, EConstraintMode, EDriverMode } from '../../framework'; import { IConfigurableConstraint } from '../../spec/i-physics-constraint'; import { PX, _trans, getTempTransform, _pxtrans } from '../physx-adapter'; diff --git a/cocos/physics/physx/physx-adapter.ts b/cocos/physics/physx/physx-adapter.ts index a7eefb10070..d0feaf70741 100644 --- a/cocos/physics/physx/physx-adapter.ts +++ b/cocos/physics/physx/physx-adapter.ts @@ -35,7 +35,8 @@ import { wasmFactory, PhysXWasmUrl } from './physx.wasmjs'; import { WebAssemblySupportMode } from '../../misc/webassembly-support'; import { instantiateWasm } from 'pal/wasm'; import { BYTEDANCE, DEBUG, EDITOR, TEST, WASM_SUPPORT_MODE } from 'internal:constants'; -import { IQuatLike, IVec3Like, Quat, RecyclePool, Vec3, geometry, Settings, settings, sys, debug, error } from '../../core'; +import { IQuatLike, IVec3Like, Quat, RecyclePool, Vec3, geometry, Settings, settings, sys } from '../../core'; +import { debug, error } from '@base/debug'; import { cclegacy } from '@base/global'; import { shrinkPositions } from '../utils/util'; import { IRaycastOptions } from '../spec/i-physics-world'; diff --git a/cocos/physics/physx/physx-world.ts b/cocos/physics/physx/physx-world.ts index 6ffe301e263..ac90db6a2b5 100644 --- a/cocos/physics/physx/physx-world.ts +++ b/cocos/physics/physx/physx-world.ts @@ -24,15 +24,12 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ import { IPhysicsWorld, IRaycastOptions } from '../spec/i-physics-world'; -import { PhysicsMaterial, PhysicsRayResult, CollisionEventType, TriggerEventType, CharacterTriggerEventType, - CharacterControllerContact } from '../framework'; -import { error, RecyclePool, js, IVec3Like, geometry, IQuatLike, Vec3, Quat } from '../../core'; +import { PhysicsMaterial, PhysicsRayResult, CollisionEventType, TriggerEventType, CharacterTriggerEventType, CharacterControllerContact } from '../framework'; +import { error } from '@base/debug'; +import { RecyclePool, js, IVec3Like, geometry, IQuatLike, Vec3, Quat } from '../../core'; import { IBaseConstraint } from '../spec/i-physics-constraint'; import { PhysXRigidBody } from './physx-rigid-body'; -import { - addActorToScene, raycastAll, simulateScene, initializeWorld, raycastClosest, sweepClosest, - gatherEvents, getWrapShape, PX, getContactDataOrByteOffset, sweepAll, -} from './physx-adapter'; +import { addActorToScene, raycastAll, simulateScene, initializeWorld, raycastClosest, sweepClosest, gatherEvents, getWrapShape, PX, getContactDataOrByteOffset, sweepAll } from './physx-adapter'; import { PhysXSharedBody } from './physx-shared-body'; import { TupleDictionary } from '../utils/tuple-dictionary'; import { PhysXContactEquation } from './physx-contact-equation'; diff --git a/cocos/profiler/profiler.ts b/cocos/profiler/profiler.ts index ba6c085c93e..daba138651f 100644 --- a/cocos/profiler/profiler.ts +++ b/cocos/profiler/profiler.ts @@ -33,7 +33,8 @@ import { Node } from '../scene-graph/node'; import { ICounterOption } from './counter'; import { PerfCounter } from './perf-counter'; import { Pass } from '../render-scene'; -import { preTransforms, System, sys, Settings, settings, warn } from '../core'; +import { preTransforms, System, sys, Settings, settings } from '../core'; +import { warn } from '@base/debug'; import { cclegacy, ccwindow } from '@base/global'; import { Root } from '../root'; import { PipelineRuntime } from '../rendering/custom/pipeline'; diff --git a/cocos/render-scene/core/memory-pools.ts b/cocos/render-scene/core/memory-pools.ts index 5a1350e4725..86e21751834 100644 --- a/cocos/render-scene/core/memory-pools.ts +++ b/cocos/render-scene/core/memory-pools.ts @@ -24,7 +24,7 @@ import { DEBUG } from 'internal:constants'; import { NativeBufferPool } from './native-pools'; -import { warn } from '../../core'; +import { warn } from '@base/debug'; const contains = (a: number[], t: number): boolean => { for (let i = 0; i < a.length; ++i) { diff --git a/cocos/render-scene/core/pass-utils.ts b/cocos/render-scene/core/pass-utils.ts index 64fa3825fbd..2c1ae39a708 100644 --- a/cocos/render-scene/core/pass-utils.ts +++ b/cocos/render-scene/core/pass-utils.ts @@ -23,7 +23,8 @@ */ import { Type } from '../../gfx'; -import { Color, Mat3, Mat4, Vec2, Vec3, Vec4, Quat, IVec2Like, IVec3Like, IVec4Like, IMat3Like, IMat4Like, warnID } from '../../core'; +import { Color, Mat3, Mat4, Vec2, Vec3, Vec4, Quat, IVec2Like, IVec3Like, IVec4Like, IMat3Like, IMat4Like } from '../../core'; +import { warnID } from '@base/debug'; const typeMask = 0xfc000000; // 6 bits => 64 types const bindingMask = 0x03f00000; // 6 bits => 64 bindings diff --git a/cocos/render-scene/core/pass.jsb.ts b/cocos/render-scene/core/pass.jsb.ts index 35cdb895767..bd411423cf8 100644 --- a/cocos/render-scene/core/pass.jsb.ts +++ b/cocos/render-scene/core/pass.jsb.ts @@ -21,10 +21,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { MacroRecord, MaterialProperty } from "./pass-utils"; +import { MacroRecord, MaterialProperty } from './pass-utils'; import { EffectAsset } from '../../asset/assets/effect-asset'; import type { Pass as JsbPass } from './pass'; -import { Mat3, Mat4, Quat, Vec2, Vec3, Vec4, error } from '../../core'; +import { Mat3, Mat4, Quat, Vec2, Vec3, Vec4 } from '../../core'; +import { error } from '@base/debug'; import { MathType } from '../../core/math/math-native-ext'; declare const jsb: any; diff --git a/cocos/render-scene/core/pass.ts b/cocos/render-scene/core/pass.ts index 814ef95e65e..1775dba140b 100644 --- a/cocos/render-scene/core/pass.ts +++ b/cocos/render-scene/core/pass.ts @@ -27,7 +27,8 @@ import { Root } from '../../root'; import { TextureBase } from '../../asset/assets/texture-base'; import { builtinResMgr } from '../../asset/asset-manager/builtin-res-mgr'; import { getPhaseID } from '../../rendering/pass-phase'; -import { murmurhash2_32_gc, errorID, assertID, warnID } from '../../core'; +import { murmurhash2_32_gc } from '../../core'; +import { errorID, assertID, warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { BufferUsageBit, DynamicStateFlagBit, DynamicStateFlags, Feature, GetTypeSize, MemoryUsageBit, PrimitiveMode, Type, Color, BlendState, BlendTarget, Buffer, BufferInfo, BufferViewInfo, DepthStencilState, DescriptorSet, DescriptorSetInfo, DescriptorSetLayout, Device, RasterizerState, Sampler, Texture, Shader, PipelineLayout, deviceManager, UniformBlock } from '../../gfx'; import { EffectAsset } from '../../asset/assets/effect-asset'; diff --git a/cocos/render-scene/core/program-lib.ts b/cocos/render-scene/core/program-lib.ts index f9295cac218..e21ae6f55bf 100644 --- a/cocos/render-scene/core/program-lib.ts +++ b/cocos/render-scene/core/program-lib.ts @@ -29,7 +29,7 @@ import { PipelineRuntime } from '../../rendering/custom/pipeline'; import { MacroRecord } from './pass-utils'; import { PipelineLayoutInfo, Device, Attribute, UniformBlock, ShaderInfo, Uniform, ShaderStage, DESCRIPTOR_SAMPLER_TYPE, DESCRIPTOR_BUFFER_TYPE, DescriptorSetLayout, DescriptorSetLayoutBinding, DescriptorSetLayoutInfo, DescriptorType, ShaderStageFlagBit, API, UniformSamplerTexture, PipelineLayout, Shader, UniformStorageBuffer, UniformStorageImage, UniformSampler, UniformTexture, UniformInputAttachment } from '../../gfx'; import { genHandles, getActiveAttributes, getShaderInstanceName, getSize, getVariantKey, IMacroInfo, populateMacros, prepareDefines } from './program-utils'; -import { debug, warn, error } from '../../core'; +import { debug, warn, error } from '@base/debug'; import { cclegacy } from '@base/global'; const _dsLayoutInfo = new DescriptorSetLayoutInfo(); diff --git a/cocos/render-scene/core/program-utils.ts b/cocos/render-scene/core/program-utils.ts index e020a7f0ed1..ffdf3bbeef1 100644 --- a/cocos/render-scene/core/program-utils.ts +++ b/cocos/render-scene/core/program-utils.ts @@ -23,7 +23,7 @@ ****************************************************************************/ import { EffectAsset } from '../../asset/assets/effect-asset'; -import { error, warn } from '../../core'; +import { error, warn } from '@base/debug'; import { Attribute, GetTypeSize, ShaderInfo, Uniform } from '../../gfx/base/define'; import { UBOForwardLight, UBOSkinning } from '../../rendering/define'; import { genHandle, MacroRecord } from './pass-utils'; diff --git a/cocos/render-scene/core/texture-buffer-pool.ts b/cocos/render-scene/core/texture-buffer-pool.ts index f17259266b1..c0aa4183fd1 100644 --- a/cocos/render-scene/core/texture-buffer-pool.ts +++ b/cocos/render-scene/core/texture-buffer-pool.ts @@ -22,9 +22,8 @@ THE SOFTWARE. */ -import { getTypedArrayConstructor, Format, FormatInfos, TextureType, TextureUsageBit, - Texture, TextureInfo, Device, BufferTextureCopy } from '../../gfx'; -import { debug } from '../../core'; +import { getTypedArrayConstructor, Format, FormatInfos, TextureType, TextureUsageBit, Texture, TextureInfo, Device, BufferTextureCopy } from '../../gfx'; +import { debug } from '@base/debug'; export function nearestPOT (num: number): number { --num; diff --git a/cocos/render-scene/scene/camera.ts b/cocos/render-scene/scene/camera.ts index 82e020dd7cd..c58eef67812 100644 --- a/cocos/render-scene/scene/camera.ts +++ b/cocos/render-scene/scene/camera.ts @@ -23,7 +23,8 @@ */ import { EDITOR } from 'internal:constants'; import { SurfaceTransform, ClearFlagBit, Device, Color, ClearFlags } from '../../gfx'; -import { lerp, Mat4, Rect, toRadian, Vec3, IVec4Like, preTransforms, warnID, geometry, Vec4 } from '../../core'; +import { lerp, Mat4, Rect, toRadian, Vec3, IVec4Like, preTransforms, geometry, Vec4 } from '../../core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { CAMERA_DEFAULT_MASK } from '../../rendering/define'; import { Node } from '../../scene-graph'; diff --git a/cocos/render-scene/scene/shadows.ts b/cocos/render-scene/scene/shadows.ts index 8b8a03ef8bd..67acd98dd98 100644 --- a/cocos/render-scene/scene/shadows.ts +++ b/cocos/render-scene/scene/shadows.ts @@ -24,7 +24,8 @@ import { DEBUG } from 'internal:constants'; import { Material } from '../../asset/assets/material'; -import { Color, Mat4, Vec3, Vec2, Enum, assert, geometry } from '../../core'; +import { Color, Mat4, Vec3, Vec2, Enum, geometry } from '../../core'; +import { assert } from '@base/debug'; import { cclegacy } from '@base/global'; import type { ShadowsInfo } from '../../scene-graph/scene-globals'; import { IMacroPatch } from '../core/pass'; diff --git a/cocos/render-scene/scene/submodel.ts b/cocos/render-scene/scene/submodel.ts index a77b388d3bb..9ad736b19f9 100644 --- a/cocos/render-scene/scene/submodel.ts +++ b/cocos/render-scene/scene/submodel.ts @@ -26,7 +26,8 @@ import { RenderingSubMesh } from '../../asset/assets/rendering-sub-mesh'; import { RenderPriority, UNIFORM_REFLECTION_TEXTURE_BINDING, UNIFORM_REFLECTION_STORAGE_BINDING, INST_MAT_WORLD, INST_SH, UBOSH, isEnableEffect } from '../../rendering/define'; import { BatchingSchemes, IMacroPatch, Pass } from '../core/pass'; import { DescriptorSet, DescriptorSetInfo, Device, InputAssembler, Texture, TextureType, TextureUsageBit, TextureInfo, Format, Sampler, Filter, Address, Shader, SamplerInfo, deviceManager, Attribute, Feature, FormatInfos, getTypedArrayConstructor } from '../../gfx'; -import { errorID, Mat4 } from '../../core'; +import { errorID } from '@base/debug'; +import { Mat4 } from '../../core'; import { cclegacy } from '@base/global'; import { getPhaseID } from '../../rendering/pass-phase'; import { Root } from '../../root'; diff --git a/cocos/render-scene/utils.ts b/cocos/render-scene/utils.ts index ff1dc948d62..7c9a8af5612 100644 --- a/cocos/render-scene/utils.ts +++ b/cocos/render-scene/utils.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { error } from '../core'; +import { error } from '@base/debug'; import { Attribute, Buffer, BufferInfo, Device, InputAssemblerInfo, AttributeName, BufferUsageBit, Format, MemoryUsageBit, InputAssembler } from '../gfx'; import { IGeometry } from '../primitive/define'; diff --git a/cocos/rendering/custom/compiler.ts b/cocos/rendering/custom/compiler.ts index da170462e25..581a4a6bfb1 100644 --- a/cocos/rendering/custom/compiler.ts +++ b/cocos/rendering/custom/compiler.ts @@ -23,14 +23,12 @@ ****************************************************************************/ import { DEBUG } from 'internal:constants'; import { Buffer, Framebuffer, LoadOp, StoreOp, Texture, Viewport } from '../../gfx'; -import { assert } from '../../core'; +import { assert } from '@base/debug'; import { VectorGraphColorMap } from './effect'; import { DefaultVisitor, depthFirstSearch, ReferenceGraphView } from './graph'; import { LayoutGraphData } from './layout-graph'; import { BasicPipeline } from './pipeline'; -import { Blit, ClearView, ComputePass, ComputeSubpass, CopyPass, Dispatch, FormatView, ManagedBuffer, ManagedResource, ManagedTexture, MovePass, - RasterPass, RasterSubpass, RaytracePass, RenderGraph, RenderGraphVisitor, RasterView, ComputeView, - RenderQueue, RenderSwapchain, ResolvePass, ResourceGraph, ResourceGraphVisitor, SceneData, SubresourceView } from './render-graph'; +import { Blit, ClearView, ComputePass, ComputeSubpass, CopyPass, Dispatch, FormatView, ManagedBuffer, ManagedResource, ManagedTexture, MovePass, RasterPass, RasterSubpass, RaytracePass, RenderGraph, RenderGraphVisitor, RasterView, ComputeView, RenderQueue, RenderSwapchain, ResolvePass, ResourceGraph, ResourceGraphVisitor, SceneData, SubresourceView } from './render-graph'; import { AccessType, ResourceResidency, SceneFlags } from './types'; import { hashCombineNum, hashCombineStr } from './define'; diff --git a/cocos/rendering/custom/custom-pipeline.ts b/cocos/rendering/custom/custom-pipeline.ts index b4ba762cce5..a27c7cd2972 100644 --- a/cocos/rendering/custom/custom-pipeline.ts +++ b/cocos/rendering/custom/custom-pipeline.ts @@ -30,7 +30,8 @@ import { CopyPair, LightInfo, QueueHint, ResourceResidency, SceneFlags } from '. import { buildBloomPass, buildForwardPass, buildFxaaPass, buildPostprocessPass, buildSSSSPass, buildToneMappingPass, buildTransparencyPass, buildUIPass, hasSkinObject, buildHBAOPasses, buildCopyPass, getRenderArea, buildReflectionProbePasss } from './define'; import { isUICamera } from './utils'; import { RenderWindow } from '../../render-scene/core/render-window'; -import { assert, geometry } from '../../core'; +import { assert } from '@base/debug'; +import { geometry } from '../../core'; import { cclegacy } from '@base/global'; import { RenderScene } from '../../render-scene'; import { AABB } from '../../core/geometry/aabb'; diff --git a/cocos/rendering/custom/debug.ts b/cocos/rendering/custom/debug.ts index 5f5703289ea..33681be42ea 100644 --- a/cocos/rendering/custom/debug.ts +++ b/cocos/rendering/custom/debug.ts @@ -24,8 +24,8 @@ /* eslint-disable max-len */ import { Viewport } from '../../gfx'; -import { assert } from '../../core'; -import { DefaultVisitor, ReferenceGraphView, ED} from './graph'; +import { assert } from '@base/debug'; +import { DefaultVisitor, ReferenceGraphView, ED } from './graph'; import { Blit, ClearView, ComputePass, ComputeSubpass, CopyPass, Dispatch, getRenderGraphValueName, MovePass, RasterPass, RasterSubpass, RaytracePass, RenderGraph, RenderGraphVisitor, RenderQueue, SceneData } from './render-graph'; import { getQueueHintName } from './types'; diff --git a/cocos/rendering/custom/define.ts b/cocos/rendering/custom/define.ts index c8e46df2a0b..2607da5a70c 100644 --- a/cocos/rendering/custom/define.ts +++ b/cocos/rendering/custom/define.ts @@ -36,7 +36,8 @@ import { SpotLight } from '../../render-scene/scene/spot-light'; import { supportsR32FloatTexture, supportsRGBA16HalfFloatTexture } from '../define'; import { BasicPipeline, Pipeline } from './pipeline'; import { AccessType, AttachmentType, CopyPair, LightInfo, QueueHint, ResourceResidency, SceneFlags, UpdateFrequency, UploadPair } from './types'; -import { Vec2, Vec3, Vec4, macro, geometry, toRadian, assert, nextPow2 } from '../../core'; +import { Vec2, Vec3, Vec4, macro, geometry, toRadian, nextPow2 } from '../../core'; +import { assert } from '@base/debug'; import { cclegacy } from '@base/global'; import { ImageAsset, Material, Texture2D } from '../../asset/assets'; import { getProfilerCamera, SRGBToLinear } from '../pipeline-funcs'; diff --git a/cocos/rendering/custom/executor.ts b/cocos/rendering/custom/executor.ts index b3fee4599d8..743836a5e02 100644 --- a/cocos/rendering/custom/executor.ts +++ b/cocos/rendering/custom/executor.ts @@ -29,7 +29,8 @@ */ /* eslint-disable max-len */ import { getPhaseID, InstancedBuffer, PipelineStateManager } from '..'; -import { assert, RecyclePool } from '../../core'; +import { assert } from '@base/debug'; +import { RecyclePool } from '../../core'; import { cclegacy } from '@base/global'; import intersect from '../../core/geometry/intersect'; import { Sphere } from '../../core/geometry/sphere'; diff --git a/cocos/rendering/custom/layout-graph-utils.ts b/cocos/rendering/custom/layout-graph-utils.ts index 2bbcc998654..c755cf31f74 100644 --- a/cocos/rendering/custom/layout-graph-utils.ts +++ b/cocos/rendering/custom/layout-graph-utils.ts @@ -24,7 +24,7 @@ /* eslint-disable max-len */ import { EffectAsset } from '../../asset/assets'; -import { assert, error, warn } from '../../core'; +import { assert, error, warn } from '@base/debug'; import { DescriptorSetInfo, DescriptorSetLayout, DescriptorSetLayoutBinding, DescriptorSetLayoutInfo, DescriptorType, Device, PipelineLayout, PipelineLayoutInfo, ShaderStageFlagBit, Type, Uniform, UniformBlock } from '../../gfx'; import { DefaultVisitor, depthFirstSearch, GraphColor, MutableVertexPropertyMap } from './graph'; import { DescriptorBlockData, DescriptorData, DescriptorDB, DescriptorSetData, DescriptorSetLayoutData, LayoutGraph, LayoutGraphData, LayoutGraphDataValue, LayoutGraphValue, PipelineLayoutData, RenderPassType, RenderPhase, RenderPhaseData, RenderStageData, ShaderProgramData } from './layout-graph'; diff --git a/cocos/rendering/custom/scene-culling.ts b/cocos/rendering/custom/scene-culling.ts index b337a00f6de..aa54af55478 100644 --- a/cocos/rendering/custom/scene-culling.ts +++ b/cocos/rendering/custom/scene-culling.ts @@ -1,4 +1,5 @@ -import { Vec3, assert } from '../../core'; +import { Vec3 } from '../../core'; +import { assert } from '@base/debug'; import { Frustum, intersect, AABB } from '../../core/geometry'; import { CommandBuffer } from '../../gfx'; import { BatchingSchemes, Pass, RenderScene } from '../../render-scene'; diff --git a/cocos/rendering/custom/web-pipeline.ts b/cocos/rendering/custom/web-pipeline.ts index 1e3a33cd209..f8d6134c9ed 100644 --- a/cocos/rendering/custom/web-pipeline.ts +++ b/cocos/rendering/custom/web-pipeline.ts @@ -26,7 +26,8 @@ import { systemInfo } from 'pal/system-info'; import { DEBUG } from 'internal:constants'; import { Buffer, DescriptorSetLayout, Device, Feature, Format, FormatFeatureBit, Sampler, Swapchain, Texture, ClearFlagBit, DescriptorSet, deviceManager, Viewport, API, CommandBuffer, Type, SamplerInfo, Filter, Address, DescriptorSetInfo, LoadOp, StoreOp, ShaderStageFlagBit, BufferInfo, TextureInfo, TextureType, UniformBlock, ResolveMode, SampleCount, Color } from '../../gfx'; -import { Mat4, Quat, toRadian, Vec2, Vec3, Vec4, assert, macro, IVec4Like, IMat4Like, IVec2Like, Color as CoreColor } from '../../core'; +import { Mat4, Quat, toRadian, Vec2, Vec3, Vec4, macro, IVec4Like, IMat4Like, IVec2Like, Color as CoreColor } from '../../core'; +import { assert } from '@base/debug'; import { cclegacy } from '@base/global'; import { AccessType, AttachmentType, CopyPair, LightInfo, LightingMode, MovePair, QueueHint, ResolvePair, ResourceDimension, ResourceFlags, ResourceResidency, SceneFlags, UpdateFrequency } from './types'; import { ComputeView, RasterView, Blit, ClearView, ComputePass, CopyPass, Dispatch, ManagedBuffer, ManagedResource, MovePass, RasterPass, RasterSubpass, RenderData, RenderGraph, RenderGraphComponent, RenderGraphValue, RenderQueue, RenderSwapchain, ResourceDesc, ResourceGraph, ResourceGraphValue, ResourceStates, ResourceTraits, SceneData, Subpass } from './render-graph'; diff --git a/cocos/rendering/custom/web-program-library.ts b/cocos/rendering/custom/web-program-library.ts index fa17cd734ee..6ed8d77b040 100644 --- a/cocos/rendering/custom/web-program-library.ts +++ b/cocos/rendering/custom/web-program-library.ts @@ -33,7 +33,7 @@ import { ProgramLibrary, ProgramProxy } from './private'; import { DescriptorTypeOrder, UpdateFrequency } from './types'; import { ProgramGroup, ProgramInfo } from './web-types'; import { getCustomPassID, getCustomPhaseID, getOrCreateDescriptorSetLayout, getEmptyDescriptorSetLayout, getEmptyPipelineLayout, initializeDescriptorSetLayoutInfo, makeDescriptorSetLayoutData, getDescriptorSetLayout, getOrCreateDescriptorID, getDescriptorTypeOrder, getProgramID, getDescriptorNameID, getDescriptorName, INVALID_ID, ENABLE_SUBPASS, getCustomSubpassID } from './layout-graph-utils'; -import { assert, error, warn } from '../../core/platform/debug'; +import { assert, error, warn } from '@base/debug'; import { IDescriptorSetLayoutInfo, localDescriptorSetLayout } from '../define'; import { PipelineRuntime } from './pipeline'; diff --git a/cocos/rendering/deferred/deferred-pipeline.ts b/cocos/rendering/deferred/deferred-pipeline.ts index 6850bd743dd..980182c1a0f 100644 --- a/cocos/rendering/deferred/deferred-pipeline.ts +++ b/cocos/rendering/deferred/deferred-pipeline.ts @@ -35,13 +35,10 @@ import { RenderPipeline, IRenderPipelineInfo, PipelineRenderData, PipelineInputA import { MainFlow } from './main-flow'; import { RenderTextureConfig } from '../pipeline-serialization'; import { ShadowFlow } from '../shadow/shadow-flow'; -import { Format, StoreOp, - ColorAttachment, DepthStencilAttachment, RenderPass, LoadOp, - RenderPassInfo, Texture, AccessFlagBit, Framebuffer, - TextureInfo, TextureType, TextureUsageBit, FramebufferInfo, Swapchain, GeneralBarrierInfo } from '../../gfx'; +import { Format, StoreOp, ColorAttachment, DepthStencilAttachment, RenderPass, LoadOp, RenderPassInfo, Texture, AccessFlagBit, Framebuffer, TextureInfo, TextureType, TextureUsageBit, FramebufferInfo, Swapchain, GeneralBarrierInfo } from '../../gfx'; import { UBOGlobal, UBOCamera, UBOShadow, UNIFORM_SHADOWMAP_BINDING, UNIFORM_SPOT_SHADOW_MAP_TEXTURE_BINDING } from '../define'; import { Camera } from '../../render-scene/scene'; -import { errorID, log } from '../../core/platform/debug'; +import { errorID, log } from '@base/debug'; import { DeferredPipelineSceneData } from './deferred-pipeline-scene-data'; import { PipelineEventType } from '../pipeline-event'; diff --git a/cocos/rendering/forward/forward-pipeline.ts b/cocos/rendering/forward/forward-pipeline.ts index e81e893131f..3a2737f2806 100644 --- a/cocos/rendering/forward/forward-pipeline.ts +++ b/cocos/rendering/forward/forward-pipeline.ts @@ -33,7 +33,7 @@ import { Swapchain, RenderPass } from '../../gfx'; import { builtinResMgr } from '../../asset/asset-manager/builtin-res-mgr'; import { Texture2D } from '../../asset/assets/texture-2d'; import { Camera } from '../../render-scene/scene'; -import { errorID, log } from '../../core/platform/debug'; +import { errorID, log } from '@base/debug'; import { PipelineSceneData } from '../pipeline-scene-data'; import { ReflectionProbeFlow } from '../reflection-probe/reflection-probe-flow'; diff --git a/cocos/rendering/geometry-renderer.ts b/cocos/rendering/geometry-renderer.ts index 7729412efd7..c74a9331fa2 100644 --- a/cocos/rendering/geometry-renderer.ts +++ b/cocos/rendering/geometry-renderer.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { Color, Mat4, Vec3, Vec4, geometry, warnID, toRadian } from '../core'; +import { Color, Mat4, Vec3, Vec4, geometry, toRadian } from '../core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { SetIndex } from './define'; import { PipelineStateManager } from './pipeline-state-manager'; diff --git a/cocos/rendering/post-process/components/taa-mask.ts b/cocos/rendering/post-process/components/taa-mask.ts index ff416e93a0c..045b64e9da3 100644 --- a/cocos/rendering/post-process/components/taa-mask.ts +++ b/cocos/rendering/post-process/components/taa-mask.ts @@ -1,5 +1,5 @@ import { RenderTexture } from '../../../asset/assets'; -import { warn } from '../../../core'; +import { warn } from '@base/debug'; import { property } from '../../../core/data/class-decorator'; import { ccclass, menu } from '../../../core/data/decorators'; import { game } from '../../../game'; diff --git a/cocos/rendering/post-process/passes/skin-pass.ts b/cocos/rendering/post-process/passes/skin-pass.ts index 5866a2fd675..25df2fc5313 100644 --- a/cocos/rendering/post-process/passes/skin-pass.ts +++ b/cocos/rendering/post-process/passes/skin-pass.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { Vec4, Vec3, warnID } from '../../../core'; +import { Vec4, Vec3 } from '../../../core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { Camera } from '../../../render-scene/scene'; import { LightInfo, QueueHint, SceneFlags } from '../../custom/types'; diff --git a/cocos/root.jsb.ts b/cocos/root.jsb.ts index 0709139d5bc..afd3f3f0467 100644 --- a/cocos/root.jsb.ts +++ b/cocos/root.jsb.ts @@ -24,7 +24,8 @@ import { DataPoolManager } from './3d/skeletal-animation/data-pool-manager'; import { Device, deviceManager } from './gfx'; -import { settings, Settings, warnID, Pool, macro } from './core'; +import { settings, Settings, Pool, macro } from './core'; +import { warnID } from '@base/debug'; import { cclegacy } from '@base/global'; import { ForwardPipeline } from './rendering'; import type { Root as JsbRoot } from './root'; diff --git a/cocos/root.ts b/cocos/root.ts index be8a779ba8f..7c813655e37 100644 --- a/cocos/root.ts +++ b/cocos/root.ts @@ -23,7 +23,8 @@ */ import { cclegacy } from '@base/global'; -import { Pool, warnID, settings, Settings, macro } from './core'; +import { Pool, settings, Settings, macro } from './core'; +import { warnID } from '@base/debug'; import type { RenderPipeline } from './rendering/render-pipeline'; import { DeferredPipeline } from './rendering/deferred/deferred-pipeline'; import { createDefaultPipeline } from './rendering/forward/forward-pipeline'; diff --git a/cocos/scene-graph/component-scheduler.ts b/cocos/scene-graph/component-scheduler.ts index 9b2fec86a7f..be8a6d15e18 100644 --- a/cocos/scene-graph/component-scheduler.ts +++ b/cocos/scene-graph/component-scheduler.ts @@ -27,7 +27,7 @@ import { CCObject } from '../core/data/object'; import { js } from '../core'; import { cclegacy } from '@base/global'; import { tryCatchFunctor_EDITOR } from '../core/utils/misc'; -import { error, assert } from '../core/platform/debug'; +import { error, assert } from '@base/debug'; import type { Component } from './component'; const fastRemoveAt = js.array.fastRemoveAt; diff --git a/cocos/scene-graph/component.ts b/cocos/scene-graph/component.ts index 6188babab7d..126560c98a5 100644 --- a/cocos/scene-graph/component.ts +++ b/cocos/scene-graph/component.ts @@ -34,7 +34,7 @@ import { Rect } from '../core/math'; import * as RF from '../core/data/utils/requiring-frame'; import { Node } from './node'; import { cclegacy } from '@base/global'; -import { errorID, warnID, assertID } from '../core/platform/debug'; +import { errorID, warnID, assertID } from '@base/debug'; 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 2f34e8bbb41..36236643276 100644 --- a/cocos/scene-graph/deprecated.ts +++ b/cocos/scene-graph/deprecated.ts @@ -31,7 +31,7 @@ import { Vec2 } from '../core/math/vec2'; import { Size } from '../core/math/size'; import { cclegacy } from '@base/global'; import { CCObject } from '../core/data/object'; -import { warnID } from '../core/platform/debug'; +import { warnID } from '@base/debug'; import { SceneGlobals } from './scene-globals'; import { SystemEventType } from '../input/types'; import { SystemEvent } from '../input'; diff --git a/cocos/scene-graph/find.ts b/cocos/scene-graph/find.ts index bc6b7eb75e3..9de060d9be6 100644 --- a/cocos/scene-graph/find.ts +++ b/cocos/scene-graph/find.ts @@ -23,7 +23,7 @@ */ import { DEV } from 'internal:constants'; -import { warnID } from '../core/platform/debug'; +import { warnID } from '@base/debug'; import { Node } from './node'; import { cclegacy } from '@base/global'; diff --git a/cocos/scene-graph/layers.ts b/cocos/scene-graph/layers.ts index 807a17243a4..dbbd6c98421 100644 --- a/cocos/scene-graph/layers.ts +++ b/cocos/scene-graph/layers.ts @@ -27,7 +27,7 @@ import { cclegacy } from '@base/global'; import { js } from '../core'; import { log2 } from '../core/math/bits'; import { assertIsTrue } from '../core/data/utils/asserts'; -import { getError, warn } from '../core/platform/debug'; +import { getError, warn } from '@base/debug'; import { Settings, settings } from '../core/settings'; // built-in layers, users can use 0~19 bits, 20~31 are system preserve bits. diff --git a/cocos/scene-graph/node-activator.ts b/cocos/scene-graph/node-activator.ts index 0bb35af5801..0353a6b9e23 100644 --- a/cocos/scene-graph/node-activator.ts +++ b/cocos/scene-graph/node-activator.ts @@ -28,7 +28,7 @@ import { array, Pool } from '../core/utils/js'; import { tryCatchFunctor_EDITOR } from '../core/utils/misc'; import { invokeOnEnable, createInvokeImpl, createInvokeImplJit, OneOffInvoker, LifeCycleInvoker } from './component-scheduler'; import { cclegacy } from '@base/global'; -import { assert, errorID, getError, log } from '../core/platform/debug'; +import { assert, errorID, getError, log } from '@base/debug'; import { NodeEventType } from './node-event'; import { assertIsTrue } from '../core/data/utils/asserts'; import type { Component } from './component'; diff --git a/cocos/scene-graph/node-dev.ts b/cocos/scene-graph/node-dev.ts index 4dfb1885be5..14f1a1ec9bf 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 { CCObject } from '../core/data/object'; import * as js from '../core/utils/js'; import { cclegacy } from '@base/global'; -import { error, errorID, getError, warn } from '../core/platform/debug'; +import { error, errorID, getError, warn } from '@base/debug'; import { Component } from './component'; const Destroying = CCObject.Flags.Destroying; diff --git a/cocos/scene-graph/node-ui-properties.ts b/cocos/scene-graph/node-ui-properties.ts index 6387f88f430..df28ef97456 100644 --- a/cocos/scene-graph/node-ui-properties.ts +++ b/cocos/scene-graph/node-ui-properties.ts @@ -24,7 +24,7 @@ import { UIRenderer } from '../2d/framework/ui-renderer'; import { UITransform } from '../2d/framework/ui-transform'; -import { warnID } from '../core/platform/debug'; +import { warnID } from '@base/debug'; import { UIMeshRenderer } from '../2d'; /** diff --git a/cocos/scene-graph/node.jsb.ts b/cocos/scene-graph/node.jsb.ts index 0575106d65b..2ea6fc86738 100644 --- a/cocos/scene-graph/node.jsb.ts +++ b/cocos/scene-graph/node.jsb.ts @@ -22,7 +22,7 @@ import { EDITOR, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { errorID, getError } from '../core/platform/debug'; +import { errorID, getError } from '@base/debug'; import { Component } from './component'; import { NodeEventType } from './node-event'; import { CCObject } from '../core/data/object'; diff --git a/cocos/scene-graph/node.ts b/cocos/scene-graph/node.ts index 8008abebf1c..13f681ddeb0 100644 --- a/cocos/scene-graph/node.ts +++ b/cocos/scene-graph/node.ts @@ -33,7 +33,7 @@ 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 { errorID, warnID, error, log, getError } from '../core/platform/debug'; +import { errorID, warnID, error, log, getError } from '@base/debug'; import { Component } from './component'; import { property } from '../core/data/decorators/property'; import type { Scene } from './scene'; diff --git a/cocos/scene-graph/prefab/prefab.ts b/cocos/scene-graph/prefab/prefab.ts index f4e33525349..4ed6e01dce5 100644 --- a/cocos/scene-graph/prefab/prefab.ts +++ b/cocos/scene-graph/prefab/prefab.ts @@ -31,7 +31,7 @@ import { cclegacy } from '@base/global'; import { Enum } from '../../core/value-types'; import { Asset } from '../../asset/assets/asset'; import { Node } from '../node'; -import { warnID } from '../../core/platform/debug'; +import { warnID } from '@base/debug'; import { updateChildrenForDeserialize } from '../../core/utils/jsb-utils'; import * as utils from './utils'; diff --git a/cocos/scene-graph/prefab/utils.ts b/cocos/scene-graph/prefab/utils.ts index 6163bcf1fd7..9914561ec30 100644 --- a/cocos/scene-graph/prefab/utils.ts +++ b/cocos/scene-graph/prefab/utils.ts @@ -25,7 +25,8 @@ import { EDITOR, SUPPORT_JIT } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { errorID, warn, editorExtrasTag } from '../../core'; +import { errorID, warn } from '@base/debug'; +import { editorExtrasTag } from '../../core'; import { Node } from '../node'; import { Component } from '../component'; import { MountedChildrenInfo, PropertyOverrideInfo, MountedComponentsInfo, TargetInfo, TargetMap, PrefabInstance, TargetOverrideInfo } from './prefab-info'; diff --git a/cocos/scene-graph/scene-globals.ts b/cocos/scene-graph/scene-globals.ts index 42f81a846f1..6a34a0955f0 100644 --- a/cocos/scene-graph/scene-globals.ts +++ b/cocos/scene-graph/scene-globals.ts @@ -37,7 +37,7 @@ import { Node } from './node'; import { cclegacy } from '@base/global'; import { macro } from '../core'; import { Root } from '../root'; -import { warnID } from '../core/platform/debug'; +import { warnID } from '@base/debug'; import { Material, MaterialPropertyFull } from '../asset/assets/material'; import { Scene } from './scene'; import { NodeEventType } from './node-event'; diff --git a/cocos/scene-graph/scene.jsb.ts b/cocos/scene-graph/scene.jsb.ts index bc4c0d89559..9a6936da06e 100644 --- a/cocos/scene-graph/scene.jsb.ts +++ b/cocos/scene-graph/scene.jsb.ts @@ -24,7 +24,7 @@ import { EDITOR, TEST } from 'internal:constants'; import { cclegacy } from '@base/global'; import { Node } from './node'; import { applyTargetOverrides, expandNestedPrefabInstanceNode } from './prefab/utils'; -import { assert } from '../core/platform/debug'; +import { assert } from '@base/debug'; import { updateChildrenForDeserialize } from '../core/utils/jsb-utils'; import { SceneGlobals } from './scene-globals'; import { patch_cc_Scene } from '../native-binding/decorators'; diff --git a/cocos/scene-graph/scene.ts b/cocos/scene-graph/scene.ts index 93d8af7c9f9..1fe59249adc 100644 --- a/cocos/scene-graph/scene.ts +++ b/cocos/scene-graph/scene.ts @@ -25,7 +25,7 @@ import { ccclass, serializable, editable } from 'cc.decorator'; import { EDITOR, TEST } from 'internal:constants'; import { CCObject } from '../core/data/object'; -import { assert, getError } from '../core/platform/debug'; +import { assert, getError } from '@base/debug'; import { RenderScene } from '../render-scene/core/render-scene'; import { Node } from './node'; import { cclegacy } from '@base/global'; diff --git a/cocos/serialization/ccon.ts b/cocos/serialization/ccon.ts index 93c821997fd..3042d6d5608 100644 --- a/cocos/serialization/ccon.ts +++ b/cocos/serialization/ccon.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { getError } from '../core'; +import { getError } from '@base/debug'; import { cclegacy } from '@base/global'; const VERSION = 1; diff --git a/cocos/serialization/deserialize-dynamic.ts b/cocos/serialization/deserialize-dynamic.ts index 78cb3831c30..cd0ec50b51f 100644 --- a/cocos/serialization/deserialize-dynamic.ts +++ b/cocos/serialization/deserialize-dynamic.ts @@ -25,7 +25,8 @@ import { EDITOR, TEST, DEV, DEBUG, JSB, PREVIEW, SUPPORT_JIT } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { js, misc, CCClass, ENUM_TAG, BITMASK_TAG, sys, error, assertIsTrue, CustomSerializable, DeserializationContext, deserializeTag, SerializationInput } from '../core'; +import { js, misc, CCClass, ENUM_TAG, BITMASK_TAG, sys, assertIsTrue, CustomSerializable, DeserializationContext, deserializeTag, SerializationInput } from '../core'; +import { error } from '@base/debug'; import { MissingScript } from '../misc/missing-script'; import { Details } from './deserialize'; import { Platform } from '../../pal/system-info/enum-type'; diff --git a/cocos/serialization/deserialize.ts b/cocos/serialization/deserialize.ts index 4478c1a98ba..cdfe85e4c44 100644 --- a/cocos/serialization/deserialize.ts +++ b/cocos/serialization/deserialize.ts @@ -24,7 +24,8 @@ import { EDITOR, TEST, PREVIEW, DEBUG, JSB, DEV } from 'internal:constants'; import { cclegacy } from '@base/global'; -import { errorID, getError, js, assertIsTrue } from '../core'; +import { errorID, getError } from '@base/debug'; +import { js, assertIsTrue } from '../core'; import { deserializeDynamic, DeserializeDynamicOptions, parseUuidDependenciesDynamic } from './deserialize-dynamic'; import { Asset } from '../asset/assets/asset'; diff --git a/cocos/serialization/instantiate.ts b/cocos/serialization/instantiate.ts index ef59cfb8a18..f4453043b1e 100644 --- a/cocos/serialization/instantiate.ts +++ b/cocos/serialization/instantiate.ts @@ -24,7 +24,8 @@ */ import { DEV, JSB } from 'internal:constants'; -import { CCObject, isCCObject, js, ValueType, jsbUtils, isCCClassOrFastDefined, getError, warn, misc } from '../core'; +import { CCObject, isCCObject, js, ValueType, jsbUtils, isCCClassOrFastDefined, misc } from '../core'; +import { getError, warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { Prefab } from '../scene-graph/prefab'; import { Node } from '../scene-graph/node'; diff --git a/cocos/serialization/report-missing-class.ts b/cocos/serialization/report-missing-class.ts index ae312fc1bee..a6bdb18635a 100644 --- a/cocos/serialization/report-missing-class.ts +++ b/cocos/serialization/report-missing-class.ts @@ -23,7 +23,7 @@ */ import { EDITOR } from 'internal:constants'; -import { errorID } from '../core'; +import { errorID } from '@base/debug'; /** * diff --git a/cocos/sorting/sorting-layers.ts b/cocos/sorting/sorting-layers.ts index 62a580af912..23d372a8bfe 100644 --- a/cocos/sorting/sorting-layers.ts +++ b/cocos/sorting/sorting-layers.ts @@ -23,7 +23,7 @@ import { EDITOR } from 'internal:constants'; import { director } from '../game/director'; import { Game, game } from '../game'; -import { errorID } from '../core/platform/debug'; +import { errorID } from '@base/debug'; import { Settings, settings } from '../core/settings'; import { Enum } from '../core/value-types'; diff --git a/cocos/sorting/sorting.ts b/cocos/sorting/sorting.ts index 23d96b60451..e2df3aa3506 100644 --- a/cocos/sorting/sorting.ts +++ b/cocos/sorting/sorting.ts @@ -27,7 +27,7 @@ import { clamp } from '../core/math'; import { SortingLayers } from './sorting-layers'; import { Component } from '../scene-graph/component'; import { ModelRenderer } from '../misc/model-renderer'; -import { warnID } from '../core/platform/debug'; +import { warnID } from '@base/debug'; const MAX_INT16 = (1 << 15) - 1; const MIN_INT16 = -1 << 15; diff --git a/cocos/spine/lib/instantiated.ts b/cocos/spine/lib/instantiated.ts index 1adf8f8aa88..c5c67e6b4ab 100644 --- a/cocos/spine/lib/instantiated.ts +++ b/cocos/spine/lib/instantiated.ts @@ -25,7 +25,8 @@ import { instantiateWasm, fetchBuffer, ensureWasmModuleReady } from 'pal/wasm'; import { JSB, WASM_SUPPORT_MODE, CULL_ASM_JS_MODULE } from 'internal:constants'; import { game } from '../../game'; -import { getError, error, sys } from '../../core'; +import { getError, error } from '@base/debug'; +import { sys } from '../../core'; import { WebAssemblySupportMode } from '../../misc/webassembly-support'; import { overrideSpineDefine } from './spine-define'; diff --git a/cocos/spine/skeleton-cache.ts b/cocos/spine/skeleton-cache.ts index 290c231578b..4368a0fd60d 100644 --- a/cocos/spine/skeleton-cache.ts +++ b/cocos/spine/skeleton-cache.ts @@ -27,7 +27,7 @@ import { vfmtPosUvColor4B, vfmtPosUvTwoColor4B, getAttributeStride } from '../2d import { SPINE_WASM } from './lib/instantiated'; import spine from './lib/spine-core.js'; import { SkeletonData } from './skeleton-data'; -import { warn } from '../core/platform/debug'; +import { warn } from '@base/debug'; const MaxCacheTime = 30; const FrameTime = 1 / 60; diff --git a/cocos/spine/skeleton-data.ts b/cocos/spine/skeleton-data.ts index 64b97119bc5..891fe45f492 100644 --- a/cocos/spine/skeleton-data.ts +++ b/cocos/spine/skeleton-data.ts @@ -23,7 +23,8 @@ */ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; -import { CCString, Enum, error } from '../core'; +import { CCString, Enum } from '../core'; +import { error } from '@base/debug'; import { cclegacy } from '@base/global'; import SkeletonCache from './skeleton-cache'; import { Skeleton } from './skeleton'; diff --git a/cocos/spine/skeleton.ts b/cocos/spine/skeleton.ts index 86738fd35db..a0bb9225041 100644 --- a/cocos/spine/skeleton.ts +++ b/cocos/spine/skeleton.ts @@ -24,7 +24,7 @@ import { EDITOR_NOT_IN_PREVIEW, JSB } from 'internal:constants'; import { ccclass, executeInEditMode, help, menu, serializable, type, displayName, override, displayOrder, editable, tooltip } from 'cc.decorator'; import { Material, Texture2D } from '../asset/assets'; -import { error, logID, warn } from '../core/platform/debug'; +import { error, logID, warn } from '@base/debug'; import { Enum, EnumType, ccenum } from '../core/value-types/enum'; import { Node } from '../scene-graph'; import { CCObject, Color, RecyclePool, js } from '../core'; diff --git a/cocos/tiledmap/tiled-layer.ts b/cocos/tiledmap/tiled-layer.ts index 155b5ff4b28..489b17a1d46 100644 --- a/cocos/tiledmap/tiled-layer.ts +++ b/cocos/tiledmap/tiled-layer.ts @@ -31,14 +31,12 @@ import { UIRenderer } from '../2d/framework/ui-renderer'; import { SpriteFrame } from '../2d/assets/sprite-frame'; import { Component, Node } from '../scene-graph'; import { TMXMapInfo } from './tmx-xml-parser'; -import { Color, IVec2Like, Mat4, Size, Vec2, Vec3, warn, logID } from '../core'; +import { Color, IVec2Like, Mat4, Size, Vec2, Vec3 } from '../core'; +import { warn, logID } from '@base/debug'; import { TiledTile } from './tiled-tile'; import { RenderData } from '../2d/renderer/render-data'; import { IBatcher } from '../2d/renderer/i-batcher'; -import { - MixedGID, GID, Orientation, TiledTextureGrids, TMXTilesetInfo, RenderOrder, StaggerAxis, StaggerIndex, TileFlag, - GIDFlags, TiledAnimationType, PropertiesInfo, TMXLayerInfo, -} from './tiled-types'; +import { MixedGID, GID, Orientation, TiledTextureGrids, TMXTilesetInfo, RenderOrder, StaggerAxis, StaggerIndex, TileFlag, GIDFlags, TiledAnimationType, PropertiesInfo, TMXLayerInfo } from './tiled-types'; import { fillTextureGrids } from './tiled-utils'; import { NodeEventType } from '../scene-graph/node-event'; import { RenderEntity, RenderEntityType } from '../2d/renderer/render-entity'; diff --git a/cocos/tiledmap/tiled-map.ts b/cocos/tiledmap/tiled-map.ts index 73f2de6433c..ef33c2096b5 100644 --- a/cocos/tiledmap/tiled-map.ts +++ b/cocos/tiledmap/tiled-map.ts @@ -26,15 +26,15 @@ import { ccclass, displayOrder, executeInEditMode, help, menu, requireComponent, import { EDITOR, JSB } from 'internal:constants'; import { Component } from '../scene-graph/component'; import { UITransform } from '../2d/framework'; -import { GID, Orientation, PropertiesInfo, Property, RenderOrder, StaggerAxis, StaggerIndex, TiledAnimationType, TiledTextureGrids, TileFlag, - TMXImageLayerInfo, TMXLayerInfo, TMXObjectGroupInfo, TMXObjectType, TMXTilesetInfo } from './tiled-types'; +import { GID, Orientation, PropertiesInfo, Property, RenderOrder, StaggerAxis, StaggerIndex, TiledAnimationType, TiledTextureGrids, TileFlag, TMXImageLayerInfo, TMXLayerInfo, TMXObjectGroupInfo, TMXObjectType, TMXTilesetInfo } from './tiled-types'; import { TMXMapInfo } from './tmx-xml-parser'; import { TiledLayer } from './tiled-layer'; import { TiledObjectGroup } from './tiled-object-group'; import { TiledMapAsset } from './tiled-map-asset'; import { Sprite } from '../2d/components/sprite'; import { fillTextureGrids } from './tiled-utils'; -import { Size, Vec2, logID, Color, sys, warn } from '../core'; +import { Size, Vec2, Color, sys } from '../core'; +import { logID, warn } from '@base/debug'; import { SpriteFrame } from '../2d/assets'; import { NodeEventType } from '../scene-graph/node-event'; import { Node } from '../scene-graph'; diff --git a/cocos/tiledmap/tiled-tile.ts b/cocos/tiledmap/tiled-tile.ts index b1463935b71..0fe24383c9c 100644 --- a/cocos/tiledmap/tiled-tile.ts +++ b/cocos/tiledmap/tiled-tile.ts @@ -36,7 +36,8 @@ import { ccclass, executeInEditMode, help, menu, requireComponent, type } from 'cc.decorator'; import { Component } from '../scene-graph/component'; import { TiledLayer } from './tiled-layer'; -import { CCInteger, warn } from '../core'; +import { CCInteger } from '../core'; +import { warn } from '@base/debug'; import { UITransform } from '../2d/framework'; import { NodeEventType } from '../scene-graph/node-event'; diff --git a/cocos/tiledmap/tmx-xml-parser.ts b/cocos/tiledmap/tmx-xml-parser.ts index f66e8d37974..f99bb2d8f69 100644 --- a/cocos/tiledmap/tmx-xml-parser.ts +++ b/cocos/tiledmap/tmx-xml-parser.ts @@ -26,11 +26,9 @@ import { Label, HorizontalTextAlignment, VerticalTextAlignment } from '../2d/com import codec from '../../external/compression/ZipUtils.js'; import zlib from '../../external/compression/zlib.min.js'; import { SAXParser } from '../asset/asset-manager/plist-parser'; -import { - GID, MixedGID, Orientation, PropertiesInfo, RenderOrder, StaggerAxis, StaggerIndex, TiledAnimation, TiledAnimationType, - TileFlag, TMXImageLayerInfo, TMXLayerInfo, TMXObject, TMXObjectGroupInfo, TMXObjectType, TMXTilesetInfo, -} from './tiled-types'; -import { Color, error, errorID, logID, Size, Vec2, warn } from '../core'; +import { GID, MixedGID, Orientation, PropertiesInfo, RenderOrder, StaggerAxis, StaggerIndex, TiledAnimation, TiledAnimationType, TileFlag, TMXImageLayerInfo, TMXLayerInfo, TMXObject, TMXObjectGroupInfo, TMXObjectType, TMXTilesetInfo } from './tiled-types'; +import { Color, Size, Vec2 } from '../core'; +import { error, errorID, logID, warn } from '@base/debug'; import { SpriteFrame } from '../2d/assets'; function uint8ArrayToUint32Array (uint8Arr: Uint8Array): null | Uint32Array | number[] { diff --git a/cocos/tween/actions/action-interval.ts b/cocos/tween/actions/action-interval.ts index c1a6b1fe93d..62bfab064b8 100644 --- a/cocos/tween/actions/action-interval.ts +++ b/cocos/tween/actions/action-interval.ts @@ -26,7 +26,8 @@ */ import { FiniteTimeAction, Action } from './action'; -import { macro, logID, errorID } from '../../core'; +import { macro } from '../../core'; +import { logID, errorID } from '@base/debug'; import { ActionInstant } from './action-instant'; /** diff --git a/cocos/tween/actions/action-manager.ts b/cocos/tween/actions/action-manager.ts index fdc1f08fa9b..bbb76e55bba 100644 --- a/cocos/tween/actions/action-manager.ts +++ b/cocos/tween/actions/action-manager.ts @@ -25,7 +25,7 @@ THE SOFTWARE. */ -import { errorID, logID } from '../../core/platform/debug'; +import { errorID, logID } from '@base/debug'; import { Action } from './action'; import { Node } from '../../scene-graph'; import { cclegacy } from '@base/global'; diff --git a/cocos/tween/actions/action.ts b/cocos/tween/actions/action.ts index 065ae1bd2f9..c4a4e43f0fa 100644 --- a/cocos/tween/actions/action.ts +++ b/cocos/tween/actions/action.ts @@ -25,7 +25,7 @@ THE SOFTWARE. */ -import { logID, errorID } from '../../core'; +import { logID, errorID } from '@base/debug'; import { Node } from '../../scene-graph'; /** diff --git a/cocos/tween/tween-action.ts b/cocos/tween/tween-action.ts index 8cae3d8fbaf..bd1dbba54cf 100644 --- a/cocos/tween/tween-action.ts +++ b/cocos/tween/tween-action.ts @@ -22,7 +22,8 @@ THE SOFTWARE. */ -import { warnID, warn, easing } from '../core'; +import { warnID, warn } from '@base/debug'; +import { easing } from '../core'; import { ActionInterval } from './actions/action-interval'; import { ITweenOption } from './export-api'; import { VERSION } from '@base/global'; diff --git a/cocos/tween/tween.ts b/cocos/tween/tween.ts index 78d4508a9f2..8f2508ea525 100644 --- a/cocos/tween/tween.ts +++ b/cocos/tween/tween.ts @@ -23,7 +23,7 @@ */ import { TweenSystem } from './tween-system'; -import { warn } from '../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { ActionInterval, sequence, repeat, repeatForever, reverseTime, delayTime, spawn } from './actions/action-interval'; import { removeSelf, show, hide, callFunc } from './actions/action-instant'; diff --git a/cocos/ui/deprecated.ts b/cocos/ui/deprecated.ts index 72e6b039d8c..23379924f47 100644 --- a/cocos/ui/deprecated.ts +++ b/cocos/ui/deprecated.ts @@ -38,7 +38,7 @@ import { Widget } from './widget'; import { PageView } from './page-view'; import { PageViewIndicator } from './page-view-indicator'; import { SafeArea } from './safe-area'; -import { warnID } from '../core/platform/debug'; +import { warnID } from '@base/debug'; import { ccclass } from '../core/data/class-decorator'; import { js, removeProperty, markAsWarning } from '../core'; import { cclegacy } from '@base/global'; diff --git a/cocos/ui/layout.ts b/cocos/ui/layout.ts index 5d81d4f9509..88789073db8 100644 --- a/cocos/ui/layout.ts +++ b/cocos/ui/layout.ts @@ -30,7 +30,7 @@ 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'; -import { warn } from '../core'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; import { NodeEventType } from '../scene-graph/node-event'; import { Node } from '../scene-graph/node'; diff --git a/cocos/ui/page-view.ts b/cocos/ui/page-view.ts index 175dd828f0b..d871d1605e2 100644 --- a/cocos/ui/page-view.ts +++ b/cocos/ui/page-view.ts @@ -33,7 +33,7 @@ import { Layout } from './layout'; import { PageViewIndicator } from './page-view-indicator'; import { ScrollView, EventType as ScrollEventType } from './scroll-view'; import { ScrollBar } from './scroll-bar'; -import { warnID, logID } from '../core/platform/debug'; +import { warnID, logID } from '@base/debug'; import { extendsEnum } from '../core/data/utils/extends-enum'; import { cclegacy } from '@base/global'; import { NodeEventType } from '../scene-graph/node-event'; diff --git a/cocos/ui/progress-bar.ts b/cocos/ui/progress-bar.ts index 3c41864cad3..c8b403cabe6 100644 --- a/cocos/ui/progress-bar.ts +++ b/cocos/ui/progress-bar.ts @@ -30,7 +30,7 @@ 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'; -import { warn } from '../core/platform/debug'; +import { warn } from '@base/debug'; import { cclegacy } from '@base/global'; /** diff --git a/cocos/ui/scroll-view.ts b/cocos/ui/scroll-view.ts index 7d77d378549..2b17c3492a4 100644 --- a/cocos/ui/scroll-view.ts +++ b/cocos/ui/scroll-view.ts @@ -28,7 +28,7 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { EventHandler as ComponentEventHandler } from '../scene-graph/component-event-handler'; import { UITransform } from '../2d/framework'; import { Event, EventMouse, EventTouch, Touch, SystemEventType, EventHandle, EventGamepad } from '../input/types'; -import { errorID, logID } from '../core/platform/debug'; +import { errorID, logID } from '@base/debug'; import { Size, Vec2, Vec3, approx } from '../core/math'; import { Layout } from './layout'; import { ScrollBar } from './scroll-bar'; diff --git a/cocos/ui/view.ts b/cocos/ui/view.ts index 474789eecfa..104fa224dc5 100644 --- a/cocos/ui/view.ts +++ b/cocos/ui/view.ts @@ -30,7 +30,8 @@ import { MINIGAME, JSB, RUNTIME_BASED, EDITOR } from 'internal:constants'; import { screenAdapter } from 'pal/screen-adapter'; import { Eventify } from '../core/event'; import { Rect, Size, Vec2 } from '../core/math'; -import { visibleRect, errorID, screen, macro, System } from '../core'; +import { visibleRect, screen, macro, System } from '../core'; +import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { Orientation } from '../../pal/screen-adapter/enum-type'; import { director } from '../game/director'; diff --git a/cocos/ui/widget.ts b/cocos/ui/widget.ts index 5aae0c17f6f..b2a096040d3 100644 --- a/cocos/ui/widget.ts +++ b/cocos/ui/widget.ts @@ -27,7 +27,8 @@ import { ccclass, help, executeInEditMode, executionOrder, menu, requireComponen import { EDITOR, DEV, EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { Component } from '../scene-graph/component'; import { UITransform } from '../2d/framework/ui-transform'; -import { Size, Vec2, Vec3, visibleRect, ccenum, errorID, Rect } from '../core'; +import { Size, Vec2, Vec3, visibleRect, ccenum, Rect } from '../core'; +import { errorID } from '@base/debug'; import { cclegacy } from '@base/global'; import { View } from './view'; import { Scene } from '../scene-graph'; diff --git a/cocos/video/video-downloader.ts b/cocos/video/video-downloader.ts index d0398cd2e66..f18f6190d4b 100644 --- a/cocos/video/video-downloader.ts +++ b/cocos/video/video-downloader.ts @@ -25,7 +25,7 @@ import downloader from '../asset/asset-manager/downloader'; import factory from '../asset/asset-manager/factory'; -import { log } from '../core/platform/debug'; +import { log } from '@base/debug'; import { VideoClip } from './assets/video-clip'; import { ccwindow } from '@base/global'; diff --git a/cocos/video/video-player-impl-web.ts b/cocos/video/video-player-impl-web.ts index 940953ed401..a62480bd481 100644 --- a/cocos/video/video-player-impl-web.ts +++ b/cocos/video/video-player-impl-web.ts @@ -24,7 +24,8 @@ import { screenAdapter } from 'pal/screen-adapter'; import { mat4, visibleRect } from '../core'; -import { sys, screen, warn } from '../core/platform'; +import { sys, screen } from '../core/platform'; +import { warn } from '@base/debug'; import { game } from '../game'; import { contains } from '../core/utils/misc'; import { EventType, READY_STATE } from './video-player-enums'; diff --git a/cocos/video/video-player-impl.ts b/cocos/video/video-player-impl.ts index 51d4d413a8d..5d23ab813eb 100644 --- a/cocos/video/video-player-impl.ts +++ b/cocos/video/video-player-impl.ts @@ -26,7 +26,7 @@ import { cclegacy } from '@base/global'; import { UITransform } from '../2d/framework'; import { VideoPlayer } from './video-player'; import { EventType } from './video-player-enums'; -import { error } from '../core/platform'; +import { error } from '@base/debug'; import { director } from '../game/director'; import { Node } from '../scene-graph'; import type { Camera } from '../render-scene/scene'; diff --git a/cocos/video/video-player.ts b/cocos/video/video-player.ts index 44cfadc6417..5563ceb70d4 100644 --- a/cocos/video/video-player.ts +++ b/cocos/video/video-player.ts @@ -24,7 +24,7 @@ import { ccclass, displayOrder, executeInEditMode, help, menu, slide, range, requireComponent, tooltip, type, serializable } from 'cc.decorator'; import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; -import { warn } from '../core/platform'; +import { warn } from '@base/debug'; import { Component, EventHandler as ComponentEventHandler } from '../scene-graph'; import { UITransform } from '../2d/framework'; import { clamp } from '../core/math'; diff --git a/cocos/web-view/web-view-impl-web.ts b/cocos/web-view/web-view-impl-web.ts index 14d61c7b8d8..76d7029fd39 100644 --- a/cocos/web-view/web-view-impl-web.ts +++ b/cocos/web-view/web-view-impl-web.ts @@ -24,7 +24,7 @@ import { screenAdapter } from 'pal/screen-adapter'; import { EventType } from './web-view-enums'; -import { error, warn } from '../core/platform'; +import { error, warn } from '@base/debug'; import { WebViewImpl } from './web-view-impl'; import { game } from '../game'; import { mat4 } from '../core/math'; diff --git a/exports/base.ts b/exports/base.ts index e2233f60b75..e0e01f99343 100644 --- a/exports/base.ts +++ b/exports/base.ts @@ -35,6 +35,8 @@ import * as gfx from '../cocos/gfx'; // LOAD ENGINE CORE export * from '../cocos/core'; +export { cclegacy, VERSION } from '@base/global'; +export { debug, log, error, warn, assert, logID, errorID, warnID, assertID, isDisplayStats, setDisplayStats, getError, DebugMode } from '@base/debug'; export * from '../cocos/rendering'; export * from '../cocos/rendering/custom/builtin-pipelines'; diff --git a/gulp/tasks/buildDebugInfos.js b/gulp/tasks/buildDebugInfos.js deleted file mode 100644 index 42ba51e3394..00000000000 --- a/gulp/tasks/buildDebugInfos.js +++ /dev/null @@ -1,29 +0,0 @@ -const Fs = require('fs'); - -module.exports = function buildDebugInfos () { - let readContent = Fs.readFileSync('EngineErrorMap.md', 'utf-8'); - let titleRegExp = /### \d+/g; - let debugInfos = {}; - - let result1 = titleRegExp.exec(readContent); - while (result1) { - let result2 = titleRegExp.exec(readContent); - let errInfoHead = result1.index + result1[0].length; - let errInfoTail = result2? result2.index: readContent.length; - - let errCode = /\d+/.exec(result1[0])[0]; - let errInfo = readContent.slice(errInfoHead, errInfoTail); - errInfo = errInfo.replace(/```/g, ' '); - errInfo = errInfo.trim(); - errInfo = errInfo.replace(/\r\n/g, '\n'); - - if (!errInfo.includes('')) { - debugInfos[`${errCode}`] = errInfo; - } - - result1 = result2; - } - - let writeContent = JSON.stringify(debugInfos, null, 4); - Fs.writeFileSync('DebugInfos.json', writeContent); -}; diff --git a/gulp/util/api-docs-build.js b/gulp/util/api-docs-build.js deleted file mode 100644 index 712893fc620..00000000000 --- a/gulp/util/api-docs-build.js +++ /dev/null @@ -1,146 +0,0 @@ -const { spawn, spawnSync } = require('child_process'); -const fs = require('fs'); -let program = require('commander'); -program - .version('1.0.0') - .option('-i --index ', 'Entrance file which is needed when generating API docs.') - .option('-j --jsonFiles ', 'JSON files that are needed when generating API docs.') - .option('-r --removeLanguage ', 'Select the language you don\'t wants to generate.') - .option('-o --output ', 'API docs output fold') - .parse(process.argv); - -const mode = 'commonjs'; -const docsName = 'Cocos-Creator-API'; -const exclude = '"**/cocos/**/+(webgl|webgl2|webgpu|utils|builtin|renderer|scene|models|misc|ammo|shapes|constraint|cannon|graphics|profiler|shader-sources|physx|spec|box2d)/*.ts"'; -const readme = 'none'; -//const exclude = '"**/cocos/**/index.ts"'; - -exports.generateJson = function () { - const index = program.index; - const output = program.output; - - // typedoc command - let commands = [ - index, - '--module', - mode, - '--generate-json', - output, - '--exclude', - exclude, - '--readme', - readme, - '--tags', - '--disableOutputCheck', - '--ignoreCompilerErrors' - ]; - let child = spawnSync('typedoc', commands, { - shell: process.platform === 'win32' - }); - outputDebug(child); -} - -exports.generateAPIZH = function (indexPath, jsonFiles, outputPath) { - if (!checkJsonFileExists(jsonFiles)) return; - // typedoc command - let commands = [ - indexPath, - '--module', - mode, - "--generate-from-json", - jsonFiles, - '--out', - outputPath, - '--name', - docsName, - '--exclude', - exclude, - '--readme', - readme, - '--tags', - '--disableOutputCheck', - '--ignoreCompilerErrors', - '--localize', - 'zh' - ]; - let child = spawn('typedoc', commands, { - shell: process.platform === 'win32' - }); - outputDebug(child); -} - -exports.generateAPIEN = function (indexPath, jsonFiles, outputPath) { - if (!checkJsonFileExists(jsonFiles)) return; - // typedoc command - let commands = [ - indexPath, - '--module', - mode, - "--generate-from-json", - jsonFiles, - '--out', - outputPath, - '--name', - docsName, - '--exclude', - exclude, - '--readme', - readme, - '--tags', - '--disableOutputCheck', - '--ignoreCompilerErrors', - '--localize', - 'en' - ]; - let child = spawn('typedoc', commands, { - shell: process.platform === 'win32' - }); - outputDebug(child); -} - -exports.generateHTMLWithLocalization = function () { - const index = program.index; - const output = program.output; - const jsonFiles = program.jsonFiles; - const removeLanguage = program.removeLanguage; - - removeLanguage != "zh" && this.generateAPIZH(index, jsonFiles, `${output}/zh`); - removeLanguage != "en" && this.generateAPIEN(index, jsonFiles, `${output}/en`); -} - -function checkJsonFileExists(jsonFils) { - let existsSync = fs.accessSync || fs.existsSync; - try { - existsSync(jsonFils) - } - catch (e) { - console.warn(`Rendering is short of the dependent json files`); - return false; - } - return true; -} - -function outputDebug(child) { - // spawnSync - if (child.output && child.output.length > 0) { - for (let i = 0; i < child.output.length; i++) { - child.output[i] && console.log(child.output[i].toString()); - } - console.log(`Json Generator Finished!`); - return; - } - - child.stdout.on('data', function (data) { - console.log(data.toString()); - }); - child.stderr.on('data', function (data) { - console.error(`${data}`); - }); - child.on('close', (code) => { - if (code !== 0) { - console.log('API Docs Generate Failed!'); - return; - } - console.log('API Docs Generate Success!'); - }); -} diff --git a/gulpfile.js b/gulpfile.js index 129aa036dfa..468c2030d43 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -34,10 +34,6 @@ const fs = require('fs-extra'); const ps = require('path'); const cp = require('child_process'); -gulp.task('build-debug-infos', async () => { - return await Promise.resolve(require('./gulp/tasks/buildDebugInfos')()); -}); - gulp.task('build-source', async () => { const cli = require.resolve('@cocos/build-engine/lib/cli'); return cp.spawn('node', [ @@ -52,7 +48,7 @@ gulp.task('build-source', async () => { }); }); -gulp.task('build-h5-source', gulp.series('build-debug-infos', async () => { +gulp.task('build-h5-source', async () => { const outDir = ps.join('bin', 'dev', 'cc'); await fs.ensureDir(outDir); await fs.emptyDir(outDir); @@ -80,9 +76,9 @@ gulp.task('build-h5-source', gulp.series('build-debug-infos', async () => { console.error(`Build process exit with ${exitCode}`); process.exit(exitCode); } -})); +}); -gulp.task('build-h5-minified', gulp.series('build-debug-infos', async () => { +gulp.task('build-h5-minified', async () => { const outDir = ps.join('bin', 'dev', 'cc-min'); await fs.ensureDir(outDir); await fs.emptyDir(outDir); @@ -102,7 +98,7 @@ gulp.task('build-h5-minified', gulp.series('build-debug-infos', async () => { stdio: 'inherit', cwd: __dirname, }); -})); +}); gulp.task('build-declarations', async () => { const outDir = ps.join('bin', '.declarations'); @@ -114,7 +110,7 @@ gulp.task('build-declarations', async () => { }); }); -gulp.task('build', gulp.parallel('build-h5-minified', 'build-debug-infos', 'build-declarations')); +gulp.task('build', gulp.parallel('build-h5-minified', 'build-declarations')); gulp.task('code-check', () => { return cp.spawn('npx', ['tsc', '--noEmit'], { @@ -133,13 +129,3 @@ gulp.task('unit-tests', () => { }); gulp.task('test', gulp.series('code-check', 'unit-tests')); - -gulp.task('build-api-json', async () => { - const APIBuilder = require('./gulp/util/api-docs-build'); - return await Promise.resolve(APIBuilder.generateJson()); -}); - -gulp.task('build-3d-api', async () => { - const APIBuilder = require('./gulp/util/api-docs-build'); - return await Promise.resolve(APIBuilder.generateHTMLWithLocalization()); -}); diff --git a/package-lock.json b/package-lock.json index 07cbbfaf650..b48a9278028 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,6 +86,11 @@ "node": ">=18.0.0" } }, + "cocos/base/debug": { + "name": "@base/debug", + "version": "1.0.0", + "license": "MIT" + }, "cocos/base/global": { "name": "@base/global", "version": "1.0.0", @@ -1910,6 +1915,10 @@ "node": ">=6.9.0" } }, + "node_modules/@base/debug": { + "resolved": "cocos/base/debug", + "link": true + }, "node_modules/@base/global": { "resolved": "cocos/base/global", "link": true diff --git a/package.json b/package.json index 521b667aa8d..60f889fdbe1 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,10 @@ "server": "http-server . -p 8002 -o playground/index.html", "postinstall": "npm run build", "build": "turbo build && npm run build-root", - "build-root": "gulp build-debug-infos && gulp build-declarations && npm run bundle-adapter && npm run fetch-ral", - "build:dev": "gulp build-h5-source", - "build:min": "gulp build-h5-minified", - "build-api-json": "gulp build-api-json -i index.ts -o ./3d-api-docs/tempJson", - "build-api": "npm run build-api-json && gulp build-3d-api -i index.ts -o ./3d-api-docs -j ./3d-api-docs/tempJson", + "build-root": "gulp build-declarations && npm run bundle-adapter && npm run fetch-ral", + "build-engine": "turbo build && gulp build-h5-minified", + "build-engine-dev": "turbo build && gulp build-h5-source", + "build-api-json": "npx typedoc", "checkout-engine-version": "node ./scripts/checkout-engine-version.js", "varify-engine-version": "node ./scripts/varify-engine-version.js", "fetch-ral": "node ./scripts/fetch-ral.js", diff --git a/pal/audio/minigame/player-web.ts b/pal/audio/minigame/player-web.ts index 56a07672a44..a700c6f8c8f 100644 --- a/pal/audio/minigame/player-web.ts +++ b/pal/audio/minigame/player-web.ts @@ -25,7 +25,7 @@ import { minigame } from 'pal/minigame'; import { systemInfo } from 'pal/system-info'; import { clamp01 } from '../../../cocos/core'; -import * as debug from '../../../cocos/core/platform/debug'; +import * as debug from '@base/debug'; import { EventTarget } from '../../../cocos/core/event'; import { audioBufferManager } from '../audio-buffer-manager'; import AudioTimer from '../audio-timer'; diff --git a/pal/audio/web/player-web.ts b/pal/audio/web/player-web.ts index 410e305d8d9..4665ce8c0a7 100644 --- a/pal/audio/web/player-web.ts +++ b/pal/audio/web/player-web.ts @@ -26,7 +26,7 @@ import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants'; import { AudioPCMDataView, AudioEvent, AudioState, AudioType } from '../type'; import { EventTarget } from '../../../cocos/core/event'; import { clamp01 } from '../../../cocos/core'; -import * as debug from '../../../cocos/core/platform/debug'; +import * as debug from '@base/debug'; import { enqueueOperation, OperationInfo, OperationQueueable } from '../operation-queue'; import AudioTimer from '../audio-timer'; import { audioBufferManager } from '../audio-buffer-manager'; diff --git a/pal/audio/web/player.ts b/pal/audio/web/player.ts index bc405ca5604..9caac96031a 100644 --- a/pal/audio/web/player.ts +++ b/pal/audio/web/player.ts @@ -22,7 +22,7 @@ THE SOFTWARE. */ -import { warnID } from '../../../cocos/core'; +import { warnID } from '@base/debug'; import { AudioLoadOptions, AudioType, AudioState, AudioPCMDataView } from '../type'; import { AudioPlayerDOM, OneShotAudioDOM } from './player-dom'; import { AudioContextAgent, AudioPlayerWeb, OneShotAudioWeb } from './player-web'; diff --git a/pal/env/package.json b/pal/env/package.json index 9911a7618d7..b049e2ac62b 100644 --- a/pal/env/package.json +++ b/pal/env/package.json @@ -8,7 +8,6 @@ "license": "MIT", "exports": { ".": { - "node": "./package.json", "types": "./src/index.ts", "native": "./src/native/env.ts", "web": "./src/web/env.ts", diff --git a/pal/image/base-image-data.ts b/pal/image/base-image-data.ts index 904a66e95e4..8f890322490 100644 --- a/pal/image/base-image-data.ts +++ b/pal/image/base-image-data.ts @@ -24,7 +24,7 @@ import { ccwindow } from '@base/global'; import { RawDataType, ImageSource } from './types'; import { sys } from '../../cocos/core/platform/sys'; -import { assert } from '../../cocos/core/platform/debug'; +import { assert } from '@base/debug'; export class BaseImageData { // TODO(qgh):Designed for compatibility, may be removed in the future. diff --git a/pal/image/minigame/image-data.ts b/pal/image/minigame/image-data.ts index 847a908362d..cd2b6bc2776 100644 --- a/pal/image/minigame/image-data.ts +++ b/pal/image/minigame/image-data.ts @@ -24,7 +24,7 @@ import { ALIPAY, XIAOMI, JSB, BAIDU, TAOBAO, TAOBAO_MINIGAME, WECHAT_MINI_PROGRAM } from 'internal:constants'; import { ccwindow } from '@base/global'; import { BaseImageData } from '../base-image-data'; -import { getError } from '../../../cocos/core/platform/debug'; +import { getError } from '@base/debug'; export class ImageData extends BaseImageData { static loadImage (url: string): Promise { diff --git a/pal/image/native/image-data.ts b/pal/image/native/image-data.ts index 2500c84dd08..84d670fd81b 100644 --- a/pal/image/native/image-data.ts +++ b/pal/image/native/image-data.ts @@ -23,7 +23,7 @@ */ import { BaseImageData } from '../base-image-data'; import { ImageSource, IMemoryImageSource, RawDataType } from '../types'; -import { getError, assert } from '../../../cocos/core/platform/debug'; +import { getError, assert } from '@base/debug'; import { override } from '../../../cocos/core/data/decorators/override'; declare const jsb: any; diff --git a/pal/image/web/image-data.ts b/pal/image/web/image-data.ts index 0d7be9e3fc9..87f088d670d 100644 --- a/pal/image/web/image-data.ts +++ b/pal/image/web/image-data.ts @@ -23,7 +23,7 @@ */ import { ccwindow } from '@base/global'; import { BaseImageData } from '../base-image-data'; -import { getError } from '../../../cocos/core/platform/debug'; +import { getError } from '@base/debug'; export class ImageData extends BaseImageData { static loadImage (urlOrBase64: string): Promise { diff --git a/pal/input/web/accelerometer-input.ts b/pal/input/web/accelerometer-input.ts index 84261e2bd62..65ed612dd30 100644 --- a/pal/input/web/accelerometer-input.ts +++ b/pal/input/web/accelerometer-input.ts @@ -29,7 +29,7 @@ import { EventTarget } from '../../../cocos/core/event/event-target'; import { BrowserType, OS } from '../../system-info/enum-type'; import { EventAcceleration, Acceleration } from '../../../cocos/input/types'; import { InputEventType } from '../../../cocos/input/types/event-enum'; -import { warn } from '../../../cocos/core/platform/debug'; +import { warn } from '@base/debug'; export class AccelerometerInputSource { private _intervalInMileSeconds = 200; diff --git a/pal/minigame/alipay.ts b/pal/minigame/alipay.ts index aa65b0a4a24..c2de0f0ad36 100644 --- a/pal/minigame/alipay.ts +++ b/pal/minigame/alipay.ts @@ -25,7 +25,7 @@ import { IMiniGame } from 'pal/minigame'; import { checkPalIntegrity, withImpl, cloneObject, createInnerAudioContextPolyfill } from '@pal/utils'; import { Orientation } from '../screen-adapter/enum-type'; -import { error, warn } from '../../cocos/core/platform/debug'; +import { error, warn } from '@base/debug'; declare let my: any; diff --git a/pal/minigame/baidu.ts b/pal/minigame/baidu.ts index aede4c88e0d..e0585793dd9 100644 --- a/pal/minigame/baidu.ts +++ b/pal/minigame/baidu.ts @@ -25,7 +25,7 @@ import { IMiniGame } from 'pal/minigame'; import { checkPalIntegrity, withImpl, cloneObject, createInnerAudioContextPolyfill } from '@pal/utils'; import { Orientation } from '../screen-adapter/enum-type'; -import { warn } from '../../cocos/core/platform/debug'; +import { warn } from '@base/debug'; declare let swan: any; diff --git a/pal/minigame/runtime.ts b/pal/minigame/runtime.ts index 08b105ca802..8a6374c4287 100644 --- a/pal/minigame/runtime.ts +++ b/pal/minigame/runtime.ts @@ -25,7 +25,7 @@ import { COCOSPLAY, HUAWEI, LINKSURE, OPPO, QTT, VIVO } from 'internal:constants'; import { SystemInfo, IMiniGame } from 'pal/minigame'; import { checkPalIntegrity, withImpl, cloneObject, createInnerAudioContextPolyfill } from '@pal/utils'; -import { warn } from '../../cocos/core/platform/debug'; +import { warn } from '@base/debug'; import { Orientation } from '../screen-adapter/enum-type'; declare let ral: any; diff --git a/pal/minigame/taobao.ts b/pal/minigame/taobao.ts index d0074080878..3d0adb1c19f 100644 --- a/pal/minigame/taobao.ts +++ b/pal/minigame/taobao.ts @@ -26,7 +26,7 @@ import { IMiniGame, SystemInfo } from 'pal/minigame'; import { cloneObject, createInnerAudioContextPolyfill, versionCompare, checkPalIntegrity, withImpl } from '@pal/utils'; import { Orientation } from '../screen-adapter/enum-type'; import { Language } from '../system-info/enum-type'; -import { error, warn } from '../../cocos/core/platform/debug'; +import { error, warn } from '@base/debug'; //taobao IDE language ("Chinese") //taobao phone language (Andrond: "cn", iPad: 'zh_CN') diff --git a/pal/minigame/taobao_minigame.ts b/pal/minigame/taobao_minigame.ts index 92da873a89c..8baf3f12e2f 100644 --- a/pal/minigame/taobao_minigame.ts +++ b/pal/minigame/taobao_minigame.ts @@ -26,7 +26,7 @@ import { IMiniGame, SystemInfo } from 'pal/minigame'; import { cloneObject, createInnerAudioContextPolyfill, versionCompare, checkPalIntegrity, withImpl } from '@pal/utils'; import { Orientation } from '../screen-adapter/enum-type'; import { Language } from '../system-info/enum-type'; -import { error, warn } from '../../cocos/core/platform/debug'; +import { error, warn } from '@base/debug'; //taobao IDE language ("Chinese") //taobao phone language (Andrond: "cn", iPad: 'zh_CN') diff --git a/pal/minigame/xiaomi.ts b/pal/minigame/xiaomi.ts index 7b054f84310..6e0f8afb73a 100644 --- a/pal/minigame/xiaomi.ts +++ b/pal/minigame/xiaomi.ts @@ -25,7 +25,7 @@ import { IMiniGame } from 'pal/minigame'; import { checkPalIntegrity, withImpl, cloneObject, createInnerAudioContextPolyfill } from '@pal/utils'; import { Orientation } from '../screen-adapter/enum-type'; -import { warn } from '../../cocos/core/platform/debug'; +import { warn } from '@base/debug'; declare let qg: any; diff --git a/pal/screen-adapter/minigame/screen-adapter.ts b/pal/screen-adapter/minigame/screen-adapter.ts index dba90b7c06b..acd1c0ffe3d 100644 --- a/pal/screen-adapter/minigame/screen-adapter.ts +++ b/pal/screen-adapter/minigame/screen-adapter.ts @@ -27,7 +27,7 @@ import { minigame } from 'pal/minigame'; import { ConfigOrientation, IScreenOptions, SafeAreaEdge } from 'pal/screen-adapter'; import { systemInfo } from 'pal/system-info'; import { checkPalIntegrity, withImpl } from '@pal/utils'; -import { error, warn, warnID } from '../../../cocos/core/platform/debug'; +import { error, warn, warnID } from '@base/debug'; import { EventTarget } from '../../../cocos/core/event/event-target'; import { Size } from '../../../cocos/core/math'; import { OS } from '../../system-info/enum-type'; diff --git a/pal/screen-adapter/native/screen-adapter.ts b/pal/screen-adapter/native/screen-adapter.ts index 1ffeb4038cd..f721df63526 100644 --- a/pal/screen-adapter/native/screen-adapter.ts +++ b/pal/screen-adapter/native/screen-adapter.ts @@ -27,7 +27,7 @@ import { checkPalIntegrity, withImpl } from '@pal/utils'; import { EventTarget } from '../../../cocos/core/event/event-target'; import { Size } from '../../../cocos/core/math'; import { Orientation } from '../enum-type'; -import { error, warn } from '../../../cocos/core/platform/debug'; +import { warn } from '@base/debug'; export interface SafeAreaEdge { top: number; diff --git a/pal/screen-adapter/web/screen-adapter.ts b/pal/screen-adapter/web/screen-adapter.ts index 2d3441c6155..c63c966ad44 100644 --- a/pal/screen-adapter/web/screen-adapter.ts +++ b/pal/screen-adapter/web/screen-adapter.ts @@ -27,7 +27,7 @@ import { ConfigOrientation, IScreenOptions, SafeAreaEdge } from 'pal/screen-adap import { systemInfo } from 'pal/system-info'; import { checkPalIntegrity, withImpl } from '@pal/utils'; import { cclegacy } from '@base/global'; -import { warnID } from '../../../cocos/core/platform/debug'; +import { warnID } from '@base/debug'; import { EventTarget } from '../../../cocos/core/event/event-target'; import { Size } from '../../../cocos/core/math'; import { Orientation } from '../enum-type'; diff --git a/pal/system-info/minigame/system-info.ts b/pal/system-info/minigame/system-info.ts index 6e0a554ccb2..cab4d923ea4 100644 --- a/pal/system-info/minigame/system-info.ts +++ b/pal/system-info/minigame/system-info.ts @@ -28,7 +28,7 @@ import { IFeatureMap } from 'pal/system-info'; import { checkPalIntegrity, withImpl } from '@pal/utils'; import { EventTarget } from '../../../cocos/core/event'; import { BrowserType, NetworkType, OS, Platform, Language, Feature } from '../enum-type'; -import { warn } from '../../../cocos/core/platform/debug'; +import { warn } from '@base/debug'; // NOTE: register minigame platform here let currentPlatform: Platform; diff --git a/pal/system-info/web/system-info.ts b/pal/system-info/web/system-info.ts index 8b4588e705d..16341ab8069 100644 --- a/pal/system-info/web/system-info.ts +++ b/pal/system-info/web/system-info.ts @@ -27,7 +27,7 @@ import { IFeatureMap } from 'pal/system-info'; import { checkPalIntegrity, withImpl } from '@pal/utils'; import { EventTarget } from '../../../cocos/core/event'; import { BrowserType, NetworkType, OS, Platform, Language, Feature } from '../enum-type'; -import { warn } from '../../../cocos/core/platform/debug'; +import { warn } from '@base/debug'; class SystemInfo extends EventTarget { public readonly networkType: NetworkType; diff --git a/pal/utils/package.json b/pal/utils/package.json index f9e7ed99952..207c8b42383 100644 --- a/pal/utils/package.json +++ b/pal/utils/package.json @@ -8,7 +8,6 @@ "license": "MIT", "exports": { ".": { - "node": "./package.json", "types": "./src/index.ts" } } diff --git a/pal/wasm/wasm-minigame.ts b/pal/wasm/wasm-minigame.ts index b2568ee3552..4542a9247e0 100644 --- a/pal/wasm/wasm-minigame.ts +++ b/pal/wasm/wasm-minigame.ts @@ -26,7 +26,7 @@ import { HUAWEI, TAOBAO_MINIGAME, WASM_SUBPACKAGE, XIAOMI } from 'internal:const import { minigame } from 'pal/minigame'; import { checkPalIntegrity, withImpl } from '@pal/utils'; import { basename } from '../../cocos/core/utils/path'; -import { error, log } from '../../cocos/core/platform/debug'; +import { error, log } from '@base/debug'; export function instantiateWasm (wasmUrl: string, importObject: WebAssembly.Imports): Promise { return getPlatformBinaryUrl(wasmUrl).then((url) => WebAssembly.instantiate(url, importObject)); diff --git a/pal/wasm/wasm-web.ts b/pal/wasm/wasm-web.ts index 227e679f743..6821fe337ac 100644 --- a/pal/wasm/wasm-web.ts +++ b/pal/wasm/wasm-web.ts @@ -24,7 +24,7 @@ import { EDITOR, PREVIEW } from 'internal:constants'; import { checkPalIntegrity, withImpl } from '@pal/utils'; -import { error } from '../../cocos/core/platform/debug'; +import { error } from '@base/debug'; declare const require: any; diff --git a/schemas/module-config.schema.json b/schemas/module-config.schema.json index e38deaa8468..ed16a0e0357 100644 --- a/schemas/module-config.schema.json +++ b/schemas/module-config.schema.json @@ -176,11 +176,6 @@ ], "description": "Abstract platform export, like `web`, `native` and `minigame`. Usually this is used for PAL modules. The build tools resolve the relative platform as entry according to the build platform config.\n- The value can be a `string` or a `object` which requires a default item. eg. { \"web\": \"/path/to/index.ts\" } is equals to { \"web\": { default: \"/path/to/index.ts\" } }.\n- We can also specify the exact platform like { \"web\": {default: \"/path/to/index.ts\", \"web-desktop\": \"/path/to/index.ts\" } }." }, - "node": { - "const": "./package.json", - "description": "`node` should be specified as './package.json' to resolve the path of package.json for build tools.", - "type": "string" - }, "types": { "description": "This is the main module export condition.\n- The dts bundle tools resolve this condition as entry.\n- The API doc tools resolve this condition as entry.\n- If no platform export is specified, the build tools resolve this condition as entry.", "type": "string" @@ -217,7 +212,6 @@ } }, "required": [ - "node", "types" ], "type": "object" @@ -420,8 +414,7 @@ }, "required": [ "name", - "version", - "exports" + "version" ], "type": "object" } diff --git a/tests/animation/newgenanim.test.ts b/tests/animation/newgenanim.test.ts index f7234da60a8..56b6d14de69 100644 --- a/tests/animation/newgenanim.test.ts +++ b/tests/animation/newgenanim.test.ts @@ -1,5 +1,6 @@ -import { lerp, Quat, Vec3, warnID } from '../../cocos/core'; +import { lerp, Quat, Vec3 } from '../../cocos/core'; +import { warnID } from '@base/debug'; import { AnimationBlend1D, AnimationBlend2D, Condition, InvalidTransitionError, VariableNotDefinedError, ClipMotion, AnimationBlendDirect, VariableType, AnimationMask, AnimationGraphVariant } from '../../cocos/animation/marionette/asset-creation'; import { AnimationGraph, StateMachine, Transition, isAnimationTransition, AnimationTransition, State, Layer } from '../../cocos/animation/marionette/animation-graph'; import { VariableTypeMismatchedError } from '../../cocos/animation/marionette/errors'; diff --git a/tests/core/ccclass.test.ts b/tests/core/ccclass.test.ts index 6fccfa9e91c..e5fc60a0f45 100644 --- a/tests/core/ccclass.test.ts +++ b/tests/core/ccclass.test.ts @@ -1,9 +1,9 @@ import { ccclass } from 'cc.decorator'; -import { warnID } from '../../cocos/core'; +import { warnID } from '@base/debug'; import { float, property } from '../../cocos/core/data/class-decorator'; import * as requiringFrame from '../../cocos/core/data/utils/requiring-frame'; import { getClassName, unregisterClass, getClassId } from '../../cocos/core/utils/js-typed'; -import { Component } from '../../cocos/scene-graph/component' +import { Component } from '../../cocos/scene-graph/component'; /** * Happened when: diff --git a/tests/core/logging.test.ts b/tests/core/logging.test.ts index 6d88a3dfea7..eac79271b43 100644 --- a/tests/core/logging.test.ts +++ b/tests/core/logging.test.ts @@ -1,5 +1,5 @@ -import { debug, DebugMode, log, _resetDebugSetting } from '../../cocos/core/platform/debug'; +import { debug, DebugMode, log, _resetDebugSetting } from '@base/debug'; describe('Logging', () => { test('Debug mode', () => { diff --git a/tests/init.ts b/tests/init.ts index c0d43a203b7..f4e42a0ccba 100644 --- a/tests/init.ts +++ b/tests/init.ts @@ -173,10 +173,10 @@ jest.mock( { virtual: true }, ); -jest.mock('../cocos/core/platform/debug', () => { +jest.mock('@base/debug', () => { const result = { __esModule: true, // Use it when dealing with esModules - ...jest.requireActual('../cocos/core/platform/debug') + ...jest.requireActual('../cocos/base/debug/src/index.ts') }; const { feed } = require('./utils/log-capture'); for (const logMethodName of ['warn', 'error', 'warnID', 'errorID']) { @@ -193,6 +193,8 @@ jest.mock('../cocos/core/platform/debug', () => { } } return result; +}, { + virtual: true, }); jest.mock( @@ -208,7 +210,7 @@ jest.mock('serialization-test-helper/run-test', () => { }); import '../exports/base'; -import { DebugMode } from "../cocos/core/platform/debug"; +import { DebugMode } from '@base/debug'; import { EffectAsset, Game, game, IGameConfig } from '../exports/base'; import './asset-manager/init'; import '../cocos/gfx/empty/empty-device'; diff --git a/tests/utils/log-capture.test.ts b/tests/utils/log-capture.test.ts index 19843e11dd5..414b6a853cb 100644 --- a/tests/utils/log-capture.test.ts +++ b/tests/utils/log-capture.test.ts @@ -1,5 +1,5 @@ -import { error, errorID, warn, warnID } from "../../cocos/core"; -import { captureErrorIDs, captureErrors, captureWarnIDs, captureWarns } from "./log-capture"; +import { error, errorID, warn, warnID } from '@base/debug'; +import { captureErrorIDs, captureErrors, captureWarnIDs, captureWarns } from './log-capture'; describe('Log capture', () => { test.each([ diff --git a/tests/utils/log-capture.ts b/tests/utils/log-capture.ts index 0e400e1cd14..8eb525f4254 100644 --- a/tests/utils/log-capture.ts +++ b/tests/utils/log-capture.ts @@ -1,4 +1,4 @@ -import type { error, errorID, warn, warnID } from "../../cocos/core"; +import type { error, errorID, warn, warnID } from '@base/debug'; abstract class LogWatcher { constructor(private _stop: () => void) { diff --git a/turbo.json b/turbo.json index de0e17cd812..a10877587f9 100644 --- a/turbo.json +++ b/turbo.json @@ -5,6 +5,10 @@ "inputs": ["src/**"], "outputs": ["lib/**"], "dependsOn": ["^build"] + }, + "@base/debug#build": { + "outputs": ["lib/**"], + "cache": false } } } \ No newline at end of file