netlify-cli 17.21.1 → 17.22.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.
Files changed (50) hide show
  1. package/dist/commands/deploy/deploy.d.ts.map +1 -1
  2. package/dist/commands/deploy/deploy.js +2 -3
  3. package/dist/commands/dev/dev.d.ts.map +1 -1
  4. package/dist/commands/dev/dev.js +3 -1
  5. package/dist/commands/functions/functions-create.d.ts.map +1 -1
  6. package/dist/commands/functions/functions-create.js +0 -1
  7. package/dist/commands/functions/functions-invoke.d.ts.map +1 -1
  8. package/dist/commands/functions/functions-invoke.js +0 -1
  9. package/dist/commands/integration/deploy.d.ts.map +1 -1
  10. package/dist/commands/integration/deploy.js +0 -4
  11. package/dist/commands/serve/index.d.ts.map +1 -1
  12. package/dist/commands/serve/index.js +1 -0
  13. package/dist/commands/serve/serve.d.ts.map +1 -1
  14. package/dist/commands/serve/serve.js +1 -0
  15. package/dist/lib/build.d.ts +2 -2
  16. package/dist/lib/build.d.ts.map +1 -1
  17. package/dist/lib/build.js +2 -2
  18. package/dist/lib/edge-functions/bootstrap.d.ts +2 -1
  19. package/dist/lib/edge-functions/bootstrap.d.ts.map +1 -1
  20. package/dist/lib/edge-functions/bootstrap.js +18 -2
  21. package/dist/lib/edge-functions/proxy.d.ts.map +1 -1
  22. package/dist/lib/edge-functions/proxy.js +1 -7
  23. package/dist/lib/geo-location.d.ts.map +1 -1
  24. package/dist/lib/geo-location.js +0 -1
  25. package/dist/lib/spinner.d.ts +7 -17
  26. package/dist/lib/spinner.d.ts.map +1 -1
  27. package/dist/lib/spinner.js +0 -14
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/dist/utils/detect-server-settings.js +1 -1
  30. package/dist/utils/framework-server.d.ts.map +1 -1
  31. package/dist/utils/framework-server.js +0 -2
  32. package/dist/utils/live-tunnel.d.ts.map +1 -1
  33. package/dist/utils/live-tunnel.js +0 -1
  34. package/dist/utils/proxy-server.d.ts +2 -1
  35. package/dist/utils/proxy-server.d.ts.map +1 -1
  36. package/dist/utils/proxy-server.js +2 -1
  37. package/dist/utils/proxy.d.ts +2 -1
  38. package/dist/utils/proxy.d.ts.map +1 -1
  39. package/dist/utils/proxy.js +29 -23
  40. package/dist/utils/read-repo-url.d.ts.map +1 -1
  41. package/dist/utils/read-repo-url.js +0 -1
  42. package/dist/utils/run-build.js +1 -1
  43. package/dist/utils/sign-redirect.d.ts +1 -1
  44. package/dist/utils/sign-redirect.d.ts.map +1 -1
  45. package/dist/utils/sign-redirect.js +0 -1
  46. package/dist/utils/sites/utils.d.ts.map +1 -1
  47. package/dist/utils/sites/utils.js +0 -1
  48. package/dist/utils/telemetry/request.js +0 -1
  49. package/npm-shrinkwrap.json +356 -805
  50. package/package.json +7 -6
@@ -60,7 +60,7 @@ const DEFAULT_STATIC_PORT = 3999;
60
60
  const getDefaultDist = (workingDir) => {
61
61
  log(`${NETLIFYDEVWARN} Unable to determine public folder to serve files from. Using current working directory`);
62
62
  log(`${NETLIFYDEVWARN} Setup a netlify.toml file with a [dev] section to specify your dev server settings.`);
63
- log(`${NETLIFYDEVWARN} See docs at: https://cli.netlify.com/netlify-dev#project-detection`);
63
+ log(`${NETLIFYDEVWARN} See docs at: https://docs.netlify.com/cli/local-development/#project-detection`);
64
64
  return workingDir;
65
65
  };
