Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support @base/global module #16247

Merged
merged 10 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ rules:
# NOTE: We don't want to rely on TS automatic type inference
'@typescript-eslint/no-inferrable-types': off

# TODO: sadly we still rely heavily on legacyCC
# TODO: sadly we still rely heavily on cclegacy
'@typescript-eslint/no-unsafe-assignment': off
'@typescript-eslint/no-unsafe-call': off
'@typescript-eslint/no-unsafe-member-access': off
Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/assembler/label/font-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import { BufferTextureCopy } from '../../../gfx';
import { safeMeasureText, BASELINE_RATIO, MIDDLE_RATIO, getBaselineOffset } from '../../utils/text-utils';
import { director, Director } from '../../../game/director';
import { ccwindow } from '../../../core/global-exports';
import { ccwindow } from '@base/global';

Check failure on line 32 in cocos/2d/assembler/label/font-utils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

`@base/global` import should occur before import of `../../assets/bitmap-font`

export interface ISharedLabelData {
canvas: HTMLCanvasElement;
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/assembler/label/text-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import { ANDROID, JSB } from 'internal:constants';
import { Texture2D } from '../../../asset/assets';
import { WrapMode } from '../../../asset/assets/asset-enum';
import { cclegacy, Color, Pool, Rect, Vec2 } from '../../../core';
import { cclegacy } from '@base/global';

Check failure on line 27 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

`@base/global` import should occur before import of `../../../asset/assets`
import { Color, Pool, Rect, Vec2 } from '../../../core';
import { log, logID, warn } from '../../../core/platform';
import { SpriteFrame } from '../../assets';
import { FontLetterDefinition } from '../../assets/bitmap-font';
Expand Down Expand Up @@ -77,8 +78,8 @@
this._lettersInfo.length = 0;
}

public processingString (isBmFont: boolean, style: TextStyle, layout: TextLayout,

Check failure on line 81 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline after '('

Check failure on line 81 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline between arguments/params

Check failure on line 81 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline between arguments/params
outputLayoutData: TextOutputLayoutData, inputString: string, out?: string[]): void {

Check failure on line 82 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline between arguments/params

Check failure on line 82 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline between arguments/params

Check failure on line 82 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline before ')'
if (!isBmFont) {
let loopTime = 0;
this._fontScale = this._getStyleFontScale(style.fontSize, style.fontScale);
Expand All @@ -91,7 +92,7 @@
if (loopTime > MAX_CALCULATION_NUM) {
this._fontScale = 1;
} else {
const maxValue = Math.max(outputLayoutData.canvasSize.width, outputLayoutData.canvasSize.height); // Current Canvas Size max dimension

Check warning on line 95 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 154. Maximum allowed is 150
const canvasScaleToMaxSizeRatio = MAX_SIZE / maxValue;
this._fontScale *= canvasScaleToMaxSizeRatio;
this._fontScale = Math.max(1, this._fontScale);
Expand All @@ -117,7 +118,7 @@
}
}

public generateRenderInfo (isBmFont: boolean, style: TextStyle, layout: TextLayout, outputLayoutData: TextOutputLayoutData,

Check failure on line 121 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline after '('

Check failure on line 121 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Expected newline between arguments/params
outputRenderData: TextOutputRenderData, inputString: string, callback: AnyFunction): void {
if (!isBmFont) {
this._updateLabelDimensions(style, layout, outputLayoutData);
Expand Down Expand Up @@ -444,7 +445,7 @@
outputLayoutData.startPosition.set(labelX + outputLayoutData.canvasPadding.x, firstLinelabelY + outputLayoutData.canvasPadding.y);
}

private _updateTexture (style: TextStyle, layout: TextLayout, outputLayoutData: TextOutputLayoutData, outputRenderData: TextOutputRenderData): void {

Check warning on line 448 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 153. Maximum allowed is 150
if (!this._context || !this._canvas) {
return;
}
Expand Down Expand Up @@ -522,7 +523,7 @@
}
}

private _drawTextEffect (startPosition: Vec2, lineHeight: number, style: TextStyle, layout: TextLayout, outputLayoutData: TextOutputLayoutData): void {

Check warning on line 526 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 155. Maximum allowed is 150
if (!style.hasShadow && !style.isOutlined && !style.isUnderline) return;

const isMultiple = outputLayoutData.parsedString.length > 1 && style.hasShadow;
Expand Down Expand Up @@ -1040,7 +1041,7 @@
}
}

