netlify 27.4.3 → 27.5.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/dist/commands/clone/clone.d.ts +7 -1
- package/dist/commands/clone/clone.js +207 -22
- package/dist/commands/clone/index.js +18 -7
- package/dist/commands/git-credential/git-credential.d.ts +7 -0
- package/dist/commands/git-credential/git-credential.js +39 -0
- package/dist/commands/git-credential/index.d.ts +3 -0
- package/dist/commands/git-credential/index.js +9 -0
- package/dist/commands/git-credential/option_values.d.ts +3 -0
- package/dist/commands/git-credential/option_values.js +2 -0
- package/dist/commands/logs/index.js +4 -1
- package/dist/commands/logs/logs.d.ts +17 -2
- package/dist/commands/logs/logs.js +32 -14
- package/dist/commands/logs/option_values.d.ts +14 -0
- package/dist/commands/logs/option_values.js +3 -0
- package/dist/commands/logs/sources/deploy.d.ts +7 -3
- package/dist/commands/logs/sources/deploy.js +115 -38
- package/dist/commands/main.js +2 -0
- package/package.json +5 -4
- package/dist/commands/agents/agents-create.d.ts.map +0 -1
- package/dist/commands/agents/agents-create.js.map +0 -1
- package/dist/commands/agents/agents-list.d.ts.map +0 -1
- package/dist/commands/agents/agents-list.js.map +0 -1
- package/dist/commands/agents/agents-show.d.ts.map +0 -1
- package/dist/commands/agents/agents-show.js.map +0 -1
- package/dist/commands/agents/agents-stop.d.ts.map +0 -1
- package/dist/commands/agents/agents-stop.js.map +0 -1
- package/dist/commands/agents/agents.d.ts.map +0 -1
- package/dist/commands/agents/agents.js.map +0 -1
- package/dist/commands/agents/constants.d.ts.map +0 -1
- package/dist/commands/agents/constants.js.map +0 -1
- package/dist/commands/agents/index.d.ts.map +0 -1
- package/dist/commands/agents/index.js.map +0 -1
- package/dist/commands/agents/types.d.ts.map +0 -1
- package/dist/commands/agents/types.js.map +0 -1
- package/dist/commands/agents/utils.d.ts.map +0 -1
- package/dist/commands/agents/utils.js.map +0 -1
- package/dist/commands/api/api.d.ts.map +0 -1
- package/dist/commands/api/api.js.map +0 -1
- package/dist/commands/api/index.d.ts.map +0 -1
- package/dist/commands/api/index.js.map +0 -1
- package/dist/commands/base-command.d.ts.map +0 -1
- package/dist/commands/base-command.js.map +0 -1
- package/dist/commands/blobs/blobs-delete.d.ts.map +0 -1
- package/dist/commands/blobs/blobs-delete.js.map +0 -1
- package/dist/commands/blobs/blobs-get.d.ts.map +0 -1
- package/dist/commands/blobs/blobs-get.js.map +0 -1
- package/dist/commands/blobs/blobs-list.d.ts.map +0 -1
- package/dist/commands/blobs/blobs-list.js.map +0 -1
- package/dist/commands/blobs/blobs-set.d.ts.map +0 -1
- package/dist/commands/blobs/blobs-set.js.map +0 -1
- package/dist/commands/blobs/blobs.d.ts.map +0 -1
- package/dist/commands/blobs/blobs.js.map +0 -1
- package/dist/commands/build/build.d.ts.map +0 -1
- package/dist/commands/build/build.js.map +0 -1
- package/dist/commands/build/index.d.ts.map +0 -1
- package/dist/commands/build/index.js.map +0 -1
- package/dist/commands/claim/claim.d.ts.map +0 -1
- package/dist/commands/claim/claim.js.map +0 -1
- package/dist/commands/claim/index.d.ts.map +0 -1
- package/dist/commands/claim/index.js.map +0 -1
- package/dist/commands/clone/clone.d.ts.map +0 -1
- package/dist/commands/clone/clone.js.map +0 -1
- package/dist/commands/clone/index.d.ts.map +0 -1
- package/dist/commands/clone/index.js.map +0 -1
- package/dist/commands/clone/option_values.d.ts.map +0 -1
- package/dist/commands/clone/option_values.js.map +0 -1
- package/dist/commands/completion/completion.d.ts.map +0 -1
- package/dist/commands/completion/completion.js.map +0 -1
- package/dist/commands/completion/index.d.ts.map +0 -1
- package/dist/commands/completion/index.js.map +0 -1
- package/dist/commands/create/create-action.d.ts.map +0 -1
- package/dist/commands/create/create-action.js.map +0 -1
- package/dist/commands/create/create.d.ts.map +0 -1
- package/dist/commands/create/create.js.map +0 -1
- package/dist/commands/create/index.d.ts.map +0 -1
- package/dist/commands/create/index.js.map +0 -1
- package/dist/commands/database/database.d.ts.map +0 -1
- package/dist/commands/database/database.js.map +0 -1
- package/dist/commands/database/db-connect.d.ts.map +0 -1
- package/dist/commands/database/db-connect.js.map +0 -1
- package/dist/commands/database/db-init.d.ts.map +0 -1
- package/dist/commands/database/db-init.js.map +0 -1
- package/dist/commands/database/db-migrate.d.ts.map +0 -1
- package/dist/commands/database/db-migrate.js.map +0 -1
- package/dist/commands/database/db-migration-new.d.ts.map +0 -1
- package/dist/commands/database/db-migration-new.js.map +0 -1
- package/dist/commands/database/db-migration-pull.d.ts.map +0 -1
- package/dist/commands/database/db-migration-pull.js.map +0 -1
- package/dist/commands/database/db-migrations-reset.d.ts.map +0 -1
- package/dist/commands/database/db-migrations-reset.js.map +0 -1
- package/dist/commands/database/db-reset.d.ts.map +0 -1
- package/dist/commands/database/db-reset.js.map +0 -1
- package/dist/commands/database/db-status.d.ts.map +0 -1
- package/dist/commands/database/db-status.js.map +0 -1
- package/dist/commands/database/index.d.ts.map +0 -1
- package/dist/commands/database/index.js.map +0 -1
- package/dist/commands/database/util/api-errors.d.ts.map +0 -1
- package/dist/commands/database/util/api-errors.js.map +0 -1
- package/dist/commands/database/util/applied-migrations.d.ts.map +0 -1
- package/dist/commands/database/util/applied-migrations.js.map +0 -1
- package/dist/commands/database/util/constants.d.ts.map +0 -1
- package/dist/commands/database/util/constants.js.map +0 -1
- package/dist/commands/database/util/db-connection.d.ts.map +0 -1
- package/dist/commands/database/util/db-connection.js.map +0 -1
- package/dist/commands/database/util/init-data.d.ts.map +0 -1
- package/dist/commands/database/util/init-data.js.map +0 -1
- package/dist/commands/database/util/meta-commands.d.ts.map +0 -1
- package/dist/commands/database/util/meta-commands.js.map +0 -1
- package/dist/commands/database/util/migrations-path.d.ts.map +0 -1
- package/dist/commands/database/util/migrations-path.js.map +0 -1
- package/dist/commands/database/util/package-json.d.ts.map +0 -1
- package/dist/commands/database/util/package-json.js.map +0 -1
- package/dist/commands/database/util/packages.d.ts.map +0 -1
- package/dist/commands/database/util/packages.js.map +0 -1
- package/dist/commands/database/util/paths.d.ts.map +0 -1
- package/dist/commands/database/util/paths.js.map +0 -1
- package/dist/commands/database/util/pg-client-executor.d.ts.map +0 -1
- package/dist/commands/database/util/pg-client-executor.js.map +0 -1
- package/dist/commands/database/util/psql-formatter.d.ts.map +0 -1
- package/dist/commands/database/util/psql-formatter.js.map +0 -1
- package/dist/commands/database/util/spawn-async.d.ts.map +0 -1
- package/dist/commands/database/util/spawn-async.js.map +0 -1
- package/dist/commands/database/util/timestamp.d.ts.map +0 -1
- package/dist/commands/database/util/timestamp.js.map +0 -1
- package/dist/commands/deploy/deploy.d.ts.map +0 -1
- package/dist/commands/deploy/deploy.js.map +0 -1
- package/dist/commands/deploy/index.d.ts.map +0 -1
- package/dist/commands/deploy/index.js.map +0 -1
- package/dist/commands/deploy/option_values.d.ts.map +0 -1
- package/dist/commands/deploy/option_values.js.map +0 -1
- package/dist/commands/dev/dev.d.ts.map +0 -1
- package/dist/commands/dev/dev.js.map +0 -1
- package/dist/commands/dev/index.d.ts.map +0 -1
- package/dist/commands/dev/index.js.map +0 -1
- package/dist/commands/dev/programmatic-netlify-dev.d.ts.map +0 -1
- package/dist/commands/dev/programmatic-netlify-dev.js.map +0 -1
- package/dist/commands/dev-exec/dev-exec.d.ts.map +0 -1
- package/dist/commands/dev-exec/dev-exec.js.map +0 -1
- package/dist/commands/dev-exec/index.d.ts.map +0 -1
- package/dist/commands/dev-exec/index.js.map +0 -1
- package/dist/commands/env/env-clone.d.ts.map +0 -1
- package/dist/commands/env/env-clone.js.map +0 -1
- package/dist/commands/env/env-get.d.ts.map +0 -1
- package/dist/commands/env/env-get.js.map +0 -1
- package/dist/commands/env/env-import.d.ts.map +0 -1
- package/dist/commands/env/env-import.js.map +0 -1
- package/dist/commands/env/env-list.d.ts.map +0 -1
- package/dist/commands/env/env-list.js.map +0 -1
- package/dist/commands/env/env-set.d.ts.map +0 -1
- package/dist/commands/env/env-set.js.map +0 -1
- package/dist/commands/env/env-unset.d.ts.map +0 -1
- package/dist/commands/env/env-unset.js.map +0 -1
- package/dist/commands/env/env.d.ts.map +0 -1
- package/dist/commands/env/env.js.map +0 -1
- package/dist/commands/env/index.d.ts.map +0 -1
- package/dist/commands/env/index.js.map +0 -1
- package/dist/commands/env/utils.d.ts.map +0 -1
- package/dist/commands/env/utils.js.map +0 -1
- package/dist/commands/functions/functions-build.d.ts.map +0 -1
- package/dist/commands/functions/functions-build.js.map +0 -1
- package/dist/commands/functions/functions-create.d.ts.map +0 -1
- package/dist/commands/functions/functions-create.js.map +0 -1
- package/dist/commands/functions/functions-invoke.d.ts.map +0 -1
- package/dist/commands/functions/functions-invoke.js.map +0 -1
- package/dist/commands/functions/functions-list.d.ts.map +0 -1
- package/dist/commands/functions/functions-list.js.map +0 -1
- package/dist/commands/functions/functions-serve.d.ts.map +0 -1
- package/dist/commands/functions/functions-serve.js.map +0 -1
- package/dist/commands/functions/functions.d.ts.map +0 -1
- package/dist/commands/functions/functions.js.map +0 -1
- package/dist/commands/functions/index.d.ts.map +0 -1
- package/dist/commands/functions/index.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init/constants.d.ts.map +0 -1
- package/dist/commands/init/constants.js.map +0 -1
- package/dist/commands/init/index.d.ts.map +0 -1
- package/dist/commands/init/index.js.map +0 -1
- package/dist/commands/init/init.d.ts.map +0 -1
- package/dist/commands/init/init.js.map +0 -1
- package/dist/commands/link/index.d.ts.map +0 -1
- package/dist/commands/link/index.js.map +0 -1
- package/dist/commands/link/link.d.ts.map +0 -1
- package/dist/commands/link/link.js.map +0 -1
- package/dist/commands/link/option_values.d.ts.map +0 -1
- package/dist/commands/link/option_values.js.map +0 -1
- package/dist/commands/login/index.d.ts.map +0 -1
- package/dist/commands/login/index.js.map +0 -1
- package/dist/commands/login/login-check.d.ts.map +0 -1
- package/dist/commands/login/login-check.js.map +0 -1
- package/dist/commands/login/login-request.d.ts.map +0 -1
- package/dist/commands/login/login-request.js.map +0 -1
- package/dist/commands/login/login.d.ts.map +0 -1
- package/dist/commands/login/login.js.map +0 -1
- package/dist/commands/logout/index.d.ts.map +0 -1
- package/dist/commands/logout/index.js.map +0 -1
- package/dist/commands/logout/logout.d.ts.map +0 -1
- package/dist/commands/logout/logout.js.map +0 -1
- package/dist/commands/logs/build.d.ts.map +0 -1
- package/dist/commands/logs/build.js.map +0 -1
- package/dist/commands/logs/index.d.ts.map +0 -1
- package/dist/commands/logs/index.js.map +0 -1
- package/dist/commands/logs/log-api.d.ts.map +0 -1
- package/dist/commands/logs/log-api.js.map +0 -1
- package/dist/commands/logs/log-levels.d.ts.map +0 -1
- package/dist/commands/logs/log-levels.js.map +0 -1
- package/dist/commands/logs/logs.d.ts.map +0 -1
- package/dist/commands/logs/logs.js.map +0 -1
- package/dist/commands/logs/sources/deploy.d.ts.map +0 -1
- package/dist/commands/logs/sources/deploy.js.map +0 -1
- package/dist/commands/logs/sources/edge-functions.d.ts.map +0 -1
- package/dist/commands/logs/sources/edge-functions.js.map +0 -1
- package/dist/commands/logs/sources/functions.d.ts.map +0 -1
- package/dist/commands/logs/sources/functions.js.map +0 -1
- package/dist/commands/main.d.ts.map +0 -1
- package/dist/commands/main.js.map +0 -1
- package/dist/commands/open/index.d.ts.map +0 -1
- package/dist/commands/open/index.js.map +0 -1
- package/dist/commands/open/open-admin.d.ts.map +0 -1
- package/dist/commands/open/open-admin.js.map +0 -1
- package/dist/commands/open/open-site.d.ts.map +0 -1
- package/dist/commands/open/open-site.js.map +0 -1
- package/dist/commands/open/open.d.ts.map +0 -1
- package/dist/commands/open/open.js.map +0 -1
- package/dist/commands/recipes/common.d.ts.map +0 -1
- package/dist/commands/recipes/common.js.map +0 -1
- package/dist/commands/recipes/index.d.ts.map +0 -1
- package/dist/commands/recipes/index.js.map +0 -1
- package/dist/commands/recipes/recipes-list.d.ts.map +0 -1
- package/dist/commands/recipes/recipes-list.js.map +0 -1
- package/dist/commands/recipes/recipes.d.ts.map +0 -1
- package/dist/commands/recipes/recipes.js.map +0 -1
- package/dist/commands/serve/index.d.ts.map +0 -1
- package/dist/commands/serve/index.js.map +0 -1
- package/dist/commands/serve/serve.d.ts.map +0 -1
- package/dist/commands/serve/serve.js.map +0 -1
- package/dist/commands/sites/index.d.ts.map +0 -1
- package/dist/commands/sites/index.js.map +0 -1
- package/dist/commands/sites/sites-create.d.ts.map +0 -1
- package/dist/commands/sites/sites-create.js.map +0 -1
- package/dist/commands/sites/sites-delete.d.ts.map +0 -1
- package/dist/commands/sites/sites-delete.js.map +0 -1
- package/dist/commands/sites/sites-list.d.ts.map +0 -1
- package/dist/commands/sites/sites-list.js.map +0 -1
- package/dist/commands/sites/sites-search.d.ts.map +0 -1
- package/dist/commands/sites/sites-search.js.map +0 -1
- package/dist/commands/sites/sites.d.ts.map +0 -1
- package/dist/commands/sites/sites.js.map +0 -1
- package/dist/commands/status/index.d.ts.map +0 -1
- package/dist/commands/status/index.js.map +0 -1
- package/dist/commands/status/status-hooks.d.ts.map +0 -1
- package/dist/commands/status/status-hooks.js.map +0 -1
- package/dist/commands/status/status.d.ts.map +0 -1
- package/dist/commands/status/status.js.map +0 -1
- package/dist/commands/switch/index.d.ts.map +0 -1
- package/dist/commands/switch/index.js.map +0 -1
- package/dist/commands/switch/switch.d.ts.map +0 -1
- package/dist/commands/switch/switch.js.map +0 -1
- package/dist/commands/teams/index.d.ts.map +0 -1
- package/dist/commands/teams/index.js.map +0 -1
- package/dist/commands/teams/teams-list.d.ts.map +0 -1
- package/dist/commands/teams/teams-list.js.map +0 -1
- package/dist/commands/teams/teams.d.ts.map +0 -1
- package/dist/commands/teams/teams.js.map +0 -1
- package/dist/commands/unlink/index.d.ts.map +0 -1
- package/dist/commands/unlink/index.js.map +0 -1
- package/dist/commands/unlink/unlink.d.ts.map +0 -1
- package/dist/commands/unlink/unlink.js.map +0 -1
- package/dist/commands/watch/index.d.ts.map +0 -1
- package/dist/commands/watch/index.js.map +0 -1
- package/dist/commands/watch/watch.d.ts.map +0 -1
- package/dist/commands/watch/watch.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/account.d.ts.map +0 -1
- package/dist/lib/account.js.map +0 -1
- package/dist/lib/api.d.ts.map +0 -1
- package/dist/lib/api.js.map +0 -1
- package/dist/lib/blobs/blobs.d.ts.map +0 -1
- package/dist/lib/blobs/blobs.js.map +0 -1
- package/dist/lib/build.d.ts.map +0 -1
- package/dist/lib/build.js.map +0 -1
- package/dist/lib/completion/constants.d.ts.map +0 -1
- package/dist/lib/completion/constants.js.map +0 -1
- package/dist/lib/completion/generate-autocompletion.d.ts.map +0 -1
- package/dist/lib/completion/generate-autocompletion.js.map +0 -1
- package/dist/lib/completion/get-autocompletion.d.ts.map +0 -1
- package/dist/lib/completion/get-autocompletion.js.map +0 -1
- package/dist/lib/completion/index.d.ts.map +0 -1
- package/dist/lib/completion/index.js.map +0 -1
- package/dist/lib/completion/script.d.ts.map +0 -1
- package/dist/lib/completion/script.js.map +0 -1
- package/dist/lib/edge-functions/bootstrap.d.ts.map +0 -1
- package/dist/lib/edge-functions/bootstrap.js.map +0 -1
- package/dist/lib/edge-functions/consts.d.ts.map +0 -1
- package/dist/lib/edge-functions/consts.js.map +0 -1
- package/dist/lib/edge-functions/editor-helper.d.ts.map +0 -1
- package/dist/lib/edge-functions/editor-helper.js.map +0 -1
- package/dist/lib/edge-functions/get-directories.d.ts.map +0 -1
- package/dist/lib/edge-functions/get-directories.js.map +0 -1
- package/dist/lib/edge-functions/headers.d.ts.map +0 -1
- package/dist/lib/edge-functions/headers.js.map +0 -1
- package/dist/lib/edge-functions/proxy.d.ts.map +0 -1
- package/dist/lib/edge-functions/proxy.js.map +0 -1
- package/dist/lib/edge-functions/registry.d.ts.map +0 -1
- package/dist/lib/edge-functions/registry.js.map +0 -1
- package/dist/lib/exec-fetcher.d.ts.map +0 -1
- package/dist/lib/exec-fetcher.js.map +0 -1
- package/dist/lib/extensions.d.ts.map +0 -1
- package/dist/lib/extensions.js.map +0 -1
- package/dist/lib/fs.d.ts.map +0 -1
- package/dist/lib/fs.js.map +0 -1
- package/dist/lib/functions/background.d.ts.map +0 -1
- package/dist/lib/functions/background.js.map +0 -1
- package/dist/lib/functions/config.d.ts.map +0 -1
- package/dist/lib/functions/config.js.map +0 -1
- package/dist/lib/functions/form-submissions-handler.d.ts.map +0 -1
- package/dist/lib/functions/form-submissions-handler.js.map +0 -1
- package/dist/lib/functions/local-proxy.d.ts.map +0 -1
- package/dist/lib/functions/local-proxy.js.map +0 -1
- package/dist/lib/functions/netlify-function.d.ts.map +0 -1
- package/dist/lib/functions/netlify-function.js.map +0 -1
- package/dist/lib/functions/registry.d.ts.map +0 -1
- package/dist/lib/functions/registry.js.map +0 -1
- package/dist/lib/functions/runtimes/go/index.d.ts.map +0 -1
- package/dist/lib/functions/runtimes/go/index.js.map +0 -1
- package/dist/lib/functions/runtimes/index.d.ts.map +0 -1
- package/dist/lib/functions/runtimes/index.js.map +0 -1
- package/dist/lib/functions/runtimes/js/builders/zisi.d.ts.map +0 -1
- package/dist/lib/functions/runtimes/js/builders/zisi.js.map +0 -1
- package/dist/lib/functions/runtimes/js/constants.d.ts.map +0 -1
- package/dist/lib/functions/runtimes/js/constants.js.map +0 -1
- package/dist/lib/functions/runtimes/js/index.d.ts.map +0 -1
- package/dist/lib/functions/runtimes/js/index.js.map +0 -1
- package/dist/lib/functions/runtimes/js/worker.d.ts.map +0 -1
- package/dist/lib/functions/runtimes/js/worker.js.map +0 -1
- package/dist/lib/functions/runtimes/rust/index.d.ts.map +0 -1
- package/dist/lib/functions/runtimes/rust/index.js.map +0 -1
- package/dist/lib/functions/scheduled.d.ts.map +0 -1
- package/dist/lib/functions/scheduled.js.map +0 -1
- package/dist/lib/functions/server.d.ts.map +0 -1
- package/dist/lib/functions/server.js.map +0 -1
- package/dist/lib/functions/synchronous.d.ts.map +0 -1
- package/dist/lib/functions/synchronous.js.map +0 -1
- package/dist/lib/functions/utils.d.ts.map +0 -1
- package/dist/lib/functions/utils.js.map +0 -1
- package/dist/lib/geo-location.d.ts.map +0 -1
- package/dist/lib/geo-location.js.map +0 -1
- package/dist/lib/http-agent.d.ts.map +0 -1
- package/dist/lib/http-agent.js.map +0 -1
- package/dist/lib/images/proxy.d.ts.map +0 -1
- package/dist/lib/images/proxy.js.map +0 -1
- package/dist/lib/log.d.ts.map +0 -1
- package/dist/lib/log.js.map +0 -1
- package/dist/lib/path.d.ts.map +0 -1
- package/dist/lib/path.js.map +0 -1
- package/dist/lib/settings.d.ts.map +0 -1
- package/dist/lib/settings.js.map +0 -1
- package/dist/lib/spinner.d.ts.map +0 -1
- package/dist/lib/spinner.js.map +0 -1
- package/dist/lib/string.d.ts.map +0 -1
- package/dist/lib/string.js.map +0 -1
- package/dist/lib/wait-port.d.ts.map +0 -1
- package/dist/lib/wait-port.js.map +0 -1
- package/dist/recipes/ai-context/context.d.ts.map +0 -1
- package/dist/recipes/ai-context/context.js.map +0 -1
- package/dist/recipes/ai-context/index.d.ts.map +0 -1
- package/dist/recipes/ai-context/index.js.map +0 -1
- package/dist/recipes/blobs-migrate/index.d.ts.map +0 -1
- package/dist/recipes/blobs-migrate/index.js.map +0 -1
- package/dist/recipes/vscode/index.d.ts.map +0 -1
- package/dist/recipes/vscode/index.js.map +0 -1
- package/dist/recipes/vscode/settings.d.ts.map +0 -1
- package/dist/recipes/vscode/settings.js.map +0 -1
- package/dist/utils/addons/prepare.d.ts.map +0 -1
- package/dist/utils/addons/prepare.js.map +0 -1
- package/dist/utils/build-info.d.ts.map +0 -1
- package/dist/utils/build-info.js.map +0 -1
- package/dist/utils/command-error-handler.d.ts.map +0 -1
- package/dist/utils/command-error-handler.js.map +0 -1
- package/dist/utils/command-helpers.d.ts.map +0 -1
- package/dist/utils/command-helpers.js.map +0 -1
- package/dist/utils/copy-template-dir/copy-template-dir.d.ts.map +0 -1
- package/dist/utils/copy-template-dir/copy-template-dir.js.map +0 -1
- package/dist/utils/create-deferred.d.ts.map +0 -1
- package/dist/utils/create-deferred.js.map +0 -1
- package/dist/utils/create-stream-promise.d.ts.map +0 -1
- package/dist/utils/create-stream-promise.js.map +0 -1
- package/dist/utils/deploy/constants.d.ts.map +0 -1
- package/dist/utils/deploy/constants.js.map +0 -1
- package/dist/utils/deploy/deploy-site.d.ts.map +0 -1
- package/dist/utils/deploy/deploy-site.js.map +0 -1
- package/dist/utils/deploy/deploy-source.d.ts.map +0 -1
- package/dist/utils/deploy/deploy-source.js.map +0 -1
- package/dist/utils/deploy/drop-api.d.ts.map +0 -1
- package/dist/utils/deploy/drop-api.js.map +0 -1
- package/dist/utils/deploy/file.d.ts.map +0 -1
- package/dist/utils/deploy/file.js.map +0 -1
- package/dist/utils/deploy/hash-config.d.ts.map +0 -1
- package/dist/utils/deploy/hash-config.js.map +0 -1
- package/dist/utils/deploy/hash-edge-functions.d.ts.map +0 -1
- package/dist/utils/deploy/hash-edge-functions.js.map +0 -1
- package/dist/utils/deploy/hash-files.d.ts.map +0 -1
- package/dist/utils/deploy/hash-files.js.map +0 -1
- package/dist/utils/deploy/hash-fns.d.ts.map +0 -1
- package/dist/utils/deploy/hash-fns.js.map +0 -1
- package/dist/utils/deploy/hasher-segments.d.ts.map +0 -1
- package/dist/utils/deploy/hasher-segments.js.map +0 -1
- package/dist/utils/deploy/process-files.d.ts.map +0 -1
- package/dist/utils/deploy/process-files.js.map +0 -1
- package/dist/utils/deploy/status-cb.d.ts.map +0 -1
- package/dist/utils/deploy/status-cb.js.map +0 -1
- package/dist/utils/deploy/upload-files.d.ts.map +0 -1
- package/dist/utils/deploy/upload-files.js.map +0 -1
- package/dist/utils/deploy/upload-source-zip.d.ts.map +0 -1
- package/dist/utils/deploy/upload-source-zip.js.map +0 -1
- package/dist/utils/deploy/util.d.ts.map +0 -1
- package/dist/utils/deploy/util.js.map +0 -1
- package/dist/utils/detect-server-settings.d.ts.map +0 -1
- package/dist/utils/detect-server-settings.js.map +0 -1
- package/dist/utils/dev-server-banner.d.ts.map +0 -1
- package/dist/utils/dev-server-banner.js.map +0 -1
- package/dist/utils/dev.d.ts.map +0 -1
- package/dist/utils/dev.js.map +0 -1
- package/dist/utils/dot-env.d.ts.map +0 -1
- package/dist/utils/dot-env.js.map +0 -1
- package/dist/utils/env/deploy-env-vars.d.ts.map +0 -1
- package/dist/utils/env/deploy-env-vars.js.map +0 -1
- package/dist/utils/env/index.d.ts.map +0 -1
- package/dist/utils/env/index.js.map +0 -1
- package/dist/utils/execa.d.ts.map +0 -1
- package/dist/utils/execa.js.map +0 -1
- package/dist/utils/exit-codes.d.ts.map +0 -1
- package/dist/utils/exit-codes.js.map +0 -1
- package/dist/utils/feature-flags.d.ts.map +0 -1
- package/dist/utils/feature-flags.js.map +0 -1
- package/dist/utils/framework-server.d.ts.map +0 -1
- package/dist/utils/framework-server.js.map +0 -1
- package/dist/utils/frameworks-api.d.ts.map +0 -1
- package/dist/utils/frameworks-api.js.map +0 -1
- package/dist/utils/functions/constants.d.ts.map +0 -1
- package/dist/utils/functions/constants.js.map +0 -1
- package/dist/utils/functions/functions.d.ts.map +0 -1
- package/dist/utils/functions/functions.js.map +0 -1
- package/dist/utils/functions/get-functions.d.ts.map +0 -1
- package/dist/utils/functions/get-functions.js.map +0 -1
- package/dist/utils/functions/index.d.ts.map +0 -1
- package/dist/utils/functions/index.js.map +0 -1
- package/dist/utils/get-cli-package-json.d.ts.map +0 -1
- package/dist/utils/get-cli-package-json.js.map +0 -1
- package/dist/utils/get-repo-data.d.ts.map +0 -1
- package/dist/utils/get-repo-data.js.map +0 -1
- package/dist/utils/get-site.d.ts.map +0 -1
- package/dist/utils/get-site.js.map +0 -1
- package/dist/utils/gh-auth.d.ts.map +0 -1
- package/dist/utils/gh-auth.js.map +0 -1
- package/dist/utils/gitignore.d.ts.map +0 -1
- package/dist/utils/gitignore.js.map +0 -1
- package/dist/utils/headers.d.ts.map +0 -1
- package/dist/utils/headers.js.map +0 -1
- package/dist/utils/hooks/requires-site-info-with-project.d.ts.map +0 -1
- package/dist/utils/hooks/requires-site-info-with-project.js.map +0 -1
- package/dist/utils/hooks/requires-site-info.d.ts.map +0 -1
- package/dist/utils/hooks/requires-site-info.js.map +0 -1
- package/dist/utils/init/config-github.d.ts.map +0 -1
- package/dist/utils/init/config-github.js.map +0 -1
- package/dist/utils/init/config-manual.d.ts.map +0 -1
- package/dist/utils/init/config-manual.js.map +0 -1
- package/dist/utils/init/config.d.ts.map +0 -1
- package/dist/utils/init/config.js.map +0 -1
- package/dist/utils/init/plugins.d.ts.map +0 -1
- package/dist/utils/init/plugins.js.map +0 -1
- package/dist/utils/init/utils.d.ts.map +0 -1
- package/dist/utils/init/utils.js.map +0 -1
- package/dist/utils/live-tunnel.d.ts.map +0 -1
- package/dist/utils/live-tunnel.js.map +0 -1
- package/dist/utils/multimap.d.ts.map +0 -1
- package/dist/utils/multimap.js.map +0 -1
- package/dist/utils/nodejs-compile-cache.d.ts.map +0 -1
- package/dist/utils/nodejs-compile-cache.js.map +0 -1
- package/dist/utils/normalize-repo-url.d.ts.map +0 -1
- package/dist/utils/normalize-repo-url.js.map +0 -1
- package/dist/utils/object-utilities.d.ts.map +0 -1
- package/dist/utils/object-utilities.js.map +0 -1
- package/dist/utils/open-browser.d.ts.map +0 -1
- package/dist/utils/open-browser.js.map +0 -1
- package/dist/utils/parse-raw-flags.d.ts.map +0 -1
- package/dist/utils/parse-raw-flags.js.map +0 -1
- package/dist/utils/prompts/blob-delete-prompts.d.ts.map +0 -1
- package/dist/utils/prompts/blob-delete-prompts.js.map +0 -1
- package/dist/utils/prompts/blob-set-prompt.d.ts.map +0 -1
- package/dist/utils/prompts/blob-set-prompt.js.map +0 -1
- package/dist/utils/prompts/confirm-prompt.d.ts.map +0 -1
- package/dist/utils/prompts/confirm-prompt.js.map +0 -1
- package/dist/utils/prompts/env-clone-prompt.d.ts.map +0 -1
- package/dist/utils/prompts/env-clone-prompt.js.map +0 -1
- package/dist/utils/prompts/env-set-prompts.d.ts.map +0 -1
- package/dist/utils/prompts/env-set-prompts.js.map +0 -1
- package/dist/utils/prompts/env-unset-prompts.d.ts.map +0 -1
- package/dist/utils/prompts/env-unset-prompts.js.map +0 -1
- package/dist/utils/prompts/prompt-messages.d.ts.map +0 -1
- package/dist/utils/prompts/prompt-messages.js.map +0 -1
- package/dist/utils/proxy-server.d.ts.map +0 -1
- package/dist/utils/proxy-server.js.map +0 -1
- package/dist/utils/proxy.d.ts.map +0 -1
- package/dist/utils/proxy.js.map +0 -1
- package/dist/utils/read-repo-url.d.ts.map +0 -1
- package/dist/utils/read-repo-url.js.map +0 -1
- package/dist/utils/redirects.d.ts.map +0 -1
- package/dist/utils/redirects.js.map +0 -1
- package/dist/utils/request-id.d.ts.map +0 -1
- package/dist/utils/request-id.js.map +0 -1
- package/dist/utils/rules-proxy.d.ts.map +0 -1
- package/dist/utils/rules-proxy.js.map +0 -1
- package/dist/utils/run-build.d.ts.map +0 -1
- package/dist/utils/run-build.js.map +0 -1
- package/dist/utils/run-git.d.ts.map +0 -1
- package/dist/utils/run-git.js.map +0 -1
- package/dist/utils/run-program.d.ts.map +0 -1
- package/dist/utils/run-program.js.map +0 -1
- package/dist/utils/scripted-commands.d.ts.map +0 -1
- package/dist/utils/scripted-commands.js.map +0 -1
- package/dist/utils/shell.d.ts.map +0 -1
- package/dist/utils/shell.js.map +0 -1
- package/dist/utils/sign-redirect.d.ts.map +0 -1
- package/dist/utils/sign-redirect.js.map +0 -1
- package/dist/utils/static-server.d.ts.map +0 -1
- package/dist/utils/static-server.js.map +0 -1
- package/dist/utils/team.d.ts.map +0 -1
- package/dist/utils/team.js.map +0 -1
- package/dist/utils/telemetry/index.d.ts.map +0 -1
- package/dist/utils/telemetry/index.js.map +0 -1
- package/dist/utils/telemetry/report-error.d.ts.map +0 -1
- package/dist/utils/telemetry/report-error.js.map +0 -1
- package/dist/utils/telemetry/request.d.ts.map +0 -1
- package/dist/utils/telemetry/request.js.map +0 -1
- package/dist/utils/telemetry/telemetry.d.ts.map +0 -1
- package/dist/utils/telemetry/telemetry.js.map +0 -1
- package/dist/utils/telemetry/utils.d.ts.map +0 -1
- package/dist/utils/telemetry/utils.js.map +0 -1
- package/dist/utils/telemetry/validation.d.ts.map +0 -1
- package/dist/utils/telemetry/validation.js.map +0 -1
- package/dist/utils/temporary-file.d.ts.map +0 -1
- package/dist/utils/temporary-file.js.map +0 -1
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js.map +0 -1
- package/dist/utils/websockets/index.d.ts.map +0 -1
- package/dist/utils/websockets/index.js.map +0 -1
- package/dist/utils/zip.d.ts.map +0 -1
- package/dist/utils/zip.js.map +0 -1
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type BaseCommand from '../base-command.js';
|
|
2
2
|
import type { CloneOptionValues } from './option_values.js';
|
|
3
|
+
export declare const getCredentialHelper: () => string;
|
|
4
|
+
export declare const finalizeClone: (options: CloneOptionValues, command: BaseCommand, workingDir: string, linkOverrides: {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
gitRemoteUrl?: string;
|
|
8
|
+
}) => Promise<void>;
|
|
3
9
|
export declare const clone: (options: CloneOptionValues, command: BaseCommand, args: {
|
|
4
10
|
repo: string;
|
|
5
11
|
targetDir?: string;
|
|
6
|
-
}) => Promise<
|
|
12
|
+
}) => Promise<void>;
|
|
7
13
|
//# sourceMappingURL=clone.d.ts.map
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { LocalState } from '@netlify/dev-utils';
|
|
1
3
|
import inquirer from 'inquirer';
|
|
2
4
|
import { normalizeRepoUrl } from '../../utils/normalize-repo-url.js';
|
|
3
|
-
import { chalk, logAndThrowError, log } from '../../utils/command-helpers.js';
|
|
5
|
+
import { chalk, logAndThrowError, log, getToken, netlifyCommand } from '../../utils/command-helpers.js';
|
|
4
6
|
import { runGit } from '../../utils/run-git.js';
|
|
7
|
+
import execa from '../../utils/execa.js';
|
|
8
|
+
import { NETLIFY_GIT_HOST } from '../git-credential/git-credential.js';
|
|
5
9
|
import { link } from '../link/link.js';
|
|
6
10
|
import { startSpinner } from '../../lib/spinner.js';
|
|
11
|
+
const NETLIFY_GIT_SERVICE_HOST = 'hgit.services-prod.nsvcs.net';
|
|
12
|
+
const isNetlifyGitServiceUrl = (repoUrl) => {
|
|
13
|
+
try {
|
|
14
|
+
const host = new URL(repoUrl).host;
|
|
15
|
+
return host === NETLIFY_GIT_HOST || host === NETLIFY_GIT_SERVICE_HOST;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
7
21
|
const getTargetDir = async (defaultDir) => {
|
|
8
22
|
const { selectedDir } = await inquirer.prompt([
|
|
9
23
|
{
|
|
@@ -23,42 +37,213 @@ const cloneRepo = async (repoUrl, targetDir, debug) => {
|
|
|
23
37
|
throw new Error(`Failed to clone repository: ${error instanceof Error ? error.message : (error?.toString() ?? '')}`);
|
|
24
38
|
}
|
|
25
39
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
40
|
+
// Under `npx`/`pnpx`/`npm exec`, `process.argv[1]` points into a temp cache dir that
|
|
41
|
+
// gets cleaned up, so a git credential helper pinned to that path breaks after the
|
|
42
|
+
// fact. Fall back to the resolved invocation (e.g. `npx netlify`) in that case.
|
|
43
|
+
export const getCredentialHelper = () => {
|
|
44
|
+
const cliCommand = netlifyCommand();
|
|
45
|
+
const invocation = cliCommand === 'netlify' ? `'${process.execPath}' '${resolve(process.argv[1])}'` : cliCommand;
|
|
46
|
+
return `!${invocation} git-credential`;
|
|
47
|
+
};
|
|
48
|
+
const configureGitAuth = async (repoDir) => {
|
|
49
|
+
await execa('git', ['config', `credential.https://${NETLIFY_GIT_HOST}.helper`, ''], { cwd: repoDir });
|
|
50
|
+
await execa('git', ['config', '--add', `credential.https://${NETLIFY_GIT_HOST}.helper`, getCredentialHelper()], {
|
|
51
|
+
cwd: repoDir,
|
|
52
|
+
});
|
|
53
|
+
await execa('git', ['config', 'http.postBuffer', '524288000'], { cwd: repoDir });
|
|
54
|
+
};
|
|
55
|
+
const cloneFromNetlifyGit = async (repoUrl, targetDir, debug) => {
|
|
31
56
|
try {
|
|
32
|
-
await
|
|
57
|
+
await execa('git', [
|
|
58
|
+
'-c',
|
|
59
|
+
`credential.https://${NETLIFY_GIT_HOST}.helper=`,
|
|
60
|
+
'-c',
|
|
61
|
+
`credential.https://${NETLIFY_GIT_HOST}.helper=${getCredentialHelper()}`,
|
|
62
|
+
'clone',
|
|
63
|
+
repoUrl,
|
|
64
|
+
targetDir,
|
|
65
|
+
], {
|
|
66
|
+
...(debug ? { stdio: 'inherit' } : {}),
|
|
67
|
+
});
|
|
33
68
|
}
|
|
34
69
|
catch (error) {
|
|
35
|
-
|
|
70
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
71
|
+
throw new Error(`Failed to clone repository: ${message}`);
|
|
36
72
|
}
|
|
37
|
-
|
|
38
|
-
|
|
73
|
+
};
|
|
74
|
+
const parseNetlifySiteInput = (input) => {
|
|
75
|
+
const netlifyAppUrlRegex = /^https?:\/\/([^.]+)\.netlify\.app\/?$/;
|
|
76
|
+
const netlifyAppUrlMatch = netlifyAppUrlRegex.exec(input);
|
|
77
|
+
if (netlifyAppUrlMatch) {
|
|
78
|
+
return { isNetlifySite: true, siteName: netlifyAppUrlMatch[1] };
|
|
79
|
+
}
|
|
80
|
+
const appNetlifyUrlRegex = /^https?:\/\/app\.netlify\.com\/(?:sites|projects)\/([^/]+)\/?/;
|
|
81
|
+
const appNetlifyUrlMatch = appNetlifyUrlRegex.exec(input);
|
|
82
|
+
if (appNetlifyUrlMatch) {
|
|
83
|
+
return { isNetlifySite: true, siteName: appNetlifyUrlMatch[1] };
|
|
84
|
+
}
|
|
85
|
+
if (!input.includes('/') && !input.includes(':') && !input.includes('.')) {
|
|
86
|
+
return { isNetlifySite: true, siteName: input };
|
|
87
|
+
}
|
|
88
|
+
return { isNetlifySite: false };
|
|
89
|
+
};
|
|
90
|
+
// FIXME(serhalp): This suffers from the same egregious performance problem as `link`/`init`.
|
|
91
|
+
// We should fix it rather than keep spreading it.
|
|
92
|
+
const lookupSiteByName = async (api, siteName) => {
|
|
93
|
+
try {
|
|
94
|
+
const sites = await api.listSites({ name: siteName, filter: 'all' });
|
|
95
|
+
const site = sites.find((s) => s.name === siteName);
|
|
96
|
+
return site ? site : null;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
if (error.status === 404) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
export const finalizeClone = async (options, command, workingDir, linkOverrides) => {
|
|
106
|
+
// `workingDir` may be relative (e.g. a user-entered target dir), and must be resolved
|
|
107
|
+
// against the *current* cwd before it changes below, not after.
|
|
108
|
+
const absoluteWorkingDir = resolve(workingDir);
|
|
109
|
+
command.workingDir = absoluteWorkingDir;
|
|
39
110
|
// TODO(serhalp): This shouldn't be necessary but `getPathInProject` does not take
|
|
40
111
|
// `command.workingDir` into account. Carefully fix this and remove this line.
|
|
41
|
-
process.chdir(
|
|
112
|
+
process.chdir(absoluteWorkingDir);
|
|
113
|
+
// `command.netlify.repositoryRoot`/`state` were resolved from the pre-clone working
|
|
114
|
+
// directory before this command's action ran, so `link()` below would otherwise read
|
|
115
|
+
// and write against the original directory instead of the freshly cloned one.
|
|
116
|
+
command.netlify.repositoryRoot = absoluteWorkingDir;
|
|
117
|
+
command.netlify.state = new LocalState(absoluteWorkingDir);
|
|
42
118
|
const { id, name, ...globalOptions } = options;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
name,
|
|
47
|
-
// Use the normalized HTTPS URL as the canonical git URL for linking to ensure
|
|
48
|
-
// we have a consistent URL format for looking up projects.
|
|
49
|
-
gitRemoteUrl: httpsUrl,
|
|
50
|
-
};
|
|
51
|
-
await link(linkOptions, command);
|
|
119
|
+
await link({ ...globalOptions, ...linkOverrides }, command);
|
|
120
|
+
};
|
|
121
|
+
const logCloneSuccess = (targetDir, { credentialsConfigured = false, devCommand } = {}) => {
|
|
52
122
|
log();
|
|
53
123
|
log(chalk.green('✔ Your project is ready to go!'));
|
|
54
124
|
log(`→ Next, enter your project directory using ${chalk.cyanBright(`cd ${targetDir}`)}`);
|
|
55
125
|
log();
|
|
56
126
|
log(`→ You can now run other ${chalk.cyanBright('netlify')} CLI commands in this directory`);
|
|
127
|
+
if (credentialsConfigured) {
|
|
128
|
+
log(`Git is configured to use your Netlify credentials for this repository.`);
|
|
129
|
+
}
|
|
57
130
|
log(`→ To build and deploy your project: ${chalk.cyanBright('netlify deploy')}`);
|
|
58
|
-
if (
|
|
59
|
-
log(`→ To run your dev server: ${chalk.cyanBright(
|
|
131
|
+
if (devCommand) {
|
|
132
|
+
log(`→ To run your dev server: ${chalk.cyanBright(devCommand)}`);
|
|
60
133
|
}
|
|
61
134
|
log(`→ To see all available commands: ${chalk.cyanBright('netlify help')}`);
|
|
62
135
|
log();
|
|
63
136
|
};
|
|
137
|
+
const cloneFromNetlifyGitService = async (options, command, args, siteInfo) => {
|
|
138
|
+
const [token] = await getToken();
|
|
139
|
+
if (!token) {
|
|
140
|
+
return logAndThrowError(`No authentication token found. Run ${chalk.cyanBright('netlify login')} to authenticate first.`);
|
|
141
|
+
}
|
|
142
|
+
const accountSlug = siteInfo.account_slug;
|
|
143
|
+
const siteSlug = siteInfo.name;
|
|
144
|
+
if (!accountSlug || !siteSlug) {
|
|
145
|
+
return logAndThrowError('Could not determine account or site slug from the site.');
|
|
146
|
+
}
|
|
147
|
+
const repoUrl = `https://${NETLIFY_GIT_HOST}/${accountSlug}/${siteSlug}.git`;
|
|
148
|
+
const targetDir = args.targetDir ?? (await getTargetDir(`./${siteSlug}`));
|
|
149
|
+
const resolvedTargetDir = resolve(targetDir);
|
|
150
|
+
log(`Remote: ${chalk.dim(repoUrl)}`);
|
|
151
|
+
const cloneSpinner = startSpinner({ text: `Cloning repository to ${chalk.cyan(targetDir)}` });
|
|
152
|
+
try {
|
|
153
|
+
await cloneFromNetlifyGit(repoUrl, resolvedTargetDir, options.debug ?? false);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
cloneSpinner.error();
|
|
157
|
+
return logAndThrowError(error);
|
|
158
|
+
}
|
|
159
|
+
cloneSpinner.success(`Cloned repository to ${chalk.cyan(targetDir)}`);
|
|
160
|
+
const configSpinner = startSpinner({ text: 'Configuring git credentials' });
|
|
161
|
+
try {
|
|
162
|
+
await configureGitAuth(resolvedTargetDir);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
configSpinner.error();
|
|
166
|
+
return logAndThrowError(error);
|
|
167
|
+
}
|
|
168
|
+
configSpinner.success('Configured git credentials');
|
|
169
|
+
await finalizeClone(options, command, resolvedTargetDir, { id: siteInfo.id });
|
|
170
|
+
logCloneSuccess(targetDir, { credentialsConfigured: true });
|
|
171
|
+
};
|
|
172
|
+
const isInsideGitRepo = async () => {
|
|
173
|
+
try {
|
|
174
|
+
await execa('git', ['rev-parse', '--is-inside-work-tree']);
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
export const clone = async (options, command, args) => {
|
|
182
|
+
await command.authenticate();
|
|
183
|
+
const { api, site } = command.netlify;
|
|
184
|
+
if (site.id) {
|
|
185
|
+
return logAndThrowError(`This directory is already linked to a Netlify project. Run ${chalk.cyanBright('netlify clone')} from outside any existing linked project directory.`);
|
|
186
|
+
}
|
|
187
|
+
if (await isInsideGitRepo()) {
|
|
188
|
+
return logAndThrowError(`This directory is already inside a git repository. Run ${chalk.cyanBright('netlify clone')} from outside any existing git repository.`);
|
|
189
|
+
}
|
|
190
|
+
const parsedInput = parseNetlifySiteInput(args.repo);
|
|
191
|
+
if (parsedInput.isNetlifySite) {
|
|
192
|
+
const siteSpinner = startSpinner({ text: `Looking up site ${chalk.cyan(parsedInput.siteName)}...` });
|
|
193
|
+
const siteInfo = await lookupSiteByName(api, parsedInput.siteName);
|
|
194
|
+
if (!siteInfo) {
|
|
195
|
+
siteSpinner.error();
|
|
196
|
+
return logAndThrowError(`Could not find a Netlify site named "${parsedInput.siteName}"`);
|
|
197
|
+
}
|
|
198
|
+
siteSpinner.success(`Found site ${chalk.cyan(siteInfo.name)}`);
|
|
199
|
+
const connectedRepoUrl = siteInfo.build_settings?.repo_url;
|
|
200
|
+
if (connectedRepoUrl && isNetlifyGitServiceUrl(connectedRepoUrl)) {
|
|
201
|
+
log(`Site is connected to Netlify's managed git service.`);
|
|
202
|
+
log(`Cloning from Netlify's managed git service...`);
|
|
203
|
+
log();
|
|
204
|
+
return cloneFromNetlifyGitService(options, command, args, siteInfo);
|
|
205
|
+
}
|
|
206
|
+
if (connectedRepoUrl) {
|
|
207
|
+
log(`Site has a connected repository: ${chalk.dim(connectedRepoUrl)}`);
|
|
208
|
+
log(`Cloning from the connected repository...`);
|
|
209
|
+
log();
|
|
210
|
+
const { repoUrl, repoName } = normalizeRepoUrl(connectedRepoUrl);
|
|
211
|
+
const targetDir = args.targetDir ?? (await getTargetDir(`./${repoName}`));
|
|
212
|
+
const cloneSpinner = startSpinner({ text: `Cloning repository to ${chalk.cyan(targetDir)}` });
|
|
213
|
+
try {
|
|
214
|
+
await cloneRepo(repoUrl, targetDir, options.debug ?? false);
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
cloneSpinner.error();
|
|
218
|
+
return logAndThrowError(error);
|
|
219
|
+
}
|
|
220
|
+
cloneSpinner.success(`Cloned repository to ${chalk.cyan(targetDir)}`);
|
|
221
|
+
await finalizeClone(options, command, targetDir, { id: siteInfo.id, gitRemoteUrl: connectedRepoUrl });
|
|
222
|
+
logCloneSuccess(targetDir);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
log(`Site does not have a connected repository.`);
|
|
226
|
+
log(`Cloning from Netlify's managed git service...`);
|
|
227
|
+
log();
|
|
228
|
+
return cloneFromNetlifyGitService(options, command, args, siteInfo);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
const { repoUrl, httpsUrl, repoName } = normalizeRepoUrl(args.repo);
|
|
233
|
+
const targetDir = args.targetDir ?? (await getTargetDir(`./${repoName}`));
|
|
234
|
+
const cloneSpinner = startSpinner({ text: `Cloning repository to ${chalk.cyan(targetDir)}` });
|
|
235
|
+
try {
|
|
236
|
+
await cloneRepo(repoUrl, targetDir, options.debug ?? false);
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
cloneSpinner.error();
|
|
240
|
+
return logAndThrowError(error);
|
|
241
|
+
}
|
|
242
|
+
cloneSpinner.success(`Cloned repository to ${chalk.cyan(targetDir)}`);
|
|
243
|
+
// Use the normalized HTTPS URL as the canonical git URL for linking to ensure
|
|
244
|
+
// we have a consistent URL format for looking up projects.
|
|
245
|
+
await finalizeClone(options, command, targetDir, { id: options.id, name: options.name, gitRemoteUrl: httpsUrl });
|
|
246
|
+
logCloneSuccess(targetDir, { devCommand: command.netlify.config.dev?.command });
|
|
247
|
+
}
|
|
248
|
+
};
|
|
64
249
|
//# sourceMappingURL=clone.js.map
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import terminalLink from 'terminal-link';
|
|
2
2
|
export const createCloneCommand = (program) => program
|
|
3
3
|
.command('clone')
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
// TODO(serhalp): When making this feature public, add this line:
|
|
5
|
+
// When cloning a Netlify site without a connected repository, the repository will be cloned from Netlify's managed git service with automatic credential configuration.
|
|
6
|
+
.description(`Clone a repository and link it to a Netlify project
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
You can clone from:
|
|
9
|
+
- A GitHub/GitLab repository URL or shorthand (e.g., owner/repo)
|
|
10
|
+
- A Netlify site name (e.g., my-site)
|
|
11
|
+
- A Netlify site URL (e.g., https://my-site.netlify.app)
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
When cloning a Netlify site that has a connected repository, the repository will be cloned from the connected source (GitHub, GitLab, etc.).
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
If you specify a target directory, the repo will be cloned into that directory. By default, a directory will be created with the name of the repo or site.`)
|
|
17
|
+
.argument('<repository>', 'Repository URL, GitHub shorthand (owner/repo), Netlify site name, or Netlify site URL')
|
|
11
18
|
.argument('[targetDir]', 'directory in which to clone the repository - will be created if it does not exist')
|
|
12
|
-
.option('--id <id>', 'ID of existing Netlify project to link to')
|
|
13
|
-
.option('--name <name>', 'Name of existing Netlify project to link to')
|
|
19
|
+
.option('--id <id>', 'ID of existing Netlify project to link to (only for GitHub/GitLab repos)')
|
|
20
|
+
.option('--name <name>', 'Name of existing Netlify project to link to (only for GitHub/GitLab repos)')
|
|
14
21
|
.addExamples([
|
|
22
|
+
'netlify clone my-site-name',
|
|
23
|
+
'netlify clone https://my-site.netlify.app',
|
|
24
|
+
'netlify clone https://app.netlify.com/sites/my-site',
|
|
15
25
|
'netlify clone vibecoder/next-unicorn',
|
|
16
26
|
'netlify clone https://github.com/vibecoder/next-unicorn.git',
|
|
17
27
|
'netlify clone git@github.com:vibecoder/next-unicorn.git',
|
|
18
28
|
'netlify clone vibecoder/next-unicorn ./next-unicorn-shh-secret',
|
|
19
29
|
'netlify clone --id 123-123-123-123 vibecoder/next-unicorn',
|
|
20
30
|
'netlify clone --name my-project-name vibecoder/next-unicorn',
|
|
31
|
+
'netlify clone my-site-name ./local-folder',
|
|
21
32
|
])
|
|
22
33
|
.addHelpText('after', () => {
|
|
23
34
|
const docsUrl = 'https://docs.netlify.com/cli/get-started/#link-and-unlink-sites';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Readable, Writable } from 'stream';
|
|
2
|
+
import type { GitCredentialOptionValues } from './option_values.js';
|
|
3
|
+
export declare const NETLIFY_GIT_HOST = "git.netlify.com";
|
|
4
|
+
export declare const parseGitCredentialInput: (input: Readable) => Promise<Partial<Record<string, string>>>;
|
|
5
|
+
export declare const writeCredentials: (output: Writable, token: string) => void;
|
|
6
|
+
export declare const gitCredential: (operation: string, _options: GitCredentialOptionValues) => Promise<void>;
|
|
7
|
+
//# sourceMappingURL=git-credential.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import process from 'process';
|
|
2
|
+
import readline from 'readline';
|
|
3
|
+
import { getToken } from '../../utils/command-helpers.js';
|
|
4
|
+
export const NETLIFY_GIT_HOST = 'git.netlify.com';
|
|
5
|
+
export const parseGitCredentialInput = async (input) => {
|
|
6
|
+
const rl = readline.createInterface({
|
|
7
|
+
input,
|
|
8
|
+
terminal: false,
|
|
9
|
+
});
|
|
10
|
+
const data = {};
|
|
11
|
+
for await (const line of rl) {
|
|
12
|
+
if (line === '')
|
|
13
|
+
break;
|
|
14
|
+
const [key, ...valueParts] = line.split('=');
|
|
15
|
+
if (key) {
|
|
16
|
+
data[key] = valueParts.join('=');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
export const writeCredentials = (output, token) => {
|
|
22
|
+
output.write(`username=x-access-token\n`);
|
|
23
|
+
output.write(`password=${token}\n`);
|
|
24
|
+
};
|
|
25
|
+
export const gitCredential = async (operation, _options) => {
|
|
26
|
+
if (operation !== 'get') {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const input = await parseGitCredentialInput(process.stdin);
|
|
30
|
+
if (input.host?.split(':')[0] !== NETLIFY_GIT_HOST) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const [token] = await getToken();
|
|
34
|
+
if (!token) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
writeCredentials(process.stdout, token);
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=git-credential.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const createGitCredentialCommand = (program) => program
|
|
2
|
+
.command('git-credential', { hidden: true })
|
|
3
|
+
.description('Git credential helper for Netlify authentication (used internally by git)')
|
|
4
|
+
.argument('<operation>', 'Git credential operation (get, store, erase)')
|
|
5
|
+
.action(async (operation, options) => {
|
|
6
|
+
const { gitCredential } = await import('./git-credential.js');
|
|
7
|
+
await gitCredential(operation, options);
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -84,12 +84,15 @@ export const createLogsCommand = (program) => {
|
|
|
84
84
|
.addOption(new Option('--since <time>', 'Start of the historical log window. Accepts a duration (e.g. 10m, 1h, 24h) or an ISO 8601 timestamp. Defaults to 10m'))
|
|
85
85
|
.addOption(new Option('--until <time>', 'End of the historical log window. Accepts a duration or an ISO 8601 timestamp (defaults to now)'))
|
|
86
86
|
.addOption(new Option('-f, --follow', 'Stream logs in real time instead of showing historical logs'))
|
|
87
|
-
.addOption(new Option('-u, --url <url>', 'Show logs for the deploy behind the given URL. Supports deploy permalinks and branch subdomains'))
|
|
87
|
+
.addOption(new Option('-u, --url <url>', 'Show logs for the deploy behind the given URL. Supports deploy permalinks and branch subdomains. Can be used with all sources.'))
|
|
88
|
+
.addOption(new Option('-d, --deploy-id <deploy-id>', 'Show logs for a specific deploy by ID, including failed builds. Can be used with all sources.'))
|
|
88
89
|
.addOption(new Option('-l, --level <levels...>', `Log levels to include. Choices are:${CLI_LOG_LEVEL_CHOICES_STRING}`))
|
|
89
90
|
.addOption(new Option('--json', 'Output logs as JSON Lines'))
|
|
90
91
|
.addExamples([
|
|
91
92
|
'netlify logs',
|
|
92
93
|
'netlify logs --since 1h',
|
|
94
|
+
'netlify logs --source deploy --deploy-id <deploy-id> --since 7d',
|
|
95
|
+
'netlify logs --source functions --deploy-id <deploy-id>',
|
|
93
96
|
'netlify logs --source functions --function checkout --since 24h',
|
|
94
97
|
'netlify logs --source edge-functions --since 30m',
|
|
95
98
|
'netlify logs --source deploy --source functions --since 1h',
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { NetlifyAPI } from '@netlify/api';
|
|
2
2
|
import type BaseCommand from '../base-command.js';
|
|
3
|
-
|
|
3
|
+
import type { LogsOptionValues } from './option_values.js';
|
|
4
|
+
type Source = 'functions' | 'edge-functions' | 'deploy';
|
|
5
|
+
export declare const logsCommand: (options: LogsOptionValues, command: BaseCommand) => Promise<undefined>;
|
|
6
|
+
export declare const runFollowMode: ({ sources, client, siteId, accessToken, deployId, deployTargeted, functionNames, edgeFunctionNames, levelsToPrint, json, }: {
|
|
7
|
+
sources: Source[];
|
|
8
|
+
client: NetlifyAPI;
|
|
9
|
+
siteId: string;
|
|
10
|
+
accessToken: string | null | undefined;
|
|
11
|
+
deployId?: string;
|
|
12
|
+
deployTargeted: boolean;
|
|
13
|
+
functionNames: string[];
|
|
14
|
+
edgeFunctionNames: string[];
|
|
15
|
+
levelsToPrint: string[];
|
|
16
|
+
json: boolean;
|
|
17
|
+
}) => Promise<undefined>;
|
|
18
|
+
export {};
|
|
4
19
|
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { chalk, log, logAndThrowError, netlifyCommand } from '../../utils/command-helpers.js';
|
|
2
|
-
import { createColorAssigner, formatJsonLine, formatLogLine, parseTimeValue, resolveDeployIdFromUrl, SOURCE_INDICATORS, SOURCE_LABELS, } from './log-api.js';
|
|
2
|
+
import { createColorAssigner, DEPLOY_ID_RE, formatJsonLine, formatLogLine, parseTimeValue, resolveDeployIdFromUrl, SOURCE_INDICATORS, SOURCE_LABELS, } from './log-api.js';
|
|
3
3
|
import { LOG_LEVELS_LIST, CLI_LOG_LEVEL_CHOICES_STRING } from './log-levels.js';
|
|
4
|
-
import { fetchDeployHistoricalLogs, findCurrentBuildingDeploy, findLatestReadyDeploy, streamDeploy, } from './sources/deploy.js';
|
|
4
|
+
import { fetchDeployHistoricalLogs, findCurrentBuildingDeploy, findLatestFinishedDeploy, findLatestReadyDeploy, isDeployFinished, streamDeploy, } from './sources/deploy.js';
|
|
5
5
|
import { fetchEdgeFunctionHistoricalLogs, streamEdgeFunctions } from './sources/edge-functions.js';
|
|
6
6
|
import { fetchFunctionHistoricalLogs, listFunctions, selectFunctions, streamFunctions, validateFunctionCount, } from './sources/functions.js';
|
|
7
7
|
const VALID_SOURCES = ['functions', 'edge-functions', 'deploy'];
|
|
8
8
|
const DEFAULT_SINCE = '10m';
|
|
9
|
+
const DEPLOY_STREAM_IDLE_CLOSE_MS = 3_000;
|
|
9
10
|
const parseSources = (rawSources) => {
|
|
10
11
|
const sources = [];
|
|
11
12
|
for (const s of rawSources) {
|
|
@@ -122,9 +123,22 @@ export const logsCommand = async (options, command) => {
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
let deployId;
|
|
125
|
-
|
|
126
|
+
let deployTargeted = false;
|
|
127
|
+
if (options.deployId) {
|
|
128
|
+
const explicitDeployId = options.deployId.trim();
|
|
129
|
+
if (!DEPLOY_ID_RE.test(explicitDeployId)) {
|
|
130
|
+
return logAndThrowError(`Invalid --deploy-id value: ${explicitDeployId}. Expected a deploy ID.`);
|
|
131
|
+
}
|
|
132
|
+
if (options.url) {
|
|
133
|
+
return logAndThrowError('--deploy-id cannot be used together with --url.');
|
|
134
|
+
}
|
|
135
|
+
deployId = explicitDeployId;
|
|
136
|
+
deployTargeted = true;
|
|
137
|
+
}
|
|
138
|
+
else if (options.url) {
|
|
126
139
|
try {
|
|
127
140
|
deployId = await resolveDeployIdFromUrl(options.url, client, siteId, siteInfo);
|
|
141
|
+
deployTargeted = deployId !== undefined;
|
|
128
142
|
}
|
|
129
143
|
catch (error) {
|
|
130
144
|
const message = error.message;
|
|
@@ -170,20 +184,20 @@ export const logsCommand = async (options, command) => {
|
|
|
170
184
|
}
|
|
171
185
|
}
|
|
172
186
|
if (!deployId) {
|
|
173
|
-
const latestId =
|
|
187
|
+
const latestId = sources.includes('deploy')
|
|
188
|
+
? await findLatestFinishedDeploy(client, siteId)
|
|
189
|
+
: await findLatestReadyDeploy(client, siteId);
|
|
174
190
|
if (latestId) {
|
|
175
191
|
deployId = latestId;
|
|
176
192
|
}
|
|
177
193
|
}
|
|
178
194
|
}
|
|
179
|
-
const apiBase = client.basePath;
|
|
180
195
|
const sinceValue = options.since ?? DEFAULT_SINCE;
|
|
181
196
|
const untilValue = options.until;
|
|
182
197
|
if (historicalRange) {
|
|
183
198
|
await runHistoricalMode({
|
|
184
199
|
sources,
|
|
185
200
|
client,
|
|
186
|
-
apiBase,
|
|
187
201
|
siteId,
|
|
188
202
|
accessToken: client.accessToken,
|
|
189
203
|
deployId,
|
|
@@ -206,17 +220,18 @@ export const logsCommand = async (options, command) => {
|
|
|
206
220
|
siteId,
|
|
207
221
|
accessToken: client.accessToken,
|
|
208
222
|
deployId,
|
|
223
|
+
deployTargeted,
|
|
209
224
|
functionNames,
|
|
210
225
|
edgeFunctionNames,
|
|
211
226
|
levelsToPrint,
|
|
212
227
|
json,
|
|
213
228
|
});
|
|
214
229
|
};
|
|
215
|
-
const runHistoricalMode = async ({ sources, client,
|
|
230
|
+
const runHistoricalMode = async ({ sources, client, siteId, accessToken, deployId, functionNames, edgeFunctionNames, from, to, levelsToPrint, json, timeDescription, }) => {
|
|
216
231
|
const allEntries = [];
|
|
217
232
|
if (sources.includes('deploy') && deployId) {
|
|
218
233
|
const deployEntries = await fetchDeployHistoricalLogs({
|
|
219
|
-
|
|
234
|
+
siteId,
|
|
220
235
|
accessToken,
|
|
221
236
|
deployId,
|
|
222
237
|
from,
|
|
@@ -264,20 +279,23 @@ const runHistoricalMode = async ({ sources, client, apiBase, siteId, accessToken
|
|
|
264
279
|
printEntry(entry, levelsToPrint, json, assignColor(key));
|
|
265
280
|
}
|
|
266
281
|
};
|
|
267
|
-
const runFollowMode = async ({ sources, client, siteId, accessToken, deployId, functionNames, edgeFunctionNames, levelsToPrint, json, }) => {
|
|
282
|
+
export const runFollowMode = async ({ sources, client, siteId, accessToken, deployId, deployTargeted, functionNames, edgeFunctionNames, levelsToPrint, json, }) => {
|
|
268
283
|
const assignColor = createColorAssigner();
|
|
269
284
|
const onEntry = (entry) => {
|
|
270
285
|
const key = `${entry.source}:${entry.name}`;
|
|
271
286
|
printEntry(entry, levelsToPrint, json, assignColor(key));
|
|
272
287
|
};
|
|
273
|
-
if (sources.includes('deploy')
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
|
|
288
|
+
if (sources.includes('deploy')) {
|
|
289
|
+
const deployStreamId = deployTargeted ? deployId : await findCurrentBuildingDeploy(client, siteId);
|
|
290
|
+
if (deployStreamId) {
|
|
291
|
+
const finished = deployTargeted
|
|
292
|
+
? await isDeployFinished(client, siteId, deployStreamId).catch(() => false)
|
|
293
|
+
: false;
|
|
294
|
+
streamDeploy(siteId, deployStreamId, accessToken, onEntry, () => {
|
|
277
295
|
if (!json) {
|
|
278
296
|
log(chalk.dim('Deploy stream closed.'));
|
|
279
297
|
}
|
|
280
|
-
});
|
|
298
|
+
}, { closeWhenIdleMs: finished ? DEPLOY_STREAM_IDLE_CLOSE_MS : undefined });
|
|
281
299
|
}
|
|
282
300
|
}
|
|
283
301
|
if (sources.includes('functions')) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BaseOptionValues } from '../base-command.js';
|
|
2
|
+
export type LogsOptionValues = BaseOptionValues & {
|
|
3
|
+
source?: string[];
|
|
4
|
+
function?: string[];
|
|
5
|
+
edgeFunction?: string[];
|
|
6
|
+
since?: string;
|
|
7
|
+
until?: string;
|
|
8
|
+
follow?: boolean;
|
|
9
|
+
url?: string;
|
|
10
|
+
deployId?: string;
|
|
11
|
+
level?: string[];
|
|
12
|
+
json?: boolean;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=option_values.d.ts.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { NetlifyAPI } from '@netlify/api';
|
|
2
2
|
import type { LogEntry } from '../log-api.js';
|
|
3
|
-
export declare const fetchDeployHistoricalLogs: ({
|
|
4
|
-
|
|
3
|
+
export declare const fetchDeployHistoricalLogs: ({ siteId, accessToken, deployId, from, to, }: {
|
|
4
|
+
siteId: string;
|
|
5
5
|
accessToken: string | null | undefined;
|
|
6
6
|
deployId: string;
|
|
7
7
|
from: number;
|
|
8
8
|
to: number;
|
|
9
9
|
}) => Promise<LogEntry[]>;
|
|
10
|
-
export declare const streamDeploy: (siteId: string, deployId: string, accessToken: string | null | undefined, onEntry: (entry: LogEntry) => void, onClose: () => void
|
|
10
|
+
export declare const streamDeploy: (siteId: string, deployId: string, accessToken: string | null | undefined, onEntry: (entry: LogEntry) => void, onClose: () => void, { closeWhenIdleMs }?: {
|
|
11
|
+
closeWhenIdleMs?: number;
|
|
12
|
+
}) => (() => void);
|
|
11
13
|
export declare const findCurrentBuildingDeploy: (client: NetlifyAPI, siteId: string) => Promise<string | undefined>;
|
|
12
14
|
export declare const findLatestReadyDeploy: (client: NetlifyAPI, siteId: string) => Promise<string | undefined>;
|
|
15
|
+
export declare const findLatestFinishedDeploy: (client: NetlifyAPI, siteId: string) => Promise<string | undefined>;
|
|
16
|
+
export declare const isDeployFinished: (client: NetlifyAPI, siteId: string, deployId: string) => Promise<boolean>;
|
|
13
17
|
//# sourceMappingURL=deploy.d.ts.map
|