From 15b041cf656fef3356b82d7583493e52e24f0a44 Mon Sep 17 00:00:00 2001 From: Pranav Dogra Date: Tue, 23 Jul 2024 11:26:34 -0700 Subject: [PATCH] fix : blueprint-builder homepage population --- .../blueprints/blueprint-builder/src/blueprint.ts | 4 ---- .../src/build-blueprint-package.ts | 14 ++++---------- packages/utils/projen-blueprint/src/blueprint.ts | 8 +++++--- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/packages/blueprints/blueprint-builder/src/blueprint.ts b/packages/blueprints/blueprint-builder/src/blueprint.ts index 60aad1518..e9ab01549 100644 --- a/packages/blueprints/blueprint-builder/src/blueprint.ts +++ b/packages/blueprints/blueprint-builder/src/blueprint.ts @@ -32,8 +32,6 @@ export interface Options extends ParentOptions { */ authorName: string; - homepage: string; - /** * @collapsed true */ @@ -99,7 +97,6 @@ export class Blueprint extends ParentBlueprint { ...defaults.advancedSettings, license: defaults.advancedSettings.license as any, }, - homepage: 'https://codecatalyst.aws/', }; const userSelectedOptions = Object.assign(typeCheck, options_); @@ -135,7 +132,6 @@ export class Blueprint extends ParentBlueprint { space: this.context.spaceName || 'unknown', packageName: options.advancedSettings.blueprintPackageName, dashname: dashName, - homepage: options.homepage, projectName: this.context.project.name || 'unknown', spaceName: this.context.spaceName || 'unknown', }); diff --git a/packages/blueprints/blueprint-builder/src/build-blueprint-package.ts b/packages/blueprints/blueprint-builder/src/build-blueprint-package.ts index 1e6a70a99..37cf7e16b 100644 --- a/packages/blueprints/blueprint-builder/src/build-blueprint-package.ts +++ b/packages/blueprints/blueprint-builder/src/build-blueprint-package.ts @@ -27,7 +27,6 @@ export function buildBlueprintPackage( packageName: string; dashname: string; bpOptions: Options; - homepage: string; projectName: string; spaceName: string; }, @@ -37,15 +36,10 @@ export function buildBlueprintPackage( }); const newBlueprintOptions: ProjenBlueprintOptions = { - homepage: options.homepage.concat( - '/spaces/', - options.space, - '/projects/', - options.projectName, - '/source-repositories/', - options.dashname, - '/view', - ), + homepage: + options.projectName !== '<>' && options.space !== '<>' + ? `https://codecatalyst.aws/spaces/${options.space}/projects/${options.projectName}/source-repositories/${options.dashname}/view` + : 'https://codecatalyst.aws', authorName: options.bpOptions.authorName, publishingOrganization: options.space, packageName: options.packageName, diff --git a/packages/utils/projen-blueprint/src/blueprint.ts b/packages/utils/projen-blueprint/src/blueprint.ts index e11db3af4..6d8ed6fbb 100644 --- a/packages/utils/projen-blueprint/src/blueprint.ts +++ b/packages/utils/projen-blueprint/src/blueprint.ts @@ -107,9 +107,11 @@ export class ProjenBlueprint extends typescript.TypeScriptProject { }; super(finalOpts); - this.addFields({ - homepage: 'https://codecatalyst.aws/', - }); + if (!finalOpts.homepage) { + this.addFields({ + homepage: 'https://codecatalyst.aws/', + }); + } const version = options.overridePackageVersion || JSON.parse(fs.readFileSync(path.resolve(this.outdir, 'package.json'), 'utf-8')).version; this.package.addVersion(version || '0.0.0');