netlify-cli 17.6.0 → 17.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{run.mjs → run.js} +3 -3
- package/npm-shrinkwrap.json +4 -4
- package/package.json +8 -9
- package/scripts/{postinstall.mjs → postinstall.js} +3 -4
- package/src/commands/addons/addons-auth.js +22 -0
- package/src/commands/addons/{addons-config.mjs → addons-config.js} +9 -34
- package/src/commands/addons/{addons-create.mjs → addons-create.js} +7 -33
- package/src/commands/addons/addons-delete.js +33 -0
- package/src/commands/addons/{addons-list.mjs → addons-list.js} +3 -25
- package/src/commands/addons/addons.js +68 -0
- package/src/commands/addons/index.js +1 -0
- package/src/commands/api/{api.mjs → api.js} +2 -24
- package/src/commands/api/index.js +13 -0
- package/src/commands/{base-command.mjs → base-command.js} +7 -7
- package/src/commands/blobs/blobs-delete.js +20 -0
- package/src/commands/blobs/{blobs-get.mjs → blobs-get.js} +2 -15
- package/src/commands/blobs/{blobs-list.mjs → blobs-list.js} +2 -16
- package/src/commands/blobs/{blobs-set.mjs → blobs-set.js} +2 -17
- package/src/commands/blobs/blobs.js +74 -0
- package/src/commands/blobs/index.js +1 -0
- package/src/commands/build/{build.mjs → build.js} +7 -28
- package/src/commands/build/index.js +13 -0
- package/src/commands/completion/completion.js +29 -0
- package/src/commands/completion/index.js +26 -0
- package/src/commands/deploy/{deploy.mjs → deploy.js} +17 -133
- package/src/commands/deploy/index.js +106 -0
- package/src/commands/dev/{dev-exec.mjs → dev-exec.js} +3 -15
- package/src/commands/dev/{dev.mjs → dev.js} +19 -38
- package/src/commands/dev/index.js +1 -0
- package/src/commands/env/{env-clone.mjs → env-clone.js} +71 -94
- package/src/commands/env/env-get.js +34 -0
- package/src/commands/env/{env-import.mjs → env-import.js} +38 -65
- package/src/commands/env/{env-list.mjs → env-list.js} +3 -37
- package/src/commands/env/{env-set.mjs → env-set.js} +36 -81
- package/src/commands/env/{env-unset.mjs → env-unset.js} +30 -62
- package/src/commands/env/env.js +127 -0
- package/src/commands/env/index.js +1 -0
- package/src/commands/functions/{functions-build.mjs → functions-build.js} +3 -22
- package/src/commands/functions/{functions-create.mjs → functions-create.js} +20 -47
- package/src/commands/functions/{functions-invoke.mjs → functions-invoke.js} +3 -41
- package/src/commands/functions/{functions-list.mjs → functions-list.js} +3 -27
- package/src/commands/functions/{functions-serve.mjs → functions-serve.js} +6 -28
- package/src/commands/functions/functions.js +98 -0
- package/src/commands/functions/index.js +1 -0
- package/src/commands/index.js +2 -0
- package/src/commands/init/index.js +12 -0
- package/src/commands/init/{init.mjs → init.js} +10 -31
- package/src/commands/integration/{deploy.mjs → deploy.js} +7 -28
- package/src/commands/integration/index.js +26 -0
- package/src/commands/link/index.js +13 -0
- package/src/commands/link/{link.mjs → link.js} +6 -28
- package/src/commands/lm/index.js +1 -0
- package/src/commands/lm/{lm-info.mjs → lm-info.js} +2 -9
- package/src/commands/lm/lm-install.js +8 -0
- package/src/commands/lm/{lm-setup.mjs → lm-setup.js} +6 -25
- package/src/commands/lm/lm-uninstall.js +7 -0
- package/src/commands/lm/lm.js +46 -0
- package/src/commands/login/index.js +9 -0
- package/src/commands/login/{login.mjs → login.js} +1 -19
- package/src/commands/logout/index.js +7 -0
- package/src/commands/logout/{logout.mjs → logout.js} +3 -16
- package/src/commands/logs/{build.mjs → build.js} +3 -8
- package/src/commands/logs/{functions.mjs → functions.js} +4 -27
- package/src/commands/logs/index.js +39 -0
- package/src/commands/logs/log-levels.js +11 -0
- package/src/commands/{main.mjs → main.js} +32 -32
- package/src/commands/open/index.js +31 -0
- package/src/commands/open/open-admin.js +11 -0
- package/src/commands/open/open-site.js +12 -0
- package/src/commands/open/open.js +13 -0
- package/src/commands/recipes/{common.mjs → common.js} +2 -2
- package/src/commands/recipes/index.js +20 -0
- package/src/commands/recipes/recipes-list.js +14 -0
- package/src/commands/recipes/{recipes.mjs → recipes.js} +8 -32
- package/src/commands/serve/index.js +27 -0
- package/src/commands/serve/{serve.mjs → serve.js} +14 -51
- package/src/commands/sites/index.js +1 -0
- package/src/commands/sites/{sites-create-template.mjs → sites-create-template.js} +9 -38
- package/src/commands/sites/{sites-create.mjs → sites-create.js} +5 -38
- package/src/commands/sites/{sites-delete.mjs → sites-delete.js} +2 -22
- package/src/commands/sites/{sites-list.mjs → sites-list.js} +4 -24
- package/src/commands/sites/sites.js +77 -0
- package/src/commands/status/index.js +19 -0
- package/src/commands/status/{status-hooks.mjs → status-hooks.js} +2 -20
- package/src/commands/status/{status.mjs → status.js} +2 -23
- package/src/commands/switch/index.js +7 -0
- package/src/commands/switch/{switch.mjs → switch.js} +3 -16
- package/src/commands/unlink/index.js +7 -0
- package/src/commands/unlink/unlink.js +21 -0
- package/src/commands/watch/index.js +8 -0
- package/src/commands/watch/{watch.mjs → watch.js} +4 -21
- package/src/lib/{api.mjs → api.js} +1 -1
- package/src/lib/blobs/{blobs.mjs → blobs.js} +2 -2
- package/src/lib/{build.mjs → build.js} +3 -3
- package/src/lib/completion/{constants.mjs → constants.js} +1 -1
- package/src/lib/completion/{generate-autocompletion.mjs → generate-autocompletion.js} +3 -3
- package/src/lib/completion/{index.mjs → index.js} +1 -1
- package/src/lib/completion/{script.mjs → script.js} +3 -3
- package/src/lib/edge-functions/{deploy.mjs → deploy.js} +2 -2
- package/src/lib/edge-functions/{editor-helper.mjs → editor-helper.js} +1 -1
- package/src/lib/edge-functions/{internal.mjs → internal.js} +2 -2
- package/src/lib/edge-functions/{proxy.mjs → proxy.js} +10 -11
- package/src/lib/edge-functions/{registry.mjs → registry.js} +1 -1
- package/src/lib/{exec-fetcher.mjs → exec-fetcher.js} +2 -2
- package/src/lib/functions/{background.mjs → background.js} +2 -2
- package/src/lib/functions/{form-submissions-handler.mjs → form-submissions-handler.js} +3 -3
- package/src/lib/functions/{local-proxy.mjs → local-proxy.js} +1 -1
- package/src/lib/functions/{netlify-function.mjs → netlify-function.js} +3 -3
- package/src/lib/functions/{registry.mjs → registry.js} +9 -9
- package/src/lib/functions/runtimes/go/{index.mjs → index.js} +2 -2
- package/src/lib/functions/runtimes/{index.mjs → index.js} +3 -4
- package/src/lib/functions/runtimes/js/builders/{netlify-lambda.mjs → netlify-lambda.js} +3 -3
- package/src/lib/functions/runtimes/js/builders/{zisi.mjs → zisi.js} +6 -6
- package/src/lib/functions/runtimes/js/{index.mjs → index.js} +4 -4
- package/src/lib/functions/runtimes/rust/{index.mjs → index.js} +4 -4
- package/src/lib/functions/{scheduled.mjs → scheduled.js} +2 -2
- package/src/lib/functions/{server.mjs → server.js} +15 -15
- package/src/lib/functions/{synchronous.mjs → synchronous.js} +3 -3
- package/src/lib/functions/{utils.mjs → utils.js} +2 -2
- package/src/lib/{geo-location.mjs → geo-location.js} +1 -1
- package/src/lib/{http-agent.mjs → http-agent.js} +1 -1
- package/src/lib/images/{proxy.mjs → proxy.js} +2 -2
- package/src/lib/{log.mjs → log.js} +1 -1
- package/src/recipes/vscode/{index.mjs → index.js} +2 -2
- package/src/recipes/vscode/{settings.mjs → settings.js} +0 -1
- package/src/utils/addons/diffs/{index.mjs → index.js} +1 -1
- package/src/utils/addons/diffs/{options.mjs → options.js} +0 -1
- package/src/utils/addons/{prepare.mjs → prepare.js} +2 -2
- package/src/utils/addons/{prompts.mjs → prompts.js} +1 -1
- package/src/utils/addons/{render.mjs → render.js} +1 -1
- package/src/utils/{banner.mjs → banner.js} +1 -1
- package/src/utils/{build-info.mjs → build-info.js} +3 -3
- package/src/utils/{command-helpers.mjs → command-helpers.js} +4 -9
- package/src/utils/deploy/{deploy-site.mjs → deploy-site.js} +8 -8
- package/src/utils/deploy/{hash-files.mjs → hash-files.js} +1 -1
- package/src/utils/deploy/{hash-fns.mjs → hash-fns.js} +3 -3
- package/src/utils/deploy/{hasher-segments.mjs → hasher-segments.js} +1 -1
- package/src/utils/deploy/{upload-files.mjs → upload-files.js} +1 -1
- package/src/utils/deploy/{util.mjs → util.js} +1 -1
- package/src/utils/{detect-server-settings.mjs → detect-server-settings.js} +6 -7
- package/src/utils/{dev.mjs → dev.js} +3 -3
- package/src/utils/{dot-env.mjs → dot-env.js} +2 -2
- package/src/utils/env/{index.mjs → index.js} +1 -1
- package/src/utils/{framework-server.mjs → framework-server.js} +4 -4
- package/src/utils/functions/{functions.mjs → functions.js} +2 -2
- package/src/utils/functions/{get-functions.mjs → get-functions.js} +1 -1
- package/src/utils/functions/index.js +3 -0
- package/src/utils/{get-global-config.mjs → get-global-config.js} +1 -1
- package/src/utils/{get-repo-data.mjs → get-repo-data.js} +1 -1
- package/src/utils/{get-site.mjs → get-site.js} +1 -1
- package/src/utils/{gh-auth.mjs → gh-auth.js} +3 -3
- package/src/utils/{gitignore.mjs → gitignore.js} +2 -2
- package/src/utils/{headers.mjs → headers.js} +1 -1
- package/src/utils/hooks/{requires-site-info.mjs → requires-site-info.js} +1 -1
- package/src/utils/init/{config-github.mjs → config-github.js} +4 -4
- package/src/utils/init/{config-manual.mjs → config-manual.js} +5 -5
- package/src/utils/init/{config.mjs → config.js} +4 -4
- package/src/utils/init/{node-version.mjs → node-version.js} +1 -1
- package/src/utils/init/{utils.mjs → utils.js} +7 -7
- package/src/utils/{live-tunnel.mjs → live-tunnel.js} +4 -4
- package/src/utils/lm/{install.mjs → install.js} +6 -6
- package/src/utils/lm/{requirements.mjs → requirements.js} +1 -1
- package/src/utils/lm/{steps.mjs → steps.js} +2 -2
- package/src/utils/lm/{ui.mjs → ui.js} +2 -2
- package/src/utils/{open-browser.mjs → open-browser.js} +1 -1
- package/src/utils/{proxy-server.mjs → proxy-server.js} +5 -5
- package/src/utils/{proxy.mjs → proxy.js} +11 -11
- package/src/utils/{redirects.mjs → redirects.js} +1 -1
- package/src/utils/{rules-proxy.mjs → rules-proxy.js} +3 -3
- package/src/utils/{run-build.mjs → run-build.js} +8 -8
- package/src/utils/{shell.mjs → shell.js} +2 -2
- package/src/utils/{state-config.mjs → state-config.js} +1 -1
- package/src/utils/{static-server.mjs → static-server.js} +1 -1
- package/src/utils/telemetry/index.js +2 -0
- package/src/utils/telemetry/{report-error.mjs → report-error.js} +4 -4
- package/src/utils/telemetry/{request.mjs → request.js} +1 -1
- package/src/utils/telemetry/{telemetry.mjs → telemetry.js} +5 -5
- package/src/utils/telemetry/{utils.mjs → utils.js} +1 -1
- package/src/utils/telemetry/{validation.mjs → validation.js} +1 -1
- package/src/utils/{validation.mjs → validation.js} +1 -1
- package/src/commands/addons/addons-auth.mjs +0 -45
- package/src/commands/addons/addons-delete.mjs +0 -53
- package/src/commands/addons/addons.mjs +0 -39
- package/src/commands/addons/index.mjs +0 -1
- package/src/commands/api/index.mjs +0 -1
- package/src/commands/blobs/blobs-delete.mjs +0 -35
- package/src/commands/blobs/blobs.mjs +0 -32
- package/src/commands/blobs/index.mjs +0 -1
- package/src/commands/build/index.mjs +0 -1
- package/src/commands/completion/completion.mjs +0 -53
- package/src/commands/completion/index.mjs +0 -1
- package/src/commands/deploy/index.mjs +0 -1
- package/src/commands/dev/index.mjs +0 -1
- package/src/commands/dev/types.d.ts +0 -30
- package/src/commands/env/env-get.mjs +0 -66
- package/src/commands/env/env.mjs +0 -41
- package/src/commands/env/index.mjs +0 -1
- package/src/commands/functions/functions.mjs +0 -39
- package/src/commands/functions/index.mjs +0 -1
- package/src/commands/index.mjs +0 -2
- package/src/commands/init/index.mjs +0 -1
- package/src/commands/integration/index.mjs +0 -24
- package/src/commands/link/index.mjs +0 -1
- package/src/commands/lm/index.mjs +0 -1
- package/src/commands/lm/lm-install.mjs +0 -27
- package/src/commands/lm/lm-uninstall.mjs +0 -18
- package/src/commands/lm/lm.mjs +0 -30
- package/src/commands/login/index.mjs +0 -1
- package/src/commands/logout/index.mjs +0 -1
- package/src/commands/logs/index.mjs +0 -12
- package/src/commands/open/index.mjs +0 -1
- package/src/commands/open/open-admin.mjs +0 -30
- package/src/commands/open/open-site.mjs +0 -31
- package/src/commands/open/open.mjs +0 -36
- package/src/commands/recipes/index.mjs +0 -1
- package/src/commands/recipes/recipes-list.mjs +0 -25
- package/src/commands/serve/index.mjs +0 -1
- package/src/commands/sites/index.mjs +0 -2
- package/src/commands/sites/sites.mjs +0 -30
- package/src/commands/status/index.mjs +0 -1
- package/src/commands/switch/index.mjs +0 -1
- package/src/commands/types.d.ts +0 -31
- package/src/commands/unlink/index.mjs +0 -1
- package/src/commands/unlink/unlink.mjs +0 -34
- package/src/commands/watch/index.mjs +0 -1
- package/src/functions-templates/typescript/abtest/{{name}}.ts +0 -31
- package/src/functions-templates/typescript/geolocation/{{name}}.ts +0 -24
- package/src/functions-templates/typescript/hello-world/{{name}}.ts +0 -12
- package/src/functions-templates/typescript/json/{{name}}.ts +0 -5
- package/src/functions-templates/typescript/log/{{name}}.ts +0 -9
- package/src/functions-templates/typescript/scheduled-function/{{name}}.ts +0 -12
- package/src/functions-templates/typescript/set-cookies/{{name}}.ts +0 -29
- package/src/functions-templates/typescript/set-req-header/{{name}}.ts +0 -5
- package/src/functions-templates/typescript/set-res-header/{{name}}.ts +0 -7
- package/src/functions-templates/typescript/transform-response/{{name}}.ts +0 -13
- package/src/utils/functions/index.mjs +0 -3
- package/src/utils/telemetry/index.mjs +0 -2
- package/src/utils/types.d.ts +0 -46
- /package/src/functions-templates/go/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/hello/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/identity-signup/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/image-external/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/localized-content/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/sanity-create/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/sanity-groq/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/submission-created/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/javascript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/rust/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/abtest/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/geolocation/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/hello-world/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/json/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/log/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/scheduled-function/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-cookies/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-req-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/set-res-header/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/functions-templates/typescript/transform-response/{.netlify-function-template.mjs → .netlify-function-template.js} +0 -0
- /package/src/lib/{account.mjs → account.js} +0 -0
- /package/src/lib/completion/{get-autocompletion.mjs → get-autocompletion.js} +0 -0
- /package/src/lib/edge-functions/{bootstrap.mjs → bootstrap.js} +0 -0
- /package/src/lib/edge-functions/{consts.mjs → consts.js} +0 -0
- /package/src/lib/edge-functions/{headers.mjs → headers.js} +0 -0
- /package/src/lib/{fs.mjs → fs.js} +0 -0
- /package/src/lib/functions/{config.mjs → config.js} +0 -0
- /package/src/lib/functions/{memoized-build.mjs → memoized-build.js} +0 -0
- /package/src/lib/functions/runtimes/js/{constants.mjs → constants.js} +0 -0
- /package/src/lib/functions/runtimes/js/{worker.mjs → worker.js} +0 -0
- /package/src/lib/{path.mjs → path.js} +0 -0
- /package/src/lib/{render-error-template.mjs → render-error-template.js} +0 -0
- /package/src/lib/{settings.mjs → settings.js} +0 -0
- /package/src/lib/{spinner.mjs → spinner.js} +0 -0
- /package/src/lib/{string.mjs → string.js} +0 -0
- /package/src/utils/addons/{compare.mjs → compare.js} +0 -0
- /package/src/utils/addons/{validation.mjs → validation.js} +0 -0
- /package/src/utils/{create-deferred.mjs → create-deferred.js} +0 -0
- /package/src/utils/{create-stream-promise.mjs → create-stream-promise.js} +0 -0
- /package/src/utils/deploy/{constants.mjs → constants.js} +0 -0
- /package/src/utils/deploy/{hash-config.mjs → hash-config.js} +0 -0
- /package/src/utils/{execa.mjs → execa.js} +0 -0
- /package/src/utils/{feature-flags.mjs → feature-flags.js} +0 -0
- /package/src/utils/functions/{constants.mjs → constants.js} +0 -0
- /package/src/utils/{get-package-json.mjs → get-package-json.js} +0 -0
- /package/src/utils/init/{plugins.mjs → plugins.js} +0 -0
- /package/src/utils/{parse-raw-flags.mjs → parse-raw-flags.js} +0 -0
- /package/src/utils/{read-repo-url.mjs → read-repo-url.js} +0 -0
- /package/src/utils/{request-id.mjs → request-id.js} +0 -0
- /package/src/utils/{sign-redirect.mjs → sign-redirect.js} +0 -0
- /package/src/utils/sites/{utils.mjs → utils.js} +0 -0
- /package/src/utils/websockets/{index.mjs → index.js} +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { getStore } from '@netlify/blobs';
|
|
2
|
-
import { chalk, error as printError } from '../../utils/command-helpers.mjs';
|
|
3
|
-
import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs';
|
|
4
|
-
/**
|
|
5
|
-
* The blobs:delete command
|
|
6
|
-
*/
|
|
7
|
-
const blobsDelete = async (storeName, key, _options, command) => {
|
|
8
|
-
const { api, siteInfo } = command.netlify;
|
|
9
|
-
const store = getStore({
|
|
10
|
-
apiURL: `${api.scheme}://${api.host}`,
|
|
11
|
-
name: storeName,
|
|
12
|
-
siteID: siteInfo.id ?? '',
|
|
13
|
-
token: api.accessToken ?? '',
|
|
14
|
-
});
|
|
15
|
-
try {
|
|
16
|
-
await store.delete(key);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return printError(`Could not delete blob ${chalk.yellow(key)} from store ${chalk.yellow(storeName)}`);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Creates the `netlify blobs:delete` command
|
|
24
|
-
* @param {import('../base-command.mjs').default} program
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
28
|
-
export const createBlobsDeleteCommand = (program) => program
|
|
29
|
-
.command('blobs:delete')
|
|
30
|
-
.description(`(Beta) Deletes an object with a given key, if it exists, from a Netlify Blobs store`)
|
|
31
|
-
.argument('<store>', 'Name of the store')
|
|
32
|
-
.argument('<key>', 'Object key')
|
|
33
|
-
.alias('blob:delete')
|
|
34
|
-
.hook('preAction', requiresSiteInfo)
|
|
35
|
-
.action(blobsDelete);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createBlobsDeleteCommand } from './blobs-delete.mjs';
|
|
2
|
-
import { createBlobsGetCommand } from './blobs-get.mjs';
|
|
3
|
-
import { createBlobsListCommand } from './blobs-list.mjs';
|
|
4
|
-
import { createBlobsSetCommand } from './blobs-set.mjs';
|
|
5
|
-
/**
|
|
6
|
-
* The blobs command
|
|
7
|
-
*/
|
|
8
|
-
const blobs = (_options, command) => {
|
|
9
|
-
command.help();
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Creates the `netlify blobs` command
|
|
13
|
-
*/
|
|
14
|
-
export const createBlobsCommand = (program) => {
|
|
15
|
-
createBlobsDeleteCommand(program);
|
|
16
|
-
createBlobsGetCommand(program);
|
|
17
|
-
createBlobsListCommand(program);
|
|
18
|
-
createBlobsSetCommand(program);
|
|
19
|
-
return program
|
|
20
|
-
.command('blobs')
|
|
21
|
-
.alias('blob')
|
|
22
|
-
.description(`(Beta) Manage objects in Netlify Blobs`)
|
|
23
|
-
.addExamples([
|
|
24
|
-
'netlify blobs:get my-store my-key',
|
|
25
|
-
'netlify blobs:set my-store my-key This will go in a blob',
|
|
26
|
-
'netlify blobs:set my-store my-key --input ./some-file.txt',
|
|
27
|
-
'netlify blobs:delete my-store my-key',
|
|
28
|
-
'netlify blobs:list my-store',
|
|
29
|
-
'netlify blobs:list my-store --json',
|
|
30
|
-
])
|
|
31
|
-
.action(blobs);
|
|
32
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createBlobsCommand } from './blobs.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createBuildCommand } from './build.mjs';
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { dirname, join } from 'path';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'tabt... Remove this comment to see the full error message
|
|
4
|
-
import { install, uninstall } from 'tabtab';
|
|
5
|
-
import { generateAutocompletion } from '../../lib/completion/index.mjs';
|
|
6
|
-
const completer = join(dirname(fileURLToPath(import.meta.url)), '../../lib/completion/script.mjs');
|
|
7
|
-
/**
|
|
8
|
-
* The completion:generate command
|
|
9
|
-
* @param {import('commander').OptionValues} options
|
|
10
|
-
* @param {import('../base-command.mjs').default} command
|
|
11
|
-
*/
|
|
12
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
13
|
-
const completionGenerate = async (options, command) => {
|
|
14
|
-
const { parent } = command;
|
|
15
|
-
generateAutocompletion(parent);
|
|
16
|
-
await install({
|
|
17
|
-
name: parent.name(),
|
|
18
|
-
completer,
|
|
19
|
-
});
|
|
20
|
-
console.log(`Completion for ${parent.name()} successful installed!`);
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Creates the `netlify completion` command
|
|
24
|
-
* @param {import('../base-command.mjs').default} program
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
28
|
-
export const createCompletionCommand = (program) => {
|
|
29
|
-
program
|
|
30
|
-
.command('completion:install')
|
|
31
|
-
.alias('completion:generate')
|
|
32
|
-
.description('Generates completion script for your preferred shell')
|
|
33
|
-
.action(completionGenerate);
|
|
34
|
-
program
|
|
35
|
-
.command('completion:uninstall', { hidden: true })
|
|
36
|
-
.alias('completion:remove')
|
|
37
|
-
.description('Uninstalls the installed completions')
|
|
38
|
-
.addExamples(['netlify completion:uninstall'])
|
|
39
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
40
|
-
.action(async (options, command) => {
|
|
41
|
-
await uninstall({
|
|
42
|
-
name: command.parent.name(),
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
return (program
|
|
46
|
-
.command('completion')
|
|
47
|
-
.description('Generate shell completion script\nRun this command to see instructions for your shell.')
|
|
48
|
-
.addExamples(['netlify completion:install'])
|
|
49
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
50
|
-
.action((options, command) => {
|
|
51
|
-
command.help();
|
|
52
|
-
}));
|
|
53
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createCompletionCommand } from './completion.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createDeployCommand } from './deploy.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createDevCommand } from './dev.mjs';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { PollingStrategy, NetlifyTOML } from '@netlify/build-info'
|
|
2
|
-
|
|
3
|
-
import type { FrameworkNames } from '../../utils/types'
|
|
4
|
-
|
|
5
|
-
/** The configuration specified in the netlify.toml under [build] */
|
|
6
|
-
export type BuildConfig = NonNullable<NetlifyTOML['build']>
|
|
7
|
-
|
|
8
|
-
export type DevConfig = NonNullable<NetlifyTOML['dev']> & {
|
|
9
|
-
framework: FrameworkNames
|
|
10
|
-
/** Directory of the functions */
|
|
11
|
-
functions?: string
|
|
12
|
-
publish?: string
|
|
13
|
-
/** Port to serve the functions */
|
|
14
|
-
port: number
|
|
15
|
-
live: boolean
|
|
16
|
-
/** The base directory from the [build] section of the configuration file */
|
|
17
|
-
base?: string
|
|
18
|
-
staticServerPort?: number
|
|
19
|
-
functionsPort?: number
|
|
20
|
-
autoLaunch?: boolean
|
|
21
|
-
https?: {
|
|
22
|
-
keyFile: string
|
|
23
|
-
certFile: string
|
|
24
|
-
}
|
|
25
|
-
envFiles?: string[]
|
|
26
|
-
|
|
27
|
-
jwtSecret: string
|
|
28
|
-
jwtRolePath: string
|
|
29
|
-
pollingStrategies?: PollingStrategy[]
|
|
30
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Option } from 'commander';
|
|
2
|
-
import { chalk, error, log, logJson } from '../../utils/command-helpers.mjs';
|
|
3
|
-
import { AVAILABLE_CONTEXTS, getEnvelopeEnv, normalizeContext } from '../../utils/env/index.mjs';
|
|
4
|
-
/**
|
|
5
|
-
* The env:get command
|
|
6
|
-
* @param {string} name Environment variable name
|
|
7
|
-
* @param {import('commander').OptionValues} options
|
|
8
|
-
* @param {import('../base-command.mjs').default} command
|
|
9
|
-
*/
|
|
10
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'name' implicitly has an 'any' type.
|
|
11
|
-
const envGet = async (name, options, command) => {
|
|
12
|
-
const { context, scope } = options;
|
|
13
|
-
const { api, cachedConfig, site } = command.netlify;
|
|
14
|
-
const siteId = site.id;
|
|
15
|
-
if (!siteId) {
|
|
16
|
-
log('No site id found, please run inside a site folder or `netlify link`');
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
const { siteInfo } = cachedConfig;
|
|
20
|
-
let { env } = cachedConfig;
|
|
21
|
-
if (siteInfo.use_envelope) {
|
|
22
|
-
env = await getEnvelopeEnv({ api, context, env, key: name, scope, siteInfo });
|
|
23
|
-
}
|
|
24
|
-
else if (context !== 'dev' || scope !== 'any') {
|
|
25
|
-
error(`To specify a context or scope, please run ${chalk.yellow('netlify open:admin')} to open the Netlify UI and opt in to the new environment variables experience from Site settings`);
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
const { value } = env[name] || {};
|
|
29
|
-
// Return json response for piping commands
|
|
30
|
-
if (options.json) {
|
|
31
|
-
logJson(value ? { [name]: value } : {});
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
if (!value) {
|
|
35
|
-
const contextType = AVAILABLE_CONTEXTS.includes(context) ? 'context' : 'branch';
|
|
36
|
-
const withContext = `in the ${chalk.magenta(context)} ${contextType}`;
|
|
37
|
-
const withScope = scope === 'any' ? '' : ` and the ${chalk.magenta(scope)} scope`;
|
|
38
|
-
log(`No value set ${withContext}${withScope} for environment variable ${chalk.yellow(name)}`);
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
log(value);
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Creates the `netlify env:get` command
|
|
45
|
-
* @param {import('../base-command.mjs').default} program
|
|
46
|
-
* @returns
|
|
47
|
-
*/
|
|
48
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
49
|
-
export const createEnvGetCommand = (program) => program
|
|
50
|
-
.command('env:get')
|
|
51
|
-
.argument('<name>', 'Environment variable name')
|
|
52
|
-
.option('-c, --context <context>', 'Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")', normalizeContext, 'dev')
|
|
53
|
-
.addOption(new Option('-s, --scope <scope>', 'Specify a scope')
|
|
54
|
-
.choices(['builds', 'functions', 'post-processing', 'runtime', 'any'])
|
|
55
|
-
.default('any'))
|
|
56
|
-
.addExamples([
|
|
57
|
-
'netlify env:get MY_VAR # get value for MY_VAR in dev context',
|
|
58
|
-
'netlify env:get MY_VAR --context production',
|
|
59
|
-
'netlify env:get MY_VAR --context branch:staging',
|
|
60
|
-
'netlify env:get MY_VAR --scope functions',
|
|
61
|
-
])
|
|
62
|
-
.description('Get resolved value of specified environment variable (includes netlify.toml)')
|
|
63
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'name' implicitly has an 'any' type.
|
|
64
|
-
.action(async (name, options, command) => {
|
|
65
|
-
await envGet(name, options, command);
|
|
66
|
-
});
|
package/src/commands/env/env.mjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { createEnvCloneCommand } from './env-clone.mjs';
|
|
2
|
-
import { createEnvGetCommand } from './env-get.mjs';
|
|
3
|
-
import { createEnvImportCommand } from './env-import.mjs';
|
|
4
|
-
import { createEnvListCommand } from './env-list.mjs';
|
|
5
|
-
import { createEnvSetCommand } from './env-set.mjs';
|
|
6
|
-
import { createEnvUnsetCommand } from './env-unset.mjs';
|
|
7
|
-
/**
|
|
8
|
-
* The env command
|
|
9
|
-
* @param {import('commander').OptionValues} options
|
|
10
|
-
* @param {import('../base-command.mjs').default} command
|
|
11
|
-
*/
|
|
12
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
13
|
-
const env = (options, command) => {
|
|
14
|
-
command.help();
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Creates the `netlify env` command
|
|
18
|
-
* @param {import('../base-command.mjs').default} program
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
22
|
-
export const createEnvCommand = (program) => {
|
|
23
|
-
createEnvGetCommand(program);
|
|
24
|
-
createEnvImportCommand(program);
|
|
25
|
-
createEnvListCommand(program);
|
|
26
|
-
createEnvSetCommand(program);
|
|
27
|
-
createEnvUnsetCommand(program);
|
|
28
|
-
createEnvCloneCommand(program);
|
|
29
|
-
return program
|
|
30
|
-
.command('env')
|
|
31
|
-
.description('Control environment variables for the current site')
|
|
32
|
-
.addExamples([
|
|
33
|
-
'netlify env:list',
|
|
34
|
-
'netlify env:get VAR_NAME',
|
|
35
|
-
'netlify env:set VAR_NAME value',
|
|
36
|
-
'netlify env:unset VAR_NAME',
|
|
37
|
-
'netlify env:import fileName',
|
|
38
|
-
'netlify env:clone --to <to-site-id>',
|
|
39
|
-
])
|
|
40
|
-
.action(env);
|
|
41
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createEnvCommand } from './env.mjs';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { chalk } from '../../utils/command-helpers.mjs';
|
|
2
|
-
import { createFunctionsBuildCommand } from './functions-build.mjs';
|
|
3
|
-
import { createFunctionsCreateCommand } from './functions-create.mjs';
|
|
4
|
-
import { createFunctionsInvokeCommand } from './functions-invoke.mjs';
|
|
5
|
-
import { createFunctionsListCommand } from './functions-list.mjs';
|
|
6
|
-
import { createFunctionsServeCommand } from './functions-serve.mjs';
|
|
7
|
-
/**
|
|
8
|
-
* The functions command
|
|
9
|
-
* @param {import('commander').OptionValues} options
|
|
10
|
-
* @param {import('../base-command.mjs').default} command
|
|
11
|
-
*/
|
|
12
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
13
|
-
const functions = (options, command) => {
|
|
14
|
-
command.help();
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Creates the `netlify functions` command
|
|
18
|
-
* @param {import('../base-command.mjs').default} program
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
22
|
-
export const createFunctionsCommand = (program) => {
|
|
23
|
-
createFunctionsBuildCommand(program);
|
|
24
|
-
createFunctionsCreateCommand(program);
|
|
25
|
-
createFunctionsInvokeCommand(program);
|
|
26
|
-
createFunctionsListCommand(program);
|
|
27
|
-
createFunctionsServeCommand(program);
|
|
28
|
-
const name = chalk.greenBright('`functions`');
|
|
29
|
-
return program
|
|
30
|
-
.command('functions')
|
|
31
|
-
.alias('function')
|
|
32
|
-
.description(`Manage netlify functions
|
|
33
|
-
The ${name} command will help you manage the functions in this site`)
|
|
34
|
-
.addExamples([
|
|
35
|
-
'netlify functions:create --name function-xyz',
|
|
36
|
-
'netlify functions:build --functions build/to/directory --src source/directory',
|
|
37
|
-
])
|
|
38
|
-
.action(functions);
|
|
39
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createFunctionsCommand } from './functions.mjs';
|
package/src/commands/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createInitCommand, init } from './init.mjs';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createDeployCommand } from './deploy.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* The int command
|
|
4
|
-
* @param {import('commander').OptionValues} options
|
|
5
|
-
* @param {import('../base-command.mjs').default} command
|
|
6
|
-
*/
|
|
7
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
8
|
-
const integrations = (options, command) => {
|
|
9
|
-
command.help();
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Creates the `netlify integration` command
|
|
13
|
-
* @param {import('../base-command.mjs').default} program
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
17
|
-
export const createIntegrationCommand = (program) => {
|
|
18
|
-
createDeployCommand(program);
|
|
19
|
-
return program
|
|
20
|
-
.command('integration')
|
|
21
|
-
.alias('int')
|
|
22
|
-
.description('Manage Netlify Integrations built with the Netlify SDK')
|
|
23
|
-
.action(integrations);
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createLinkCommand, link } from './link.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createLmCommand } from './lm.mjs';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { installPlatform } from '../../utils/lm/install.mjs';
|
|
2
|
-
import { printBanner } from '../../utils/lm/ui.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* The lm:install command
|
|
5
|
-
* @param {import('commander').OptionValues} options
|
|
6
|
-
*/
|
|
7
|
-
// @ts-expect-error TS(7031) FIXME: Binding element 'force' implicitly has an 'any' ty... Remove this comment to see the full error message
|
|
8
|
-
const lmInstall = async ({ force }) => {
|
|
9
|
-
const installed = await installPlatform({ force });
|
|
10
|
-
if (installed) {
|
|
11
|
-
printBanner(force);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Creates the `netlify lm:install` command
|
|
16
|
-
* @param {import('../base-command.mjs').default} program
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
20
|
-
export const createLmInstallCommand = (program) => program
|
|
21
|
-
.command('lm:install', { hidden: true })
|
|
22
|
-
.alias('lm:init')
|
|
23
|
-
.description(`Configures your computer to use Netlify Large Media
|
|
24
|
-
It installs the required credentials helper for Git,
|
|
25
|
-
and configures your Git environment with the right credentials.`)
|
|
26
|
-
.option('-f, --force', 'Force the credentials helper installation')
|
|
27
|
-
.action(lmInstall);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { uninstall } from '../../utils/lm/install.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* The lm:uninstall command
|
|
4
|
-
*/
|
|
5
|
-
const lmUninstall = async () => {
|
|
6
|
-
await uninstall();
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Creates the `netlify lm:uninstall` command
|
|
10
|
-
* @param {import('../base-command.mjs').default} program
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
14
|
-
export const createLmUninstallCommand = (program) => program
|
|
15
|
-
.command('lm:uninstall', { hidden: true })
|
|
16
|
-
.alias('lm:remove')
|
|
17
|
-
.description('Uninstalls Netlify git credentials helper and cleans up any related configuration changes made by the install command.')
|
|
18
|
-
.action(lmUninstall);
|
package/src/commands/lm/lm.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createLmInfoCommand } from './lm-info.mjs';
|
|
2
|
-
import { createLmInstallCommand } from './lm-install.mjs';
|
|
3
|
-
import { createLmSetupCommand } from './lm-setup.mjs';
|
|
4
|
-
import { createLmUninstallCommand } from './lm-uninstall.mjs';
|
|
5
|
-
/**
|
|
6
|
-
* The lm command
|
|
7
|
-
* @param {import('commander').OptionValues} options
|
|
8
|
-
* @param {import('../base-command.mjs').default} command
|
|
9
|
-
*/
|
|
10
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
11
|
-
const lm = (options, command) => {
|
|
12
|
-
command.help();
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Creates the `netlify lm` command
|
|
16
|
-
* @param {import('../base-command.mjs').default} program
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
20
|
-
export const createLmCommand = (program) => {
|
|
21
|
-
createLmInfoCommand(program);
|
|
22
|
-
createLmInstallCommand(program);
|
|
23
|
-
createLmSetupCommand(program);
|
|
24
|
-
createLmUninstallCommand(program);
|
|
25
|
-
program
|
|
26
|
-
.command('lm', { hidden: true })
|
|
27
|
-
.description('[Deprecated and will be removed from future versions] Handle Netlify Large Media operations\nThe lm command will help you manage large media for a site')
|
|
28
|
-
.addExamples(['netlify lm:info', 'netlify lm:install', 'netlify lm:setup'])
|
|
29
|
-
.action(lm);
|
|
30
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createLoginCommand, login } from './login.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createLogoutCommand } from './logout.mjs';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createLogsBuildCommand } from './build.mjs';
|
|
2
|
-
import { createLogsFunctionCommand } from './functions.mjs';
|
|
3
|
-
export const createLogsCommand = (program) => {
|
|
4
|
-
createLogsBuildCommand(program);
|
|
5
|
-
createLogsFunctionCommand(program);
|
|
6
|
-
return program
|
|
7
|
-
.command('logs')
|
|
8
|
-
.alias('log')
|
|
9
|
-
.description('Stream logs from your site')
|
|
10
|
-
.addExamples(['netlify logs:deploy', 'netlify logs:function', 'netlify logs:function my-function'])
|
|
11
|
-
.action((_, command) => command.help());
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createOpenCommand } from './open.mjs';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { exit, log } from '../../utils/command-helpers.mjs';
|
|
2
|
-
import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs';
|
|
3
|
-
import openBrowser from '../../utils/open-browser.mjs';
|
|
4
|
-
/**
|
|
5
|
-
* The open:admin command
|
|
6
|
-
* @param {import('commander').OptionValues} options
|
|
7
|
-
* @param {import('../base-command.mjs').default} command
|
|
8
|
-
*/
|
|
9
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
10
|
-
export const openAdmin = async (options, command) => {
|
|
11
|
-
const { siteInfo } = command.netlify;
|
|
12
|
-
await command.authenticate();
|
|
13
|
-
log(`Opening "${siteInfo.name}" site admin UI:`);
|
|
14
|
-
log(`> ${siteInfo.admin_url}`);
|
|
15
|
-
// @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
|
|
16
|
-
await openBrowser({ url: siteInfo.admin_url });
|
|
17
|
-
exit();
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Creates the `netlify open:admin` command
|
|
21
|
-
* @param {import('../base-command.mjs').default} program
|
|
22
|
-
* @returns
|
|
23
|
-
*/
|
|
24
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
25
|
-
export const createOpenAdminCommand = (program) => program
|
|
26
|
-
.command('open:admin')
|
|
27
|
-
.description('Opens current site admin UI in Netlify')
|
|
28
|
-
.addExamples(['netlify open:admin'])
|
|
29
|
-
.hook('preAction', requiresSiteInfo)
|
|
30
|
-
.action(openAdmin);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { exit, log } from '../../utils/command-helpers.mjs';
|
|
2
|
-
import requiresSiteInfo from '../../utils/hooks/requires-site-info.mjs';
|
|
3
|
-
import openBrowser from '../../utils/open-browser.mjs';
|
|
4
|
-
/**
|
|
5
|
-
* The open:site command
|
|
6
|
-
* @param {import('commander').OptionValues} options
|
|
7
|
-
* @param {import('../base-command.mjs').default} command
|
|
8
|
-
*/
|
|
9
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
10
|
-
export const openSite = async (options, command) => {
|
|
11
|
-
const { siteInfo } = command.netlify;
|
|
12
|
-
await command.authenticate();
|
|
13
|
-
const url = siteInfo.ssl_url || siteInfo.url;
|
|
14
|
-
log(`Opening "${siteInfo.name}" site url:`);
|
|
15
|
-
log(`> ${url}`);
|
|
16
|
-
// @ts-expect-error TS(2345) FIXME: Argument of type '{ url: any; }' is not assignable... Remove this comment to see the full error message
|
|
17
|
-
await openBrowser({ url });
|
|
18
|
-
exit();
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Creates the `netlify open:site` command
|
|
22
|
-
* @param {import('../base-command.mjs').default} program
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
26
|
-
export const createOpenSiteCommand = (program) => program
|
|
27
|
-
.command('open:site')
|
|
28
|
-
.description('Opens current site url in browser')
|
|
29
|
-
.addExamples(['netlify open:site'])
|
|
30
|
-
.hook('preAction', requiresSiteInfo)
|
|
31
|
-
.action(openSite);
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { log } from '../../utils/command-helpers.mjs';
|
|
2
|
-
import { createOpenAdminCommand, openAdmin } from './open-admin.mjs';
|
|
3
|
-
import { createOpenSiteCommand, openSite } from './open-site.mjs';
|
|
4
|
-
/**
|
|
5
|
-
* The open command
|
|
6
|
-
* @param {import('commander').OptionValues} options
|
|
7
|
-
* @param {import('../base-command.mjs').default} command
|
|
8
|
-
*/
|
|
9
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
10
|
-
const open = async (options, command) => {
|
|
11
|
-
if (!options.site || !options.admin) {
|
|
12
|
-
log(command.helpInformation());
|
|
13
|
-
}
|
|
14
|
-
if (options.site) {
|
|
15
|
-
await openSite(options, command);
|
|
16
|
-
}
|
|
17
|
-
// Default open netlify admin
|
|
18
|
-
await openAdmin(options, command);
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Creates the `netlify open` command
|
|
22
|
-
* @param {import('../base-command.mjs').default} program
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
26
|
-
export const createOpenCommand = (program) => {
|
|
27
|
-
createOpenAdminCommand(program);
|
|
28
|
-
createOpenSiteCommand(program);
|
|
29
|
-
return program
|
|
30
|
-
.command('open')
|
|
31
|
-
.description(`Open settings for the site linked to the current folder`)
|
|
32
|
-
.option('--site', 'Open site')
|
|
33
|
-
.option('--admin', 'Open Netlify site')
|
|
34
|
-
.addExamples(['netlify open --site', 'netlify open --admin', 'netlify open:admin', 'netlify open:site'])
|
|
35
|
-
.action(open);
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createRecipesCommand, runRecipe } from './recipes.mjs';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import AsciiTable from 'ascii-table';
|
|
2
|
-
import { listRecipes } from './common.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* The recipes:list command
|
|
5
|
-
*/
|
|
6
|
-
const recipesListCommand = async () => {
|
|
7
|
-
const recipes = await listRecipes();
|
|
8
|
-
const table = new AsciiTable(`Usage: netlify recipes <name>`);
|
|
9
|
-
table.setHeading('Name', 'Description');
|
|
10
|
-
recipes.forEach(({ description, name }) => {
|
|
11
|
-
table.addRow(name, description);
|
|
12
|
-
});
|
|
13
|
-
console.log(table.toString());
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Creates the `netlify recipes:list` command
|
|
17
|
-
* @param {import('../base-command.mjs').default} program
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
21
|
-
export const createRecipesListCommand = (program) => program
|
|
22
|
-
.command('recipes:list')
|
|
23
|
-
.description(`List the recipes available to create and modify files in a project`)
|
|
24
|
-
.addExamples(['netlify recipes:list'])
|
|
25
|
-
.action(recipesListCommand);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createServeCommand } from './serve.mjs';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createSitesFromTemplateCommand } from './sites-create-template.mjs';
|
|
2
|
-
import { createSitesCreateCommand } from './sites-create.mjs';
|
|
3
|
-
import { createSitesDeleteCommand } from './sites-delete.mjs';
|
|
4
|
-
import { createSitesListCommand } from './sites-list.mjs';
|
|
5
|
-
/**
|
|
6
|
-
* The sites command
|
|
7
|
-
* @param {import('commander').OptionValues} options
|
|
8
|
-
* @param {import('../base-command.mjs').default} command
|
|
9
|
-
*/
|
|
10
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'options' implicitly has an 'any' type.
|
|
11
|
-
const sites = (options, command) => {
|
|
12
|
-
command.help();
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Creates the `netlify sites` command
|
|
16
|
-
* @param {import('../base-command.mjs').default} program
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
// @ts-expect-error TS(7006) FIXME: Parameter 'program' implicitly has an 'any' type.
|
|
20
|
-
export const createSitesCommand = (program) => {
|
|
21
|
-
createSitesCreateCommand(program);
|
|
22
|
-
createSitesFromTemplateCommand(program);
|
|
23
|
-
createSitesListCommand(program);
|
|
24
|
-
createSitesDeleteCommand(program);
|
|
25
|
-
return program
|
|
26
|
-
.command('sites')
|
|
27
|
-
.description(`Handle various site operations\nThe sites command will help you manage all your sites`)
|
|
28
|
-
.addExamples(['netlify sites:create --name my-new-site', 'netlify sites:list'])
|
|
29
|
-
.action(sites);
|
|
30
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createStatusCommand } from './status.mjs';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createSwitchCommand } from './switch.mjs';
|