netlify-cli 12.5.0 → 12.6.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 (83) hide show
  1. package/npm-shrinkwrap.json +908 -582
  2. package/package.json +5 -159
  3. package/src/commands/deploy/deploy.mjs +1 -1
  4. package/src/commands/dev/dev.mjs +24 -11
  5. package/src/commands/env/env-list.mjs +1 -0
  6. package/src/commands/functions/functions-create.mjs +35 -25
  7. package/src/commands/sites/sites-list.mjs +1 -1
  8. package/src/commands/watch/watch.mjs +1 -1
  9. package/src/functions-templates/go/hello-world/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  10. package/src/functions-templates/javascript/apollo-graphql/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  11. package/src/functions-templates/javascript/apollo-graphql-rest/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  12. package/src/functions-templates/javascript/auth-fetch/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  13. package/src/functions-templates/javascript/create-user/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  14. package/src/functions-templates/javascript/fauna-crud/{.netlify-function-template.cjs → .netlify-function-template.mjs} +3 -2
  15. package/src/functions-templates/javascript/fauna-graphql/{.netlify-function-template.cjs → .netlify-function-template.mjs} +3 -2
  16. package/src/functions-templates/javascript/google-analytics/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  17. package/src/functions-templates/javascript/graphql-gateway/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  18. package/src/functions-templates/javascript/hasura-event-triggered/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  19. package/src/functions-templates/javascript/hello/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  20. package/src/functions-templates/{typescript/hello-world/.netlify-function-template.cjs → javascript/hello-world/.netlify-function-template.mjs} +1 -1
  21. package/src/functions-templates/javascript/identity-signup/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  22. package/src/functions-templates/javascript/image-external/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  23. package/src/functions-templates/javascript/localized-content/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  24. package/src/functions-templates/javascript/node-fetch/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  25. package/src/functions-templates/javascript/oauth-passport/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  26. package/src/functions-templates/javascript/protected-function/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  27. package/src/functions-templates/javascript/sanity-create/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  28. package/src/functions-templates/javascript/sanity-groq/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  29. package/src/functions-templates/javascript/scheduled-function/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  30. package/src/functions-templates/javascript/scheduled-function/package.json +1 -1
  31. package/src/functions-templates/javascript/send-email/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  32. package/src/functions-templates/javascript/serverless-ssr/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  33. package/src/functions-templates/javascript/set-cookie/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  34. package/src/functions-templates/javascript/set-cookies/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  35. package/src/functions-templates/{typescript/set-req-header/.netlify-function-template.cjs → javascript/set-req-header/.netlify-function-template.mjs} +1 -1
  36. package/src/functions-templates/javascript/set-res-header/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  37. package/src/functions-templates/javascript/slack-rate-limit/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  38. package/src/functions-templates/javascript/stripe-charge/{.netlify-function-template.cjs → .netlify-function-template.mjs} +2 -2
  39. package/src/functions-templates/javascript/stripe-subscription/{.netlify-function-template.cjs → .netlify-function-template.mjs} +2 -2
  40. package/src/functions-templates/javascript/submission-created/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  41. package/src/functions-templates/javascript/token-hider/{.netlify-function-template.cjs → .netlify-function-template.mjs} +2 -2
  42. package/src/functions-templates/{typescript/transform-response/.netlify-function-template.cjs → javascript/transform-response/.netlify-function-template.mjs} +1 -1
  43. package/src/functions-templates/javascript/url-shortener/{.netlify-function-template.cjs → .netlify-function-template.mjs} +2 -2
  44. package/src/functions-templates/javascript/using-middleware/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  45. package/src/functions-templates/rust/hello-world/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  46. package/src/functions-templates/typescript/abtest/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  47. package/src/functions-templates/typescript/geolocation/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  48. package/src/functions-templates/typescript/geolocation/{{name}}.ts +1 -1
  49. package/src/functions-templates/{javascript/hello-world/.netlify-function-template.cjs → typescript/hello-world/.netlify-function-template.mjs} +1 -1
  50. package/src/functions-templates/typescript/hello-world/package-lock.json +7 -7
  51. package/src/functions-templates/typescript/hello-world/package.json +1 -1
  52. package/src/functions-templates/typescript/json/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  53. package/src/functions-templates/typescript/json/{{name}}.ts +1 -1
  54. package/src/functions-templates/typescript/log/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  55. package/src/functions-templates/typescript/log/{{name}}.ts +2 -2
  56. package/src/functions-templates/typescript/scheduled-function/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  57. package/src/functions-templates/typescript/scheduled-function/package.json +1 -1
  58. package/src/functions-templates/typescript/set-cookies/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  59. package/src/functions-templates/{javascript/set-req-header/.netlify-function-template.cjs → typescript/set-req-header/.netlify-function-template.mjs} +1 -1
  60. package/src/functions-templates/typescript/set-res-header/{.netlify-function-template.cjs → .netlify-function-template.mjs} +1 -1
  61. package/src/functions-templates/{javascript/transform-response/.netlify-function-template.cjs → typescript/transform-response/.netlify-function-template.mjs} +1 -1
  62. package/src/lib/completion/constants.mjs +1 -1
  63. package/src/lib/edge-functions/deploy.mjs +1 -1
  64. package/src/lib/edge-functions/internal.mjs +1 -1
  65. package/src/lib/edge-functions/proxy.mjs +2 -2
  66. package/src/lib/{fs.cjs → fs.mjs} +5 -13
  67. package/src/lib/functions/runtimes/js/builders/netlify-lambda.mjs +1 -1
  68. package/src/lib/functions/runtimes/js/builders/zisi.mjs +1 -1
  69. package/src/lib/functions/runtimes/rust/index.mjs +1 -1
  70. package/src/lib/{settings.cjs → settings.mjs} +6 -8
  71. package/src/lib/{spinner.cjs → spinner.mjs} +5 -7
  72. package/src/utils/command-helpers.mjs +1 -1
  73. package/src/utils/dot-env.mjs +1 -1
  74. package/src/utils/functions/functions.mjs +2 -2
  75. package/src/utils/functions/get-functions.mjs +1 -1
  76. package/src/utils/get-global-config.mjs +1 -1
  77. package/src/utils/gitignore.mjs +1 -1
  78. package/src/utils/init/utils.mjs +1 -1
  79. package/src/utils/live-tunnel.mjs +1 -1
  80. package/src/utils/lm/install.mjs +2 -2
  81. package/src/utils/proxy.mjs +1 -1
  82. package/src/utils/rules-proxy.mjs +1 -1
  83. package/src/utils/state-config.mjs +1 -1
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'set-res-header',
3
3
  description: 'Adds a custom HTTP header to HTTP response.',
