mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 01:50:24 -05:00
switch from yarn to npm
This eases build setup. Where Yarn requires a separate package repository, npm is available in the standard one. yarn's package repository signature was recently expired, and apparently will expire again in a year. Avoid dealing with that. Fixes #110.
This commit is contained in:
@@ -111,6 +111,8 @@ To build the server, you will need the following C libraries installed:
|
||||
* [`ncursesw`](https://www.gnu.org/software/ncurses/), the UTF-8 version of
|
||||
the `ncurses` library.
|
||||
|
||||
To build the UI, you'll need [node and npm](https://nodejs.org/en/download/).
|
||||
|
||||
On recent Ubuntu or Raspbian Linux, the following command will install
|
||||
all non-Rust dependencies:
|
||||
|
||||
@@ -122,6 +124,7 @@ $ sudo apt-get install \
|
||||
libavutil-dev \
|
||||
libncurses-dev \
|
||||
libsqlite3-dev \
|
||||
npm \
|
||||
pkgconf \
|
||||
sqlite3 \
|
||||
tzdata
|
||||
@@ -131,15 +134,12 @@ On macOS with [Homebrew](https://brew.sh/) and Xcode installed, try the
|
||||
following command:
|
||||
|
||||
```
|
||||
$ brew install ffmpeg yarn
|
||||
$ brew install ffmpeg node
|
||||
```
|
||||
|
||||
Next, you need Rust 1.45+ and Cargo. The easiest way to install them is by
|
||||
following the instructions at [rustup.rs](https://www.rustup.rs/).
|
||||
|
||||
Finally, building the UI requires [yarn](https://yarnpkg.com/en/). (On macOS,
|
||||
the `brew` command above installs it for you. On Linux, follow yarn's guide.)
|
||||
|
||||
Once prerequisites are installed, you can build the server and find it in
|
||||
`target/release/moonfire-nvr`:
|
||||
|
||||
@@ -149,12 +149,12 @@ $ cargo test
|
||||
$ cargo build --release
|
||||
```
|
||||
|
||||
You can build the UI via `yarn` and find it in the `ui/dist` directory:
|
||||
You can build the UI via `npm` and find it in the `ui/dist` directory:
|
||||
|
||||
```
|
||||
$ cd ui
|
||||
$ yarn
|
||||
$ yarn build
|
||||
$ npm install
|
||||
$ npm run build
|
||||
```
|
||||
|
||||
### Running interactively straight from the working copy
|
||||
|
||||
@@ -21,7 +21,7 @@ this in the webpack documentation.
|
||||
Checkout the branch you want to work on and type
|
||||
|
||||
$ cd ui
|
||||
$ yarn start
|
||||
$ npm run start
|
||||
|
||||
This will pack and prepare a development setup. By default the development
|
||||
server that serves up the web page(s) will listen on
|
||||
@@ -55,7 +55,7 @@ as described
|
||||
Thus one could connect to a remote Moonfire NVR by specifying its URL as
|
||||
follows:
|
||||
|
||||
$ MOONFIRE_URL=https://nvr.example.com/ yarn start
|
||||
$ MOONFIRE_URL=https://nvr.example.com/ npm run start
|
||||
|
||||
This allows you to test a new UI against your stable, production Moonfire NVR
|
||||
installation with real data.
|
||||
@@ -64,7 +64,7 @@ The default `MOONFIRE_DEV_HOST` is suitable for connecting to the proxy server
|
||||
from a browser running on the same machine. If you want your server to be
|
||||
externally accessible, you may want to bind to `0.0.0.0` instead:
|
||||
|
||||
$ MOONFIRE_DEV_HOST=0.0.0.0 yarn start
|
||||
$ MOONFIRE_DEV_HOST=0.0.0.0 npm run start
|
||||
|
||||
Be careful, though: it's insecure to send your production credentials over a
|
||||
non-`https` connection, as described more below.
|
||||
|
||||
Reference in New Issue
Block a user