@rage-against-the-pixel/unity-cli 3.0.1 → 4.0.0

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.
Files changed (60) hide show
  1. package/README.md +89 -223
  2. package/dist/android-sdk.js +8 -1
  3. package/dist/android-sdk.js.map +1 -1
  4. package/dist/cli.js +195 -506
  5. package/dist/cli.js.map +1 -1
  6. package/dist/failure-markers.d.ts +17 -0
  7. package/dist/failure-markers.js +46 -0
  8. package/dist/failure-markers.js.map +1 -0
  9. package/dist/github-actions-ci.d.ts +1 -0
  10. package/dist/github-actions-ci.js +17 -3
  11. package/dist/github-actions-ci.js.map +1 -1
  12. package/dist/index.d.ts +2 -2
  13. package/dist/index.js +2 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/license-client.d.ts +113 -2
  16. package/dist/license-client.js +715 -54
  17. package/dist/license-client.js.map +1 -1
  18. package/dist/logger-provider.d.ts +2 -0
  19. package/dist/logger-provider.js +3 -0
  20. package/dist/logger-provider.js.map +1 -1
  21. package/dist/logging.d.ts +6 -1
  22. package/dist/logging.js +66 -5
  23. package/dist/logging.js.map +1 -1
  24. package/dist/process-tracker.d.ts +71 -0
  25. package/dist/process-tracker.js +213 -0
  26. package/dist/process-tracker.js.map +1 -0
  27. package/dist/unity-cli.d.ts +97 -0
  28. package/dist/unity-cli.js +587 -0
  29. package/dist/unity-cli.js.map +1 -0
  30. package/dist/unity-editor.d.ts +25 -16
  31. package/dist/unity-editor.js +204 -107
  32. package/dist/unity-editor.js.map +1 -1
  33. package/dist/unity-installer.d.ts +134 -0
  34. package/dist/unity-installer.js +963 -0
  35. package/dist/unity-installer.js.map +1 -0
  36. package/dist/unity-logging.d.ts +16 -1
  37. package/dist/unity-logging.js +79 -40
  38. package/dist/unity-logging.js.map +1 -1
  39. package/dist/unity-project.d.ts +15 -0
  40. package/dist/unity-project.js +80 -0
  41. package/dist/unity-project.js.map +1 -1
  42. package/dist/unity-version.d.ts +4 -0
  43. package/dist/unity-version.js +40 -2
  44. package/dist/unity-version.js.map +1 -1
  45. package/dist/upm-cli.d.ts +8 -8
  46. package/dist/upm-cli.js +8 -8
  47. package/dist/upm-cli.js.map +1 -1
  48. package/dist/utilities.d.ts +27 -7
  49. package/dist/utilities.js +119 -63
  50. package/dist/utilities.js.map +1 -1
  51. package/dist/utp-benign.d.ts +13 -0
  52. package/dist/utp-benign.js +41 -0
  53. package/dist/utp-benign.js.map +1 -0
  54. package/dist/utp.d.ts +11 -2
  55. package/dist/utp.js +40 -3
  56. package/dist/utp.js.map +1 -1
  57. package/package.json +14 -15
  58. package/dist/unity-hub.d.ts +0 -127
  59. package/dist/unity-hub.js +0 -1327
  60. package/dist/unity-hub.js.map +0 -1
