@galacean/engine-spine 0.0.0-experimental-2024071201 → 0.0.0-experimental-2024071602

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.0-experimental-2024071201",
2
+ "version": "0.0.0-experimental-2024071602",
3
3
  "description": "galacean spine runtime",
4
4
  "name": "@galacean/engine-spine",
5
5
  "main": "dist/main.js",
@@ -16,9 +16,10 @@
16
16
  "@babel/plugin-proposal-class-properties": "^7.12.1",
17
17
  "@babel/plugin-proposal-decorators": "^7.12.1",
18
18
  "@babel/plugin-proposal-optional-chaining": "^7.12.1",
19
+ "@babel/plugin-transform-class-properties": "^7.24.7",
19
20
  "@babel/plugin-transform-object-assign": "^7.12.1",
20
- "@babel/preset-env": "^7.12.1",
21
- "@babel/preset-typescript": "^7.12.1",
21
+ "@babel/preset-env": "^7.24.8",
22
+ "@babel/preset-typescript": "^7.24.7",
22
23
  "@galacean/engine": "1.3.0-alpha.0",
23
24
  "@galacean/engine-toolkit": "beta",
24
25
  "@rollup/plugin-babel": "^5.2.1",
@@ -29,13 +30,24 @@
29
30
  "@rollup/plugin-terser": "^0.4.3",
30
31
  "@swc/core": "^1.3.32",
31
32
  "@swc/helpers": "^0.5",
33
+ "@types/chai": "^4.3.16",
34
+ "@types/jest": "^29.5.12",
35
+ "@types/node": "^20.14.10",
32
36
  "@vitejs/plugin-basic-ssl": "^1.1.0",
33
- "cross-env": "^5.2.0",
37
+ "babel-core": "^6.26.3",
38
+ "babel-jest": "^29.7.0",
39
+ "canvas": "^2.11.2",
40
+ "chai": "^4.3.6",
41
+ "chai-spies": "^1.0.0",
42
+ "cross-env": "^5.2.1",
34
43
  "cypress": "^13.13.0",
35
44
  "dat.gui": "^0.7.9",
36
- "floss": "^5.0.1",
45
+ "electron": "^12.0.0",
46
+ "jest": "^29.7.0",
47
+ "jest-environment-jsdom": "^29.7.0",
37
48
  "react": "^16.14.0",
38
49
  "react-dom": "^16.14.0",
50
+ "regenerator-runtime": "^0.14.1",
39
51
  "rollup": "^2.32.0",
40
52
  "rollup-plugin-glslify": "^1.2.0",
41
53
  "rollup-plugin-modify": "^3.0.0",
@@ -43,7 +55,11 @@
43
55
  "rollup-plugin-swc3": "^0.8.0",
44
56
  "rollup-plugin-terser": "^7.0.2",
45
57
  "rollup-plugin-version-injector": "^1.3.3",
46
- "typescript": "^4.8.4",
58
+ "sinon": "^18.0.0",
59
+ "ts-jest": "^29.2.2",
60
+ "ts-node": "^10.9.2",
61
+ "tsconfig-paths": "^4.2.0",
62
+ "typescript": "^5.5.3",
47
63
  "vite": "^4.3.9"
48
64
  },
49
65
  "ci": {
@@ -54,11 +70,32 @@
54
70
  "types",
55
71
  "dist"
56
72
  ],
