Note: NPM v5 changed completely the way it builds local modules, breaking the Graylog web interface build. Please use Yarn instead of NPM v5.
- Install the requirements listed above
- Run
yarn install
- Run
yarn start
to build the project for development and start the development server. You can exclude any Graylog frontend plugins from the build by runningdisable_plugins=true npm start
instead - Open http://localhost:8080 in your browser to access the Graylog web interface
The yarn start
(or disable_plugins=true yarn start
) command will run an Express web server which is configured to do a full page reload in your browser every time that you save a file. This ensures that you will always use the latest version of your code.
You can start the development server in any other port that you like. To do so, use the --port=<port>
option, e.g. yarn start --port=8000
will start the development server in port 8000 instead of the default 8080. The server will also pick a random port if the port is already taken, so you don't need to worry if another process is already using that port.
We mainly develop using IntelliJ or WebStorm. If you also decide to use them to work in Graylog, enable React JSX
as Javascript language version to support the JSX language extension. This setting was called JSX harmony
before, and it is available in one or the other form since IntelliJ 14 and WebStorm 9.
-
Update a single dependency
- Run
yarn upgrade <package>@<version>
- Commit any changes in both
package.json
andyarn.lock
files - Do any changes required to adapt the code to the upgraded modules
- Run
-
Update many dependencies
- It may be dangerous updating many dependencies at the same time, so be sure you checked the upgrade notes of all modules before getting started. Once you are ready to upgrade the modules, Yarn provides a few options to do it:
- You can pass all packages you want to upgrade to Yarn:
yarn upgrade <package1> <package2>...
- Yarn also supports upgrading packages matching a pattern, so you can execute
yarn upgrade --pattern <pattern>
- You could execute
yarn upgrade
if you really want to upgrade all packages
- You can pass all packages you want to upgrade to Yarn:
- After doing the upgrade, remember to commit both the
package.json
andyarn.lock
files
- It may be dangerous updating many dependencies at the same time, so be sure you checked the upgrade notes of all modules before getting started. Once you are ready to upgrade the modules, Yarn provides a few options to do it: