Skip to content

Commit 48f7071

Browse files
committed
docs: README: reorder sections
Put usage tips _after_ the start commands
1 parent abd7d08 commit 48f7071

File tree

1 file changed

+40
-36
lines changed

1 file changed

+40
-36
lines changed

README.md

+40-36
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,45 @@ can also install `webxdc-dev` in just your development project as a
2727

2828
## Usage
2929

30+
### Starting
31+
32+
#### Running a directory
33+
34+
In case you don't use bundling tooling and have a simple webxdc project where
35+
you have a directory that is zipped directly into a `.xdc` file, you can run it
36+
directly:
37+
38+
```shell
39+
webxdc-dev run /path/to/webxdc/project
40+
```
41+
42+
This may not be convenient or may not even work if you use tools like `vite` or
43+
`webpack-dev-server` though. For that, see below.
44+
45+
#### Running an .xdc file
46+
47+
You can run an `.xdc` file with the following command:
48+
49+
```shell
50+
webxdc-dev run /path/to/my.xdc
51+
```
52+
53+
#### With vite, webpack-dev-server, etc
54+
55+
It can be very useful to use a dev server that supports bundling and hot
56+
reloading, like `vite` or `webpack-dev-server`. In this case your
57+
project has a `package.json`.
58+
59+
You can run `webxdc-dev` against such a dev server directly. For instance if
60+
you have your project under development running on `http://localhost:3000`,
61+
this is how you can run it:
62+
63+
```shell
64+
webxdc-dev run http://localhost:3000
65+
```
66+
67+
### After starting
68+
3069
When you start `webxdc-dev`, it opens a browser window with the webxdc-dev UI.
3170
Two webxdc application instances are already running. You can start the
3271
instance in the embedded UI with the start button in each instance header. You
@@ -57,7 +96,7 @@ are running.
5796
The dev tool console shows messages with the same color prefix as the instance
5897
UIs.
5998

60-
### Clean state
99+
#### Clean state
61100

62101
Instances start with a clean slate: empty `localStorage` and `sessionStorage`.
63102
This means an instance may flash briefly with old state when it is opened for
@@ -66,41 +105,6 @@ the first time after startup.
66105
The UI also lets you clear the state with the `reset` button - this refreshes
67106
both server and client state, and is as if you restarted `webxdc-dev`.
68107

69-
### Running a directory
70-
71-
In case you don't use bundling tooling and have a simple webxdc project where
72-
you have a directory that is zipped directly into a `.xdc` file, you can run it
73-
directly:
74-
75-
```shell
76-
webxdc-dev run /path/to/webxdc/project
77-
```
78-
79-
This may not be convenient or may not even work if you use tools like `vite` or
80-
`webpack-dev-server` though. For that, see below.
81-
82-
### Running an .xdc file
83-
84-
You can run an `.xdc` file with the following command:
85-
86-
```shell
87-
webxdc-dev run /path/to/my.xdc
88-
```
89-
90-
### With vite, webpack-dev-server, etc
91-
92-
It can be very useful to use a dev server that supports bundling and hot
93-
reloading, like `vite` or `webpack-dev-server`. In this case your
94-
project has a `package.json`.
95-
96-
You can run `webxdc-dev` against such a dev server directly. For instance if
97-
you have your project under development running on `http://localhost:3000`,
98-
this is how you can run it:
99-
100-
```shell
101-
webxdc-dev run http://localhost:3000
102-
```
103-
104108
## Command-line options
105109

106110
### Controlling the port number with `-p`

0 commit comments

Comments
 (0)