core: ported config schema to d.t.s

This commit is contained in:
Patrik Oldsberg
2020-11-15 20:53:00 +01:00
parent 567ce7804a
commit 8782781f16
2 changed files with 68 additions and 50 deletions
+65
View File
@@ -0,0 +1,65 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Config {
/**
* Generic frontend configuration.
*/
app: {
/**
* The public absolute root URL that the frontend.
* @visibility frontend
*/
baseUrl: string;
/**
* The title of the app.
* @visibility frontend
*/
title?: string;
};
/**
* Generic backend configuration.
*/
backend: {
/**
* The public absolute root URL that the backend is reachable at.
* @visibility frontend
*/
baseUrl: string;
};
/**
* Configuration that provides information about the organization that the app is for.
*/
organization?: {
/**
* The name of the organization that the app belongs to.
* @visibility frontend
*/
name?: string;
};
homepage?: {
clocks?: {
/** @visibility frontend */
label: string;
/** @visibility frontend */
timezone: string;
}[];
};
}
+3 -50
View File
@@ -79,55 +79,8 @@
"@types/zen-observable": "^0.8.0"
},
"files": [
"dist"
"dist",
"config.d.ts"
],
"configSchema": {
"$schema": "https://backstage.io/schema/config-v1",
"title": "@backstage/core",
"type": "object",
"properties": {
"app": {
"type": "object",
"properties": {
"title": {
"type": "string",
"visibility": "frontend"
},
"baseUrl": {
"type": "string",
"visibility": "frontend"
}
},
"required": [
"title",
"baseUrl"
]
},
"backend": {
"type": "object",
"properties": {
"baseUrl": {
"type": "string",
"visibility": "frontend"
}
},
"required": [
"baseUrl"
]
},
"organization": {
"type": "object",
"properties": {
"name": {
"type": "string",
"visibility": "frontend"
}
}
}
},
"required": [
"app",
"backend"
]
}
"configSchema": "config.d.ts"
}