@notask/unity-cli-tools 1.0.3 → 1.0.5

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,17 @@
1
+ ## [1.0.5](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.4...1.0.5) (2025-04-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Editor:** Force hubIPC and usehub to add projects ([1da532a](https://github.com/NoTaskStudios/unity-cli-tools/commit/1da532a5db4cb9d1e7404861e570633b4661be99))
7
+
8
+ ## [1.0.4](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.3...1.0.4) (2025-04-29)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **Hub:** get changeset for editor version installation ([ab4d9ad](https://github.com/NoTaskStudios/unity-cli-tools/commit/ab4d9adaeb3909bf44de5bdbbdde5e9c3ced297f))
14
+
1
15
  ## [1.0.3](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.2...1.0.3) (2025-04-28)
2
16
 
3
17
 
@@ -239,7 +239,7 @@ class UnityEditor {
239
239
  return false;
240
240
  }
241
241
  }
242
- static async openProject(projectInfo, batchmode = false, waitForExit = true) {
242
+ static async openProject(projectInfo, useHub = true, batchmode = false, waitForExit = true) {
243
243
  try {
244
244
  console.debug(`Opening project at ${projectInfo.projectPath}`);
245
245
  const args = ["-projectPath", projectInfo.projectPath];
@@ -249,6 +249,9 @@ class UnityEditor {
249
249
  if (batchmode) {
250
250
  args.push("-batchmode");
251
251
  }
252
+ if (useHub) {
253
+ args.push(...["-useHub", "-hubIPC"]);
254
+ }
252
255
  const editorInfo = { version: projectInfo.editorVersion };
253
256
  const options = { reject: false };
254
257
  const { stdout, stderr } = await this.execUnityEditorCommand(editorInfo, args, options);
@@ -8,6 +8,7 @@ const os_1 = __importDefault(require("os"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const unity_js_1 = require("./types/unity.js");
10
10
  const commandExecutor_js_1 = require("./utils/commandExecutor.js");
11
+ const unity_changeset_1 = require("unity-changeset");
11
12
  class UnityHub {
12
13
  static CONFIG_PATHS = {
13
14
  win32: {
@@ -150,12 +151,12 @@ class UnityHub {
150
151
  throw error;
151
152
  }
152
153
  }
153
- static async addEditor(version, changeset, modules = [], architecture = unity_js_1.EditorArchitecture.x86_64) {
154
+ static async addEditor(version, modules = [], architecture = unity_js_1.EditorArchitecture.x86_64) {
154
155
  try {
155
- console.debug(`Installing Unity ${version} ${(changeset ?? "") ? `(changeset: ${changeset})` : ""}`);
156
+ const data = await (0, unity_changeset_1.getUnityChangeset)(version);
156
157
  const args = ["install", "-v", version];
157
- if (changeset) {
158
- args.push("--changeset", changeset);
158
+ if (data) {
159
+ args.push("--changeset", data.changeset);
159
160
  }
160
161
  if (modules.length > 0) {
161
162
  args.push("--module");
@@ -14,6 +14,6 @@ declare class UnityEditor {
14
14
  static exportPackage(projectInfo: ProjectInfo, assetPaths: string[], outputPath: string): Promise<boolean>;
15
15
  static importPackage(projectInfo: ProjectInfo, packagePath: string): Promise<boolean>;
16
16
  static createProject(projectInfo: ProjectInfo, waitForExit?: boolean): Promise<boolean>;
17
- static openProject(projectInfo: ProjectInfo, batchmode?: boolean, waitForExit?: boolean): Promise<boolean>;
17
+ static openProject(projectInfo: ProjectInfo, useHub?: boolean, batchmode?: boolean, waitForExit?: boolean): Promise<boolean>;
18
18
  }
19
19
  export default UnityEditor;
@@ -234,7 +234,7 @@ class UnityEditor {
234
234
  return false;
235
235
  }
236
236
  }
237
- static async openProject(projectInfo, batchmode = false, waitForExit = true) {
237
+ static async openProject(projectInfo, useHub = true, batchmode = false, waitForExit = true) {
238
238
  try {
239
239
  console.debug(`Opening project at ${projectInfo.projectPath}`);
240
240
  const args = ["-projectPath", projectInfo.projectPath];
@@ -244,6 +244,9 @@ class UnityEditor {
244
244
  if (batchmode) {
245
245
  args.push("-batchmode");
246
246
  }
247
+ if (useHub) {
248
+ args.push(...["-useHub", "-hubIPC"]);
249
+ }
247
250
  const editorInfo = { version: projectInfo.editorVersion };
248
251
  const options = { reject: false };
249
252
  const { stdout, stderr } = await this.execUnityEditorCommand(editorInfo, args, options);
@@ -11,7 +11,7 @@ declare class UnityHub {
11
11
  static setInstallPath(path: string): Promise<void>;
12
12
  static getUnityInstallations(filter?: string): Promise<UnityInstallations>;
13
13
  static addModule(editorVersion: string, modules: ModuleId[], childModules?: boolean): Promise<void>;
14
- static addEditor(version: string, changeset?: string, modules?: ModuleId[], architecture?: EditorArchitecture): Promise<void>;
14
+ static addEditor(version: string, modules?: ModuleId[], architecture?: EditorArchitecture): Promise<void>;
15
15
  static getProjects(): Promise<{
16
16
  name: string;
17
17
  path: string;
@@ -3,6 +3,7 @@ import os from "os";
3
3
  import path from "path";
4
4
  import { EditorArchitecture, UnityEditorLanguages, UnityModules, } from "./types/unity.js";
5
5
  import { executeCommand } from "./utils/commandExecutor.js";
6
+ import { getUnityChangeset } from "unity-changeset";
6
7
  class UnityHub {
7
8
  static CONFIG_PATHS = {
8
9
  win32: {
@@ -145,12 +146,12 @@ class UnityHub {
145
146
  throw error;
146
147
  }
147
148
  }
148
- static async addEditor(version, changeset, modules = [], architecture = EditorArchitecture.x86_64) {
149
+ static async addEditor(version, modules = [], architecture = EditorArchitecture.x86_64) {
149
150
  try {
150
- console.debug(`Installing Unity ${version} ${(changeset ?? "") ? `(changeset: ${changeset})` : ""}`);
151
+ const data = await getUnityChangeset(version);
151
152
  const args = ["install", "-v", version];
152
- if (changeset) {
153
- args.push("--changeset", changeset);
153
+ if (data) {
154
+ args.push("--changeset", data.changeset);
154
155
  }
155
156
  if (modules.length > 0) {
156
157
  args.push("--module");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notask/unity-cli-tools",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",
@@ -44,7 +44,8 @@
44
44
  "description": "A tools for Unity command line development.",
45
45
  "dependencies": {
46
46
  "execa": "^9.5.2",
47
- "fs-extra": "^11.3.0"
47
+ "fs-extra": "^11.3.0",
48
+ "unity-changeset": "2.5.0"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@eslint/js": "9.24.0",