private _scaleFontSizeDown (style: TextStyle, layout: TextLayout, outputLayoutData: TextOutputLayoutData, inputString: string, fontSize: number): void {

Check warning on line 1044 in cocos/2d/assembler/label/text-processing.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 156. Maximum allowed is 150
let shouldUpdateContent = true;
if (!fontSize) {
fontSize = 0.1;
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/assets/bitmap-font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import { ccclass, type, serializable, editable } from 'cc.decorator';
import { Font } from './font';
import { SpriteFrame } from './sprite-frame';
import { cclegacy, js, warn } from '../../core';
import { cclegacy } from '@base/global';
import { js, warn } from '../../core';

export interface IConfig {
[key: string]: any;
Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/assets/font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { ccclass } from 'cc.decorator';
import { Asset } from '../../asset/assets';
import { cclegacy } from '../../core';
import { cclegacy } from '@base/global';

/**
* @en Class for Font handling.
Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/assets/label-atlas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import { ccclass } from 'cc.decorator';
import { BitmapFont } from './bitmap-font';
import { cclegacy } from '../../core';
import { cclegacy } from '@base/global';
/**
* @en Class for LabelAtlas handling.
* @zh 艺术数字字体资源类。
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/assets/sprite-atlas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import { EDITOR, TEST } from 'internal:constants';
import { ccclass, serializable, editable } from 'cc.decorator';
import { Asset } from '../../asset/assets';
import { SpriteFrame } from './sprite-frame';
import { cclegacy, js } from '../../core';
import { cclegacy } from '@base/global';
import { js } from '../../core';
import type { TextureBase } from '../../asset/assets/texture-base';

interface ISpriteAtlasSerializeData{
Expand Down
4 changes: 2 additions & 2 deletions cocos/2d/assets/sprite-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, cclegacy, errorID, warnID, js } from '../../core';
import { Mat4, Rect, Size, Vec2, Vec3, Vec4, errorID, warnID, js } from '../../core';
import { cclegacy, ccwindow } from '@base/global';
import { Asset } from '../../asset/assets/asset';
import { TextureBase } from '../../asset/assets/texture-base';
import { ImageAsset } from '../../asset/assets/image-asset';
Expand All @@ -37,7 +38,6 @@
import { Mesh } from '../../3d/assets/mesh';
import { createMesh } from '../../3d/misc';
import { Attribute, AttributeName, Format, PrimitiveMode, Sampler, SamplerInfo, Texture } from '../../gfx';
import { ccwindow } from '../../core/global-exports';

const INSET_LEFT = 0;
const INSET_TOP = 1;
Expand Down Expand Up @@ -261,8 +261,8 @@
* @returns @en SpriteFrame asset. @zh 精灵资源。
*/
public static createWithImage (memoryImageSourceOrImageAsset: ImageAsset | IMemoryImageSource): SpriteFrame;
public static createWithImage (imageSourceOrImageAsset: ImageAsset | IMemoryImageSource | HTMLCanvasElement | HTMLImageElement | ImageBitmap): SpriteFrame {

Check warning on line 264 in cocos/2d/assets/sprite-frame.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 160. Maximum allowed is 150
const img = imageSourceOrImageAsset instanceof ImageAsset ? imageSourceOrImageAsset : new ImageAsset(imageSourceOrImageAsset as IMemoryImageSource);

Check warning on line 265 in cocos/2d/assets/sprite-frame.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 156. Maximum allowed is 150
const tex = new Texture2D();
tex.image = img;
const spf = new SpriteFrame();
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/assets/ttf-font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
*/

import { ccclass, string, override, serializable } from 'cc.decorator';
import { path, cclegacy } from '../../core';
import { path } from '../../core';
import { cclegacy } from '@base/global';
import { Font } from './font';

/**
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/components/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ import { UIMeshRenderer } from './ui-mesh-renderer';
import { Graphics } from './graphics';
import { UIStaticBatch } from './ui-static-batch';
import { UIOpacity } from './ui-opacity';
import { js, cclegacy, replaceProperty } from '../../core';
import { js, replaceProperty } from '../../core';
import { cclegacy } from '@base/global';

/**
* Alias of [[Mask]]
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/components/graphics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, cclegacy } from '../../core';
import { Color, warnID } from '../../core';
import { cclegacy } from '@base/global';
import { scene } from '../../render-scene';
import { IAssembler } from '../renderer/base';
import { IBatcher } from '../renderer/i-batcher';
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/components/label-outline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

import { ccclass, help, executionOrder, menu, tooltip, requireComponent, executeInEditMode, serializable } from 'cc.decorator';
import { Component } from '../../scene-graph/component';
import { Color, cclegacy } from '../../core';
import { Color } from '../../core';
import { cclegacy } from '@base/global';
import { Label } from './label';

/**
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/components/label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import { minigame } from 'pal/minigame';
import { BitmapFont, Font, SpriteFrame } from '../assets';
import { ImageAsset, Texture2D } from '../../asset/assets';
import { ccenum, cclegacy, Color } from '../../core';
import { ccenum, Color } from '../../core';
import { cclegacy } from '@base/global';
import { IBatcher } from '../renderer/i-batcher';
import { FontAtlas } from '../assets/bitmap-font';
import { CanvasPool, ISharedLabelData, LetterRenderTexture } from '../assembler/label/font-utils';
Expand Down Expand Up @@ -339,7 +340,7 @@
* @zh
* 文本字符之间的间距。仅在使用 BMFont 位图字体时生效。
*/
@visible(function (this: Label) {

Check warning on line 343 in cocos/2d/components/label.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
return !this._isSystemFontUsed && this._font instanceof BitmapFont;
})
@displayOrder(9)
Expand Down Expand Up @@ -442,7 +443,7 @@
* 文本字体名称, 只在 useSystemFont 属性为 true 的时候生效。
*/
@displayOrder(13)
@visible(function (this: Label) { return this._isSystemFontUsed; })

Check warning on line 446 in cocos/2d/components/label.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
@tooltip('i18n:label.font_family')
get fontFamily (): string {
return this._fontFamily;
Expand All @@ -465,7 +466,7 @@
*/
@type(Font)
@displayOrder(13)
@visible(function (this: Label) { return !this._isSystemFontUsed; })

Check warning on line 469 in cocos/2d/components/label.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
@tooltip('i18n:label.font')
get font (): Font | null {
// return this._N$file;
Expand Down Expand Up @@ -590,7 +591,7 @@
* @en The height of underline.
* @zh 下划线高度。
*/
@visible(function (this: Label) { return this._isUnderline; })

Check warning on line 594 in cocos/2d/components/label.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Unexpected unnamed function
@editable
@displayOrder(18)
@tooltip('i18n:label.underline_height')
Expand Down
6 changes: 3 additions & 3 deletions cocos/2d/components/mask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
THE SOFTWARE.
*/

import { ccclass, help, executionOrder, menu, tooltip, displayOrder,
type, visible, serializable, range, slide, executeInEditMode } from 'cc.decorator';
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, cclegacy, ccenum, error } from '../../core';
import { clamp, Color, Mat4, Vec2, Vec3, warnID, ccenum, error } from '../../core';
import { cclegacy } from '@base/global';
import { Graphics } from './graphics';
import { TransformBit } from '../../scene-graph/node-enum';
import { Stage } from '../renderer/stencil-manager';
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/components/rich-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, cclegacy, js, Size } from '../../core';
import { assert, warnID, 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';
import { Node } from '../../scene-graph';
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/components/sprite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, cclegacy, ccenum, clamp, warn } from '../../core';
import { Vec2, ccenum, clamp, warn } from '../../core';
import { cclegacy } from '@base/global';
import { IBatcher } from '../renderer/i-batcher';
import { UIRenderer, InstanceMaterialType } from '../framework/ui-renderer';
import { PixelFormat } from '../../asset/assets/asset-enum';
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/components/ui-mesh-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ 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, cclegacy, warn } from '../../core';
import { assert, warn } from '../../core';
import { cclegacy } from '@base/global';
import { RenderDrawInfoType } from '../renderer/render-draw-info';
import type { UIRenderer } from '../framework/ui-renderer';

Expand Down
6 changes: 3 additions & 3 deletions cocos/2d/framework/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
THE SOFTWARE.
*/

import { ccclass, help, disallowMultiple, executeInEditMode,
executionOrder, menu, tooltip, type, serializable } from 'cc.decorator';
import { ccclass, help, disallowMultiple, executeInEditMode, executionOrder, menu, tooltip, type, serializable } from 'cc.decorator';
import { EDITOR } from 'internal:constants';
import { Camera } from '../../misc/camera-component';
import { Widget } from '../../ui/widget';
import { Vec3, screen, Enum, cclegacy, visibleRect } from '../../core';
import { Vec3, screen, Enum, visibleRect } from '../../core';
import { cclegacy } from '@base/global';
import { view } from '../../ui/view';
import { RenderRoot2D } from './render-root-2d';
import { NodeEventType } from '../../scene-graph/node-event';
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/framework/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
*/
/* eslint-disable @typescript-eslint/no-unsafe-return */

import { markAsWarning, removeProperty, replaceProperty, js, Color, cclegacy } from '../../core';
import { markAsWarning, removeProperty, replaceProperty, js, Color } from '../../core';
import { cclegacy } from '@base/global';
import { UIComponent } from './ui-component';
import { UITransform } from './ui-transform';
import { UIRenderer } from './ui-renderer';
Expand Down
5 changes: 2 additions & 3 deletions cocos/2d/framework/render-root-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
THE SOFTWARE.
*/

import { ccclass, disallowMultiple, executeInEditMode,
executionOrder, help, menu, requireComponent } from 'cc.decorator';
import { ccclass, disallowMultiple, executeInEditMode, executionOrder, help, menu, requireComponent } from 'cc.decorator';
import { Component } from '../../scene-graph/component';
import { cclegacy } from '../../core';
import { cclegacy } from '@base/global';
import { UITransform } from './ui-transform';

/**
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/framework/sprite-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
import { ccclass, executeInEditMode, executionOrder, help, menu, serializable, type, visible } from 'cc.decorator';
import { builtinResMgr } from '../../asset/asset-manager';
import { Material } from '../../asset/assets';
import { Color, Vec2, cclegacy } from '../../core';
import { Color, Vec2 } from '../../core';
import { cclegacy } from '@base/global';
import { ModelLocalBindings } from '../../rendering/define';
import { Model } from '../../render-scene/scene';
import { Root } from '../../root';
Expand Down
8 changes: 3 additions & 5 deletions cocos/2d/framework/ui-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
*/

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, cclegacy } from '../../core';
import { ccclass, executeInEditMode, requireComponent, tooltip, type, displayOrder, serializable, override, visible, displayName, disallowAnimation } from 'cc.decorator';
import { Color, assert, ccenum } from '../../core';
import { cclegacy } from '@base/global';
import { builtinResMgr } from '../../asset/asset-manager';
import { Material } from '../../asset/assets';
import { BlendFactor, BlendOp, ColorMask } from '../../gfx';
Expand Down
8 changes: 2 additions & 6 deletions cocos/2d/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
THE SOFTWARE.
*/

import {
graphicsAssembler,
labelAssembler,
spriteAssembler,
} from './assembler';
import { graphicsAssembler, labelAssembler, spriteAssembler } from './assembler';
import { RenderData, MeshRenderData } from './renderer/render-data';
import { MeshBuffer } from './renderer/mesh-buffer';
import { StencilManager } from './renderer/stencil-manager';
import { cclegacy } from '../core';
import { cclegacy } from '@base/global';
import './event';

import './renderer/batcher-2d';
Expand Down
6 changes: 3 additions & 3 deletions cocos/2d/renderer/batcher-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import { Camera, Model } from '../../render-scene/scene';
import type { UIStaticBatch } from '../components/ui-static-batch';
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, cclegacy, 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, assert, approx, EPSILON } from '../../core';
import { cclegacy } from '@base/global';
import { Root } from '../../root';
import { Node } from '../../scene-graph';
import { Stage, StencilManager } from './stencil-manager';
Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/renderer/draw-batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Texture, Sampler, InputAssembler, DescriptorSet, Shader } from '../../g
import { Node } from '../../scene-graph';
import { Model } from '../../render-scene/scene/model';
import { Layers } from '../../scene-graph/layers';
import { cclegacy } from '../../core';
import { cclegacy } from '@base/global';
import { Pass } from '../../render-scene/core/pass';
import { IBatcher } from './i-batcher';

Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/renderer/vertex-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

