Repository: jiahaog/nativefier
File: src/build/buildNativefierApp.ts (TypeScript)

Code before:
      .filter(
        ([key, value]) =>
          OPTIONS_REQUIRING_WINDOWS_FOR_WINDOWS_BUILD.includes(key) && !!value,
      )
      .map(([key]) => key);
    if (optionsPresent.length === 0) {
      return;
    }
    log.warn(
      `*Not* setting [${optionsPresent.join(', ')}], as couldn't find Wine.`,
      'Wine is required when packaging a Windows app under on non-Windows platforms.',
      'Also, note that Windows apps built under non-Windows platforms without Wine *will lack* certain',
      'features, like a correct icon and process name. Do yourself a favor and install Wine, please.',
    );
    for (const keyToUnset of optionsPresent) {
      (options as unknown as Record<string, undefined>)[keyToUnset] = undefined;
    }
  }
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export async function buildNativefierApp(
  rawOptions: RawOptions,
): Promise<string | undefined> {
  if (rawOptions.quiet) {
    log.setLevel('silent');
  }

  log.warn(
    '\n\n    Hi! Nativefier is minimally maintained these days, and needs more hands.\n' +
      '    If you have the time & motivation, help with bugfixes and maintenance is VERY welcome.\n' +
      '    Please go to https://github.com/nativefier/nativefier and help how you can. Thanks.\n\n',
  );

  log.info('\nProcessing options...');

  let finalOutDirectory = rawOptions.out ?? process.cwd();

  if (isUpgrade(rawOptions)) {
    log.debug('Attempting to upgrade from', rawOptions.upgradeFrom);
    const oldApp = findUpgradeApp(rawOptions.upgradeFrom as string);
    if (!oldApp) {
      throw new Error(
        `Could not find an old Nativfier app in "${
          rawOptions.upgradeFrom as string
        }"`,
      );
    }
    rawOptions = useOldAppOptions(rawOptions, oldApp);
    if (rawOptions.out === undefined && rawOptions.overwrite) {
      finalOutDirectory = oldApp.appRoot;

Review comment (suggestion):
```suggestion
  // early-suppress potential logging before full options handling
  if (rawOptions.quiet) {
```

Code after:
      .filter(
        ([key, value]) =>
          OPTIONS_REQUIRING_WINDOWS_FOR_WINDOWS_BUILD.includes(key) && !!value,
      )
      .map(([key]) => key);
    if (optionsPresent.length === 0) {
      return;
    }
    log.warn(
      `*Not* setting [${optionsPresent.join(', ')}], as couldn't find Wine.`,
      'Wine is required when packaging a Windows app under on non-Windows platforms.',
      'Also, note that Windows apps built under non-Windows platforms without Wine *will lack* certain',
      'features, like a correct icon and process name. Do yourself a favor and install Wine, please.',
    );
    for (const keyToUnset of optionsPresent) {
      (options as unknown as Record<string, undefined>)[keyToUnset] = undefined;
    }
  }
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export async function buildNativefierApp(
  rawOptions: RawOptions,
): Promise<string | undefined> {
  // early-suppress potential logging before full options handling
  if (rawOptions.quiet) {
    log.setLevel('silent');
  }

  log.warn(
    '\n\n    Hi! Nativefier is minimally maintained these days, and needs more hands.\n' +
      '    If you have the time & motivation, help with bugfixes and maintenance is VERY welcome.\n' +
      '    Please go to https://github.com/nativefier/nativefier and help how you can. Thanks.\n\n',
  );

  log.info('\nProcessing options...');

  let finalOutDirectory = rawOptions.out ?? process.cwd();

  if (isUpgrade(rawOptions)) {
    log.debug('Attempting to upgrade from', rawOptions.upgradeFrom);
    const oldApp = findUpgradeApp(rawOptions.upgradeFrom as string);
    if (!oldApp) {
      throw new Error(
        `Could not find an old Nativfier app in "${
          rawOptions.upgradeFrom as string
        }"`,
      );
    }
    rawOptions = useOldAppOptions(rawOptions, oldApp);
    if (rawOptions.out === undefined && rawOptions.overwrite) {