@notask/unity-cli-tools 1.0.1 → 1.0.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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.0.2](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.1...1.0.2) (2025-04-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Build:** wrong modules references ([c5ec8c3](https://github.com/NoTaskStudios/unity-cli-tools/commit/c5ec8c3e295b147703bd07029d28e081daf78c86))
7
+ * **Hub:** way to get hub versions by filtering ([ae7b497](https://github.com/NoTaskStudios/unity-cli-tools/commit/ae7b49742c64c816b3b147ef7feeebf5386ca54c))
8
+
1
9
  ## [1.0.1](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.0...1.0.1) (2025-04-23)
2
10
 
3
11
 
@@ -101,8 +101,11 @@ class UnityHub {
101
101
  }
102
102
  console.debug(`Install path set to: ${stdout}`);
103
103
  }
104
- static async getUnityInstallations() {
105
- const { stdout, stderr } = await this.execUnityHubCommand(["editors", "-i"], {
104
+ static async getUnityInstallations(filter = "i") {
105
+ if (!["i", "a", "r"].includes(filter)) {
106
+ throw new Error(`Invalid filter "${filter}". Use "i" for installed, "a" for all, or "r" for available releases.`);
107
+ }
108
+ const { stdout, stderr } = await this.execUnityHubCommand(["editors", `-${filter}`], {
106
109
  reject: false,
107
110
  });
108
111
  const isSuccess = stdout.includes(", installed at");
@@ -13,7 +13,7 @@ declare class UnityHub {
13
13
  static execUnityHubCommand(args: string[], options?: CommandOptions): Promise<CommandResult>;
14
14
  static getInstallPath(): Promise<string>;
15
15
  static setInstallPath(path: string): Promise<void>;
16
- static getUnityInstallations(): Promise<UnityInstallations>;
16
+ static getUnityInstallations(filter?: string): Promise<UnityInstallations>;
17
17
  static addModule(editorVersion: string, modules: ModuleId[], childModules?: boolean): Promise<void>;
18
18
  static addEditor(version: string, changeset?: string, modules?: ModuleId[], architecture?: EditorArchitecture): Promise<void>;
19
19
  static getProjects(): Promise<{
@@ -96,8 +96,11 @@ class UnityHub {
96
96
  }
97
97
  console.debug(`Install path set to: ${stdout}`);
98
98
  }
99
- static async getUnityInstallations() {
100
- const { stdout, stderr } = await this.execUnityHubCommand(["editors", "-i"], {
99
+ static async getUnityInstallations(filter = "i") {
100
+ if (!["i", "a", "r"].includes(filter)) {
101
+ throw new Error(`Invalid filter "${filter}". Use "i" for installed, "a" for all, or "r" for available releases.`);
102
+ }
103
+ const { stdout, stderr } = await this.execUnityHubCommand(["editors", `-${filter}`], {
101
104
  reject: false,
102
105
  });
103
106
  const isSuccess = stdout.includes(", installed at");
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@notask/unity-cli-tools",
3
- "version": "1.0.1",
4
- "main": "dist-cjs/index.js",
5
- "module": "dist/index.js",
6
- "types": "dist/index.d.ts",
3
+ "version": "1.0.2",
4
+ "main": "dist/cjs/index.js",
5
+ "module": "dist/esm/index.js",
6
+ "types": "dist/esm/index.d.ts",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": {
10
- "import": "./dist/index.js",
11
- "require": "./dist-cjs/index.js",
12
- "types": "./dist/index.d.ts"
10
+ "import": "./dist/esm/index.js",
11
+ "require": "./dist/cjs/index.js",
12
+ "types": "./dist/esm/index.d.ts"
13
13
  }
14
14
  },
15
15
  "private": false,