66
66
  const getStaticServerPort = async ({ devConfig }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"framework-server.d.ts","sourceRoot":"","sources":["../../src/utils/framework-server.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAK3C,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;SAI1B,MAAM;cACD,cAAc;MACtB,QAAQ,iBAAiB,CAqD5B,CAAA"}
1
+ {"version":3,"file":"framework-server.d.ts","sourceRoot":"","sources":["../../src/utils/framework-server.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAK3C,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;SAI1B,MAAM;cACD,cAAc;MACtB,QAAQ,iBAAiB,CAmD5B,CAAA"}
@@ -43,11 +43,9 @@ export const startFrameworkServer = async function ({ cwd, settings, }) {
43
43
  throw new Error(`Timed out waiting for port '${settings.frameworkPort}' to be open`);
44
44
  }
45
45
  }
46
- // @ts-expect-error TS(2345) FIXME: Argument of type '{ error: boolean; spinner: Ora; ... Remove this comment to see the full error message
47
46
  stopSpinner({ error: false, spinner });
48
47
  }
49
48
  catch (error_) {
50
- // @ts-expect-error TS(2345) FIXME: Argument of type '{ error: boolean; spinner: Ora; ... Remove this comment to see the full error message
51
49
  stopSpinner({ error: true, spinner });
52
50
  log(NETLIFYDEVERR, `Netlify Dev could not start or connect to localhost:${settings.frameworkPort}.`);
53
51
  log(NETLIFYDEVERR, `Please make sure your framework server is running on port ${settings.frameworkPort}`);
@@ -1 +1 @@
1
- {"version":3,"file":"live-tunnel.d.ts","sourceRoot":"","sources":["../../src/utils/live-tunnel.ts"],"names":[],"mappings":"AAgGA,eAAO,MAAM,eAAe;;;;;kBAkC3B,CAAA;AAGD,eAAO,MAAM,iBAAiB,oCAqB7B,CAAA"}
1
+ {"version":3,"file":"live-tunnel.d.ts","sourceRoot":"","sources":["../../src/utils/live-tunnel.ts"],"names":[],"mappings":"AA+FA,eAAO,MAAM,eAAe;;;;;kBAkC3B,CAAA;AAGD,eAAO,MAAM,iBAAiB,oCAqB7B,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import process from 'process';
2
- // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'node... Remove this comment to see the full error message
3
2
  import fetch from 'node-fetch';
4
3
  import pWaitFor from 'p-wait-for';
5
4
  import { v4 as uuidv4 } from 'uuid';
@@ -10,7 +10,7 @@ interface InspectSettings {
10
10
  address?: string;
11
11
  }
12
12
  export declare const generateInspectSettings: (edgeInspect: boolean | string, edgeInspectBrk: boolean | string) => InspectSettings;
13
- export declare const startProxyServer: ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, site, siteInfo, state, }: {
13
+ export declare const startProxyServer: ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, disableEdgeFunctions, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, site, siteInfo, state, }: {
14
14
  accountId: string;
15
15
  addonsUrls: $TSFixMe;
16
16
  blobsContext?: BlobsContext | undefined;
@@ -18,6 +18,7 @@ export declare const startProxyServer: ({ accountId, addonsUrls, blobsContext, c
18
18
  config: NetlifyOptions['config'];
19
19
  configPath?: string | undefined;
20
20
  debug: boolean;
21
+ disableEdgeFunctions: boolean;
21
22
  env: NetlifyOptions['cachedConfig']['env'];
22
23
  inspectSettings: InspectSettings;
23
24
  getUpdatedConfig: () => Promise<object>;
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-server.d.ts","sourceRoot":"","sources":["../../src/utils/proxy-server.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,UAAU,eAAe;IAEvB,OAAO,EAAE,OAAO,CAAA;IAEhB,KAAK,EAAE,OAAO,CAAA;IAEd,OAAO,CAAC,EAAE,MAAM,CAAA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,CAAC;qBACtB,MAAM;gBACX,MAAM;cACR,cAAc;aACf,OAAO;UACV,QAAQ;cACJ,QAAQ;gBACN,MAAM;;WAEX,WAAW;;qBA+BnB,CAAA"}
@@ -17,7 +17,7 @@ export const generateInspectSettings = (edgeInspect, edgeInspectBrk) => {
17
17
  address: getAddress(),
18
18
  };
19
19
  };
20
- export const startProxyServer = async ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, site, siteInfo, state, }) => {
20
+ export const startProxyServer = async ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, disableEdgeFunctions, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, site, siteInfo, state, }) => {
21
21
  const url = await startProxy({
22
22
  addonsUrls,
23
23
  blobsContext,
@@ -25,6 +25,7 @@ export const startProxyServer = async ({ accountId, addonsUrls, blobsContext, co
25
25
  config,
26
26
  configPath: configPath || site.configPath,
27
27
  debug,
28
+ disableEdgeFunctions,
28
29
  env,
29
30
  functionsRegistry,
30
31
  geolocationMode,
@@ -2,8 +2,9 @@ import { BaseCommand } from '../commands/index.js';
2
2
  import { $TSFixMe } from '../commands/types.js';
3
3
  import { ServerSettings } from './types.js';
4
4
  export declare const getProxyUrl: (settings: Pick<ServerSettings, 'https' | 'port'>) => string;
5
- export declare const startProxy: ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, siteInfo, state, }: {
5
+ export declare const startProxy: ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, disableEdgeFunctions, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, siteInfo, state, }: {
6
6
  command: BaseCommand;
7
7
  settings: ServerSettings;
8
+ disableEdgeFunctions: boolean;
8
9
  } & Record<string, any>) => Promise<string>;
9
10
  //# sourceMappingURL=proxy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/utils/proxy.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAkB/C,OAAO,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAA;AAutB9D,eAAO,MAAM,WAAW,aAAuB,KAAK,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,WAGpF,CAAA;AAED,eAAO,MAAM,UAAU;aAoBT,WAAW;cAAY,cAAc;2CA2FlD,CAAA"}
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/utils/proxy.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAkB/C,OAAO,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAA;AA0tB9D,eAAO,MAAM,WAAW,aAAuB,KAAK,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC,WAGpF,CAAA;AAID,eAAO,MAAM,UAAU;aAqBT,WAAW;cAAY,cAAc;0BAAwB,OAAO;2CAoGjF,CAAA"}
@@ -531,7 +531,7 @@ const onRequest = async ({ addonsUrls, edgeFunctionsProxy, env, functionsRegistr
531
531
  if (isImageRequest(req)) {
532
532
  return imageProxy(req, res);
533
533
  }
534
- const edgeFunctionsProxyURL = await edgeFunctionsProxy(req, res);
534
+ const edgeFunctionsProxyURL = await edgeFunctionsProxy?.(req);
535
535
  if (edgeFunctionsProxyURL !== undefined) {
536
536
  return proxy.web(req, res, { target: edgeFunctionsProxyURL });
537
537
  }
@@ -593,30 +593,36 @@ export const getProxyUrl = function (settings) {
593
593
  const scheme = settings.https ? 'https' : 'http';
594
594
  return `${scheme}://localhost:${settings.port}`;
595
595
  };
596
- export const startProxy = async function ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, siteInfo, state, }) {
596
+ export const startProxy = async function ({ accountId, addonsUrls, blobsContext, command, config, configPath, debug, disableEdgeFunctions, env, functionsRegistry, geoCountry, geolocationMode, getUpdatedConfig, inspectSettings, offline, projectDir, repositoryRoot, settings, siteInfo, state, }) {
597
597
  const secondaryServerPort = settings.https ? await getAvailablePort() : null;
598
598
  const functionsServer = settings.functionsPort ? `http://127.0.0.1:${settings.functionsPort}` : null;
599
- const edgeFunctionsProxy = await initializeEdgeFunctionsProxy({
600
- command,
601
- blobsContext,
602
- config,
603
- configPath,
604
- debug,
605
- env,
606
- geolocationMode,
607
- geoCountry,
608
- getUpdatedConfig,
609
- inspectSettings,
610
- mainPort: settings.port,
611
- offline,
612
- passthroughPort: secondaryServerPort || settings.port,
613
- settings,
614
- projectDir,
615
- repositoryRoot,
616
- siteInfo,
617
- accountId,
618
- state,
619
- });
599
+ let edgeFunctionsProxy;
600
+ if (disableEdgeFunctions) {
601
+ log(NETLIFYDEVWARN, 'Edge functions are disabled. Run without the --internal-disable-edge-functions flag to enable them.');
602
+ }
603
+ else {
604
+ edgeFunctionsProxy = await initializeEdgeFunctionsProxy({
605
+ command,
606
+ blobsContext,
607
+ config,
608
+ configPath,
609
+ debug,
610
+ env,
611
+ geolocationMode,
612
+ geoCountry,
613
+ getUpdatedConfig,
614
+ inspectSettings,
615
+ mainPort: settings.port,
616
+ offline,
617
+ passthroughPort: secondaryServerPort || settings.port,
618
+ settings,
619
+ projectDir,
620
+ repositoryRoot,
621
+ siteInfo,
622
+ accountId,
623
+ state,
624
+ });
625
+ }
620
626
  const imageProxy = await initializeImageProxy({
621
627
  config,
622
628
  settings,
@@ -1 +1 @@
1
- {"version":3,"file":"read-repo-url.d.ts","sourceRoot":"","sources":["../../src/utils/read-repo-url.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,6BASvB,CAAA;AAkBD;;GAEG;AAEH,eAAO,MAAM,eAAe,gCAO3B,CAAA;AAGD,eAAO,MAAM,YAAY,oCASxB,CAAA"}
1
+ {"version":3,"file":"read-repo-url.d.ts","sourceRoot":"","sources":["../../src/utils/read-repo-url.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AAEH,eAAO,MAAM,WAAW,6BASvB,CAAA;AAkBD;;GAEG;AAEH,eAAO,MAAM,eAAe,gCAO3B,CAAA;AAGD,eAAO,MAAM,YAAY,oCASxB,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import url from 'url';
2
- // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'node... Remove this comment to see the full error message
3
2
  import fetch from 'node-fetch';
4
3
  // supported repo host types
5
4
  const GITHUB = 'GitHub';
@@ -57,7 +57,7 @@ export const runNetlifyBuild = async ({ command, env = {}, options, settings, ti
57
57
  cwd: cachedConfig.buildDir,
58
58
  quiet: options.quiet,
59
59
  saveConfig: options.saveConfig,
60
- edgeFunctionsBootstrapURL: getBootstrapURL(),
60
+ edgeFunctionsBootstrapURL: await getBootstrapURL(),
61
61
  };
62
62
  const devCommand = async (settingsOverrides = {}) => {
63
63
  let cwd = command.workingDir;
@@ -3,5 +3,5 @@ export declare const signRedirect: ({ deployContext, secret, siteID, siteURL }:
3
3
  secret: any;
4
4
  siteID: any;
5
5
  siteURL: any;
6
- }) => any;
6
+ }) => string;
7
7
  //# sourceMappingURL=sign-redirect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sign-redirect.d.ts","sourceRoot":"","sources":["../../src/utils/sign-redirect.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;SAYxB,CAAA"}
1
+ {"version":3,"file":"sign-redirect.d.ts","sourceRoot":"","sources":["../../src/utils/sign-redirect.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;;;;YAYxB,CAAA"}
@@ -1,4 +1,3 @@
1
- // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'json... Remove this comment to see the full error message
2
1
  import jwt from 'jsonwebtoken';
3
2
  // https://docs.netlify.com/routing/redirects/rewrites-proxies/#signed-proxy-redirects
4
3
  // @ts-expect-error TS(7031) FIXME: Binding element 'deployContext' implicitly has an ... Remove this comment to see the full error message
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/sites/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,8BAoBlC,CAAA;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;EAkB5B,CAAA;AAED,eAAO,MAAM,UAAU,iBAAwB,MAAM,WAAW,MAAM,YAAY,MAAM,iBAcvF,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/sites/utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,8BAoBlC,CAAA;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;EAkB5B,CAAA;AAED,eAAO,MAAM,UAAU,iBAAwB,MAAM,WAAW,MAAM,YAAY,MAAM,iBAcvF,CAAA"}
@@ -1,4 +1,3 @@
1
- // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'node... Remove this comment to see the full error message
2
1
  import fetch from 'node-fetch';
3
2
  // @ts-expect-error TS(7006) FIXME: Parameter 'token' implicitly has an 'any' type.
4
3
  export const getTemplatesFromGitHub = async (token) => {
@@ -1,7 +1,6 @@
1
1
  // This file is being called by `src/utils/telemetry/telemetry.js` as a child process
2
2
  // to run a s a detached process
3
3
  import process from 'process';
4
- // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'node... Remove this comment to see the full error message
5
4
  import fetch from 'node-fetch';
6
5
  import getPackageJson from '../get-package-json.js';
7
6
  const { name, version } = await getPackageJson();