Skip to content

Commit

Permalink
feat(cli): add support for --title
Browse files Browse the repository at this point in the history
  • Loading branch information
AviVahl committed Jun 25, 2024
1 parent 9da05fa commit 2fd4e0f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/engine-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ async function engine() {
description: 'Public path',
default: '',
},
title: {
type: String,
description: 'Title to set on the generated html file',
default: undefined,
},
staticBuild: {
type: Boolean,
description: 'Enable config build via config loaders',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface CreateBuildConfigOptions {
nodeFormat: 'esm' | 'cjs';
entryPointsPaths?: EntryPointsPaths;
staticBuild: boolean;
title?: string;
}

export function createBuildConfiguration(options: CreateBuildConfigOptions) {
Expand All @@ -33,6 +34,7 @@ export function createBuildConfiguration(options: CreateBuildConfigOptions) {
nodeFormat,
entryPointsPaths,
staticBuild,
title,
} = options;
const { webEntryPoints, nodeEntryPoints } = entryPoints;
const { webEntryPointsPaths, nodeEntryPointsPaths } = entryPointsPaths || {};
Expand Down Expand Up @@ -93,6 +95,7 @@ export function createBuildConfiguration(options: CreateBuildConfigOptions) {
const htmlFileName = envType === 'electron-renderer' ? `${envName}.${envType}` : envName;
return `${htmlFileName}.html`;
},
title,
}),
],
} satisfies BuildOptions;
Expand Down
5 changes: 4 additions & 1 deletion packages/engine-cli/src/engine-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface RunEngineOptions {
publicConfigsRoute?: string;
configLoadingMode?: ConfigLoadingMode;
staticBuild?: boolean;
title?: string;
}

export async function runEngine({
Expand All @@ -63,6 +64,7 @@ export async function runEngine({
publicConfigsRoute = 'configs',
configLoadingMode = 'require',
staticBuild = false,
title,
}: RunEngineOptions = {}): Promise<{
featureEnvironmentsMapping: FeatureEnvironmentMapping;
configMapping: ConfigurationEnvironmentMapping;
Expand Down Expand Up @@ -170,7 +172,8 @@ export async function runEngine({
jsOutExtension,
nodeFormat,
entryPointsPaths,
staticBuild
staticBuild,
title,
});

if (watch) {
Expand Down

0 comments on commit 2fd4e0f

Please sign in to comment.