You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 12, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ This is how we pull down your build environment variables and manage your addons
26
26
<summary>
27
27
<b>Pro tip: Aliasing commands</b>
28
28
</summary>
29
+
29
30
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:
30
31
31
32
```bash
@@ -39,18 +40,6 @@ alias ndx="netlify dev:exec "
39
40
40
41
</details>
41
42
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
-
54
43
## Using the beta
55
44
56
45
Currently the Netlify dev plugin is in private beta. You'll need to follow these steps to enable it:
@@ -97,14 +86,25 @@ COMMANDS
97
86
dev:exec Exec command
98
87
```
99
88
89
+
## Live Share
90
+
91
+
To share your ongoing dev session with a coworker, just run Netlify Dev with a `--live` flag:
92
+
93
+
```bash
94
+
netlify dev --live
95
+
```
96
+
97
+
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.
98
+
99
+
> 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.
100
+
100
101
## Project detection
101
102
102
-
Netlify Dev will attempt to detect the SSG or build command that you are using, and run these on your behalf, while adding other development utilities.
103
+
Netlify Dev will attempt to detect the SSG or build command that you are using, and run these on your behalf, while adding other development utilities. If you have a JavaScript project, it looks for the best `package.json` script to run for you, using simple heuristics, so you can use the full flexibility of npm scripts. We may add more intelligence to this in future.
103
104
104
-
**Overriding the detectors**: The number of project types which Netlify Dev can detect is growing, but if yours is not yet supported automatically, you can instruct Netlify Dev to run the project on your behalf by declaring it in a `[dev]` block of your `netlify.toml` file.
105
+
**Overriding the detectors**: The number of [project types which Netlify Dev can detect](https://github.com/netlify/netlify-dev-plugin/tree/master/src/detectors) is growing, but if yours is not yet supported (contributions welcome!), you can instruct Netlify Dev to run the project on your behalf by declaring it in a `[dev]` block of your `netlify.toml` file.
105
106
106
107
```toml
107
-
108
108
#sample dev block in the toml
109
109
[dev]
110
110
command = "yarn start" # Command to start your dev server
@@ -114,13 +114,13 @@ Netlify Dev will attempt to detect the SSG or build command that you are using,
114
114
115
115
<details>
116
116
<summary>
117
-
<b>Explanation of detectors and ports in Netlify Dev</b>
117
+
<b>Explanation of ports in Netlify Dev</b>
118
118
</summary>
119
119
120
120
There will be a number of ports that you will encounter when using Netlify Dev, especially when running a static site generator like Gatsby which has its own dev server. All the port numbers can be a bit confusing, so here is a brief explainer.
121
121
122
122
- If your SSG has a devserver on port 8000 for example, Netlify Dev needs to be told to proxy that port so it can merge it in with the rest of the local Netlify environment (say, running on port 8888), which is what you want to get the full Netlify Dev experience with Functions, Redirects, and so on.
123
-
- If you're running a project we have a detector for, we hardcode those conventional ports so you don't have to supply it yourself.
123
+
- If you're running a project we have a detector for, we hardcode those conventional ports so you don't have to supply it yourself. If we have multiple detectors that match, we'll ask you to choose.
124
124
- However, sometimes you're using some other project (we welcome contributions for detectors!) or just have a custom port you want Netlify Dev to point to for some reason. This is when you go to the `netlify.toml` `[dev]` block to specify exactly what port we should listen to.
125
125
126
126
As for which port to use while doing local development in Netlify Dev, always look for this box in your console output and use that:
Copy file name to clipboardExpand all lines: src/detectors/README.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,3 +22,47 @@
22
22
- Dev block overrides will supercede anything you write in your detector: https://github.com/netlify/netlify-dev-plugin#project-detection
23
23
- detectors are language agnostic. don't assume npm or yarn.
24
24
- if default args (like 'develop') are missing, that means the user has configured it, best to tell them to use the -c flag.
25
+
26
+
## detector notes
27
+
28
+
- metalsmith is popular but has no dev story so we have skipped it
29
+
- hub press doesnt even have cli https://github.com/HubPress/hubpress.io#what-is-hubpress
30
+
- gitbook:
31
+
32
+
not sure if we want to support gitbook yet
33
+
34
+
requires a global install: https://github.com/GitbookIO/gitbook/blob/master/docs/setup.md
35
+
36
+
```js
37
+
const {
38
+
hasRequiredDeps,
39
+
hasRequiredFiles,
40
+
getYarnOrNPMCommand,
41
+
scanScripts
42
+
} =require("./utils/jsdetect");
43
+
module.exports=function() {
44
+
// REQUIRED FILES
45
+
if (!hasRequiredFiles(["README.md", "SUMMARY.md"])) returnfalse;
46
+
// // REQUIRED DEPS
47
+
// if (!hasRequiredDeps(["hexo"])) return false;
48
+
49
+
/** everything below now assumes that we are within gatsby */
0 commit comments