Skip to content

Commit

Permalink
feat(vcs-hosts): apply lifters after scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Jul 26, 2024
1 parent d61517d commit 142c124
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ await scaffold({
},
languages: {
foo: {scaffold: options => options}
},
vcsHosts: {
baz: {
scaffold: options => options,
prompt: () => ({repoOwner: 'form8ion'})
}
}
}
});
Expand Down
6 changes: 6 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ await scaffold({
},
languages: {
foo: {scaffold: options => options}
},
vcsHosts: {
baz: {
scaffold: options => options,
prompt: () => ({repoOwner: 'form8ion'})
}
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/scaffolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function scaffold(options) {
nextSteps: contributedTasks
});

await lift({projectRoot, results: deepmerge.all(contributors), enhancers: dependencyUpdaters});
await lift({projectRoot, results: deepmerge.all(contributors), enhancers: {...dependencyUpdaters, ...vcsHosts}});

const gitResults = gitRepo && await liftGit({projectRoot, origin: vcsHostResults});

Expand Down
2 changes: 1 addition & 1 deletion src/scaffolder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('project scaffolder', () => {
expect(lift).toHaveBeenCalledWith({
projectRoot: projectPath,
results: deepmerge.all([licenseResults, languageResults, dependencyUpdaterResults, contributingResults]),
enhancers: dependencyUpdaters
enhancers: {...dependencyUpdaters, ...vcsHosts}
});
expect(resultsReporter.reportResults).toHaveBeenCalledWith({
nextSteps: [...gitNextSteps, ...dependencyUpdaterNextSteps]
Expand Down

0 comments on commit 142c124

Please sign in to comment.