@notask/unity-cli-tools 1.1.0 → 1.1.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/CHANGELOG.md +14 -0
- package/dist/cjs/events/hubEventEmitter.js +24 -5
- package/dist/cjs/index.js +3 -1
- package/dist/esm/events/hubEventEmitter.d.ts +1 -1
- package/dist/esm/events/hubEventEmitter.js +24 -5
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.1.2](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.1.1...1.1.2) (2025-05-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **hot-fix:** completed promise as get ([22f152a](https://github.com/NoTaskStudios/unity-cli-tools/commit/22f152a5da016371719649593a96005a636fa9c5))
|
|
7
|
+
|
|
8
|
+
## [1.1.1](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.1.0...1.1.1) (2025-05-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **hot-fix:** re-import event modules ([36d1c00](https://github.com/NoTaskStudios/unity-cli-tools/commit/36d1c0011b663c88e321199ab953edc412b10ada))
|
|
14
|
+
|
|
1
15
|
# [1.1.0](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.7...1.1.0) (2025-05-04)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -9,11 +9,30 @@ class UnityHubInstallerEvent extends events_1.EventEmitter {
|
|
|
9
9
|
constructor() {
|
|
10
10
|
super();
|
|
11
11
|
}
|
|
12
|
-
completed
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
get completed() {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const onComplete = (events) => {
|
|
15
|
+
cleanup();
|
|
16
|
+
resolve(events);
|
|
17
|
+
};
|
|
18
|
+
const onError = (error) => {
|
|
19
|
+
cleanup();
|
|
20
|
+
reject(error);
|
|
21
|
+
};
|
|
22
|
+
const onCancel = () => {
|
|
23
|
+
cleanup();
|
|
24
|
+
reject(new Error("Cancelled"));
|
|
25
|
+
};
|
|
26
|
+
const cleanup = () => {
|
|
27
|
+
this.off(unity_ts_1.InstallerEventType.Completed, onComplete);
|
|
28
|
+
this.off(unity_ts_1.InstallerEventType.Error, onError);
|
|
29
|
+
this.off(unity_ts_1.InstallerEventType.Cancelled, onCancel);
|
|
30
|
+
};
|
|
31
|
+
this.on(unity_ts_1.InstallerEventType.Completed, onComplete);
|
|
32
|
+
this.on(unity_ts_1.InstallerEventType.Error, onError);
|
|
33
|
+
this.on(unity_ts_1.InstallerEventType.Cancelled, onCancel);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
17
36
|
Progress(raw) {
|
|
18
37
|
const events = hubEventParser_ts_1.UnityHubEventParser.parseUnityHubEvent(raw);
|
|
19
38
|
if (events.length === 0)
|
package/dist/cjs/index.js
CHANGED
|
@@ -17,9 +17,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.UnityEditor = exports.UnityHub = void 0;
|
|
20
|
+
exports.UnityHubInstallerEvent = exports.UnityEditor = exports.UnityHub = void 0;
|
|
21
21
|
var unityHub_ts_1 = require("./unityHub.js");
|
|
22
22
|
Object.defineProperty(exports, "UnityHub", { enumerable: true, get: function () { return __importDefault(unityHub_ts_1).default; } });
|
|
23
23
|
var unityEditor_ts_1 = require("./unityEditor.js");
|
|
24
24
|
Object.defineProperty(exports, "UnityEditor", { enumerable: true, get: function () { return __importDefault(unityEditor_ts_1).default; } });
|
|
25
|
+
var hubEventEmitter_ts_1 = require("./events/hubEventEmitter.js");
|
|
26
|
+
Object.defineProperty(exports, "UnityHubInstallerEvent", { enumerable: true, get: function () { return hubEventEmitter_ts_1.UnityHubInstallerEvent; } });
|
|
25
27
|
__exportStar(require("./types/unity.js"), exports);
|
|
@@ -14,7 +14,7 @@ export interface InstallerEmitter extends EventEmitter {
|
|
|
14
14
|
export declare class UnityHubInstallerEvent extends EventEmitter implements InstallerEmitter {
|
|
15
15
|
#private;
|
|
16
16
|
constructor();
|
|
17
|
-
completed: Promise<InstallerEvent[]>;
|
|
17
|
+
get completed(): Promise<InstallerEvent[]>;
|
|
18
18
|
Progress(raw: string): void;
|
|
19
19
|
Cancel(): void;
|
|
20
20
|
}
|
|
@@ -6,11 +6,30 @@ export class UnityHubInstallerEvent extends EventEmitter {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
}
|
|
9
|
-
completed
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
get completed() {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const onComplete = (events) => {
|
|
12
|
+
cleanup();
|
|
13
|
+
resolve(events);
|
|
14
|
+
};
|
|
15
|
+
const onError = (error) => {
|
|
16
|
+
cleanup();
|
|
17
|
+
reject(error);
|
|
18
|
+
};
|
|
19
|
+
const onCancel = () => {
|
|
20
|
+
cleanup();
|
|
21
|
+
reject(new Error("Cancelled"));
|
|
22
|
+
};
|
|
23
|
+
const cleanup = () => {
|
|
24
|
+
this.off(InstallerEventType.Completed, onComplete);
|
|
25
|
+
this.off(InstallerEventType.Error, onError);
|
|
26
|
+
this.off(InstallerEventType.Cancelled, onCancel);
|
|
27
|
+
};
|
|
28
|
+
this.on(InstallerEventType.Completed, onComplete);
|
|
29
|
+
this.on(InstallerEventType.Error, onError);
|
|
30
|
+
this.on(InstallerEventType.Cancelled, onCancel);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
14
33
|
Progress(raw) {
|
|
15
34
|
const events = UnityHubEventParser.parseUnityHubEvent(raw);
|
|
16
35
|
if (events.length === 0)
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED