Skip to content

Commit

Permalink
fix(templates): modify cli to add docs while scaffolding application (#…
Browse files Browse the repository at this point in the history
…169)

modify cli to add docs while scaffolding application

gh-0

## Description

Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Intermediate change (work in progress)

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

- [ ] Test A
- [ ] Test B

## Checklist:

- [ ] Performed a self-review of my own code
- [ ] npm test passes on your machine
- [ ] New tests added or existing tests modified to cover all changes
- [ ] Code conforms with the style guide
- [ ] API Documentation in code was updated
- [ ] Any dependent changes have been merged and published in downstream
modules
  • Loading branch information
Tyagi-Sunny authored Jun 27, 2024
1 parent e4f5b20 commit 1e52fa3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
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);

0 comments on commit 1e52fa3

Please sign in to comment.