@@ -0,0 +1,134 @@
1
+ import { UnityEditor } from './unity-editor';
2
+ import { UnityVersion } from './unity-version';
3
+ import { UnityCli } from './unity-cli';
4
+ import { UnityRelease } from '@rage-against-the-pixel/unity-releases-api';
5
+ /**
6
+ * Finds or installs Unity Editors.
7
+ * - 2017.4 and newer install through the official Unity CLI (`unity install`).
8
+ * - 5.x installs from Unity's download archive, because the official CLI reads one-digit majors as Unity 6 shorthand.
9
+ * - 4.x installs from Unity's legacy installers.
10
+ */
11
+ export declare class UnityInstaller {
12
+ private readonly logger;
13
+ private cli;
14
+ /** The 5.x release being installed from the archive, and its installers' published integrity values. */
15
+ private archiveVersion;
16
+ private archiveIntegrity;
17
+ /**
18
+ * @param cli The official Unity CLI to use. Installed on demand when omitted.
19
+ */
20
+ constructor(cli?: UnityCli | undefined);
21
+ /**
22
+ * Gets the official Unity CLI, installing it when needed.
23
+ */
24
+ GetCli(): Promise<UnityCli>;
25
+ /**
26
+ * Sets the directory editors are installed to.
27
+ * @param installPath The directory to install editors to.
28
+ */
29
+ SetInstallPath(installPath: string): Promise<void>;
30
+ /**
31
+ * Gets the directory editors are installed to.
32
+ */
33
+ GetInstallPath(): Promise<string>;
34
+ /**
35
+ * Finds the requested Unity Editor, installing it and any missing modules when needed.
36
+ * @param unityVersion The Unity version to find or install. Partial versions such as 2021.3.x resolve to the newest matching release.
37
+ * @param modules The module ids to install alongside the editor.
38
+ * @param channels The release channels to accept when resolving a partial version: f, p, b, a or x. Default is ['f'].
39
+ */
40
+ GetEditor(unityVersion: UnityVersion, modules?: string[], channels?: string[]): Promise<UnityEditor>;
41
+ /**
42
+ * Resolves a partial or changeset-less version to an exact release with its changeset.
43
+ * 4.x versions are returned as they are, since no release service lists them.
44
+ * @param unityVersion The requested version.
45
+ * @param channels The release channels to accept.
46
+ */
47
+ resolveVersion(unityVersion: UnityVersion, channels?: string[]): Promise<UnityVersion>;
48
+ private installCliEditor;
49
+ private execWithRetry;
50
+ /**
51
+ * Drops modules the release does not offer, since `unity install` fails on an unknown module id.
52
+ */
53
+ private filterModules;
54
+ /**
55
+ * Looks up an installed editor with `unity editors path`, registering one that sits in the install path but that the CLI does not know about yet.
56
+ */
57
+ private findCliEditor;
58
+ private getLegacyInstallPath;
59
+ /**
60
+ * Installs Unity 5.x from the download archive.
61
+ */
62
+ private installArchiveEditor;
63
+ /**
64
+ * Gets the checksum a download must match before it is installed: a pinned SHA-256 for the fixed installers,
65
+ * or the Unity Releases API integrity value for 5.x archive installers. Fails closed when neither is known.
66
+ * @param url The download URL.
67
+ */
68
+ private getDownloadOptions;
69
+ /**
70
+ * Maps each installer URL of a release (editor and modules) to the integrity value the Unity Releases API publishes for it.
71
+ * @param unityVersion The exact release.
72
+ */
73
+ private static getReleaseIntegrity;
74
+ private getArchiveModuleNames;
75
+ /**
76
+ * Runs a Unity NSIS installer silently. NSIS needs `/D=` last and unquoted, so the command line is passed verbatim, without a shell.
77
+ */
78
+ private runWindowsInstaller;
79
+ private installMacPackages;
80
+ /**
81
+ * Moves target support that macOS packages installed to /Applications/Unity/PlaybackEngines into an existing versioned editor.
82
+ */
83
+ private moveMacPlaybackEngines;
84
+ /**
85
+ * Moves an editor that a macOS package installed to /Applications/Unity into its versioned folder.
86
+ */
87
+ private moveMacApplicationsUnity;
88
+ /**
89
+ * Rejects versions and changesets that are not plain Unity release identifiers before they become URLs and paths.
90
+ */
91
+ private static assertArchiveVersion;
92
+ /**
93
+ * Installs Unity 4.x from Unity's legacy installers.
94
+ */
95
+ private installLegacyEditor;
96
+ /**
97
+ * Installs the system packages the Linux editor needs, and the older libssl that 2019.1 to 2021.x link against.
98
+ */
99
+ private installLinuxDependencies;
100
+ /**
101
+ * Patches the Bee Backend for Unity Linux Editor.
102
+ * https://discussions.unity.com/t/linux-editor-stuck-on-loading-because-of-bee-backend-w-workaround/854480
103
+ * @param editorPath The path to the Unity Editor executable.
104
+ */
105
+ private patchBeeBackend;
106
+ /**
107
+ * Gets the specified Unity release info from the Unity Releases API.
108
+ * Supports querying by exact version or by prefix (e.g., "2020", "2020.1", "2021.x", "2021.3.x").
109
+ * @param unityVersion The Unity version to get the release info for.
110
+ * @param channels Letter channels to accept (`f`, `p`, `b`, `a`, `x`). Default stable-only.
111
+ * @returns The Unity release info.
112
+ */
113
+ static GetEditorReleaseInfo(unityVersion: UnityVersion, channels?: string[]): Promise<UnityRelease>;
114
+ private static fallbackVersionLookup;
115
+ /**
116
+ * Get the mapping of Unity platform targets to their corresponding module identifiers for the current OS.
117
+ * @returns A map of Unity platform targets to their corresponding module identifiers for the current OS.
118
+ */
119
+ static GetPlatformTargetModuleMap(): {
120
+ [key: string]: string;
121
+ };
122
+ }
123
+ /**
124
+ * Resolves an install directory, Editor folder, app bundle or executable to the editor executable.
125
+ * @param location A path the editor may be under.
126
+ * @returns The editor executable, or undefined when none is found.
127
+ */
128
+ export declare function resolveEditorExecutable(location: string | undefined): string | undefined;
129
+ /**
130
+ * Reads the CPU architectures of a macOS editor binary from its Mach-O header.
131
+ * @param executablePath The editor executable.
132
+ * @returns The architectures, or undefined off macOS or when the header is not recognized, in which case callers accept the editor.
133
+ */
134
+ export declare function getExecutableArchitectures(executablePath: string): ('X86_64' | 'ARM64')[] | undefined;