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
After setup, either serve the samples and demos or develop locally, as
149
+
described below.
150
+
151
+
#### Serve samples and demos
152
+
153
+
Serve the repository to view samples and demos through
154
+
`http://localhost:8080/`:
155
+
156
+
```bash
157
+
# Serve the repository on http://localhost:8080
158
+
npm run serve
159
+
```
160
+
161
+
#### Develop locally
146
162
147
-
# Build xrblocks.js.
148
-
npm run build
163
+
For active SDK development, run watch mode and local serving together:
149
164
150
-
# After making changes, check ESLint and run Prettier
165
+
```bash
166
+
# Build the SDK in watch mode and serve the repository on http://localhost:8080
167
+
npm run dev
168
+
```
169
+
170
+
#### Linting and formatting
171
+
172
+
XR Blocks uses ESLint for linting and Prettier for formatting. Run the
173
+
following commands to check your code before submitting a pull request:
174
+
175
+
```bash
151
176
npm run lint # ESLint check
152
177
npm run format # Prettier format
153
178
```
154
179
155
-
XR Blocks uses ESLint for linting and Prettier for formatting.
156
-
If coding in VSCode, make sure to install the [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and the [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode). Then set Prettier as your default formatter.
Copy file name to clipboardExpand all lines: docs/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,18 +8,18 @@ This website is built using [Docusaurus](https://docusaurus.io/).
8
8
Start the development server for the documentation:
9
9
10
10
```bash
11
-
# In the xrblocks/docs folder:
11
+
# In the xrblocks/docs/ directory
12
12
npm start
13
13
```
14
14
15
-
For templates and samples in the documentation site to be loaded, a web server needs to be started in the `xrblocks` folder:
15
+
This serves the documentation site locally at `http://localhost:3000/` and
16
+
watches for changes to the documentation source files.
16
17
17
-
```bash
18
-
# In the xrblocks folder:
19
-
npm run build
20
-
http-server --cors
21
-
```
18
+
When viewing docs pages that embed templates or samples, **also** follow the
19
+
[development guide](../README.md#development-guide) in the root README to serve
20
+
the SDK on port 8080. Both servers can run simultaneously.
22
21
23
22
## Deployment
24
23
25
-
The documentation site is automatically deployed to https://xrblocks.github.io/docs/ whenever it is updated in the [google/xrblocks](https://github.com/google/xrblocks) repository.
24
+
The documentation site is automatically deployed to https://xrblocks.github.io/docs/
25
+
whenever it is updated in the [google/xrblocks](https://github.com/google/xrblocks) repository.
0 commit comments