From a3b3298ffdb059d18e1002cb879dee315f64f01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Bou=C3=A7as?= Date: Wed, 14 Feb 2024 14:00:28 +0000 Subject: [PATCH] fix: use `configMutations` for deploy config API (#5517) * fix: use `configMutations` for deploy config API * chore: remove `console.log` --- .../src/plugins_core/deploy_config/index.ts | 47 +-- .../.netlify/deploy/v1/config.json | 21 -- .../fixtures/deploy_config/manifest.yml | 2 - .../fixtures/deploy_config/netlify.toml | 10 - .../fixtures/deploy_config/plugin.js | 7 - .../.netlify/deploy/v1/config.json | 21 -- .../fixtures/from_build_command/manifest.yml | 2 - .../fixtures/from_build_command/netlify.toml | 10 - .../fixtures/from_build_command/plugin.js | 7 - .../fixtures/malformed_config/manifest.yml | 2 - .../fixtures/malformed_config/netlify.toml | 10 - .../fixtures/malformed_config/plugin.js | 7 - .../.netlify/deploy/v1/config.json | 27 +- .../fixtures/readonly_properties/manifest.yml | 2 - .../fixtures/readonly_properties/netlify.toml | 11 - .../fixtures/readonly_properties/plugin.js | 7 - .../tests/deploy_config/snapshots/tests.js.md | 336 ++---------------- .../deploy_config/snapshots/tests.js.snap | Bin 1508 -> 1232 bytes 18 files changed, 29 insertions(+), 500 deletions(-) delete mode 100644 packages/build/tests/deploy_config/fixtures/deploy_config/manifest.yml delete mode 100644 packages/build/tests/deploy_config/fixtures/deploy_config/netlify.toml delete mode 100644 packages/build/tests/deploy_config/fixtures/deploy_config/plugin.js delete mode 100644 packages/build/tests/deploy_config/fixtures/from_build_command/manifest.yml delete mode 100644 packages/build/tests/deploy_config/fixtures/from_build_command/netlify.toml delete mode 100644 packages/build/tests/deploy_config/fixtures/from_build_command/plugin.js delete mode 100644 packages/build/tests/deploy_config/fixtures/malformed_config/manifest.yml delete mode 100644 packages/build/tests/deploy_config/fixtures/malformed_config/netlify.toml delete mode 100644 packages/build/tests/deploy_config/fixtures/malformed_config/plugin.js delete mode 100644 packages/build/tests/deploy_config/fixtures/readonly_properties/manifest.yml delete mode 100644 packages/build/tests/deploy_config/fixtures/readonly_properties/netlify.toml delete mode 100644 packages/build/tests/deploy_config/fixtures/readonly_properties/plugin.js diff --git a/packages/build/src/plugins_core/deploy_config/index.ts b/packages/build/src/plugins_core/deploy_config/index.ts index b7281d118b..515ba224bb 100644 --- a/packages/build/src/plugins_core/deploy_config/index.ts +++ b/packages/build/src/plugins_core/deploy_config/index.ts @@ -1,9 +1,8 @@ import { promises as fs } from 'fs' import { resolve } from 'path' -import { mergeConfigs } from '@netlify/config' - import type { NetlifyConfig } from '../../index.js' +import { getConfigMutations } from '../../plugins/child/diff.js' import { CoreStep, CoreStepFunction } from '../types.js' import { filterConfig } from './util.js' @@ -11,27 +10,10 @@ import { filterConfig } from './util.js' // The properties that can be set using this API. Each element represents a // path using dot-notation — e.g. `["build", "functions"]` represents the // `build.functions` property. -const ALLOWED_PROPERTIES = [ - ['build', 'edge_functions'], - ['build', 'functions'], - ['build', 'publish'], - ['functions', '*'], - ['functions', '*', '*'], - ['headers'], - ['images', 'remote_images'], - ['redirects'], -] - -// For array properties, any values set in this API will be merged with the -// main configuration file in such a way that user-defined values always take -// precedence. The exception are these properties that let frameworks set -// values that should be evaluated before any user-defined values. They use -// a special notation where `headers!` represents "forced headers", etc. -const OVERRIDE_PROPERTIES = new Set(['headers!', 'redirects!']) +const ALLOWED_PROPERTIES = [['images', 'remote_images']] const coreStep: CoreStepFunction = async function ({ buildDir, - netlifyConfig, systemLog = () => { // no-op }, @@ -55,33 +37,14 @@ const coreStep: CoreStepFunction = async function ({ throw new Error('An error occured while processing the platform configurarion defined by your framework') } - const configOverrides: Partial = {} - - for (const key in config) { - // If the key uses the special notation for defining mutations that should - // take precedence over user-defined properties, extract the canonical - // property, set it on a different object, and delete it from the main one. - if (OVERRIDE_PROPERTIES.has(key)) { - const canonicalKey = key.slice(0, -1) - - configOverrides[canonicalKey] = config[key] - - delete config[key] - } - } - // Filtering out any properties that can't be mutated using this API. config = filterConfig(config, [], ALLOWED_PROPERTIES, systemLog) - // Merging the different configuration sources. The order here is important. - // Leftmost elements of the array take precedence. - const newConfig = mergeConfigs([config, netlifyConfig, configOverrides], { concatenateArrays: true }) + const configMutations = getConfigMutations({}, config, applyDeployConfig.event) - for (const key in newConfig) { - netlifyConfig[key] = newConfig[key] + return { + configMutations, } - - return {} } export const applyDeployConfig: CoreStep = { diff --git a/packages/build/tests/deploy_config/fixtures/deploy_config/.netlify/deploy/v1/config.json b/packages/build/tests/deploy_config/fixtures/deploy_config/.netlify/deploy/v1/config.json index 2d28013c52..a9a0421ba9 100644 --- a/packages/build/tests/deploy_config/fixtures/deploy_config/.netlify/deploy/v1/config.json +++ b/packages/build/tests/deploy_config/fixtures/deploy_config/.netlify/deploy/v1/config.json @@ -1,25 +1,4 @@ { - "functions": { - "my_framework*": { - "included_files": ["files/**"] - } - }, - "redirects": [ - { - "from": "/$netlify-snapshot-preserve/from-config", - "to": "/$netlify-snapshot-preserve/to-config", - "status": 418, - "force": true - } - ], - "redirects!": [ - { - "from": "/$netlify-snapshot-preserve/from-config-override", - "to": "/$netlify-snapshot-preserve/to-config-override", - "status": 418, - "force": true - } - ], "images": { "remote_images": ["domain1.netlify", "domain2.netlify"] } diff --git a/packages/build/tests/deploy_config/fixtures/deploy_config/manifest.yml b/packages/build/tests/deploy_config/fixtures/deploy_config/manifest.yml deleted file mode 100644 index a3512f0259..0000000000 --- a/packages/build/tests/deploy_config/fixtures/deploy_config/manifest.yml +++ /dev/null @@ -1,2 +0,0 @@ -name: test -inputs: [] diff --git a/packages/build/tests/deploy_config/fixtures/deploy_config/netlify.toml b/packages/build/tests/deploy_config/fixtures/deploy_config/netlify.toml deleted file mode 100644 index bf0913b244..0000000000 --- a/packages/build/tests/deploy_config/fixtures/deploy_config/netlify.toml +++ /dev/null @@ -1,10 +0,0 @@ -[build] -command = "echo Hello" - -[[plugins]] -package = "./plugin.js" - -[[redirects]] -from = "/$netlify-snapshot-preserve/from" -status = 200 -to = "/$netlify-snapshot-preserve/to" diff --git a/packages/build/tests/deploy_config/fixtures/deploy_config/plugin.js b/packages/build/tests/deploy_config/fixtures/deploy_config/plugin.js deleted file mode 100644 index 2953efb740..0000000000 --- a/packages/build/tests/deploy_config/fixtures/deploy_config/plugin.js +++ /dev/null @@ -1,7 +0,0 @@ -export const onPreBuild = function ({ netlifyConfig }) { - console.log('onPreBuild:', netlifyConfig) -} - -export const onBuild = function ({ netlifyConfig }) { - console.log('onBuild:', netlifyConfig) -} \ No newline at end of file diff --git a/packages/build/tests/deploy_config/fixtures/from_build_command/.netlify/deploy/v1/config.json b/packages/build/tests/deploy_config/fixtures/from_build_command/.netlify/deploy/v1/config.json index 2d28013c52..a9a0421ba9 100644 --- a/packages/build/tests/deploy_config/fixtures/from_build_command/.netlify/deploy/v1/config.json +++ b/packages/build/tests/deploy_config/fixtures/from_build_command/.netlify/deploy/v1/config.json @@ -1,25 +1,4 @@ { - "functions": { - "my_framework*": { - "included_files": ["files/**"] - } - }, - "redirects": [ - { - "from": "/$netlify-snapshot-preserve/from-config", - "to": "/$netlify-snapshot-preserve/to-config", - "status": 418, - "force": true - } - ], - "redirects!": [ - { - "from": "/$netlify-snapshot-preserve/from-config-override", - "to": "/$netlify-snapshot-preserve/to-config-override", - "status": 418, - "force": true - } - ], "images": { "remote_images": ["domain1.netlify", "domain2.netlify"] } diff --git a/packages/build/tests/deploy_config/fixtures/from_build_command/manifest.yml b/packages/build/tests/deploy_config/fixtures/from_build_command/manifest.yml deleted file mode 100644 index a3512f0259..0000000000 --- a/packages/build/tests/deploy_config/fixtures/from_build_command/manifest.yml +++ /dev/null @@ -1,2 +0,0 @@ -name: test -inputs: [] diff --git a/packages/build/tests/deploy_config/fixtures/from_build_command/netlify.toml b/packages/build/tests/deploy_config/fixtures/from_build_command/netlify.toml deleted file mode 100644 index d8f5130f39..0000000000 --- a/packages/build/tests/deploy_config/fixtures/from_build_command/netlify.toml +++ /dev/null @@ -1,10 +0,0 @@ -[build] -command = "node write_config.mjs" - -[[plugins]] -package = "./plugin.js" - -[[redirects]] -from = "/$netlify-snapshot-preserve/from" -status = 200 -to = "/$netlify-snapshot-preserve/to" diff --git a/packages/build/tests/deploy_config/fixtures/from_build_command/plugin.js b/packages/build/tests/deploy_config/fixtures/from_build_command/plugin.js deleted file mode 100644 index 2953efb740..0000000000 --- a/packages/build/tests/deploy_config/fixtures/from_build_command/plugin.js +++ /dev/null @@ -1,7 +0,0 @@ -export const onPreBuild = function ({ netlifyConfig }) { - console.log('onPreBuild:', netlifyConfig) -} - -export const onBuild = function ({ netlifyConfig }) { - console.log('onBuild:', netlifyConfig) -} \ No newline at end of file diff --git a/packages/build/tests/deploy_config/fixtures/malformed_config/manifest.yml b/packages/build/tests/deploy_config/fixtures/malformed_config/manifest.yml deleted file mode 100644 index a3512f0259..0000000000 --- a/packages/build/tests/deploy_config/fixtures/malformed_config/manifest.yml +++ /dev/null @@ -1,2 +0,0 @@ -name: test -inputs: [] diff --git a/packages/build/tests/deploy_config/fixtures/malformed_config/netlify.toml b/packages/build/tests/deploy_config/fixtures/malformed_config/netlify.toml deleted file mode 100644 index bf0913b244..0000000000 --- a/packages/build/tests/deploy_config/fixtures/malformed_config/netlify.toml +++ /dev/null @@ -1,10 +0,0 @@ -[build] -command = "echo Hello" - -[[plugins]] -package = "./plugin.js" - -[[redirects]] -from = "/$netlify-snapshot-preserve/from" -status = 200 -to = "/$netlify-snapshot-preserve/to" diff --git a/packages/build/tests/deploy_config/fixtures/malformed_config/plugin.js b/packages/build/tests/deploy_config/fixtures/malformed_config/plugin.js deleted file mode 100644 index 2953efb740..0000000000 --- a/packages/build/tests/deploy_config/fixtures/malformed_config/plugin.js +++ /dev/null @@ -1,7 +0,0 @@ -export const onPreBuild = function ({ netlifyConfig }) { - console.log('onPreBuild:', netlifyConfig) -} - -export const onBuild = function ({ netlifyConfig }) { - console.log('onBuild:', netlifyConfig) -} \ No newline at end of file diff --git a/packages/build/tests/deploy_config/fixtures/readonly_properties/.netlify/deploy/v1/config.json b/packages/build/tests/deploy_config/fixtures/readonly_properties/.netlify/deploy/v1/config.json index 46b0dc29fe..81a2292085 100644 --- a/packages/build/tests/deploy_config/fixtures/readonly_properties/.netlify/deploy/v1/config.json +++ b/packages/build/tests/deploy_config/fixtures/readonly_properties/.netlify/deploy/v1/config.json @@ -1,31 +1,10 @@ { - "build": { - "command": "echo Goodbye", - "publish": "publish/api", - "processing": { - "css": "!important" - } - }, "plugins": [ { "package": "@netlify/imaginary-plugin" } ], - "redirects": [ - { - "from": "/$netlify-snapshot-preserve/from-config", - "to": "/$netlify-snapshot-preserve/to-config", - "status": 418, - "force": true - } - ], - "redirects!": [ - { - "from": "/$netlify-snapshot-preserve/from-config-override", - "to": "/$netlify-snapshot-preserve/to-config-override", - "status": 418, - "force": true - } - ], - "unknown_property": 42 + "images": { + "remote_images": ["domain1.netlify", "domain2.netlify"] + } } \ No newline at end of file diff --git a/packages/build/tests/deploy_config/fixtures/readonly_properties/manifest.yml b/packages/build/tests/deploy_config/fixtures/readonly_properties/manifest.yml deleted file mode 100644 index a3512f0259..0000000000 --- a/packages/build/tests/deploy_config/fixtures/readonly_properties/manifest.yml +++ /dev/null @@ -1,2 +0,0 @@ -name: test -inputs: [] diff --git a/packages/build/tests/deploy_config/fixtures/readonly_properties/netlify.toml b/packages/build/tests/deploy_config/fixtures/readonly_properties/netlify.toml deleted file mode 100644 index 2129ea55f5..0000000000 --- a/packages/build/tests/deploy_config/fixtures/readonly_properties/netlify.toml +++ /dev/null @@ -1,11 +0,0 @@ -[build] -command = "echo Hello" -publish = "publish/user" - -[[plugins]] -package = "./plugin.js" - -[[redirects]] -from = "/$netlify-snapshot-preserve/from" -status = 200 -to = "/$netlify-snapshot-preserve/to" diff --git a/packages/build/tests/deploy_config/fixtures/readonly_properties/plugin.js b/packages/build/tests/deploy_config/fixtures/readonly_properties/plugin.js deleted file mode 100644 index 2953efb740..0000000000 --- a/packages/build/tests/deploy_config/fixtures/readonly_properties/plugin.js +++ /dev/null @@ -1,7 +0,0 @@ -export const onPreBuild = function ({ netlifyConfig }) { - console.log('onPreBuild:', netlifyConfig) -} - -export const onBuild = function ({ netlifyConfig }) { - console.log('onBuild:', netlifyConfig) -} \ No newline at end of file diff --git a/packages/build/tests/deploy_config/snapshots/tests.js.md b/packages/build/tests/deploy_config/snapshots/tests.js.md index 3fa5a6cae7..52d44402f1 100644 --- a/packages/build/tests/deploy_config/snapshots/tests.js.md +++ b/packages/build/tests/deploy_config/snapshots/tests.js.md @@ -26,122 +26,23 @@ Generated by [AVA](https://avajs.dev). packages/build/tests/deploy_config/fixtures/readonly_properties␊ ␊ > Config file␊ - packages/build/tests/deploy_config/fixtures/readonly_properties/netlify.toml␊ + No config file was defined: using default values.␊ ␊ > Resolved config␊ build:␊ - command: echo Hello␊ - commandOrigin: config␊ - publish: packages/build/tests/deploy_config/fixtures/readonly_properties/publish/user␊ - publishOrigin: config␊ - plugins:␊ - - inputs: {}␊ - origin: config␊ - package: ./plugin.js␊ - redirects:␊ - - from:/$netlify-snapshot-preserve/from␊ - status: 200␊ - to:/$netlify-snapshot-preserve/to␊ - redirectsOrigin: config␊ + publish: packages/build/tests/deploy_config/fixtures/readonly_properties␊ + publishOrigin: default␊ ␊ > Context␊ production␊ - ␊ - > Loading plugins␊ - - ./plugin.js@1.0.0 from netlify.toml␊ - ␊ - ./plugin.js (onPreBuild event) ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - onPreBuild: {␊ - redirectsOrigin: 'config',␊ - functions: { '*': {} },␊ - plugins: [ { package: './plugin.js', origin: 'config', inputs: {} } ],␊ - build: {␊ - environment: {},␊ - publish: 'packages/build/tests/deploy_config/fixtures/readonly_properties/publish/user',␊ - publishOrigin: 'config',␊ - processing: { css: {}, html: {}, images: {}, js: {} },␊ - services: {},␊ - command: 'echo Hello',␊ - commandOrigin: 'config'␊ - },␊ - headers: [],␊ - redirects: [␊ - {␊ - from: /$netlify-snapshot-preserve/from',␊ - query: {},␊ - to: /$netlify-snapshot-preserve/to',␊ - status: 200,␊ - force: false,␊ - conditions: {},␊ - headers: {}␊ - }␊ - ]␊ - }␊ - ␊ - (./plugin.js onPreBuild completed in 1ms)␊ - Build step duration: ./plugin.js onPreBuild completed in 1ms␊ - ␊ - build.command from netlify.toml ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - $ echo Hello␊ - Hello␊ - ␊ - (build.command completed in 1ms)␊ - Build step duration: build.command completed in 1ms␊ - Discarding property that is not supported by the Deploy Configuration API: build.command␊ - Loading property from Deploy Configuration API: build.publish␊ - Discarding property that is not supported by the Deploy Configuration API: build.processing␊ Discarding property that is not supported by the Deploy Configuration API: plugins␊ - Loading property from Deploy Configuration API: redirects␊ - Discarding property that is not supported by the Deploy Configuration API: unknown_property␊ - ␊ - ./plugin.js (onBuild event) ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - onBuild: {␊ - redirectsOrigin: 'config',␊ - functions: { '*': {} },␊ - plugins: [ { package: './plugin.js', origin: 'config', inputs: {} } ],␊ - build: {␊ - publish: 'packages/build/tests/deploy_config/fixtures/readonly_properties/publish/user',␊ - environment: {},␊ - publishOrigin: 'config',␊ - processing: { css: {}, html: {}, images: {}, js: {} },␊ - services: {},␊ - command: 'echo Hello',␊ - commandOrigin: 'config'␊ - },␊ - headers: [],␊ - redirects: [␊ - {␊ - from: /$netlify-snapshot-preserve/from-config-override',␊ - to: /$netlify-snapshot-preserve/to-config-override',␊ - status: 418,␊ - force: true␊ - },␊ - {␊ - from: /$netlify-snapshot-preserve/from',␊ - query: {},␊ - to: /$netlify-snapshot-preserve/to',␊ - status: 200,␊ - force: false,␊ - conditions: {},␊ - headers: {}␊ - },␊ - {␊ - from: /$netlify-snapshot-preserve/from-config',␊ - to: /$netlify-snapshot-preserve/to-config',␊ - status: 418,␊ - force: true␊ - }␊ - ]␊ - }␊ + Loading property from Deploy Configuration API: images.remote_images␊ + Netlify configuration property "images" value changed to { remote_images: [ 'domain1.netlify', 'domain2.netlify' ] }.␊ ␊ - (./plugin.js onBuild completed in 1ms)␊ - Build step duration: ./plugin.js onBuild completed in 1ms␊ + > Updated config␊ + build:␊ + publish: packages/build/tests/deploy_config/fixtures/readonly_properties␊ + publishOrigin: default␊ ␊ Netlify Build Complete ␊ ────────────────────────────────────────────────────────────────␊ @@ -171,119 +72,22 @@ Generated by [AVA](https://avajs.dev). packages/build/tests/deploy_config/fixtures/from_build_command␊ ␊ > Config file␊ - packages/build/tests/deploy_config/fixtures/from_build_command/netlify.toml␊ + No config file was defined: using default values.␊ ␊ > Resolved config␊ build:␊ - command: node write_config.mjs␊ - commandOrigin: config␊ publish: packages/build/tests/deploy_config/fixtures/from_build_command␊ publishOrigin: default␊ - plugins:␊ - - inputs: {}␊ - origin: config␊ - package: ./plugin.js␊ - redirects:␊ - - from:/$netlify-snapshot-preserve/from␊ - status: 200␊ - to:/$netlify-snapshot-preserve/to␊ - redirectsOrigin: config␊ ␊ > Context␊ production␊ - ␊ - > Loading plugins␊ - - ./plugin.js@1.0.0 from netlify.toml␊ - ␊ - ./plugin.js (onPreBuild event) ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - onPreBuild: {␊ - redirectsOrigin: 'config',␊ - functions: { '*': {} },␊ - plugins: [ { package: './plugin.js', origin: 'config', inputs: {} } ],␊ - build: {␊ - environment: {},␊ - publish: 'packages/build/tests/deploy_config/fixtures/from_build_command',␊ - publishOrigin: 'default',␊ - processing: { css: {}, html: {}, images: {}, js: {} },␊ - services: {},␊ - command: 'node write_config.mjs',␊ - commandOrigin: 'config'␊ - },␊ - headers: [],␊ - redirects: [␊ - {␊ - from: /$netlify-snapshot-preserve/from',␊ - query: {},␊ - to: /$netlify-snapshot-preserve/to',␊ - status: 200,␊ - force: false,␊ - conditions: {},␊ - headers: {}␊ - }␊ - ]␊ - }␊ - ␊ - (./plugin.js onPreBuild completed in 1ms)␊ - Build step duration: ./plugin.js onPreBuild completed in 1ms␊ - ␊ - build.command from netlify.toml ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - $ node write_config.mjs␊ - ␊ - (build.command completed in 1ms)␊ - Build step duration: build.command completed in 1ms␊ - Loading property from Deploy Configuration API: functions.my_framework*.included_files␊ - Loading property from Deploy Configuration API: redirects␊ Loading property from Deploy Configuration API: images.remote_images␊ + Netlify configuration property "images" value changed to { remote_images: [ 'domain1.netlify', 'domain2.netlify' ] }.␊ ␊ - ./plugin.js (onBuild event) ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - onBuild: {␊ - redirectsOrigin: 'config',␊ - functions: { 'my_framework*': { included_files: [Array] }, '*': {} },␊ - plugins: [ { package: './plugin.js', origin: 'config', inputs: {} } ],␊ - build: {␊ - environment: {},␊ - publish: 'packages/build/tests/deploy_config/fixtures/from_build_command',␊ - publishOrigin: 'default',␊ - processing: { css: {}, html: {}, images: {}, js: {} },␊ - services: {},␊ - command: 'node write_config.mjs',␊ - commandOrigin: 'config'␊ - },␊ - headers: [],␊ - redirects: [␊ - {␊ - from: /$netlify-snapshot-preserve/from-config-override',␊ - to: /$netlify-snapshot-preserve/to-config-override',␊ - status: 418,␊ - force: true␊ - },␊ - {␊ - from: /$netlify-snapshot-preserve/from',␊ - query: {},␊ - to: /$netlify-snapshot-preserve/to',␊ - status: 200,␊ - force: false,␊ - conditions: {},␊ - headers: {}␊ - },␊ - {␊ - from: /$netlify-snapshot-preserve/from-config',␊ - to: /$netlify-snapshot-preserve/to-config',␊ - status: 418,␊ - force: true␊ - }␊ - ],␊ - images: { remote_images: [ 'domain1.netlify', 'domain2.netlify' ] }␊ - }␊ - ␊ - (./plugin.js onBuild completed in 1ms)␊ - Build step duration: ./plugin.js onBuild completed in 1ms␊ + > Updated config␊ + build:␊ + publish: packages/build/tests/deploy_config/fixtures/from_build_command␊ + publishOrigin: default␊ ␊ Netlify Build Complete ␊ ────────────────────────────────────────────────────────────────␊ @@ -313,120 +117,22 @@ Generated by [AVA](https://avajs.dev). packages/build/tests/deploy_config/fixtures/deploy_config␊ ␊ > Config file␊ - packages/build/tests/deploy_config/fixtures/deploy_config/netlify.toml␊ + No config file was defined: using default values.␊ ␊ > Resolved config␊ build:␊ - command: echo Hello␊ - commandOrigin: config␊ publish: packages/build/tests/deploy_config/fixtures/deploy_config␊ publishOrigin: default␊ - plugins:␊ - - inputs: {}␊ - origin: config␊ - package: ./plugin.js␊ - redirects:␊ - - from:/$netlify-snapshot-preserve/from␊ - status: 200␊ - to:/$netlify-snapshot-preserve/to␊ - redirectsOrigin: config␊ ␊ > Context␊ production␊ - ␊ - > Loading plugins␊ - - ./plugin.js@1.0.0 from netlify.toml␊ - ␊ - ./plugin.js (onPreBuild event) ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - onPreBuild: {␊ - redirectsOrigin: 'config',␊ - functions: { '*': {} },␊ - plugins: [ { package: './plugin.js', origin: 'config', inputs: {} } ],␊ - build: {␊ - environment: {},␊ - publish: 'packages/build/tests/deploy_config/fixtures/deploy_config',␊ - publishOrigin: 'default',␊ - processing: { css: {}, html: {}, images: {}, js: {} },␊ - services: {},␊ - command: 'echo Hello',␊ - commandOrigin: 'config'␊ - },␊ - headers: [],␊ - redirects: [␊ - {␊ - from: /$netlify-snapshot-preserve/from',␊ - query: {},␊ - to: /$netlify-snapshot-preserve/to',␊ - status: 200,␊ - force: false,␊ - conditions: {},␊ - headers: {}␊ - }␊ - ]␊ - }␊ - ␊ - (./plugin.js onPreBuild completed in 1ms)␊ - Build step duration: ./plugin.js onPreBuild completed in 1ms␊ - ␊ - build.command from netlify.toml ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - $ echo Hello␊ - Hello␊ - ␊ - (build.command completed in 1ms)␊ - Build step duration: build.command completed in 1ms␊ - Loading property from Deploy Configuration API: functions.my_framework*.included_files␊ - Loading property from Deploy Configuration API: redirects␊ Loading property from Deploy Configuration API: images.remote_images␊ + Netlify configuration property "images" value changed to { remote_images: [ 'domain1.netlify', 'domain2.netlify' ] }.␊ ␊ - ./plugin.js (onBuild event) ␊ - ────────────────────────────────────────────────────────────────␊ - ␊ - onBuild: {␊ - redirectsOrigin: 'config',␊ - functions: { 'my_framework*': { included_files: [Array] }, '*': {} },␊ - plugins: [ { package: './plugin.js', origin: 'config', inputs: {} } ],␊ - build: {␊ - environment: {},␊ - publish: 'packages/build/tests/deploy_config/fixtures/deploy_config',␊ - publishOrigin: 'default',␊ - processing: { css: {}, html: {}, images: {}, js: {} },␊ - services: {},␊ - command: 'echo Hello',␊ - commandOrigin: 'config'␊ - },␊ - headers: [],␊ - redirects: [␊ - {␊ - from: /$netlify-snapshot-preserve/from-config-override',␊ - to: /$netlify-snapshot-preserve/to-config-override',␊ - status: 418,␊ - force: true␊ - },␊ - {␊ - from: /$netlify-snapshot-preserve/from',␊ - query: {},␊ - to: /$netlify-snapshot-preserve/to',␊ - status: 200,␊ - force: false,␊ - conditions: {},␊ - headers: {}␊ - },␊ - {␊ - from: /$netlify-snapshot-preserve/from-config',␊ - to: /$netlify-snapshot-preserve/to-config',␊ - status: 418,␊ - force: true␊ - }␊ - ],␊ - images: { remote_images: [ 'domain1.netlify', 'domain2.netlify' ] }␊ - }␊ - ␊ - (./plugin.js onBuild completed in 1ms)␊ - Build step duration: ./plugin.js onBuild completed in 1ms␊ + > Updated config␊ + build:␊ + publish: packages/build/tests/deploy_config/fixtures/deploy_config␊ + publishOrigin: default␊ ␊ Netlify Build Complete ␊ ────────────────────────────────────────────────────────────────␊ diff --git a/packages/build/tests/deploy_config/snapshots/tests.js.snap b/packages/build/tests/deploy_config/snapshots/tests.js.snap index b7e132d711940072a3dd7451d4885d321ac1432f..abb03f45ffcd82d013721b0fa9fffdbca30b42e1 100644 GIT binary patch literal 1232 zcmV;>1TXtRRzV*gO*+J^Fp%U9JoK4K@_^Z z3^;Wah#!jx00000000B+Six@FMi6ydxB+-*(LWdj2Iv&BWar33k=Aa}0&Zd$NP!|S zoE15gHX*sp?ozQ}2xx(#U(jB9OK<(H{y}d&c6Pa>NJ&=gxUSVif{@!v5xsaM7@0$sP0~?ORq>#*bfzOY=397_-hk~{J#Zsh8?09PS z+?ALLji=>Z-JoG>eeLpYx$JIHV~*F$gu z6Pu~WIZ?)KCaO(M`y$N~B&K_JsA;>6K9ms(W5Jt~BNlxylG&xltt`Uz*}n zGgW0YqAdC$HFF;^g8^nJS)=UxmD`kM(Y(TJ{?SsH-_{CqOA2GS=G3k`b;(*KfmsmU zs_M%^Ag?ShYc04AsB0;>K`A)?7A2)^rm9%1QCh}-DzYPq*2hzzOp!3eLSi-NCQ32^ z91$%nc=Oo&wWSL`uXW*;bfGo8N|MkHY*p1@7QVF*{8xCcHQ)v{V88x9Ne`uXNi+{A zrI5g5%kyQLX6ns0BE24`T$u)(C;gA_v`GK&kJhArJEZS2w1TWZ6WJW?zqzlTL$|9% zn!HvF+$l5w42J@~#v~EV@rsS+dFq;pxRCGatd#NXP{Za0B@E6dUfB&|KBgM40J^=> zzWYqs;wckUdo!vN^tK#EJ5}rMTKTV)M0A?dDMV3-7%$iQSfBZLZAiuMy zg?!gT)ojUHWM#G+DjR19hB{5kU)5R2{C=jUU{K{#IrGrXwRysy5{2JcL=_b}G-qvx z$ReVCg4O~w?MQfH&CgwL+0KO5wWfO}z>5Oqcp9JW&85~_)V7Vru7>E%E~JddEKyjE z(MBR()l2=HdOwbk%=N^Z&^e{qjE!Er)@u;!MXb7h&Ax%x?0*0-0ZAahApig@5@0a^ literal 1508 zcmVlfHm*EX~0G@(N=5N=#wv)!Sow)H>k!8=!IdkUxd}sV= z^Ew%%EIJau|Amss6kqN>U?_kx30WaSiNG<8JB+4d$T`cAOM-$38s=ier1J*5M>tN~0EeluOYMv~%;c7!oQT5+T3mY2VD62|-e%@*$x^ zx_tHSxDnPU^HUzHKr-6k3Zr>`Kmt=Rpu3gl!(#Nap^fly+R<-;>R>kT5?|`W9;1&rS_HylmAALI0Cy&5Rv9wS`z`DKR$EOb1vNg`*#xaSEuBl}bDOGq=t-3t{elC!YC-#|QJy%+?O14(%-owedr{>f963Ze;xgG}5G?6{DaLtOAsZ_z-q^Q42oq)*p*eHJCI zKM3sB+nIe2_L^R~pwG`23LX#^2iT6^YsU3!ZeX~$~suw&$$#MrucA3amF?5m#~d^*)v-H$&g{qoK?{kJ(rr;$|) zczPiRpK%>o;x2O5MWo4s+;{UA0MF}!pnFXZT+q4a3zb~em%42V_iM6jWtxt%9dHy1 z7$8y@B1JVj>4Ae%t;UjBGHd6b2ATEujwiFOhRo84aA?*Yme;}!;LA_bV=i{3V#^=9}JmYgUjE{@Z22ws#mMz8kG<9tx=`#}u z&-!@QXBD`zEv!$ofVTHuzJYgLPy1YQ&0iYr;|Y?@{kJENty_$({%7{;OMM+bv;PNA K`!I-AMgRbFH{DkN