update template folder structure

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
aramissennyeydd
2024-03-06 18:24:44 -05:00
parent 00c6b272db
commit 61315a9ee4
24 changed files with 26 additions and 16 deletions
@@ -63,7 +63,7 @@ async function generate(
'-c',
resolvePackagePath(
'@backstage/repo-tools',
'templates/typescript-backstage.client.yaml',
'templates/typescript-backstage-client.yaml',
),
'--generator-key',
'v3.0',
@@ -78,6 +78,11 @@ async function generate(abortSignal?: AbortController) {
OPENAPI_IGNORE_FILES.join('\n'),
);
const additionalProperties = [];
if (clientPackage) {
additionalProperties.push(`clientPackageName=${clientPackage}`);
}
await exec(
'node',
[
@@ -92,9 +97,9 @@ async function generate(abortSignal?: AbortController) {
'-c',
resolvePackagePath(
'@backstage/repo-tools',
'templates/typescript-backstage.server.yaml',
'templates/typescript-backstage-server.yaml',
),
`--additional-properties=clientPackageName=@backstage/catalog-client`,
`--additional-properties=${additionalProperties.join(',')}`,
'--generator-key',
'v3.0',
],
@@ -1,11 +1,11 @@
templateDir: templates/typescript-backstage
templateDir: templates/typescript-backstage-client
files:
client/api.mustache:
api.mustache:
templateType: API
# For some reason, they check for destinationFilename differences. We have to change the ending to override the file.
destinationFilename: .client.ts
client/model.mustache:
model.mustache:
templateType: Model
destinationFilename: .model.ts
modelGeneric.mustache:
@@ -22,19 +22,19 @@ files:
templateType: SupportingFiles
modelTaggedUnion.mustache:
templateType: SupportingFiles
client/models/models_all.mustache:
models/models_all.mustache:
templateType: SupportingFiles
destinationFilename: models/index.ts
client/types/fetch.ts:
types/fetch.ts:
destinationFilename: types/fetch.ts
client/types/discovery.ts:
types/discovery.ts:
destinationFilename: types/discovery.ts
client/apis/index.mustache:
apis/index.mustache:
templateType: SupportingFiles
destinationFilename: apis/index.ts
client/pluginId.mustache:
pluginId.mustache:
templateType: SupportingFiles
destinationFilename: pluginId.ts
client/index.mustache:
index.mustache:
templateType: SupportingFiles
destinationFilename: index.ts
@@ -1,13 +1,13 @@
templateDir: templates/typescript-backstage
templateDir: templates/typescript-backstage-server
files:
server/api.mustache:
api.mustache:
templateType: API
# For some reason, they check for destinationFilename differences. We have to change the ending to override the file.
destinationFilename: .server.ts
server/apis/index.mustache:
apis/index.mustache:
templateType: SupportingFiles
destinationFilename: apis/index.ts
server/index.mustache:
index.mustache:
templateType: SupportingFiles
destinationFilename: index.ts
@@ -0,0 +1,5 @@
//
// ******************************************************************
// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *
// ******************************************************************