netlify-cli 17.22.1 → 17.23.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 (39) hide show
  1. package/dist/commands/functions/functions-create.js +4 -4
  2. package/dist/lib/http-agent.js +1 -1
  3. package/dist/tsconfig.tsbuildinfo +1 -1
  4. package/dist/utils/deploy/deploy-site.d.ts.map +1 -1
  5. package/dist/utils/deploy/deploy-site.js +0 -1
  6. package/dist/utils/deploy/hash-fns.d.ts +13 -3
  7. package/dist/utils/deploy/hash-fns.d.ts.map +1 -1
  8. package/dist/utils/deploy/hash-fns.js +25 -12
  9. package/functions-templates/javascript/scheduled-function/package.json +1 -1
  10. package/functions-templates/typescript/hello-world/package-lock.json +53 -19
  11. package/functions-templates/typescript/hello-world/package.json +1 -1
  12. package/functions-templates/typescript/scheduled-function/package.json +1 -1
  13. package/npm-shrinkwrap.json +1257 -487
  14. package/package.json +11 -11
  15. /package/functions-templates/go/hello-world/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  16. /package/functions-templates/javascript/hello/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  17. /package/functions-templates/javascript/hello-world/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  18. /package/functions-templates/javascript/identity-signup/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  19. /package/functions-templates/javascript/image-external/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  20. /package/functions-templates/javascript/localized-content/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  21. /package/functions-templates/javascript/sanity-create/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  22. /package/functions-templates/javascript/sanity-groq/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  23. /package/functions-templates/javascript/scheduled-function/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  24. /package/functions-templates/javascript/set-cookies/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  25. /package/functions-templates/javascript/set-req-header/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  26. /package/functions-templates/javascript/set-res-header/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  27. /package/functions-templates/javascript/submission-created/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  28. /package/functions-templates/javascript/transform-response/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  29. /package/functions-templates/rust/hello-world/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  30. /package/functions-templates/typescript/abtest/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  31. /package/functions-templates/typescript/geolocation/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  32. /package/functions-templates/typescript/hello-world/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  33. /package/functions-templates/typescript/json/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  34. /package/functions-templates/typescript/log/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  35. /package/functions-templates/typescript/scheduled-function/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  36. /package/functions-templates/typescript/set-cookies/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  37. /package/functions-templates/typescript/set-req-header/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  38. /package/functions-templates/typescript/set-res-header/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
  39. /package/functions-templates/typescript/transform-response/{.netlify-function-template.js → .netlify-function-template.mjs} +0 -0
@@ -94,7 +94,7 @@ const formatRegistryArrayForInquirer = async function (lang, funcType) {
94
94
  .filter((folder) => Boolean(folder?.isDirectory()))
95
95
  .map(async ({ name }) => {
96
96
  try {
97
- const templatePath = path.join(templatesDir, lang, name, '.netlify-function-template.js');
97
+ const templatePath = path.join(templatesDir, lang, name, '.netlify-function-template.mjs');
98
98
  // @ts-expect-error TS(7036) FIXME: Dynamic import's specifier must be of type 'string... Remove this comment to see the full error message
99
99
  const template = await import(pathToFileURL(templatePath));
100
100
  return template.default;
@@ -324,7 +324,7 @@ const downloadFromURL = async function (command, options, argumentName, function
324
324
  log(`${NETLIFYDEVLOG} Installing dependencies for ${nameToUse} complete `);
325
325
  });
326
326
  // read, execute, and delete function template file if exists
327
- const fnTemplateFile = path.join(fnFolder, '.netlify-function-template.js');
327
+ const fnTemplateFile = path.join(fnFolder, '.netlify-function-template.mjs');
328
328
  if (await fileExistsAsync(fnTemplateFile)) {
329
329
  const { default: { addons = [], onComplete }, } = await import(pathToFileURL(fnTemplateFile).href);
330
330
  await installAddons(command, addons, path.resolve(fnFolder));
@@ -435,7 +435,7 @@ const scaffoldFromTemplate = async function (command, options, argumentName, fun
435
435
  let functionPackageJson;
436
436
  // These files will not be part of the log message because they'll likely
437
437
  // be removed before the command finishes.
438
- const omittedFromOutput = new Set(['.netlify-function-template.js', 'package.json', 'package-lock.json']);
438
+ const omittedFromOutput = new Set(['.netlify-function-template.mjs', 'package.json', 'package-lock.json']);
439
439
  const createdFiles = await copyTemplateDir(pathToTemplate, functionPath, vars);
440
440
  // @ts-expect-error TS(7006) FIXME: Parameter 'filePath' implicitly has an 'any' type.
441
441
  createdFiles.forEach((filePath) => {
@@ -449,7 +449,7 @@ const scaffoldFromTemplate = async function (command, options, argumentName, fun
449
449
  }
450
450
  });
451
451
  // delete function template file that was copied over by copydir
452
- await unlink(path.join(functionPath, '.netlify-function-template.js'));
452
+ await unlink(path.join(functionPath, '.netlify-function-template.mjs'));
453
453
  // npm install
454
454
  if (functionPackageJson !== undefined) {
455
455
  const spinner = ora({
@@ -1,5 +1,5 @@
1
1
  import { readFile } from 'fs/promises';
2
- import HttpsProxyAgent from 'https-proxy-agent';
2
+ import { HttpsProxyAgent } from 'https-proxy-agent';
3
3
  import waitPort from 'wait-port';
4
4
  import { NETLIFYDEVERR, NETLIFYDEVWARN, exit, log } from '../utils/command-helpers.js';
5
5
  // https://github.com/TooTallNate/node-https-proxy-agent/issues/89