Skip to content

Commit

Permalink
fix : blueprint-builder homepage population (#596)
Browse files Browse the repository at this point in the history
Co-authored-by: Pranav Dogra <prandog@amazon.com>
  • Loading branch information
pranavdo and Pranav Dogra authored Jul 25, 2024
1 parent a17772e commit 008f176
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
4 changes: 0 additions & 4 deletions packages/blueprints/blueprint-builder/src/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export interface Options extends ParentOptions {
*/
authorName: string;

homepage: string;

/**
* @collapsed true
*/
Expand Down Expand Up @@ -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_);

Expand Down Expand Up @@ -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',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export function buildBlueprintPackage(
packageName: string;
dashname: string;
bpOptions: Options;
homepage: string;
projectName: string;
spaceName: string;
},
Expand All @@ -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 !== '<<FAKE_PROJECTNAME>>' && options.space !== '<<FAKE_SPACENAME>>'
? `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,
Expand Down
8 changes: 5 additions & 3 deletions packages/utils/projen-blueprint/src/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 008f176

Please sign in to comment.