4
4
  functionType: 'edge',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'slack-rate-limit',
3
3
  description: 'Slack Rate-limit: post to Slack, at most once an hour, using Netlify Identity metadata',
4
4
  functionType: 'serverless',
@@ -1,6 +1,6 @@
1
- const chalk = require('chalk')
1
+ import chalk from 'chalk'
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  name: 'stripe-charge',
5
5
  description: 'Stripe Charge: Charge a user with Stripe',
6
6
  functionType: 'serverless',
@@ -1,6 +1,6 @@
1
- const chalk = require('chalk')
1
+ import chalk from 'chalk'
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  name: 'stripe-subscription',
5
5
  description: 'Stripe subscription: Create a subscription with Stripe',
6
6
  functionType: 'serverless',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'submission-created',
3
3
  description: 'submission-created: template for event triggered function when a new Netlify Form is submitted',
4
4
  functionType: 'serverless',
@@ -1,6 +1,6 @@
1
- const chalk = require('chalk')
1
+ import chalk from 'chalk'
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  name: 'token-hider',
5
5
  description: 'Token Hider: access APIs without exposing your API keys',
6
6
  functionType: 'serverless',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'transform-response',
3
3
  description: 'Transform the content of an HTTP response',
4
4
  functionType: 'edge',
@@ -1,6 +1,6 @@
1
- const chalk = require('chalk')
1
+ import chalk from 'chalk'
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  name: 'url-shortener',
5
5
  description: 'URL Shortener: simple URL shortener with Netlify Forms!',
