netlify-cli 10.2.0 → 10.3.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/npm-shrinkwrap.json +1107 -291
- package/package.json +3 -3
- package/src/commands/deploy/deploy.js +45 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "netlify-cli",
|
|
3
3
|
"description": "Netlify command line tool",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.3.0",
|
|
5
5
|
"author": "Netlify Inc.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
|
|
@@ -208,9 +208,9 @@
|
|
|
208
208
|
"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\""
|
|
209
209
|
},
|
|
210
210
|
"dependencies": {
|
|
211
|
-
"@netlify/build": "^27.
|
|
211
|
+
"@netlify/build": "^27.1.1",
|
|
212
212
|
"@netlify/config": "^18.0.0",
|
|
213
|
-
"@netlify/edge-bundler": "^1.
|
|
213
|
+
"@netlify/edge-bundler": "^1.1.0",
|
|
214
214
|
"@netlify/framework-info": "^9.0.2",
|
|
215
215
|
"@netlify/local-functions-proxy": "^1.1.1",
|
|
216
216
|
"@netlify/plugins-list": "^6.19.0",
|
|
@@ -8,6 +8,7 @@ const inquirer = require('inquirer')
|
|
|
8
8
|
const isObject = require('lodash/isObject')
|
|
9
9
|
const prettyjson = require('prettyjson')
|
|
10
10
|
|
|
11
|
+
const runCoreStepPromise = import('@netlify/build')
|
|
11
12
|
const netlifyConfigPromise = import('@netlify/config')
|
|
12
13
|
|
|
13
14
|
const { cancelDeploy } = require('../../lib/api')
|
|
@@ -274,6 +275,10 @@ const deployProgressCb = function () {
|
|
|
274
275
|
}
|
|
275
276
|
return
|
|
276
277
|
}
|
|
278
|
+
case 'error':
|
|
279
|
+
stopSpinner({ error: true, spinner: events[event.type], text: event.msg })
|
|
280
|
+
delete events[event.type]
|
|
281
|
+
return
|
|
277
282
|
case 'stop':
|
|
278
283
|
default: {
|
|
279
284
|
stopSpinner({ spinner: events[event.type], text: event.msg })
|
|
@@ -381,6 +386,40 @@ const handleBuild = async ({ cachedConfig, options }) => {
|
|
|
381
386
|
return { newConfig, configMutations }
|
|
382
387
|
}
|
|
383
388
|
|
|
389
|
+
/**
|
|
390
|
+
*
|
|
391
|
+
* @param {object} options Bundling options
|
|
392
|
+
* @returns
|
|
393
|
+
*/
|
|
394
|
+
const bundleEdgeFunctions = async (options) => {
|
|
395
|
+
const { runCoreSteps } = await runCoreStepPromise
|
|
396
|
+
const statusCb = options.silent ? () => {} : deployProgressCb()
|
|
397
|
+
|
|
398
|
+
statusCb({
|
|
399
|
+
type: 'edge-functions-bundling',
|
|
400
|
+
msg: 'Bundling edge functions...\n',
|
|
401
|
+
phase: 'start',
|
|
402
|
+
})
|
|
403
|
+
|
|
404
|
+
const { severityCode, success } = await runCoreSteps(['edge_functions_bundling'], { ...options, buffer: true })
|
|
405
|
+
|
|
406
|
+
if (!success) {
|
|
407
|
+
statusCb({
|
|
408
|
+
type: 'edge-functions-bundling',
|
|
409
|
+
msg: 'Deploy aborted due to error while bundling edge functions',
|
|
410
|
+
phase: 'error',
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
exit(severityCode)
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
statusCb({
|
|
417
|
+
type: 'edge-functions-bundling',
|
|
418
|
+
msg: 'Finished bundling edge functions',
|
|
419
|
+
phase: 'stop',
|
|
420
|
+
})
|
|
421
|
+
}
|
|
422
|
+
|
|
384
423
|
/**
|
|
385
424
|
*
|
|
386
425
|
* @param {object} config
|
|
@@ -526,6 +565,12 @@ const deploy = async (options, command) => {
|
|
|
526
565
|
const deployFolder = await getDeployFolder({ options, config, site, siteData })
|
|
527
566
|
const functionsFolder = getFunctionsFolder({ options, config, site, siteData })
|
|
528
567
|
const { configPath } = site
|
|
568
|
+
const edgeFunctionsConfig = command.netlify.config.edge_functions
|
|
569
|
+
|
|
570
|
+
// build flag wasn't used and edge functions exist
|
|
571
|
+
if (!options.build && edgeFunctionsConfig && edgeFunctionsConfig.length !== 0) {
|
|
572
|
+
await bundleEdgeFunctions(options)
|
|
573
|
+
}
|
|
529
574
|
|
|
530
575
|
log(
|
|
531
576
|
prettyjson.render({
|