import { AttributeName, Format, FormatInfos, Attribute } from '../../gfx';
import { cclegacy } from '../../core';
import { cclegacy } from '@base/global';

/**
* @en Vertex format with vector 3 position attribute
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/utils/dynamic-atlas/atlas-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
*/

import { EDITOR_NOT_IN_PREVIEW } from 'internal:constants';
import { System, macro, js, cclegacy } from '../../../core';
import { System, macro, js } from '../../../core';
import { cclegacy } from '@base/global';
import { Filter } from '../../../asset/assets/asset-enum';
import { Atlas, DynamicAtlasTexture } from './atlas';
import { director } from '../../../game';
Expand Down
3 changes: 2 additions & 1 deletion cocos/2d/utils/dynamic-atlas/atlas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { PixelFormat } from '../../../asset/assets/asset-enum';
import { ImageAsset } from '../../../asset/assets/image-asset';
import { Texture2D } from '../../../asset/assets/texture-2d';
import { BufferTextureCopy } from '../../../gfx';
import { cclegacy, warn } from '../../../core';
import { cclegacy } from '@base/global';
import { warn } from '../../../core';
import { SpriteFrame } from '../../assets/sprite-frame';

const space = 2;
Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/utils/font-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { safeMeasureText } from './text-utils';
import downloader from '../../asset/asset-manager/downloader';
import factory from '../../asset/asset-manager/factory';
import { TTFFont } from '../assets/ttf-font';
import { ccwindow } from '../../core/global-exports';
import { ccwindow } from '@base/global';

