@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,890 @@
|
|
|
1
|
+
import { stat } from 'fs/promises';
|
|
2
|
+
import { basename, resolve } from 'path';
|
|
3
|
+
import { stdin, stdout } from 'process';
|
|
4
|
+
import { runCoreSteps } from '@netlify/build';
|
|
5
|
+
import inquirer from 'inquirer';
|
|
6
|
+
import isEmpty from 'lodash/isEmpty.js';
|
|
7
|
+
import isObject from 'lodash/isObject.js';
|
|
8
|
+
import { parseAllHeaders } from '@netlify/headers-parser';
|
|
9
|
+
import { parseAllRedirects } from '@netlify/redirect-parser';
|
|
10
|
+
import prettyjson from 'prettyjson';
|
|
11
|
+
import { cancelDeploy } from '../../lib/api.js';
|
|
12
|
+
import { getRunBuildOptions, runBuild, } from '../../lib/build.js';
|
|
13
|
+
import { getBootstrapURL } from '../../lib/edge-functions/bootstrap.js';
|
|
14
|
+
import { featureFlags as edgeFunctionsFeatureFlags } from '../../lib/edge-functions/consts.js';
|
|
15
|
+
import { normalizeFunctionsConfig } from '../../lib/functions/config.js';
|
|
16
|
+
import { BACKGROUND_FUNCTIONS_WARNING } from '../../lib/log.js';
|
|
17
|
+
import { startSpinner, stopSpinner } from '../../lib/spinner.js';
|
|
18
|
+
import { detectFrameworkSettings, getDefaultConfig } from '../../utils/build-info.js';
|
|
19
|
+
import { NETLIFY_CYAN_HEX, NETLIFYDEVERR, NETLIFYDEVLOG, chalk, logAndThrowError, exit, getToken, log, logJson, warn, } from '../../utils/command-helpers.js';
|
|
20
|
+
import { DEFAULT_DEPLOY_TIMEOUT } from '../../utils/deploy/constants.js';
|
|
21
|
+
import { deploySite } from '../../utils/deploy/deploy-site.js';
|
|
22
|
+
import { uploadSourceZip } from '../../utils/deploy/upload-source-zip.js';
|
|
23
|
+
import { getEnvelopeEnv } from '../../utils/env/index.js';
|
|
24
|
+
import { getFunctionsManifestPath, getInternalFunctionsDir } from '../../utils/functions/index.js';
|
|
25
|
+
import openBrowser from '../../utils/open-browser.js';
|
|
26
|
+
import { link } from '../link/link.js';
|
|
27
|
+
import { sitesCreate } from '../sites/sites-create.js';
|
|
28
|
+
import boxen from 'boxen';
|
|
29
|
+
import terminalLink from 'terminal-link';
|
|
30
|
+
import { anyEdgeFunctionsDirectoryExists } from '../../lib/edge-functions/get-directories.js';
|
|
31
|
+
const triggerDeploy = async ({ api, options, siteData, siteId, }) => {
|
|
32
|
+
try {
|
|
33
|
+
const siteBuild = await api.createSiteBuild({ siteId });
|
|
34
|
+
if (options.json) {
|
|
35
|
+
logJson({
|
|
36
|
+
site_id: siteId,
|
|
37
|
+
site_name: siteData.name,
|
|
38
|
+
deploy_id: `${siteBuild.deploy_id}`,
|
|
39
|
+
logs: `https://app.netlify.com/projects/${siteData.name}/deploys/${siteBuild.deploy_id}`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
log(`${NETLIFYDEVLOG} A new deployment was triggered successfully. Visit https://app.netlify.com/projects/${siteData.name}/deploys/${siteBuild.deploy_id} to see the logs.`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error_) {
|
|
47
|
+
if (error_.status === 404) {
|
|
48
|
+
return logAndThrowError('Project not found. Please rerun "netlify link" and make sure that your project has CI configured.');
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return logAndThrowError(error_.message);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/** Retrieves the folder containing the static files that need to be deployed */
|
|
56
|
+
const getDeployFolder = async ({ command, config, options, site, siteData, }) => {
|
|
57
|
+
let deployFolder;
|
|
58
|
+
// if the `--dir .` flag is provided we should resolve it to the working directory.
|
|
59
|
+
// - in regular sites this is the `process.cwd`
|
|
60
|
+
// - in mono repositories this will be the root of the jsWorkspace
|
|
61
|
+
if (options.dir) {
|
|
62
|
+
deployFolder = command.workspacePackage
|
|
63
|
+
? resolve(command.jsWorkspaceRoot || site.root, options.dir)
|
|
64
|
+
: resolve(command.workingDir, options.dir);
|
|
65
|
+
}
|
|
66
|
+
else if (config?.build?.publish) {
|
|
67
|
+
deployFolder = resolve(site.root, config.build.publish);
|
|
68
|
+
}
|
|
69
|
+
else if (siteData?.build_settings?.dir) {
|
|
70
|
+
deployFolder = resolve(site.root, siteData.build_settings.dir);
|
|
71
|
+
}
|
|
72
|
+
if (!deployFolder) {
|
|
73
|
+
if (!stdin.isTTY || !stdout.isTTY) {
|
|
74
|
+
// non interactive - can't get the value, resolve to the cwd
|
|
75
|
+
if (command.workspacePackage) {
|
|
76
|
+
return command.jsWorkspaceRoot || site.root;
|
|
77
|
+
}
|
|
78
|
+
return command.workingDir;
|
|
79
|
+
}
|
|
80
|
+
log('Please provide a publish directory (e.g. "public" or "dist" or "."):');
|
|
81
|
+
// Generate copy-pasteable command with current options
|
|
82
|
+
const copyableCommand = generateDeployCommand({ ...options, dir: '<PATH>' }, [], command);
|
|
83
|
+
log(`\nTo specify directory non-interactively, use: ${copyableCommand}\n`);
|
|
84
|
+
const { promptPath } = await inquirer.prompt([
|
|
85
|
+
{
|
|
86
|
+
type: 'input',
|
|
87
|
+
name: 'promptPath',
|
|
88
|
+
message: 'Publish directory',
|
|
89
|
+
default: '.',
|
|
90
|
+
filter: (input) => resolve(command.workingDir, input),
|
|
91
|
+
},
|
|
92
|
+
]);
|
|
93
|
+
deployFolder = promptPath;
|
|
94
|
+
}
|
|
95
|
+
return deployFolder;
|
|
96
|
+
};
|
|
97
|
+
const validateDeployFolder = async (deployFolder) => {
|
|
98
|
+
let stats;
|
|
99
|
+
try {
|
|
100
|
+
stats = await stat(deployFolder);
|
|
101
|
+
}
|
|
102
|
+
catch (error_) {
|
|
103
|
+
if (error_ && typeof error_ === 'object' && 'code' in error_) {
|
|
104
|
+
if (error_.code === 'ENOENT') {
|
|
105
|
+
return logAndThrowError(`The deploy directory "${deployFolder}" has not been found. Did you forget to run 'netlify build'?`);
|
|
106
|
+
}
|
|
107
|
+
// Improve the message of permission errors
|
|
108
|
+
if (error_.code === 'EACCES') {
|
|
109
|
+
return logAndThrowError('Permission error when trying to access deploy folder');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
throw error_;
|
|
113
|
+
}
|
|
114
|
+
if (!stats.isDirectory()) {
|
|
115
|
+
return logAndThrowError('Deploy target must be a path to a directory');
|
|
116
|
+
}
|
|
117
|
+
return stats;
|
|
118
|
+
};
|
|
119
|
+
/** get the functions directory */
|
|
120
|
+
const getFunctionsFolder = ({ config, options, site, siteData, workingDir, }) => {
|
|
121
|
+
let functionsFolder;
|
|
122
|
+
// Support "functions" and "Functions"
|
|
123
|
+
const funcConfig = config.functionsDirectory;
|
|
124
|
+
if (options.functions) {
|
|
125
|
+
functionsFolder = resolve(workingDir, options.functions);
|
|
126
|
+
}
|
|
127
|
+
else if (funcConfig) {
|
|
128
|
+
functionsFolder = resolve(site.root, funcConfig);
|
|
129
|
+
}
|
|
130
|
+
else if (siteData?.build_settings?.functions_dir) {
|
|
131
|
+
functionsFolder = resolve(site.root, siteData.build_settings.functions_dir);
|
|
132
|
+
}
|
|
133
|
+
return functionsFolder;
|
|
134
|
+
};
|
|
135
|
+
const validateFunctionsFolder = async (functionsFolder) => {
|
|
136
|
+
let stats;
|
|
137
|
+
if (functionsFolder) {
|
|
138
|
+
// we used to hard error if functions folder is specified but doesn't exist
|
|
139
|
+
// but this was too strict for onboarding. we can just log a warning.
|
|
140
|
+
try {
|
|
141
|
+
stats = await stat(functionsFolder);
|
|
142
|
+
}
|
|
143
|
+
catch (error_) {
|
|
144
|
+
if (error_ && typeof error_ === 'object' && 'code' in error_) {
|
|
145
|
+
if (error_.code === 'ENOENT') {
|
|
146
|
+
log(`Functions folder "${functionsFolder}" specified but it doesn't exist! Will proceed without deploying functions`);
|
|
147
|
+
}
|
|
148
|
+
// Improve the message of permission errors
|
|
149
|
+
if (error_.code === 'EACCES') {
|
|
150
|
+
return logAndThrowError('Permission error when trying to access functions folder');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (stats && !stats.isDirectory()) {
|
|
156
|
+
return logAndThrowError('Functions folder must be a path to a directory');
|
|
157
|
+
}
|
|
158
|
+
return stats;
|
|
159
|
+
};
|
|
160
|
+
const validateFolders = async ({ deployFolder, functionsFolder, }) => {
|
|
161
|
+
const deployFolderStat = await validateDeployFolder(deployFolder);
|
|
162
|
+
const functionsFolderStat = await validateFunctionsFolder(functionsFolder);
|
|
163
|
+
return { deployFolderStat, functionsFolderStat };
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @param {object} config
|
|
167
|
+
* @param {string} config.deployFolder
|
|
168
|
+
* @param {*} config.site
|
|
169
|
+
* @returns
|
|
170
|
+
*/
|
|
171
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'deployFolder' implicitly has an '... Remove this comment to see the full error message
|
|
172
|
+
const getDeployFilesFilter = ({ deployFolder, site }) => {
|
|
173
|
+
// site.root === deployFolder can happen when users run `netlify deploy --dir .`
|
|
174
|
+
// in that specific case we don't want to publish the repo node_modules
|
|
175
|
+
// when site.root !== deployFolder the behaviour matches our buildbot
|
|
176
|
+
const skipNodeModules = site.root === deployFolder;
|
|
177
|
+
return (filename) => {
|
|
178
|
+
if (filename == null) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (filename === deployFolder) {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
const base = basename(filename);
|
|
185
|
+
const skipFile = (skipNodeModules && base === 'node_modules') ||
|
|
186
|
+
(base.startsWith('.') && base !== '.well-known') ||
|
|
187
|
+
base.startsWith('__MACOSX') ||
|
|
188
|
+
base.includes('/.') ||
|
|
189
|
+
// headers and redirects are bundled in the config
|
|
190
|
+
base === '_redirects' ||
|
|
191
|
+
base === '_headers';
|
|
192
|
+
return !skipFile;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
const SEC_TO_MILLISEC = 1e3;
|
|
196
|
+
// 100 bytes
|
|
197
|
+
const SYNC_FILE_LIMIT = 1e2;
|
|
198
|
+
// Helper function to generate copy-pasteable deploy command
|
|
199
|
+
const generateDeployCommand = (options, availableTeams, command) => {
|
|
200
|
+
const parts = ['netlify deploy'];
|
|
201
|
+
// Handle site selection/creation first
|
|
202
|
+
if (options.createSite) {
|
|
203
|
+
const siteName = typeof options.createSite === 'string' ? options.createSite : '<SITE_NAME>';
|
|
204
|
+
parts.push(`--create-site ${siteName}`);
|
|
205
|
+
if (availableTeams.length > 1) {
|
|
206
|
+
parts.push('--team <TEAM_SLUG>');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else if (options.site) {
|
|
210
|
+
parts.push(`--site ${options.site}`);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
parts.push('--create-site <SITE_NAME>');
|
|
214
|
+
if (availableTeams.length > 1) {
|
|
215
|
+
parts.push('--team <TEAM_SLUG>');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (command?.options) {
|
|
219
|
+
for (const option of command.options) {
|
|
220
|
+
if (['createSite', 'site', 'team'].includes(option.attributeName())) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
const optionName = option.attributeName();
|
|
224
|
+
const value = options[optionName];
|
|
225
|
+
if (option.long?.startsWith('--no-')) {
|
|
226
|
+
if (value === false) {
|
|
227
|
+
parts.push(option.long);
|
|
228
|
+
}
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
if (optionName === 'build') {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (value && option.long) {
|
|
235
|
+
const flag = option.long;
|
|
236
|
+
const hasValue = option.required || option.optional;
|
|
237
|
+
if (hasValue && typeof value === 'string') {
|
|
238
|
+
const quotedValue = optionName === 'message' ? `"${value}"` : value;
|
|
239
|
+
parts.push(`${flag} ${quotedValue}`);
|
|
240
|
+
}
|
|
241
|
+
else if (hasValue && typeof value === 'number') {
|
|
242
|
+
parts.push(`${flag} ${value}`);
|
|
243
|
+
}
|
|
244
|
+
else if (!hasValue && value === true) {
|
|
245
|
+
parts.push(flag);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return parts.join(' ');
|
|
251
|
+
};
|
|
252
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'api' implicitly has an 'any' type... Remove this comment to see the full error message
|
|
253
|
+
const prepareProductionDeploy = async ({ api, siteData, options, command }) => {
|
|
254
|
+
if (isObject(siteData.published_deploy) && siteData.published_deploy.locked) {
|
|
255
|
+
log(`\n${NETLIFYDEVERR} Deployments are "locked" for production context of this project\n`);
|
|
256
|
+
// Generate copy-pasteable command with current options
|
|
257
|
+
const overrideCommand = generateDeployCommand({ ...options, prodIfUnlocked: true, prod: false }, [], command);
|
|
258
|
+
log('\nTo override deployment lock (USE WITH CAUTION), use:');
|
|
259
|
+
log(` ${overrideCommand}`);
|
|
260
|
+
log('\nWarning: Only use --prod-if-unlocked if you are absolutely sure you want to override the deployment lock.\n');
|
|
261
|
+
const { unlockChoice } = await inquirer.prompt([
|
|
262
|
+
{
|
|
263
|
+
type: 'confirm',
|
|
264
|
+
name: 'unlockChoice',
|
|
265
|
+
message: 'Would you like to "unlock" deployments for production context to proceed?',
|
|
266
|
+
default: false,
|
|
267
|
+
},
|
|
268
|
+
]);
|
|
269
|
+
if (!unlockChoice)
|
|
270
|
+
exit(0);
|
|
271
|
+
await api.unlockDeploy({ deploy_id: siteData.published_deploy.id });
|
|
272
|
+
log(`\n${NETLIFYDEVLOG} "Auto publishing" has been enabled for production context\n`);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
const hasErrorMessage = (actual, expected) => {
|
|
276
|
+
if (typeof actual === 'string') {
|
|
277
|
+
return actual.includes(expected);
|
|
278
|
+
}
|
|
279
|
+
return false;
|
|
280
|
+
};
|
|
281
|
+
const reportDeployError = ({ error, failAndExit, }) => {
|
|
282
|
+
switch (true) {
|
|
283
|
+
case error.name === 'JSONHTTPError': {
|
|
284
|
+
const message = error.json?.message ?? '';
|
|
285
|
+
if (hasErrorMessage(message, 'Background Functions not allowed by team plan')) {
|
|
286
|
+
return failAndExit(`\n${BACKGROUND_FUNCTIONS_WARNING}`);
|
|
287
|
+
}
|
|
288
|
+
warn(`JSONHTTPError: ${message} ${error.status}`);
|
|
289
|
+
warn(`\n${JSON.stringify(error, null, ' ')}\n`);
|
|
290
|
+
return failAndExit(error);
|
|
291
|
+
}
|
|
292
|
+
case error.name === 'TextHTTPError': {
|
|
293
|
+
warn(`TextHTTPError: ${error.status}`);
|
|
294
|
+
warn(`\n${error}\n`);
|
|
295
|
+
return failAndExit(error);
|
|
296
|
+
}
|
|
297
|
+
case hasErrorMessage(error.message, 'Invalid filename'): {
|
|
298
|
+
warn(error.message);
|
|
299
|
+
return failAndExit(error);
|
|
300
|
+
}
|
|
301
|
+
default: {
|
|
302
|
+
warn(`\n${JSON.stringify(error, null, ' ')}\n`);
|
|
303
|
+
return failAndExit(error);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
const deployProgressCb = function () {
|
|
308
|
+
const spinnersByType = {};
|
|
309
|
+
return (event) => {
|
|
310
|
+
switch (event.phase) {
|
|
311
|
+
case 'start': {
|
|
312
|
+
spinnersByType[event.type] = startSpinner({
|
|
313
|
+
text: event.msg,
|
|
314
|
+
});
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
case 'progress': {
|
|
318
|
+
const spinner = spinnersByType[event.type];
|
|
319
|
+
if (spinner) {
|
|
320
|
+
spinner.update({ text: event.msg });
|
|
321
|
+
}
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
case 'error':
|
|
325
|
+
stopSpinner({ error: true, spinner: spinnersByType[event.type], text: event.msg });
|
|
326
|
+
delete spinnersByType[event.type];
|
|
327
|
+
return;
|
|
328
|
+
case 'stop':
|
|
329
|
+
default: {
|
|
330
|
+
spinnersByType[event.type].success(event.msg);
|
|
331
|
+
delete spinnersByType[event.type];
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
const uploadDeployBlobs = async ({ cachedConfig, deployId, options, packagePath, silent, siteId, }) => {
|
|
337
|
+
const statusCb = silent ? () => { } : deployProgressCb();
|
|
338
|
+
statusCb({
|
|
339
|
+
type: 'blobs-uploading',
|
|
340
|
+
msg: 'Uploading blobs to deploy store...\n',
|
|
341
|
+
phase: 'start',
|
|
342
|
+
});
|
|
343
|
+
const [token] = await getToken();
|
|
344
|
+
const blobsToken = token || undefined;
|
|
345
|
+
const { success } = await runCoreSteps(['blobs_upload'], {
|
|
346
|
+
...options,
|
|
347
|
+
// We log our own progress so we don't want this as well. Plus, this logs much of the same
|
|
348
|
+
// information as the build that (likely) came before this as part of the deploy build.
|
|
349
|
+
quiet: options.debug ?? true,
|
|
350
|
+
// @ts-expect-error(serhalp) -- Untyped in `@netlify/build`
|
|
351
|
+
cachedConfig,
|
|
352
|
+
packagePath,
|
|
353
|
+
deployId,
|
|
354
|
+
siteId,
|
|
355
|
+
token: blobsToken,
|
|
356
|
+
});
|
|
357
|
+
if (!success) {
|
|
358
|
+
statusCb({
|
|
359
|
+
type: 'blobs-uploading',
|
|
360
|
+
msg: 'Deploy aborted due to error while uploading blobs to deploy store',
|
|
361
|
+
phase: 'error',
|
|
362
|
+
});
|
|
363
|
+
return logAndThrowError('Error while uploading blobs to deploy store');
|
|
364
|
+
}
|
|
365
|
+
statusCb({
|
|
366
|
+
type: 'blobs-uploading',
|
|
367
|
+
msg: 'Finished uploading blobs to deploy store',
|
|
368
|
+
phase: 'stop',
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
const runDeploy = async ({
|
|
372
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'alias' implicitly has an 'any' ty... Remove this comment to see the full error message
|
|
373
|
+
alias,
|
|
374
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'api' implicitly has an 'any' type... Remove this comment to see the full error message
|
|
375
|
+
api, command,
|
|
376
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'config' implicitly has an 'any' t... Remove this comment to see the full error message
|
|
377
|
+
config,
|
|
378
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'deployFolder' implicitly has an '... Remove this comment to see the full error message
|
|
379
|
+
deployFolder,
|
|
380
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'deployTimeout' implicitly has an ... Remove this comment to see the full error message
|
|
381
|
+
deployTimeout,
|
|
382
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'deployToProduction' implicitly ha... Remove this comment to see the full error message
|
|
383
|
+
deployToProduction,
|
|
384
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'functionsConfig' implicitly has a... Remove this comment to see the full error message
|
|
385
|
+
functionsConfig, functionsFolder,
|
|
386
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'options' implicitly has an 'a... Remove this comment to see the full error message
|
|
387
|
+
options,
|
|
388
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'packagePath' implicitly has an 'a... Remove this comment to see the full error message
|
|
389
|
+
packagePath,
|
|
390
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'silent' implicitly has an 'any' t... Remove this comment to see the full error message
|
|
391
|
+
silent,
|
|
392
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'site' implicitly has an 'any' typ... Remove this comment to see the full error message
|
|
393
|
+
site,
|
|
394
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'siteData' implicitly has an 'any'... Remove this comment to see the full error message
|
|
395
|
+
siteData,
|
|
396
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'siteId' implicitly has an 'any' t... Remove this comment to see the full error message
|
|
397
|
+
siteId,
|
|
398
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'skipFunctionsCache' implicitly ha... Remove this comment to see the full error message
|
|
399
|
+
skipFunctionsCache,
|
|
400
|
+
// @ts-expect-error TS(7031) FIXME: Binding element 'title' implicitly has an 'any' ty... Remove this comment to see the full error message
|
|
401
|
+
title, deployId: existingDeployId, }) => {
|
|
402
|
+
let results;
|
|
403
|
+
let deployId = existingDeployId;
|
|
404
|
+
let uploadSourceZipResult;
|
|
405
|
+
try {
|
|
406
|
+
// We won't have a deploy ID if we run the command with `--no-build`.
|
|
407
|
+
// In this case, we must create the deploy.
|
|
408
|
+
if (!deployId) {
|
|
409
|
+
if (deployToProduction) {
|
|
410
|
+
await prepareProductionDeploy({ siteData, api, options, command });
|
|
411
|
+
}
|
|
412
|
+
const draft = options.draft || (!deployToProduction && !alias);
|
|
413
|
+
const createDeployBody = { draft, branch: alias, include_upload_url: options.uploadSourceZip };
|
|
414
|
+
const createDeployResponse = await api.createSiteDeploy({ siteId, title, body: createDeployBody });
|
|
415
|
+
deployId = createDeployResponse.id;
|
|
416
|
+
if (options.uploadSourceZip &&
|
|
417
|
+
createDeployResponse.source_zip_upload_url &&
|
|
418
|
+
createDeployResponse.source_zip_filename) {
|
|
419
|
+
uploadSourceZipResult = await uploadSourceZip({
|
|
420
|
+
sourceDir: site.root,
|
|
421
|
+
uploadUrl: createDeployResponse.source_zip_upload_url,
|
|
422
|
+
filename: createDeployResponse.source_zip_filename,
|
|
423
|
+
statusCb: silent ? () => { } : deployProgressCb(),
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
const internalFunctionsFolder = await getInternalFunctionsDir({ base: site.root, packagePath, ensureExists: true });
|
|
428
|
+
await command.netlify.frameworksAPIPaths.functions.ensureExists();
|
|
429
|
+
// The order of the directories matter: zip-it-and-ship-it will prioritize
|
|
430
|
+
// functions from the rightmost directories. In this case, we want user
|
|
431
|
+
// functions to take precedence over internal functions.
|
|
432
|
+
const functionDirectories = [
|
|
433
|
+
internalFunctionsFolder,
|
|
434
|
+
command.netlify.frameworksAPIPaths.functions.path,
|
|
435
|
+
functionsFolder,
|
|
436
|
+
].filter((folder) => Boolean(folder));
|
|
437
|
+
const manifestPath = skipFunctionsCache ? null : await getFunctionsManifestPath({ base: site.root, packagePath });
|
|
438
|
+
const redirectsPath = `${deployFolder}/_redirects`;
|
|
439
|
+
const headersPath = `${deployFolder}/_headers`;
|
|
440
|
+
const { redirects } = await parseAllRedirects({
|
|
441
|
+
configRedirects: config.redirects,
|
|
442
|
+
redirectsFiles: [redirectsPath],
|
|
443
|
+
minimal: true,
|
|
444
|
+
});
|
|
445
|
+
config.redirects = redirects;
|
|
446
|
+
const { headers } = await parseAllHeaders({
|
|
447
|
+
configHeaders: config.headers,
|
|
448
|
+
headersFiles: [headersPath],
|
|
449
|
+
minimal: true,
|
|
450
|
+
});
|
|
451
|
+
config.headers = headers;
|
|
452
|
+
await uploadDeployBlobs({
|
|
453
|
+
deployId,
|
|
454
|
+
siteId,
|
|
455
|
+
silent,
|
|
456
|
+
options,
|
|
457
|
+
cachedConfig: command.netlify.cachedConfig,
|
|
458
|
+
packagePath: command.workspacePackage,
|
|
459
|
+
});
|
|
460
|
+
results = await deploySite(command, api, siteId, deployFolder, {
|
|
461
|
+
// @ts-expect-error FIXME
|
|
462
|
+
config,
|
|
463
|
+
fnDir: functionDirectories,
|
|
464
|
+
functionsConfig,
|
|
465
|
+
statusCb: silent ? () => { } : deployProgressCb(),
|
|
466
|
+
deployTimeout,
|
|
467
|
+
syncFileLimit: SYNC_FILE_LIMIT,
|
|
468
|
+
// pass an existing deployId to update
|
|
469
|
+
deployId,
|
|
470
|
+
filter: getDeployFilesFilter({ site, deployFolder }),
|
|
471
|
+
workingDir: command.workingDir,
|
|
472
|
+
manifestPath,
|
|
473
|
+
skipFunctionsCache,
|
|
474
|
+
siteRoot: site.root,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
catch (error) {
|
|
478
|
+
if (deployId) {
|
|
479
|
+
await cancelDeploy({ api, deployId });
|
|
480
|
+
}
|
|
481
|
+
return reportDeployError({ error: error, failAndExit: logAndThrowError });
|
|
482
|
+
}
|
|
483
|
+
const siteUrl = results.deploy.ssl_url || results.deploy.url;
|
|
484
|
+
const deployUrl = results.deploy.deploy_ssl_url || results.deploy.deploy_url;
|
|
485
|
+
const logsUrl = `${results.deploy.admin_url}/deploys/${results.deploy.id}`;
|
|
486
|
+
let functionLogsUrl = `${results.deploy.admin_url}/logs/functions`;
|
|
487
|
+
let edgeFunctionLogsUrl = `${results.deploy.admin_url}/logs/edge-functions`;
|
|
488
|
+
if (!deployToProduction) {
|
|
489
|
+
functionLogsUrl += `?scope=deploy:${deployId}`;
|
|
490
|
+
edgeFunctionLogsUrl += `?scope=deployid:${deployId}`;
|
|
491
|
+
}
|
|
492
|
+
return {
|
|
493
|
+
siteId: results.deploy.site_id,
|
|
494
|
+
siteName: results.deploy.name,
|
|
495
|
+
deployId: results.deployId,
|
|
496
|
+
siteUrl,
|
|
497
|
+
deployUrl,
|
|
498
|
+
logsUrl,
|
|
499
|
+
functionLogsUrl,
|
|
500
|
+
edgeFunctionLogsUrl,
|
|
501
|
+
sourceZipFileName: uploadSourceZipResult?.sourceZipFileName,
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
const handleBuild = async ({ cachedConfig, currentDir, defaultConfig, deployHandler, deployId, options, packagePath, skewProtectionToken, }) => {
|
|
505
|
+
if (!options.build) {
|
|
506
|
+
return {};
|
|
507
|
+
}
|
|
508
|
+
const [token] = await getToken();
|
|
509
|
+
const resolvedOptions = await getRunBuildOptions({
|
|
510
|
+
cachedConfig,
|
|
511
|
+
currentDir,
|
|
512
|
+
defaultConfig,
|
|
513
|
+
deployHandler,
|
|
514
|
+
deployId,
|
|
515
|
+
options,
|
|
516
|
+
packagePath,
|
|
517
|
+
skewProtectionToken,
|
|
518
|
+
token,
|
|
519
|
+
});
|
|
520
|
+
const { configMutations, exitCode, newConfig, logs } = await runBuild(resolvedOptions);
|
|
521
|
+
// Without this, the deploy command fails silently
|
|
522
|
+
if (exitCode !== 0) {
|
|
523
|
+
let message = '';
|
|
524
|
+
if (options.verbose && logs?.stdout.length) {
|
|
525
|
+
message += `\n\n${logs.stdout.join('')}\n\n`;
|
|
526
|
+
}
|
|
527
|
+
if (logs?.stderr.length) {
|
|
528
|
+
message += logs.stderr.join('');
|
|
529
|
+
}
|
|
530
|
+
logAndThrowError(`Error while running build${message}`);
|
|
531
|
+
}
|
|
532
|
+
return { newConfig, configMutations };
|
|
533
|
+
};
|
|
534
|
+
const bundleEdgeFunctions = async (options, command) => {
|
|
535
|
+
const argv = process.argv.slice(2);
|
|
536
|
+
const statusCb = options.silent || argv.includes('--json') || argv.includes('--silent') ? () => { } : deployProgressCb();
|
|
537
|
+
statusCb({
|
|
538
|
+
type: 'edge-functions-bundling',
|
|
539
|
+
msg: 'Bundling edge functions...\n',
|
|
540
|
+
phase: 'start',
|
|
541
|
+
});
|
|
542
|
+
const { severityCode, success } = await runCoreSteps(['edge_functions_bundling'], {
|
|
543
|
+
...options,
|
|
544
|
+
packagePath: command.workspacePackage,
|
|
545
|
+
buffer: true,
|
|
546
|
+
featureFlags: edgeFunctionsFeatureFlags,
|
|
547
|
+
// We log our own progress so we don't want this as well. Plus, this logs much of the same
|
|
548
|
+
// information as the build that (likely) came before this as part of the deploy build.
|
|
549
|
+
quiet: options.debug ?? true,
|
|
550
|
+
// (cachedConfig type error hides this one, but it still is valid) @ts-expect-error FIXME(serhalp): This is missing from the `runCoreSteps` type in @netlify/build
|
|
551
|
+
edgeFunctionsBootstrapURL: await getBootstrapURL(),
|
|
552
|
+
// @ts-expect-error 'CachedConfig' is not assignable to type 'Record<string, unknown>'.
|
|
553
|
+
// Index signature for type 'string' is missing in type 'CachedConfig'.
|
|
554
|
+
cachedConfig: command.netlify.cachedConfig,
|
|
555
|
+
});
|
|
556
|
+
if (!success) {
|
|
557
|
+
statusCb({
|
|
558
|
+
type: 'edge-functions-bundling',
|
|
559
|
+
msg: 'Deploy aborted due to error while bundling edge functions',
|
|
560
|
+
phase: 'error',
|
|
561
|
+
});
|
|
562
|
+
exit(severityCode);
|
|
563
|
+
}
|
|
564
|
+
statusCb({
|
|
565
|
+
type: 'edge-functions-bundling',
|
|
566
|
+
msg: 'Finished bundling edge functions',
|
|
567
|
+
phase: 'stop',
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
const printResults = ({ deployToProduction, uploadSourceZip, json, results, runBuildCommand, }) => {
|
|
571
|
+
const msgData = {
|
|
572
|
+
'Build logs': terminalLink(results.logsUrl, results.logsUrl, { fallback: false }),
|
|
573
|
+
'Function logs': terminalLink(results.functionLogsUrl, results.functionLogsUrl, { fallback: false }),
|
|
574
|
+
'Edge function Logs': terminalLink(results.edgeFunctionLogsUrl, results.edgeFunctionLogsUrl, { fallback: false }),
|
|
575
|
+
};
|
|
576
|
+
log('');
|
|
577
|
+
// Note: this is leakily mimicking the @netlify/build heading style
|
|
578
|
+
log(chalk.cyanBright.bold(`🚀 Deploy complete\n${'─'.repeat(64)}`));
|
|
579
|
+
// Json response for piping commands
|
|
580
|
+
if (json) {
|
|
581
|
+
const jsonData = {
|
|
582
|
+
site_id: results.siteId,
|
|
583
|
+
site_name: results.siteName,
|
|
584
|
+
deploy_id: results.deployId,
|
|
585
|
+
deploy_url: results.deployUrl,
|
|
586
|
+
logs: results.logsUrl,
|
|
587
|
+
function_logs: results.functionLogsUrl,
|
|
588
|
+
edge_function_logs: results.edgeFunctionLogsUrl,
|
|
589
|
+
};
|
|
590
|
+
if (deployToProduction) {
|
|
591
|
+
jsonData.url = results.siteUrl;
|
|
592
|
+
}
|
|
593
|
+
if (uploadSourceZip) {
|
|
594
|
+
jsonData.source_zip_filename = results.sourceZipFileName;
|
|
595
|
+
}
|
|
596
|
+
logJson(jsonData);
|
|
597
|
+
exit(0);
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
const message = deployToProduction
|
|
601
|
+
? `Deployed to production URL: ${terminalLink(results.siteUrl, results.siteUrl, { fallback: false })}\n
|
|
602
|
+
Unique deploy URL: ${terminalLink(results.deployUrl, results.deployUrl, { fallback: false })}`
|
|
603
|
+
: `Deployed draft to ${terminalLink(results.deployUrl, results.deployUrl, { fallback: false })}`;
|
|
604
|
+
log(boxen(message, {
|
|
605
|
+
padding: 1,
|
|
606
|
+
margin: 1,
|
|
607
|
+
textAlignment: 'center',
|
|
608
|
+
borderStyle: 'round',
|
|
609
|
+
borderColor: NETLIFY_CYAN_HEX,
|
|
610
|
+
// This is an intentional half-width space to work around a unicode padding math bug in boxen
|
|
611
|
+
// eslint-disable-next-line no-irregular-whitespace
|
|
612
|
+
title: `⬥ ${deployToProduction ? 'Production deploy' : 'Draft deploy'} is live ⬥ `,
|
|
613
|
+
titleAlignment: 'center',
|
|
614
|
+
}));
|
|
615
|
+
log(prettyjson.render(msgData));
|
|
616
|
+
if (!deployToProduction) {
|
|
617
|
+
log();
|
|
618
|
+
log('If everything looks good on your draft URL, deploy it to your main project URL with the --prod flag:');
|
|
619
|
+
log(chalk.cyanBright.bold(`netlify deploy${runBuildCommand ? '' : ' --no-build'} --prod`));
|
|
620
|
+
log();
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
const prepAndRunDeploy = async ({ api, command, config, deployToProduction, options, site, siteData, siteId, workingDir, deployId, }) => {
|
|
625
|
+
const alias = options.alias || options.branch;
|
|
626
|
+
// if a context is passed besides dev, we need to pull env vars from that specific context
|
|
627
|
+
if (options.context && options.context !== 'dev') {
|
|
628
|
+
command.netlify.cachedConfig.env = await getEnvelopeEnv({
|
|
629
|
+
api,
|
|
630
|
+
context: options.context,
|
|
631
|
+
env: command.netlify.cachedConfig.env,
|
|
632
|
+
siteInfo: siteData,
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
const deployFolder = await getDeployFolder({ command, options, config, site, siteData });
|
|
636
|
+
const functionsFolder = getFunctionsFolder({ workingDir, options, config, site, siteData });
|
|
637
|
+
const { configPath } = site;
|
|
638
|
+
// build flag wasn't used and edge functions directories exist
|
|
639
|
+
if (!options.build && (await anyEdgeFunctionsDirectoryExists(command))) {
|
|
640
|
+
// for the case of directories existing but not containing any edge functions,
|
|
641
|
+
// there is early bail in edge functions bundling after scanning for edge functions
|
|
642
|
+
// for this case and to avoid replicating scanning logic here, we defer to the bundling step
|
|
643
|
+
await bundleEdgeFunctions(options, command);
|
|
644
|
+
}
|
|
645
|
+
log('');
|
|
646
|
+
// Note: this is leakily mimicking the @netlify/build heading style
|
|
647
|
+
log(chalk.cyanBright.bold(`Deploying to Netlify\n${'─'.repeat(64)}`));
|
|
648
|
+
log('');
|
|
649
|
+
log(prettyjson.render({
|
|
650
|
+
'Deploy path': deployFolder,
|
|
651
|
+
'Functions path': functionsFolder,
|
|
652
|
+
'Configuration path': configPath,
|
|
653
|
+
}));
|
|
654
|
+
log();
|
|
655
|
+
const { functionsFolderStat } = await validateFolders({
|
|
656
|
+
deployFolder,
|
|
657
|
+
functionsFolder,
|
|
658
|
+
});
|
|
659
|
+
const siteEnv = await getEnvelopeEnv({
|
|
660
|
+
api,
|
|
661
|
+
context: options.context,
|
|
662
|
+
env: command.netlify.cachedConfig.env,
|
|
663
|
+
raw: true,
|
|
664
|
+
scope: 'functions',
|
|
665
|
+
siteInfo: siteData,
|
|
666
|
+
});
|
|
667
|
+
const functionsConfig = normalizeFunctionsConfig({
|
|
668
|
+
functionsConfig: config.functions,
|
|
669
|
+
projectRoot: site.root,
|
|
670
|
+
siteEnv,
|
|
671
|
+
});
|
|
672
|
+
const results = await runDeploy({
|
|
673
|
+
// @ts-expect-error FIXME
|
|
674
|
+
alias,
|
|
675
|
+
api,
|
|
676
|
+
command,
|
|
677
|
+
config,
|
|
678
|
+
deployFolder,
|
|
679
|
+
deployTimeout: options.timeout ? options.timeout * SEC_TO_MILLISEC : DEFAULT_DEPLOY_TIMEOUT,
|
|
680
|
+
deployToProduction,
|
|
681
|
+
functionsConfig,
|
|
682
|
+
// pass undefined functionsFolder if doesn't exist
|
|
683
|
+
functionsFolder: functionsFolderStat && functionsFolder,
|
|
684
|
+
options,
|
|
685
|
+
packagePath: command.workspacePackage,
|
|
686
|
+
silent: options.json || options.silent,
|
|
687
|
+
site,
|
|
688
|
+
siteData,
|
|
689
|
+
siteId,
|
|
690
|
+
skipFunctionsCache: options.skipFunctionsCache,
|
|
691
|
+
title: options.message,
|
|
692
|
+
deployId,
|
|
693
|
+
});
|
|
694
|
+
return results;
|
|
695
|
+
};
|
|
696
|
+
const validateTeamForSiteCreation = (accounts, options, siteName) => {
|
|
697
|
+
if (accounts.length === 0) {
|
|
698
|
+
return logAndThrowError('No teams available. Please ensure you have access to at least one team.');
|
|
699
|
+
}
|
|
700
|
+
if (accounts.length === 1) {
|
|
701
|
+
options.team = accounts[0].slug;
|
|
702
|
+
const message = siteName ? `Creating new site: ${siteName}` : 'Creating new site with random name';
|
|
703
|
+
log(`${message} (using team: ${accounts[0].name})`);
|
|
704
|
+
return;
|
|
705
|
+
}
|
|
706
|
+
const availableTeams = accounts.map((team) => team.slug).join(', ');
|
|
707
|
+
return logAndThrowError(`Multiple teams available. Please specify which team to use with --team flag.\n` +
|
|
708
|
+
`Available teams: ${availableTeams}\n\n` +
|
|
709
|
+
`Example: netlify deploy --create-site${siteName ? ` ${siteName}` : ''} --team <TEAM_SLUG>`);
|
|
710
|
+
};
|
|
711
|
+
const createSiteWithFlags = async (options, command, site) => {
|
|
712
|
+
const { accounts } = command.netlify;
|
|
713
|
+
const siteName = typeof options.createSite === 'string' ? options.createSite : undefined;
|
|
714
|
+
if (!options.team) {
|
|
715
|
+
validateTeamForSiteCreation(accounts, options, siteName);
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
const message = siteName ? `Creating new site: ${siteName}` : 'Creating new site with random name';
|
|
719
|
+
log(message);
|
|
720
|
+
}
|
|
721
|
+
// Create site directly via API to bypass interactive prompts
|
|
722
|
+
const { api } = command.netlify;
|
|
723
|
+
const body = {};
|
|
724
|
+
if (siteName) {
|
|
725
|
+
body.name = siteName.trim();
|
|
726
|
+
}
|
|
727
|
+
if (!options.team) {
|
|
728
|
+
throw new Error('Team must be specified to create a site');
|
|
729
|
+
}
|
|
730
|
+
try {
|
|
731
|
+
const siteData = await api.createSiteInTeam({
|
|
732
|
+
accountSlug: options.team,
|
|
733
|
+
body,
|
|
734
|
+
});
|
|
735
|
+
site.id = siteData.id;
|
|
736
|
+
return siteData;
|
|
737
|
+
}
|
|
738
|
+
catch (error_) {
|
|
739
|
+
if (error_.status === 422) {
|
|
740
|
+
return logAndThrowError(siteName
|
|
741
|
+
? `Site name "${siteName}" is already taken. Please try a different name.`
|
|
742
|
+
: 'Unable to create site with a random name. Please try again or specify a different name.');
|
|
743
|
+
}
|
|
744
|
+
return logAndThrowError(`Failed to create site: ${error_.status}: ${error_.message}`);
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
const promptForSiteAction = async (options, command, site) => {
|
|
748
|
+
log("This folder isn't linked to a project yet");
|
|
749
|
+
const { accounts } = command.netlify;
|
|
750
|
+
const availableTeams = accounts.map((acc) => ({ name: acc.name, slug: acc.slug }));
|
|
751
|
+
const copyableCommand = generateDeployCommand(options, availableTeams, command);
|
|
752
|
+
log(`\nTo create and deploy in one go, use: ${copyableCommand}`);
|
|
753
|
+
if (availableTeams.length > 1) {
|
|
754
|
+
log(`\nYou must pick a --team: ${availableTeams.map((team) => team.slug).join(', ')}`);
|
|
755
|
+
}
|
|
756
|
+
const { initChoice } = await inquirer.prompt([
|
|
757
|
+
{
|
|
758
|
+
type: 'list',
|
|
759
|
+
name: 'initChoice',
|
|
760
|
+
message: 'What would you like to do?',
|
|
761
|
+
choices: [
|
|
762
|
+
{
|
|
763
|
+
name: '⇄ Link this directory to an existing project',
|
|
764
|
+
value: 'link',
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: '+ Create & configure a new project',
|
|
768
|
+
value: 'create',
|
|
769
|
+
},
|
|
770
|
+
],
|
|
771
|
+
},
|
|
772
|
+
]);
|
|
773
|
+
const siteData = initChoice === 'create' ? await sitesCreate({}, command) : await link({}, command);
|
|
774
|
+
site.id = siteData.id;
|
|
775
|
+
return siteData;
|
|
776
|
+
};
|
|
777
|
+
const ensureSiteExists = async (options, command, site, siteInfo) => {
|
|
778
|
+
const hasSiteData = (site.id || options.site) && !isEmpty(siteInfo);
|
|
779
|
+
if (hasSiteData) {
|
|
780
|
+
return siteInfo;
|
|
781
|
+
}
|
|
782
|
+
if (options.createSite) {
|
|
783
|
+
return createSiteWithFlags(options, command, site);
|
|
784
|
+
}
|
|
785
|
+
return promptForSiteAction(options, command, site);
|
|
786
|
+
};
|
|
787
|
+
export const deploy = async (options, command) => {
|
|
788
|
+
const { workingDir } = command;
|
|
789
|
+
const { api, site, siteInfo } = command.netlify;
|
|
790
|
+
const alias = options.alias || options.branch;
|
|
791
|
+
command.setAnalyticsPayload({ open: options.open, prod: options.prod, json: options.json, alias: Boolean(alias) });
|
|
792
|
+
await command.authenticate(options.auth);
|
|
793
|
+
const siteData = await ensureSiteExists(options, command, site, siteInfo);
|
|
794
|
+
const siteId = siteData.id;
|
|
795
|
+
if (options.trigger) {
|
|
796
|
+
return triggerDeploy({ api, options, siteData, siteId });
|
|
797
|
+
}
|
|
798
|
+
const deployToProduction = !options.draft && (options.prod || (options.prodIfUnlocked && !(siteData.published_deploy?.locked ?? false)));
|
|
799
|
+
let results = {};
|
|
800
|
+
if (options.build) {
|
|
801
|
+
if (deployToProduction) {
|
|
802
|
+
await prepareProductionDeploy({ siteData, api, options, command });
|
|
803
|
+
}
|
|
804
|
+
const draft = options.draft || (!deployToProduction && !alias);
|
|
805
|
+
const createDeployBody = { draft, branch: alias, include_upload_url: options.uploadSourceZip };
|
|
806
|
+
// TODO: Type this properly in `@netlify/api`.
|
|
807
|
+
const deployMetadata = (await api.createSiteDeploy({
|
|
808
|
+
siteId,
|
|
809
|
+
title: options.message,
|
|
810
|
+
body: createDeployBody,
|
|
811
|
+
}));
|
|
812
|
+
const deployId = deployMetadata.id || '';
|
|
813
|
+
const skewProtectionToken = deployMetadata.skew_protection_token;
|
|
814
|
+
let sourceZipFileName;
|
|
815
|
+
if (options.uploadSourceZip &&
|
|
816
|
+
deployMetadata.source_zip_upload_url &&
|
|
817
|
+
deployMetadata.source_zip_filename &&
|
|
818
|
+
site.root) {
|
|
819
|
+
await uploadSourceZip({
|
|
820
|
+
sourceDir: site.root,
|
|
821
|
+
uploadUrl: deployMetadata.source_zip_upload_url,
|
|
822
|
+
filename: deployMetadata.source_zip_filename,
|
|
823
|
+
statusCb: options.json || options.silent ? () => { } : deployProgressCb(),
|
|
824
|
+
});
|
|
825
|
+
sourceZipFileName = deployMetadata.source_zip_filename;
|
|
826
|
+
}
|
|
827
|
+
try {
|
|
828
|
+
const settings = await detectFrameworkSettings(command, 'build');
|
|
829
|
+
await handleBuild({
|
|
830
|
+
packagePath: command.workspacePackage,
|
|
831
|
+
cachedConfig: command.netlify.cachedConfig,
|
|
832
|
+
defaultConfig: getDefaultConfig(settings),
|
|
833
|
+
currentDir: command.workingDir,
|
|
834
|
+
options,
|
|
835
|
+
deployHandler: async ({ netlifyConfig }) => {
|
|
836
|
+
results = await prepAndRunDeploy({
|
|
837
|
+
command,
|
|
838
|
+
options,
|
|
839
|
+
workingDir,
|
|
840
|
+
api,
|
|
841
|
+
site,
|
|
842
|
+
config: netlifyConfig,
|
|
843
|
+
siteData,
|
|
844
|
+
siteId,
|
|
845
|
+
deployToProduction,
|
|
846
|
+
deployId,
|
|
847
|
+
});
|
|
848
|
+
return {};
|
|
849
|
+
},
|
|
850
|
+
deployId,
|
|
851
|
+
skewProtectionToken,
|
|
852
|
+
});
|
|
853
|
+
// Ensure source zip filename is included in results for JSON output
|
|
854
|
+
if (sourceZipFileName) {
|
|
855
|
+
results.sourceZipFileName = sourceZipFileName;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
catch (error) {
|
|
859
|
+
// The build has failed, so let's cancel the deploy we created.
|
|
860
|
+
await cancelDeploy({ api, deployId });
|
|
861
|
+
throw error;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
else {
|
|
865
|
+
results = await prepAndRunDeploy({
|
|
866
|
+
command,
|
|
867
|
+
options,
|
|
868
|
+
workingDir,
|
|
869
|
+
api,
|
|
870
|
+
site,
|
|
871
|
+
config: command.netlify.config,
|
|
872
|
+
siteData,
|
|
873
|
+
siteId,
|
|
874
|
+
deployToProduction,
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
printResults({
|
|
878
|
+
runBuildCommand: options.build,
|
|
879
|
+
json: options.json,
|
|
880
|
+
results,
|
|
881
|
+
deployToProduction,
|
|
882
|
+
uploadSourceZip: !!options.uploadSourceZip,
|
|
883
|
+
});
|
|
884
|
+
if (options.open) {
|
|
885
|
+
const urlToOpen = deployToProduction ? results.siteUrl : results.deployUrl;
|
|
886
|
+
await openBrowser({ url: urlToOpen });
|
|
887
|
+
exit();
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
//# sourceMappingURL=deploy.js.map
|