Make sure you have git
, node
>= 10.16, and npm
installed. There might
be problems if you use yarn
as it doesn't use the package-lock.json
file and
you might get incorrect and untested dependencies.
Important: If you use Windows, you must use Bash (comes with Git for windows) as a command shell (otherwise scripts won't run).
git clone https://github.com/lumieducation/h5p-nodejs-library
cd h5p-nodejs-library
npm install
This will install all dependencies in all packages, run lerna's bootstrap command, linking all cross-dependencies and downloads test-dependencies such as the h5p core and editor library as well as content types.
This repository is a so called monorepo and is managed by
lerna. A monorepo is one repository for several
packages, which can be found in the packages/
folder. Each subfolder is its
own package, published via npm. Packages are mostly
self contained except for the following cases:
- node modules needed for every package are located in the root
package.json
andnode_module
folder. The jest testing framework andtypescript
are used in every package - therefore these are installed in the rootnode_module
folder and made accessible in every package. - data used for unit and integration tests that are required by more than one
package are located in
test/data
. Data used for only single packages is located in the respectivepackage/<name>/test/data
folder.
You must transpile the TypeScript files to ES5 for the project to work (the
TypeScript transpiler will be installed automatically if you run npm install
):
npm run build
To start the server-side-rendering example run
npm start
and open http://localhost:8080 in your browser.