Skip to content

Commit

Permalink
fix(deps): update dependency @netlify/config to v17 (#3838)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency @netlify/config to v17

* fix: use new version of `@netlify/config`

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: ehmicky <ehmicky@gmail.com>
Co-authored-by: ehmicky <ehmicky@users.noreply.github.com>
  • Loading branch information
4 people authored Dec 16, 2021
1 parent 08f1b50 commit ede3514
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 10 deletions.
130 changes: 123 additions & 7 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"dependencies": {
"@netlify/build": "^20.3.1",
"@netlify/config": "^16.0.7",
"@netlify/config": "^17.0.0",
"@netlify/framework-info": "^7.0.0",
"@netlify/local-functions-proxy": "^1.1.1",
"@netlify/plugin-edge-handlers": "^2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/commands/base-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
const process = require('process')
const { format } = require('util')

const resolveConfig = require('@netlify/config')
const { Command, Option } = require('commander')
const debug = require('debug')
const merge = require('lodash/merge')

// TODO: use static `import` after migrating this repository to pure ES modules
const jsClient = import('netlify')
const netlifyConfigPromise = import('@netlify/config')

const { getAgent } = require('../lib/http-agent')
const {
Expand Down Expand Up @@ -464,6 +464,7 @@ class BaseCommand extends Command {
async getConfig(config) {
const options = this.opts()
const { cwd, host, offline = options.offline, pathPrefix, scheme, state, token } = config
const { resolveConfig } = await netlifyConfigPromise

try {
return await resolveConfig({
Expand Down
4 changes: 3 additions & 1 deletion src/commands/deploy/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ const { stat } = require('fs').promises
const { basename, resolve } = require('path')
const { cwd, env } = require('process')

const { restoreConfig, updateConfig } = require('@netlify/config')
const { get } = require('dot-prop')
const inquirer = require('inquirer')
const isObject = require('lodash/isObject')
const prettyjson = require('prettyjson')

const netlifyConfigPromise = import('@netlify/config')

const { cancelDeploy } = require('../../lib/api')
const { getBuildOptions, runBuild } = require('../../lib/build')
const { normalizeFunctionsConfig } = require('../../lib/functions/config')
Expand Down Expand Up @@ -527,6 +528,7 @@ const deploy = async (options, command) => {
const functionsConfig = normalizeFunctionsConfig({ functionsConfig: config.functions, projectRoot: site.root })

const redirectsPath = `${deployFolder}/_redirects`
const { restoreConfig, updateConfig } = await netlifyConfigPromise
// @ts-ignore
await updateConfig(configMutations, {
buildDir: deployFolder,
Expand Down

1 comment on commit ede3514

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 354 MB

Please sign in to comment.