netlify-cli 13.0.0 → 13.1.0
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/README.md +1 -1
- package/npm-shrinkwrap.json +2307 -1437
- package/package.json +14 -14
- package/src/commands/deploy/deploy.mjs +1 -1
- package/src/commands/functions/functions-create.mjs +2 -2
- package/src/commands/graph/graph.mjs +8 -1
- package/src/functions-templates/javascript/token-hider/package-lock.json +6 -6
- package/src/functions-templates/javascript/url-shortener/package-lock.json +6 -6
- package/src/functions-templates/rust/hello-world/Cargo.toml +1 -1
- package/src/functions-templates/typescript/hello-world/package-lock.json +6 -6
- package/src/lib/api.mjs +1 -1
- package/src/lib/build.mjs +0 -1
- package/src/lib/functions/registry.mjs +0 -1
- package/src/utils/addons/diffs/options.mjs +3 -3
- package/src/utils/command-helpers.mjs +3 -3
- package/src/utils/deploy/deploy-site.mjs +1 -1
- package/src/utils/deploy/hash-fns.mjs +0 -1
- package/src/utils/detect-server-settings.mjs +5 -5
- package/src/utils/dev.mjs +1 -1
- package/src/utils/dot-env.mjs +1 -1
- package/src/utils/init/utils.mjs +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": "13.
|
|
4
|
+
"version": "13.1.0",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"test:dev:vitest": "vitest run tests/unit/ && vitest run tests/integration",
|
|
60
60
|
"test:ci:ava:integration": "c8 -r json ava --concurrency 1 --no-worker-threads tests/integration/",
|
|
61
61
|
"test:ci:vitest:unit": "vitest run --coverage tests/unit/",
|
|
62
|
-
"test:ci:vitest:integration": "vitest run --coverage
|
|
62
|
+
"test:ci:vitest:integration": "vitest run --coverage tests/integration/",
|
|
63
63
|
"test:affected": "node ./tools/affected-test.mjs",
|
|
64
64
|
"e2e": "node ./tools/e2e/run.mjs",
|
|
65
65
|
"docs": "node ./site/scripts/docs.mjs",
|
|
@@ -76,12 +76,12 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@fastify/static": "^6.6.0",
|
|
79
|
-
"@netlify/build": "^29.5
|
|
79
|
+
"@netlify/build": "^29.6.5",
|
|
80
80
|
"@netlify/config": "^20.3.3",
|
|
81
|
-
"@netlify/edge-bundler": "^8.
|
|
82
|
-
"@netlify/framework-info": "^9.8.
|
|
81
|
+
"@netlify/edge-bundler": "^8.11.0",
|
|
82
|
+
"@netlify/framework-info": "^9.8.5",
|
|
83
83
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
84
|
-
"@netlify/zip-it-and-ship-it": "^8.
|
|
84
|
+
"@netlify/zip-it-and-ship-it": "^8.9.0",
|
|
85
85
|
"@octokit/rest": "^19.0.0",
|
|
86
86
|
"ansi-escapes": "^5.0.0",
|
|
87
87
|
"ansi-styles": "^5.0.0",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"ascii-table": "0.0.9",
|
|
90
90
|
"backoff": "^2.5.0",
|
|
91
91
|
"better-opn": "^3.0.0",
|
|
92
|
-
"boxen": "^
|
|
93
|
-
"chalk": "^
|
|
92
|
+
"boxen": "^7.0.1",
|
|
93
|
+
"chalk": "^5.0.0",
|
|
94
94
|
"chokidar": "^3.0.2",
|
|
95
95
|
"ci-info": "^3.0.0",
|
|
96
96
|
"clean-deep": "^3.0.2",
|
|
@@ -130,8 +130,8 @@
|
|
|
130
130
|
"https-proxy-agent": "^5.0.0",
|
|
131
131
|
"inquirer": "^6.5.1",
|
|
132
132
|
"inquirer-autocomplete-prompt": "^1.0.1",
|
|
133
|
-
"is-docker": "^
|
|
134
|
-
"is-plain-obj": "^
|
|
133
|
+
"is-docker": "^3.0.0",
|
|
134
|
+
"is-plain-obj": "^4.0.0",
|
|
135
135
|
"is-wsl": "^2.2.0",
|
|
136
136
|
"isexe": "^2.0.0",
|
|
137
137
|
"jsonwebtoken": "^9.0.0",
|
|
@@ -152,8 +152,8 @@
|
|
|
152
152
|
"node-fetch": "^2.6.0",
|
|
153
153
|
"node-version-alias": "^2.0.0",
|
|
154
154
|
"ora": "^5.0.0",
|
|
155
|
-
"p-filter": "^
|
|
156
|
-
"p-map": "^
|
|
155
|
+
"p-filter": "^3.0.0",
|
|
156
|
+
"p-map": "^5.0.0",
|
|
157
157
|
"p-wait-for": "^3.0.0",
|
|
158
158
|
"parallel-transform": "^1.2.0",
|
|
159
159
|
"parse-github-url": "^1.0.2",
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"devDependencies": {
|
|
186
186
|
"@babel/preset-react": "^7.12.13",
|
|
187
187
|
"@netlify/eslint-config-node": "^7.0.0",
|
|
188
|
-
"@vitest/coverage-c8": "^0.
|
|
188
|
+
"@vitest/coverage-c8": "^0.29.0",
|
|
189
189
|
"ava": "^4.0.0",
|
|
190
190
|
"c8": "^7.11.0",
|
|
191
191
|
"cpy": "^9.0.1",
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"typescript": "^4.4.4",
|
|
210
210
|
"verdaccio": "^5.10.2",
|
|
211
211
|
"vite": "^4.0.0",
|
|
212
|
-
"vitest": "^0.
|
|
212
|
+
"vitest": "^0.29.0"
|
|
213
213
|
},
|
|
214
214
|
"ava": {
|
|
215
215
|
"files": [
|
|
@@ -567,7 +567,7 @@ const deploy = async (options, command) => {
|
|
|
567
567
|
return triggerDeploy({ api, options, siteData, siteId })
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
-
const {
|
|
570
|
+
const { configMutations = [], newConfig } = await handleBuild({
|
|
571
571
|
cachedConfig: command.netlify.cachedConfig,
|
|
572
572
|
options,
|
|
573
573
|
})
|
|
@@ -361,7 +361,7 @@ const downloadFromURL = async function (command, options, argumentName, function
|
|
|
361
361
|
const fnTemplateFile = path.join(fnFolder, '.netlify-function-template.mjs')
|
|
362
362
|
if (await fileExistsAsync(fnTemplateFile)) {
|
|
363
363
|
const {
|
|
364
|
-
default: {
|
|
364
|
+
default: { addons = [], onComplete },
|
|
365
365
|
// eslint-disable-next-line import/no-dynamic-require
|
|
366
366
|
} = await import(pathToFileURL(fnTemplateFile).href)
|
|
367
367
|
|
|
@@ -463,7 +463,7 @@ const scaffoldFromTemplate = async function (command, options, argumentName, fun
|
|
|
463
463
|
} else if (chosenTemplate === 'report') {
|
|
464
464
|
log(`${NETLIFYDEVLOG} Open in browser: https://github.com/netlify/cli/issues/new`)
|
|
465
465
|
} else {
|
|
466
|
-
const {
|
|
466
|
+
const { addons = [], lang, name: templateName, onComplete } = chosenTemplate
|
|
467
467
|
const pathToTemplate = path.join(templatesDir, lang, templateName)
|
|
468
468
|
if (!fs.existsSync(pathToTemplate)) {
|
|
469
469
|
throw new Error(
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import { warn } from '../../utils/command-helpers.mjs'
|
|
3
|
+
|
|
2
4
|
import { createGraphConfigWriteCommand } from './graph-config-write.mjs'
|
|
3
5
|
import { createGraphEditCommand } from './graph-edit.mjs'
|
|
4
6
|
import { createGraphHandlerCommand } from './graph-handler.mjs'
|
|
@@ -32,7 +34,12 @@ export const createGraphCommand = (program) => {
|
|
|
32
34
|
|
|
33
35
|
return program
|
|
34
36
|
.command('graph')
|
|
35
|
-
.
|
|
37
|
+
.hook('preAction', () => {
|
|
38
|
+
warn(
|
|
39
|
+
'Netlify Graph is deprecated and will be removed from the CLI in a future release at the end of April, 2023. Please migrate off of Netlify Graph beforehand.',
|
|
40
|
+
)
|
|
41
|
+
})
|
|
42
|
+
.description('(Deprecated) Control the Netlify Graph functions for the current site')
|
|
36
43
|
.addExamples(['netlify graph:pull', 'netlify graph:edit'])
|
|
37
44
|
.action(graph)
|
|
38
45
|
}
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
20
20
|
},
|
|
21
21
|
"node_modules/axios": {
|
|
22
|
-
"version": "1.3.
|
|
23
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.
|
|
24
|
-
"integrity": "sha512-
|
|
22
|
+
"version": "1.3.4",
|
|
23
|
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz",
|
|
24
|
+
"integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"follow-redirects": "^1.15.0",
|
|
27
27
|
"form-data": "^4.0.0",
|
|
@@ -198,9 +198,9 @@
|
|
|
198
198
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
199
199
|
},
|
|
200
200
|
"axios": {
|
|
201
|
-
"version": "1.3.
|
|
202
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.
|
|
203
|
-
"integrity": "sha512-
|
|
201
|
+
"version": "1.3.4",
|
|
202
|
+
"resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz",
|
|
203
|
+
"integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==",
|
|
204
204
|
"requires": {
|
|
205
205
|
"follow-redirects": "^1.15.0",
|
|
206
206
|
"form-data": "^4.0.0",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"node_modules/hashids": {
|
|
54
|
-
"version": "2.2.
|
|
55
|
-
"resolved": "https://registry.npmjs.org/hashids/-/hashids-2.2.
|
|
56
|
-
"integrity": "sha512-
|
|
54
|
+
"version": "2.2.11",
|
|
55
|
+
"resolved": "https://registry.npmjs.org/hashids/-/hashids-2.2.11.tgz",
|
|
56
|
+
"integrity": "sha512-e1rAPT5Wa9vf/Dq1eq8LFw5VH2dtKxRf6k9bCw0GLwKL/SRnUphIcqwJWUZ1ki18cdj03nCrpdlJOcyHILQk8Q=="
|
|
57
57
|
},
|
|
58
58
|
"node_modules/mime-db": {
|
|
59
59
|
"version": "1.51.0",
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"hashids": {
|
|
108
|
-
"version": "2.2.
|
|
109
|
-
"resolved": "https://registry.npmjs.org/hashids/-/hashids-2.2.
|
|
110
|
-
"integrity": "sha512-
|
|
108
|
+
"version": "2.2.11",
|
|
109
|
+
"resolved": "https://registry.npmjs.org/hashids/-/hashids-2.2.11.tgz",
|
|
110
|
+
"integrity": "sha512-e1rAPT5Wa9vf/Dq1eq8LFw5VH2dtKxRf6k9bCw0GLwKL/SRnUphIcqwJWUZ1ki18cdj03nCrpdlJOcyHILQk8Q=="
|
|
111
111
|
},
|
|
112
112
|
"mime-db": {
|
|
113
113
|
"version": "1.51.0",
|
|
@@ -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.37",
|
|
30
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.37.tgz",
|
|
31
|
+
"integrity": "sha512-7GgtHCs/QZrBrDzgIJnQtuSvhFSwhyYSI2uafSwZoNt1iOGhEN5fwNrQMjtONyHm9+/LoA4453jH0CMYcr06Pg=="
|
|
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.37",
|
|
62
|
+
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.37.tgz",
|
|
63
|
+
"integrity": "sha512-7GgtHCs/QZrBrDzgIJnQtuSvhFSwhyYSI2uafSwZoNt1iOGhEN5fwNrQMjtONyHm9+/LoA4453jH0CMYcr06Pg=="
|
|
64
64
|
},
|
|
65
65
|
"is-promise": {
|
|
66
66
|
"version": "4.0.0",
|
package/src/lib/api.mjs
CHANGED
|
@@ -12,7 +12,7 @@ const FIRST_PAGE = 1
|
|
|
12
12
|
const MAX_PAGES = 10
|
|
13
13
|
const MAX_PER_PAGE = 100
|
|
14
14
|
export const listSites = async ({ api, options }) => {
|
|
15
|
-
const {
|
|
15
|
+
const { maxPages = MAX_PAGES, page = FIRST_PAGE, ...rest } = options
|
|
16
16
|
const sites = await api.listSites({ page, per_page: MAX_PER_PAGE, ...rest })
|
|
17
17
|
// TODO: use pagination headers when js-client returns them
|
|
18
18
|
if (sites.length === MAX_PER_PAGE && page + 1 <= maxPages) {
|
package/src/lib/build.mjs
CHANGED
|
@@ -194,7 +194,6 @@ export class FunctionsRegistry {
|
|
|
194
194
|
const functions = await this.listFunctions(directories, {
|
|
195
195
|
featureFlags: {
|
|
196
196
|
buildRustSource: env.NETLIFY_EXPERIMENTAL_BUILD_RUST_SOURCE === 'true',
|
|
197
|
-
project_deploy_configuration_api_use_per_function_configuration_files: true,
|
|
198
197
|
},
|
|
199
198
|
configFileDirectories: [getPathInProject([INTERNAL_FUNCTIONS_FOLDER])],
|
|
200
199
|
config: this.config.functions,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import ansiStyles from 'ansi-styles'
|
|
3
|
+
// eslint-disable-next-line no-restricted-imports
|
|
4
|
+
import { Chalk } from 'chalk'
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const forceColor = new chalk.Instance({ level: 1 })
|
|
6
|
+
const forceColor = new Chalk({ level: 1 })
|
|
7
7
|
|
|
8
8
|
const colorTheme = {
|
|
9
9
|
boolean: ansiStyles.yellow,
|
|
@@ -5,7 +5,7 @@ import process from 'process'
|
|
|
5
5
|
import { format, inspect } from 'util'
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line no-restricted-imports
|
|
8
|
-
import
|
|
8
|
+
import { Chalk } from 'chalk'
|
|
9
9
|
import chokidar from 'chokidar'
|
|
10
10
|
import decache from 'decache'
|
|
11
11
|
import WSL from 'is-wsl'
|
|
@@ -27,10 +27,10 @@ const argv = process.argv.slice(2)
|
|
|
27
27
|
*/
|
|
28
28
|
const safeChalk = function (noColors) {
|
|
29
29
|
if (noColors) {
|
|
30
|
-
const colorlessChalk = new
|
|
30
|
+
const colorlessChalk = new Chalk({ level: 0 })
|
|
31
31
|
return colorlessChalk
|
|
32
32
|
}
|
|
33
|
-
return new
|
|
33
|
+
return new Chalk()
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export const chalk = safeChalk(argv.includes('--json'))
|
|
@@ -39,6 +39,7 @@ export const deploySite = async (
|
|
|
39
39
|
maxRetry = DEFAULT_MAX_RETRY,
|
|
40
40
|
// API calls this the 'title'
|
|
41
41
|
message: title,
|
|
42
|
+
rootDir,
|
|
42
43
|
siteEnv,
|
|
43
44
|
skipFunctionsCache,
|
|
44
45
|
statusCb = () => {
|
|
@@ -46,7 +47,6 @@ export const deploySite = async (
|
|
|
46
47
|
},
|
|
47
48
|
syncFileLimit = DEFAULT_SYNC_LIMIT,
|
|
48
49
|
tmpDir = temporaryDirectory(),
|
|
49
|
-
rootDir,
|
|
50
50
|
} = {},
|
|
51
51
|
) => {
|
|
52
52
|
statusCb({
|
|
@@ -69,7 +69,6 @@ const getFunctionZips = async ({
|
|
|
69
69
|
const { zipFunctions } = await import('@netlify/zip-it-and-ship-it')
|
|
70
70
|
|
|
71
71
|
return await zipFunctions(directories, tmpDir, {
|
|
72
|
-
featureFlags: { project_deploy_configuration_api_use_per_function_configuration_files: true },
|
|
73
72
|
basePath: rootDir,
|
|
74
73
|
configFileDirectories: [getPathInProject([INTERNAL_FUNCTIONS_FOLDER])],
|
|
75
74
|
config: functionsConfig,
|
|
@@ -160,13 +160,13 @@ const getSettingsFromFramework = (framework) => {
|
|
|
160
160
|
build: { directory: dist },
|
|
161
161
|
dev: {
|
|
162
162
|
commands: [command],
|
|
163
|
-
port: frameworkPort,
|
|
164
163
|
pollingStrategies = [],
|
|
164
|
+
port: frameworkPort,
|
|
165
165
|
},
|
|
166
|
-
name: frameworkName,
|
|
167
|
-
staticAssetsDirectory: staticDir,
|
|
168
166
|
env = {},
|
|
167
|
+
name: frameworkName,
|
|
169
168
|
plugins,
|
|
169
|
+
staticAssetsDirectory: staticDir,
|
|
170
170
|
} = framework
|
|
171
171
|
|
|
172
172
|
return {
|
|
@@ -246,10 +246,10 @@ const handleCustomFramework = ({ devConfig }) => {
|
|
|
246
246
|
const mergeSettings = async ({ devConfig, frameworkSettings = {} }) => {
|
|
247
247
|
const {
|
|
248
248
|
command: frameworkCommand,
|
|
249
|
-
frameworkPort: frameworkDetectedPort,
|
|
250
249
|
dist,
|
|
251
|
-
framework,
|
|
252
250
|
env,
|
|
251
|
+
framework,
|
|
252
|
+
frameworkPort: frameworkDetectedPort,
|
|
253
253
|
pollingStrategies = [],
|
|
254
254
|
} = frameworkSettings
|
|
255
255
|
|
package/src/utils/dev.mjs
CHANGED
|
@@ -132,7 +132,7 @@ export const getSiteInformation = async ({ api, offline, site, siteInfo }) => {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
const getEnvSourceName = (source) => {
|
|
135
|
-
const {
|
|
135
|
+
const { name = source, printFn = chalk.green } = ENV_VAR_SOURCES[source] || {}
|
|
136
136
|
|
|
137
137
|
return printFn(name)
|
|
138
138
|
}
|
package/src/utils/dot-env.mjs
CHANGED
|
@@ -22,7 +22,7 @@ export const loadDotEnvFiles = async function ({ envFiles, projectDir }) {
|
|
|
22
22
|
// in the user configuration, the order is highest to lowest
|
|
23
23
|
const defaultEnvFiles = ['.env.development.local', '.env.local', '.env.development', '.env']
|
|
24
24
|
|
|
25
|
-
export const tryLoadDotEnvFiles = async ({
|
|
25
|
+
export const tryLoadDotEnvFiles = async ({ dotenvFiles = defaultEnvFiles, projectDir }) => {
|
|
26
26
|
const results = await Promise.all(
|
|
27
27
|
dotenvFiles.map(async (file) => {
|
|
28
28
|
const filepath = path.resolve(projectDir, file)
|
package/src/utils/init/utils.mjs
CHANGED
|
@@ -40,8 +40,8 @@ const getDefaultSettings = ({
|
|
|
40
40
|
const recommendedPlugins = getRecommendPlugins(frameworkPlugins, config)
|
|
41
41
|
const {
|
|
42
42
|
command: defaultBuildCmd = frameworkBuildCommand,
|
|
43
|
-
publish: defaultBuildDir = frameworkBuildDir,
|
|
44
43
|
functions: defaultFunctionsDir,
|
|
44
|
+
publish: defaultBuildDir = frameworkBuildDir,
|
|
45
45
|
} = config.build
|
|
46
46
|
|
|
47
47
|
return {
|
|
@@ -87,9 +87,9 @@ export const getBuildSettings = async ({ config, env, repositoryRoot, siteRoot }
|
|
|
87
87
|
const baseDirectory = getBaseDirectory({ repositoryRoot, siteRoot })
|
|
88
88
|
const nodeVersion = await detectNodeVersion({ baseDirectory, env })
|
|
89
89
|
const {
|
|
90
|
-
frameworkName,
|
|
91
90
|
frameworkBuildCommand,
|
|
92
91
|
frameworkBuildDir,
|
|
92
|
+
frameworkName,
|
|
93
93
|
frameworkPlugins = [],
|
|
94
94
|
} = await getFrameworkInfo({
|
|
95
95
|
baseDirectory,
|