netlify-cli 16.0.0 → 16.0.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "16.0.0",
4
+ "version": "16.0.2",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -44,13 +44,13 @@
44
44
  "dependencies": {
45
45
  "@bugsnag/js": "7.20.2",
46
46
  "@fastify/static": "6.10.2",
47
- "@netlify/build": "29.19.0",
47
+ "@netlify/build": "29.20.2",
48
48
  "@netlify/build-info": "7.7.3",
49
49
  "@netlify/config": "20.8.0",
50
50
  "@netlify/edge-bundler": "8.17.1",
51
51
  "@netlify/local-functions-proxy": "1.1.1",
52
52
  "@netlify/serverless-functions-api": "1.5.2",
53
- "@netlify/zip-it-and-ship-it": "9.13.1",
53
+ "@netlify/zip-it-and-ship-it": "9.15.1",
54
54
  "@octokit/rest": "19.0.13",
55
55
  "ansi-escapes": "6.2.0",
56
56
  "ansi-styles": "6.2.1",
@@ -48,6 +48,7 @@ const build = async (options, command) => {
48
48
 
49
49
  const buildOptions = await getBuildOptions({
50
50
  cachedConfig,
51
+ packagePath: command.workspacePackage,
51
52
  token,
52
53
  options,
53
54
  })
@@ -13,6 +13,7 @@ import prettyjson from 'prettyjson'
13
13
 
14
14
  import { cancelDeploy } from '../../lib/api.mjs'
15
15
  import { getBuildOptions, runBuild } from '../../lib/build.mjs'
16
+ import { getBootstrapURL } from '../../lib/edge-functions/bootstrap.mjs'
16
17
  import { featureFlags as edgeFunctionsFeatureFlags } from '../../lib/edge-functions/consts.mjs'
17
18
  import { normalizeFunctionsConfig } from '../../lib/functions/config.mjs'
18
19
  import { BACKGROUND_FUNCTIONS_WARNING } from '../../lib/log.mjs'
@@ -399,16 +400,18 @@ const runDeploy = async ({
399
400
  *
400
401
  * @param {object} config
401
402
  * @param {*} config.cachedConfig
403
+ * @param {string} [config.packagePath]
402
404
  * @param {import('commander').OptionValues} config.options The options of the command
403
405
  * @returns
404
406
  */
405
- const handleBuild = async ({ cachedConfig, options }) => {
407
+ const handleBuild = async ({ cachedConfig, options, packagePath }) => {
406
408
  if (!options.build) {
407
409
  return {}
408
410
  }
409
411
  const [token] = await getToken()
410
412
  const resolvedOptions = await getBuildOptions({
411
413
  cachedConfig,
414
+ packagePath,
412
415
  token,
413
416
  options,
414
417
  })
@@ -442,6 +445,7 @@ const bundleEdgeFunctions = async (options, command) => {
442
445
  packagePath: command.workspacePackage,
443
446
  buffer: true,
444
447
  featureFlags: edgeFunctionsFeatureFlags,
448
+ edgeFunctionsBootstrapURL: getBootstrapURL(),
445
449
  })
446
450
 
447
451
  if (!success) {
@@ -587,6 +591,7 @@ const deploy = async (options, command) => {
587
591
  }
588
592
 
589
593
  const { configMutations = [], newConfig } = await handleBuild({
594
+ packagePath: command.workspacePackage,
590
595
  cachedConfig: command.netlify.cachedConfig,
591
596
  options,
592
597
  })
package/src/lib/build.mjs CHANGED
@@ -3,6 +3,7 @@ import process from 'process'
3
3
 
4
4
  import build from '@netlify/build'
5
5
 
6
+ import { getBootstrapURL } from './edge-functions/bootstrap.mjs'
6
7
  import { featureFlags as edgeFunctionsFeatureFlags } from './edge-functions/consts.mjs'
7
8
 
8
9
  /**
@@ -18,6 +19,7 @@ import { featureFlags as edgeFunctionsFeatureFlags } from './edge-functions/cons
18
19
  *
19
20
  * @param {object} config
20
21
  * @param {*} config.cachedConfig
22
+ * @param {string} [config.packagePath]
21
23
  * @param {string} config.token
22
24
  * @param {import('commander').OptionValues} config.options
23
25
  * @returns {BuildConfig}
@@ -25,10 +27,12 @@ import { featureFlags as edgeFunctionsFeatureFlags } from './edge-functions/cons
25
27
  export const getBuildOptions = ({
26
28
  cachedConfig,
27
29
  options: { context, cwd, debug, dry, json, offline, silent },
30
+ packagePath,
28
31
  token,
29
32
  }) => ({
30
33
  cachedConfig,
31
34
  siteId: cachedConfig.siteInfo.id,
35
+ packagePath,
32
36
  token,
33
37
  dry,
34
38
  debug,
@@ -43,6 +47,7 @@ export const getBuildOptions = ({
43
47
  ...edgeFunctionsFeatureFlags,
44
48
  functionsBundlingManifest: true,
45
49
  },
50
+ edgeFunctionsBootstrapURL: getBootstrapURL(),
46
51
  })
47
52
 
48
53
  /**
@@ -219,6 +219,20 @@ const getFunctionsServer = (options) => {
219
219
  return app
220
220
  }
221
221
 
222
+ /**
223
+ *
224
+ * @param {object} options
225
+ * @param {import('../../commands/base-command.mjs').default} options.command
226
+ * @param {*} options.capabilities
227
+ * @param {*} options.config
228
+ * @param {boolean} options.debug
229
+ * @param {*} options.loadDistFunctions
230
+ * @param {*} options.settings
231
+ * @param {*} options.site
232
+ * @param {string} options.siteUrl
233
+ * @param {*} options.timeouts
234
+ * @returns
235
+ */
222
236
  export const startFunctionsServer = async (options) => {
223
237
  const { capabilities, command, config, debug, loadDistFunctions, settings, site, siteUrl, timeouts } = options
224
238
  const internalFunctionsDir = await getInternalFunctionsDir({ base: site.root })
@@ -260,15 +274,22 @@ export const startFunctionsServer = async (options) => {
260
274
 
261
275
  const server = await getFunctionsServer(Object.assign(options, { functionsRegistry }))
262
276
 
263
- await startWebServer({ server, settings })
277
+ await startWebServer({ server, settings, debug })
264
278
  }
265
279
 
266
- const startWebServer = async ({ server, settings }) => {
267
- await new Promise((resolve) => {
268
- server.listen(settings.functionsPort, (err) => {
280
+ /**
281
+ *
282
+ * @param {object} config
283
+ * @param {boolean} config.debug
284
+ * @param {ReturnType<Awaited<typeof getFunctionsServer>>} config.server
285
+ * @param {*} config.settings
286
+ */
287
+ const startWebServer = async ({ debug, server, settings }) => {
288
+ await new Promise((/** @type {(resolve: void) => void} */ resolve) => {
289
+ server.listen(settings.functionsPort, (/** @type {unknown} */ err) => {
269
290
  if (err) {
270
291
  errorExit(`${NETLIFYDEVERR} Unable to start functions server: ${err}`)
271
- } else {
292
+ } else if (debug) {
272
293
  log(`${NETLIFYDEVLOG} Functions server is listening on ${settings.functionsPort}`)
273
294
  }
274
295
  resolve()
@@ -2,6 +2,7 @@
2
2
  import { promises as fs } from 'fs'
3
3
  import path, { join } from 'path'
4
4
 
5
+ import { getBootstrapURL } from '../lib/edge-functions/bootstrap.mjs'
5
6
  import { INTERNAL_EDGE_FUNCTIONS_FOLDER } from '../lib/edge-functions/consts.mjs'
6
7
  import { getPathInProject } from '../lib/settings.mjs'
7
8
 
@@ -73,6 +74,7 @@ export const runNetlifyBuild = async ({ command, env = {}, options, settings, ti
73
74
  cwd: cachedConfig.buildDir,
74
75
  quiet: options.quiet,
75
76
  saveConfig: options.saveConfig,
77
+ edgeFunctionsBootstrapURL: getBootstrapURL(),
76
78
  }
77
79
 
78
80
  const devCommand = async (settingsOverrides = {}) => {