netlify-cli 20.0.4 → 20.1.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.js CHANGED
@@ -6,20 +6,37 @@ import { maybeEnableCompileCache } from '../dist/utils/nodejs-compile-cache.js'
6
6
  // 12 hours
7
7
  const UPDATE_CHECK_INTERVAL = 432e5
8
8
 
9
+ const NETLIFY_CYAN_HEX = '#28b5ac'
10
+ const UPDATE_BOXEN_OPTIONS = {
11
+ padding: 1,
12
+ margin: 1,
13
+ textAlignment: 'center',
14
+ borderStyle: 'round',
15
+ borderColor: NETLIFY_CYAN_HEX,
16
+ float: 'center',
17
+ title: '⬥ ',
18
+ titleAlignment: 'center',
19
+ }
20
+
9
21
  const main = async () => {
22
+ const { default: chalk } = await import('chalk')
10
23
  const { default: updateNotifier } = await import('update-notifier')
24
+ const { default: terminalLink } = await import('terminal-link')
11
25
  const { createMainCommand } = await import('../dist/commands/main.js')
12
26
  const { logError } = await import('../dist/utils/command-helpers.js')
13
27
  const { default: getPackageJson } = await import('../dist/utils/get-cli-package-json.js')
14
28
  const { runProgram } = await import('../dist/utils/run-program.js')
15
29
 
16
- const pkg = await getPackageJson()
17
-
18
30
  try {
31
+ const pkg = await getPackageJson()
32
+ const message = `Update available ${chalk.dim('{currentVersion}')} → ${chalk.green('{latestVersion}')}
33
+ See what's new in the ${terminalLink('release notes', 'https://ntl.fyi/cli-versions')}
34
+
35
+ Run ${chalk.inverse.hex(NETLIFY_CYAN_HEX)('{updateCommand}')} to update`
19
36
  updateNotifier({
20
37
  pkg,
21
38
  updateCheckInterval: UPDATE_CHECK_INTERVAL,
22
- }).notify()
39
+ }).notify({ message, boxenOptions: UPDATE_BOXEN_OPTIONS })
23
40
  } catch (error) {
24
41
  logError(`Error checking for updates: ${error?.toString()}`)
25
42
  }