netlify-cli 17.5.3 → 17.7.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} +14 -14
- 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} +1 -1
- 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} +3 -3
- package/src/lib/functions/{registry.mjs → registry.js} +9 -9
- 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} +15 -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} +2 -2
- 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} +11 -11
- 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
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
|
-
import { exit, log } from '../command-helpers.
|
|
3
|
-
import { createDeployKey, getBuildSettings, saveNetlifyToml, setupSite } from './utils.
|
|
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.
|
|
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.
|
|
67
|
-
* @param {Awaited<ReturnType<import('../../utils/get-repo-data.
|
|
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.
|
|
2
|
-
import { configGithub } from './config-github.
|
|
3
|
-
import configManual from './config-manual.
|
|
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.
|
|
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.
|
|
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.
|
|
6
|
-
import { normalizeBackslash } from '../../lib/path.
|
|
7
|
-
import { detectBuildSettings } from '../build-info.
|
|
8
|
-
import { chalk, error as failAndExit, log, warn } from '../command-helpers.
|
|
9
|
-
import { getRecommendPlugins, getUIPlugins } from './plugins.
|
|
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.
|
|
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.
|
|
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.
|
|
7
|
-
import { getPathInHome } from '../lib/settings.
|
|
8
|
-
import { NETLIFYDEVERR, NETLIFYDEVLOG, chalk, log } from './command-helpers.
|
|
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.
|
|
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.
|
|
12
|
-
import { fileExistsAsync } from '../../lib/fs.
|
|
13
|
-
import { normalizeBackslash } from '../../lib/path.
|
|
14
|
-
import { getLegacyPathInHome, getPathInHome } from '../../lib/settings.
|
|
15
|
-
import { chalk } from '../command-helpers.
|
|
16
|
-
import { checkGitLFSVersionStep, checkGitVersionStep, checkLFSFiltersStep } from './steps.
|
|
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.
|
|
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.
|
|
2
|
-
import { checkGitVersion, checkHelperVersion, checkLFSFilters, checkLFSVersion } from './requirements.
|
|
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.
|
|
4
|
-
import { getShellInfo, isBinInPath } from './install.
|
|
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.
|
|
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.
|
|
2
|
-
import { startProxy } from './proxy.
|
|
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.
|
|
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.
|
|
53
|
-
* @param {import('../lib/functions/registry.
|
|
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.
|
|
25
|
-
import { fileExistsAsync, isFileAsync } from '../lib/fs.
|
|
26
|
-
import { DEFAULT_FUNCTION_URL_EXPRESSION } from '../lib/functions/registry.
|
|
27
|
-
import { initializeProxy as initializeImageProxy, isImageRequest } from '../lib/images/proxy.
|
|
28
|
-
import renderErrorTemplate from '../lib/render-error-template.
|
|
29
|
-
import { NETLIFYDEVLOG, NETLIFYDEVWARN, log, chalk } from './command-helpers.
|
|
30
|
-
import createStreamPromise from './create-stream-promise.
|
|
31
|
-
import { headersForPath, parseHeaders, NFFunctionName, NFRequestID, NFFunctionRoute } from './headers.
|
|
32
|
-
import { generateRequestID } from './request-id.
|
|
33
|
-
import { createRewriter, onChanges } from './rules-proxy.
|
|
34
|
-
import { signRedirect } from './sign-redirect.
|
|
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);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseAllRedirects } from 'netlify-redirect-parser';
|
|
2
|
-
import { NETLIFYDEVERR, log } from './command-helpers.
|
|
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.
|
|
9
|
-
import { NETLIFYDEVLOG } from './command-helpers.
|
|
10
|
-
import { parseRedirects } from './redirects.
|
|
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.
|
|
4
|
-
import { INTERNAL_EDGE_FUNCTIONS_FOLDER } from '../lib/edge-functions/consts.
|
|
5
|
-
import { getPathInProject } from '../lib/settings.
|
|
6
|
-
import { error } from './command-helpers.
|
|
7
|
-
import { startFrameworkServer } from './framework-server.
|
|
8
|
-
import { INTERNAL_FUNCTIONS_FOLDER } from './functions/index.
|
|
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.
|
|
41
|
-
* @param {import('../commands/base-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.
|
|
6
|
-
import { processOnExit } from './dev.
|
|
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.
|
|
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.
|
|
4
|
+
import { log, NETLIFYDEVLOG } from './command-helpers.js';
|
|
5
5
|
/**
|
|
6
6
|
* @param {object} config
|
|
7
7
|
* @param {import('./types.js').ServerSettings} config.settings
|
|
@@ -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.
|
|
8
|
-
import getGlobalConfig from '../get-global-config.
|
|
9
|
-
import { cliVersion } from './utils.
|
|
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.
|
|
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.
|
|
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.
|
|
7
|
-
import getGlobalConfig from '../get-global-config.
|
|
8
|
-
import { isTelemetryDisabled, cliVersion } from './utils.
|
|
9
|
-
import isValidEventName from './validation.
|
|
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.
|
|
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.
|
|
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.
|
|
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,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';
|