const ccdocument = ccwindow.document;

Expand Down
2 changes: 1 addition & 1 deletion cocos/2d/utils/html-text-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

import { TEST } from 'internal:constants';
import { cclegacy } from '../../core';
import { cclegacy } from '@base/global';

/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
Expand Down
3 changes: 2 additions & 1 deletion cocos/3d/assets/mesh.jsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import { cclegacy, Vec3 } from '../../core';
import { cclegacy } from '@base/global';
import { Vec3 } from '../../core';
import { patch_cc_Mesh } from '../../native-binding/decorators';
import type { Mesh as JsbMesh } from './mesh';

Expand Down
10 changes: 4 additions & 6 deletions cocos/3d/assets/mesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ import { Asset } from '../../asset/assets/asset';
import { IDynamicGeometry } from '../../primitive/define';
import { BufferBlob } from '../misc/buffer-blob';
import { Skeleton } from './skeleton';
import { geometry, cclegacy, sys, warnID, Mat4, Quat, Vec3, assertIsTrue, murmurhash2_32_gc, errorID } from '../../core';
import { geometry, sys, warnID, Mat4, Quat, Vec3, assertIsTrue, murmurhash2_32_gc, errorID } from '../../core';
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';
import { Attribute, Device, Buffer, BufferInfo, AttributeName, BufferUsageBit, Feature, Format, FormatInfos, FormatType, MemoryUsageBit, PrimitiveMode, getTypedArrayConstructor, DrawInfo, FormatInfo, deviceManager } from '../../gfx';
import { Morph } from './morph';
import { MorphRendering, createMorphRendering } from './morph-rendering';
import { MeshoptDecoder } from '../misc/mesh-codec';
import zlib from '../../../external/compression/zlib.min';
import zlib from '../../../external/compression/zlib.min';

