diff --git a/core/package-lock.json b/core/package-lock.json index dbc5e95c1c..de1a26c15a 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13460,9 +13460,9 @@ } }, "typescript": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", - "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true }, "typescript-memoize": { diff --git a/core/package.json b/core/package.json index e85cc1bcda..da118057eb 100644 --- a/core/package.json +++ b/core/package.json @@ -224,7 +224,7 @@ "tslint-microsoft-contrib": "^6.2.0", "tslint-no-unused": "^0.2.0-alpha.1", "tslint-plugin-prettier": "^2.3.0", - "typescript": "^3.9.3" + "typescript": "^3.9.6" }, "scripts": { "add-version-files": "node ./build/src/bin/add-version-files.js", @@ -253,4 +253,4 @@ ] }, "gitHead": "b0647221a4d2ff06952bae58000b104215aed922" -} \ No newline at end of file +} diff --git a/core/src/config/config-context.ts b/core/src/config/config-context.ts index 28d4529dd0..95d8ce525f 100644 --- a/core/src/config/config-context.ts +++ b/core/src/config/config-context.ts @@ -10,7 +10,7 @@ import Joi from "@hapi/joi" import chalk from "chalk" import { isString, fromPairs, mapValues } from "lodash" import { PrimitiveMap, joiIdentifierMap, joiStringMap, joiPrimitive, DeepPrimitiveMap, joiVariables } from "./common" -import { Provider, ProviderConfig, ProviderMap } from "./provider" +import { Provider, GenericProviderConfig, ProviderMap } from "./provider" import { ConfigurationError } from "../exceptions" import { resolveTemplateString } from "../template-string" import { Garden } from "../garden" @@ -530,7 +530,7 @@ class ProviderContext extends ConfigContext { .example({ clusterHostname: "my-cluster.example.com" }) .meta({ keyPlaceholder: "" }) ) - public config: ProviderConfig + public config: GenericProviderConfig @schema( joiIdentifierMap( diff --git a/core/src/config/project.ts b/core/src/config/project.ts index a74269e9c6..ea3f818df8 100644 --- a/core/src/config/project.ts +++ b/core/src/config/project.ts @@ -29,7 +29,7 @@ import { findByName, getNames } from "../util/util" import { ConfigurationError, ParameterError, ValidationError } from "../exceptions" import { PrimitiveMap } from "./common" import { cloneDeep, omit, isPlainObject } from "lodash" -import { providerConfigBaseSchema, ProviderConfig } from "./provider" +import { providerConfigBaseSchema, GenericProviderConfig } from "./provider" import { DEFAULT_API_VERSION, DOCS_BASE_URL } from "../constants" import { defaultDotIgnoreFiles } from "../util/fs" import { pathExists, readFile } from "fs-extra" @@ -54,7 +54,7 @@ export interface ParsedEnvironment { export interface EnvironmentConfig { name: string defaultNamespace: string | null - providers?: ProviderConfig[] // further validated by each plugin + providers?: GenericProviderConfig[] // further validated by each plugin varfile?: string variables: DeepPrimitiveMap production?: boolean @@ -207,7 +207,7 @@ export interface ProjectConfig { exclude?: string[] } outputs?: OutputSpec[] - providers: ProviderConfig[] + providers: GenericProviderConfig[] sources?: SourceConfig[] varfile?: string variables: DeepPrimitiveMap @@ -574,7 +574,7 @@ export async function pickEnvironment({ ...envProviders, ] - const mergedProviders: { [name: string]: ProviderConfig } = {} + const mergedProviders: { [name: string]: GenericProviderConfig } = {} for (const provider of allProviders) { if (!!mergedProviders[provider.name]) { diff --git a/core/src/config/provider.ts b/core/src/config/provider.ts index c08217b2b2..9a0b018395 100644 --- a/core/src/config/provider.ts +++ b/core/src/config/provider.ts @@ -17,9 +17,12 @@ import { EnvironmentStatus } from "../types/plugin/provider/getEnvironmentStatus import { environmentStatusSchema } from "./status" import { PluginTools } from "../types/plugin/tools" -export interface ProviderConfig { +export interface BaseProviderConfig { name: string environments?: string[] +} + +export interface GenericProviderConfig extends BaseProviderConfig { [key: string]: any } @@ -48,7 +51,7 @@ export const providerConfigBaseSchema = () => .meta({ extendable: true }) .id("providerConfig") -export interface Provider { +export interface Provider { name: string dependencies: { [name: string]: Provider } environments?: string[] @@ -78,7 +81,7 @@ export const providerSchema = () => .id("provider") export interface ProviderMap { - [name: string]: Provider + [name: string]: Provider } export const defaultProviders = [{ name: "container" }] @@ -94,7 +97,7 @@ export const defaultProvider: Provider = { } export function providerFromConfig( - config: ProviderConfig, + config: GenericProviderConfig, dependencies: ProviderMap, moduleConfigs: ModuleConfig[], status: EnvironmentStatus, @@ -114,14 +117,14 @@ export function providerFromConfig( * Given a plugin and its provider config, return a list of dependency names based on declared dependencies, * as well as implicit dependencies based on template strings. */ -export async function getAllProviderDependencyNames(plugin: GardenPlugin, config: ProviderConfig) { +export async function getAllProviderDependencyNames(plugin: GardenPlugin, config: GenericProviderConfig) { return uniq([...(plugin.dependencies || []), ...(await getProviderTemplateReferences(config))]).sort() } /** * Given a provider config, return implicit dependencies based on template strings. */ -export async function getProviderTemplateReferences(config: ProviderConfig) { +export async function getProviderTemplateReferences(config: GenericProviderConfig) { const references = collectTemplateReferences(config) const deps: string[] = [] diff --git a/core/src/garden.ts b/core/src/garden.ts index 667e7a5b72..348ef740a3 100644 --- a/core/src/garden.ts +++ b/core/src/garden.ts @@ -61,7 +61,7 @@ import { } from "./util/fs" import { Provider, - ProviderConfig, + GenericProviderConfig, getAllProviderDependencyNames, defaultProvider, ProviderMap, @@ -137,7 +137,7 @@ export interface GardenParams { projectName: string projectRoot: string projectSources?: SourceConfig[] - providerConfigs: ProviderConfig[] + providerConfigs: GenericProviderConfig[] variables: DeepPrimitiveMap secrets: StringMap sessionId: string | null @@ -184,7 +184,7 @@ export class Garden { public readonly gardenDirPath: string public readonly artifactsPath: string public readonly opts: GardenOpts - private readonly providerConfigs: ProviderConfig[] + private readonly providerConfigs: GenericProviderConfig[] public readonly workingCopyId: string public readonly dotIgnoreFiles: string[] public readonly moduleIncludePatterns?: string[] @@ -1203,7 +1203,7 @@ export interface ConfigDump { environmentName: string // TODO: Remove this? allEnvironmentNames: string[] namespace: string - providers: (Omit | ProviderConfig)[] + providers: (Omit | GenericProviderConfig)[] variables: DeepPrimitiveMap moduleConfigs: ModuleConfig[] workflowConfigs: WorkflowConfig[] diff --git a/core/src/plugin-context.ts b/core/src/plugin-context.ts index cc1628a26e..37bc96788d 100644 --- a/core/src/plugin-context.ts +++ b/core/src/plugin-context.ts @@ -9,7 +9,7 @@ import { Garden } from "./garden" import { cloneDeep } from "lodash" import { projectNameSchema, projectSourcesSchema, environmentNameSchema } from "./config/project" -import { Provider, providerSchema, ProviderConfig } from "./config/provider" +import { Provider, providerSchema, GenericProviderConfig } from "./config/provider" import { deline } from "./util/string" import { joi, joiVariables, PrimitiveMap } from "./config/common" @@ -31,7 +31,7 @@ export interface CommandInfo { opts: PrimitiveMap } -export interface PluginContext extends WrappedFromGarden { +export interface PluginContext extends WrappedFromGarden { command?: CommandInfo provider: Provider } diff --git a/core/src/plugins.ts b/core/src/plugins.ts index ddceabd1e0..fe1da9eb53 100644 --- a/core/src/plugins.ts +++ b/core/src/plugins.ts @@ -14,7 +14,7 @@ import { pluginSchema, ModuleTypeMap, } from "./types/plugin/plugin" -import { ProviderConfig } from "./config/provider" +import { GenericProviderConfig } from "./config/provider" import { ConfigurationError, PluginError, RuntimeError } from "./exceptions" import { uniq, mapValues, fromPairs, flatten, keyBy, some } from "lodash" import { findByName, pushToKey, getNames } from "./util/util" @@ -23,7 +23,7 @@ import { validateSchema } from "./config/validation" import { LogEntry } from "./logger/log-entry" import { DependencyValidationGraph } from "./util/validate-dependencies" -export function loadPlugins(log: LogEntry, registeredPlugins: PluginMap, configs: ProviderConfig[]) { +export function loadPlugins(log: LogEntry, registeredPlugins: PluginMap, configs: GenericProviderConfig[]) { const loadedPlugins: PluginMap = {} const loadPlugin = (name: string) => { @@ -107,7 +107,7 @@ export function loadPlugins(log: LogEntry, registeredPlugins: PluginMap, configs /** * Returns the given provider configs in dependency order. */ -export function getDependencyOrder(configs: T[], registeredPlugins: PluginMap): T[] { +export function getDependencyOrder(configs: T[], registeredPlugins: PluginMap): T[] { const graph = new DependencyValidationGraph() for (const plugin of Object.values(registeredPlugins)) { @@ -141,7 +141,7 @@ export function getDependencyOrder(configs: T[], regis } // Takes a plugin and resolves it against its base plugin, if applicable -function resolvePlugin(plugin: GardenPlugin, loadedPlugins: PluginMap, configs: ProviderConfig[]): GardenPlugin { +function resolvePlugin(plugin: GardenPlugin, loadedPlugins: PluginMap, configs: GenericProviderConfig[]): GardenPlugin { if (!plugin.base) { return plugin } @@ -320,7 +320,7 @@ interface ModuleDefinitionMap { [moduleType: string]: { plugin: GardenPlugin; spec: ModuleTypeDefinition } } -function resolveModuleDefinitions(resolvedPlugins: PluginMap, configs: ProviderConfig[]): PluginMap { +function resolveModuleDefinitions(resolvedPlugins: PluginMap, configs: GenericProviderConfig[]): PluginMap { // Collect module type declarations const graph = new DependencyValidationGraph() const moduleDefinitionMap: { [moduleType: string]: { plugin: GardenPlugin; spec: ModuleTypeDefinition }[] } = {} diff --git a/core/src/plugins/conftest/conftest.ts b/core/src/plugins/conftest/conftest.ts index 7ed9193fc9..9c4d35ab04 100644 --- a/core/src/plugins/conftest/conftest.ts +++ b/core/src/plugins/conftest/conftest.ts @@ -8,7 +8,7 @@ import { resolve, relative } from "path" import { createGardenPlugin } from "../../types/plugin/plugin" -import { providerConfigBaseSchema, ProviderConfig, Provider } from "../../config/provider" +import { providerConfigBaseSchema, GenericProviderConfig, Provider } from "../../config/provider" import { joi, joiIdentifier, joiArray } from "../../config/common" import { dedent, naturalList } from "../../util/string" import { TestModuleParams } from "../../types/plugin/module/testModule" @@ -25,7 +25,7 @@ import { getK8sProvider } from "../openfaas/config" import { renderTemplates } from "../kubernetes/helm/common" import { LogEntry } from "../../logger/log-entry" -export interface ConftestProviderConfig extends ProviderConfig { +export interface ConftestProviderConfig extends GenericProviderConfig { policyPath: string namespace?: string testFailureThreshold: "deny" | "warn" | "none" diff --git a/core/src/plugins/container/container.ts b/core/src/plugins/container/container.ts index 4be835b95d..efb93ef49e 100644 --- a/core/src/plugins/container/container.ts +++ b/core/src/plugins/container/container.ts @@ -23,9 +23,9 @@ import { SuggestModulesParams, SuggestModulesResult } from "../../types/plugin/m import { listDirectory } from "../../util/fs" import { dedent } from "../../util/string" import { getModuleTypeUrl } from "../../docs/common" -import { Provider, ProviderConfig } from "../../config/provider" +import { Provider, GenericProviderConfig } from "../../config/provider" -export interface ContainerProviderConfig extends ProviderConfig {} +export interface ContainerProviderConfig extends GenericProviderConfig {} export type ContainerProvider = Provider export const containerModuleOutputsSchema = () => diff --git a/core/src/plugins/google/google-cloud-functions.ts b/core/src/plugins/google/google-cloud-functions.ts index be740c24e1..2fe02ac3f5 100644 --- a/core/src/plugins/google/google-cloud-functions.ts +++ b/core/src/plugins/google/google-cloud-functions.ts @@ -49,7 +49,7 @@ export type GcfServiceSpec = GcfModuleSpec export interface GcfModule extends GardenModule {} -function getGcfProject(service: Service, provider: Provider) { +function getGcfProject(service: Service, provider: Provider) { return service.spec.project || provider.config.defaultProject || null } diff --git a/core/src/plugins/hadolint/hadolint.ts b/core/src/plugins/hadolint/hadolint.ts index 467d609e40..48d31c98fe 100644 --- a/core/src/plugins/hadolint/hadolint.ts +++ b/core/src/plugins/hadolint/hadolint.ts @@ -10,10 +10,9 @@ import Bluebird from "bluebird" import { join, relative, resolve } from "path" import { pathExists, readFile } from "fs-extra" import { createGardenPlugin, GardenModule } from "../../sdk" -import { providerConfigBaseSchema, ProviderConfig, Provider } from "../../config/provider" +import { providerConfigBaseSchema, GenericProviderConfig, Provider } from "../../config/provider" import { joi } from "../../config/common" import { dedent, splitLines, naturalList } from "../../util/string" -import { TestModuleParams } from "../../types/plugin/module/testModule" import { STATIC_DIR } from "../../constants" import { padStart, padEnd } from "lodash" import chalk from "chalk" @@ -21,11 +20,12 @@ import { ConfigurationError } from "../../exceptions" import { containerHelpers } from "../container/helpers" import { baseBuildSpecSchema } from "../../config/module" import { getProviderUrl, getModuleTypeUrl, getGitHubUrl } from "../../docs/common" +import { TestModuleParams } from "../../types/plugin/module/testModule" const defaultConfigPath = join(STATIC_DIR, "hadolint", "default.hadolint.yaml") const configFilename = ".hadolint.yaml" -interface HadolintProviderConfig extends ProviderConfig { +interface HadolintProviderConfig extends GenericProviderConfig { autoInject: boolean testFailureThreshold: "error" | "warning" | "none" } diff --git a/core/src/plugins/kubernetes/config.ts b/core/src/plugins/kubernetes/config.ts index 73b84f5192..370ff941b6 100644 --- a/core/src/plugins/kubernetes/config.ts +++ b/core/src/plugins/kubernetes/config.ts @@ -9,7 +9,7 @@ import dedent = require("dedent") import { joiArray, joiIdentifier, joiProviderName, joi, joiStringMap } from "../../config/common" -import { Provider, providerConfigBaseSchema, ProviderConfig } from "../../config/provider" +import { Provider, providerConfigBaseSchema, GenericProviderConfig } from "../../config/provider" import { containerRegistryConfigSchema, ContainerRegistryConfig, @@ -87,7 +87,7 @@ export type ContainerBuildMode = "local-docker" | "cluster-docker" | "kaniko" export type DefaultDeploymentStrategy = "rolling" export type DeploymentStrategy = DefaultDeploymentStrategy | "blue-green" -export interface KubernetesConfig extends ProviderConfig { +export interface KubernetesConfig extends GenericProviderConfig { buildMode: ContainerBuildMode clusterDocker?: { enableBuildKit?: boolean diff --git a/core/src/plugins/openfaas/config.ts b/core/src/plugins/openfaas/config.ts index 2c5c90ad99..79338f8f70 100644 --- a/core/src/plugins/openfaas/config.ts +++ b/core/src/plugins/openfaas/config.ts @@ -17,7 +17,7 @@ import { Service } from "../../types/service" import { ExecModuleSpecBase, ExecTestSpec } from "../exec" import { KubernetesProvider } from "../kubernetes/config" import { CommonServiceSpec } from "../../config/service" -import { Provider, providerConfigBaseSchema, ProviderConfig, ProviderMap } from "../../config/provider" +import { Provider, providerConfigBaseSchema, GenericProviderConfig, ProviderMap } from "../../config/provider" import { union } from "lodash" import { ContainerModule } from "../container/config" import { ConfigureModuleParams, ConfigureModuleResult } from "../../types/plugin/module/configure" @@ -83,7 +83,7 @@ export interface OpenFaasModule extends GardenModule {} -export interface OpenFaasConfig extends ProviderConfig { +export interface OpenFaasConfig extends GenericProviderConfig { gatewayUrl: string hostname: string faasNetes: { diff --git a/core/src/plugins/terraform/terraform.ts b/core/src/plugins/terraform/terraform.ts index bca7383f7e..7c93aa349d 100644 --- a/core/src/plugins/terraform/terraform.ts +++ b/core/src/plugins/terraform/terraform.ts @@ -10,7 +10,7 @@ import { join } from "path" import { pathExists } from "fs-extra" import { createGardenPlugin } from "../../types/plugin/plugin" import { getEnvironmentStatus, prepareEnvironment } from "./init" -import { providerConfigBaseSchema, ProviderConfig, Provider } from "../../config/provider" +import { providerConfigBaseSchema, GenericProviderConfig, Provider } from "../../config/provider" import { joi, joiVariables } from "../../config/common" import { dedent } from "../../util/string" import { supportedVersions, defaultTerraformVersion, terraformCliSpecs } from "./cli" @@ -23,7 +23,7 @@ import { SuggestModulesParams, SuggestModulesResult } from "../../types/plugin/m import { listDirectory } from "../../util/fs" import { terraformCommands } from "./commands" -type TerraformProviderConfig = ProviderConfig & +type TerraformProviderConfig = GenericProviderConfig & TerraformBaseSpec & { initRoot?: string } diff --git a/core/src/sdk/index.ts b/core/src/sdk/index.ts index 946d63849a..0b4480ece4 100644 --- a/core/src/sdk/index.ts +++ b/core/src/sdk/index.ts @@ -8,4 +8,4 @@ export { createGardenPlugin } from "../types/plugin/plugin" export { GardenModule } from "../types/module" -export { ProviderConfig, Provider } from "../config/provider" +export { GenericProviderConfig, Provider } from "../config/provider" diff --git a/core/src/tasks/resolve-provider.ts b/core/src/tasks/resolve-provider.ts index 249159042d..a53200ac25 100644 --- a/core/src/tasks/resolve-provider.ts +++ b/core/src/tasks/resolve-provider.ts @@ -10,7 +10,7 @@ import stableStringify = require("json-stable-stringify") import chalk from "chalk" import { BaseTask, TaskParams, TaskType } from "./base" import { - ProviderConfig, + GenericProviderConfig, Provider, providerFromConfig, getProviderTemplateReferences, @@ -39,7 +39,7 @@ import { gardenEnv } from "../constants" interface Params extends TaskParams { plugin: GardenPlugin - config: ProviderConfig + config: GenericProviderConfig forceRefresh: boolean forceInit: boolean } @@ -64,7 +64,7 @@ export class ResolveProviderTask extends BaseTask { type: TaskType = "resolve-provider" concurrencyLimit = 20 - private config: ProviderConfig + private config: GenericProviderConfig private plugin: GardenPlugin private forceRefresh: boolean private forceInit: boolean @@ -155,8 +155,8 @@ export class ResolveProviderTask extends BaseTask { this.log.silly(`Validating ${providerName} config`) - const validateConfig = (config: ProviderConfig) => { - return validateWithPath({ + const validateConfig = (config: GenericProviderConfig) => { + return validateWithPath({ config: omit(config, "path"), schema: this.plugin.configSchema || joi.object(), path: this.garden.projectRoot, @@ -214,7 +214,7 @@ export class ResolveProviderTask extends BaseTask { this.log.silly(`Validating '${providerName}' config against '${base.name}' schema`) - resolvedConfig = validateWithPath({ + resolvedConfig = validateWithPath({ config: omit(resolvedConfig, "path"), schema: base.configSchema.unknown(true), path: this.garden.projectRoot, @@ -246,11 +246,11 @@ export class ResolveProviderTask extends BaseTask { }) } - private hashConfig(config: ProviderConfig) { + private hashConfig(config: GenericProviderConfig) { return hashString(stableStringify(config)) } - private async getCachedStatus(config: ProviderConfig): Promise { + private async getCachedStatus(config: GenericProviderConfig): Promise { const cachePath = this.getCachePath() this.log.silly(`Checking provider status cache for ${this.plugin.name} at ${cachePath}`) @@ -289,7 +289,7 @@ export class ResolveProviderTask extends BaseTask { return omit(cachedStatus, ["configHash", "resolvedAt"]) } - private async setCachedStatus(config: ProviderConfig, status: EnvironmentStatus) { + private async setCachedStatus(config: GenericProviderConfig, status: EnvironmentStatus) { const cachePath = this.getCachePath() this.log.silly(`Caching provider status for ${this.plugin.name} at ${cachePath}`) diff --git a/core/src/types/plugin/provider/configureProvider.ts b/core/src/types/plugin/provider/configureProvider.ts index deeb8ff97f..2ab7ea4a45 100644 --- a/core/src/types/plugin/provider/configureProvider.ts +++ b/core/src/types/plugin/provider/configureProvider.ts @@ -7,7 +7,7 @@ */ import { projectNameSchema, projectRootSchema } from "../../../config/project" -import { ProviderConfig, providerConfigBaseSchema, providerSchema, ProviderMap } from "../../../config/provider" +import { GenericProviderConfig, providerConfigBaseSchema, providerSchema, ProviderMap } from "../../../config/provider" import { logEntrySchema } from "../base" import { configStoreSchema, ConfigStore } from "../../../config-store" import { joiArray, joi, joiIdentifier, joiIdentifierMap } from "../../../config/common" @@ -18,7 +18,7 @@ import { LogEntry } from "../../../logger/log-entry" import { PluginTools } from "../tools" // Note: These are the only plugin handler params that don't inherit from PluginActionParamsBase -export interface ConfigureProviderParams extends ActionHandlerParamsBase { +export interface ConfigureProviderParams extends ActionHandlerParamsBase { config: T configStore: ConfigStore dependencies: ProviderMap @@ -31,7 +31,7 @@ export interface ConfigureProviderParams extends base?: ActionHandler, ConfigureProviderResult> } -export interface ConfigureProviderResult { +export interface ConfigureProviderResult { config: T moduleConfigs?: ModuleConfig[] } diff --git a/core/test/unit/src/config/provider.ts b/core/test/unit/src/config/provider.ts index bd9f75b0d2..19fcb334af 100644 --- a/core/test/unit/src/config/provider.ts +++ b/core/test/unit/src/config/provider.ts @@ -7,7 +7,7 @@ */ import { expect } from "chai" -import { ProviderConfig, getAllProviderDependencyNames } from "../../../../src/config/provider" +import { GenericProviderConfig, getAllProviderDependencyNames } from "../../../../src/config/provider" import { expectError } from "../../../helpers" import { createGardenPlugin } from "../../../../src/types/plugin/plugin" @@ -17,7 +17,7 @@ describe("getProviderDependencies", () => { }) it("should extract implicit provider dependencies from template strings", async () => { - const config: ProviderConfig = { + const config: GenericProviderConfig = { name: "my-provider", someKey: "${providers.other-provider.foo}", anotherKey: "foo-${providers.another-provider.bar}", @@ -26,7 +26,7 @@ describe("getProviderDependencies", () => { }) it("should ignore template strings that don't reference providers", async () => { - const config: ProviderConfig = { + const config: GenericProviderConfig = { name: "my-provider", someKey: "${providers.other-provider.foo}", anotherKey: "foo-${some.other.ref}", @@ -35,7 +35,7 @@ describe("getProviderDependencies", () => { }) it("should throw on provider-scoped template strings without a provider name", async () => { - const config: ProviderConfig = { + const config: GenericProviderConfig = { name: "my-provider", someKey: "${providers}", } diff --git a/core/test/unit/src/garden.ts b/core/test/unit/src/garden.ts index fc20a4ea7a..9781911ec8 100644 --- a/core/test/unit/src/garden.ts +++ b/core/test/unit/src/garden.ts @@ -1740,7 +1740,7 @@ describe("Garden", () => { const providers = keyBy(await garden.resolveProviders(garden.log), "name") expect(providers.test).to.exist - expect(providers.test.config.foo).to.equal("bar") + expect(providers.test.config["foo"]).to.equal("bar") }) it("should throw if a config doesn't match a plugin's configuration schema", async () => { @@ -1848,7 +1848,7 @@ describe("Garden", () => { const providerB = await garden.resolveProvider(garden.log, "test-b") - expect(providerB.config.foo).to.equal("bar") + expect(providerB.config["foo"]).to.equal("bar") }) it("should allow providers to reference outputs from a disabled provider", async () => { @@ -1891,7 +1891,7 @@ describe("Garden", () => { const providerB = await garden.resolveProvider(garden.log, "test-b") - expect(providerB.config.foo).to.equal("default") + expect(providerB.config["foo"]).to.equal("default") }) it("should allow providers to reference variables", async () => { @@ -1916,7 +1916,7 @@ describe("Garden", () => { const providerB = await garden.resolveProvider(garden.log, "test-a") - expect(providerB.config.foo).to.equal("bar") + expect(providerB.config["foo"]).to.equal("bar") }) it("should match a dependency to a plugin base", async () => { diff --git a/package-lock.json b/package-lock.json index 4c80513074..7e746688d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12311,9 +12311,9 @@ "dev": true }, "typescript": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", - "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true }, "typescript-formatter": { diff --git a/package.json b/package.json index 1d967822db..2b13c3042b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "tslint-microsoft-contrib": "^6.2.0", "tslint-no-focused-test": "^0.5.0", "tslint-no-unused": "^0.2.0-alpha.1", - "typescript": "^3.9.3", + "typescript": "^3.9.6", "typescript-formatter": "^7.2.2" }, "scripts": {