Skip to content

Commit

Permalink
refactor: add / use named exports for plugins + makers + publishers
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Oct 26, 2022
1 parent 247bcc8 commit 2fb2045
Show file tree
Hide file tree
Showing 35 changed files with 63 additions and 51 deletions.
2 changes: 1 addition & 1 deletion packages/api/core/src/api/make.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';

import { asyncOra } from '@electron-forge/async-ora';
import MakerBase from '@electron-forge/maker-base';
import { MakerBase } from '@electron-forge/maker-base';
import { ForgeArch, ForgeConfig, ForgeConfigMaker, ForgeMakeResult, ForgePlatform, IForgeResolvableMaker } from '@electron-forge/shared-types';
import { getHostArch } from '@electron/get';
import chalk from 'chalk';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/core/test/fixture/custom-maker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MakerBase from '@electron-forge/maker-base';
import { MakerBase } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';

interface Config {
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/appx/src/MakerAppX.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
import resolveCommand from 'cross-spawn/lib/util/resolveCommand';
import windowsStore from 'electron-windows-store';
Expand Down Expand Up @@ -130,4 +130,4 @@ export default class MakerAppX extends MakerBase<MakerAppXConfig> {
}
}

export { MakerAppXConfig };
export { MakerAppX, MakerAppXConfig };
2 changes: 2 additions & 0 deletions packages/maker/base/src/Maker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,5 @@ export default abstract class Maker<C> implements IForgeMaker {
return `${noPrerelease}.0`;
}
}

export { Maker as MakerBase };
2 changes: 1 addition & 1 deletion packages/maker/base/test/ensure-output_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path';
import { expect } from 'chai';
import fs from 'fs-extra';

import MakerBase, { EmptyConfig } from '../src/Maker';
import { EmptyConfig, MakerBase } from '../src/Maker';

class MakerImpl extends MakerBase<EmptyConfig> {
name = 'test';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/base/test/support_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';

import MakerBase, { EmptyConfig } from '../src/Maker';
import { EmptyConfig, MakerBase } from '../src/Maker';

class MakerImpl extends MakerBase<EmptyConfig> {
name = 'test';
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/base/test/version_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';

import MakerBase, { EmptyConfig } from '../src/Maker';
import { EmptyConfig, MakerBase } from '../src/Maker';

class MakerImpl extends MakerBase<EmptyConfig> {
name = 'test';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/deb/src/MakerDeb.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';

import { MakerDebConfig } from './Config';
Expand Down Expand Up @@ -51,4 +51,4 @@ export default class MakerDeb extends MakerBase<MakerDebConfig> {
}
}

export { MakerDebConfig };
export { MakerDeb, MakerDebConfig };
2 changes: 1 addition & 1 deletion packages/maker/deb/test/MakerDeb_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
import { expect } from 'chai';
import proxyquire from 'proxyquire';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/dmg/src/MakerDMG.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
import fs from 'fs-extra';

Expand Down Expand Up @@ -40,4 +40,4 @@ export default class MakerDMG extends MakerBase<MakerDMGConfig> {
}
}

export { MakerDMGConfig };
export { MakerDMG, MakerDMGConfig };
2 changes: 1 addition & 1 deletion packages/maker/dmg/test/MakerDMG_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
import { expect } from 'chai';
import proxyquire from 'proxyquire';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/flatpak/src/MakerFlatpak.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
import fs from 'fs-extra';

Expand Down Expand Up @@ -52,4 +52,4 @@ export default class MakerFlatpak extends MakerBase<MakerFlatpakConfig> {
}
}

export { MakerFlatpak };
export { MakerFlatpak, MakerFlatpakConfig };
2 changes: 1 addition & 1 deletion packages/maker/flatpak/test/MakerFlatpak_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
import { expect } from 'chai';
import 'chai-as-promised';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/pkg/src/MakerPKG.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
import { flatAsync } from '@electron/osx-sign';

Expand Down Expand Up @@ -40,4 +40,4 @@ export default class MakerPKG extends MakerBase<MakerPKGConfig> {
}
}

export { MakerPKGConfig };
export { MakerPKG, MakerPKGConfig };
2 changes: 1 addition & 1 deletion packages/maker/pkg/test/MakerPKG_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
import { expect } from 'chai';
import proxyquire from 'proxyquire';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/rpm/src/MakerRpm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';

import { MakerRpmConfig } from './Config';
Expand Down Expand Up @@ -49,4 +49,4 @@ export default class MakerRpm extends MakerBase<MakerRpmConfig> {
}
}

export { MakerRpmConfig };
export { MakerRpm, MakerRpmConfig };
2 changes: 1 addition & 1 deletion packages/maker/rpm/test/MakerRpm_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
import { expect } from 'chai';
import proxyquire from 'proxyquire';
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/snap/src/MakerSnap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';

