Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit 5389aab

Browse files
Added scripts documentation. Enabled deployment of example to github pages and deployed it. Updated demo link in README, also updated TOC
1 parent 9631fad commit 5389aab

File tree

4 files changed

+135
-5
lines changed

4 files changed

+135
-5
lines changed

README.md

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ For those that haven't used or seen dat.GUI before, it's basically a GUI for upd
1111
- [Usage](#usage)
1212
- [Docs](#docs)
1313
* [`DatGui`](#datgui)
14+
+ [props](#props)
1415
* [Components](#components)
16+
+ [Common props](#common-props)
1517
+ [`DatBoolean`](#datboolean)
1618
+ [`DatButton`](#datbutton)
1719
+ [`DatColor`](#datcolor)
@@ -20,14 +22,26 @@ For those that haven't used or seen dat.GUI before, it's basically a GUI for upd
2022
+ [`DatPresets`](#datpresets)
2123
+ [`DatSelect`](#datselect)
2224
+ [`DatString`](#datstring)
25+
- [Scripts](#scripts)
26+
+ [`build`](#build)
27+
+ [`dev`](#dev)
28+
+ [`dev:migrate`](#devmigrate)
29+
+ [`dev:promote`](#devpromote)
30+
+ [`example`](#example)
31+
+ [`example:deploy`](#exampledeploy)
32+
+ [`test`](#test)
33+
+ [`test:watch`](#testwatch)
34+
+ [`lint`](#lint)
35+
+ [`lint:fix`](#lintfix)
36+
+ [`toc`](#toc)
2337
- [What's missing](#whats-missing)
2438
- [Roadmap](#roadmap)
2539

2640
## Demo
2741

28-
[Checkout the demo!](http://rohandeshpande.com/react-dat-gui)
42+
[Checkout the demo!](https://rohan-deshpande.github.io/react-dat-gui/)
2943

30-
The demo is a deployed version of the latest production build of `./example`.
44+
The demo is a deployed version of the latest production build of `./example`. There's also a `dev` directory where you can prototype changes to the source code easily. Both of these have been bootstrapped with `create-react-app`.
3145

3246
## Installation
3347

@@ -183,6 +197,54 @@ A select component for updating a value with one of the options supplied via the
183197

184198
A simple text input component that can be used to mutate strings.
185199

200+
## Scripts
201+
202+
There are a few NPM scripts in the root `package.json` for developing changes to the repo's source code as well as running tests and deploying the demo.
203+
204+
#### `build`
205+
206+
Builds the package for publishing.
207+
208+
#### `dev`
209+
210+
Runs the app in `./dev`.
211+
212+
#### `dev:migrate`
213+
214+
Migrates the code in `./src` to `./dev/src/react-dat-gui`. Handy for making sure you're developing with the latest source code.
215+
216+
#### `dev:promote`
217+
218+
Promotes the code in `./dev/src/react-dat-gui` back up to the root of the repo. Use this when you're happy with the changes you've been developing.
219+
220+
#### `example`
221+
222+
Runs the app in `./example`.
223+
224+
#### `example:deploy`
225+
226+
Deploys the production build of the app in `./example` to the `gh-pages` branch of this repo.
227+
228+
#### `test`
229+
230+
Runs unit tests.
231+
232+
#### `test:watch`
233+
234+
Runs unit tests and watches for changes.
235+
236+
#### `lint`
237+
238+
Runs `eslint` on the supplied path.
239+
240+
#### `lint:fix`
241+
242+
Runs `eslint --fix` on the supplied path.
243+
244+
#### `toc`
245+
246+
Prints the `README.md` table of contents into the console.
247+
186248
## What's missing
187249

188250
There are still a few features from the original implementation missing from this package. These are mainly related to saving and loading data as well as local storage. Animations for folder expanding/collapsing is also not currently implemented, but shouldn't be too hard to do.

example/package-lock.json

Lines changed: 61 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "react-dat-gui-example",
3+
"homepage": "https://rohan-deshpande.github.io/react-dat-gui",
34
"version": "0.1.0",
45
"private": true,
56
"dependencies": {
@@ -12,6 +13,11 @@
1213
"start": "react-scripts start",
1314
"build": "react-scripts build",
1415
"test": "react-scripts test --env=jsdom",
15-
"eject": "react-scripts eject"
16+
"eject": "react-scripts eject",
17+
"predeploy": "npm run build",
18+
"deploy": "gh-pages -d build"
19+
},
20+
"devDependencies": {
21+
"gh-pages": "^1.0.0"
1622
}
1723
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131
"dev:migrate": "sh scripts/dev-migrate && npm run dev",
3232
"dev:promote": "sh scripts/dev-promote && npm run build",
3333
"example": "npm run start --prefix example",
34+
"example:deploy": "npm run deploy --prefix example",
3435
"test": "mocha --compilers js:babel-core/register --colors ./test/*.spec.js",
3536
"test:watch": "mocha --compilers js:babel-core/register --colors -w ./test/*.spec.js",
3637
"lint": "eslint src test build",
37-
"lint:fix": "eslint --fix"
38+
"lint:fix": "eslint --fix",
39+
"toc": "markdown-toc README.md --no-firsth1 --maxdepth 3"
3840
},
3941
"dependencies": {
4042
"classnames": "2.2.5",

0 commit comments

Comments
 (0)