@notask/unity-cli-tools 1.2.0-rc.1 → 2.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.
- package/.claude/settings.local.json +7 -0
- package/CHANGELOG.md +164 -164
- package/LICENSE +23 -23
- package/README.md +809 -347
- package/dist/cjs/errors/Result.js +76 -0
- package/dist/cjs/errors/UnityError.js +77 -0
- package/dist/cjs/errors/index.js +18 -0
- package/dist/cjs/events/hubEventEmitter.js +16 -16
- package/dist/cjs/events/hubEventParser.js +97 -27
- package/dist/cjs/events/patterns/implementations/bracketModulePattern.js +57 -0
- package/dist/cjs/events/patterns/implementations/errorPattern.js +99 -0
- package/dist/cjs/events/patterns/implementations/fallbackPattern.js +63 -0
- package/dist/cjs/events/patterns/implementations/index.js +9 -0
- package/dist/cjs/events/patterns/index.js +23 -0
- package/dist/cjs/events/patterns/patternRegistry.js +69 -0
- package/dist/cjs/events/patterns/statusNormalizer.js +280 -0
- package/dist/cjs/events/patterns/types.js +2 -0
- package/dist/cjs/index.js +8 -11
- package/dist/cjs/unityEditor.js +182 -230
- package/dist/cjs/unityHub.js +110 -85
- package/dist/cjs/utils/commandExecutor.js +8 -9
- package/dist/esm/errors/Result.d.ts +21 -0
- package/dist/esm/errors/Result.js +63 -0
- package/dist/esm/errors/UnityError.d.ts +36 -0
- package/dist/esm/errors/UnityError.js +64 -0
- package/dist/esm/errors/index.d.ts +2 -0
- package/dist/esm/errors/index.js +2 -0
- package/dist/esm/events/hubEventEmitter.d.ts +1 -1
- package/dist/esm/events/hubEventParser.d.ts +17 -3
- package/dist/esm/events/hubEventParser.js +97 -27
- package/dist/esm/events/patterns/implementations/bracketModulePattern.d.ts +11 -0
- package/dist/esm/events/patterns/implementations/bracketModulePattern.js +53 -0
- package/dist/esm/events/patterns/implementations/errorPattern.d.ts +22 -0
- package/dist/esm/events/patterns/implementations/errorPattern.js +95 -0
- package/dist/esm/events/patterns/implementations/fallbackPattern.d.ts +13 -0
- package/dist/esm/events/patterns/implementations/fallbackPattern.js +59 -0
- package/dist/esm/events/patterns/implementations/index.d.ts +3 -0
- package/dist/esm/events/patterns/implementations/index.js +3 -0
- package/dist/esm/events/patterns/index.d.ts +4 -0
- package/dist/esm/events/patterns/index.js +4 -0
- package/dist/esm/events/patterns/patternRegistry.d.ts +14 -0
- package/dist/esm/events/patterns/patternRegistry.js +65 -0
- package/dist/esm/events/patterns/statusNormalizer.d.ts +15 -0
- package/dist/esm/events/patterns/statusNormalizer.js +276 -0
- package/dist/esm/events/patterns/types.d.ts +30 -0
- package/dist/esm/events/patterns/types.js +1 -0
- package/dist/esm/index.d.ts +5 -6
- package/dist/esm/index.js +1 -2
- package/dist/esm/unityEditor.d.ts +11 -15
- package/dist/esm/unityEditor.js +196 -244
- package/dist/esm/unityHub.d.ts +13 -11
- package/dist/esm/unityHub.js +108 -83
- package/dist/esm/utils/commandExecutor.d.ts +4 -3
- package/dist/esm/utils/commandExecutor.js +8 -9
- package/package.json +70 -70
- package/sandbox/index.js +51 -0
- package/sandbox/node_modules/.package-lock.json +10495 -0
- package/sandbox/package.json +13 -0
- package/dist/cjs/configs/unityConfig.js +0 -74
- package/dist/cjs/unityTemplates.js +0 -29
- package/dist/esm/configs/unityConfig.d.ts +0 -25
- package/dist/esm/configs/unityConfig.js +0 -68
- package/dist/esm/unityTemplates.d.ts +0 -10
- package/dist/esm/unityTemplates.js +0 -24
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.UnityConfig = void 0;
|
|
7
|
-
const os_1 = __importDefault(require("os"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const UNITY_HUB_PATHS = {
|
|
10
|
-
win32: {
|
|
11
|
-
hubDir: "C:\\Program Files\\Unity Hub\\Unity Hub.exe",
|
|
12
|
-
projects: path_1.default.join(os_1.default.homedir(), "AppData", "Roaming", "UnityHub", "projects-v1.json"),
|
|
13
|
-
projectDir: path_1.default.join(os_1.default.homedir(), "AppData", "Roaming", "UnityHub", "projectDir.json"),
|
|
14
|
-
},
|
|
15
|
-
darwin: {
|
|
16
|
-
hubDir: "/Applications/Unity Hub.app/Contents/MacOS/Unity Hub",
|
|
17
|
-
projects: path_1.default.join(os_1.default.homedir(), "Library", "Application Support", "UnityHub", "projects-v1.json"),
|
|
18
|
-
projectDir: path_1.default.join(os_1.default.homedir(), "Library", "Application Support", "UnityHub", "projectDir.json"),
|
|
19
|
-
},
|
|
20
|
-
linux: {
|
|
21
|
-
hubDir: "/opt/UnityHub/UnityHub",
|
|
22
|
-
projects: path_1.default.join(os_1.default.homedir(), ".config", "UnityHub", "projects-v1.json"),
|
|
23
|
-
projectDir: path_1.default.join(os_1.default.homedir(), ".config", "UnityHub", "projectDir.json"),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
const UNITY_EDITOR_PATHS = {
|
|
27
|
-
win32: {
|
|
28
|
-
base: "C:/Program Files/Unity/Hub/Editor",
|
|
29
|
-
executable: "Editor/Unity.exe",
|
|
30
|
-
projectTemplates: "Editor/Data/Resources/PackageManager/ProjectTemplates",
|
|
31
|
-
},
|
|
32
|
-
darwin: {
|
|
33
|
-
base: "/Applications/Unity/Hub/Editor",
|
|
34
|
-
executable: "Unity.app/Contents/MacOS/Unity",
|
|
35
|
-
projectTemplates: "Unity.app/Contents/Resources/PackageManager/ProjectTemplates",
|
|
36
|
-
},
|
|
37
|
-
linux: {
|
|
38
|
-
base: "/opt/unity/editor",
|
|
39
|
-
executable: "Editor/Unity",
|
|
40
|
-
projectTemplates: "Editor/Data/Resources/PackageManager/ProjectTemplates",
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
class UnityConfig {
|
|
44
|
-
static getPlatformConfig() {
|
|
45
|
-
const platform = process.platform;
|
|
46
|
-
const unityHubPaths = UNITY_HUB_PATHS[platform];
|
|
47
|
-
const unityEditorPaths = UNITY_EDITOR_PATHS[platform];
|
|
48
|
-
const settings = {
|
|
49
|
-
editor: {
|
|
50
|
-
base: environment.unityEditorPath ?? unityEditorPaths.base,
|
|
51
|
-
executable: unityEditorPaths.executable,
|
|
52
|
-
projectTemplates: unityEditorPaths.projectTemplates,
|
|
53
|
-
},
|
|
54
|
-
hub: {
|
|
55
|
-
hubDir: environment.unityHubPath ?? unityHubPaths.hubDir,
|
|
56
|
-
projects: unityHubPaths.projects,
|
|
57
|
-
projectDir: unityHubPaths.projectDir,
|
|
58
|
-
},
|
|
59
|
-
templates: {
|
|
60
|
-
projectTemplates: environment.unityProjectTemplatePath ?? unityEditorPaths.projectTemplates,
|
|
61
|
-
},
|
|
62
|
-
platform,
|
|
63
|
-
architecture: os_1.default.arch(),
|
|
64
|
-
};
|
|
65
|
-
return settings;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.UnityConfig = UnityConfig;
|
|
69
|
-
const environment = {
|
|
70
|
-
unityHubPath: process.env.UNITY_HUB_PATH,
|
|
71
|
-
unityEditorPath: process.env.UNITY_EDITOR_PATH,
|
|
72
|
-
unityProjectPath: process.env.UNITY_PROJECT_PATH,
|
|
73
|
-
unityProjectTemplatePath: process.env.UNITY_PROJECT_TEMPLATE_PATH,
|
|
74
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = __importDefault(require("path"));
|
|
7
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const unityConfig_ts_1 = require("./configs/unityConfig.js");
|
|
9
|
-
class UnityTemplates {
|
|
10
|
-
static unityConfig = unityConfig_ts_1.UnityConfig.getPlatformConfig();
|
|
11
|
-
static getProjectTemplatesPath() {
|
|
12
|
-
return this.unityConfig.templates.projectTemplates;
|
|
13
|
-
}
|
|
14
|
-
static getProjectTemplatesPathForVersion(version) {
|
|
15
|
-
return path_1.default.join(this.unityConfig.editor.base, version, this.getProjectTemplatesPath());
|
|
16
|
-
}
|
|
17
|
-
static getProjectTemplates(version) {
|
|
18
|
-
const templatePath = this.getProjectTemplatesPathForVersion(version);
|
|
19
|
-
if (!fs_extra_1.default.existsSync(templatePath)) {
|
|
20
|
-
throw new Error(`Template path does not exist: ${templatePath}`);
|
|
21
|
-
}
|
|
22
|
-
const templates = fs_extra_1.default.readdirSync(templatePath).filter((file) => path_1.default.extname(file) === ".tgz");
|
|
23
|
-
return templates.map((template) => ({
|
|
24
|
-
templateName: path_1.default.basename(template, ".tgz"),
|
|
25
|
-
templatePath: path_1.default.join(templatePath, template),
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.default = UnityTemplates;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
interface UnityHubPaths {
|
|
2
|
-
hubDir: string;
|
|
3
|
-
projects: string;
|
|
4
|
-
projectDir: string;
|
|
5
|
-
}
|
|
6
|
-
interface UnityEditorPaths {
|
|
7
|
-
base: string;
|
|
8
|
-
executable: string;
|
|
9
|
-
projectTemplates: string;
|
|
10
|
-
}
|
|
11
|
-
interface UnityTemplatePaths {
|
|
12
|
-
projectTemplates: string;
|
|
13
|
-
}
|
|
14
|
-
interface PlatformConfig {
|
|
15
|
-
editor: UnityEditorPaths;
|
|
16
|
-
hub: UnityHubPaths;
|
|
17
|
-
templates: UnityTemplatePaths;
|
|
18
|
-
platform: string;
|
|
19
|
-
architecture: string;
|
|
20
|
-
}
|
|
21
|
-
declare class UnityConfig {
|
|
22
|
-
static getPlatformConfig(): PlatformConfig;
|
|
23
|
-
}
|
|
24
|
-
export { UnityConfig };
|
|
25
|
-
export type { UnityHubPaths, UnityEditorPaths, UnityTemplatePaths, PlatformConfig };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import os from "os";
|
|
2
|
-
import path from "path";
|
|
3
|
-
const UNITY_HUB_PATHS = {
|
|
4
|
-
win32: {
|
|
5
|
-
hubDir: "C:\\Program Files\\Unity Hub\\Unity Hub.exe",
|
|
6
|
-
projects: path.join(os.homedir(), "AppData", "Roaming", "UnityHub", "projects-v1.json"),
|
|
7
|
-
projectDir: path.join(os.homedir(), "AppData", "Roaming", "UnityHub", "projectDir.json"),
|
|
8
|
-
},
|
|
9
|
-
darwin: {
|
|
10
|
-
hubDir: "/Applications/Unity Hub.app/Contents/MacOS/Unity Hub",
|
|
11
|
-
projects: path.join(os.homedir(), "Library", "Application Support", "UnityHub", "projects-v1.json"),
|
|
12
|
-
projectDir: path.join(os.homedir(), "Library", "Application Support", "UnityHub", "projectDir.json"),
|
|
13
|
-
},
|
|
14
|
-
linux: {
|
|
15
|
-
hubDir: "/opt/UnityHub/UnityHub",
|
|
16
|
-
projects: path.join(os.homedir(), ".config", "UnityHub", "projects-v1.json"),
|
|
17
|
-
projectDir: path.join(os.homedir(), ".config", "UnityHub", "projectDir.json"),
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
const UNITY_EDITOR_PATHS = {
|
|
21
|
-
win32: {
|
|
22
|
-
base: "C:/Program Files/Unity/Hub/Editor",
|
|
23
|
-
executable: "Editor/Unity.exe",
|
|
24
|
-
projectTemplates: "Editor/Data/Resources/PackageManager/ProjectTemplates",
|
|
25
|
-
},
|
|
26
|
-
darwin: {
|
|
27
|
-
base: "/Applications/Unity/Hub/Editor",
|
|
28
|
-
executable: "Unity.app/Contents/MacOS/Unity",
|
|
29
|
-
projectTemplates: "Unity.app/Contents/Resources/PackageManager/ProjectTemplates",
|
|
30
|
-
},
|
|
31
|
-
linux: {
|
|
32
|
-
base: "/opt/unity/editor",
|
|
33
|
-
executable: "Editor/Unity",
|
|
34
|
-
projectTemplates: "Editor/Data/Resources/PackageManager/ProjectTemplates",
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
class UnityConfig {
|
|
38
|
-
static getPlatformConfig() {
|
|
39
|
-
const platform = process.platform;
|
|
40
|
-
const unityHubPaths = UNITY_HUB_PATHS[platform];
|
|
41
|
-
const unityEditorPaths = UNITY_EDITOR_PATHS[platform];
|
|
42
|
-
const settings = {
|
|
43
|
-
editor: {
|
|
44
|
-
base: environment.unityEditorPath ?? unityEditorPaths.base,
|
|
45
|
-
executable: unityEditorPaths.executable,
|
|
46
|
-
projectTemplates: unityEditorPaths.projectTemplates,
|
|
47
|
-
},
|
|
48
|
-
hub: {
|
|
49
|
-
hubDir: environment.unityHubPath ?? unityHubPaths.hubDir,
|
|
50
|
-
projects: unityHubPaths.projects,
|
|
51
|
-
projectDir: unityHubPaths.projectDir,
|
|
52
|
-
},
|
|
53
|
-
templates: {
|
|
54
|
-
projectTemplates: environment.unityProjectTemplatePath ?? unityEditorPaths.projectTemplates,
|
|
55
|
-
},
|
|
56
|
-
platform,
|
|
57
|
-
architecture: os.arch(),
|
|
58
|
-
};
|
|
59
|
-
return settings;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const environment = {
|
|
63
|
-
unityHubPath: process.env.UNITY_HUB_PATH,
|
|
64
|
-
unityEditorPath: process.env.UNITY_EDITOR_PATH,
|
|
65
|
-
unityProjectPath: process.env.UNITY_PROJECT_PATH,
|
|
66
|
-
unityProjectTemplatePath: process.env.UNITY_PROJECT_TEMPLATE_PATH,
|
|
67
|
-
};
|
|
68
|
-
export { UnityConfig };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface ProjectTemplates {
|
|
2
|
-
templateName: string;
|
|
3
|
-
templatePath: string;
|
|
4
|
-
}
|
|
5
|
-
declare class UnityTemplates {
|
|
6
|
-
private static getProjectTemplatesPath;
|
|
7
|
-
private static getProjectTemplatesPathForVersion;
|
|
8
|
-
static getProjectTemplates(version: string): ProjectTemplates[];
|
|
9
|
-
}
|
|
10
|
-
export default UnityTemplates;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import fs from "fs-extra";
|
|
3
|
-
import { UnityConfig } from "./configs/unityConfig.js";
|
|
4
|
-
class UnityTemplates {
|
|
5
|
-
static unityConfig = UnityConfig.getPlatformConfig();
|
|
6
|
-
static getProjectTemplatesPath() {
|
|
7
|
-
return this.unityConfig.templates.projectTemplates;
|
|
8
|
-
}
|
|
9
|
-
static getProjectTemplatesPathForVersion(version) {
|
|
10
|
-
return path.join(this.unityConfig.editor.base, version, this.getProjectTemplatesPath());
|
|
11
|
-
}
|
|
12
|
-
static getProjectTemplates(version) {
|
|
13
|
-
const templatePath = this.getProjectTemplatesPathForVersion(version);
|
|
14
|
-
if (!fs.existsSync(templatePath)) {
|
|
15
|
-
throw new Error(`Template path does not exist: ${templatePath}`);
|
|
16
|
-
}
|
|
17
|
-
const templates = fs.readdirSync(templatePath).filter((file) => path.extname(file) === ".tgz");
|
|
18
|
-
return templates.map((template) => ({
|
|
19
|
-
templateName: path.basename(template, ".tgz"),
|
|
20
|
-
templatePath: path.join(templatePath, template),
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export default UnityTemplates;
|