Skip to content

Commit f18fcb9

Browse files
authored
Added guide about updating Now CLI (#101)
* Pinned dependencies and updated lockfile * Guide for updating Now CLI * Updated menu title * Correct wording * Update mask off * Fixed links
1 parent 6c791c6 commit f18fcb9

File tree

8 files changed

+143
-16
lines changed

8 files changed

+143
-16
lines changed

.yarnrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
save-exact true
1+
save-prefix ""

components/text/hr.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const HR = () => (
2+
<hr
3+
style={{
4+
border: '0',
5+
borderTop: '1px solid #eaeaea',
6+
margin: '50px 0'
7+
}}
8+
/>
9+
)
10+
11+
export default HR

components/text/link.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
// Packages
12
import NativeLink from 'next/link'
23
import PropTypes from 'prop-types'
34

45
export const GenericLink = props => {
56
if (props.href.startsWith('/')) {
67
return <InternalLink {...props} />
78
}
9+
10+
if (props.href.includes('@') || props.href.startsWith('#')) {
11+
return <AnchorLink {...props} />
12+
}
13+
814
return <ExternalLink {...props} />
915
}
1016

11-
export const InternalLink = ({ href, as, children }, { darkBg } = {}) => (
17+
export const InternalLink = ({ href, as, children, darkBg }) => (
1218
<NativeLink prefetch href={href} as={as}>
1319
<a className={darkBg ? 'dark' : ''}>
1420
{children}
@@ -24,8 +30,14 @@ export const InternalLink = ({ href, as, children }, { darkBg } = {}) => (
2430
a:hover {
2531
text-decoration: underline;
2632
}
33+
2734
a.dark {
2835
color: #fff;
36+
border-bottom: 1px solid #fff;
37+
}
38+
39+
a.dark:hover {
40+
text-decoration: none;
2941
}
3042
`}
3143
</style>

lib/data/docs.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ export default [
109109
href: '/docs/guides/migrate-your-app'
110110
},
111111
{
112-
name: 'How to use Cloudflare',
112+
name: 'How to Use Cloudflare',
113113
href: '/docs/guides/how-to-use-cloudflare'
114+
},
115+
{
116+
name: 'Updating Now CLI',
117+
href: '/docs/guides/updating-now-cli'
114118
}
115119
]
116120
},

lib/with-doc.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { PDIV, P, Quote } from '../components/text/paragraph'
77
import { UL, LI } from '../components/text/list'
88
import { H3, H4, H5 } from '../components/text/heading'
99
import { InlineCode } from '../components/text/code'
10-
import { ExternalLink } from '../components/text/link'
10+
import { GenericLink } from '../components/text/link'
11+
import HR from '../components/text/hr'
1112
import DocsNavbarDesktop from '../components/docs/navbar/desktop'
1213
import DocsNavbarMobile from '../components/docs/navbar/mobile'
1314
import DocsNavbarToggle from '../components/docs/navbar/toggle'
@@ -189,6 +190,7 @@ export const components = {
189190
h3: DocH3,
190191
h4: DocH4,
191192
code: InlineCode,
192-
a: ExternalLink,
193-
blockquote: Quote
193+
a: GenericLink,
194+
blockquote: Quote,
195+
hr: HR
194196
}

pages/docs/guides/updating-now-cli.js

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import markdown from 'markdown-in-js'
2+
import withDoc, { components } from '../../../lib/with-doc'
3+
4+
import { leo } from '../../../lib/data/team'
5+
import Image from '../../../components/image'
6+
import {
7+
TerminalOutput,
8+
TerminalInput
9+
} from '../../../components/text/terminal'
10+
11+
const updateMessage = {
12+
color: 'white',
13+
background: '#FF0000',
14+
padding: '1px 3px'
15+
}
16+
17+
// prettier-ignore
18+
export default withDoc({
19+
title: 'Updating Now CLI',
20+
date: '20 Jan 2018 11:34 AM PDT',
21+
authors: [ leo ],
22+
})(markdown(components)`
23+
24+
If there is a new release
25+
of [Now CLI](https://zeit.co/download#now-cli) available, you will
26+
see a message similiar to this one appear in your terminal output:
27+
28+
${<TerminalOutput><span style={updateMessage}>UPDATE AVAILABLE</span> The latest version of Now CLI is 8.4.0</TerminalOutput>}
29+
30+
This indicates that it is time to update your local instance of
31+
Now CLI. To make this as easy as possible, we have put together this
32+
guide for you.
33+
34+
In order to know which action is the right one for you to take, you
35+
firstly need to ask yourself these questions:
36+
37+
## Is Now Desktop Installed and Running?
38+
39+
If that is the case, you do not need to do anything – other than
40+
ensuring this option is marked as enabled in [Now Desktop](/download):
41+
42+
${<Image
43+
src={`${IMAGE_ASSETS_URL}/blog/improved-cli-updates/update-option.png`}
44+
width={385}
45+
height={228}
46+
/>}
47+
48+
As long as that is the case, you will automatically receive
49+
the latest update for Now CLI once a new release comes out.
50+
51+
## Did You Install Now CLI Manually?
52+
53+
Firstly, you need to determine whether or not the instance
54+
of Now CLI intalled on your device is a [canary release](/blog/canary) or
55+
not by running this command:
56+
57+
${<TerminalInput>now --version</TerminalInput>}
58+
59+
If the output looks similiar to this (contains "canary", the exact version
60+
does not need to match), you can safely
61+
assume it is a canary release:
62+
63+
${<TerminalOutput>10.0.0-canary.14</TerminalOutput>}
64+
65+
Now that you know which release channel you are
66+
using, you can pick the right way to update depending
67+
on where you installed it from:
68+
69+
- [curl](#curl)
70+
- [npm](#npm)
71+
- [yarn](#yarn)
72+
73+
---
74+
75+
## curl
76+
77+
For the latest **stable update**, run this command:
78+
79+
${<TerminalInput>curl https://install.zeit.co -sSf | sh</TerminalInput>}
80+
81+
To get the latest **canary update**, however, run this:
82+
83+
${<TerminalInput>curl https://install.zeit.co/canary -sSf | sh</TerminalInput>}
84+
85+
## npm
86+
87+
For the latest **stable update**, run this command:
88+
89+
${<TerminalInput>npm install -g now</TerminalInput>}
90+
91+
To get the latest **canary update**, however, run this:
92+
93+
${<TerminalInput>npm install -g now@canary</TerminalInput>}
94+
95+
## yarn
96+
97+
For the latest **stable update**, run this command:
98+
99+
${<TerminalInput>yarn global add now</TerminalInput>}
100+
101+
To get the latest **canary update**, however, run this:
102+
103+
${<TerminalInput>yarn global add now@canary</TerminalInput>}
104+
`)
Loading

yarn.lock

+4-10
Original file line numberDiff line numberDiff line change
@@ -1732,15 +1732,9 @@ [email protected]:
17321732
version "1.1.1"
17331733
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
17341734

1735-
electron-releases@^2.1.0:
1736-
version "2.1.0"
1737-
resolved "https://registry.yarnpkg.com/electron-releases/-/electron-releases-2.1.0.tgz#c5614bf811f176ce3c836e368a0625782341fd4e"
1738-
17391735
electron-to-chromium@^1.3.30:
1740-
version "1.3.30"
1741-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.30.tgz#9666f532a64586651fc56a72513692e820d06a80"
1742-
dependencies:
1743-
electron-releases "^2.1.0"
1736+
version "1.3.31"
1737+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.31.tgz#00d832cba9fe2358652b0c48a8816c8e3a037e9f"
17441738

17451739
elegant-spinner@^1.0.1:
17461740
version "1.0.1"
@@ -4337,8 +4331,8 @@ range-parser@^1.0.3, range-parser@~1.2.0:
43374331
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e"
43384332

43394333
rc@^1.1.7:
4340-
version "1.2.3"
4341-
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.3.tgz#51575a900f8dd68381c710b4712c2154c3e2035b"
4334+
version "1.2.4"
4335+
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.4.tgz#a0f606caae2a3b862bbd0ef85482c0125b315fa3"
43424336
dependencies:
43434337
deep-extend "~0.4.0"
43444338
ini "~1.3.0"

0 commit comments

Comments
 (0)