OED has many scripts to support its use for development and sometimes in production settings. These can be
run by executing npm run [SCRIPT]
in the web
docker compose
service
(e.g. docker compose run --rm web npm run [SCRIPT] [args]
).
For non-Docker installs (not normally the case and assumes you have npm on your system), simply issue
npm run [SCRIPT]
.
start
starts the NodeJS webserver.start:dev
starts the NodeJS webserver with Nodemon, so it restarts automatically.webpack:dev
runs Webpack in development mode and dynamically rebuilding the client-side
application when files change.webpack:build
runs Webpack once in production mode.webpack
runs Webpack once in development mode.check
runs all the below non-test checks (that is, all static checks)check:header
ensures that there are no source files without MPL headers.check:typescript
ensures that there are no JavaScript source files in the TypeScript portion of
the project.check:types
runs the TypeScript compiler without emitting code (i.e. just checks for type
errors).check:lint
runs TSLint against the project to ensure style conformity.test
runs the automated test suite on the server.testsome <path to desired test file where can have multiple times>
runs the automated
test on the provided test file(s).Note many of these are described in more detail on the installation page.
createdb
creates the database schema in an uninitialized database. It will not update
the
schema.migratedb
should upgrade the database after upgrading the software to a new version.addMamacMeters
adds meters from a CSV file.updateMamacMeters
fetches new data from previously imported Mamac meters.refreshReadingViews
aggregates readings data in the database for daily graphing has the latest
data.refreshDailyReadingViews
same as refreshReadingViews but using newer names.refreshHourlyReadingViews
aggregates readings data in the database for hourly graphing has the
latest
data.refreshAllReadingViews
does both the refreshDailyReadingViews and refreshHourlyReadingViews.
createUser
creates a new user. If given no arguments, it is interactive; you can also
pass the
username and password as command line arguments. This is not normally used any more since the admin web page
allows adding/modifying users.editUser
edits the password of an existing user. This is not normally used any more since the
admin web page allows adding/modifying users.sendLogEmail
sends an email with the latest errors/warnings to the specified email.Developers interested in how to create the test data and related script should consult the testing page.