Skip to content

Commit

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

homepage: string;

/**
* @collapsed true
*/
Expand Down Expand Up @@ -97,6 +99,7 @@ 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 @@ -132,6 +135,9 @@ 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,13 +27,25 @@ export function buildBlueprintPackage(
packageName: string;
dashname: string;
bpOptions: Options;
homepage: string;
projectName: string;
spaceName: string;
},
) {
repository.copyStaticFiles({
from: 'standard-blueprint',
});

const newBlueprintOptions: ProjenBlueprintOptions = {
homepage: options.homepage.concat(
'/spaces/',
options.space,
'/projects/',
options.projectName,
'/source-repositories/',
options.dashname,
'/view',
),
authorName: options.bpOptions.authorName,
publishingOrganization: options.space,
packageName: options.packageName,
Expand Down Expand Up @@ -72,7 +84,6 @@ export function buildBlueprintPackage(
'fast-xml-parser',
],
keywords: [...(options.bpOptions.advancedSettings?.tags || ['<<tag>>'])],
homepage: '',
};
console.log('New blueprint options:', JSON.stringify(newBlueprintOptions, null, 2));

Expand Down
2 changes: 1 addition & 1 deletion packages/blueprints/blueprint/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/blueprints/gen-ai-chatbot/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/blueprints/launch-blueprint/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/blueprints/mirror-to-codecommit/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/blueprints/sam-serverless-app/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/blueprints/subscribe-blueprint/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/blueprints/test-blueprint/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/utils/projen-blueprint/src/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ export interface ProjenBlueprintOptions extends typescript.TypeScriptProjectOpti
* @deprecated
*/
gettingStarted?: boolean;

/**
* Homepage url
*/
homepage?: string;
}

const DEFAULT_OPTS = {
Expand Down Expand Up @@ -102,6 +107,10 @@ export class ProjenBlueprint extends typescript.TypeScriptProject {
};
super(finalOpts);

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');
this.addDevDeps('ts-node@^10');
Expand Down

0 comments on commit 3cbf155

Please sign in to comment.