const config = require('./src/config');

module.exports = {
  packagerConfig: {
    arch: 'x64',
    protocols: [
      {
        name: 'Automation Scaping Tool',
        schemes: [config.DEEP_LINKING_URL],
      },
    ],
  },
  rebuildConfig: {},
  makers: [
    // {
    //   name: '@electron-forge/maker-squirrel',
    //   // platforms: ['win32'],
    //   // config: {
    //   //   certificateFile: './cert.pfx',
    //   //   certificatePassword: config.CERTIFICATE_PASSWORD,
    //   // },
    // },
    // {
    //   name: '@electron-forge/maker-wix',
    // },
    {
      name: '@electron-forge/maker-zip',
      platforms: ['win32', 'darwin'],
    },
    // {
    //   name: '@electron-forge/maker-deb',
    //   config: {},
    // },
    // {
    //   name: '@electron-forge/maker-rpm',
    //   config: {},
    // },
    // {
    //   name: '@electron-forge/maker-wix',
    //   config: {
    //     language: 1033,
    //     manufacturer: 'My Awesome Company',
    //   },
    // },
  ],
  electronArgs: ['--trace-warnings'],
  remote: '*',
  plugins: [
    {
      name: '@electron-forge/plugin-vite',
      config: {
        // `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
        // If you are familiar with Vite configuration, it will look really familiar.
        build: [
          {
            // `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
            entry: 'src/main.js',
            config: 'vite.main.config.mjs',
          },
          {
            entry: 'src/preload.js',
            config: 'vite.preload.config.mjs',
          },
          {
            entry: 'src/preload2.js',
            config: 'vite.preload.config.mjs',
          },
        ],
        renderer: [
          {
            name: 'main_window',
            config: 'vite.renderer.config.mjs',
          },
        ],
      },
    },
  ],
  publishers: [
    {
      name: '@electron-forge/publisher-github',
      authToken: config.GITHUB_TOKEN,
      config: {
        repository: {
          owner: 'tnguyenthanhreiq',
          name: 'automation_scraping_tool',
        },
        prerelease: true,
      },
    },
  ],
};
