Skip to content

Commit 67e9606

Browse files
committed
Reduce the number of terminals required to build riot-web to 1
A step towards a real solution for #7305 This approach makes use of `npm link` to remove the use of symlinks in the build process. The build process has also been altered to invoke the build process of each underlying SDK (react, js). This means that one can now `npm link` and `npm start` and have a working environment. At the same time, parallelshell was dropped due to lack of maintenance from the maintainer.
1 parent e58ac74 commit 67e9606

File tree

5 files changed

+2675
-2199
lines changed

5 files changed

+2675
-2199
lines changed

README.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ Building From Source
6464
Riot is a modular webapp built with modern ES6 and requires a npm build system
6565
to build.
6666

67-
1. Install or update `node.js` so that your `node` is at least v6.3.0 (and `npm`
68-
is at least v3.10.x).
67+
1. Install or update `node.js` so that your `node` is at least v8.12.0 (and `npm`
68+
is at least v5.x).
6969
1. Clone the repo: `git clone https://github.com/vector-im/riot-web.git`.
7070
1. Switch to the riot-web directory: `cd riot-web`.
71-
1. If you're using the `develop` branch, install the develop versions of the
72-
dependencies, as the released ones will be too old:
71+
1. If you're using the `develop` branch then it is recommended to set up a proper
72+
development environment ("Setting up a dev environment" below) however one can
73+
install the develop versions of the dependencies instead:
7374
```
7475
scripts/fetch-develop.deps.sh
7576
```
@@ -89,13 +90,9 @@ to build.
8990
npm install
9091
npm run build
9192
```
92-
However, we recommend setting up a proper development environment (see "Setting
93-
up a dev environment" below) if you want to run your own copy of the
94-
`develop` branch, as it makes it much easier to keep these dependencies
95-
up-to-date. Or just use https://riot.im/develop - the continuous integration
96-
release of the develop branch.
97-
(Note that we don't reference the develop versions in git directly due to
98-
https://github.com/npm/npm/issues/3055.)
93+
Or just use https://riot.im/develop - the continuous integration release of the
94+
develop branch. (Note that we don't reference the develop versions in git directly
95+
due to https://github.com/npm/npm/issues/3055.)
9996
1. Install the prerequisites: `npm install`.
10097
1. Configure the app by copying `config.sample.json` to `config.json` and
10198
modifying it (see below for details).
@@ -239,7 +236,7 @@ higher and lower level React components useful for building Matrix communication
239236
apps using React.
240237

241238
After creating a new component you must run `npm run reskindex` to regenerate
242-
the `component-index.js` for the app (used in future for skinning)
239+
the `component-index.js` for the app (used in future for skinning).
243240

244241
Please note that Riot is intended to run correctly without access to the public
245242
internet. So please don't depend on resources (JS libs, CSS, images, fonts)
@@ -256,20 +253,17 @@ having to manually rebuild each time.
256253

257254
First clone and build `matrix-js-sdk`:
258255

259-
1. `git clone git@github.com:matrix-org/matrix-js-sdk.git`
256+
1. `git clone https://github.com/matrix-org/matrix-js-sdk.git`
260257
1. `pushd matrix-js-sdk`
261258
1. `git checkout develop`
262-
1. `npm install`
263-
1. `npm install source-map-loader` # because webpack is made of fail (https://github.com/webpack/webpack/issues/1472)
264259
1. `popd`
265260

266261
Then similarly with `matrix-react-sdk`:
267262

268-
1. `git clone git@github.com:matrix-org/matrix-react-sdk.git`
263+
1. `git clone https://github.com/matrix-org/matrix-react-sdk.git`
269264
1. `pushd matrix-react-sdk`
270265
1. `git checkout develop`
271-
1. `npm install`
272-
1. `rm -r node_modules/matrix-js-sdk; ln -s ../../matrix-js-sdk node_modules/`
266+
1. `npm link ../matrix-js-sdk`
273267
1. `popd`
274268

275269
Finally, build and start Riot itself:
@@ -278,8 +272,8 @@ Finally, build and start Riot itself:
278272
1. `cd riot-web`
279273
1. `git checkout develop`
280274
1. `npm install`
281-
1. `rm -r node_modules/matrix-js-sdk; ln -s ../../matrix-js-sdk node_modules/`
282-
1. `rm -r node_modules/matrix-react-sdk; ln -s ../../matrix-react-sdk node_modules/`
275+
1. `npm link ../matrix-js-sdk`
276+
1. `npm link ../matrix-react-sdk`
283277
1. `npm start`
284278
1. Wait a few seconds for the initial build to finish; you should see something like:
285279
```
@@ -298,10 +292,8 @@ Finally, build and start Riot itself:
298292
disables caching, so do NOT use it in production.
299293
1. Open http://127.0.0.1:8080/ in your browser to see your newly built Riot.
300294
301-
When you make changes to `matrix-react-sdk` or `matrix-js-sdk`, you will need
302-
to run `npm run build` in the relevant directory. You can do this automatically
303-
by instead running `npm start` in the directory, to start a development builder
304-
which will watch for changes to the files and rebuild automatically.
295+
When you make changes to `matrix-react-sdk` or `matrix-js-sdk` they should be
296+
automatically picked up by webpack and built.
305297
306298
If you add or remove any components from the Riot skin, you will need to rebuild
307299
the skin's index by running, `npm run reskindex`.

0 commit comments

Comments
 (0)