@depup/netlify-cli 24.3.0-depup.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/LICENSE +22 -0
- package/README.md +54 -0
- package/bin/run.js +66 -0
- package/changes.json +102 -0
- package/dist/commands/agents/agents-create.d.ts +12 -0
- package/dist/commands/agents/agents-create.d.ts.map +1 -0
- package/dist/commands/agents/agents-create.js +131 -0
- package/dist/commands/agents/agents-create.js.map +1 -0
- package/dist/commands/agents/agents-list.d.ts +10 -0
- package/dist/commands/agents/agents-list.d.ts.map +1 -0
- package/dist/commands/agents/agents-list.js +115 -0
- package/dist/commands/agents/agents-list.js.map +1 -0
- package/dist/commands/agents/agents-show.d.ts +9 -0
- package/dist/commands/agents/agents-show.d.ts.map +1 -0
- package/dist/commands/agents/agents-show.js +127 -0
- package/dist/commands/agents/agents-show.js.map +1 -0
- package/dist/commands/agents/agents-stop.d.ts +11 -0
- package/dist/commands/agents/agents-stop.d.ts.map +1 -0
- package/dist/commands/agents/agents-stop.js +75 -0
- package/dist/commands/agents/agents-stop.js.map +1 -0
- package/dist/commands/agents/agents.d.ts +3 -0
- package/dist/commands/agents/agents.d.ts.map +1 -0
- package/dist/commands/agents/agents.js +83 -0
- package/dist/commands/agents/agents.js.map +1 -0
- package/dist/commands/agents/constants.d.ts +39 -0
- package/dist/commands/agents/constants.d.ts.map +1 -0
- package/dist/commands/agents/constants.js +29 -0
- package/dist/commands/agents/constants.js.map +1 -0
- package/dist/commands/agents/index.d.ts +2 -0
- package/dist/commands/agents/index.d.ts.map +1 -0
- package/dist/commands/agents/index.js +2 -0
- package/dist/commands/agents/index.js.map +1 -0
- package/dist/commands/agents/types.d.ts +48 -0
- package/dist/commands/agents/types.d.ts.map +1 -0
- package/dist/commands/agents/types.js +2 -0
- package/dist/commands/agents/types.js.map +1 -0
- package/dist/commands/agents/utils.d.ts +8 -0
- package/dist/commands/agents/utils.d.ts.map +1 -0
- package/dist/commands/agents/utils.js +51 -0
- package/dist/commands/agents/utils.js.map +1 -0
- package/dist/commands/api/api.d.ts +4 -0
- package/dist/commands/api/api.d.ts.map +1 -0
- package/dist/commands/api/api.js +42 -0
- package/dist/commands/api/api.js.map +1 -0
- package/dist/commands/api/index.d.ts +3 -0
- package/dist/commands/api/index.d.ts.map +1 -0
- package/dist/commands/api/index.js +14 -0
- package/dist/commands/api/index.js.map +1 -0
- package/dist/commands/base-command.d.ts +104 -0
- package/dist/commands/base-command.d.ts.map +1 -0
- package/dist/commands/base-command.js +637 -0
- package/dist/commands/base-command.js.map +1 -0
- package/dist/commands/blobs/blobs-delete.d.ts +5 -0
- package/dist/commands/blobs/blobs-delete.d.ts.map +1 -0
- package/dist/commands/blobs/blobs-delete.js +27 -0
- package/dist/commands/blobs/blobs-delete.js.map +1 -0
- package/dist/commands/blobs/blobs-get.d.ts +8 -0
- package/dist/commands/blobs/blobs-get.d.ts.map +1 -0
- package/dist/commands/blobs/blobs-get.js +34 -0
- package/dist/commands/blobs/blobs-get.js.map +1 -0
- package/dist/commands/blobs/blobs-list.d.ts +10 -0
- package/dist/commands/blobs/blobs-list.d.ts.map +1 -0
- package/dist/commands/blobs/blobs-list.js +39 -0
- package/dist/commands/blobs/blobs-list.js.map +1 -0
- package/dist/commands/blobs/blobs-set.d.ts +9 -0
- package/dist/commands/blobs/blobs-set.d.ts.map +1 -0
- package/dist/commands/blobs/blobs-set.js +49 -0
- package/dist/commands/blobs/blobs-set.js.map +1 -0
- package/dist/commands/blobs/blobs.d.ts +6 -0
- package/dist/commands/blobs/blobs.d.ts.map +1 -0
- package/dist/commands/blobs/blobs.js +82 -0
- package/dist/commands/blobs/blobs.js.map +1 -0
- package/dist/commands/build/build.d.ts +6 -0
- package/dist/commands/build/build.d.ts.map +1 -0
- package/dist/commands/build/build.js +39 -0
- package/dist/commands/build/build.js.map +1 -0
- package/dist/commands/build/index.d.ts +3 -0
- package/dist/commands/build/index.d.ts.map +1 -0
- package/dist/commands/build/index.js +25 -0
- package/dist/commands/build/index.js.map +1 -0
- package/dist/commands/clone/clone.d.ts +7 -0
- package/dist/commands/clone/clone.d.ts.map +1 -0
- package/dist/commands/clone/clone.js +64 -0
- package/dist/commands/clone/clone.js.map +1 -0
- package/dist/commands/clone/index.d.ts +3 -0
- package/dist/commands/clone/index.d.ts.map +1 -0
- package/dist/commands/clone/index.js +30 -0
- package/dist/commands/clone/index.js.map +1 -0
- package/dist/commands/clone/option_values.d.ts +6 -0
- package/dist/commands/clone/option_values.d.ts.map +1 -0
- package/dist/commands/clone/option_values.js +2 -0
- package/dist/commands/clone/option_values.js.map +1 -0
- package/dist/commands/completion/completion.d.ts +5 -0
- package/dist/commands/completion/completion.d.ts.map +1 -0
- package/dist/commands/completion/completion.js +67 -0
- package/dist/commands/completion/completion.js.map +1 -0
- package/dist/commands/completion/index.d.ts +3 -0
- package/dist/commands/completion/index.d.ts.map +1 -0
- package/dist/commands/completion/index.js +27 -0
- package/dist/commands/completion/index.js.map +1 -0
- package/dist/commands/database/constants.d.ts +4 -0
- package/dist/commands/database/constants.d.ts.map +1 -0
- package/dist/commands/database/constants.js +4 -0
- package/dist/commands/database/constants.js.map +1 -0
- package/dist/commands/database/database.d.ts +18 -0
- package/dist/commands/database/database.d.ts.map +1 -0
- package/dist/commands/database/database.js +94 -0
- package/dist/commands/database/database.js.map +1 -0
- package/dist/commands/database/db-connection.d.ts +8 -0
- package/dist/commands/database/db-connection.d.ts.map +1 -0
- package/dist/commands/database/db-connection.js +41 -0
- package/dist/commands/database/db-connection.js.map +1 -0
- package/dist/commands/database/drizzle.d.ts +3 -0
- package/dist/commands/database/drizzle.d.ts.map +1 -0
- package/dist/commands/database/drizzle.js +96 -0
- package/dist/commands/database/drizzle.js.map +1 -0
- package/dist/commands/database/index.d.ts +2 -0
- package/dist/commands/database/index.d.ts.map +1 -0
- package/dist/commands/database/index.js +2 -0
- package/dist/commands/database/index.js.map +1 -0
- package/dist/commands/database/init.d.ts +9 -0
- package/dist/commands/database/init.d.ts.map +1 -0
- package/dist/commands/database/init.js +124 -0
- package/dist/commands/database/init.js.map +1 -0
- package/dist/commands/database/migrate.d.ts +7 -0
- package/dist/commands/database/migrate.d.ts.map +1 -0
- package/dist/commands/database/migrate.js +34 -0
- package/dist/commands/database/migrate.js.map +1 -0
- package/dist/commands/database/migration-new.d.ts +13 -0
- package/dist/commands/database/migration-new.d.ts.map +1 -0
- package/dist/commands/database/migration-new.js +135 -0
- package/dist/commands/database/migration-new.js.map +1 -0
- package/dist/commands/database/pg-client-executor.d.ts +12 -0
- package/dist/commands/database/pg-client-executor.d.ts.map +1 -0
- package/dist/commands/database/pg-client-executor.js +27 -0
- package/dist/commands/database/pg-client-executor.js.map +1 -0
- package/dist/commands/database/reset.d.ts +6 -0
- package/dist/commands/database/reset.d.ts.map +1 -0
- package/dist/commands/database/reset.js +24 -0
- package/dist/commands/database/reset.js.map +1 -0
- package/dist/commands/database/status.d.ts +4 -0
- package/dist/commands/database/status.d.ts.map +1 -0
- package/dist/commands/database/status.js +71 -0
- package/dist/commands/database/status.js.map +1 -0
- package/dist/commands/database/utils.d.ts +75 -0
- package/dist/commands/database/utils.d.ts.map +1 -0
- package/dist/commands/database/utils.js +172 -0
- package/dist/commands/database/utils.js.map +1 -0
- package/dist/commands/deploy/deploy.d.ts +4 -0
- package/dist/commands/deploy/deploy.d.ts.map +1 -0
- package/dist/commands/deploy/deploy.js +890 -0
- package/dist/commands/deploy/deploy.js.map +1 -0
- package/dist/commands/deploy/index.d.ts +3 -0
- package/dist/commands/deploy/index.d.ts.map +1 -0
- package/dist/commands/deploy/index.js +96 -0
- package/dist/commands/deploy/index.js.map +1 -0
- package/dist/commands/deploy/option_values.d.ts +23 -0
- package/dist/commands/deploy/option_values.d.ts.map +1 -0
- package/dist/commands/deploy/option_values.js +3 -0
- package/dist/commands/deploy/option_values.js.map +1 -0
- package/dist/commands/dev/dev.d.ts +4 -0
- package/dist/commands/dev/dev.d.ts.map +1 -0
- package/dist/commands/dev/dev.js +248 -0
- package/dist/commands/dev/dev.js.map +1 -0
- package/dist/commands/dev/index.d.ts +3 -0
- package/dist/commands/dev/index.d.ts.map +1 -0
- package/dist/commands/dev/index.js +77 -0
- package/dist/commands/dev/index.js.map +1 -0
- package/dist/commands/dev/programmatic-netlify-dev.d.ts +20 -0
- package/dist/commands/dev/programmatic-netlify-dev.d.ts.map +1 -0
- package/dist/commands/dev/programmatic-netlify-dev.js +45 -0
- package/dist/commands/dev/programmatic-netlify-dev.js.map +1 -0
- package/dist/commands/dev-exec/dev-exec.d.ts +4 -0
- package/dist/commands/dev-exec/dev-exec.d.ts.map +1 -0
- package/dist/commands/dev-exec/dev-exec.js +46 -0
- package/dist/commands/dev-exec/dev-exec.js.map +1 -0
- package/dist/commands/dev-exec/index.d.ts +3 -0
- package/dist/commands/dev-exec/index.d.ts.map +1 -0
- package/dist/commands/dev-exec/index.js +17 -0
- package/dist/commands/dev-exec/index.js.map +1 -0
- package/dist/commands/env/env-clone.d.ts +4 -0
- package/dist/commands/env/env-clone.d.ts.map +1 -0
- package/dist/commands/env/env-clone.js +81 -0
- package/dist/commands/env/env-clone.js.map +1 -0
- package/dist/commands/env/env-get.d.ts +4 -0
- package/dist/commands/env/env-get.d.ts.map +1 -0
- package/dist/commands/env/env-get.js +29 -0
- package/dist/commands/env/env-get.js.map +1 -0
- package/dist/commands/env/env-import.d.ts +4 -0
- package/dist/commands/env/env-import.d.ts.map +1 -0
- package/dist/commands/env/env-import.js +78 -0
- package/dist/commands/env/env-import.js.map +1 -0
- package/dist/commands/env/env-list.d.ts +4 -0
- package/dist/commands/env/env-list.d.ts.map +1 -0
- package/dist/commands/env/env-list.js +85 -0
- package/dist/commands/env/env-list.js.map +1 -0
- package/dist/commands/env/env-set.d.ts +4 -0
- package/dist/commands/env/env-set.d.ts.map +1 -0
- package/dist/commands/env/env-set.js +118 -0
- package/dist/commands/env/env-set.js.map +1 -0
- package/dist/commands/env/env-unset.d.ts +4 -0
- package/dist/commands/env/env-unset.d.ts.map +1 -0
- package/dist/commands/env/env-unset.js +76 -0
- package/dist/commands/env/env-unset.js.map +1 -0
- package/dist/commands/env/env.d.ts +3 -0
- package/dist/commands/env/env.d.ts.map +1 -0
- package/dist/commands/env/env.js +139 -0
- package/dist/commands/env/env.js.map +1 -0
- package/dist/commands/env/index.d.ts +2 -0
- package/dist/commands/env/index.d.ts.map +1 -0
- package/dist/commands/env/index.js +2 -0
- package/dist/commands/env/index.js.map +1 -0
- package/dist/commands/functions/functions-build.d.ts +4 -0
- package/dist/commands/functions/functions-build.d.ts.map +1 -0
- package/dist/commands/functions/functions-build.js +26 -0
- package/dist/commands/functions/functions-build.js.map +1 -0
- package/dist/commands/functions/functions-create.d.ts +4 -0
- package/dist/commands/functions/functions-create.d.ts.map +1 -0
- package/dist/commands/functions/functions-create.js +629 -0
- package/dist/commands/functions/functions-create.js.map +1 -0
- package/dist/commands/functions/functions-invoke.d.ts +4 -0
- package/dist/commands/functions/functions-invoke.d.ts.map +1 -0
- package/dist/commands/functions/functions-invoke.js +210 -0
- package/dist/commands/functions/functions-invoke.js.map +1 -0
- package/dist/commands/functions/functions-list.d.ts +4 -0
- package/dist/commands/functions/functions-list.d.ts.map +1 -0
- package/dist/commands/functions/functions-list.js +38 -0
- package/dist/commands/functions/functions-list.js.map +1 -0
- package/dist/commands/functions/functions-serve.d.ts +4 -0
- package/dist/commands/functions/functions-serve.d.ts.map +1 -0
- package/dist/commands/functions/functions-serve.js +74 -0
- package/dist/commands/functions/functions-serve.js.map +1 -0
- package/dist/commands/functions/functions.d.ts +3 -0
- package/dist/commands/functions/functions.d.ts.map +1 -0
- package/dist/commands/functions/functions.js +108 -0
- package/dist/commands/functions/functions.js.map +1 -0
- package/dist/commands/functions/index.d.ts +2 -0
- package/dist/commands/functions/index.d.ts.map +1 -0
- package/dist/commands/functions/index.js +2 -0
- package/dist/commands/functions/index.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +3 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init/constants.d.ts +4 -0
- package/dist/commands/init/constants.d.ts.map +1 -0
- package/dist/commands/init/constants.js +3 -0
- package/dist/commands/init/constants.js.map +1 -0
- package/dist/commands/init/index.d.ts +3 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/init/index.js +17 -0
- package/dist/commands/init/index.js.map +1 -0
- package/dist/commands/init/init.d.ts +12 -0
- package/dist/commands/init/init.d.ts.map +1 -0
- package/dist/commands/init/init.js +205 -0
- package/dist/commands/init/init.js.map +1 -0
- package/dist/commands/link/index.d.ts +3 -0
- package/dist/commands/link/index.d.ts.map +1 -0
- package/dist/commands/link/index.js +25 -0
- package/dist/commands/link/index.js.map +1 -0
- package/dist/commands/link/link.d.ts +5 -0
- package/dist/commands/link/link.d.ts.map +1 -0
- package/dist/commands/link/link.js +305 -0
- package/dist/commands/link/link.js.map +1 -0
- package/dist/commands/link/option_values.d.ts +8 -0
- package/dist/commands/link/option_values.d.ts.map +1 -0
- package/dist/commands/link/option_values.js +3 -0
- package/dist/commands/link/option_values.js.map +1 -0
- package/dist/commands/login/index.d.ts +3 -0
- package/dist/commands/login/index.d.ts.map +1 -0
- package/dist/commands/login/index.js +20 -0
- package/dist/commands/login/index.js.map +1 -0
- package/dist/commands/login/login-check.d.ts +4 -0
- package/dist/commands/login/login-check.d.ts.map +1 -0
- package/dist/commands/login/login-check.js +49 -0
- package/dist/commands/login/login-check.js.map +1 -0
- package/dist/commands/login/login-request.d.ts +3 -0
- package/dist/commands/login/login-request.d.ts.map +1 -0
- package/dist/commands/login/login-request.js +19 -0
- package/dist/commands/login/login-request.js.map +1 -0
- package/dist/commands/login/login.d.ts +4 -0
- package/dist/commands/login/login.d.ts.map +1 -0
- package/dist/commands/login/login.js +43 -0
- package/dist/commands/login/login.js.map +1 -0
- package/dist/commands/logout/index.d.ts +3 -0
- package/dist/commands/logout/index.d.ts.map +1 -0
- package/dist/commands/logout/index.js +8 -0
- package/dist/commands/logout/index.js.map +1 -0
- package/dist/commands/logout/logout.d.ts +4 -0
- package/dist/commands/logout/logout.d.ts.map +1 -0
- package/dist/commands/logout/logout.js +23 -0
- package/dist/commands/logout/logout.js.map +1 -0
- package/dist/commands/logs/build.d.ts +8 -0
- package/dist/commands/logs/build.d.ts.map +1 -0
- package/dist/commands/logs/build.js +72 -0
- package/dist/commands/logs/build.js.map +1 -0
- package/dist/commands/logs/functions.d.ts +4 -0
- package/dist/commands/logs/functions.d.ts.map +1 -0
- package/dist/commands/logs/functions.js +79 -0
- package/dist/commands/logs/functions.js.map +1 -0
- package/dist/commands/logs/index.d.ts +5 -0
- package/dist/commands/logs/index.d.ts.map +1 -0
- package/dist/commands/logs/index.js +40 -0
- package/dist/commands/logs/index.js.map +1 -0
- package/dist/commands/logs/log-levels.d.ts +11 -0
- package/dist/commands/logs/log-levels.d.ts.map +1 -0
- package/dist/commands/logs/log-levels.js +12 -0
- package/dist/commands/logs/log-levels.js.map +1 -0
- package/dist/commands/main.d.ts +36 -0
- package/dist/commands/main.d.ts.map +1 -0
- package/dist/commands/main.js +232 -0
- package/dist/commands/main.js.map +1 -0
- package/dist/commands/open/index.d.ts +3 -0
- package/dist/commands/open/index.d.ts.map +1 -0
- package/dist/commands/open/index.js +32 -0
- package/dist/commands/open/index.js.map +1 -0
- package/dist/commands/open/open-admin.d.ts +3 -0
- package/dist/commands/open/open-admin.d.ts.map +1 -0
- package/dist/commands/open/open-admin.js +11 -0
- package/dist/commands/open/open-admin.js.map +1 -0
- package/dist/commands/open/open-site.d.ts +4 -0
- package/dist/commands/open/open-site.d.ts.map +1 -0
- package/dist/commands/open/open-site.js +12 -0
- package/dist/commands/open/open-site.js.map +1 -0
- package/dist/commands/open/open.d.ts +4 -0
- package/dist/commands/open/open.d.ts.map +1 -0
- package/dist/commands/open/open.js +14 -0
- package/dist/commands/open/open.js.map +1 -0
- package/dist/commands/recipes/common.d.ts +3 -0
- package/dist/commands/recipes/common.d.ts.map +1 -0
- package/dist/commands/recipes/common.js +26 -0
- package/dist/commands/recipes/common.js.map +1 -0
- package/dist/commands/recipes/index.d.ts +3 -0
- package/dist/commands/recipes/index.d.ts.map +1 -0
- package/dist/commands/recipes/index.js +21 -0
- package/dist/commands/recipes/index.js.map +1 -0
- package/dist/commands/recipes/recipes-list.d.ts +5 -0
- package/dist/commands/recipes/recipes-list.d.ts.map +1 -0
- package/dist/commands/recipes/recipes-list.js +15 -0
- package/dist/commands/recipes/recipes-list.js.map +1 -0
- package/dist/commands/recipes/recipes.d.ts +12 -0
- package/dist/commands/recipes/recipes.d.ts.map +1 -0
- package/dist/commands/recipes/recipes.js +53 -0
- package/dist/commands/recipes/recipes.js.map +1 -0
- package/dist/commands/serve/index.d.ts +3 -0
- package/dist/commands/serve/index.d.ts.map +1 -0
- package/dist/commands/serve/index.js +32 -0
- package/dist/commands/serve/index.js.map +1 -0
- package/dist/commands/serve/serve.d.ts +4 -0
- package/dist/commands/serve/serve.d.ts.map +1 -0
- package/dist/commands/serve/serve.js +177 -0
- package/dist/commands/serve/serve.js.map +1 -0
- package/dist/commands/sites/index.d.ts +2 -0
- package/dist/commands/sites/index.d.ts.map +1 -0
- package/dist/commands/sites/index.js +2 -0
- package/dist/commands/sites/index.js.map +1 -0
- package/dist/commands/sites/sites-create.d.ts +8 -0
- package/dist/commands/sites/sites-create.d.ts.map +1 -0
- package/dist/commands/sites/sites-create.js +122 -0
- package/dist/commands/sites/sites-create.js.map +1 -0
- package/dist/commands/sites/sites-delete.d.ts +4 -0
- package/dist/commands/sites/sites-delete.d.ts.map +1 -0
- package/dist/commands/sites/sites-delete.js +74 -0
- package/dist/commands/sites/sites-delete.js.map +1 -0
- package/dist/commands/sites/sites-list.d.ts +4 -0
- package/dist/commands/sites/sites-list.d.ts.map +1 -0
- package/dist/commands/sites/sites-list.js +59 -0
- package/dist/commands/sites/sites-list.js.map +1 -0
- package/dist/commands/sites/sites.d.ts +4 -0
- package/dist/commands/sites/sites.d.ts.map +1 -0
- package/dist/commands/sites/sites.js +55 -0
- package/dist/commands/sites/sites.js.map +1 -0
- package/dist/commands/status/index.d.ts +3 -0
- package/dist/commands/status/index.d.ts.map +1 -0
- package/dist/commands/status/index.js +21 -0
- package/dist/commands/status/index.js.map +1 -0
- package/dist/commands/status/status-hooks.d.ts +4 -0
- package/dist/commands/status/status-hooks.d.ts.map +1 -0
- package/dist/commands/status/status-hooks.js +30 -0
- package/dist/commands/status/status-hooks.js.map +1 -0
- package/dist/commands/status/status.d.ts +4 -0
- package/dist/commands/status/status.d.ts.map +1 -0
- package/dist/commands/status/status.js +73 -0
- package/dist/commands/status/status.js.map +1 -0
- package/dist/commands/switch/index.d.ts +3 -0
- package/dist/commands/switch/index.d.ts.map +1 -0
- package/dist/commands/switch/index.js +8 -0
- package/dist/commands/switch/index.js.map +1 -0
- package/dist/commands/switch/switch.d.ts +4 -0
- package/dist/commands/switch/switch.d.ts.map +1 -0
- package/dist/commands/switch/switch.js +31 -0
- package/dist/commands/switch/switch.js.map +1 -0
- package/dist/commands/unlink/index.d.ts +3 -0
- package/dist/commands/unlink/index.d.ts.map +1 -0
- package/dist/commands/unlink/index.js +15 -0
- package/dist/commands/unlink/index.js.map +1 -0
- package/dist/commands/unlink/unlink.d.ts +4 -0
- package/dist/commands/unlink/unlink.d.ts.map +1 -0
- package/dist/commands/unlink/unlink.js +23 -0
- package/dist/commands/unlink/unlink.js.map +1 -0
- package/dist/commands/watch/index.d.ts +3 -0
- package/dist/commands/watch/index.d.ts.map +1 -0
- package/dist/commands/watch/index.js +9 -0
- package/dist/commands/watch/index.js.map +1 -0
- package/dist/commands/watch/watch.d.ts +3 -0
- package/dist/commands/watch/watch.d.ts.map +1 -0
- package/dist/commands/watch/watch.js +91 -0
- package/dist/commands/watch/watch.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/account.d.ts +3 -0
- package/dist/lib/account.d.ts.map +1 -0
- package/dist/lib/account.js +3 -0
- package/dist/lib/account.js.map +1 -0
- package/dist/lib/api.d.ts +14 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +27 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/blobs/blobs.d.ts +47 -0
- package/dist/lib/blobs/blobs.d.ts.map +1 -0
- package/dist/lib/blobs/blobs.js +82 -0
- package/dist/lib/blobs/blobs.js.map +1 -0
- package/dist/lib/build.d.ts +120 -0
- package/dist/lib/build.d.ts.map +1 -0
- package/dist/lib/build.js +80 -0
- package/dist/lib/build.js.map +1 -0
- package/dist/lib/completion/constants.d.ts +2 -0
- package/dist/lib/completion/constants.d.ts.map +1 -0
- package/dist/lib/completion/constants.js +3 -0
- package/dist/lib/completion/constants.js.map +1 -0
- package/dist/lib/completion/generate-autocompletion.d.ts +8 -0
- package/dist/lib/completion/generate-autocompletion.d.ts.map +1 -0
- package/dist/lib/completion/generate-autocompletion.js +42 -0
- package/dist/lib/completion/generate-autocompletion.js.map +1 -0
- package/dist/lib/completion/get-autocompletion.d.ts +13 -0
- package/dist/lib/completion/get-autocompletion.d.ts.map +1 -0
- package/dist/lib/completion/get-autocompletion.js +31 -0
- package/dist/lib/completion/get-autocompletion.js.map +1 -0
- package/dist/lib/completion/index.d.ts +2 -0
- package/dist/lib/completion/index.d.ts.map +1 -0
- package/dist/lib/completion/index.js +2 -0
- package/dist/lib/completion/index.js.map +1 -0
- package/dist/lib/completion/script.d.ts +3 -0
- package/dist/lib/completion/script.d.ts.map +1 -0
- package/dist/lib/completion/script.js +19 -0
- package/dist/lib/completion/script.js.map +1 -0
- package/dist/lib/edge-functions/bootstrap.d.ts +3 -0
- package/dist/lib/edge-functions/bootstrap.d.ts.map +1 -0
- package/dist/lib/edge-functions/bootstrap.js +20 -0
- package/dist/lib/edge-functions/bootstrap.js.map +1 -0
- package/dist/lib/edge-functions/consts.d.ts +11 -0
- package/dist/lib/edge-functions/consts.d.ts.map +1 -0
- package/dist/lib/edge-functions/consts.js +13 -0
- package/dist/lib/edge-functions/consts.js.map +1 -0
- package/dist/lib/edge-functions/editor-helper.d.ts +9 -0
- package/dist/lib/edge-functions/editor-helper.d.ts.map +1 -0
- package/dist/lib/edge-functions/editor-helper.js +33 -0
- package/dist/lib/edge-functions/editor-helper.js.map +1 -0
- package/dist/lib/edge-functions/get-directories.d.ts +6 -0
- package/dist/lib/edge-functions/get-directories.d.ts.map +1 -0
- package/dist/lib/edge-functions/get-directories.js +25 -0
- package/dist/lib/edge-functions/get-directories.js.map +1 -0
- package/dist/lib/edge-functions/headers.d.ts +36 -0
- package/dist/lib/edge-functions/headers.d.ts.map +1 -0
- package/dist/lib/edge-functions/headers.js +43 -0
- package/dist/lib/edge-functions/headers.js.map +1 -0
- package/dist/lib/edge-functions/proxy.d.ts +50 -0
- package/dist/lib/edge-functions/proxy.d.ts.map +1 -0
- package/dist/lib/edge-functions/proxy.js +159 -0
- package/dist/lib/edge-functions/proxy.js.map +1 -0
- package/dist/lib/edge-functions/registry.d.ts +138 -0
- package/dist/lib/edge-functions/registry.d.ts.map +1 -0
- package/dist/lib/edge-functions/registry.js +511 -0
- package/dist/lib/edge-functions/registry.js.map +1 -0
- package/dist/lib/exec-fetcher.d.ts +20 -0
- package/dist/lib/exec-fetcher.d.ts.map +1 -0
- package/dist/lib/exec-fetcher.js +166 -0
- package/dist/lib/exec-fetcher.js.map +1 -0
- package/dist/lib/extensions.d.ts +12 -0
- package/dist/lib/extensions.d.ts.map +1 -0
- package/dist/lib/extensions.js +14 -0
- package/dist/lib/extensions.js.map +1 -0
- package/dist/lib/fs.d.ts +10 -0
- package/dist/lib/fs.d.ts.map +1 -0
- package/dist/lib/fs.js +38 -0
- package/dist/lib/fs.js.map +1 -0
- package/dist/lib/functions/background.d.ts +5 -0
- package/dist/lib/functions/background.d.ts.map +1 -0
- package/dist/lib/functions/background.js +17 -0
- package/dist/lib/functions/background.js.map +1 -0
- package/dist/lib/functions/config.d.ts +23 -0
- package/dist/lib/functions/config.d.ts.map +1 -0
- package/dist/lib/functions/config.js +19 -0
- package/dist/lib/functions/config.js.map +1 -0
- package/dist/lib/functions/form-submissions-handler.d.ts +11 -0
- package/dist/lib/functions/form-submissions-handler.d.ts.map +1 -0
- package/dist/lib/functions/form-submissions-handler.js +154 -0
- package/dist/lib/functions/form-submissions-handler.js.map +1 -0
- package/dist/lib/functions/local-proxy.d.ts +9 -0
- package/dist/lib/functions/local-proxy.d.ts.map +1 -0
- package/dist/lib/functions/local-proxy.js +38 -0
- package/dist/lib/functions/local-proxy.js.map +1 -0
- package/dist/lib/functions/netlify-function.d.ts +102 -0
- package/dist/lib/functions/netlify-function.d.ts.map +1 -0
- package/dist/lib/functions/netlify-function.js +270 -0
- package/dist/lib/functions/netlify-function.js.map +1 -0
- package/dist/lib/functions/registry.d.ts +136 -0
- package/dist/lib/functions/registry.d.ts.map +1 -0
- package/dist/lib/functions/registry.js +464 -0
- package/dist/lib/functions/registry.js.map +1 -0
- package/dist/lib/functions/runtimes/go/index.d.ts +11 -0
- package/dist/lib/functions/runtimes/go/index.d.ts.map +1 -0
- package/dist/lib/functions/runtimes/go/index.js +65 -0
- package/dist/lib/functions/runtimes/go/index.js.map +1 -0
- package/dist/lib/functions/runtimes/index.d.ts +55 -0
- package/dist/lib/functions/runtimes/index.d.ts.map +1 -0
- package/dist/lib/functions/runtimes/index.js +10 -0
- package/dist/lib/functions/runtimes/index.js.map +1 -0
- package/dist/lib/functions/runtimes/js/builders/zisi.d.ts +35 -0
- package/dist/lib/functions/runtimes/js/builders/zisi.d.ts.map +1 -0
- package/dist/lib/functions/runtimes/js/builders/zisi.js +129 -0
- package/dist/lib/functions/runtimes/js/builders/zisi.js.map +1 -0
- package/dist/lib/functions/runtimes/js/constants.d.ts +2 -0
- package/dist/lib/functions/runtimes/js/constants.d.ts.map +1 -0
- package/dist/lib/functions/runtimes/js/constants.js +2 -0
- package/dist/lib/functions/runtimes/js/constants.js.map +1 -0
- package/dist/lib/functions/runtimes/js/index.d.ts +25 -0
- package/dist/lib/functions/runtimes/js/index.d.ts.map +1 -0
- package/dist/lib/functions/runtimes/js/index.js +120 -0
- package/dist/lib/functions/runtimes/js/index.js.map +1 -0
- package/dist/lib/functions/runtimes/js/worker.d.ts +8 -0
- package/dist/lib/functions/runtimes/js/worker.d.ts.map +1 -0
- package/dist/lib/functions/runtimes/js/worker.js +64 -0
- package/dist/lib/functions/runtimes/js/worker.js.map +1 -0
- package/dist/lib/functions/runtimes/rust/index.d.ts +11 -0
- package/dist/lib/functions/runtimes/rust/index.d.ts.map +1 -0
- package/dist/lib/functions/runtimes/rust/index.js +72 -0
- package/dist/lib/functions/runtimes/rust/index.js.map +1 -0
- package/dist/lib/functions/scheduled.d.ts +21 -0
- package/dist/lib/functions/scheduled.d.ts.map +1 -0
- package/dist/lib/functions/scheduled.js +77 -0
- package/dist/lib/functions/scheduled.js.map +1 -0
- package/dist/lib/functions/server.d.ts +48 -0
- package/dist/lib/functions/server.d.ts.map +1 -0
- package/dist/lib/functions/server.js +299 -0
- package/dist/lib/functions/server.js.map +1 -0
- package/dist/lib/functions/synchronous.d.ts +11 -0
- package/dist/lib/functions/synchronous.d.ts.map +1 -0
- package/dist/lib/functions/synchronous.js +132 -0
- package/dist/lib/functions/synchronous.js.map +1 -0
- package/dist/lib/functions/utils.d.ts +7 -0
- package/dist/lib/functions/utils.d.ts.map +1 -0
- package/dist/lib/functions/utils.js +14 -0
- package/dist/lib/functions/utils.js.map +1 -0
- package/dist/lib/geo-location.d.ts +17 -0
- package/dist/lib/geo-location.d.ts.map +1 -0
- package/dist/lib/geo-location.js +76 -0
- package/dist/lib/geo-location.js.map +1 -0
- package/dist/lib/http-agent.d.ts +22 -0
- package/dist/lib/http-agent.d.ts.map +1 -0
- package/dist/lib/http-agent.js +91 -0
- package/dist/lib/http-agent.js.map +1 -0
- package/dist/lib/images/proxy.d.ts +10 -0
- package/dist/lib/images/proxy.d.ts.map +1 -0
- package/dist/lib/images/proxy.js +28 -0
- package/dist/lib/images/proxy.js.map +1 -0
- package/dist/lib/log.d.ts +3 -0
- package/dist/lib/log.d.ts.map +1 -0
- package/dist/lib/log.js +16 -0
- package/dist/lib/log.js.map +1 -0
- package/dist/lib/path.d.ts +2 -0
- package/dist/lib/path.d.ts.map +1 -0
- package/dist/lib/path.js +2 -0
- package/dist/lib/path.js.map +1 -0
- package/dist/lib/settings.d.ts +14 -0
- package/dist/lib/settings.d.ts.map +1 -0
- package/dist/lib/settings.js +19 -0
- package/dist/lib/settings.js.map +1 -0
- package/dist/lib/spinner.d.ts +23 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +53 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/string.d.ts +2 -0
- package/dist/lib/string.d.ts.map +1 -0
- package/dist/lib/string.js +2 -0
- package/dist/lib/string.js.map +1 -0
- package/dist/lib/wait-port.d.ts +5 -0
- package/dist/lib/wait-port.d.ts.map +1 -0
- package/dist/lib/wait-port.js +45 -0
- package/dist/lib/wait-port.js.map +1 -0
- package/dist/recipes/ai-context/context.d.ts +59 -0
- package/dist/recipes/ai-context/context.d.ts.map +1 -0
- package/dist/recipes/ai-context/context.js +195 -0
- package/dist/recipes/ai-context/context.js.map +1 -0
- package/dist/recipes/ai-context/index.d.ts +4 -0
- package/dist/recipes/ai-context/index.d.ts.map +1 -0
- package/dist/recipes/ai-context/index.js +132 -0
- package/dist/recipes/ai-context/index.js.map +1 -0
- package/dist/recipes/blobs-migrate/index.d.ts +9 -0
- package/dist/recipes/blobs-migrate/index.d.ts.map +1 -0
- package/dist/recipes/blobs-migrate/index.js +78 -0
- package/dist/recipes/blobs-migrate/index.js.map +1 -0
- package/dist/recipes/vscode/index.d.ts +12 -0
- package/dist/recipes/vscode/index.d.ts.map +1 -0
- package/dist/recipes/vscode/index.js +93 -0
- package/dist/recipes/vscode/index.js.map +1 -0
- package/dist/recipes/vscode/settings.d.ts +18 -0
- package/dist/recipes/vscode/settings.d.ts.map +1 -0
- package/dist/recipes/vscode/settings.js +61 -0
- package/dist/recipes/vscode/settings.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utils/addons/prepare.d.ts +13 -0
- package/dist/utils/addons/prepare.d.ts.map +1 -0
- package/dist/utils/addons/prepare.js +26 -0
- package/dist/utils/addons/prepare.js.map +1 -0
- package/dist/utils/build-info.d.ts +21 -0
- package/dist/utils/build-info.d.ts.map +1 -0
- package/dist/utils/build-info.js +122 -0
- package/dist/utils/build-info.js.map +1 -0
- package/dist/utils/command-helpers.d.ts +84 -0
- package/dist/utils/command-helpers.d.ts.map +1 -0
- package/dist/utils/command-helpers.js +210 -0
- package/dist/utils/command-helpers.js.map +1 -0
- package/dist/utils/copy-template-dir/copy-template-dir.d.ts +2 -0
- package/dist/utils/copy-template-dir/copy-template-dir.d.ts.map +1 -0
- package/dist/utils/copy-template-dir/copy-template-dir.js +66 -0
- package/dist/utils/copy-template-dir/copy-template-dir.js.map +1 -0
- package/dist/utils/create-deferred.d.ts +7 -0
- package/dist/utils/create-deferred.d.ts.map +1 -0
- package/dist/utils/create-deferred.js +11 -0
- package/dist/utils/create-deferred.js.map +1 -0
- package/dist/utils/create-stream-promise.d.ts +5 -0
- package/dist/utils/create-stream-promise.d.ts.map +1 -0
- package/dist/utils/create-stream-promise.js +48 -0
- package/dist/utils/create-stream-promise.js.map +1 -0
- package/dist/utils/deploy/constants.d.ts +10 -0
- package/dist/utils/deploy/constants.d.ts.map +1 -0
- package/dist/utils/deploy/constants.js +18 -0
- package/dist/utils/deploy/constants.js.map +1 -0
- package/dist/utils/deploy/deploy-site.d.ts +21 -0
- package/dist/utils/deploy/deploy-site.d.ts.map +1 -0
- package/dist/utils/deploy/deploy-site.js +157 -0
- package/dist/utils/deploy/deploy-site.js.map +1 -0
- package/dist/utils/deploy/file.d.ts +8 -0
- package/dist/utils/deploy/file.d.ts.map +1 -0
- package/dist/utils/deploy/file.js +2 -0
- package/dist/utils/deploy/file.js.map +1 -0
- package/dist/utils/deploy/hash-config.d.ts +10 -0
- package/dist/utils/deploy/hash-config.d.ts.map +1 -0
- package/dist/utils/deploy/hash-config.js +26 -0
- package/dist/utils/deploy/hash-config.js.map +1 -0
- package/dist/utils/deploy/hash-files.d.ts +15 -0
- package/dist/utils/deploy/hash-files.d.ts.map +1 -0
- package/dist/utils/deploy/hash-files.js +21 -0
- package/dist/utils/deploy/hash-files.js.map +1 -0
- package/dist/utils/deploy/hash-fns.d.ts +24 -0
- package/dist/utils/deploy/hash-fns.d.ts.map +1 -0
- package/dist/utils/deploy/hash-fns.js +141 -0
- package/dist/utils/deploy/hash-fns.js.map +1 -0
- package/dist/utils/deploy/hasher-segments.d.ts +16 -0
- package/dist/utils/deploy/hasher-segments.d.ts.map +1 -0
- package/dist/utils/deploy/hasher-segments.js +74 -0
- package/dist/utils/deploy/hasher-segments.js.map +1 -0
- package/dist/utils/deploy/process-files.d.ts +16 -0
- package/dist/utils/deploy/process-files.d.ts.map +1 -0
- package/dist/utils/deploy/process-files.js +38 -0
- package/dist/utils/deploy/process-files.js.map +1 -0
- package/dist/utils/deploy/status-cb.d.ts +7 -0
- package/dist/utils/deploy/status-cb.d.ts.map +1 -0
- package/dist/utils/deploy/status-cb.js +2 -0
- package/dist/utils/deploy/status-cb.js.map +1 -0
- package/dist/utils/deploy/upload-files.d.ts +7 -0
- package/dist/utils/deploy/upload-files.d.ts.map +1 -0
- package/dist/utils/deploy/upload-files.js +116 -0
- package/dist/utils/deploy/upload-files.js.map +1 -0
- package/dist/utils/deploy/upload-source-zip.d.ts +12 -0
- package/dist/utils/deploy/upload-source-zip.d.ts.map +1 -0
- package/dist/utils/deploy/upload-source-zip.js +131 -0
- package/dist/utils/deploy/upload-source-zip.js.map +1 -0
- package/dist/utils/deploy/util.d.ts +5 -0
- package/dist/utils/deploy/util.d.ts.map +1 -0
- package/dist/utils/deploy/util.js +93 -0
- package/dist/utils/deploy/util.js.map +1 -0
- package/dist/utils/detect-server-settings.d.ts +118 -0
- package/dist/utils/detect-server-settings.d.ts.map +1 -0
- package/dist/utils/detect-server-settings.js +252 -0
- package/dist/utils/detect-server-settings.js.map +1 -0
- package/dist/utils/dev-server-banner.d.ts +4 -0
- package/dist/utils/dev-server-banner.d.ts.map +1 -0
- package/dist/utils/dev-server-banner.js +15 -0
- package/dist/utils/dev-server-banner.js.map +1 -0
- package/dist/utils/dev.d.ts +58 -0
- package/dist/utils/dev.d.ts.map +1 -0
- package/dist/utils/dev.js +185 -0
- package/dist/utils/dev.js.map +1 -0
- package/dist/utils/dot-env.d.ts +26 -0
- package/dist/utils/dot-env.d.ts.map +1 -0
- package/dist/utils/dot-env.js +43 -0
- package/dist/utils/dot-env.js.map +1 -0
- package/dist/utils/env/index.d.ts +164 -0
- package/dist/utils/env/index.d.ts.map +1 -0
- package/dist/utils/env/index.js +260 -0
- package/dist/utils/env/index.js.map +1 -0
- package/dist/utils/execa.d.ts +4 -0
- package/dist/utils/execa.d.ts.map +1 -0
- package/dist/utils/execa.js +15 -0
- package/dist/utils/execa.js.map +1 -0
- package/dist/utils/feature-flags.d.ts +20 -0
- package/dist/utils/feature-flags.d.ts.map +1 -0
- package/dist/utils/feature-flags.js +20 -0
- package/dist/utils/feature-flags.js.map +1 -0
- package/dist/utils/framework-server.d.ts +13 -0
- package/dist/utils/framework-server.d.ts.map +1 -0
- package/dist/utils/framework-server.js +66 -0
- package/dist/utils/framework-server.js.map +1 -0
- package/dist/utils/frameworks-api.d.ts +20 -0
- package/dist/utils/frameworks-api.d.ts.map +1 -0
- package/dist/utils/frameworks-api.js +54 -0
- package/dist/utils/frameworks-api.js.map +1 -0
- package/dist/utils/functions/constants.d.ts +2 -0
- package/dist/utils/functions/constants.d.ts.map +1 -0
- package/dist/utils/functions/constants.js +2 -0
- package/dist/utils/functions/constants.js.map +1 -0
- package/dist/utils/functions/functions.d.ts +32 -0
- package/dist/utils/functions/functions.d.ts.map +1 -0
- package/dist/utils/functions/functions.js +39 -0
- package/dist/utils/functions/functions.js.map +1 -0
- package/dist/utils/functions/get-functions.d.ts +10 -0
- package/dist/utils/functions/get-functions.d.ts.map +1 -0
- package/dist/utils/functions/get-functions.js +35 -0
- package/dist/utils/functions/get-functions.js.map +1 -0
- package/dist/utils/functions/index.d.ts +4 -0
- package/dist/utils/functions/index.d.ts.map +1 -0
- package/dist/utils/functions/index.js +4 -0
- package/dist/utils/functions/index.js.map +1 -0
- package/dist/utils/get-cli-package-json.d.ts +4 -0
- package/dist/utils/get-cli-package-json.d.ts.map +1 -0
- package/dist/utils/get-cli-package-json.js +22 -0
- package/dist/utils/get-cli-package-json.js.map +1 -0
- package/dist/utils/get-repo-data.d.ts +17 -0
- package/dist/utils/get-repo-data.d.ts.map +1 -0
- package/dist/utils/get-repo-data.js +59 -0
- package/dist/utils/get-repo-data.js.map +1 -0
- package/dist/utils/get-site.d.ts +4 -0
- package/dist/utils/get-site.d.ts.map +1 -0
- package/dist/utils/get-site.js +21 -0
- package/dist/utils/get-site.js.map +1 -0
- package/dist/utils/gh-auth.d.ts +14 -0
- package/dist/utils/gh-auth.d.ts.map +1 -0
- package/dist/utils/gh-auth.js +92 -0
- package/dist/utils/gh-auth.js.map +1 -0
- package/dist/utils/gitignore.d.ts +2 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/utils/gitignore.js +4 -0
- package/dist/utils/gitignore.js.map +1 -0
- package/dist/utils/headers.d.ts +15 -0
- package/dist/utils/headers.d.ts.map +1 -0
- package/dist/utils/headers.js +39 -0
- package/dist/utils/headers.js.map +1 -0
- package/dist/utils/hooks/requires-site-info-with-project.d.ts +8 -0
- package/dist/utils/hooks/requires-site-info-with-project.d.ts.map +1 -0
- package/dist/utils/hooks/requires-site-info-with-project.js +83 -0
- package/dist/utils/hooks/requires-site-info-with-project.js.map +1 -0
- package/dist/utils/hooks/requires-site-info.d.ts +7 -0
- package/dist/utils/hooks/requires-site-info.d.ts.map +1 -0
- package/dist/utils/hooks/requires-site-info.js +31 -0
- package/dist/utils/hooks/requires-site-info.js.map +1 -0
- package/dist/utils/init/config-github.d.ts +15 -0
- package/dist/utils/init/config-github.d.ts.map +1 -0
- package/dist/utils/init/config-github.js +214 -0
- package/dist/utils/init/config-github.js.map +1 -0
- package/dist/utils/init/config-manual.d.ts +8 -0
- package/dist/utils/init/config-manual.d.ts.map +1 -0
- package/dist/utils/init/config-manual.js +86 -0
- package/dist/utils/init/config-manual.js.map +1 -0
- package/dist/utils/init/config.d.ts +9 -0
- package/dist/utils/init/config.d.ts.map +1 -0
- package/dist/utils/init/config.js +29 -0
- package/dist/utils/init/config.js.map +1 -0
- package/dist/utils/init/plugins.d.ts +7 -0
- package/dist/utils/init/plugins.d.ts.map +1 -0
- package/dist/utils/init/plugins.js +4 -0
- package/dist/utils/init/plugins.js.map +1 -0
- package/dist/utils/init/utils.d.ts +156 -0
- package/dist/utils/init/utils.d.ts.map +1 -0
- package/dist/utils/init/utils.js +178 -0
- package/dist/utils/init/utils.js.map +1 -0
- package/dist/utils/live-tunnel.d.ts +9 -0
- package/dist/utils/live-tunnel.d.ts.map +1 -0
- package/dist/utils/live-tunnel.js +125 -0
- package/dist/utils/live-tunnel.js.map +1 -0
- package/dist/utils/multimap.d.ts +6 -0
- package/dist/utils/multimap.d.ts.map +1 -0
- package/dist/utils/multimap.js +10 -0
- package/dist/utils/multimap.js.map +1 -0
- package/dist/utils/nodejs-compile-cache.d.ts +24 -0
- package/dist/utils/nodejs-compile-cache.d.ts.map +1 -0
- package/dist/utils/nodejs-compile-cache.js +44 -0
- package/dist/utils/nodejs-compile-cache.js.map +1 -0
- package/dist/utils/normalize-repo-url.d.ts +11 -0
- package/dist/utils/normalize-repo-url.d.ts.map +1 -0
- package/dist/utils/normalize-repo-url.js +24 -0
- package/dist/utils/normalize-repo-url.js.map +1 -0
- package/dist/utils/open-browser.d.ts +7 -0
- package/dist/utils/open-browser.d.ts.map +1 -0
- package/dist/utils/open-browser.js +33 -0
- package/dist/utils/open-browser.js.map +1 -0
- package/dist/utils/parse-raw-flags.d.ts +3 -0
- package/dist/utils/parse-raw-flags.d.ts.map +1 -0
- package/dist/utils/parse-raw-flags.js +51 -0
- package/dist/utils/parse-raw-flags.js.map +1 -0
- package/dist/utils/prompts/blob-delete-prompts.d.ts +2 -0
- package/dist/utils/prompts/blob-delete-prompts.d.ts.map +1 -0
- package/dist/utils/prompts/blob-delete-prompts.js +12 -0
- package/dist/utils/prompts/blob-delete-prompts.js.map +1 -0
- package/dist/utils/prompts/blob-set-prompt.d.ts +2 -0
- package/dist/utils/prompts/blob-set-prompt.d.ts.map +1 -0
- package/dist/utils/prompts/blob-set-prompt.js +12 -0
- package/dist/utils/prompts/blob-set-prompt.js.map +1 -0
- package/dist/utils/prompts/confirm-prompt.d.ts +2 -0
- package/dist/utils/prompts/confirm-prompt.d.ts.map +1 -0
- package/dist/utils/prompts/confirm-prompt.js +21 -0
- package/dist/utils/prompts/confirm-prompt.js.map +1 -0
- package/dist/utils/prompts/env-clone-prompt.d.ts +11 -0
- package/dist/utils/prompts/env-clone-prompt.d.ts.map +1 -0
- package/dist/utils/prompts/env-clone-prompt.js +28 -0
- package/dist/utils/prompts/env-clone-prompt.js.map +1 -0
- package/dist/utils/prompts/env-set-prompts.d.ts +2 -0
- package/dist/utils/prompts/env-set-prompts.d.ts.map +1 -0
- package/dist/utils/prompts/env-set-prompts.js +12 -0
- package/dist/utils/prompts/env-set-prompts.js.map +1 -0
- package/dist/utils/prompts/env-unset-prompts.d.ts +8 -0
- package/dist/utils/prompts/env-unset-prompts.d.ts.map +1 -0
- package/dist/utils/prompts/env-unset-prompts.js +18 -0
- package/dist/utils/prompts/env-unset-prompts.js.map +1 -0
- package/dist/utils/prompts/prompt-messages.d.ts +25 -0
- package/dist/utils/prompts/prompt-messages.d.ts.map +1 -0
- package/dist/utils/prompts/prompt-messages.js +26 -0
- package/dist/utils/prompts/prompt-messages.js.map +1 -0
- package/dist/utils/proxy-server.d.ts +47 -0
- package/dist/utils/proxy-server.d.ts.map +1 -0
- package/dist/utils/proxy-server.js +52 -0
- package/dist/utils/proxy-server.js.map +1 -0
- package/dist/utils/proxy.d.ts +21 -0
- package/dist/utils/proxy.d.ts.map +1 -0
- package/dist/utils/proxy.js +787 -0
- package/dist/utils/proxy.js.map +1 -0
- package/dist/utils/read-repo-url.d.ts +12 -0
- package/dist/utils/read-repo-url.d.ts.map +1 -0
- package/dist/utils/read-repo-url.js +53 -0
- package/dist/utils/read-repo-url.js.map +1 -0
- package/dist/utils/redirects.d.ts +6 -0
- package/dist/utils/redirects.d.ts.map +1 -0
- package/dist/utils/redirects.js +59 -0
- package/dist/utils/redirects.js.map +1 -0
- package/dist/utils/request-id.d.ts +2 -0
- package/dist/utils/request-id.d.ts.map +1 -0
- package/dist/utils/request-id.js +3 -0
- package/dist/utils/request-id.js.map +1 -0
- package/dist/utils/rules-proxy.d.ts +16 -0
- package/dist/utils/rules-proxy.d.ts.map +1 -0
- package/dist/utils/rules-proxy.js +87 -0
- package/dist/utils/rules-proxy.js.map +1 -0
- package/dist/utils/run-build.d.ts +58 -0
- package/dist/utils/run-build.d.ts.map +1 -0
- package/dist/utils/run-build.js +134 -0
- package/dist/utils/run-build.js.map +1 -0
- package/dist/utils/run-git.d.ts +2 -0
- package/dist/utils/run-git.d.ts.map +1 -0
- package/dist/utils/run-git.js +7 -0
- package/dist/utils/run-git.js.map +1 -0
- package/dist/utils/run-program.d.ts +3 -0
- package/dist/utils/run-program.d.ts.map +1 -0
- package/dist/utils/run-program.js +13 -0
- package/dist/utils/run-program.js.map +1 -0
- package/dist/utils/scripted-commands.d.ts +3 -0
- package/dist/utils/scripted-commands.d.ts.map +1 -0
- package/dist/utils/scripted-commands.js +18 -0
- package/dist/utils/scripted-commands.js.map +1 -0
- package/dist/utils/shell.d.ts +13 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +123 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sign-redirect.d.ts +7 -0
- package/dist/utils/sign-redirect.d.ts.map +1 -0
- package/dist/utils/sign-redirect.js +16 -0
- package/dist/utils/sign-redirect.js.map +1 -0
- package/dist/utils/static-server.d.ts +10 -0
- package/dist/utils/static-server.d.ts.map +1 -0
- package/dist/utils/static-server.js +36 -0
- package/dist/utils/static-server.js.map +1 -0
- package/dist/utils/telemetry/index.d.ts +3 -0
- package/dist/utils/telemetry/index.d.ts.map +1 -0
- package/dist/utils/telemetry/index.js +3 -0
- package/dist/utils/telemetry/index.js.map +1 -0
- package/dist/utils/telemetry/report-error.d.ts +10 -0
- package/dist/utils/telemetry/report-error.d.ts.map +1 -0
- package/dist/utils/telemetry/report-error.js +52 -0
- package/dist/utils/telemetry/report-error.js.map +1 -0
- package/dist/utils/telemetry/request.d.ts +2 -0
- package/dist/utils/telemetry/request.d.ts.map +1 -0
- package/dist/utils/telemetry/request.js +41 -0
- package/dist/utils/telemetry/request.js.map +1 -0
- package/dist/utils/telemetry/telemetry.d.ts +14 -0
- package/dist/utils/telemetry/telemetry.d.ts.map +1 -0
- package/dist/utils/telemetry/telemetry.js +94 -0
- package/dist/utils/telemetry/telemetry.js.map +1 -0
- package/dist/utils/telemetry/utils.d.ts +3 -0
- package/dist/utils/telemetry/utils.d.ts.map +1 -0
- package/dist/utils/telemetry/utils.js +7 -0
- package/dist/utils/telemetry/utils.js.map +1 -0
- package/dist/utils/telemetry/validation.d.ts +2 -0
- package/dist/utils/telemetry/validation.d.ts.map +1 -0
- package/dist/utils/telemetry/validation.js +63 -0
- package/dist/utils/telemetry/validation.js.map +1 -0
- package/dist/utils/temporary-file.d.ts +7 -0
- package/dist/utils/temporary-file.d.ts.map +1 -0
- package/dist/utils/temporary-file.js +16 -0
- package/dist/utils/temporary-file.js.map +1 -0
- package/dist/utils/types.d.ts +200 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.js.map +1 -0
- package/dist/utils/validation.d.ts +2 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +12 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/websockets/index.d.ts +3 -0
- package/dist/utils/websockets/index.d.ts.map +1 -0
- package/dist/utils/websockets/index.js +3 -0
- package/dist/utils/websockets/index.js.map +1 -0
- package/functions-templates/go/hello-world/.netlify-function-template.mjs +6 -0
- package/functions-templates/go/hello-world/go.mod +5 -0
- package/functions-templates/go/hello-world/go.sum +22 -0
- package/functions-templates/go/hello-world/main.go +24 -0
- package/functions-templates/javascript/hello/.netlify-function-template.mjs +5 -0
- package/functions-templates/javascript/hello/{{name}}.js +4 -0
- package/functions-templates/javascript/hello-world/.netlify-function-template.mjs +6 -0
- package/functions-templates/javascript/hello-world/{{name}}.mjs +13 -0
- package/functions-templates/javascript/image-external/.netlify-function-template.mjs +5 -0
- package/functions-templates/javascript/image-external/{{name}}.js +12 -0
- package/functions-templates/javascript/localized-content/.netlify-function-template.mjs +5 -0
- package/functions-templates/javascript/localized-content/{{name}}.js +15 -0
- package/functions-templates/javascript/scheduled-function/.netlify-function-template.mjs +6 -0
- package/functions-templates/javascript/scheduled-function/package.json +20 -0
- package/functions-templates/javascript/scheduled-function/{{name}}.mjs +11 -0
- package/functions-templates/javascript/set-cookies/.netlify-function-template.mjs +5 -0
- package/functions-templates/javascript/set-cookies/{{name}}.js +28 -0
- package/functions-templates/javascript/set-req-header/.netlify-function-template.mjs +5 -0
- package/functions-templates/javascript/set-req-header/{{name}}.js +3 -0
- package/functions-templates/javascript/set-res-header/.netlify-function-template.mjs +5 -0
- package/functions-templates/javascript/set-res-header/{{name}}.js +5 -0
- package/functions-templates/javascript/transform-response/.netlify-function-template.mjs +5 -0
- package/functions-templates/javascript/transform-response/{{name}}.js +12 -0
- package/functions-templates/rust/hello-world/.netlify-function-template.mjs +6 -0
- package/functions-templates/rust/hello-world/Cargo.lock +1149 -0
- package/functions-templates/rust/hello-world/Cargo.toml +14 -0
- package/functions-templates/rust/hello-world/src/main.rs +29 -0
- package/functions-templates/typescript/abtest/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/abtest/{{name}}.ts +31 -0
- package/functions-templates/typescript/geolocation/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/geolocation/{{name}}.ts +23 -0
- package/functions-templates/typescript/hello-world/.netlify-function-template.mjs +6 -0
- package/functions-templates/typescript/hello-world/package-lock.json +97 -0
- package/functions-templates/typescript/hello-world/package.json +21 -0
- package/functions-templates/typescript/hello-world/{{name}}.mts +14 -0
- package/functions-templates/typescript/json/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/json/{{name}}.ts +4 -0
- package/functions-templates/typescript/log/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/log/{{name}}.ts +9 -0
- package/functions-templates/typescript/scheduled-function/.netlify-function-template.mjs +6 -0
- package/functions-templates/typescript/scheduled-function/package.json +22 -0
- package/functions-templates/typescript/scheduled-function/{{name}}.mts +11 -0
- package/functions-templates/typescript/set-cookies/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/set-cookies/{{name}}.ts +29 -0
- package/functions-templates/typescript/set-req-header/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/set-req-header/{{name}}.ts +5 -0
- package/functions-templates/typescript/set-res-header/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/set-res-header/{{name}}.ts +7 -0
- package/functions-templates/typescript/transform-response/.netlify-function-template.mjs +5 -0
- package/functions-templates/typescript/transform-response/{{name}}.ts +13 -0
- package/npm-shrinkwrap.json +12641 -0
- package/package.json +274 -0
- package/scripts/bash.sh +15 -0
- package/scripts/fish.sh +8 -0
- package/scripts/netlifyPackage.js +68 -0
- package/scripts/path.ps1 +35 -0
- package/scripts/postinstall.js +82 -0
- package/scripts/prepublishOnly.js +29 -0
- package/scripts/zsh.sh +3 -0
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
import { existsSync } from 'fs';
|
|
2
|
+
import { join, relative, resolve } from 'path';
|
|
3
|
+
import process from 'process';
|
|
4
|
+
import { format } from 'util';
|
|
5
|
+
import { NetlifyAPI } from '@netlify/api';
|
|
6
|
+
import { DefaultLogger, Project } from '@netlify/build-info';
|
|
7
|
+
import { NodeFS, NoopLogger } from '@netlify/build-info/node';
|
|
8
|
+
import { resolveConfig } from '@netlify/config';
|
|
9
|
+
import { getGlobalConfigStore, LocalState } from '@netlify/dev-utils';
|
|
10
|
+
import { isCI } from 'ci-info';
|
|
11
|
+
import { Command, Option } from 'commander';
|
|
12
|
+
import debug from 'debug';
|
|
13
|
+
import { findUp } from 'find-up';
|
|
14
|
+
import inquirer from 'inquirer';
|
|
15
|
+
import inquirerAutocompletePrompt from 'inquirer-autocomplete-prompt';
|
|
16
|
+
import merge from 'lodash/merge.js';
|
|
17
|
+
import pick from 'lodash/pick.js';
|
|
18
|
+
import { getAgent } from '../lib/http-agent.js';
|
|
19
|
+
import { NETLIFY_CYAN, USER_AGENT, chalk, logAndThrowError, exit, getToken, log, version, normalizeConfig, padLeft, pollForToken, sortOptions, warn, logError, } from '../utils/command-helpers.js';
|
|
20
|
+
import { getFrameworksAPIPaths } from '../utils/frameworks-api.js';
|
|
21
|
+
import { getSiteByName } from '../utils/get-site.js';
|
|
22
|
+
import openBrowser from '../utils/open-browser.js';
|
|
23
|
+
import { identify, reportError, track } from '../utils/telemetry/index.js';
|
|
24
|
+
// load the autocomplete plugin
|
|
25
|
+
inquirer.registerPrompt('autocomplete', inquirerAutocompletePrompt);
|
|
26
|
+
/** Netlify CLI client id. Lives in bot@netlify.com */
|
|
27
|
+
// TODO: setup client for multiple environments
|
|
28
|
+
export const CLIENT_ID = 'd6f37de6614df7ae58664cfca524744d73807a377f5ee71f1a254f78412e3750';
|
|
29
|
+
const NANO_SECS_TO_MSECS = 1e6;
|
|
30
|
+
/** The fallback width for the help terminal */
|
|
31
|
+
const FALLBACK_HELP_CMD_WIDTH = 80;
|
|
32
|
+
const HELP_$ = NETLIFY_CYAN('$');
|
|
33
|
+
/** indent on commands or description on the help page */
|
|
34
|
+
const HELP_INDENT_WIDTH = 2;
|
|
35
|
+
/** separator width between term and description */
|
|
36
|
+
const HELP_SEPARATOR_WIDTH = 5;
|
|
37
|
+
/**
|
|
38
|
+
* A list of commands where we don't have to perform the workspace selection at.
|
|
39
|
+
* Those commands work with the system or are not writing any config files that need to be
|
|
40
|
+
* workspace aware.
|
|
41
|
+
*/
|
|
42
|
+
const COMMANDS_WITHOUT_WORKSPACE_OPTIONS = new Set(['api', 'recipes', 'completion', 'status', 'switch', 'login']);
|
|
43
|
+
/**
|
|
44
|
+
* A list of commands where we need to fetch featureflags for config resolution
|
|
45
|
+
*/
|
|
46
|
+
const COMMANDS_WITH_FEATURE_FLAGS = new Set(['build', 'dev', 'deploy']);
|
|
47
|
+
/**
|
|
48
|
+
* Names of options whose values should be scrubbed
|
|
49
|
+
*/
|
|
50
|
+
const SCRUBBED_OPTIONS = new Set(['auth']);
|
|
51
|
+
const getScrubbedOptions = (command) => Object.entries(command.optsWithGlobals()).reduce((acc, [key, value]) => ({
|
|
52
|
+
...acc,
|
|
53
|
+
[key]: {
|
|
54
|
+
source: command.getOptionValueSourceWithGlobals(key),
|
|
55
|
+
value: SCRUBBED_OPTIONS.has(key) ? '********' : value,
|
|
56
|
+
},
|
|
57
|
+
}), {});
|
|
58
|
+
/** Formats a help list correctly with the correct indent */
|
|
59
|
+
const formatHelpList = (textArray) => textArray.join('\n').replace(/^/gm, ' '.repeat(HELP_INDENT_WIDTH));
|
|
60
|
+
/** Get the duration between a start time and the current time */
|
|
61
|
+
const getDuration = (startTime) => {
|
|
62
|
+
const durationNs = process.hrtime.bigint() - startTime;
|
|
63
|
+
return Math.round(Number(durationNs / BigInt(NANO_SECS_TO_MSECS)));
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Retrieves a workspace package based of the filter flag that is provided.
|
|
67
|
+
* If the filter flag does not match a workspace package or is not defined then it will prompt with an autocomplete to select a package
|
|
68
|
+
*/
|
|
69
|
+
async function selectWorkspace(project, filter) {
|
|
70
|
+
// don't show prompt for workspace selection if there is only one package
|
|
71
|
+
if (project.workspace?.packages && project.workspace.packages.length === 1) {
|
|
72
|
+
return project.workspace.packages[0].path;
|
|
73
|
+
}
|
|
74
|
+
const selected = project.workspace?.packages.find((pkg) => {
|
|
75
|
+
if (project.relativeBaseDirectory &&
|
|
76
|
+
project.relativeBaseDirectory.length !== 0 &&
|
|
77
|
+
pkg.path.startsWith(project.relativeBaseDirectory)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return (pkg.name && pkg.name === filter) || pkg.path === filter;
|
|
81
|
+
});
|
|
82
|
+
if (!selected) {
|
|
83
|
+
log();
|
|
84
|
+
log(chalk.cyan(`We've detected multiple projects inside your repository`));
|
|
85
|
+
if (isCI) {
|
|
86
|
+
throw new Error(`Projects detected: ${(project.workspace?.packages || [])
|
|
87
|
+
.map((pkg) => pkg.name || pkg.path)
|
|
88
|
+
.join(', ')}. Configure the project you want to work with and try again. Refer to https://ntl.fyi/configure-site for more information.`);
|
|
89
|
+
}
|
|
90
|
+
const { result } = await inquirer.prompt({
|
|
91
|
+
name: 'result',
|
|
92
|
+
// @ts-expect-error(serhalp) -- I think this is because `inquirer-autocomplete-prompt` extends known
|
|
93
|
+
// `type`s but TS doesn't know about it
|
|
94
|
+
type: 'autocomplete',
|
|
95
|
+
message: 'Select the project you want to work with',
|
|
96
|
+
source: (_unused, input = '') => (project.workspace?.packages || [])
|
|
97
|
+
.filter((pkg) => pkg.path.includes(input))
|
|
98
|
+
.map((pkg) => ({
|
|
99
|
+
name: `${pkg.name ? `${chalk.bold(pkg.name)} ` : ''}${pkg.path} ${chalk.dim(`--filter ${pkg.name || pkg.path}`)}`,
|
|
100
|
+
value: pkg.path,
|
|
101
|
+
})),
|
|
102
|
+
});
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
return selected.path;
|
|
106
|
+
}
|
|
107
|
+
async function getRepositoryRoot(cwd) {
|
|
108
|
+
const res = await findUp('.git', { cwd, type: 'directory' });
|
|
109
|
+
if (res) {
|
|
110
|
+
return join(res, '..');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export function storeToken(globalConfig, { userId, name, email, accessToken }) {
|
|
114
|
+
const userData = merge(globalConfig.get(`users.${userId}`), {
|
|
115
|
+
id: userId,
|
|
116
|
+
name,
|
|
117
|
+
email,
|
|
118
|
+
auth: {
|
|
119
|
+
token: accessToken,
|
|
120
|
+
github: {
|
|
121
|
+
user: undefined,
|
|
122
|
+
token: undefined,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
globalConfig.set('userId', userId);
|
|
127
|
+
globalConfig.set(`users.${userId}`, userData);
|
|
128
|
+
}
|
|
129
|
+
/** Base command class that provides tracking and config initialization */
|
|
130
|
+
export default class BaseCommand extends Command {
|
|
131
|
+
/** The netlify object inside each command with the state */
|
|
132
|
+
netlify;
|
|
133
|
+
// TODO(serhalp) We set `startTime` here and then overwrite it in a `preAction` hook. This is
|
|
134
|
+
// just asking for latent bugs. Remove this one?
|
|
135
|
+
analytics = { startTime: process.hrtime.bigint() };
|
|
136
|
+
project;
|
|
137
|
+
/**
|
|
138
|
+
* The working directory that is used for reading the `netlify.toml` file and storing the state.
|
|
139
|
+
* In a monorepo context this must not be the process working directory and can be an absolute path to the
|
|
140
|
+
* Package/Site that should be worked in.
|
|
141
|
+
*/
|
|
142
|
+
// here we actually want to disable the lint rule as its value is set
|
|
143
|
+
// eslint-disable-next-line no-restricted-properties
|
|
144
|
+
workingDir = process.cwd();
|
|
145
|
+
/**
|
|
146
|
+
* The workspace root if inside a mono repository.
|
|
147
|
+
* Must not be the repository root!
|
|
148
|
+
*/
|
|
149
|
+
jsWorkspaceRoot;
|
|
150
|
+
/** The current workspace package we should execute the commands in */
|
|
151
|
+
workspacePackage;
|
|
152
|
+
featureFlags = {};
|
|
153
|
+
siteId;
|
|
154
|
+
accountId;
|
|
155
|
+
/**
|
|
156
|
+
* IMPORTANT this function will be called for each command!
|
|
157
|
+
* Don't do anything expensive in there.
|
|
158
|
+
*/
|
|
159
|
+
createCommand(name) {
|
|
160
|
+
const base = new BaseCommand(name)
|
|
161
|
+
// .addOption(new Option('--force', 'Force command to run. Bypasses prompts for certain destructive commands.'))
|
|
162
|
+
.addOption(new Option('--silent', 'Silence CLI output').hideHelp(true))
|
|
163
|
+
.addOption(new Option('--cwd <cwd>').hideHelp(true))
|
|
164
|
+
.addOption(new Option('--auth <token>', 'Netlify auth token - can be used to run this command without logging in'))
|
|
165
|
+
.addOption(new Option('--http-proxy [address]', 'Proxy server address to route requests through.')
|
|
166
|
+
.default(process.env.HTTP_PROXY || process.env.HTTPS_PROXY)
|
|
167
|
+
.hideHelp(true))
|
|
168
|
+
.addOption(new Option('--http-proxy-certificate-filename [file]', 'Certificate file to use when connecting using a proxy server')
|
|
169
|
+
.default(process.env.NETLIFY_PROXY_CERTIFICATE_FILENAME)
|
|
170
|
+
.hideHelp(true))
|
|
171
|
+
.option('--debug', 'Print debugging information');
|
|
172
|
+
// only add the `--filter` option to commands that are workspace aware
|
|
173
|
+
if (!COMMANDS_WITHOUT_WORKSPACE_OPTIONS.has(name)) {
|
|
174
|
+
base.option('--filter <app>', 'For monorepos, specify the name of the application to run the command in');
|
|
175
|
+
}
|
|
176
|
+
return base.hook('preAction', async (_parentCommand, actionCommand) => {
|
|
177
|
+
if (actionCommand.opts()?.debug) {
|
|
178
|
+
process.env.DEBUG = '*';
|
|
179
|
+
}
|
|
180
|
+
debug(`${name}:preAction`)('start');
|
|
181
|
+
this.analytics.startTime = process.hrtime.bigint();
|
|
182
|
+
await this.init(actionCommand);
|
|
183
|
+
debug(`${name}:preAction`)('end');
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
#noBaseOptions = false;
|
|
187
|
+
/** don't show help options on command overview (mostly used on top commands like `addons` where options only apply on children) */
|
|
188
|
+
noHelpOptions() {
|
|
189
|
+
this.#noBaseOptions = true;
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
192
|
+
/** The examples list for the command (used inside doc generation and help page) */
|
|
193
|
+
examples = [];
|
|
194
|
+
/** Set examples for the command */
|
|
195
|
+
addExamples(examples) {
|
|
196
|
+
this.examples = examples;
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
/** Overrides the help output of commander with custom styling */
|
|
200
|
+
createHelp() {
|
|
201
|
+
const help = super.createHelp();
|
|
202
|
+
help.commandUsage = (command) => {
|
|
203
|
+
const term = this.name() === 'netlify'
|
|
204
|
+
? `${HELP_$} ${command.name()} [COMMAND]`
|
|
205
|
+
: `${HELP_$} ${command.parent?.name()} ${command.name()} ${command.usage()}`;
|
|
206
|
+
return padLeft(term, HELP_INDENT_WIDTH);
|
|
207
|
+
};
|
|
208
|
+
const getCommands = (command) => {
|
|
209
|
+
const parentCommand = this.name() === 'netlify' ? command : command.parent;
|
|
210
|
+
return (parentCommand?.commands
|
|
211
|
+
.filter((cmd) => {
|
|
212
|
+
if (cmd._hidden)
|
|
213
|
+
return false;
|
|
214
|
+
// the root command
|
|
215
|
+
if (this.name() === 'netlify') {
|
|
216
|
+
// don't include subcommands on the main page
|
|
217
|
+
return !cmd.name().includes(':');
|
|
218
|
+
}
|
|
219
|
+
return cmd.name().startsWith(`${command.name()}:`);
|
|
220
|
+
})
|
|
221
|
+
.sort((a, b) => a.name().localeCompare(b.name())) || []);
|
|
222
|
+
};
|
|
223
|
+
help.longestSubcommandTermLength = (command) => getCommands(command).reduce((max, cmd) => Math.max(max, cmd.name().length), 0);
|
|
224
|
+
/** override the longestOptionTermLength to react on hide options flag */
|
|
225
|
+
help.longestOptionTermLength = (command, helper) =>
|
|
226
|
+
// @ts-expect-error TS(2551) FIXME: Property 'noBaseOptions' does not exist on type 'C... Remove this comment to see the full error message
|
|
227
|
+
(command.noBaseOptions === false &&
|
|
228
|
+
helper.visibleOptions(command).reduce((max, option) => Math.max(max, helper.optionTerm(option).length), 0)) ||
|
|
229
|
+
0;
|
|
230
|
+
help.formatHelp = (command, helper) => {
|
|
231
|
+
const parentCommand = this.name() === 'netlify' ? command : command.parent;
|
|
232
|
+
const termWidth = helper.padWidth(command, helper);
|
|
233
|
+
const helpWidth = helper.helpWidth || FALLBACK_HELP_CMD_WIDTH;
|
|
234
|
+
// formats a term correctly
|
|
235
|
+
const formatItem = (term, description, isCommand = false) => {
|
|
236
|
+
const bang = isCommand ? `${HELP_$} ` : '';
|
|
237
|
+
if (description) {
|
|
238
|
+
const pad = termWidth + HELP_SEPARATOR_WIDTH;
|
|
239
|
+
const fullText = `${bang}${term.padEnd(pad - (isCommand ? 2 : 0))}${chalk.grey(description)}`;
|
|
240
|
+
return helper.wrap(fullText, helpWidth - HELP_INDENT_WIDTH, pad);
|
|
241
|
+
}
|
|
242
|
+
return `${bang}${term}`;
|
|
243
|
+
};
|
|
244
|
+
let output = [];
|
|
245
|
+
// Description
|
|
246
|
+
const [topDescription, ...commandDescription] = (helper.commandDescription(command) || '').split('\n');
|
|
247
|
+
if (topDescription.length !== 0) {
|
|
248
|
+
output = [...output, topDescription, ''];
|
|
249
|
+
}
|
|
250
|
+
// on the parent help command the version should be displayed
|
|
251
|
+
if (this.name() === 'netlify') {
|
|
252
|
+
output = [...output, chalk.bold('VERSION'), formatHelpList([formatItem(USER_AGENT)]), ''];
|
|
253
|
+
}
|
|
254
|
+
// Usage
|
|
255
|
+
output = [...output, chalk.bold('USAGE'), helper.commandUsage(command), ''];
|
|
256
|
+
// Arguments
|
|
257
|
+
const argumentList = helper
|
|
258
|
+
.visibleArguments(command)
|
|
259
|
+
.map((argument) => formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument)));
|
|
260
|
+
if (argumentList.length !== 0) {
|
|
261
|
+
output = [...output, chalk.bold('ARGUMENTS'), formatHelpList(argumentList), ''];
|
|
262
|
+
}
|
|
263
|
+
if (command.#noBaseOptions === false) {
|
|
264
|
+
// Options
|
|
265
|
+
const optionList = helper
|
|
266
|
+
.visibleOptions(command)
|
|
267
|
+
.sort(sortOptions)
|
|
268
|
+
.map((option) => formatItem(helper.optionTerm(option), helper.optionDescription(option)));
|
|
269
|
+
if (optionList.length !== 0) {
|
|
270
|
+
output = [...output, chalk.bold('OPTIONS'), formatHelpList(optionList), ''];
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// Description
|
|
274
|
+
if (commandDescription.length !== 0) {
|
|
275
|
+
output = [...output, chalk.bold('DESCRIPTION'), formatHelpList(commandDescription), ''];
|
|
276
|
+
}
|
|
277
|
+
// Aliases
|
|
278
|
+
// @ts-expect-error TS(2551) FIXME: Property '_aliases' does not exist on type 'Comman... Remove this comment to see the full error message
|
|
279
|
+
if (command._aliases.length !== 0) {
|
|
280
|
+
// @ts-expect-error TS(2551) FIXME: Property '_aliases' does not exist on type 'Comman... Remove this comment to see the full error message
|
|
281
|
+
const aliases = command._aliases.map((alias) => formatItem(`${parentCommand.name()} ${alias}`, null, true));
|
|
282
|
+
output = [...output, chalk.bold('ALIASES'), formatHelpList(aliases), ''];
|
|
283
|
+
}
|
|
284
|
+
if (command.examples.length !== 0) {
|
|
285
|
+
output = [
|
|
286
|
+
...output,
|
|
287
|
+
chalk.bold('EXAMPLES'),
|
|
288
|
+
formatHelpList(command.examples.map((example) => `${HELP_$} ${example}`)),
|
|
289
|
+
'',
|
|
290
|
+
];
|
|
291
|
+
}
|
|
292
|
+
const commandList = getCommands(command).map((cmd) => formatItem(cmd.name(), helper.subcommandDescription(cmd).split('\n')[0], true));
|
|
293
|
+
if (commandList.length !== 0) {
|
|
294
|
+
output = [...output, chalk.bold('COMMANDS'), formatHelpList(commandList), ''];
|
|
295
|
+
}
|
|
296
|
+
return [...output, ''].join('\n');
|
|
297
|
+
};
|
|
298
|
+
return help;
|
|
299
|
+
}
|
|
300
|
+
/** Will be called on the end of an action to track the metrics */
|
|
301
|
+
async onEnd(error_) {
|
|
302
|
+
const { payload = {}, startTime } = this.analytics;
|
|
303
|
+
const duration = getDuration(startTime);
|
|
304
|
+
const status = error_ === undefined ? 'success' : 'error';
|
|
305
|
+
const command = Array.isArray(this.args) ? this.args[0] : this.name();
|
|
306
|
+
debug(`${this.name()}:onEnd`)(`Command: ${command}. Status: ${status}. Duration: ${duration}ms`);
|
|
307
|
+
try {
|
|
308
|
+
await track('command', {
|
|
309
|
+
...payload,
|
|
310
|
+
command,
|
|
311
|
+
duration,
|
|
312
|
+
status,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
catch (err) {
|
|
316
|
+
debug(`${this.name()}:onEnd`)(`Command: ${command}. Telemetry tracking failed: ${err instanceof Error ? err.message : err?.toString()}`);
|
|
317
|
+
}
|
|
318
|
+
if (error_ !== undefined) {
|
|
319
|
+
logError(error_ instanceof Error ? error_ : format(error_));
|
|
320
|
+
exit(1);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
async authenticate(tokenFromFlag) {
|
|
324
|
+
const [token] = await getToken(tokenFromFlag);
|
|
325
|
+
if (token) {
|
|
326
|
+
return token;
|
|
327
|
+
}
|
|
328
|
+
return this.expensivelyAuthenticate();
|
|
329
|
+
}
|
|
330
|
+
async expensivelyAuthenticate() {
|
|
331
|
+
const webUI = process.env.NETLIFY_WEB_UI || 'https://app.netlify.com';
|
|
332
|
+
log(`Logging into your Netlify account...`);
|
|
333
|
+
// Create ticket for auth
|
|
334
|
+
const ticket = await this.netlify.api.createTicket({
|
|
335
|
+
clientId: CLIENT_ID,
|
|
336
|
+
});
|
|
337
|
+
// Open browser for authentication
|
|
338
|
+
const authLink = `${webUI}/authorize?response_type=ticket&ticket=${ticket.id}`;
|
|
339
|
+
log(`Opening ${authLink}`);
|
|
340
|
+
await openBrowser({ url: authLink });
|
|
341
|
+
log();
|
|
342
|
+
log(`To request authorization from a human, run: ${chalk.cyanBright('netlify login --request "<msg>"')}`);
|
|
343
|
+
log();
|
|
344
|
+
const accessToken = await pollForToken({
|
|
345
|
+
api: this.netlify.api,
|
|
346
|
+
ticket,
|
|
347
|
+
});
|
|
348
|
+
const { email, full_name: name, id: userId } = await this.netlify.api.getCurrentUser();
|
|
349
|
+
if (!userId) {
|
|
350
|
+
return logAndThrowError('Could not retrieve user ID from Netlify API');
|
|
351
|
+
}
|
|
352
|
+
storeToken(this.netlify.globalConfig, { userId, name, email, accessToken });
|
|
353
|
+
await identify({
|
|
354
|
+
name,
|
|
355
|
+
email,
|
|
356
|
+
userId,
|
|
357
|
+
});
|
|
358
|
+
await track('user_login', {
|
|
359
|
+
email,
|
|
360
|
+
});
|
|
361
|
+
// Log success
|
|
362
|
+
log();
|
|
363
|
+
log(chalk.greenBright('You are now logged into your Netlify account!'));
|
|
364
|
+
log();
|
|
365
|
+
log(`Run ${chalk.cyanBright('netlify status')} for account details`);
|
|
366
|
+
log();
|
|
367
|
+
log(`To see all available commands run: ${chalk.cyanBright('netlify help')}`);
|
|
368
|
+
log();
|
|
369
|
+
return accessToken;
|
|
370
|
+
}
|
|
371
|
+
/** Adds some data to the analytics payload */
|
|
372
|
+
setAnalyticsPayload(payload) {
|
|
373
|
+
this.analytics = {
|
|
374
|
+
...this.analytics,
|
|
375
|
+
payload: { ...this.analytics.payload, ...payload },
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Initializes the options and parses the configuration needs to be called on start of a command function
|
|
380
|
+
*/
|
|
381
|
+
async init(actionCommand) {
|
|
382
|
+
debug(`${actionCommand.name()}:init`)('start');
|
|
383
|
+
const flags = actionCommand.opts();
|
|
384
|
+
// here we actually want to use the process.cwd as we are setting the workingDir
|
|
385
|
+
// eslint-disable-next-line no-restricted-properties
|
|
386
|
+
const processCwd = process.cwd();
|
|
387
|
+
if (flags.cwd) {
|
|
388
|
+
const resolvedCwd = resolve(flags.cwd);
|
|
389
|
+
this.workingDir = resolvedCwd;
|
|
390
|
+
// if cwd matches process.cwd, act like cwd wasn't provided
|
|
391
|
+
if (resolvedCwd === processCwd) {
|
|
392
|
+
delete flags.cwd;
|
|
393
|
+
this.workingDir = processCwd;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
// ==================================================
|
|
397
|
+
// Create a Project and run the Heuristics to detect
|
|
398
|
+
// if we are running inside a monorepo or not.
|
|
399
|
+
// ==================================================
|
|
400
|
+
// retrieve the repository root
|
|
401
|
+
const rootDir = await getRepositoryRoot();
|
|
402
|
+
// Get framework, add to analytics payload for every command, if a framework is set
|
|
403
|
+
const fs = new NodeFS();
|
|
404
|
+
// disable logging inside the project and FS if not in debug mode
|
|
405
|
+
fs.logger = actionCommand.opts()?.debug ? new DefaultLogger('debug') : new NoopLogger();
|
|
406
|
+
this.project = new Project(fs, this.workingDir, rootDir)
|
|
407
|
+
.setEnvironment(process.env)
|
|
408
|
+
.setNodeVersion(process.version)
|
|
409
|
+
.setReportFn((err, reportConfig) => {
|
|
410
|
+
reportError(err, {
|
|
411
|
+
severity: reportConfig?.severity || 'error',
|
|
412
|
+
metadata: reportConfig?.metadata,
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
const frameworks = await this.project.detectFrameworks();
|
|
416
|
+
let packageConfig = flags.config ? resolve(flags.config) : undefined;
|
|
417
|
+
// check if we have detected multiple projects inside which one we have to perform our operations.
|
|
418
|
+
// only ask to select one if on the workspace root and no --cwd was provided
|
|
419
|
+
if (!flags.cwd &&
|
|
420
|
+
!COMMANDS_WITHOUT_WORKSPACE_OPTIONS.has(actionCommand.name()) &&
|
|
421
|
+
this.project.workspace?.packages.length &&
|
|
422
|
+
this.project.workspace.isRoot) {
|
|
423
|
+
this.workspacePackage = await selectWorkspace(this.project, actionCommand.opts().filter);
|
|
424
|
+
this.workingDir = join(this.project.jsWorkspaceRoot, this.workspacePackage);
|
|
425
|
+
}
|
|
426
|
+
if (this.project.workspace?.packages.length && !this.project.workspace.isRoot) {
|
|
427
|
+
// set the package path even though we are not in the workspace root
|
|
428
|
+
// as the build command will set the process working directory to the workspace root
|
|
429
|
+
this.workspacePackage = this.project.relativeBaseDirectory;
|
|
430
|
+
}
|
|
431
|
+
this.jsWorkspaceRoot = this.project.jsWorkspaceRoot;
|
|
432
|
+
// detect if a toml exists in this package.
|
|
433
|
+
const tomlFile = join(this.workingDir, 'netlify.toml');
|
|
434
|
+
if (!packageConfig && existsSync(tomlFile)) {
|
|
435
|
+
packageConfig = tomlFile;
|
|
436
|
+
}
|
|
437
|
+
// ==================================================
|
|
438
|
+
// Retrieve Site id and build state from the state.json
|
|
439
|
+
// ==================================================
|
|
440
|
+
const state = new LocalState(this.workingDir);
|
|
441
|
+
const [token] = await getToken(flags.auth);
|
|
442
|
+
const apiUrlOpts = {
|
|
443
|
+
userAgent: USER_AGENT,
|
|
444
|
+
};
|
|
445
|
+
if (process.env.NETLIFY_API_URL) {
|
|
446
|
+
const apiUrl = new URL(process.env.NETLIFY_API_URL);
|
|
447
|
+
apiUrlOpts.scheme = apiUrl.protocol.slice(0, -1);
|
|
448
|
+
apiUrlOpts.host = apiUrl.host;
|
|
449
|
+
apiUrlOpts.pathPrefix =
|
|
450
|
+
process.env.NETLIFY_API_URL === `${apiUrl.protocol}//${apiUrl.host}` ? '/api/v1' : apiUrl.pathname;
|
|
451
|
+
}
|
|
452
|
+
const agent = await getAgent({
|
|
453
|
+
httpProxy: flags.httpProxy,
|
|
454
|
+
certificateFile: flags.httpProxyCertificateFilename,
|
|
455
|
+
});
|
|
456
|
+
const apiOpts = { ...apiUrlOpts, agent };
|
|
457
|
+
const api = new NetlifyAPI(token ?? '', apiOpts);
|
|
458
|
+
actionCommand.siteId = flags.siteId || (typeof flags.site === 'string' && flags.site) || state.get('siteId');
|
|
459
|
+
const needsFeatureFlagsToResolveConfig = COMMANDS_WITH_FEATURE_FLAGS.has(actionCommand.name());
|
|
460
|
+
if (api.accessToken && !flags.offline && needsFeatureFlagsToResolveConfig && actionCommand.siteId) {
|
|
461
|
+
try {
|
|
462
|
+
// FIXME(serhalp): Remove `any` and fix errors. API types exist now.
|
|
463
|
+
const site = await api.getSite({ siteId: actionCommand.siteId, feature_flags: 'cli' });
|
|
464
|
+
actionCommand.featureFlags = site.feature_flags;
|
|
465
|
+
actionCommand.accountId = site.account_id;
|
|
466
|
+
}
|
|
467
|
+
catch {
|
|
468
|
+
// if the site is not found, that could mean that the user passed a site name, not an ID
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
// ==================================================
|
|
472
|
+
// Start retrieving the configuration through the
|
|
473
|
+
// configuration file and the API
|
|
474
|
+
// ==================================================
|
|
475
|
+
const cachedConfig = await actionCommand.getConfig({
|
|
476
|
+
cwd: flags.cwd ? this.workingDir : this.jsWorkspaceRoot || this.workingDir,
|
|
477
|
+
repositoryRoot: rootDir,
|
|
478
|
+
packagePath: this.workspacePackage,
|
|
479
|
+
// The config flag needs to be resolved from the actual process working directory
|
|
480
|
+
configFilePath: packageConfig,
|
|
481
|
+
token,
|
|
482
|
+
...apiUrlOpts,
|
|
483
|
+
});
|
|
484
|
+
const { accounts = [], buildDir, config, configPath, repositoryRoot, siteInfo } = cachedConfig;
|
|
485
|
+
const env = cachedConfig?.env ?? {};
|
|
486
|
+
env.NETLIFY_CLI_VERSION = { sources: ['internal'], value: version };
|
|
487
|
+
const normalizedConfig = normalizeConfig(config);
|
|
488
|
+
// If a user passes a site name as an option instead of a site ID to options.site, the siteInfo object
|
|
489
|
+
// will only have the property siteInfo.id. Checking for one of the other properties ensures that we can do
|
|
490
|
+
// a re-call of the api.getSite() that is done in @netlify/config so we have the proper site object in all
|
|
491
|
+
// commands.
|
|
492
|
+
// options.site as a site name (and not just site id) was introduced for the deploy command, so users could
|
|
493
|
+
// deploy by name along with by id
|
|
494
|
+
let siteData = siteInfo;
|
|
495
|
+
if (!siteData.url && flags.site) {
|
|
496
|
+
const result = await getSiteByName(api, flags.site);
|
|
497
|
+
if (result == null) {
|
|
498
|
+
return logAndThrowError(`Project with name "${flags.site}" not found`);
|
|
499
|
+
}
|
|
500
|
+
siteData = result;
|
|
501
|
+
}
|
|
502
|
+
const globalConfig = await getGlobalConfigStore();
|
|
503
|
+
// ==================================================
|
|
504
|
+
// Perform analytics reporting
|
|
505
|
+
// ==================================================
|
|
506
|
+
const frameworkIDs = frameworks?.map((framework) => framework.id);
|
|
507
|
+
if (frameworkIDs?.length !== 0) {
|
|
508
|
+
this.setAnalyticsPayload({ frameworks: frameworkIDs });
|
|
509
|
+
}
|
|
510
|
+
this.setAnalyticsPayload({
|
|
511
|
+
monorepo: Boolean(this.project.workspace),
|
|
512
|
+
packageManager: this.project.packageManager?.name,
|
|
513
|
+
buildSystem: this.project.buildSystems.map(({ id }) => id),
|
|
514
|
+
opts: getScrubbedOptions(actionCommand),
|
|
515
|
+
args: actionCommand.args,
|
|
516
|
+
});
|
|
517
|
+
// set the project and the netlify api object on the command,
|
|
518
|
+
// to be accessible inside each command.
|
|
519
|
+
actionCommand.project = this.project;
|
|
520
|
+
actionCommand.workingDir = this.workingDir;
|
|
521
|
+
actionCommand.workspacePackage = this.workspacePackage;
|
|
522
|
+
actionCommand.jsWorkspaceRoot = this.jsWorkspaceRoot;
|
|
523
|
+
// Either an existing configuration file from `@netlify/config` or a file path
|
|
524
|
+
// that should be used for creating it.
|
|
525
|
+
const configFilePath = configPath || join(this.workingDir, 'netlify.toml');
|
|
526
|
+
actionCommand.netlify = {
|
|
527
|
+
accounts,
|
|
528
|
+
// api methods
|
|
529
|
+
api,
|
|
530
|
+
apiOpts,
|
|
531
|
+
// The absolute repository root (detected through @netlify/config)
|
|
532
|
+
repositoryRoot,
|
|
533
|
+
configFilePath,
|
|
534
|
+
relConfigFilePath: relative(repositoryRoot, configFilePath),
|
|
535
|
+
// current site context
|
|
536
|
+
site: {
|
|
537
|
+
root: buildDir,
|
|
538
|
+
configPath,
|
|
539
|
+
get id() {
|
|
540
|
+
return state.get('siteId');
|
|
541
|
+
},
|
|
542
|
+
set id(id) {
|
|
543
|
+
state.set('siteId', id);
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
// Site information retrieved using the API (api.getSite())
|
|
547
|
+
siteInfo: siteData,
|
|
548
|
+
// Configuration from netlify.[toml/yml]
|
|
549
|
+
config: normalizedConfig,
|
|
550
|
+
// Used to avoid calling @netlify/config again
|
|
551
|
+
cachedConfig: {
|
|
552
|
+
...cachedConfig,
|
|
553
|
+
env,
|
|
554
|
+
},
|
|
555
|
+
// global cli config
|
|
556
|
+
// TODO(serhalp): Rename to `globalConfigStore`
|
|
557
|
+
globalConfig,
|
|
558
|
+
// state of current site dir
|
|
559
|
+
// TODO(serhalp): Rename to `cliState`
|
|
560
|
+
state,
|
|
561
|
+
frameworksAPIPaths: getFrameworksAPIPaths(buildDir, this.workspacePackage),
|
|
562
|
+
};
|
|
563
|
+
debug(`${this.name()}:init`)('end');
|
|
564
|
+
}
|
|
565
|
+
/** Find and resolve the Netlify configuration */
|
|
566
|
+
async getConfig(opts) {
|
|
567
|
+
const { configFilePath, cwd, host, offline, packagePath, pathPrefix, repositoryRoot, scheme, token } = opts;
|
|
568
|
+
// the flags that are passed to the command like `--debug` or `--offline`
|
|
569
|
+
const flags = this.opts();
|
|
570
|
+
try {
|
|
571
|
+
// FIXME(serhalp): Type this in `netlify/build`! This is blocking a ton of proper types across the CLI.
|
|
572
|
+
return await resolveConfig({
|
|
573
|
+
accountId: this.accountId,
|
|
574
|
+
config: configFilePath,
|
|
575
|
+
packagePath: packagePath,
|
|
576
|
+
repositoryRoot: repositoryRoot,
|
|
577
|
+
cwd: cwd,
|
|
578
|
+
context: flags.context || process.env.CONTEXT || this.getDefaultContext(),
|
|
579
|
+
debug: flags.debug,
|
|
580
|
+
siteId: this.siteId,
|
|
581
|
+
token: token,
|
|
582
|
+
mode: 'cli',
|
|
583
|
+
host: host,
|
|
584
|
+
pathPrefix: pathPrefix,
|
|
585
|
+
scheme: scheme,
|
|
586
|
+
offline: offline ?? flags.offline,
|
|
587
|
+
siteFeatureFlagPrefix: 'cli',
|
|
588
|
+
featureFlags: this.featureFlags,
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
catch (error_) {
|
|
592
|
+
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
|
|
593
|
+
const isUserError = error_.customErrorInfo !== undefined && error_.customErrorInfo.type === 'resolveConfig';
|
|
594
|
+
// If we're failing due to an error thrown by us, it might be because the token we're using is invalid.
|
|
595
|
+
// To account for that, we try to retrieve the config again, this time without a token, to avoid making
|
|
596
|
+
// any API calls.
|
|
597
|
+
//
|
|
598
|
+
// @todo Replace this with a mechanism for calling `resolveConfig` with more granularity (i.e. having
|
|
599
|
+
// the option to say that we don't need API data.)
|
|
600
|
+
if (isUserError && !offline && token) {
|
|
601
|
+
if (flags.debug) {
|
|
602
|
+
logError(error_);
|
|
603
|
+
warn('Failed to resolve config, falling back to offline resolution');
|
|
604
|
+
}
|
|
605
|
+
// recursive call with trying to resolve offline
|
|
606
|
+
return this.getConfig({ ...opts, offline: true });
|
|
607
|
+
}
|
|
608
|
+
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
|
|
609
|
+
const message = isUserError ? error_.message : error_.stack;
|
|
610
|
+
return logAndThrowError(message);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* get a path inside the `.netlify` project folder resolving with the workspace package
|
|
615
|
+
*/
|
|
616
|
+
getPathInProject(...paths) {
|
|
617
|
+
return join(this.workspacePackage || '', '.netlify', ...paths);
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Returns the context that should be used in case one hasn't been explicitly
|
|
621
|
+
* set. The default context is `dev` most of the time, but some commands may
|
|
622
|
+
* wish to override that.
|
|
623
|
+
*/
|
|
624
|
+
getDefaultContext() {
|
|
625
|
+
return this.name() === 'serve' ? 'production' : 'dev';
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Retrieve feature flags for this site
|
|
629
|
+
*/
|
|
630
|
+
getFeatureFlag(flagName) {
|
|
631
|
+
// @ts-expect-error(serhalp) -- FIXME(serhalp): This probably isn't what we intend.
|
|
632
|
+
// We should return `false` feature flags as `false` and not `null`. Carefully fix.
|
|
633
|
+
return this.netlify.siteInfo.feature_flags?.[flagName] || null;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
export const getBaseOptionValues = (options) => pick(options, ['auth', 'cwd', 'debug', 'filter', 'httpProxy', 'silent', 'verbose']);
|
|
637
|
+
//# sourceMappingURL=base-command.js.map
|