-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use productName from app/package.json if present #204
Closes #204
- Loading branch information
Showing
20 changed files
with
229 additions
and
143 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
export interface AppMetadata extends Metadata { | ||
readonly version: string | ||
|
||
/** The application name */ | ||
readonly name: string | ||
|
||
/** | ||
* As {@link AppMetadata#name}, but allows you to specify a product name for your executable which contains spaces and other special characters | ||
* not allowed in the [name property]{@link https://docs.npmjs.com/files/package.json#name}. | ||
*/ | ||
readonly productName?: string | ||
|
||
readonly description: string | ||
readonly author: AuthorMetadata | ||
|
||
readonly build: BuildMetadata | ||
} | ||
|
||
export function getProductName(metadata: AppMetadata) { | ||
return metadata.build.productName || metadata.productName || metadata.name | ||
} | ||
|
||
export interface DevMetadata extends Metadata { | ||
readonly build: DevBuildMetadata | ||
|
||
readonly directories?: MetadataDirectories | ||
} | ||
|
||
export interface BuildMetadata { | ||
readonly "app-bundle-id": string | ||
readonly "app-category-type": string | ||
|
||
readonly iconUrl: string | ||
|
||
/** | ||
* See {@link AppMetadata#productName}. | ||
*/ | ||
readonly productName?: string | ||
} | ||
|
||
export interface RepositoryInfo { | ||
readonly url: string | ||
} | ||
|
||
export interface Metadata { | ||
readonly repository: string | RepositoryInfo | ||
} | ||
|
||
export interface AuthorMetadata { | ||
readonly name: string | ||
readonly email: string | ||
} | ||
|
||
export interface MetadataDirectories { | ||
readonly buildResources?: string | ||
} | ||
|
||
export interface DevBuildMetadata { | ||
readonly osx: appdmg.Specification | ||
readonly win: any, | ||
readonly linux: any | ||
} | ||
|
||
export class Platform { | ||
public static OSX = new Platform("osx", "osx") | ||
public static LINUX = new Platform("linux", "linux") | ||
public static WINDOWS = new Platform("windows", "win") | ||
|
||
constructor(public name: string, public buildConfigurationKey: string) { | ||
} | ||
|
||
toString() { | ||
return this.name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.