<commit_before>import { app } from "electron"
import { createSharedMenuItems, editMenu } from "./shared-menu"
import { fileOperationsSubmenu } from "./shared-menu"
import isDev from "electron-is-dev"

export function createMacMenu(
  window: Electron.BrowserWindow,
): Electron.MenuItemConstructorOptions[] {
  const shared = createSharedMenuItems(window)
  const name: string = app.getName()

  const appMenu: Electron.MenuItemConstructorOptions = {
    label: name,
    submenu: [
      { label: `About ${name}`, role: "orderFrontStandardAboutPanel" },
      { type: "separator" },
      { label: `Hide ${name}`, accelerator: "Command+H", role: "hide" },
      { label: "Hide Others", accelerator: "Command+Option+H", role: "hideOtherApplications" },
      { label: "Show All", role: "unhideAllApplications" },
      { type: "separator" },
      { ...shared.quit, accelerator: "Command+Q" },
    ],
  }
  const fileMenu: Electron.MenuItemConstructorOptions = {
    label: "File",
    type: "submenu",
    submenu: fileOperationsSubmenu,
  }

  const viewMenu: Electron.MenuItemConstructorOptions = {
    label: "View",
    submenu: isDev
      ? [
          { ...shared.reload, accelerator: "Command+R" },
          { ...shared.storybook, accelerator: "Alt+Shift+S" },
          { ...shared.toggleDevTools, accelerator: "Alt+Command+I" },
        ]
      : [{ ...shared.fullScreen, accelerator: "Ctrl+Command+F" }],
  }

  const helpMenu: Electron.MenuItemConstructorOptions = {
    label: "Help",
    submenu: [process.env.HOMEPAGE && shared.visit].filter(Boolean),
  }

  return [appMenu, fileMenu, editMenu, viewMenu, helpMenu]
}
<commit_msg>Actually fix electron@5 breaking changes<commit_after>import { app } from "electron"
import { createSharedMenuItems, editMenu } from "./shared-menu"
import { fileOperationsSubmenu } from "./shared-menu"
import isDev from "electron-is-dev"

export function createMacMenu(
  window: Electron.BrowserWindow,
): Electron.MenuItemConstructorOptions[] {
  const shared = createSharedMenuItems(window)
  const name: string = app.getName()

  const appMenu: Electron.MenuItemConstructorOptions = {
    label: name,
    submenu: [
      { label: `About ${name}` },
      { type: "separator" },
      { label: `Hide ${name}`, accelerator: "Command+H" },
      {
        label: "Hide Others",
        accelerator: "Command+Option+H",
      },
      { label: "Show All" },
      { type: "separator" },
      { ...shared.quit, accelerator: "Command+Q" },
    ],
  }
  const fileMenu: Electron.MenuItemConstructorOptions = {
    label: "File",
    type: "submenu",
    submenu: fileOperationsSubmenu,
  }

  const viewMenu: Electron.MenuItemConstructorOptions = {
    label: "View",
    submenu: isDev
      ? [
          { ...shared.reload, accelerator: "Command+R" },
          { ...shared.storybook, accelerator: "Alt+Shift+S" },
          { ...shared.toggleDevTools, accelerator: "Alt+Command+I" },
        ]
      : [{ ...shared.fullScreen, accelerator: "Ctrl+Command+F" }],
  }

  const helpMenu: Electron.MenuItemConstructorOptions = {
    label: "Help",
    submenu: [process.env.HOMEPAGE && shared.visit].filter(Boolean),
  }

  return [appMenu, fileMenu, editMenu, viewMenu, helpMenu]
}

{'fraction_non_alphanumeric': 0.1479876160990712, 'fraction_numerical': 0.00030959752321981426, 'mean_word_length': 3.360323886639676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4710555', 'n_tokens_mistral': 994, 'n_tokens_neox': 957, 'n_words': 214}