6
6
  functionType: 'serverless',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'using-middleware',
3
3
  description: 'Using Middleware with middy',
4
4
  functionType: 'serverless',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'hello-world',
3
3
  priority: 1,
4
4
  description: 'Basic function that shows how to create a handler and return a response',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'abtest',
3
3
  description: "Function that randomly assigns users to group 'a' or 'b' and sets this value as a cookie.",
4
4
  functionType: 'edge',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'geolocation',
3
3
  description: "Returns info about user's geolocation, which can be used to serve location-specific content.",
4
4
  functionType: 'edge',
@@ -17,7 +17,7 @@ export default async (request: Request, context: Context) => {
17
17
  // }
18
18
  // }
19
19
 
20
- return context.json({
20
+ return Response.json({
21
21
  geo: context.geo,
22
22
  header: request.headers.get("x-nf-geo"),
23
23
  });
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'hello-world',
3
3
  priority: 1,
4
4
  description: 'Basic function that shows async/await usage, and response formatting',
@@ -9,15 +9,15 @@
9
9
  "version": "1.0.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@netlify/functions": "^1.3.0",
12
+ "@netlify/functions": "^1.4.0",
13
13
  "@types/node": "^14.0.0",
14
14
  "typescript": "^4.0.0"
15
15
  }
16
16
  },
17
17
  "node_modules/@netlify/functions": {
18
- "version": "1.3.0",
19
- "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.3.0.tgz",
20
- "integrity": "sha512-hN/Fgpz8XIOBfsBPLYUMxVKBlCopgeqGB0popayicnmkFLnvKByTTMYgF01wcF9DBtBQdV0H2h1kPFpMl34I8w==",
18
+ "version": "1.4.0",
19
+ "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.4.0.tgz",
20
+ "integrity": "sha512-gy7ULTIRroc2/jyFVGx1djCmmBMVisIwrvkqggq5B6iDcInRSy2Tpkm+V5C63hKJVkNRskKWtLQKm9ecCaQTjA==",
21
21
  "dependencies": {
22
22
  "is-promise": "^4.0.0"
23
23
  },
@@ -50,9 +50,9 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@netlify/functions": {
53
- "version": "1.3.0",
54
- "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.3.0.tgz",
55
- "integrity": "sha512-hN/Fgpz8XIOBfsBPLYUMxVKBlCopgeqGB0popayicnmkFLnvKByTTMYgF01wcF9DBtBQdV0H2h1kPFpMl34I8w==",
53
+ "version": "1.4.0",
54
+ "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-1.4.0.tgz",
55
+ "integrity": "sha512-gy7ULTIRroc2/jyFVGx1djCmmBMVisIwrvkqggq5B6iDcInRSy2Tpkm+V5C63hKJVkNRskKWtLQKm9ecCaQTjA==",
56
56
  "requires": {
57
57
  "is-promise": "^4.0.0"
58
58
  }
@@ -14,7 +14,7 @@
14
14
  "author": "Netlify",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@netlify/functions": "^1.3.0",
17
+ "@netlify/functions": "^1.4.0",
18
18
  "@types/node": "^14.0.0",
19
19
  "typescript": "^4.0.0"
20
20
  }
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'json',
3
3
  description: 'Function that returns a simple json response',
4
4
  functionType: 'edge',
@@ -1,5 +1,5 @@
1
1
  import type { Context } from "https://edge.netlify.com";
2
2
 
3
3
  export default async (request: Request, context: Context) => {
4
- return context.json({ hello: "world" });
4
+ return Response.json({ hello: "world", location: context.geo.city });
5
5
  };
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'log',
3
3
  description: 'Basic function logging context of request',
4
4
  functionType: 'edge',
@@ -1,9 +1,9 @@
1
1
  import type { Context } from "https://edge.netlify.com";
2
2
 
3
3
  export default async (request: Request, context: Context) => {
4
- context.log("Hello from the logging service");
4
+ console.log(`There was a request from ${context.geo.city} to ${request.url}`);
5
5
 
6
6
  return new Response("The request to this URL was logged", {
7
7
  headers: { "content-type": "text/html" },
8
8
  });
9
- };
9
+ };
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'scheduled-function',
3
3
  priority: 1,
