Skip to content

Commit

Permalink
feat: fix cr problem
Browse files Browse the repository at this point in the history
  • Loading branch information
木鳐 committed Dec 26, 2024
1 parent b54f336 commit 6b1c196
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"vitest": "2.1.3"
},
"lint-staged": {
"*.{ts}": [
"*.{ts,tsx}": [
"eslint --fix",
"git add"
]
Expand Down
14 changes: 11 additions & 3 deletions packages/core/src/asset/ResourceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,10 @@ export class ResourceManager {
initVirtualResources(config: EditorResourceItem[]): void {
config.forEach((element) => {
this._virtualPathMap[element.virtualPath] = element.path;
element.depndentAssets && this._dependencyMap[element.virtualPath] = element.depndentAssets;
this._editorResourceConfig[element.id] = element;
if (element.depndentAssets) {
this._dependencyMap[element.virtualPath] = element.depndentAssets;
}

Check warning on line 601 in packages/core/src/asset/ResourceManager.ts

View check run for this annotation

Codecov / codecov/patch

packages/core/src/asset/ResourceManager.ts#L600-L601

Added lines #L600 - L601 were not covered by tests
});
}
//-----------------Editor temp solution-----------------
Expand Down Expand Up @@ -634,8 +636,14 @@ const rePropName = RegExp(
"g"
);

type EditorResourceItem = { virtualPath: string; path: string; type: string; id: string, depndentAssets: { [key: string]: string } };
type EditorResourceConfig = Record< string, EditorResourceItem >;
type EditorResourceItem = {
virtualPath: string;
path: string;
type: string;
id: string;
depndentAssets: { [key: string]: string };
};
type EditorResourceConfig = Record<string, EditorResourceItem>;
type SubAssetPromiseCallbacks<T> = Record<
// main asset url, ie. "https://***.glb"
string,
Expand Down

0 comments on commit 6b1c196

Please sign in to comment.