netlify-cli 17.6.0 → 17.8.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 (295) hide show
  1. package/bin/{run.mjs → run.js} +3 -3
  2. package/npm-shrinkwrap.json +4 -4
  3. package/package.json +8 -9
  4. package/scripts/{postinstall.mjs → postinstall.js} +3 -4
  5. package/src/commands/addons/addons-auth.js +22 -0
  6. package/src/commands/addons/{addons-config.mjs → addons-config.js} +9 -34
  7. package/src/commands/addons/{addons-create.mjs → addons-create.js} +7 -33
  8. package/src/commands/addons/addons-delete.js +33 -0
  9. package/src/commands/addons/{addons-list.mjs → addons-list.js} +3 -25
  10. package/src/commands/addons/addons.js +68 -0
  11. package/src/commands/addons/index.js +1 -0
  12. package/src/commands/api/{api.mjs → api.js} +2 -24
  13. package/src/commands/api/index.js +13 -0
  14. package/src/commands/{base-command.mjs → base-command.js} +7 -7
  15. package/src/commands/blobs/blobs-delete.js +20 -0
  16. package/src/commands/blobs/{blobs-get.mjs → blobs-get.js} +2 -15
  17. package/src/commands/blobs/{blobs-list.mjs → blobs-list.js} +2 -16
  18. package/src/commands/blobs/{blobs-set.mjs → blobs-set.js} +2 -17
  19. package/src/commands/blobs/blobs.js +74 -0
  20. package/src/commands/blobs/index.js +1 -0
  21. package/src/commands/build/{build.mjs → build.js} +7 -28
  22. package/src/commands/build/index.js +13 -0
  23. package/src/commands/completion/completion.js +29 -0
  24. package/src/commands/completion/index.js +26 -0
  25. package/src/commands/deploy/{deploy.mjs → deploy.js} +17 -133
  26. package/src/commands/deploy/index.js +106 -0
  27. package/src/commands/dev/{dev-exec.mjs → dev-exec.js} +3 -15
  28. package/src/commands/dev/{dev.mjs → dev.js} +19 -38
  29. package/src/commands/dev/index.js +1 -0
  30. package/src/commands/env/{env-clone.mjs → env-clone.js} +71 -94
  31. package/src/commands/env/env-get.js +34 -0
  32. package/src/commands/env/{env-import.mjs → env-import.js} +38 -65
  33. package/src/commands/env/{env-list.mjs → env-list.js} +3 -37
  34. package/src/commands/env/{env-set.mjs → env-set.js} +36 -81
  35. package/src/commands/env/{env-unset.mjs → env-unset.js} +30 -62
  36. package/src/commands/env/env.js +127 -0
  37. package/src/commands/env/index.js +1 -0
  38. package/src/commands/functions/{functions-build.mjs → functions-build.js} +3 -22
  39. package/src/commands/functions/{functions-create.mjs → functions-create.js} +20 -47
  40. package/src/commands/functions/{functions-invoke.mjs → functions-invoke.js} +3 -41
  41. package/src/commands/functions/{functions-list.mjs → functions-list.js} +3 -27
  42. package/src/commands/functions/{functions-serve.mjs → functions-serve.js} +6 -28
  43. package/src/commands/functions/functions.js +98 -0
  44. package/src/commands/functions/index.js +1 -0
  45. package/src/commands/index.js +2 -0
  46. package/src/commands/init/index.js +12 -0
  47. package/src/commands/init/{init.mjs → init.js} +10 -31
  48. package/src/commands/integration/{deploy.mjs → deploy.js} +7 -28
  49. package/src/commands/integration/index.js +26 -0
  50. package/src/commands/link/index.js +13 -0
  51. package/src/commands/link/{link.mjs → link.js} +6 -28
  52. package/src/commands/lm/index.js +1 -0
  53. package/src/commands/lm/{lm-info.mjs → lm-info.js} +2 -9
  54. package/src/commands/lm/lm-install.js +8 -0
  55. package/src/commands/lm/{lm-setup.mjs → lm-setup.js} +6 -25
  56. package/src/commands/lm/lm-uninstall.js +7 -0
  57. package/src/commands/lm/lm.js +46 -0
  58. package/src/commands/login/index.js +9 -0
  59. package/src/commands/login/{login.mjs → login.js} +1 -19
  60. package/src/commands/logout/index.js +7 -0
  61. package/src/commands/logout/{logout.mjs → logout.js} +3 -16
  62. package/src/commands/logs/{build.mjs → build.js} +3 -8
  63. package/src/commands/logs/{functions.mjs → functions.js} +4 -27
  64. package/src/commands/logs/index.js +39 -0
  65. package/src/commands/logs/log-levels.js +11 -0
  66. package/src/commands/{main.mjs → main.js} +32 -32
  67. package/src/commands/open/index.js +31 -0
  68. package/src/commands/open/open-admin.js +11 -0
  69. package/src/commands/open/open-site.js +12 -0
  70. package/src/commands/open/open.js +13 -0
  71. package/src/commands/recipes/{common.mjs → common.js} +2 -2
  72. package/src/commands/recipes/index.js +20 -0
  73. package/src/commands/recipes/recipes-list.js +14 -0
  74. package/src/commands/recipes/{recipes.mjs → recipes.js} +8 -32
  75. package/src/commands/serve/index.js +27 -0
  76. package/src/commands/serve/{serve.mjs → serve.js} +14 -51
  77. package/src/commands/sites/index.js +1 -0
  78. package/src/commands/sites/{sites-create-template.mjs → sites-create-template.js} +9 -38
  79. package/src/commands/sites/{sites-create.mjs → sites-create.js} +5 -38
  80. package/src/commands/sites/{sites-delete.mjs → sites-delete.js} +2 -22
  81. package/src/commands/sites/{sites-list.mjs → sites-list.js} +4 -24
  82. package/src/commands/sites/sites.js +77 -0
  83. package/src/commands/status/index.js +19 -0
  84. package/src/commands/status/{status-hooks.mjs → status-hooks.js} +2 -20
  85. package/src/commands/status/{status.mjs → status.js} +2 -23
  86. package/src/commands/switch/index.js +7 -0
  87. package/src/commands/switch/{switch.mjs → switch.js} +3 -16
  88. package/src/commands/unlink/index.js +7 -0
  89. package/src/commands/unlink/unlink.js +21 -0
  90. package/src/commands/watch/index.js +8 -0
  91. package/src/commands/watch/{watch.mjs → watch.js} +4 -21
  92. package/src/lib/{api.mjs → api.js} +1 -1
  93. package/src/lib/blobs/{blobs.mjs → blobs.js} +2 -2
  94. package/src/lib/{build.mjs → build.js} +3 -3
  95. package/src/lib/completion/{constants.mjs → constants.js} +1 -1
  96. package/src/lib/completion/{generate-autocompletion.mjs → generate-autocompletion.js} +3 -3
  97. package/src/lib/completion/{index.mjs → index.js} +1 -1
  98. package/src/lib/completion/{script.mjs → script.js} +3 -3
  99. package/src/lib/edge-functions/{deploy.mjs → deploy.js} +2 -2
  100. package/src/lib/edge-functions/{editor-helper.mjs → editor-helper.js} +1 -1
  101. package/src/lib/edge-functions/{internal.mjs → internal.js} +2 -2
  102. package/src/lib/edge-functions/{proxy.mjs → proxy.js} +10 -11
  103. package/src/lib/edge-functions/{registry.mjs → registry.js} +4 -2
  104. package/src/lib/{exec-fetcher.mjs → exec-fetcher.js} +2 -2
  105. package/src/lib/functions/{background.mjs → background.js} +2 -2
  106. package/src/lib/functions/{form-submissions-handler.mjs → form-submissions-handler.js} +3 -3
  107. package/src/lib/functions/{local-proxy.mjs → local-proxy.js} +1 -1
  108. package/src/lib/functions/{netlify-function.mjs → netlify-function.js} +18 -63
  109. package/src/lib/functions/{registry.mjs → registry.js} +33 -96
  110. package/src/lib/functions/runtimes/go/{index.mjs → index.js} +2 -2
  111. package/src/lib/functions/runtimes/{index.mjs → index.js} +3 -4
  112. package/src/lib/functions/runtimes/js/builders/{netlify-lambda.mjs → netlify-lambda.js} +3 -3
  113. package/src/lib/functions/runtimes/js/builders/{zisi.mjs → zisi.js} +6 -6
  114. package/src/lib/functions/runtimes/js/{index.mjs → index.js} +4 -4
  115. package/src/lib/functions/runtimes/rust/{index.mjs → index.js} +4 -4
  116. package/src/lib/functions/{scheduled.mjs → scheduled.js} +2 -2
  117. package/src/lib/functions/{server.mjs → server.js} +16 -15
  118. package/src/lib/functions/{synchronous.mjs → synchronous.js} +3 -3
  119. package/src/lib/functions/{utils.mjs → utils.js} +2 -2
  120. package/src/lib/{geo-location.mjs → geo-location.js} +1 -1
  121. package/src/lib/{http-agent.mjs → http-agent.js} +1 -1
  122. package/src/lib/images/{proxy.mjs → proxy.js} +3 -3
  123. package/src/lib/{log.mjs → log.js} +1 -1
  124. package/src/recipes/vscode/{index.mjs → index.js} +2 -2
  125. package/src/recipes/vscode/{settings.mjs → settings.js} +0 -1
  126. package/src/utils/addons/diffs/{index.mjs → index.js} +1 -1
  127. package/src/utils/addons/diffs/{options.mjs → options.js} +0 -1
  128. package/src/utils/addons/{prepare.mjs → prepare.js} +2 -2
  129. package/src/utils/addons/{prompts.mjs → prompts.js} +1 -1
  130. package/src/utils/addons/{render.mjs → render.js} +1 -1
  131. package/src/utils/{banner.mjs → banner.js} +1 -1
  132. package/src/utils/{build-info.mjs → build-info.js} +3 -3
  133. package/src/utils/{command-helpers.mjs → command-helpers.js} +4 -9
  134. package/src/utils/deploy/{deploy-site.mjs → deploy-site.js} +8 -8
  135. package/src/utils/deploy/{hash-files.mjs → hash-files.js} +1 -1
  136. package/src/utils/deploy/{hash-fns.mjs → hash-fns.js} +3 -3
  137. package/src/utils/deploy/{hasher-segments.mjs → hasher-segments.js} +1 -1
  138. package/src/utils/deploy/{upload-files.mjs → upload-files.js} +1 -1
  139. package/src/utils/deploy/{util.mjs → util.js} +1 -1
  140. package/src/utils/{detect-server-settings.mjs → detect-server-settings.js} +6 -7
  141. package/src/utils/{dev.mjs → dev.js} +3 -3
  142. package/src/utils/{dot-env.mjs → dot-env.js} +2 -2
  143. package/src/utils/env/{index.mjs → index.js} +1 -1
  144. package/src/utils/{framework-server.mjs → framework-server.js} +4 -4
  145. package/src/utils/functions/{functions.mjs → functions.js} +2 -2
  146. package/src/utils/functions/{get-functions.mjs → get-functions.js} +1 -1
  147. package/src/utils/functions/index.js +3 -0
  148. package/src/utils/{get-global-config.mjs → get-global-config.js} +1 -1
  149. package/src/utils/{get-repo-data.mjs → get-repo-data.js} +1 -1
  150. package/src/utils/{get-site.mjs → get-site.js} +1 -1
  151. package/src/utils/{gh-auth.mjs → gh-auth.js} +3 -3
  152. package/src/utils/{gitignore.mjs → gitignore.js} +2 -2
  153. package/src/utils/{headers.mjs → headers.js} +1 -1
  154. package/src/utils/hooks/{requires-site-info.mjs → requires-site-info.js} +1 -1
  155. package/src/utils/init/{config-github.mjs → config-github.js} +4 -4
  156. package/src/utils/init/{config-manual.mjs → config-manual.js} +5 -5
  157. package/src/utils/init/{config.mjs → config.js} +4 -4
  158. package/src/utils/init/{node-version.mjs → node-version.js} +1 -1
  159. package/src/utils/init/{utils.mjs → utils.js} +7 -7
  160. package/src/utils/{live-tunnel.mjs → live-tunnel.js} +4 -4
  161. package/src/utils/lm/{install.mjs → install.js} +6 -6
  162. package/src/utils/lm/{requirements.mjs → requirements.js} +1 -1
  163. package/src/utils/lm/{steps.mjs → steps.js} +2 -2
  164. package/src/utils/lm/{ui.mjs → ui.js} +2 -2
  165. package/src/utils/{open-browser.mjs → open-browser.js} +1 -1
  166. package/src/utils/{proxy-server.mjs → proxy-server.js} +5 -5
  167. package/src/utils/{proxy.mjs → proxy.js} +18 -16
  168. package/src/utils/{redirects.mjs → redirects.js} +1 -1
  169. package/src/utils/{rules-proxy.mjs → rules-proxy.js} +3 -3
  170. package/src/utils/{run-build.mjs → run-build.js} +8 -8
  171. package/src/utils/{shell.mjs → shell.js} +2 -2
  172. package/src/utils/{state-config.mjs → state-config.js} +1 -1
  173. package/src/utils/{static-server.mjs → static-server.js} +1 -1
  174. package/src/utils/telemetry/index.js +2 -0
  175. package/src/utils/telemetry/{report-error.mjs → report-error.js} +4 -4
  176. package/src/utils/telemetry/{request.mjs → request.js} +1 -1
  177. package/src/utils/telemetry/{telemetry.mjs → telemetry.js} +5 -5
  178. package/src/utils/telemetry/{utils.mjs → utils.js} +1 -1
  179. package/src/utils/telemetry/{validation.mjs → validation.js} +1 -1
  180. package/src/utils/{validation.mjs → validation.js} +1 -1
  181. package/src/commands/addons/addons-auth.mjs +0 -45
  182. package/src/commands/addons/addons-delete.mjs +0 -53
  183. package/src/commands/addons/addons.mjs +0 -39
  184. package/src/commands/addons/index.mjs +0 -1
  185. package/src/commands/api/index.mjs +0 -1
  186. package/src/commands/blobs/blobs-delete.mjs +0 -35
  187. package/src/commands/blobs/blobs.mjs +0 -32
  188. package/src/commands/blobs/index.mjs +0 -1
  189. package/src/commands/build/index.mjs +0 -1
  190. package/src/commands/completion/completion.mjs +0 -53
  191. package/src/commands/completion/index.mjs +0 -1
  192. package/src/commands/deploy/index.mjs +0 -1
  193. package/src/commands/dev/index.mjs +0 -1
  194. package/src/commands/dev/types.d.ts +0 -30
  195. package/src/commands/env/env-get.mjs +0 -66
  196. package/src/commands/env/env.mjs +0 -41
  197. package/src/commands/env/index.mjs +0 -1
  198. package/src/commands/functions/functions.mjs +0 -39
  199. package/src/commands/functions/index.mjs +0 -1
  200. package/src/commands/index.mjs +0 -2
  201. package/src/commands/init/index.mjs +0 -1
  202. package/src/commands/integration/index.mjs +0 -24
  203. package/src/commands/link/index.mjs +0 -1
  204. package/src/commands/lm/index.mjs +0 -1
  205. package/src/commands/lm/lm-install.mjs +0 -27
  206. package/src/commands/lm/lm-uninstall.mjs +0 -18
  207. package/src/commands/lm/lm.mjs +0 -30
  208. package/src/commands/login/index.mjs +0 -1
  209. package/src/commands/logout/index.mjs +0 -1
  210. package/src/commands/logs/index.mjs +0 -12
  211. package/src/commands/open/index.mjs +0 -1
  212. package/src/commands/open/open-admin.mjs +0 -30
  213. package/src/commands/open/open-site.mjs +0 -31
  214. package/src/commands/open/open.mjs +0 -36
  215. package/src/commands/recipes/index.mjs +0 -1
  216. package/src/commands/recipes/recipes-list.mjs +0 -25
  217. package/src/commands/serve/index.mjs +0 -1
  218. package/src/commands/sites/index.mjs +0 -2
  219. package/src/commands/sites/sites.mjs +0 -30
  220. package/src/commands/status/index.mjs +0 -1
  221. package/src/commands/switch/index.mjs +0 -1
  222. package/src/commands/types.d.ts +0 -31
  223. package/src/commands/unlink/index.mjs +0 -1
  224. package/src/commands/unlink/unlink.mjs +0 -34
  225. package/src/commands/watch/index.mjs +0 -1
  226. package/src/functions-templates/typescript/abtest/{{name}}.ts +0 -31
  227. package/src/functions-templates/typescript/geolocation/{{name}}.ts +0 -24
  228. package/src/functions-templates/typescript/hello-world/{{name}}.ts +0 -12
  229. package/src/functions-templates/typescript/json/{{name}}.ts +0 -5
  230. package/src/functions-templates/typescript/log/{{name}}.ts +0 -9
  231. package/src/functions-templates/typescript/scheduled-function/{{name}}.ts +0 -12
  232. package/src/functions-templates/typescript/set-cookies/{{name}}.ts +0 -29
  233. package/src/functions-templates/typescript/set-req-header/{{name}}.ts +0 -5
  234. package/src/functions-templates/typescript/set-res-header/{{name}}.ts +0 -7
  235. package/src/functions-templates/typescript/transform-response/{{name}}.ts +0 -13
  236. package/src/utils/functions/index.mjs +0 -3
  237. package/src/utils/telemetry/index.mjs +0 -2
  238. package/src/utils/types.d.ts +0 -46
  239. /package/src/functions-templates/go/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  240. /package/src/functions-templates/javascript/hello/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  241. /package/src/functions-templates/javascript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  242. /package/src/functions-templates/javascript/identity-signup/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  243. /package/src/functions-templates/javascript/image-external/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  244. /package/src/functions-templates/javascript/localized-content/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  245. /package/src/functions-templates/javascript/sanity-create/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  246. /package/src/functions-templates/javascript/sanity-groq/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  247. /package/src/functions-templates/javascript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  248. /package/src/functions-templates/javascript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  249. /package/src/functions-templates/javascript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  250. /package/src/functions-templates/javascript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  251. /package/src/functions-templates/javascript/submission-created/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  252. /package/src/functions-templates/javascript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  253. /package/src/functions-templates/rust/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  254. /package/src/functions-templates/typescript/abtest/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  255. /package/src/functions-templates/typescript/geolocation/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  256. /package/src/functions-templates/typescript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  257. /package/src/functions-templates/typescript/json/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  258. /package/src/functions-templates/typescript/log/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  259. /package/src/functions-templates/typescript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  260. /package/src/functions-templates/typescript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  261. /package/src/functions-templates/typescript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  262. /package/src/functions-templates/typescript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  263. /package/src/functions-templates/typescript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
  264. /package/src/lib/{account.mjs → account.js} +0 -0
  265. /package/src/lib/completion/{get-autocompletion.mjs → get-autocompletion.js} +0 -0
  266. /package/src/lib/edge-functions/{bootstrap.mjs → bootstrap.js} +0 -0
  267. /package/src/lib/edge-functions/{consts.mjs → consts.js} +0 -0
  268. /package/src/lib/edge-functions/{headers.mjs → headers.js} +0 -0
  269. /package/src/lib/{fs.mjs → fs.js} +0 -0
  270. /package/src/lib/functions/{config.mjs → config.js} +0 -0
  271. /package/src/lib/functions/{memoized-build.mjs → memoized-build.js} +0 -0
  272. /package/src/lib/functions/runtimes/js/{constants.mjs → constants.js} +0 -0
  273. /package/src/lib/functions/runtimes/js/{worker.mjs → worker.js} +0 -0
  274. /package/src/lib/{path.mjs → path.js} +0 -0
  275. /package/src/lib/{render-error-template.mjs → render-error-template.js} +0 -0
  276. /package/src/lib/{settings.mjs → settings.js} +0 -0
  277. /package/src/lib/{spinner.mjs → spinner.js} +0 -0
  278. /package/src/lib/{string.mjs → string.js} +0 -0
  279. /package/src/utils/addons/{compare.mjs → compare.js} +0 -0
  280. /package/src/utils/addons/{validation.mjs → validation.js} +0 -0
  281. /package/src/utils/{create-deferred.mjs → create-deferred.js} +0 -0
  282. /package/src/utils/{create-stream-promise.mjs → create-stream-promise.js} +0 -0
  283. /package/src/utils/deploy/{constants.mjs → constants.js} +0 -0
  284. /package/src/utils/deploy/{hash-config.mjs → hash-config.js} +0 -0
  285. /package/src/utils/{execa.mjs → execa.js} +0 -0
  286. /package/src/utils/{feature-flags.mjs → feature-flags.js} +0 -0
  287. /package/src/utils/functions/{constants.mjs → constants.js} +0 -0
  288. /package/src/utils/{get-package-json.mjs → get-package-json.js} +0 -0
  289. /package/src/utils/init/{plugins.mjs → plugins.js} +0 -0
  290. /package/src/utils/{parse-raw-flags.mjs → parse-raw-flags.js} +0 -0
  291. /package/src/utils/{read-repo-url.mjs → read-repo-url.js} +0 -0
  292. /package/src/utils/{request-id.mjs → request-id.js} +0 -0
  293. /package/src/utils/{sign-redirect.mjs → sign-redirect.js} +0 -0
  294. /package/src/utils/sites/{utils.mjs → utils.js} +0 -0
  295. /package/src/utils/websockets/{index.mjs → index.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import inquirer from 'inquirer';
2
- import { exit, log } from '../command-helpers.mjs';
3
- import { createDeployKey, getBuildSettings, saveNetlifyToml, setupSite } from './utils.mjs';
2
+ import { exit, log } from '../command-helpers.js';
3
+ import { createDeployKey, getBuildSettings, saveNetlifyToml, setupSite } from './utils.js';
4
4
  /**
5
5
  * Prompts for granting the netlify ssh public key access to your repo
6
6
  * @param {object} deployKey
@@ -24,7 +24,7 @@ const addDeployKey = async (deployKey) => {
24
24
  };
25
25
  /**
26
26
  * @param {object} config
27
- * @param {Awaited<ReturnType<import('../../utils/get-repo-data.mjs').default>>} config.repoData
27
+ * @param {Awaited<ReturnType<import('../../utils/get-repo-data.js').default>>} config.repoData
28
28
  * @returns {Promise<string>}
29
29
  */
30
30
  // @ts-expect-error TS(7031) FIXME: Binding element 'repoData' implicitly has an 'any'... Remove this comment to see the full error message
@@ -63,8 +63,8 @@ const addDeployHook = async (deployHook) => {
63
63
  };
64
64
  /**
65
65
  * @param {object} config
66
- * @param {import('../../commands/base-command.mjs').default} config.command
67
- * @param {Awaited<ReturnType<import('../../utils/get-repo-data.mjs').default>>} config.repoData
66
+ * @param {import('../../commands/base-command.js').default} config.command
67
+ * @param {Awaited<ReturnType<import('../../utils/get-repo-data.js').default>>} config.repoData
68
68
  * @param {string} config.siteId
69
69
  */
70
70
  // @ts-expect-error TS(7031) FIXME: Binding element 'command' implicitly has an 'any' ... Remove this comment to see the full error message
@@ -1,6 +1,6 @@
1
- import { chalk, log } from '../command-helpers.mjs';
2
- import { configGithub } from './config-github.mjs';
3
- import configManual from './config-manual.mjs';
1
+ import { chalk, log } from '../command-helpers.js';
2
+ import { configGithub } from './config-github.js';
3
+ import configManual from './config-manual.js';
4
4
  // @ts-expect-error TS(7006) FIXME: Parameter 'repoData' implicitly has an 'any' type.
5
5
  const logSuccess = (repoData) => {
6
6
  log();
@@ -16,7 +16,7 @@ const logSuccess = (repoData) => {
16
16
  };
17
17
  /**
18
18
  * @param {object} config
19
- * @param {import('../../commands/base-command.mjs').default} config.command
19
+ * @param {import('../../commands/base-command.js').default} config.command
20
20
  * @param {boolean} config.manual
21
21
  * @param {*} config.repoData
22
22
  * @param {string} config.siteId
@@ -1,7 +1,7 @@
1
1
  import { readFile } from 'fs/promises';
2
2
  import { locatePath } from 'locate-path';
3
3
  import nodeVersionAlias from 'node-version-alias';
4
- import { warn } from '../command-helpers.mjs';
4
+ import { warn } from '../command-helpers.js';
5
5
  const DEFAULT_NODE_VERSION = '12.18.0';
6
6
  const NVM_FLAG_PREFIX = '--';
7
7
  // to support NODE_VERSION=--lts, etc.
@@ -2,11 +2,11 @@ import { writeFile } from 'fs/promises';
2
2
  import path from 'path';
3
3
  import cleanDeep from 'clean-deep';
4
4
  import inquirer from 'inquirer';
5
- import { fileExistsAsync } from '../../lib/fs.mjs';
6
- import { normalizeBackslash } from '../../lib/path.mjs';
7
- import { detectBuildSettings } from '../build-info.mjs';
8
- import { chalk, error as failAndExit, log, warn } from '../command-helpers.mjs';
9
- import { getRecommendPlugins, getUIPlugins } from './plugins.mjs';
5
+ import { fileExistsAsync } from '../../lib/fs.js';
6
+ import { normalizeBackslash } from '../../lib/path.js';
7
+ import { detectBuildSettings } from '../build-info.js';
8
+ import { chalk, error as failAndExit, log, warn } from '../command-helpers.js';
9
+ import { getRecommendPlugins, getUIPlugins } from './plugins.js';
10
10
  // these plugins represent runtimes that are
11
11
  // expected to be "automatically" installed. Even though
12
12
  // they can be installed on package/toml, we always
@@ -26,7 +26,7 @@ export const getPluginsToAutoInstall = (pluginsInstalled = [], pluginsRecommende
26
26
  *
27
27
  * @param {Partial<import('@netlify/build-info').Settings>} settings
28
28
  * @param {*} config
29
- * @param {import('../../commands/base-command.mjs').default} command
29
+ * @param {import('../../commands/base-command.js').default} command
30
30
  */
31
31
  // @ts-expect-error TS(7006) FIXME: Parameter 'settings' implicitly has an 'any' type.
32
32
  const normalizeSettings = (settings, config, command) => {
@@ -78,7 +78,7 @@ const getPromptInputs = ({ defaultBaseDir, defaultBuildCmd, defaultBuildDir }) =
78
78
  /**
79
79
  * @param {object} param0
80
80
  * @param {*} param0.config
81
- * @param {import('../../commands/base-command.mjs').default} param0.command
81
+ * @param {import('../../commands/base-command.js').default} param0.command
82
82
  */
83
83
  // @ts-expect-error TS(7031) FIXME: Binding element 'command' implicitly has an 'any' ... Remove this comment to see the full error message
84
84
  export const getBuildSettings = async ({ command, config }) => {
@@ -3,11 +3,11 @@ import process from 'process';
3
3
  import fetch from 'node-fetch';
4
4
  import pWaitFor from 'p-wait-for';
5
5
  import { v4 as uuidv4 } from 'uuid';
6
- import { fetchLatestVersion, shouldFetchLatestVersion } from '../lib/exec-fetcher.mjs';
7
- import { getPathInHome } from '../lib/settings.mjs';
8
- import { NETLIFYDEVERR, NETLIFYDEVLOG, chalk, log } from './command-helpers.mjs';
6
+ import { fetchLatestVersion, shouldFetchLatestVersion } from '../lib/exec-fetcher.js';
7
+ import { getPathInHome } from '../lib/settings.js';
8
+ import { NETLIFYDEVERR, NETLIFYDEVLOG, chalk, log } from './command-helpers.js';
9
9
  // @ts-expect-error TS(7034) FIXME: Variable 'execa' implicitly has type 'any' in some... Remove this comment to see the full error message
10
- import execa from './execa.mjs';
10
+ import execa from './execa.js';
11
11
  const PACKAGE_NAME = 'live-tunnel-client';
12
12
  const EXEC_NAME = PACKAGE_NAME;
13
13
  const SLUG_LOCAL_STATE_KEY = 'liveTunnelSlug';
@@ -8,12 +8,12 @@ import execa from 'execa';
8
8
  import hasbin from 'hasbin';
9
9
  import { Listr } from 'listr2';
10
10
  import pathKey from 'path-key';
11
- import { fetchLatestVersion, shouldFetchLatestVersion } from '../../lib/exec-fetcher.mjs';
12
- import { fileExistsAsync } from '../../lib/fs.mjs';
13
- import { normalizeBackslash } from '../../lib/path.mjs';
14
- import { getLegacyPathInHome, getPathInHome } from '../../lib/settings.mjs';
15
- import { chalk } from '../command-helpers.mjs';
16
- import { checkGitLFSVersionStep, checkGitVersionStep, checkLFSFiltersStep } from './steps.mjs';
11
+ import { fetchLatestVersion, shouldFetchLatestVersion } from '../../lib/exec-fetcher.js';
12
+ import { fileExistsAsync } from '../../lib/fs.js';
13
+ import { normalizeBackslash } from '../../lib/path.js';
14
+ import { getLegacyPathInHome, getPathInHome } from '../../lib/settings.js';
15
+ import { chalk } from '../command-helpers.js';
16
+ import { checkGitLFSVersionStep, checkGitVersionStep, checkLFSFiltersStep } from './steps.js';
17
17
  const PACKAGE_NAME = 'netlify-credential-helper';
18
18
  const EXEC_NAME = 'git-credential-netlify';
19
19
  const GIT_CONFIG = '.gitconfig';
@@ -1,6 +1,6 @@
1
1
  import semver from 'semver';
2
2
  // @ts-expect-error TS(7034) FIXME: Variable 'execa' implicitly has type 'any' in some... Remove this comment to see the full error message
3
- import execa from '../execa.mjs';
3
+ import execa from '../execa.js';
4
4
  export const checkLFSFilters = async function () {
5
5
  try {
6
6
  // @ts-expect-error TS(7005) FIXME: Variable 'execa' implicitly has an 'any' type.
@@ -1,5 +1,5 @@
1
- import { chalk } from '../command-helpers.mjs';
2
- import { checkGitVersion, checkHelperVersion, checkLFSFilters, checkLFSVersion } from './requirements.mjs';
1
+ import { chalk } from '../command-helpers.js';
2
+ import { checkGitVersion, checkHelperVersion, checkLFSFilters, checkLFSVersion } from './requirements.js';
3
3
  export const checkGitVersionStep = {
4
4
  title: 'Checking Git version',
5
5
  // @ts-expect-error TS(7006) FIXME: Parameter 'ctx' implicitly has an 'any' type.
@@ -1,7 +1,7 @@
1
1
  import os from 'os';
2
2
  import boxen from 'boxen';
3
- import { chalk, log } from '../command-helpers.mjs';
4
- import { getShellInfo, isBinInPath } from './install.mjs';
3
+ import { chalk, log } from '../command-helpers.js';
4
+ import { getShellInfo, isBinInPath } from './install.js';
5
5
  /**
6
6
  * @param {boolean} force
7
7
  */
@@ -2,7 +2,7 @@ import process from 'process';
2
2
  // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'bett... Remove this comment to see the full error message
3
3
  import open from 'better-opn';
4
4
  import isDockerContainer from 'is-docker';
5
- import { chalk, log } from './command-helpers.mjs';
5
+ import { chalk, log } from './command-helpers.js';
6
6
  // @ts-expect-error TS(7031) FIXME: Binding element 'message' implicitly has an 'any' ... Remove this comment to see the full error message
7
7
  const unableToOpenBrowserMessage = function ({ message, url }) {
8
8
  log('---------------------------');
@@ -1,5 +1,5 @@
1
- import { exit, log, NETLIFYDEVERR } from './command-helpers.mjs';
2
- import { startProxy } from './proxy.mjs';
1
+ import { exit, log, NETLIFYDEVERR } from './command-helpers.js';
2
+ import { startProxy } from './proxy.js';
3
3
  /**
4
4
  * @typedef {Object} InspectSettings
5
5
  * @property {boolean} enabled - Inspect enabled
@@ -34,7 +34,7 @@ export const generateInspectSettings = (edgeInspect, edgeInspectBrk) => {
34
34
  * @param {object} params
35
35
  * @param {string=} params.accountId
36
36
  * @param {*} params.addonsUrls
37
- * @param {import("../lib/blobs/blobs.mjs").BlobsContext} blobsContext
37
+ * @param {import("../lib/blobs/blobs.js").BlobsContext} blobsContext
38
38
  * @param {import('../commands/types.js').NetlifyOptions["config"]} params.config
39
39
  * @param {string} [params.configPath] An override for the Netlify config path
40
40
  * @param {boolean} params.debug
@@ -49,8 +49,8 @@ export const generateInspectSettings = (edgeInspect, edgeInspectBrk) => {
49
49
  * @param {*} params.siteInfo
50
50
  * @param {string} params.projectDir
51
51
  * @param {string} params.repositoryRoot
52
- * @param {import('./state-config.mjs').default} params.state
53
- * @param {import('../lib/functions/registry.mjs').FunctionsRegistry=} params.functionsRegistry
52
+ * @param {import('./state-config.js').default} params.state
53
+ * @param {import('../lib/functions/registry.js').FunctionsRegistry=} params.functionsRegistry
54
54
  * @returns
55
55
  */
56
56
  export const startProxyServer = async ({
@@ -21,17 +21,17 @@ import jwtDecode from 'jwt-decode';
21
21
  import { locatePath } from 'locate-path';
22
22
  import pFilter from 'p-filter';
23
23
  import toReadableStream from 'to-readable-stream';
24
- import { handleProxyRequest, initializeProxy as initializeEdgeFunctionsProxy, isEdgeFunctionsRequest, } from '../lib/edge-functions/proxy.mjs';
25
- import { fileExistsAsync, isFileAsync } from '../lib/fs.mjs';
26
- import { DEFAULT_FUNCTION_URL_EXPRESSION } from '../lib/functions/registry.mjs';
27
- import { initializeProxy as initializeImageProxy, isImageRequest } from '../lib/images/proxy.mjs';
28
- import renderErrorTemplate from '../lib/render-error-template.mjs';
29
- import { NETLIFYDEVLOG, NETLIFYDEVWARN, log, chalk } from './command-helpers.mjs';
30
- import createStreamPromise from './create-stream-promise.mjs';
31
- import { headersForPath, parseHeaders, NFFunctionName, NFRequestID, NFFunctionRoute } from './headers.mjs';
32
- import { generateRequestID } from './request-id.mjs';
33
- import { createRewriter, onChanges } from './rules-proxy.mjs';
34
- import { signRedirect } from './sign-redirect.mjs';
24
+ import { handleProxyRequest, initializeProxy as initializeEdgeFunctionsProxy, isEdgeFunctionsRequest, } from '../lib/edge-functions/proxy.js';
25
+ import { fileExistsAsync, isFileAsync } from '../lib/fs.js';
26
+ import { DEFAULT_FUNCTION_URL_EXPRESSION } from '../lib/functions/registry.js';
27
+ import { initializeProxy as initializeImageProxy, isImageRequest } from '../lib/images/proxy.js';
28
+ import renderErrorTemplate from '../lib/render-error-template.js';
29
+ import { NETLIFYDEVLOG, NETLIFYDEVWARN, log, chalk } from './command-helpers.js';
30
+ import createStreamPromise from './create-stream-promise.js';
31
+ import { headersForPath, parseHeaders, NFFunctionName, NFRequestID, NFFunctionRoute } from './headers.js';
32
+ import { generateRequestID } from './request-id.js';
33
+ import { createRewriter, onChanges } from './rules-proxy.js';
34
+ import { signRedirect } from './sign-redirect.js';
35
35
  const gunzip = util.promisify(zlib.gunzip);
36
36
  const brotliDecompress = util.promisify(zlib.brotliDecompress);
37
37
  const deflate = util.promisify(zlib.deflate);
@@ -312,8 +312,9 @@ siteInfo, }) {
312
312
  (ct.endsWith('/x-www-form-urlencoded') || ct === 'multipart/form-data')) {
313
313
  return proxy.web(req, res, { target: options.functionsServer });
314
314
  }
315
- const matchingFunction = functionsRegistry && (await functionsRegistry.getFunctionForURLPath(destURL, req.method));
316
315
  const destStaticFile = await getStatic(dest.pathname, options.publicFolder);
316
+ const matchingFunction = functionsRegistry &&
317
+ (await functionsRegistry.getFunctionForURLPath(destURL, req.method, () => Boolean(destStaticFile)));
317
318
  let statusValue;
318
319
  if (match.force ||
319
320
  (!staticFile && ((!options.framework && destStaticFile) || isInternal(destURL) || matchingFunction))) {
@@ -573,11 +574,15 @@ res) => {
573
574
  req.originalBody = ['GET', 'OPTIONS', 'HEAD'].includes(req.method)
574
575
  ? null
575
576
  : await createStreamPromise(req, BYTES_LIMIT);
577
+ if (isImageRequest(req)) {
578
+ return imageProxy(req, res);
579
+ }
576
580
  const edgeFunctionsProxyURL = await edgeFunctionsProxy(req, res);
577
581
  if (edgeFunctionsProxyURL !== undefined) {
578
582
  return proxy.web(req, res, { target: edgeFunctionsProxyURL });
579
583
  }
580
- const functionMatch = functionsRegistry && (await functionsRegistry.getFunctionForURLPath(req.url, req.method));
584
+ const functionMatch = functionsRegistry &&
585
+ (await functionsRegistry.getFunctionForURLPath(req.url, req.method, () => getStatic(decodeURIComponent(reqToURL(req, req.url).pathname), settings.dist)));
581
586
  if (functionMatch) {
582
587
  // Setting an internal header with the function name so that we don't
583
588
  // have to match the URL again in the functions server.
@@ -626,9 +631,6 @@ res) => {
626
631
  (ct.endsWith('/x-www-form-urlencoded') || ct === 'multipart/form-data')) {
627
632
  return proxy.web(req, res, { target: functionsServer });
628
633
  }
629
- if (isImageRequest(req)) {
630
- return imageProxy(req, res);
631
- }
632
634
  proxy.web(req, res, options);
633
635
  };
634
636
  /**
@@ -1,5 +1,5 @@
1
1
  import { parseAllRedirects } from 'netlify-redirect-parser';
2
- import { NETLIFYDEVERR, log } from './command-helpers.mjs';
2
+ import { NETLIFYDEVERR, log } from './command-helpers.js';
3
3
  // Parse, normalize and validate all redirects from `_redirects` files
4
4
  // and `netlify.toml`
5
5
  // @ts-expect-error TS(7031) FIXME: Binding element 'configPath' implicitly has an 'an... Remove this comment to see the full error message
@@ -5,9 +5,9 @@ import cookie from 'cookie';
5
5
  // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'netl... Remove this comment to see the full error message
6
6
  import redirector from 'netlify-redirector';
7
7
  import pFilter from 'p-filter';
8
- import { fileExistsAsync } from '../lib/fs.mjs';
9
- import { NETLIFYDEVLOG } from './command-helpers.mjs';
10
- import { parseRedirects } from './redirects.mjs';
8
+ import { fileExistsAsync } from '../lib/fs.js';
9
+ import { NETLIFYDEVLOG } from './command-helpers.js';
10
+ import { parseRedirects } from './redirects.js';
11
11
  // @ts-expect-error TS(7034) FIXME: Variable 'watchers' implicitly has type 'any[]' in... Remove this comment to see the full error message
12
12
  const watchers = [];
13
13
  // @ts-expect-error TS(7006) FIXME: Parameter 'files' implicitly has an 'any' type.
@@ -1,11 +1,11 @@
1
1
  import { promises as fs } from 'fs';
2
2
  import path, { join } from 'path';
3
- import { getBootstrapURL } from '../lib/edge-functions/bootstrap.mjs';
4
- import { INTERNAL_EDGE_FUNCTIONS_FOLDER } from '../lib/edge-functions/consts.mjs';
5
- import { getPathInProject } from '../lib/settings.mjs';
6
- import { error } from './command-helpers.mjs';
7
- import { startFrameworkServer } from './framework-server.mjs';
8
- import { INTERNAL_FUNCTIONS_FOLDER } from './functions/index.mjs';
3
+ import { getBootstrapURL } from '../lib/edge-functions/bootstrap.js';
4
+ import { INTERNAL_EDGE_FUNCTIONS_FOLDER } from '../lib/edge-functions/consts.js';
5
+ import { getPathInProject } from '../lib/settings.js';
6
+ import { error } from './command-helpers.js';
7
+ import { startFrameworkServer } from './framework-server.js';
8
+ import { INTERNAL_FUNCTIONS_FOLDER } from './functions/index.js';
9
9
  const netlifyBuildPromise = import('@netlify/build');
10
10
  /**
11
11
  * Copies `netlify.toml`, if one is defined, into the `.netlify` internal
@@ -37,8 +37,8 @@ const cleanInternalDirectory = async (basePath) => {
37
37
  };
38
38
  /**
39
39
  * @param {object} params
40
- * @param {import('../commands/base-command.mjs').default} params.command
41
- * @param {import('../commands/base-command.mjs').default} params.command
40
+ * @param {import('../commands/base-command.js').default} params.command
41
+ * @param {import('../commands/base-command.js').default} params.command
42
42
  * @param {*} params.options The flags of the command
43
43
  * @param {import('./types.js').ServerSettings} params.settings
44
44
  * @param {NodeJS.ProcessEnv} [params.env]
@@ -2,8 +2,8 @@ import process from 'process';
2
2
  import execa from 'execa';
3
3
  // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'stri... Remove this comment to see the full error message
4
4
  import stripAnsiCc from 'strip-ansi-control-characters';
5
- import { chalk, log, NETLIFYDEVERR, NETLIFYDEVWARN } from './command-helpers.mjs';
6
- import { processOnExit } from './dev.mjs';
5
+ import { chalk, log, NETLIFYDEVERR, NETLIFYDEVWARN } from './command-helpers.js';
6
+ import { processOnExit } from './dev.js';
7
7
  /**
8
8
  * @type {(() => Promise<void>)[]} - array of functions to run before the process exits
9
9
  */
@@ -5,7 +5,7 @@ import { deleteProperty, getProperty, hasProperty, setProperty } from 'dot-prop'
5
5
  import { findUpSync } from 'find-up';
6
6
  // @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'writ... Remove this comment to see the full error message
7
7
  import writeFileAtomic from 'write-file-atomic';
8
- import { getPathInProject } from '../lib/settings.mjs';
8
+ import { getPathInProject } from '../lib/settings.js';
9
9
  const STATE_PATH = getPathInProject(['state.json']);
10
10
  const permissionError = "You don't have access to this file.";
11
11
  /**
@@ -1,7 +1,7 @@
1
1
  import path from 'path';
2
2
  import fastifyStatic from '@fastify/static';
3
3
  import Fastify from 'fastify';
4
- import { log, NETLIFYDEVLOG } from './command-helpers.mjs';
4
+ import { log, NETLIFYDEVLOG } from './command-helpers.js';
5
5
  /**
6
6
  * @param {object} config
7
7
  * @param {import('./types.js').ServerSettings} config.settings
@@ -0,0 +1,2 @@
1
+ export { track, identify } from './telemetry.js';
2
+ export { reportError } from './report-error.js';
@@ -4,9 +4,9 @@ import process, { version as nodejsVersion } from 'process';
4
4
  import { fileURLToPath } from 'url';
5
5
  import { isCI } from 'ci-info';
6
6
  // @ts-expect-error TS(7034) FIXME: Variable 'execa' implicitly has type 'any' in some... Remove this comment to see the full error message
7
- import execa from '../execa.mjs';
8
- import getGlobalConfig from '../get-global-config.mjs';
9
- import { cliVersion } from './utils.mjs';
7
+ import execa from '../execa.js';
8
+ import getGlobalConfig from '../get-global-config.js';
9
+ import { cliVersion } from './utils.js';
10
10
  const dirPath = dirname(fileURLToPath(import.meta.url));
11
11
  /**
12
12
  *
@@ -47,7 +47,7 @@ export const reportError = async function (error, config = {}) {
47
47
  // spawn detached child process to handle send and wait for the http request to finish
48
48
  // otherwise it can get canceled
49
49
  // @ts-expect-error TS(7005) FIXME: Variable 'execa' implicitly has an 'any' type.
50
- await execa(process.execPath, [join(dirPath, 'request.mjs'), options], {
50
+ await execa(process.execPath, [join(dirPath, 'request.js'), options], {
51
51
  detached: true,
52
52
  stdio: 'ignore',
53
53
  });
@@ -3,7 +3,7 @@
3
3
  import process from 'process';
4
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
5
  import fetch from 'node-fetch';
6
- import getPackageJson from '../get-package-json.mjs';
6
+ import getPackageJson from '../get-package-json.js';
7
7
  const { name, version } = await getPackageJson();
8
8
  const options = JSON.parse(process.argv[2]);
9
9
  const CLIENT_ID = 'NETLIFY_CLI';
@@ -3,10 +3,10 @@ import process, { version as nodejsVersion } from 'process';
3
3
  import { fileURLToPath } from 'url';
4
4
  import { isCI } from 'ci-info';
5
5
  // @ts-expect-error TS(7034) FIXME: Variable 'execa' implicitly has type 'any' in some... Remove this comment to see the full error message
6
- import execa from '../execa.mjs';
7
- import getGlobalConfig from '../get-global-config.mjs';
8
- import { isTelemetryDisabled, cliVersion } from './utils.mjs';
9
- import isValidEventName from './validation.mjs';
6
+ import execa from '../execa.js';
7
+ import getGlobalConfig from '../get-global-config.js';
8
+ import { isTelemetryDisabled, cliVersion } from './utils.js';
9
+ import isValidEventName from './validation.js';
10
10
  const dirPath = dirname(fileURLToPath(import.meta.url));
11
11
  /**
12
12
  * @param {'track' | 'identify'} type
@@ -14,7 +14,7 @@ const dirPath = dirname(fileURLToPath(import.meta.url));
14
14
  */
15
15
  // @ts-expect-error TS(7006) FIXME: Parameter 'type' implicitly has an 'any' type.
16
16
  function send(type, payload) {
17
- const requestFile = join(dirPath, 'request.mjs');
17
+ const requestFile = join(dirPath, 'request.js');
18
18
  const options = JSON.stringify({
19
19
  data: payload,
20
20
  type,
@@ -1,4 +1,4 @@
1
- import getPackageJson from '../get-package-json.mjs';
1
+ import getPackageJson from '../get-package-json.js';
2
2
  export const { version: cliVersion } = await getPackageJson();
3
3
  // @ts-expect-error TS(7006) FIXME: Parameter 'config' implicitly has an 'any' type.
4
4
  export const isTelemetryDisabled = function (config) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Utility to validating analytic event names for clean data
3
3
  */
4
- import { log } from '../command-helpers.mjs';
4
+ import { log } from '../command-helpers.js';
5
5
  // @ts-expect-error TS(7006) FIXME: Parameter 'eventName' implicitly has an 'any' type... Remove this comment to see the full error message
6
6
  export default function isValidEventName(eventName, config) {
7
7
  const validProject = [config.projectName];
@@ -1,4 +1,4 @@
1
- import { BANG, chalk } from './command-helpers.mjs';
1
+ import { BANG, chalk } from './command-helpers.js';
2
2
  /**
3
3
  * @param {string} exampleCommand
4
4
  * @returns {(value:string, previous: unknown) => unknown}
@@ -1,45 +0,0 @@
1
- import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepare.mjs';
2
- import { exit, log } from '../../utils/command-helpers.mjs';
3
- import openBrowser from '../../utils/open-browser.mjs';
4
- /**
5
- * The addons:auth command
6
- * @param {string} addonName
7
- * @param {import('commander').OptionValues} options
8
- * @param {import('../base-command.mjs').default} command
9
- * @returns {Promise<boolean>}
10
- */
11
- // @ts-expect-error TS(7006) FIXME: Parameter 'addonName' implicitly has an 'any' type... Remove this comment to see the full error message
12
- const addonsAuth = async (addonName, options, command) => {
13
- const { addon } = await prepareAddonCommand({
14
- command,
15
- addonName,
16
- validation: ADDON_VALIDATION.EXISTS,
17
- });
18
- if (!addon.auth_url) {
19
- log(`No Admin URL found for the "${addonName} add-on"`);
20
- return false;
21
- }
22
- log();
23
- log(`Opening ${addonName} add-on admin URL:`);
24
- log();
25
- log(addon.auth_url);
26
- log();
27
- // @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
28
- await openBrowser({ url: addon.auth_url });
29
- exit();
30
- };
31
- /**
32
- * Creates the `netlify addons:auth` command
33
- * @param {import('../base-command.mjs').default} program
34
- * @returns
35
- */
36
- // @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
37
- export const createAddonsAuthCommand = (program) => program
38
- .command('addons:auth', { hidden: true })
39
- .alias('addon:auth')
40
- .argument('<name>', 'Add-on slug')
41
- .description('Login to add-on provider')
42
- // @ts-expect-error TS(7006) FIXME: Parameter 'addonName' implicitly has an 'any' type... Remove this comment to see the full error message
43
- .action(async (addonName, options, command) => {
44
- await addonsAuth(addonName, options, command);
45
- });
@@ -1,53 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import { ADDON_VALIDATION, prepareAddonCommand } from '../../utils/addons/prepare.mjs';
3
- import { error, exit, log } from '../../utils/command-helpers.mjs';
4
- /**
5
- * The addons:delete command
6
- * @param {string} addonName
7
- * @param {import('commander').OptionValues} options
8
- * @param {import('../base-command.mjs').default} command
9
- */
10
- // @ts-expect-error TS(7006) FIXME: Parameter 'addonName' implicitly has an 'any' type... Remove this comment to see the full error message
11
- const addonsDelete = async (addonName, options, command) => {
12
- const { addon } = await prepareAddonCommand({
13
- command,
14
- addonName,
15
- validation: ADDON_VALIDATION.EXISTS,
16
- });
17
- if (!options.force && !options.f) {
18
- const { wantsToDelete } = await inquirer.prompt({
19
- type: 'confirm',
20
- name: 'wantsToDelete',
21
- message: `Are you sure you want to delete the ${addonName} add-on? (to skip this prompt, pass a --force flag)`,
22
- default: false,
23
- });
24
- if (!wantsToDelete) {
25
- exit();
26
- }
27
- }
28
- try {
29
- await command.netlify.api.deleteServiceInstance({
30
- siteId: command.netlify.site.id,
31
- addon: addonName,
32
- instanceId: addon.id,
33
- });
34
- log(`Addon "${addonName}" deleted`);
35
- }
36
- catch (error_) {
37
- // @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
38
- error(error_.message);
39
- }
40
- };
41
- /**
42
- * Creates the `netlify addons:delete` command
43
- * @param {import('../base-command.mjs').default} program
44
- * @returns
45
- */
46
- // @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
47
- export const createAddonsDeleteCommand = (program) => program
48
- .command('addons:delete', { hidden: true })
49
- .alias('addon:delete')
50
- .argument('<name>', 'Add-on namespace')
51
- .description(`Remove an add-on extension to your site\nAdd-ons are a way to extend the functionality of your Netlify site`)
52
- .option('-f, --force', 'delete without prompting (useful for CI)')
53
- .action(addonsDelete);
@@ -1,39 +0,0 @@
1
- import { createAddonsAuthCommand } from './addons-auth.mjs';
2
- import { createAddonsConfigCommand } from './addons-config.mjs';
3
- import { createAddonsCreateCommand } from './addons-create.mjs';
4
- import { createAddonsDeleteCommand } from './addons-delete.mjs';
5
- import { createAddonsListCommand } from './addons-list.mjs';
6
- /**
7
- * The addons command
8
- * @param {import('commander').OptionValues} options
9
- * @param {import('../base-command.mjs').default} command
10
- */
11
- // @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
12
- const addons = (options, command) => {
13
- command.help();
14
- };
15
- /**
16
- * Creates the `netlify addons` command
17
- * @param {import('../base-command.mjs').default} program
18
- * @returns
19
- */
20
- // @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
21
- export const createAddonsCommand = (program) => {
22
- createAddonsAuthCommand(program);
23
- createAddonsConfigCommand(program);
24
- createAddonsCreateCommand(program);
25
- createAddonsDeleteCommand(program);
26
- createAddonsListCommand(program);
27
- return program
28
- .command('addons', { hidden: true })
29
- .alias('addon')
30
- .description('[Deprecated and will be removed from future versions] Manage Netlify Add-ons')
31
- .addExamples([
32
- 'netlify addons:create addon-xyz',
33
- 'netlify addons:list',
34
- 'netlify addons:config addon-xyz',
35
- 'netlify addons:delete addon-xyz',
36
- 'netlify addons:auth addon-xyz',
37
- ])
38
- .action(addons);
39
- };
@@ -1 +0,0 @@
1
- export { createAddonsCommand } from './addons.mjs';
@@ -1 +0,0 @@
1
- export { createApiCommand } from './api.mjs';
@@ -1,35 +0,0 @@
1
- import { getStore } from '@netlify/blobs';
2
- import { chalk, error as printError } from '../../utils/command-helpers.mjs';
3
- import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs';
4
- /**
5
- * The blobs:delete command
6
- */
7
- const blobsDelete = async (storeName, key, _options, command) => {
8
- const { api, siteInfo } = command.netlify;
9
- const store = getStore({
10
- apiURL: `${api.scheme}://${api.host}`,
11
- name: storeName,
12
- siteID: siteInfo.id ?? '',
13
- token: api.accessToken ?? '',
14
- });
15
- try {
16
- await store.delete(key);
17
- }
18
- catch {
19
- return printError(`Could not delete blob ${chalk.yellow(key)} from store ${chalk.yellow(storeName)}`);
20
- }
21
- };
22
- /**
23
- * Creates the `netlify blobs:delete` command
24
- * @param {import('../base-command.mjs').default} program
25
- * @returns
26
- */
27
- // @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
28
- export const createBlobsDeleteCommand = (program) => program
29
- .command('blobs:delete')
30
- .description(`(Beta) Deletes an object with a given key, if it exists, from a Netlify Blobs store`)
31
- .argument('<store>', 'Name of the store')
32
- .argument('<key>', 'Object key')
33
- .alias('blob:delete')
34
- .hook('preAction', requiresSiteInfo)
35
- .action(blobsDelete);