Skip to content

Commit

Permalink
GeneratoOptions should extend from CommonGeneratorOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaphi committed May 10, 2022
1 parent 0d3d643 commit 1bf3556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/generate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import chulk from "chalk";
import { existsSync } from "fs";
import { appendFile } from "fs/promises";
import type { CommonGeneratorOptions } from "./generators/common/index.js";
import { generateGreasemonkeyHeaders } from "./generators/greasemonkey/index.js";
import type {
GrantOptions,
Expand All @@ -21,7 +22,7 @@ import {

export type RunAtOption = "start" | "end" | "idle" | "body" | "menu";

export type GeneratorOptions<T extends GrantOptions> = {
export type GeneratorOptions<T extends GrantOptions> = CommonGeneratorOptions & {
collapse: boolean;
direct?: boolean;
downloadURL?: string;
Expand All @@ -30,7 +31,6 @@ export type GeneratorOptions<T extends GrantOptions> = {
homepage?: string;
inject?: string;
matches?: string[];
namespace?: string;
output: string;
packagePath: string;
pretty?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { parseName, prettifyName } from "../../utils/name.js";
import type { PackageInfo } from "../../utils/package.js";
import type { CommonHeaders, HeaderEntries } from "../index.js";

export type CommonHeadersOptions = {
export type CommonGeneratorOptions = {
namespace?: string;
pretty: boolean;
}
Expand All @@ -15,7 +15,7 @@ export type CommonHeadersOptions = {
*/
export const generateCommonHeaders = (
pkg: PackageInfo,
options: CommonHeadersOptions
options: CommonGeneratorOptions
) => {
const { namespace, pretty } = options;

Expand Down

0 comments on commit 1bf3556

Please # to comment.