Skip to content

Commit

Permalink
chore(deps): update dependency eslint-plugin-sort-destructure-keys to…
Browse files Browse the repository at this point in the history
… v1.5.0 (#5507)

* chore(deps): update dependency eslint-plugin-sort-destructure-keys to v1.5.0

* chore: fix lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Tschinder <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 27, 2023
1 parent 0c3fd0a commit 046e6b9
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 41 deletions.
38 changes: 22 additions & 16 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 site/src/_layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export default class Layout extends React.Component {
}

render() {
const { routes = [], children, route, title = 'Netlify CLI', logo } = this.props
const { children, logo, route, routes = [], title = 'Netlify CLI' } = this.props

const { menu, update } = this.state

Expand Down
2 changes: 1 addition & 1 deletion src/commands/deploy/deploy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ const deploy = async (options, command) => {
return triggerDeploy({ api, options, siteData, siteId })
}

const { newConfig, configMutations = [] } = await handleBuild({
const { configMutations = [], newConfig } = await handleBuild({
cachedConfig: command.netlify.cachedConfig,
options,
})
Expand Down
4 changes: 2 additions & 2 deletions src/commands/functions/functions-create.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ const downloadFromURL = async function (command, options, argumentName, function
const fnTemplateFile = path.join(fnFolder, '.netlify-function-template.mjs')
if (await fileExistsAsync(fnTemplateFile)) {
const {
default: { onComplete, addons = [] },
default: { addons = [], onComplete },
// eslint-disable-next-line import/no-dynamic-require
} = await import(pathToFileURL(fnTemplateFile).href)

Expand Down Expand Up @@ -463,7 +463,7 @@ const scaffoldFromTemplate = async function (command, options, argumentName, fun
} else if (chosenTemplate === 'report') {
log(`${NETLIFYDEVLOG} Open in browser: https://github.com/netlify/cli/issues/new`)
} else {
const { onComplete, name: templateName, lang, addons = [] } = chosenTemplate
const { addons = [], lang, name: templateName, onComplete } = chosenTemplate
const pathToTemplate = path.join(templatesDir, lang, templateName)
if (!fs.existsSync(pathToTemplate)) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const FIRST_PAGE = 1
const MAX_PAGES = 10
const MAX_PER_PAGE = 100
export const listSites = async ({ api, options }) => {
const { page = FIRST_PAGE, maxPages = MAX_PAGES, ...rest } = options
const { maxPages = MAX_PAGES, page = FIRST_PAGE, ...rest } = options
const sites = await api.listSites({ page, per_page: MAX_PER_PAGE, ...rest })
// TODO: use pagination headers when js-client returns them
if (sites.length === MAX_PER_PAGE && page + 1 <= maxPages) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/deploy/deploy-site.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export const deploySite = async (
maxRetry = DEFAULT_MAX_RETRY,
// API calls this the 'title'
message: title,
rootDir,
siteEnv,
skipFunctionsCache,
statusCb = () => {
/* default to noop */
},
syncFileLimit = DEFAULT_SYNC_LIMIT,
tmpDir = temporaryDirectory(),
rootDir,
} = {},
) => {
statusCb({
Expand Down
10 changes: 5 additions & 5 deletions src/utils/detect-server-settings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ const getSettingsFromFramework = (framework) => {
build: { directory: dist },
dev: {
commands: [command],
port: frameworkPort,
pollingStrategies = [],
port: frameworkPort,
},
name: frameworkName,
staticAssetsDirectory: staticDir,
env = {},
name: frameworkName,
plugins,
staticAssetsDirectory: staticDir,
} = framework

return {
Expand Down Expand Up @@ -246,10 +246,10 @@ const handleCustomFramework = ({ devConfig }) => {
const mergeSettings = async ({ devConfig, frameworkSettings = {} }) => {
const {
command: frameworkCommand,
frameworkPort: frameworkDetectedPort,
dist,
framework,
env,
framework,
frameworkPort: frameworkDetectedPort,
pollingStrategies = [],
} = frameworkSettings

Expand Down
2 changes: 1 addition & 1 deletion src/utils/dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const getSiteInformation = async ({ api, offline, site, siteInfo }) => {
}

const getEnvSourceName = (source) => {
const { printFn = chalk.green, name = source } = ENV_VAR_SOURCES[source] || {}
const { name = source, printFn = chalk.green } = ENV_VAR_SOURCES[source] || {}

return printFn(name)
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/dot-env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const loadDotEnvFiles = async function ({ envFiles, projectDir }) {
// in the user configuration, the order is highest to lowest
const defaultEnvFiles = ['.env.development.local', '.env.local', '.env.development', '.env']

export const tryLoadDotEnvFiles = async ({ projectDir, dotenvFiles = defaultEnvFiles }) => {
export const tryLoadDotEnvFiles = async ({ dotenvFiles = defaultEnvFiles, projectDir }) => {
const results = await Promise.all(
dotenvFiles.map(async (file) => {
const filepath = path.resolve(projectDir, file)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/init/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const getDefaultSettings = ({
const recommendedPlugins = getRecommendPlugins(frameworkPlugins, config)
const {
command: defaultBuildCmd = frameworkBuildCommand,
publish: defaultBuildDir = frameworkBuildDir,
functions: defaultFunctionsDir,
publish: defaultBuildDir = frameworkBuildDir,
} = config.build

return {
Expand Down Expand Up @@ -87,9 +87,9 @@ export const getBuildSettings = async ({ config, env, repositoryRoot, siteRoot }
const baseDirectory = getBaseDirectory({ repositoryRoot, siteRoot })
const nodeVersion = await detectNodeVersion({ baseDirectory, env })
const {
frameworkName,
frameworkBuildCommand,
frameworkBuildDir,
frameworkName,
frameworkPlugins = [],
} = await getFrameworkInfo({
baseDirectory,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/110.command.build.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const defaultEnvs = {
const runBuildCommand = async function (
t,
cwd,
{ apiUrl, exitCode: expectedExitCode = 0, output: outputs, flags = [], env = defaultEnvs } = {},
{ apiUrl, env = defaultEnvs, exitCode: expectedExitCode = 0, flags = [], output: outputs } = {},
) {
const { all, exitCode } = await execa(cliPath, ['build', ...flags], {
reject: false,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/20.command.functions.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const test = isCI ? avaTest.serial.bind(avaTest) : avaTest
const DEFAULT_PORT = 9999
const SERVE_TIMEOUT = 180_000

const withFunctionsServer = async ({ builder, args = [], port = DEFAULT_PORT }, testHandler) => {
const withFunctionsServer = async ({ args = [], builder, port = DEFAULT_PORT }, testHandler) => {
let ps
try {
ps = execa(cliPath, ['functions:serve', ...args], {
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/utils/dev-server.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ const getExecaOptions = ({ cwd, env }) => {
}

const startServer = async ({
cwd,
args = [],
context = 'dev',
offline = true,
cwd,
env = {},
args = [],
expectFailure = false,
serve = false,
offline = true,
prompt,
serve = false,
}) => {
const port = await getPort()
const staticPort = await getPort()
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/utils/mock-api.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const startMockApi = ({ routes, silent }) => {
app.use(express.json())
app.use(express.raw())

routes.forEach(({ method = 'get', path, response = {}, status = 200, requestBody }) => {
routes.forEach(({ method = 'get', path, requestBody, response = {}, status = 200 }) => {
app[method.toLowerCase()](`/api/v1/${path}`, function onRequest(req, res) {
// validate request body
if (requestBody !== undefined && !isDeepStrictEqual(requestBody, req.body)) {
Expand Down Expand Up @@ -73,7 +73,7 @@ const getEnvironmentVariables = ({ apiUrl }) => ({
NETLIFY_API_URL: apiUrl,
})

const getCLIOptions = ({ apiUrl, builder: { directory: cwd }, extendEnv = true, env = {} }) => ({
const getCLIOptions = ({ apiUrl, builder: { directory: cwd }, env = {}, extendEnv = true }) => ({
cwd,
env: { ...getEnvironmentVariables({ apiUrl }), ...env },
extendEnv,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/utils/site-builder.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const createSiteBuilder = ({ siteName }) => {
})
return builder
},
withRedirectsFile: ({ redirects = [], pathPrefix = '' }) => {
withRedirectsFile: ({ pathPrefix = '', redirects = [] }) => {
const dest = path.join(directory, pathPrefix, '_redirects')
tasks.push(async () => {
const content = redirects
Expand Down Expand Up @@ -133,7 +133,7 @@ const createSiteBuilder = ({ siteName }) => {
files.forEach(builder.withContentFile)
return builder
},
withEnvFile: ({ path: filePath = '.env', pathPrefix = '', env = {} }) => {
withEnvFile: ({ env = {}, path: filePath = '.env', pathPrefix = '' }) => {
const dest = path.join(directory, pathPrefix, filePath)
tasks.push(async () => {
await ensureDir(path.dirname(dest))
Expand Down

1 comment on commit 046e6b9

@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: 263 MB

Please sign in to comment.