function getIndexStrideCtor (stride: number): Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor {
switch (stride) {
Expand Down
10 changes: 4 additions & 6 deletions cocos/3d/assets/morph-rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@
THE SOFTWARE.
*/

import {
AttributeName, Buffer, BufferUsageBit, Device, MemoryUsageBit, DescriptorSet, BufferInfo, FormatFeatureBit, Format, Texture, Sampler,
} from '../../gfx';
import { AttributeName, Buffer, BufferUsageBit, Device, MemoryUsageBit, DescriptorSet, BufferInfo, FormatFeatureBit, Format, Texture, Sampler } from '../../gfx';
import { Mesh } from './mesh';
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 { 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, cclegacy } from '../../core';
import { assertIsNonNullable, assertIsTrue, warn, bits, nextPow2 } from '../../core';
import { cclegacy } from '@base/global';
import { IMacroPatch } from '../../render-scene';
import { PixelFormat } from '../../asset/assets/asset-enum';

Expand Down
3 changes: 2 additions & 1 deletion cocos/3d/assets/skeleton.jsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
THE SOFTWARE.
*/

import { CCString, cclegacy, Mat4 } from '../../core';
import { CCString, Mat4 } from '../../core';
import { cclegacy } from '@base/global';
import { DataPoolManager } from '../skeletal-animation/data-pool-manager';
import { Asset } from '../../asset/assets/asset';
import { patch_cc_Skeleton } from '../../native-binding/decorators';
Expand Down
Loading
Loading