netlify-cli 8.0.7 → 8.1.0-rc
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 +81 -3
- package/npm-shrinkwrap.json +305 -2105
- package/package.json +10 -33
- package/src/commands/addons/addons-auth.js +50 -0
- package/src/commands/addons/addons-config.js +180 -0
- package/src/commands/addons/addons-create.js +129 -0
- package/src/commands/addons/addons-delete.js +59 -0
- package/src/commands/addons/addons-list.js +62 -0
- package/src/commands/addons/addons.js +49 -0
- package/src/commands/addons/index.js +3 -24
- package/src/commands/api/api.js +83 -0
- package/src/commands/api/index.js +5 -0
- package/src/commands/base-command.js +322 -0
- package/src/commands/build/build.js +58 -0
- package/src/commands/build/index.js +3 -61
- package/src/commands/completion/completion.js +18 -0
- package/src/commands/completion/index.js +5 -0
- package/src/commands/{deploy.js → deploy/deploy.js} +306 -278
- package/src/commands/deploy/index.js +5 -0
- package/src/commands/dev/dev-exec.js +39 -0
- package/src/commands/dev/dev-trace.js +50 -0
- package/src/commands/dev/dev.js +349 -0
- package/src/commands/dev/index.js +3 -335
- package/src/commands/env/env-get.js +51 -0
- package/src/commands/env/env-import.js +93 -0
- package/src/commands/env/env-list.js +63 -0
- package/src/commands/env/env-set.js +67 -0
- package/src/commands/env/env-unset.js +66 -0
- package/src/commands/env/env.js +47 -0
- package/src/commands/env/index.js +3 -23
- package/src/commands/functions/functions-build.js +59 -0
- package/src/commands/functions/{create.js → functions-create.js} +133 -94
- package/src/commands/functions/functions-invoke.js +276 -0
- package/src/commands/functions/functions-list.js +107 -0
- package/src/commands/functions/functions-serve.js +63 -0
- package/src/commands/functions/functions.js +53 -0
- package/src/commands/functions/index.js +3 -45
- package/src/commands/index.js +5 -0
- package/src/commands/init/index.js +6 -0
- package/src/commands/{init.js → init/init.js} +79 -68
- package/src/commands/link/index.js +6 -0
- package/src/{utils/link/link-by-prompt.js → commands/link/link.js} +153 -14
- package/src/commands/lm/index.js +3 -19
- package/src/commands/lm/lm-info.js +42 -0
- package/src/commands/lm/lm-install.js +36 -0
- package/src/commands/lm/lm-setup.js +106 -0
- package/src/commands/lm/lm-uninstall.js +25 -0
- package/src/commands/lm/lm.js +39 -0
- package/src/commands/login/index.js +6 -0
- package/src/commands/login/login.js +52 -0
- package/src/commands/logout/index.js +5 -0
- package/src/commands/logout/logout.js +43 -0
- package/src/commands/main.js +117 -0
- package/src/commands/open/index.js +3 -39
- package/src/commands/open/open-admin.js +56 -0
- package/src/commands/open/open-site.js +49 -0
- package/src/commands/open/open.js +42 -0
- package/src/commands/sites/index.js +5 -20
- package/src/commands/sites/sites-create.js +184 -0
- package/src/commands/sites/sites-delete.js +108 -0
- package/src/commands/sites/sites-list.js +89 -0
- package/src/commands/sites/sites.js +36 -0
- package/src/commands/status/index.js +3 -118
- package/src/commands/status/status-hooks.js +73 -0
- package/src/commands/status/status.js +125 -0
- package/src/commands/switch/index.js +5 -0
- package/src/commands/switch/switch.js +50 -0
- package/src/commands/unlink/index.js +5 -0
- package/src/commands/unlink/unlink.js +48 -0
- package/src/commands/watch/index.js +5 -0
- package/src/commands/watch/watch.js +121 -0
- package/src/lib/build.js +21 -7
- package/src/lib/exec-fetcher.js +5 -3
- package/src/lib/fs.js +54 -36
- package/src/lib/functions/background.js +1 -1
- package/src/lib/functions/form-submissions-handler.js +2 -1
- package/src/lib/functions/local-proxy.js +2 -1
- package/src/lib/functions/netlify-function.js +4 -1
- package/src/lib/functions/registry.js +4 -6
- package/src/lib/functions/runtimes/go/index.js +2 -1
- package/src/lib/functions/runtimes/js/builders/netlify-lambda.js +6 -4
- package/src/lib/functions/runtimes/js/builders/zisi.js +3 -3
- package/src/lib/functions/runtimes/rust/index.js +4 -3
- package/src/lib/functions/server.js +2 -3
- package/src/lib/functions/synchronous.js +2 -1
- package/src/lib/functions/utils.js +2 -3
- package/src/lib/functions/watcher.js +1 -0
- package/src/lib/http-agent.js +3 -5
- package/src/lib/log.js +2 -1
- package/src/lib/spinner.js +22 -0
- package/src/utils/addons/diffs/index.js +1 -0
- package/src/utils/addons/diffs/options.js +3 -1
- package/src/utils/addons/prepare.js +13 -6
- package/src/utils/addons/prompts.js +2 -1
- package/src/utils/addons/render.js +3 -1
- package/src/utils/command-helpers.js +156 -43
- package/src/utils/create-stream-promise.js +5 -5
- package/src/utils/deferred.js +1 -0
- package/src/utils/deploy/deploy-site.js +1 -1
- package/src/utils/deploy/index.js +4 -0
- package/src/utils/detect-server-settings.js +10 -12
- package/src/utils/dev.js +18 -10
- package/src/utils/dot-env.js +4 -2
- package/src/utils/{edge-handlers.js → functions/edge-handlers.js} +8 -7
- package/src/utils/functions/functions.js +36 -0
- package/src/utils/{get-functions.js → functions/get-functions.js} +2 -1
- package/src/utils/functions/index.js +8 -26
- package/src/utils/get-global-config.js +3 -2
- package/src/utils/get-repo-data.js +1 -0
- package/src/utils/gh-auth.js +1 -0
- package/src/utils/gitignore.js +7 -5
- package/src/utils/header.js +2 -2
- package/src/utils/headers.js +1 -2
- package/src/utils/index.js +42 -0
- package/src/utils/init/config-github.js +12 -5
- package/src/utils/init/config-manual.js +9 -2
- package/src/utils/init/config.js +13 -7
- package/src/utils/init/frameworks.js +1 -0
- package/src/utils/init/node-version.js +4 -2
- package/src/utils/init/plugins.js +1 -0
- package/src/utils/init/utils.js +10 -6
- package/src/utils/live-tunnel.js +3 -4
- package/src/utils/lm/install.js +10 -15
- package/src/utils/lm/requirements.js +3 -1
- package/src/utils/lm/steps.js +1 -1
- package/src/utils/lm/ui.js +7 -3
- package/src/utils/open-browser.js +8 -2
- package/src/utils/parse-raw-flags.js +4 -4
- package/src/utils/proxy.js +6 -5
- package/src/utils/read-repo-url.js +1 -0
- package/src/utils/redirects.js +2 -2
- package/src/utils/rules-proxy.js +2 -1
- package/src/utils/state-config.js +1 -1
- package/src/utils/telemetry/index.js +2 -113
- package/src/utils/telemetry/request.js +3 -1
- package/src/utils/telemetry/telemetry.js +117 -0
- package/src/utils/telemetry/validation.js +13 -12
- package/src/utils/traffic-mesh.js +3 -3
- package/oclif.manifest.json +0 -1
- package/src/commands/addons/auth.js +0 -42
- package/src/commands/addons/config.js +0 -177
- package/src/commands/addons/create.js +0 -127
- package/src/commands/addons/delete.js +0 -69
- package/src/commands/addons/list.js +0 -54
- package/src/commands/api.js +0 -84
- package/src/commands/dev/exec.js +0 -32
- package/src/commands/dev/trace.js +0 -61
- package/src/commands/env/get.js +0 -44
- package/src/commands/env/import.js +0 -90
- package/src/commands/env/list.js +0 -49
- package/src/commands/env/set.js +0 -64
- package/src/commands/env/unset.js +0 -58
- package/src/commands/functions/build.js +0 -60
- package/src/commands/functions/invoke.js +0 -277
- package/src/commands/functions/list.js +0 -102
- package/src/commands/functions/serve.js +0 -70
- package/src/commands/link.js +0 -133
- package/src/commands/lm/info.js +0 -36
- package/src/commands/lm/install.js +0 -30
- package/src/commands/lm/setup.js +0 -107
- package/src/commands/lm/uninstall.js +0 -17
- package/src/commands/login.js +0 -54
- package/src/commands/logout.js +0 -37
- package/src/commands/open/admin.js +0 -51
- package/src/commands/open/site.js +0 -43
- package/src/commands/sites/create.js +0 -191
- package/src/commands/sites/delete.js +0 -116
- package/src/commands/sites/list.js +0 -84
- package/src/commands/status/hooks.js +0 -60
- package/src/commands/switch.js +0 -44
- package/src/commands/unlink.js +0 -38
- package/src/commands/watch.js +0 -115
- package/src/hooks/init.js +0 -46
- package/src/index.js +0 -25
- package/src/lib/help.js +0 -26
- package/src/utils/chalk.js +0 -16
- package/src/utils/check-command-inputs.js +0 -21
- package/src/utils/command.js +0 -262
- package/src/utils/detect-functions-builder.js +0 -25
- package/src/utils/difference.js +0 -4
- package/src/utils/logo.js +0 -11
- package/src/utils/show-help.js +0 -5
- package/src/utils/telemetry/tracked-command.js +0 -51
package/bin/run
CHANGED
|
@@ -1,4 +1,82 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node --trace-warnings
|
|
2
|
+
/* eslint-disable promise/prefer-await-to-then,promise/prefer-await-to-callbacks,eslint-comments/disable-enable-pair */
|
|
3
|
+
const process = require('process')
|
|
2
4
|
|
|
3
|
-
require('
|
|
4
|
-
|
|
5
|
+
const updateNotifier = require('update-notifier')
|
|
6
|
+
|
|
7
|
+
const { createAddonsCommand } = require('../src/commands/addons')
|
|
8
|
+
const { createApiCommand } = require('../src/commands/api')
|
|
9
|
+
const { BaseCommand } = require('../src/commands/base-command')
|
|
10
|
+
const { createBuildCommand } = require('../src/commands/build')
|
|
11
|
+
const { createCompletionCommand } = require('../src/commands/completion')
|
|
12
|
+
const { createDeployCommand } = require('../src/commands/deploy')
|
|
13
|
+
const { createDevCommand } = require('../src/commands/dev')
|
|
14
|
+
const { createEnvCommand } = require('../src/commands/env')
|
|
15
|
+
const { createFunctionsCommand } = require('../src/commands/functions')
|
|
16
|
+
const { createInitCommand } = require('../src/commands/init')
|
|
17
|
+
const { createLinkCommand } = require('../src/commands/link')
|
|
18
|
+
const { createLmCommand } = require('../src/commands/lm')
|
|
19
|
+
const { createLoginCommand } = require('../src/commands/login')
|
|
20
|
+
const { createLogoutCommand } = require('../src/commands/logout')
|
|
21
|
+
const { createMainCommand } = require('../src/commands/main')
|
|
22
|
+
const { createOpenCommand } = require('../src/commands/open')
|
|
23
|
+
const { createSitesCommand } = require('../src/commands/sites')
|
|
24
|
+
const { createStatusCommand } = require('../src/commands/status')
|
|
25
|
+
const { createSwitchCommand } = require('../src/commands/switch')
|
|
26
|
+
const { createUnlinkCommand } = require('../src/commands/unlink')
|
|
27
|
+
const { createWatchCommand } = require('../src/commands/watch')
|
|
28
|
+
|
|
29
|
+
// 12 hours
|
|
30
|
+
const UPDATE_CHECK_INTERVAL = 432e5
|
|
31
|
+
|
|
32
|
+
if (require.main === module) {
|
|
33
|
+
// eslint-disable-next-line node/global-require
|
|
34
|
+
const pkg = require('../package.json')
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
updateNotifier({
|
|
38
|
+
pkg,
|
|
39
|
+
updateCheckInterval: UPDATE_CHECK_INTERVAL,
|
|
40
|
+
}).notify()
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.log('Error checking for updates:')
|
|
43
|
+
console.log(error)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const program = new BaseCommand('netlify')
|
|
47
|
+
|
|
48
|
+
createAddonsCommand(program)
|
|
49
|
+
createApiCommand(program)
|
|
50
|
+
createBuildCommand(program)
|
|
51
|
+
createCompletionCommand(program)
|
|
52
|
+
createDeployCommand(program)
|
|
53
|
+
createDevCommand(program)
|
|
54
|
+
createEnvCommand(program)
|
|
55
|
+
createFunctionsCommand(program)
|
|
56
|
+
createInitCommand(program)
|
|
57
|
+
createLinkCommand(program)
|
|
58
|
+
createLmCommand(program)
|
|
59
|
+
createLoginCommand(program)
|
|
60
|
+
createLogoutCommand(program)
|
|
61
|
+
createOpenCommand(program)
|
|
62
|
+
createSitesCommand(program)
|
|
63
|
+
createStatusCommand(program)
|
|
64
|
+
createSwitchCommand(program)
|
|
65
|
+
createUnlinkCommand(program)
|
|
66
|
+
createWatchCommand(program)
|
|
67
|
+
|
|
68
|
+
/** @type {Error} */
|
|
69
|
+
let caughtError
|
|
70
|
+
|
|
71
|
+
createMainCommand(program)
|
|
72
|
+
.then(() => program.parseAsync(process.argv))
|
|
73
|
+
.catch((error) => {
|
|
74
|
+
caughtError = error
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
// long running commands like dev server cannot be caught by a post action hook
|
|
78
|
+
// they are running on the main command
|
|
79
|
+
process.on('exit', () => {
|
|
80
|
+
program.onEnd(caughtError)
|
|
81
|
+
})
|
|
82
|
+
}
|