import { MakerSnapConfig } from './Config';
Expand Down Expand Up @@ -34,4 +34,4 @@ export default class MakerSnap extends MakerBase<MakerSnapConfig> {
}
}

export { MakerSnapConfig };
export { MakerSnap, MakerSnapConfig };
2 changes: 1 addition & 1 deletion packages/maker/snap/test/MakerSnap_spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgeArch } from '@electron-forge/shared-types';
import { expect } from 'chai';
import proxyquire from 'proxyquire';
Expand Down
4 changes: 3 additions & 1 deletion packages/maker/squirrel/src/MakerSquirrel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
import { convertVersion, createWindowsInstaller, Options as ElectronWinstallerOptions } from 'electron-winstaller';
import fs from 'fs-extra';
Expand Down Expand Up @@ -51,3 +51,5 @@ export default class MakerSquirrel extends MakerBase<MakerSquirrelConfig> {
return artifacts;
}
}

export { MakerSquirrel };
4 changes: 2 additions & 2 deletions packages/maker/wix/src/MakerWix.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';

import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
import { MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';
import chalk from 'chalk';
import { MSICreator, MSICreatorOptions } from 'electron-wix-msi/lib/creator';
Expand Down Expand Up @@ -52,4 +52,4 @@ export default class MakerWix extends MakerBase<MakerWixConfig> {
}
}

export { MakerWixConfig };
export { MakerWix, MakerWixConfig };
4 changes: 3 additions & 1 deletion packages/maker/zip/src/MakerZIP.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import { promisify } from 'util';

import MakerBase, { EmptyConfig, MakerOptions } from '@electron-forge/maker-base';
import { EmptyConfig, MakerBase, MakerOptions } from '@electron-forge/maker-base';
import { ForgePlatform } from '@electron-forge/shared-types';

export type MakerZIPConfig = EmptyConfig;
Expand All @@ -28,3 +28,5 @@ export default class MakerZIP extends MakerBase<MakerZIPConfig> {
return [zipPath];
}
}

export { MakerZIP };
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PluginBase from '@electron-forge/plugin-base';
import { PluginBase } from '@electron-forge/plugin-base';
import { ForgeConfig, ForgeHookFn } from '@electron-forge/shared-types';

import { AutoUnpackNativesConfig } from './Config';
Expand Down Expand Up @@ -34,4 +34,4 @@ export default class AutoUnpackNativesPlugin extends PluginBase<AutoUnpackNative
};
}

export { AutoUnpackNativesConfig };
export { AutoUnpackNativesPlugin, AutoUnpackNativesConfig };
2 changes: 2 additions & 0 deletions packages/plugin/base/src/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ export default abstract class Plugin<C> implements IForgePlugin {
return false;
}
}

export { Plugin as PluginBase };
6 changes: 3 additions & 3 deletions packages/plugin/compile/src/CompilePlugin.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as path from 'path';

import PluginBase, { StartOptions } from '@electron-forge/plugin-base';
import { PluginBase, StartOptions } from '@electron-forge/plugin-base';
import { ForgeHookFn } from '@electron-forge/shared-types';

import { CompilePluginConfig } from './Config';
import { createCompileHook } from './lib/compile-hook';

export default class LocalElectronPlugin extends PluginBase<CompilePluginConfig> {
export default class CompileElectronPlugin extends PluginBase<CompilePluginConfig> {
name = 'electron-compile';

private dir!: string;
Expand Down Expand Up @@ -35,4 +35,4 @@ export default class LocalElectronPlugin extends PluginBase<CompilePluginConfig>
}
}

export { CompilePluginConfig };
export { CompileElectronPlugin, CompilePluginConfig };
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import runElectronegativity from '@doyensec/electronegativity';
import PluginBase from '@electron-forge/plugin-base';
import { PluginBase } from '@electron-forge/plugin-base';
import { ForgeConfig, ForgeHookFn } from '@electron-forge/shared-types';

// To be more precise, postPackage options we care about.
Expand Down Expand Up @@ -78,3 +78,5 @@ export default class ElectronegativityPlugin extends PluginBase<Electronegativit
);
};
}

export { ElectronegativityPlugin };
4 changes: 2 additions & 2 deletions packages/plugin/local-electron/src/LocalElectronPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PluginBase from '@electron-forge/plugin-base';
import { PluginBase } from '@electron-forge/plugin-base';
import { ForgeConfig, ForgeHookFn } from '@electron-forge/shared-types';
import fs from 'fs-extra';

Expand Down Expand Up @@ -62,4 +62,4 @@ export default class LocalElectronPlugin extends PluginBase<LocalElectronPluginC
};
}

