Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): modify cli to add docs while scaffolding application #169

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/backend/src/plugins/sourceloop-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function createExtensionAction() {
},
},
},
async handler(ctx: any) {
async handler(ctx: any) { // NOSONAR

const extensions = ctx.input.extensions;
const cwd=ctx.workspacePath;
Expand Down
24 changes: 24 additions & 0 deletions patches/@sourceloop+cli+7.2.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/node_modules/@sourceloop/cli/lib/generators/scaffold/index.js b/node_modules/@sourceloop/cli/lib/generators/scaffold/index.js
index a2f1db9..2a370df 100644
--- a/node_modules/@sourceloop/cli/lib/generators/scaffold/index.js
+++ b/node_modules/@sourceloop/cli/lib/generators/scaffold/index.js
@@ -29,10 +29,19 @@ class ScaffoldGenerator extends base_generator_1.BaseGenerator {
path: require.resolve('../backstage-integration'),
}, this.options);
}
+
+ await this._addDocs();
}
async install() {
await this.spawnCommand('npm', ['i']);
}
+ async _addDocs() {
+ const sourcePath = `${this.destinationRoot()}/README.md`;
+ const destinationPath = `${this.destinationRoot()}/docs/README.md`;
+ /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
+ //@ts-ignore
+ await this.fs.copyTplAsync(sourcePath, destinationPath);
+ }
_setRoot() {
if (this.options.cwd) {
this.destinationRoot(this.options.cwd);
Loading