revert config packages changes

Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
Juan Pablo Garcia Ripa
2026-01-25 13:55:42 +01:00
parent 6f8636f3de
commit 5d49075e1f
5 changed files with 6 additions and 33 deletions
@@ -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.
*
-3
View File
@@ -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(
-27
View File
@@ -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;
-1
View File
@@ -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';
+2 -1
View File
@@ -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);