73
+ "jest": {
74
+ "runner": "jest-runner",
75
+ "testEnvironment": "jsdom",
76
+ "testEnvironmentOptions": {
77
+ "url": "https://jestjs.io/",
78
+ "userAgent": "Agent/007"
79
+ },
80
+ "preset": "ts-jest",
81
+ "collectCoverage": true,
82
+ "testRegex": "(/tests/.*\\.(test|spec))\\.ts?$",
83
+ "collectCoverageFrom": [
84
+ "src/**/*.ts"
85
+ ],
86
+ "transform": {
87
+ "^.+\\.js$": "babel-jest",
88
+ "^.+\\.ts$": "ts-jest"
89
+ },
90
+ "transformIgnorePatterns": [
91
+ "node_modules/(?!(.*@esotericsoftware/spine-core.*))"
92
+ ]
93
+ },
57
94
  "scripts": {
58
95
  "example": "vite",
59
- "test": "cross-env TS_NODE_PROJECT=tsconfig.tests.json floss --path tests -r ts-node/register",
60
- "test-debug": "cross-env TS_NODE_PROJECT=tsconfig.tests.json floss --path tests -r ts-node/register --debug",
61
- "test-cov": "cross-env TS_NODE_PROJECT=tsconfig.tests.json IS_COV=1 nyc --reporter=lcov floss --path tests -r ts-node/register",
96
+ "test": "jest",
97
+ "test:cov": "jest --coverage",
98
+ "test:debug": "cross-env DEBUG_MODE=1 jest",
62
99
  "dev": "rollup -cw",
63
100
  "build": "npm run b:types && cross-env BUILD_TYPE=ALL rollup -c",
64
101
  "build:watch": "npm run b:types && cross-env BUILD_TYPE=ALL rollup -c --watch",
@@ -1,12 +1,7 @@
1
1
  import { Skeleton, SkeletonData, AnimationState, AnimationStateData } from "@esotericsoftware/spine-core";
2
2
  import { Buffer, Renderer, Entity, Material, Engine, BoundingBox, Primitive, SubPrimitive } from "@galacean/engine";
3
3
  import { SkeletonDataResource } from "./loader/SkeletonDataResource";
4
- declare module '@esotericsoftware/spine-core' {
5
- interface SkeletonData {
6
- refCount: number;
7
- }
8
- }
9
- interface InitialState {
4
+ interface DefaultState {
10
5
  animationName: string;
11
6
  skinName: string;
12
7
  loop: boolean;
@@ -28,7 +23,7 @@ export declare class SpineAnimation extends Renderer {
28
23
  /** Render setting for spine rendering. */
29
24
  setting: SpineRenderSetting;
30
25
  /** Initial spine animation and skin state. */
31
- initialState: InitialState;
26
+ defaultState: DefaultState;
32
27
  /** @internal */
33
28
  _primitive: Primitive;
34
29
  /** @internal */
@@ -129,6 +124,7 @@ export declare class SpineAnimation extends Renderer {
129
124
  private onAnimationStart;
130
125
  private onAnimationComplete;
131
126
  private _clearMaterialCache;
127
+ private _initializeDefaultState;
132
128
  }
133
129
  /**
134
130
  * @internal
@@ -1,9 +1,11 @@
1
- import { Engine, Texture2D } from "@galacean/engine";
1
+ import { AssetPromise, Engine, Texture2D } from "@galacean/engine";
2
2
  import { TextureAtlas, SkeletonData, Texture, TextureFilter, TextureWrap } from "@esotericsoftware/spine-core";
3
3
  export declare function createSkeletonData(textureAtlas: TextureAtlas, skeletonTextData: string | ArrayBuffer, skeletonFileType: 'json' | 'skel'): SkeletonData;
4
4
  export declare function loadTexturesByPath(imagePaths: string[], imageExtensions: string[], engine: Engine): Promise<Texture2D[]>;
5
5
  export declare function loadTextureAtlas(atlasPath: string, engine: Engine): Promise<TextureAtlas>;
6
6
  export declare function createTextureAtlas(atlasText: string, textures: Texture2D[]): TextureAtlas;
7
+ export declare function loadTexture(url: string, engine: Engine, imageLoaderType?: string): AssetPromise<Texture2D>;
8
+ export declare function createAdaptiveTexture(texture: Texture2D): AdaptiveTexture;
7
9
  export declare function getBaseUrl(url: string): string;
8
10
  export declare class AdaptiveTexture extends Texture {
9
11
  texture: Texture2D;