Includes templates in @backstage/repo-tools package and use them in the CLI

Signed-off-by: Taras Mankovski <taras@frontside.com>
This commit is contained in:
Taras Mankovski
2023-12-01 14:30:44 -05:00
parent df4a219c52
commit f909e9de40
3 changed files with 18 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/repo-tools': patch
---
Includes templates in @backstage/repo-tools package and use them in the CLI
+3 -1
View File
@@ -32,6 +32,7 @@
"dependencies": {
"@apidevtools/swagger-parser": "^10.1.0",
"@apisyouwonthate/style-guide": "^1.4.0",
"@backstage/backend-common": "workspace:^",
"@backstage/catalog-model": "workspace:^",
"@backstage/cli-common": "workspace:^",
"@backstage/cli-node": "workspace:^",
@@ -85,7 +86,8 @@
},
"files": [
"bin",
"dist/**/*.js"
"dist/**/*.js",
"templates"
],
"nodemonConfig": {
"watch": "./src",
@@ -21,6 +21,7 @@ import { paths as cliPaths } from '../../../lib/paths';
import { mkdirpSync } from 'fs-extra';
import fs from 'fs-extra';
import { exec } from '../../../lib/exec';
import { resolvePackagePath } from '@backstage/backend-common';
async function generate(spec: string, outputDirectory: string) {
const resolvedOpenapiPath = resolve(spec);
@@ -47,7 +48,15 @@ async function generate(spec: string, outputDirectory: string) {
'-g',
'typescript',
'-c',
'templates/typescript-backstage.yaml',
resolvePackagePath(
'@backstage/repo-tools',
'templates/typescript-backstage.yaml',
),
'-t',
resolvePackagePath(
'@backstage/repo-tools',
'templates/typescript-backstage',
),
'--generator-key',
'v3.0',
],