@ives_xxz/framework 1.4.0 → 1.4.2

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/FW.d.ts CHANGED
@@ -177,11 +177,6 @@ declare namespace FW {
177
177
  onDestroy();
178
178
  };
179
179
 
180
- type SocketMessage = {
181
- data: any;
182
- error: boolean;
183
- };
184
-
185
180
  type SocketManager = {
186
181
  createSocket(
187
182
  tag: string,
package/Framework.ts CHANGED
@@ -117,7 +117,7 @@ class Framework {
117
117
  }
118
118
 
119
119
  /**
120
- * 创建注册表
120
+ * 创建注册表实例
121
121
  */
122
122
  createRegistry(bundleName: string): FW.Registry {
123
123
  if (!this.registry.has(bundleName)) return;
@@ -126,12 +126,11 @@ class Framework {
126
126
  }
127
127
 
128
128
  /**
129
- * 销毁注册表
129
+ * 销毁注册表实例
130
130
  * @param bundleName
131
131
  */
132
132
  destroyRegistry(bundleName: string) {
133
- if (this.registry.has(bundleName)) return;
134
- this.registry.delete(bundleName);
133
+ if (!this.registry.has(bundleName)) return;
135
134
  this.container.unbind(this.registry.get(bundleName));
136
135
  }
137
136
 
@@ -1,11 +1,4 @@
1
1
  export namespace FWEventDefine {
2
- export enum SystemEvent {
3
- BUNDLE_LOADED = 'BUNDLE_LOADED',
4
- BUNDLE_RELEASE = 'BUNDLE_RELEASE',
5
- BUNDLE_REGISTERED = 'BUNDLE_REGISTERED',
6
- BUNDLE_UN_REGISTERED = 'BUNDLE_UN_REGISTERED',
7
- }
8
-
9
2
  export enum LanguageEvent {
10
3
  /** 语言变更 */
11
4
  LANGUAGE_CHANGE = 'LANGUAGE_CHANGE',
package/entry/FWEntry.ts CHANGED
@@ -166,7 +166,20 @@ export default class FWEntry implements FW.Entry {
166
166
  }
167
167
 
168
168
  getDepend(bundleName: string) {
169
- return this.map.get(bundleName)?.depend || [];
169
+ const dependencySet = new Set<string>();
170
+ const findDependencies = (name: string) => {
171
+ const directDeps = this.map.get(name)?.depend || [];
172
+ for (const dep of directDeps) {
173
+ if (!dependencySet.has(dep)) {
174
+ dependencySet.add(dep);
175
+ findDependencies(dep);
176
+ }
177
+ }
178
+ };
179
+
180
+ findDependencies(bundleName);
181
+
182
+ return Array.from(dependencySet);
170
183
  }
171
184
 
172
185
  hasSceneName(sceneName: string) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": ["123456"],