@openfairygui/cli 0.2.1 → 0.2.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/dist/cli.mjs CHANGED
@@ -864,7 +864,7 @@ var ExtensibleProperty = class extends Property {
864
864
  };
865
865
  //#endregion
866
866
  //#region ../core/src/constants.ts
867
- const VERSION = `v0.2.1`;
867
+ const VERSION = `v0.2.2`;
868
868
  /** Binary package file magic number: "FGUI" as uint32. */
869
869
  const FGUI_MAGIC = 1179080009;
870
870
  /** Null string index in the binary string table. */
@@ -28727,14 +28727,15 @@ function resolvePublishOptions(doc, overrides = {}) {
28727
28727
  const root = doc.getRoot();
28728
28728
  const publishSettings = (root.getSettings?.() ?? {}).publish ?? {};
28729
28729
  const atlasSetting = publishSettings.atlasSetting ?? {};
28730
- const projectType = root.getProjectType();
28731
- const fileExtension = overrides.fileExtension ?? resolveDefaultPublishFileExtension(projectType, publishSettings);
28730
+ const projectType = overrides.targetProjectType ?? root.getProjectType();
28731
+ const explicitLayaboxTarget = overrides.targetProjectType === ProjectType.LayaBox;
28732
+ const fileExtension = overrides.fileExtension ?? (explicitLayaboxTarget ? "fui" : resolveDefaultPublishFileExtension(projectType, publishSettings));
28732
28733
  let compressed = overrides.compressed ?? publishSettings.compressDesc ?? false;
28733
28734
  if (projectType === UNITY_PROJECT_TYPE) compressed = overrides.compressed ?? false;
28734
28735
  const atlasOptions = {
28735
28736
  maxSize: overrides.atlas?.maxSize ?? atlasSetting.maxSize ?? 2048,
28736
28737
  fast: overrides.atlas?.fast ?? atlasSetting.fast ?? true,
28737
- allowRotation: overrides.atlas?.allowRotation ?? atlasSetting.allowRotation ?? false,
28738
+ allowRotation: overrides.atlas?.allowRotation ?? (explicitLayaboxTarget ? false : atlasSetting.allowRotation ?? false),
28738
28739
  padding: overrides.atlas?.padding ?? atlasSetting.padding ?? 2,
28739
28740
  powerOfTwo: overrides.atlas?.powerOfTwo ?? atlasSetting.sizeOption === "pot",
28740
28741
  square: overrides.atlas?.square ?? atlasSetting.forceSquare ?? false,
@@ -29409,7 +29410,8 @@ function registerPublishCommand(program) {
29409
29410
  const pkgFilter = options.packages?.split(",").map((value) => value.trim());
29410
29411
  const resolved = resolvePublishOptions(doc, {
29411
29412
  compressed: options.compressed,
29412
- packages: pkgFilter
29413
+ packages: pkgFilter,
29414
+ targetProjectType: projectType
29413
29415
  });
29414
29416
  console.log(`Settings: ext=${resolved.fileExtension}, compressed=${resolved.compressed}`);
29415
29417
  if (options.branch) console.log(`Active branch: ${options.branch}`);
@@ -29452,7 +29454,7 @@ function registerRestoreCommand(program) {
29452
29454
  //#region src/utils/package-version.ts
29453
29455
  const require$1 = createRequire(import.meta.url);
29454
29456
  function getInjectedPackageVersion() {
29455
- const version = "0.2.1";
29457
+ const version = "0.2.2";
29456
29458
  return typeof version === "string" && true ? version : null;
29457
29459
  }
29458
29460
  function readPackageVersion() {
@@ -29480,7 +29482,7 @@ function createProgram() {
29480
29482
  " openfairygui",
29481
29483
  "",
29482
29484
  "Input can be a .fairy file or a project root directory (auto-discovers .fairy file).",
29483
- "File extension and binary format are read from project settings."
29485
+ "Publish settings are read from the project; --project-type applies target-specific output rules."
29484
29486
  ].join("\n"));
29485
29487
  return program;
29486
29488
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfairygui/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "FairyGUI Headless Authoring SDK — command-line interface.",
5
5
  "author": "OpenFairyGUI Contributors",
6
6
  "license": "MIT",
@@ -33,13 +33,13 @@
33
33
  "restore"
34
34
  ],
35
35
  "devDependencies": {
36
- "@openfairygui/core": "0.2.1",
37
- "@openfairygui/functions": "0.2.1"
36
+ "@openfairygui/core": "0.2.2",
37
+ "@openfairygui/functions": "0.2.2"
38
38
  },
39
39
  "dependencies": {
40
40
  "commander": "^14.0.2",
41
41
  "jiti": "^2.7.0",
42
- "@openfairygui/backend": "0.2.1"
42
+ "@openfairygui/backend": "0.2.2"
43
43
  },
44
44
  "optionalDependencies": {
45
45
  "sharp": ">=0.33.0"
package/src/cli.ts CHANGED
@@ -25,7 +25,7 @@ function createProgram(): Command {
25
25
  ' openfairygui',
26
26
  '',
27
27
  'Input can be a .fairy file or a project root directory (auto-discovers .fairy file).',
28
- 'File extension and binary format are read from project settings.',
28
+ 'Publish settings are read from the project; --project-type applies target-specific output rules.',
29
29
  ].join('\n'),
30
30
  );
31
31
 
@@ -1,8 +1,8 @@
1
- import type { Command } from 'commander';
1
+ import path from 'node:path';
2
2
  import { NodeIO } from '@openfairygui/core/node';
3
3
  import { resolvePublishOptions } from '@openfairygui/functions';
4
4
  import { publishNode } from '@openfairygui/functions/node';
5
- import path from 'node:path';
5
+ import type { Command } from 'commander';
6
6
  import { resolveFairyPath } from '../utils/project-input.js';
7
7
  import { parseProjectType } from '../utils/project-type.js';
8
8
 
@@ -44,6 +44,7 @@ export function registerPublishCommand(program: Command): void {
44
44
  const resolved = resolvePublishOptions(doc, {
45
45
  compressed: options.compressed,
46
46
  packages: pkgFilter,
47
+ targetProjectType: projectType,
47
48
  });
48
49
 
49
50
  console.log(`Settings: ext=${resolved.fileExtension}, compressed=${resolved.compressed}`);