netlify-cli 15.9.0 → 15.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/npm-shrinkwrap.json +32 -32
- package/package.json +1 -1
- package/scripts/postinstall.mjs +8 -8
- package/src/commands/functions/functions-build.mjs +2 -2
- package/src/commands/main.mjs +1 -1
- package/src/lib/completion/generate-autocompletion.mjs +4 -4
- package/src/lib/edge-functions/proxy.mjs +2 -1
- package/src/lib/functions/registry.mjs +1 -3
- package/src/lib/functions/runtimes/js/builders/zisi.mjs +3 -8
- package/src/lib/functions/server.mjs +3 -4
- package/src/recipes/vscode/index.mjs +1 -1
- package/src/utils/deploy/hash-fns.mjs +1 -2
- package/src/utils/detect-server-settings.mjs +4 -5
- package/src/utils/execa.mjs +4 -2
- package/src/utils/functions/get-functions.mjs +2 -2
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
|
-
"version": "15.9.
|
|
3
|
+
"version": "15.9.1",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "netlify-cli",
|
|
9
|
-
"version": "15.9.
|
|
9
|
+
"version": "15.9.1",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
@@ -879,9 +879,9 @@
|
|
|
879
879
|
}
|
|
880
880
|
},
|
|
881
881
|
"node_modules/@netlify/build/node_modules/@sindresorhus/is": {
|
|
882
|
-
"version": "5.
|
|
883
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
884
|
-
"integrity": "sha512-
|
|
882
|
+
"version": "5.5.1",
|
|
883
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
884
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug==",
|
|
885
885
|
"engines": {
|
|
886
886
|
"node": ">=14.16"
|
|
887
887
|
},
|
|
@@ -3884,9 +3884,9 @@
|
|
|
3884
3884
|
}
|
|
3885
3885
|
},
|
|
3886
3886
|
"node_modules/@xhmikosr/downloader/node_modules/@sindresorhus/is": {
|
|
3887
|
-
"version": "5.
|
|
3888
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
3889
|
-
"integrity": "sha512-
|
|
3887
|
+
"version": "5.5.1",
|
|
3888
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
3889
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug==",
|
|
3890
3890
|
"engines": {
|
|
3891
3891
|
"node": ">=14.16"
|
|
3892
3892
|
},
|
|
@@ -7313,9 +7313,9 @@
|
|
|
7313
7313
|
}
|
|
7314
7314
|
},
|
|
7315
7315
|
"node_modules/fetch-node-website/node_modules/@sindresorhus/is": {
|
|
7316
|
-
"version": "5.
|
|
7317
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
7318
|
-
"integrity": "sha512-
|
|
7316
|
+
"version": "5.5.1",
|
|
7317
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
7318
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug==",
|
|
7319
7319
|
"engines": {
|
|
7320
7320
|
"node": ">=14.16"
|
|
7321
7321
|
},
|
|
@@ -11335,9 +11335,9 @@
|
|
|
11335
11335
|
}
|
|
11336
11336
|
},
|
|
11337
11337
|
"node_modules/package-json/node_modules/@sindresorhus/is": {
|
|
11338
|
-
"version": "5.
|
|
11339
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
11340
|
-
"integrity": "sha512-
|
|
11338
|
+
"version": "5.5.1",
|
|
11339
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
11340
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug==",
|
|
11341
11341
|
"engines": {
|
|
11342
11342
|
"node": ">=14.16"
|
|
11343
11343
|
},
|
|
@@ -13853,9 +13853,9 @@
|
|
|
13853
13853
|
}
|
|
13854
13854
|
},
|
|
13855
13855
|
"node_modules/type-fest": {
|
|
13856
|
-
"version": "3.13.
|
|
13857
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.
|
|
13858
|
-
"integrity": "sha512-
|
|
13856
|
+
"version": "3.13.1",
|
|
13857
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz",
|
|
13858
|
+
"integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==",
|
|
13859
13859
|
"engines": {
|
|
13860
13860
|
"node": ">=14.16"
|
|
13861
13861
|
},
|
|
@@ -15151,9 +15151,9 @@
|
|
|
15151
15151
|
},
|
|
15152
15152
|
"dependencies": {
|
|
15153
15153
|
"@sindresorhus/is": {
|
|
15154
|
-
"version": "5.
|
|
15155
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
15156
|
-
"integrity": "sha512-
|
|
15154
|
+
"version": "5.5.1",
|
|
15155
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
15156
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug=="
|
|
15157
15157
|
},
|
|
15158
15158
|
"@szmarczak/http-timer": {
|
|
15159
15159
|
"version": "5.0.1",
|
|
@@ -17193,9 +17193,9 @@
|
|
|
17193
17193
|
},
|
|
17194
17194
|
"dependencies": {
|
|
17195
17195
|
"@sindresorhus/is": {
|
|
17196
|
-
"version": "5.
|
|
17197
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
17198
|
-
"integrity": "sha512-
|
|
17196
|
+
"version": "5.5.1",
|
|
17197
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
17198
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug=="
|
|
17199
17199
|
},
|
|
17200
17200
|
"@szmarczak/http-timer": {
|
|
17201
17201
|
"version": "5.0.1",
|
|
@@ -19735,9 +19735,9 @@
|
|
|
19735
19735
|
},
|
|
19736
19736
|
"dependencies": {
|
|
19737
19737
|
"@sindresorhus/is": {
|
|
19738
|
-
"version": "5.
|
|
19739
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
19740
|
-
"integrity": "sha512-
|
|
19738
|
+
"version": "5.5.1",
|
|
19739
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
19740
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug=="
|
|
19741
19741
|
},
|
|
19742
19742
|
"@szmarczak/http-timer": {
|
|
19743
19743
|
"version": "5.0.1",
|
|
@@ -22603,9 +22603,9 @@
|
|
|
22603
22603
|
},
|
|
22604
22604
|
"dependencies": {
|
|
22605
22605
|
"@sindresorhus/is": {
|
|
22606
|
-
"version": "5.
|
|
22607
|
-
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.
|
|
22608
|
-
"integrity": "sha512-
|
|
22606
|
+
"version": "5.5.1",
|
|
22607
|
+
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.5.1.tgz",
|
|
22608
|
+
"integrity": "sha512-wTsEUhqTXg1NDW+o9aWANj4LxELwWjqN0F3ltsWwpYoh0NSlMWo+u7FluRrSF2E2uaPYx7dJ3FnTf69git/0ug=="
|
|
22609
22609
|
},
|
|
22610
22610
|
"@szmarczak/http-timer": {
|
|
22611
22611
|
"version": "5.0.1",
|
|
@@ -24476,9 +24476,9 @@
|
|
|
24476
24476
|
}
|
|
24477
24477
|
},
|
|
24478
24478
|
"type-fest": {
|
|
24479
|
-
"version": "3.13.
|
|
24480
|
-
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.
|
|
24481
|
-
"integrity": "sha512-
|
|
24479
|
+
"version": "3.13.1",
|
|
24480
|
+
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz",
|
|
24481
|
+
"integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g=="
|
|
24482
24482
|
},
|
|
24483
24483
|
"type-is": {
|
|
24484
24484
|
"version": "1.6.18",
|
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import process from 'process'
|
|
2
2
|
|
|
3
|
+
import chalk from 'chalk'
|
|
4
|
+
|
|
5
|
+
import { createMainCommand } from '../src/commands/index.mjs'
|
|
6
|
+
// TODO: use destructuring again once the imported file is esm
|
|
7
|
+
import { generateAutocompletion } from '../src/lib/completion/index.mjs'
|
|
8
|
+
|
|
3
9
|
const id = (message) => message
|
|
4
10
|
|
|
5
11
|
/**
|
|
@@ -8,12 +14,10 @@ const id = (message) => message
|
|
|
8
14
|
* @param {Array<chalk['Color'] | chalk['Modifiers']>} styles
|
|
9
15
|
* @returns
|
|
10
16
|
*/
|
|
11
|
-
const format =
|
|
17
|
+
const format = (message, styles) => {
|
|
12
18
|
let func = id
|
|
13
19
|
try {
|
|
14
|
-
|
|
15
|
-
const chalk = await import('chalk')
|
|
16
|
-
func = chalk.default
|
|
20
|
+
func = chalk
|
|
17
21
|
styles.forEach((style) => {
|
|
18
22
|
func = func[style]
|
|
19
23
|
})
|
|
@@ -26,10 +30,6 @@ const postInstall = async () => {
|
|
|
26
30
|
// as yarn pnp analyzes everything inside the postinstall
|
|
27
31
|
// yarn pnp executes it out of a .yarn folder .yarn/unplugged/netlify-cli-file-fb026a3a6d/node_modules/netlify-cli/scripts/postinstall.mjs
|
|
28
32
|
if (!process.argv[1].includes('.yarn')) {
|
|
29
|
-
const { createMainCommand } = await import('../src/commands/index.mjs')
|
|
30
|
-
// TODO: use destructuring again once the imported file is esm
|
|
31
|
-
const { generateAutocompletion } = await import('../src/lib/completion/index.mjs')
|
|
32
|
-
|
|
33
33
|
// create or update the autocompletion definition
|
|
34
34
|
const program = createMainCommand()
|
|
35
35
|
generateAutocompletion(program)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { mkdir } from 'fs/promises'
|
|
3
3
|
|
|
4
|
+
import { zipFunctions } from '@netlify/zip-it-and-ship-it'
|
|
5
|
+
|
|
4
6
|
import { NETLIFYDEVERR, NETLIFYDEVLOG, exit, log } from '../../utils/command-helpers.mjs'
|
|
5
7
|
import { getFunctionsDir } from '../../utils/functions/index.mjs'
|
|
6
8
|
|
|
@@ -36,8 +38,6 @@ const functionsBuild = async (options, command) => {
|
|
|
36
38
|
|
|
37
39
|
log(`${NETLIFYDEVLOG} Building functions`)
|
|
38
40
|
|
|
39
|
-
const { zipFunctions } = await import('@netlify/zip-it-and-ship-it')
|
|
40
|
-
|
|
41
41
|
zipFunctions(src, dst, { skipGo: true })
|
|
42
42
|
log(`${NETLIFYDEVLOG} Functions built to `, dst)
|
|
43
43
|
}
|
package/src/commands/main.mjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import process from 'process'
|
|
3
3
|
|
|
4
4
|
import { Option } from 'commander'
|
|
5
|
+
import envinfo from 'envinfo'
|
|
5
6
|
import { closest } from 'fastest-levenshtein'
|
|
6
7
|
import inquirer from 'inquirer'
|
|
7
8
|
|
|
@@ -39,7 +40,6 @@ const SUGGESTION_TIMEOUT = 1e4
|
|
|
39
40
|
const getVersionPage = async () => {
|
|
40
41
|
// performance optimization - load envinfo on demand
|
|
41
42
|
|
|
42
|
-
const envinfo = await import('envinfo')
|
|
43
43
|
const data = await envinfo.run({
|
|
44
44
|
System: ['OS', 'CPU'],
|
|
45
45
|
Binaries: ['Node', 'Yarn', 'npm'],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
import
|
|
2
|
+
import fs from 'fs'
|
|
3
3
|
import { dirname } from 'path'
|
|
4
4
|
|
|
5
5
|
import { sortOptions, warn } from '../../utils/command-helpers.mjs'
|
|
@@ -28,10 +28,10 @@ const generateAutocompletion = (program) => {
|
|
|
28
28
|
{},
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
if (!existsSync(dirname(AUTOCOMPLETION_FILE))) {
|
|
32
|
-
mkdirSync(dirname(AUTOCOMPLETION_FILE), { recursive: true })
|
|
31
|
+
if (!fs.existsSync(dirname(AUTOCOMPLETION_FILE))) {
|
|
32
|
+
fs.mkdirSync(dirname(AUTOCOMPLETION_FILE), { recursive: true })
|
|
33
33
|
}
|
|
34
|
-
writeFileSync(AUTOCOMPLETION_FILE, JSON.stringify(autocomplete), 'utf-8')
|
|
34
|
+
fs.writeFileSync(AUTOCOMPLETION_FILE, JSON.stringify(autocomplete), 'utf-8')
|
|
35
35
|
} catch (error_) {
|
|
36
36
|
// Sometimes it can happen that the autocomplete generation in the postinstall script lacks permissions
|
|
37
37
|
// to write files to the home directory of the user. Therefore just warn with the error and don't break install.
|
|
@@ -3,6 +3,8 @@ import { Buffer } from 'buffer'
|
|
|
3
3
|
import { relative } from 'path'
|
|
4
4
|
import { cwd, env } from 'process'
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line import/no-namespace
|
|
7
|
+
import * as bundler from '@netlify/edge-bundler'
|
|
6
8
|
import getAvailablePort from 'get-port'
|
|
7
9
|
|
|
8
10
|
import { NETLIFYDEVERR, NETLIFYDEVWARN, chalk, error as printError, log } from '../../utils/command-helpers.mjs'
|
|
@@ -185,7 +187,6 @@ const prepareServer = async ({
|
|
|
185
187
|
const importMapPaths = [...importMaps, config.functions['*'].deno_import_map]
|
|
186
188
|
|
|
187
189
|
try {
|
|
188
|
-
const bundler = await import('@netlify/edge-bundler')
|
|
189
190
|
const distImportMapPath = getPathInProject([DIST_IMPORT_MAP_PATH])
|
|
190
191
|
const runIsolate = await bundler.serve({
|
|
191
192
|
...getDownloadUpdateFunctions(),
|
|
@@ -3,6 +3,7 @@ import { mkdir } from 'fs/promises'
|
|
|
3
3
|
import { extname, isAbsolute, join, resolve } from 'path'
|
|
4
4
|
import { env } from 'process'
|
|
5
5
|
|
|
6
|
+
import { listFunctions } from '@netlify/zip-it-and-ship-it'
|
|
6
7
|
import extractZip from 'extract-zip'
|
|
7
8
|
|
|
8
9
|
import {
|
|
@@ -175,9 +176,6 @@ export class FunctionsRegistry {
|
|
|
175
176
|
// This function is here so we can mock it in tests
|
|
176
177
|
// eslint-disable-next-line class-methods-use-this
|
|
177
178
|
async listFunctions(...args) {
|
|
178
|
-
// Performance optimization: load '@netlify/zip-it-and-ship-it' on demand.
|
|
179
|
-
const { listFunctions } = await import('@netlify/zip-it-and-ship-it')
|
|
180
|
-
|
|
181
179
|
return await listFunctions(...args)
|
|
182
180
|
}
|
|
183
181
|
|
|
@@ -2,6 +2,7 @@ import { mkdir, writeFile } from 'fs/promises'
|
|
|
2
2
|
import { createRequire } from 'module'
|
|
3
3
|
import path from 'path'
|
|
4
4
|
|
|
5
|
+
import { zipFunction, listFunction } from '@netlify/zip-it-and-ship-it'
|
|
5
6
|
import decache from 'decache'
|
|
6
7
|
import { readPackageUp } from 'read-pkg-up'
|
|
7
8
|
import sourceMapSupport from 'source-map-support'
|
|
@@ -44,9 +45,6 @@ const buildFunction = async ({
|
|
|
44
45
|
}
|
|
45
46
|
const functionDirectory = path.dirname(func.mainFile)
|
|
46
47
|
|
|
47
|
-
// performance
|
|
48
|
-
const { zipFunction } = await import('@netlify/zip-it-and-ship-it')
|
|
49
|
-
|
|
50
48
|
// If we have a function at `functions/my-func/index.js` and we pass
|
|
51
49
|
// that path to `zipFunction`, it will lack the context of the whole
|
|
52
50
|
// functions directory and will infer the name of the function to be
|
|
@@ -92,15 +90,12 @@ const buildFunction = async ({
|
|
|
92
90
|
* @param {string} params.mainFile
|
|
93
91
|
* @param {string} params.projectRoot
|
|
94
92
|
*/
|
|
95
|
-
export const parseFunctionForMetadata = async ({ config, mainFile, projectRoot }) =>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return await listFunction(mainFile, {
|
|
93
|
+
export const parseFunctionForMetadata = async ({ config, mainFile, projectRoot }) =>
|
|
94
|
+
await listFunction(mainFile, {
|
|
99
95
|
config: netlifyConfigToZisiConfig({ config, projectRoot }),
|
|
100
96
|
featureFlags: { zisi_functions_api_v2: true },
|
|
101
97
|
parseISC: true,
|
|
102
98
|
})
|
|
103
|
-
}
|
|
104
99
|
|
|
105
100
|
// Clears the cache for any files inside the directory from which functions are
|
|
106
101
|
// served.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import express from 'express'
|
|
3
|
+
import expressLogging from 'express-logging'
|
|
2
4
|
import jwtDecode from 'jwt-decode'
|
|
3
5
|
|
|
4
6
|
import { NETLIFYDEVERR, NETLIFYDEVLOG, error as errorExit, log } from '../../utils/command-helpers.mjs'
|
|
@@ -185,11 +187,8 @@ export const createHandler = function (options) {
|
|
|
185
187
|
}
|
|
186
188
|
}
|
|
187
189
|
|
|
188
|
-
const getFunctionsServer =
|
|
190
|
+
const getFunctionsServer = (options) => {
|
|
189
191
|
const { buildersPrefix = '', functionsPrefix = '', functionsRegistry, siteUrl } = options
|
|
190
|
-
// performance optimization, load express on demand
|
|
191
|
-
const { default: express } = await import('express')
|
|
192
|
-
const { default: expressLogging } = await import('express-logging')
|
|
193
192
|
const app = express()
|
|
194
193
|
const functionHandler = createHandler(options)
|
|
195
194
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { join } from 'path'
|
|
2
2
|
|
|
3
|
+
import { DenoBridge } from '@netlify/edge-bundler'
|
|
3
4
|
import execa from 'execa'
|
|
4
5
|
import inquirer from 'inquirer'
|
|
5
6
|
|
|
@@ -49,7 +50,6 @@ const getDenoExtPrompt = () => {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export const run = async ({ config, repositoryRoot }) => {
|
|
52
|
-
const { DenoBridge } = await import('@netlify/edge-bundler')
|
|
53
53
|
const deno = new DenoBridge({
|
|
54
54
|
onBeforeDownload: () =>
|
|
55
55
|
log(`${NETLIFYDEVWARN} Setting up the Edge Functions environment. This may take a couple of minutes.`),
|
|
@@ -2,6 +2,7 @@ import { readFile } from 'fs/promises'
|
|
|
2
2
|
import path from 'path'
|
|
3
3
|
import { promisify } from 'util'
|
|
4
4
|
|
|
5
|
+
import { zipFunctions } from '@netlify/zip-it-and-ship-it'
|
|
5
6
|
import fromArray from 'from2-array'
|
|
6
7
|
import pumpModule from 'pump'
|
|
7
8
|
|
|
@@ -66,8 +67,6 @@ const getFunctionZips = async ({
|
|
|
66
67
|
})
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
const { zipFunctions } = await import('@netlify/zip-it-and-ship-it')
|
|
70
|
-
|
|
71
70
|
return await zipFunctions(directories, tmpDir, {
|
|
72
71
|
basePath: rootDir,
|
|
73
72
|
configFileDirectories: [getPathInProject([INTERNAL_FUNCTIONS_FOLDER])],
|
|
@@ -10,6 +10,8 @@ import { NodeFS } from '@netlify/build-info/node'
|
|
|
10
10
|
import { getFramework, listFrameworks } from '@netlify/framework-info'
|
|
11
11
|
import fuzzy from 'fuzzy'
|
|
12
12
|
import getPort from 'get-port'
|
|
13
|
+
import inquirer from 'inquirer'
|
|
14
|
+
import inquirerAutocompletePrompt from 'inquirer-autocomplete-prompt'
|
|
13
15
|
|
|
14
16
|
import { NETLIFYDEVWARN, chalk, log } from './command-helpers.mjs'
|
|
15
17
|
import { acquirePort } from './dev.mjs'
|
|
@@ -207,11 +209,11 @@ const detectChangesInNewSettings = (frameworkSettings, newSettings, metadata) =>
|
|
|
207
209
|
const message = ['']
|
|
208
210
|
const [setting] = newSettings
|
|
209
211
|
|
|
210
|
-
if (frameworkSettings?.framework !== setting?.framework) {
|
|
212
|
+
if (frameworkSettings?.framework !== setting?.framework.name) {
|
|
211
213
|
message.push(
|
|
212
214
|
`- Framework does not match:`,
|
|
213
215
|
` [old]: ${frameworkSettings?.framework}`,
|
|
214
|
-
` [new]: ${setting?.framework}`,
|
|
216
|
+
` [new]: ${setting?.framework.name}`,
|
|
215
217
|
'',
|
|
216
218
|
)
|
|
217
219
|
}
|
|
@@ -259,9 +261,6 @@ const detectFrameworkSettings = async ({ projectDir }) => {
|
|
|
259
261
|
}
|
|
260
262
|
|
|
261
263
|
if (frameworks.length > 1) {
|
|
262
|
-
// performance optimization, load inquirer on demand
|
|
263
|
-
const { default: inquirer } = await import('inquirer')
|
|
264
|
-
const { default: inquirerAutocompletePrompt } = await import('inquirer-autocomplete-prompt')
|
|
265
264
|
/** multiple matching detectors, make the user choose */
|
|
266
265
|
inquirer.registerPrompt('autocomplete', inquirerAutocompletePrompt)
|
|
267
266
|
const scriptInquirerOptions = formatSettingsArrForInquirer(frameworks)
|
package/src/utils/execa.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { env } from 'process'
|
|
2
|
+
|
|
3
|
+
import execaLib from 'execa'
|
|
4
|
+
|
|
2
5
|
// This is a thin layer on top of `execa` that allows consumers to provide an
|
|
3
6
|
// alternative path to the module location, making it easier to mock its logic
|
|
4
7
|
// in tests (see `tests/utils/mock-execa.js`).
|
|
@@ -13,8 +16,7 @@ if (env.NETLIFY_CLI_EXECA_PATH) {
|
|
|
13
16
|
const execaMock = await import(env.NETLIFY_CLI_EXECA_PATH)
|
|
14
17
|
execa = execaMock.default
|
|
15
18
|
} else {
|
|
16
|
-
|
|
17
|
-
execa = execaLib.default
|
|
19
|
+
execa = execaLib
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export default execa
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import { listFunctions } from '@netlify/zip-it-and-ship-it'
|
|
3
|
+
|
|
2
4
|
import { fileExistsAsync } from '../../lib/fs.mjs'
|
|
3
5
|
|
|
4
6
|
const getUrlPath = (functionName) => `/.netlify/functions/${functionName}`
|
|
@@ -24,8 +26,6 @@ export const getFunctions = async (functionsSrcDir, config = {}) => {
|
|
|
24
26
|
return []
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
// performance optimization, load '@netlify/zip-it-and-ship-it' on demand
|
|
28
|
-
const { listFunctions } = await import('@netlify/zip-it-and-ship-it')
|
|
29
29
|
const functions = await listFunctions(functionsSrcDir, {
|
|
30
30
|
config: config.functions ? extractSchedule(config.functions) : undefined,
|
|
31
31
|
parseISC: true,
|