revert config packages changes
Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { AppConfig, CONFIG_KEY_PART_PATTERN } from '@backstage/config';
|
||||
import { AppConfig } from '@backstage/config';
|
||||
import { assertError } from '@backstage/errors';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { AsyncConfigSourceGenerator, ConfigSource } from './types';
|
||||
@@ -84,6 +84,9 @@ export class EnvConfigSource implements ConfigSource {
|
||||
|
||||
const ENV_PREFIX = 'APP_CONFIG_';
|
||||
|
||||
// Update the same pattern in config package if this is changed
|
||||
const CONFIG_KEY_PART_PATTERN = /^[a-z][a-z0-9]*(?:[-_:][a-z0-9]+)*$/i;
|
||||
|
||||
/**
|
||||
* Read runtime configuration from the environment.
|
||||
*
|
||||
|
||||
@@ -43,9 +43,6 @@ export type Config = {
|
||||
getOptionalStringArray(key: string): string[] | undefined;
|
||||
};
|
||||
|
||||
// @public
|
||||
export const CONFIG_KEY_PART_PATTERN: RegExp;
|
||||
|
||||
// @public
|
||||
export class ConfigReader implements Config {
|
||||
constructor(
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright 2025 The Backstage Authors
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The pattern that config keys must match.
|
||||
*
|
||||
* @remarks
|
||||
* keys must only contain the letters `a` through `z` and digits, in groups separated by
|
||||
* dashes or underscores and colon. Additionally, the very first character of each such group
|
||||
* must be a letter, not a digit
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const CONFIG_KEY_PART_PATTERN = /^[a-z][a-z0-9]*(?:[-_:][a-z0-9]+)*$/i;
|
||||
@@ -29,4 +29,3 @@ export type {
|
||||
export { readDurationFromConfig } from './readDurationFromConfig';
|
||||
export { ConfigReader } from './reader';
|
||||
export type { AppConfig, Config } from './types';
|
||||
export { CONFIG_KEY_PART_PATTERN } from './constants';
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
import { JsonObject, JsonValue } from '@backstage/types';
|
||||
import { AppConfig, Config } from './types';
|
||||
|
||||
import { CONFIG_KEY_PART_PATTERN } from './constants';
|
||||
// Update the same pattern in config-loader package if this is changed
|
||||
const CONFIG_KEY_PART_PATTERN = /^[a-z][a-z0-9]*(?:[-_:][a-z0-9]+)*$/i;
|
||||
|
||||
function isObject(value: JsonValue | undefined): value is JsonObject {
|
||||
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
||||
|
||||
Reference in New Issue
Block a user