config-loader: move EnvFunc up a level
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -22,10 +22,9 @@ import { EnvConfigSource } from './EnvConfigSource';
|
||||
import { FileConfigSource } from './FileConfigSource';
|
||||
import { MergedConfigSource } from './MergedConfigSource';
|
||||
import { RemoteConfigSource } from './RemoteConfigSource';
|
||||
import { ConfigSource } from './types';
|
||||
import { ConfigSource, EnvFunc } from './types';
|
||||
import { ObservableConfigProxy } from './ObservableConfigProxy';
|
||||
import { LoadConfigOptionsRemote } from '../loader';
|
||||
import { EnvFunc } from './transform';
|
||||
|
||||
export class ConfigSources {
|
||||
static parseArgs(
|
||||
|
||||
@@ -22,10 +22,10 @@ import {
|
||||
AsyncConfigSourceIterator,
|
||||
ConfigSource,
|
||||
ConfigSourceData,
|
||||
EnvFunc,
|
||||
ReadConfigDataOptions,
|
||||
} from './types';
|
||||
import { createConfigTransformer } from './transform';
|
||||
import { EnvFunc } from './transform';
|
||||
|
||||
export interface FileConfigSourceOptions {
|
||||
/**
|
||||
|
||||
@@ -20,10 +20,10 @@ import isEqual from 'lodash/isEqual';
|
||||
import fetch from 'node-fetch';
|
||||
import yaml from 'yaml';
|
||||
import { ConfigTransformer, createConfigTransformer } from './transform';
|
||||
import { EnvFunc } from './transform/types';
|
||||
import {
|
||||
AsyncConfigSourceIterator,
|
||||
ConfigSource,
|
||||
EnvFunc,
|
||||
ReadConfigDataOptions,
|
||||
} from './types';
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ export type { RemoteConfigSourceOptions } from './RemoteConfigSource';
|
||||
export { StaticConfigSource } from './StaticConfigSource';
|
||||
export type { StaticConfigSourceOptions } from './StaticConfigSource';
|
||||
export type {
|
||||
EnvFunc,
|
||||
ConfigSource,
|
||||
ConfigSourceData,
|
||||
ReadConfigDataOptions,
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
|
||||
import { JsonObject, JsonValue } from '@backstage/types';
|
||||
import { assertError } from '@backstage/errors';
|
||||
import { EnvFunc, TransformContext, TransformFunc } from './types';
|
||||
import { TransformContext, TransformFunc } from './types';
|
||||
import { isObject } from './utils';
|
||||
import { createSubstitutionTransform } from './substitution';
|
||||
import { createIncludeTransform } from './include';
|
||||
import { EnvFunc } from '../types';
|
||||
|
||||
/**
|
||||
* Applies a set of transforms to raw configuration data.
|
||||
|
||||
@@ -18,7 +18,8 @@ import yaml from 'yaml';
|
||||
import { extname, dirname, resolve as resolvePath } from 'path';
|
||||
import { JsonObject, JsonValue } from '@backstage/types';
|
||||
import { isObject } from './utils';
|
||||
import { TransformFunc, EnvFunc, ReadFileFunc } from './types';
|
||||
import { TransformFunc, ReadFileFunc } from './types';
|
||||
import { EnvFunc } from '../types';
|
||||
|
||||
// Parsers for each type of included file
|
||||
const includeFileParser: {
|
||||
|
||||
@@ -16,9 +16,4 @@
|
||||
|
||||
export { createConfigTransformer } from './apply';
|
||||
export type { ConfigTransformer } from './apply';
|
||||
export type {
|
||||
EnvFunc,
|
||||
ReadFileFunc,
|
||||
TransformContext,
|
||||
TransformFunc,
|
||||
} from './types';
|
||||
export type { ReadFileFunc, TransformContext, TransformFunc } from './types';
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
*/
|
||||
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { TransformFunc, EnvFunc } from './types';
|
||||
import { TransformFunc } from './types';
|
||||
import { EnvFunc } from '../types';
|
||||
|
||||
/**
|
||||
* A environment variable substitution transform that transforms e.g. 'token ${MY_TOKEN}'
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
import { JsonValue } from '@backstage/types';
|
||||
|
||||
export type EnvFunc = (name: string) => Promise<string | undefined>;
|
||||
|
||||
export type ReadFileFunc = (path: string) => Promise<string>;
|
||||
|
||||
export interface TransformContext {
|
||||
|
||||
@@ -39,3 +39,5 @@ export interface AsyncConfigSourceIterator
|
||||
export interface ConfigSource {
|
||||
readConfigData(options?: ReadConfigDataOptions): AsyncConfigSourceIterator;
|
||||
}
|
||||
|
||||
export type EnvFunc = (name: string) => Promise<string | undefined>;
|
||||
|
||||
Reference in New Issue
Block a user