@openfairygui/cli 0.6.2 → 0.7.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/bin/cli.cjs +7 -9
- package/dist/cli.mjs +156 -33140
- package/package.json +6 -9
- package/src/cli.ts +0 -56
- package/src/commands/backend-capabilities.ts +0 -39
- package/src/commands/docs.ts +0 -36
- package/src/commands/doctor.ts +0 -112
- package/src/commands/inspect.ts +0 -49
- package/src/commands/publish.ts +0 -72
- package/src/commands/restore.ts +0 -56
- package/src/commands/validate.ts +0 -29
- package/src/contracts.ts +0 -50
- package/src/utils/json-output.ts +0 -40
- package/src/utils/package-version.ts +0 -23
- package/src/utils/project-input.ts +0 -26
- package/src/utils/project-type.ts +0 -31
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ProjectType } from '@openfairygui/core';
|
|
2
|
-
|
|
3
|
-
export function parseProjectType(value: string | undefined): number | undefined {
|
|
4
|
-
if (!value) return undefined;
|
|
5
|
-
const trimmed = value.trim();
|
|
6
|
-
if (trimmed === '') return undefined;
|
|
7
|
-
if (/^\d+$/u.test(trimmed)) return Number(trimmed);
|
|
8
|
-
const normalized = trimmed.toLowerCase();
|
|
9
|
-
const map: Record<string, number> = {
|
|
10
|
-
unity: ProjectType.Unity,
|
|
11
|
-
flash: ProjectType.Flash,
|
|
12
|
-
starling: ProjectType.Starling,
|
|
13
|
-
cocoscreator: ProjectType.CocosCreator,
|
|
14
|
-
cocos: ProjectType.CocosCreator,
|
|
15
|
-
layabox: ProjectType.LayaBox,
|
|
16
|
-
laya: ProjectType.LayaBox,
|
|
17
|
-
egret: ProjectType.Egret,
|
|
18
|
-
haxe: ProjectType.Haxe,
|
|
19
|
-
pixi: ProjectType.Pixi,
|
|
20
|
-
libgdx: ProjectType.LibGDX,
|
|
21
|
-
unreal: ProjectType.Unreal,
|
|
22
|
-
cryengine: ProjectType.CryEngine,
|
|
23
|
-
monogame: ProjectType.MonoGame,
|
|
24
|
-
vision: ProjectType.Vision,
|
|
25
|
-
};
|
|
26
|
-
const resolved = map[normalized];
|
|
27
|
-
if (resolved === undefined) {
|
|
28
|
-
throw new Error(`Unknown project type: ${value}. Use a numeric id or one of: ${Object.keys(map).join(', ')}`);
|
|
29
|
-
}
|
|
30
|
-
return resolved;
|
|
31
|
-
}
|