netlify-cli 9.16.4 → 9.16.7
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/bin/run +1 -1
- package/npm-shrinkwrap.json +1148 -1128
- package/package.json +3 -3
- package/scripts/postinstall.js +3 -3
- package/src/commands/functions/functions-create.js +4 -4
- package/src/commands/functions/functions-invoke.js +1 -1
- package/src/commands/graph/graph-handler.js +1 -1
- package/src/commands/main.js +1 -1
- package/src/functions-templates/go/hello-world/go.mod +1 -1
- package/src/functions-templates/go/scheduled-function/go.mod +1 -1
- package/src/functions-templates/javascript/stripe-charge/package-lock.json +6 -6
- package/src/functions-templates/javascript/stripe-subscription/package-lock.json +6 -6
- package/src/functions-templates/typescript/hello-world/package-lock.json +6 -6
- package/src/lib/functions/registry.js +1 -1
- package/src/lib/functions/server.js +2 -2
- package/src/utils/deploy/hash-fns.js +1 -1
- package/src/utils/detect-server-settings.js +2 -2
- package/src/utils/functions/get-functions.js +2 -2
- package/src/utils/read-repo-url.js +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "9.16.
|
|
4
|
+
"version": "9.16.7",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!npm-shrinkwrap.json\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
|
|
207
207
|
},
|
|
208
208
|
"dependencies": {
|
|
209
|
-
"@netlify/build": "^26.5.
|
|
209
|
+
"@netlify/build": "^26.5.3",
|
|
210
210
|
"@netlify/config": "^17.0.20",
|
|
211
211
|
"@netlify/framework-info": "^9.0.2",
|
|
212
212
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
},
|
|
319
319
|
"devDependencies": {
|
|
320
320
|
"@babel/preset-react": "^7.12.13",
|
|
321
|
-
"@netlify/eslint-config-node": "^
|
|
321
|
+
"@netlify/eslint-config-node": "^6.0.0",
|
|
322
322
|
"ava": "^4.0.0",
|
|
323
323
|
"c8": "^7.11.0",
|
|
324
324
|
"eslint-plugin-sort-destructure-keys": "^1.3.5",
|
package/scripts/postinstall.js
CHANGED
|
@@ -12,7 +12,7 @@ const format = (message, styles) => {
|
|
|
12
12
|
let func = id
|
|
13
13
|
try {
|
|
14
14
|
// this fails sometimes on outdated npm versions
|
|
15
|
-
// eslint-disable-next-line
|
|
15
|
+
// eslint-disable-next-line n/global-require
|
|
16
16
|
func = require('chalk')
|
|
17
17
|
styles.forEach((style) => {
|
|
18
18
|
func = func[style]
|
|
@@ -26,9 +26,9 @@ const postInstall = () => {
|
|
|
26
26
|
// as yarn pnp analyzes everything inside the postinstall
|
|
27
27
|
// yarn pnp executes it out of a .yarn folder .yarn/unplugged/netlify-cli-file-fb026a3a6d/node_modules/netlify-cli/scripts/postinstall.js
|
|
28
28
|
if (!process.argv[1].includes('.yarn')) {
|
|
29
|
-
// eslint-disable-next-line
|
|
29
|
+
// eslint-disable-next-line n/global-require
|
|
30
30
|
const { createMainCommand } = require('../src/commands')
|
|
31
|
-
// eslint-disable-next-line
|
|
31
|
+
// eslint-disable-next-line n/global-require
|
|
32
32
|
const { createAutocompletion } = require('../src/lib/completion')
|
|
33
33
|
|
|
34
34
|
// create or update the autocompletion definition
|
|
@@ -98,7 +98,7 @@ const formatRegistryArrayForInquirer = function (lang) {
|
|
|
98
98
|
const registry = folderNames
|
|
99
99
|
// filter out markdown files
|
|
100
100
|
.filter((folderName) => !folderName.endsWith('.md'))
|
|
101
|
-
// eslint-disable-next-line
|
|
101
|
+
// eslint-disable-next-line n/global-require, import/no-dynamic-require
|
|
102
102
|
.map((folderName) => require(path.join(templatesDir, lang, folderName, '.netlify-function-template.js')))
|
|
103
103
|
.sort((folderNameA, folderNameB) => {
|
|
104
104
|
const priorityDiff = (folderNameA.priority || DEFAULT_PRIORITY) - (folderNameB.priority || DEFAULT_PRIORITY)
|
|
@@ -298,7 +298,7 @@ const downloadFromURL = async function (command, options, argumentName, function
|
|
|
298
298
|
// read, execute, and delete function template file if exists
|
|
299
299
|
const fnTemplateFile = path.join(fnFolder, '.netlify-function-template.js')
|
|
300
300
|
if (fs.existsSync(fnTemplateFile)) {
|
|
301
|
-
// eslint-disable-next-line
|
|
301
|
+
// eslint-disable-next-line n/global-require, import/no-dynamic-require
|
|
302
302
|
const { onComplete, addons = [] } = require(fnTemplateFile)
|
|
303
303
|
|
|
304
304
|
await installAddons(command, addons, path.resolve(fnFolder))
|
|
@@ -323,7 +323,7 @@ const getNpmInstallPackages = (existingPackages = {}, neededPackages = {}) =>
|
|
|
323
323
|
// we don't do this check, we may be upgrading the version of a module used in
|
|
324
324
|
// another part of the project, which we don't want to do.
|
|
325
325
|
const installDeps = async ({ functionPackageJson, functionPath, functionsDir }) => {
|
|
326
|
-
// eslint-disable-next-line import/no-dynamic-require,
|
|
326
|
+
// eslint-disable-next-line import/no-dynamic-require, n/global-require
|
|
327
327
|
const { dependencies: functionDependencies, devDependencies: functionDevDependencies } = require(functionPackageJson)
|
|
328
328
|
const sitePackageJson = await findUp('package.json', { cwd: functionsDir })
|
|
329
329
|
const npmInstallFlags = ['--no-audit', '--no-fund']
|
|
@@ -337,7 +337,7 @@ const installDeps = async ({ functionPackageJson, functionPath, functionsDir })
|
|
|
337
337
|
return
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
// eslint-disable-next-line import/no-dynamic-require,
|
|
340
|
+
// eslint-disable-next-line import/no-dynamic-require, n/global-require
|
|
341
341
|
const { dependencies: siteDependencies, devDependencies: siteDevDependencies } = require(sitePackageJson)
|
|
342
342
|
const dependencies = getNpmInstallPackages(siteDependencies, functionDependencies)
|
|
343
343
|
const devDependencies = getNpmInstallPackages(siteDevDependencies, functionDevDependencies)
|
|
@@ -64,7 +64,7 @@ const processPayloadFromFlag = function (payloadString) {
|
|
|
64
64
|
if (pathexists) {
|
|
65
65
|
try {
|
|
66
66
|
// there is code execution potential here
|
|
67
|
-
// eslint-disable-next-line
|
|
67
|
+
// eslint-disable-next-line n/global-require, import/no-dynamic-require
|
|
68
68
|
payload = require(payloadpath)
|
|
69
69
|
return payload
|
|
70
70
|
} catch (error_) {
|
|
@@ -64,7 +64,7 @@ const graphHandler = async (userOperationName, options, command) => {
|
|
|
64
64
|
const filterOperationNames = (operationChoices, input) =>
|
|
65
65
|
operationChoices.filter((operation) => operation.value.toLowerCase().match(input.toLowerCase()))
|
|
66
66
|
|
|
67
|
-
// eslint-disable-next-line
|
|
67
|
+
// eslint-disable-next-line n/global-require
|
|
68
68
|
const inquirerAutocompletePrompt = require('inquirer-autocomplete-prompt')
|
|
69
69
|
/** multiple matching detectors, make the user choose */
|
|
70
70
|
inquirer.registerPrompt('autocomplete', inquirerAutocompletePrompt)
|
package/src/commands/main.js
CHANGED
|
@@ -46,7 +46,7 @@ const SUGGESTION_TIMEOUT = 1e4
|
|
|
46
46
|
|
|
47
47
|
const getVersionPage = async () => {
|
|
48
48
|
// performance optimization - load envinfo on demand
|
|
49
|
-
// eslint-disable-next-line
|
|
49
|
+
// eslint-disable-next-line n/global-require
|
|
50
50
|
const envinfo = require('envinfo')
|
|
51
51
|
const data = await envinfo.run({
|
|
52
52
|
System: ['OS', 'CPU'],
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"node_modules/stripe": {
|
|
108
|
-
"version": "8.
|
|
109
|
-
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.
|
|
110
|
-
"integrity": "sha512-
|
|
108
|
+
"version": "8.217.0",
|
|
109
|
+
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.217.0.tgz",
|
|
110
|
+
"integrity": "sha512-CHWazNOrb1EBxTpepv5hCKMxOwF/oW3E4zRi8/LZIy5FC2y7A7NzcuE1aErYXLId3bKPe20HOmWKvjDRU2bXaA==",
|
|
111
111
|
"dependencies": {
|
|
112
112
|
"@types/node": ">=8.1.0",
|
|
113
113
|
"qs": "^6.10.3"
|
|
@@ -184,9 +184,9 @@
|
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
186
|
"stripe": {
|
|
187
|
-
"version": "8.
|
|
188
|
-
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.
|
|
189
|
-
"integrity": "sha512-
|
|
187
|
+
"version": "8.217.0",
|
|
188
|
+
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.217.0.tgz",
|
|
189
|
+
"integrity": "sha512-CHWazNOrb1EBxTpepv5hCKMxOwF/oW3E4zRi8/LZIy5FC2y7A7NzcuE1aErYXLId3bKPe20HOmWKvjDRU2bXaA==",
|
|
190
190
|
"requires": {
|
|
191
191
|
"@types/node": ">=8.1.0",
|
|
192
192
|
"qs": "^6.10.3"
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"node_modules/stripe": {
|
|
108
|
-
"version": "8.
|
|
109
|
-
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.
|
|
110
|
-
"integrity": "sha512-
|
|
108
|
+
"version": "8.217.0",
|
|
109
|
+
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.217.0.tgz",
|
|
110
|
+
"integrity": "sha512-CHWazNOrb1EBxTpepv5hCKMxOwF/oW3E4zRi8/LZIy5FC2y7A7NzcuE1aErYXLId3bKPe20HOmWKvjDRU2bXaA==",
|
|
111
111
|
"dependencies": {
|
|
112
112
|
"@types/node": ">=8.1.0",
|
|
113
113
|
"qs": "^6.10.3"
|
|
@@ -184,9 +184,9 @@
|
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
186
|
"stripe": {
|
|
187
|
-
"version": "8.
|
|
188
|
-
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.
|
|
189
|
-
"integrity": "sha512-
|
|
187
|
+
"version": "8.217.0",
|
|
188
|
+
"resolved": "https://registry.npmjs.org/stripe/-/stripe-8.217.0.tgz",
|
|
189
|
+
"integrity": "sha512-CHWazNOrb1EBxTpepv5hCKMxOwF/oW3E4zRi8/LZIy5FC2y7A7NzcuE1aErYXLId3bKPe20HOmWKvjDRU2bXaA==",
|
|
190
190
|
"requires": {
|
|
191
191
|
"@types/node": ">=8.1.0",
|
|
192
192
|
"qs": "^6.10.3"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"node_modules/@types/node": {
|
|
29
|
-
"version": "14.18.
|
|
30
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.
|
|
31
|
-
"integrity": "sha512-
|
|
29
|
+
"version": "14.18.13",
|
|
30
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.13.tgz",
|
|
31
|
+
"integrity": "sha512-Z6/KzgyWOga3pJNS42A+zayjhPbf2zM3hegRQaOPnLOzEi86VV++6FLDWgR1LGrVCRufP/ph2daa3tEa5br1zA=="
|
|
32
32
|
},
|
|
33
33
|
"node_modules/is-promise": {
|
|
34
34
|
"version": "4.0.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"@types/node": {
|
|
61
|
-
"version": "14.18.
|
|
62
|
-
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.
|
|
63
|
-
"integrity": "sha512-
|
|
61
|
+
"version": "14.18.13",
|
|
62
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.13.tgz",
|
|
63
|
+
"integrity": "sha512-Z6/KzgyWOga3pJNS42A+zayjhPbf2zM3hegRQaOPnLOzEi86VV++6FLDWgR1LGrVCRufP/ph2daa3tEa5br1zA=="
|
|
64
64
|
},
|
|
65
65
|
"is-promise": {
|
|
66
66
|
"version": "4.0.0",
|
|
@@ -48,7 +48,7 @@ class FunctionsRegistry {
|
|
|
48
48
|
this.functionWatchers = new Map()
|
|
49
49
|
|
|
50
50
|
// Performance optimization: load '@netlify/zip-it-and-ship-it' on demand.
|
|
51
|
-
// eslint-disable-next-line
|
|
51
|
+
// eslint-disable-next-line n/global-require
|
|
52
52
|
const { listFunctions } = require('@netlify/zip-it-and-ship-it')
|
|
53
53
|
|
|
54
54
|
this.listFunctions = listFunctions
|
|
@@ -169,9 +169,9 @@ const createHandler = function (options) {
|
|
|
169
169
|
const getFunctionsServer = function (options) {
|
|
170
170
|
const { buildersPrefix = '', functionsPrefix = '', functionsRegistry, siteUrl } = options
|
|
171
171
|
// performance optimization, load express on demand
|
|
172
|
-
// eslint-disable-next-line
|
|
172
|
+
// eslint-disable-next-line n/global-require
|
|
173
173
|
const express = require('express')
|
|
174
|
-
// eslint-disable-next-line
|
|
174
|
+
// eslint-disable-next-line n/global-require
|
|
175
175
|
const expressLogging = require('express-logging')
|
|
176
176
|
const app = express()
|
|
177
177
|
const functionHandler = createHandler(options)
|
|
@@ -27,7 +27,7 @@ const getFunctionZips = async ({
|
|
|
27
27
|
|
|
28
28
|
if (manifestPath) {
|
|
29
29
|
try {
|
|
30
|
-
// eslint-disable-next-line import/no-dynamic-require,
|
|
30
|
+
// eslint-disable-next-line import/no-dynamic-require, n/global-require
|
|
31
31
|
const { functions, timestamp } = require(manifestPath)
|
|
32
32
|
const manifestAge = Date.now() - timestamp
|
|
33
33
|
|
|
@@ -192,9 +192,9 @@ const detectFrameworkSettings = async ({ projectDir }) => {
|
|
|
192
192
|
|
|
193
193
|
if (frameworks.length > 1) {
|
|
194
194
|
// performance optimization, load inquirer on demand
|
|
195
|
-
// eslint-disable-next-line
|
|
195
|
+
// eslint-disable-next-line n/global-require
|
|
196
196
|
const inquirer = require('inquirer')
|
|
197
|
-
// eslint-disable-next-line
|
|
197
|
+
// eslint-disable-next-line n/global-require
|
|
198
198
|
const inquirerAutocompletePrompt = require('inquirer-autocomplete-prompt')
|
|
199
199
|
/** multiple matching detectors, make the user choose */
|
|
200
200
|
inquirer.registerPrompt('autocomplete', inquirerAutocompletePrompt)
|
|
@@ -26,7 +26,7 @@ const getFunctions = async (functionsSrcDir, config = {}) => {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// performance optimization, load '@netlify/zip-it-and-ship-it' on demand
|
|
29
|
-
// eslint-disable-next-line
|
|
29
|
+
// eslint-disable-next-line n/global-require
|
|
30
30
|
const { listFunctions } = require('@netlify/zip-it-and-ship-it')
|
|
31
31
|
const functions = await listFunctions(functionsSrcDir, {
|
|
32
32
|
config: config.functions ? extractSchedule(config.functions) : undefined,
|
|
@@ -42,7 +42,7 @@ const getFunctionsAndWatchDirs = async (functionsSrcDir) => {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// performance optimization, load '@netlify/zip-it-and-ship-it' on demand
|
|
45
|
-
// eslint-disable-next-line
|
|
45
|
+
// eslint-disable-next-line n/global-require
|
|
46
46
|
const { listFunctions } = require('@netlify/zip-it-and-ship-it')
|
|
47
47
|
|
|
48
48
|
// get all functions files so we know which directories to watch
|
|
@@ -12,7 +12,7 @@ const GITHUB = 'GitHub'
|
|
|
12
12
|
*/
|
|
13
13
|
const readRepoURL = async function (_url) {
|
|
14
14
|
// TODO: use `url.URL()` instead
|
|
15
|
-
// eslint-disable-next-line
|
|
15
|
+
// eslint-disable-next-line n/no-deprecated-api
|
|
16
16
|
const URL = url.parse(_url)
|
|
17
17
|
const repoHost = validateRepoURL(_url)
|
|
18
18
|
if (repoHost !== GITHUB) throw new Error('only GitHub repos are supported for now')
|
|
@@ -38,7 +38,7 @@ const getRepoURLContents = async function (repoHost, ownerAndRepo, contentsPath)
|
|
|
38
38
|
|
|
39
39
|
const validateRepoURL = function (_url) {
|
|
40
40
|
// TODO: use `url.URL()` instead
|
|
41
|
-
// eslint-disable-next-line
|
|
41
|
+
// eslint-disable-next-line n/no-deprecated-api
|
|
42
42
|
const URL = url.parse(_url)
|
|
43
43
|
if (URL.host !== 'github.com') return null
|
|
44
44
|
// other validation logic here
|