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.
- package/bin/{run.mjs → run.js} +3 -3
- package/npm-shrinkwrap.json +4 -4
- package/package.json +8 -9
- package/scripts/{postinstall.mjs → postinstall.js} +3 -4
- package/src/commands/addons/addons-auth.js +22 -0
- package/src/commands/addons/{addons-config.mjs → addons-config.js} +9 -34
- package/src/commands/addons/{addons-create.mjs → addons-create.js} +7 -33
- package/src/commands/addons/addons-delete.js +33 -0
- package/src/commands/addons/{addons-list.mjs → addons-list.js} +3 -25
- package/src/commands/addons/addons.js +68 -0
- package/src/commands/addons/index.js +1 -0
- package/src/commands/api/{api.mjs → api.js} +2 -24
- package/src/commands/api/index.js +13 -0
- package/src/commands/{base-command.mjs → base-command.js} +7 -7
- package/src/commands/blobs/blobs-delete.js +20 -0
- package/src/commands/blobs/{blobs-get.mjs → blobs-get.js} +2 -15
- package/src/commands/blobs/{blobs-list.mjs → blobs-list.js} +2 -16
- package/src/commands/blobs/{blobs-set.mjs → blobs-set.js} +2 -17
- package/src/commands/blobs/blobs.js +74 -0
- package/src/commands/blobs/index.js +1 -0
- package/src/commands/build/{build.mjs → build.js} +7 -28
- package/src/commands/build/index.js +13 -0
- package/src/commands/completion/completion.js +29 -0
- package/src/commands/completion/index.js +26 -0
- package/src/commands/deploy/{deploy.mjs → deploy.js} +17 -133
- package/src/commands/deploy/index.js +106 -0
- package/src/commands/dev/{dev-exec.mjs → dev-exec.js} +3 -15
- package/src/commands/dev/{dev.mjs → dev.js} +19 -38
- package/src/commands/dev/index.js +1 -0
- package/src/commands/env/{env-clone.mjs → env-clone.js} +71 -94
- package/src/commands/env/env-get.js +34 -0
- package/src/commands/env/{env-import.mjs → env-import.js} +38 -65
- package/src/commands/env/{env-list.mjs → env-list.js} +3 -37
- package/src/commands/env/{env-set.mjs → env-set.js} +36 -81
- package/src/commands/env/{env-unset.mjs → env-unset.js} +30 -62
- package/src/commands/env/env.js +127 -0
- package/src/commands/env/index.js +1 -0
- package/src/commands/functions/{functions-build.mjs → functions-build.js} +3 -22
- package/src/commands/functions/{functions-create.mjs → functions-create.js} +20 -47
- package/src/commands/functions/{functions-invoke.mjs → functions-invoke.js} +3 -41
- package/src/commands/functions/{functions-list.mjs → functions-list.js} +3 -27
- package/src/commands/functions/{functions-serve.mjs → functions-serve.js} +6 -28
- package/src/commands/functions/functions.js +98 -0
- package/src/commands/functions/index.js +1 -0
- package/src/commands/index.js +2 -0
- package/src/commands/init/index.js +12 -0
- package/src/commands/init/{init.mjs → init.js} +10 -31
- package/src/commands/integration/{deploy.mjs → deploy.js} +7 -28
- package/src/commands/integration/index.js +26 -0
- package/src/commands/link/index.js +13 -0
- package/src/commands/link/{link.mjs → link.js} +6 -28
- package/src/commands/lm/index.js +1 -0
- package/src/commands/lm/{lm-info.mjs → lm-info.js} +2 -9
- package/src/commands/lm/lm-install.js +8 -0
- package/src/commands/lm/{lm-setup.mjs → lm-setup.js} +6 -25
- package/src/commands/lm/lm-uninstall.js +7 -0
- package/src/commands/lm/lm.js +46 -0
- package/src/commands/login/index.js +9 -0
- package/src/commands/login/{login.mjs → login.js} +1 -19
- package/src/commands/logout/index.js +7 -0
- package/src/commands/logout/{logout.mjs → logout.js} +3 -16
- package/src/commands/logs/{build.mjs → build.js} +3 -8
- package/src/commands/logs/{functions.mjs → functions.js} +4 -27
- package/src/commands/logs/index.js +39 -0
- package/src/commands/logs/log-levels.js +11 -0
- package/src/commands/{main.mjs → main.js} +32 -32
- package/src/commands/open/index.js +31 -0
- package/src/commands/open/open-admin.js +11 -0
- package/src/commands/open/open-site.js +12 -0
- package/src/commands/open/open.js +13 -0
- package/src/commands/recipes/{common.mjs → common.js} +2 -2
- package/src/commands/recipes/index.js +20 -0
- package/src/commands/recipes/recipes-list.js +14 -0
- package/src/commands/recipes/{recipes.mjs → recipes.js} +8 -32
- package/src/commands/serve/index.js +27 -0
- package/src/commands/serve/{serve.mjs → serve.js} +14 -51
- package/src/commands/sites/index.js +1 -0
- package/src/commands/sites/{sites-create-template.mjs → sites-create-template.js} +9 -38
- package/src/commands/sites/{sites-create.mjs → sites-create.js} +5 -38
- package/src/commands/sites/{sites-delete.mjs → sites-delete.js} +2 -22
- package/src/commands/sites/{sites-list.mjs → sites-list.js} +4 -24
- package/src/commands/sites/sites.js +77 -0
- package/src/commands/status/index.js +19 -0
- package/src/commands/status/{status-hooks.mjs → status-hooks.js} +2 -20
- package/src/commands/status/{status.mjs → status.js} +2 -23
- package/src/commands/switch/index.js +7 -0
- package/src/commands/switch/{switch.mjs → switch.js} +3 -16
- package/src/commands/unlink/index.js +7 -0
- package/src/commands/unlink/unlink.js +21 -0
- package/src/commands/watch/index.js +8 -0
- package/src/commands/watch/{watch.mjs → watch.js} +4 -21
- package/src/lib/{api.mjs → api.js} +1 -1
- package/src/lib/blobs/{blobs.mjs → blobs.js} +2 -2
- package/src/lib/{build.mjs → build.js} +3 -3
- package/src/lib/completion/{constants.mjs → constants.js} +1 -1
- package/src/lib/completion/{generate-autocompletion.mjs → generate-autocompletion.js} +3 -3
- package/src/lib/completion/{index.mjs → index.js} +1 -1
- package/src/lib/completion/{script.mjs → script.js} +3 -3
- package/src/lib/edge-functions/{deploy.mjs → deploy.js} +2 -2
- package/src/lib/edge-functions/{editor-helper.mjs → editor-helper.js} +1 -1
- package/src/lib/edge-functions/{internal.mjs → internal.js} +2 -2
- package/src/lib/edge-functions/{proxy.mjs → proxy.js} +10 -11
- package/src/lib/edge-functions/{registry.mjs → registry.js} +4 -2
- package/src/lib/{exec-fetcher.mjs → exec-fetcher.js} +2 -2
- package/src/lib/functions/{background.mjs → background.js} +2 -2
- package/src/lib/functions/{form-submissions-handler.mjs → form-submissions-handler.js} +3 -3
- package/src/lib/functions/{local-proxy.mjs → local-proxy.js} +1 -1
- package/src/lib/functions/{netlify-function.mjs → netlify-function.js} +18 -63
- package/src/lib/functions/{registry.mjs → registry.js} +33 -96
- package/src/lib/functions/runtimes/go/{index.mjs → index.js} +2 -2
- package/src/lib/functions/runtimes/{index.mjs → index.js} +3 -4
- package/src/lib/functions/runtimes/js/builders/{netlify-lambda.mjs → netlify-lambda.js} +3 -3
- package/src/lib/functions/runtimes/js/builders/{zisi.mjs → zisi.js} +6 -6
- package/src/lib/functions/runtimes/js/{index.mjs → index.js} +4 -4
- package/src/lib/functions/runtimes/rust/{index.mjs → index.js} +4 -4
- package/src/lib/functions/{scheduled.mjs → scheduled.js} +2 -2
- package/src/lib/functions/{server.mjs → server.js} +16 -15
- package/src/lib/functions/{synchronous.mjs → synchronous.js} +3 -3
- package/src/lib/functions/{utils.mjs → utils.js} +2 -2
- package/src/lib/{geo-location.mjs → geo-location.js} +1 -1
- package/src/lib/{http-agent.mjs → http-agent.js} +1 -1
- package/src/lib/images/{proxy.mjs → proxy.js} +3 -3
- package/src/lib/{log.mjs → log.js} +1 -1
- package/src/recipes/vscode/{index.mjs → index.js} +2 -2
- package/src/recipes/vscode/{settings.mjs → settings.js} +0 -1
- package/src/utils/addons/diffs/{index.mjs → index.js} +1 -1
- package/src/utils/addons/diffs/{options.mjs → options.js} +0 -1
- package/src/utils/addons/{prepare.mjs → prepare.js} +2 -2
- package/src/utils/addons/{prompts.mjs → prompts.js} +1 -1
- package/src/utils/addons/{render.mjs → render.js} +1 -1
- package/src/utils/{banner.mjs → banner.js} +1 -1
- package/src/utils/{build-info.mjs → build-info.js} +3 -3
- package/src/utils/{command-helpers.mjs → command-helpers.js} +4 -9
- package/src/utils/deploy/{deploy-site.mjs → deploy-site.js} +8 -8
- package/src/utils/deploy/{hash-files.mjs → hash-files.js} +1 -1
- package/src/utils/deploy/{hash-fns.mjs → hash-fns.js} +3 -3
- package/src/utils/deploy/{hasher-segments.mjs → hasher-segments.js} +1 -1
- package/src/utils/deploy/{upload-files.mjs → upload-files.js} +1 -1
- package/src/utils/deploy/{util.mjs → util.js} +1 -1
- package/src/utils/{detect-server-settings.mjs → detect-server-settings.js} +6 -7
- package/src/utils/{dev.mjs → dev.js} +3 -3
- package/src/utils/{dot-env.mjs → dot-env.js} +2 -2
- package/src/utils/env/{index.mjs → index.js} +1 -1
- package/src/utils/{framework-server.mjs → framework-server.js} +4 -4
- package/src/utils/functions/{functions.mjs → functions.js} +2 -2
- package/src/utils/functions/{get-functions.mjs → get-functions.js} +1 -1
- package/src/utils/functions/index.js +3 -0
- package/src/utils/{get-global-config.mjs → get-global-config.js} +1 -1
- package/src/utils/{get-repo-data.mjs → get-repo-data.js} +1 -1
- package/src/utils/{get-site.mjs → get-site.js} +1 -1
- package/src/utils/{gh-auth.mjs → gh-auth.js} +3 -3
- package/src/utils/{gitignore.mjs → gitignore.js} +2 -2
- package/src/utils/{headers.mjs → headers.js} +1 -1
- package/src/utils/hooks/{requires-site-info.mjs → requires-site-info.js} +1 -1
- package/src/utils/init/{config-github.mjs → config-github.js} +4 -4
- package/src/utils/init/{config-manual.mjs → config-manual.js} +5 -5
- package/src/utils/init/{config.mjs → config.js} +4 -4
- package/src/utils/init/{node-version.mjs → node-version.js} +1 -1
- package/src/utils/init/{utils.mjs → utils.js} +7 -7
- package/src/utils/{live-tunnel.mjs → live-tunnel.js} +4 -4
- package/src/utils/lm/{install.mjs → install.js} +6 -6
- package/src/utils/lm/{requirements.mjs → requirements.js} +1 -1
- package/src/utils/lm/{steps.mjs → steps.js} +2 -2
- package/src/utils/lm/{ui.mjs → ui.js} +2 -2
- package/src/utils/{open-browser.mjs → open-browser.js} +1 -1
- package/src/utils/{proxy-server.mjs → proxy-server.js} +5 -5
- package/src/utils/{proxy.mjs → proxy.js} +18 -16
- package/src/utils/{redirects.mjs → redirects.js} +1 -1
- package/src/utils/{rules-proxy.mjs → rules-proxy.js} +3 -3
- package/src/utils/{run-build.mjs → run-build.js} +8 -8
- package/src/utils/{shell.mjs → shell.js} +2 -2
- package/src/utils/{state-config.mjs → state-config.js} +1 -1
- package/src/utils/{static-server.mjs → static-server.js} +1 -1
- package/src/utils/telemetry/index.js +2 -0
- package/src/utils/telemetry/{report-error.mjs → report-error.js} +4 -4
- package/src/utils/telemetry/{request.mjs → request.js} +1 -1
- package/src/utils/telemetry/{telemetry.mjs → telemetry.js} +5 -5
- package/src/utils/telemetry/{utils.mjs → utils.js} +1 -1
- package/src/utils/telemetry/{validation.mjs → validation.js} +1 -1
- package/src/utils/{validation.mjs → validation.js} +1 -1
- package/src/commands/addons/addons-auth.mjs +0 -45
- package/src/commands/addons/addons-delete.mjs +0 -53
- package/src/commands/addons/addons.mjs +0 -39
- package/src/commands/addons/index.mjs +0 -1
- package/src/commands/api/index.mjs +0 -1
- package/src/commands/blobs/blobs-delete.mjs +0 -35
- package/src/commands/blobs/blobs.mjs +0 -32
- package/src/commands/blobs/index.mjs +0 -1
- package/src/commands/build/index.mjs +0 -1
- package/src/commands/completion/completion.mjs +0 -53
- package/src/commands/completion/index.mjs +0 -1
- package/src/commands/deploy/index.mjs +0 -1
- package/src/commands/dev/index.mjs +0 -1
- package/src/commands/dev/types.d.ts +0 -30
- package/src/commands/env/env-get.mjs +0 -66
- package/src/commands/env/env.mjs +0 -41
- package/src/commands/env/index.mjs +0 -1
- package/src/commands/functions/functions.mjs +0 -39
- package/src/commands/functions/index.mjs +0 -1
- package/src/commands/index.mjs +0 -2
- package/src/commands/init/index.mjs +0 -1
- package/src/commands/integration/index.mjs +0 -24
- package/src/commands/link/index.mjs +0 -1
- package/src/commands/lm/index.mjs +0 -1
- package/src/commands/lm/lm-install.mjs +0 -27
- package/src/commands/lm/lm-uninstall.mjs +0 -18
- package/src/commands/lm/lm.mjs +0 -30
- package/src/commands/login/index.mjs +0 -1
- package/src/commands/logout/index.mjs +0 -1
- package/src/commands/logs/index.mjs +0 -12
- package/src/commands/open/index.mjs +0 -1
- package/src/commands/open/open-admin.mjs +0 -30
- package/src/commands/open/open-site.mjs +0 -31
- package/src/commands/open/open.mjs +0 -36
- package/src/commands/recipes/index.mjs +0 -1
- package/src/commands/recipes/recipes-list.mjs +0 -25
- package/src/commands/serve/index.mjs +0 -1
- package/src/commands/sites/index.mjs +0 -2
- package/src/commands/sites/sites.mjs +0 -30
- package/src/commands/status/index.mjs +0 -1
- package/src/commands/switch/index.mjs +0 -1
- package/src/commands/types.d.ts +0 -31
- package/src/commands/unlink/index.mjs +0 -1
- package/src/commands/unlink/unlink.mjs +0 -34
- package/src/commands/watch/index.mjs +0 -1
- package/src/functions-templates/typescript/abtest/{{name}}.ts +0 -31
- package/src/functions-templates/typescript/geolocation/{{name}}.ts +0 -24
- package/src/functions-templates/typescript/hello-world/{{name}}.ts +0 -12
- package/src/functions-templates/typescript/json/{{name}}.ts +0 -5
- package/src/functions-templates/typescript/log/{{name}}.ts +0 -9
- package/src/functions-templates/typescript/scheduled-function/{{name}}.ts +0 -12
- package/src/functions-templates/typescript/set-cookies/{{name}}.ts +0 -29
- package/src/functions-templates/typescript/set-req-header/{{name}}.ts +0 -5
- package/src/functions-templates/typescript/set-res-header/{{name}}.ts +0 -7
- package/src/functions-templates/typescript/transform-response/{{name}}.ts +0 -13
- package/src/utils/functions/index.mjs +0 -3
- package/src/utils/telemetry/index.mjs +0 -2
- package/src/utils/types.d.ts +0 -46
- /package/src/functions-templates/go/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/hello/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/identity-signup/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/image-external/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/localized-content/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/sanity-create/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/sanity-groq/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/submission-created/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/rust/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/abtest/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/geolocation/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/json/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/log/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/lib/{account.mjs → account.js} +0 -0
- /package/src/lib/completion/{get-autocompletion.mjs → get-autocompletion.js} +0 -0
- /package/src/lib/edge-functions/{bootstrap.mjs → bootstrap.js} +0 -0
- /package/src/lib/edge-functions/{consts.mjs → consts.js} +0 -0
- /package/src/lib/edge-functions/{headers.mjs → headers.js} +0 -0
- /package/src/lib/{fs.mjs → fs.js} +0 -0
- /package/src/lib/functions/{config.mjs → config.js} +0 -0
- /package/src/lib/functions/{memoized-build.mjs → memoized-build.js} +0 -0
- /package/src/lib/functions/runtimes/js/{constants.mjs → constants.js} +0 -0
- /package/src/lib/functions/runtimes/js/{worker.mjs → worker.js} +0 -0
- /package/src/lib/{path.mjs → path.js} +0 -0
- /package/src/lib/{render-error-template.mjs → render-error-template.js} +0 -0
- /package/src/lib/{settings.mjs → settings.js} +0 -0
- /package/src/lib/{spinner.mjs → spinner.js} +0 -0
- /package/src/lib/{string.mjs → string.js} +0 -0
- /package/src/utils/addons/{compare.mjs → compare.js} +0 -0
- /package/src/utils/addons/{validation.mjs → validation.js} +0 -0
- /package/src/utils/{create-deferred.mjs → create-deferred.js} +0 -0
- /package/src/utils/{create-stream-promise.mjs → create-stream-promise.js} +0 -0
- /package/src/utils/deploy/{constants.mjs → constants.js} +0 -0
- /package/src/utils/deploy/{hash-config.mjs → hash-config.js} +0 -0
- /package/src/utils/{execa.mjs → execa.js} +0 -0
- /package/src/utils/{feature-flags.mjs → feature-flags.js} +0 -0
- /package/src/utils/functions/{constants.mjs → constants.js} +0 -0
- /package/src/utils/{get-package-json.mjs → get-package-json.js} +0 -0
- /package/src/utils/init/{plugins.mjs → plugins.js} +0 -0
- /package/src/utils/{parse-raw-flags.mjs → parse-raw-flags.js} +0 -0
- /package/src/utils/{read-repo-url.mjs → read-repo-url.js} +0 -0
- /package/src/utils/{request-id.mjs → request-id.js} +0 -0
- /package/src/utils/{sign-redirect.mjs → sign-redirect.js} +0 -0
- /package/src/utils/sites/{utils.mjs → utils.js} +0 -0
- /package/src/utils/websockets/{index.mjs → index.js} +0 -0
|
@@ -3,9 +3,9 @@ import { dirname } from 'path';
|
|
|
3
3
|
import { pathToFileURL } from 'url';
|
|
4
4
|
import { Worker } from 'worker_threads';
|
|
5
5
|
import lambdaLocal from 'lambda-local';
|
|
6
|
-
import detectNetlifyLambdaBuilder from './builders/netlify-lambda.
|
|
7
|
-
import detectZisiBuilder, { parseFunctionForMetadata } from './builders/zisi.
|
|
8
|
-
import { SECONDS_TO_MILLISECONDS } from './constants.
|
|
6
|
+
import detectNetlifyLambdaBuilder from './builders/netlify-lambda.js';
|
|
7
|
+
import detectZisiBuilder, { parseFunctionForMetadata } from './builders/zisi.js';
|
|
8
|
+
import { SECONDS_TO_MILLISECONDS } from './constants.js';
|
|
9
9
|
export const name = 'js';
|
|
10
10
|
// @ts-expect-error TS(7034) FIXME: Variable 'netlifyLambdaDetectorCache' implicitly h... Remove this comment to see the full error message
|
|
11
11
|
let netlifyLambdaDetectorCache;
|
|
@@ -40,7 +40,7 @@ export const getBuildFunction = async ({ config, directory, errorExit, func, pro
|
|
|
40
40
|
// @ts-expect-error TS(2532) FIXME: Object is possibly 'undefined'.
|
|
41
41
|
return () => ({ schedule: metadata.schedule, srcFiles });
|
|
42
42
|
};
|
|
43
|
-
const workerURL = new URL('worker.
|
|
43
|
+
const workerURL = new URL('worker.js', import.meta.url);
|
|
44
44
|
// @ts-expect-error TS(7031) FIXME: Binding element 'context' implicitly has an 'any' ... Remove this comment to see the full error message
|
|
45
45
|
export const invokeFunction = async ({ context, environment, event, func, timeout }) => {
|
|
46
46
|
if (func.buildData.runtimeAPIVersion !== 2) {
|
|
@@ -4,10 +4,10 @@ import { platform } from 'process';
|
|
|
4
4
|
import { findUp } from 'find-up';
|
|
5
5
|
import toml from 'toml';
|
|
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 '../../../../utils/execa.
|
|
8
|
-
import { SERVE_FUNCTIONS_FOLDER } from '../../../../utils/functions/functions.
|
|
9
|
-
import { getPathInProject } from '../../../settings.
|
|
10
|
-
import { runFunctionsProxy } from '../../local-proxy.
|
|
7
|
+
import execa from '../../../../utils/execa.js';
|
|
8
|
+
import { SERVE_FUNCTIONS_FOLDER } from '../../../../utils/functions/functions.js';
|
|
9
|
+
import { getPathInProject } from '../../../settings.js';
|
|
10
|
+
import { runFunctionsProxy } from '../../local-proxy.js';
|
|
11
11
|
const isWindows = platform === 'win32';
|
|
12
12
|
export const name = 'rs';
|
|
13
13
|
// @ts-expect-error TS(7031) FIXME: Binding element 'func' implicitly has an 'any' typ... Remove this comment to see the full error message
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import AnsiToHtml from 'ansi-to-html';
|
|
2
|
-
import { CLOCKWORK_USERAGENT } from '../../utils/functions/index.
|
|
3
|
-
import { formatLambdaError } from './utils.
|
|
2
|
+
import { CLOCKWORK_USERAGENT } from '../../utils/functions/index.js';
|
|
3
|
+
import { formatLambdaError } from './utils.js';
|
|
4
4
|
const ansiToHtml = new AnsiToHtml();
|
|
5
5
|
// @ts-expect-error TS(7031) FIXME: Binding element 'error' implicitly has an 'any' ty... Remove this comment to see the full error message
|
|
6
6
|
export const buildHelpResponse = ({ error, headers, path, result }) => {
|
|
@@ -5,18 +5,18 @@ import express from 'express';
|
|
|
5
5
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'expr... Remove this comment to see the full error message
|
|
6
6
|
import expressLogging from 'express-logging';
|
|
7
7
|
import jwtDecode from 'jwt-decode';
|
|
8
|
-
import { NETLIFYDEVERR, NETLIFYDEVLOG, error as errorExit, log } from '../../utils/command-helpers.
|
|
9
|
-
import { isFeatureFlagEnabled } from '../../utils/feature-flags.
|
|
10
|
-
import { CLOCKWORK_USERAGENT, getFunctionsDistPath, getFunctionsServePath, getInternalFunctionsDir, } from '../../utils/functions/index.
|
|
11
|
-
import { NFFunctionName, NFFunctionRoute } from '../../utils/headers.
|
|
12
|
-
import { headers as efHeaders } from '../edge-functions/headers.
|
|
13
|
-
import { getGeoLocation } from '../geo-location.
|
|
14
|
-
import { handleBackgroundFunction, handleBackgroundFunctionResult } from './background.
|
|
15
|
-
import { createFormSubmissionHandler } from './form-submissions-handler.
|
|
16
|
-
import { FunctionsRegistry } from './registry.
|
|
17
|
-
import { handleScheduledFunction } from './scheduled.
|
|
18
|
-
import { handleSynchronousFunction } from './synchronous.
|
|
19
|
-
import { shouldBase64Encode } from './utils.
|
|
8
|
+
import { NETLIFYDEVERR, NETLIFYDEVLOG, error as errorExit, log } from '../../utils/command-helpers.js';
|
|
9
|
+
import { isFeatureFlagEnabled } from '../../utils/feature-flags.js';
|
|
10
|
+
import { CLOCKWORK_USERAGENT, getFunctionsDistPath, getFunctionsServePath, getInternalFunctionsDir, } from '../../utils/functions/index.js';
|
|
11
|
+
import { NFFunctionName, NFFunctionRoute } from '../../utils/headers.js';
|
|
12
|
+
import { headers as efHeaders } from '../edge-functions/headers.js';
|
|
13
|
+
import { getGeoLocation } from '../geo-location.js';
|
|
14
|
+
import { handleBackgroundFunction, handleBackgroundFunctionResult } from './background.js';
|
|
15
|
+
import { createFormSubmissionHandler } from './form-submissions-handler.js';
|
|
16
|
+
import { FunctionsRegistry } from './registry.js';
|
|
17
|
+
import { handleScheduledFunction } from './scheduled.js';
|
|
18
|
+
import { handleSynchronousFunction } from './synchronous.js';
|
|
19
|
+
import { shouldBase64Encode } from './utils.js';
|
|
20
20
|
// @ts-expect-error TS(7006) FIXME: Parameter 'headers' implicitly has an 'any' type.
|
|
21
21
|
const buildClientContext = function (headers) {
|
|
22
22
|
// inject a client context based on auth header, ported over from netlify-lambda (https://github.com/netlify/netlify-lambda/pull/57)
|
|
@@ -201,8 +201,8 @@ const getFunctionsServer = (options) => {
|
|
|
201
201
|
/**
|
|
202
202
|
*
|
|
203
203
|
* @param {object} options
|
|
204
|
-
* @param {import("../blobs/blobs.
|
|
205
|
-
* @param {import('../../commands/base-command.
|
|
204
|
+
* @param {import("../blobs/blobs.js").BlobsContext} options.blobsContext
|
|
205
|
+
* @param {import('../../commands/base-command.js').default} options.command
|
|
206
206
|
* @param {*} options.capabilities
|
|
207
207
|
* @param {*} options.config
|
|
208
208
|
* @param {boolean} options.debug
|
|
@@ -212,7 +212,7 @@ const getFunctionsServer = (options) => {
|
|
|
212
212
|
* @param {*} options.siteInfo
|
|
213
213
|
* @param {string} options.siteUrl
|
|
214
214
|
* @param {*} options.timeouts
|
|
215
|
-
* @returns {Promise<import('./registry.
|
|
215
|
+
* @returns {Promise<import('./registry.js').FunctionsRegistry | undefined>}
|
|
216
216
|
*/
|
|
217
217
|
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
218
218
|
export const startFunctionsServer = async (options) => {
|
|
@@ -259,6 +259,7 @@ export const startFunctionsServer = async (options) => {
|
|
|
259
259
|
}
|
|
260
260
|
const functionsRegistry = new FunctionsRegistry({
|
|
261
261
|
blobsContext,
|
|
262
|
+
// @ts-expect-error TS(7031) FIXME
|
|
262
263
|
capabilities,
|
|
263
264
|
config,
|
|
264
265
|
debug,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Buffer } from 'buffer';
|
|
2
2
|
import { isStream } from 'is-stream';
|
|
3
|
-
import { chalk, logPadded, NETLIFYDEVERR } from '../../utils/command-helpers.
|
|
4
|
-
import renderErrorTemplate from '../render-error-template.
|
|
5
|
-
import { detectAwsSdkError } from './utils.
|
|
3
|
+
import { chalk, logPadded, NETLIFYDEVERR } from '../../utils/command-helpers.js';
|
|
4
|
+
import renderErrorTemplate from '../render-error-template.js';
|
|
5
|
+
import { detectAwsSdkError } from './utils.js';
|
|
6
6
|
/**
|
|
7
7
|
* @typedef InvocationError
|
|
8
8
|
* @property {string} errorType
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { chalk, warn } from '../../utils/command-helpers.
|
|
2
|
-
import { MISSING_AWS_SDK_WARNING } from '../log.
|
|
1
|
+
import { chalk, warn } from '../../utils/command-helpers.js';
|
|
2
|
+
import { MISSING_AWS_SDK_WARNING } from '../log.js';
|
|
3
3
|
// @ts-expect-error TS(7031) FIXME: Binding element 'error' implicitly has an 'any' ty... Remove this comment to see the full error message
|
|
4
4
|
export const detectAwsSdkError = ({ error }) => {
|
|
5
5
|
const isAwsSdkError = error && error.errorMessage && error.errorMessage.includes("Cannot find module 'aws-sdk'");
|
|
@@ -36,7 +36,7 @@ export const mockLocation = {
|
|
|
36
36
|
* @param {"cache"|"update"|"mock"} params.mode
|
|
37
37
|
* @param {string} params.geoCountry
|
|
38
38
|
* @param {boolean} params.offline
|
|
39
|
-
* @param {import('../utils/state-config.
|
|
39
|
+
* @param {import('../utils/state-config.js').default} params.state
|
|
40
40
|
* @returns {Promise<GeoLocation>}
|
|
41
41
|
*/
|
|
42
42
|
// @ts-expect-error TS(7031) FIXME: Binding element 'geoCountry' implicitly has an 'an... Remove this comment to see the full error message
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'fs/promises';
|
|
2
2
|
import HttpsProxyAgent from 'https-proxy-agent';
|
|
3
3
|
import waitPort from 'wait-port';
|
|
4
|
-
import { NETLIFYDEVERR, NETLIFYDEVWARN, exit, log } from '../utils/command-helpers.
|
|
4
|
+
import { NETLIFYDEVERR, NETLIFYDEVWARN, exit, log } from '../utils/command-helpers.js';
|
|
5
5
|
// https://github.com/TooTallNate/node-https-proxy-agent/issues/89
|
|
6
6
|
// Maybe replace with https://github.com/delvedor/hpagent
|
|
7
7
|
// @ts-expect-error TS(2507) FIXME: Type 'typeof createHttpsProxyAgent' is not a const... Remove this comment to see the full error message
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { createIPX, ipxFSStorage, ipxHttpStorage, createIPXNodeServer } from 'ipx';
|
|
3
|
-
import { log, NETLIFYDEVERR } from '../../utils/command-helpers.
|
|
4
|
-
import { getProxyUrl } from '../../utils/proxy.
|
|
3
|
+
import { log, NETLIFYDEVERR } from '../../utils/command-helpers.js';
|
|
4
|
+
import { getProxyUrl } from '../../utils/proxy.js';
|
|
5
5
|
export const IMAGE_URL_PATTERN = '/.netlify/images';
|
|
6
6
|
// @ts-expect-error TS(7006) FIXME: Parameter 'config' implicitly has an 'any' type.
|
|
7
7
|
export const parseAllDomains = function (config) {
|
|
@@ -94,7 +94,7 @@ export const initializeProxy = async function ({ config, settings, }) {
|
|
|
94
94
|
if (!sourceImagePath.startsWith('http://') && !sourceImagePath.startsWith('https://')) {
|
|
95
95
|
// Construct the full URL for relative paths to request from development server
|
|
96
96
|
const sourceImagePathWithLeadingSlash = sourceImagePath.startsWith('/') ? sourceImagePath : `/${sourceImagePath}`;
|
|
97
|
-
const fullImageUrl = `${devServerUrl}
|
|
97
|
+
const fullImageUrl = `${devServerUrl}${encodeURIComponent(sourceImagePathWithLeadingSlash)}`;
|
|
98
98
|
console.log(`fullImageUrl: ${fullImageUrl}`);
|
|
99
99
|
req.url = `/${modifiers}/${fullImageUrl}`;
|
|
100
100
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { chalk } from '../utils/command-helpers.
|
|
1
|
+
import { chalk } from '../utils/command-helpers.js';
|
|
2
2
|
const RED_BACKGROUND = chalk.red('-background');
|
|
3
3
|
const [PRO, BUSINESS, ENTERPRISE] = ['Pro', 'Business', 'Enterprise'].map((plan) => chalk.magenta(plan));
|
|
4
4
|
export const BACKGROUND_FUNCTIONS_WARNING = `A serverless function ending in \`${RED_BACKGROUND}\` was detected.
|
|
@@ -2,8 +2,8 @@ import { join } from 'path';
|
|
|
2
2
|
import { DenoBridge } from '@netlify/edge-bundler';
|
|
3
3
|
import execa from 'execa';
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
|
-
import { NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, error, log } from '../../utils/command-helpers.
|
|
6
|
-
import { applySettings, getSettings, writeSettings } from './settings.
|
|
5
|
+
import { NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, error, log } from '../../utils/command-helpers.js';
|
|
6
|
+
import { applySettings, getSettings, writeSettings } from './settings.js';
|
|
7
7
|
export const description = 'Create VS Code settings for an optimal experience with Netlify projects';
|
|
8
8
|
// @ts-expect-error TS(7031) FIXME: Binding element 'fileExists' implicitly has an 'an... Remove this comment to see the full error message
|
|
9
9
|
const getPrompt = ({ fileExists, path }) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { mkdir, readFile, stat, writeFile } from 'fs/promises';
|
|
2
2
|
import { dirname, relative } from 'path';
|
|
3
|
-
// eslint-disable-next-line import/no-namespace
|
|
4
3
|
import * as JSONC from 'comment-json';
|
|
5
4
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'unix... Remove this comment to see the full error message
|
|
6
5
|
import unixify from 'unixify';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'conc... Remove this comment to see the full error message
|
|
2
2
|
import concordance from 'concordance';
|
|
3
|
-
import { concordanceDiffOptions, concordanceOptions } from './options.
|
|
3
|
+
import { concordanceDiffOptions, concordanceOptions } from './options.js';
|
|
4
4
|
// @ts-expect-error TS(7006) FIXME: Parameter 'actualDescriptor' implicitly has an 'an... Remove this comment to see the full error message
|
|
5
5
|
const formatDescriptorDiff = function (actualDescriptor, expectedDescriptor, options) {
|
|
6
6
|
const diffOptions = { ...options, ...concordanceDiffOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { chalk, error, exit, log, warn } from '../command-helpers.
|
|
1
|
+
import { chalk, error, exit, log, warn } from '../command-helpers.js';
|
|
2
2
|
export const ADDON_VALIDATION = {
|
|
3
3
|
EXISTS: 'EXISTS',
|
|
4
4
|
NOT_EXISTS: 'NOT_EXISTS',
|
|
@@ -88,7 +88,7 @@ export const getAddons = async ({ api, siteId }) => {
|
|
|
88
88
|
/**
|
|
89
89
|
*
|
|
90
90
|
* @param {object} config
|
|
91
|
-
* @param {import('../../commands/base-command.
|
|
91
|
+
* @param {import('../../commands/base-command.js').default} config.command
|
|
92
92
|
* @param {string} [config.addonName]
|
|
93
93
|
* @param {keyof ADDON_VALIDATION} [config.validation]
|
|
94
94
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { chalk } from '../command-helpers.
|
|
1
|
+
import { chalk } from '../command-helpers.js';
|
|
2
2
|
/* programmatically generate CLI prompts */
|
|
3
3
|
// @ts-expect-error TS(7006) FIXME: Parameter 'settings' implicitly has an 'any' type.
|
|
4
4
|
export default function generatePrompts(settings) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AsciiTable from 'ascii-table';
|
|
2
|
-
import { chalk } from '../command-helpers.
|
|
2
|
+
import { chalk } from '../command-helpers.js';
|
|
3
3
|
// @ts-expect-error TS(7006) FIXME: Parameter 'values' implicitly has an 'any' type.
|
|
4
4
|
export const renderMissingValues = function (values, manifest) {
|
|
5
5
|
const display = values
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import boxen from 'boxen';
|
|
2
|
-
import { chalk, log, NETLIFYDEVLOG } from './command-helpers.
|
|
2
|
+
import { chalk, log, NETLIFYDEVLOG } from './command-helpers.js';
|
|
3
3
|
// @ts-expect-error TS(7031) FIXME: Binding element 'url' implicitly has an 'any' type... Remove this comment to see the full error message
|
|
4
4
|
export const printBanner = ({ url }) => {
|
|
5
5
|
const banner = chalk.bold(`${NETLIFYDEVLOG} Server now ready on ${url}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fuzzy from 'fuzzy';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
-
import { chalk, log } from './command-helpers.
|
|
3
|
+
import { chalk, log } from './command-helpers.js';
|
|
4
4
|
/**
|
|
5
5
|
* Filters the inquirer settings based on the input
|
|
6
6
|
* @param {ReturnType<typeof formatSettingsArrForInquirer>} scriptInquirerOptions
|
|
@@ -37,7 +37,7 @@ const formatSettingsArrForInquirer = function (settings, type = 'dev') {
|
|
|
37
37
|
/**
|
|
38
38
|
* Uses @netlify/build-info to detect the dev settings and port based on the framework
|
|
39
39
|
* and the build system that is used.
|
|
40
|
-
* @param {import('../commands/base-command.
|
|
40
|
+
* @param {import('../commands/base-command.js').default} command
|
|
41
41
|
* @param {'dev' | 'build'} type The type of command (dev or build)
|
|
42
42
|
* @returns {Promise<Settings | undefined>}
|
|
43
43
|
*/
|
|
@@ -80,7 +80,7 @@ command = "${chosenSettings.devCommand}"
|
|
|
80
80
|
};
|
|
81
81
|
/**
|
|
82
82
|
* Detects and filters the build setting for a project and a command
|
|
83
|
-
* @param {import('../commands/base-command.
|
|
83
|
+
* @param {import('../commands/base-command.js').default} command
|
|
84
84
|
*/
|
|
85
85
|
// @ts-expect-error TS(7006) FIXME: Parameter 'command' implicitly has an 'any' type.
|
|
86
86
|
export const detectBuildSettings = async (command) => {
|
|
@@ -2,17 +2,16 @@ import { once } from 'events';
|
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import process from 'process';
|
|
4
4
|
import { format, inspect } from 'util';
|
|
5
|
-
// eslint-disable-next-line no-restricted-imports
|
|
6
5
|
import { Chalk } from 'chalk';
|
|
7
6
|
import chokidar from 'chokidar';
|
|
8
7
|
import decache from 'decache';
|
|
9
8
|
import WSL from 'is-wsl';
|
|
10
9
|
import debounce from 'lodash/debounce.js';
|
|
11
10
|
import terminalLink from 'terminal-link';
|
|
12
|
-
import { clearSpinner, startSpinner } from '../lib/spinner.
|
|
13
|
-
import getGlobalConfig from './get-global-config.
|
|
14
|
-
import getPackageJson from './get-package-json.
|
|
15
|
-
import { reportError } from './telemetry/report-error.
|
|
11
|
+
import { clearSpinner, startSpinner } from '../lib/spinner.js';
|
|
12
|
+
import getGlobalConfig from './get-global-config.js';
|
|
13
|
+
import getPackageJson from './get-package-json.js';
|
|
14
|
+
import { reportError } from './telemetry/report-error.js';
|
|
16
15
|
/** The parsed process argv without the binary only arguments and flags */
|
|
17
16
|
const argv = process.argv.slice(2);
|
|
18
17
|
/**
|
|
@@ -202,7 +201,6 @@ export const exit = (code = 0) => {
|
|
|
202
201
|
// @ts-expect-error TS(7006) FIXME: Parameter 'config' implicitly has an 'any' type.
|
|
203
202
|
export const normalizeConfig = (config) => {
|
|
204
203
|
// Unused var here is in order to omit 'publish' from build config
|
|
205
|
-
// eslint-disable-next-line no-unused-vars
|
|
206
204
|
const { publish, publishOrigin, ...build } = config.build;
|
|
207
205
|
return publishOrigin === 'default' ? { ...config, build } : config;
|
|
208
206
|
};
|
|
@@ -253,9 +251,6 @@ export const watchDebounced = async (target, { depth, ignored = [], onAdd = noOp
|
|
|
253
251
|
// @ts-expect-error TS(7006) FIXME: Parameter 'text' implicitly has an 'any' type.
|
|
254
252
|
export const getTerminalLink = (text, url) => terminalLink(text, url, { fallback: () => `${text} (${url})` });
|
|
255
253
|
export const isNodeError = (err) => error instanceof Error;
|
|
256
|
-
// FIXME: tsc is throwing the following error:
|
|
257
|
-
// @ts-expect-error TS7060: This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint.
|
|
258
|
-
// Adding a trailing comma to the generic type fixes the problem, but annoyingly Prettier is undoing that.
|
|
259
254
|
export const nonNullable = (value) => value !== null && value !== undefined;
|
|
260
255
|
export const noOp = () => {
|
|
261
256
|
// no-op
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { rm } from 'fs/promises';
|
|
2
2
|
import cleanDeep from 'clean-deep';
|
|
3
3
|
import { temporaryDirectory } from 'tempy';
|
|
4
|
-
import { deployFileNormalizer, getDistPathIfExists, isEdgeFunctionFile } from '../../lib/edge-functions/deploy.
|
|
5
|
-
import { warn } from '../command-helpers.
|
|
6
|
-
import { DEFAULT_CONCURRENT_HASH, DEFAULT_CONCURRENT_UPLOAD, DEFAULT_DEPLOY_TIMEOUT, DEFAULT_MAX_RETRY, DEFAULT_SYNC_LIMIT, } from './constants.
|
|
7
|
-
import { hashConfig } from './hash-config.
|
|
8
|
-
import hashFiles from './hash-files.
|
|
9
|
-
import hashFns from './hash-fns.
|
|
10
|
-
import uploadFiles from './upload-files.
|
|
11
|
-
import { getUploadList, waitForDeploy, waitForDiff } from './util.
|
|
4
|
+
import { deployFileNormalizer, getDistPathIfExists, isEdgeFunctionFile } from '../../lib/edge-functions/deploy.js';
|
|
5
|
+
import { warn } from '../command-helpers.js';
|
|
6
|
+
import { DEFAULT_CONCURRENT_HASH, DEFAULT_CONCURRENT_UPLOAD, DEFAULT_DEPLOY_TIMEOUT, DEFAULT_MAX_RETRY, DEFAULT_SYNC_LIMIT, } from './constants.js';
|
|
7
|
+
import { hashConfig } from './hash-config.js';
|
|
8
|
+
import hashFiles from './hash-files.js';
|
|
9
|
+
import hashFns from './hash-fns.js';
|
|
10
|
+
import uploadFiles from './upload-files.js';
|
|
11
|
+
import { getUploadList, waitForDeploy, waitForDiff } from './util.js';
|
|
12
12
|
export const deploySite = async (
|
|
13
13
|
// @ts-expect-error TS(7006) FIXME: Parameter 'api' implicitly has an 'any' type.
|
|
14
14
|
api,
|
|
@@ -3,7 +3,7 @@ import { promisify } from 'util';
|
|
|
3
3
|
import walker from 'folder-walker';
|
|
4
4
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'pump... Remove this comment to see the full error message
|
|
5
5
|
import pumpModule from 'pump';
|
|
6
|
-
import { fileFilterCtor, fileNormalizerCtor, hasherCtor, manifestCollectorCtor } from './hasher-segments.
|
|
6
|
+
import { fileFilterCtor, fileNormalizerCtor, hasherCtor, manifestCollectorCtor } from './hasher-segments.js';
|
|
7
7
|
const pump = promisify(pumpModule);
|
|
8
8
|
const hashFiles = async ({ assetType = 'file',
|
|
9
9
|
// @ts-expect-error TS(7031) FIXME: Binding element 'concurrentHash' implicitly has an... Remove this comment to see the full error message
|
|
@@ -6,9 +6,9 @@ import { zipFunctions } from '@netlify/zip-it-and-ship-it';
|
|
|
6
6
|
import fromArray from 'from2-array';
|
|
7
7
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'pump... Remove this comment to see the full error message
|
|
8
8
|
import pumpModule from 'pump';
|
|
9
|
-
import { getPathInProject } from '../../lib/settings.
|
|
10
|
-
import { INTERNAL_FUNCTIONS_FOLDER } from '../functions/functions.
|
|
11
|
-
import { hasherCtor, manifestCollectorCtor } from './hasher-segments.
|
|
9
|
+
import { getPathInProject } from '../../lib/settings.js';
|
|
10
|
+
import { INTERNAL_FUNCTIONS_FOLDER } from '../functions/functions.js';
|
|
11
|
+
import { hasherCtor, manifestCollectorCtor } from './hasher-segments.js';
|
|
12
12
|
const pump = promisify(pumpModule);
|
|
13
13
|
// Maximum age of functions manifest (2 minutes).
|
|
14
14
|
const MANIFEST_FILE_TTL = 12e4;
|
|
@@ -7,7 +7,7 @@ import transform from 'parallel-transform';
|
|
|
7
7
|
import { objCtor as objFilterCtor } from 'through2-filter';
|
|
8
8
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'thro... Remove this comment to see the full error message
|
|
9
9
|
import { obj as map } from 'through2-map';
|
|
10
|
-
import { normalizePath } from './util.
|
|
10
|
+
import { normalizePath } from './util.js';
|
|
11
11
|
// a parallel transform stream segment ctor that hashes fileObj's created by folder-walker
|
|
12
12
|
// TODO: use promises instead of callbacks
|
|
13
13
|
/* eslint-disable promise/prefer-await-to-callbacks */
|
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'back... Remove this comment to see the full error message
|
|
3
3
|
import backoff from 'backoff';
|
|
4
4
|
import pMap from 'p-map';
|
|
5
|
-
import { UPLOAD_INITIAL_DELAY, UPLOAD_MAX_DELAY, UPLOAD_RANDOM_FACTOR } from './constants.
|
|
5
|
+
import { UPLOAD_INITIAL_DELAY, UPLOAD_MAX_DELAY, UPLOAD_RANDOM_FACTOR } from './constants.js';
|
|
6
6
|
// @ts-expect-error TS(7006) FIXME: Parameter 'api' implicitly has an 'any' type.
|
|
7
7
|
const uploadFiles = async (api, deployId, uploadList, { concurrentUpload, maxRetry, statusCb }) => {
|
|
8
8
|
if (!concurrentUpload || !statusCb || !maxRetry)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sep } from 'path';
|
|
2
2
|
import pWaitFor from 'p-wait-for';
|
|
3
|
-
import { DEPLOY_POLL } from './constants.
|
|
3
|
+
import { DEPLOY_POLL } from './constants.js';
|
|
4
4
|
// normalize windows paths to unix paths
|
|
5
5
|
// @ts-expect-error TS(7006) FIXME: Parameter 'relname' implicitly has an 'any' type.
|
|
6
6
|
export const normalizePath = (relname) => {
|
|
@@ -3,11 +3,11 @@ import { EOL } from 'os';
|
|
|
3
3
|
import { dirname, relative, resolve } from 'path';
|
|
4
4
|
import { getFramework, getSettings } from '@netlify/build-info';
|
|
5
5
|
import getPort from 'get-port';
|
|
6
|
-
import { detectFrameworkSettings } from './build-info.
|
|
7
|
-
import { NETLIFYDEVWARN, chalk, log } from './command-helpers.
|
|
8
|
-
import { acquirePort } from './dev.
|
|
9
|
-
import { getInternalFunctionsDir } from './functions/functions.
|
|
10
|
-
import { getPluginsToAutoInstall } from './init/utils.
|
|
6
|
+
import { detectFrameworkSettings } from './build-info.js';
|
|
7
|
+
import { NETLIFYDEVWARN, chalk, log } from './command-helpers.js';
|
|
8
|
+
import { acquirePort } from './dev.js';
|
|
9
|
+
import { getInternalFunctionsDir } from './functions/functions.js';
|
|
10
|
+
import { getPluginsToAutoInstall } from './init/utils.js';
|
|
11
11
|
/** @param {string} str */
|
|
12
12
|
// @ts-expect-error TS(7006) FIXME: Parameter 'str' implicitly has an 'any' type.
|
|
13
13
|
const formatProperty = (str) => chalk.magenta(`'${str}'`);
|
|
@@ -49,7 +49,6 @@ const readHttpsSettings = async (options) => {
|
|
|
49
49
|
*/
|
|
50
50
|
// @ts-expect-error TS(7006) FIXME: Parameter 'devConfig' implicitly has an 'any' type... Remove this comment to see the full error message
|
|
51
51
|
function validateProperty(devConfig, property, type) {
|
|
52
|
-
// eslint-disable-next-line valid-typeof
|
|
53
52
|
if (devConfig[property] && typeof devConfig[property] !== type) {
|
|
54
53
|
const formattedProperty = formatProperty(property);
|
|
55
54
|
throw new TypeError(`Invalid ${formattedProperty} option provided in config. The value of ${formattedProperty} option must be of type ${type}`);
|
|
@@ -236,7 +235,7 @@ const handleForcedFramework = async ({ devConfig, project, workingDir, workspace
|
|
|
236
235
|
* Get the server settings based on the flags and the devConfig
|
|
237
236
|
* @param {import('../commands/dev/types.js').DevConfig} devConfig
|
|
238
237
|
* @param {import('commander').OptionValues} flags
|
|
239
|
-
* @param {import('../commands/base-command.
|
|
238
|
+
* @param {import('../commands/base-command.js').default} command
|
|
240
239
|
* @returns {Promise<import('./types.js').ServerSettings>}
|
|
241
240
|
*/
|
|
242
241
|
// @ts-expect-error TS(7006) FIXME: Parameter 'devConfig' implicitly has an 'any' type... Remove this comment to see the full error message
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
2
|
import getPort from 'get-port';
|
|
3
3
|
import isEmpty from 'lodash/isEmpty.js';
|
|
4
|
-
import { supportsBackgroundFunctions } from '../lib/account.
|
|
5
|
-
import { NETLIFYDEVLOG, chalk, error, log, warn } from './command-helpers.
|
|
6
|
-
import { loadDotEnvFiles } from './dot-env.
|
|
4
|
+
import { supportsBackgroundFunctions } from '../lib/account.js';
|
|
5
|
+
import { NETLIFYDEVLOG, chalk, error, log, warn } from './command-helpers.js';
|
|
6
|
+
import { loadDotEnvFiles } from './dot-env.js';
|
|
7
7
|
// Possible sources of environment variables. For the purpose of printing log messages only. Order does not matter.
|
|
8
8
|
const ENV_VAR_SOURCES = {
|
|
9
9
|
account: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFile } from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import dotenv from 'dotenv';
|
|
4
|
-
import { isFileAsync } from '../lib/fs.
|
|
5
|
-
import { warn } from './command-helpers.
|
|
4
|
+
import { isFileAsync } from '../lib/fs.js';
|
|
5
|
+
import { warn } from './command-helpers.js';
|
|
6
6
|
// @ts-expect-error TS(7031) FIXME: Binding element 'envFiles' implicitly has an 'any'... Remove this comment to see the full error message
|
|
7
7
|
export const loadDotEnvFiles = async function ({ envFiles, projectDir }) {
|
|
8
8
|
const response = await tryLoadDotEnvFiles({ projectDir, dotenvFiles: envFiles });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { error } from '../command-helpers.
|
|
1
|
+
import { error } from '../command-helpers.js';
|
|
2
2
|
export const AVAILABLE_CONTEXTS = ['all', 'production', 'deploy-preview', 'branch-deploy', 'dev'];
|
|
3
3
|
export const AVAILABLE_SCOPES = ['builds', 'functions', 'runtime', 'post_processing'];
|
|
4
4
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import waitPort from 'wait-port';
|
|
2
|
-
import { startSpinner, stopSpinner } from '../lib/spinner.
|
|
3
|
-
import { error, exit, log, NETLIFYDEVERR, NETLIFYDEVLOG } from './command-helpers.
|
|
4
|
-
import { runCommand } from './shell.
|
|
5
|
-
import { startStaticServer } from './static-server.
|
|
2
|
+
import { startSpinner, stopSpinner } from '../lib/spinner.js';
|
|
3
|
+
import { error, exit, log, NETLIFYDEVERR, NETLIFYDEVLOG } from './command-helpers.js';
|
|
4
|
+
import { runCommand } from './shell.js';
|
|
5
|
+
import { startStaticServer } from './static-server.js';
|
|
6
6
|
// 10 minutes
|
|
7
7
|
const FRAMEWORK_PORT_TIMEOUT = 6e5;
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
|
-
import { isDirectoryAsync, isFileAsync } from '../../lib/fs.
|
|
4
|
-
import { getPathInProject } from '../../lib/settings.
|
|
3
|
+
import { isDirectoryAsync, isFileAsync } from '../../lib/fs.js';
|
|
4
|
+
import { getPathInProject } from '../../lib/settings.js';
|
|
5
5
|
export const INTERNAL_FUNCTIONS_FOLDER = 'functions-internal';
|
|
6
6
|
export const SERVE_FUNCTIONS_FOLDER = 'functions-serve';
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { listFunctions } from '@netlify/zip-it-and-ship-it';
|
|
2
|
-
import { fileExistsAsync } from '../../lib/fs.
|
|
2
|
+
import { fileExistsAsync } from '../../lib/fs.js';
|
|
3
3
|
// @ts-expect-error TS(7006) FIXME: Parameter 'functionName' implicitly has an 'any' t... Remove this comment to see the full error message
|
|
4
4
|
const getUrlPath = (functionName) => `/.netlify/functions/${functionName}`;
|
|
5
5
|
export const BACKGROUND = '-background';
|
|
@@ -2,7 +2,7 @@ import { readFile } from 'fs/promises';
|
|
|
2
2
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'conf... Remove this comment to see the full error message
|
|
3
3
|
import Configstore from 'configstore';
|
|
4
4
|
import { v4 as uuidv4 } from 'uuid';
|
|
5
|
-
import { getLegacyPathInHome, getPathInHome } from '../lib/settings.
|
|
5
|
+
import { getLegacyPathInHome, getPathInHome } from '../lib/settings.js';
|
|
6
6
|
const globalConfigDefaults = {
|
|
7
7
|
/* disable stats from being sent to Netlify */
|
|
8
8
|
telemetryDisabled: false,
|
|
@@ -6,7 +6,7 @@ import gitRepoInfo from 'git-repo-info';
|
|
|
6
6
|
import gitconfiglocal from 'gitconfiglocal';
|
|
7
7
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'pars... Remove this comment to see the full error message
|
|
8
8
|
import parseGitRemote from 'parse-github-url';
|
|
9
|
-
import { log } from './command-helpers.
|
|
9
|
+
import { log } from './command-helpers.js';
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
12
|
* @param {object} config
|
|
@@ -4,9 +4,9 @@ import process from 'process';
|
|
|
4
4
|
import { Octokit } from '@octokit/rest';
|
|
5
5
|
import getPort from 'get-port';
|
|
6
6
|
import inquirer from 'inquirer';
|
|
7
|
-
import { log } from './command-helpers.
|
|
8
|
-
import createDeferred from './create-deferred.
|
|
9
|
-
import openBrowser from './open-browser.
|
|
7
|
+
import { log } from './command-helpers.js';
|
|
8
|
+
import createDeferred from './create-deferred.js';
|
|
9
|
+
import openBrowser from './open-browser.js';
|
|
10
10
|
const SERVER_PORT = 3000;
|
|
11
11
|
/**
|
|
12
12
|
* @typedef Token
|
|
@@ -2,8 +2,8 @@ import { readFile, writeFile } from 'fs/promises';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'pars... Remove this comment to see the full error message
|
|
4
4
|
import parseIgnore from 'parse-gitignore';
|
|
5
|
-
import { fileExistsAsync } from '../lib/fs.
|
|
6
|
-
import { log } from './command-helpers.
|
|
5
|
+
import { fileExistsAsync } from '../lib/fs.js';
|
|
6
|
+
import { log } from './command-helpers.js';
|
|
7
7
|
// @ts-expect-error TS(7006) FIXME: Parameter 'dir' implicitly has an 'any' type.
|
|
8
8
|
const hasGitIgnore = async function (dir) {
|
|
9
9
|
const gitIgnorePath = path.join(dir, '.gitignore');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Octokit } from '@octokit/rest';
|
|
2
|
-
import { chalk, error as failAndExit, log } from '../command-helpers.
|
|
3
|
-
import { getGitHubToken as ghauth } from '../gh-auth.
|
|
4
|
-
import { createDeployKey, formatErrorMessage, getBuildSettings, saveNetlifyToml, setupSite } from './utils.
|
|
2
|
+
import { chalk, error as failAndExit, log } from '../command-helpers.js';
|
|
3
|
+
import { getGitHubToken as ghauth } from '../gh-auth.js';
|
|
4
|
+
import { createDeployKey, formatErrorMessage, getBuildSettings, saveNetlifyToml, setupSite } from './utils.js';
|
|
5
5
|
/**
|
|
6
6
|
* @typedef Token
|
|
7
7
|
* @type {object}
|
|
@@ -197,7 +197,7 @@ const addNotificationHooks = async ({ api, siteId, token }) => {
|
|
|
197
197
|
};
|
|
198
198
|
/**
|
|
199
199
|
* @param {object} config
|
|
200
|
-
* @param {import('../../commands/base-command.
|
|
200
|
+
* @param {import('../../commands/base-command.js').default} config.command
|
|
201
201
|
* @param {string} config.repoName
|
|
202
202
|
* @param {string} config.repoOwner
|
|
203
203
|
* @param {string} config.siteId
|