H5P-Nodejs-Library
  • README
  • Basic usage
    • Architecture
    • Integrating the core library
    • H5P Ajax Endpoints
    • Constructing H5PEditor
    • REST Example
  • Advanced usage
    • Authorization
    • User content state
    • Multiple user states per object
    • Impersonating users
    • Basic completion tracking
    • Localization
    • Cluster
    • Addons
    • Customization
    • Performance optimizations
    • Privacy
    • Forward proxy support
    • Security
  • NPM packages
    • h5p-mongos3
      • Mongo/S3 Content Storage
      • S3 Temporary File Storage
      • Mongo Library Storage
      • Mongo/S3 Library Storage
    • h5p-webcomponents
    • h5p-react
    • h5p-redis-lock
    • h5p-svg-sanitizer
    • h5p-clamav-scanner
  • Development
    • Getting started
    • Testing & code quality
    • Core updates
    • Project Status
Powered by GitBook
On this page
  • Prerequisites
  • Installation for development purposes
  • Structure of the repository
  • Building the TypeScript files
  • Running the server-side-rendering example

Was this helpful?

  1. Development

Getting started

PreviousDevelopmentNextTesting & code quality

Last updated 2 months ago

Was this helpful?

Prerequisites

Make sure you have , >= 20, and 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).

Installation for development purposes

git clone https://github.com/lumieducation/h5p-nodejs-library
cd h5p-nodejs-library
npm install

This will install all dependencies in all packages, linking all cross-dependencies and downloads test dependencies such as the h5p core and editor library as well as content types.

Structure of the repository

This repository is a monorepo. A monorepo is one repository for several packages, which can be found in the packages/ folder. Each subfolder is its own package, published via . Packages are mostly self contained except for the following cases:

  • NPM modules needed for every package are located in the root package.json and node_module folder. For example, the testing framework and typescript are used in every package - therefore these are 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 respective package/<name>/test/data folder.

Building the TypeScript files

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

Running the server-side-rendering example

To start the server-side-rendering example run

npm start

and open http://localhost:8080 in your browser.

git
node
npm
NPM workspaces
npm
jest