Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 79387cd

Browse files
author
sw-yx
committed
cleanups to README
1 parent f93ee46 commit 79387cd

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ This is how we pull down your build environment variables and manage your addons
2222
- `netlify dev:exec <command>` runs a shell command within the netlify dev environment
2323
- `netlify functions:create` bootstrap a new function
2424

25+
<details>
26+
<summary>
27+
<b>Pro tip: Aliasing commands</b>
28+
</summary>
2529
As these commands are expected to be frequently used, it may be helpful to define aliases in your terminal (Mac: [bash](https://jonsuh.com/blog/bash-command-line-shortcuts/), [zsh](https://askubuntu.com/questions/758496/how-to-make-a-permanent-alias-in-oh-my-zsh), Windows: [doskey](https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt), [registry](https://stackoverflow.com/questions/20530996/aliases-in-windows-command-prompt)) to your personal preference. For example:
2630

2731
```bash
@@ -33,6 +37,20 @@ alias nfc="netlify functions:create"
3337
alias ndx="netlify dev:exec "
3438
```
3539

40+
</details>
41+
42+
## Live Share
43+
44+
To share your ongoing dev session with a coworker, just run Netlify Dev with a `--live` flag:
45+
46+
```bash
47+
netlify dev --live
48+
```
49+
50+
You will get a URL that looks like `https://clever-cray-2aa156-6639f3.netlify.live/`. This can be accessed by anyone as long as you keep your session open.
51+
52+
> Note: there are currently known issues with ending the live session alongside your webdevserver, as well as with live reloading. We are working on fixing it, and would appreciate repro cases. In the mean time you can run `ps aux | grep live-tunnel` and kill these sessions manually.
53+
3654
## Using the beta
3755

3856
Currently the Netlify dev plugin is in private beta. You'll need to follow these steps to enable it:
@@ -137,13 +155,16 @@ Netlify can also create serverless functions for you locally as part of Netlify
137155

138156
A number of function templates are available to get you started, and you can add your own utility functions to suit your own project development needs.
139157

140-
Create a new function
158+
**Create a new function**
141159

142160
```bash
143161
$ netlify functions:create
144162
```
145163

146-
More detailed usage examples:
164+
<details>
165+
<summary>
166+
<b>More detailed usage examples</b>
167+
</summary>
147168

148169
```bash
149170
# Create a new function from one of the
@@ -180,11 +201,15 @@ module.exports = {
180201
181202
Instead of using our basic templates, you can use your own by passing it with a --url flag: `netlify functions:create hello-world --url https://github.com/netlify-labs/all-the-functions/tree/master/functions/9-using-middleware`, specifying any addons and postinstall/complete steps as shown above.
182203
183-
#### Function Builders, Function Builder Detection, and Relationship with `netlify-lambda`
204+
</details>
205+
206+
### Function Builders, Function Builder Detection, and Relationship with `netlify-lambda`
207+
208+
**Existing users of `netlify-lambda` should have no change to their workflow by switching to `netlify dev`.** One immediate benefit is no need for [proxying](https://github.com/netlify/netlify-lambda#proxying-for-local-development) since Netlify Dev does that for you.
184209
185210
**Why Function Builders**
186211
187-
Notice that all the functions created and mentioned so far require no build step. This is intentional: we want to remain agnostic of build tooling and thereby create clear expectations: You give us a folder of functions, and we simply serve it (This is called [`zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it)). If you want to build that folder from a separate source folder, that is entirely under your control. Use whatever tool you like.
212+
Notice that all the functions created by `netlify functions:create` require no build step. This is intentional: we want to remain agnostic of build tooling and thereby create clear expectations: You give us a folder of functions, and we simply serve it (This is called [`zip-it-and-ship-it`](https://github.com/netlify/zip-it-and-ship-it)). If you want to build that folder from a separate source folder, that is entirely under your control. Use whatever tool you like.
188213
189214
This can be helpful, for example, to use ES modules syntax (e.g. `import`/`export`) via webpack, babel transforms via `babel-cli` or `babel-loader`, or strict type-checking and transpilation with TypeScript's `tsc` or other webpack loaders.
190215
@@ -202,18 +227,6 @@ Netlify Dev will watch `netlify-lambda`'s source folder and rebuild whenever the
202227
203228
We may offer detection for more function builders in future, and also let you specify function build commands in the `netlify.toml` `[dev]` block. Please share your usecase with us if you are likely to need this.
204229
205-
## Live Share
206-
207-
To share your ongoing dev session with a coworker, just run Netlify Dev with a `--live` flag:
208-
209-
```bash
210-
netlify dev --live
211-
```
212-
213-
You will get a URL that looks like `https://clever-cray-2aa156-6639f3.netlify.live/`. This can be accessed by anyone as long as you keep your session open.
214-
215-
> Note: there are currently known issues with ending the live session alongside your webdevserver, as well as with live reloading. We are working on fixing it, and would appreciate repro cases. In the mean time you can run `ps aux | grep live-tunnel` and kill these sessions manually.
216-
217230
### Using Add-ons
218231
219232
Add-ons are a way for Netlify users to extend the functionality of their Jamstack site/app.
@@ -231,3 +244,5 @@ The above command will install the FaunaDB add-on and provision a noSQL database
231244
Or install this [one click example](https://github.com/netlify/fauna-one-click).
232245
233246
After you have installed an add-on, it will be visible with the `netlify addons:list` command inside your site's current working directory. You can use `netlify addons:delete $ADDONNAME` to delete your addon instance.
247+
248+
For now, it is important to include instructions to create addons for each member of your team, as there is no way to specify addons inside of `netlify.toml`. We are working on this.

0 commit comments

Comments
 (0)