4
4
  description: 'Basic implementation of a scheduled function in TypeScript.',
@@ -15,7 +15,7 @@
15
15
  "author": "Netlify",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@netlify/functions": "^1.3.0",
18
+ "@netlify/functions": "^1.4.0",
19
19
  "@types/node": "^14.18.9",
20
20
  "typescript": "^4.5.5"
21
21
  }
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'set-cookies',
3
3
  description: 'Create and manage HTTP cookies',
4
4
  functionType: 'edge',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'set-req-header',
3
3
  description: 'Adds a custom HTTP header to HTTP request.',
4
4
  functionType: 'edge',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'set-res-header',
3
3
  description: 'Adds a custom HTTP header to HTTP response.',
4
4
  functionType: 'edge',
@@ -1,4 +1,4 @@
1
- module.exports = {
1
+ export default {
2
2
  name: 'transform-response',
3
3
  description: 'Transform the content of an HTTP response',
4
4
  functionType: 'edge',
@@ -1,4 +1,4 @@
1
1
  // @ts-check
2
- import { getPathInHome } from '../settings.cjs'
2
+ import { getPathInHome } from '../settings.mjs'
3
3
 
4
4
  export const AUTOCOMPLETION_FILE = getPathInHome(['autocompletion.json'])
@@ -2,7 +2,7 @@
2
2
  import { stat } from 'fs/promises'
3
3
  import { join } from 'path'
4
4
 
5
- import { getPathInProject } from '../settings.cjs'
5
+ import { getPathInProject } from '../settings.mjs'
6
6
 
7
7
  import { EDGE_FUNCTIONS_FOLDER, PUBLIC_URL_PATH } from './consts.mjs'
8
8
 
@@ -3,7 +3,7 @@ import { readFile, stat } from 'fs/promises'
3
3
  import { dirname, join, resolve } from 'path'
4
4
  import { cwd } from 'process'
5
5
 
6
- import { getPathInProject } from '../settings.cjs'
6
+ import { getPathInProject } from '../settings.mjs'
7
7
 
8
8
  import { INTERNAL_EDGE_FUNCTIONS_FOLDER } from './consts.mjs'
9
9
 
@@ -8,8 +8,8 @@ import { v4 as generateUUID } from 'uuid'
8
8
 
9
9
  import { NETLIFYDEVERR, NETLIFYDEVWARN, chalk, error as printError, log } from '../../utils/command-helpers.mjs'
10
10
  import { getGeoLocation } from '../geo-location.mjs'
11
- import { getPathInProject } from '../settings.cjs'
12
- import { startSpinner, stopSpinner } from '../spinner.cjs'
11
+ import { getPathInProject } from '../settings.mjs'
12
+ import { startSpinner, stopSpinner } from '../spinner.mjs'
13
13
 
14
14
  import { DIST_IMPORT_MAP_PATH } from './consts.mjs'
15
15
  import headers from './headers.mjs'
@@ -1,10 +1,8 @@
1
1
  // @ts-check
2
- const {
3
- constants,
4
- promises: { access, stat },
5
- } = require('fs')
2
+ import { constants } from 'fs'
3
+ import { access, stat } from 'fs/promises'
6
4
 
7
- const fileExistsAsync = async (filePath) => {
5
+ export const fileExistsAsync = async (filePath) => {
8
6
  try {
9
7
  await access(filePath, constants.F_OK)
10
8
  return true
@@ -36,16 +34,10 @@ const isType = async (filePath, type) => {
36
34
  * Checks if the provided filePath is a file
37
35
  * @param {string} filePath
38
36
  */
39
- const isFileAsync = (filePath) => isType(filePath, 'isFile')
37
+ export const isFileAsync = (filePath) => isType(filePath, 'isFile')
40
38
 
41
39
  /**
42
40
  * Checks if the provided filePath is a directory
43
41
  * @param {string} filePath
44
42
  */
45
- const isDirectoryAsync = (filePath) => isType(filePath, 'isDirectory')
46
-
47
- module.exports = {
48
- fileExistsAsync,
49
- isDirectoryAsync,
50
- isFileAsync,
51
- }
43
+ export const isDirectoryAsync = (filePath) => isType(filePath, 'isDirectory')
@@ -5,7 +5,7 @@ import { resolve } from 'path'
5
5
  import minimist from 'minimist'
6
6
 
7
7
  import execa from '../../../../../utils/execa.mjs'
8
- import { fileExistsAsync } from '../../../../fs.cjs'
8
+ import { fileExistsAsync } from '../../../../fs.mjs'
9
9
  import { memoizedBuild } from '../../../memoized-build.mjs'
10
10
 
11
11
  export const detectNetlifyLambda = async function ({ packageJson } = {}) {
@@ -7,7 +7,7 @@ import readPkgUp from 'read-pkg-up'
7
7
  import sourceMapSupport from 'source-map-support'
8
8
 
9
9
  import { NETLIFYDEVERR } from '../../../../../utils/command-helpers.mjs'
10
- import { getPathInProject } from '../../../../settings.cjs'
10
+ import { getPathInProject } from '../../../../settings.mjs'
11
11
  import { normalizeFunctionsConfig } from '../../../config.mjs'
12
12
  import { memoizedBuild } from '../../../memoized-build.mjs'
13
13
 
@@ -7,7 +7,7 @@ import findUp from 'find-up'
7
7
  import toml from 'toml'
8
8
 
9
9
  import execa from '../../../../utils/execa.mjs'
10
- import { getPathInProject } from '../../../settings.cjs'
10
+ import { getPathInProject } from '../../../settings.mjs'
11
11
  import { runFunctionsProxy } from '../../local-proxy.mjs'
12
12
 
13
13
  const isWindows = platform === 'win32'
@@ -1,7 +1,7 @@
1
- const os = require('os')
2
- const path = require('path')
1
+ import os from 'os'
2
+ import path from 'path'
3
3
 
4
- const envPaths = require('env-paths')
4
+ import envPaths from 'env-paths'
5
5
 
6
6
  const OSBasedPaths = envPaths('netlify', { suffix: '' })
7
7
  const NETLIFY_HOME = '.netlify'
@@ -12,7 +12,7 @@ const NETLIFY_HOME = '.netlify'
12
12
  * @param {string[]} paths
13
13
  * @returns {string}
14
14
  */
15
- const getLegacyPathInHome = (paths) => {
15
+ export const getLegacyPathInHome = (paths) => {
16
16
  const pathInHome = path.join(os.homedir(), NETLIFY_HOME, ...paths)
17
17
  return pathInHome
18
18
  }
@@ -22,7 +22,7 @@ const getLegacyPathInHome = (paths) => {
22
22
  * @param {string[]} paths
23
23
  * @returns {string}
24
24
  */
25
- const getPathInHome = (paths) => {
25
+ export const getPathInHome = (paths) => {
26
26
  const pathInHome = path.join(OSBasedPaths.config, ...paths)
27
27
  return pathInHome
28
28
  }
@@ -32,9 +32,7 @@ const getPathInHome = (paths) => {
32
32
  * @param {string[]} paths
33
33
  * @returns {string}
34
34
  */
35
- const getPathInProject = (paths) => {
35
+ export const getPathInProject = (paths) => {
36
36
  const pathInProject = path.join(NETLIFY_HOME, ...paths)
37
37
  return pathInProject
38
38
  }
39
-
40
- module.exports = { getLegacyPathInHome, getPathInHome, getPathInProject }
@@ -1,6 +1,6 @@
1
1
  // @ts-check
2
- const logSymbols = require('log-symbols')
3
- const ora = require('ora')
2
+ import logSymbols from 'log-symbols'
3
+ import ora from 'ora'
4
4
 
5
5
  /**
6
6
  * Creates a spinner with the following text
@@ -8,7 +8,7 @@ const ora = require('ora')
8
8
  * @param {string} config.text
9
9
  * @returns {ora.Ora}
10
10
  */
11
- const startSpinner = ({ text }) =>
11
+ export const startSpinner = ({ text }) =>
12
12
  ora({
13
13
  text,
14
14
  }).start()
@@ -21,7 +21,7 @@ const startSpinner = ({ text }) =>
21
21
  * @param {string} [config.text]
22
22
  * @returns {void}
23
23
  */
24
- const stopSpinner = ({ error, spinner, text }) => {
24
+ export const stopSpinner = ({ error, spinner, text }) => {
25
25
  if (!spinner) {
26
26
  return
27
27
  }
@@ -39,10 +39,8 @@ const stopSpinner = ({ error, spinner, text }) => {
39
39
  * @param {ora.Ora} config.spinner
40
40
  * @returns {void}
41
41
  */
42
- const clearSpinner = ({ spinner }) => {
42
+ export const clearSpinner = ({ spinner }) => {
43
43
  if (spinner) {
44
44
  spinner.stop()
45
45
  }
46
46
  }
47
-
48
- module.exports = { clearSpinner, startSpinner, stopSpinner }
@@ -12,7 +12,7 @@ import WSL from 'is-wsl'
12
12
  import debounce from 'lodash/debounce.js'
13
13
  import terminalLink from 'terminal-link'
14
14
 
15
- import { clearSpinner, startSpinner } from '../lib/spinner.cjs'
15
+ import { clearSpinner, startSpinner } from '../lib/spinner.mjs'
16
16
 
17
17
  import getGlobalConfig from './get-global-config.mjs'
18
18
  import getPackageJson from './get-package-json.mjs'
@@ -4,7 +4,7 @@ import path from 'path'
4
4
 
5
5
  import dotenv from 'dotenv'
6
6
 
7
- import { isFileAsync } from '../lib/fs.cjs'
7
+ import { isFileAsync } from '../lib/fs.mjs'
8
8
 
9
9
  import { warn } from './command-helpers.mjs'
10
10
 
@@ -1,8 +1,8 @@
1
1
  // @ts-check
2
2
  import { resolve } from 'path'
3
3
 
4
- import { isDirectoryAsync, isFileAsync } from '../../lib/fs.cjs'
5
- import { getPathInProject } from '../../lib/settings.cjs'
4
+ import { isDirectoryAsync, isFileAsync } from '../../lib/fs.mjs'
5
+ import { getPathInProject } from '../../lib/settings.mjs'
6
6
 
7
7
  /**
8
8
  * retrieves the function directory out of the flags or config
@@ -1,5 +1,5 @@
1
1
  // @ts-check
2
- import { fileExistsAsync } from '../../lib/fs.cjs'
2
+ import { fileExistsAsync } from '../../lib/fs.mjs'
3
3
 
4
4
  const getUrlPath = (functionName) => `/.netlify/functions/${functionName}`
5
5
 
@@ -3,7 +3,7 @@ import { readFile } from 'fs/promises'
3
3
  import Configstore from 'configstore'
4
4
  import { v4 as uuidv4 } from 'uuid'
5
5
 
6
- import { getLegacyPathInHome, getPathInHome } from '../lib/settings.cjs'
6
+ import { getLegacyPathInHome, getPathInHome } from '../lib/settings.mjs'
7
7
 
8
8
  const globalConfigDefaults = {
9
9
  /* disable stats from being sent to Netlify */
@@ -4,7 +4,7 @@ import path from 'path'
4
4
 
5
5
  import parseIgnore from 'parse-gitignore'
6
6
 
7
- import { fileExistsAsync } from '../lib/fs.cjs'
7
+ import { fileExistsAsync } from '../lib/fs.mjs'
8
8
 
9
9
  import { log } from './command-helpers.mjs'
10
10
 
@@ -6,7 +6,7 @@ import process from 'process'
6
6
  import cleanDeep from 'clean-deep'
7
7
  import inquirer from 'inquirer'
8
8
 
9
- import { fileExistsAsync } from '../../lib/fs.cjs'
9
+ import { fileExistsAsync } from '../../lib/fs.mjs'
10
10
  import { normalizeBackslash } from '../../lib/path.mjs'
11
11
  import { chalk, error as failAndExit, log, warn } from '../command-helpers.mjs'
12
12
 
@@ -5,7 +5,7 @@ import fetch from 'node-fetch'
5
5
  import pWaitFor from 'p-wait-for'
6
6
 
7
7
  import { fetchLatestVersion, shouldFetchLatestVersion } from '../lib/exec-fetcher.mjs'
8
- import { getPathInHome } from '../lib/settings.cjs'
8
+ import { getPathInHome } from '../lib/settings.mjs'
9
9
 
10
10
  import { NETLIFYDEVERR, NETLIFYDEVLOG, chalk, log } from './command-helpers.mjs'
11
11
  import execa from './execa.mjs'
@@ -11,9 +11,9 @@ import Listr from 'listr'
11
11
  import pathKey from 'path-key'
12
12
 
13
13
  import { fetchLatestVersion, shouldFetchLatestVersion } from '../../lib/exec-fetcher.mjs'
14
- import { fileExistsAsync } from '../../lib/fs.cjs'
14
+ import { fileExistsAsync } from '../../lib/fs.mjs'
15
15
  import { normalizeBackslash } from '../../lib/path.mjs'
16
- import { getLegacyPathInHome, getPathInHome } from '../../lib/settings.cjs'
16
+ import { getLegacyPathInHome, getPathInHome } from '../../lib/settings.mjs'
17
17
  import { chalk } from '../command-helpers.mjs'
18
18
 
19
19
  import { checkGitLFSVersionStep, checkGitVersionStep, checkLFSFiltersStep } from './steps.mjs'
@@ -25,7 +25,7 @@ import {
25
25
  initializeProxy as initializeEdgeFunctionsProxy,
26
26
  isEdgeFunctionsRequest,
27
27
  } from '../lib/edge-functions/proxy.mjs'
28
- import { fileExistsAsync, isFileAsync } from '../lib/fs.cjs'
28
+ import { fileExistsAsync, isFileAsync } from '../lib/fs.mjs'
29
29
  import renderErrorTemplate from '../lib/render-error-template.mjs'
30
30
 
31
31
  import { NETLIFYDEVLOG, NETLIFYDEVWARN } from './command-helpers.mjs'
@@ -6,7 +6,7 @@ import cookie from 'cookie'
6
6
  import redirector from 'netlify-redirector'
7
7
  import pFilter from 'p-filter'
8
8
 
9
- import { fileExistsAsync } from '../lib/fs.cjs'
9
+ import { fileExistsAsync } from '../lib/fs.mjs'
10
10
 
11
11
  import { NETLIFYDEVLOG } from './command-helpers.mjs'
12
12
  import { parseRedirects } from './redirects.mjs'
@@ -6,7 +6,7 @@ import dotProp from 'dot-prop'
6
6
  import findUp from 'find-up'
7
7
  import writeFileAtomic from 'write-file-atomic'
8
8
 
9
- import { getPathInProject } from '../lib/settings.cjs'
9
+ import { getPathInProject } from '../lib/settings.mjs'
10
10
 
11
11
  const STATE_PATH = getPathInProject(['state.json'])
12
12
  const permissionError = "You don't have access to this file."