export { LocalElectronPluginConfig };
export { LocalElectronPlugin, LocalElectronPluginConfig };
4 changes: 2 additions & 2 deletions packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path';

import { asyncOra } from '@electron-forge/async-ora';
import { utils } from '@electron-forge/core';
import PluginBase from '@electron-forge/plugin-base';
import { PluginBase } from '@electron-forge/plugin-base';
import { ElectronProcess, ForgeArch, ForgeConfig, ForgeHookFn, ForgePlatform } from '@electron-forge/shared-types';
import Logger, { Tab } from '@electron-forge/web-multi-logger';
import chalk from 'chalk';
Expand Down Expand Up @@ -398,4 +398,4 @@ the generated files). Instead, it is ${JSON.stringify(pj.main)}`);
}
}

export { WebpackPluginConfig };
export { WebpackPlugin, WebpackPluginConfig };
2 changes: 2 additions & 0 deletions packages/publisher/base/src/Publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ export default abstract class Publisher<C> implements IForgePublisher {
throw new Error(`Publisher ${this.name} did not implement the publish method`);
}
}

export { Publisher as PublisherBase };
4 changes: 2 additions & 2 deletions packages/publisher/bitbucket/src/PublisherBitbucket.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';

import { asyncOra } from '@electron-forge/async-ora';
import PublisherBase, { PublisherOptions } from '@electron-forge/publisher-base';
import { PublisherBase, PublisherOptions } from '@electron-forge/publisher-base';
import FormData from 'form-data';
import fs from 'fs-extra';
import fetch from 'node-fetch';
Expand Down Expand Up @@ -84,4 +84,4 @@ export default class PublisherBitbucket extends PublisherBase<PublisherBitbucket
}
}

export { PublisherBitbucketConfig };
export { PublisherBitbucket, PublisherBitbucketConfig };
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';

import { asyncOra } from '@electron-forge/async-ora';
import PublisherBase, { PublisherOptions } from '@electron-forge/publisher-base';
import { PublisherBase, PublisherOptions } from '@electron-forge/publisher-base';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
import debug from 'debug';
import FormData from 'form-data';
Expand Down Expand Up @@ -156,4 +156,4 @@ export default class PublisherERS extends PublisherBase<PublisherERSConfig> {
}
}

export { PublisherERSConfig };
export { PublisherERS, PublisherERSConfig };
4 changes: 2 additions & 2 deletions packages/publisher/github/src/PublisherGithub.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';

import { asyncOra } from '@electron-forge/async-ora';
import PublisherBase, { PublisherOptions } from '@electron-forge/publisher-base';
import { PublisherBase, PublisherOptions } from '@electron-forge/publisher-base';
import { ForgeMakeResult } from '@electron-forge/shared-types';
import { GetResponseDataTypeFromEndpointMethod } from '@octokit/types';
import fs from 'fs-extra';
Expand Down Expand Up @@ -131,4 +131,4 @@ export default class PublisherGithub extends PublisherBase<PublisherGitHubConfig
}
}

export { PublisherGitHubConfig };
export { PublisherGithub, PublisherGitHubConfig };
4 changes: 2 additions & 2 deletions packages/publisher/nucleus/src/PublisherNucleus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';

import { asyncOra } from '@electron-forge/async-ora';
import PublisherBase, { PublisherOptions } from '@electron-forge/publisher-base';
import { PublisherBase, PublisherOptions } from '@electron-forge/publisher-base';
import debug from 'debug';
import FormData from 'form-data';
import fetch from 'node-fetch';
Expand Down Expand Up @@ -68,4 +68,4 @@ export default class PublisherNucleus extends PublisherBase<PublisherNucleusConf
}
}

export { PublisherNucleusConfig };
export { PublisherNucleus, PublisherNucleusConfig };
4 changes: 2 additions & 2 deletions packages/publisher/s3/src/PublisherS3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { S3Client } from '@aws-sdk/client-s3';
import { Progress, Upload } from '@aws-sdk/lib-storage';
import { Credentials } from '@aws-sdk/types';
import { asyncOra } from '@electron-forge/async-ora';
import PublisherBase, { PublisherOptions } from '@electron-forge/publisher-base';
import { PublisherBase, PublisherOptions } from '@electron-forge/publisher-base';
import debug from 'debug';

import { PublisherS3Config } from './Config';
Expand Down Expand Up @@ -101,4 +101,4 @@ export default class PublisherS3 extends PublisherBase<PublisherS3Config> {
}
}

export { PublisherS3Config };
export { PublisherS3, PublisherS3Config };
Loading

0 comments on commit 2fb2045

Please sign in to comment.